Documentation
¶
Index ¶
Constants ¶
const ( ToolNameShell = "shell" ToolNameRunShellBackground = "run_background_job" ToolNameListBackgroundJobs = "list_background_jobs" ToolNameViewBackgroundJob = "view_background_job" ToolNameStopBackgroundJob = "stop_background_job" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunShellArgs ¶
type RunShellArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
Timeout int `json:"timeout,omitempty" jsonschema:"Timeout in seconds (default 30)"`
}
func (*RunShellArgs) UnmarshalJSON ¶
func (a *RunShellArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both the canonical "cmd" key and the common alias "command" for the shell command parameter.
The advertised schema still declares "cmd" as the canonical name, but many models (particularly ones biased by Anthropic's built-in bash tool and other ecosystems that use "command") occasionally emit "command" instead. Accepting both prevents a wasted turn on an empty-command error while keeping the canonical contract unchanged. When "cmd" is present with a non-blank value it wins; a blank (empty or whitespace-only) "cmd" falls back to "command" so a valid alias is not silently shadowed.
type RunShellBackgroundArgs ¶
type RunShellBackgroundArgs struct {
Cmd string `json:"cmd" jsonschema:"Shell command to run in background"`
Cwd string `json:"cwd,omitempty" jsonschema:"Working directory (default \".\")"`
}
func (*RunShellBackgroundArgs) UnmarshalJSON ¶
func (a *RunShellBackgroundArgs) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts both "cmd" (canonical) and "command" (common alias), mirroring RunShellArgs.UnmarshalJSON. See its comment for rationale.
type ScriptShellTool ¶
type ScriptShellTool struct {
// contains filtered or unexported fields
}
func NewScriptShellTool ¶
func NewScriptShellTool(shellTools map[string]latest.ScriptShellToolConfig, env []string) (*ScriptShellTool, error)
func (*ScriptShellTool) Instructions ¶
func (t *ScriptShellTool) Instructions() string
type StopBackgroundJobArgs ¶
type StopBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool provides shell command execution capabilities.
func NewShellTool ¶
func NewShellTool(env []string, runConfig *config.RuntimeConfig) *Tool
NewShellTool creates a new shell tool.
func (*Tool) Instructions ¶
type ViewBackgroundJobArgs ¶
type ViewBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"Background job ID"`
}