Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyRegistryConfig(registry *Registry, cfg RegistryConfig)
- func DefaultRetryable(err error) bool
- func FormatActivityLog(group *ActivityGroup) string
- func FromJSON(jsonStr string) (*builtin.Result, error)
- func GovernedToolNames(registry *Registry, evaluator types.RuleEvaluator, role, taskType string, ...) []string
- func IsToolAllowed(name string, allowed []string) bool
- func RequiredTierForTool(t Tool) types.PermissionTier
- func SetResultEncoding(useToon bool)
- func ToJSON(r *builtin.Result) (string, error)
- func ToOpenAIFunction(t Tool) map[string]any
- type ActivityGroup
- type ActivityGroupingConfig
- type ActivityTracker
- type Category
- type ContextTool
- type Cost
- type Executable
- type ExecutableKind
- type ExecutionContext
- type ExecutionRegistry
- type ExecutionResult
- type Executor
- type HookRegistry
- func (h *HookRegistry) PostHooks(toolName string) []PostHook
- func (h *HookRegistry) PreHooks(toolName string) []PreHook
- func (h *HookRegistry) RegisterPostHook(toolName string, hook PostHook)
- func (h *HookRegistry) RegisterPreHook(toolName string, hook PreHook)
- func (h *HookRegistry) UnregisterHook(toolName string, hook any)
- type HookResult
- type Impact
- type Intent
- type IntentBuilder
- type IntentFormatter
- type IntentHistory
- func (h *IntentHistory) Add(intent Intent)
- func (h *IntentHistory) Clear()
- func (h *IntentHistory) Count() int
- func (h *IntentHistory) GetAll() []Intent
- func (h *IntentHistory) GetByPhase(phase string) []Intent
- func (h *IntentHistory) GetLatest() *Intent
- func (h *IntentHistory) GetRecent(n int) []Intent
- type IntentLibrary
- func (l *IntentLibrary) AnalyzingCodebase(phase string, target string) Intent
- func (l *IntentLibrary) FixingIssue(issueID int, title string) Intent
- func (l *IntentLibrary) GeneratingArtifact(artifactType string) Intent
- func (l *IntentLibrary) ImplementingTask(taskID int, description string) Intent
- func (l *IntentLibrary) RefactoringCode(description string) Intent
- func (l *IntentLibrary) RunningTests(testPath string) Intent
- func (l *IntentLibrary) SearchingForPattern(pattern string, scope string) Intent
- func (l *IntentLibrary) ValidatingImplementation(aspect string) Intent
- type Middleware
- func Chain(middlewares ...Middleware) Middleware
- func DefaultMiddlewareStack(cfg MiddlewareConfig) []Middleware
- func DockerSandboxMiddleware(sandbox SandboxExecutor, kindLookup func(string) string) Middleware
- func FileChangeTracking(watcher *filewatch.FileWatcher) Middleware
- func Hooks(registry *HookRegistry) Middleware
- func PanicRecovery() Middleware
- func Progress(manager ProgressTracker, longRunning map[string]string) Middleware
- func ResultSizeLimit(maxBytes int, suffix string) Middleware
- func Retry(cfg RetryConfig) Middleware
- func Timeout(defaultTimeout time.Duration, perTool map[string]time.Duration) Middleware
- func ToastNotifications(manager ToastNotifier) Middleware
- func Validation(cfg ValidationConfig, onError func(tool, param, msg string)) Middleware
- type MiddlewareConfig
- type PermissionDeniedError
- type PoolConfig
- type PoolMode
- type PostHook
- type PreHook
- type ProgressTracker
- type Registry
- func (r *Registry) Close() error
- func (r *Registry) ConfigureContainers(cfg *config.Config, repoRoot string)
- func (r *Registry) ConfigureDockerSandbox(cfg *config.Config, workDir string)
- func (r *Registry) ConfigureTodoPlanning(llmClient builtin.PlanningClient, planningModel string)
- func (r *Registry) ContainerInfo() (enabled bool, composePath string, workDir string)
- func (r *Registry) Count() int
- func (r *Registry) DisableContainers()
- func (r *Registry) EnableCodeIndex(store *storage.Store)
- func (r *Registry) EnableContainers(composePath, workDir string)
- func (r *Registry) EnableMissionControl(store *mission.Store, agentID string, requireApproval bool, ...)
- func (r *Registry) EnableSemanticSearch(searcher *embeddings.Searcher)
- func (r *Registry) EnableTelemetry(hub *telemetry.Hub, sessionID string)
- func (r *Registry) Execute(name string, params map[string]any) (*builtin.Result, error)
- func (r *Registry) ExecuteWithContext(ctx context.Context, name string, params map[string]any) (*builtin.Result, error)
- func (r *Registry) Filter(keep func(Tool) bool)
- func (r *Registry) Get(name string) (Tool, bool)
- func (r *Registry) GetTodoTool() *builtin.TodoTool
- func (r *Registry) Hooks() *HookRegistry
- func (r *Registry) List() []Tool
- func (r *Registry) LoadDefaultPlugins() error
- func (r *Registry) LoadExternal(pluginDir string) error
- func (r *Registry) LoadExternalFromMultipleDirs(dirs []string) error
- func (r *Registry) Register(t Tool)
- func (r *Registry) Remove(name string)
- func (r *Registry) RequiredTier(name string) types.PermissionTier
- func (r *Registry) SetCompactionManager(compactor builtin.Compactor)
- func (r *Registry) SetContainerContext(composePath, workDir string)
- func (r *Registry) SetEnv(env map[string]string)
- func (r *Registry) SetMaxExecTimeSeconds(seconds int32)
- func (r *Registry) SetMaxFileSizeBytes(max int64)
- func (r *Registry) SetMaxOutputBytes(max int)
- func (r *Registry) SetSandboxConfig(cfg any)
- func (r *Registry) SetTodoStore(store builtin.TodoStore)
- func (r *Registry) SetToolKind(toolName, kind string)
- func (r *Registry) SetWorkDir(workDir string)
- func (r *Registry) ToOpenAIFunctions() []map[string]any
- func (r *Registry) ToOpenAIFunctionsFiltered(allowed []string) []map[string]any
- func (r *Registry) ToOpenAIFunctionsGoverned(evaluator types.RuleEvaluator, role, taskType string, baseAllowed []string, ...) []map[string]any
- func (r *Registry) ToolKind(toolName string) string
- func (r *Registry) UpdateMissionAgent(agentID string)
- func (r *Registry) UpdateMissionSession(sessionID string)
- func (r *Registry) UpdateTelemetrySession(sessionID string)
- func (r *Registry) Use(mw Middleware)
- type RegistryConfig
- type RegistryOption
- type RetryConfig
- type RichTool
- type SandboxExecutor
- type SandboxRequest
- type SandboxResult
- type ToastNotifier
- type Tool
- type ToolCall
- type ToolMetadata
- type ToolPool
- type ValidationConfig
- type ValidationRule
- type Validator
Constants ¶
const ( DefaultToolTimeout = 2 * time.Minute DefaultToolMaxResult = 100_000 DefaultRetryMaxAttempts = 2 DefaultRetryInitial = 200 * time.Millisecond DefaultRetryMax = 2 * time.Second DefaultRetryMultiplier = 2 DefaultRetryJitter = 0.2 )
const ProgressIndeterminate = "indeterminate"
ProgressIndeterminate is the mode value for indeterminate progress bars.
const ToolCallIDParam = "__buckley_tool_call_id"
ToolCallIDParam allows callers to attach a stable tool call ID for telemetry.
Variables ¶
var DefaultLongRunningTools = map[string]string{
"run_shell": "Shell command",
"search_text": "Searching",
"search_replace": "Replacing",
"find_files": "Scanning files",
"git_diff": "Diff",
"git_log": "Git log",
"analyze_complexity": "Analyzing complexity",
"find_duplicates": "Finding duplicates",
"generate_test": "Generating tests",
}
DefaultLongRunningTools lists tools that should trigger progress indicators.
Functions ¶
func ApplyRegistryConfig ¶
func ApplyRegistryConfig(registry *Registry, cfg RegistryConfig)
ApplyRegistryConfig applies registry defaults and middleware settings.
func DefaultRetryable ¶
DefaultRetryable determines whether an error should be retried.
func FormatActivityLog ¶
func FormatActivityLog(group *ActivityGroup) string
FormatActivityLog formats an activity group for display
func GovernedToolNames ¶ added in v1.1.0
func GovernedToolNames(registry *Registry, evaluator types.RuleEvaluator, role, taskType string, baseAllowed []string, budgetUtil float64) []string
GovernedToolNames returns the tool list after skill and arbiter filtering.
func IsToolAllowed ¶
IsToolAllowed returns true if the tool name is allowed by the filter. An empty allowed list means all tools are allowed.
func RequiredTierForTool ¶ added in v1.1.0
func RequiredTierForTool(t Tool) types.PermissionTier
RequiredTierForTool infers the permission tier for a tool from its metadata.
func SetResultEncoding ¶
func SetResultEncoding(useToon bool)
SetResultEncoding toggles whether tool outputs use TOON or JSON encoding.
func ToOpenAIFunction ¶
ToOpenAIFunction converts a tool to OpenAI function calling format
Types ¶
type ActivityGroup ¶
type ActivityGroup struct {
Category Category // Category of tools in this group
StartTime time.Time // When first tool was called
EndTime time.Time // When last tool was completed
ToolCalls []ToolCall // Individual tool calls in this group
Summary string // Human-readable summary
}
ActivityGroup represents a group of related tool calls
type ActivityGroupingConfig ¶
type ActivityGroupingConfig struct {
WindowSeconds int // Time window for grouping (default: 30)
Enabled bool
}
ActivityGroupingConfig holds configuration for activity grouping
func DefaultActivityGroupingConfig ¶
func DefaultActivityGroupingConfig() ActivityGroupingConfig
DefaultActivityGroupingConfig returns sensible defaults
type ActivityTracker ¶
type ActivityTracker struct {
// contains filtered or unexported fields
}
ActivityTracker tracks tool calls and groups them for display
func NewActivityTracker ¶
func NewActivityTracker(config ActivityGroupingConfig) *ActivityTracker
NewActivityTracker creates a new activity tracker
func (*ActivityTracker) GetGroups ¶
func (t *ActivityTracker) GetGroups() []ActivityGroup
GetGroups returns all activity groups
func (*ActivityTracker) GetLatestGroup ¶
func (t *ActivityTracker) GetLatestGroup() *ActivityGroup
GetLatestGroup returns the most recent activity group
func (*ActivityTracker) RecordCall ¶
func (t *ActivityTracker) RecordCall(tool Tool, params map[string]any, result *builtin.Result, startTime, endTime time.Time)
RecordCall records a tool call for potential grouping
type Category ¶
type Category string
Category represents the functional category of a tool
const ( CategoryCodebase Category = "codebase" // grep, find_symbol, search CategoryGit Category = "git" // git_status, git_diff, git_log CategoryTesting Category = "testing" // run_tests, generate_test CategoryFilesystem Category = "filesystem" // read, write, edit, list CategoryRefactoring Category = "refactoring" // rename_symbol, extract_function CategoryDocumentation Category = "documentation" // generate_docstring, explain_code CategoryAnalysis Category = "analysis" // analyze_complexity, find_duplicates CategoryDelegation Category = "delegation" // buckley, subagent, codex CategoryBrowser Category = "browser" // headless_browse CategoryShell Category = "shell" // shell_command CategoryPlanning Category = "planning" // todo, checkpoint )
type ContextTool ¶
type ContextTool interface {
ExecuteWithContext(ctx context.Context, params map[string]any) (*builtin.Result, error)
}
ContextTool is an optional interface for tools that accept contexts.
type Executable ¶ added in v1.1.0
type Executable interface {
Name() string
Kind() ExecutableKind
RequiredTier() types.PermissionTier
Execute(ctx context.Context, input map[string]any) (*ExecutionResult, error)
}
Executable is the unified interface for both tools and slash commands.
type ExecutableKind ¶ added in v1.1.0
type ExecutableKind int
ExecutableKind distinguishes tools from commands.
const ( ToolKind ExecutableKind = iota CommandKind )
type ExecutionContext ¶
type ExecutionContext struct {
Context context.Context
ToolName string
Tool Tool
SessionID string
CallID string
Params map[string]any
StartTime time.Time
Attempt int
Metadata map[string]any
}
ExecutionContext carries request metadata through the middleware chain.
type ExecutionRegistry ¶ added in v1.1.0
type ExecutionRegistry struct {
// contains filtered or unexported fields
}
ExecutionRegistry is the single dispatch surface with arbiter governance.
func NewExecutionRegistry ¶ added in v1.1.0
func NewExecutionRegistry( evaluator types.RuleEvaluator, escalator types.PermissionEscalator, sandbox types.SandboxResolver, ) *ExecutionRegistry
NewExecutionRegistry creates a governed execution registry.
func (*ExecutionRegistry) Execute ¶ added in v1.1.0
func (r *ExecutionRegistry) Execute(ctx context.Context, name string, input map[string]any, role string) (*ExecutionResult, error)
Execute dispatches a named executable with full governance.
func (*ExecutionRegistry) FilterTo ¶ added in v1.1.0
func (r *ExecutionRegistry) FilterTo(config PoolConfig) *ToolPool
FilterTo creates a ToolPool from the registry with the given config.
func (*ExecutionRegistry) Register ¶ added in v1.1.0
func (r *ExecutionRegistry) Register(exec Executable)
Register adds an executable to the registry.
type ExecutionResult ¶ added in v1.1.0
ExecutionResult is the output of an executable.
type Executor ¶
type Executor func(ctx *ExecutionContext) (*builtin.Result, error)
Executor is the function signature for tool execution.
type HookRegistry ¶
type HookRegistry struct {
// contains filtered or unexported fields
}
HookRegistry stores pre/post hooks per tool name.
func (*HookRegistry) PostHooks ¶
func (h *HookRegistry) PostHooks(toolName string) []PostHook
PostHooks returns hooks in order: "*" then tool-specific.
func (*HookRegistry) PreHooks ¶
func (h *HookRegistry) PreHooks(toolName string) []PreHook
PreHooks returns hooks in order: "*" then tool-specific.
func (*HookRegistry) RegisterPostHook ¶
func (h *HookRegistry) RegisterPostHook(toolName string, hook PostHook)
RegisterPostHook registers a post-hook for a tool name or "*".
func (*HookRegistry) RegisterPreHook ¶
func (h *HookRegistry) RegisterPreHook(toolName string, hook PreHook)
RegisterPreHook registers a pre-hook for a tool name or "*".
func (*HookRegistry) UnregisterHook ¶
func (h *HookRegistry) UnregisterHook(toolName string, hook any)
UnregisterHook removes a previously registered hook for a tool name or "*".
type HookResult ¶
type HookResult struct {
Abort bool
ModifiedParams map[string]any
AbortReason string
AbortResult *builtin.Result
}
HookResult describes how a pre-hook wants to adjust execution.
type Intent ¶
type Intent struct {
Phase string // "planning", "execution", "review"
Activity string // High-level activity description
Tools []string // Tools that will be used
ExpectedTime string // Estimated time (e.g., "~30 seconds")
Timestamp time.Time // When intent was declared
}
Intent represents a statement of what the agent is about to do
type IntentBuilder ¶
type IntentBuilder struct {
// contains filtered or unexported fields
}
IntentBuilder helps construct intent statements
func NewIntentBuilder ¶
func NewIntentBuilder(phase string) *IntentBuilder
NewIntentBuilder creates a new intent builder
func (*IntentBuilder) Activity ¶
func (b *IntentBuilder) Activity(activity string) *IntentBuilder
Activity sets the high-level activity description
func (*IntentBuilder) AddParam ¶
func (b *IntentBuilder) AddParam(key string, value any) *IntentBuilder
AddParam adds a parameter for template substitution
func (*IntentBuilder) AddTool ¶
func (b *IntentBuilder) AddTool(toolName string) *IntentBuilder
AddTool adds a tool to the intent
func (*IntentBuilder) Build ¶
func (b *IntentBuilder) Build() Intent
Build creates the intent statement
type IntentFormatter ¶
type IntentFormatter struct{}
IntentFormatter formats intent statements for display
func NewIntentFormatter ¶
func NewIntentFormatter() *IntentFormatter
NewIntentFormatter creates a new intent formatter
func (*IntentFormatter) Format ¶
func (f *IntentFormatter) Format(intent Intent) string
Format formats an intent for display
func (*IntentFormatter) FormatCompact ¶
func (f *IntentFormatter) FormatCompact(intent Intent) string
FormatCompact creates a compact single-line intent
func (*IntentFormatter) FormatWithDetails ¶
func (f *IntentFormatter) FormatWithDetails(intent Intent) string
FormatWithDetails formats an intent with detailed information
type IntentHistory ¶
type IntentHistory struct {
// contains filtered or unexported fields
}
IntentHistory tracks intent statements for a session
func NewIntentHistory ¶
func NewIntentHistory() *IntentHistory
NewIntentHistory creates a new intent history
func (*IntentHistory) Add ¶
func (h *IntentHistory) Add(intent Intent)
Add adds an intent to the history
func (*IntentHistory) Count ¶
func (h *IntentHistory) Count() int
Count returns the number of intents
func (*IntentHistory) GetByPhase ¶
func (h *IntentHistory) GetByPhase(phase string) []Intent
GetByPhase returns intents for a specific phase
func (*IntentHistory) GetLatest ¶
func (h *IntentHistory) GetLatest() *Intent
GetLatest returns the most recent intent
func (*IntentHistory) GetRecent ¶
func (h *IntentHistory) GetRecent(n int) []Intent
GetRecent returns the N most recent intents
type IntentLibrary ¶
type IntentLibrary struct{}
IntentLibrary provides pre-built intent templates for common activities
func NewIntentLibrary ¶
func NewIntentLibrary() *IntentLibrary
NewIntentLibrary creates a new intent library
func (*IntentLibrary) AnalyzingCodebase ¶
func (l *IntentLibrary) AnalyzingCodebase(phase string, target string) Intent
AnalyzingCodebase creates an intent for codebase analysis
func (*IntentLibrary) FixingIssue ¶
func (l *IntentLibrary) FixingIssue(issueID int, title string) Intent
FixingIssue creates an intent for fixing a review issue
func (*IntentLibrary) GeneratingArtifact ¶
func (l *IntentLibrary) GeneratingArtifact(artifactType string) Intent
GeneratingArtifact creates an intent for artifact generation
func (*IntentLibrary) ImplementingTask ¶
func (l *IntentLibrary) ImplementingTask(taskID int, description string) Intent
ImplementingTask creates an intent for implementing a task
func (*IntentLibrary) RefactoringCode ¶
func (l *IntentLibrary) RefactoringCode(description string) Intent
RefactoringCode creates an intent for refactoring
func (*IntentLibrary) RunningTests ¶
func (l *IntentLibrary) RunningTests(testPath string) Intent
RunningTests creates an intent for running tests
func (*IntentLibrary) SearchingForPattern ¶
func (l *IntentLibrary) SearchingForPattern(pattern string, scope string) Intent
SearchingForPattern creates an intent for pattern searching
func (*IntentLibrary) ValidatingImplementation ¶
func (l *IntentLibrary) ValidatingImplementation(aspect string) Intent
ValidatingImplementation creates an intent for review validation
type Middleware ¶
Middleware wraps an Executor with additional behavior.
func Chain ¶
func Chain(middlewares ...Middleware) Middleware
Chain composes middlewares in order (first middleware is outermost).
func DefaultMiddlewareStack ¶
func DefaultMiddlewareStack(cfg MiddlewareConfig) []Middleware
DefaultMiddlewareStack returns the default middleware chain.
func DockerSandboxMiddleware ¶
func DockerSandboxMiddleware(sandbox SandboxExecutor, kindLookup func(string) string) Middleware
DockerSandboxMiddleware intercepts shell-executing tools and routes them through the provided SandboxExecutor. Read-only tools pass through untouched.
func FileChangeTracking ¶
func FileChangeTracking(watcher *filewatch.FileWatcher) Middleware
FileChangeTracking emits file change notifications for write/edit tools.
func Hooks ¶
func Hooks(registry *HookRegistry) Middleware
Hooks runs registered pre/post hooks around tool execution.
func PanicRecovery ¶
func PanicRecovery() Middleware
PanicRecovery converts panics into tool errors and records stack traces in metadata.
func Progress ¶
func Progress(manager ProgressTracker, longRunning map[string]string) Middleware
Progress reports tool execution progress to the manager.
func ResultSizeLimit ¶
func ResultSizeLimit(maxBytes int, suffix string) Middleware
ResultSizeLimit truncates oversized tool results.
func Retry ¶
func Retry(cfg RetryConfig) Middleware
Retry retries tool execution with exponential backoff.
func ToastNotifications ¶
func ToastNotifications(manager ToastNotifier) Middleware
ToastNotifications emits toast messages for tool failures.
func Validation ¶
func Validation(cfg ValidationConfig, onError func(tool, param, msg string)) Middleware
Validation applies configured validation rules before executing tools.
type MiddlewareConfig ¶
type MiddlewareConfig struct {
ToastManager ToastNotifier
ProgressManager ProgressTracker
FileWatcher *filewatch.FileWatcher
DefaultTimeout time.Duration
PerToolTimeouts map[string]time.Duration
RetryConfig RetryConfig
MaxResultBytes int
LongRunningTools map[string]string
ValidationConfig ValidationConfig
OnValidationError func(tool, param, msg string)
}
MiddlewareConfig configures the default middleware stack.
type PermissionDeniedError ¶ added in v1.1.0
PermissionDeniedError indicates a tool call was denied.
func (*PermissionDeniedError) Error ¶ added in v1.1.0
func (e *PermissionDeniedError) Error() string
type PoolConfig ¶ added in v1.1.0
PoolConfig describes a filtered tool set.
type PostHook ¶
type PostHook func(ctx *ExecutionContext, result *builtin.Result, err error) (*builtin.Result, error)
PostHook runs after a tool executes.
type PreHook ¶
type PreHook func(ctx *ExecutionContext) HookResult
PreHook runs before a tool executes.
type ProgressTracker ¶
ProgressTracker reports start/done events for long-running tools.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all available tools
func NewEmptyRegistry ¶
func NewEmptyRegistry() *Registry
NewEmptyRegistry creates a new empty tool registry without any built-in tools
func NewRegistry ¶
func NewRegistry(opts ...RegistryOption) *Registry
NewRegistry creates a new tool registry with built-in tools
func (*Registry) Close ¶
Close releases resources held by the registry, including sandbox containers.
func (*Registry) ConfigureContainers ¶
ConfigureContainers wires container support for shell execution when enabled.
func (*Registry) ConfigureDockerSandbox ¶
ConfigureDockerSandbox sets up Docker-based OS-level sandboxing when enabled.
func (*Registry) ConfigureTodoPlanning ¶
func (r *Registry) ConfigureTodoPlanning(llmClient builtin.PlanningClient, planningModel string)
ConfigureTodoPlanning enables planning capabilities on the TodoTool
func (*Registry) ContainerInfo ¶
ContainerInfo exposes whether container execution is enabled and the compose details.
func (*Registry) DisableContainers ¶
func (r *Registry) DisableContainers()
DisableContainers disables container execution
func (*Registry) EnableCodeIndex ¶
EnableCodeIndex registers context lookup tools backed by storage.
func (*Registry) EnableContainers ¶
EnableContainers configures the registry to run tools inside containers.
func (*Registry) EnableMissionControl ¶
func (r *Registry) EnableMissionControl(store *mission.Store, agentID string, requireApproval bool, timeout time.Duration)
EnableMissionControl configures mission-control-backed approvals for mutating tools. When requireApproval is true, write_file/apply_patch will block until approved.
func (*Registry) EnableSemanticSearch ¶
func (r *Registry) EnableSemanticSearch(searcher *embeddings.Searcher)
EnableSemanticSearch registers semantic search tools
func (*Registry) EnableTelemetry ¶
EnableTelemetry wires telemetry events for selected built-in tools.
func (*Registry) ExecuteWithContext ¶
func (r *Registry) ExecuteWithContext(ctx context.Context, name string, params map[string]any) (*builtin.Result, error)
ExecuteWithContext executes a tool by name using the provided context.
func (*Registry) GetTodoTool ¶
GetTodoTool returns the registered TodoTool, or nil if not registered
func (*Registry) Hooks ¶
func (r *Registry) Hooks() *HookRegistry
Hooks returns the registry hook manager.
func (*Registry) LoadDefaultPlugins ¶
LoadDefaultPlugins loads plugins from standard locations
func (*Registry) LoadExternal ¶
LoadExternal loads external plugin tools from a directory
func (*Registry) LoadExternalFromMultipleDirs ¶
LoadExternalFromMultipleDirs loads external plugins from multiple directories
func (*Registry) RequiredTier ¶ added in v1.1.0
func (r *Registry) RequiredTier(name string) types.PermissionTier
RequiredTier returns the inferred tier for a registered tool.
func (*Registry) SetCompactionManager ¶
SetCompactionManager registers the compact_context tool.
func (*Registry) SetContainerContext ¶
SetContainerContext tracks compose/workdir metadata without forcing container execution.
func (*Registry) SetEnv ¶
SetEnv configures environment variable overrides for tools that support it.
func (*Registry) SetMaxExecTimeSeconds ¶
SetMaxExecTimeSeconds configures a global max execution time for tools that support it.
func (*Registry) SetMaxFileSizeBytes ¶
SetMaxFileSizeBytes configures file size limits for tools that support it.
func (*Registry) SetMaxOutputBytes ¶
SetMaxOutputBytes configures a global max output size for tools that support it.
func (*Registry) SetSandboxConfig ¶
SetSandboxConfig configures command sandboxing for tools that support it. The cfg value is passed through to each tool that implements a SetSandboxConfig method, allowing the tool package to remain decoupled from the concrete sandbox.Config type.
func (*Registry) SetTodoStore ¶
SetTodoStore initializes the TODO tool with a storage backend
func (*Registry) SetToolKind ¶
SetToolKind associates an ACP tool_call kind with a tool name. Valid kinds are defined in pkg/acp/types.go (read, edit, delete, execute, etc.).
func (*Registry) SetWorkDir ¶
SetWorkDir configures a base working directory for tools that support it. Tools may use this to resolve relative paths and run shell/git commands in the correct repository root (critical for hosted/multi-project deployments).
func (*Registry) ToOpenAIFunctions ¶
ToOpenAIFunctions converts all tools to OpenAI function calling format
func (*Registry) ToOpenAIFunctionsFiltered ¶
ToOpenAIFunctionsFiltered converts only allowed tools to OpenAI function format. If allowed is empty, all tools are returned.
func (*Registry) ToOpenAIFunctionsGoverned ¶ added in v1.1.0
func (r *Registry) ToOpenAIFunctionsGoverned(evaluator types.RuleEvaluator, role, taskType string, baseAllowed []string, budgetUtil float64) []map[string]any
ToOpenAIFunctionsGoverned applies skill and arbiter filtering before exposing tools.
func (*Registry) ToolKind ¶
ToolKind returns the ACP tool_call kind for a tool, or empty string if not set.
func (*Registry) UpdateMissionAgent ¶
UpdateMissionAgent updates the agent identifier recorded alongside pending changes.
func (*Registry) UpdateMissionSession ¶
UpdateMissionSession updates the active session used when recording pending changes.
func (*Registry) UpdateTelemetrySession ¶
UpdateTelemetrySession updates the active session used for telemetry fan-out.
func (*Registry) Use ¶
func (r *Registry) Use(mw Middleware)
Use registers a middleware on the registry.
type RegistryConfig ¶
type RegistryConfig struct {
TelemetryHub *telemetry.Hub
TelemetrySessionID string
HookRegistry *HookRegistry
MissionStore *mission.Store
MissionSessionID string
MissionAgentID string
MissionTimeout time.Duration
RequireMissionApproval bool
MaxOutputBytes int
Middleware MiddlewareConfig
}
RegistryConfig configures registry defaults and middleware options.
func DefaultRegistryConfig ¶
func DefaultRegistryConfig() RegistryConfig
DefaultRegistryConfig returns baseline defaults for registry setup.
type RegistryOption ¶
type RegistryOption func(*registryOptions)
RegistryOption configures optional settings for a Registry.
func WithBuiltinFilter ¶
func WithBuiltinFilter(filter func(Tool) bool) RegistryOption
WithBuiltinFilter allows callers to filter built-in tools during registry construction.
func WithKind ¶
func WithKind(toolName, kind string) RegistryOption
WithKind sets the ACP tool_call kind for a tool during registry construction.
type RetryConfig ¶
type RetryConfig struct {
MaxAttempts int
InitialDelay time.Duration
MaxDelay time.Duration
Multiplier float64
Jitter float64
RetryableFunc func(error) bool
}
RetryConfig configures retry behavior.
type RichTool ¶
type RichTool interface {
Tool
Metadata() ToolMetadata
}
RichTool is an optional interface that tools can implement for enhanced UI Tools that don't implement this will use default metadata
type SandboxExecutor ¶
type SandboxExecutor interface {
Execute(ctx context.Context, req SandboxRequest) (*SandboxResult, error)
Ready(ctx context.Context) error
Close() error
}
SandboxExecutor defines the interface for OS-level sandbox execution. Implementations route shell commands to isolated environments (e.g. Docker containers).
type SandboxRequest ¶
type SandboxRequest struct {
Command string
WorkDir string
Env map[string]string
Timeout time.Duration
ToolName string
}
SandboxRequest describes a command to execute inside the sandbox.
type SandboxResult ¶
type SandboxResult struct {
ExitCode int
Stdout string
Stderr string
Duration time.Duration
Killed bool
}
SandboxResult holds the output of a sandboxed command execution.
type ToastNotifier ¶
type ToastNotifier interface {
Error(title, message string)
}
ToastNotifier sends user-visible toast notifications.
type Tool ¶
type Tool interface {
Name() string
Description() string
Parameters() builtin.ParameterSchema
Execute(params map[string]any) (*builtin.Result, error)
}
Tool represents a tool that can be called by the LLM
type ToolCall ¶
type ToolCall struct {
Tool Tool
Params map[string]any
Result *builtin.Result
StartTime time.Time
EndTime time.Time
Duration time.Duration
Metadata ToolMetadata
}
ToolCall represents a single tool invocation with timing
type ToolMetadata ¶
type ToolMetadata struct {
Category Category // Functional category
Intent string // Template for intent display: "Searching for {pattern} in {path}"
Summary string // Template for result summary: "Found {count} matches in {files} files"
Impact Impact // Operation impact level
Cost Cost // Resource cost
ExampleUsage string // Example of how to use this tool
}
ToolMetadata contains rich metadata for enhanced UI display
func DefaultMetadata ¶
func DefaultMetadata() ToolMetadata
DefaultMetadata returns default metadata for tools without explicit metadata
func GetMetadata ¶
func GetMetadata(t Tool) ToolMetadata
GetMetadata returns metadata for a tool, with fallback to defaults
type ToolPool ¶ added in v1.1.0
type ToolPool struct {
// contains filtered or unexported fields
}
ToolPool is an immutable filtered set of executables.
func AssemblePool ¶ added in v1.1.0
func AssemblePool(registry *ExecutionRegistry, evaluator types.RuleEvaluator, role, taskType string) *ToolPool
AssemblePool builds a filtered tool set using arbiter governance.
type ValidationConfig ¶
type ValidationConfig struct {
Rules []ValidationRule
}
ValidationConfig collects validation rules.
type ValidationRule ¶
ValidationRule defines a validation rule for a tool parameter.
type Validator ¶
Validator checks a parameter value.
func ValidateNonEmpty ¶
func ValidateNonEmpty() Validator
ValidateNonEmpty ensures a parameter is non-empty.
func ValidatePath ¶
ValidatePath ensures a path is non-empty and within baseDir (when provided).
Source Files
¶
- activity.go
- containers.go
- defaults.go
- execution.go
- filter.go
- governed.go
- hooks.go
- intent.go
- metadata.go
- middleware.go
- middleware_approval.go
- middleware_filewatch.go
- middleware_hooks.go
- middleware_limit.go
- middleware_progress.go
- middleware_retry.go
- middleware_safety.go
- middleware_sandbox.go
- middleware_telemetry.go
- middleware_timeout.go
- middleware_toast.go
- middleware_validation.go
- registry.go
- registry_container.go
- registry_events.go
- registry_execute.go
- registry_mission.go
- registry_openai.go
- registry_plugins.go
- registry_setup.go
- registry_snapshot.go
- registry_tools.go
- sandbox_executor.go
- tool.go