Documentation
¶
Overview ¶
Package toolcmd reads the command a tool call ran out of the input it was stored with, for every place in the daemon that describes a call in one line: the Now screen's phrase, a notification's subject, a loop alert's sample, a subagent's current call.
Codex is the reason it exists. Its `exec` tool does not run a command: it runs a JavaScript script that calls Codex's own tools — `tools.exec_command({cmd: "git status"})` for a shell command, `tools.apply_patch(…)` for an edit — and the script is what the call carries under `command`. Shown as sent, every one of those lines read as a wall of JavaScript. The chat reads the command out (ui/src/lib/chat.ts codexScript); this is the same reading for the daemon, and the two must say the same thing (testdata in toolcmd_test.go and chat.test.ts match).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command is the command line a call's stored `command` stands for: for Codex's `exec`, what its script ran (Script); a Codex input stored before the daemon unwrapped it — the arguments' JSON string under `command`, a `shell` argv inside — read as it is stored now; anything else as it is.
func Script ¶
Script is what a Codex `exec` script ran, as one line: the first line of the shell command it passed to `tools.exec_command`, `apply_patch <file>` for a patch, else the name of the tool it called (`web__run`). ok is false when the script calls no tool at all.
func ScriptCall ¶
ScriptCall is the first of Codex's tools a script calls and what it was given, where that can be read: the first line of `exec_command`'s `cmd`, the file an `apply_patch` patches; "" otherwise. ok is false when the script calls no tool.
Types ¶
This section is empty.