Documentation
¶
Overview ¶
Package sessionio provides harness-neutral access to coding-agent sessions.
Index ¶
- Constants
- Variables
- func ValidatePresenceSnapshot(snapshot PresenceSnapshot) error
- func WriteJSON(writer io.Writer, producer Producer, records []Record) error
- func WritePresenceJSON(writer io.Writer, producer Producer, snapshot PresenceSnapshot) error
- type Adapter
- type AdapterDescriptor
- type ByteRange
- type Capability
- type CapabilityStatus
- type CaptureKind
- type ContentAvailability
- type ContentBlock
- type ContentID
- type ContentKind
- type DatabaseKey
- type DatabaseLocator
- type Diagnostic
- type DiagnosticSeverity
- type DiscoveryRevision
- type Event
- type EventID
- type EventKind
- type EvidenceRef
- type Fact
- type FactEvent
- type FactKind
- type FileLocator
- type Harness
- type LimitationKind
- type ListingCache
- type ListingCacheSource
- type LocatorKind
- type MarkerEvent
- type MediaContent
- type MessageEvent
- type MessageRole
- type NDJSONEncoder
- type NativeAgentMetadata
- type NativeHistoryMetadata
- type NativeIdentity
- type NativeIdentityKind
- type NativeObservation
- type NativeRelationshipHint
- type NativeRelationshipKind
- type NativeRepresentation
- type NativeSessionMetadata
- type NextFunc
- type NodeKind
- type NodeRef
- type ObservationID
- type OccurrenceID
- type OpaqueContent
- type OpaqueLocator
- type Payload
- type PresenceCapability
- type PresenceCapabilityStatus
- type PresenceCertainty
- type PresenceEvidence
- type PresenceEvidenceKind
- type PresenceMatch
- type PresenceNDJSONEncoder
- type PresenceOccurrence
- type PresenceOccurrenceRelation
- type PresenceProviderStatus
- type PresenceReason
- type PresenceSelection
- type PresenceSelectionStatus
- type PresenceSnapshot
- type PresenceSupport
- type ProcessInstance
- type Producer
- type ReadItem
- type ReaderError
- type ReasoningEvent
- type Record
- type RecordKind
- type Registry
- type Relation
- type RelationID
- type RelationKind
- type RelationOrigin
- type Revision
- type RevisionKind
- type SessionID
- type SessionRef
- type SessionRequest
- type Source
- type SourceID
- type SourceKind
- type SourceLimitation
- type SourceLocator
- type SourceOccurrence
- type SourceStatus
- type Stream
- type SupportLevel
- type TextContent
- type ToolCallEvent
- type ToolResultEvent
- type ToolResultStatus
- type UnknownEvent
- type UnmatchedProcess
- type UsageEvent
Constants ¶
const PresenceSchema = "sessionio.presence/v1"
PresenceSchema identifies the runtime-presence machine-output schema.
const ReaderSchema = "sessionio.reader/v1"
ReaderSchema identifies the initial reader machine-output schema.
Variables ¶
var ErrStreamClosed = errors.New("sessionio: stream closed")
ErrStreamClosed is returned when Next is called after Close.
Functions ¶
func ValidatePresenceSnapshot ¶
func ValidatePresenceSnapshot(snapshot PresenceSnapshot) error
ValidatePresenceSnapshot validates a runtime-presence snapshot before use or encoding.
func WritePresenceJSON ¶
func WritePresenceJSON(writer io.Writer, producer Producer, snapshot PresenceSnapshot) error
WritePresenceJSON writes one validated presence snapshot followed by a newline.
Types ¶
type Adapter ¶
type Adapter interface {
Descriptor() AdapterDescriptor
Sources(context.Context) (Stream[Source], error)
Sessions(context.Context, SessionRequest) (Stream[SessionRef], error)
Read(context.Context, SessionRef) (Stream[ReadItem], error)
}
Adapter discovers and reads sessions for one harness.
type AdapterDescriptor ¶
type AdapterDescriptor struct {
Harness Harness `json:"harness"`
Version string `json:"version"`
Capabilities []CapabilityStatus `json:"capabilities"`
}
AdapterDescriptor declares an adapter's identity and capabilities.
type Capability ¶
type Capability string
Capability identifies a reader feature exposed by a source or adapter.
const ( CapabilityDiscovery Capability = "discovery" CapabilityMessages Capability = "messages" CapabilityRichContent Capability = "rich_content" CapabilityTools Capability = "tools" CapabilityReasoning Capability = "reasoning" CapabilityBranches Capability = "branches" CapabilityUsage Capability = "usage" CapabilityEnvironment Capability = "environment" CapabilityRepository Capability = "repository" CapabilityIncrementalReading Capability = "incremental_reading" )
type CapabilityStatus ¶
type CapabilityStatus struct {
Capability Capability `json:"capability"`
Support SupportLevel `json:"support"`
Detail string `json:"detail,omitempty"`
}
CapabilityStatus describes one capability.
type CaptureKind ¶
type CaptureKind string
CaptureKind distinguishes exact bytes from a logical structured snapshot.
const ( CaptureKindByteExact CaptureKind = "byte_exact" CaptureKindStructuredSnapshot CaptureKind = "structured_snapshot" CaptureKindDecodedStream CaptureKind = "decoded_stream" )
type ContentAvailability ¶
type ContentAvailability string
ContentAvailability describes why content is or is not directly readable.
const ( ContentAvailabilityAvailable ContentAvailability = "available" ContentAvailabilityEncrypted ContentAvailability = "encrypted" ContentAvailabilityRedacted ContentAvailability = "redacted" ContentAvailabilityExternal ContentAvailability = "external" )
type ContentBlock ¶
type ContentBlock struct {
ID ContentID `json:"id"`
Kind ContentKind `json:"kind"`
Availability ContentAvailability `json:"availability"`
Text *TextContent `json:"text,omitempty"`
Media *MediaContent `json:"media,omitempty"`
Opaque *OpaqueContent `json:"opaque,omitempty"`
}
ContentBlock is one typed message or reasoning content block.
type ContentKind ¶
type ContentKind string
ContentKind selects the active ContentBlock variant.
const ( ContentKindText ContentKind = "text" ContentKindMedia ContentKind = "media" ContentKindOpaque ContentKind = "opaque" )
type DatabaseKey ¶
DatabaseKey is one native database key component.
type DatabaseLocator ¶
type DatabaseLocator struct {
Path string `json:"path"`
Table string `json:"table"`
Keys []DatabaseKey `json:"keys,omitempty"`
}
DatabaseLocator identifies a row or event within a database.
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Severity DiagnosticSeverity `json:"severity"`
Message string `json:"message"`
Locator *SourceLocator `json:"locator,omitempty"`
Cause error `json:"-"`
}
Diagnostic reports a non-fatal source or capability condition.
type DiagnosticSeverity ¶
type DiagnosticSeverity string
DiagnosticSeverity identifies the impact of a reader diagnostic.
const ( DiagnosticSeverityInfo DiagnosticSeverity = "info" DiagnosticSeverityWarning DiagnosticSeverity = "warning" DiagnosticSeverityError DiagnosticSeverity = "error" )
type DiscoveryRevision ¶
type DiscoveryRevision string
DiscoveryRevision is an opaque, non-authoritative discovery change token.
type Event ¶
type Event struct {
ID EventID `json:"id"`
Kind EventKind `json:"kind"`
Timestamp *time.Time `json:"timestamp,omitempty"`
Evidence []EvidenceRef `json:"evidence"`
Message *MessageEvent `json:"message,omitempty"`
Reasoning *ReasoningEvent `json:"reasoning,omitempty"`
ToolCall *ToolCallEvent `json:"tool_call,omitempty"`
ToolResult *ToolResultEvent `json:"tool_result,omitempty"`
Usage *UsageEvent `json:"usage,omitempty"`
Facts *FactEvent `json:"facts,omitempty"`
Marker *MarkerEvent `json:"marker,omitempty"`
Unknown *UnknownEvent `json:"unknown,omitempty"`
}
Event is one normalized event backed by native evidence.
type EventKind ¶
type EventKind string
EventKind selects the active Event variant.
const ( EventKindMessage EventKind = "message" EventKindReasoning EventKind = "reasoning" EventKindToolCall EventKind = "tool_call" EventKindToolResult EventKind = "tool_result" EventKindUsage EventKind = "usage" EventKindFacts EventKind = "facts" EventKindMarker EventKind = "marker" EventKindUnknown EventKind = "unknown" )
type EvidenceRef ¶
type EvidenceRef struct {
Observation ObservationID `json:"observation"`
Locator SourceLocator `json:"locator"`
}
EvidenceRef points from normalized data to a native observation.
type FactEvent ¶
type FactEvent struct {
Facts []Fact `json:"facts"`
}
FactEvent contains normalized session facts.
type FactKind ¶
type FactKind string
FactKind identifies a normalized session fact.
const ( FactKindLaunchDirectory FactKind = "launch_directory" FactKindWorkingDirectory FactKind = "working_directory" FactKindModel FactKind = "model" FactKindProvider FactKind = "provider" FactKindEffort FactKind = "effort" FactKindGitRoot FactKind = "git_root" FactKindGitRemote FactKind = "git_remote" FactKindGitBranch FactKind = "git_branch" FactKindGitCommit FactKind = "git_commit" FactKindApprovalPolicy FactKind = "approval_policy" FactKindSandboxPolicy FactKind = "sandbox_policy" FactKindTimezone FactKind = "timezone" FactKindCurrentDate FactKind = "current_date" )
type FileLocator ¶
type FileLocator struct {
Root string `json:"root"`
Path string `json:"path"`
Record *uint64 `json:"record,omitempty"`
Line *uint64 `json:"line,omitempty"`
ByteRange *ByteRange `json:"byte_range,omitempty"`
}
FileLocator identifies a record or byte range within a root-relative file.
type LimitationKind ¶
type LimitationKind string
LimitationKind identifies missing fidelity in the upstream source.
const ( LimitationKindUpstreamTruncation LimitationKind = "upstream_truncation" LimitationKindExternalPayload LimitationKind = "external_payload" LimitationKindMissingExternalPayload LimitationKind = "missing_external_payload" LimitationKindMutableMaterialization LimitationKind = "mutable_materialization" )
type ListingCache ¶ added in v0.2.0
type ListingCache interface {
// Lookup returns the retained listing record for key while stamp matches.
Lookup(key string, stamp string) (SessionRef, bool)
// Retain stores the listing record that key produced under stamp.
Retain(key string, stamp string, ref SessionRef)
}
ListingCache is an advisory per-source cache of session listing records. It never changes what an adapter lists: a miss, a changed stamp, or an unusable cache only costs the source read that produced the record before.
The stamp is opaque to the cache and is built by the adapter from the size, modification time, and file identity of every container the listing record was read from.
type ListingCacheSource ¶ added in v0.2.0
type ListingCacheSource interface {
ListingCache(sourceID string) (ListingCache, bool)
}
ListingCacheSource hands an adapter the advisory cache of one source. An adapter resolves its own source identity, so the cache file of one source never serves another.
type LocatorKind ¶
type LocatorKind string
LocatorKind selects the active SourceLocator variant.
const ( LocatorKindFile LocatorKind = "file" LocatorKindDatabase LocatorKind = "database" LocatorKindOpaque LocatorKind = "opaque" )
type MarkerEvent ¶
MarkerEvent preserves an operational or structural native marker.
type MediaContent ¶
type MediaContent struct {
MediaType string `json:"media_type,omitempty"`
Data []byte `json:"data,omitempty"`
Reference string `json:"reference,omitempty"`
}
MediaContent contains inline or externally referenced media.
type MessageEvent ¶
type MessageEvent struct {
Role MessageRole `json:"role"`
Content []ContentBlock `json:"content,omitempty"`
}
MessageEvent contains ordered native message content.
type MessageRole ¶
type MessageRole string
MessageRole identifies the native conversational role.
const ( MessageRoleUser MessageRole = "user" MessageRoleAssistant MessageRole = "assistant" MessageRoleDeveloper MessageRole = "developer" MessageRoleSystem MessageRole = "system" MessageRoleTool MessageRole = "tool" MessageRoleUnknown MessageRole = "unknown" )
type NDJSONEncoder ¶
type NDJSONEncoder struct {
// contains filtered or unexported fields
}
NDJSONEncoder writes independently decodable reader records.
func NewNDJSONEncoder ¶
func NewNDJSONEncoder(writer io.Writer, producer Producer) (*NDJSONEncoder, error)
NewNDJSONEncoder creates a validated NDJSON encoder.
func (*NDJSONEncoder) Encode ¶
func (encoder *NDJSONEncoder) Encode(record Record) error
Encode validates and writes one self-describing NDJSON record.
type NativeAgentMetadata ¶
type NativeHistoryMetadata ¶
type NativeIdentity ¶
type NativeIdentity struct {
Kind NativeIdentityKind `json:"kind"`
Value string `json:"value"`
}
type NativeIdentityKind ¶
type NativeIdentityKind string
NativeIdentityKind identifies one native session identity.
const NativeIdentityKindSession NativeIdentityKind = "session"
type NativeObservation ¶
type NativeObservation struct {
ID ObservationID `json:"id"`
NativeKind string `json:"native_kind"`
// NativeKey is the harness's own record identifier, empty where a harness
// has none. Sessionio stores and matches it but never interprets it.
NativeKey string `json:"native_key,omitempty"`
NativeVersion string `json:"native_version,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
Locator SourceLocator `json:"locator"`
Revision Revision `json:"revision"`
Representation NativeRepresentation `json:"representation"`
Limitations []SourceLimitation `json:"limitations,omitempty"`
}
NativeObservation is the smallest independently locatable native unit.
type NativeRelationshipHint ¶
type NativeRelationshipHint struct {
Kind NativeRelationshipKind `json:"kind"`
TargetNativeID string `json:"target_native_id"`
}
type NativeRelationshipKind ¶
type NativeRelationshipKind string
NativeRelationshipKind identifies a native session relationship hint.
const ( NativeRelationshipKindForkParent NativeRelationshipKind = "fork_parent" NativeRelationshipKindControlParent NativeRelationshipKind = "control_parent" )
type NativeRepresentation ¶
type NativeRepresentation struct {
Capture CaptureKind `json:"capture"`
Codec string `json:"codec,omitempty"`
MediaType string `json:"media_type"`
Data []byte `json:"data"`
Framing []byte `json:"framing,omitempty"`
}
NativeRepresentation preserves a source-native observation.
type NativeSessionMetadata ¶
type NativeSessionMetadata struct {
Identities []NativeIdentity `json:"identities,omitempty"`
Relationships []NativeRelationshipHint `json:"relationships,omitempty"`
Agent *NativeAgentMetadata `json:"agent,omitempty"`
History *NativeHistoryMetadata `json:"history,omitempty"`
}
NativeSessionMetadata preserves native identities and session topology.
type NodeKind ¶
type NodeKind string
NodeKind identifies the object addressed by a relation endpoint.
const ( NodeKindSession NodeKind = "session" NodeKindObservation NodeKind = "observation" NodeKindEvent NodeKind = "event" NodeKindContent NodeKind = "content" // NodeKindNativeRecord addresses a native record by its NativeKey, so a // relation can name a peer record without reading the peer source. NodeKindNativeRecord NodeKind = "native_record" )
type ObservationID ¶
type ObservationID string
ObservationID is an opaque source-native observation identifier.
type OccurrenceID ¶
type OccurrenceID string
OccurrenceID is an opaque source-occurrence identifier.
type OpaqueContent ¶
type OpaqueContent struct {
NativeType string `json:"native_type"`
MediaType string `json:"media_type,omitempty"`
Data []byte `json:"data,omitempty"`
}
OpaqueContent preserves a harness-specific content block.
type OpaqueLocator ¶
OpaqueLocator identifies a unit through an adapter-defined scheme.
type PresenceCapability ¶
type PresenceCapability string
PresenceCapability identifies a runtime-presence signal a provider can inspect.
const ( PresenceCapabilityExactMatch PresenceCapability = "exact_match" PresenceCapabilityProbableMatch PresenceCapability = "probable_match" )
type PresenceCapabilityStatus ¶
type PresenceCapabilityStatus struct {
Capability PresenceCapability `json:"capability"`
Support PresenceSupport `json:"support"`
Reason *PresenceReason `json:"reason,omitempty"`
Detail string `json:"detail,omitempty"`
}
PresenceCapabilityStatus reports one provider capability for one harness.
type PresenceCertainty ¶
type PresenceCertainty string
PresenceCertainty describes the strength of a runtime-to-session match.
const ( PresenceCertaintyExact PresenceCertainty = "exact" PresenceCertaintyProbable PresenceCertainty = "probable" )
type PresenceEvidence ¶
type PresenceEvidence struct {
Kind PresenceEvidenceKind `json:"kind"`
Certainty PresenceCertainty `json:"certainty"`
Detail string `json:"detail,omitempty"`
}
PresenceEvidence is a typed, non-secret observation supporting a presence result.
type PresenceEvidenceKind ¶
type PresenceEvidenceKind string
PresenceEvidenceKind identifies a non-secret runtime-presence observation.
const ( PresenceEvidenceProcessIdentity PresenceEvidenceKind = "process_identity" PresenceEvidenceNativeSessionRegistry PresenceEvidenceKind = "native_session_registry" PresenceEvidenceOpenSessionFile PresenceEvidenceKind = "open_session_file" PresenceEvidenceTerminalIdentity PresenceEvidenceKind = "terminal_identity" PresenceEvidenceTerminalBreadcrumb PresenceEvidenceKind = "terminal_breadcrumb" PresenceEvidenceLoopbackListener PresenceEvidenceKind = "loopback_listener" PresenceEvidenceHealthEndpoint PresenceEvidenceKind = "health_endpoint" PresenceEvidenceSessionStatus PresenceEvidenceKind = "session_status" )
type PresenceMatch ¶
type PresenceMatch struct {
Harness Harness `json:"harness"`
NativeSessionID string `json:"native_session_id"`
Certainty PresenceCertainty `json:"certainty"`
Occurrences []PresenceOccurrence `json:"occurrences"`
Selection PresenceSelection `json:"selection"`
Processes []ProcessInstance `json:"processes"`
Evidence []PresenceEvidence `json:"evidence"`
}
PresenceMatch groups runtime observations by harness and native session ID.
type PresenceNDJSONEncoder ¶
type PresenceNDJSONEncoder struct {
// contains filtered or unexported fields
}
PresenceNDJSONEncoder writes independently decodable presence snapshots.
func NewPresenceNDJSONEncoder ¶
func NewPresenceNDJSONEncoder(writer io.Writer, producer Producer) (*PresenceNDJSONEncoder, error)
NewPresenceNDJSONEncoder creates a validated presence NDJSON encoder.
func (*PresenceNDJSONEncoder) Encode ¶
func (encoder *PresenceNDJSONEncoder) Encode(snapshot PresenceSnapshot) error
Encode validates and writes one self-describing presence snapshot.
type PresenceOccurrence ¶
type PresenceOccurrence struct {
Session SessionRef `json:"session"`
Relation PresenceOccurrenceRelation `json:"relation"`
}
PresenceOccurrence attaches one persisted session occurrence to a native session match.
type PresenceOccurrenceRelation ¶
type PresenceOccurrenceRelation string
PresenceOccurrenceRelation describes how a persisted occurrence matches a native session.
const ( PresenceOccurrenceRelationExactLocator PresenceOccurrenceRelation = "exact_locator" PresenceOccurrenceRelationNativeIdentity PresenceOccurrenceRelation = "native_identity" )
type PresenceProviderStatus ¶
type PresenceProviderStatus struct {
Harness Harness `json:"harness"`
Version string `json:"version"`
Support PresenceSupport `json:"support"`
Reason *PresenceReason `json:"reason,omitempty"`
Detail string `json:"detail,omitempty"`
Capabilities []PresenceCapabilityStatus `json:"capabilities"`
}
PresenceProviderStatus reports a versioned runtime-presence provider for one harness.
type PresenceReason ¶
type PresenceReason string
PresenceReason explains a non-match or unavailable runtime-presence signal.
const ( PresenceReasonAccessDenied PresenceReason = "access_denied" PresenceReasonAuthenticationRequired PresenceReason = "authentication_required" PresenceReasonCrossEnvironment PresenceReason = "cross_environment" PresenceReasonInspectionFailed PresenceReason = "inspection_failed" PresenceReasonNoSessionIdentity PresenceReason = "no_session_identity" PresenceReasonPrerequisiteMissing PresenceReason = "prerequisite_missing" PresenceReasonProcessExited PresenceReason = "process_exited" PresenceReasonProviderUnsupported PresenceReason = "provider_unsupported" PresenceReasonStaleProcessIdentity PresenceReason = "stale_process_identity" PresenceReasonUnmatchedNativeIdentity PresenceReason = "unmatched_native_identity" )
type PresenceSelection ¶
type PresenceSelection struct {
Status PresenceSelectionStatus `json:"status"`
SessionID SessionID `json:"session_id,omitempty"`
}
PresenceSelection records the selected persisted occurrence, if resolution was possible.
type PresenceSelectionStatus ¶
type PresenceSelectionStatus string
PresenceSelectionStatus describes whether one persisted occurrence was selected.
const ( PresenceSelectionResolved PresenceSelectionStatus = "resolved" PresenceSelectionAmbiguous PresenceSelectionStatus = "ambiguous" )
type PresenceSnapshot ¶
type PresenceSnapshot struct {
ObservedAt time.Time `json:"observed_at"`
ExpiresAt time.Time `json:"expires_at"`
Providers []PresenceProviderStatus `json:"providers"`
Matches []PresenceMatch `json:"matches"`
UnmatchedProcesses []UnmatchedProcess `json:"unmatched_processes"`
}
PresenceSnapshot is one ephemeral, time-bounded runtime-presence observation.
type PresenceSupport ¶
type PresenceSupport string
PresenceSupport describes whether a runtime-presence signal is available.
const ( PresenceSupportSupported PresenceSupport = "supported" PresenceSupportUnsupported PresenceSupport = "unsupported" )
type ProcessInstance ¶
type ProcessInstance struct {
PID uint64 `json:"pid"`
StartedAt time.Time `json:"started_at"`
Evidence []PresenceEvidence `json:"evidence"`
}
ProcessInstance is a live process identity sampled with its start time.
type ReadItem ¶
type ReadItem struct {
Session SessionRef `json:"session"`
Observation NativeObservation `json:"observation"`
Events []Event `json:"events,omitempty"`
Relations []Relation `json:"relations,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}
ReadItem contains one native observation and its normalized projections.
type ReaderError ¶
type ReaderError struct {
Operation string
Harness Harness
AdapterVersion string
SessionID SessionID
Locator *SourceLocator
Err error
}
ReaderError adds reader context while preserving the underlying error.
func (*ReaderError) Error ¶
func (readerError *ReaderError) Error() string
func (*ReaderError) Unwrap ¶
func (readerError *ReaderError) Unwrap() error
Unwrap returns the underlying reader failure.
type ReasoningEvent ¶
type ReasoningEvent struct {
Content []ContentBlock `json:"content,omitempty"`
Summary []ContentBlock `json:"summary,omitempty"`
}
ReasoningEvent contains reasoning and any separately exposed summary.
type Record ¶
type Record struct {
Kind RecordKind `json:"kind"`
Source *Source `json:"source,omitempty"`
Session *SessionRef `json:"session,omitempty"`
ReadItem *ReadItem `json:"read_item,omitempty"`
Diagnostic *Diagnostic `json:"diagnostic,omitempty"`
}
Record is one validated reader machine-output record.
type RecordKind ¶
type RecordKind string
RecordKind selects the active Record variant.
const ( RecordKindSource RecordKind = "source" RecordKindSession RecordKind = "session" RecordKindReadItem RecordKind = "read_item" RecordKindDiagnostic RecordKind = "diagnostic" )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores one validated adapter per harness.
func NewRegistry ¶
NewRegistry creates a registry and validates every supplied adapter.
func (*Registry) Descriptors ¶
func (registry *Registry) Descriptors() []AdapterDescriptor
Descriptors returns descriptors ordered lexically by harness.
type Relation ¶
type Relation struct {
ID RelationID `json:"id"`
Kind RelationKind `json:"kind"`
From NodeRef `json:"from"`
To NodeRef `json:"to"`
Origin RelationOrigin `json:"origin"`
Evidence []EvidenceRef `json:"evidence"`
}
Relation links two typed nodes using native evidence.
type RelationKind ¶
type RelationKind string
RelationKind identifies a structural relation.
const ( RelationKindPrevious RelationKind = "previous" RelationKindNext RelationKind = "next" RelationKindReplyTo RelationKind = "reply_to" RelationKindBranchParent RelationKind = "branch_parent" RelationKindContains RelationKind = "contains" RelationKindToolPair RelationKind = "tool_pair" RelationKindMaterializes RelationKind = "materializes" RelationKindUpdates RelationKind = "updates" // RelationKindActiveLeaf identifies the source-selected leaf of a persisted branch tree. RelationKindActiveLeaf RelationKind = "active_leaf" )
type RelationOrigin ¶
type RelationOrigin string
RelationOrigin distinguishes native relations from deterministic projections.
const ( RelationOriginNative RelationOrigin = "native" RelationOriginDeterministic RelationOrigin = "deterministic" )
type Revision ¶
type Revision struct {
Kind RevisionKind `json:"kind"`
Value string `json:"value"`
}
Revision identifies the immutable source state used for a read.
type RevisionKind ¶
type RevisionKind string
RevisionKind identifies the source revision mechanism.
const ( RevisionKindFileSnapshot RevisionKind = "file_snapshot" RevisionKindDatabaseTransaction RevisionKind = "database_transaction" RevisionKindEventSequence RevisionKind = "event_sequence" RevisionKindOpaque RevisionKind = "opaque" )
type SessionRef ¶
type SessionRef struct {
ID SessionID `json:"id"`
NativeID string `json:"native_id"`
Title string `json:"title,omitempty"`
DiscoveryRevision DiscoveryRevision `json:"discovery_revision"`
Native NativeSessionMetadata `json:"native"`
Occurrence SourceOccurrence `json:"occurrence"`
StartedAt *time.Time `json:"started_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}
SessionRef identifies one native session within one source occurrence.
type SessionRequest ¶
type SessionRequest struct {
Sources []SourceID
}
SessionRequest filters session discovery by source.
type Source ¶
type Source struct {
ID SourceID `json:"id"`
Harness Harness `json:"harness"`
Kind SourceKind `json:"kind"`
Status SourceStatus `json:"status"`
Locator SourceLocator `json:"locator"`
Capabilities []CapabilityStatus `json:"capabilities,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}
Source describes one discovered native source.
type SourceKind ¶
type SourceKind string
SourceKind distinguishes canonical transcripts from auxiliary stores.
const ( SourceKindCanonical SourceKind = "canonical" SourceKindAuxiliary SourceKind = "auxiliary" )
type SourceLimitation ¶
type SourceLimitation struct {
Kind LimitationKind `json:"kind"`
Detail string `json:"detail,omitempty"`
}
SourceLimitation records a native-source fidelity limitation.
type SourceLocator ¶
type SourceLocator struct {
Kind LocatorKind `json:"kind"`
File *FileLocator `json:"file,omitempty"`
Database *DatabaseLocator `json:"database,omitempty"`
Opaque *OpaqueLocator `json:"opaque,omitempty"`
}
SourceLocator locates a source-native unit.
type SourceOccurrence ¶
type SourceOccurrence struct {
ID OccurrenceID `json:"id"`
SourceID SourceID `json:"source_id"`
Harness Harness `json:"harness"`
Locator SourceLocator `json:"locator"`
}
SourceOccurrence identifies one observed instance of a source.
type SourceStatus ¶
type SourceStatus string
SourceStatus describes whether a discovered source can be read.
const ( SourceStatusAvailable SourceStatus = "available" SourceStatusMissing SourceStatus = "missing" SourceStatusDisabled SourceStatus = "disabled" SourceStatusUnsupported SourceStatus = "unsupported" )
type SupportLevel ¶
type SupportLevel string
SupportLevel describes how completely a capability is implemented.
const ( SupportFull SupportLevel = "full" SupportPartial SupportLevel = "partial" SupportExperimental SupportLevel = "experimental" )
type TextContent ¶
type TextContent struct {
Text string `json:"text"`
}
TextContent contains a native text block.
type ToolCallEvent ¶
type ToolCallEvent struct {
CallID string `json:"call_id"`
Name string `json:"name"`
Input Payload `json:"input"`
}
ToolCallEvent contains one native tool invocation.
type ToolResultEvent ¶
type ToolResultEvent struct {
CallID string `json:"call_id"`
Status ToolResultStatus `json:"status"`
Output Payload `json:"output"`
}
ToolResultEvent contains one native tool result or state transition.
type ToolResultStatus ¶
type ToolResultStatus string
ToolResultStatus describes the state represented by a tool result.
const ( ToolResultStatusSuccess ToolResultStatus = "success" ToolResultStatusError ToolResultStatus = "error" ToolResultStatusPending ToolResultStatus = "pending" ToolResultStatusRunning ToolResultStatus = "running" ToolResultStatusUnknown ToolResultStatus = "unknown" )
type UnknownEvent ¶
type UnknownEvent struct {
NativeType string `json:"native_type"`
}
UnknownEvent preserves the type of an otherwise unknown native record.
type UnmatchedProcess ¶
type UnmatchedProcess struct {
Harness Harness `json:"harness"`
Process ProcessInstance `json:"process"`
ClaimedNativeIDs []string `json:"claimed_native_ids,omitempty"`
Reason PresenceReason `json:"reason"`
Evidence []PresenceEvidence `json:"evidence"`
}
UnmatchedProcess is a live harness process that was not assigned to a persisted session.
type UsageEvent ¶
type UsageEvent struct {
InputTokens *int64 `json:"input_tokens,omitempty"`
OutputTokens *int64 `json:"output_tokens,omitempty"`
ReasoningTokens *int64 `json:"reasoning_tokens,omitempty"`
CacheReadTokens *int64 `json:"cache_read_tokens,omitempty"`
CacheWriteTokens *int64 `json:"cache_write_tokens,omitempty"`
TotalTokens *int64 `json:"total_tokens,omitempty"`
}
UsageEvent contains normalized optional token counters.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
claude
Package claude reads Claude Code transcript JSONL files.
|
Package claude reads Claude Code transcript JSONL files. |
|
codex
Package codex reads Codex rollout JSONL files.
|
Package codex reads Codex rollout JSONL files. |
|
cmd
|
|
|
sessionio
command
|
|
|
internal
|
|
|
catalog
Package catalog owns the PostgreSQL search catalog and its typed failures.
|
Package catalog owns the PostgreSQL search catalog and its typed failures. |
|
config
Package config loads the versioned strict TOML configuration file.
|
Package config loads the versioned strict TOML configuration file. |
|
fileid
Package fileid produces a persistable file identity, so a later run can tell an in-place rewrite from an atomic replacement at the same path.
|
Package fileid produces a persistable file identity, so a later run can tell an in-place rewrite from an atomic replacement at the same path. |
|
passage
Package passage turns normalized reader items into deterministic passages and their searchable projections.
|
Package passage turns normalized reader items into deterministic passages and their searchable projections. |
|
readercache
Package readercache retains an advisory per-source listing cache, so a warm listing reopens no source container whose stat identity is unchanged.
|
Package readercache retains an advisory per-source listing cache, so a warm listing reopens no source container whose stat identity is unchanged. |