pi-crew 0.11.0 → 0.11.2

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.
Files changed (174) hide show
  1. package/CHANGELOG.md +155 -9
  2. package/README.md +161 -1037
  3. package/agents/verifier.md +18 -7
  4. package/dist/index.mjs +744 -90644
  5. package/docs/README.md +57 -46
  6. package/docs/architecture.md +87 -33
  7. package/docs/commands-reference.md +9 -5
  8. package/docs/troubleshooting.md +3 -2
  9. package/package.json +1 -3
  10. package/schema.json +39 -0
  11. package/skills/real-test-pi-crew/REPORT-TEMPLATE.md +2 -0
  12. package/skills/real-test-pi-crew/SKILL.md +371 -34
  13. package/src/agents/agent-config.ts +1 -1
  14. package/src/agents/discover-agents.ts +1 -1
  15. package/src/config/config-validation.ts +15 -2
  16. package/src/config/config.ts +47 -13
  17. package/src/config/defaults.ts +0 -1
  18. package/src/config/env-vars.ts +35 -0
  19. package/src/config/types.ts +19 -5
  20. package/src/errors.ts +2 -2
  21. package/src/extension/async-notifier.ts +23 -0
  22. package/src/extension/crew-vibes/config.ts +0 -21
  23. package/src/extension/crew-vibes/index.ts +0 -2
  24. package/src/extension/crew-vibes/render.ts +1 -50
  25. package/src/extension/help.ts +21 -12
  26. package/src/extension/knowledge-injection.ts +2 -1
  27. package/src/extension/management.ts +8 -3
  28. package/src/extension/notification-sink.ts +17 -0
  29. package/src/extension/register.ts +7 -2
  30. package/src/extension/registration/command-utils.ts +28 -2
  31. package/src/extension/registration/commands/dashboard.ts +11 -1
  32. package/src/extension/registration/commands/manage.ts +36 -19
  33. package/src/extension/registration/commands/run.ts +24 -2
  34. package/src/extension/registration/commands/shared.ts +23 -1
  35. package/src/extension/registration/commands/status.ts +25 -2
  36. package/src/extension/registration/context-builder.ts +8 -2
  37. package/src/extension/registration/health-notify-policy.ts +100 -0
  38. package/src/extension/registration/lazy-configurers.ts +35 -0
  39. package/src/extension/registration/lifecycle-handlers.ts +91 -30
  40. package/src/extension/registration/lifecycle.ts +75 -10
  41. package/src/extension/registration/observability.ts +98 -35
  42. package/src/extension/registration/registration-types.ts +7 -5
  43. package/src/extension/registration/runtime-cleanup.ts +9 -3
  44. package/src/extension/registration/subagent-helpers.ts +38 -0
  45. package/src/extension/registration/subagent-tools.ts +16 -6
  46. package/src/extension/registration/team-tool.ts +10 -3
  47. package/src/extension/registration/terminal-status-wiring.ts +172 -0
  48. package/src/extension/registration/viewers.ts +6 -0
  49. package/src/extension/registration/wire-cross-extension.ts +28 -0
  50. package/src/extension/run-compare.ts +220 -0
  51. package/src/extension/run-export.ts +37 -5
  52. package/src/extension/run-maintenance.ts +155 -5
  53. package/src/extension/team-tool/dispatch/index.ts +3 -2
  54. package/src/extension/team-tool/dispatch/manage.ts +5 -2
  55. package/src/extension/team-tool/goal.ts +4 -1
  56. package/src/extension/team-tool/handle-settings.ts +33 -4
  57. package/src/extension/team-tool/health-monitor.ts +21 -7
  58. package/src/extension/team-tool/lifecycle-actions.ts +49 -1
  59. package/src/extension/team-tool/plan.ts +10 -0
  60. package/src/extension/team-tool/routing-hint.ts +63 -0
  61. package/src/extension/team-tool/status.ts +4 -0
  62. package/src/extension/team-tool.ts +52 -6
  63. package/src/extension/webhook-notify.ts +382 -0
  64. package/src/observability/metric-sink.ts +12 -2
  65. package/src/prompt/prompt-runtime.ts +82 -31
  66. package/src/prompt/worker-events-channel.ts +12 -0
  67. package/src/runtime/README.md +1 -1
  68. package/src/runtime/async-runner.ts +87 -1
  69. package/src/runtime/background-runner.ts +313 -234
  70. package/src/runtime/broker/crew-broker.ts +17 -11
  71. package/src/runtime/broker/delegate/shadow-lifecycle.ts +92 -0
  72. package/src/runtime/broker/wait-status-cache.ts +1 -1
  73. package/src/runtime/child-pi/child-pi-timers.ts +1 -1
  74. package/src/runtime/child-pi/mock-fixtures.ts +48 -0
  75. package/src/runtime/crew-agent-records.ts +337 -45
  76. package/src/runtime/deadletter.ts +43 -1
  77. package/src/runtime/delegate-spawn.ts +5 -1
  78. package/src/runtime/dispatch-batch.ts +72 -5
  79. package/src/runtime/goal-workflow/goal-loop-runner.ts +73 -4
  80. package/src/runtime/heartbeat/heartbeat-watcher.ts +7 -0
  81. package/src/runtime/model/model-fallback.ts +21 -1
  82. package/src/runtime/model/pi-args.ts +8 -10
  83. package/src/runtime/recovery/crash-recovery.ts +25 -1
  84. package/src/runtime/run-worker.ts +12 -1
  85. package/src/runtime/scheduling/global-worker-cap.ts +13 -6
  86. package/src/runtime/scheduling/run-coalesced-task-group.ts +27 -1
  87. package/src/runtime/scheduling/scheduler.ts +49 -13
  88. package/src/runtime/scheduling/semaphore.ts +148 -20
  89. package/src/runtime/scratchpad/README.md +1 -1
  90. package/src/runtime/scratchpad/protocol.ts +1 -1
  91. package/src/runtime/settings-store.ts +1 -1
  92. package/src/runtime/skill-instructions.ts +22 -0
  93. package/src/runtime/stale-reconciler.ts +85 -13
  94. package/src/runtime/task-display.ts +1 -1
  95. package/src/runtime/task-runner/pre-execution.ts +26 -2
  96. package/src/runtime/task-runner/prompt-builder.ts +142 -45
  97. package/src/runtime/task-runner.ts +21 -1
  98. package/src/runtime/team-runner.ts +38 -1
  99. package/src/runtime/workspace-lock.ts +4 -1
  100. package/src/schema/config-schema.ts +18 -0
  101. package/src/schema/team-tool-schema.ts +17 -0
  102. package/src/state/atomic-write.ts +53 -0
  103. package/src/state/contracts.ts +109 -0
  104. package/src/state/coordination/locks.ts +191 -33
  105. package/src/state/coordination/mailbox.ts +140 -15
  106. package/src/state/crew-init.ts +87 -12
  107. package/src/state/event-log/cursor.ts +37 -1
  108. package/src/state/event-log/event-log-rotation.ts +72 -7
  109. package/src/state/stores/active-run-registry.ts +13 -1
  110. package/src/state/stores/state-store.ts +112 -22
  111. package/src/state/types.ts +4 -0
  112. package/src/ui/adaptive-card.ts +65 -0
  113. package/src/ui/agents-jobs-browser.ts +70 -64
  114. package/src/ui/card-colors.ts +36 -7
  115. package/src/ui/dashboard-panes/agents-pane.ts +55 -14
  116. package/src/ui/dashboard-panes/cancellation-pane.ts +0 -42
  117. package/src/ui/dashboard-panes/health-pane.ts +7 -5
  118. package/src/ui/dashboard-panes/mailbox-pane.ts +22 -6
  119. package/src/ui/dashboard-panes/metrics-pane.ts +15 -7
  120. package/src/ui/dashboard-panes/pane-theme.ts +21 -0
  121. package/src/ui/dashboard-panes/plan-pane.ts +63 -30
  122. package/src/ui/dashboard-panes/progress-pane.ts +3 -2
  123. package/src/ui/dashboard-panes/schedules-pane.ts +44 -21
  124. package/src/ui/dashboard-panes/transcript-pane.ts +11 -5
  125. package/src/ui/dwf-phase-display.ts +3 -20
  126. package/src/ui/format-helpers.ts +22 -0
  127. package/src/ui/heartbeat-aggregator.ts +34 -0
  128. package/src/ui/inline-panel/crew-editor.ts +13 -3
  129. package/src/ui/inline-panel/index.ts +60 -4
  130. package/src/ui/keybinding-map.ts +251 -35
  131. package/src/ui/live-conversation-overlay.ts +180 -47
  132. package/src/ui/live-run-sidebar.ts +134 -55
  133. package/src/ui/mascot.ts +32 -16
  134. package/src/ui/overlays/agent-picker-overlay.ts +81 -26
  135. package/src/ui/overlays/confirm-overlay.ts +55 -29
  136. package/src/ui/overlays/help-overlay.ts +108 -53
  137. package/src/ui/overlays/mailbox-compose-overlay.ts +89 -50
  138. package/src/ui/overlays/mailbox-detail-overlay.ts +137 -57
  139. package/src/ui/powerbar-publisher.ts +0 -1
  140. package/src/ui/rail.ts +333 -0
  141. package/src/ui/run-dashboard.ts +193 -79
  142. package/src/ui/run-snapshot-cache.ts +18 -1
  143. package/src/ui/settings-overlay.ts +81 -39
  144. package/src/ui/spinner.ts +26 -2
  145. package/src/ui/terminal-status.ts +7 -1
  146. package/src/ui/theme-adapter.ts +0 -45
  147. package/src/ui/theme-discovery.ts +12 -6
  148. package/src/ui/tool-progress-formatter.ts +128 -9
  149. package/src/ui/tool-renderers/brief-mode.ts +10 -67
  150. package/src/ui/tool-renderers/index.ts +374 -523
  151. package/src/ui/transcript-viewer.ts +30 -12
  152. package/src/ui/widget/index.ts +32 -52
  153. package/src/ui/widget/task-list.ts +64 -32
  154. package/src/ui/widget/widget-formatters.ts +3 -402
  155. package/src/ui/widget/widget-model.ts +28 -7
  156. package/src/ui/widget/widget-renderer.ts +201 -128
  157. package/src/ui/widget/widget-types.ts +0 -2
  158. package/src/utils/incremental-reader.ts +11 -3
  159. package/src/utils/paths.ts +94 -12
  160. package/src/utils/project-markers.ts +40 -0
  161. package/src/utils/visual.ts +0 -4
  162. package/src/worktree/worktree-manager.ts +206 -26
  163. package/workflows/distill.workflow.md +3 -3
  164. package/workflows/fast-fix.workflow.md +1 -1
  165. package/workflows/plan-execute.workflow.md +1 -1
  166. package/workflows/review.workflow.md +1 -1
  167. package/workflows/strict-fast-fix.workflow.md +1 -1
  168. package/docs/migration-v0.4-v0.5.md +0 -208
  169. package/docs/runtime-flow.md +0 -148
  170. package/src/extension/crew-vibes/figures.ts +0 -22
  171. package/src/extension/crew-vibes/font-detect.ts +0 -71
  172. package/src/ui/dynamic-border.ts +0 -35
  173. package/src/ui/loaders.ts +0 -6
  174. package/src/ui/overlay-stack.ts +0 -148
package/docs/README.md CHANGED
@@ -1,56 +1,67 @@
1
- # docs/ — documentation index
1
+ # pi-crew docs
2
2
 
3
- pi-crew's documentation. After the v0.9.x reorg the **living/active** docs
4
- stay at the root of this directory; historical/retired docs live in
5
- [`archive/`](./archive/). Cluster maps for the code live in
6
- [`src/runtime/README.md`](../src/runtime/README.md) and
7
- [`src/state/README.md`](../src/state/README.md).
3
+ Documentation for the pi-crew package (multi-agent team orchestration as a Pi
4
+ extension). The root of `docs/` holds only **living** docs; dated point-in-time
5
+ material (audits, plans, fix specs, roadmaps) is archived under
6
+ [`archive/`](./archive/).
8
7
 
9
- ## Living docs (root)
8
+ ## Start here
10
9
 
11
10
  | Doc | Contents |
12
11
  |-----|----------|
13
- | [`usage.md`](./usage.md) | Usage patterns + config examples |
14
- | [`commands-reference.md`](./commands-reference.md) | Slash commands + `/team-api` |
15
- | [`actions-reference.md`](./actions-reference.md) | Full tool actions + examples |
12
+ | [`../README.md`](../README.md) | Package README — what pi-crew is, install, quickstart |
13
+ | [`usage.md`](./usage.md) | Config, run modes, slash commands, management actions |
14
+ | [`architecture.md`](./architecture.md) | Layers, state layout, and the run lifecycle (the former `runtime-flow.md` content lives here) |
15
+ | [`troubleshooting.md`](./troubleshooting.md) | Common errors, recovery procedures, error codes (E001–E013) |
16
+
17
+ ## Reference
18
+
19
+ | Doc | Contents |
20
+ |-----|----------|
21
+ | [`actions-reference.md`](./actions-reference.md) | Every `team` tool action with parameters and examples |
22
+ | [`commands-reference.md`](./commands-reference.md) | Slash commands and `/team-api` |
23
+ | [`hooks-reference.md`](./hooks-reference.md) | The three hook/event subsystems and when to use each |
24
+ | [`role-tools.md`](./role-tools.md) | Role → tool permission matrix. **Generated** from `src/config/role-tools.ts` via `scripts/gen-role-tools-docs.mjs` — regenerate, do not hand-edit |
16
25
  | [`resource-formats.md`](./resource-formats.md) | Agent/team/workflow file formats |
17
- | [`architecture.md`](./architecture.md) | Internal architecture + run flow |
18
- | [`runtime-flow.md`](./runtime-flow.md) | Runtime execution details |
19
- | [`dynamic-workflows.md`](./dynamic-workflows.md) | `.dwf.ts` script runtime + trust model |
26
+ | [`trust-model.md`](./trust-model.md) | The authoritative trust model (single source of truth) |
20
27
  | [`goals.md`](./goals.md) | Autonomous goal loops (`team action='goal'`) |
21
- | [`live-mailbox-runtime.md`](./live-mailbox-runtime.md) | Mailbox + live-session runtime |
22
- | [`troubleshooting.md`](./troubleshooting.md) | Common errors, recovery, error-code reference (E001–E012) |
23
- | [`publishing.md`](./publishing.md) | Release & publish process |
24
- | [`migration-v0.4-v0.5.md`](./migration-v0.4-v0.5.md) | Migration guide: v0.4 → v0.5 |
25
- | [`HARNESS.md`](./HARNESS.md) | Agent-testing harness operating model |
26
- | [`HARNESS_BACKLOG.md`](./HARNESS_BACKLOG.md) | Harness capability backlog |
27
- | [`FEATURE_INTAKE.md`](./FEATURE_INTAKE.md) | Feature-intake gate for implementation prompts |
28
- | [`TEST_MATRIX.md`](./TEST_MATRIX.md) | Behavior→proof mapping (every row needs real evidence) |
29
- | [`TEST-STRATEGY-2026-07-30.md`](./TEST-STRATEGY-2026-07-30.md) | v0.9.56 test strategy (coverage × test type) |
30
- | [`COVERAGE-ASSESSMENT-2026-08-01.md`](./COVERAGE-ASSESSMENT-2026-08-01.md) | v0.9.56 coverage assessment + source-reorg history |
31
- | [`AUDIT-2026-07-30.md`](./AUDIT-2026-07-30.md) | v0.9.56 comprehensive audit (6 parallel streams) |
32
- | [`REMEDIATION-PLAN-2026-07-30.md`](./REMEDIATION-PLAN-2026-07-30.md) | v0.9.56 remediation plan |
33
- | [`refactor-plan.md`](./refactor-plan.md) | Maintainability refactor plan (phased, v0.9.68) |
34
- | [`refactor-plan.review.md`](./refactor-plan.review.md) | Verification sweep 3 (vòng 4) audit trail — 3 large-file baselines CONFIRMED, 6 corrections, Phase 4 reframe |
35
-
36
- ## Subdirectories
28
+ | [`dynamic-workflows.md`](./dynamic-workflows.md) | `.dwf.ts` script workflows and their trust model |
29
+ | [`live-mailbox-runtime.md`](./live-mailbox-runtime.md) | Mailbox files and the live-session runtime direction |
30
+ | [`UI-DESIGN-SYSTEM.md`](./UI-DESIGN-SYSTEM.md) | RAIL design contract for TUI surfaces (primitive source: `src/ui/rail.ts`) |
31
+ | [`publishing.md`](./publishing.md) | npm release and publish process |
32
+ | [`failure-mode-inventory.md`](./failure-mode-inventory.md) | Failure modes mapped to their handlers; gaps are declared, not hidden |
33
+ | [`TEST_MATRIX.md`](./TEST_MATRIX.md) | Behavior → proof mapping; every row needs real evidence |
34
+ | [`HARNESS.md`](./HARNESS.md) | Development-harness operating model for building pi-crew itself |
35
+ | [`HARNESS_BACKLOG.md`](./HARNESS_BACKLOG.md) | Harness capability backlog (HB-xxx items) |
36
+ | [`FEATURE_INTAKE.md`](./FEATURE_INTAKE.md) | Intake gate every implementation prompt must pass |
37
+
38
+ ## Records
39
+
40
+ Historical and supporting material lives in subdirectories. These are records,
41
+ not living specs — verify against code before relying on them.
37
42
 
38
43
  | Subdir | Contents |
39
44
  |--------|----------|
40
- | [`archive/`](./archive/) | Historical/retired docs (flat; ~59 files — audits, research, superseded plans) |
41
- | [`bugs/`](./bugs/) | Bug write-ups + security audit/issues |
42
- | [`decisions/`](./decisions/) | Architecture decision records (ADRs, numbered) |
43
- | [`distillation/`](./distillation/) | Distilled pattern/skill references |
44
- | [`fixes/`](./fixes/) | Bug-fix reports |
45
- | [`migration/`](./migration/) | Migration guides (e.g. atomic-write v2) |
46
- | [`patterns/`](./patterns/) | Reusable pattern references |
47
- | [`perf/`](./perf/) | Performance audits, sprint reports, optimization plans |
48
- | [`product/`](./product/) | Product-domain docs |
49
- | [`skills/`](./skills/) | pi-crew skills reference |
50
- | [`stories/`](./stories/) | Story-sized work packets |
51
- | [`superpowers/`](./superpowers/) | Fallow-patterns adoption plans |
52
- | [`templates/`](./templates/) | Decision / story / validation-report templates |
53
-
54
- See also the top-level [README.md](../README.md) and the source cluster maps
55
- ([`src/runtime/README.md`](../src/runtime/README.md),
56
- [`src/state/README.md`](../src/state/README.md)).
45
+ | [`decisions/`](./decisions/) | Architecture decision records (ADRs); index in its README |
46
+ | [`design/`](./design/) | Design and implementation-plan docs for features in flight (subagent-v2, inline agent panel, work-item splits) |
47
+ | [`bugs/`](./bugs/) | Bug write-ups plus security audits/issues |
48
+ | [`fixes/`](./fixes/) | Per-bug fix reports: root cause, evidence, applied layers |
49
+ | [`perf/`](./perf/) | Performance baselines, bench reports, optimization plans, sprint reports |
50
+ | [`archive/`](./archive/) | Dated point-in-time docs (audits, plans, fix specs, roadmaps) kept for history |
51
+ | [`ui-samples/`](./ui-samples/) | TUI surface catalog: captures rendered by the real render functions, PNGs, and generator scripts |
52
+ | [`real-test/`](./real-test/) | Real-binary test session reports and probe logs |
53
+ | [`evidence/`](./evidence/) | Raw evidence logs captured for work items (e.g., RED demos) |
54
+ | [`migration/`](./migration/) | Migration guides (e.g., atomic-write v2) |
55
+ | [`patterns/`](./patterns/) | Distilled reusable patterns (command → agent → skill tiers) |
56
+ | [`product/`](./product/) | Product-domain docs: team-run lifecycle, team-tool API, state contracts |
57
+ | [`skills/`](./skills/) | Skill chains and effectiveness reference |
58
+ | [`stories/`](./stories/) | Story-sized work packets with status |
59
+ | [`superpowers/`](./superpowers/) | Adopted workflow plans (`plans/`) and specs (`specs/`) |
60
+ | [`templates/`](./templates/) | Templates: `decision.md`, `story.md`, `validation-report.md` |
61
+ | [`distillation/`](./distillation/) | Distillations of external skill libraries into pi-crew patterns |
62
+
63
+ ## See also
64
+
65
+ - [Package README](../README.md) and [CHANGELOG](../CHANGELOG.md)
66
+ - Source cluster maps: [`src/runtime/README.md`](../src/runtime/README.md),
67
+ [`src/state/README.md`](../src/state/README.md)
@@ -2,8 +2,6 @@
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.10.3 — 100+ rounds of code review hardening (see [CHANGELOG.md](../CHANGELOG.md)).
6
-
7
5
  ## Layers
8
6
 
9
7
  ```text
@@ -24,39 +22,95 @@ State layer (project root resolves to <crewRoot>:
24
22
  <crewRoot>/artifacts/{runId}/...
25
23
  ```
26
24
 
27
- ## Run flow
25
+ ## Runtime flow
26
+
27
+ The former `docs/runtime-flow.md` was folded into this section; the standalone
28
+ file is being retired.
29
+
30
+ ### Run lifecycle
31
+
32
+ ```text
33
+ team tool (action=run) or /team-run
34
+ └─ handleTeamTool → team-tool/run.ts
35
+ ├─ discover agents/teams/workflows; validate refs
36
+ ├─ create run manifest, tasks.json, goal artifact
37
+ └─ foreground (default, session-bound) or async (background)?
38
+ ├─ foreground: startForegroundRun() schedules executeTeamRun()
39
+ └─ async: spawnBackgroundTeamRun()
40
+ ├─ node --import jiti-register.mjs background-runner.ts (detached)
41
+ ├─ fail-fast when jiti is missing
42
+ └─ background-runner: append async.started, write async.pid
43
+ startup marker, re-discover resources, executeTeamRun()
44
+
45
+ executeTeamRun()
46
+ ├─ mark run.running; materialize queued/running agent records lazily
47
+ ├─ build task-graph index
48
+ ├─ while queued tasks remain:
49
+ │ ├─ snapshot task graph; resolveBatchConcurrency() (hard-capped)
50
+ │ ├─ getReadyTasks() → run the ready batch concurrently
51
+ │ │ └─ runTeamTask():
52
+ │ │ prepare workspace/worktree, render prompt + dependency
53
+ │ │ context, choose model candidates from Pi config, spawn the
54
+ │ │ child pi process, parse its JSONL stdout/stderr, persist
55
+ │ │ agent status/events/output, write result/log/transcript
56
+ │ │ artifacts
57
+ │ ├─ merge task updates monotonically
58
+ │ ├─ optional adaptive plan injection
59
+ │ └─ persist tasks/agents/progress + batch artifact
60
+ └─ policy closeout → run.completed | run.failed | run.blocked | run.cancelled
61
+ ```
62
+
63
+ Run/task states: `queued` / `planning` / `running` → `completed` / `failed` /
64
+ `blocked` / `cancelled`; tasks additionally use `skipped`. Terminal states are
65
+ monotonic — parallel merges must not regress them (see
66
+ [Team runner](#team-runner)).
67
+
68
+ Action routing (`status`, `cancel`, `resume`, `forget`, `doctor`, …) is
69
+ documented in [actions-reference.md](actions-reference.md).
70
+
71
+ ### Key files in the run path
28
72
 
29
73
  ```text
30
- user/team tool
31
- │
32
- ▼
33
- handleTeamTool(action=run)
34
- ├─ discover agents/teams/workflows
35
- ├─ validate team/workflow refs
36
- ├─ create run manifest + task graph
37
- ├─ write goal artifact
38
- └─ choose foreground/session-bound or async/background mode
39
- │
40
- ├─ foreground: startForegroundRun() schedules executeTeamRun()
41
- │
42
- └─ async: spawnBackgroundTeamRun()
43
- ├─ node --import jiti-register.mjs background-runner.ts
44
- ├─ background-runner writes async.started + async.pid marker
45
- └─ executeTeamRun()
46
- ├─ resolve ready task batch
47
- ├─ resolveBatchConcurrency() with hard cap
48
- ├─ runTeamTask() per task
49
- │ ├─ build prompt + dependency context
50
- │ ├─ choose configured Pi model candidates
51
- │ ├─ spawn child `pi` worker
52
- │ ├─ observe JSONL/stdout progress
53
- │ ├─ persist agent status/events/output
54
- │ └─ write result/log/transcript artifacts
55
- ├─ merge task updates monotonically
56
- ├─ write progress artifacts
57
- └─ synthesize policy closeout
74
+ src/extension/register.ts Pi extension entry/wiring
75
+ src/extension/team-tool/run.ts run creation; foreground/async split
76
+ src/runtime/background-runner.ts detached async entrypoint
77
+ src/runtime/async-runner.ts background spawn command/options
78
+ src/runtime/team-runner.ts workflow/task-graph scheduler
79
+ src/runtime/task-runner.ts single task execution (+ task-runner/)
80
+ src/runtime/child-pi/child-pi.ts child Pi process + output observer
81
+ src/runtime/model/model-fallback.ts configured model candidates/routing
82
+ src/runtime/scheduling/concurrency.ts batch concurrency decisions
83
+ src/runtime/process-status.ts pid/liveness/stale detection
84
+ src/state/stores/state-store.ts manifest/tasks persistence
85
+ src/state/event-log/event-log.ts JSONL run events
86
+ src/runtime/crew-agent-records.ts aggregate + per-agent status files
58
87
  ```
59
88
 
89
+ ### Runtime env vars
90
+
91
+ The complete registry is `src/config/env-vars.ts` — the CI gate
92
+ (`scripts/check-env-vars.mjs`) fails on any raw `PI_CREW_*` / `PI_TEAMS_*`
93
+ read outside it, and mirror-pair resolution (`PI_CREW_*` ↔ `PI_TEAMS_*`)
94
+ lives there. The ones most likely to be set by hand:
95
+
96
+ | Env | Effect |
97
+ |---|---|
98
+ | `PI_CREW_EXECUTE_WORKERS=0` | Disable real workers; use scaffold behavior (`PI_TEAMS_EXECUTE_WORKERS=0` legacy alias). |
99
+ | `PI_CREW_DEPTH` / `PI_CREW_MAX_DEPTH` | Subagent recursion guard (`PI_TEAMS_*` legacy aliases). |
100
+ | `PI_TEAMS_HOME` | Override user config/state home (tests). |
101
+ | `PI_TEAMS_PI_BIN` | Override the child `pi` executable. |
102
+ | `PI_CREW_ASYNC_EARLY_EXIT_GUARD=0` | Disable the async-run early-exit guard. |
103
+ | `PI_TEAMS_MOCK_CHILD_PI` / `PI_CREW_MOCK_LIVE_SESSION` | Test hooks for mocked worker execution. |
104
+ | `PI_CREW_MAX_WORKERS` | Cap concurrent workers (default `max(2, cpus−2)`). |
105
+ | `PI_TEAMS_CHILD_RESPONSE_TIMEOUT_MS` | Child Pi response timeout. |
106
+
107
+ ### Debugging a run
108
+
109
+ - `background.log` — early import/spawn errors of async runs.
110
+ - `events.jsonl` — run event chronology; `agents/{taskId}/status.json` — per-agent model/progress/tool status.
111
+ - `artifacts/{runId}/transcripts/{taskId}.jsonl` — raw child Pi transcript.
112
+ - `team action='status' runId=…` — canonical state + stale async detection; `/team-dashboard` for a UI overview.
113
+
60
114
  ## Extension layer
61
115
 
62
116
  `src/extension/register.ts` wires the package into Pi:
@@ -169,7 +223,7 @@ Foreground runs are session-bound and should be interrupted on session shutdown
169
223
 
170
224
  Key config sections:
171
225
 
172
- - `runtime`: `auto`, `child-process`, `scaffold`, experimental `live-session`.
226
+ - `runtime`: `auto` (default; resolves to `child-process` unless config/env requests otherwise), `child-process`, `scaffold` (explicit dry-run, no child workers), experimental `live-session`.
173
227
  - `limits`: concurrency/task/depth safety controls.
174
228
  - `ui`: widget/dashboard/powerbar/model-token display settings.
175
229
  - `observability`: in-memory metrics, heartbeat watcher interval, metric file retention.
@@ -179,4 +233,4 @@ Key config sections:
179
233
  - `agents`: builtin overrides for models/fallbacks/tools.
180
234
  - `autonomous`: policy injection/profile for proactive team delegation.
181
235
 
182
- See `usage.md`, `resource-formats.md`, `runtime-flow.md`, and `live-mailbox-runtime.md` for operational details.
236
+ See `usage.md`, `resource-formats.md`, and `live-mailbox-runtime.md` for operational details.
@@ -14,26 +14,29 @@ Slash commands are manual actions triggered from the Pi chat. Autonomous tool us
14
14
  | `/team-resume <runId>` | Resume a stopped run |
15
15
  | `/team-retry <runId>` | Retry a failed run |
16
16
  | `/team-result <runId>` | Show a task result artifact |
17
- | `/team-respond <taskId> <message>` | Respond to a waiting worker task |
18
- | `/team-follow-up [options]` | Manage follow-up notifications |
17
+ | `/team-respond <runId> <taskId\|--all> <message>` | Respond to a waiting worker task |
18
+ | `/team-follow-up <runId> <taskId> <prompt>` | Send a follow-up prompt to a task |
19
19
  | `/team-events <runId>` | View the event log |
20
20
  | `/team-artifacts <runId>` | View artifacts |
21
21
  | `/team-transcript <runId>` | Open the transcript viewer |
22
22
  | `/team-worktrees <runId>` | View worktree metadata |
23
- | `/team-cleanup <runId>` | Remove worktrees (interactive menu: `/team-cleanup-menu`) |
24
23
  | `/team-forget <runId>` | Fully delete a run |
25
24
  | `/team-prune` | Delete multiple old runs |
26
- | `/team-invalidate [scope]` | Invalidate caches |
25
+ | `/team-invalidate <runId>` | Invalidate the snapshot cache for a run |
27
26
  | `/team-export <runId>` | Export a run bundle |
28
27
  | `/team-import <path>` | Import a run bundle |
29
28
  | `/team-imports` | List imported bundles |
30
29
  | `/team-api <runId> <op>` | State API interop |
31
30
  | `/team-metrics [filter]` | View metrics |
31
+ | `/schedules [log <jobId-or-name>]` | List scheduled jobs (`log` tails the latest run output) |
32
32
  | `/team-manager` | Interactive helper |
33
+ | `/team-cleanup-menu` | Alias for `/team-manager` (interactive menu) |
33
34
  | `/team-dashboard` | Live dashboard overlay |
34
35
  | `/team-init [options]` | Initialize the project layout |
35
36
  | `/team-config [options]` | View or update config |
36
37
  | `/team-settings <subcmd>` | Manage config keys |
38
+ | `/skill-list [--json]` | List builtin skill templates |
39
+ | `/skill-create <template-id> [--var key=value] [--project]` | Create a skill from a builtin template |
37
40
  | `/team-autonomy <subcmd>` | Manage delegation |
38
41
  | `/team-validate` | Validate resources |
39
42
  | `/team-help` | Help text |
@@ -43,7 +46,8 @@ Slash commands are manual actions triggered from the Pi chat. Autonomous tool us
43
46
  | **`/workflows`** | **v0.9.0** List static + dynamic workflows (`.dwf.ts`) |
44
47
  | `/crew-view <runId> <taskId>` | Open an agent's live full-screen transcript view (thin alias for the inline-panel pane wiring; never switches sessions) |
45
48
  | `/crew-back` | Close the agent transcript view and return to the main conversation |
46
- | `/team-vibes [on\|off\|speed on\|off\|capacity on\|off]` | Toggle crew-vibes speed + context meters (on/off, speed, capacity) |
49
+ | `/team-vibes [on\|off]` | Toggle the provider-quota status |
50
+ | `/crew-brief [on\|off\|status]` | Toggle brief mode for crew `team`/`agent` tool output |
47
51
 
48
52
  **Removed (v0.10.1 docs hygiene):** `/team-orchestrate`, `/team-schedule`,
49
53
  `/team-scheduled`, `/team-search`, `/team-graph` — phantom entries; none of
@@ -1,6 +1,6 @@
1
1
  # Troubleshooting
2
2
 
3
- Common problems and their fixes. If you hit an error code (E001–E012), see the
3
+ Common problems and their fixes. If you hit an error code (E001–E013), see the
4
4
  [Error codes](#error-codes) table below.
5
5
 
6
6
  ## Quick health check
@@ -130,7 +130,7 @@ team action='status' details=false # compact: status, progress, goal, issues o
130
130
 
131
131
  ## Error codes
132
132
 
133
- pi-crew uses a structured error taxonomy (E001–E012). Each error renders its
133
+ pi-crew uses a structured error taxonomy (E001–E013). Each error renders its
134
134
  code + a help hint inline. Common ones:
135
135
 
136
136
  | Code | Name | Meaning | First check |
@@ -147,6 +147,7 @@ code + a help hint inline. Common ones:
147
147
  | E010 | EventLogLockTimeout | event log locked under contention | transient; retry, or lower concurrency |
148
148
  | E011 | DepthLimitExceeded | crew nesting too deep | raise `crew.maxDepth` or flatten the call |
149
149
  | E012 | RunStale | run reconciled as stale | see "Stale async process" above |
150
+ | E013 | ModelOutOfScope | requested model not in pi's `enabledModels` allowlist | pick a model listed in `enabledModels` (settings.json) or disable `reliability.scopeModels` |
150
151
 
151
152
  ## Still stuck
152
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-crew",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
5
  "author": "baphuongna",
6
6
  "license": "MIT",
@@ -53,10 +53,8 @@
53
53
  "docs/usage.md",
54
54
  "docs/architecture.md",
55
55
  "docs/dynamic-workflows.md",
56
- "docs/runtime-flow.md",
57
56
  "docs/resource-formats.md",
58
57
  "docs/publishing.md",
59
- "docs/migration-v0.4-v0.5.md",
60
58
  "tsconfig.json",
61
59
  "schema.json",
62
60
  "types/",
package/schema.json CHANGED
@@ -344,6 +344,11 @@
344
344
  "minimum": 1,
345
345
  "maximum": 50
346
346
  },
347
+ "inlinePanel": {
348
+ "type": "boolean",
349
+ "default": true,
350
+ "description": "Show the inline agent panel above the editor (editor-wrapper agent rows)."
351
+ },
347
352
  "powerbar": {
348
353
  "type": "boolean"
349
354
  },
@@ -377,6 +382,11 @@
377
382
  "type": "boolean",
378
383
  "default": true
379
384
  },
385
+ "autoCloseDashboardMs": {
386
+ "type": "integer",
387
+ "minimum": 0,
388
+ "description": "Auto-close delay for the run dashboard once the run reaches a terminal state (ms)."
389
+ },
380
390
  "showModel": {
381
391
  "type": "boolean",
382
392
  "default": true,
@@ -509,6 +519,35 @@
509
519
  "minimum": 1,
510
520
  "maximum": 90,
511
521
  "default": 7
522
+ },
523
+ "webhook": {
524
+ "type": "object",
525
+ "additionalProperties": false,
526
+ "sensitive": true,
527
+ "description": "US-030: opt-in outbound webhook on run terminal transitions (completed/failed/cancelled). SENSITIVE — user config only; a project-level webhook URL would let an untrusted repo exfiltrate run metadata. Disabled by default (no URL = zero network calls).",
528
+ "properties": {
529
+ "url": {
530
+ "type": "string",
531
+ "minLength": 1,
532
+ "pattern": "^https?://",
533
+ "description": "Target URL. Must be http(s); localhost/127.0.0.0-8/[::1]/169.254.0.0-16/fe80::-10 targets are refused unless allowLocalhost is true."
534
+ },
535
+ "enabled": {
536
+ "type": "boolean",
537
+ "description": "Master switch. Defaults to true when url is set; false disables (zero network)."
538
+ },
539
+ "secret": {
540
+ "type": "string",
541
+ "minLength": 1,
542
+ "description": "Shared secret — sets x-pi-crew-signature: sha256=<hmac-sha256(body, secret)> on every POST."
543
+ },
544
+ "allowLocalhost": {
545
+ "type": "boolean",
546
+ "description": "Explicit SSRF-guard bypass for loopback/link-local targets (e.g. a local test receiver). Default false.",
547
+ "default": false
548
+ }
549
+ },
550
+ "required": ["url"]
512
551
  }
513
552
  }
514
553
  },
@@ -37,6 +37,8 @@ This artifact exists so past runs are verifiable (see SKILL.md "Output report").
37
37
  | 10a surface E2E | ✅/❌/⏭️ | tmux 3/3 (spawn+self-close / kill-pane→degrade / doctor orphan) + herdr 3/3 — or skip reason per backend (no `$TMUX`/CI/no socket/in tmux for herdr) |
38
38
  | 10b live surface run | ✅/❌/⏭️ | `visibleAgents='<set>'`, pane ids+titles during run, `worker.surface_spawned`/`worker.surface_closed` events (+ no `surface.degraded`), panes auto-closed. NOTE: `manifest.surface.panes` is `{}` at run END even on success (released on pane close) — engage-evidence is the EVENTS + `manifest.surface.provider`/`workerPids` |
39
39
  | 10c herdr path | ✅/❌/⏭️ | ran in herdr pane / skipped (not in herdr pane) |
40
+ | 12 resource contracts | ✅/❌/⏭️ | 12a contracts `<pass>/<tests>` · 12b agents `<n>` / bad desc `0` / no routing `0` / strict-YAML fails `0` · 12c rendered agent lines `<n>`, all with `useWhen=` (budget-truncated by design) · 12d `<pass>/<tests>` |
41
+ | 13 real-run UI render | ✅/❌/⏭️ | runId `<id>` (real run, NOT fixtures); surfaces rendered: `<list>`; states: running/done/failed/focused/idle/narrow; invariant sweep `undefined` 0 · retired glyph 0 · `->` 0 · wire-format 0 · invented word 0 · bad plural 0; glyph-vs-state: spinner only while running ✅; hint survives @`<min width>` ✅; formats consistent (duration/usage/runId) ✅; catalog regenerated + 1 PNG inspected ✅ |
40
42
  | 11 remediation regression | ✅/❌/⏭️ | sub-checks run + evidence: 11a buffered-site census `<n>` files (full test:unit `<pass>/<tests>` if run) · 11b wc-gate max `<n>`/2000 + in `ci` · 11c validator warn `<key>` → severity · 11d slow tier 3 files disjoint · 11e nightly SMOKE not-set · 11f reject format sites · 11g widgetPlacement bottom · 11h twins 3× green · 11i dead-export 0 + MUST_INCLUDE 5 · 11j committed-hash OK |
41
43
 
42
44
  Legend: ✅ pass with evidence · ❌ fail (root cause below) · ⏭️ skipped (justify why)