Skip to content
1 min read · 139 words

Function: createRunShellCommandTool()

ts
function createRunShellCommandTool(options: RunShellCommandOptions): Tool;

Defined in: src/batteries/sandbox/tool.ts:60

Assemble the factory-style run_shell_command tool. It is intentionally not a bulk-registered battery value. cwd is a model-supplied workspace-relative path and receives the complete PathTranslator gauntlet, including symlink refusal; the default is the workspace root.

The command spawns first, then stdout and stderr are drained concurrently and merged in arrival order into one stream and one storeRetrievableBytes call. Diagnostics are polled while drains run and written as [sandbox] denied: … at their observation point ("observed after", not "caused by"). The command is never accumulated here. timeout_seconds defaults to 300 and is a tool argument. Non-zero exits, violations, timeouts, and post-spawn I/O failures return the singular artifact; failures meaning the command never ran throw instead.

Parameters

ParameterType
optionsRunShellCommandOptions

Returns

Tool