pi-subagents 0.81.0 → 0.82.1

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 (152) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +1 -1
  3. package/bundle/agents.js +3 -3
  4. package/bundle/child-tool-plan.js +2 -2
  5. package/bundle/{chunk-L5ZHE4L4.js → chunk-3JCDWF4V.js} +4 -4
  6. package/bundle/{chunk-LSRUTHT7.js → chunk-43SCHIMD.js} +1 -1
  7. package/bundle/{chunk-VJHOELQP.js → chunk-46XKCPJR.js} +193 -81
  8. package/bundle/{chunk-G5DKFLLI.js → chunk-4SDU2BZX.js} +15 -10
  9. package/bundle/{chunk-2ZSNH26H.js → chunk-4Y2ROR7L.js} +7 -7
  10. package/bundle/{chunk-V2JWDB5U.js → chunk-52UBALJL.js} +2 -2
  11. package/bundle/{chunk-3DC5KBVP.js → chunk-5TYMSZX3.js} +1 -1
  12. package/bundle/{chunk-NNLASTQE.js → chunk-6XJB7PIX.js} +20 -6
  13. package/bundle/{chunk-ZBC44JJ3.js → chunk-CIZQXJ5Q.js} +22 -9
  14. package/bundle/{chunk-KSWQVGDW.js → chunk-FXUXCX2K.js} +225 -18
  15. package/bundle/{chunk-563BHAZ5.js → chunk-G4GZD3OJ.js} +35 -26
  16. package/bundle/{chunk-ARRKBB2B.js → chunk-GJECHSAR.js} +2 -2
  17. package/bundle/{chunk-V3BIUPLU.js → chunk-IVAE5Z6Q.js} +256 -52
  18. package/bundle/{chunk-V6MR5TOQ.js → chunk-JYUKW2SY.js} +25 -19
  19. package/bundle/{chunk-BJN5LUQY.js → chunk-OYF6AFDY.js} +1 -1
  20. package/bundle/{chunk-CEKS3TFO.js → chunk-PBK2I7WY.js} +6 -6
  21. package/bundle/{chunk-TUWLXTAM.js → chunk-PDZWJCHD.js} +681 -320
  22. package/bundle/{chunk-EYNJ6VL6.js → chunk-PLCCBLPY.js} +2 -2
  23. package/bundle/{chunk-XMFLCKMQ.js → chunk-QE4AGIMG.js} +339 -132
  24. package/bundle/{chunk-74RT5YQE.js → chunk-RMQFMMAT.js} +123 -33
  25. package/bundle/{chunk-WSBNENFS.js → chunk-UCPP4GNU.js} +14 -4
  26. package/bundle/{chunk-2XYWN7QJ.js → chunk-UTT254JE.js} +2 -2
  27. package/bundle/{chunk-BPS2AGBZ.js → chunk-VSUSLDNW.js} +93 -52
  28. package/bundle/{chunk-ZP3HODFH.js → chunk-XSWOTIA3.js} +1 -1
  29. package/bundle/{chunk-3IF2PGW7.js → chunk-YKEWIB4M.js} +1 -1
  30. package/bundle/{chunk-26C3WLYQ.js → chunk-ZIV4J4HG.js} +498 -274
  31. package/bundle/control-channel.js +2 -2
  32. package/bundle/index.js +1 -1
  33. package/bundle/intercom-bridge.js +2 -2
  34. package/bundle/preflight.js +8 -8
  35. package/bundle/project-panes.js +3 -3
  36. package/docs/agents.md +37 -7
  37. package/docs/configuration.md +9 -1
  38. package/docs/tool-reference.md +3 -1
  39. package/docs/workflows.md +16 -0
  40. package/package.json +2 -2
  41. package/skills/council-mode/SKILL.md +1 -4
  42. package/skills/pi-subagents/SKILL.md +130 -107
  43. package/skills/pi-subagents/references/orchestration.md +124 -0
  44. package/skills/pi-subagents/references/prompting-and-roles.md +96 -295
  45. package/src/agents/agent-management.js +3 -3
  46. package/src/agents/agent-memory.js +3 -1
  47. package/src/agents/agents.js +6 -6
  48. package/src/agents/frontmatter.d.ts +2 -0
  49. package/src/agents/frontmatter.js +15 -1
  50. package/src/agents/skills.js +2 -1
  51. package/src/extension/config.js +3 -0
  52. package/src/extension/herdr-pi-bridge.js +17 -10
  53. package/src/extension/index.js +82 -2
  54. package/src/extension/reply-workflow-script.js +5 -2
  55. package/src/extension/schemas.js +3 -3
  56. package/src/extension/subagent-guide.js +1 -2
  57. package/src/intercom/native-supervisor-channel.js +20 -0
  58. package/src/missions/lifecycle.js +7 -1
  59. package/src/runs/background/active-async-capacity.d.ts +1 -0
  60. package/src/runs/background/active-async-capacity.js +9 -3
  61. package/src/runs/background/async-execution.js +20 -10
  62. package/src/runs/background/async-job-tracker.d.ts +6 -1
  63. package/src/runs/background/async-job-tracker.js +9 -4
  64. package/src/runs/background/async-status.d.ts +4 -0
  65. package/src/runs/background/async-status.js +22 -3
  66. package/src/runs/background/await-async-run.js +3 -7
  67. package/src/runs/background/boot-id.d.ts +12 -0
  68. package/src/runs/background/boot-id.js +47 -0
  69. package/src/runs/background/interrupted-elsewhere.d.ts +22 -0
  70. package/src/runs/background/interrupted-elsewhere.js +68 -0
  71. package/src/runs/background/notify.d.ts +2 -0
  72. package/src/runs/background/notify.js +13 -0
  73. package/src/runs/background/result-delivery-ownership.d.ts +6 -0
  74. package/src/runs/background/result-delivery-ownership.js +19 -1
  75. package/src/runs/background/result-watcher.d.ts +3 -1
  76. package/src/runs/background/result-watcher.js +24 -8
  77. package/src/runs/background/run-child-session.d.ts +1 -6
  78. package/src/runs/background/run-child-session.js +1 -1
  79. package/src/runs/background/run-status.js +2 -1
  80. package/src/runs/background/stale-run-reconciler.d.ts +25 -0
  81. package/src/runs/background/stale-run-reconciler.js +52 -13
  82. package/src/runs/background/subagent-runner-bootstrap.js +3 -0
  83. package/src/runs/background/subagent-runner.d.ts +4 -0
  84. package/src/runs/background/subagent-runner.js +13 -5
  85. package/src/runs/background/subagent-wait.d.ts +1 -1
  86. package/src/runs/background/subagent-wait.js +6 -1
  87. package/src/runs/background/terminal-run-index.d.ts +2 -0
  88. package/src/runs/background/terminal-run-index.js +44 -3
  89. package/src/runs/foreground/async-stop-action.js +3 -1
  90. package/src/runs/foreground/execution.js +6 -3
  91. package/src/runs/foreground/foreground-history.d.ts +16 -2
  92. package/src/runs/foreground/foreground-history.js +133 -31
  93. package/src/runs/foreground/subagent-executor.d.ts +11 -0
  94. package/src/runs/foreground/subagent-executor.js +277 -74
  95. package/src/runs/shared/child-launch.d.ts +2 -2
  96. package/src/runs/shared/child-session.d.ts +3 -2
  97. package/src/runs/shared/child-session.js +51 -8
  98. package/src/runs/shared/child-tool-plan.d.ts +7 -0
  99. package/src/runs/shared/child-tool-plan.js +21 -6
  100. package/src/runs/shared/herdr-connection.d.ts +17 -8
  101. package/src/runs/shared/herdr-connection.js +19 -7
  102. package/src/runs/shared/herdr-external-adapters.d.ts +3 -2
  103. package/src/runs/shared/herdr-external-adapters.js +1 -1
  104. package/src/runs/shared/herdr-machine.d.ts +12 -2
  105. package/src/runs/shared/herdr-machine.js +55 -9
  106. package/src/runs/shared/herdr-pane-host.d.ts +88 -0
  107. package/src/runs/shared/herdr-pane-host.js +155 -0
  108. package/src/runs/shared/herdr-placed-run.d.ts +27 -150
  109. package/src/runs/shared/herdr-placed-run.js +48 -395
  110. package/src/runs/shared/local-machine-access.d.ts +5 -0
  111. package/src/runs/shared/local-machine-access.js +28 -0
  112. package/src/runs/shared/orca-progress-tabs.d.ts +0 -1
  113. package/src/runs/shared/orca-progress-tabs.js +1 -24
  114. package/src/runs/shared/parallel-utils.d.ts +1 -1
  115. package/src/runs/shared/placed-run-owner.d.ts +49 -0
  116. package/src/runs/shared/placed-run-owner.js +93 -0
  117. package/src/runs/shared/placement-host.d.ts +99 -0
  118. package/src/runs/shared/placement-host.js +157 -0
  119. package/src/runs/shared/rex-machine.d.ts +25 -0
  120. package/src/runs/shared/rex-machine.js +83 -0
  121. package/src/runs/shared/rex-pane-host.d.ts +62 -0
  122. package/src/runs/shared/rex-pane-host.js +327 -0
  123. package/src/shared/completion-owner.d.ts +5 -0
  124. package/src/shared/completion-owner.js +5 -0
  125. package/src/shared/session-identity.d.ts +2 -0
  126. package/src/shared/session-identity.js +26 -0
  127. package/src/shared/types.d.ts +45 -6
  128. package/src/tui/fleet.d.ts +1 -0
  129. package/src/tui/fleet.js +25 -15
  130. package/src/tui/render.d.ts +6 -0
  131. package/src/tui/render.js +3 -3
  132. package/src/tui/subagent-messages.js +1 -0
  133. package/src/workflows/scripted-workflow.d.ts +1 -1
  134. package/src/workflows/workflow-auto-resume.d.ts +32 -0
  135. package/src/workflows/workflow-auto-resume.js +102 -0
  136. package/src/workflows/workflow-launch-record.d.ts +27 -0
  137. package/src/workflows/workflow-launch-record.js +48 -0
  138. package/src/workflows/workflow-resume-claim.d.ts +82 -0
  139. package/src/workflows/workflow-resume-claim.js +210 -0
  140. package/src/workflows/workflow-resume.d.ts +56 -0
  141. package/src/workflows/workflow-resume.js +106 -0
  142. package/src/workflows/workflow-reuse.d.ts +15 -9
  143. package/src/workflows/workflow-reuse.js +77 -14
  144. package/src/workflows/workflow-revival.d.ts +2 -0
  145. package/src/workflows/workflow-revival.js +2 -1
  146. package/src/workflows/workflow-stop-cause.d.ts +6 -0
  147. package/src/workflows/workflow-stop-cause.js +8 -0
  148. package/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  149. package/skills/pi-subagents/references/execution-controls.md +0 -563
  150. package/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  151. package/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  152. package/skills/pi-subagents/references/review-and-validation.md +0 -73
@@ -6,33 +6,35 @@ import {
6
6
  resolveWorkflowForegroundSteeringTarget,
7
7
  steerAsyncRun,
8
8
  steerWorkflowForegroundTarget
9
- } from "./chunk-CEKS3TFO.js";
9
+ } from "./chunk-PBK2I7WY.js";
10
10
  import {
11
11
  FLEET_STATUS_WIDGET_KEY,
12
12
  reportFleetWarning,
13
- runningTone
14
- } from "./chunk-2ZSNH26H.js";
13
+ runningTone,
14
+ stepTaskSummary
15
+ } from "./chunk-4Y2ROR7L.js";
15
16
  import {
17
+ foregroundChildStateLabel,
16
18
  formatAsyncRunTranscript,
17
19
  stopAsyncRun
18
- } from "./chunk-KSWQVGDW.js";
20
+ } from "./chunk-FXUXCX2K.js";
19
21
  import {
20
22
  contextModeBadge,
21
23
  contextModeLabel,
22
24
  decodeUtf8Tail,
23
25
  listAsyncRuns
24
- } from "./chunk-NNLASTQE.js";
25
- import "./chunk-VJHOELQP.js";
26
- import "./chunk-BJN5LUQY.js";
26
+ } from "./chunk-6XJB7PIX.js";
27
+ import "./chunk-46XKCPJR.js";
28
+ import "./chunk-OYF6AFDY.js";
27
29
  import "./chunk-NIXWDZZV.js";
28
- import "./chunk-ZP3HODFH.js";
30
+ import "./chunk-XSWOTIA3.js";
29
31
  import "./chunk-7F6RKT6W.js";
30
32
  import "./chunk-CTPAE36Y.js";
31
33
  import "./chunk-7J4ZXMY7.js";
32
34
  import {
33
35
  getArtifactPaths,
34
36
  getArtifactsDir
35
- } from "./chunk-3DC5KBVP.js";
37
+ } from "./chunk-5TYMSZX3.js";
36
38
  import {
37
39
  snapshotExternalRuns
38
40
  } from "./chunk-UKG4V45O.js";
@@ -44,7 +46,7 @@ import {
44
46
  formatTokens,
45
47
  readStatus,
46
48
  shortenPath
47
- } from "./chunk-ZBC44JJ3.js";
49
+ } from "./chunk-CIZQXJ5Q.js";
48
50
  import {
49
51
  DIRS
50
52
  } from "./chunk-5LFLVSTM.js";
@@ -203,18 +205,22 @@ function asyncItems(run, description) {
203
205
  if (run.steps.length === 0 || run.mode === "workflow") {
204
206
  return [{ key: `async:${run.id}`, kind: "async", runId: run.id, agent: run.mode, state: run.state, updatedAt, run, ...description ? { description } : {} }];
205
207
  }
206
- return run.steps.map((step) => ({
207
- key: `async:${run.id}:${step.index}`,
208
- kind: "async",
209
- runId: run.id,
210
- index: step.index,
211
- agent: step.label ? `${step.label} (${step.agent})` : step.agent,
212
- state: step.status,
213
- updatedAt: step.lastActivityAt ?? updatedAt,
214
- run,
215
- step,
216
- ...description ? { description } : {}
217
- }));
208
+ return run.steps.map((step) => {
209
+ const task = stepTaskSummary(step, step.agent);
210
+ return {
211
+ key: `async:${run.id}:${step.index}`,
212
+ kind: "async",
213
+ runId: run.id,
214
+ index: step.index,
215
+ agent: step.label ? `${step.label} (${step.agent})` : step.agent,
216
+ state: step.status,
217
+ updatedAt: step.lastActivityAt ?? updatedAt,
218
+ run,
219
+ step,
220
+ ...task ? { task } : {},
221
+ ...description ? { description } : {}
222
+ };
223
+ });
218
224
  }
219
225
  function orderFleetAsyncRuns(runs, terminalLimit, trackedJobs) {
220
226
  const updatedAt = (run) => run.lastUpdate ?? run.endedAt ?? run.startedAt;
@@ -296,7 +302,8 @@ function collectFleetSnapshot(state, options = {}) {
296
302
  ...state.currentSessionId ? { sessionId: state.currentSessionId } : {},
297
303
  entryLimit: MAX_FLEET_HISTORY_CANDIDATES,
298
304
  resultsDir: options.resultsDir ?? DIRS.results,
299
- reconcile: false
305
+ reconcile: false,
306
+ onCorruptStatus: (warning) => reportFleetWarning(state, warning)
300
307
  }).filter((run) => !trackedIds.has(run.id));
301
308
  runs = [...trackedRuns, ...history];
302
309
  } else {
@@ -503,7 +510,7 @@ function foregroundRecentDetail(item, state) {
503
510
  const lines = [
504
511
  `Run: ${item.runId}`,
505
512
  "Source: foreground",
506
- `State: ${child.status}`,
513
+ `State: ${foregroundChildStateLabel(run, child)}`,
507
514
  `Mode: ${run.mode}`,
508
515
  `Child: ${child.index} (${child.agent})${contextModeLabel(child.context) ? ` ${contextModeLabel(child.context)}` : ""}`,
509
516
  modelThinking ? `Model: ${modelThinking}` : void 0,
@@ -1179,8 +1186,10 @@ var SubagentFleetComponent = class {
1179
1186
  const item = this.snapshot.items[index];
1180
1187
  const marker = index === this.selected ? this.theme.fg("accent", "\u203A") : " ";
1181
1188
  const context = item.kind === "async" ? contextModeBadge(this.theme, item.step?.context ?? item.run.context) : item.kind === "foreground-recent" ? contextModeBadge(this.theme, item.child.context) : "";
1182
- const agent = index === this.selected ? this.theme.bold(item.agent) : item.agent;
1183
- const identity = item.runId.slice(0, 8);
1189
+ const task = item.kind === "async" ? item.task : void 0;
1190
+ const name = task && item.kind === "async" && item.step ? item.step.agent : item.agent;
1191
+ const agent = index === this.selected ? this.theme.bold(name) : name;
1192
+ const identity = task ?? item.runId.slice(0, 8);
1184
1193
  const left = `${marker} ${statusGlyph(item, this.theme)} ${agent}${context} ${this.theme.fg("dim", `\xB7 ${identity}`)}`;
1185
1194
  return rightAligned(left, this.theme.fg("dim", item.state), layout.roster.width);
1186
1195
  });
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-EYNJ6VL6.js";
3
+ } from "./chunk-PLCCBLPY.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-ZBC44JJ3.js";
7
+ } from "./chunk-CIZQXJ5Q.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {