Agents
Run AI coding agents headless from swamp workflows and record what each run
did and cost, so a workflow can hand simple subtasks to a cheaper model and
keep the expensive one for planning and review. Supports Kiro CLI
(@cachehit/agents/kiro).
Each run stores an invocation record (model, success, failure class,
Kiro credits, duration, tool calls, answer preview) and a transcript
with the full prompt and answer. The readonly tool profile, the default,
limits the agent to reading and searching files; actor gives it every
tool of a Kiro agent without permission prompts.
Quick Start
swamp extension pull @cachehit/agents
swamp model create @cachehit/agents/kiro kiro \
--global-arg defaultModel=claude-haiku-4.5
swamp model method run kiro listModels
swamp model method run kiro invoke \
--input prompt="Summarise what src/ does" --input cwd=/path/to/repo
swamp model method run kiro invokeAndParse \
--input prompt='List the TODOs in src/ as JSON [{"file":..,"line":..}]' \
--input model=claude-sonnet-4.6Methods
- invoke: run Kiro with a prompt; fails the step if the run fails.
- invokeAndParse: like invoke, and the answer must contain JSON, which
is stored as
parsed; asks again when it does not. - listModels: store Kiro's models with their credit rate multipliers.
First release with @cachehit/agents/kiro. invoke, invokeAndParse and listModels run Kiro CLI headless and record the model, credits, duration, tool calls and failure class of every run.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| kiroPath? | string | kiro-cli executable, resolved on PATH unless absolute |
| defaultModel? | string | Kiro model ID used when invoke omits model; see listModels |
| defaultAgent? | string | Kiro agent (context profile) for the actor profile; Kiro's default agent when unset |
| maxRetries? | number | Retries for rate limits, killed processes and, in invokeAndParse, unparseable answers |
| retryDelayMs? | number | Base backoff; attempt n waits n times this |
| Argument | Type | Description |
|---|---|---|
| prompt | string | Task for the agent; sent on stdin |
| model? | string | Kiro model ID, for example claude-haiku-4.5; defaults to defaultModel |
| agent? | string | Kiro agent for the actor profile; overrides defaultAgent |
| cwd? | string | Working directory for the agent; defaults to the swamp process directory |
| invocationId? | string | Names the invocation-<id> and transcript-<id> data; a random UUID when unset |
| tags? | record | Key-value labels stored with the invocation, for example a task role |
| Argument | Type | Description |
|---|---|---|
| prompt | string | Task for the agent; sent on stdin |
| model? | string | Kiro model ID, for example claude-haiku-4.5; defaults to defaultModel |
| agent? | string | Kiro agent for the actor profile; overrides defaultAgent |
| cwd? | string | Working directory for the agent; defaults to the swamp process directory |
| invocationId? | string | Names the invocation-<id> and transcript-<id> data; a random UUID when unset |
| tags? | record | Key-value labels stored with the invocation, for example a task role |
Resources
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Spawns a subprocess with Deno.Command().
- models/kiro/_lib/process.ts:60 — no reason given