pi-crew 0.8.14 → 0.9.1
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 +366 -0
- package/README.md +112 -2
- package/docs/FEATURE_INTAKE.md +1 -1
- package/docs/HARNESS.md +20 -19
- package/docs/PROJECT_REVIEW.md +132 -133
- package/docs/PROJECT_REVIEW_FIXES.md +130 -131
- package/docs/actions-reference.md +127 -121
- package/docs/architecture.md +1 -1
- package/docs/code-review-2026-05-11.md +134 -134
- package/docs/commands-reference.md +108 -106
- package/docs/comparison-pi-subagents-vs-pi-crew.md +105 -105
- package/docs/deep-review-report.md +1 -1
- package/docs/dynamic-workflows.md +90 -0
- package/docs/fixes/BATCH_A_H1_H2.md +17 -17
- package/docs/fixes/bug-007-async-notifier-stale-ctx.md +23 -23
- package/docs/followup-plan-2026-05-12.md +135 -135
- package/docs/followup-review-2026-05-12.md +86 -86
- package/docs/followup-review-round3-2026-05-12.md +123 -123
- package/docs/goals.md +59 -0
- package/docs/implementation-plan-top3.md +4 -4
- package/docs/issue-29-analysis.md +2 -2
- package/docs/oh-my-pi-research.md +154 -154
- package/docs/optimization-plan.md +2 -0
- package/docs/perf/baseline-2026-05.md +9 -9
- package/docs/perf/final-report-2026-05.md +2 -2
- package/docs/perf/sprint-1-report.md +2 -2
- package/docs/perf/sprint-2-report.md +1 -1
- package/docs/perf/upgrade-plan-2026-05.md +72 -72
- package/docs/pi-crew-bugs.md +230 -230
- package/docs/pi-crew-investigation-report.md +102 -102
- package/docs/pi-crew-test-round5.md +4 -4
- package/docs/runtime-analysis-child-vs-live.md +57 -57
- package/docs/runtime-migration-in-process-analysis.md +97 -97
- package/package.json +2 -4
- package/skills/orchestration/SKILL.md +11 -11
- package/src/agents/agent-config.ts +4 -0
- package/src/config/config.ts +39 -0
- package/src/config/types.ts +11 -0
- package/src/extension/action-suggestions.ts +2 -1
- package/src/extension/async-notifier.ts +10 -0
- package/src/extension/help.ts +14 -0
- package/src/extension/registration/commands.ts +27 -0
- package/src/extension/team-tool/destructive-gate.ts +1 -1
- package/src/extension/team-tool/goal-wrap.ts +288 -0
- package/src/extension/team-tool/goal.ts +405 -0
- package/src/extension/team-tool/run.ts +103 -4
- package/src/extension/team-tool/workflow-manage.ts +194 -0
- package/src/extension/team-tool.ts +20 -0
- package/src/hooks/types.ts +3 -1
- package/src/runtime/async-runner.ts +27 -2
- package/src/runtime/background-runner.ts +68 -19
- package/src/runtime/child-pi.ts +9 -1
- package/src/runtime/completion-guard.ts +1 -1
- package/src/runtime/dynamic-workflow-context.ts +450 -0
- package/src/runtime/dynamic-workflow-runner.ts +180 -0
- package/src/runtime/global-worker-cap.ts +96 -0
- package/src/runtime/goal-evaluator.ts +294 -0
- package/src/runtime/goal-loop-runner.ts +612 -0
- package/src/runtime/goal-state-store.ts +209 -0
- package/src/runtime/iteration-hooks.ts +2 -1
- package/src/runtime/pi-args.ts +10 -2
- package/src/runtime/post-checks.ts +2 -1
- package/src/runtime/result-extractor.ts +32 -0
- package/src/runtime/team-runner.ts +11 -1
- package/src/runtime/verification-gates.ts +88 -5
- package/src/runtime/verification-integrity.ts +110 -0
- package/src/runtime/verification-worktree.ts +136 -0
- package/src/runtime/workspace-lock.ts +448 -0
- package/src/schema/config-schema.ts +26 -0
- package/src/schema/team-tool-schema.ts +39 -4
- package/src/state/atomic-write.ts +9 -0
- package/src/state/contracts.ts +14 -0
- package/src/state/crew-init.ts +18 -5
- package/src/state/event-log.ts +7 -1
- package/src/state/state-store.ts +2 -0
- package/src/state/types.ts +82 -0
- package/src/state/worker-atomic-writer.ts +190 -0
- package/src/utils/env-allowlist.ts +30 -0
- package/src/utils/redaction.ts +104 -24
- package/src/utils/safe-paths.ts +55 -14
- package/src/workflows/discover-workflows.ts +25 -1
- package/src/workflows/workflow-config.ts +13 -0
- package/src/worktree/cleanup.ts +2 -1
- package/src/worktree/worktree-manager.ts +4 -3
- package/teams/parallel-research.team.md +1 -1
- package/workflows/examples/hello.dwf.ts +24 -0
|
@@ -1,52 +1,58 @@
|
|
|
1
1
|
# pi-crew — Tool Actions Reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `team` tool is the primary tool that pi-crew registers with Pi. All operations go through `action`.
|
|
4
4
|
|
|
5
5
|
## Quick Reference
|
|
6
6
|
|
|
7
|
-
| Action | Purpose |
|
|
8
|
-
|
|
9
|
-
| `recommend` |
|
|
10
|
-
| `run` |
|
|
11
|
-
| `plan` | Preview workflow
|
|
12
|
-
| `orchestrate` | Execute
|
|
13
|
-
| `schedule` |
|
|
14
|
-
| `scheduled` | List scheduled jobs |
|
|
15
|
-
| `status` |
|
|
16
|
-
| `summary` |
|
|
17
|
-
| `cancel` |
|
|
18
|
-
| `resume` | Re-queue failed/cancelled tasks |
|
|
19
|
-
| `list` | List teams, agents, workflows, runs |
|
|
20
|
-
| `get` | Inspect agent/team/workflow |
|
|
21
|
-
| `search` | BM25
|
|
22
|
-
| `events` |
|
|
23
|
-
| `artifacts` | List run artifacts |
|
|
24
|
-
| `worktrees` | List run worktree metadata |
|
|
25
|
-
| `graph` | Load/save/list run graphs |
|
|
26
|
-
| `cleanup` |
|
|
27
|
-
| `forget` |
|
|
28
|
-
| `prune` |
|
|
29
|
-
| `export` | Export portable run bundle |
|
|
30
|
-
| `import` | Import run bundle |
|
|
31
|
-
| `imports` | List imported bundles |
|
|
32
|
-
| `create` |
|
|
33
|
-
| `update` |
|
|
34
|
-
| `delete` |
|
|
35
|
-
| `validate` | Validate resources |
|
|
36
|
-
| `doctor` |
|
|
37
|
-
| `config` | Show/update config |
|
|
38
|
-
| `init` |
|
|
39
|
-
| `autonomy` |
|
|
40
|
-
| `api` | Safe interop
|
|
41
|
-
|
|
|
7
|
+
| Action | Purpose | When to use |
|
|
8
|
+
|--------|---------|-------------|
|
|
9
|
+
| `recommend` | Suggest a suitable team/workflow | Starting point when unsure what to pick |
|
|
10
|
+
| `run` | Create a run and execute a workflow | Main operation |
|
|
11
|
+
| `plan` | Preview a workflow without running tasks | Dry-run planning |
|
|
12
|
+
| `orchestrate` | Execute from a plan document | Automate a plan |
|
|
13
|
+
| `schedule` | Schedule recurring runs | Periodic automation |
|
|
14
|
+
| `scheduled` | List scheduled jobs | View schedules |
|
|
15
|
+
| `status` | Read run status | Track progress |
|
|
16
|
+
| `summary` | Read/write run summary artifact | Summarize |
|
|
17
|
+
| `cancel` | Cancel queued/running work | Stop a run |
|
|
18
|
+
| `resume` | Re-queue failed/cancelled tasks | Resume a run |
|
|
19
|
+
| `list` | List teams, agents, workflows, runs | Explore resources |
|
|
20
|
+
| `get` | Inspect agent/team/workflow | View details |
|
|
21
|
+
| `search` | BM25-ranked agent/team discovery | Smart search |
|
|
22
|
+
| `events` | Read the event log | Debug/audit |
|
|
23
|
+
| `artifacts` | List run artifacts | View outputs |
|
|
24
|
+
| `worktrees` | List run worktree metadata | Inspect worktrees |
|
|
25
|
+
| `graph` | Load/save/list run graphs | Visualization |
|
|
26
|
+
| `cleanup` | Delete run worktrees | Cleanup |
|
|
27
|
+
| `forget` | Delete run state/artifacts | Remove entirely (requires `confirm`) |
|
|
28
|
+
| `prune` | Delete multiple old finished runs | Bulk cleanup |
|
|
29
|
+
| `export` | Export a portable run bundle | Share/backup |
|
|
30
|
+
| `import` | Import a run bundle | Receive a run from elsewhere |
|
|
31
|
+
| `imports` | List imported bundles | View imports |
|
|
32
|
+
| `create` | Create an agent/team/workflow | Extend resources |
|
|
33
|
+
| `update` | Update an agent/team/workflow | Edit resources |
|
|
34
|
+
| `delete` | Delete an agent/team/workflow | Remove resources (requires `confirm`) |
|
|
35
|
+
| `validate` | Validate resources | Health check |
|
|
36
|
+
| `doctor` | Check readiness | Diagnose environment |
|
|
37
|
+
| `config` | Show/update config | Configuration |
|
|
38
|
+
| `init` | Initialize project layout | Initial setup |
|
|
39
|
+
| `autonomy` | Manage delegation settings | Adjust automation |
|
|
40
|
+
| `api` | Safe interop for state operations | Advanced integration |
|
|
41
|
+
| **`goal`** | **v0.9.0** Autonomous goal loop (worker → LLM judge → feedback → iterate) | Autonomous multi-turn |
|
|
42
|
+
| **`workflow-create`** | **v0.9.0** Create a `.dwf.ts` (requires `confirm:true`, ACE-gated) | Author dynamic workflow |
|
|
43
|
+
| **`workflow-get`** | **v0.9.0** View source + metadata of a dynamic workflow | Inspect `.dwf.ts` |
|
|
44
|
+
| **`workflow-list`** | **v0.9.0** List static + dynamic workflows | Discover workflows |
|
|
45
|
+
| **`workflow-save`** | **v0.9.0** Overwrite `.dwf.ts` source (requires `confirm:true`) | Update dynamic workflow |
|
|
46
|
+
| **`workflow-delete`** | **v0.9.0** Delete a `.dwf.ts` (requires `confirm:true`) | Remove dynamic workflow |
|
|
47
|
+
| `help` | Display help text | Help |
|
|
42
48
|
|
|
43
49
|
---
|
|
44
50
|
|
|
45
|
-
##
|
|
51
|
+
## Action Details
|
|
46
52
|
|
|
47
|
-
### `recommend` —
|
|
53
|
+
### `recommend` — Guided suggestions
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
When you are unsure which team/workflow to use, call `recommend` to get analysis and suggestions:
|
|
50
56
|
|
|
51
57
|
```json
|
|
52
58
|
{
|
|
@@ -55,19 +61,19 @@ Khi chưa biết dùng team/workflow nào, gọi `recommend` để nhận phân
|
|
|
55
61
|
}
|
|
56
62
|
```
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
- Fanout hints (
|
|
61
|
-
-
|
|
62
|
-
-
|
|
64
|
+
The response includes:
|
|
65
|
+
- The suggested team/workflow
|
|
66
|
+
- Fanout hints (how many subagents)
|
|
67
|
+
- Whether to use async or worktree mode
|
|
68
|
+
- The rationale for the choice
|
|
63
69
|
|
|
64
70
|
---
|
|
65
71
|
|
|
66
|
-
### `run` —
|
|
72
|
+
### `run` — Execute a workflow
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
This is the main action. It creates a run manifest, a task graph, and executes it.
|
|
69
75
|
|
|
70
|
-
####
|
|
76
|
+
#### Basic syntax
|
|
71
77
|
|
|
72
78
|
```json
|
|
73
79
|
{
|
|
@@ -77,17 +83,17 @@ Response gồm:
|
|
|
77
83
|
}
|
|
78
84
|
```
|
|
79
85
|
|
|
80
|
-
####
|
|
86
|
+
#### Choose a team
|
|
81
87
|
|
|
82
|
-
| Team |
|
|
83
|
-
|
|
84
|
-
| `default` |
|
|
85
|
-
| `fast-fix` |
|
|
86
|
-
| `implementation` | Adaptive planner
|
|
88
|
+
| Team | Purpose |
|
|
89
|
+
|------|---------|
|
|
90
|
+
| `default` | Balanced, 4 steps: explore → plan → execute → verify |
|
|
91
|
+
| `fast-fix` | Small bug fixes: explore → execute → verify |
|
|
92
|
+
| `implementation` | Adaptive planner decides fanout on its own |
|
|
87
93
|
| `review` | Code review + security review |
|
|
88
|
-
| `research` |
|
|
94
|
+
| `research` | Research and documentation writing |
|
|
89
95
|
|
|
90
|
-
####
|
|
96
|
+
#### Run asynchronously (async)
|
|
91
97
|
|
|
92
98
|
```json
|
|
93
99
|
{
|
|
@@ -98,7 +104,7 @@ Response gồm:
|
|
|
98
104
|
}
|
|
99
105
|
```
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
The run is detached from the session and survives session switches/reloads. pi-crew automatically notifies you when the run completes.
|
|
102
108
|
|
|
103
109
|
#### Worktree isolation
|
|
104
110
|
|
|
@@ -111,7 +117,7 @@ Run tách riêng khỏi session, có thể sống qua session switch/reload. Pi-
|
|
|
111
117
|
}
|
|
112
118
|
```
|
|
113
119
|
|
|
114
|
-
|
|
120
|
+
Each task runs in its own git worktree — safe for the main codebase. Requires a clean repo.
|
|
115
121
|
|
|
116
122
|
#### Override model
|
|
117
123
|
|
|
@@ -124,7 +130,7 @@ Mỗi task chạy trong git worktree riêng — an toàn cho codebase chính. Y
|
|
|
124
130
|
}
|
|
125
131
|
```
|
|
126
132
|
|
|
127
|
-
#### Override config
|
|
133
|
+
#### Override config for a run
|
|
128
134
|
|
|
129
135
|
```json
|
|
130
136
|
{
|
|
@@ -140,7 +146,7 @@ Mỗi task chạy trong git worktree riêng — an toàn cho codebase chính. Y
|
|
|
140
146
|
|
|
141
147
|
#### Plan approval gate
|
|
142
148
|
|
|
143
|
-
|
|
149
|
+
Requires explicit approval after the planner creates the plan, before the executor runs:
|
|
144
150
|
|
|
145
151
|
```json
|
|
146
152
|
{
|
|
@@ -175,9 +181,9 @@ Cancel plan:
|
|
|
175
181
|
|
|
176
182
|
---
|
|
177
183
|
|
|
178
|
-
### `plan` — Preview workflow
|
|
184
|
+
### `plan` — Preview a workflow
|
|
179
185
|
|
|
180
|
-
|
|
186
|
+
Like `run` but **does not spawn workers**. Previews the task graph that would be created:
|
|
181
187
|
|
|
182
188
|
```json
|
|
183
189
|
{
|
|
@@ -189,9 +195,9 @@ Giống `run` nhưng **không spawn workers**. Xem trước task graph sẽ tạ
|
|
|
189
195
|
|
|
190
196
|
---
|
|
191
197
|
|
|
192
|
-
### `orchestrate` — Execute
|
|
198
|
+
### `orchestrate` — Execute from a plan document
|
|
193
199
|
|
|
194
|
-
|
|
200
|
+
Executes a workflow from a plan document that contains tagged sections:
|
|
195
201
|
|
|
196
202
|
```markdown
|
|
197
203
|
# Design Phase
|
|
@@ -220,9 +226,9 @@ TAG→chain mapping:
|
|
|
220
226
|
|
|
221
227
|
---
|
|
222
228
|
|
|
223
|
-
### `schedule` —
|
|
229
|
+
### `schedule` — Schedule recurring runs
|
|
224
230
|
|
|
225
|
-
|
|
231
|
+
Creates a scheduled job using cron, interval, or once:
|
|
226
232
|
|
|
227
233
|
```json
|
|
228
234
|
{
|
|
@@ -258,9 +264,9 @@ Params: `cron`, `interval` (ms), `once` (ISO timestamp)
|
|
|
258
264
|
|
|
259
265
|
---
|
|
260
266
|
|
|
261
|
-
### `search` — BM25
|
|
267
|
+
### `search` — BM25-ranked discovery
|
|
262
268
|
|
|
263
|
-
|
|
269
|
+
Search agents/teams/workflows with BM25 ranking:
|
|
264
270
|
|
|
265
271
|
```json
|
|
266
272
|
{
|
|
@@ -271,7 +277,7 @@ Tìm kiếm agents/teams/workflows với BM25 ranking:
|
|
|
271
277
|
|
|
272
278
|
---
|
|
273
279
|
|
|
274
|
-
### `status` —
|
|
280
|
+
### `status` — Run status
|
|
275
281
|
|
|
276
282
|
```json
|
|
277
283
|
{
|
|
@@ -280,13 +286,13 @@ Tìm kiếm agents/teams/workflows với BM25 ranking:
|
|
|
280
286
|
}
|
|
281
287
|
```
|
|
282
288
|
|
|
283
|
-
Output
|
|
289
|
+
Output includes: manifest, tasks, agents, timing, usage totals.
|
|
284
290
|
|
|
285
291
|
---
|
|
286
292
|
|
|
287
|
-
### `summary` —
|
|
293
|
+
### `summary` — Run summary
|
|
288
294
|
|
|
289
|
-
|
|
295
|
+
Read summary:
|
|
290
296
|
|
|
291
297
|
```json
|
|
292
298
|
{
|
|
@@ -295,7 +301,7 @@ Output gồm: manifest, tasks, agents, timing, usage totals.
|
|
|
295
301
|
}
|
|
296
302
|
```
|
|
297
303
|
|
|
298
|
-
|
|
304
|
+
Write summary:
|
|
299
305
|
|
|
300
306
|
```json
|
|
301
307
|
{
|
|
@@ -307,7 +313,7 @@ Ghi summary:
|
|
|
307
313
|
|
|
308
314
|
---
|
|
309
315
|
|
|
310
|
-
### `cancel` —
|
|
316
|
+
### `cancel` — Cancel a run
|
|
311
317
|
|
|
312
318
|
```json
|
|
313
319
|
{
|
|
@@ -316,11 +322,11 @@ Ghi summary:
|
|
|
316
322
|
}
|
|
317
323
|
```
|
|
318
324
|
|
|
319
|
-
|
|
325
|
+
Cancels all queued/running tasks. Running child processes receive SIGTERM.
|
|
320
326
|
|
|
321
327
|
---
|
|
322
328
|
|
|
323
|
-
### `resume` —
|
|
329
|
+
### `resume` — Resume a run
|
|
324
330
|
|
|
325
331
|
```json
|
|
326
332
|
{
|
|
@@ -329,11 +335,11 @@ Hủy tất cả queued/running tasks. Running child processes nhận SIGTERM.
|
|
|
329
335
|
}
|
|
330
336
|
```
|
|
331
337
|
|
|
332
|
-
Re-
|
|
338
|
+
Re-queues failed/cancelled/skipped tasks. Already-completed tasks are unaffected.
|
|
333
339
|
|
|
334
340
|
---
|
|
335
341
|
|
|
336
|
-
### `list` —
|
|
342
|
+
### `list` — List resources
|
|
337
343
|
|
|
338
344
|
```json
|
|
339
345
|
{
|
|
@@ -341,11 +347,11 @@ Re-queue failed/cancelled/skipped tasks. Tasks đã completed không bị ảnh
|
|
|
341
347
|
}
|
|
342
348
|
```
|
|
343
349
|
|
|
344
|
-
|
|
350
|
+
Displays: discovered teams, agents, workflows, and recent runs.
|
|
345
351
|
|
|
346
352
|
---
|
|
347
353
|
|
|
348
|
-
### `get` —
|
|
354
|
+
### `get` — Inspect resource details
|
|
349
355
|
|
|
350
356
|
```json
|
|
351
357
|
{
|
|
@@ -392,7 +398,7 @@ Append-only JSONL events: task.started, task.completed, run.blocked, etc.
|
|
|
392
398
|
|
|
393
399
|
---
|
|
394
400
|
|
|
395
|
-
### `cleanup` —
|
|
401
|
+
### `cleanup` — Delete worktrees
|
|
396
402
|
|
|
397
403
|
```json
|
|
398
404
|
{
|
|
@@ -401,11 +407,11 @@ Append-only JSONL events: task.started, task.completed, run.blocked, etc.
|
|
|
401
407
|
}
|
|
402
408
|
```
|
|
403
409
|
|
|
404
|
-
Dirty worktrees
|
|
410
|
+
Dirty worktrees are kept unless `force: true`.
|
|
405
411
|
|
|
406
412
|
---
|
|
407
413
|
|
|
408
|
-
### `forget` —
|
|
414
|
+
### `forget` — Delete a run entirely
|
|
409
415
|
|
|
410
416
|
```json
|
|
411
417
|
{
|
|
@@ -415,11 +421,11 @@ Dirty worktrees được giữ lại trừ khi `force: true`.
|
|
|
415
421
|
}
|
|
416
422
|
```
|
|
417
423
|
|
|
418
|
-
|
|
424
|
+
Deletes state + artifacts + worktrees. Requires `confirm: true`.
|
|
419
425
|
|
|
420
426
|
---
|
|
421
427
|
|
|
422
|
-
### `prune` —
|
|
428
|
+
### `prune` — Delete old runs
|
|
423
429
|
|
|
424
430
|
```json
|
|
425
431
|
{
|
|
@@ -429,11 +435,11 @@ Xóa state + artifacts + worktrees. Cần `confirm: true`.
|
|
|
429
435
|
}
|
|
430
436
|
```
|
|
431
437
|
|
|
432
|
-
|
|
438
|
+
Keeps the `keep` most recent runs and deletes the rest.
|
|
433
439
|
|
|
434
440
|
---
|
|
435
441
|
|
|
436
|
-
### `export` / `import` —
|
|
442
|
+
### `export` / `import` — Share runs
|
|
437
443
|
|
|
438
444
|
Export:
|
|
439
445
|
|
|
@@ -473,9 +479,9 @@ List imports:
|
|
|
473
479
|
|
|
474
480
|
---
|
|
475
481
|
|
|
476
|
-
### `create` —
|
|
482
|
+
### `create` — Create resources
|
|
477
483
|
|
|
478
|
-
|
|
484
|
+
Create an agent:
|
|
479
485
|
|
|
480
486
|
```json
|
|
481
487
|
{
|
|
@@ -495,7 +501,7 @@ Tạo agent:
|
|
|
495
501
|
}
|
|
496
502
|
```
|
|
497
503
|
|
|
498
|
-
|
|
504
|
+
Create a team:
|
|
499
505
|
|
|
500
506
|
```json
|
|
501
507
|
{
|
|
@@ -515,7 +521,7 @@ Tạo team:
|
|
|
515
521
|
}
|
|
516
522
|
```
|
|
517
523
|
|
|
518
|
-
|
|
524
|
+
Create a workflow:
|
|
519
525
|
|
|
520
526
|
```json
|
|
521
527
|
{
|
|
@@ -534,7 +540,7 @@ Tạo workflow:
|
|
|
534
540
|
|
|
535
541
|
---
|
|
536
542
|
|
|
537
|
-
### `update` —
|
|
543
|
+
### `update` — Update resources
|
|
538
544
|
|
|
539
545
|
```json
|
|
540
546
|
{
|
|
@@ -547,11 +553,11 @@ Tạo workflow:
|
|
|
547
553
|
}
|
|
548
554
|
```
|
|
549
555
|
|
|
550
|
-
`updateReferences: true`
|
|
556
|
+
`updateReferences: true` automatically updates all team references pointing to the old name.
|
|
551
557
|
|
|
552
558
|
---
|
|
553
559
|
|
|
554
|
-
### `delete` —
|
|
560
|
+
### `delete` — Delete resources
|
|
555
561
|
|
|
556
562
|
```json
|
|
557
563
|
{
|
|
@@ -563,11 +569,11 @@ Tạo workflow:
|
|
|
563
569
|
}
|
|
564
570
|
```
|
|
565
571
|
|
|
566
|
-
|
|
572
|
+
Creates a backup automatically before deleting.
|
|
567
573
|
|
|
568
574
|
---
|
|
569
575
|
|
|
570
|
-
### `validate` —
|
|
576
|
+
### `validate` — Validate resources
|
|
571
577
|
|
|
572
578
|
```json
|
|
573
579
|
{
|
|
@@ -575,11 +581,11 @@ Backup tự động trước khi xóa.
|
|
|
575
581
|
}
|
|
576
582
|
```
|
|
577
583
|
|
|
578
|
-
|
|
584
|
+
Checks: agents, teams, workflows, references, model hints.
|
|
579
585
|
|
|
580
586
|
---
|
|
581
587
|
|
|
582
|
-
### `doctor` —
|
|
588
|
+
### `doctor` — Diagnose environment
|
|
583
589
|
|
|
584
590
|
```json
|
|
585
591
|
{
|
|
@@ -587,7 +593,7 @@ Kiểm tra: agents, teams, workflows, references, model hints.
|
|
|
587
593
|
}
|
|
588
594
|
```
|
|
589
595
|
|
|
590
|
-
|
|
596
|
+
Checks: cwd, platform, Node.js, Pi version, git, state paths, config, resources, model/provider.
|
|
591
597
|
|
|
592
598
|
Smoke test child Pi (explicit):
|
|
593
599
|
|
|
@@ -600,9 +606,9 @@ Smoke test child Pi (explicit):
|
|
|
600
606
|
|
|
601
607
|
---
|
|
602
608
|
|
|
603
|
-
### `api` —
|
|
609
|
+
### `api` — Advanced state interop
|
|
604
610
|
|
|
605
|
-
Safe API
|
|
611
|
+
Safe API for run/task/event/heartbeat/claim/mailbox operations:
|
|
606
612
|
|
|
607
613
|
```text
|
|
608
614
|
/team-api <runId> <operation> [key=value]
|
|
@@ -610,30 +616,30 @@ Safe API cho run/task/event/heartbeat/claim/mailbox operations:
|
|
|
610
616
|
|
|
611
617
|
Operations:
|
|
612
618
|
|
|
613
|
-
| Operation |
|
|
614
|
-
|
|
615
|
-
| `read-manifest` |
|
|
616
|
-
| `list-tasks` |
|
|
617
|
-
| `read-task` |
|
|
618
|
-
| `read-events` |
|
|
619
|
-
| `read-heartbeat` |
|
|
620
|
-
| `write-heartbeat` |
|
|
621
|
-
| `claim-task` | Claim task (
|
|
622
|
-
| `release-task-claim` | Release claim |
|
|
623
|
-
| `transition-task-status` |
|
|
624
|
-
| `send-message` |
|
|
625
|
-
| `read-mailbox` |
|
|
626
|
-
| `ack-message` | Acknowledge message |
|
|
627
|
-
| `read-delivery` |
|
|
628
|
-
| `validate-mailbox` | Validate/
|
|
629
|
-
| `approve-plan` | Approve plan (
|
|
630
|
-
| `cancel-plan` | Cancel plan |
|
|
619
|
+
| Operation | Description |
|
|
620
|
+
|-----------|-------------|
|
|
621
|
+
| `read-manifest` | Read the manifest |
|
|
622
|
+
| `list-tasks` | List tasks |
|
|
623
|
+
| `read-task` | Read a task (requires `taskId=`) |
|
|
624
|
+
| `read-events` | Read the event log |
|
|
625
|
+
| `read-heartbeat` | Read a heartbeat (requires `taskId=`) |
|
|
626
|
+
| `write-heartbeat` | Write a heartbeat (requires `taskId=`, `alive=`) |
|
|
627
|
+
| `claim-task` | Claim a task (requires `taskId=`, `owner=`) |
|
|
628
|
+
| `release-task-claim` | Release a claim |
|
|
629
|
+
| `transition-task-status` | Transition task status |
|
|
630
|
+
| `send-message` | Send a mailbox message |
|
|
631
|
+
| `read-mailbox` | Read the mailbox |
|
|
632
|
+
| `ack-message` | Acknowledge a message |
|
|
633
|
+
| `read-delivery` | Read delivery state |
|
|
634
|
+
| `validate-mailbox` | Validate/repair mailbox |
|
|
635
|
+
| `approve-plan` | Approve a plan (when requirePlanApproval) |
|
|
636
|
+
| `cancel-plan` | Cancel a plan |
|
|
631
637
|
|
|
632
638
|
---
|
|
633
639
|
|
|
634
|
-
### `config` —
|
|
640
|
+
### `config` — Configuration
|
|
635
641
|
|
|
636
|
-
|
|
642
|
+
View current config:
|
|
637
643
|
|
|
638
644
|
```json
|
|
639
645
|
{ "action": "config" }
|
|
@@ -659,7 +665,7 @@ Unset:
|
|
|
659
665
|
|
|
660
666
|
---
|
|
661
667
|
|
|
662
|
-
### `init` —
|
|
668
|
+
### `init` — Initialize project
|
|
663
669
|
|
|
664
670
|
```json
|
|
665
671
|
{ "action": "init" }
|
package/docs/architecture.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`pi-crew` is a Pi package for coordinated multi-agent work. It is intentionally durable-first: every run is represented on disk, every task has a state record, and child workers stream progress into JSONL/status files so foreground sessions, background jobs, dashboards, and later restarts all read the same source of truth.
|
|
4
4
|
|
|
5
|
-
**Current version:** v0.
|
|
5
|
+
**Current version:** v0.9.0 — 100+ rounds of code review hardening (see [CHANGELOG.md](../CHANGELOG.md)).
|
|
6
6
|
|
|
7
7
|
## Layers
|
|
8
8
|
|