Versions in this module Expand all Collapse all v0 v0.1.0 Sep 26, 2026 Changes in this version + const DeliveryDelivered + const DeliveryFailed + const DeliveryPending + const DeliveryStreaming + const OperationEnvelopeVersion + const PlanStepBlocked + const PlanStepCompleted + const PlanStepPending + const PlanStepRunning + const RunCancelled + const RunExecuting + const RunFailed + const RunPaused + const RunPending + const RunSucceeded + const TaskCancelled + const TaskClaimed + const TaskCompleted + const TaskFailed + const TaskPending + const TaskRunning + var ErrApprovalOwnerMismatch = errors.New("approval owner mismatch") + var ErrApprovalRevisionConflict = errors.New("approval revision conflict") + var ErrAttemptConflict = errors.New("attempt identity reused with different input") + var ErrAttemptOwnerMismatch = errors.New("attempt owner mismatch") + var ErrAttemptRevisionConflict = errors.New("attempt revision conflict") + var ErrAttemptTerminal = errors.New("attempt already settled") + var ErrGlobalBusy = errors.New("global run limit reached") + var ErrInputConflict = errors.New("input ID reused with different request") + var ErrInputRevision = errors.New("input revision conflict") + var ErrPlanRevision = errors.New("plan revision conflict") + var ErrSessionBusy = errors.New("session has an active input") + var ErrTaskClaimed = errors.New("task is already claimed") + var ErrTaskRevision = errors.New("task revision conflict") + var ErrToolRoundConflict = errors.New("tool round ID reused with different intent") + var ErrToolRoundRevision = errors.New("tool round revision conflict") + func IsTaskPlanStale(task Task, plan Plan) bool + func WithIdentity(ctx context.Context, identity Identity) (context.Context, error) + type AdmissionDecision struct + ActiveID string + Input AdmittedInput + InterruptID string + Join bool + Wake bool + type AdmissionEnvelopeBuilder struct + Attempts AttemptLedger + MaxReconciliation int + func (b AdmissionEnvelopeBuilder) Build(ctx context.Context, identity Identity, ...) (CanonicalAdmission, error) + type AdmissionStore interface + Create func(context.Context, AdmittedInput) (AdmittedInput, bool, error) + Get func(context.Context, Identity, string) (AdmittedInput, bool, error) + Pending func(context.Context, Identity, int) ([]AdmittedInput, error) + Transition func(context.Context, Identity, string, uint64, InputState, string, string) (AdmittedInput, error) + type AdmittedInput struct + AdmittedAt time.Time + FailureCode string + ID string + Identity Identity + Mode InputMode + PayloadHash string + Priority InputPriority + Revision uint64 + State InputState + SteersInputID string + UpdatedAt time.Time + type ApprovalDecision struct + Allowed bool + EnvelopeHash string + ExpiresAt time.Time + Reason string + RequestID string + type ApprovalPendingError struct + Request ApprovalRequest + func (e *ApprovalPendingError) Error() string + type ApprovalRecord struct + Decision ApprovalDecision + Request ApprovalRequest + Revision uint64 + State ApprovalState + type ApprovalRequest struct + CreatedAt time.Time + Envelope OperationEnvelope + EnvelopeHash string + ID string + ReasonCode string + Version int + func NewApprovalRequest(id string, envelope OperationEnvelope, reason string, at time.Time) (ApprovalRequest, error) + type ApprovalState string + const ApprovalApproved + const ApprovalDenied + const ApprovalPending + type ApprovalStore interface + Create func(context.Context, ApprovalRequest) (ApprovalRecord, bool, error) + Get func(context.Context, Identity, string) (ApprovalRecord, bool, error) + Resolve func(context.Context, Identity, string, uint64, ApprovalDecision) (ApprovalRecord, error) + type Approver interface + Approve func(context.Context, ApprovalRequest) (ApprovalDecision, error) + type Attempt struct + AdmittedAt time.Time + ArgsHash string + CatalogVersion string + ID string + IdempotencyKey string + Identity Identity + PolicyVersion string + ReasonCode string + ReconcileAction string + RequestID string + ResultHash string + Revision uint64 + SchemaDigest string + SettledAt time.Time + SourceEventIDs []string + StartedAt time.Time + State AttemptState + TargetHash string + Tool ToolRef + type AttemptLedger interface + Admit func(context.Context, Attempt) (Attempt, bool, error) + Get func(context.Context, Identity, string) (Attempt, bool, error) + ListForReconciliation func(context.Context, Identity, int) ([]Attempt, error) + Settle func(context.Context, Identity, string, uint64, AttemptSettlement) (Attempt, error) + Start func(context.Context, Identity, string, uint64, time.Time) (Attempt, error) + type AttemptSettlement struct + At time.Time + ReasonCode string + ReconcileAction string + ResultHash string + State AttemptState + type AttemptState string + const AttemptAdmitted + const AttemptCancelledBefore + const AttemptDenied + const AttemptExecuting + const AttemptFailed + const AttemptIndeterminate + const AttemptSucceeded + type AuthorizationResolver func(canonicalArguments string) ([]AuthorizationTarget, error) + type AuthorizationTarget struct + Action string + Resource string + type CanonicalAdmission struct + AdmissionDigest string + CatalogVersion string + ContextDigest string + HarnessDigest string + Identity Identity + InputID string + PolicyVersion string + Reconciliation []Attempt + func (a CanonicalAdmission) ReadyForProvider() bool + type Canonicalizer func(arguments string) (string, error) + type Capability struct + Class ToolClass + Description string + Ref ToolRef + Schema json.RawMessage + SchemaDigest string + type CapabilityPage struct + CatalogVersion string + Items []CapabilitySummary + NextCursor string + type CapabilityQuery struct + Cursor string + IncludeSchemas bool + Limit int + MaxSchemaBytes int + Search string + ToolSet string + type CapabilitySummary struct + Class ToolClass + Description string + Ref ToolRef + Schema json.RawMessage + SchemaDigest string + SchemaOmitted bool + type Catalog struct + func NewCatalog() *Catalog + func (c *Catalog) Register(spec ToolSpec) error + func (c *Catalog) Snapshot(version string) (CatalogSnapshot, error) + type CatalogSnapshot struct + func (s CatalogSnapshot) CanonicalOperation(ref ToolRef, assertedResource, arguments string) (Operation, error) + func (s CatalogSnapshot) Capabilities(toolSet string, snapshot policy.Snapshot) []Capability + func (s CatalogSnapshot) Discover(query CapabilityQuery, snapshot policy.Snapshot) (CapabilityPage, error) + func (s CatalogSnapshot) Refs(policySnapshot policy.Snapshot) []ToolRef + func (s CatalogSnapshot) Resolve(ref ToolRef) (ToolSpec, bool) + func (s CatalogSnapshot) Version() string + type ChildRun struct + ArtifactRef string + CapabilityVersion string + ContextDigest string + CreatedAt time.Time + ExpertID string + FailureCode string + ID string + Identity Identity + Model string + ParentNodeID string + ParentRunID string + Revision uint64 + Status ChildStatus + UpdatedAt time.Time + type ChildRunStore interface + Create func(context.Context, ChildRun) error + Get func(context.Context, string) (ChildRun, bool) + Transition func(context.Context, string, uint64, ChildStatus, string, string) (ChildRun, error) + type ChildStatus string + const ChildCancelled + const ChildCompleted + const ChildFailed + const ChildPending + const ChildPressure + const ChildRunning + type Dispatcher struct + Approvals ApprovalStore + Approver Approver + Catalog CatalogSnapshot + Ledger AttemptLedger + Now func() time.Time + Policy policy.Snapshot + func (d Dispatcher) Execute(ctx context.Context, attemptID string, ref ToolRef, resource, arguments string) (string, error) + func (d Dispatcher) ExecuteOperation(ctx context.Context, request OperationRequest) (string, error) + type ExistingAttemptError struct + Attempt Attempt + func (e *ExistingAttemptError) Error() string + type Flow struct + ID string + Nodes []FlowNode + Revision uint64 + type FlowNode struct + DependsOn []string + TaskID string + type Goal struct + ID string + Objective string + Revision uint64 + Status string + type Identity struct + PrincipalID string + RunID string + SessionID string + TenantID string + func IdentityFromContext(ctx context.Context) (Identity, bool) + func (i Identity) Validate() error + type IndeterminateError struct + Err error + func (e *IndeterminateError) Error() string + func (e *IndeterminateError) Unwrap() error + type InputMode string + const InputQueue + const InputSteer + type InputPriority string + const InputPriorityLater + const InputPriorityNext + const InputPriorityNow + type InputState string + const InputAdmitted + const InputCancelled + const InputCompleted + const InputFailed + const InputQueued + const InputRunning + const InputSteering + type MemoryAdmissionStore struct + func NewMemoryAdmissionStore() *MemoryAdmissionStore + func (s *MemoryAdmissionStore) Create(ctx context.Context, in AdmittedInput) (AdmittedInput, bool, error) + func (s *MemoryAdmissionStore) Get(ctx context.Context, owner Identity, id string) (AdmittedInput, bool, error) + func (s *MemoryAdmissionStore) Pending(ctx context.Context, owner Identity, limit int) ([]AdmittedInput, error) + func (s *MemoryAdmissionStore) Transition(ctx context.Context, owner Identity, id string, expected uint64, ...) (AdmittedInput, error) + type MemoryApprovalStore struct + func NewMemoryApprovalStore() *MemoryApprovalStore + func (s *MemoryApprovalStore) Create(ctx context.Context, request ApprovalRequest) (ApprovalRecord, bool, error) + func (s *MemoryApprovalStore) Get(ctx context.Context, owner Identity, requestID string) (ApprovalRecord, bool, error) + func (s *MemoryApprovalStore) Resolve(ctx context.Context, owner Identity, requestID string, expected uint64, ...) (ApprovalRecord, error) + type MemoryAttemptLedger struct + func NewMemoryAttemptLedger() *MemoryAttemptLedger + func (l *MemoryAttemptLedger) Admit(ctx context.Context, in Attempt) (Attempt, bool, error) + func (l *MemoryAttemptLedger) Get(ctx context.Context, owner Identity, id string) (Attempt, bool, error) + func (l *MemoryAttemptLedger) ListForReconciliation(ctx context.Context, owner Identity, limit int) ([]Attempt, error) + func (l *MemoryAttemptLedger) Settle(ctx context.Context, owner Identity, id string, expected uint64, ...) (Attempt, error) + func (l *MemoryAttemptLedger) Start(ctx context.Context, owner Identity, id string, expected uint64, at time.Time) (Attempt, error) + type MemoryChildRunStore struct + func NewMemoryChildRunStore() *MemoryChildRunStore + func (s *MemoryChildRunStore) Create(ctx context.Context, run ChildRun) error + func (s *MemoryChildRunStore) Get(ctx context.Context, id string) (ChildRun, bool) + func (s *MemoryChildRunStore) Transition(ctx context.Context, id string, expected uint64, next ChildStatus, ...) (ChildRun, error) + type MemoryRunStore struct + func NewMemoryRunStore() *MemoryRunStore + func (s *MemoryRunStore) Create(ctx context.Context, run Run) (Run, error) + func (s *MemoryRunStore) Get(ctx context.Context, owner Identity, id string) (Run, bool, error) + func (s *MemoryRunStore) Update(ctx context.Context, owner Identity, id string, expected uint64, ...) (Run, error) + type MemoryTaskMailbox struct + func NewMemoryTaskMailbox() *MemoryTaskMailbox + func (m *MemoryTaskMailbox) Ack(ctx context.Context, owner Identity, recipient string, sequence uint64) (TaskMailboxState, error) + func (m *MemoryTaskMailbox) Append(ctx context.Context, message TaskMessage) (TaskMessage, bool, error) + func (m *MemoryTaskMailbox) Replay(ctx context.Context, owner Identity, recipient string, after uint64, limit int) ([]TaskMessage, error) + type MemoryToolRoundStore struct + func NewMemoryToolRoundStore() *MemoryToolRoundStore + func (s *MemoryToolRoundStore) Create(ctx context.Context, round ToolRound) (ToolRound, bool, error) + func (s *MemoryToolRoundStore) Get(ctx context.Context, owner Identity, id string) (ToolRound, bool, error) + func (s *MemoryToolRoundStore) Open(ctx context.Context, owner Identity, limit int) ([]ToolRound, error) + func (s *MemoryToolRoundStore) Transition(ctx context.Context, owner Identity, roundID string, expected uint64, ...) (ToolRound, error) + type MemoryWorkStore struct + func NewMemoryWorkStore() *MemoryWorkStore + func (s *MemoryWorkStore) CreatePlan(ctx context.Context, record PlanRecord) (PlanRecord, error) + func (s *MemoryWorkStore) CreateTask(ctx context.Context, task Task) (Task, error) + func (s *MemoryWorkStore) GetPlan(ctx context.Context, owner Identity, id string) (PlanRecord, bool, error) + func (s *MemoryWorkStore) GetTask(ctx context.Context, owner Identity, id string) (Task, bool, error) + func (s *MemoryWorkStore) ListTasks(ctx context.Context, owner Identity, goalID string) ([]Task, error) + func (s *MemoryWorkStore) TransitionTask(ctx context.Context, owner Identity, id string, expected uint64, ...) (Task, error) + func (s *MemoryWorkStore) UpdatePlan(ctx context.Context, owner Identity, id string, expected uint64, ...) (PlanRecord, error) + type Operation struct + ArgsHash string + Authorizations []AuthorizationTarget + CanonicalArguments string + CatalogVersion string + Resource string + SchemaDigest string + TargetHash string + Tool ToolRef + type OperationEnvelope struct + AttemptID string + IdempotencyKey string + Identity Identity + PolicyVersion string + RequestID string + SourceEventIDs []string + Version int + type OperationRequest struct + Arguments string + AttemptID string + IdempotencyKey string + RequestID string + Resource string + SourceEventIDs []string + Tool ToolRef + type Plan struct + ID string + Revision uint64 + Steps []PlanStep + UpdatedAt time.Time + type PlanRecord struct + Owner Identity + Plan Plan + type PlanStep struct + Description string + ID string + Status string + type PlanStore interface + CreatePlan func(context.Context, PlanRecord) (PlanRecord, error) + GetPlan func(context.Context, Identity, string) (PlanRecord, bool, error) + UpdatePlan func(context.Context, Identity, string, uint64, []PlanStep) (PlanRecord, error) + type ResourceResolver func(canonicalArguments string) (string, error) + type Run struct + CreatedAt time.Time + Delivery RunDeliveryState + DeliveryCursor uint64 + Execution RunExecutionState + FailureCode string + ID string + Identity Identity + InputID string + Revision uint64 + UpdatedAt time.Time + type RunDeliveryState string + type RunExecutionState string + type RunStore interface + Create func(context.Context, Run) (Run, error) + Get func(context.Context, Identity, string) (Run, bool, error) + Update func(context.Context, Identity, string, uint64, RunExecutionState, RunDeliveryState, ...) (Run, error) + type SessionCoordinator struct + func NewSessionCoordinator(store AdmissionStore, maxActive int) (*SessionCoordinator, error) + func (c *SessionCoordinator) Admit(ctx context.Context, in AdmittedInput) (AdmissionDecision, error) + func (c *SessionCoordinator) ConsumeWake(sessionID string) bool + func (c *SessionCoordinator) Finish(ctx context.Context, owner Identity, id string, expected uint64, ...) (AdmittedInput, *AdmittedInput, error) + func (c *SessionCoordinator) Interrupt(ctx context.Context, owner Identity, id string, expected uint64) (AdmittedInput, *AdmittedInput, error) + func (c *SessionCoordinator) Recover(inputs []AdmittedInput) error + type Task struct + Assignee string + GoalID string + ID string + Owner Identity + ParentTaskID string + PlanID string + PlanRevision uint64 + Revision uint64 + RunID string + Status string + UpdatedAt time.Time + type TaskMailbox interface + Ack func(context.Context, Identity, string, uint64) (TaskMailboxState, error) + Append func(context.Context, TaskMessage) (TaskMessage, bool, error) + Replay func(context.Context, Identity, string, uint64, int) ([]TaskMessage, error) + type TaskMailboxState struct + AckedSequence uint64 + HeadSequence uint64 + type TaskMessage struct + CreatedAt time.Time + ID string + Owner Identity + PayloadHash string + RecipientTaskID string + SenderTaskID string + Sequence uint64 + type TaskStore interface + CreateTask func(context.Context, Task) (Task, error) + GetTask func(context.Context, Identity, string) (Task, bool, error) + ListTasks func(context.Context, Identity, string) ([]Task, error) + TransitionTask func(context.Context, Identity, string, uint64, string, string, string) (Task, error) + type ToolCallRecord struct + AttemptID string + ID string + Omission *ToolOmission + Required bool + State ToolCallState + Tool ToolRef + UpdatedAt time.Time + type ToolCallState string + const ToolCallAdmitted + const ToolCallApprovalPending + const ToolCallDenied + const ToolCallExecuting + const ToolCallFailed + const ToolCallIndeterminate + const ToolCallOmitted + const ToolCallPlanned + const ToolCallSucceeded + type ToolClass struct + Category string + HostAction bool + SideEffecting bool + TrustedOutput bool + type ToolFunc func(context.Context, string) (string, error) + type ToolOmission struct + ReasonCode string + Safe bool + type ToolRef struct + Name string + Version string + type ToolRound struct + Calls []ToolCallRecord + CatalogVersion string + CreatedAt time.Time + ID string + Identity Identity + PolicyVersion string + Revision uint64 + UpdatedAt time.Time + func (r ToolRound) Assess() ToolRoundAssessment + type ToolRoundAssessment struct + Blockers []string + Converged bool + type ToolRoundStore interface + Create func(context.Context, ToolRound) (ToolRound, bool, error) + Get func(context.Context, Identity, string) (ToolRound, bool, error) + Open func(context.Context, Identity, int) ([]ToolRound, error) + Transition func(context.Context, Identity, string, uint64, string, ToolCallState, string, ...) (ToolRound, error) + type ToolSpec struct + Canonicalize Canonicalizer + Class ToolClass + Description string + Execute ToolFunc + Ref ToolRef + ResolveAuthorizations AuthorizationResolver + ResolveResource ResourceResolver + Schema json.RawMessage + SchemaDigest string + ToolSets []string + Validate Validator + type Validator func(arguments string) error