Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrToolDenied = errors.New("tool not permitted")
var ErrUnknownBuiltin = errors.New("unknown builtin tool")
var ErrUnknownManifest = errors.New("unknown tool manifest")
Functions ¶
func BuildSpecs ¶
BuildSpecs converts a Registry into model.ToolSpec definitions.
func ExecDirect ¶
ExecDirect runs a shell command directly
func IsBuiltinTool ¶
IsBuiltinTool checks if the given name is a builtin tool
func SetPermissions ¶
func SetPermissions(list []string)
SetPermissions configures which tools may execute. Nil or empty slice allows all.
Types ¶
type AuditEvent ¶
type AuditEvent struct {
Tool string `json:"tool"`
Args map[string]any `json:"args"`
Duration int64 `json:"duration_ms"`
Error string `json:"error,omitempty"`
Timestamp time.Time `json:"ts"`
}
AuditEvent represents a tool execution event.
type Registry ¶
func WrapWithAudit ¶
WrapWithAudit wraps all tools in a registry with audit logging to w.
type TerminalAware ¶
TerminalAware is an optional interface a Tool can implement to signal that a successful execution should normally terminate the agent loop without an additional model reflection pass. Example: the "agent" delegation tool returns a final answer string from the delegated agent.
type Tool ¶
type Tool interface {
Name() string
Description() string
JSONSchema() map[string]any
Execute(ctx context.Context, args map[string]any) (string, error)
}
Tool represents an executable action available to agents.
func FromManifest ¶
func FromManifest(m config.ToolManifest) (Tool, error)
func MarkTerminal ¶
MarkTerminal wraps a Tool so the agent runtime can detect it and finalize immediately after successful execution (if all tool calls in a step are terminal and there are no errors).
Source Files
¶
- api_builtin.go
- arg_parse.go
- audit.go
- builtins.go
- builtins_network.go
- builtins_system.go
- builtins_team.go
- builtins_utility.go
- create_builtin.go
- download_builtin.go
- edit_range_builtin.go
- exec.go
- file_discovery_builtins.go
- fileinfo_builtin.go
- insert_at_builtin.go
- lsp_builtin.go
- manifest.go
- read_lines_builtin.go
- read_webpage_builtin.go
- registry.go
- search_replace_builtin.go
- shell_builtins.go
- spec.go
- terminal.go
- todo_builtins.go
- view_builtin.go
- web_helpers.go
- web_search_builtin.go
- write_edit_builtins.go