@linxiraos/pi-messenger 1.1.1 → 1.3.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/CHANGELOG.md +741 -676
- package/LICENSE +45 -0
- package/README.md +424 -424
- package/THIRD-PARTY-NOTICES.txt +22951 -0
- package/config-overlay.ts +175 -171
- package/config.ts +221 -209
- package/crew/agents/crew-plan-sync.md +66 -64
- package/crew/agents/crew-planner.md +173 -172
- package/crew/agents/crew-reviewer.md +58 -58
- package/crew/agents/crew-worker.md +130 -129
- package/crew/agents.ts +507 -434
- package/crew/handlers/coordination.ts +350 -332
- package/crew/handlers/plan.ts +988 -906
- package/crew/handlers/review.ts +354 -333
- package/crew/handlers/revise.ts +400 -376
- package/crew/handlers/status.ts +303 -295
- package/crew/handlers/sync.ts +237 -233
- package/crew/handlers/task.ts +820 -792
- package/crew/handlers/team.ts +294 -235
- package/crew/handlers/work.ts +467 -425
- package/crew/id-allocator.ts +30 -30
- package/crew/index.ts +297 -257
- package/crew/live-progress.ts +58 -58
- package/crew/lobby.ts +504 -473
- package/crew/prompt.ts +262 -252
- package/crew/registry.ts +114 -114
- package/crew/spawn.ts +135 -111
- package/crew/state-autonomous.ts +163 -164
- package/crew/state-planning.ts +264 -263
- package/crew/state.ts +20 -20
- package/crew/store.ts +646 -642
- package/crew/task-actions.ts +162 -131
- package/crew/team/store.ts +572 -479
- package/crew/team/subagent-roles.ts +105 -87
- package/crew/team/types.ts +50 -50
- package/crew/types.ts +194 -194
- package/crew/utils/artifacts.ts +57 -62
- package/crew/utils/config.ts +158 -156
- package/crew/utils/discover.ts +221 -219
- package/crew/utils/install.ts +94 -85
- package/crew/utils/migrations.ts +126 -0
- package/crew/utils/progress.ts +191 -187
- package/crew/utils/result.ts +16 -16
- package/crew/utils/risk-labels.ts +5 -7
- package/crew/utils/task-format.ts +14 -14
- package/crew/utils/team-roles.ts +44 -28
- package/crew/utils/truncate.ts +76 -79
- package/crew/utils/verdict.ts +55 -55
- package/editor-binary.ts +150 -0
- package/editor-command.ts +107 -0
- package/editor-target.ts +40 -0
- package/feed.ts +321 -268
- package/handlers.ts +1041 -1107
- package/index.ts +1314 -1206
- package/install.mjs +187 -189
- package/lib.ts +587 -467
- package/overlay-actions.ts +519 -511
- package/overlay-coordinator.ts +150 -150
- package/overlay-render.ts +770 -676
- package/overlay.ts +872 -830
- package/package.json +64 -60
- package/paths.ts +60 -0
- package/skills/pi-messenger-crew/SKILL.md +375 -347
- package/store.ts +1147 -1139
- package/teamagent-command.ts +321 -0
- package/vitest.config.ts +10 -10
|
@@ -1,347 +1,375 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pi-messenger-crew
|
|
3
|
-
description: Orchestrator reference for pi-messenger Crew planning, task management, configuration, and agent coordination. Crew workers already have the pi_messenger actions they need in crew-worker.md.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Pi-Messenger Crew Skill
|
|
7
|
-
|
|
8
|
-
> Crew workers do not need this skill. `crew-worker.md` already contains every `pi_messenger` action workers need for task execution.
|
|
9
|
-
>
|
|
10
|
-
> Orchestrators and humans can use this as the full reference for planning, task management, configuration, and Crew internals.
|
|
11
|
-
|
|
12
|
-
Use pi-messenger for multi-agent coordination and Crew task orchestration.
|
|
13
|
-
|
|
14
|
-
## Quick Reference
|
|
15
|
-
|
|
16
|
-
### Join or Leave the Mesh
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
pi_messenger({ action: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
pi_messenger({ action: "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
pi_messenger({ action: "team.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
pi_messenger({ action: "
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
pi_messenger({ action: "
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
pi_messenger({ action: "
|
|
95
|
-
pi_messenger({ action: "
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pi_messenger({ action: "task.
|
|
103
|
-
pi_messenger({ action: "task.
|
|
104
|
-
pi_messenger({ action: "task.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
pi_messenger({ action: "task.
|
|
108
|
-
pi_messenger({ action: "task.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
//
|
|
189
|
-
pi_messenger({ action: "
|
|
190
|
-
|
|
191
|
-
//
|
|
192
|
-
pi_messenger({ action: "
|
|
193
|
-
|
|
194
|
-
//
|
|
195
|
-
pi_messenger({ action: "
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
.
|
|
226
|
-
├──
|
|
227
|
-
├──
|
|
228
|
-
├──
|
|
229
|
-
├──
|
|
230
|
-
├──
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
1
|
+
---
|
|
2
|
+
name: pi-messenger-crew
|
|
3
|
+
description: Orchestrator reference for pi-messenger Crew planning, task management, configuration, and agent coordination. Crew workers already have the pi_messenger actions they need in crew-worker.md.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pi-Messenger Crew Skill
|
|
7
|
+
|
|
8
|
+
> Crew workers do not need this skill. `crew-worker.md` already contains every `pi_messenger` action workers need for task execution.
|
|
9
|
+
>
|
|
10
|
+
> Orchestrators and humans can use this as the full reference for planning, task management, configuration, and Crew internals.
|
|
11
|
+
|
|
12
|
+
Use pi-messenger for multi-agent coordination and Crew task orchestration.
|
|
13
|
+
|
|
14
|
+
## Quick Reference
|
|
15
|
+
|
|
16
|
+
### Join or Leave the Mesh
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
pi_messenger({ action: "join" });
|
|
20
|
+
pi_messenger({ action: "leave" });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Check Status
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
pi_messenger({ action: "status" });
|
|
27
|
+
pi_messenger({ action: "list" }); // See other agents
|
|
28
|
+
pi_messenger({ action: "feed" }); // Activity feed
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Crew Workflow
|
|
32
|
+
|
|
33
|
+
### 1. Check Crew Agents
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
pi_messenger({ action: "crew.agents" }); // Verify 5 agents
|
|
37
|
+
pi_messenger({ action: "crew.install" }); // Informational: shows discovered sources
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Plan from PRD
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// Auto-discover PRD.md in current directory
|
|
44
|
+
pi_messenger({ action: "plan" });
|
|
45
|
+
|
|
46
|
+
// Or specify path
|
|
47
|
+
pi_messenger({ action: "plan", prd: "path/to/PRD.md" });
|
|
48
|
+
|
|
49
|
+
// Or pass an inline prompt (no PRD file needed)
|
|
50
|
+
pi_messenger({ action: "plan", prompt: "Scan the codebase for bugs focusing on error handling" });
|
|
51
|
+
|
|
52
|
+
// Re-plan with a steering prompt (wipes existing tasks, preserves progress notes)
|
|
53
|
+
pi_messenger({ action: "plan", prompt: "Split the auth module into login and registration" });
|
|
54
|
+
|
|
55
|
+
// Steer first-time planning (prompt injected into progress notes before planner runs)
|
|
56
|
+
pi_messenger({ action: "plan", prd: "docs/PRD.md", prompt: "focus on backend first" });
|
|
57
|
+
|
|
58
|
+
// Plan + auto-start autonomous work when planning completes
|
|
59
|
+
pi_messenger({ action: "plan" }); // auto-starts workers (default)
|
|
60
|
+
|
|
61
|
+
// Cancel active or stale planning
|
|
62
|
+
pi_messenger({ action: "plan.cancel" });
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Re-planning rejects if any tasks are `in_progress` — stop or complete them first. The steering prompt is injected into `planning-progress.md`'s Notes section where the planner reads it on every pass.
|
|
66
|
+
|
|
67
|
+
### Optional: Activate Team Context
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
pi_messenger({ action: "team.setup", name: "migration-squad" });
|
|
71
|
+
pi_messenger({ action: "team.setup", name: "review-squad" });
|
|
72
|
+
pi_messenger({
|
|
73
|
+
action: "team.setup",
|
|
74
|
+
name: "research-squad",
|
|
75
|
+
message: "Research first, then plan the implementation.",
|
|
76
|
+
});
|
|
77
|
+
pi_messenger({ action: "team.memory.note", type: "decision", message: "Use cursor pagination for task history" });
|
|
78
|
+
pi_messenger({ action: "team.roles" });
|
|
79
|
+
pi_messenger({ action: "team.status" });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Team is optional. Use `team.setup` for first-run setup: it activates a profile, saves editable JSON if needed, creates a starter charter when missing, and returns next steps. Crew remains the execution engine. Team role names follow the packaged `pi-subagents` vocabulary where possible (`context-builder`, `delegate`, `oracle`, `planner`, `researcher`, `reviewer`, `scout`, `worker`). `pi-messenger` may read subagent markdown metadata from disk when present, but it does not require or invoke subagents. Active Team profiles let the planner tag tasks with `role` and `riskLabels`, then inject role, charter, and memory context into worker prompts. High-risk tasks wait for `task.approve`; `task.reject` records feedback and rejected tasks surface `task.revise` / `task.revise-tree` next steps.
|
|
83
|
+
|
|
84
|
+
### 3. Work on Tasks
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// Single wave (runs ready tasks once)
|
|
88
|
+
pi_messenger({ action: "work" });
|
|
89
|
+
|
|
90
|
+
// Autonomous (keeps running until done/blocked)
|
|
91
|
+
pi_messenger({ action: "work", autonomous: true });
|
|
92
|
+
|
|
93
|
+
// Override concurrency or model for this wave
|
|
94
|
+
pi_messenger({ action: "work", autonomous: true, concurrency: 4 });
|
|
95
|
+
pi_messenger({ action: "work", model: "claude-sonnet-4-20250514" });
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4. Task Management
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
pi_messenger({ action: "task.list" });
|
|
102
|
+
pi_messenger({ action: "task.ready" }); // Tasks with no pending deps
|
|
103
|
+
pi_messenger({ action: "task.show", id: "task-1" });
|
|
104
|
+
pi_messenger({ action: "task.start", id: "task-1" });
|
|
105
|
+
pi_messenger({ action: "task.progress", id: "task-1", message: "Implemented auth middleware" });
|
|
106
|
+
pi_messenger({ action: "task.done", id: "task-1", summary: "What was done" });
|
|
107
|
+
pi_messenger({ action: "task.block", id: "task-1", reason: "Why blocked" });
|
|
108
|
+
pi_messenger({ action: "task.unblock", id: "task-1" });
|
|
109
|
+
pi_messenger({ action: "task.reset", id: "task-1" });
|
|
110
|
+
pi_messenger({ action: "task.reset", id: "task-1", cascade: true }); // Reset dependents too
|
|
111
|
+
|
|
112
|
+
// Create tasks manually
|
|
113
|
+
pi_messenger({ action: "task.create", title: "Implement auth", content: "Detailed spec...", dependsOn: ["task-1"] });
|
|
114
|
+
pi_messenger({ action: "task.create", title: "Change auth API", role: "worker", riskLabels: ["auth", "api-contract"] });
|
|
115
|
+
pi_messenger({ action: "task.approve", id: "task-2" });
|
|
116
|
+
|
|
117
|
+
// Split a task into subtasks (two-phase: inspect then execute)
|
|
118
|
+
pi_messenger({ action: "task.split", id: "task-3" }); // Inspect: shows spec, deps, dependents
|
|
119
|
+
pi_messenger({
|
|
120
|
+
action: "task.split",
|
|
121
|
+
id: "task-3",
|
|
122
|
+
subtasks: [
|
|
123
|
+
{ title: "Subtask A", content: "..." },
|
|
124
|
+
{ title: "Subtask B", content: "..." },
|
|
125
|
+
],
|
|
126
|
+
}); // Execute: creates subtasks, parent becomes milestone
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 5. Task Revision
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
// Revise a single task's spec (planner rewrites based on your prompt)
|
|
133
|
+
pi_messenger({ action: "task.revise", id: "task-3", prompt: "add error handling for network failures" });
|
|
134
|
+
|
|
135
|
+
// Revise a task and all its transitive dependents (subtree revision)
|
|
136
|
+
// Planner sees the full subtree and can add/remove/modify tasks
|
|
137
|
+
pi_messenger({ action: "task.revise-tree", id: "task-3", prompt: "split this into separate API and CLI tasks" });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Single revision rewrites one task's spec. Tree revision rewrites an entire subtree — the planner can modify existing tasks, add new ones (capped at 2x subtree size), remove pending ones, and rewire dependencies. Done tasks in the subtree are preserved; revisable tasks reset to `todo`.
|
|
141
|
+
|
|
142
|
+
Both revisions are mutually exclusive (only one revision at a time).
|
|
143
|
+
|
|
144
|
+
### 6. Review
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
// Review a task implementation
|
|
148
|
+
pi_messenger({ action: "review", target: "task-1" });
|
|
149
|
+
|
|
150
|
+
// Review the overall plan
|
|
151
|
+
pi_messenger({ action: "review", target: "plan", type: "plan" });
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Overlay Keybindings
|
|
155
|
+
|
|
156
|
+
The Crew overlay (accessible via `/messenger` then tab to Crew) supports these keybindings:
|
|
157
|
+
|
|
158
|
+
**Global:** `[+/-]` Adjust worker concurrency (1-10), `[c]` Cancel active planning, `[Esc]` Close/back
|
|
159
|
+
|
|
160
|
+
**Task list view:** `[↑/↓]` Navigate, `[Enter]` Detail view
|
|
161
|
+
|
|
162
|
+
**Task actions (list and detail):**
|
|
163
|
+
|
|
164
|
+
- `[s]` Start task (todo only)
|
|
165
|
+
- `[r]` Reset task, `[R]` Cascade reset (reset + all dependents)
|
|
166
|
+
- `[u]` Unblock task (blocked only)
|
|
167
|
+
- `[b]` Block with reason (in_progress only)
|
|
168
|
+
- `[q]` Stop worker (in_progress with live worker)
|
|
169
|
+
- `[m]` Message worker (in_progress with live worker)
|
|
170
|
+
- `[S]` Split task (shows hint with command)
|
|
171
|
+
- `[p]` Revise task spec, `[P]` Revise subtree (not in_progress, not milestone)
|
|
172
|
+
- `[x]` Delete task (not while worker is active)
|
|
173
|
+
- `[←/→]` Navigate between tasks in detail view
|
|
174
|
+
|
|
175
|
+
## File Coordination
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
// Reserve files before editing
|
|
179
|
+
pi_messenger({ action: "reserve", paths: ["src/index.ts", "src/types.ts"], reason: "Working on core" });
|
|
180
|
+
|
|
181
|
+
// Release when done
|
|
182
|
+
pi_messenger({ action: "release" });
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Agent Communication
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
// Rename yourself
|
|
189
|
+
pi_messenger({ action: "rename", name: "MyAgentName" });
|
|
190
|
+
|
|
191
|
+
// Send message to specific agent
|
|
192
|
+
pi_messenger({ action: "send", to: "OtherAgent", message: "Hello!" });
|
|
193
|
+
|
|
194
|
+
// Broadcast to all
|
|
195
|
+
pi_messenger({ action: "broadcast", message: "Announcement" });
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Messages are logged to the feed and visible in the overlay. DMs interrupt only the target agent (delivered as steering); broadcasts interrupt all agents.
|
|
199
|
+
|
|
200
|
+
## Typical Crew Session
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// 1. Join
|
|
204
|
+
pi_messenger({ action: "join" });
|
|
205
|
+
|
|
206
|
+
// 2. Plan (spawns planner agent)
|
|
207
|
+
pi_messenger({ action: "plan" });
|
|
208
|
+
|
|
209
|
+
// 3. Check tasks
|
|
210
|
+
pi_messenger({ action: "task.list" });
|
|
211
|
+
|
|
212
|
+
// 4. Work
|
|
213
|
+
pi_messenger({ action: "work", autonomous: true });
|
|
214
|
+
|
|
215
|
+
// 5. Status
|
|
216
|
+
pi_messenger({ action: "status" });
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Data Storage
|
|
220
|
+
|
|
221
|
+
Crew stores data in `.zeta/messenger/crew/`:
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
.zeta/messenger/crew/
|
|
225
|
+
├── config.json # Project config (concurrency, models, coordination, etc.)
|
|
226
|
+
├── plan.json # Plan metadata
|
|
227
|
+
├── planning-progress.md # Planner output log (Notes section for steering)
|
|
228
|
+
├── planning-outline.md # Latest plan outline
|
|
229
|
+
├── planning-state.json # Current planning phase/pass
|
|
230
|
+
├── agents/ # Optional: project-level crew agent overrides
|
|
231
|
+
│ └── crew-worker.md
|
|
232
|
+
├── tasks/
|
|
233
|
+
│ ├── task-1.json # Task metadata (status, deps, summary)
|
|
234
|
+
│ ├── task-1.md # Task spec (planner-generated)
|
|
235
|
+
│ ├── task-1.progress.md # Worker progress log
|
|
236
|
+
│ └── ...
|
|
237
|
+
├── blocks/
|
|
238
|
+
│ └── task-N.md # Block context
|
|
239
|
+
└── artifacts/ # Debug artifacts (agent input/output)
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Team stores active project state in `.zeta/messenger/team/`:
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
.zeta/messenger/team/
|
|
246
|
+
├── team.json # Active team/profile
|
|
247
|
+
├── charter.md # Project team charter
|
|
248
|
+
├── memory.jsonl # Structured memory source of truth
|
|
249
|
+
├── decisions.md # Human-readable memory rollups
|
|
250
|
+
├── interfaces.md
|
|
251
|
+
├── risks.md
|
|
252
|
+
└── handoffs.md
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Reusable profiles are JSON files under `~/.zeta/agent/messenger/team-profiles/`.
|
|
256
|
+
|
|
257
|
+
The activity feed lives at `.zeta/messenger/feed.jsonl` (project-scoped, shared across all agents in the project).
|
|
258
|
+
|
|
259
|
+
Each crew agent ships with a default model:
|
|
260
|
+
|
|
261
|
+
| Agent | Role | Default Model |
|
|
262
|
+
| ---------------- | -------- | ---------------------------- |
|
|
263
|
+
| `crew-planner` | planner | `anthropic/claude-opus-4-6` |
|
|
264
|
+
| `crew-worker` | worker | `anthropic/claude-haiku-4-5` |
|
|
265
|
+
| `crew-reviewer` | reviewer | `anthropic/claude-opus-4-6` |
|
|
266
|
+
| `crew-plan-sync` | analyst | `anthropic/claude-haiku-4-5` |
|
|
267
|
+
|
|
268
|
+
Override via `crew.models.<role>` in config. To customize an agent for a project, copy it from the extension's `crew/agents/` directory (under `~/.zeta/plugins/node_modules/@linxiraos/pi-messenger/`) to `.zeta/messenger/crew/agents/` and edit the frontmatter — project-level agents override extension defaults by name, and load only when the project opts in (`"trustProjectAgents": true` in `.zeta/pi-messenger.json`). Agents support `thinking: <level>` in frontmatter (off, minimal, low, medium, high, xhigh). Config `thinking.<role>` overrides the frontmatter value.
|
|
269
|
+
|
|
270
|
+
## Configuration
|
|
271
|
+
|
|
272
|
+
User-level config goes in `~/.zeta/agent/pi-messenger.json` under a `crew` key. Project-level config goes in `.zeta/messenger/crew/config.json`. Project overrides user, both override defaults.
|
|
273
|
+
|
|
274
|
+
Crew spawns multiple LLM sessions in parallel — start with a cheap worker model and scale up. Add this to `~/.zeta/agent/pi-messenger.json`:
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{ "crew": { "models": { "worker": "claude-haiku-4-5" } } }
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Model strings accept `provider/model` format for explicit provider selection and `:level` suffix for inline thinking control:
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"crew": {
|
|
285
|
+
"models": { "worker": "anthropic/claude-haiku-4-5", "planner": "openrouter/anthropic/claude-sonnet-4:high" }
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
The `:level` suffix and the `thinking.<role>` config are independent — if both are set, the suffix takes precedence.
|
|
291
|
+
|
|
292
|
+
Full example (`~/.zeta/agent/pi-messenger.json`):
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"crew": {
|
|
297
|
+
"concurrency": { "workers": 3, "max": 6 },
|
|
298
|
+
"models": { "worker": "claude-haiku-4-5", "planner": "claude-sonnet-4-6" },
|
|
299
|
+
"coordination": "chatty",
|
|
300
|
+
"work": { "maxAttemptsPerTask": 5 }
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Project-level (`.zeta/messenger/crew/config.json`):
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
{
|
|
309
|
+
"concurrency": { "workers": 4 },
|
|
310
|
+
"coordination": "moderate",
|
|
311
|
+
"models": { "worker": "gpt-4.1" },
|
|
312
|
+
"planning": { "maxPasses": 1 },
|
|
313
|
+
"work": {
|
|
314
|
+
"maxWaves": 50,
|
|
315
|
+
"env": { "OPENAI_API_BASE": "https://custom.endpoint" }
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Key Settings
|
|
321
|
+
|
|
322
|
+
| Setting | Description | Default |
|
|
323
|
+
| ---------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------- |
|
|
324
|
+
| `concurrency.workers` | Default parallel workers per wave | `2` |
|
|
325
|
+
| `concurrency.max` | Maximum workers allowed via `+` key (hard ceiling: 10) | `10` |
|
|
326
|
+
| `dependencies` | Dependency scheduling mode: `advisory` or `strict` | `"advisory"` |
|
|
327
|
+
| `coordination` | Worker communication level: `none`, `minimal`, `moderate`, `chatty` | `chatty` |
|
|
328
|
+
| `messageBudgets` | Max outgoing messages per worker per level (sends rejected after limit) | `{ none: 0, minimal: 2, moderate: 5, chatty: 10 }` |
|
|
329
|
+
| `models.worker` | Default model for workers | `anthropic/claude-haiku-4-5` |
|
|
330
|
+
| `models.planner` | Default model for planner | `anthropic/claude-opus-4-6` |
|
|
331
|
+
| `models.reviewer` | Default model for reviewer | `anthropic/claude-opus-4-6` |
|
|
332
|
+
| `models.analyst` | Default model for analyst (plan-sync) | `anthropic/claude-haiku-4-5` |
|
|
333
|
+
| `thinking.planner` | Thinking level for planner agent | (from frontmatter) |
|
|
334
|
+
| `thinking.worker` | Thinking level for worker agents | (from frontmatter) |
|
|
335
|
+
| `thinking.reviewer` | Thinking level for reviewer agents | (from frontmatter) |
|
|
336
|
+
| `thinking.analyst` | Thinking level for analyst agents | (from frontmatter) |
|
|
337
|
+
| `planning.maxPasses` | Max planner/reviewer refinement passes | `1` |
|
|
338
|
+
| `work.maxWaves` | Max autonomous waves | `50` |
|
|
339
|
+
| `work.maxAttemptsPerTask` | Max attempts before auto-blocking a task | `5` |
|
|
340
|
+
| `work.stopOnBlock` | Stop autonomous mode when any task blocks | `false` |
|
|
341
|
+
| `work.shutdownGracePeriodMs` | Grace period before SIGTERM on abort | `30000` |
|
|
342
|
+
| `work.env` | Environment variables passed to spawned workers | `{}` |
|
|
343
|
+
|
|
344
|
+
### Coordination Levels
|
|
345
|
+
|
|
346
|
+
Controls how much workers communicate during execution:
|
|
347
|
+
|
|
348
|
+
- **`none`**: No coordination instructions. Workers just execute their task.
|
|
349
|
+
- **`minimal`**: Check reservations before editing files. Message if conflicts.
|
|
350
|
+
- **`moderate`**: Announce start/completion via broadcast. Check reservations. Ask about unclear dependencies.
|
|
351
|
+
- **`chatty`** (default): All of moderate, plus: DM peers whose tasks overlap, share progress on interface changes, respond to incoming messages, claim next task after completion.
|
|
352
|
+
|
|
353
|
+
At `moderate` and `chatty`, workers also receive recent activity context and concurrent task info in their prompts.
|
|
354
|
+
|
|
355
|
+
### Model Override Priority
|
|
356
|
+
|
|
357
|
+
Worker model is resolved with this priority (highest wins):
|
|
358
|
+
|
|
359
|
+
1. Per-task `model` field on the task object
|
|
360
|
+
2. Per-wave `model` param on the work call
|
|
361
|
+
3. Team role model when present
|
|
362
|
+
4. Config-level `crew.models.worker`
|
|
363
|
+
5. Host session model
|
|
364
|
+
6. Agent `.md` frontmatter `model` field
|
|
365
|
+
|
|
366
|
+
### Graceful Shutdown
|
|
367
|
+
|
|
368
|
+
When you cancel a work run (Ctrl+C), workers receive a shutdown sequence:
|
|
369
|
+
|
|
370
|
+
1. Inbox message asking the worker to stop, release reservations, and exit
|
|
371
|
+
2. Wait `shutdownGracePeriodMs` (default 30s) for clean exit
|
|
372
|
+
3. SIGTERM if still running, wait 5s
|
|
373
|
+
4. SIGKILL if still running
|
|
374
|
+
|
|
375
|
+
Tasks from gracefully shutdown workers reset to `todo` for retry on the next wave. Crashed workers (non-graceful exit) block the task in autonomous mode to prevent retry loops.
|