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
@@ -3,25 +3,22 @@ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
3
3
  import type { handleTeamTool as HandleTeamToolFn } from "../extension/team-tool.ts";
4
4
  import type { MetricRegistry } from "../observability/metric-registry.ts";
5
5
 
6
- let _cachedHandleTeamTool: typeof HandleTeamToolFn | undefined;
7
6
  async function handleTeamTool(
8
7
  params: Parameters<typeof HandleTeamToolFn>[0],
9
8
  ctx: Parameters<typeof HandleTeamToolFn>[1],
10
9
  ): Promise<Awaited<ReturnType<typeof HandleTeamToolFn>>> {
11
- if (!_cachedHandleTeamTool) {
12
- // LAZY: avoid pulling team-tool.ts (and its entire runtime chain) into module load.
13
- const mod = await import("../extension/team-tool.ts");
14
- _cachedHandleTeamTool = mod.handleTeamTool;
15
- }
16
- return _cachedHandleTeamTool(params, ctx);
10
+ // LAZY: avoid pulling team-tool.ts (and its entire runtime chain) into module load.
11
+ const mod = await import("../extension/team-tool.ts");
12
+ return mod.handleTeamTool(params, ctx);
17
13
  }
18
14
 
19
15
  import { isToolError, textFromToolResult } from "../extension/tool-result.ts";
20
16
  import { readCrewAgents } from "../runtime/crew-agent-records.ts";
21
17
  import { exportDiagnostic } from "../runtime/diagnostic-export.ts";
22
18
  import type { MailboxDirection, MailboxMessage } from "../state/coordination/mailbox.ts";
23
- import { appendEvent } from "../state/event-log/event-log.ts";
19
+ import { appendEventBuffered } from "../state/event-log/event-log.ts";
24
20
  import { loadRunManifestById, saveRunTasks } from "../state/stores/state-store.ts";
21
+ import { logInternalError } from "../utils/internal-error.ts";
25
22
 
26
23
  export interface RunActionResult {
27
24
  ok: boolean;
@@ -141,12 +138,12 @@ export async function dispatchKillStaleWorkers(ctx: ExtensionContext, runId: str
141
138
  };
142
139
  });
143
140
  saveRunTasks(loaded.manifest, tasks);
144
- appendEvent(loaded.manifest.eventsPath, {
141
+ appendEventBuffered(loaded.manifest.eventsPath, {
145
142
  type: "worker.kill_stale",
146
143
  runId,
147
144
  message: `Marked ${count} stale worker heartbeat(s) dead.`,
148
145
  data: { count },
149
- });
146
+ }).catch((e) => logInternalError("run_action_dispatcher.buffered", e, "type=worker.kill_stale"));
150
147
  return {
151
148
  ok: true,
152
149
  message: `Marked ${count} stale worker heartbeat(s) dead.`,
@@ -345,7 +345,10 @@ const EFFECTIVE_DEFAULTS: Record<string, unknown> = {
345
345
  "ui.dashboardPlacement": "center",
346
346
  "ui.dashboardWidth": 72,
347
347
  "ui.autoOpenDashboard": false,
348
- "ui.widgetPlacement": "aboveEditor",
348
+ // G17 sync (2026-09-10 review): canonical DEFAULT_UI.widgetPlacement =
349
+ // "bottom" (defaults.ts / install.mjs / project-init) — was drifted
350
+ // "aboveEditor" in this duplicated EFFECTIVE_DEFAULTS map.
351
+ "ui.widgetPlacement": "bottom",
349
352
  "autonomous.enabled": true,
350
353
  "autonomous.injectPolicy": true,
351
354
  "autonomous.preferAsyncForLongTasks": false,