actionstringrequiredlist · output · kill.
idstringThe terminal, e.g. t_3. Needed by output and kill.
sinceintegeroutput: read from this position. 0 gives everything kept.
Two categories in one tool
| Action | Category | Asked |
|---|---|---|
list | read | never |
output | read | never |
kill | exec | in every mode but full |
Reading what a server is printing should not need a prompt; stopping it should. The category is computed from the arguments.
The working loop
terminal({ action: "list" }) // is it already running?
bash({ command: "npm run dev", background: true, port: 5173 })
terminal({ action: "output", id: "t_3" }) // what did it print since last time?
terminal({ action: "kill", id: "t_3" }) // stop it and everything it started# The calls the model makes, in order:
# terminal {"action": "list"} is it already running?
# terminal {"action": "create", "command": "npm run dev"} start it
# terminal {"action": "output", "id": "t_3"} what did it print since last time?
# terminal {"action": "kill", "id": "t_3"} stop it and everything it startedThe agent is told to check for a server that may already be running rather than starting a second one on the same port — which fails in a way that looks like the code is broken.
They live in your process
A terminal survives an answer, not a restart of whatever holds the package. Worth saying in any interface that lists them.
Where there are none
Never on a phone. On a cloud workspace only when the application supplies terminals. On a computer, from the machine itself.