brainclaw 1.5.5 → 1.7.0
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 +5 -4
- package/dist/brainclaw-vscode.vsix +0 -0
- package/dist/cli.js +124 -7
- package/dist/commands/bootstrap-loop.js +206 -0
- package/dist/commands/loop.js +156 -0
- package/dist/commands/loops-handlers.js +110 -55
- package/dist/commands/mcp-read-handlers.js +37 -0
- package/dist/commands/mcp-schemas.generated.js +33 -0
- package/dist/commands/mcp.js +661 -207
- package/dist/commands/questions.js +180 -0
- package/dist/commands/reply.js +190 -0
- package/dist/commands/session-end.js +105 -3
- package/dist/commands/session-start.js +32 -53
- package/dist/commands/setup.js +64 -13
- package/dist/commands/switch.js +17 -1
- package/dist/core/agent-capability.js +19 -0
- package/dist/core/agent-files.js +86 -0
- package/dist/core/agent-integrations.js +34 -0
- package/dist/core/agent-inventory.js +27 -0
- package/dist/core/agentrun-reconciler.js +130 -0
- package/dist/core/ai-agent-detection.js +17 -1
- package/dist/core/claims.js +54 -3
- package/dist/core/dirty-scope.js +242 -0
- package/dist/core/dispatch-status.js +219 -0
- package/dist/core/entity-operations.js +128 -9
- package/dist/core/execution-adapters.js +38 -2
- package/dist/core/facade-schema.js +71 -0
- package/dist/core/federation-cloud.js +27 -12
- package/dist/core/federation-materialize.js +57 -0
- package/dist/core/instruction-templates.js +2 -0
- package/dist/core/loops/bootstrap-acquire.js +195 -0
- package/dist/core/loops/facade-schema.js +68 -1
- package/dist/core/loops/hooks/bootstrap-write.js +144 -0
- package/dist/core/loops/hooks/notify-operator.js +148 -0
- package/dist/core/loops/hooks/survey-source-reader.js +256 -0
- package/dist/core/loops/index.js +8 -2
- package/dist/core/loops/next-expected.js +63 -0
- package/dist/core/loops/presets/bootstrap.js +75 -0
- package/dist/core/loops/presets/index.js +16 -0
- package/dist/core/loops/store.js +224 -4
- package/dist/core/loops/types.js +346 -1
- package/dist/core/loops/verbs.js +739 -6
- package/dist/core/schema.js +30 -2
- package/dist/core/state.js +62 -0
- package/dist/core/worktree.js +58 -0
- package/dist/facts.js +360 -5
- package/dist/facts.json +359 -4
- package/docs/cli.md +10 -7
- package/docs/concepts/dispatch-lifecycle.md +228 -0
- package/docs/concepts/loop-engine.md +55 -0
- package/docs/concepts/multi-agent-workflows.md +167 -166
- package/docs/concepts/troubleshooting.md +36 -2
- package/docs/index.md +4 -3
- package/docs/integrations/hermes.md +78 -0
- package/docs/integrations/overview.md +22 -18
- package/docs/mcp-schema-changelog.md +8 -1
- package/docs/quickstart-existing-project.md +1 -1
- package/package.json +5 -4
package/dist/facts.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
3
|
-
"generated_at": "2026-05-
|
|
2
|
+
"version": "1.7.0",
|
|
3
|
+
"generated_at": "2026-05-28T00:12:31.140Z",
|
|
4
4
|
"tools": {
|
|
5
|
-
"count":
|
|
6
|
-
"published_count":
|
|
5
|
+
"count": 62,
|
|
6
|
+
"published_count": 61,
|
|
7
7
|
"names": [
|
|
8
8
|
"bclaw_bootstrap",
|
|
9
9
|
"bclaw_release_notes",
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
"bclaw_check_security",
|
|
29
29
|
"bclaw_read_inbox",
|
|
30
30
|
"bclaw_get_thread",
|
|
31
|
+
"bclaw_dispatch_status",
|
|
31
32
|
"bclaw_dispatch",
|
|
32
33
|
"bclaw_send_message",
|
|
33
34
|
"bclaw_ack_message",
|
|
34
35
|
"bclaw_setup",
|
|
36
|
+
"bclaw_init_project",
|
|
35
37
|
"bclaw_write_note",
|
|
36
38
|
"bclaw_quick_capture",
|
|
37
39
|
"bclaw_claim",
|
|
@@ -107,5 +109,358 @@
|
|
|
107
109
|
"action": "act",
|
|
108
110
|
"cross_project_link": "xpl"
|
|
109
111
|
}
|
|
112
|
+
},
|
|
113
|
+
"agent_integrations": {
|
|
114
|
+
"count": 19,
|
|
115
|
+
"names": [
|
|
116
|
+
"antigravity",
|
|
117
|
+
"claude-code",
|
|
118
|
+
"claude-sonnet",
|
|
119
|
+
"cline",
|
|
120
|
+
"codex",
|
|
121
|
+
"continue",
|
|
122
|
+
"cursor",
|
|
123
|
+
"github-copilot",
|
|
124
|
+
"hermes",
|
|
125
|
+
"kilocode",
|
|
126
|
+
"mistral-vibe",
|
|
127
|
+
"nanoclaw",
|
|
128
|
+
"nemoclaw",
|
|
129
|
+
"openclaw",
|
|
130
|
+
"opencode",
|
|
131
|
+
"picoclaw",
|
|
132
|
+
"roo",
|
|
133
|
+
"windsurf",
|
|
134
|
+
"zeroclaw"
|
|
135
|
+
],
|
|
136
|
+
"profiles": [
|
|
137
|
+
{
|
|
138
|
+
"name": "antigravity",
|
|
139
|
+
"category": "code-agent",
|
|
140
|
+
"workflow_model": "interactive",
|
|
141
|
+
"tier": "B",
|
|
142
|
+
"has_mcp": true,
|
|
143
|
+
"has_hooks": false,
|
|
144
|
+
"has_skills": false,
|
|
145
|
+
"has_rules": true,
|
|
146
|
+
"instruction_file": "GEMINI.md",
|
|
147
|
+
"mcp_config_scope": "machine",
|
|
148
|
+
"role_capabilities": [
|
|
149
|
+
"execute",
|
|
150
|
+
"consult"
|
|
151
|
+
],
|
|
152
|
+
"max_concurrent_tasks": 2
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "claude-code",
|
|
156
|
+
"category": "code-agent",
|
|
157
|
+
"workflow_model": "interactive",
|
|
158
|
+
"tier": "A",
|
|
159
|
+
"has_mcp": true,
|
|
160
|
+
"has_hooks": true,
|
|
161
|
+
"has_skills": true,
|
|
162
|
+
"has_rules": true,
|
|
163
|
+
"instruction_file": "CLAUDE.md",
|
|
164
|
+
"mcp_config_scope": "both",
|
|
165
|
+
"role_capabilities": [
|
|
166
|
+
"execute",
|
|
167
|
+
"coordinate",
|
|
168
|
+
"review",
|
|
169
|
+
"consult"
|
|
170
|
+
],
|
|
171
|
+
"max_concurrent_tasks": 3
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "claude-sonnet",
|
|
175
|
+
"category": "code-agent",
|
|
176
|
+
"workflow_model": "interactive",
|
|
177
|
+
"tier": "A",
|
|
178
|
+
"has_mcp": true,
|
|
179
|
+
"has_hooks": true,
|
|
180
|
+
"has_skills": true,
|
|
181
|
+
"has_rules": true,
|
|
182
|
+
"instruction_file": "CLAUDE.md",
|
|
183
|
+
"mcp_config_scope": "both",
|
|
184
|
+
"role_capabilities": [
|
|
185
|
+
"execute",
|
|
186
|
+
"coordinate",
|
|
187
|
+
"review",
|
|
188
|
+
"consult"
|
|
189
|
+
],
|
|
190
|
+
"max_concurrent_tasks": 6
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "cline",
|
|
194
|
+
"category": "code-agent",
|
|
195
|
+
"workflow_model": "interactive",
|
|
196
|
+
"tier": "A",
|
|
197
|
+
"has_mcp": true,
|
|
198
|
+
"has_hooks": true,
|
|
199
|
+
"has_skills": true,
|
|
200
|
+
"has_rules": true,
|
|
201
|
+
"instruction_file": ".clinerules/brainclaw.md",
|
|
202
|
+
"mcp_config_scope": "project",
|
|
203
|
+
"role_capabilities": [
|
|
204
|
+
"execute",
|
|
205
|
+
"review"
|
|
206
|
+
],
|
|
207
|
+
"max_concurrent_tasks": 3
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "codex",
|
|
211
|
+
"category": "code-agent",
|
|
212
|
+
"workflow_model": "task-based",
|
|
213
|
+
"tier": "A",
|
|
214
|
+
"has_mcp": true,
|
|
215
|
+
"has_hooks": true,
|
|
216
|
+
"has_skills": true,
|
|
217
|
+
"has_rules": true,
|
|
218
|
+
"instruction_file": "AGENTS.md",
|
|
219
|
+
"mcp_config_scope": "machine",
|
|
220
|
+
"role_capabilities": [
|
|
221
|
+
"execute",
|
|
222
|
+
"review"
|
|
223
|
+
],
|
|
224
|
+
"max_concurrent_tasks": 5
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "continue",
|
|
228
|
+
"category": "code-agent",
|
|
229
|
+
"workflow_model": "interactive",
|
|
230
|
+
"tier": "B",
|
|
231
|
+
"has_mcp": true,
|
|
232
|
+
"has_hooks": false,
|
|
233
|
+
"has_skills": false,
|
|
234
|
+
"has_rules": true,
|
|
235
|
+
"instruction_file": ".continue/rules/brainclaw.md",
|
|
236
|
+
"mcp_config_scope": "both",
|
|
237
|
+
"role_capabilities": [
|
|
238
|
+
"execute",
|
|
239
|
+
"consult"
|
|
240
|
+
],
|
|
241
|
+
"max_concurrent_tasks": 2
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "cursor",
|
|
245
|
+
"category": "code-agent",
|
|
246
|
+
"workflow_model": "interactive",
|
|
247
|
+
"tier": "A",
|
|
248
|
+
"has_mcp": true,
|
|
249
|
+
"has_hooks": true,
|
|
250
|
+
"has_skills": true,
|
|
251
|
+
"has_rules": true,
|
|
252
|
+
"instruction_file": ".cursor/rules/brainclaw.md",
|
|
253
|
+
"mcp_config_scope": "machine",
|
|
254
|
+
"role_capabilities": [
|
|
255
|
+
"execute",
|
|
256
|
+
"review"
|
|
257
|
+
],
|
|
258
|
+
"max_concurrent_tasks": 1
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "github-copilot",
|
|
262
|
+
"category": "code-agent",
|
|
263
|
+
"workflow_model": "interactive",
|
|
264
|
+
"tier": "A",
|
|
265
|
+
"has_mcp": true,
|
|
266
|
+
"has_hooks": true,
|
|
267
|
+
"has_skills": true,
|
|
268
|
+
"has_rules": true,
|
|
269
|
+
"instruction_file": ".github/copilot-instructions.md",
|
|
270
|
+
"mcp_config_scope": "project",
|
|
271
|
+
"role_capabilities": [
|
|
272
|
+
"execute",
|
|
273
|
+
"review",
|
|
274
|
+
"consult"
|
|
275
|
+
],
|
|
276
|
+
"max_concurrent_tasks": 1
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "hermes",
|
|
280
|
+
"category": "autonomous-agent",
|
|
281
|
+
"workflow_model": "task-based",
|
|
282
|
+
"tier": "B",
|
|
283
|
+
"has_mcp": true,
|
|
284
|
+
"has_hooks": false,
|
|
285
|
+
"has_skills": true,
|
|
286
|
+
"has_rules": false,
|
|
287
|
+
"instruction_file": "AGENTS.md",
|
|
288
|
+
"mcp_config_scope": "machine",
|
|
289
|
+
"role_capabilities": [
|
|
290
|
+
"execute",
|
|
291
|
+
"review",
|
|
292
|
+
"consult"
|
|
293
|
+
],
|
|
294
|
+
"max_concurrent_tasks": 1
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "kilocode",
|
|
298
|
+
"category": "code-agent",
|
|
299
|
+
"workflow_model": "interactive",
|
|
300
|
+
"tier": "B",
|
|
301
|
+
"has_mcp": true,
|
|
302
|
+
"has_hooks": false,
|
|
303
|
+
"has_skills": true,
|
|
304
|
+
"has_rules": true,
|
|
305
|
+
"instruction_file": ".kilo/rules/brainclaw.md",
|
|
306
|
+
"mcp_config_scope": "project",
|
|
307
|
+
"role_capabilities": [
|
|
308
|
+
"execute",
|
|
309
|
+
"review",
|
|
310
|
+
"consult"
|
|
311
|
+
],
|
|
312
|
+
"max_concurrent_tasks": 2
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "mistral-vibe",
|
|
316
|
+
"category": "code-agent",
|
|
317
|
+
"workflow_model": "task-based",
|
|
318
|
+
"tier": "B",
|
|
319
|
+
"has_mcp": true,
|
|
320
|
+
"has_hooks": false,
|
|
321
|
+
"has_skills": true,
|
|
322
|
+
"has_rules": false,
|
|
323
|
+
"instruction_file": "AGENTS.md",
|
|
324
|
+
"mcp_config_scope": "both",
|
|
325
|
+
"role_capabilities": [
|
|
326
|
+
"execute",
|
|
327
|
+
"review",
|
|
328
|
+
"consult"
|
|
329
|
+
],
|
|
330
|
+
"max_concurrent_tasks": 2
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "nanoclaw",
|
|
334
|
+
"category": "autonomous-agent",
|
|
335
|
+
"workflow_model": "task-based",
|
|
336
|
+
"tier": "C",
|
|
337
|
+
"has_mcp": false,
|
|
338
|
+
"has_hooks": false,
|
|
339
|
+
"has_skills": true,
|
|
340
|
+
"has_rules": false,
|
|
341
|
+
"instruction_file": "skills/nanoclaw/SKILL.md",
|
|
342
|
+
"mcp_config_scope": "none",
|
|
343
|
+
"role_capabilities": [
|
|
344
|
+
"execute"
|
|
345
|
+
],
|
|
346
|
+
"max_concurrent_tasks": 1
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "nemoclaw",
|
|
350
|
+
"category": "autonomous-agent",
|
|
351
|
+
"workflow_model": "task-based",
|
|
352
|
+
"tier": "C",
|
|
353
|
+
"has_mcp": false,
|
|
354
|
+
"has_hooks": false,
|
|
355
|
+
"has_skills": true,
|
|
356
|
+
"has_rules": false,
|
|
357
|
+
"instruction_file": "skills/nemoclaw/SKILL.md",
|
|
358
|
+
"mcp_config_scope": "none",
|
|
359
|
+
"role_capabilities": [
|
|
360
|
+
"execute"
|
|
361
|
+
],
|
|
362
|
+
"max_concurrent_tasks": 1
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "openclaw",
|
|
366
|
+
"category": "autonomous-agent",
|
|
367
|
+
"workflow_model": "task-based",
|
|
368
|
+
"tier": "B",
|
|
369
|
+
"has_mcp": true,
|
|
370
|
+
"has_hooks": false,
|
|
371
|
+
"has_skills": true,
|
|
372
|
+
"has_rules": false,
|
|
373
|
+
"instruction_file": "skills/openclaw/SKILL.md",
|
|
374
|
+
"mcp_config_scope": "machine",
|
|
375
|
+
"role_capabilities": [
|
|
376
|
+
"execute",
|
|
377
|
+
"coordinate"
|
|
378
|
+
],
|
|
379
|
+
"max_concurrent_tasks": 1
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "opencode",
|
|
383
|
+
"category": "code-agent",
|
|
384
|
+
"workflow_model": "interactive",
|
|
385
|
+
"tier": "B",
|
|
386
|
+
"has_mcp": true,
|
|
387
|
+
"has_hooks": false,
|
|
388
|
+
"has_skills": false,
|
|
389
|
+
"has_rules": true,
|
|
390
|
+
"instruction_file": "AGENTS.md",
|
|
391
|
+
"mcp_config_scope": "project",
|
|
392
|
+
"role_capabilities": [
|
|
393
|
+
"execute",
|
|
394
|
+
"review"
|
|
395
|
+
],
|
|
396
|
+
"max_concurrent_tasks": 2
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "picoclaw",
|
|
400
|
+
"category": "autonomous-agent",
|
|
401
|
+
"workflow_model": "scheduled",
|
|
402
|
+
"tier": "C",
|
|
403
|
+
"has_mcp": false,
|
|
404
|
+
"has_hooks": false,
|
|
405
|
+
"has_skills": true,
|
|
406
|
+
"has_rules": false,
|
|
407
|
+
"instruction_file": "skills/picoclaw/SKILL.md",
|
|
408
|
+
"mcp_config_scope": "none",
|
|
409
|
+
"role_capabilities": [
|
|
410
|
+
"execute"
|
|
411
|
+
],
|
|
412
|
+
"max_concurrent_tasks": 1
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "roo",
|
|
416
|
+
"category": "code-agent",
|
|
417
|
+
"workflow_model": "interactive",
|
|
418
|
+
"tier": "B",
|
|
419
|
+
"has_mcp": true,
|
|
420
|
+
"has_hooks": false,
|
|
421
|
+
"has_skills": false,
|
|
422
|
+
"has_rules": true,
|
|
423
|
+
"instruction_file": ".roo/rules/brainclaw.md",
|
|
424
|
+
"mcp_config_scope": "project",
|
|
425
|
+
"role_capabilities": [
|
|
426
|
+
"execute",
|
|
427
|
+
"review"
|
|
428
|
+
],
|
|
429
|
+
"max_concurrent_tasks": 2
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "windsurf",
|
|
433
|
+
"category": "code-agent",
|
|
434
|
+
"workflow_model": "interactive",
|
|
435
|
+
"tier": "A",
|
|
436
|
+
"has_mcp": true,
|
|
437
|
+
"has_hooks": true,
|
|
438
|
+
"has_skills": true,
|
|
439
|
+
"has_rules": true,
|
|
440
|
+
"instruction_file": ".windsurfrules",
|
|
441
|
+
"mcp_config_scope": "machine",
|
|
442
|
+
"role_capabilities": [
|
|
443
|
+
"execute",
|
|
444
|
+
"review"
|
|
445
|
+
],
|
|
446
|
+
"max_concurrent_tasks": 1
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"name": "zeroclaw",
|
|
450
|
+
"category": "autonomous-agent",
|
|
451
|
+
"workflow_model": "task-based",
|
|
452
|
+
"tier": "C",
|
|
453
|
+
"has_mcp": false,
|
|
454
|
+
"has_hooks": false,
|
|
455
|
+
"has_skills": true,
|
|
456
|
+
"has_rules": false,
|
|
457
|
+
"instruction_file": "skills/zeroclaw/SKILL.md",
|
|
458
|
+
"mcp_config_scope": "none",
|
|
459
|
+
"role_capabilities": [
|
|
460
|
+
"execute"
|
|
461
|
+
],
|
|
462
|
+
"max_concurrent_tasks": 1
|
|
463
|
+
}
|
|
464
|
+
]
|
|
110
465
|
}
|
|
111
466
|
}
|
package/docs/cli.md
CHANGED
|
@@ -90,7 +90,7 @@ Machine-only onboarding. Detects available agents, writes the machine-level MCP/
|
|
|
90
90
|
|
|
91
91
|
| Option | Description |
|
|
92
92
|
|---|---|
|
|
93
|
-
| `--agents <agents>` | Agents to configure: `all`, `detected`,
|
|
93
|
+
| `--agents <agents>` | Agents to configure: `all`, `detected`/`installed`, comma-separated names, or numeric choices from the prompt |
|
|
94
94
|
| `-y, --yes` | Accept all defaults non-interactively |
|
|
95
95
|
|
|
96
96
|
```bash
|
|
@@ -101,6 +101,8 @@ brainclaw setup-machine --agents codex,cursor
|
|
|
101
101
|
|
|
102
102
|
Use this when Brainclaw is new on the current machine and you want to make the MCP surface visible to your coding agent before touching any project. The usual follow-up is `brainclaw init` inside the project you want to create or refresh.
|
|
103
103
|
|
|
104
|
+
By default, `detected` means the current agent plus every installed coding agent Brainclaw can detect on the machine. In non-interactive `--yes` mode, Brainclaw configures that detected install set when it is non-empty; explicit `--agents ...` always wins.
|
|
105
|
+
|
|
104
106
|
---
|
|
105
107
|
|
|
106
108
|
### `brainclaw init`
|
|
@@ -128,7 +130,7 @@ brainclaw init --project-mode multi-project --project-strategy folder
|
|
|
128
130
|
|
|
129
131
|
Common onboarding split:
|
|
130
132
|
|
|
131
|
-
- new machine → `brainclaw setup-machine --yes`
|
|
133
|
+
- new machine → `brainclaw setup-machine --yes` configures detected installed agents
|
|
132
134
|
- current project (new or already using Brainclaw) → `brainclaw init`
|
|
133
135
|
- explicit second agent on an existing Brainclaw project → `brainclaw enable-agent <agent-name>`
|
|
134
136
|
|
|
@@ -1398,7 +1400,7 @@ brainclaw register-agent my-bot --capability code-review --capability testing --
|
|
|
1398
1400
|
### `brainclaw enable-agent <name>`
|
|
1399
1401
|
|
|
1400
1402
|
Enable an existing agent and optionally update its capabilities.
|
|
1401
|
-
Built-in integration names include `claude-code`, `cursor`, `windsurf`, `cline`, `codex`, `opencode`, `antigravity`, `continue`, `roo`, and `github-copilot`.
|
|
1403
|
+
Built-in integration names include `claude-code`, `cursor`, `windsurf`, `cline`, `codex`, `opencode`, `antigravity`, `continue`, `roo`, `kilocode`, `mistral-vibe`, `hermes`, and `github-copilot`.
|
|
1402
1404
|
|
|
1403
1405
|
| Option | Description |
|
|
1404
1406
|
|---|---|
|
|
@@ -1409,10 +1411,11 @@ Built-in integration names include `claude-code`, `cursor`, `windsurf`, `cline`,
|
|
|
1409
1411
|
| `--json` | Output as JSON |
|
|
1410
1412
|
|
|
1411
1413
|
```bash
|
|
1412
|
-
brainclaw enable-agent github-copilot --set-current
|
|
1413
|
-
brainclaw enable-agent opencode
|
|
1414
|
-
brainclaw enable-agent antigravity
|
|
1415
|
-
brainclaw enable-agent
|
|
1414
|
+
brainclaw enable-agent github-copilot --set-current
|
|
1415
|
+
brainclaw enable-agent opencode
|
|
1416
|
+
brainclaw enable-agent antigravity
|
|
1417
|
+
brainclaw enable-agent hermes
|
|
1418
|
+
brainclaw enable-agent my-bot --capability refactor --json
|
|
1416
1419
|
```
|
|
1417
1420
|
|
|
1418
1421
|
### `brainclaw whoami`
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Dispatch lifecycle
|
|
2
|
+
|
|
3
|
+
When brainclaw routes work to another agent — `bclaw_coordinate(intent="assign"|"review"|"consult")`, `bclaw_dispatch(intent="execute")`, or a multi-turn `bclaw_loop` — it spins up **up to six related entities** plus an on-disk **brief-ack sentinel** and (since pln#504) **per-assignment stdout/stderr log files**. Knowing what each one means lets you tell at a glance whether a dispatch is alive, dead, or merely slow.
|
|
4
|
+
|
|
5
|
+
This doc is the consolidated reference. It complements:
|
|
6
|
+
- [multi-agent-workflows.md](multi-agent-workflows.md) — happy-path coordination patterns
|
|
7
|
+
- [troubleshooting.md](troubleshooting.md) — symptom-driven diagnostic playbooks
|
|
8
|
+
- [loop-engine.md](loop-engine.md) — multi-turn loop protocol details
|
|
9
|
+
- [../integrations/codex.md](../integrations/codex.md), [../integrations/claude-code.md](../integrations/claude-code.md), etc. — per-agent spawn semantics
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The six entities
|
|
14
|
+
|
|
15
|
+
A single `bclaw_coordinate(intent="review", open_loop=true, targetAgents=[codex])` creates:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
┌─────────────────┐
|
|
19
|
+
│ candidate │ cnd_… (review payload)
|
|
20
|
+
└────────┬────────┘
|
|
21
|
+
│ references
|
|
22
|
+
┌───────────────────┼──────────────────┐
|
|
23
|
+
▼ ▼ ▼
|
|
24
|
+
┌──────────┐ ┌─────────────┐ ┌──────────┐
|
|
25
|
+
│ loop │ ◄────►│ assignment │ │ message │
|
|
26
|
+
│ lop_… │ │ asgn_… │ │ msg_… │
|
|
27
|
+
└──────────┘ └──────┬──────┘ └──────────┘
|
|
28
|
+
│
|
|
29
|
+
│ owned-by
|
|
30
|
+
▼
|
|
31
|
+
┌──────────────┐
|
|
32
|
+
│ claim │ clm_… (worktree lock)
|
|
33
|
+
└──────┬───────┘
|
|
34
|
+
│ triggers
|
|
35
|
+
▼
|
|
36
|
+
┌──────────────┐
|
|
37
|
+
│ agent_run │ run_… (the OS-level spawn)
|
|
38
|
+
└──────┬───────┘
|
|
39
|
+
│
|
|
40
|
+
┌───────────────────┼─────────────────┐
|
|
41
|
+
▼ ▼ ▼
|
|
42
|
+
┌──────────┐ ┌─────────────┐ ┌────────────┐
|
|
43
|
+
│ ack file │ │ stdout log │ │ stderr log │
|
|
44
|
+
│ .ack │ │ .stdout.log │ │ .stderr.log│
|
|
45
|
+
└──────────┘ └─────────────┘ └────────────┘
|
|
46
|
+
(pln#476) (pln#504) (pln#504)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
| Entity | Prefix | Created by | Owner | Purpose |
|
|
50
|
+
|---|---|---|---|---|
|
|
51
|
+
| `candidate` | `cnd_` | the coordinate facade (review/ideate) | the dispatcher agent | Review payload that the loop references. Stays after the loop closes. |
|
|
52
|
+
| `loop` | `lop_` | `bclaw_coordinate(open_loop=true)` or `bclaw_loop(intent="open")` | the dispatcher | Multi-turn thread of structured work. Has its own FSM. |
|
|
53
|
+
| `assignment` | `asgn_` | dispatcher when targeting an agent | the **target** agent | Lifecycle event for that agent's turn. The only entity whose FSM tracks the WORKER's progress. |
|
|
54
|
+
| `message` | `msg_` | dispatcher | the dispatcher | The brief delivered to the target's inbox. |
|
|
55
|
+
| `claim` | `clm_` | dispatcher (or `bclaw_claim` directly) | the target agent | Worktree advisory lock. Released when the work is done or the agent gives up. |
|
|
56
|
+
| `agent_run` | `run_` | the CLI execution adapter, only when an OS-level spawn actually happens | the target agent | OS-level subprocess record. Status FSM tracks the LIFETIME of the process — but only the parts brainclaw can observe (see [§Liveness limits](#liveness-limits) below). |
|
|
57
|
+
|
|
58
|
+
Plus two filesystem-only artefacts created by the worker shell wrapper:
|
|
59
|
+
|
|
60
|
+
- **Brief-ack sentinel**: `.brainclaw/coordination/runtime/ack/<assignment_id>.ack` — touched by the spawn wrapper BEFORE the agent binary runs (pln#476). Proves the spawn shell got far enough to execute `touch`. Does NOT prove the agent binary itself succeeded.
|
|
61
|
+
- **stdout/stderr logs** (pln#504): `.brainclaw/coordination/runtime/log/<assignment_id>.{stdout,stderr}.log` — opened by the parent before the spawn, the child inherits dup'd fds and writes its streams there. This is the only window onto what a sandboxed worker actually said before dying.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## FSM cheatsheet
|
|
66
|
+
|
|
67
|
+
### `loop.status`
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
open ──▶ paused ──▶ open (pause / resume)
|
|
71
|
+
│
|
|
72
|
+
├──▶ completed (stop_condition met)
|
|
73
|
+
├──▶ cancelled (manual close — use when the loop dies abnormally)
|
|
74
|
+
└──▶ blocked (external blocker; intent to resume later)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`bclaw_loop(intent="close")` accepts **only** `completed | cancelled | blocked` as `status`. **Not `failed`** — map crashed/dead loops to `cancelled` with a `reason`.
|
|
78
|
+
|
|
79
|
+
### `assignment.status`
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
created ──▶ offered ──▶ accepted ──▶ started ──▶ completed
|
|
83
|
+
│ │ │ │
|
|
84
|
+
│ │ │ └──▶ failed (worker self-reported)
|
|
85
|
+
│ │ │ └──▶ blocked (worker needs supervisor)
|
|
86
|
+
│ │ │ └──▶ cancelled (rerouted away)
|
|
87
|
+
│ │ └──▶ acceptance_ttl expired (default 15min) → cancelled
|
|
88
|
+
│ └──▶ heartbeat_ttl expired (default 30min while running) → cancelled
|
|
89
|
+
└──▶ removed by `bclaw_assignment_admin` (rare)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Transitions past `offered` require the assigned agent itself (or `bclaw_assignment_admin`). A coordinator that didn't create the assignment **cannot** update it — `Agent X cannot update assignment owned by Y` is the canonical rejection.
|
|
93
|
+
|
|
94
|
+
### `agent_run.status`
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
launching ──▶ running ──▶ completed
|
|
98
|
+
│ ──▶ failed (non-zero exit, worker reported)
|
|
99
|
+
│ ──▶ interrupted (TTL/heartbeat expiry, see below)
|
|
100
|
+
│
|
|
101
|
+
└──▶ failed (spawn returned no pid, brief-ack timeout)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Liveness limits** {#liveness-limits}: `last_event_at` is bumped only when the worker writes a lifecycle event (via MCP or via the wrap shell). A worker that crashes before its first output keeps `status=running` and `last_event_at == launched_at` until reconciled. Since pln#503 phase 3.2, **any read of `agent_run` via `bclaw_find` / `bclaw_get` triggers a lazy reconciliation pass**: open runs past the 60s grace window get their pid checked, and dead workers transition to `failed` (`status_reason='silent_termination_no_evidence'`) once past the 30min stale threshold.
|
|
105
|
+
|
|
106
|
+
For a single consolidated check (run + assignment + claim + loop + pid + log tails + verdict in one response), use **`bclaw_dispatch_status(target_id)`** (pln#503 phase 3.1).
|
|
107
|
+
|
|
108
|
+
### `claim.status`
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
active ──▶ released
|
|
112
|
+
│
|
|
113
|
+
└──▶ adopted (another session inherited the claim, e.g. reconnect)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Releasing a claim does NOT cancel its assignment / agent_run / loop — those are independent entities. You generally need to clean up all of them together when aborting a dispatch.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Observability decision tree
|
|
121
|
+
|
|
122
|
+
You called `bclaw_coordinate(intent="review", open_loop=true, …)` and got back `execution_status: "delivered_and_started"`. What does that actually mean?
|
|
123
|
+
|
|
124
|
+
**Fast path** (recommended since pln#503 phase 3.1): call `bclaw_dispatch_status(target_id="<asgn_…>")` and read its `diagnosis.health` + `diagnosis.recommended_next_action`. The tool consolidates the steps below into a single response — entity fan-out, pid liveness, log tails, verdict, recommended next action.
|
|
125
|
+
|
|
126
|
+
**Long path** (for understanding or when the tool isn't available):
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
1. execution_status = "delivered_and_started"
|
|
130
|
+
├──▶ Means: the spawn wrapper touched the brief-ack sentinel
|
|
131
|
+
└──▶ Does NOT mean: the worker is doing useful work
|
|
132
|
+
|
|
133
|
+
2. Verify the spawn is alive — check the agent_run record
|
|
134
|
+
bclaw_find(entity="agent_run", filter={assignment_id: "<asgn>"})
|
|
135
|
+
├──▶ status="running" AND pid alive on OS AND last_event_at < 5min ago → healthy
|
|
136
|
+
├──▶ status="running" AND pid alive AND last_event_at == launched_at → stalled (worker never produced output)
|
|
137
|
+
├──▶ status="running" AND pid dead → silently died (see logs)
|
|
138
|
+
└──▶ status="completed" / "failed" / "interrupted" → terminal, read status_reason
|
|
139
|
+
|
|
140
|
+
3. If silent, read the logs (pln#504)
|
|
141
|
+
cat .brainclaw/coordination/runtime/log/<asgn>.stderr.log
|
|
142
|
+
cat .brainclaw/coordination/runtime/log/<asgn>.stdout.log
|
|
143
|
+
├──▶ Contains an error → root cause found
|
|
144
|
+
└──▶ Empty → worker died before any write OR launched without log capture (legacy path)
|
|
145
|
+
|
|
146
|
+
4. If the worker is alive but doing nothing useful for 15+ min
|
|
147
|
+
→ most likely sandbox / MCP / capability mismatch with the brief
|
|
148
|
+
→ see ../integrations/<agent>.md "Caveats" for per-agent gotchas
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Diagnostic playbook
|
|
154
|
+
|
|
155
|
+
When a dispatch hangs, work top-down through these checks. For the symptom-driven variant see [troubleshooting.md#inbox-messages-stuck--brief-ack-never-arrived](troubleshooting.md#inbox-messages-stuck--brief-ack-never-arrived).
|
|
156
|
+
|
|
157
|
+
### Quick triage (≤5s)
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Single call covers process liveness + ack + log tails + entity state + verdict
|
|
161
|
+
bclaw_dispatch_status(target_id="<asgn>") # or clm_/lop_/run_
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Read `diagnosis.health` (`healthy` | `stalled` | `silent_death` | `terminal` | `not_dispatched` | `unknown`) and `diagnosis.recommended_next_action` — usually that's all you need.
|
|
165
|
+
|
|
166
|
+
### Manual triage (≤30s — when `bclaw_dispatch_status` isn't available)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# 1. Is the OS-level process alive?
|
|
170
|
+
Get-Process -Id <pid> # Windows
|
|
171
|
+
ps -p <pid> # POSIX
|
|
172
|
+
|
|
173
|
+
# 2. Did the spawn wrapper actually run?
|
|
174
|
+
ls .brainclaw/coordination/runtime/ack/<asgn>.ack
|
|
175
|
+
|
|
176
|
+
# 3. What did the worker say? (pln#504)
|
|
177
|
+
cat .brainclaw/coordination/runtime/log/<asgn>.stderr.log
|
|
178
|
+
cat .brainclaw/coordination/runtime/log/<asgn>.stdout.log
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Deeper (1-5min)
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Full entity state — same fan-out bclaw_dispatch_status does for you
|
|
185
|
+
bclaw_get(entity="assignment", id="<asgn>") # owner, ttls, status_reason
|
|
186
|
+
bclaw_get(entity="agent_run", id="<run>") # pid, started_at, last_event_at
|
|
187
|
+
bclaw_get(entity="claim", id="<clm>") # worktree, agent
|
|
188
|
+
bclaw_get(entity="loop", id="<lop>") # current_phase, slot states
|
|
189
|
+
|
|
190
|
+
# Worktree activity
|
|
191
|
+
git -C <worktree> log --oneline -5 # any new commits?
|
|
192
|
+
git -C <worktree> status # uncommitted work?
|
|
193
|
+
ls <worktree>/REVIEW_FINDINGS.md # for review loops
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Abort a dispatch cleanly
|
|
197
|
+
|
|
198
|
+
A dead dispatch needs four cleanup steps (no single facade does all of them today):
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
1. Stop-Process -Id <pid> # if pid still alive
|
|
202
|
+
2. bclaw_loop(intent="close", loop_id="<lop>", status="cancelled", reason="...")
|
|
203
|
+
3. bclaw_release_claim(id="<clm>")
|
|
204
|
+
4. (optional) bclaw_assignment_admin or leave assignment as `offered`
|
|
205
|
+
— only the owning agent can transition assignment.status, and a
|
|
206
|
+
released claim already makes it effectively orphan
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Per-agent spawn semantics
|
|
212
|
+
|
|
213
|
+
Spawn behaviour varies by agent. The capability profile in `src/core/agent-capability.ts` describes each agent's prompt delivery, sandbox model, and MCP availability. Per-agent caveats:
|
|
214
|
+
|
|
215
|
+
- [codex.md](../integrations/codex.md#caveats) — `--sandbox workspace-write` required; spawned codex may not have brainclaw MCP wired; stdin_pipe prompt delivery; brief-ack required for headless dispatch detection.
|
|
216
|
+
- [claude-code.md](../integrations/claude-code.md) — interactive vs `-p` headless modes; tools whitelist.
|
|
217
|
+
- [copilot.md](../integrations/copilot.md), [windsurf.md](../integrations/windsurf.md), [cline.md](../integrations/cline.md), [opencode.md](../integrations/opencode.md), [roo.md](../integrations/roo.md), [kilocode.md](../integrations/kilocode.md), [continue.md](../integrations/continue.md) — per-agent specifics.
|
|
218
|
+
- [mistral-vibe.md](../integrations/mistral-vibe.md) — EU/GDPR self-hosted option.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## See also
|
|
223
|
+
|
|
224
|
+
- [troubleshooting.md](troubleshooting.md) — symptom-driven diagnostic playbooks
|
|
225
|
+
- [loop-engine.md](loop-engine.md) — multi-turn loop protocol, locks, advance gates
|
|
226
|
+
- [multi-agent-workflows.md](multi-agent-workflows.md) — high-level coordination scenarios
|
|
227
|
+
- [../integrations/overview.md](../integrations/overview.md) — index of supported agents
|
|
228
|
+
- [../integrations/mcp.md](../integrations/mcp.md) — full MCP tool catalog
|