The JSON contract
#Introduction
Agents read saaio's TOON, but a program wants something it can parse and rely on. For a status
bar, a dashboard or a script of your own, saaio status --json prints the whole board as JSON:
every flow, nothing truncated, with camelCase keys and version first.
saaio status --json # this project's flows
saaio status --all --json # every project's flows
saaio status shop-217 --json # a board with just that flow
Important
The command line and this JSON are saaio's only public interface. The log files are private and may change, so read the JSON, never the logs.
#The board
saaio status --json prints one board, with its flows:
{
"version": 4,
"now": 1792214602016,
"count": 2,
"needsYou": 1,
"flows": [
{
"id": "e514f1de-604d-4dbc-9b88-2cd76333d0a4",
"name": "shop-217",
"request": "SHOP-217 add CSV export",
"mode": "guided",
"kind": "feature",
"merges": true,
"phase": "implement",
"state": "blocked",
"blocker": "Task 5: the migration needs a default value",
"delegate": null,
"tasks": { "done": 4, "total": 9 },
"review": null,
"mergeRequest": null,
"merged": false,
"decisions": ["approach B: one exporter per format"],
"steps": [
{ "phase": "plan", "status": "done", "durationMs": 5052 },
{ "phase": "implement", "status": "current", "durationMs": 22132 },
{ "phase": "review", "status": "open", "durationMs": null },
{ "phase": "merge-request", "status": "open", "durationMs": null }
],
"timeline": [
{ "at": 1792214574703, "text": "started", "tone": "neutral" },
{ "at": 1792214574832, "text": "phase: plan", "tone": "progress" },
{ "at": 1792214577856, "text": "decided: approach B: one exporter per format", "tone": "neutral" },
{ "at": 1792214579884, "text": "phase: implement", "tone": "progress" },
{ "at": 1792214583915, "text": "blocked: Task 5: the migration needs a default value", "tone": "problem" }
],
"startedAt": 1792214574703,
"changedAt": 1792214583915,
"workspace": {
"path": "/Users/jan/projects/shop/.saaio/worktrees/shop-217",
"branch": "flow/shop-217",
"slot": 1,
"window": null,
"agent": "claude",
"base": null
},
"answer": null,
"session": null,
"questions": [],
"permission": false,
"services": null,
"turn": null,
"setup": null
},
{
"id": "5418e55e-581e-4117-a46c-0824b8e475d9",
"name": "scratch",
"request": "",
"mode": "plain",
"kind": null,
"merges": true,
"phase": null,
"state": "idle",
"blocker": null,
"delegate": null,
"tasks": null,
"review": null,
"mergeRequest": null,
"merged": false,
"decisions": [],
"steps": [],
"timeline": [{ "at": 1792214574828, "text": "started", "tone": "neutral" }],
"startedAt": 1792214574828,
"changedAt": 1792214574828,
"workspace": {
"path": "/Users/jan/projects/scratch",
"branch": null,
"slot": null,
"window": null,
"agent": "claude",
"base": null
},
"answer": null,
"session": null,
"questions": [],
"permission": false,
"services": null,
"turn": null,
"setup": null
}
]
}
The board's own keys:
| Key | Type | Holds |
|---|---|---|
version | number | the contract's version, 4 today |
now | number | when the board was made, in Unix milliseconds |
count | number | how many flows there are |
needsYou | number | how many are waiting, blocked or not-responding |
flows | array | the flows, sorted: needs you, ready (idle), running, finished. The most recent change first within each group |
All times are Unix milliseconds.
#A flow
Each entry of flows holds everything saaio knows about one flow:
| Key | Type | Holds |
|---|---|---|
id | string | the flow's id, a UUID |
name | string | the flow's name |
request | string | what was asked for. Empty for a plain session |
mode | string | guided, auto or plain |
kind | string or null | the flow's kind: feature, fix, research or one of the config's. Null for a plain session and a flow from before kinds |
merges | boolean | false for a kind without a branch, such as research: nothing to merge, done once it answered |
phase | string or null | the phase it is in. Null before its first phase and for a plain session |
state | string | see States |
blocker | string or null | the question of a waiting flow, or the reason of a blocked one |
delegate | string or null | what a subagent works on while the flow is delegated |
tasks | object or null | { "done", "total" }, the plan's tasks |
review | object or null | { "fixed", "open" }, the review's findings |
mergeRequest | string or null | the merge request's URL |
merged | boolean | the merge request was merged |
decisions | array of strings | decisions made on your behalf, oldest first |
steps | array | one per phase of the flow's workflow. Empty for a plain session. See Steps. |
timeline | array | what happened, oldest first. See Timeline. |
startedAt | number | when the flow started |
changedAt | number | when its state, phase, blocker or idle note last changed, or its merge request closed |
workspace | object or null | where its worker runs. Null for a flow made with saaio new. See Workspace. |
answer | string or null | the worker's last turn's closing message, as its harness reported it, up to 4000 characters |
session | object or null | { "id", "transcript" }: the session id the harness picked and the path of its transcript (transcript may be null). Set for Codex, which picks its own id. Null for Claude Code, which uses the flow's. |
questions | array | the questions of the dialog a waiting flow shows. Empty when it waits on none. See Questions. |
permission | boolean | the flow is waiting on a permission prompt in its pane; blocker names the tool call. A Codex request counts once it is waiting, three seconds in. |
services | object or null | where the flow's services stand. Null until saaio first pauses them. See Services. |
turn | object or null | a heavy command of the flow that waits for another worker's run. Null when none waits. See Turn. |
setup | object or null | the last run of the repo's .saaio/setup for the flow. Null when the repository has none. See Setup. |
#States
state is one of:
| State | Means |
|---|---|
working | the worker is at work |
delegated | a subagent works on the flow |
waiting | the worker asks you something (blocker holds the question) |
idle | the worker's turn ended without a question |
blocked | the flow cannot go on (blocker holds the reason) |
not-responding | the worker sent heartbeats and stopped for 90 seconds |
done | the merge request is open or merged, or a flow that merges nothing answered |
ended | the worker's session ended for good |
waiting, blocked and not-responding count as needing you.
#Steps
Each entry of steps is one phase of the flow's workflow, in order:
| Key | Type | Holds |
|---|---|---|
phase | string | the phase's name, as the flow's workflow names it |
status | string | done, current, open or stale: done before, but the flow went back to an earlier phase since (Going back to implement) |
durationMs | number or null | the time spent in the phase. The current phase counts up to now, or up to when the merge request opened or the flow ended; a phase skill after that runs its clock again. Null for a phase not reached |
Once a merge request merged, or opened while the flow stands at its last phase, every step is
done, and a phase skipped on the way has durationMs null. A flow keeps the phases it started with, so two flows can have different steps.
#Timeline
Each entry of timeline is one thing that happened, oldest first:
| Key | Type | Holds |
|---|---|---|
at | number | when it happened |
text | string | what happened: started, phase: plan, phase: implement (back), waiting: ..., answered, idle: ..., blocked: ..., decided: ..., review: 3 fixed, 1 open, MR opened, PR #42 merged (MR !88 merged on GitLab), PR #42 closed, master: ... (a message from the master), master typed: ... (a line typed into its pane), pause failed: ..., resume failed: ..., setup failed: ... (while its worker was working), setup passed, ended |
tone | string | neutral, progress, attention, problem or success |
#Questions
When a Claude Code worker asks with a question dialog (AskUserQuestion), questions holds one entry
per question, and blocker holds the first question:
| Key | Type | Holds |
|---|---|---|
header | string | the question's short label |
question | string | the question |
options | array | { "label", "description" } per option, in the dialog's order |
multiSelect | boolean | several options may be picked |
#Services
services tells you where the repo's .saaio/pause and .saaio/resume left the flow's services
(Pause and resume):
| Key | Type | Holds |
|---|---|---|
status | string | pausing, paused, resuming, running, pause-failed or resume-failed |
since | number | when it got there |
reason | string or null | the last line the script printed, for pause-failed and resume-failed; its whole output is in the store's hooks/<id>/pause.log or resume.log (Files) |
#Turn
turn describes a shell call that runs a command the repository lists under [exclusive]
(Heavy commands) and waits while another worker runs one:
| Key | Type | Holds |
|---|---|---|
command | string | the listed command it runs |
holder | string | the name of the flow whose run has the turn |
since | number | when it began to wait |
#Setup
setup holds the last run of the repo's .saaio/setup, at saaio start or by saaio setup
(When setup or teardown fails). A failure stays until a run passes,
whatever the flow's state:
| Key | Type | Holds |
|---|---|---|
failed | string or null | the last line the script printed when it failed. Null when it passed |
log | string | the file with the run's whole output |
at | number | when it ran |
#Workspace
workspace says where the worker runs:
| Key | Type | Holds |
|---|---|---|
path | string | the worktree, or a plain session's folder |
branch | string or null | the flow's branch. Null for a plain session |
slot | number or null | the flow's slot, 1 to 20. Null for a plain session |
window | string or null | saaio-ui once the UI opened the worker. Null before |
agent | string | the agent it runs, a name from the config |
base | string or null | the branch a stacked flow stands on and its merge request targets: its saaio start --base, then where that base merged. Null for a flow that started from what the repository had checked out |
#Every project
saaio status --all --json wraps one board per registered store that has flows:
{
"version": 4,
"now": 1792214602016,
"projects": [
{ "name": "shop", "root": "/Users/jan/.local/state/saaio/projects/shop", "board": { "version": 4, "...": "..." } }
]
}
Each project holds:
| Key | Type | Holds |
|---|---|---|
name | string | the project's name: its store's folder name, or default for the default store. (2), (3) and so on after a name already taken |
root | string | the store's folder |
board | object | the board, as saaio status --json prints it |
#Versions
version increases when a change could break a reader. New keys can appear without a new version,
so your reader should ignore keys it does not know.
So far, the contract has had four versions:
| Version | Changed |
|---|---|
| 1 | the first contract |
| 2 | plain sessions: workspace.branch and workspace.slot can be null, and mode can be plain |
| 3 | phase and steps[].phase are the names of the flow's own workflow, not always the built-in four |
| 4 | steps[].status can be stale |