Documentation
¶
Overview ¶
Package recording owns the versioned envelope, not native protocol semantics.
Index ¶
- Constants
- func EncodeFrame(f Frame) ([]byte, error)
- func EncodeReport(value any) ([]byte, error)
- func Hash(data []byte) string
- func ValidateManifest(data []byte, artifact string, content []byte) (rawjson.Value, error)
- type Direction
- type Document
- type Format
- type Frame
- type Limits
- type Manifest
- type NativeIdentity
- type Receipt
- type TransportReport
Constants ¶
const ( FormatName = "agent-mock-jsonl" FormatVersion = 1 Transport = "stdio-jsonl" )
Variables ¶
This section is empty.
Functions ¶
func EncodeFrame ¶
EncodeFrame emits one unified v1 JSONL envelope without reserializing Wire. Capture frames are protocol-only, epoch 1, without synthetic fault controls.
func EncodeReport ¶
EncodeReport is for tool-owned metadata only; native payloads use EncodeFrame.
func ValidateManifest ¶
ValidateManifest validates an explicitly supplied v1 format descriptor and the hash for one caller-selected artifact. Unknown outer metadata is preserved, including historical source paths. It never follows paths from a manifest. Legacy manifests without recordingFormat remain the external caller's concern.
Types ¶
type Document ¶
type Format ¶
type Format struct {
Name string `json:"name"`
Version int `json:"version"`
Transport string `json:"transport"`
}
func CurrentFormat ¶
func CurrentFormat() Format
type Frame ¶
type Frame struct {
Ordinal int64
Direction Direction
Channel string
Epoch int64
ElapsedMS int64
Wire rawjson.Value
Delay time.Duration
Disconnect bool
Raw rawjson.Value
}
Frame.Raw preserves the supplied envelope too. Wire is absent for synthetic disconnect actions; Delay is explicit injection, never inferred from ElapsedMS.
type Limits ¶
Limits are inclusive source/count bounds and an exclusive wire byte bound, matching the existing peer. Zero selects compatibility defaults when reading.
func DefaultLimits ¶
type NativeIdentity ¶
type NativeIdentity struct {
Transport string `json:"transport,omitempty"`
Executable string `json:"executable"`
SHA256 string `json:"sha256"`
Args []string `json:"args"`
CWD string `json:"cwd"`
Version string `json:"version,omitempty"`
}
NativeIdentity deliberately excludes environment values. Version is a caller assertion; capture hashes the resolved executable without invoking --version.
type Receipt ¶
type Receipt struct {
Version int `json:"version"`
Status string `json:"status"`
FullConsumption bool `json:"fullConsumption"`
NativeLaunched bool `json:"nativeLaunched"`
Peer string `json:"peer"`
Provider string `json:"provider"`
Frames int `json:"frames"`
RecordingSHA256 string `json:"recordingSHA256"`
ClientEOF bool `json:"clientEOF"`
CleanupComplete bool `json:"cleanupComplete"`
}
type TransportReport ¶
type TransportReport struct {
Target string `json:"target,omitempty"`
RemoteConnected bool `json:"remoteConnected,omitempty"`
RemoteClosed bool `json:"remoteClosed,omitempty"`
Version int `json:"version"`
CaptureStatus string `json:"captureStatus"`
Reason string `json:"reason"`
Frames int64 `json:"frames"`
ProtocolBytes int64 `json:"protocolBytes"`
StderrBytes int64 `json:"stderrBytes"`
Milliseconds int64 `json:"milliseconds"`
NativeLaunched bool `json:"nativeLaunched"`
NativeExitCode *int `json:"nativeExitCode"`
NativeSignal string `json:"nativeSignal,omitempty"`
ClientEOF bool `json:"clientEOF"` // Complete input reached EOF without a forwarding error.
StdinEOFAction string `json:"stdinEOFAction,omitempty"` // Actual successful close or interrupt, not configured policy.
StdinEOFSignal string `json:"stdinEOFSignal,omitempty"` // Signal successfully sent to the direct child.
Reaped bool `json:"reaped"`
CleanupComplete bool `json:"cleanupComplete"`
Error string `json:"error,omitempty"`
}