Versions in this module Expand all Collapse all v0 v0.1.0 Aug 22, 2026 Changes in this version + const AwaitAgentToolName + const CancelAgentToolName + const DefaultAnthropicVersion + const DefaultCharsPerToken + const DefaultFailoverCooldown + const DefaultKeepRecent + const DefaultListRunsLimit + const DefaultMaxAgentDepth + const DefaultMaxHandoffs + const DefaultMaxPerDrain + const DefaultMaxSteps + const DefaultOffloadPreview + const DefaultOffloadThreshold + const DefaultRecallTopK + const DefaultStubEmbedderDim + const DefaultTriggerBudget + const DefaultTriggerCooldown + const ForgetToolName + const ListAgentsToolName + const MetaKeyContextHint + const ReadToolResultName + const RecallToolName + const RememberToolName + const SignalParentToolName + const SpawnAgentToolName + var ErrInputRequired = errors.New("agent: tool requires mid-call input and no InputHandler is configured") + var ErrMaxHandoffs = errors.New("agent: max handoffs exceeded") + var ErrMaxSteps = errors.New("agent: max steps exceeded") + var ErrNotAvailableNow = errors.New("agent: tool source not available now") + var ErrSignalAbort = errors.New("agent: turn aborted by child signal") + var ErrTreeBudget = errors.New("agent: tree budget exhausted") + var ErrUnknownTool = errors.New("agent: unknown tool") + var ToolChoiceAuto = ToolChoice + var ToolChoiceNone = ToolChoice + var ToolChoiceRequired = ToolChoice + func AddAsyncFunc[In any](s *FuncSource, name, description string, ...) error + func AddFunc[In any](s *FuncSource, name, description string, ...) error + func DenyTool(reason string) error + func GrantAllPreempts(Signal) bool + func MergeWith[T any](merge func(acc, next T) T) func(acc, next IncomingEvent) IncomingEvent + func RaiseSignal(ctx context.Context, sig Signal) bool + func TypedFilter[T any](fn func(T) bool) func(IncomingEvent) bool + func TypedTransform[T any](fn func(T) (T, bool)) func(IncomingEvent) (IncomingEvent, bool) + func WithAgentCallBudget(ctx context.Context, n int) context.Context + func WithTreeBudget(ctx context.Context, b TreeBudget) context.Context + type AgentHop struct + Name string + type AgentPath []AgentHop + func (p AgentPath) Child(name string) AgentPath + func (p AgentPath) Contains(name string) bool + func (p AgentPath) Depth() int + func (p AgentPath) String() string + type AgentPool struct + func NewAgentPool(onEvent func(SubAgentEvent)) *AgentPool + func (p *AgentPool) Register(name, description string, runner *Runner, maxDepth int) error + func (p *AgentPool) Registered() []RegisteredAgent + type AgentSource struct + func NewAgentSource(cfg AgentSourceConfig) (*AgentSource, error) + func NewServerAgentSource(cfg ServerAgentConfig) (*AgentSource, error) + func (s *AgentSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (s *AgentSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type AgentSourceConfig struct + Description string + InputSchema json.RawMessage + MaxDepth int + Name string + OnEvent func(SubAgentEvent) + Runner *Runner + type AggregateHint struct + Strategy WindowStrategy + WindowMs int + type AnthropicConfig struct + APIKey string + BaseURL string + HTTPClient *http.Client + MaxTokens int + Model string + Version string + type AnthropicProvider struct + func NewAnthropicProvider(cfg AnthropicConfig) (*AnthropicProvider, error) + func (p *AnthropicProvider) Generate(ctx context.Context, req ProviderRequest) (*ProviderResponse, error) + func (p *AnthropicProvider) Stream(ctx context.Context, req ProviderRequest) (Stream, error) + type AppendEventsRequest struct + Events []Event + RunID string + type AppendEventsResponse struct + Found bool + type AppendMessagesRequest struct + Messages []Message + RunID string + type AppendMessagesResponse struct + Found bool + type ApprovalMode int + const ModeAlwaysAllow + const ModeAlwaysAsk + const ModeReadOnlyAuto + const ModeReversibleAuto + type AskFunc func(ctx context.Context, info ToolCallInfo) (bool, error) + type AsyncAgentSource struct + func NewAsyncAgentSource(cfg AsyncAgentSourceConfig) (*AsyncAgentSource, error) + func (s *AsyncAgentSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (s *AsyncAgentSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type AsyncAgentSourceConfig struct + Description string + InputSchema json.RawMessage + MaxDepth int + Name string + OnComplete func(name string, result *TurnResult, err error) + OnEvent func(SubAgentEvent) + Runner *Runner + type AsyncResult struct + Ack string + Await func(ctx context.Context) (IncomingEvent, error) + type CharTokenEstimator struct + CharsPerToken int + func (e CharTokenEstimator) Estimate(msgs []Message) int + type ClientSource struct + func NewClientSource(c *client.Client, opts ...ClientSourceOption) *ClientSource + func (s *ClientSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (s *ClientSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type ClientSourceOption func(*ClientSource) + func WithInputHandler(h client.InputHandler) ClientSourceOption + func WithTaskCompletionHook(fn func(*client.BackgroundTask)) ClientSourceOption + func WithTaskDetachHook(fn func(*client.BackgroundTask)) ClientSourceOption + func WithTaskGrace(d time.Duration) ClientSourceOption + func WithTaskStatusHook(fn func(*core.DetailedTask)) ClientSourceOption + type CompactionInfo struct + After int + Before int + type Compactor interface + Compact func(ctx context.Context, history []Message) ([]Message, error) + type ContextHint struct + Aggregate *AggregateHint + Priority string + Retention string + Sensitivity string + Template string + func HintFromMeta(meta map[string]any) (ContextHint, bool) + type Control struct + CallID string + type CreateRunRequest struct + RunID string + type CreateRunResponse struct + Created bool + RunID string + type CritiqueConfig struct + AllowOnError bool + Instructions string + Principles string + Provider Provider + Tools func(name string) bool + type DeleteMemoryRequest struct + Key string + Namespace string + type DeleteMemoryResponse struct + Deleted bool + type Delta struct + FinishReason string + Index int + Kind DeltaKind + Text string + ToolCallID string + ToolName string + Usage *Usage + type DeltaAccumulator struct + func (a *DeltaAccumulator) Add(d Delta) + func (a *DeltaAccumulator) Result() *ProviderResponse + type DeltaKind string + const DeltaFinish + const DeltaReasoning + const DeltaText + const DeltaToolCallArgs + const DeltaToolCallStart + const DeltaUsage + type ElicitationCoordinator struct + func NewElicitationCoordinator(ui ElicitationUI) *ElicitationCoordinator + func (c *ElicitationCoordinator) Confirm(ctx context.Context, message string) (bool, error) + func (c *ElicitationCoordinator) Handler() client.ElicitationHandler + type ElicitationUI func(ctx context.Context, req core.ElicitationRequest) (core.ElicitationResult, error) + type Embedder interface + Embed func(ctx context.Context, texts []string) ([]Embedding, error) + type Embedding []float32 + func (a Embedding) Cosine(b Embedding) float64 + type Event struct + Compaction *CompactionInfo + Error string + Kind EventKind + Reason string + Result *TurnResult + Signal *Signal + Step int + Text string + ToolCall *ToolCall + ToolResult *core.ToolResult + type EventInjectionConfig struct + Consent func(hint ContextHint, ev IncomingEvent) bool + Filters []func(IncomingEvent) bool + Hints map[string]ContextHint + MaxPerDrain int + Merge func(acc, next IncomingEvent) IncomingEvent + Transforms []func(IncomingEvent) (IncomingEvent, bool) + type EventInjectionPolicy struct + func NewEventInjectionPolicy(cfg EventInjectionConfig) *EventInjectionPolicy + func (p *EventInjectionPolicy) Drain() []InjectedContext + func (p *EventInjectionPolicy) Dropped() int + func (p *EventInjectionPolicy) Ingest(ev IncomingEvent) + func (p *EventInjectionPolicy) SetHint(name string, h ContextHint) + type EventKind string + const EventCompaction + const EventError + const EventSignal + const EventTextDelta + const EventThinkingBegin + const EventThinkingDelta + const EventThinkingEnd + const EventToolBegin + const EventToolCancelled + const EventToolDenied + const EventToolEnd + const EventToolError + const EventToolUnavailable + const EventTurnBegin + const EventTurnEnd + type FailoverConfig struct + Backup Provider + Cooldown time.Duration + Logger *slog.Logger + Primary Provider + type FailoverProvider struct + func NewFailoverProvider(cfg FailoverConfig) (*FailoverProvider, error) + func (f *FailoverProvider) Generate(ctx context.Context, req ProviderRequest) (*ProviderResponse, error) + func (f *FailoverProvider) Health() ProviderHealth + func (f *FailoverProvider) StartReconciler(ctx context.Context, interval time.Duration, probe func(context.Context) error) (stop func()) + func (f *FailoverProvider) Stream(ctx context.Context, req ProviderRequest) (Stream, error) + type FanOutConfig struct + Aggregate func([]FanOutResult) string + Description string + Members []*AgentSource + Name string + type FanOutResult struct + IsError bool + Name string + Text string + type FanOutSource struct + func NewFanOutSource(cfg FanOutConfig) (*FanOutSource, error) + func (s *FanOutSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (s *FanOutSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type FileToolResultStore struct + func NewFileToolResultStore(dir string) (*FileToolResultStore, error) + func (s *FileToolResultStore) GetToolResult(ctx context.Context, req GetToolResultRequest) (GetToolResultResponse, error) + func (s *FileToolResultStore) PutToolResult(ctx context.Context, req PutToolResultRequest) (PutToolResultResponse, error) + type FilterSource struct + func NewFilterSource(src ToolSource, keep func(core.ToolDef) bool) *FilterSource + func (f *FilterSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (f *FilterSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type ForkRunRequest struct + AtMessage int + NewRunID string + RunID string + type ForkRunResponse struct + Created bool + ForkPoint int + Found bool + RunID string + type FuncSource struct + func NewFuncSource() *FuncSource + func NewSignalSource() *FuncSource + func NewSpawnSource(pool *AgentPool) *FuncSource + func (s *FuncSource) AddToolFunc(def core.ToolDef, ...) error + func (s *FuncSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (s *FuncSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type GenerationParams struct + MaxTokens int + Temperature *float64 + ToolChoice ToolChoice + type GetToolResultRequest struct + Ref string + type GetToolResultResponse struct + Found bool + Result core.ToolResult + type InMemoryMemoryStore struct + func NewInMemoryMemoryStore(opts ...MemoryStoreOption) *InMemoryMemoryStore + func (s *InMemoryMemoryStore) DeleteMemory(ctx context.Context, req DeleteMemoryRequest) (DeleteMemoryResponse, error) + func (s *InMemoryMemoryStore) ListMemories(ctx context.Context, req ListMemoriesRequest) (ListMemoriesResponse, error) + func (s *InMemoryMemoryStore) PutMemory(ctx context.Context, req PutMemoryRequest) (PutMemoryResponse, error) + type InMemoryRunStore struct + func NewInMemoryRunStore() *InMemoryRunStore + func (s *InMemoryRunStore) AppendEvents(ctx context.Context, req AppendEventsRequest) (AppendEventsResponse, error) + func (s *InMemoryRunStore) AppendMessages(ctx context.Context, req AppendMessagesRequest) (AppendMessagesResponse, error) + func (s *InMemoryRunStore) CreateRun(ctx context.Context, req CreateRunRequest) (CreateRunResponse, error) + func (s *InMemoryRunStore) ForkRun(ctx context.Context, req ForkRunRequest) (ForkRunResponse, error) + func (s *InMemoryRunStore) ListRuns(ctx context.Context, req ListRunsRequest) (ListRunsResponse, error) + func (s *InMemoryRunStore) LoadRun(ctx context.Context, req LoadRunRequest) (LoadRunResponse, error) + type InMemorySemanticStore struct + func NewInMemorySemanticStore(embedder Embedder, opts ...InMemorySemanticStoreOption) (*InMemorySemanticStore, error) + func (s *InMemorySemanticStore) DeleteMemory(ctx context.Context, req DeleteMemoryRequest) (DeleteMemoryResponse, error) + func (s *InMemorySemanticStore) ListMemories(ctx context.Context, req ListMemoriesRequest) (ListMemoriesResponse, error) + func (s *InMemorySemanticStore) PutMemory(ctx context.Context, req PutMemoryRequest) (PutMemoryResponse, error) + type InMemorySemanticStoreOption func(*InMemorySemanticStore) + func WithSemanticMaxMemories(n int) InMemorySemanticStoreOption + func WithSemanticTracerProvider(tp core.TracerProvider) InMemorySemanticStoreOption + type InMemoryToolResultStore struct + func NewInMemoryToolResultStore(opts ...ToolResultStoreOption) *InMemoryToolResultStore + func (s *InMemoryToolResultStore) GetToolResult(ctx context.Context, req GetToolResultRequest) (GetToolResultResponse, error) + func (s *InMemoryToolResultStore) PutToolResult(ctx context.Context, req PutToolResultRequest) (PutToolResultResponse, error) + type IncomingEvent struct + Cursor string + Data core.RawJSON + ID string + Meta map[string]any + Name string + Server string + Time time.Time + func ShallowMergeJSON(acc, next IncomingEvent) IncomingEvent + type InjectedContext struct + Event IncomingEvent + Priority string + Text string + type ListMemoriesRequest struct + Limit int + Namespace string + Query string + type ListMemoriesResponse struct + Items []ScoredMemory + type ListRunsRequest struct + Cursor string + Limit int + type ListRunsResponse struct + NextCursor string + Runs []RunInfo + type LoadRunRequest struct + RunID string + type LoadRunResponse struct + Found bool + Run Run + type MarkRequest struct + Content string + Marker string + Provenance Provenance + ToolName string + type MemoryItem struct + CreatedAt time.Time + Key string + Value string + type MemorySource struct + func NewMemorySource(store MemoryStore, opts ...MemorySourceOption) (*MemorySource, error) + func (m *MemorySource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (m *MemorySource) RecallRelevant(ctx context.Context, query string, opts RecallOptions) (string, error) + func (m *MemorySource) Summary(ctx context.Context, opts SummaryOptions) (string, error) + func (m *MemorySource) Tools(ctx context.Context) ([]core.ToolDef, error) + type MemorySourceOption func(*MemorySource) + func WithMemoryNamespaceFunc(fn func() string) MemorySourceOption + type MemoryStore interface + DeleteMemory func(ctx context.Context, req DeleteMemoryRequest) (DeleteMemoryResponse, error) + ListMemories func(ctx context.Context, req ListMemoriesRequest) (ListMemoriesResponse, error) + PutMemory func(ctx context.Context, req PutMemoryRequest) (PutMemoryResponse, error) + type MemoryStoreOption func(*InMemoryMemoryStore) + func WithMaxMemories(n int) MemoryStoreOption + type Message struct + Role Role + Text string + Timestamp time.Time + ToolCallID string + ToolCalls []ToolCall + type MultiOption func(*MultiSource) + func WithCollisionNotify(fn func(name string, sourceIDs []string)) MultiOption + func WithResolver(r Resolver) MultiOption + type MultiSource struct + func NewMultiSource(opts ...MultiOption) *MultiSource + func (m *MultiSource) Add(id string, src ToolSource) error + func (m *MultiSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (m *MultiSource) Invalidate() + func (m *MultiSource) OwnerOf(ctx context.Context, name string, args map[string]any) (sourceID string, found bool) + func (m *MultiSource) Remove(id string) + func (m *MultiSource) SourceTools(ctx context.Context, id string) (defs []core.ToolDef, found bool, err error) + func (m *MultiSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type OffloadConfig struct + PerToolThreshold map[string]int + PreviewLen int + Threshold int + type OffloadingSource struct + func NewOffloadingSource(src ToolSource, store ToolResultStore, cfg OffloadConfig) *OffloadingSource + func (o *OffloadingSource) Call(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + func (o *OffloadingSource) Tools(ctx context.Context) ([]core.ToolDef, error) + type OpenAIConfig struct + APIKey string + BaseURL string + HTTPClient *http.Client + Model string + type OpenAIEmbedder struct + func NewOpenAIEmbedder(cfg OpenAIEmbedderConfig) (*OpenAIEmbedder, error) + func (e *OpenAIEmbedder) Embed(ctx context.Context, texts []string) ([]Embedding, error) + type OpenAIEmbedderConfig struct + APIKey string + BaseURL string + HTTPClient *http.Client + Model string + TracerProvider core.TracerProvider + type OpenAIProvider struct + func NewOpenAIProvider(cfg OpenAIConfig) (*OpenAIProvider, error) + func (p *OpenAIProvider) Generate(ctx context.Context, req ProviderRequest) (*ProviderResponse, error) + func (p *OpenAIProvider) Stream(ctx context.Context, req ProviderRequest) (Stream, error) + type Provenance string + const ProvenanceAgent + const ProvenanceOperator + const ProvenanceServer + const ProvenanceWorld + type Provider interface + Generate func(ctx context.Context, req ProviderRequest) (*ProviderResponse, error) + Stream func(ctx context.Context, req ProviderRequest) (Stream, error) + func NewThinkingProvider(p Provider, openTag, closeTag string) Provider + type ProviderError struct + Body string + StatusCode int + func (e *ProviderError) Error() string + type ProviderHealth struct + Active string + ConsecutiveFailures int + LastError string + LastFailureAt time.Time + type ProviderRequest struct + Instructions string + MaxTokens int + Messages []Message + ResponseSchema core.RawJSON + Temperature *float64 + ToolChoice ToolChoice + Tools []core.ToolDef + type ProviderResponse struct + FinishReason string + Reasoning string + Text string + ToolCalls []ToolCall + Usage *Usage + type PutMemoryRequest struct + Item MemoryItem + Namespace string + type PutMemoryResponse struct + type PutToolResultRequest struct + Ref string + Result core.ToolResult + type PutToolResultResponse struct + type RecallOptions struct + MinScore float64 + TopK int + type RegisteredAgent struct + Description string + Name string + type Resolver func(name string, candidates []ToolOwner, args map[string]any) (sourceID string, err error) + type Role string + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + type Run struct + CreatedAt time.Time + Events []Event + ForkPoint int + ID string + Messages []Message + ParentID string + type RunInfo struct + CreatedAt time.Time + ForkPoint int + ID string + MessageCount int + ParentID string + type RunScope struct + CallBudget int + Path AgentPath + Tree TreeUsage + func ScopeFrom(ctx context.Context) RunScope + func (s RunScope) Depth() int + type RunStore interface + AppendEvents func(ctx context.Context, req AppendEventsRequest) (AppendEventsResponse, error) + AppendMessages func(ctx context.Context, req AppendMessagesRequest) (AppendMessagesResponse, error) + CreateRun func(ctx context.Context, req CreateRunRequest) (CreateRunResponse, error) + ForkRun func(ctx context.Context, req ForkRunRequest) (ForkRunResponse, error) + ListRuns func(ctx context.Context, req ListRunsRequest) (ListRunsResponse, error) + LoadRun func(ctx context.Context, req LoadRunRequest) (LoadRunResponse, error) + type Runner struct + func NewRunner(cfg RunnerConfig) (*Runner, error) + func (r *Runner) Run(ctx context.Context, history []Message, emit func(Event)) (*TurnResult, error) + func (r *Runner) RunTurn(ctx context.Context, req TurnRequest) (*TurnResult, error) + type RunnerConfig struct + Compactor Compactor + Generation GenerationParams + Instructions string + InstructionsFunc func(context.Context) string + Interruptible bool + MaxSteps int + MeterProvider core.MeterProvider + PreemptGrant func(sig Signal) bool + Provider Provider + ResponseSchema core.RawJSON + Selector ToolSelector + SignalPolicy SignalPolicy + ToolMiddleware []ToolMiddleware + Tools ToolSource + TracerProvider core.TracerProvider + TreeBudget TreeBudget + type ScoredMemory struct + Item MemoryItem + Score float64 + type ServerAgentConfig struct + Backing ToolSource + Description string + Instructions string + MaxDepth int + MaxSteps int + MeterProvider core.MeterProvider + Name string + OnEvent func(SubAgentEvent) + Provider Provider + ResponseSchema core.RawJSON + Tools []core.ToolDef + TracerProvider core.TracerProvider + type Signal struct + Data core.RawJSON + Kind SignalKind + Name string + Note string + Source string + type SignalAction struct + AbortTurn bool + Reason string + func AbortOnEscalate(signals []Signal) SignalAction + type SignalKind string + const SignalCustom + const SignalEscalate + const SignalPreempt + type SignalPolicy func(signals []Signal) SignalAction + type SpawnStatus struct + ID string + Name string + Status string + type SpotlightConfig struct + Classify func(ToolCallInfo) Provenance + Mark func(MarkRequest) string + type Stream interface + Close func() error + Recv func() (Delta, error) + type StubEmbedder struct + Dim int + func (e StubEmbedder) Embed(ctx context.Context, texts []string) ([]Embedding, error) + type StubProvider struct + func NewStubProvider(turns ...StubTurn) *StubProvider + func (s *StubProvider) Generate(ctx context.Context, req ProviderRequest) (*ProviderResponse, error) + func (s *StubProvider) Requests() []ProviderRequest + func (s *StubProvider) Stream(ctx context.Context, req ProviderRequest) (Stream, error) + type StubTurn struct + Deltas []Delta + Err error + FinishReason string + Text string + ToolCalls []ToolCall + type SubAgentEvent struct + Depth int + Event Event + Scope string + type SummarizingCompactor struct + func NewSummarizingCompactor(cfg SummarizingConfig) (*SummarizingCompactor, error) + func (c *SummarizingCompactor) Compact(ctx context.Context, history []Message) ([]Message, error) + type SummarizingConfig struct + Estimator TokenEstimator + Instructions string + KeepRecent int + MaxTokens int + Provider Provider + type SummaryOptions struct + MaxChars int + MaxItems int + type Team struct + func NewTeam(cfg TeamConfig) (*Team, error) + func (t *Team) Run(ctx context.Context, input string, emit func(Event)) (*TurnResult, error) + func (t *Team) RunTurn(ctx context.Context, history []Message, active string, emit func(Event)) (*TurnResult, string, error) + func (t *Team) StartAgent() string + func (t *Team) ToolDefs(ctx context.Context) (map[string][]core.ToolDef, error) + type TeamConfig struct + MaxHandoffs int + Members []TeamMember + OnEvent func(SubAgentEvent) + OnHandoff func(from, to string) + Start string + type TeamMember struct + Config RunnerConfig + HandoffTo []string + Name string + type TieredApproval struct + func NewTieredApproval(opts ...TieredOption) *TieredApproval + func (t *TieredApproval) DefaultMode() ApprovalMode + func (t *TieredApproval) SetDefaultMode(m ApprovalMode) + func (t *TieredApproval) WrapToolCall(ctx context.Context, info ToolCallInfo, next ToolCallFunc) (*core.ToolResult, error) + type TieredOption func(*TieredApproval) + func WithAsk(ask AskFunc) TieredOption + func WithDefaultMode(m ApprovalMode) TieredOption + func WithRememberApprovals(remember bool) TieredOption + func WithToolRule(tool string, rule ToolRule) TieredOption + type TokenEstimator interface + Estimate func(msgs []Message) int + type ToolCall struct + Args core.RawJSON + ID string + Name string + type ToolCallFunc func(ctx context.Context, info ToolCallInfo) (*core.ToolResult, error) + type ToolCallInfo struct + Call ToolCall + Destructive bool + Idempotent bool + ReadOnly bool + Scope RunScope + Step int + type ToolChoice struct + Mode string + Name string + func ToolChoiceFunc(name string) ToolChoice + func (tc ToolChoice) IsZero() bool + type ToolDeniedError struct + ModelReason string + Reason string + func (e *ToolDeniedError) Error() string + type ToolMiddleware func(ctx context.Context, info ToolCallInfo, next ToolCallFunc) (*core.ToolResult, error) + func AfterToolCall(...) ToolMiddleware + func BeforeToolCall(fn func(ctx context.Context, info *ToolCallInfo) error) ToolMiddleware + func NewCritiqueGate(cfg CritiqueConfig) (ToolMiddleware, error) + func Spotlight(cfg SpotlightConfig) ToolMiddleware + type ToolOwner struct + Def core.ToolDef + SourceID string + type ToolResultStore interface + GetToolResult func(ctx context.Context, req GetToolResultRequest) (GetToolResultResponse, error) + PutToolResult func(ctx context.Context, req PutToolResultRequest) (PutToolResultResponse, error) + type ToolResultStoreOption func(*InMemoryToolResultStore) + func WithMaxToolResults(n int) ToolResultStoreOption + type ToolRule int + const RuleAllow + const RuleAsk + const RuleDeny + type ToolSelector func(ctx context.Context, history []Message, tools []core.ToolDef) ([]core.ToolDef, error) + type ToolSource interface + Call func(ctx context.Context, name string, args map[string]any) (*core.ToolResult, error) + Tools func(ctx context.Context) ([]core.ToolDef, error) + type TreeBudget struct + MaxSteps int + MaxTokens int + type TreeUsage struct + MaxSteps int + MaxTokens int + StepsUsed int + TokensUsed int + type TriggerBinding struct + Cooldown time.Duration + Event string + Filter func(IncomingEvent) bool + Instructions string + Label string + Server string + type TriggerFiring struct + Binding TriggerBinding + Event IncomingEvent + type TriggerPolicy struct + func NewTriggerPolicy(cfg TriggerPolicyConfig) *TriggerPolicy + func (t *TriggerPolicy) Add(b TriggerBinding) + func (t *TriggerPolicy) Bindings() []TriggerBinding + func (t *TriggerPolicy) Firings() int + func (t *TriggerPolicy) NotifyEngagement() + func (t *TriggerPolicy) OnEvent(ev IncomingEvent) *TriggerFiring + func (t *TriggerPolicy) Remove(server, event, label string) bool + type TriggerPolicyConfig struct + Bindings []TriggerBinding + Budget int + Consent func(TriggerBinding, IncomingEvent) bool + Logger *slog.Logger + type TurnRequest struct + Control <-chan Control + Emit func(Event) + Generation GenerationParams + History []Message + type TurnResult struct + FinishReason string + Messages []Message + Steps int + Structured core.RawJSON + Text string + Usage Usage + type Usage struct + InputTokens int + OutputTokens int + type WindowStrategy string + const WindowDebounce + const WindowLastWins + const WindowMerge