Documentation
¶
Overview ¶
Ports packages/agent/src/harness/prompt-templates.ts.
Ports packages/agent/src/harness/skills.ts.
Package harness holds the shared declarations of Pi's durable agent harness: tool, resource, stream-option, execution-environment, and shell-output contracts consumed by the session, execution, runtime, and utility packages beneath it.
Index ¶
- Constants
- Variables
- func AbortError(ctx Context) error
- func AwaitWithContext(ctx Context, done <-chan struct{}) error
- func ContextValue[T any](ctx Context, key ContextKey[T]) (T, bool)
- func ConvertToLlm(messages []agent.AgentMessage) []ai.Message
- func DecodeToolResultContent(raw []json.RawMessage) ([]ai.ToolResultMessageContent, error)
- func FormatPromptTemplateInvocation(template PromptTemplate, args []string) string
- func FormatSkillInvocation(skill Skill, additionalInstructions string) string
- func FormatSkillsForSystemPrompt(skills []Skill) string
- func LoadPromptTemplates(ctx context.Context, env ExecutionEnv, paths []string) ([]PromptTemplate, []PromptTemplateDiagnostic)
- func LoadSkills(ctx context.Context, env ExecutionEnv, dirs []string) ([]Skill, []SkillDiagnostic)
- func LoadSourcedPromptTemplates[S any](ctx context.Context, env ExecutionEnv, inputs []SourcedPath[S], ...) ([]SourcedPromptTemplate[S], []SourcedPromptTemplateDiagnostic[S], error)
- func LoadSourcedSkills[S any](ctx context.Context, env ExecutionEnv, inputs []SourcedPath[S], ...) ([]SourcedSkill[S], []SourcedSkillDiagnostic[S], error)
- func ParseCommandArgs(input string) []string
- func StartAiSpan[Result any](ctx Context, name string, attributes SpanAttributes, ...) (Result, error)
- func StartHarnessSpan[Result any](ctx Context, name string, attributes SpanAttributes, ...) (Result, error)
- func SubstituteArgs(content string, args []string) string
- func ValidateCompactionSettings(settings CompactionSettings) error
- func ValidateRetryPolicy(policy ai.RetryPolicy) error
- func ValidateToolNames(tools []AgentHarnessTool) error
- type AgentHarnessDeferredOption
- type AgentHarnessResources
- type AgentHarnessStreamOptions
- type AgentHarnessStreamOptionsPatch
- type AgentHarnessTool
- type AgentHarnessToolInvocation
- type AgentHarnessToolUpdateCallback
- type AgentHarnessToolUpdateOptions
- type AgentToolResult
- type AttributeValue
- type BranchSummaryError
- type BranchSummaryErrorCode
- type Closed
- type CompactionError
- type CompactionErrorCode
- type CompactionSettings
- type Context
- func BackgroundContext() Context
- func TODOContext() Context
- func WithAbortSignal(parent Context, signal Context) Context
- func WithCancel(parent Context) (Context, context.CancelCauseFunc)
- func WithContextValue[T any](parent Context, key ContextKey[T], value T) Context
- func WithTelemetryContext(ctx Context, telemetry TelemetryContext) Context
- func WithoutAbortSignal(parent Context) Context
- type ContextKey
- type CreateDirOptions
- type CreateTempFileOptions
- type ExecutionEnv
- type ExecutionError
- type ExecutionErrorCode
- type FieldPatch
- type FileError
- type FileErrorCode
- type FileInfo
- type FileKind
- type FileSystem
- type HarnessClosed
- type HarnessFault
- type InMemoryTelemetryContext
- type InvalidLane
- type InvalidMessage
- type InvalidNavigation
- type JsonValue
- type LaneBusy
- type MapPatch
- type NoActiveOperation
- type NoActiveRun
- type NothingToCompact
- type NothingToResume
- type OperationMismatch
- type PromptTemplate
- type PromptTemplateDiagnostic
- type ReadTextLinesOptions
- type RecordedTelemetryEvent
- type RecordedTelemetrySpan
- type RemoveOptions
- type Shell
- type ShellExecOptions
- type ShellExecResult
- type ShellOutputCaptureOptions
- type ShellOutputLimits
- type ShellOutputMetadata
- type ShellOutputRetention
- type ShellOutputTruncation
- type ShellOutputUpdate
- type ShellOutputView
- type Skill
- type SkillDiagnostic
- type SourcedPath
- type SourcedPromptTemplate
- type SourcedPromptTemplateDiagnostic
- type SourcedSkill
- type SourcedSkillDiagnostic
- type SpanAttributes
- type SpanOptions
- type SpanStatus
- type SpanStatusCode
- type SpanStatusError
- type TaggedError
- type TelemetryAttributeDefinition
- type TelemetryAttributeMetadata
- type TelemetryAttributeType
- type TelemetryContext
- type TelemetryDefinition
- type TelemetryDefinitions
- type TelemetryEventAttributeDefinition
- type TelemetryEventDefinition
- type TelemetryParentDefinition
- type TelemetrySchemaDefinition
- type TelemetrySpan
- type TelemetrySpanDefinition
- type TelemetryStartAttributeDefinition
- type TextLine
- type TextLineReader
- type UnknownSkill
- type UnknownTarget
- type UnknownTemplate
Constants ¶
const ( SpanStatusCodeOK = telemetry.SpanStatusCodeOK SpanStatusCodeError = telemetry.SpanStatusCodeError )
Span status codes.
const ( ToolReplayNever = "never" ToolReplaySafe = "safe" )
Tool replay policies for an effect whose durable intent exists but whose outcome is unknown.
const ( ShellOutputUpdateReplace = "replace" ShellOutputUpdateAppend = "append" ShellOutputUpdateSlide = "slide" ShellOutputUpdateMetadata = "metadata" )
Shell output update kinds.
Variables ¶
var AITelemetrySchema = TelemetrySchemaDefinition{Version: 1, Spans: TelemetryDefinitions[TelemetrySpanDefinition]{ {Name: "pi.ai.request", Definition: TelemetrySpanDefinition{ Description: "One logical request to an AI provider", Parents: TelemetryParentDefinition{Kind: "any"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.ai.operation", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Logical provider operation"}, Type: "string", Values: []AttributeValue{"stream", "fetch_deferred", "cancel_deferred", "generate_images"}}, Required: true}}, {Name: "pi.ai.provider", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Selected provider id"}, Type: "string"}, Required: true}}, {Name: "pi.ai.model", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Requested model id"}, Type: "string"}, Required: true}}, {Name: "pi.ai.api", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Provider API id"}, Type: "string"}, Required: true}}, {Name: "pi.ai.streaming", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether this operation returns a stream"}, Type: "boolean"}, Required: true}}, {Name: "pi.ai.deferred", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether the operation requests or participates in deferred execution"}, Type: "boolean"}, Required: false}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.ai.response.model", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Concrete response model"}, Type: "string"}}, {Name: "pi.ai.response.id", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Provider response id", Cardinality: "high"}, Type: "string"}}, {Name: "pi.ai.response.stop_reason", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Normalized terminal response reason"}, Type: "string", Values: []AttributeValue{"stop", "length", "tool_use", "error", "aborted", "deferred"}}}, {Name: "pi.ai.http.status_code", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Final HTTP status"}, Type: "number"}}, {Name: "pi.ai.usage.input_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported input tokens"}, Type: "number"}}, {Name: "pi.ai.usage.output_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported output tokens"}, Type: "number"}}, {Name: "pi.ai.usage.cache_read_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported cache-read tokens"}, Type: "number"}}, {Name: "pi.ai.usage.cache_write_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported cache-write tokens"}, Type: "number"}}, {Name: "pi.ai.usage.reasoning_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported reasoning tokens"}, Type: "number"}}, {Name: "pi.ai.usage.total_tokens", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported total tokens"}, Type: "number"}}, {Name: "pi.ai.usage.cost", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Reported total cost"}, Type: "number"}}, {Name: "pi.ai.stream.chunk_count", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Streamed update chunk count"}, Type: "number"}}, {Name: "pi.ai.stream.time_to_first_chunk_ms", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Elapsed milliseconds to first update chunk"}, Type: "number"}}, {Name: "pi.ai.error.type", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Provider or transport error class", Cardinality: "low"}, Type: "string"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The operation throws or returns an error result"}, }}, }}
AITelemetrySchema describes AI-request telemetry without enabling recording or export.
var AgentTelemetrySchemas = []TelemetrySchemaDefinition{AITelemetrySchema, HarnessTelemetrySchema}
AgentTelemetrySchemas combines the AI-request and harness span vocabularies in upstream order.
var DefaultRetryPolicy = ai.RetryPolicy{ Enabled: true, MaxRetries: 3, BaseDelayMs: 1_000, MaxAgentDelayMs: new(ai.DefaultMaxAgentRetryDelayMs), }
DefaultRetryPolicy is the harness default provider retry policy.
var HarnessTelemetrySchema = TelemetrySchemaDefinition{Version: 1, Spans: TelemetryDefinitions[TelemetrySpanDefinition]{ {Name: "pi.harness.run", Definition: TelemetrySpanDefinition{ Description: "One admitted in-process run invocation", Parents: TelemetryParentDefinition{Kind: "root_or_external"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.session.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Session id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.recovery", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether this invocation resumes durable work"}, Type: "boolean"}, Required: true}}, {Name: "pi.operation.kind", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Run operation kind"}, Type: "string", Values: []AttributeValue{"run"}}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.operation.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Run invocation outcome"}, Type: "string", Values: []AttributeValue{"completed", "aborted", "failed", "suspended"}}}, {Name: "pi.error.code", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Stable operation error code", Cardinality: "low"}, Type: "string"}}, {Name: "pi.error.type", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Low-cardinality operation error class", Cardinality: "low"}, Type: "string"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The run fails or throws"}, }}, {Name: "pi.harness.compaction", Definition: TelemetrySpanDefinition{ Description: "One admitted in-process manual compaction invocation", Parents: TelemetryParentDefinition{Kind: "root_or_external"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.session.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Session id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.recovery", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether this invocation resumes durable work"}, Type: "boolean"}, Required: true}}, {Name: "pi.operation.kind", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Compaction operation kind"}, Type: "string", Values: []AttributeValue{"compaction"}}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.operation.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Compaction invocation outcome"}, Type: "string", Values: []AttributeValue{"completed", "declined", "aborted", "failed"}}}, {Name: "pi.error.code", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Stable operation error code", Cardinality: "low"}, Type: "string"}}, {Name: "pi.error.type", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Low-cardinality operation error class", Cardinality: "low"}, Type: "string"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The compaction fails or throws"}, }}, {Name: "pi.harness.navigation", Definition: TelemetrySpanDefinition{ Description: "One admitted in-process navigation invocation", Parents: TelemetryParentDefinition{Kind: "root_or_external"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.session.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Session id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.recovery", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether this invocation resumes durable work"}, Type: "boolean"}, Required: true}}, {Name: "pi.operation.kind", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Navigation operation kind"}, Type: "string", Values: []AttributeValue{"navigation"}}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.operation.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Navigation invocation outcome"}, Type: "string", Values: []AttributeValue{"completed", "declined", "aborted", "failed"}}}, {Name: "pi.error.code", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Stable operation error code", Cardinality: "low"}, Type: "string"}}, {Name: "pi.error.type", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Low-cardinality operation error class", Cardinality: "low"}, Type: "string"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The navigation fails or throws"}, }}, {Name: "pi.harness.checkpoint", Definition: TelemetrySpanDefinition{ Description: "One run checkpoint", Parents: TelemetryParentDefinition{Kind: "spans", Spans: []string{"pi.harness.run"}}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.checkpoint.kind", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Checkpoint purpose"}, Type: "string", Values: []AttributeValue{"normal", "abort_reconcile"}}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{}, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "Checkpoint work throws"}, }}, {Name: "pi.harness.turn", Definition: TelemetrySpanDefinition{ Description: "One assistant response and its tool batch", Parents: TelemetryParentDefinition{Kind: "spans", Spans: []string{"pi.harness.run"}}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.turn.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Invocation-local turn id", Cardinality: "high"}, Type: "string"}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{}, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "Turn work throws"}, }}, {Name: "pi.harness.step", Definition: TelemetrySpanDefinition{ Description: "One durable retry attempt", Parents: TelemetryParentDefinition{Kind: "spans", Spans: []string{"pi.harness.turn", "pi.harness.checkpoint", "pi.harness.compaction", "pi.harness.navigation"}}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.step.kind", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Retryable step kind"}, Type: "string", Values: []AttributeValue{"assistant", "compaction", "branch_summary"}}, Required: true}}, {Name: "pi.step.attempt", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "One-based durable attempt number"}, Type: "number"}, Required: true}}, {Name: "pi.compaction.reason", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Compaction trigger"}, Type: "string", Values: []AttributeValue{"manual", "threshold", "overflow"}}, Required: false}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.step.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Attempt outcome"}, Type: "string", Values: []AttributeValue{"succeeded", "retry", "failed", "aborted", "deferred", "overflow"}}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The attempt retries, fails, or throws"}, }}, {Name: "pi.harness.tool", Definition: TelemetrySpanDefinition{ Description: "One raw phase-2 tool execution", Parents: TelemetryParentDefinition{Kind: "spans", Spans: []string{"pi.harness.turn", "pi.harness.run"}}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.turn.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Invocation-local live turn id", Cardinality: "high"}, Type: "string"}, Required: false}}, {Name: "pi.tool.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Tool name"}, Type: "string"}, Required: true}}, {Name: "pi.tool.call_id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Tool call id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.tool.replay", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Declared replay policy"}, Type: "string", Values: []AttributeValue{"never", "safe"}}, Required: true}}, {Name: "pi.tool.recovery", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether this is recovery execution"}, Type: "boolean"}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.tool.is_error", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Whether raw phase-2 execution returned an error"}, Type: "boolean"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "Raw phase-2 execution returns an error"}, }}, {Name: "pi.harness.hook", Definition: TelemetrySpanDefinition{ Description: "One registered hook handler invocation", Parents: TelemetryParentDefinition{Kind: "any"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id when accepted", Cardinality: "high"}, Type: "string"}, Required: false}}, {Name: "pi.hook.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Hook name"}, Type: "string", Values: []AttributeValue{"before_run", "before_drive", "before_run_end", "transform_context", "before_request", "before_payload", "after_response", "before_tool", "after_tool", "before_compaction", "before_navigation"}}, Required: true}}, {Name: "pi.hook.registration_id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Optional hook registration metadata"}, Type: "string"}, Required: false}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.hook.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Handler outcome"}, Type: "string", Values: []AttributeValue{"completed", "skipped", "blocked", "failed"}}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The handler throws"}, }}, {Name: "pi.harness.sleep", Definition: TelemetrySpanDefinition{ Description: "One retry delay", Parents: TelemetryParentDefinition{Kind: "spans", Spans: []string{"pi.harness.run", "pi.harness.compaction", "pi.harness.navigation", "pi.harness.turn", "pi.harness.checkpoint"}}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.sleep.delay_ms", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Requested delay in milliseconds"}, Type: "number"}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.sleep.outcome", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Delay outcome"}, Type: "string", Values: []AttributeValue{"elapsed", "aborted"}}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "Sleep work throws"}, }}, {Name: "pi.harness.event_handler", Definition: TelemetrySpanDefinition{ Description: "One passive event listener invocation", Parents: TelemetryParentDefinition{Kind: "any"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.event.type", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Delivered harness event type", Cardinality: "low"}, Type: "string", Values: []AttributeValue{"run_start", "run_resume", "run_suspend", "operation_abort", "run_end", "fault", "handler_error", "turn_start", "turn_end", "retry_scheduled", "retry_start", "retry_end", "message_start", "message_update", "message_end", "tool_start", "tool_update", "tool_end", "entry_added", "queue_update", "value_update", "config_update", "compaction_start", "compaction_end", "navigation_start", "navigation_end", "lane_created", "usage"}}, Required: true}}, {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name for lane-scoped events", Cardinality: "high"}, Type: "string"}, Required: false}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{}, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "The listener throws"}, }}, {Name: "pi.session.write", Definition: TelemetrySpanDefinition{ Description: "One committed session transaction", Parents: TelemetryParentDefinition{Kind: "any"}, StartAttributes: TelemetryDefinitions[TelemetryStartAttributeDefinition]{ {Name: "pi.session.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Session id", Cardinality: "high"}, Type: "string"}, Required: true}}, {Name: "pi.lane.name", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Lane name when supplied by the caller", Cardinality: "high"}, Type: "string"}, Required: false}}, {Name: "pi.operation.id", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Durable operation id when supplied by the caller", Cardinality: "high"}, Type: "string"}, Required: false}}, {Name: "pi.session.item_count", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Number of writes in the transaction"}, Type: "number"}, Required: true}}, {Name: "pi.session.item_kinds", Definition: TelemetryStartAttributeDefinition{TelemetryAttributeDefinition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Distinct write kinds in the transaction"}, Type: "string[]", ElementValues: []AttributeValue{"entry", "usage", "value", "list"}}, Required: true}}, }, EndAttributes: TelemetryDefinitions[TelemetryAttributeDefinition]{ {Name: "pi.session.first_seq", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "First committed sequence in the transaction"}, Type: "number"}}, {Name: "pi.session.last_seq", Definition: TelemetryAttributeDefinition{TelemetryAttributeMetadata: TelemetryAttributeMetadata{Description: "Last committed sequence in the transaction"}, Type: "number"}}, }, Status: struct { Default SpanStatusCode `json:"default"` ErrorWhen string `json:"errorWhen"` }{Default: "ok", ErrorWhen: "Storage rejects the transaction"}, }}, }}
HarnessTelemetrySchema describes harness telemetry without enabling recording or export.
var NoopTelemetryContext = telemetry.NoopTelemetryContext
NoopTelemetryContext is the shared telemetry context used when an application does not provide one (upstream NOOP_TELEMETRY_CONTEXT). It is also a span, so children started from it receive it again.
Functions ¶
func AbortError ¶
AbortError returns the error representing a context's abort reason (upstream abortError): the cancellation cause, which is context.Canceled or context.DeadlineExceeded when no explicit cause was supplied.
func AwaitWithContext ¶
AwaitWithContext observes done until it is closed or ctx is cancelled (upstream awaitWithContext). Cancellation returns only this waiter's abort error; it does not cancel the underlying work. If ctx is already cancelled the abort error is returned without observing done, like the upstream synchronous rejection. The underlying work's own result is carried by the caller (for example through a variable written before done is closed).
func ContextValue ¶
func ContextValue[T any](ctx Context, key ContextKey[T]) (T, bool)
ContextValue returns the value stored under key, reporting whether one is present (upstream Context.value, where undefined means absent).
func ConvertToLlm ¶
func ConvertToLlm(messages []agent.AgentMessage) []ai.Message
ConvertToLlm converts harness messages without normalizing failed assistants or synthesizing tool results. Provider normalization belongs to the request boundary. Ports packages/agent/src/harness/messages.ts (convertToLlm).
func DecodeToolResultContent ¶
func DecodeToolResultContent(raw []json.RawMessage) ([]ai.ToolResultMessageContent, error)
DecodeToolResultContent decodes a text/image content array.
func FormatPromptTemplateInvocation ¶
func FormatPromptTemplateInvocation(template PromptTemplate, args []string) string
FormatPromptTemplateInvocation expands a template with already parsed arguments.
func FormatSkillInvocation ¶
FormatSkillInvocation wraps a skill with its reference directory and optional additional instructions.
func FormatSkillsForSystemPrompt ¶
Ports packages/agent/src/harness/system-prompt.ts. FormatSkillsForSystemPrompt lists model-visible skills in resource order and XML-escapes their fields.
func LoadPromptTemplates ¶
func LoadPromptTemplates(ctx context.Context, env ExecutionEnv, paths []string) ([]PromptTemplate, []PromptTemplateDiagnostic)
LoadPromptTemplates reads explicit Markdown files and direct Markdown children of directories. It waits for each environment operation and reports read/parse failures without discarding valid siblings.
func LoadSkills ¶
func LoadSkills(ctx context.Context, env ExecutionEnv, dirs []string) ([]Skill, []SkillDiagnostic)
LoadSkills recursively discovers skills through the execution environment. SKILL.md takes precedence over descendants, root Markdown files require a description, and failures are returned as warnings without discarding valid siblings.
func LoadSourcedPromptTemplates ¶
func LoadSourcedPromptTemplates[S any](ctx context.Context, env ExecutionEnv, inputs []SourcedPath[S], mapper func(PromptTemplate, S, context.Context) (any, error)) ([]SourcedPromptTemplate[S], []SourcedPromptTemplateDiagnostic[S], error)
LoadSourcedPromptTemplates invokes mapper in load order and attaches each input's source to its templates and warnings. A nil mapper retains the base PromptTemplate. Mapping runs synchronously with the same caller context; a mapper error stops loading and is returned unchanged.
func LoadSourcedSkills ¶
func LoadSourcedSkills[S any](ctx context.Context, env ExecutionEnv, inputs []SourcedPath[S], mapper func(Skill, S, context.Context) (any, error)) ([]SourcedSkill[S], []SourcedSkillDiagnostic[S], error)
LoadSourcedSkills attaches input provenance to every skill and diagnostic. A nil mapper retains the base Skill; a mapper can return an application-specific value and runs in load order with the caller context. A mapper error stops loading and is returned unchanged.
func ParseCommandArgs ¶
ParseCommandArgs splits harness command arguments on spaces and tabs outside quotes. Unlike the coding-agent parser, unquoted newlines are ordinary characters in this upstream harness API.
func StartAiSpan ¶
func StartAiSpan[Result any](ctx Context, name string, attributes SpanAttributes, callback func(TelemetrySpan, Context) (Result, error)) (Result, error)
StartAiSpan invokes callback with an AI-request span and a derived context that parents nested telemetry to that span. It waits for callback and returns its result and error unchanged. Cancellation remains the callback's responsibility; the wrapper does not validate schema attributes or set span status.
func StartHarnessSpan ¶
func StartHarnessSpan[Result any](ctx Context, name string, attributes SpanAttributes, callback func(TelemetrySpan, Context) (Result, error)) (Result, error)
StartHarnessSpan invokes callback with a harness span and a derived context that parents nested telemetry to that span. It waits for callback and returns its result and error unchanged. Cancellation remains the callback's responsibility; the wrapper does not validate schema attributes or set span status.
func SubstituteArgs ¶
SubstituteArgs performs the harness's ordered positional, slice, ARGUMENTS and @ replacement passes. Inserted values participate in later passes, matching the harness rather than coding-agent's single-pass helper.
func ValidateCompactionSettings ¶
func ValidateCompactionSettings(settings CompactionSettings) error
ValidateCompactionSettings rejects token counts that are not finite non-negative safe integers.
func ValidateRetryPolicy ¶
func ValidateRetryPolicy(policy ai.RetryPolicy) error
ValidateRetryPolicy rejects retry counts and delays that are not finite non-negative safe integers, and a retry count whose attempt total would not remain safe.
func ValidateToolNames ¶
func ValidateToolNames(tools []AgentHarnessTool) error
ValidateToolNames rejects duplicate tool names.
Types ¶
type AgentHarnessDeferredOption ¶
type AgentHarnessDeferredOption = ai.DeferredOption
AgentHarnessDeferredOption is the curated deferred-generation request: JSON `true`/`false` or an object with an optional window.
type AgentHarnessResources ¶
type AgentHarnessResources struct {
PromptTemplates []PromptTemplate `json:"promptTemplates,omitempty"`
Skills []Skill `json:"skills,omitempty"`
}
AgentHarnessResources are the resources available to explicit invocation methods and system-prompt callbacks.
type AgentHarnessStreamOptions ¶
type AgentHarnessStreamOptions struct {
Transport ai.Transport `json:"transport,omitempty"`
TimeoutMs *int `json:"timeoutMs,omitempty"`
MaxRetries *int `json:"maxRetries,omitempty"`
MaxRetryDelayMs *int `json:"maxRetryDelayMs,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
// CacheRetention is "none", "short", "long", or empty when absent.
CacheRetention string `json:"cacheRetention,omitempty"`
Deferred *AgentHarnessDeferredOption `json:"deferred,omitempty"`
}
AgentHarnessStreamOptions are the curated provider request options owned by the harness and snapshotted per turn.
type AgentHarnessStreamOptionsPatch ¶
type AgentHarnessStreamOptionsPatch struct {
Transport FieldPatch[ai.Transport]
TimeoutMs FieldPatch[int]
MaxRetries FieldPatch[int]
MaxRetryDelayMs FieldPatch[int]
CacheRetention FieldPatch[string]
Deferred FieldPatch[AgentHarnessDeferredOption]
Headers MapPatch[string]
Metadata MapPatch[any]
}
AgentHarnessStreamOptionsPatch is a partial stream-options update returned by before_request hooks (upstream AgentHarnessStreamOptionsPatch).
type AgentHarnessTool ¶
type AgentHarnessTool struct {
ai.ToolSchema
Label string
// PrepareArguments is an optional compatibility shim applied to raw
// tool-call arguments before schema validation.
PrepareArguments func(args JsonValue) (JsonValue, error)
// Replay is ToolReplayNever, ToolReplaySafe, or empty (never).
Replay string
// ExecutionMode overrides the default sequential/parallel mode.
ExecutionMode agent.ToolExecutionMode
Execute func(ctx context.Context, toolCallID string, params map[string]JsonValue, onUpdate AgentHarnessToolUpdateCallback, toolContext any, invocation AgentHarnessToolInvocation) (AgentToolResult, error)
}
AgentHarnessTool is a tool executed by the harness with an application-defined tool context resolved for the current turn snapshot.
type AgentHarnessToolInvocation ¶
type AgentHarnessToolInvocation interface {
// InvocationID is the opaque session-unique id equal to the call's
// reserved result-entry id.
InvocationID() string
OperationID() string
TurnID() string
// GetMemo reads one invocation-scoped durable replay memo; ok is false
// when the memo is unset.
GetMemo(ctx context.Context, name string) (value JsonValue, ok bool, err error)
// SetMemo sets one invocation-scoped durable replay memo; a nil value
// deletes it.
SetMemo(ctx context.Context, name string, value *JsonValue) error
}
AgentHarnessToolInvocation is the stable harness identity for one logical tool call, unchanged during safe replay.
type AgentHarnessToolUpdateCallback ¶
type AgentHarnessToolUpdateCallback func(partialResult AgentToolResult, options AgentHarnessToolUpdateOptions)
AgentHarnessToolUpdateCallback is the synchronous full-snapshot progress callback supplied to harness-native tools.
type AgentHarnessToolUpdateOptions ¶
type AgentHarnessToolUpdateOptions struct {
// Checkpoint requests replacement of the invocation's durable recovery
// checkpoint.
Checkpoint bool
}
AgentHarnessToolUpdateOptions configures one live tool progress update.
type AgentToolResult ¶
type AgentToolResult struct {
Content []ai.ToolResultMessageContent `json:"content"`
Details JsonValue `json:"details,omitempty"`
Usage *ai.Usage `json:"usage,omitempty"`
Terminate *bool `json:"terminate,omitempty"`
}
AgentToolResult is the harness tool result wire shape: text or image content returned to the model, arbitrary details, optional usage, and an optional termination hint.
func (*AgentToolResult) UnmarshalJSON ¶
func (result *AgentToolResult) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the text/image content union.
type AttributeValue ¶
type AttributeValue = telemetry.AttributeValue
AttributeValue is a telemetry attribute value: string, number (int, int64 or float64), bool, or a slice of one of those (upstream AttributeValue).
type BranchSummaryError ¶
type BranchSummaryError struct {
Code BranchSummaryErrorCode
Message string
Cause error
}
BranchSummaryError is returned by branch summarization helpers.
func (*BranchSummaryError) Error ¶
func (err *BranchSummaryError) Error() string
func (*BranchSummaryError) Unwrap ¶
func (err *BranchSummaryError) Unwrap() error
type BranchSummaryErrorCode ¶
type BranchSummaryErrorCode string
BranchSummaryErrorCode is a stable branch-summary error code.
const ( BranchSummaryErrorAborted BranchSummaryErrorCode = "aborted" BranchSummaryErrorSummarizationFailed BranchSummaryErrorCode = "summarization_failed" )
type Closed ¶
type Closed struct {
Message string `json:"-"`
}
Closed reports a call made after the harness closed.
func (*Closed) MarshalJSON ¶
type CompactionError ¶
type CompactionError struct {
Code CompactionErrorCode
Message string
Cause error
}
CompactionError is returned by compaction helpers.
func (*CompactionError) Error ¶
func (err *CompactionError) Error() string
func (*CompactionError) Unwrap ¶
func (err *CompactionError) Unwrap() error
type CompactionErrorCode ¶
type CompactionErrorCode string
CompactionErrorCode is a stable compaction error code.
const ( CompactionErrorAborted CompactionErrorCode = "aborted" CompactionErrorSummarizationFailed CompactionErrorCode = "summarization_failed" )
type CompactionSettings ¶
type CompactionSettings struct {
Enabled bool `json:"enabled"`
ReserveTokens int `json:"reserveTokens"`
KeepRecentTokens int `json:"keepRecentTokens"`
}
CompactionSettings configures automatic compaction. It lives here rather than in the compaction package because session operation state embeds it and the compaction package depends on session entries.
type Context ¶
Context is the harness invocation context (upstream chord Context).
func BackgroundContext ¶
func BackgroundContext() Context
BackgroundContext is the root context with no values or cancellation (upstream BACKGROUND_CONTEXT).
func TODOContext ¶
func TODOContext() Context
TODOContext is the placeholder root context (upstream TODO_CONTEXT).
func WithAbortSignal ¶
WithAbortSignal derives a context cancelled by either the parent or the supplied signal (upstream withAbortSignal, which combines the two with AbortSignal.any). The signal is any context whose Done channel represents an abort, such as execution.Gate.Signal(). The derived context keeps the first cause: the parent's or the signal's, whichever aborted first. When the signal and parent are harness contexts (created by WithCancel or WithAbortSignal, possibly under value layers) the abort is visible synchronously, like AbortSignal.any; a signal already aborted aborts the derived context before this function returns. Other contexts propagate promptly through context.AfterFunc. The parent context remains unchanged. A nil signal returns the parent unchanged. When only the supplied signal can cancel, Done retains that signal's channel identity while values still come from the parent.
func WithCancel ¶
func WithCancel(parent Context) (Context, context.CancelCauseFunc)
WithCancel derives an independently cancellable child context (upstream withCancel). The cancel function records its cause as the abort reason; a nil cause records context.Canceled. Cancellation is visible synchronously to contexts combined with it through WithAbortSignal.
func WithContextValue ¶
func WithContextValue[T any](parent Context, key ContextKey[T], value T) Context
WithContextValue derives a context containing one additional or replaced value (upstream withContextValue). The parent is unchanged.
func WithTelemetryContext ¶
func WithTelemetryContext(ctx Context, telemetry TelemetryContext) Context
WithTelemetryContext derives a context whose telemetry children use the supplied parent or active span (upstream withTelemetryContext).
func WithoutAbortSignal ¶
WithoutAbortSignal derives a context retaining all values except caller cancellation (upstream withoutAbortSignal). Intended for mandatory cleanup and for drive passes that must outlive the caller's wait.
type ContextKey ¶
type ContextKey[T any] struct { // contains filtered or unexported fields }
ContextKey is a typed, identity-compared context key (upstream ContextKey<T>). Two keys created with the same description are distinct.
func CreateContextKey ¶
func CreateContextKey[T any](description string) ContextKey[T]
CreateContextKey returns a fresh typed key (upstream createContextKey).
func (ContextKey[T]) String ¶
func (key ContextKey[T]) String() string
String returns the key description, matching the upstream Symbol description.
type CreateDirOptions ¶
type CreateDirOptions struct {
Recursive *bool
}
CreateDirOptions configures FileSystem.CreateDir; Recursive defaults to true when nil.
type CreateTempFileOptions ¶
CreateTempFileOptions configures FileSystem.CreateTempFile.
type ExecutionEnv ¶
type ExecutionEnv interface {
FileSystem
Shell
}
ExecutionEnv is the filesystem and process execution environment used by the harness.
type ExecutionError ¶
type ExecutionError struct {
Code ExecutionErrorCode
Message string
Cause error
}
ExecutionError is returned by Shell.Exec.
func (*ExecutionError) Error ¶
func (err *ExecutionError) Error() string
func (*ExecutionError) Unwrap ¶
func (err *ExecutionError) Unwrap() error
type ExecutionErrorCode ¶
type ExecutionErrorCode string
ExecutionErrorCode is a stable, backend-independent execution error code.
const ( ExecutionErrorAborted ExecutionErrorCode = "aborted" ExecutionErrorTimeout ExecutionErrorCode = "timeout" ExecutionErrorSpawnError ExecutionErrorCode = "spawn_error" ExecutionErrorCallbackError ExecutionErrorCode = "callback_error" ExecutionErrorUnknown ExecutionErrorCode = "unknown" )
type FieldPatch ¶
FieldPatch is one optional patch field. Present=false leaves the field unchanged; Present with a nil Value deletes it (upstream `key: undefined`); Present with a Value sets it.
func DeleteField ¶
func DeleteField[T any]() FieldPatch[T]
DeleteField returns a patch that deletes a field.
func SetField ¶
func SetField[T any](value T) FieldPatch[T]
SetField returns a patch that sets a field.
type FileError ¶
type FileError struct {
Code FileErrorCode
Message string
// Path is the absolute addressed path associated with the failure, when
// available.
Path string
Cause error
}
FileError is returned by FileSystem operations.
type FileErrorCode ¶
type FileErrorCode string
FileErrorCode is a stable, backend-independent file error code.
const ( FileErrorAborted FileErrorCode = "aborted" FileErrorNotFound FileErrorCode = "not_found" FileErrorPermissionDenied FileErrorCode = "permission_denied" FileErrorNotDirectory FileErrorCode = "not_directory" FileErrorIsDirectory FileErrorCode = "is_directory" FileErrorInvalid FileErrorCode = "invalid" FileErrorNotSupported FileErrorCode = "not_supported" FileErrorUnknown FileErrorCode = "unknown" )
type FileInfo ¶
type FileInfo struct {
// Name is the basename of Path.
Name string `json:"name"`
// Path is the absolute, syntactically normalized addressed path; symlinks
// are not followed.
Path string `json:"path"`
Kind FileKind `json:"kind"`
Size int64 `json:"size"`
// MtimeMs is the modification time in milliseconds since the Unix epoch.
MtimeMs float64 `json:"mtimeMs"`
}
FileInfo is metadata for one filesystem object.
type FileKind ¶
type FileKind string
FileKind is the kind of addressed filesystem object; symlinks are not followed automatically.
type FileSystem ¶
type FileSystem interface {
Cwd() string
AbsolutePath(ctx context.Context, path string) (string, error)
JoinPath(ctx context.Context, parts []string) (string, error)
ReadTextFile(ctx context.Context, path string) (string, error)
OpenTextLineReader(ctx context.Context, path string) (TextLineReader, error)
ReadTextLines(ctx context.Context, path string, options *ReadTextLinesOptions) ([]string, error)
ReadBinaryFile(ctx context.Context, path string) ([]byte, error)
WriteFile(ctx context.Context, path string, content []byte) error
AppendFile(ctx context.Context, path string, content []byte) error
RenameFile(ctx context.Context, sourcePath, destinationPath string) error
FileInfo(ctx context.Context, path string) (FileInfo, error)
ListDir(ctx context.Context, path string) ([]FileInfo, error)
CanonicalPath(ctx context.Context, path string) (string, error)
Exists(ctx context.Context, path string) (bool, error)
CreateDir(ctx context.Context, path string, options *CreateDirOptions) error
Remove(ctx context.Context, path string, options *RemoveOptions) error
// CreateTempDir defaults prefix to "tmp-" when nil.
CreateTempDir(ctx context.Context, prefix *string) (string, error)
CreateTempFile(ctx context.Context, options *CreateTempFileOptions) (string, error)
// Cleanup releases resources; it is best-effort and never fails.
Cleanup(ctx context.Context)
}
FileSystem is the filesystem capability used by the harness. Paths may be absolute or relative to Cwd. Operations never panic; every failure, including unexpected backend failures, is a *FileError.
type HarnessClosed ¶
type HarnessClosed struct{}
HarnessClosed rejects work that was active when the harness closed.
func (*HarnessClosed) Error ¶
func (*HarnessClosed) Error() string
type HarnessFault ¶
HarnessFault closes the harness after a failed admitted storage commit or a throwing trusted computation.
func (*HarnessFault) Error ¶
func (err *HarnessFault) Error() string
func (*HarnessFault) Unwrap ¶
func (err *HarnessFault) Unwrap() error
type InMemoryTelemetryContext ¶
type InMemoryTelemetryContext = telemetry.InMemoryTelemetryContext
InMemoryTelemetryContext records backend-neutral spans in process memory.
type InvalidLane ¶
type InvalidLane laneReasonError
InvalidLane reports an invalid lane name or lane creation target.
func (*InvalidLane) Error ¶
func (err *InvalidLane) Error() string
func (*InvalidLane) MarshalJSON ¶
func (err *InvalidLane) MarshalJSON() ([]byte, error)
func (*InvalidLane) Tag ¶
func (*InvalidLane) Tag() string
type InvalidMessage ¶
type InvalidMessage laneReasonError
InvalidMessage reports an empty or invalid request message.
func (*InvalidMessage) Error ¶
func (err *InvalidMessage) Error() string
func (*InvalidMessage) MarshalJSON ¶
func (err *InvalidMessage) MarshalJSON() ([]byte, error)
func (*InvalidMessage) Tag ¶
func (*InvalidMessage) Tag() string
type InvalidNavigation ¶
type InvalidNavigation laneReasonError
InvalidNavigation reports an invalid navigation request.
func (*InvalidNavigation) Error ¶
func (err *InvalidNavigation) Error() string
func (*InvalidNavigation) MarshalJSON ¶
func (err *InvalidNavigation) MarshalJSON() ([]byte, error)
func (*InvalidNavigation) Tag ¶
func (*InvalidNavigation) Tag() string
type JsonValue ¶
type JsonValue = any
JsonValue is a strict JSON value: nil, bool, number, string, []any, or map[string]any.
type LaneBusy ¶
type LaneBusy struct {
Lane string `json:"lane"`
OperationID string `json:"operationId"`
OperationKind string `json:"operationKind"`
Message string `json:"-"`
}
LaneBusy reports that a lane already has a current operation.
func (*LaneBusy) MarshalJSON ¶
type MapPatch ¶
MapPatch patches a string-keyed map. Present=false leaves the map unchanged. Present with nil Entries clears the whole map (upstream `headers: undefined`). Present with non-nil Entries applies each entry: a nil value deletes the key, a non-nil value sets it. An empty non-nil Entries map is the upstream `{}` patch, which creates an empty map when none existed.
type NoActiveOperation ¶
type NoActiveOperation laneError
NoActiveOperation reports a lane without a current operation.
func (*NoActiveOperation) Error ¶
func (err *NoActiveOperation) Error() string
func (*NoActiveOperation) MarshalJSON ¶
func (err *NoActiveOperation) MarshalJSON() ([]byte, error)
func (*NoActiveOperation) Tag ¶
func (*NoActiveOperation) Tag() string
type NoActiveRun ¶
type NoActiveRun laneError
NoActiveRun reports a lane without a current run.
func (*NoActiveRun) Error ¶
func (err *NoActiveRun) Error() string
func (*NoActiveRun) MarshalJSON ¶
func (err *NoActiveRun) MarshalJSON() ([]byte, error)
func (*NoActiveRun) Tag ¶
func (*NoActiveRun) Tag() string
type NothingToCompact ¶
type NothingToCompact laneError
NothingToCompact reports a lane whose transcript has nothing to compact.
func (*NothingToCompact) Error ¶
func (err *NothingToCompact) Error() string
func (*NothingToCompact) MarshalJSON ¶
func (err *NothingToCompact) MarshalJSON() ([]byte, error)
func (*NothingToCompact) Tag ¶
func (*NothingToCompact) Tag() string
type NothingToResume ¶
type NothingToResume laneError
NothingToResume reports a lane without an operation to resume.
func (*NothingToResume) Error ¶
func (err *NothingToResume) Error() string
func (*NothingToResume) MarshalJSON ¶
func (err *NothingToResume) MarshalJSON() ([]byte, error)
func (*NothingToResume) Tag ¶
func (*NothingToResume) Tag() string
type OperationMismatch ¶
type OperationMismatch struct {
Lane string `json:"lane"`
ExpectedOperationID string `json:"expectedOperationId"`
CurrentOperationID *string `json:"currentOperationId,omitempty"`
LastOperationID *string `json:"lastOperationId,omitempty"`
Message string `json:"-"`
}
OperationMismatch reports an expected operation id that is not current.
func (*OperationMismatch) Error ¶
func (err *OperationMismatch) Error() string
func (*OperationMismatch) MarshalJSON ¶
func (err *OperationMismatch) MarshalJSON() ([]byte, error)
func (*OperationMismatch) Tag ¶
func (*OperationMismatch) Tag() string
type PromptTemplate ¶
type PromptTemplate struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Content string `json:"content"`
}
PromptTemplate can be formatted into a prompt for explicit invocation.
type PromptTemplateDiagnostic ¶
type PromptTemplateDiagnostic struct {
Type string `json:"type"`
Code string `json:"code"`
Message string `json:"message"`
Path string `json:"path"`
}
PromptTemplateDiagnostic is a warning from the environment or Markdown parser.
type ReadTextLinesOptions ¶
type ReadTextLinesOptions struct {
// MaxLines stops reading after this many lines when positive.
MaxLines *int
}
ReadTextLinesOptions bounds FileSystem.ReadTextLines.
type RecordedTelemetryEvent ¶
type RecordedTelemetryEvent = telemetry.RecordedTelemetryEvent
RecordedTelemetryEvent is a detached span-event snapshot.
type RecordedTelemetrySpan ¶
type RecordedTelemetrySpan = telemetry.RecordedTelemetrySpan
RecordedTelemetrySpan is a detached span snapshot.
type RemoveOptions ¶
RemoveOptions configures FileSystem.Remove; both default to false.
type Shell ¶
type Shell interface {
// Exec runs command in the environment cwd unless options.Cwd is set.
Exec(ctx context.Context, command string, options *ShellExecOptions) (ShellExecResult, error)
// Cleanup releases resources; it is best-effort and never fails.
Cleanup(ctx context.Context)
}
Shell is the shell execution capability used by the harness. Every failure is an *ExecutionError.
type ShellExecOptions ¶
type ShellExecOptions struct {
// Cwd defaults to the environment cwd; relative paths resolve against it.
Cwd string
// Env values override inherited defaults when InheritEnv is not false.
Env map[string]string
// InheritEnv defaults to true when nil.
InheritEnv *bool
// Timeout is in seconds; nil means no timeout.
Timeout *float64
// Capture requests bounded capture. Output is discarded when Capture and
// OnUpdate are both nil.
Capture *ShellOutputCaptureOptions
// OnUpdate receives bounded output changes. A returned error stops the
// command and fails Exec with a callback_error, as a throwing upstream
// callback does.
OnUpdate func(ctx context.Context, update ShellOutputUpdate) error
}
ShellExecOptions configures Shell.Exec.
type ShellExecResult ¶
type ShellExecResult struct {
ExitCode int `json:"exitCode"`
ShellOutputMetadata
}
ShellExecResult is a bounded shell completion. Output text is delivered through ShellExecOptions.OnUpdate.
type ShellOutputCaptureOptions ¶
type ShellOutputCaptureOptions struct {
Limits ShellOutputLimits `json:"limits"`
// Spill preserves complete output in an environment-local file after the
// limits are crossed.
Spill bool `json:"spill,omitempty"`
}
ShellOutputCaptureOptions request bounded capture.
type ShellOutputLimits ¶
type ShellOutputLimits struct {
MaxBytes int `json:"maxBytes"`
MaxLines int `json:"maxLines"`
// Retain defaults to tail when empty.
Retain ShellOutputRetention `json:"retain,omitempty"`
}
ShellOutputLimits are the source-side limits for one combined output view.
type ShellOutputMetadata ¶
type ShellOutputMetadata struct {
Truncation ShellOutputTruncation `json:"truncation"`
SpillPath string `json:"spillPath,omitempty"`
LastLineBytes *int `json:"lastLineBytes,omitempty"`
}
ShellOutputMetadata accompanies a bounded output view.
type ShellOutputRetention ¶
type ShellOutputRetention string
ShellOutputRetention selects which portion of bounded output survives.
const ( ShellOutputRetainHead ShellOutputRetention = "head" ShellOutputRetainTail ShellOutputRetention = "tail" )
type ShellOutputTruncation ¶
type ShellOutputTruncation struct {
Truncated bool `json:"truncated"`
// TruncatedBy is "lines", "bytes", or nil (JSON null) when not truncated.
TruncatedBy *string `json:"truncatedBy"`
TotalLines int `json:"totalLines"`
TotalBytes int `json:"totalBytes"`
OutputLines int `json:"outputLines"`
OutputBytes int `json:"outputBytes"`
LastLinePartial bool `json:"lastLinePartial"`
FirstLineExceedsLimit bool `json:"firstLineExceedsLimit"`
MaxLines int `json:"maxLines"`
MaxBytes int `json:"maxBytes"`
}
ShellOutputTruncation is truncation metadata without the retained text.
type ShellOutputUpdate ¶
type ShellOutputUpdate struct {
Kind string
Output ShellOutputView
Text string
Drop int
Metadata ShellOutputMetadata
}
ShellOutputUpdate is one incremental source-side change to a bounded view. Kind selects the populated fields: replace uses Output; append uses Text and Metadata; slide uses Drop, Text, and Metadata; metadata uses Metadata. Drop counts UTF-16 code units, as upstream string offsets do.
func (ShellOutputUpdate) MarshalJSON ¶
func (update ShellOutputUpdate) MarshalJSON() ([]byte, error)
MarshalJSON emits the kind-specific upstream wire shape.
func (*ShellOutputUpdate) UnmarshalJSON ¶
func (update *ShellOutputUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes any update kind.
type ShellOutputView ¶
type ShellOutputView struct {
Text string `json:"text"`
ShellOutputMetadata
}
ShellOutputView is one complete bounded output view.
type Skill ¶
type Skill struct {
Name string `json:"name"`
Description string `json:"description"`
Content string `json:"content"`
FilePath string `json:"filePath"`
// DisableModelInvocation excludes the skill from model-visible listings
// while still allowing explicit application invocation.
DisableModelInvocation bool `json:"disableModelInvocation,omitempty"`
}
Skill is loaded from a SKILL.md file or provided by an application. Name, Description, and FilePath are inserted into the system prompt.
type SkillDiagnostic ¶
type SkillDiagnostic = PromptTemplateDiagnostic
SkillDiagnostic is a warning from skill discovery or metadata validation.
type SourcedPath ¶
SourcedPath associates an application-owned provenance value with an input path.
type SourcedPromptTemplate ¶
type SourcedPromptTemplate[S any] struct { PromptTemplate any `json:"promptTemplate"` Source S `json:"source"` }
SourcedPromptTemplate retains the mapped template and its unchanged provenance. Without a mapper, PromptTemplate contains a harness.PromptTemplate; a mapper may supply an application-defined template value.
type SourcedPromptTemplateDiagnostic ¶
type SourcedPromptTemplateDiagnostic[S any] struct { PromptTemplateDiagnostic Source S `json:"source"` }
SourcedPromptTemplateDiagnostic retains the warning and its input provenance.
type SourcedSkill ¶
SourcedSkill retains the base Skill or application-mapped value with its provenance.
type SourcedSkillDiagnostic ¶
type SourcedSkillDiagnostic[S any] struct { SkillDiagnostic Source S `json:"source"` }
SourcedSkillDiagnostic associates a warning with its input provenance.
type SpanAttributes ¶
type SpanAttributes = telemetry.SpanAttributes
SpanAttributes maps attribute names to values (upstream SpanAttributes).
type SpanOptions ¶
type SpanOptions = telemetry.SpanOptions
SpanOptions names a span and supplies its start attributes (upstream SpanOptions).
type SpanStatus ¶
type SpanStatus = telemetry.SpanStatus
SpanStatus is a span's final status (upstream SpanStatus).
type SpanStatusCode ¶
type SpanStatusCode = telemetry.SpanStatusCode
SpanStatusCode is "ok" or "error".
type SpanStatusError ¶
type SpanStatusError = telemetry.SpanStatusError
SpanStatusError carries optional error details for an error status.
type TaggedError ¶
TaggedError is an expected harness failure returned in a result's error channel. Its JSON form is {"_tag", "message", "name", ...fields}, matching the upstream tagged-error toJSON.
type TelemetryAttributeDefinition ¶
type TelemetryAttributeDefinition struct {
TelemetryAttributeMetadata
Type TelemetryAttributeType `json:"type"`
Values []AttributeValue `json:"values,omitzero"`
ElementValues []AttributeValue `json:"elementValues,omitzero"`
Examples []AttributeValue `json:"examples,omitzero"`
}
TelemetryAttributeDefinition describes a value, its allowed literals, and examples. Values applies to scalar types; ElementValues applies to array types.
type TelemetryAttributeMetadata ¶
type TelemetryAttributeMetadata struct {
Description string `json:"description"`
Sensitive *bool `json:"sensitive,omitempty"`
Cardinality string `json:"cardinality,omitempty"`
}
TelemetryAttributeMetadata describes an attribute's meaning and handling.
type TelemetryAttributeType ¶
type TelemetryAttributeType string
TelemetryAttributeType identifies the scalar or homogeneous array value of an attribute.
type TelemetryContext ¶
type TelemetryContext = telemetry.TelemetryContext
TelemetryContext starts child spans (upstream pi-telemetry TelemetryContext). Upstream startSpan returns the callback's value; Go callers capture results in the callback closure and StartSpan returns the callback's error.
func GetTelemetryContext ¶
func GetTelemetryContext(ctx Context) TelemetryContext
GetTelemetryContext returns the telemetry parent attached to a context, or the shared no-op parent (upstream getTelemetryContext).
type TelemetryDefinition ¶
TelemetryDefinition is one named member of an ordered schema object.
type TelemetryDefinitions ¶
type TelemetryDefinitions[T any] []TelemetryDefinition[T]
TelemetryDefinitions preserves the insertion order of a schema's named members. It serializes as a JSON object, not an array.
func (TelemetryDefinitions[T]) Get ¶
func (definitions TelemetryDefinitions[T]) Get(name string) (T, bool)
Get looks up a named schema member.
func (TelemetryDefinitions[T]) MarshalJSON ¶
func (definitions TelemetryDefinitions[T]) MarshalJSON() ([]byte, error)
MarshalJSON preserves schema member order when serializing the object.
type TelemetryEventAttributeDefinition ¶
type TelemetryEventAttributeDefinition = TelemetryStartAttributeDefinition
TelemetryEventAttributeDefinition records whether an event attribute is required.
type TelemetryEventDefinition ¶
type TelemetryEventDefinition struct {
Description string `json:"description"`
Attributes TelemetryDefinitions[TelemetryEventAttributeDefinition] `json:"attributes"`
}
TelemetryEventDefinition describes a named span event.
type TelemetryParentDefinition ¶
type TelemetryParentDefinition struct {
Kind string `json:"kind"`
Spans []string `json:"spans,omitzero"`
}
TelemetryParentDefinition describes permitted parents: any, root_or_external, or the named spans.
type TelemetrySchemaDefinition ¶
type TelemetrySchemaDefinition struct {
Version int `json:"version"`
Spans TelemetryDefinitions[TelemetrySpanDefinition] `json:"spans"`
}
TelemetrySchemaDefinition is the upstream-owned, serializable span vocabulary. Version is the upstream telemetry schema version, not a Pig format discriminator.
type TelemetrySpan ¶
type TelemetrySpan = telemetry.TelemetrySpan
TelemetrySpan is an active span that can itself parent children (upstream TelemetrySpan).
type TelemetrySpanDefinition ¶
type TelemetrySpanDefinition struct {
Description string `json:"description"`
Parents TelemetryParentDefinition `json:"parents"`
StartAttributes TelemetryDefinitions[TelemetryStartAttributeDefinition] `json:"startAttributes"`
EndAttributes TelemetryDefinitions[TelemetryAttributeDefinition] `json:"endAttributes"`
Events TelemetryDefinitions[TelemetryEventDefinition] `json:"events,omitzero"`
Status struct {
Default SpanStatusCode `json:"default"`
ErrorWhen string `json:"errorWhen"`
} `json:"status"`
}
TelemetrySpanDefinition describes a span's parents, start attributes, completion enrichment, events, and status policy.
type TelemetryStartAttributeDefinition ¶
type TelemetryStartAttributeDefinition struct {
TelemetryAttributeDefinition
Required bool `json:"required"`
}
TelemetryStartAttributeDefinition records whether a start attribute is required.
type TextLine ¶
type TextLine struct {
Text string
// Terminated reports whether the line ended with "\n"; callers use it to
// discard a torn final record.
Terminated bool
}
TextLine is one UTF-8 line read from a text file.
type TextLineReader ¶
type TextLineReader interface {
// ReadLine returns the next line, or nil at end of file.
ReadLine(ctx context.Context) (*TextLine, error)
// Close releases the open file; it is best-effort and never fails.
Close(ctx context.Context)
}
TextLineReader is a pull-based UTF-8 line reader that preserves final-line termination.
type UnknownSkill ¶
type UnknownSkill namedError
UnknownSkill reports a skill name absent from the harness resources.
func (*UnknownSkill) Error ¶
func (err *UnknownSkill) Error() string
func (*UnknownSkill) MarshalJSON ¶
func (err *UnknownSkill) MarshalJSON() ([]byte, error)
func (*UnknownSkill) Tag ¶
func (*UnknownSkill) Tag() string
type UnknownTarget ¶
UnknownTarget reports a target entry id absent from the session.
func (*UnknownTarget) Error ¶
func (err *UnknownTarget) Error() string
func (*UnknownTarget) MarshalJSON ¶
func (err *UnknownTarget) MarshalJSON() ([]byte, error)
func (*UnknownTarget) Tag ¶
func (*UnknownTarget) Tag() string
type UnknownTemplate ¶
type UnknownTemplate namedError
UnknownTemplate reports a prompt template name absent from the resources.
func (*UnknownTemplate) Error ¶
func (err *UnknownTemplate) Error() string
func (*UnknownTemplate) MarshalJSON ¶
func (err *UnknownTemplate) MarshalJSON() ([]byte, error)
func (*UnknownTemplate) Tag ¶
func (*UnknownTemplate) Tag() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentharness holds the public durable AgentHarness data contracts of packages/agent/src/harness/agent-harness.ts, the passive HarnessEventBus of harness/events.ts and the ordered HookRegistry of harness/hooks.ts.
|
Package agentharness holds the public durable AgentHarness data contracts of packages/agent/src/harness/agent-harness.ts, the passive HarnessEventBus of harness/events.ts and the ordered HookRegistry of harness/hooks.ts. |
|
Package compaction prepares and summarizes durable harness entries with an embedded retained tail.
|
Package compaction prepares and summarizes durable harness entries with an embedded retained tail. |
|
Package env provides NodeExecutionEnv, the host-OS filesystem and shell implementation of the harness execution environment.
|
Package env provides NodeExecutionEnv, the host-OS filesystem and shell implementation of the harness execution environment. |
|
Package execution provides effect admission for the durable agent harness.
|
Package execution provides effect admission for the durable agent harness. |
|
Package pico3 is the experimental Pico3 agent kernel: durable records, commit-granular documents, a single-writer Session line, a task scheduler, the built-in turn kinds, and the watch view protocol.
|
Package pico3 is the experimental Pico3 agent kernel: durable records, commit-granular documents, a single-writer Session line, a task scheduler, the built-in turn kinds, and the watch view protocol. |
|
Package runtime owns the durable AgentHarness runtime: lane control projections, serialized commands, and installed drive passes with their effect gates.
|
Package runtime owns the durable AgentHarness runtime: lane control projections, serialized commands, and installed drive passes with their effect gates. |
|
Package session implements the durable harness session: the write-once entry tree, bound values and lists, the usage ledger, the storage contract, the Session mutation line, Branch capabilities, forks, and the in-memory backend.
|
Package session implements the durable harness session: the write-once entry tree, bound values and lists, the usage ledger, the storage contract, the Session mutation line, Branch capabilities, forks, and the in-memory backend. |
|
testing
Package sessiontesting holds runner-independent session test fixtures and storage decorators shared by every backend's conformance and benchmarks.
|
Package sessiontesting holds runner-independent session test fixtures and storage decorators shared by every backend's conformance and benchmarks. |
|
testing/benchmark
Package benchmark holds the deterministic session workloads shared by every backend's storage and repository benchmarks.
|
Package benchmark holds the deterministic session workloads shared by every backend's storage and repository benchmarks. |
|
testing/conformance
Package conformance holds the runner-independent Storage and SessionRepo conformance suites every session backend must pass.
|
Package conformance holds the runner-independent Storage and SessionRepo conformance suites every session backend must pass. |
|
Package tools provides the execution-environment-backed tools of the agent harness.
|
Package tools provides the execution-environment-backed tools of the agent harness. |
|
Package utils holds the harness usage arithmetic, adaptive publication, and bounded shell-output capture helpers.
|
Package utils holds the harness usage arithmetic, adaptive publication, and bounded shell-output capture helpers. |