shell_job
Inspect and control background shell jobs: list, check status, stream output, send stdin, kill, or wait for exit. Block up to wait_ms to replace polling loops.
Instructions
Inspect and control background jobs. actions: list | status | output | write | kill | wait | remove. output/wait can block up to wait_ms until new output appears, so one call replaces a polling loop; pass the returned next_offset back as offset to stream without re-reading what you already saw.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | For action="write": text to send to stdin (add \n yourself). | |
| action | Yes | list: all jobs. status: one job without output. output: incremental output. wait: block until the job exits. write: send stdin. kill: terminate. remove: kill and forget. | |
| job_id | No | Required for every action except "list". | |
| offset | No | Byte offset to read from (use next_offset from the previous call). Default 0. | |
| signal | No | For action="kill": SIGTERM (default), SIGKILL, SIGINT. | |
| stream | No | Which stream to read. Default combined. | |
| wait_ms | No | Block up to this long for new output / for exit. Default 0 (return at once). | |
| max_output_bytes | No | Byte cap on returned output before middle-truncation. Lower it to save tokens. |