workbite 0.1.21 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -31
- package/bin/workbite.js +13 -13
- package/lib/agent.js +240 -240
- package/lib/archive.js +334 -334
- package/lib/boot-provenance.js +54 -54
- package/lib/cli.js +334 -334
- package/lib/common.js +68 -68
- package/lib/diagnostics.js +238 -238
- package/lib/download.js +53 -53
- package/lib/install.js +274 -274
- package/lib/mcp-task-context.js +188 -188
- package/lib/mcp.js +671 -671
- package/lib/private-state.js +116 -116
- package/lib/runtime.js +775 -775
- package/lib/startup-lock.js +71 -71
- package/lib/transfer.js +113 -113
- package/lib/update.js +86 -86
- package/package.json +35 -35
- package/release.json +13 -13
- package/skills/workbite-native/SKILL.md +126 -126
- package/skills/workbite-native/agents/openai.yaml +4 -4
- package/skills/workbite-native/references/commands.md +213 -213
- package/skills/workbite-native/references/task-fields.md +208 -208
- package/skills/workbite-native/references/transfer.md +204 -204
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
# workbite agent / workbite mcp reference
|
|
2
|
-
|
|
3
|
-
Contents: invocation · binding flags · commands · packets · output and
|
|
4
|
-
exits · refusals and recovery · file input on Windows · MCP tools.
|
|
5
|
-
|
|
6
|
-
## Invocation
|
|
7
|
-
|
|
8
|
-
`workbite` is the npm launcher's bin. Where it is not on `PATH`, run the same
|
|
9
|
-
entry with Node: `node <path-to-installed-workbite>/bin/workbite.js agent ...`.
|
|
10
|
-
Only the commands below exist under `workbite agent`; anything else (raw RPC,
|
|
11
|
-
legacy apply, delete, migration, provider control) is refused. Each call is
|
|
12
|
-
one request to the native client of the installed bundle, which talks to the
|
|
13
|
-
workspace's running owner; nothing is started, and a refusal starts nothing.
|
|
14
|
-
|
|
15
|
-
## Binding flags
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
workbite agent [--workspace ABS --workspace-uid UUID] <command> ...
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- `--workspace` (absolute path) and `--workspace-uid` (the workspace's UUID)
|
|
22
|
-
are given together or not at all.
|
|
23
|
-
- Without them, a read binds the workspace saved by the last successful
|
|
24
|
-
`workbite open`. Writes (`tasks create`, `tasks update`, `checkpoint`,
|
|
25
|
-
import apply/rollback) refuse without the explicit pair. Use the default only for discovery
|
|
26
|
-
(`capabilities`, the first `status`, `tasks list`); once `status` has
|
|
27
|
-
named the workspace, pass the pair on `context` and `operation-status` too.
|
|
28
|
-
- The binding is checked before every call: the workspace descriptor must
|
|
29
|
-
still carry that UUID and its owner must be the same ready, authenticated
|
|
30
|
-
owner. A changed selection never retargets an explicit binding.
|
|
31
|
-
|
|
32
|
-
## Commands
|
|
33
|
-
|
|
34
|
-
| Command | Writes | Form |
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| capabilities | no | `workbite agent capabilities` |
|
|
37
|
-
| status | no | `workbite agent [binding] status` |
|
|
38
|
-
| tasks list | no | `workbite agent [binding] tasks list [--status S] [--limit N] [--offset N]` |
|
|
39
|
-
| context | no | `workbite agent --workspace ABS --workspace-uid UUID context --task T-0001 [--view V]` |
|
|
40
|
-
| tasks create | yes | `workbite agent --workspace ABS --workspace-uid UUID tasks create --intent-id ID (--input-file FILE \| --stdin)` |
|
|
41
|
-
| tasks update | yes | `workbite agent --workspace ABS --workspace-uid UUID tasks update --intent-id ID (--input-file FILE \| --stdin)` |
|
|
42
|
-
| checkpoint | yes | `workbite agent --workspace ABS --workspace-uid UUID checkpoint --intent-id ID (--input-file FILE \| --stdin)` |
|
|
43
|
-
| operation-status | no | `workbite agent --workspace ABS --workspace-uid UUID operation-status --intent-id ID` |
|
|
44
|
-
|
|
45
|
-
- `capabilities` lists what the installed native client actually supports;
|
|
46
|
-
a command it does not list is refused, never emulated.
|
|
47
|
-
- `status`: the native answer plus a top-level `workbite` object
|
|
48
|
-
(`schema: "workbite.agent.binding.v1"`, `workspace`, `workspace_uid`,
|
|
49
|
-
`endpoint`, `state`). Take the pair from `workbite.workspace` and
|
|
50
|
-
`workbite.workspace_uid`, and continue only with exit 0, `data.ready: true`
|
|
51
|
-
and `data.actual_workspace_uid` equal to `workbite.workspace_uid`. It never
|
|
52
|
-
contains tokens or credentials.
|
|
53
|
-
- `tasks list`: `--status` `active` (default: open + started), `all`, `open`,
|
|
54
|
-
`started`, `done`, `dropped`; `--limit` 1–100 (default 20); `--offset` ≥ 0.
|
|
55
|
-
Rows are `id`, `title`, `status`, `priority`, `revision`; order is backlog
|
|
56
|
-
order. Page with `data.next_offset` (`null` on the last page).
|
|
57
|
-
- `context --task ID`: the Task (`id`, `uid`, `title`, `detail`, `status`,
|
|
58
|
-
`priority`, `due`, `revision`) plus at most five newest `recent_worklog`
|
|
59
|
-
entries. `--view` is `core-v1` (default), `planning-v1`, `planning-v2` or
|
|
60
|
-
`resume-v1`, when the native client lists it.
|
|
61
|
-
|
|
62
|
-
## Advertised fields and transfer commands
|
|
63
|
-
|
|
64
|
-
Probe `workbite agent capabilities` before using new fields or transfer
|
|
65
|
-
commands. Task fields require the exact command's `packet_schema`; MCP
|
|
66
|
-
`tools/list` must agree. See [task-fields.md](task-fields.md) for field types
|
|
67
|
-
and full packets, and [transfer.md](transfer.md) for unreleased,
|
|
68
|
-
capability-gated export/import preview/apply/status/rollback. A refusal never
|
|
69
|
-
authorizes legacy apply, raw HTTP or another install.
|
|
70
|
-
|
|
71
|
-
## Packets
|
|
72
|
-
|
|
73
|
-
Exactly one JSON object from `--input-file FILE` or `--stdin` (one is
|
|
74
|
-
required; they are exclusive), valid UTF-8 of at most 32768 bytes, with only
|
|
75
|
-
the keys admitted by the advertised `packet_schema`. Write it without a BOM.
|
|
76
|
-
A packet never names a workspace. The launcher checks size and UTF-8 and hands the text to the native
|
|
77
|
-
client as stdin; the packet never travels in argv.
|
|
78
|
-
|
|
79
|
-
`tasks create`:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{"title": "Fix login redirect loop", "detail": "Seen on /settings after token refresh.", "follows_task_id": "T-0004"}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`title` is required and nonblank; `detail` and `follows_task_id` are
|
|
86
|
-
original optional fields. Additional fields require `packet_schema`; see
|
|
87
|
-
[task-fields.md](task-fields.md). `follows_task_id` is receipt provenance only
|
|
88
|
-
(no parent or dependency). One intent ID creates at most one Task.
|
|
89
|
-
|
|
90
|
-
`tasks update`:
|
|
91
|
-
|
|
92
|
-
```json
|
|
93
|
-
{"task_id": "T-0001", "expected_revision": 4, "changes": {"detail": "…", "status": "started"}}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
`expected_revision` is the integer from a fresh `context`. `changes` is a
|
|
97
|
-
non-empty object matching the advertised schema. The original subset is
|
|
98
|
-
`detail`/`status`; additions require explicit field/type advertisement.
|
|
99
|
-
See [task-fields.md](task-fields.md).
|
|
100
|
-
|
|
101
|
-
`checkpoint`:
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{"task_id": "T-0001", "date": "2026-10-13", "done": ["Reproduced the loop."], "next": ["Patch the guard."], "blockers": []}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
All five keys are required; `date` is `YYYY-MM-DD`; `done`, `next` and
|
|
108
|
-
`blockers` are lists of strings with at least one item across the three.
|
|
109
|
-
|
|
110
|
-
Intent IDs match `[A-Za-z0-9._:-]{8,128}`. Pick them so you can tell them
|
|
111
|
-
apart later, for example `wb.create.20261013.login-bug`,
|
|
112
|
-
`wb.update.T-0001.r4.started`, `wb.checkpoint.T-0001.20261013.1`.
|
|
113
|
-
|
|
114
|
-
## Output and exits
|
|
115
|
-
|
|
116
|
-
| Exit | Meaning |
|
|
117
|
-
|---:|---|
|
|
118
|
-
| 0 | success, idempotent replay, or an operation-status answer (committed or unknown); one `workstack.cli.v1` JSON envelope on stdout |
|
|
119
|
-
| 1 | refused. A native/domain refusal prints a `workstack.cli.v1` envelope with `error.code`. A WorkBite binding, argument, input or transport refusal (missing write pair, binding mismatch, unreadable or oversize packet, unavailable owner, lost response) prints only a short redacted message on stderr and no JSON |
|
|
120
|
-
| 2 | native usage error; no envelope |
|
|
121
|
-
|
|
122
|
-
- An envelope has `data` on success and `error` on failure, never both.
|
|
123
|
-
- A committed write has `meta.commit_state: "committed"`, `meta.intent_id`
|
|
124
|
-
and `meta.replayed`. `tasks create` / `tasks update` add `data.receipt`
|
|
125
|
-
(`operation`, `result` `created` / `applied` / `no_change`, `task_id`,
|
|
126
|
-
`before_revision`, `after_revision`, `committed_at`) and `data.task`. A
|
|
127
|
-
receipt lookup precedes revision CAS. A replay returns the original snapshot
|
|
128
|
-
even after later edits: read `context` for current state.
|
|
129
|
-
If `data.omitted` names `task` or `receipt`, they were dropped for size;
|
|
130
|
-
`commit_state` still settles the write.
|
|
131
|
-
- A write whose answer was lost or timed out exits 1 with a stderr message
|
|
132
|
-
saying the commit is unknown and was not replayed: treat it exactly like
|
|
133
|
-
`commit_unknown` below.
|
|
134
|
-
|
|
135
|
-
## Refusals and recovery
|
|
136
|
-
|
|
137
|
-
| `error.code` | Do |
|
|
138
|
-
|---|---|
|
|
139
|
-
| `revision_conflict` | re-read `context`; re-issue against `details.current_revision` with a new intent ID only if still within the user's intent, else stop and report |
|
|
140
|
-
| `idempotency_conflict` | that intent ID was used for a different packet: stop; never reuse it |
|
|
141
|
-
| `task_not_found` | ask the user; never substitute another Task |
|
|
142
|
-
| `invalid_body`, `input_unreadable` | fix the packet (keys, types, encoding) or file path |
|
|
143
|
-
| `operation_refused` | report it; nothing was written |
|
|
144
|
-
| `workspace_mismatch`, `invalid_authority`, `owner_unavailable`, `owner_upgrade_required`, `store_sync_required`, `capability_not_enabled`, `unsupported`, `internal_error` | stop and report; no fallback |
|
|
145
|
-
| `commit_unknown`, or a stderr "commit unknown" message | stop writing; keep the intent ID and packet; follow operation-status below |
|
|
146
|
-
|
|
147
|
-
`operation-status --intent-id ID` is read-only and exits 0 with either:
|
|
148
|
-
|
|
149
|
-
- `data.commit_state: "committed"`: the original receipt and task; the write
|
|
150
|
-
happened.
|
|
151
|
-
- `data.commit_state: "unknown"` with a `reason` (`no_receipt`,
|
|
152
|
-
`recovery_pending`, `purged`, `incomplete_evidence`,
|
|
153
|
-
`not_an_agent_intent`, …). Unknown never means "not written". Only for
|
|
154
|
-
`no_receipt` may you resend the same intent ID with the byte-identical
|
|
155
|
-
packet. Never send a changed packet under that ID and never switch to a new
|
|
156
|
-
ID to force it through.
|
|
157
|
-
|
|
158
|
-
A checkpoint has no Task receipt: on `commit_unknown` report it and do not
|
|
159
|
-
append another checkpoint.
|
|
160
|
-
|
|
161
|
-
## File input on Windows
|
|
162
|
-
|
|
163
|
-
Windows PowerShell 5.1 pipes re-encode non-ASCII text, and
|
|
164
|
-
`Set-Content -Encoding utf8` adds a BOM. Write BOM-free UTF-8 through .NET and
|
|
165
|
-
use `--input-file`:
|
|
166
|
-
|
|
167
|
-
```powershell
|
|
168
|
-
$packet = New-TemporaryFile
|
|
169
|
-
$body = '{"title":"Fix login redirect loop","detail":"Seen after token refresh."}'
|
|
170
|
-
[IO.File]::WriteAllText($packet.FullName, $body, (New-Object Text.UTF8Encoding $false))
|
|
171
|
-
workbite agent --workspace 'C:\work\demo' --workspace-uid '11111111-1111-4111-8111-111111111111' tasks create --intent-id wb.create.20261013.login-bug --input-file $packet.FullName
|
|
172
|
-
$LASTEXITCODE
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Keep the file unchanged until the write is committed or recovered, so a
|
|
176
|
-
permitted resend is byte-identical. POSIX shells can use `--stdin` with a
|
|
177
|
-
here-document.
|
|
178
|
-
|
|
179
|
-
## MCP tools
|
|
180
|
-
|
|
181
|
-
`workbite mcp [--workspace ABS --workspace-uid UUID]` serves the same
|
|
182
|
-
commands over MCP stdio. It binds once at startup and keeps that workspace for
|
|
183
|
-
the life of the process: with the explicit pair (recommended) that workspace;
|
|
184
|
-
otherwise the selection saved at startup. A later `workbite open` of another
|
|
185
|
-
workspace does not move a running server; restart it to rebind.
|
|
186
|
-
|
|
187
|
-
Arguments are flat (no nested packet); `workspace_uid` must equal the
|
|
188
|
-
server's bound UUID wherever it is given, and is required on writes. Unknown
|
|
189
|
-
or mistyped arguments are refused before anything runs.
|
|
190
|
-
|
|
191
|
-
| Tool | Writes | Arguments (required **bold**) |
|
|
192
|
-
|---|---|---|
|
|
193
|
-
| `workbite_status` | no | `workspace_uid` |
|
|
194
|
-
| `workbite_tasks_list` | no | `workspace_uid`, `status`, `limit`, `offset` |
|
|
195
|
-
| `workbite_context` | no | `workspace_uid`, **`task_id`**, `view`, `fingerprint`, `if_fingerprint` |
|
|
196
|
-
| `workbite_tasks_create` | yes | **`workspace_uid`**, **`intent_id`**, **`title`**, `detail`, `follows_task_id`, other advertised create fields |
|
|
197
|
-
| `workbite_tasks_update` | yes | **`workspace_uid`**, **`intent_id`**, **`task_id`**, **`expected_revision`**, **`changes`** (advertised update fields) |
|
|
198
|
-
| `workbite_checkpoint` | yes | **`workspace_uid`**, **`intent_id`**, **`task_id`**, **`date`**, **`done`**, **`next`**, **`blockers`** |
|
|
199
|
-
| `workbite_operation_status` | no | `workspace_uid`, **`intent_id`** |
|
|
200
|
-
|
|
201
|
-
- Pass `workspace_uid` on reads of a selected Task too, so a server bound
|
|
202
|
-
elsewhere refuses instead of answering for another workspace.
|
|
203
|
-
- `workbite_status` adds a `workbite` object (`workspace`, `workspace_uid`).
|
|
204
|
-
- Results carry the envelope as `structuredContent` (from protocol
|
|
205
|
-
`2025-06-18`) and as text. A refusal is `isError: true`; adapter refusals
|
|
206
|
-
use contract `workbite.mcp.v1` with codes such as `invalid_arguments`,
|
|
207
|
-
`workspace_mismatch`, `binding_unavailable`, `not_sent` and
|
|
208
|
-
`commit_unknown` (with `meta.commit_state: "unknown"` and the `intent_id`
|
|
209
|
-
for `workbite_operation_status`). Calls run one at a time and are never
|
|
210
|
-
retried.
|
|
211
|
-
- Transfer tool names and exact preview/apply/status/rollback argument rules:
|
|
212
|
-
[transfer.md](transfer.md). They require actual native capability support.
|
|
213
|
-
- No tool runs shells, raw RPC, deletes or policy changes.
|
|
1
|
+
# workbite agent / workbite mcp reference
|
|
2
|
+
|
|
3
|
+
Contents: invocation · binding flags · commands · packets · output and
|
|
4
|
+
exits · refusals and recovery · file input on Windows · MCP tools.
|
|
5
|
+
|
|
6
|
+
## Invocation
|
|
7
|
+
|
|
8
|
+
`workbite` is the npm launcher's bin. Where it is not on `PATH`, run the same
|
|
9
|
+
entry with Node: `node <path-to-installed-workbite>/bin/workbite.js agent ...`.
|
|
10
|
+
Only the commands below exist under `workbite agent`; anything else (raw RPC,
|
|
11
|
+
legacy apply, delete, migration, provider control) is refused. Each call is
|
|
12
|
+
one request to the native client of the installed bundle, which talks to the
|
|
13
|
+
workspace's running owner; nothing is started, and a refusal starts nothing.
|
|
14
|
+
|
|
15
|
+
## Binding flags
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
workbite agent [--workspace ABS --workspace-uid UUID] <command> ...
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- `--workspace` (absolute path) and `--workspace-uid` (the workspace's UUID)
|
|
22
|
+
are given together or not at all.
|
|
23
|
+
- Without them, a read binds the workspace saved by the last successful
|
|
24
|
+
`workbite open`. Writes (`tasks create`, `tasks update`, `checkpoint`,
|
|
25
|
+
import apply/rollback) refuse without the explicit pair. Use the default only for discovery
|
|
26
|
+
(`capabilities`, the first `status`, `tasks list`); once `status` has
|
|
27
|
+
named the workspace, pass the pair on `context` and `operation-status` too.
|
|
28
|
+
- The binding is checked before every call: the workspace descriptor must
|
|
29
|
+
still carry that UUID and its owner must be the same ready, authenticated
|
|
30
|
+
owner. A changed selection never retargets an explicit binding.
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
| Command | Writes | Form |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| capabilities | no | `workbite agent capabilities` |
|
|
37
|
+
| status | no | `workbite agent [binding] status` |
|
|
38
|
+
| tasks list | no | `workbite agent [binding] tasks list [--status S] [--limit N] [--offset N]` |
|
|
39
|
+
| context | no | `workbite agent --workspace ABS --workspace-uid UUID context --task T-0001 [--view V]` |
|
|
40
|
+
| tasks create | yes | `workbite agent --workspace ABS --workspace-uid UUID tasks create --intent-id ID (--input-file FILE \| --stdin)` |
|
|
41
|
+
| tasks update | yes | `workbite agent --workspace ABS --workspace-uid UUID tasks update --intent-id ID (--input-file FILE \| --stdin)` |
|
|
42
|
+
| checkpoint | yes | `workbite agent --workspace ABS --workspace-uid UUID checkpoint --intent-id ID (--input-file FILE \| --stdin)` |
|
|
43
|
+
| operation-status | no | `workbite agent --workspace ABS --workspace-uid UUID operation-status --intent-id ID` |
|
|
44
|
+
|
|
45
|
+
- `capabilities` lists what the installed native client actually supports;
|
|
46
|
+
a command it does not list is refused, never emulated.
|
|
47
|
+
- `status`: the native answer plus a top-level `workbite` object
|
|
48
|
+
(`schema: "workbite.agent.binding.v1"`, `workspace`, `workspace_uid`,
|
|
49
|
+
`endpoint`, `state`). Take the pair from `workbite.workspace` and
|
|
50
|
+
`workbite.workspace_uid`, and continue only with exit 0, `data.ready: true`
|
|
51
|
+
and `data.actual_workspace_uid` equal to `workbite.workspace_uid`. It never
|
|
52
|
+
contains tokens or credentials.
|
|
53
|
+
- `tasks list`: `--status` `active` (default: open + started), `all`, `open`,
|
|
54
|
+
`started`, `done`, `dropped`; `--limit` 1–100 (default 20); `--offset` ≥ 0.
|
|
55
|
+
Rows are `id`, `title`, `status`, `priority`, `revision`; order is backlog
|
|
56
|
+
order. Page with `data.next_offset` (`null` on the last page).
|
|
57
|
+
- `context --task ID`: the Task (`id`, `uid`, `title`, `detail`, `status`,
|
|
58
|
+
`priority`, `due`, `revision`) plus at most five newest `recent_worklog`
|
|
59
|
+
entries. `--view` is `core-v1` (default), `planning-v1`, `planning-v2` or
|
|
60
|
+
`resume-v1`, when the native client lists it.
|
|
61
|
+
|
|
62
|
+
## Advertised fields and transfer commands
|
|
63
|
+
|
|
64
|
+
Probe `workbite agent capabilities` before using new fields or transfer
|
|
65
|
+
commands. Task fields require the exact command's `packet_schema`; MCP
|
|
66
|
+
`tools/list` must agree. See [task-fields.md](task-fields.md) for field types
|
|
67
|
+
and full packets, and [transfer.md](transfer.md) for unreleased,
|
|
68
|
+
capability-gated export/import preview/apply/status/rollback. A refusal never
|
|
69
|
+
authorizes legacy apply, raw HTTP or another install.
|
|
70
|
+
|
|
71
|
+
## Packets
|
|
72
|
+
|
|
73
|
+
Exactly one JSON object from `--input-file FILE` or `--stdin` (one is
|
|
74
|
+
required; they are exclusive), valid UTF-8 of at most 32768 bytes, with only
|
|
75
|
+
the keys admitted by the advertised `packet_schema`. Write it without a BOM.
|
|
76
|
+
A packet never names a workspace. The launcher checks size and UTF-8 and hands the text to the native
|
|
77
|
+
client as stdin; the packet never travels in argv.
|
|
78
|
+
|
|
79
|
+
`tasks create`:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{"title": "Fix login redirect loop", "detail": "Seen on /settings after token refresh.", "follows_task_id": "T-0004"}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`title` is required and nonblank; `detail` and `follows_task_id` are
|
|
86
|
+
original optional fields. Additional fields require `packet_schema`; see
|
|
87
|
+
[task-fields.md](task-fields.md). `follows_task_id` is receipt provenance only
|
|
88
|
+
(no parent or dependency). One intent ID creates at most one Task.
|
|
89
|
+
|
|
90
|
+
`tasks update`:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{"task_id": "T-0001", "expected_revision": 4, "changes": {"detail": "…", "status": "started"}}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`expected_revision` is the integer from a fresh `context`. `changes` is a
|
|
97
|
+
non-empty object matching the advertised schema. The original subset is
|
|
98
|
+
`detail`/`status`; additions require explicit field/type advertisement.
|
|
99
|
+
See [task-fields.md](task-fields.md).
|
|
100
|
+
|
|
101
|
+
`checkpoint`:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{"task_id": "T-0001", "date": "2026-10-13", "done": ["Reproduced the loop."], "next": ["Patch the guard."], "blockers": []}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
All five keys are required; `date` is `YYYY-MM-DD`; `done`, `next` and
|
|
108
|
+
`blockers` are lists of strings with at least one item across the three.
|
|
109
|
+
|
|
110
|
+
Intent IDs match `[A-Za-z0-9._:-]{8,128}`. Pick them so you can tell them
|
|
111
|
+
apart later, for example `wb.create.20261013.login-bug`,
|
|
112
|
+
`wb.update.T-0001.r4.started`, `wb.checkpoint.T-0001.20261013.1`.
|
|
113
|
+
|
|
114
|
+
## Output and exits
|
|
115
|
+
|
|
116
|
+
| Exit | Meaning |
|
|
117
|
+
|---:|---|
|
|
118
|
+
| 0 | success, idempotent replay, or an operation-status answer (committed or unknown); one `workstack.cli.v1` JSON envelope on stdout |
|
|
119
|
+
| 1 | refused. A native/domain refusal prints a `workstack.cli.v1` envelope with `error.code`. A WorkBite binding, argument, input or transport refusal (missing write pair, binding mismatch, unreadable or oversize packet, unavailable owner, lost response) prints only a short redacted message on stderr and no JSON |
|
|
120
|
+
| 2 | native usage error; no envelope |
|
|
121
|
+
|
|
122
|
+
- An envelope has `data` on success and `error` on failure, never both.
|
|
123
|
+
- A committed write has `meta.commit_state: "committed"`, `meta.intent_id`
|
|
124
|
+
and `meta.replayed`. `tasks create` / `tasks update` add `data.receipt`
|
|
125
|
+
(`operation`, `result` `created` / `applied` / `no_change`, `task_id`,
|
|
126
|
+
`before_revision`, `after_revision`, `committed_at`) and `data.task`. A
|
|
127
|
+
receipt lookup precedes revision CAS. A replay returns the original snapshot
|
|
128
|
+
even after later edits: read `context` for current state.
|
|
129
|
+
If `data.omitted` names `task` or `receipt`, they were dropped for size;
|
|
130
|
+
`commit_state` still settles the write.
|
|
131
|
+
- A write whose answer was lost or timed out exits 1 with a stderr message
|
|
132
|
+
saying the commit is unknown and was not replayed: treat it exactly like
|
|
133
|
+
`commit_unknown` below.
|
|
134
|
+
|
|
135
|
+
## Refusals and recovery
|
|
136
|
+
|
|
137
|
+
| `error.code` | Do |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `revision_conflict` | re-read `context`; re-issue against `details.current_revision` with a new intent ID only if still within the user's intent, else stop and report |
|
|
140
|
+
| `idempotency_conflict` | that intent ID was used for a different packet: stop; never reuse it |
|
|
141
|
+
| `task_not_found` | ask the user; never substitute another Task |
|
|
142
|
+
| `invalid_body`, `input_unreadable` | fix the packet (keys, types, encoding) or file path |
|
|
143
|
+
| `operation_refused` | report it; nothing was written |
|
|
144
|
+
| `workspace_mismatch`, `invalid_authority`, `owner_unavailable`, `owner_upgrade_required`, `store_sync_required`, `capability_not_enabled`, `unsupported`, `internal_error` | stop and report; no fallback |
|
|
145
|
+
| `commit_unknown`, or a stderr "commit unknown" message | stop writing; keep the intent ID and packet; follow operation-status below |
|
|
146
|
+
|
|
147
|
+
`operation-status --intent-id ID` is read-only and exits 0 with either:
|
|
148
|
+
|
|
149
|
+
- `data.commit_state: "committed"`: the original receipt and task; the write
|
|
150
|
+
happened.
|
|
151
|
+
- `data.commit_state: "unknown"` with a `reason` (`no_receipt`,
|
|
152
|
+
`recovery_pending`, `purged`, `incomplete_evidence`,
|
|
153
|
+
`not_an_agent_intent`, …). Unknown never means "not written". Only for
|
|
154
|
+
`no_receipt` may you resend the same intent ID with the byte-identical
|
|
155
|
+
packet. Never send a changed packet under that ID and never switch to a new
|
|
156
|
+
ID to force it through.
|
|
157
|
+
|
|
158
|
+
A checkpoint has no Task receipt: on `commit_unknown` report it and do not
|
|
159
|
+
append another checkpoint.
|
|
160
|
+
|
|
161
|
+
## File input on Windows
|
|
162
|
+
|
|
163
|
+
Windows PowerShell 5.1 pipes re-encode non-ASCII text, and
|
|
164
|
+
`Set-Content -Encoding utf8` adds a BOM. Write BOM-free UTF-8 through .NET and
|
|
165
|
+
use `--input-file`:
|
|
166
|
+
|
|
167
|
+
```powershell
|
|
168
|
+
$packet = New-TemporaryFile
|
|
169
|
+
$body = '{"title":"Fix login redirect loop","detail":"Seen after token refresh."}'
|
|
170
|
+
[IO.File]::WriteAllText($packet.FullName, $body, (New-Object Text.UTF8Encoding $false))
|
|
171
|
+
workbite agent --workspace 'C:\work\demo' --workspace-uid '11111111-1111-4111-8111-111111111111' tasks create --intent-id wb.create.20261013.login-bug --input-file $packet.FullName
|
|
172
|
+
$LASTEXITCODE
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Keep the file unchanged until the write is committed or recovered, so a
|
|
176
|
+
permitted resend is byte-identical. POSIX shells can use `--stdin` with a
|
|
177
|
+
here-document.
|
|
178
|
+
|
|
179
|
+
## MCP tools
|
|
180
|
+
|
|
181
|
+
`workbite mcp [--workspace ABS --workspace-uid UUID]` serves the same
|
|
182
|
+
commands over MCP stdio. It binds once at startup and keeps that workspace for
|
|
183
|
+
the life of the process: with the explicit pair (recommended) that workspace;
|
|
184
|
+
otherwise the selection saved at startup. A later `workbite open` of another
|
|
185
|
+
workspace does not move a running server; restart it to rebind.
|
|
186
|
+
|
|
187
|
+
Arguments are flat (no nested packet); `workspace_uid` must equal the
|
|
188
|
+
server's bound UUID wherever it is given, and is required on writes. Unknown
|
|
189
|
+
or mistyped arguments are refused before anything runs.
|
|
190
|
+
|
|
191
|
+
| Tool | Writes | Arguments (required **bold**) |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| `workbite_status` | no | `workspace_uid` |
|
|
194
|
+
| `workbite_tasks_list` | no | `workspace_uid`, `status`, `limit`, `offset` |
|
|
195
|
+
| `workbite_context` | no | `workspace_uid`, **`task_id`**, `view`, `fingerprint`, `if_fingerprint` |
|
|
196
|
+
| `workbite_tasks_create` | yes | **`workspace_uid`**, **`intent_id`**, **`title`**, `detail`, `follows_task_id`, other advertised create fields |
|
|
197
|
+
| `workbite_tasks_update` | yes | **`workspace_uid`**, **`intent_id`**, **`task_id`**, **`expected_revision`**, **`changes`** (advertised update fields) |
|
|
198
|
+
| `workbite_checkpoint` | yes | **`workspace_uid`**, **`intent_id`**, **`task_id`**, **`date`**, **`done`**, **`next`**, **`blockers`** |
|
|
199
|
+
| `workbite_operation_status` | no | `workspace_uid`, **`intent_id`** |
|
|
200
|
+
|
|
201
|
+
- Pass `workspace_uid` on reads of a selected Task too, so a server bound
|
|
202
|
+
elsewhere refuses instead of answering for another workspace.
|
|
203
|
+
- `workbite_status` adds a `workbite` object (`workspace`, `workspace_uid`).
|
|
204
|
+
- Results carry the envelope as `structuredContent` (from protocol
|
|
205
|
+
`2025-06-18`) and as text. A refusal is `isError: true`; adapter refusals
|
|
206
|
+
use contract `workbite.mcp.v1` with codes such as `invalid_arguments`,
|
|
207
|
+
`workspace_mismatch`, `binding_unavailable`, `not_sent` and
|
|
208
|
+
`commit_unknown` (with `meta.commit_state: "unknown"` and the `intent_id`
|
|
209
|
+
for `workbite_operation_status`). Calls run one at a time and are never
|
|
210
|
+
retried.
|
|
211
|
+
- Transfer tool names and exact preview/apply/status/rollback argument rules:
|
|
212
|
+
[transfer.md](transfer.md). They require actual native capability support.
|
|
213
|
+
- No tool runs shells, raw RPC, deletes or policy changes.
|