types

package
v1.164.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package types defines the shared wire contracts for the shell tools.

Index

Constants

View Source
const ToolNameShell = "shell"

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.

The command is resolved by safety.CommandArg over an exact-key map rather than by struct tags: encoding/json matches keys case-insensitively with last-wins, so {"cmd":"ls","CMD":"rm -rf x"} would run a command the runtime never classified. Sharing the resolver keeps the executed command identical to the labelled one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL