pi-crew 0.1.51 → 0.2.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 +56 -1
- package/README.md +176 -781
- package/agents/analyst.md +11 -11
- package/agents/critic.md +11 -11
- package/agents/executor.md +11 -11
- package/agents/explorer.md +11 -11
- package/agents/planner.md +11 -11
- package/agents/reviewer.md +11 -11
- package/agents/security-reviewer.md +11 -11
- package/agents/test-engineer.md +11 -11
- package/agents/verifier.md +70 -11
- package/agents/writer.md +11 -11
- package/docs/actions-reference.md +595 -0
- package/docs/commands-reference.md +347 -0
- package/docs/runtime-flow.md +148 -148
- package/index.ts +6 -6
- package/package.json +99 -99
- package/skills/async-worker-recovery/SKILL.md +42 -42
- package/skills/context-artifact-hygiene/SKILL.md +52 -52
- package/skills/delegation-patterns/SKILL.md +54 -54
- package/skills/mailbox-interactive/SKILL.md +40 -40
- package/skills/model-routing-context/SKILL.md +39 -39
- package/skills/multi-perspective-review/SKILL.md +58 -58
- package/skills/observability-reliability/SKILL.md +41 -41
- package/skills/orchestration/SKILL.md +157 -157
- package/skills/ownership-session-security/SKILL.md +41 -41
- package/skills/pi-extension-lifecycle/SKILL.md +39 -39
- package/skills/requirements-to-task-packet/SKILL.md +63 -63
- package/skills/resource-discovery-config/SKILL.md +41 -41
- package/skills/runtime-state-reader/SKILL.md +44 -44
- package/skills/secure-agent-orchestration-review/SKILL.md +45 -45
- package/skills/state-mutation-locking/SKILL.md +42 -42
- package/skills/systematic-debugging/SKILL.md +67 -67
- package/skills/ui-render-performance/SKILL.md +39 -39
- package/skills/verification-before-done/SKILL.md +57 -57
- package/skills/worktree-isolation/SKILL.md +39 -39
- package/src/adapters/claude-adapter.ts +25 -0
- package/src/adapters/codex-adapter.ts +21 -0
- package/src/adapters/cursor-adapter.ts +17 -0
- package/src/adapters/export-util.ts +137 -0
- package/src/adapters/index.ts +15 -0
- package/src/adapters/registry.ts +18 -0
- package/src/adapters/types.ts +23 -0
- package/src/agents/agent-config.ts +2 -0
- package/src/agents/agent-search.ts +98 -98
- package/src/agents/discover-agents.ts +2 -1
- package/src/config/config.ts +13 -1
- package/src/config/drift-detector.ts +211 -0
- package/src/config/markers.ts +327 -0
- package/src/config/resilient-parser.ts +108 -0
- package/src/config/suggestions.ts +74 -0
- package/src/extension/cross-extension-rpc.ts +103 -94
- package/src/extension/project-init.ts +21 -1
- package/src/extension/register.ts +45 -14
- package/src/extension/registration/commands.ts +77 -8
- package/src/extension/registration/subagent-tools.ts +10 -1
- package/src/extension/registration/team-tool.ts +10 -1
- package/src/extension/registration/viewers.ts +48 -34
- package/src/extension/run-bundle-schema.ts +89 -89
- package/src/extension/run-import.ts +25 -1
- package/src/extension/run-index.ts +5 -1
- package/src/extension/run-maintenance.ts +142 -68
- package/src/extension/team-manager-command.ts +10 -1
- package/src/extension/team-tool/doctor.ts +28 -3
- package/src/extension/team-tool/handle-settings.ts +195 -188
- package/src/extension/team-tool/inspect.ts +41 -41
- package/src/extension/team-tool/intent-policy.ts +42 -42
- package/src/extension/team-tool/lifecycle-actions.ts +27 -8
- package/src/extension/team-tool/plan.ts +19 -19
- package/src/extension/team-tool/run.ts +12 -1
- package/src/extension/team-tool.ts +11 -1
- package/src/i18n.ts +184 -184
- package/src/observability/exporters/otlp-exporter.ts +92 -77
- package/src/prompt/prompt-runtime.ts +72 -72
- package/src/runtime/agent-memory.ts +72 -72
- package/src/runtime/agent-observability.ts +114 -114
- package/src/runtime/async-marker.ts +26 -26
- package/src/runtime/attention-events.ts +28 -28
- package/src/runtime/auto-resume.ts +100 -0
- package/src/runtime/background-runner.ts +11 -1
- package/src/runtime/cancellation-token.ts +89 -89
- package/src/runtime/cancellation.ts +61 -61
- package/src/runtime/capability-inventory.ts +116 -116
- package/src/runtime/child-pi.ts +7 -2
- package/src/runtime/compaction-summary.ts +271 -0
- package/src/runtime/completion-guard.ts +190 -190
- package/src/runtime/crash-recovery.ts +33 -0
- package/src/runtime/delta-conflict.ts +360 -0
- package/src/runtime/direct-run.ts +35 -35
- package/src/runtime/foreground-control.ts +82 -82
- package/src/runtime/green-contract.ts +46 -46
- package/src/runtime/group-join.ts +106 -106
- package/src/runtime/heartbeat-gradient.ts +28 -28
- package/src/runtime/heartbeat-watcher.ts +124 -124
- package/src/runtime/iteration-hooks.ts +262 -0
- package/src/runtime/live-agent-control.ts +88 -88
- package/src/runtime/live-control-realtime.ts +36 -36
- package/src/runtime/live-extension-bridge.ts +150 -150
- package/src/runtime/live-irc.ts +92 -92
- package/src/runtime/live-session-health.ts +100 -100
- package/src/runtime/loop-gates.ts +129 -0
- package/src/runtime/metric-parser.ts +40 -0
- package/src/runtime/notebook-helpers.ts +90 -90
- package/src/runtime/orphan-sentinel.ts +7 -7
- package/src/runtime/parallel-research.ts +44 -44
- package/src/runtime/phase-progress.ts +217 -0
- package/src/runtime/pi-args.ts +38 -11
- package/src/runtime/pi-json-output.ts +111 -111
- package/src/runtime/pi-spawn.ts +57 -7
- package/src/runtime/policy-engine.ts +79 -79
- package/src/runtime/post-checks.ts +122 -0
- package/src/runtime/progress-event-coalescer.ts +43 -43
- package/src/runtime/prose-compressor.ts +164 -164
- package/src/runtime/recovery-recipes.ts +74 -74
- package/src/runtime/result-extractor.ts +121 -121
- package/src/runtime/role-permission.ts +39 -39
- package/src/runtime/sensitive-paths.ts +2 -2
- package/src/runtime/session-resources.ts +25 -25
- package/src/runtime/session-snapshot.ts +59 -59
- package/src/runtime/session-usage.ts +79 -79
- package/src/runtime/sidechain-output.ts +29 -29
- package/src/runtime/stream-preview.ts +177 -177
- package/src/runtime/supervisor-contact.ts +59 -59
- package/src/runtime/task-display.ts +38 -38
- package/src/runtime/task-graph.ts +207 -0
- package/src/runtime/task-quality.ts +207 -0
- package/src/runtime/task-runner/capabilities.ts +78 -78
- package/src/runtime/task-runner/live-executor.ts +7 -1
- package/src/runtime/task-runner/progress.ts +119 -119
- package/src/runtime/task-runner/prompt-pipeline.ts +64 -64
- package/src/runtime/task-runner/result-utils.ts +14 -14
- package/src/runtime/task-runner/run-projection.ts +103 -103
- package/src/runtime/task-runner/state-helpers.ts +22 -22
- package/src/runtime/team-runner.ts +117 -7
- package/src/runtime/worker-heartbeat.ts +21 -21
- package/src/runtime/worker-startup.ts +57 -57
- package/src/runtime/workflow-state.ts +187 -0
- package/src/runtime/workspace-tree.ts +298 -298
- package/src/schema/config-schema.ts +11 -0
- package/src/schema/validation-types.ts +148 -0
- package/src/skills/skill-templates.ts +374 -0
- package/src/state/active-run-registry.ts +35 -11
- package/src/state/atomic-write.ts +33 -26
- package/src/state/contracts.ts +1 -0
- package/src/state/event-reconstructor.ts +217 -0
- package/src/state/locks.ts +2 -13
- package/src/state/mailbox.ts +4 -3
- package/src/state/state-store.ts +32 -14
- package/src/state/task-claims.ts +44 -44
- package/src/state/types.ts +9 -0
- package/src/state/usage.ts +29 -29
- package/src/subagents/async-entry.ts +1 -1
- package/src/subagents/index.ts +3 -3
- package/src/subagents/live/control.ts +1 -1
- package/src/subagents/live/manager.ts +1 -1
- package/src/subagents/live/realtime.ts +1 -1
- package/src/subagents/live/session-runtime.ts +1 -1
- package/src/subagents/manager.ts +1 -1
- package/src/subagents/spawn.ts +1 -1
- package/src/teams/team-serializer.ts +38 -38
- package/src/types/diff.d.ts +18 -18
- package/src/ui/crew-footer.ts +101 -101
- package/src/ui/crew-select-list.ts +111 -111
- package/src/ui/crew-widget.ts +5 -2
- package/src/ui/dashboard-panes/cancellation-pane.ts +42 -42
- package/src/ui/dashboard-panes/capability-pane.ts +59 -59
- package/src/ui/dashboard-panes/mailbox-pane.ts +35 -35
- package/src/ui/dashboard-panes/metrics-pane.ts +34 -34
- package/src/ui/dashboard-panes/progress-pane.ts +11 -0
- package/src/ui/dynamic-border.ts +25 -25
- package/src/ui/layout-primitives.ts +106 -106
- package/src/ui/loaders.ts +158 -158
- package/src/ui/render-coalescer.ts +51 -51
- package/src/ui/render-diff.ts +119 -119
- package/src/ui/render-scheduler.ts +143 -143
- package/src/ui/run-action-dispatcher.ts +10 -1
- package/src/ui/spinner.ts +17 -17
- package/src/ui/status-colors.ts +58 -58
- package/src/ui/syntax-highlight.ts +116 -116
- package/src/ui/transcript-entries.ts +258 -258
- package/src/utils/completion-dedupe.ts +63 -63
- package/src/utils/frontmatter.ts +68 -68
- package/src/utils/git.ts +262 -262
- package/src/utils/ids.ts +17 -17
- package/src/utils/incremental-reader.ts +104 -104
- package/src/utils/names.ts +27 -27
- package/src/utils/redaction.ts +44 -44
- package/src/utils/safe-paths.ts +47 -47
- package/src/utils/scan-cache.ts +136 -136
- package/src/utils/sleep.ts +40 -26
- package/src/utils/task-name-generator.ts +337 -337
- package/src/workflows/validate-workflow.ts +40 -40
- package/src/worktree/branch-freshness.ts +45 -45
- package/teams/default.team.md +12 -12
- package/teams/fast-fix.team.md +11 -11
- package/teams/implementation.team.md +18 -18
- package/teams/parallel-research.team.md +14 -14
- package/teams/research.team.md +11 -11
- package/teams/review.team.md +12 -12
- package/workflows/default.workflow.md +30 -29
- package/workflows/fast-fix.workflow.md +23 -22
- package/workflows/implementation.workflow.md +43 -43
- package/workflows/parallel-research.workflow.md +46 -46
- package/workflows/research.workflow.md +22 -22
- package/workflows/review.workflow.md +30 -30
- package/docs/refactor-tasks-phase3.md +0 -394
- package/docs/refactor-tasks-phase4.md +0 -564
- package/docs/refactor-tasks-phase5.md +0 -402
- package/docs/refactor-tasks-phase6.md +0 -662
- package/docs/refactor-tasks.md +0 -1484
- package/docs/research/AGENT-EXECUTION-ARCHITECTURE.md +0 -261
- package/docs/research/AGENT-LIFECYCLE-COMPARISON.md +0 -111
- package/docs/research/AUDIT_OH_MY_PI.md +0 -261
- package/docs/research/AUDIT_PI_CREW.md +0 -457
- package/docs/research/CAVEMAN-DEEP-RESEARCH.md +0 -281
- package/docs/research/COMPARISON_OH_MY_PI_VS_PI_CREW.md +0 -264
- package/docs/research/DEEP-RESEARCH-PI-POWERBAR.md +0 -343
- package/docs/research/DEEP_RESEARCH_SUBAGENT_ARCHITECTURE.md +0 -480
- package/docs/research/GAP_CLOSURE_IMPLEMENTATION_PLAN.md +0 -354
- package/docs/research/IMPLEMENTATION_PLAN.md +0 -385
- package/docs/research/LIVE-SESSION-PRODUCTION-READY-PLAN.md +0 -502
- package/docs/research/OH-MY-PI-DEEP-RESEARCH-v14.7.6.md +0 -266
- package/docs/research/REMAINING-GAPS-PLAN.md +0 -363
- package/docs/research/SESSION-SUMMARY-2026-05-08.md +0 -146
- package/docs/research/UI-RESPONSIVENESS-AUDIT.md +0 -173
- package/docs/research-awesome-agent-skills-distillation.md +0 -100
- package/docs/research-extension-examples.md +0 -297
- package/docs/research-extension-system.md +0 -324
- package/docs/research-oh-my-pi-distillation.md +0 -369
- package/docs/research-optimization-plan.md +0 -548
- package/docs/research-phase10-distillation.md +0 -199
- package/docs/research-phase11-distillation.md +0 -201
- package/docs/research-phase8-operator-experience-plan.md +0 -819
- package/docs/research-phase9-observability-reliability-plan.md +0 -1190
- package/docs/research-pi-coding-agent.md +0 -357
- package/docs/research-source-pi-crew-reference.md +0 -174
- package/docs/research-ui-optimization-plan.md +0 -480
- package/docs/source-runtime-refactor-map.md +0 -107
- package/src/utils/atomic-write.ts +0 -33
package/README.md
CHANGED
|
@@ -1,631 +1,238 @@
|
|
|
1
1
|
# pi-crew
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Coordinate AI agent teams inside [Pi](https://github.com/nicekate/pi-coding-agent).**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
pi-crew is a Pi extension that orchestrates autonomous multi-agent workflows — research, implementation, review, testing, and more — with durable state, parallel execution, worktree isolation, and safe defaults.
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
|
-
pi-crew
|
|
8
|
+
npm: pi-crew
|
|
9
|
+
repo: https://github.com/baphuongna/pi-crew
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
**v0.2.0**: Security hardening + 76% faster startup. See [CHANGELOG.md](CHANGELOG.md).
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
https://github.com/baphuongna/pi-crew
|
|
15
|
-
```
|
|
14
|
+
---
|
|
16
15
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- foreground workflow scheduler
|
|
32
|
-
- detached async/background runner
|
|
33
|
-
- stale async PID detection
|
|
34
|
-
- active run summary and async completion notifications in Pi sessions
|
|
35
|
-
- owner-session delivery guards so stale sessions do not receive background subagent/result/live-session completions
|
|
36
|
-
- real child Pi worker execution by default, with explicit scaffold/dry-run opt-out
|
|
37
|
-
- child Pi JSON output parsing for final text, usage, and event counts
|
|
38
|
-
- retryable model fallback attempts per task
|
|
39
|
-
- aggregate usage totals in status/summary
|
|
40
|
-
- progress, summary, prompt, result, log, diff, patch, export artifacts
|
|
41
|
-
- task packets, verification/green-contract evidence, policy decision artifacts, and task graph metadata
|
|
42
|
-
- opt-in git worktree isolation per task
|
|
43
|
-
- worktree branch mismatch detection
|
|
44
|
-
- dirty worktree preservation unless `force` is explicitly set
|
|
45
|
-
- cancel/resume lifecycle operations
|
|
46
|
-
- forget/prune cleanup operations with explicit confirmation
|
|
47
|
-
- export/import portable run bundles
|
|
48
|
-
- resource create/update/delete with backups, dry-run, reference checks, and optional reference updates
|
|
49
|
-
- resource validation and doctor checks
|
|
50
|
-
- project initialization for `.pi` layout and `.gitignore`
|
|
51
|
-
- config show/update with user/project scope and nested unset support
|
|
52
|
-
- safe API interop for manifest/task/event/heartbeat/claim/mailbox operations
|
|
53
|
-
- realpath containment for run/import/artifact/transcript/mailbox/agent state reads and writes, including symlink escape protection
|
|
54
|
-
- read-only state APIs avoid creating mailbox files when only inspecting delivery or mailbox state
|
|
55
|
-
- run-level and task-level mailbox files with validation/repair support
|
|
56
|
-
- `/team-manager` interactive helper
|
|
57
|
-
- `/team-dashboard` custom TUI overlay with progress preview, action shortcuts, and reload
|
|
58
|
-
- `parallel-research` team/workflow for dynamic `Source/pi-*` fanout and parallel shard exploration
|
|
59
|
-
- observability metrics: per-session Counter/Gauge/Histogram registry, JSONL sink, `/team-metrics`, dashboard metrics pane, Prometheus/OTLP exporters (OTLP opt-in)
|
|
60
|
-
- reliability hardening: heartbeat gradient watcher, opt-in retry executor with attempt trace, crash-recovery detection, deadletter queue
|
|
61
|
-
- background `Agent`/`crew_agent` completion wake-up so parent sessions can automatically join completed subagent results
|
|
62
|
-
- optional `runtime.requirePlanApproval` gate for planner-first approval before mutating adaptive implementation workers run
|
|
63
|
-
- optional `runtime.completionMutationGuard` to warn or fail implementation-style workers that complete without observed mutation tool calls
|
|
64
|
-
- grouped result delivery is correlated through mailbox metadata, deduped by request id, and acknowledged via existing `ack-message`
|
|
65
|
-
- shared redaction for common secrets before durable event/log/mailbox/artifact/metric/diagnostic persistence
|
|
66
|
-
- package polish: `schema.json`, TypeScript semantic check, strip-types import smoke, cross-platform CI workflow, dry-run package verification
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **One Pi tool** — `team` handles routing, planning, execution, review, and cleanup
|
|
19
|
+
- **Autonomous delegation** — policy injection decides when/how to delegate based on task complexity
|
|
20
|
+
- **Real child Pi workers** — each task spawns a separate Pi process by default; scaffold/dry-run opt-out
|
|
21
|
+
- **Adaptive planning** — implementation workflow lets a planner agent decide subagent fanout
|
|
22
|
+
- **Parallel execution** — tasks in the same phase run concurrently with configurable concurrency
|
|
23
|
+
- **Durable state** — manifest, tasks, events, artifacts all persisted to disk
|
|
24
|
+
- **Async/background runs** — detached runs survive session switches with completion notifications
|
|
25
|
+
- **Worktree isolation** — opt-in git worktrees per task for safe parallel edits
|
|
26
|
+
- **Rich UI** — live widget, dashboard, progress tracking, model/token display
|
|
27
|
+
- **Observability** — metrics registry, Prometheus/OTLP exporters, heartbeat watching, deadletter queue
|
|
28
|
+
- **Resource management** — create/update/delete agents, teams, workflows with validation
|
|
29
|
+
- **Import/export** — portable run bundles for sharing and archiving
|
|
67
30
|
|
|
68
|
-
|
|
31
|
+
---
|
|
69
32
|
|
|
70
|
-
|
|
33
|
+
## Install
|
|
71
34
|
|
|
72
35
|
```bash
|
|
73
36
|
pi install npm:pi-crew
|
|
74
37
|
```
|
|
75
38
|
|
|
76
|
-
|
|
39
|
+
Local development:
|
|
77
40
|
|
|
78
41
|
```bash
|
|
79
42
|
pi install ./pi-crew
|
|
80
43
|
```
|
|
81
44
|
|
|
82
|
-
|
|
45
|
+
Post-install config bootstrap:
|
|
83
46
|
|
|
84
47
|
```bash
|
|
85
|
-
pi-crew
|
|
48
|
+
pi-crew # after npm install
|
|
49
|
+
node ./pi-crew/install.mjs # from local clone
|
|
86
50
|
```
|
|
87
51
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
node ./pi-crew/install.mjs
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Local verification from this package:
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
cd pi-crew
|
|
98
|
-
npm run ci
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Runtime safety model
|
|
52
|
+
---
|
|
102
53
|
|
|
103
|
-
|
|
54
|
+
## Quick Start
|
|
104
55
|
|
|
105
|
-
|
|
56
|
+
### 1. Initialize project
|
|
106
57
|
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
"runtime": { "mode": "scaffold" }
|
|
110
|
-
}
|
|
58
|
+
```text
|
|
59
|
+
/team-init
|
|
111
60
|
```
|
|
112
61
|
|
|
113
|
-
|
|
62
|
+
### 2. Run a team
|
|
114
63
|
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
"executeWorkers": false
|
|
118
|
-
}
|
|
64
|
+
```text
|
|
65
|
+
/team-run Investigate failing tests and propose a fix
|
|
119
66
|
```
|
|
120
67
|
|
|
121
|
-
|
|
68
|
+
Or via tool call:
|
|
122
69
|
|
|
123
70
|
```json
|
|
124
71
|
{
|
|
125
72
|
"action": "run",
|
|
126
|
-
"team": "
|
|
127
|
-
"goal": "
|
|
128
|
-
"workspaceMode": "worktree"
|
|
73
|
+
"team": "default",
|
|
74
|
+
"goal": "Investigate failing tests and propose a fix"
|
|
129
75
|
}
|
|
130
76
|
```
|
|
131
77
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
## Config
|
|
135
|
-
|
|
136
|
-
User config path:
|
|
78
|
+
### 3. Check status
|
|
137
79
|
|
|
138
80
|
```text
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Project config path:
|
|
143
|
-
|
|
144
|
-
```text
|
|
145
|
-
.crew/config.json # default (new projects)
|
|
146
|
-
.pi/teams/config.json # legacy (when the repo already has .pi/)
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
The project root is auto-detected by walking up from the current directory and stopping at any of: `.git`, `.pi`, `.crew`, `.hg`, `.svn`, `.factory`, `.omc`, or any common manifest file (`package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, `composer.json`, `build.gradle[.kts]`). If the project already has a `.pi/` directory, pi-crew reuses it under `.pi/teams/` to avoid creating a parallel layout; otherwise it uses `.crew/`.
|
|
150
|
-
|
|
151
|
-
Config merge priority:
|
|
152
|
-
|
|
153
|
-
```text
|
|
154
|
-
user < project for ordinary presentation/UX settings
|
|
81
|
+
/team-status <runId>
|
|
82
|
+
/team-dashboard
|
|
155
83
|
```
|
|
156
84
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
Resource discovery trust boundary: project-local agents, teams, and workflows may add new names, but cannot shadow builtin or user resources with the same name.
|
|
85
|
+
### 4. Get a recommendation
|
|
160
86
|
|
|
161
|
-
|
|
87
|
+
When unsure which team/workflow fits:
|
|
162
88
|
|
|
163
89
|
```json
|
|
164
90
|
{
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"notifierIntervalMs": 5000,
|
|
168
|
-
"requireCleanWorktreeLeader": true,
|
|
169
|
-
"autonomous": {
|
|
170
|
-
"profile": "suggested",
|
|
171
|
-
"enabled": true,
|
|
172
|
-
"injectPolicy": true,
|
|
173
|
-
"preferAsyncForLongTasks": false,
|
|
174
|
-
"allowWorktreeSuggestion": true,
|
|
175
|
-
"magicKeywords": {
|
|
176
|
-
"review": ["review", "audit", "inspect"]
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"runtime": {
|
|
180
|
-
"mode": "auto",
|
|
181
|
-
"groupJoin": "smart",
|
|
182
|
-
"groupJoinAckTimeoutMs": 300000,
|
|
183
|
-
"requirePlanApproval": false,
|
|
184
|
-
"completionMutationGuard": "warn"
|
|
185
|
-
},
|
|
186
|
-
"limits": {
|
|
187
|
-
"maxConcurrentWorkers": 3,
|
|
188
|
-
"maxTaskDepth": 2,
|
|
189
|
-
"maxChildrenPerTask": 5,
|
|
190
|
-
"maxRunMinutes": 60,
|
|
191
|
-
"maxRetriesPerTask": 1,
|
|
192
|
-
"heartbeatStaleMs": 60000
|
|
193
|
-
},
|
|
194
|
-
"ui": {
|
|
195
|
-
"widgetPlacement": "aboveEditor",
|
|
196
|
-
"widgetMaxLines": 8,
|
|
197
|
-
"powerbar": true,
|
|
198
|
-
"dashboardPlacement": "center",
|
|
199
|
-
"dashboardWidth": 72,
|
|
200
|
-
"dashboardLiveRefreshMs": 1000,
|
|
201
|
-
"autoOpenDashboard": false,
|
|
202
|
-
"autoOpenDashboardForForegroundRuns": false,
|
|
203
|
-
"showModel": true,
|
|
204
|
-
"showTokens": true,
|
|
205
|
-
"showTools": true
|
|
206
|
-
},
|
|
207
|
-
"tools": {
|
|
208
|
-
"enableClaudeStyleAliases": true,
|
|
209
|
-
"enableSteer": true,
|
|
210
|
-
"terminateOnForeground": false
|
|
211
|
-
},
|
|
212
|
-
"telemetry": {
|
|
213
|
-
"enabled": true
|
|
214
|
-
},
|
|
215
|
-
"observability": {
|
|
216
|
-
"enabled": true,
|
|
217
|
-
"pollIntervalMs": 5000,
|
|
218
|
-
"metricRetentionDays": 7
|
|
219
|
-
},
|
|
220
|
-
"reliability": {
|
|
221
|
-
"autoRetry": false,
|
|
222
|
-
"autoRecover": false,
|
|
223
|
-
"deadletterThreshold": 3,
|
|
224
|
-
"retryPolicy": {
|
|
225
|
-
"maxAttempts": 3,
|
|
226
|
-
"backoffMs": 1000,
|
|
227
|
-
"jitterRatio": 0.3,
|
|
228
|
-
"exponentialFactor": 2
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
"otlp": {
|
|
232
|
-
"enabled": false,
|
|
233
|
-
"endpoint": "http://localhost:4318/v1/metrics"
|
|
234
|
-
}
|
|
91
|
+
"action": "recommend",
|
|
92
|
+
"goal": "Refactor auth flow and add tests"
|
|
235
93
|
}
|
|
236
94
|
```
|
|
237
95
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- Foreground child-process runs continue in the Pi extension process and return control to chat immediately, so large workflows do not block the interactive session. They are interrupted on session shutdown. Use `async: true` only for intentionally detached runs that may survive the current session.
|
|
241
|
-
- Async completion notifications survive extension reload/auto-compaction: active runs are not marked consumed just because the notifier restarts, while stale owner-session callbacks are suppressed after session switches.
|
|
242
|
-
- Background `Agent`/`crew_agent` runs notify the parent session when they reach a terminal state; the parent can then call `get_subagent_result`/`crew_agent_result` and continue the original task.
|
|
243
|
-
- `tools.terminateOnForeground` is an opt-in power-user setting. When true, foreground `Agent`/`crew_agent` calls return with `terminate: true` after the child result is available, saving one follow-up LLM turn. Default is false so the assistant can still summarize raw worker output.
|
|
244
|
-
- Runtime state paths are treated as untrusted data: run ids, import bundles, artifact/transcript paths, mailbox files, and agent control/log files are validated with containment checks before reads or writes.
|
|
245
|
-
- `runtime.completionMutationGuard` defaults to `warn`; set `off` to disable or `fail` to fail implementation-style tasks that report success without observed mutation tool calls.
|
|
246
|
-
- Group-join result messages use normal mailbox delivery and normal `ack-message`; missing acknowledgements never block run completion, and duplicate delivery attempts reuse the same request id/message instead of appending spam.
|
|
247
|
-
- Common secret patterns (`token=`, `apiKey=`, `Authorization: Bearer ...`, private keys, etc.) are redacted before durable logs/events/mailbox/artifacts/metrics/diagnostics are written.
|
|
248
|
-
- `observability.enabled` defaults to true for in-memory metrics and heartbeat watching. Metric JSONL snapshots are gated by `telemetry.enabled`; set `telemetry.enabled=false` to opt out of local telemetry files.
|
|
249
|
-
- `reliability.autoRetry` and `reliability.autoRecover` default to false. Enabling retry may execute an idempotent task more than once; each attempt is recorded in `task.attempts`, and exhausted retries append a deadletter entry.
|
|
250
|
-
- `otlp.enabled` defaults to false. Configure `otlp.endpoint` only when you want to push metrics to an OTLP HTTP collector.
|
|
251
|
-
|
|
252
|
-
UI notes:
|
|
253
|
-
|
|
254
|
-
- `widgetPlacement`/`widgetMaxLines` keep the persistent active-run widget compact.
|
|
255
|
-
- `dashboardPlacement: "center"` is the default for `/team-dashboard`; set it to `"right"` only when you want a right-sidebar dashboard.
|
|
256
|
-
- `autoOpenDashboard`/`autoOpenDashboardForForegroundRuns` control whether the live sidebar opens automatically. Both default to false so the compact widget above the input remains the primary live UI.
|
|
257
|
-
- `dashboardLiveRefreshMs` controls the live sidebar refresh cadence.
|
|
258
|
-
- `showModel`, `showTokens`, and `showTools` show worker model attempts, token usage, and tool activity in dashboard agent rows.
|
|
259
|
-
|
|
260
|
-
Show config:
|
|
261
|
-
|
|
262
|
-
```text
|
|
263
|
-
/team-config
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
Update user config:
|
|
267
|
-
|
|
268
|
-
```text
|
|
269
|
-
/team-config asyncByDefault=true notifierIntervalMs=5000
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
Update project config:
|
|
273
|
-
|
|
274
|
-
```text
|
|
275
|
-
/team-config autonomous.profile=assisted autonomous.preferAsyncForLongTasks=true --project
|
|
276
|
-
```
|
|
96
|
+
---
|
|
277
97
|
|
|
278
|
-
|
|
98
|
+
## Builtin Teams
|
|
279
99
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
100
|
+
| Team | Workflow | Mục đích |
|
|
101
|
+
|------|----------|----------|
|
|
102
|
+
| `default` | explore → plan → execute → verify | Cân bằng, đa năng |
|
|
103
|
+
| `fast-fix` | explore → execute → verify | Sửa bug nhỏ nhanh |
|
|
104
|
+
| `implementation` | Adaptive planner quyết fanout | Multi-file implementation |
|
|
105
|
+
| `review` | explore → code-review → security-review → verify | Code review + security audit |
|
|
106
|
+
| `research` | explore → analyze → write | Nghiên cứu và viết tài liệu |
|
|
285
107
|
|
|
286
|
-
|
|
108
|
+
## Builtin Agents
|
|
287
109
|
|
|
288
|
-
```text
|
|
289
|
-
./schema.json
|
|
290
110
|
```
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
The extension registers one main tool:
|
|
295
|
-
|
|
296
|
-
```text
|
|
297
|
-
team
|
|
111
|
+
analyst · critic · executor · explorer · planner · reviewer
|
|
112
|
+
security-reviewer · test-engineer · verifier · writer
|
|
298
113
|
```
|
|
299
114
|
|
|
300
|
-
|
|
115
|
+
---
|
|
301
116
|
|
|
302
|
-
|
|
117
|
+
## Runtime Safety
|
|
303
118
|
|
|
304
|
-
|
|
305
|
-
{
|
|
306
|
-
"action": "recommend",
|
|
307
|
-
"goal": "Refactor auth flow and add tests"
|
|
308
|
-
}
|
|
309
|
-
```
|
|
119
|
+
By default, `run` launches each task as a **separate child Pi process**. Workers execute independently and stream output to durable state.
|
|
310
120
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
Supported actions:
|
|
314
|
-
|
|
315
|
-
| Action | Purpose |
|
|
316
|
-
|---|---|
|
|
317
|
-
| `list` | List discovered teams, agents, workflows, and recent runs |
|
|
318
|
-
| `get` | Inspect a named agent/team/workflow |
|
|
319
|
-
| `recommend` | Suggest team/workflow/action plus decomposition and fanout hints |
|
|
320
|
-
| `run` | Create a run and execute the workflow scheduler |
|
|
321
|
-
| `plan` | Validate and preview workflow execution without running tasks |
|
|
322
|
-
| `status` | Read durable run status |
|
|
323
|
-
| `summary` | Read/write run summary artifact |
|
|
324
|
-
| `events` | Read run event log |
|
|
325
|
-
| `artifacts` | List run artifacts |
|
|
326
|
-
| `worktrees` | List run worktree metadata |
|
|
327
|
-
| `cancel` | Cancel queued/running work |
|
|
328
|
-
| `resume` | Re-queue failed/cancelled/skipped/running tasks |
|
|
329
|
-
| `cleanup` | Clean run worktrees; dirty worktrees are preserved unless forced |
|
|
330
|
-
| `forget` | Delete run state/artifacts after `confirm: true` |
|
|
331
|
-
| `prune` | Delete old finished runs after `confirm: true` |
|
|
332
|
-
| `export` | Export a portable run bundle |
|
|
333
|
-
| `import` | Import a run bundle into local imports |
|
|
334
|
-
| `imports` | List imported run bundles |
|
|
335
|
-
| `create` | Create agent/team/workflow in user/project scope |
|
|
336
|
-
| `update` | Update agent/team/workflow with backup |
|
|
337
|
-
| `delete` | Delete agent/team/workflow with `confirm: true` and backup |
|
|
338
|
-
| `validate` | Validate agents, teams, workflows, references, and model hints |
|
|
339
|
-
| `doctor` | Check local readiness and optionally run child Pi smoke check |
|
|
340
|
-
| `config` | Show/update config |
|
|
341
|
-
| `init` | Create project `.pi` layout and update `.gitignore` |
|
|
342
|
-
| `autonomy` | Show/update autonomous delegation settings |
|
|
343
|
-
| `api` | Safe interop for run/task/event/heartbeat/claim/mailbox state, including plan approval/cancel operations |
|
|
344
|
-
| `help` | Show help text |
|
|
345
|
-
|
|
346
|
-
## Example tool calls
|
|
347
|
-
|
|
348
|
-
Run a default team safely:
|
|
121
|
+
Scaffold/dry-run mode (no real workers):
|
|
349
122
|
|
|
350
123
|
```json
|
|
351
|
-
{
|
|
352
|
-
"action": "run",
|
|
353
|
-
"team": "default",
|
|
354
|
-
"goal": "Investigate failing tests and propose a fix"
|
|
355
|
-
}
|
|
124
|
+
{ "runtime": { "mode": "scaffold" } }
|
|
356
125
|
```
|
|
357
126
|
|
|
358
|
-
|
|
127
|
+
Disable workers globally:
|
|
359
128
|
|
|
360
129
|
```json
|
|
361
|
-
{
|
|
362
|
-
"action": "run",
|
|
363
|
-
"team": "implementation",
|
|
364
|
-
"goal": "Implement the user settings screen",
|
|
365
|
-
"async": true
|
|
366
|
-
}
|
|
130
|
+
{ "executeWorkers": false }
|
|
367
131
|
```
|
|
368
132
|
|
|
369
|
-
|
|
133
|
+
Worktree mode is **opt-in** and requires a clean repo:
|
|
370
134
|
|
|
371
135
|
```json
|
|
372
136
|
{
|
|
373
137
|
"action": "run",
|
|
374
138
|
"team": "implementation",
|
|
375
|
-
"
|
|
376
|
-
"goal": "Add API endpoint and tests",
|
|
139
|
+
"goal": "Refactor auth",
|
|
377
140
|
"workspaceMode": "worktree"
|
|
378
141
|
}
|
|
379
142
|
```
|
|
380
143
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
```json
|
|
384
|
-
{
|
|
385
|
-
"action": "run",
|
|
386
|
-
"team": "implementation",
|
|
387
|
-
"workflow": "implementation",
|
|
388
|
-
"goal": "Refactor auth and update tests",
|
|
389
|
-
"config": {
|
|
390
|
-
"runtime": { "requirePlanApproval": true }
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
Approve or cancel the pending plan:
|
|
396
|
-
|
|
397
|
-
```json
|
|
398
|
-
{
|
|
399
|
-
"action": "api",
|
|
400
|
-
"runId": "team_...",
|
|
401
|
-
"config": { "operation": "approve-plan" }
|
|
402
|
-
}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
Inspect a run:
|
|
406
|
-
|
|
407
|
-
```json
|
|
408
|
-
{
|
|
409
|
-
"action": "status",
|
|
410
|
-
"runId": "team_..."
|
|
411
|
-
}
|
|
412
|
-
```
|
|
144
|
+
---
|
|
413
145
|
|
|
414
|
-
|
|
146
|
+
## Configuration
|
|
415
147
|
|
|
416
|
-
|
|
417
|
-
{
|
|
418
|
-
"action": "create",
|
|
419
|
-
"resource": "agent",
|
|
420
|
-
"config": {
|
|
421
|
-
"scope": "project",
|
|
422
|
-
"name": "api-reviewer",
|
|
423
|
-
"description": "Reviews backend API changes",
|
|
424
|
-
"systemPrompt": "You review backend API changes for correctness and compatibility.",
|
|
425
|
-
"triggers": ["api", "endpoint", "contract"],
|
|
426
|
-
"useWhen": ["backend API change", "OpenAPI contract update"],
|
|
427
|
-
"avoidWhen": ["documentation-only edits"],
|
|
428
|
-
"cost": "cheap",
|
|
429
|
-
"category": "backend"
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
```
|
|
148
|
+
### Config Paths
|
|
433
149
|
|
|
434
|
-
|
|
150
|
+
| Scope | Path |
|
|
151
|
+
|-------|------|
|
|
152
|
+
| User | `~/.pi/agent/extensions/pi-crew/config.json` |
|
|
153
|
+
| Project (new) | `.crew/config.json` |
|
|
154
|
+
| Project (legacy) | `.pi/teams/config.json` |
|
|
435
155
|
|
|
436
|
-
|
|
156
|
+
### Quick Config
|
|
437
157
|
|
|
438
158
|
```text
|
|
439
|
-
/
|
|
440
|
-
/team-
|
|
441
|
-
/team-
|
|
442
|
-
/team-
|
|
443
|
-
/team-
|
|
444
|
-
/team-resume <runId>
|
|
445
|
-
/team-events <runId>
|
|
446
|
-
/team-artifacts <runId>
|
|
447
|
-
/team-worktrees <runId>
|
|
448
|
-
/team-cleanup <runId> [--force]
|
|
449
|
-
/team-forget <runId> --confirm [--force]
|
|
450
|
-
/team-prune --keep=20 --confirm
|
|
451
|
-
/team-export <runId>
|
|
452
|
-
/team-import <path-to-run-export.json> [--user]
|
|
453
|
-
/team-imports
|
|
454
|
-
/team-api <runId> <operation> [key=value]
|
|
455
|
-
/team-metrics [filter]
|
|
456
|
-
/team-manager
|
|
457
|
-
/team-dashboard
|
|
458
|
-
/team-init [--copy-builtins] [--overwrite]
|
|
459
|
-
/team-config [key=value] [--unset=key.path] [--project]
|
|
460
|
-
/team-settings [list|get <key>|set <key> <value>|unset <key>|path|scope]
|
|
461
|
-
/team-autonomy [status|on|off|manual|suggested|assisted|aggressive] [--prefer-async] [--no-worktree-suggest]
|
|
462
|
-
/team-validate
|
|
463
|
-
/team-help
|
|
464
|
-
/team-doctor
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
### `/team-api` examples
|
|
468
|
-
|
|
469
|
-
```text
|
|
470
|
-
/team-api team_... read-manifest
|
|
471
|
-
/team-api team_... list-tasks
|
|
472
|
-
/team-api team_... read-task taskId=task_...
|
|
473
|
-
/team-api team_... read-events
|
|
474
|
-
/team-api team_... read-heartbeat taskId=task_...
|
|
475
|
-
/team-api team_... write-heartbeat taskId=task_... alive=true
|
|
476
|
-
/team-api team_... claim-task taskId=task_... owner=worker-1
|
|
477
|
-
/team-api team_... release-task-claim taskId=task_... owner=worker-1 token=...
|
|
478
|
-
/team-api team_... transition-task-status taskId=task_... owner=worker-1 token=... status=running
|
|
479
|
-
/team-api team_... send-message direction=outbox to=worker body="please check this"
|
|
480
|
-
/team-api team_... send-message taskId=task_... direction=inbox to=worker body="task scoped message"
|
|
481
|
-
/team-api team_... read-mailbox direction=outbox
|
|
482
|
-
/team-api team_... read-mailbox taskId=task_... direction=inbox
|
|
483
|
-
/team-api team_... ack-message messageId=msg_... # also acknowledges group-join result messages
|
|
484
|
-
/team-api team_... read-delivery
|
|
485
|
-
/team-api team_... validate-mailbox repair=true
|
|
486
|
-
/team-api team_... approve-plan
|
|
487
|
-
/team-api team_... cancel-plan
|
|
159
|
+
/team-config # view
|
|
160
|
+
/team-config asyncByDefault=true # update
|
|
161
|
+
/team-config runtime.mode=scaffold # scaffold mode
|
|
162
|
+
/team-config --unset=asyncByDefault # reset
|
|
163
|
+
/team-config autonomous.profile=assisted --project # project scope
|
|
488
164
|
```
|
|
489
165
|
|
|
490
|
-
|
|
166
|
+
### Key Settings
|
|
491
167
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
168
|
+
| Section | Key Settings | Default |
|
|
169
|
+
|---------|-------------|---------|
|
|
170
|
+
| **Runtime** | `mode`: `auto` \| `scaffold` \| `child-process` \| `live-session` | `auto` |
|
|
171
|
+
| **Concurrency** | `limits.maxConcurrentWorkers` | workflow-dependent (2–4) |
|
|
172
|
+
| **Async** | `asyncByDefault`, `runtime.groupJoin` | `false`, `smart` |
|
|
173
|
+
| **Autonomy** | `profile`: `manual` \| `suggested` \| `assisted` \| `aggressive` | `suggested` |
|
|
174
|
+
| **UI** | `widgetPlacement`, `dashboardPlacement`, `showModel`, `showTokens` | compact widget |
|
|
175
|
+
| **Reliability** | `autoRetry`, `autoRecover`, `deadletterThreshold` | all opt-in |
|
|
176
|
+
| **Observability** | `prometheus.enabled`, `otlp.enabled` | opt-in |
|
|
496
177
|
|
|
497
|
-
|
|
178
|
+
> ⚠️ **Trust boundary**: project config cannot override sensitive execution controls (workers, runtime mode, autonomy, agent overrides). Set those in **user config** only.
|
|
498
179
|
|
|
499
|
-
|
|
180
|
+
📖 Full config reference: [docs/configuration.md](docs/configuration.md) *(coming soon — see [docs/usage.md](docs/usage.md) for now)*
|
|
500
181
|
|
|
501
|
-
|
|
502
|
-
/team-settings # list all known config keys
|
|
503
|
-
/team-settings get limits.maxTurns # read one key
|
|
504
|
-
/team-settings set limits.maxTurns 20 # update a key
|
|
505
|
-
/team-settings unset runtime.maxTurns # reset to default
|
|
506
|
-
/team-settings path # show config file path
|
|
507
|
-
/team-settings scope # show current scope (user/project)
|
|
508
|
-
```
|
|
182
|
+
---
|
|
509
183
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
| Key | Type | Description |
|
|
513
|
-
|-----|------|-------------|
|
|
514
|
-
| `asyncByDefault` | boolean | Run workflows async by default |
|
|
515
|
-
| `executeWorkers` | boolean | Enable real child Pi workers |
|
|
516
|
-
| `notifierIntervalMs` | number | Polling interval for async notifications |
|
|
517
|
-
| `runtime.mode` | `"auto"\|"scaffold"\|"child-process"\|"live-session"` | Crew runtime selection |
|
|
518
|
-
| `runtime.maxTurns` | number | Max turns per worker |
|
|
519
|
-
| `runtime.graceTurns` | number | Grace turns after max |
|
|
520
|
-
| `runtime.inheritContext` | boolean | Workers inherit parent context |
|
|
521
|
-
| `runtime.promptMode` | `"replace"\|"append"` | Prompt merge strategy |
|
|
522
|
-
| `runtime.groupJoin` | `"off"\|"group"\|"smart"` | Group join strategy |
|
|
523
|
-
| `runtime.groupJoinAckTimeoutMs` | number | Group join ack timeout (ms) |
|
|
524
|
-
| `runtime.requirePlanApproval` | boolean | Require plan approval before execution |
|
|
525
|
-
| `runtime.completionMutationGuard` | `"off"\|"warn"\|"fail"` | Mutation guard on completion |
|
|
526
|
-
| `limits.maxConcurrentWorkers` | number | Max concurrent workers |
|
|
527
|
-
| `limits.maxTaskDepth` | number | Max task tree depth |
|
|
528
|
-
| `limits.maxChildrenPerTask` | number | Max children per task |
|
|
529
|
-
| `limits.maxRunMinutes` | number | Max run duration (minutes) |
|
|
530
|
-
| `limits.maxRetriesPerTask` | number | Max retries per task |
|
|
531
|
-
| `limits.maxTasksPerRun` | number | Max tasks per run |
|
|
532
|
-
| `limits.heartbeatStaleMs` | number | Heartbeat stale threshold (ms) |
|
|
533
|
-
| `control.enabled` | boolean | Enable agent control-plane |
|
|
534
|
-
| `control.needsAttentionAfterMs` | number | Attention trigger after inactivity (ms) |
|
|
535
|
-
| `autonomous.profile` | `"manual"\|"suggested"\|"assisted"\|"aggressive"` | Autonomy profile |
|
|
536
|
-
| `autonomous.injectPolicy` | boolean | Inject autonomy policy into prompt |
|
|
537
|
-
| `autonomous.preferAsyncForLongTasks` | boolean | Auto-async for long tasks |
|
|
538
|
-
| `autonomous.allowWorktreeSuggestion` | boolean | Suggest worktree mode |
|
|
539
|
-
| `tools.enableClaudeStyleAliases` | boolean | Enable Claude-style tool aliases |
|
|
540
|
-
| `tools.enableSteer` | boolean | Enable steer tool |
|
|
541
|
-
| `tools.terminateOnForeground` | boolean | Return terminate:true from foreground Agent |
|
|
542
|
-
| `agents.disableBuiltins` | boolean | Disable all builtin agents |
|
|
543
|
-
| `observability.prometheus.enabled` | boolean | Enable Prometheus exporter |
|
|
544
|
-
| `observability.otlp.enabled` | boolean | Enable OTLP exporter |
|
|
545
|
-
| `worktree.enabled` | boolean | Enable worktree isolation |
|
|
546
|
-
|
|
547
|
-
## Dashboard
|
|
548
|
-
|
|
549
|
-
Open:
|
|
184
|
+
## Tool Actions
|
|
550
185
|
|
|
551
|
-
```
|
|
552
|
-
|
|
186
|
+
```json
|
|
187
|
+
{ "action": "run", "team": "default", "goal": "..." } // execute
|
|
188
|
+
{ "action": "status", "runId": "team_..." } // monitor
|
|
189
|
+
{ "action": "cancel", "runId": "team_..." } // stop
|
|
190
|
+
{ "action": "resume", "runId": "team_..." } // continue
|
|
191
|
+
{ "action": "recommend", "goal": "..." } // get advice
|
|
192
|
+
{ "action": "list" } // discover
|
|
193
|
+
{ "action": "create", "resource": "agent", ... } // extend
|
|
194
|
+
{ "action": "doctor" } // diagnose
|
|
553
195
|
```
|
|
554
196
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
```text
|
|
558
|
-
↑/↓ or j/k select run
|
|
559
|
-
r reload run list
|
|
560
|
-
p toggle short/long progress preview
|
|
561
|
-
Enter or s show status
|
|
562
|
-
a list artifacts
|
|
563
|
-
u show summary
|
|
564
|
-
i API read-manifest
|
|
565
|
-
q or Esc close
|
|
566
|
-
```
|
|
197
|
+
📖 Full actions reference: [docs/actions-reference.md](docs/actions-reference.md)
|
|
567
198
|
|
|
568
|
-
|
|
199
|
+
---
|
|
569
200
|
|
|
570
|
-
|
|
201
|
+
## Slash Commands
|
|
571
202
|
|
|
572
203
|
```text
|
|
573
|
-
/team-
|
|
204
|
+
/team-run [--team=X] [--async] [--worktree] <goal>
|
|
205
|
+
/team-status <runId>
|
|
206
|
+
/team-dashboard
|
|
207
|
+
/team-doctor
|
|
208
|
+
/team-init [--copy-builtins]
|
|
209
|
+
/team-config [key=value]
|
|
210
|
+
/team-autonomy [status|on|off|suggested|assisted]
|
|
574
211
|
```
|
|
575
212
|
|
|
576
|
-
|
|
213
|
+
📖 Full commands reference: [docs/commands-reference.md](docs/commands-reference.md)
|
|
577
214
|
|
|
578
|
-
|
|
579
|
-
- run a team
|
|
580
|
-
- show run status
|
|
581
|
-
- cleanup run worktrees
|
|
582
|
-
- create routed agent/team resources
|
|
583
|
-
- update routed agent/team resources
|
|
584
|
-
- doctor
|
|
585
|
-
|
|
586
|
-
## Resource paths
|
|
587
|
-
|
|
588
|
-
Builtin package resources:
|
|
589
|
-
|
|
590
|
-
```text
|
|
591
|
-
agents/*.md
|
|
592
|
-
teams/*.team.md
|
|
593
|
-
workflows/*.workflow.md
|
|
594
|
-
```
|
|
595
|
-
|
|
596
|
-
User resources:
|
|
215
|
+
---
|
|
597
216
|
|
|
598
|
-
|
|
599
|
-
~/.pi/agent/agents/*.md
|
|
600
|
-
~/.pi/agent/teams/*.team.md
|
|
601
|
-
~/.pi/agent/workflows/*.workflow.md
|
|
602
|
-
```
|
|
217
|
+
## Resource Discovery
|
|
603
218
|
|
|
604
|
-
|
|
219
|
+
Agents, teams, and workflows are discovered from three layers:
|
|
605
220
|
|
|
606
|
-
```text
|
|
607
|
-
.crew/agents/*.md
|
|
608
|
-
.crew/teams/*.team.md
|
|
609
|
-
.crew/workflows/*.workflow.md
|
|
610
221
|
```
|
|
611
|
-
|
|
612
|
-
Legacy layout (when `.pi/` already exists in the repo):
|
|
613
|
-
|
|
614
|
-
```text
|
|
615
|
-
.pi/teams/agents/*.md
|
|
616
|
-
.pi/teams/teams/*.team.md
|
|
617
|
-
.pi/teams/workflows/*.workflow.md
|
|
222
|
+
builtin (package) < user (~/.pi/agent/) < project (.crew/ or .pi/teams/)
|
|
618
223
|
```
|
|
619
224
|
|
|
620
|
-
|
|
225
|
+
Project resources can add new names but **cannot shadow** builtin/user resources.
|
|
621
226
|
|
|
622
|
-
|
|
623
|
-
builtin < user < project
|
|
624
|
-
```
|
|
227
|
+
### Resource Paths
|
|
625
228
|
|
|
626
|
-
|
|
229
|
+
| Type | Builtin | User | Project |
|
|
230
|
+
|------|---------|------|---------|
|
|
231
|
+
| Agent | `agents/*.md` | `~/.pi/agent/agents/*.md` | `.crew/agents/*.md` |
|
|
232
|
+
| Team | `teams/*.team.md` | `~/.pi/agent/teams/*.team.md` | `.crew/teams/*.team.md` |
|
|
233
|
+
| Workflow | `workflows/*.workflow.md` | `~/.pi/agent/workflows/*.workflow.md` | `.crew/workflows/*.workflow.md` |
|
|
627
234
|
|
|
628
|
-
|
|
235
|
+
### Custom Resources with Routing Metadata
|
|
629
236
|
|
|
630
237
|
```yaml
|
|
631
238
|
---
|
|
@@ -637,292 +244,80 @@ avoidWhen: docs-only edits
|
|
|
637
244
|
cost: cheap
|
|
638
245
|
category: backend
|
|
639
246
|
---
|
|
247
|
+
Your system prompt here.
|
|
640
248
|
```
|
|
641
249
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
## Builtin resources
|
|
645
|
-
|
|
646
|
-
Builtin agents include roles such as:
|
|
647
|
-
|
|
648
|
-
```text
|
|
649
|
-
analyst
|
|
650
|
-
critic
|
|
651
|
-
executor
|
|
652
|
-
explorer
|
|
653
|
-
planner
|
|
654
|
-
reviewer
|
|
655
|
-
security-reviewer
|
|
656
|
-
test-engineer
|
|
657
|
-
verifier
|
|
658
|
-
writer
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
Builtin teams include:
|
|
662
|
-
|
|
663
|
-
```text
|
|
664
|
-
default
|
|
665
|
-
fast-fix
|
|
666
|
-
implementation
|
|
667
|
-
research
|
|
668
|
-
review
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
Builtin workflows include:
|
|
672
|
-
|
|
673
|
-
```text
|
|
674
|
-
default
|
|
675
|
-
fast-fix
|
|
676
|
-
implementation
|
|
677
|
-
research
|
|
678
|
-
review
|
|
679
|
-
```
|
|
680
|
-
|
|
681
|
-
## State layout
|
|
682
|
-
|
|
683
|
-
Project-local state is preferred when the cwd is inside a recognised project (any of the markers listed in the Config section above). Otherwise pi-crew falls back to user-global state.
|
|
684
|
-
|
|
685
|
-
The project state root (`<crewRoot>` below) resolves to:
|
|
686
|
-
|
|
687
|
-
```text
|
|
688
|
-
<repoRoot>/.crew/ # default, used for new projects
|
|
689
|
-
<repoRoot>/.pi/teams/ # legacy reuse when .pi/ already exists
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
Typical project-local state (`<crewRoot>` is one of the two paths above):
|
|
693
|
-
|
|
694
|
-
```text
|
|
695
|
-
<crewRoot>/state/runs/{runId}/manifest.json
|
|
696
|
-
<crewRoot>/state/runs/{runId}/tasks.json
|
|
697
|
-
<crewRoot>/state/runs/{runId}/events.jsonl
|
|
698
|
-
<crewRoot>/artifacts/{runId}/...
|
|
699
|
-
<crewRoot>/worktrees/{runId}/{taskId}
|
|
700
|
-
<crewRoot>/imports/{runId}/run-export.json
|
|
701
|
-
```
|
|
250
|
+
📖 Full resource formats: [docs/resource-formats.md](docs/resource-formats.md)
|
|
702
251
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
```text
|
|
706
|
-
<crewRoot>/state/runs/{runId}/mailbox/inbox.jsonl
|
|
707
|
-
<crewRoot>/state/runs/{runId}/mailbox/outbox.jsonl
|
|
708
|
-
<crewRoot>/state/runs/{runId}/mailbox/delivery.json
|
|
709
|
-
<crewRoot>/state/runs/{runId}/mailbox/tasks/{taskId}/inbox.jsonl
|
|
710
|
-
<crewRoot>/state/runs/{runId}/mailbox/tasks/{taskId}/outbox.jsonl
|
|
711
|
-
```
|
|
712
|
-
|
|
713
|
-
User-global fallback (shared with other Pi tools):
|
|
714
|
-
|
|
715
|
-
```text
|
|
716
|
-
~/.pi/agent/extensions/pi-crew/state/runs/...
|
|
717
|
-
~/.pi/agent/extensions/pi-crew/artifacts/...
|
|
718
|
-
~/.pi/agent/extensions/pi-crew/imports/...
|
|
719
|
-
```
|
|
720
|
-
|
|
721
|
-
## Project initialization
|
|
722
|
-
|
|
723
|
-
Initialize project-local layout:
|
|
724
|
-
|
|
725
|
-
```text
|
|
726
|
-
/team-init
|
|
727
|
-
```
|
|
728
|
-
|
|
729
|
-
Optionally copy builtin resources:
|
|
730
|
-
|
|
731
|
-
```text
|
|
732
|
-
/team-init --copy-builtins
|
|
733
|
-
/team-init --copy-builtins --overwrite
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
Created directories (new projects):
|
|
737
|
-
|
|
738
|
-
```text
|
|
739
|
-
.crew/agents/
|
|
740
|
-
.crew/teams/
|
|
741
|
-
.crew/workflows/
|
|
742
|
-
.crew/imports/
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
If the project already has `.pi/`, the legacy layout is initialised instead:
|
|
746
|
-
|
|
747
|
-
```text
|
|
748
|
-
.pi/teams/agents/
|
|
749
|
-
.pi/teams/teams/
|
|
750
|
-
.pi/teams/workflows/
|
|
751
|
-
.pi/teams/imports/
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
`.gitignore` entries are written for whichever layout is active, e.g.:
|
|
755
|
-
|
|
756
|
-
```text
|
|
757
|
-
# new layout
|
|
758
|
-
.crew/state/
|
|
759
|
-
.crew/artifacts/
|
|
760
|
-
.crew/worktrees/
|
|
761
|
-
.crew/imports/
|
|
762
|
-
|
|
763
|
-
# legacy layout
|
|
764
|
-
.pi/teams/state/
|
|
765
|
-
.pi/teams/artifacts/
|
|
766
|
-
.pi/teams/worktrees/
|
|
767
|
-
.pi/teams/imports/
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
## Import/export
|
|
771
|
-
|
|
772
|
-
Export writes:
|
|
773
|
-
|
|
774
|
-
```text
|
|
775
|
-
{artifactsRoot}/export/run-export.json
|
|
776
|
-
{artifactsRoot}/export/run-export.md
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
Import stores bundles under (new layout):
|
|
780
|
-
|
|
781
|
-
```text
|
|
782
|
-
.crew/imports/{runId}/run-export.json
|
|
783
|
-
.crew/imports/{runId}/README.md
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
or under the legacy layout when `.pi/` already exists:
|
|
787
|
-
|
|
788
|
-
```text
|
|
789
|
-
.pi/teams/imports/{runId}/run-export.json
|
|
790
|
-
.pi/teams/imports/{runId}/README.md
|
|
791
|
-
```
|
|
252
|
+
---
|
|
792
253
|
|
|
793
|
-
|
|
254
|
+
## State Layout
|
|
794
255
|
|
|
795
|
-
```text
|
|
796
|
-
~/.pi/agent/extensions/pi-crew/imports/{runId}/run-export.json
|
|
797
|
-
~/.pi/agent/extensions/pi-crew/imports/{runId}/README.md
|
|
798
256
|
```
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
/
|
|
257
|
+
<crewRoot>/ # .crew/ (new) or .pi/teams/ (legacy)
|
|
258
|
+
├── state/runs/{runId}/
|
|
259
|
+
│ ├── manifest.json # run metadata
|
|
260
|
+
│ ├── tasks.json # task graph + status
|
|
261
|
+
│ ├── events.jsonl # append-only events
|
|
262
|
+
│ └── agents/{taskId}/status.json # per-agent state
|
|
263
|
+
├── artifacts/{runId}/
|
|
264
|
+
│ ├── goal.md
|
|
265
|
+
│ ├── prompts/{taskId}.md
|
|
266
|
+
│ ├── results/{taskId}.txt
|
|
267
|
+
│ ├── logs/{taskId}.log
|
|
268
|
+
│ └── summary.md
|
|
269
|
+
├── worktrees/{runId}/{taskId}/
|
|
270
|
+
└── imports/{runId}/run-export.json
|
|
806
271
|
```
|
|
807
272
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
```text
|
|
811
|
-
/team-doctor
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
Doctor checks include:
|
|
815
|
-
|
|
816
|
-
- cwd
|
|
817
|
-
- platform/architecture/Node.js version
|
|
818
|
-
- `pi --version`
|
|
819
|
-
- `git --version`
|
|
820
|
-
- writable state paths
|
|
821
|
-
- config parse
|
|
822
|
-
- discovery counts
|
|
823
|
-
- resource validation
|
|
824
|
-
- current model/provider when available
|
|
825
|
-
- model/fallback hints
|
|
826
|
-
|
|
827
|
-
Optional child Pi smoke check is explicit only:
|
|
273
|
+
---
|
|
828
274
|
|
|
829
|
-
|
|
830
|
-
{
|
|
831
|
-
"action": "doctor",
|
|
832
|
-
"config": {
|
|
833
|
-
"smokeChildPi": true
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
```
|
|
275
|
+
## Environment Variables
|
|
837
276
|
|
|
838
|
-
|
|
277
|
+
| Variable | Purpose |
|
|
278
|
+
|----------|---------|
|
|
279
|
+
| `PI_CREW_EXECUTE_WORKERS=0` | Disable child workers (scaffold mode) |
|
|
280
|
+
| `PI_TEAMS_EXECUTE_WORKERS=0` | Legacy disable flag |
|
|
281
|
+
| `PI_TEAMS_MOCK_CHILD_PI=success` | Mock child worker for testing |
|
|
282
|
+
| `PI_TEAMS_PI_BIN=<path>` | Explicit Pi CLI path |
|
|
283
|
+
| `PI_TEAMS_HOME=<path>` | Override home for tests |
|
|
839
284
|
|
|
840
|
-
|
|
841
|
-
PI_CREW_EXECUTE_WORKERS=0 disable child workers and use scaffold/dry-run mode
|
|
842
|
-
PI_TEAMS_EXECUTE_WORKERS=0 legacy disable flag
|
|
843
|
-
PI_TEAMS_MOCK_CHILD_PI=success test/mock child worker success
|
|
844
|
-
PI_TEAMS_MOCK_CHILD_PI=json-success
|
|
845
|
-
PI_TEAMS_MOCK_CHILD_PI=retryable-failure
|
|
846
|
-
PI_TEAMS_INHERIT_PROJECT_CONTEXT control child prompt context inheritance
|
|
847
|
-
PI_TEAMS_INHERIT_SKILLS control skill inheritance
|
|
848
|
-
PI_TEAMS_HOME override home path for tests/config/state
|
|
849
|
-
PI_TEAMS_PI_BIN optional explicit Pi CLI script/shim path for doctor/child workers
|
|
850
|
-
```
|
|
285
|
+
---
|
|
851
286
|
|
|
852
287
|
## Development
|
|
853
288
|
|
|
854
|
-
Install dependencies:
|
|
855
|
-
|
|
856
289
|
```bash
|
|
857
290
|
cd pi-crew
|
|
858
|
-
npm install
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
```bash
|
|
864
|
-
npm test
|
|
291
|
+
npm install # dependencies
|
|
292
|
+
npm test # unit + integration tests
|
|
293
|
+
npm run typecheck # tsc --noEmit
|
|
294
|
+
npm run ci # full CI-equivalent check
|
|
295
|
+
npm pack --dry-run # package verification
|
|
865
296
|
```
|
|
866
297
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
```bash
|
|
870
|
-
npm run typecheck
|
|
871
|
-
```
|
|
872
|
-
|
|
873
|
-
Full local CI-equivalent check:
|
|
874
|
-
|
|
875
|
-
```bash
|
|
876
|
-
npm run ci
|
|
877
|
-
```
|
|
298
|
+
CI runs on: `ubuntu-latest` · `windows-latest` · `macos-latest`
|
|
878
299
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
```text
|
|
882
|
-
ubuntu-latest
|
|
883
|
-
windows-latest
|
|
884
|
-
macos-latest
|
|
885
|
-
```
|
|
886
|
-
|
|
887
|
-
Package dry-run only:
|
|
888
|
-
|
|
889
|
-
```bash
|
|
890
|
-
npm pack --dry-run
|
|
891
|
-
```
|
|
300
|
+
---
|
|
892
301
|
|
|
893
302
|
## Documentation
|
|
894
303
|
|
|
895
|
-
|
|
304
|
+
| Doc | Contents |
|
|
305
|
+
|-----|----------|
|
|
306
|
+
| [docs/actions-reference.md](docs/actions-reference.md) | Full tool actions + examples |
|
|
307
|
+
| [docs/commands-reference.md](docs/commands-reference.md) | Slash commands + `/team-api` |
|
|
308
|
+
| [docs/resource-formats.md](docs/resource-formats.md) | Agent/team/workflow file formats |
|
|
309
|
+
| [docs/usage.md](docs/usage.md) | Usage patterns + config examples |
|
|
310
|
+
| [docs/architecture.md](docs/architecture.md) | Internal architecture + run flow |
|
|
311
|
+
| [docs/runtime-flow.md](docs/runtime-flow.md) | Runtime execution details |
|
|
312
|
+
| [docs/live-mailbox-runtime.md](docs/live-mailbox-runtime.md) | Mailbox + live-session runtime |
|
|
313
|
+
| [docs/publishing.md](docs/publishing.md) | Release & publish process |
|
|
314
|
+
| [docs/next-upgrade-roadmap.md](docs/next-upgrade-roadmap.md) | Future upgrade roadmap |
|
|
315
|
+
| [schema.json](schema.json) | Config JSON schema |
|
|
316
|
+
|
|
317
|
+
Research docs (not in package): [`docs/pi-crew-research/`](https://github.com/baphuongna/pi-crew/tree/main/docs) — audits, deep research, distillation notes.
|
|
896
318
|
|
|
897
|
-
|
|
898
|
-
pi-crew/docs/architecture.md
|
|
899
|
-
pi-crew/docs/usage.md
|
|
900
|
-
pi-crew/docs/resource-formats.md
|
|
901
|
-
pi-crew/docs/live-mailbox-runtime.md
|
|
902
|
-
pi-crew/docs/publishing.md
|
|
903
|
-
```
|
|
904
|
-
|
|
905
|
-
Historical workspace-level design/progress docs may exist in the original development workspace under `docs/pi-crew-*`, but package-maintained docs live under `pi-crew/docs/`.
|
|
906
|
-
|
|
907
|
-
## Local Pi smoke
|
|
908
|
-
|
|
909
|
-
A local Pi smoke test requires an installed Pi CLI and a real Pi environment:
|
|
910
|
-
|
|
911
|
-
```bash
|
|
912
|
-
cd pi-crew
|
|
913
|
-
npm run smoke:pi
|
|
914
|
-
```
|
|
915
|
-
|
|
916
|
-
Then in Pi:
|
|
917
|
-
|
|
918
|
-
```text
|
|
919
|
-
/team-doctor
|
|
920
|
-
/team-validate
|
|
921
|
-
/team-autonomy status
|
|
922
|
-
```
|
|
319
|
+
---
|
|
923
320
|
|
|
924
321
|
## Acknowledgements
|
|
925
322
|
|
|
926
|
-
`pi-crew` builds on ideas and selected MIT-licensed implementation patterns from `pi-subagents` and `oh-my-claudecode`.
|
|
927
|
-
|
|
928
|
-
It also draws conceptual inspiration from `oh-my-openagent`; no `oh-my-openagent` source code is copied unless separately documented and license-compatible.
|
|
323
|
+
`pi-crew` builds on ideas and selected MIT-licensed implementation patterns from `pi-subagents` and `oh-my-claudecode`, with conceptual inspiration from `oh-my-openagent`.
|