pi-crew 0.10.3 → 0.10.5

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 (64) hide show
  1. package/AGENTS.md +2 -1
  2. package/CHANGELOG.md +40 -0
  3. package/README.md +5 -1
  4. package/dist/index.mjs +10684 -6883
  5. package/docs/architecture.md +4 -4
  6. package/docs/commands-reference.md +3 -0
  7. package/docs/publishing.md +15 -3
  8. package/install.mjs +90 -39
  9. package/package.json +8 -3
  10. package/scripts/README.md +4 -3
  11. package/skills/real-test-pi-crew/REPORT-TEMPLATE.md +1 -0
  12. package/skills/real-test-pi-crew/SKILL.md +153 -6
  13. package/src/config/migration-validator.ts +113 -0
  14. package/src/extension/cross-extension-rpc.ts +3 -7
  15. package/src/extension/register.ts +13 -0
  16. package/src/extension/registration/observability.ts +3 -7
  17. package/src/extension/registration/subagent-tools.ts +3 -7
  18. package/src/extension/registration/team-tool.ts +3 -7
  19. package/src/extension/registration/ui.ts +3 -8
  20. package/src/extension/registration/viewers.ts +3 -10
  21. package/src/extension/team-manager-command.ts +3 -7
  22. package/src/extension/team-tool/api/agent-control.ts +17 -10
  23. package/src/extension/team-tool/api/heartbeat.ts +4 -3
  24. package/src/extension/team-tool/api/mailbox.ts +33 -20
  25. package/src/extension/team-tool/api/plan-approval.ts +5 -5
  26. package/src/extension/team-tool/api/task-claims.ts +8 -7
  27. package/src/extension/team-tool/cancel.ts +6 -0
  28. package/src/extension/team-tool/handle-settings.ts +4 -1
  29. package/src/extension/team-tool/run.ts +3 -7
  30. package/src/extension/team-tool/status.ts +5 -0
  31. package/src/extension/team-tool.ts +6 -14
  32. package/src/hooks/registry.ts +3 -0
  33. package/src/prompt/scratchpad-lifecycle.ts +3 -3
  34. package/src/runtime/background-runner.ts +62 -42
  35. package/src/runtime/broker/crew-broker.ts +112 -441
  36. package/src/runtime/broker/delegate/delegate-event.ts +37 -0
  37. package/src/runtime/broker/mailbox-observer/mailbox-fanout.ts +59 -0
  38. package/src/runtime/broker/protocol/connection-state.ts +103 -0
  39. package/src/runtime/broker/protocol/events-replay.ts +68 -0
  40. package/src/runtime/broker/protocol/manifest-loader.ts +20 -0
  41. package/src/runtime/broker/protocol/msg-inbox.ts +69 -0
  42. package/src/runtime/broker/protocol/request-parsers.ts +175 -0
  43. package/src/runtime/broker/protocol/wait-auth.ts +46 -0
  44. package/src/runtime/child-pi/child-pi.ts +15 -0
  45. package/src/runtime/finalize-run.ts +15 -7
  46. package/src/runtime/foreground-control.ts +19 -6
  47. package/src/runtime/goal-workflow/dynamic-workflow-context.ts +6 -0
  48. package/src/runtime/goal-workflow/dynamic-workflow-runner.ts +3 -0
  49. package/src/runtime/goal-workflow/goal-loop-runner.ts +29 -27
  50. package/src/runtime/goal-workflow/goal-state-store.ts +3 -0
  51. package/src/runtime/heartbeat/heartbeat-watcher.ts +3 -3
  52. package/src/runtime/model/pi-args.ts +6 -1
  53. package/src/runtime/plan-replan.ts +3 -0
  54. package/src/runtime/run-tracker.ts +9 -8
  55. package/src/runtime/stale-reconciler.ts +28 -3
  56. package/src/runtime/supervisor-contact.ts +3 -0
  57. package/src/runtime/task-runner/child-executor.ts +33 -0
  58. package/src/runtime/team-runner.ts +3 -3
  59. package/src/state/stores/ownership-map.ts +5 -4
  60. package/src/state/stores/plan-store.ts +12 -0
  61. package/src/state/stores/state-store.ts +5 -0
  62. package/src/ui/powerbar-publisher.ts +3 -7
  63. package/src/ui/run-action-dispatcher.ts +7 -10
  64. package/src/ui/settings-overlay.ts +4 -1
package/AGENTS.md CHANGED
@@ -69,7 +69,8 @@ npm test
69
69
 
70
70
  - `src/extension/team-tool.ts` — main tool actions
71
71
  - `src/runtime/team-runner.ts` — workflow scheduler
72
- - `src/runtime/task-runner.ts` — task execution and artifacts
72
+ - `src/runtime/task-runner.ts` + `src/runtime/task-runner/` — task execution and artifacts (thin entry + phase modules: pre-execution, child-executor, post-execution, …)
73
+ - `src/runtime/child-pi/` — child Pi process runtime (spawn/streams/kill/steering/timers/transcript modules)
73
74
  - `src/state/` — durable state/event/artifact store
74
75
  - `src/worktree/` — worktree creation and cleanup
75
76
  - `agents/`, `teams/`, `workflows/` — builtin resources
package/CHANGELOG.md CHANGED
@@ -2,6 +2,46 @@
2
2
 
3
3
  > **Note:** `atomic-write-v2.ts` / `AtomicWriter` mentioned in historical entries below was consolidated into `atomic-write.ts` as of v0.9.42. This changelog is preserved as historical record — the migration was completed (the v2 class was never adopted; v1 won on simplicity + symlink-safety + link+unlink atomicity). See `docs/migration/atomic-write-v2-migration.md` for the decision rationale.
4
4
 
5
+ ## [0.10.5] — user-scope runs: waitForRun + background diagnostics (2026-09-11)
6
+
7
+ ### fix: RUN/WAIT instantly errored "Run not found" for user-scope runs (#54)
8
+
9
+ `waitForRun`'s slow-path attempt-0 probe joined `projectCrewRoot(cwd)`
10
+ (`<cwd>/.crew/state/runs/…`) to test run-directory existence. But runs created in
11
+ a **markerless (non-git) cwd** are routed to **user scope**
12
+ (`userCrewRoot()` = `~/.pi/agent/extensions/pi-crew/`) by `createRunPaths` →
13
+ `scopeBaseRoot` — the exact scope resolution `loadRunManifestById` uses when
14
+ reading. Result: the run executed fine (STATUS/STEER/SUMMARY all worked), while
15
+ `team action=run` and every `team action=wait` **instantly** threw
16
+ `Run not found` — so the agent believed the crew had failed and duplicated the
17
+ work itself while it kept running in the background. Reproduced from the #54
18
+ transcript (artifact paths under `~/.pi/agent/extensions/pi-crew/artifacts/…`).
19
+
20
+ - The probe now resolves through the exported, pure `createRunPaths(cwd,
21
+ runId).stateRoot` — the same scope-aware resolver used at run creation, so
22
+ project scope (incl. the `.pi/teams/` fallback, issue #29) and user scope
23
+ both resolve correctly.
24
+ - Regression test: user-scope run in a markerless cwd (isolated
25
+ `PI_TEAMS_HOME`) — the waiter must poll through the user-scope dir and
26
+ resolve on terminal status instead of throwing.
27
+ - Same-family fix (#55, also in this release): `background-runner.ts` computed
28
+ `background.log` + `exit-code.txt` paths via `projectCrewRoot` too, so those
29
+ diagnostics silently went missing for user-scope runs — degrading exactly
30
+ the crash evidence needed to diagnose them. Both sites now resolve via the
31
+ exported `backgroundLogPath()` / `backgroundExitCodePath()` helpers built on
32
+ `createRunPaths` (scope-aware; runId boundary hardening preserved). Ships as
33
+ source — no dist rebuild needed for this half.
34
+
35
+ ### test: macOS ENOTEMPTY teardown race — shared `teardownCwd` helper
36
+
37
+ Third and fourth occurrence of the class (CI runs 34557602253 / 34558219451:
38
+ `resume-checkpoint`, `wait-request-broker`): a run's last artifact writes race
39
+ the recursive `rmSync` in test teardown — `rimrafSync` throws ENOTEMPTY when a
40
+ file lands between its unlink pass and a directory rmdir. Extracted the
41
+ 5×200ms sleepSync retry (previously copy-pasted in resume-cancel `8197f054`
42
+ and role-tools-integration `6a271822`) into `test/fixtures/teardown-cwd.ts`
43
+ and switched both affected files to it.
44
+
5
45
  ## [0.10.3] — MuxSurface: workers in real panes + per-team-run tabs (2026-09-01)
6
46
 
7
47
  128 commits since v0.10.2. The headline feature is **MuxSurface A1** (spec
package/README.md CHANGED
@@ -698,7 +698,11 @@ the `goal` action's completion-guarantee loop to builtin workflows.
698
698
 
699
699
  | Key path | Type | Default | Description |
700
700
  |----------|------|---------|-------------|
701
- | `ui.widgetPlacement` | `aboveEditor \| belowEditor` | `aboveEditor` | Where the status widget renders. |
701
+ | `ui.widgetPlacement` | `aboveEditor \| belowEditor \| bottom` | `bottom` | Where the status widget renders. `bottom` docks inside the crew-vibes footer (very bottom of the screen), falling back to `belowEditor` when no footer sink exists. |
702
+ | `ui.widgetRowStyle` | `compact \| detailed` | `compact` | Per-agent row layout in the widget (`compact` = one width-budgeted line per agent; `detailed` = two-line tree). |
703
+ | `ui.inlinePanel` | `boolean` | `true` | Keyboard-navigable agent rows under the prompt (`↓` from an empty prompt). Yields to any extension that owns the editor component. |
704
+ | `ui.refreshMs` | `number` | `1000` | Internal UI refresh cadence default (not a user-settable `ui.*` schema key — kept here for completeness). |
705
+ | `ui.widgetDefaultFrameMs` | `number` | `1000` | Internal widget frame-budget default (not a user-settable `ui.*` schema key — kept here for completeness). |
702
706
  | `ui.widgetMaxLines` | `number` | `8` | Max lines shown by the widget. |
703
707
  | `ui.powerbar` | `boolean` | `true` | Show the power bar. |
704
708
  | `ui.dashboardPlacement` | `center \| right` | `center` | Dashboard screen position. |