Versions in this module Expand all Collapse all v0 v0.2.0 Jul 25, 2026 Changes in this version + const BlockImage + const BlockText + const BlockThinking + const BlockToolResult + const BlockToolUse + const EventAssistant + const EventCompaction + const EventError + const EventPartialAssistant + const EventPermissionRequest + const EventResult + const EventSkillCompleted + const EventSkillInvoked + const EventSkillsLoaded + const EventSubagent + const EventSystem + const EventToolCallEnd + const EventToolCallStart + const EventUsage + const EventUser + const IdempotencyNotApplicable + const IdempotencyOptional + const IdempotencyRequired + const IdempotencyUnsupported + const ObservationCompaction + const ObservationMCPCall + const ObservationPermissionCallback + const ObservationProviderAttempt + const ObservationStoreOperation + const ObservationToolExecution + const PermissionModeAcceptEdits + const PermissionModeDefault + const PermissionModeYolo + const RiskCritical + const RiskHigh + const RiskLow + const RiskMedium + const SideEffectIdempotent + const SideEffectNonIdempotent + const SideEffectNone + const SideEffectUnknown + const TrustHumanInstruction + const TrustSystemPolicy + const TrustToolResult + const TrustUntrustedContent + type Agent struct + func NewAgent(opts AgentOptions) (*Agent, error) + func (a *Agent) Close() error + func (a *Agent) Observe(ctx context.Context, observation core.Observation) + func (a *Agent) Options() AgentOptions + func (a *Agent) Session(ctx context.Context, opts SessionOptions) (*Session, error) + func (a *Agent) Store() core.SessionStore + type AgentOptions struct + CWD string + CloseTools bool + CompactionStrategy CompactionStrategy + CompactionThreshold float64 + DisableCompaction bool + DisableSkills bool + DisableSubagents bool + FilesystemPolicy tools.FilesystemPolicy + IncludePartialMessages bool + Logger *slog.Logger + MCPServers []mcp.ServerConfig + MaxOutputTokens *int + MaxRetries int + MaxTurns int + Model core.ModelID + Observer core.Observer + Permissions PermissionOptions + Principal core.Principal + ProblemSolving ProblemSolvingOptions + Provider core.Provider + ProviderFactory core.ProviderFactory + ProviderRetry *ProviderRetryPolicy + SessionStore core.SessionStore + SkillsDir string + SubagentsDir string + SystemPrompt string + ToolConcurrency int + ToolProfile tools.Profile + Tools *tools.Registry + func AgentOptionsFromConfig(opts config.AgentOptions) AgentOptions + type CanUseTool = permissions.CanUseTool + type CompactionRequest struct + ContextWindow int + EstimatedTokens int + Messages []core.Message + Model core.ModelID + Provider core.Provider + System []core.SystemBlock + Tools []core.ToolSchema + Trigger string + type CompactionResult struct + Changed bool + Messages []core.Message + type CompactionStrategy interface + Compact func(ctx context.Context, req CompactionRequest) (CompactionResult, error) + Name func() string + func DefaultCompactionStrategy() CompactionStrategy + type ContentBlock = core.ContentBlock + type ContentTrust = core.ContentTrust + type DescribedTool = core.DescribedTool + type Event = core.Event + type EventType = core.EventType + type FilesystemPolicy = tools.FilesystemPolicy + type IdempotencySupport = core.IdempotencySupport + type IdempotentTool = core.IdempotentTool + type ImageSource = core.ImageSource + type KeepLastTurnsCompactionStrategy struct + SummaryMaxOutputTokens int + Turns int + func (s KeepLastTurnsCompactionStrategy) Compact(ctx context.Context, req CompactionRequest) (CompactionResult, error) + func (s KeepLastTurnsCompactionStrategy) Name() string + type LegacyStreamingProvider = core.LegacyStreamingProvider + type MCPHTTPServerConfig = mcp.HTTPServerConfig + type MCPServerConfig = mcp.ServerConfig + type MCPStdioServerConfig = mcp.StdioServerConfig + type Message = core.Message + type ModelID = core.ModelID + type Observation = core.Observation + type ObservationType = core.ObservationType + type Observer = core.Observer + type PermissionMode = core.PermissionMode + type PermissionOptions struct + CanUseTool permissions.CanUseTool + Mode core.PermissionMode + Rules []permissions.Rule + type PermissionRule = permissions.Rule + type Principal = core.Principal + type ProblemSolvingOptions struct + AutoRepoMap bool + AutoVerify bool + Enabled bool + MaxConsecutiveToolErrors int + RequirePlanBeforeWrite bool + type Provider = core.Provider + type ProviderFactory = core.ProviderFactory + type ProviderRequest = core.ProviderRequest + type ProviderRetryPolicy struct + InitialBackoff time.Duration + MaxBackoff time.Duration + MaxRetries int + type ProviderStream = core.ProviderStream + type ProviderStreamEvent = core.ProviderStreamEvent + type ProviderStreamResult = core.ProviderStreamResult + type RiskLevel = core.RiskLevel + type RunHandle struct + func (h *RunHandle) Abort() + func (h *RunHandle) Close() + func (h *RunHandle) Done() <-chan struct{} + func (h *RunHandle) Events() <-chan core.Event + type RunImage struct + Data string + MediaType string + URL string + type RunOptions struct + Effort string + Images []RunImage + MaxOutputTokens *int + Temperature *float64 + Thinking map[string]interface{} + type Session struct + CreatedAt time.Time + ID string + Meta map[string]interface{} + Principal core.Principal + func (s *Session) Abort() + func (s *Session) MessageCount() int + func (s *Session) Metadata() map[string]interface{} + func (s *Session) Run(ctx context.Context, prompt string, opts RunOptions) <-chan core.Event + func (s *Session) StartRun(ctx context.Context, prompt string, opts RunOptions) *RunHandle + func (s *Session) UpdateMeta(meta map[string]interface{}) error + func (s *Session) UpdateMetaContext(ctx context.Context, meta map[string]interface{}) error + type SessionOptions struct + ID string + Meta map[string]interface{} + Principal core.Principal + type SessionStore = core.SessionStore + type SideEffectKind = core.SideEffectKind + type StopReason = core.StopReason + type StreamingProvider = core.StreamingProvider + type Tool = core.Tool + type ToolContext = core.ToolContext + type ToolDescriptor = core.ToolDescriptor + type ToolResult = core.ToolResult + type Usage = core.Usage