pi-crew 0.11.7 → 0.11.9

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 (66) hide show
  1. package/.githooks/pre-commit +22 -0
  2. package/.githooks/pre-push +56 -0
  3. package/CHANGELOG.md +196 -1
  4. package/dist/index.mjs +533 -515
  5. package/docs/publishing.md +29 -0
  6. package/docs/usage.md +1 -1
  7. package/index.ts +3 -3
  8. package/install.mjs +4 -1
  9. package/package.json +8 -5
  10. package/scripts/install-hooks.mjs +32 -0
  11. package/skills/real-test-pi-crew/SKILL.md +57 -18
  12. package/src/config/config-validation.ts +8 -1
  13. package/src/config/defaults.ts +8 -1
  14. package/src/config/env-vars.ts +16 -1
  15. package/src/config/types.ts +28 -4
  16. package/src/extension/command-completions.ts +44 -22
  17. package/src/extension/registration/foreground-run-controller.ts +19 -10
  18. package/src/extension/registration/lifecycle-handlers.ts +6 -491
  19. package/src/extension/registration/lifecycle.ts +7 -90
  20. package/src/extension/registration/render-loop.ts +532 -0
  21. package/src/extension/team-tool/doctor.ts +6 -0
  22. package/src/extension/team-tool/handle-settings.ts +4 -1
  23. package/src/runtime/child-pi/child-pi-spawn.ts +7 -0
  24. package/src/runtime/child-pi/child-pi.ts +37 -2
  25. package/src/runtime/child-pi/pi-version.ts +187 -0
  26. package/src/runtime/classifier/classifier-service.ts +298 -0
  27. package/src/runtime/dispatch-batch.ts +4 -0
  28. package/src/runtime/live-session/live-session-runtime.ts +31 -0
  29. package/src/runtime/model/pi-args.ts +62 -3
  30. package/src/runtime/process/zombie-scanner.ts +168 -7
  31. package/src/runtime/rpc/README.md +64 -25
  32. package/src/runtime/rpc/rpc-worker.ts +146 -26
  33. package/src/runtime/run-worker.ts +89 -15
  34. package/src/runtime/scheduling/run-coalesced-task-group.ts +3 -0
  35. package/src/runtime/skill-instructions.ts +66 -1
  36. package/src/runtime/surface/resolve-surface.ts +34 -19
  37. package/src/runtime/task-runner/child-executor.ts +132 -0
  38. package/src/runtime/task-runner/pre-execution.ts +8 -0
  39. package/src/runtime/task-runner.ts +6 -0
  40. package/src/schema/config-schema.ts +20 -8
  41. package/src/schema/team-tool-schema.ts +4 -2
  42. package/src/state/contracts.ts +5 -0
  43. package/src/ui/dashboard-panes/agents-pane.ts +3 -2
  44. package/src/ui/dashboard-panes/health-pane.ts +6 -1
  45. package/src/ui/dashboard-panes/mailbox-pane.ts +12 -7
  46. package/src/ui/dashboard-panes/plan-pane.ts +5 -2
  47. package/src/ui/dashboard-panes/progress-pane.ts +8 -2
  48. package/src/ui/format-helpers.ts +11 -0
  49. package/src/ui/live-conversation-overlay.ts +5 -3
  50. package/src/ui/live-duration.ts +5 -4
  51. package/src/ui/live-run-sidebar.ts +90 -20
  52. package/src/ui/overlays/mailbox-compose-overlay.ts +31 -1
  53. package/src/ui/rail.ts +14 -1
  54. package/src/ui/run-action-dispatcher.ts +2 -1
  55. package/src/ui/run-dashboard.ts +62 -22
  56. package/src/ui/run-snapshot-cache.ts +32 -0
  57. package/src/ui/settings-overlay.ts +36 -3
  58. package/src/ui/tool-renderers/brief-mode.ts +2 -2
  59. package/src/ui/transcript-viewer.ts +4 -1
  60. package/src/ui/widget/index.ts +10 -2
  61. package/src/ui/widget/task-list.ts +22 -7
  62. package/src/ui/widget/widget-model.ts +5 -4
  63. package/src/ui/widget/widget-renderer.ts +212 -37
  64. package/src/utils/relative-time.ts +11 -3
  65. package/src/utils/socket-path.ts +48 -8
  66. package/src/utils/visual.ts +32 -2
@@ -60,11 +60,41 @@ export function __test__visibleWidthCacheSize(): number {
60
60
  function consumeAnsi(input: string, index: number): number {
61
61
  const char = input[index];
62
62
  if (!char || char !== "\u001b") return 0;
63
- if (input[index + 1] !== "[") return 0;
63
+ const next = input[index + 1];
64
+ if (next === "[") {
65
+ let i = index + 2;
66
+ while (i < input.length) {
67
+ const code = input.charCodeAt(i);
68
+ if (code >= 0x40 && code <= 0x7e) return i - index + 1;
69
+ i++;
70
+ }
71
+ return 0;
72
+ }
73
+ // R3-9: OSC sequences (`ESC ] … BEL` or `ESC ] … ESC \`) — OSC-8 hyperlinks
74
+ // (pi-tui `hyperlink()`, used by the crew widget) ride this branch. The
75
+ // truncation/wrap/sanitize helpers must treat the whole sequence as ONE
76
+ // zero-width unit, matching pi-tui's `visibleWidth` (which already strips
77
+ // OSC), or a clipped line would slice mid-escape and leak raw bytes into
78
+ // the terminal. Malformed payloads (stray control char) fall back to the
79
+ // pre-existing behaviour of treating the ESC as ordinary data.
80
+ //
81
+ // U6/DR4 (pi 1.0.4 adoption, 2026-10-06): APC sequences (`ESC _ … BEL` or
82
+ // `ESC _ … ESC \`) share the exact same grammar, so they ride the same
83
+ // scanner. pi-tui's `CURSOR_MARKER` — now a documented public contract —
84
+ // is an APC string (`\u001b_pi:c\u0007`) that focused components emit at
85
+ // the cursor position. Without this branch, truncateToWidth/wrapHard
86
+ // walked the marker's `_pi:c` payload as ordinary text (~6 visible
87
+ // columns) and could slice the sequence in half; with it, the whole
88
+ // marker is consumed as ONE zero-width unit, matching pi-tui's
89
+ // `visibleWidth` (which already zero-widths APC). Same malformed fallback:
90
+ // a stray control char cannot belong to an OSC/APC payload either.
91
+ if (next !== "]" && next !== "_") return 0;
64
92
  let i = index + 2;
65
93
  while (i < input.length) {
66
94
  const code = input.charCodeAt(i);
67
- if (code >= 0x40 && code <= 0x7e) return i - index + 1;
95
+ if (code === 0x07) return i - index + 1; // BEL terminator
96
+ if (code === 0x1b && input[i + 1] === "\\") return i - index + 2; // ST terminator
97
+ if (code < 0x20) return 0; // control char cannot belong to an OSC/APC payload
68
98
  i++;
69
99
  }
70
100
  return 0;