pi-crew 0.10.5 → 0.11.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.
Files changed (128) hide show
  1. package/CHANGELOG.md +292 -0
  2. package/agents/analyst.md +37 -2
  3. package/agents/cold-verifier.md +10 -1
  4. package/agents/councillor-critic.md +39 -0
  5. package/agents/councillor-pragmatist.md +39 -0
  6. package/agents/councillor-skeptic.md +41 -0
  7. package/agents/critic.md +40 -2
  8. package/agents/designer.md +58 -0
  9. package/agents/executor.md +39 -2
  10. package/agents/explorer.md +38 -2
  11. package/agents/librarian.md +49 -0
  12. package/agents/oracle.md +54 -0
  13. package/agents/orchestrator.md +48 -0
  14. package/agents/planner.md +41 -2
  15. package/agents/reviewer.md +39 -2
  16. package/agents/security-reviewer.md +43 -2
  17. package/agents/test-engineer.md +48 -2
  18. package/agents/verifier.md +14 -1
  19. package/agents/writer.md +32 -2
  20. package/dist/index.mjs +35196 -34789
  21. package/package.json +170 -169
  22. package/scripts/watch-agent-transcript.mjs +120 -0
  23. package/skills/async-worker-recovery/SKILL.md +4 -1
  24. package/skills/child-pi-spawning/SKILL.md +4 -1
  25. package/skills/context-artifact-hygiene/SKILL.md +4 -1
  26. package/skills/council/SKILL.md +24 -45
  27. package/skills/delegation-patterns/SKILL.md +18 -1
  28. package/skills/distill-persona/SKILL.md +4 -1
  29. package/skills/distill-software/SKILL.md +4 -1
  30. package/skills/event-log-tracing/SKILL.md +4 -1
  31. package/skills/git-master/SKILL.md +4 -1
  32. package/skills/iterative-audit/SKILL.md +4 -1
  33. package/skills/live-agent-lifecycle/SKILL.md +4 -1
  34. package/skills/mailbox-interactive/SKILL.md +4 -1
  35. package/skills/model-routing-context/SKILL.md +10 -1
  36. package/skills/multi-perspective-review/SKILL.md +18 -1
  37. package/skills/observability-reliability/SKILL.md +4 -1
  38. package/skills/orchestration/SKILL.md +18 -1
  39. package/skills/ownership-session-security/SKILL.md +4 -1
  40. package/skills/pi-extension-lifecycle/SKILL.md +4 -1
  41. package/skills/post-mortem/SKILL.md +4 -1
  42. package/skills/read-only-explorer/SKILL.md +4 -1
  43. package/skills/real-test-pi-crew/SKILL.md +165 -12
  44. package/skills/requirements-to-task-packet/SKILL.md +10 -1
  45. package/skills/research/SKILL.md +4 -1
  46. package/skills/resource-discovery-config/SKILL.md +10 -1
  47. package/skills/runtime-state-reader/SKILL.md +4 -1
  48. package/skills/safe-bash/SKILL.md +4 -1
  49. package/skills/scrutinize/SKILL.md +24 -1
  50. package/skills/secure-agent-orchestration-review/SKILL.md +4 -1
  51. package/skills/state-mutation-locking/SKILL.md +4 -1
  52. package/skills/systematic-debugging/SKILL.md +4 -1
  53. package/skills/verification-before-done/SKILL.md +18 -1
  54. package/skills/widget-rendering/SKILL.md +4 -1
  55. package/skills/workspace-isolation/SKILL.md +4 -1
  56. package/skills/worktree-isolation/SKILL.md +4 -1
  57. package/src/config/config-validation.ts +1 -0
  58. package/src/config/types.ts +8 -0
  59. package/src/errors.ts +1 -1
  60. package/src/extension/context-status-injection.ts +2 -2
  61. package/src/extension/crew-input-router.ts +2 -0
  62. package/src/extension/crew-vibes/config.ts +1 -56
  63. package/src/extension/crew-vibes/figures.ts +5 -84
  64. package/src/extension/crew-vibes/font-detect.ts +1 -1
  65. package/src/extension/crew-vibes/index.ts +36 -328
  66. package/src/extension/crew-vibes/render.ts +2 -58
  67. package/src/extension/help.ts +1 -0
  68. package/src/extension/knowledge-injection.ts +19 -7
  69. package/src/extension/post-init-skill-check.ts +32 -0
  70. package/src/extension/register.ts +9 -1
  71. package/src/extension/registration/command-registration.ts +5 -1
  72. package/src/extension/registration/commands/schedules.ts +212 -0
  73. package/src/extension/registration/commands/shared.ts +56 -1
  74. package/src/extension/registration/hook-registration.ts +20 -3
  75. package/src/extension/registration/lifecycle-handlers.ts +16 -2
  76. package/src/extension/registration/schedule-toast-bridge.ts +109 -0
  77. package/src/extension/registration/tool-loop-guard.ts +243 -0
  78. package/src/extension/registration/viewers.ts +66 -1
  79. package/src/extension/team-tool/handle-schedule.ts +120 -1
  80. package/src/extension/team-tool/handle-settings.ts +10 -0
  81. package/src/extension/team-tool/run.ts +42 -1
  82. package/src/extension/team-tool-types.ts +6 -0
  83. package/src/prompt/prompt-runtime.ts +25 -6
  84. package/src/runtime/async-runner.ts +75 -11
  85. package/src/runtime/background-runner.ts +41 -0
  86. package/src/runtime/broker/crew-broker-client.ts +45 -2
  87. package/src/runtime/broker/crew-broker.ts +22 -27
  88. package/src/runtime/broker/protocol/request-parsers.ts +10 -2
  89. package/src/runtime/broker/stdin-handshake.ts +87 -0
  90. package/src/runtime/broker/wait-push.ts +45 -0
  91. package/src/runtime/detached-run-results.ts +25 -1
  92. package/src/runtime/foreground-watchdog.ts +24 -5
  93. package/src/runtime/live-session/live-session-runtime.ts +1 -1
  94. package/src/runtime/model/model-scope.ts +2 -2
  95. package/src/runtime/run-tracker.ts +65 -11
  96. package/src/runtime/scheduling/scheduler.ts +120 -6
  97. package/src/runtime/settings-store.ts +28 -2
  98. package/src/runtime/skill-instructions.ts +20 -4
  99. package/src/runtime/task-runner/child-executor.ts +1 -1
  100. package/src/runtime/task-runner/prompt-builder.ts +22 -9
  101. package/src/schema/config-schema.ts +1 -0
  102. package/src/skills/discover-skills.ts +2 -2
  103. package/src/state/coordination/locks.ts +17 -2
  104. package/src/ui/agents-jobs-browser.ts +785 -0
  105. package/src/ui/dashboard-panes/agents-pane.ts +7 -4
  106. package/src/ui/dashboard-panes/schedules-pane.ts +154 -0
  107. package/src/ui/inline-panel/crew-editor.ts +19 -6
  108. package/src/ui/inline-panel/index.ts +6 -0
  109. package/src/ui/key-utils.ts +3 -0
  110. package/src/ui/keybinding-map.ts +56 -2
  111. package/src/ui/mascot.ts +2 -1
  112. package/src/ui/overlays/agent-picker-overlay.ts +3 -3
  113. package/src/ui/overlays/confirm-overlay.ts +3 -2
  114. package/src/ui/overlays/mailbox-compose-overlay.ts +4 -3
  115. package/src/ui/overlays/mailbox-detail-overlay.ts +3 -3
  116. package/src/ui/run-dashboard.ts +257 -6
  117. package/src/ui/settings-overlay.ts +43 -3
  118. package/src/ui/transcript-viewer.ts +3 -2
  119. package/src/ui/widget/index.ts +61 -88
  120. package/src/ui/widget/widget-formatters.ts +7 -4
  121. package/src/ui/widget/widget-renderer.ts +134 -174
  122. package/src/ui/widget/widget-types.ts +0 -7
  123. package/src/utils/frontmatter.ts +7 -1
  124. package/src/utils/ndjson.ts +9 -1
  125. package/src/utils/relative-time.ts +33 -0
  126. package/src/extension/crew-vibes/footer.ts +0 -313
  127. package/src/extension/crew-vibes/speed.ts +0 -286
  128. package/src/ui/dock-footer.ts +0 -49
package/package.json CHANGED
@@ -1,171 +1,172 @@
1
1
  {
2
- "name": "pi-crew",
3
- "version": "0.10.5",
4
- "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
- "author": "baphuongna",
6
- "license": "MIT",
7
- "engines": {
8
- "node": ">=22.0.0"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/baphuongna/pi-crew.git"
13
- },
14
- "homepage": "https://github.com/baphuongna/pi-crew#readme",
15
- "bugs": {
16
- "url": "https://github.com/baphuongna/pi-crew/issues"
17
- },
18
- "type": "module",
19
- "bin": {
20
- "pi-crew": "install.mjs"
21
- },
22
- "keywords": [
23
- "pi-package",
24
- "pi",
25
- "pi-coding-agent",
26
- "teams",
27
- "agents",
28
- "multi-agent",
29
- "orchestration"
30
- ],
31
- "files": [
32
- "src/",
33
- "!src/benchmark",
34
- "dist/index.mjs",
35
- "index.ts",
36
- "install.mjs",
37
- "agents/",
38
- "teams/",
39
- "workflows/",
40
- "skills/**",
41
- "themes/",
42
- "assets/crew-vibes.ttf",
43
- "scripts/clean-strip-types.mjs",
44
- "scripts/postinstall.mjs",
45
- "scripts/install-crew-vibes-font.mjs",
46
- "scripts/build-crew-vibes-font.py",
47
- "scripts/pty_probe.py",
48
- "README.md",
49
- "AGENTS.md",
50
- "docs/actions-reference.md",
51
- "docs/commands-reference.md",
52
- "docs/troubleshooting.md",
53
- "docs/usage.md",
54
- "docs/architecture.md",
55
- "docs/dynamic-workflows.md",
56
- "docs/runtime-flow.md",
57
- "docs/resource-formats.md",
58
- "docs/publishing.md",
59
- "docs/migration-v0.4-v0.5.md",
60
- "tsconfig.json",
61
- "schema.json",
62
- "types/",
63
- "CHANGELOG.md",
64
- "LICENSE",
65
- "NOTICE.md",
66
- "scripts/resource-sampler.mjs",
67
- "scripts/analyze-run.mjs"
68
- ],
69
- "scripts": {
70
- "check": "npm run ci",
71
- "ci": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm test && npm pack --dry-run",
72
- "ci:fast": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm run test:critical && npm pack --dry-run",
73
- "check:lockfile-sync": "node scripts/check-lockfile-sync.mjs",
74
- "check:lazy-imports": "node scripts/check-lazy-imports.mjs",
75
- "check:bundle-staleness": "node scripts/check-bundle-staleness.mjs",
76
- "check:bundle-size": "node scripts/check-bundle-size.mjs",
77
- "check:conflict-markers": "node scripts/check-conflict-markers.mjs",
78
- "check:decision-drift": "node scripts/check-decision-drift.mjs",
79
- "check:env-vars": "node scripts/check-env-vars.mjs",
80
- "check:event-types": "node scripts/check-event-types-registry.mjs",
81
- "typecheck": "tsc --noEmit && node --experimental-strip-types -e \"await import('./index.ts'); console.log('strip-types import ok')\"",
82
- "lint": "biome check --linter-enabled=true --formatter-enabled=false --max-diagnostics=50 .",
83
- "format:check": "biome format .",
84
- "test": "npm run test:unit && npm run test:integration",
85
- "test:full": "npm run test:unit && npm run test:integration && npm run test:integration:slow",
86
- "test:unit": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=180000 --test-force-exit 'test/unit/**/*.test.ts'",
87
- "test:critical": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 --test-force-exit test/unit/runtime/broker/crew-broker-handshake.test.ts test/unit/runtime/broker/crew-broker-stale-socket.test.ts test/unit/runtime/broker/crew-broker-feature-flag.test.ts test/unit/runtime/broker/crew-broker-server-gate.test.ts test/unit/runtime/broker/crew-broker-client-fallback.test.ts test/unit/runtime/broker/crew-broker-mailbox-observer.test.ts test/unit/runtime/broker/crew-broker-close-during-reconnect.test.ts test/unit/runtime/broker/crew-broker-steer-dedup.test.ts test/unit/runtime/broker/crew-broker-symlink-steering.test.ts test/unit/ui/keybinding-map.parity.test.ts test/unit/ui/pi-tui-dispatch-probe.test.ts test/unit/utils/session-utils-extract.test.ts test/unit/config/config-schema-sync.test.ts test/unit/runtime/child-pi/child-pi-env-spread.test.ts",
88
- "test:watch": "node scripts/test-runner.mjs --watch --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
89
- "test:integration": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=300000 test/integration/*.test.ts",
90
- "test:integration:slow": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=600000 test/integration/slow/*.test.ts",
91
- "test:system": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 --test-force-exit test/system/*.e2e.test.ts",
92
- "test:smoke": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 test/smoke/*.smoke.ts",
93
- "test:spike": "node scripts/test-runner.mjs --test-concurrency=2 --test-timeout=120000 --test-force-exit test/runtime/scratchpad/*.test.ts",
94
- "test:functional": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=120000 test/functional/pi-crew-functional.test.ts",
95
- "test:platform": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=60000 test/platform/*.test.ts",
96
- "build:bundle": "node scripts/build-bundle.mjs",
97
- "test:bundle": "node --experimental-strip-types --test --test-force-exit test/unit/bundle-load.test.ts",
98
- "watch:bundle": "node scripts/watch-bundle.mjs",
99
- "build:bundle:once": "node scripts/watch-bundle.mjs --once",
100
- "dev": "node scripts/dev-runner.mjs",
101
- "postinstall": "node scripts/postinstall.mjs",
102
- "install:crew-font": "node scripts/install-crew-vibes-font.mjs",
103
- "build:crew-font": "python scripts/build-crew-vibes-font.py",
104
- "bench": "node scripts/run-bench.mjs",
105
- "bench:check": "node scripts/bench-check.mjs",
106
- "test:new": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
107
- "test:changed": "node scripts/test-changed.mjs",
108
- "bench:capture": "node scripts/run-bench.mjs && node -e \"require('node:fs').copyFileSync('test/bench/results.json','test/bench/baseline.json')\"",
109
- "profile:startup": "node scripts/profile-startup.mjs",
110
- "smoke:pi": "pi install .",
111
- "smoke:release": "node scripts/release-smoke.mjs",
112
- "prepack": "node scripts/clean-strip-types.mjs",
113
- "test:fast": "npm run test:critical && npm run test:bundle",
114
- "check:wc-gate": "node scripts/wc-gate.mjs"
115
- },
116
- "exports": {
117
- "./schema.json": "./schema.json",
118
- "./workflow": {
119
- "types": "./types/dwf.d.ts"
120
- }
121
- },
122
- "pi": {
123
- "extensions": [
124
- "./index.ts"
125
- ],
126
- "skills": [
127
- "./skills"
128
- ]
129
- },
130
- "peerDependencies": {
131
- "@earendil-works/pi-agent-core": "*",
132
- "@earendil-works/pi-ai": "*",
133
- "@earendil-works/pi-coding-agent": "*",
134
- "@earendil-works/pi-tui": "*"
135
- },
136
- "dependencies": {
137
- "@sinclair/typebox": "^0.34.50",
138
- "acorn": "^8.17.0",
139
- "ajv": "^8.20.0",
140
- "cli-highlight": "^2.1.11",
141
- "diff": "^5.2.0",
142
- "esbuild": "^0.28.1",
143
- "jiti": "^2.7.0",
144
- "yaml": "^2.9.0"
145
- },
146
- "devDependencies": {
147
- "@biomejs/biome": "^2.5.3",
148
- "@earendil-works/pi-agent-core": "^0.84.0",
149
- "@earendil-works/pi-ai": "^0.84.0",
150
- "@earendil-works/pi-coding-agent": "^0.84.0",
151
- "@earendil-works/pi-tui": "^0.84.0",
152
- "@types/node": "^25.9.5",
153
- "tsx": "^4.23.0",
154
- "typescript": "^7.0.2"
155
- },
156
- "peerDependenciesMeta": {
157
- "@earendil-works/pi-agent-core": {
158
- "optional": true
159
- },
160
- "@earendil-works/pi-ai": {
161
- "optional": true
162
- },
163
- "@earendil-works/pi-coding-agent": {
164
- "optional": true
165
- },
166
- "@earendil-works/pi-tui": {
167
- "optional": true
168
- }
169
- },
170
- "readmeFilename": "README.md"
2
+ "name": "pi-crew",
3
+ "version": "0.11.0",
4
+ "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
+ "author": "baphuongna",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=22.0.0"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/baphuongna/pi-crew.git"
13
+ },
14
+ "homepage": "https://github.com/baphuongna/pi-crew#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/baphuongna/pi-crew/issues"
17
+ },
18
+ "type": "module",
19
+ "bin": {
20
+ "pi-crew": "install.mjs"
21
+ },
22
+ "keywords": [
23
+ "pi-package",
24
+ "pi",
25
+ "pi-coding-agent",
26
+ "teams",
27
+ "agents",
28
+ "multi-agent",
29
+ "orchestration"
30
+ ],
31
+ "files": [
32
+ "src/",
33
+ "!src/benchmark",
34
+ "dist/index.mjs",
35
+ "index.ts",
36
+ "install.mjs",
37
+ "agents/",
38
+ "teams/",
39
+ "workflows/",
40
+ "skills/**",
41
+ "themes/",
42
+ "assets/crew-vibes.ttf",
43
+ "scripts/clean-strip-types.mjs",
44
+ "scripts/postinstall.mjs",
45
+ "scripts/install-crew-vibes-font.mjs",
46
+ "scripts/build-crew-vibes-font.py",
47
+ "scripts/pty_probe.py",
48
+ "README.md",
49
+ "AGENTS.md",
50
+ "docs/actions-reference.md",
51
+ "docs/commands-reference.md",
52
+ "docs/troubleshooting.md",
53
+ "docs/usage.md",
54
+ "docs/architecture.md",
55
+ "docs/dynamic-workflows.md",
56
+ "docs/runtime-flow.md",
57
+ "docs/resource-formats.md",
58
+ "docs/publishing.md",
59
+ "docs/migration-v0.4-v0.5.md",
60
+ "tsconfig.json",
61
+ "schema.json",
62
+ "types/",
63
+ "CHANGELOG.md",
64
+ "LICENSE",
65
+ "NOTICE.md",
66
+ "scripts/resource-sampler.mjs",
67
+ "scripts/analyze-run.mjs",
68
+ "scripts/watch-agent-transcript.mjs"
69
+ ],
70
+ "scripts": {
71
+ "check": "npm run ci",
72
+ "ci": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm test && npm pack --dry-run",
73
+ "ci:fast": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm run test:critical && npm pack --dry-run",
74
+ "check:lockfile-sync": "node scripts/check-lockfile-sync.mjs",
75
+ "check:lazy-imports": "node scripts/check-lazy-imports.mjs",
76
+ "check:bundle-staleness": "node scripts/check-bundle-staleness.mjs",
77
+ "check:bundle-size": "node scripts/check-bundle-size.mjs",
78
+ "check:conflict-markers": "node scripts/check-conflict-markers.mjs",
79
+ "check:decision-drift": "node scripts/check-decision-drift.mjs",
80
+ "check:env-vars": "node scripts/check-env-vars.mjs",
81
+ "check:event-types": "node scripts/check-event-types-registry.mjs",
82
+ "typecheck": "tsc --noEmit && node --experimental-strip-types -e \"await import('./index.ts'); console.log('strip-types import ok')\"",
83
+ "lint": "biome check --linter-enabled=true --formatter-enabled=false --max-diagnostics=50 .",
84
+ "format:check": "biome format .",
85
+ "test": "npm run test:unit && npm run test:integration",
86
+ "test:full": "npm run test:unit && npm run test:integration && npm run test:integration:slow",
87
+ "test:unit": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=180000 --test-force-exit 'test/unit/**/*.test.ts'",
88
+ "test:critical": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 --test-force-exit test/unit/runtime/broker/crew-broker-handshake.test.ts test/unit/runtime/broker/crew-broker-stale-socket.test.ts test/unit/runtime/broker/crew-broker-feature-flag.test.ts test/unit/runtime/broker/crew-broker-server-gate.test.ts test/unit/runtime/broker/crew-broker-client-fallback.test.ts test/unit/runtime/broker/crew-broker-mailbox-observer.test.ts test/unit/runtime/broker/crew-broker-close-during-reconnect.test.ts test/unit/runtime/broker/crew-broker-steer-dedup.test.ts test/unit/runtime/broker/crew-broker-symlink-steering.test.ts test/unit/ui/keybinding-map.parity.test.ts test/unit/ui/pi-tui-dispatch-probe.test.ts test/unit/utils/session-utils-extract.test.ts test/unit/config/config-schema-sync.test.ts test/unit/runtime/child-pi/child-pi-env-spread.test.ts",
89
+ "test:watch": "node scripts/test-runner.mjs --watch --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
90
+ "test:integration": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=300000 test/integration/*.test.ts",
91
+ "test:integration:slow": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=600000 test/integration/slow/*.test.ts",
92
+ "test:system": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 --test-force-exit test/system/*.e2e.test.ts",
93
+ "test:smoke": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 test/smoke/*.smoke.ts",
94
+ "test:spike": "node scripts/test-runner.mjs --test-concurrency=2 --test-timeout=120000 --test-force-exit test/runtime/scratchpad/*.test.ts",
95
+ "test:functional": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=120000 test/functional/pi-crew-functional.test.ts",
96
+ "test:platform": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=60000 test/platform/*.test.ts",
97
+ "build:bundle": "node scripts/build-bundle.mjs",
98
+ "test:bundle": "node --experimental-strip-types --test --test-force-exit test/unit/bundle-load.test.ts",
99
+ "watch:bundle": "node scripts/watch-bundle.mjs",
100
+ "build:bundle:once": "node scripts/watch-bundle.mjs --once",
101
+ "dev": "node scripts/dev-runner.mjs",
102
+ "postinstall": "node scripts/postinstall.mjs",
103
+ "install:crew-font": "node scripts/install-crew-vibes-font.mjs",
104
+ "build:crew-font": "python scripts/build-crew-vibes-font.py",
105
+ "bench": "node scripts/run-bench.mjs",
106
+ "bench:check": "node scripts/bench-check.mjs",
107
+ "test:new": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
108
+ "test:changed": "node scripts/test-changed.mjs",
109
+ "bench:capture": "node scripts/run-bench.mjs && node -e \"require('node:fs').copyFileSync('test/bench/results.json','test/bench/baseline.json')\"",
110
+ "profile:startup": "node scripts/profile-startup.mjs",
111
+ "smoke:pi": "pi install .",
112
+ "smoke:release": "node scripts/release-smoke.mjs",
113
+ "prepack": "node scripts/clean-strip-types.mjs",
114
+ "test:fast": "npm run test:critical && npm run test:bundle",
115
+ "check:wc-gate": "node scripts/wc-gate.mjs"
116
+ },
117
+ "exports": {
118
+ "./schema.json": "./schema.json",
119
+ "./workflow": {
120
+ "types": "./types/dwf.d.ts"
121
+ }
122
+ },
123
+ "pi": {
124
+ "extensions": [
125
+ "./index.ts"
126
+ ],
127
+ "skills": [
128
+ "./skills"
129
+ ]
130
+ },
131
+ "peerDependencies": {
132
+ "@earendil-works/pi-agent-core": "*",
133
+ "@earendil-works/pi-ai": "*",
134
+ "@earendil-works/pi-coding-agent": "*",
135
+ "@earendil-works/pi-tui": "*"
136
+ },
137
+ "dependencies": {
138
+ "@sinclair/typebox": "^0.34.50",
139
+ "acorn": "^8.17.0",
140
+ "ajv": "^8.20.0",
141
+ "cli-highlight": "^2.1.11",
142
+ "diff": "^5.2.0",
143
+ "esbuild": "^0.28.1",
144
+ "jiti": "^2.7.0",
145
+ "yaml": "^2.9.0"
146
+ },
147
+ "devDependencies": {
148
+ "@biomejs/biome": "^2.5.3",
149
+ "@earendil-works/pi-agent-core": "^0.84.0",
150
+ "@earendil-works/pi-ai": "^0.84.0",
151
+ "@earendil-works/pi-coding-agent": "^0.84.0",
152
+ "@earendil-works/pi-tui": "^0.84.0",
153
+ "@types/node": "^25.9.5",
154
+ "tsx": "^4.23.0",
155
+ "typescript": "^7.0.2"
156
+ },
157
+ "peerDependenciesMeta": {
158
+ "@earendil-works/pi-agent-core": {
159
+ "optional": true
160
+ },
161
+ "@earendil-works/pi-ai": {
162
+ "optional": true
163
+ },
164
+ "@earendil-works/pi-coding-agent": {
165
+ "optional": true
166
+ },
167
+ "@earendil-works/pi-tui": {
168
+ "optional": true
169
+ }
170
+ },
171
+ "readmeFilename": "README.md"
171
172
  }
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+ // Watch a pi session transcript (JSONL stream events) and print one readable
3
+ // line per message — the "session subagent" pane companion for the Agents &
4
+ // Jobs browser (`p` key). Unlike `tail -F` on the raw file, every line here is
5
+ // a formatted summary (role badge + preview), so a tmux/herdr pane shows WHAT
6
+ // the agent is doing, not walls of JSON.
7
+ //
8
+ // Usage: node watch-agent-transcript.mjs <transcript.jsonl>
9
+ import { open as openFile } from "node:fs/promises";
10
+ import { basename } from "node:path";
11
+
12
+ const path = process.argv[2];
13
+ if (!path) {
14
+ console.error("usage: node watch-agent-transcript.mjs <transcript.jsonl>");
15
+ process.exit(1);
16
+ }
17
+
18
+ const WIDTH = Math.min(200, Number(process.env.COLUMNS || 160) || 160);
19
+
20
+ function oneLine(text) {
21
+ return String(text ?? "")
22
+ .replace(/\s+/g, " ")
23
+ .trim();
24
+ }
25
+
26
+ function clip(text, max = WIDTH - 10) {
27
+ const s = oneLine(text);
28
+ return s.length > max ? `${s.slice(0, max - 1)}…` : s;
29
+ }
30
+
31
+ function stamp(iso) {
32
+ const m = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/.exec(iso ?? "");
33
+ return m ? `${m[2]}` : "";
34
+ }
35
+
36
+ function renderEvent(evt) {
37
+ if (evt.type === "session") return "── session start ──";
38
+ if (evt.type === "agent_start") return "── agent start ──";
39
+ if (evt.type !== "message_end" || !evt.message) return null;
40
+ const msg = evt.message;
41
+ const who =
42
+ msg.role === "assistant" ? "🤖" : msg.role === "user" ? "👤" : msg.role === "toolResult" ? "📤" : (msg.role ?? "?");
43
+ const parts = Array.isArray(msg.content) ? msg.content : [{ type: "text", text: String(msg.content ?? "") }];
44
+ const out = [];
45
+ for (const part of parts) {
46
+ if (part.type === "thinking") out.push(`💭 ${clip(part.thinking, 120)}`);
47
+ else if (part.type === "text") out.push(`💬 ${clip(part.text)}`);
48
+ else if (part.type === "tool_use") {
49
+ const input = typeof part.input === "object" ? JSON.stringify(part.input) : String(part.input ?? "");
50
+ out.push(`🔧 ${part.name ?? "tool"} ${clip(input, 100)}`);
51
+ } else if (part.type === "tool_result") {
52
+ const content = typeof part.content === "string" ? part.content : JSON.stringify(part.content ?? "");
53
+ out.push(`📤 ${clip(content, 120)}`);
54
+ }
55
+ }
56
+ if (out.length === 0) return null;
57
+ return `${stamp(evt.timestamp ?? msg.timestamp) || " "} ${who} ${out.join(" │ ")}`;
58
+ }
59
+
60
+ // Clear the pane first — herdr/tmux panes boot via the shell, so the echoed
61
+ // prompt + full node command would otherwise sit above the watcher output.
62
+ process.stdout.write("\x1b[2J\x1b[H");
63
+ console.log(`── watching ${basename(path)} ──`);
64
+
65
+ let offset = 0;
66
+ let buffer = "";
67
+ const POLL_MS = 400;
68
+ let waitingSince = 0;
69
+ let lastWaitingLog = 0;
70
+
71
+ function logWaiting(now) {
72
+ if (!waitingSince) waitingSince = now;
73
+ if (now - lastWaitingLog >= 2500) {
74
+ const waitedS = Math.round((now - waitingSince) / 1000);
75
+ console.log(`… waiting for ${basename(path)} to appear (${waitedS}s)`);
76
+ lastWaitingLog = now;
77
+ }
78
+ }
79
+
80
+ async function pump() {
81
+ try {
82
+ const fh = await openFile(path, "r");
83
+ try {
84
+ const stat = await fh.stat();
85
+ if (waitingSince) {
86
+ console.log(`✓ transcript appeared (waited ${Math.round((Date.now() - waitingSince) / 1000)}s)`);
87
+ waitingSince = 0;
88
+ }
89
+ if (stat.size < offset) offset = 0; // truncated/rotated
90
+ if (stat.size > offset) {
91
+ const len = stat.size - offset;
92
+ const buf = Buffer.alloc(len);
93
+ await fh.read(buf, 0, len, offset);
94
+ offset += len;
95
+ buffer += buf.toString("utf8");
96
+ const lines = buffer.split("\n");
97
+ buffer = lines.pop() ?? "";
98
+ for (const line of lines) {
99
+ const trimmed = line.trim();
100
+ if (!trimmed) continue;
101
+ try {
102
+ const rendered = renderEvent(JSON.parse(trimmed));
103
+ if (rendered) console.log(rendered);
104
+ } catch {
105
+ console.log(`· ${clip(trimmed)}`);
106
+ }
107
+ }
108
+ }
109
+ } finally {
110
+ await fh.close();
111
+ }
112
+ } catch {
113
+ // File not there yet (cold-start window): visible waiting state so the
114
+ // pane explains itself instead of looking dead.
115
+ logWaiting(Date.now());
116
+ }
117
+ }
118
+
119
+ setInterval(pump, POLL_MS);
120
+ await pump();
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: async-worker-recovery
3
- description: Background worker, heartbeat, stale-run, crash-recovery, and deadletter workflow. Use when debugging stuck/dead workers or changing async run reliability.
3
+ description: >
4
+ Background worker, heartbeat, stale-run, crash-recovery, and deadletter workflow. Use when debugging stuck/dead workers or changing async run reliability.
5
+ When NOT to use: pure investigation without async context (use read-only-explorer); one-shot fixes that don't need recovery infrastructure.
6
+
4
7
  origin: pi-crew
5
8
  triggers:
6
9
  - "worker crashed"
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: child-pi-spawning
3
- description: "Child Pi worker spawning, lifecycle callbacks, and failure modes."
3
+ description: >
4
+ Child Pi worker spawning, lifecycle callbacks, and failure modes.
5
+ When NOT to use: non-Pi subprocess execution (use safe-bash); for general async reliability (use async-worker-recovery).
6
+
4
7
  origin: pi-crew
5
8
  triggers:
6
9
  - "worker crashed"
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: context-artifact-hygiene
3
- description: "Use when constructing worker prompts, reading artifacts/logs, summarizing runs, compacting context, or handing work between agents."
3
+ description: >
4
+ Use when constructing worker prompts, reading artifacts/logs, summarizing runs, compacting context, or handing work between agents.
5
+ When NOT to use: tasks without artifact/context concerns; pure code questions (use read-only-explorer).
6
+
4
7
  origin: pi-crew
5
8
  triggers:
6
9
  - "construct prompt"
@@ -5,7 +5,7 @@ description: >
5
5
  architecture choice, or plan. Anti-anchoring: each role receives ONLY the question,
6
6
  not conversation history. Aggregates votes into consensus recommendation with dissent tracking.
7
7
  Use when facing critical decisions, architecture choices, security tradeoffs, or plan reviews
8
- where single-perspective analysis is insufficient.
8
+ where single-perspective analysis is insufficient. When NOT to use: trivial choices where consensus adds no value; time-critical decisions that can't afford 3 parallel reviews.
9
9
  origin: ECC/skills/council
10
10
  ---
11
11
 
@@ -46,58 +46,23 @@ DO NOT bias the question toward any particular answer.
46
46
 
47
47
  ### Step 2: Spawn 3 Council Members
48
48
 
49
- Launch 3 parallel subagents with these EXACT roles:
49
+ Launch 3 parallel subagents, one per seat, using the councillor agents:
50
50
 
51
- **Skeptic** (Goal: Find flaws):
52
- ```
53
- You are the Skeptic on a council evaluating: [QUESTION]
54
-
55
- Your role: Find every possible flaw, risk, and failure mode.
56
- - Challenge assumptions
57
- - Identify edge cases that break the proposed approach
58
- - Focus on what could go WRONG
59
- - Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
60
- - Provide your top 3 risks
61
-
62
- Output format:
63
- Position: PRO | CON | ABSTAIN
64
- Confidence: 0.0-1.0
65
- Reasoning: [your analysis]
66
- Top 3 Risks: [list]
67
- ```
51
+ - **Skeptic** (finds flaws) → `subagent_type='councillor-skeptic'`
52
+ - **Pragmatist** (weighs tradeoffs) → `subagent_type='councillor-pragmatist'`
53
+ - **Critic** (stress-tests reasoning) → `subagent_type='councillor-critic'`
68
54
 
69
- **Pragmatist** (Goal: Evaluate tradeoffs):
70
- ```
71
- You are the Pragmatist on a council evaluating: [QUESTION]
55
+ Each subagent's prompt is EXACTLY the question text from Step 1 — nothing else, no context preamble, no your-opinion-matters framing.
72
56
 
73
- Your role: Weigh practical tradeoffs objectively.
74
- - Consider implementation cost, maintenance burden, team impact
75
- - Evaluate time-to-value and opportunity cost
76
- - Compare against realistic alternatives
77
- - Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
57
+ The seat perspective, output contract (Position/Confidence/Reasoning + seat-specific field), and anti-anchoring are baked into the agent files. The councillor agents carry `inheritProjectContext: false`, so isolation is STRUCTURAL (enforced at spawn), not merely instructed — do not wrap the question with your own framing or history.
78
58
 
79
- Output format:
80
- Position: PRO | CON | ABSTAIN
81
- Confidence: 0.0-1.0
82
- Reasoning: [your analysis]
83
- Alternatives Considered: [list]
84
- ```
59
+ All three seats return the shared vote block:
85
60
 
86
- **Critic** (Goal: Stress-test reasoning):
87
61
  ```
88
- You are the Critic on a council evaluating: [QUESTION]
89
-
90
- Your role: Stress-test the logical foundations of each possible answer.
91
- - Identify logical fallacies in common arguments for/against
92
- - Check if the question itself contains hidden assumptions
93
- - Evaluate whether the stated constraints are real or assumed
94
- - Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
95
-
96
- Output format:
97
62
  Position: PRO | CON | ABSTAIN
98
63
  Confidence: 0.0-1.0
99
- Reasoning: [your analysis]
100
- Hidden Assumptions: [list]
64
+ Reasoning: <analysis>
65
+ <Seat-specific field: Top 3 Risks | Alternatives Considered | Hidden Assumptions>
101
66
  ```
102
67
 
103
68
  ### Step 3: Aggregate Votes
@@ -161,3 +126,17 @@ Before finalizing a council result, verify:
161
126
  - [ ] Consensus level computed from vote pattern
162
127
  - [ ] Dissent explicitly documented (not hidden)
163
128
  - [ ] Recommendation includes actionable next steps
129
+
130
+ ## Budget
131
+
132
+ This skill applies a 3-attempt budget: 1 initial + max 2 re-attempts.
133
+
134
+ Stamp every invocation:
135
+
136
+ ```
137
+ attempt X of 3 (Y attempts remaining)
138
+ ```
139
+
140
+ An attempt is one full council round (3 adversarial agents → aggregate → consensus). Re-attempt when votes deadlock or dissent reveals information the first round missed.
141
+
142
+ Re-attempts only when the previous attempt materially changes the decision or risk. Do NOT spend a re-attempt on mechanical changes or already-resolved findings. When exhausted, escalate to the user with options (accept risk / change scope / exceptional budget).
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: delegation-patterns
3
- description: "Subagent/team delegation workflow."
3
+ description: >
4
+ Subagent/team delegation workflow.
5
+ When NOT to use: pure read-only investigation (use read-only-explorer); pre-planning analysis (use scrutinize).
6
+
4
7
  origin: pi-crew
5
8
  triggers:
6
9
  - "delegate this"
@@ -118,3 +121,17 @@ npx tsc --noEmit
118
121
  node --experimental-strip-types --test test/unit/team-recommendation.test.ts test/unit/task-output-context-security.test.ts test/integration/phase3-runtime.test.ts
119
122
  npm test
120
123
  ```
124
+
125
+ ## Budget
126
+
127
+ This skill applies a 3-attempt budget: 1 initial + max 2 re-attempts.
128
+
129
+ Stamp every invocation:
130
+
131
+ ```
132
+ attempt X of 3 (Y attempts remaining)
133
+ ```
134
+
135
+ An attempt is one delegation decision (choose agent/team → dispatch → collect). Re-attempt when the delegation target fails or returns unusable output.
136
+
137
+ Re-attempts only when the previous attempt materially changes the decision or risk. Do NOT spend a re-attempt on mechanical changes or already-resolved findings. When exhausted, escalate to the user with options (accept risk / change scope / exceptional budget).