Versions in this module Expand all Collapse all v0 v0.1.3 Oct 9, 2026 Changes in this version + func ValidMemoryKind(kind MemoryKind) bool type MemoryEntry + ConfirmedAt time.Time + Evidence string + ExpiresAt *time.Time + Key string + SeenCount uint64 + Sources []MemorySource + type MemoryEraser interface + EraseMemory func(context.Context, string, string) error type MemoryKind + const MemoryContext + const MemoryEpisode + const MemoryPreference + const MemoryProcedure + type MemoryReader interface + ReadMemory func(context.Context, string, string) (MemoryEntry, error) + type MemoryRetention struct + Content string + Key string + Kind MemoryKind + ReplaceID string + TTLSeconds int64 + Tags []string + Target string + type MemorySource struct + Conversation string + Rollout string + Run string + type MemoryTarget struct + Description string + Name string + ScopeID string + Writable bool + type ScopedMemory interface + MemoryTargets func(context.Context, string) ([]MemoryTarget, error) + Retain func(context.Context, string, MemoryRetention) (MemoryEntry, error) v0.1.2 Oct 9, 2026 v0.1.1 Oct 9, 2026 Changes in this version type NativeRun + SafeToolLabels map[string]telemetry.SafeLabels v0.1.0 Oct 8, 2026 Changes in this version + const CapabilitySupported + const CapabilityUnknown + const CapabilityUnsupported + const ContentPartImage + const ContentPartText + const InboxFollow + const InboxSteer + const ReasoningBlockRedacted + const ReasoningBlockThinking + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + const ToolChoiceAuto + const ToolChoiceDefault + const ToolChoiceNamed + const ToolChoiceNone + const ToolChoiceRequired + const ToolStrictDefault + const ToolStrictDisabled + const ToolStrictEnabled + var ErrAnswerConflict = errors.New("agentcore: answer conflicts with recorded answer") + var ErrBusy = errors.New("agentcore: agent is busy with another run") + var ErrNoPendingQuestion = errors.New("agentcore: no pending question") + var ErrParked = errors.New("tool parked the run awaiting a human answer") + var ErrSessionLeaseLost = errors.New("agentcore: durable session lease lost") + func AcquireSessionLease(ctx context.Context, store SessionStore, sessionID string) (context.Context, func() error, error) + func ActiveLeaf(log []SessionEntry) string + func Cosine(a, b []float32) float64 + func DelegationDepth(ctx context.Context) int + func IdempotencyKey(ctx context.Context) (key string, ok bool) + func IsRetryable(err error) bool + func LaunchBackground(ctx context.Context, tool, label string, ...) (json.RawMessage, error) + func PendingQuestion(log []SessionEntry) (callID string, question json.RawMessage, found bool) + func PiQuestionFromEntry(entry SessionEntry) (string, json.RawMessage, bool) + func RecordGoalRevision(ctx context.Context, revision GoalRevision) error + func RecordSessionAnswer(ctx context.Context, store SessionStore, sessionID, callID, answer string) (bool, error) + func RecoverNativeTranscript(entries []SessionEntry) (json.RawMessage, error) + func ReportProgress(ctx context.Context, note string) + func Rewind(ctx context.Context, store SessionStore, sessionID, targetID string, ...) (string, error) + func RunSessionFrom(ctx context.Context) string + func SandboxSessionFrom(ctx context.Context) string + func StringProperties(names ...string) map[string]any + func ToolCallID(ctx context.Context) (id string, ok bool) + func ToolInvocationScope(ctx context.Context) (string, bool) + func TruncateBytes(s string, maxBytes int) string + func TruncateMiddle(s string, maxBytes int) string + func WithBackgroundLauncher(ctx context.Context, launch BackgroundLauncher) context.Context + func WithDelegationDepth(ctx context.Context, depth int) context.Context + func WithGoalRevisionRecorder(ctx context.Context, record func(context.Context, GoalRevision) error) context.Context + func WithRunProgress(ctx context.Context, progress func(string)) context.Context + func WithRunSession(ctx context.Context, id string) context.Context + func WithSandboxSession(ctx context.Context, id string) context.Context + func WithToolInvocationScope(ctx context.Context, invocationID string) context.Context + type AccountScopedProviderState = protocol.AccountScopedProviderState + type AfterToolCall func(ctx context.Context, call ToolCall, result string, runErr error) (rewritten string, terminate bool) + type Agent struct + func Build(plugins ...Plugin) (*Agent, error) + func New(cfg Config) (*Agent, error) + func (a *Agent) AddChildUsage(u Usage) + func (a *Agent) Continue(ctx context.Context, history []Message, task string) (RunResult, error) + func (a *Agent) ContinueStream(ctx context.Context, history []Message, task string, sink StreamSink) (RunResult, error) + func (a *Agent) Describe() string + func (a *Agent) FollowUp(ctx context.Context, m Message) error + func (a *Agent) Fork(childSessionID string) *Agent + func (a *Agent) IsDurable() bool + func (a *Agent) OpenPiTools(ctx context.Context) (*PiToolHost, error) + func (a *Agent) Prompt(ctx context.Context, userInput string) (RunResult, error) + func (a *Agent) PromptStream(ctx context.Context, userInput string, sink StreamSink) (RunResult, error) + func (a *Agent) RunNative(ctx context.Context, input NativeRun) (RunResult, error) + func (a *Agent) SessionID() string + func (a *Agent) Steer(ctx context.Context, m Message) error + type AgentDefinition struct + Agents string + ScopeID string + SkillLoader SkillLoader + Skills []Skill + Soul string + func (d AgentDefinition) IsZero() bool + func (d AgentDefinition) Validate() []Diagnostic + type AgentEndHook func(ctx context.Context, res RunResult) + type AllowList struct + func NewAllowList(names ...string) *AllowList + func (a *AllowList) Allow(_ context.Context, call ToolCall) Decision + func (a *AllowList) PermittedTools(_ context.Context, all []string) []string + type ArgPreparer interface + PrepareArguments func(raw string) string + type BackgroundLauncher func(tool, label string, run func(context.Context) (string, error)) (json.RawMessage, error) + type BatchDecision struct + AdditionalContexts []Message + type BatchInterceptor interface + InterceptBatch func(ctx context.Context, calls []ToolCall) BatchDecision + type BeforeAgentStartHook func(ctx context.Context, start RunStart) RunStart + type BeforeCompactHook func(ctx context.Context, req CompactRequest) CompactDecision + type BeforeToolCall func(ctx context.Context, call ToolCall) Decision + type BookkeepingTool interface + Bookkeeping func() bool + type BranchOptions struct + Summarize func(ctx context.Context, abandoned []Message) (string, Usage, error) + type BudgetPlugin struct + Gate func(ctx context.Context, u Usage) bool + Step func(ctx context.Context, turn int) error + func (BudgetPlugin) Name() string + func (p BudgetPlugin) Register(r *Registry) error + type CallRetrySafeTool interface + RetrySafeCall func(call ToolCall) bool + type CapabilitySupport = protocol.CapabilitySupport + type CardPoint struct + Label string + Value float64 + type CardStat struct + Label string + Value string + type ChatDelta = protocol.ChatDelta + type ChatRequest = protocol.ChatRequest + type ChatResponse = protocol.ChatResponse + func AssistantText(content string) ChatResponse + func AssistantToolCall(id, name, args string) ChatResponse + type CheckpointState struct + ActiveTools []string + Completed bool + DisabledTools []string + Goal string + Model string + type ChildQuestionError struct + Question json.RawMessage + QuestionID string + SessionID string + func PiChildQuestionFromEntry(entry SessionEntry) (string, *ChildQuestionError, bool) + func (e *ChildQuestionError) Error() string + type CompactDecision struct + Messages []Message + Skip bool + type CompactRequest struct + Budget int + Messages []Message + Settings CompactionSettings + Turn int + type CompactionPlugin struct + Model string + Provider LLMProvider + Settings *CompactionSettings + Strategy Compactor + func CompactionUsing(c Compactor) CompactionPlugin + func (CompactionPlugin) Name() string + func (p CompactionPlugin) Register(r *Registry) error + type CompactionRequest struct + Budget int + Messages []Message + Model string + Provider LLMProvider + Settings CompactionSettings + Turn int + type CompactionResult struct + Messages []Message + Usage Usage + type CompactionSettings struct + KeepRecentTokens int + MaxSummaryTokens int + PruneCacheWarmSuffixTokens int + PruneMinimumSavingsTokens int + PruneProtectedTools []string + func DefaultCompactionSettings() CompactionSettings + type Compactor interface + Compact func(ctx context.Context, req CompactionRequest) (CompactionResult, error) + Name func() string + ShouldCompact func(messages []Message, budget int) bool + func DefaultCompactor() Compactor + type Config struct + BudgetGate func(ctx context.Context, u Usage) bool + Compaction *CompactionSettings + CompactionModel string + CompactionProvider LLMProvider + Compactor Compactor + ContextWindow int + Definition AgentDefinition + Env *Env + Escalation []ModelRung + Extensions []ExtensionFactory + GetFollowUpMessages func(ctx context.Context) []Message + GetSteeringMessages func(ctx context.Context) []Message + Goal string + Hooks Hooks + Limits *Limits + MaxTokens int + Memory MemoryStore + Model string + ModelCapabilities ModelCapabilities + NativeProvider *ai.FallbackProvider + OutputSchema *OutputSchema + ParallelToolCalls *bool + Policy Policy + PrepareNextTurn func(ctx context.Context, state TurnState) TurnState + PromptCacheKey string + PromptCacheRetention string + Provider LLMProvider + ProviderSession *ProviderSession + ProviderSessionID string + ReasoningEffort string + RefreshKey func(ctx context.Context, provider string) (string, error) + ResumeSession bool + Retry *RetryPolicy + SeedDisabledTools []string + Session SessionStore + SessionID string + StepGate func(ctx context.Context, turn int) error + ToolChoice ToolChoice + Tools *ToolSet + type ContentPart = protocol.ContentPart + type ContextContributor interface + RunContext func(ctx context.Context) context.Context + type ContextHook func(ctx context.Context, msgs []Message) []Message + type ContextPruneRequest struct + Budget int + Messages []Message + PromptCacheActive bool + Settings CompactionSettings + type ContextPruner interface + PruneContext func(req ContextPruneRequest) ([]Message, bool) + type CredentialResolver interface + Resolve func(ctx context.Context, args string) (string, error) + type Decision struct + Allow bool + Reason string + func Allowed() Decision + func Blocked(reason string) Decision + type DefinitionPlugin struct + Definition AgentDefinition + Env *Env + Limits *Limits + func (DefinitionPlugin) Name() string + func (p DefinitionPlugin) Register(r *Registry) error + type DenyAll struct + func (DenyAll) Allow(context.Context, ToolCall) Decision + func (DenyAll) PermittedTools(context.Context, []string) []string + type Diagnostic struct + Message string + Part string + Severity Severity + type Embedder = protocol.Embedder + type Env struct + Credentials CredentialResolver + Sandbox Sandbox + func DefaultEnv() Env + type Extension interface + Name func() string + type ExtensionFactory interface + BeginRun func(ctx context.Context, info RunInfo) (Extension, error) + Name func() string + type FauxProvider struct + Recorded []ChatRequest + Responses []ChatResponse + func NewFauxProvider(responses ...ChatResponse) *FauxProvider + func (f *FauxProvider) Chat(_ context.Context, req ChatRequest) (ChatResponse, error) + func (f *FauxProvider) Name() string + func (f *FauxProvider) Stream(ctx context.Context, req ChatRequest) (<-chan ChatDelta, error) + func (f *FauxProvider) SupportsTools() bool + type GoalReviser interface + ReviseGoal func() (goal string, ok bool) + type GoalRevision struct + Goal string + Previous string + Reason string + type HookErrorPolicy string + const HookContinue + const HookThrow + type Hooks struct + After []AfterToolCall + AgentEnd []AgentEndHook + Before []BeforeToolCall + BeforeAgentStart []BeforeAgentStartHook + BeforeCompact []BeforeCompactHook + BeforeProviderRequest []ProviderRequestHook + Context []ContextHook + ErrorPolicy HookErrorPolicy + MessageEnd []MessageEndHook + OnError func(source string, err error) + PiContext []PiContextHook + TurnEnd []TurnHook + TurnStart []TurnHook + type HooksPlugin struct + Hooks Hooks + Label string + Priority Priority + func HooksOf(h Hooks) HooksPlugin + func (p HooksPlugin) Name() string + func (p HooksPlugin) Register(r *Registry) error + type InboxItem struct + ID string + Lane string + Message Message + type KeyUpdater = protocol.KeyUpdater + type LLMProvider = protocol.LLMProvider + type LabSkillRef struct + Description string + ID string + Name string + type LabStep struct + Context []Message + CostUSD float64 + CumCostUSD float64 + CumTokensIn int + CumTokensOut int + Depth int + Error string + Index int + Kind LabStepKind + Memory []string + NativeTrace json.RawMessage + Persona string + Response string + SessionKey string + SkillsAdvertised []LabSkillRef + SkillsLoaded []string + StopReason string + Summary string + System string + TokensIn int + TokensOut int + ToolCalls []LabToolCall + Tools []string + Turn int + func FoldSteps(records []TurnRecord) []LabStep + type LabStepKind string + const LabStepCompaction + const LabStepTurn + type LabToolCall struct + Allowed bool + Args string + Error string + ID string + Name string + Result string + type Limits struct + MaxContextTokens int + MaxToolCalls int + MaxToolResultLen int + MaxTurns int + func DefaultLimits() Limits + type MemoryCurator interface + Supersede func(ctx context.Context, scopeID, id, replacementID string) error + Update func(ctx context.Context, scopeID, id string, entry MemoryEntry) error + type MemoryEntry struct + Confidence float64 + Content string + CreatedAt time.Time + ID string + Kind MemoryKind + ScopeID string + SourceRun string + Tags []string + type MemoryKind string + const MemoryFact + const MemoryLearning + const MemoryOutcome + type MemorySessionStore struct + func NewMemorySessionStore() *MemorySessionStore + func (m *MemorySessionStore) AcquireSessionLease(ctx context.Context, id string) (context.Context, func() error, error) + func (m *MemorySessionStore) Append(ctx context.Context, id string, e SessionEntry) error + func (m *MemorySessionStore) AppendBatch(_ context.Context, id string, entries []SessionEntry) error + func (m *MemorySessionStore) CheckpointSeq(_ context.Context, id string) (int, bool, error) + func (m *MemorySessionStore) Log(_ context.Context, id string) ([]SessionEntry, error) + func (m *MemorySessionStore) LogFrom(_ context.Context, id string, sinceSeq int) ([]SessionEntry, error) + func (m *MemorySessionStore) Sessions() []string + type MemoryStore interface + Recall func(ctx context.Context, scopeID, query string, limit int) ([]MemoryEntry, error) + Remember func(ctx context.Context, entry MemoryEntry) error + type Message = protocol.Message + func CloseDanglingCalls(messages []Message) []Message + type MessageEndHook func(ctx context.Context, msg Message) + type ModelCapabilities = protocol.ModelCapabilities + func CapabilitiesOf(provider LLMProvider, model string) ModelCapabilities + type ModelCapabilityError struct + Feature string + Model string + Provider string + func (e *ModelCapabilityError) Error() string + type ModelCapabilityProvider = protocol.ModelCapabilityProvider + type ModelPlugin struct + CacheRetention string + Capabilities ModelCapabilities + ContextWindow int + Escalation []ModelRung + MaxTokens int + Model string + NativeProvider *ai.FallbackProvider + OutputSchema *OutputSchema + ParallelToolCalls *bool + PromptCacheKey string + Provider LLMProvider + ReasoningEffort string + RefreshKey func(ctx context.Context, provider string) (string, error) + Retry *RetryPolicy + ToolChoice ToolChoice + func (ModelPlugin) Name() string + func (p ModelPlugin) Register(r *Registry) error + type ModelRung struct + Capabilities ModelCapabilities + ContextWindow int + Model string + Provider LLMProvider + type NativeContextContributor interface + TransformNativeContext func(context.Context, []json.RawMessage) ([]json.RawMessage, error) + type NativeRun struct + Commands map[string]json.RawMessage + Compaction *nativehost.CompactionPolicy + ControlOnly bool + Input []Message + Lifecycle func(string) + Sink StreamSink + State json.RawMessage + Task string + Telemetry telemetry.Context + type NativeStateContributor interface + NativeState func() (json.RawMessage, error) + RestoreNativeState func(json.RawMessage) error + type ObservePhase string + const PhaseAppend + const PhaseExternalInput + const PhaseRebase + const PhaseRequest + const PhaseRestore + type OutputSchema = protocol.OutputSchema + type ParallelTool interface + Parallel func() bool + type PiArgumentPreparer interface + PiArgumentPreparation func() string + type PiCompletedTurn struct + Calls []ToolCall + Info StopInfo + Model string + Outcomes []PiToolOutcome + StopReason string + Usage Usage + type PiContextHook func(context.Context, []json.RawMessage) ([]json.RawMessage, error) + type PiToolHost struct + func (h *PiToolHost) Close() error + func (h *PiToolHost) CompletePiRun(ctx context.Context, result RunResult) RunResult + func (h *PiToolHost) ControlPiRun(ctx context.Context, info StepInfo) (string, error) + func (h *PiToolHost) Definitions(ctx context.Context) (json.RawMessage, error) + func (h *PiToolHost) Execute(ctx context.Context, params json.RawMessage, emit func(json.RawMessage) error) (json.RawMessage, PiToolOutcome, error) + func (h *PiToolHost) FinishPiDelegationBatch(ctx context.Context, calls []ToolCall, outcomes []PiToolOutcome) (PiTurnDecision, error) + func (h *PiToolHost) FinishPiTurn(ctx context.Context, turn PiCompletedTurn) (PiTurnDecision, error) + func (h *PiToolHost) ObservePiMessages(ctx context.Context, phase ObservePhase, turn int, raw json.RawMessage) error + func (h *PiToolHost) PiCompactionPolicy() (budget, keepRecent int) + func (h *PiToolHost) PiGoal() string + func (h *PiToolHost) PreparePiTurn(ctx context.Context, info StepInfo) (PiTurnPreparation, error) + func (h *PiToolHost) RefreshPiGoal() (system string, changed bool, err error) + func (h *PiToolHost) ResumeDelegation(ctx context.Context, effectID string, original PiToolOutcome, ...) (json.RawMessage, PiToolOutcome, error) + func (h *PiToolHost) StartPiRun(ctx context.Context, task string) (string, error) + func (h *PiToolHost) StartPiRunWithLifecycle(ctx context.Context, task string, lifecycle func(string)) (string, error) + func (h *PiToolHost) TransformPiContext(ctx context.Context, raw json.RawMessage) json.RawMessage + func (h *PiToolHost) ValidatePiSession(id string, durable bool) error + type PiToolOutcome struct + AdditionalContexts []Message + ChildQuestion *ChildQuestionError + Executed bool + Invocations []ToolInvocation + Parked bool + QuestionID string + Terminate bool + Trace ToolTrace + type PiTurnDecision struct + End bool + Parked bool + type PiTurnPreparation struct + DisableTools bool + Messages []Message + Note string + StopReason string + type Plugin interface + Name func() string + Register func(r *Registry) error + func ConfigPlugin(cfg Config) Plugin + type Policy interface + Allow func(ctx context.Context, call ToolCall) Decision + PermittedTools func(ctx context.Context, all []string) []string + type PolicyPlugin struct + Policy Policy + func PolicyAllowList(names ...string) PolicyPlugin + func PolicyDenyAll() PolicyPlugin + func (PolicyPlugin) Name() string + func (p PolicyPlugin) Register(r *Registry) error + type Priority int + const PriorityDefault + const PriorityGate + const PriorityLate + type ProcessSandbox interface + Start func(ctx context.Context, req SandboxExec) (SandboxProcess, error) + type PromptContributor interface + SystemPrompt func() string + type ProviderError = protocol.ProviderError + func NewProviderError(provider string, response *http.Response, message string) *ProviderError + type ProviderRequestHook func(ctx context.Context, req ChatRequest) ChatRequest + type ProviderSession = protocol.ProviderSession + func NewProviderSession() *ProviderSession + type ProviderSessionRegistry struct + func NewProviderSessionRegistry(capacity int, idleTTL time.Duration) *ProviderSessionRegistry + func (r *ProviderSessionRegistry) Acquire(key string) (*ProviderSession, func()) + func (r *ProviderSessionRegistry) Close() + type ProviderSessionState = protocol.ProviderSessionState + type ReasoningBlock = protocol.ReasoningBlock + type RecoveryPolicy string + const RecoveryMarkInterrupted + type ReducedState struct + ActiveTools []string + Completed bool + DisabledTools []string + Draft string + Goal string + Inbox []InboxItem + LastTurn int + Messages []Message + Model string + PendingCompaction bool + ToolOutcomes map[string]ToolOutcomeRecord + ToolProgress map[string]string + func ReduceSession(log []SessionEntry) ReducedState + type Registry struct + func BuildRegistry(plugins ...Plugin) (*Registry, error) + func (r *Registry) AddExtension(f ExtensionFactory) + func (r *Registry) AddHooks(p Priority, h Hooks) + func (r *Registry) AddTools(tools ...Tool) + func (r *Registry) Agent() (*Agent, error) + func (r *Registry) ApplyConfig(cfg Config) error + func (r *Registry) Describe() string + func (r *Registry) Plugins() []string + func (r *Registry) Provider(seam string) string + func (r *Registry) SetBudgetGate(fn func(ctx context.Context, u Usage) bool) error + func (r *Registry) SetCompaction(s CompactionSettings) error + func (r *Registry) SetCompactionModel(p LLMProvider, model string) error + func (r *Registry) SetCompactor(c Compactor) error + func (r *Registry) SetContextWindow(tokens int) error + func (r *Registry) SetDefinition(d AgentDefinition) error + func (r *Registry) SetEnv(e Env) error + func (r *Registry) SetEscalation(rungs []ModelRung) error + func (r *Registry) SetFollowUpSource(fn func(ctx context.Context) []Message) error + func (r *Registry) SetGoal(goal string) error + func (r *Registry) SetLimits(l Limits) error + func (r *Registry) SetMaxTokens(n int) error + func (r *Registry) SetMemory(m MemoryStore) error + func (r *Registry) SetModel(p LLMProvider, model string) error + func (r *Registry) SetModelCapabilities(c ModelCapabilities) error + func (r *Registry) SetNativeProvider(p *ai.FallbackProvider) error + func (r *Registry) SetOutputSchema(s *OutputSchema) error + func (r *Registry) SetParallelToolCalls(enabled bool) error + func (r *Registry) SetPolicy(p Policy) error + func (r *Registry) SetPrepareNextTurn(fn func(ctx context.Context, state TurnState) TurnState) error + func (r *Registry) SetPromptCache(key, retention string) error + func (r *Registry) SetProviderSession(s *ProviderSession, id string) error + func (r *Registry) SetReasoningEffort(e string) error + func (r *Registry) SetRefreshKey(fn func(ctx context.Context, provider string) (string, error)) error + func (r *Registry) SetRetry(p RetryPolicy) error + func (r *Registry) SetSeedDisabledTools(names []string) error + func (r *Registry) SetSession(s SessionStore, id string, resume bool) error + func (r *Registry) SetSteeringSource(fn func(ctx context.Context) []Message) error + func (r *Registry) SetStepGate(fn func(ctx context.Context, turn int) error) error + func (r *Registry) SetToolChoice(choice ToolChoice) error + func (r *Registry) Unload(name string) error + func (r *Registry) UsePolicy(p Policy) error + type ReplayProvider struct + Records []TurnRecord + func NewReplayProvider(records ...TurnRecord) *ReplayProvider + func (r *ReplayProvider) Chat(_ context.Context, req ChatRequest) (ChatResponse, error) + func (r *ReplayProvider) Name() string + func (r *ReplayProvider) Stream(ctx context.Context, req ChatRequest) (<-chan ChatDelta, error) + func (r *ReplayProvider) SupportsTools() bool + type ResultCard struct + Kind string + Points []CardPoint + Stats []CardStat + Title string + Unit string + type ResumePlan struct + ActiveTools []string + Answers map[string]string + Completed bool + DisabledTools []string + Draft string + DroppedCalls []ToolCall + Goal string + Inbox []InboxItem + Interrupted bool + Messages []Message + Model string + RerunCompaction bool + RetryCalls []ToolCall + ToolOutcomes map[string]ToolOutcomeRecord + ToolProgress map[string]string + func RecoverSession(log []SessionEntry, tools *ToolSet, policy RecoveryPolicy) ResumePlan + type RetryPolicy = protocol.RetryPolicy + func DefaultRetryPolicy() RetryPolicy + type RetrySafeTool interface + RetrySafe func() bool + type RichTool interface + RunRich func(ctx context.Context, args string) (ToolOutput, error) + type Role = protocol.Role + type RunChapter struct + CostUSD float64 + FirstStep int + FirstTurn int + Index int + LastStep int + LastTurn int + Steps int + Summary string + Title string + TokensIn int + TokensOut int + ToolCalls int + func RunChapters(steps []LabStep) []RunChapter + type RunCloser interface + CloseRun func() + type RunCommandHandler interface + HandleRunCommand func(context.Context, json.RawMessage) (json.RawMessage, error) + type RunController interface + ControlRun func(context.Context, StepInfo) (reason string, err error) + type RunFinalizer interface + FinalizeRun func(context.Context, RunResult, error) error + type RunInfo struct + Agent *Agent + Bookkeeping func(tool string) bool + Depth int + Durable bool + Goal string + Limits Limits + Owner string + ScopeID string + Session SessionStore + SessionID string + type RunObserver interface + ObserveMessages func(ctx context.Context, phase ObservePhase, turn int, msgs []Message) + type RunResult struct + CommandResults map[string]json.RawMessage + Final string + Messages []Message + NativeRevision string + NativeState json.RawMessage + NativeTelemetry json.RawMessage + Parked bool + Question json.RawMessage + StopReason string + Tools []ToolTrace + Turns int + UnpersistedEntries int + Usage Usage + type RunStart struct + Messages []Message + System string + Task string + type Sandbox interface + Exec func(ctx context.Context, req SandboxExec) (SandboxResult, error) + type SandboxExec struct + Argv []string + Constraints SandboxLimits + Env map[string]string + Image string + Mounts []SandboxMount + Session string + Stdin string + Workdir string + type SandboxLimits struct + CPUs float64 + MemoryMB int + Network bool + NetworkAllow []string + PidsLimit int + RunAsHostUser bool + TimeoutSeconds float64 + WritableFS bool + type SandboxMount struct + ReadOnly bool + Source string + Target string + type SandboxProcess interface + Kill func() error + Stderr func() io.ReadCloser + Stdin func() io.WriteCloser + Stdout func() io.ReadCloser + Wait func() (SandboxResult, error) + type SandboxResult struct + ExitCode int + KillReason string + Killed bool + Stderr string + Stdout string + type SelfGated interface + SelfGated func() bool + type Session struct + CreatedAt time.Time + ID string + Messages []Message + ParentID string + ScopeID string + UpdatedAt time.Time + type SessionBatchStore interface + AppendBatch func(ctx context.Context, sessionID string, entries []SessionEntry) error + type SessionEntry struct + Answer string + CallID string + Content string + CreatedAt time.Time + Final bool + Goal string + ID string + Kind SessionEntryKind + Lane string + Message *Message + Model string + Outcome *ToolOutcomeRecord + ParentID string + Question json.RawMessage + Retained []Message + Seq int + State *CheckpointState + Summary string + Target string + Tool string + Tools []string + Turn int + Usage *Usage + func ActivePath(log []SessionEntry) []SessionEntry + func LoadResumeLog(ctx context.Context, store SessionStore, sessionID string) ([]SessionEntry, error) + type SessionEntryKind string + const EntryActiveToolsChange + const EntryAnswer + const EntryAssistantFrame + const EntryBranchSummary + const EntryCompaction + const EntryGoal + const EntryInbox + const EntryInboxDone + const EntryLeaf + const EntryLeafMove + const EntryMessage + const EntryModelChange + const EntryPiAnswer + const EntryPiChildResult + const EntryPiContextSummary + const EntryPiDelegation + const EntryPiDelegationBatch + const EntryPiEffectDone + const EntryPiEffectStart + const EntryPiEvent + const EntryPiGoal + const EntryPiGoalRevision + const EntryPiInvocation + const EntryPiModelSelection + const EntryPiState + const EntryQuestion + const EntryToolDisabled + const EntryToolOutcome + const EntryToolProgress + const EntryTurnInterrupted + type SessionLeaseStore interface + AcquireSessionLease func(ctx context.Context, sessionID string) (leaseCtx context.Context, release func() error, err error) + type SessionNode struct + Entry SessionEntry + ID string + ParentID string + func SessionTree(log []SessionEntry) []SessionNode + type SessionPlugin struct + ID string + ProviderSessionID string + ProviderState *ProviderSession + Resume bool + SeedDisabledTools []string + Store SessionStore + func (SessionPlugin) Name() string + func (p SessionPlugin) Register(r *Registry) error + type SessionSandbox interface + CloseSession func(id string) error + type SessionStore interface + Append func(ctx context.Context, sessionID string, entry SessionEntry) error + Log func(ctx context.Context, sessionID string) ([]SessionEntry, error) + type SessionWindowStore interface + CheckpointSeq func(ctx context.Context, sessionID string) (seq int, branched bool, err error) + LogFrom func(ctx context.Context, sessionID string, sinceSeq int) ([]SessionEntry, error) + type Severity string + const SeverityError + const SeverityWarning + type Skill struct + Body string + Description string + Enabled bool + ID string + Name string + type SkillLoader func(ctx context.Context, ids []string) (map[string]string, error) + type SteeringPlugin struct + FollowUp func(ctx context.Context) []Message + PrepareNextTurn func(ctx context.Context, state TurnState) TurnState + Steer func(ctx context.Context) []Message + func (SteeringPlugin) Name() string + func (p SteeringPlugin) Register(r *Registry) error + type StepDecision struct + AdditionalContexts []Message + type StepInfo struct + BookkeepingTurns int + Model string + Turn int + Usage Usage + type StepInterceptor interface + BeforeStep func(ctx context.Context, info StepInfo) StepDecision + type StopDecision struct + Continue bool + Inject []Message + Note string + StopReason string + type StopInfo struct + Attempt int + Final string + Tools []ToolTrace + Turns int + type StopInterceptor interface + TurnStopping func(ctx context.Context, info StopInfo) StopDecision + type StreamDecision struct + Abort bool + Inject []Message + type StreamEvent struct + Card *ResultCard + Note string + Question json.RawMessage + Token string + Tool *ToolTrace + Turn int + Type StreamEventType + type StreamEventType string + const StreamAgentEnd + const StreamAgentStart + const StreamCard + const StreamMessageEnd + const StreamMessageStart + const StreamProgress + const StreamQuestion + const StreamSavePoint + const StreamToken + const StreamTool + const StreamToolExecEnd + const StreamToolExecStart + const StreamToolExecUpdate + const StreamTurnEnd + const StreamTurnStart + type StreamInterceptor interface + InterceptStreamDelta func(ctx context.Context, accumulated string) StreamDecision + type StreamSink func(StreamEvent) + type StreamingTool interface + RunStreaming func(ctx context.Context, args string, emit func(partial string)) (string, error) + type StringTool struct + Description string + Execute func(context.Context, map[string]string) (string, error) + Properties map[string]any + Required []string + ToolName string + func (t StringTool) Name() string + func (t StringTool) Run(ctx context.Context, args string) (string, error) + func (t StringTool) Schema() ToolSchema + type Tool interface + Name func() string + Run func(ctx context.Context, args string) (string, error) + Schema func() ToolSchema + type ToolCall = protocol.ToolCall + type ToolChoice = protocol.ToolChoice + type ToolChoiceMode = protocol.ToolChoiceMode + type ToolContributor interface + Tools func() []Tool + type ToolDenialReason string + const ToolDenialAborted + type ToolGate struct + Allowed bool + CallID string + Error string + Reason string + type ToolInterceptor interface + InterceptToolResult func(ctx context.Context, call ToolCall, result string, runErr error) ToolResultDecision + type ToolInvocation struct + Executed bool + Trace ToolTrace + type ToolInvoker interface + InvokeTool func(ctx context.Context, name, args string) (ToolOutput, error) + func ToolInvokerFrom(ctx context.Context) (ToolInvoker, bool) + type ToolOutcomeRecord struct + Executed bool + Extra []Message + Invocations []ToolInvocation + Message Message + Terminate bool + Trace ToolTrace + type ToolOutput struct + AdditionalContexts []Message + Content string + Invocations []ToolInvocation + Parts []ContentPart + Terminate bool + type ToolResultArchiver interface + ArchiveToolResult func(context.Context, ToolCall, string) (string, error) + type ToolResultDecision struct + AdditionalContexts []Message + Meta string + Replace bool + Result string + ResultRef string + Terminate bool + type ToolSchema = protocol.ToolSchema + type ToolSet struct + func NewToolSet(tools ...Tool) *ToolSet + func (ts *ToolSet) Add(t Tool) + func (ts *ToolSet) Get(name string) (Tool, bool) + func (ts *ToolSet) Names() []string + func (ts *ToolSet) Schemas() []ToolSchema + func (ts *ToolSet) With(tools ...Tool) *ToolSet + type ToolStrictness = protocol.ToolStrictness + type ToolTrace struct + Allowed bool + Args string + CallID string + Error string + IdempotencyKey string + LatencyMS int64 + Reason string + ResultMeta string + SpillLocator string + Tool string + func (t ToolTrace) DeniedAborted() bool + type ToolsPlugin struct + Label string + Tools []Tool + func ToolsFromSet(ts *ToolSet) ToolsPlugin + func ToolsOf(list ...Tool) ToolsPlugin + func (p ToolsPlugin) Name() string + func (p ToolsPlugin) Register(r *Registry) error + type TurnHook func(ctx context.Context, info TurnInfo) + type TurnInfo struct + Model string + StopReason string + Turn int + Usage Usage + type TurnRecord struct + CostUSD float64 + Depth int + Error string + Messages []Message + NativeTrace json.RawMessage + ReasoningBlocks []ReasoningBlock + Response string + SessionKey string + StopReason string + TokensIn int + TokensOut int + ToolCalls []ToolCall + ToolGates []ToolGate + Tools []string + func ApplyLiveGates(records []TurnRecord, traces []ToolTrace) []TurnRecord + type TurnState struct + Messages []Message + Model string + System string + Tools *ToolSet + type Usage = protocol.Usage