pi-subagents 0.85.0 → 0.87.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 (97) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +2 -2
  4. package/bundle/{chunk-O7CPL6H4.js → chunk-2D2DQGC2.js} +9 -9
  5. package/bundle/{chunk-KZ34KQQH.js → chunk-2NY5PCKQ.js} +11 -5
  6. package/bundle/{chunk-PVIVCDG2.js → chunk-3CVOAS77.js} +2 -2
  7. package/bundle/{chunk-N7B2KD74.js → chunk-6O7YH2QV.js} +1 -1
  8. package/bundle/{chunk-IQIWF2VX.js → chunk-AIL46SZU.js} +8 -6
  9. package/bundle/{chunk-H2NLFTC5.js → chunk-BFF6YDK6.js} +1 -1
  10. package/bundle/{chunk-UX4SCV5N.js → chunk-C3KWLXDH.js} +159 -98
  11. package/bundle/{chunk-GCSLVFCX.js → chunk-C5QWQSSM.js} +1 -1
  12. package/bundle/{chunk-3UZ5FVVJ.js → chunk-DGTZKYIE.js} +39 -34
  13. package/bundle/{chunk-KDMFBYFM.js → chunk-ESWW6XSX.js} +1 -1
  14. package/bundle/{chunk-WOVMHDES.js → chunk-EYGBK6CE.js} +194 -94
  15. package/bundle/{chunk-CS4O36CZ.js → chunk-HDICKROY.js} +5 -5
  16. package/bundle/{chunk-DV2NCNPR.js → chunk-JLDQ6YUR.js} +12 -12
  17. package/bundle/{chunk-RQAUNAWG.js → chunk-LFKMM3UH.js} +2 -2
  18. package/bundle/{chunk-L2ENOFVZ.js → chunk-LZKVUWIY.js} +66 -26
  19. package/bundle/{chunk-RV5OGHLO.js → chunk-M2VBGET6.js} +2 -2
  20. package/bundle/{chunk-HFTBF7SG.js → chunk-OOE3R7IQ.js} +1 -1
  21. package/bundle/{chunk-JNXT3MPI.js → chunk-OTLDAYEQ.js} +5 -5
  22. package/bundle/{chunk-JWYG26RE.js → chunk-OZCPYJEY.js} +80 -37
  23. package/bundle/{chunk-LGMILZNE.js → chunk-PGU4TZV3.js} +79 -32
  24. package/bundle/{chunk-KEY3UQMQ.js → chunk-SIAQXPJ4.js} +6 -8
  25. package/bundle/{chunk-QO75KJBT.js → chunk-USRX7QXD.js} +2 -2
  26. package/bundle/{chunk-7MAE3DJV.js → chunk-VFUFOZBU.js} +1 -1
  27. package/bundle/{chunk-NF7IEKBH.js → chunk-W2BZS6UC.js} +27 -13
  28. package/bundle/{chunk-T5V5BRCL.js → chunk-W52LJANO.js} +1 -1
  29. package/bundle/{chunk-PHZP3KHB.js → chunk-XSDYTXHF.js} +18 -11
  30. package/bundle/{chunk-LTPH2DXH.js → chunk-XV7RTWTS.js} +3 -3
  31. package/bundle/{chunk-JO67XSKD.js → chunk-YEXKJJVS.js} +12 -7
  32. package/bundle/control-channel.js +2 -2
  33. package/bundle/index.js +1 -1
  34. package/bundle/intercom-bridge.js +2 -2
  35. package/bundle/preflight.js +12 -10
  36. package/bundle/project-panes.js +3 -3
  37. package/bundle/workflow-resources.js +1 -1
  38. package/docs/agents.md +9 -3
  39. package/docs/configuration.md +14 -6
  40. package/docs/extension-api.md +2 -0
  41. package/docs/models.md +6 -2
  42. package/docs/tool-reference.md +3 -0
  43. package/package.json +1 -1
  44. package/skills/pi-subagents/SKILL.md +7 -4
  45. package/skills/pi-subagents/references/prompting-and-roles.md +1 -0
  46. package/src/agents/agent-management.js +10 -6
  47. package/src/agents/agent-serializer.d.ts +2 -0
  48. package/src/agents/agent-serializer.js +1 -1
  49. package/src/agents/agents.js +37 -12
  50. package/src/api/preflight.d.ts +3 -1
  51. package/src/api/preflight.js +2 -0
  52. package/src/extension/index.js +4 -2
  53. package/src/extension/schemas.d.ts +2 -0
  54. package/src/extension/schemas.js +1 -0
  55. package/src/extension/tool-activation.js +10 -1
  56. package/src/extension/tool-description.d.ts +1 -1
  57. package/src/extension/tool-description.js +8 -8
  58. package/src/runs/background/async-execution.d.ts +2 -1
  59. package/src/runs/background/async-execution.js +4 -2
  60. package/src/runs/background/run-status.js +5 -4
  61. package/src/runs/background/runner-aliases.js +15 -0
  62. package/src/runs/background/subagent-runner.js +6 -6
  63. package/src/runs/background/wait-subscriptions.js +124 -12
  64. package/src/runs/foreground/async-stop-action.d.ts +1 -1
  65. package/src/runs/foreground/async-stop-action.js +9 -1
  66. package/src/runs/foreground/execution.js +1 -0
  67. package/src/runs/foreground/subagent-executor.d.ts +1 -0
  68. package/src/runs/foreground/subagent-executor.js +51 -8
  69. package/src/runs/shared/acceptance.js +69 -26
  70. package/src/runs/shared/child-session.d.ts +5 -4
  71. package/src/runs/shared/child-session.js +43 -33
  72. package/src/runs/shared/external-cli-contract.d.ts +49 -0
  73. package/src/runs/shared/external-cli-contract.js +18 -13
  74. package/src/runs/shared/herdr-placed-run.js +3 -2
  75. package/src/runs/shared/mcp-config-sources.d.ts +2 -1
  76. package/src/runs/shared/mcp-config-sources.js +1 -1
  77. package/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -1
  78. package/src/runs/shared/mcp-direct-tool-allowlist.js +5 -6
  79. package/src/runs/shared/model-resolution.d.ts +19 -4
  80. package/src/runs/shared/model-resolution.js +50 -51
  81. package/src/runs/shared/structured-output.js +10 -3
  82. package/src/shared/artifacts.js +25 -13
  83. package/src/shared/pruned-fork.js +2 -2
  84. package/src/shared/types.d.ts +71 -48
  85. package/src/tui/render.js +83 -22
  86. package/src/watchdog/model-selection.js +2 -2
  87. package/src/watchdog/review.js +2 -2
  88. package/src/workflows/scripted-workflow.d.ts +2 -0
  89. package/src/workflows/scripted-workflow.js +103 -39
  90. package/src/workflows/structured-workflow-scripts.d.ts +4 -3
  91. package/src/workflows/structured-workflow-scripts.js +32 -11
  92. package/src/workflows/workflow-receipt.js +36 -53
  93. package/src/workflows/workflow-resources.js +4 -4
  94. package/src/workflows/workflow-resume-claim.d.ts +2 -0
  95. package/src/workflows/workflow-resume-claim.js +1 -1
  96. package/src/workflows/workflow-resume.d.ts +1 -1
  97. package/src/workflows/workflow-resume.js +3 -1
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  rewriteSubagentPrompt
3
- } from "./chunk-JNXT3MPI.js";
3
+ } from "./chunk-OTLDAYEQ.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-HFTBF7SG.js";
6
+ } from "./chunk-OOE3R7IQ.js";
7
7
  import {
8
8
  WATCHDOG_DIFF_TOOL_NAME,
9
9
  captureWatchdogDiffBaseline,
10
10
  createWatchdogDiffTool
11
- } from "./chunk-IQIWF2VX.js";
12
- import "./chunk-LTPH2DXH.js";
13
- import "./chunk-T5V5BRCL.js";
11
+ } from "./chunk-AIL46SZU.js";
12
+ import "./chunk-XV7RTWTS.js";
13
+ import "./chunk-W52LJANO.js";
14
14
  import {
15
15
  MODEL_ONLY_TOOL
16
16
  } from "./chunk-HXRB42AF.js";
17
- import "./chunk-NF7IEKBH.js";
17
+ import "./chunk-W2BZS6UC.js";
18
18
  import {
19
19
  appendAgentRefinementOverlay
20
- } from "./chunk-QO75KJBT.js";
21
- import "./chunk-LGMILZNE.js";
20
+ } from "./chunk-USRX7QXD.js";
21
+ import "./chunk-PGU4TZV3.js";
22
22
  import "./chunk-NIXWDZZV.js";
23
- import "./chunk-KDMFBYFM.js";
23
+ import "./chunk-ESWW6XSX.js";
24
24
  import "./chunk-7F6RKT6W.js";
25
25
  import {
26
26
  assertNoToolModifierEntries
27
- } from "./chunk-KEY3UQMQ.js";
27
+ } from "./chunk-SIAQXPJ4.js";
28
28
  import "./chunk-CTPAE36Y.js";
29
- import "./chunk-PHZP3KHB.js";
29
+ import "./chunk-XSDYTXHF.js";
30
30
  import {
31
31
  HERDR_PI_MAX_FRAME_BYTES,
32
32
  HERDR_PI_PROTOCOL,
@@ -43,7 +43,7 @@ import {
43
43
  discoverAgents,
44
44
  resolveExistingReadPaths,
45
45
  resolveSkills
46
- } from "./chunk-UX4SCV5N.js";
46
+ } from "./chunk-C3KWLXDH.js";
47
47
  import "./chunk-JEZOSEWG.js";
48
48
  import "./chunk-YFCK7H2S.js";
49
49
  import "./chunk-QXASAHIA.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-QO75KJBT.js";
3
+ } from "./chunk-USRX7QXD.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-UX4SCV5N.js";
7
+ } from "./chunk-C3KWLXDH.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowChatProgressRows
3
- } from "./chunk-KZ34KQQH.js";
3
+ } from "./chunk-2NY5PCKQ.js";
4
4
  import {
5
5
  aggregateStepStatus,
6
6
  contextModeBadge,
@@ -21,7 +21,7 @@ import {
21
21
  projectAsyncWorkflowRows,
22
22
  projectWorkflowChecklist,
23
23
  workflowGraphStageNodes
24
- } from "./chunk-LTPH2DXH.js";
24
+ } from "./chunk-XV7RTWTS.js";
25
25
  import {
26
26
  isStaleExtensionContextError,
27
27
  isUnboundExtensionRuntimeError,
@@ -33,7 +33,7 @@ import {
33
33
  formatWorkflowJsonPreview,
34
34
  hostStepReportName,
35
35
  hostStepVerdictLabel
36
- } from "./chunk-LGMILZNE.js";
36
+ } from "./chunk-PGU4TZV3.js";
37
37
  import {
38
38
  snapshotExternalRuns
39
39
  } from "./chunk-UKG4V45O.js";
@@ -51,7 +51,7 @@ import {
51
51
  getSingleResultOutput,
52
52
  shortenPath,
53
53
  unresolvedChildWatchdogBlockers
54
- } from "./chunk-UX4SCV5N.js";
54
+ } from "./chunk-C3KWLXDH.js";
55
55
  import {
56
56
  MAX_WIDGET_JOBS,
57
57
  WIDGET_ANIMATION_INTERVAL_MS,
@@ -337,6 +337,27 @@ function compactTaskText(task, label) {
337
337
  if (!normalized) return void 0;
338
338
  return previewDisplayText(normalized, COMPACT_TASK_MAX_CHARS);
339
339
  }
340
+ var EXPANDED_TASK_MAX_LINES = 8;
341
+ function expandedTaskLines(task, label, width) {
342
+ const taskText = task?.trim();
343
+ if (!taskText || taskText === PROMPT_REDACTED || width <= 0) return void 0;
344
+ const shown = truncateDisplayText(taskText, EXPANDED_TASK_MAX_LINES * width);
345
+ const labelText = label?.trim() && label.trim() !== PROMPT_REDACTED ? sanitizeDisplayText(label) : "";
346
+ const head = labelText && labelText !== sanitizeDisplayText(shown) ? `${labelText} \u2014 ` : "";
347
+ const lines = [];
348
+ for (const rawLine of `task: ${head}${shown}`.split("\n")) {
349
+ const content = sanitizeDisplayText(rawLine);
350
+ if (!content) {
351
+ if (lines.length > 0 && lines[lines.length - 1] !== "") lines.push("");
352
+ continue;
353
+ }
354
+ const indent = rawLine.match(/^[ \t]*/)[0].replace(/\t/g, " ").slice(0, Math.floor(width / 2));
355
+ for (const part of wrapPlainText(content, width - indent.length)) lines.push(`${indent}${part}`);
356
+ if (lines.length > EXPANDED_TASK_MAX_LINES) break;
357
+ }
358
+ if (lines.length <= EXPANDED_TASK_MAX_LINES && shown.length === taskText.length) return lines;
359
+ return [...lines.slice(0, EXPANDED_TASK_MAX_LINES), "\u2026"];
360
+ }
340
361
  var LANE_VALUE_MAX_CHARS = 48;
341
362
  function boundedLaneValue(value, maxChars = LANE_VALUE_MAX_CHARS) {
342
363
  if (!value?.trim() || value.trim() === PROMPT_REDACTED) return void 0;
@@ -1400,14 +1421,14 @@ function widgetStepActivity(step, snapshotNow) {
1400
1421
  if (activity) return activity;
1401
1422
  return facts.join(" \xB7 ");
1402
1423
  }
1403
- function widgetChainDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1424
+ function widgetChainDetails(job, theme, expanded = false, width = getTermWidth(), frame, fullTask = false) {
1404
1425
  if (!job.steps?.length) return [];
1405
1426
  const total = job.chainStepCount ?? job.steps.length;
1406
1427
  const lines = [];
1407
1428
  for (const span of buildAsyncChainStepSpans(total, job.steps.length, job.parallelGroups)) {
1408
1429
  const steps = job.steps.slice(span.start, span.start + span.count);
1409
1430
  if (span.isParallel) {
1410
- lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false));
1431
+ lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false, fullTask));
1411
1432
  continue;
1412
1433
  }
1413
1434
  const step = steps[0];
@@ -1415,16 +1436,18 @@ function widgetChainDetails(job, theme, expanded = false, width = getTermWidth()
1415
1436
  lines.push(` ${theme.fg("dim", `\u25E6 Step ${span.stepIndex + 1}/${total}: pending`)}`);
1416
1437
  continue;
1417
1438
  }
1418
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame));
1439
+ lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame, { fullTask }));
1419
1440
  }
1420
1441
  return lines;
1421
1442
  }
1422
- function widgetParallelAgentDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1443
+ function widgetParallelAgentDetails(job, theme, expanded = false, width = getTermWidth(), frame, fullTask = false) {
1423
1444
  if (!job.steps?.length) return [];
1445
+ const taskLines = (step, indent) => expanded && fullTask && step.status === "running" ? (expandedTaskLines(step.description, step.label, width - indent.length - 4) ?? []).map((line) => `${indent}${theme.fg("dim", line)}`) : [];
1446
+ if (job.mode === "single") return job.steps.flatMap((step) => taskLines(step, " "));
1424
1447
  if (job.mode !== "parallel" && job.mode !== "chain") return [];
1425
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
1448
+ if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame, fullTask);
1426
1449
  const group = activeParallelWidgetGroup(job);
1427
- if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup));
1450
+ if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup), fullTask);
1428
1451
  const total = job.stepsTotal ?? job.steps.length;
1429
1452
  const lines = [];
1430
1453
  for (const [index, step] of job.steps.entries()) {
@@ -1436,6 +1459,7 @@ function widgetParallelAgentDetails(job, theme, expanded = false, width = getTer
1436
1459
  const display = step.sessionName?.trim() || (label ? `${label} (${step.agent})` : step.agent);
1437
1460
  const thinking = childThinkingLevel(step);
1438
1461
  lines.push(` ${theme.fg("dim", `${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index), frame, thinking)} ${itemTitle} ${index + 1}/${total}: ${display} \xB7 ${widgetStepStatus(step.status, theme, thinking)}${modelDisplay}${activity ? ` \xB7 ${activity}` : ""}`)}`);
1462
+ lines.push(...taskLines(step, " "));
1439
1463
  const lane = projectAsyncLane(job, step);
1440
1464
  if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
1441
1465
  for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 8 : 6)) lines.push(` ${nestedLine}`);
@@ -1560,7 +1584,7 @@ function parallelWidgetGroupHeader(group, theme, frame) {
1560
1584
  const label = group.stepIndex !== void 0 && group.chainTotal !== void 0 ? `Step ${group.stepIndex + 1}/${group.chainTotal}: parallel group` : "parallel group";
1561
1585
  return ` ${widgetStepGlyph(status, theme, widgetStepsRunningSeed(group.steps), frame)} ${themeBold(theme, label)} ${theme.fg("dim", "\xB7")} ${theme.fg("dim", formatParallelOutcome(group.steps, group.total))}`;
1562
1586
  }
1563
- function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, prioritizeActive) {
1587
+ function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, prioritizeActive, fullTask = false) {
1564
1588
  const lines = [parallelWidgetGroupHeader(group, theme, frame)];
1565
1589
  const rows = parallelWidgetStepRows(group.steps, group.total, prioritizeActive);
1566
1590
  for (const [rowIndex, row] of rows.entries()) {
@@ -1570,7 +1594,8 @@ function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, p
1570
1594
  rowIndent: " ",
1571
1595
  detailIndent: " ",
1572
1596
  rowMarker: marker,
1573
- includeCurrentPath: true
1597
+ includeCurrentPath: true,
1598
+ fullTask
1574
1599
  }));
1575
1600
  }
1576
1601
  for (let index = rows.length; index < group.total; index++) {
@@ -1973,7 +1998,9 @@ function foregroundStyleWidgetStepLines(job, theme, step, itemTitle, index, tota
1973
1998
  const lines = [`${rowIndent}${rowMarker}${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index - 1), frame, thinking)} ${themeBold(theme, rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "\xB7")} ${status}${modelDisplay}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`];
1974
1999
  const lane = projectAsyncLane(job, step);
1975
2000
  if (lane) lines.push(...formatLaneProjectionLines(lane, theme, detailIndent));
1976
- const task = collapseDetails ? stepTaskSummary(step, displayName) : compactTaskText(step.description, step.label);
2001
+ const fullTask = expanded && options?.fullTask && step.status === "running" ? expandedTaskLines(step.description, step.label, width - detailIndent.length - 4) : void 0;
2002
+ const task = fullTask ? void 0 : collapseDetails ? stepTaskSummary(step, displayName) : compactTaskText(step.description, step.label);
2003
+ for (const line of fullTask ?? []) lines.push(`${detailIndent}${theme.fg("dim", line)}`);
1977
2004
  if (task) lines.push(`${detailIndent}${theme.fg("dim", `task: ${task}`)}`);
1978
2005
  const activity = widgetStepActivityLine(step, width, expanded, job.updatedAt);
1979
2006
  const currentPath = options?.includeCurrentPath && step.currentPath ? shortenPath(step.currentPath) : void 0;
@@ -2023,7 +2050,7 @@ function hostStepWidgetLines(job, theme, indent) {
2023
2050
  if (rows.length > visible.length) lines.push(`${indent}${theme.fg("dim", `\u2026 +${rows.length - visible.length} host steps hidden`)}`);
2024
2051
  return lines;
2025
2052
  }
2026
- function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection = buildWorkflowWidgetProjection(job)) {
2053
+ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection = buildWorkflowWidgetProjection(job), fullTask = false) {
2027
2054
  const steps = projection.steps.filter((step) => !projection.materializedKeys?.has(step.workflowKey ?? "") && !projection.materializedKeys?.has(step.runId ?? ""));
2028
2055
  const checklist = widgetChecklistWithoutMaterializedChildren(projection);
2029
2056
  if (!expanded && job.mode === "workflow") {
@@ -2040,14 +2067,14 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2040
2067
  ...formatNestedWidgetLines(job.nestedChildren, theme, width, expanded, job.updatedAt, expanded ? 12 : 6).map((line) => ` ${line}`)
2041
2068
  ];
2042
2069
  }
2043
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
2070
+ if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame, fullTask);
2044
2071
  const lines = [
2045
2072
  ...expanded ? workflowPreflightLines(job) : [],
2046
2073
  ...workflowChecklistWidgetLines(checklist, theme, " ", expanded, frame, { includeItemErrors: !expanded, liveWidget: true })
2047
2074
  ];
2048
2075
  const group = activeParallelWidgetGroup(job);
2049
2076
  if (group) {
2050
- lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup)));
2077
+ lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup), fullTask));
2051
2078
  } else {
2052
2079
  const { stageProgress, plannedKeys } = projection;
2053
2080
  const total = job.mode === "chain" ? job.chainStepCount ?? job.stepsTotal ?? steps.length : stageProgress?.total ?? job.stepsTotal ?? steps.length;
@@ -2059,7 +2086,7 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2059
2086
  const itemTitle = isPlannedStage ? "Stage" : "Step";
2060
2087
  const displayIndex = isPlannedStage ? (step.index ?? index) + 1 : plannedKeys ? ++extraStepIndex : index + 1;
2061
2088
  const displayTotal = isPlannedStage ? stageTotal : extraStepCount;
2062
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame));
2089
+ lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame, { fullTask }));
2063
2090
  }
2064
2091
  }
2065
2092
  lines.push(...hostStepWidgetLines(job, theme, " "));
@@ -2070,7 +2097,7 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2070
2097
  }
2071
2098
  return lines;
2072
2099
  }
2073
- function buildSingleWidgetLines(job, theme, width, expanded, frame, projection = buildWorkflowWidgetProjection(job), reservedLines = 0) {
2100
+ function buildSingleWidgetLines(job, theme, width, expanded, frame, projection = buildWorkflowWidgetProjection(job), reservedLines = 0, fullTask = false) {
2074
2101
  if ((!expanded || projection.inlineFleetCovered) && job.mode === "workflow") return [compactWorkflowHeaderLine(job, theme, width), ...compactWorkflowWidgetBodyLines(job, theme, frame, projection, widgetLineBudget(expanded) - 1 - reservedLines)].map((line) => truncLine(line, width));
2075
2102
  const stats = widgetStats(job, theme, projection, !expanded);
2076
2103
  const count = job.mode === "workflow" ? projection.checklist?.total ?? projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length : job.mode === "chain" ? job.chainStepCount : projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length;
@@ -2082,7 +2109,7 @@ function buildSingleWidgetLines(job, theme, width, expanded, frame, projection =
2082
2109
  return [
2083
2110
  `${theme.fg("toolTitle", themeBold(theme, title))} ${theme.fg("dim", "\xB7 background")}`,
2084
2111
  ...collapseDetails ? [] : [summary],
2085
- ...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection)
2112
+ ...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection, fullTask)
2086
2113
  ].map((line) => truncLine(line, width));
2087
2114
  }
2088
2115
  function compactSingleWidgetLines(job, theme, width, frame, projection = buildWorkflowWidgetProjection(job)) {
@@ -2441,7 +2468,7 @@ function widgetChecklistWithoutMaterializedChildren(projection) {
2441
2468
  if (!checklist || !materializedKeys) return checklist;
2442
2469
  return { ...checklist, phases: checklist.phases.map((phase) => ({ ...phase, items: phase.items.filter((item) => !materializedKeys.has(item.key)) })) };
2443
2470
  }
2444
- function materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor) {
2471
+ function materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor, fullTask = false) {
2445
2472
  const { children, inlineFleetCovered } = projectionFor(job);
2446
2473
  if (inlineFleetCovered || !children?.length) return [];
2447
2474
  const lines = [];
@@ -2452,8 +2479,8 @@ function materializedWidgetChildLines(job, theme, width, expanded, frame, projec
2452
2479
  const identity = child.workflowKey ?? child.asyncId;
2453
2480
  const stats = widgetStats(child, theme, projection, !expanded);
2454
2481
  lines.push(` ${last ? "\u2514\u2500" : "\u251C\u2500"} ${theme.bold(identity)} ${widgetStatusGlyph(child, theme, frame)} ${themeBold(theme, widgetJobName(child))}${contextModeBadge(theme, child.context)}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`);
2455
- for (const detail of foregroundStyleWidgetDetails(child, theme, expanded, Math.max(0, width - 6), frame, projection)) lines.push(` ${last ? " " : "\u2502 "}${detail}`);
2456
- for (const detail of materializedWidgetChildLines(child, theme, Math.max(0, width - 4), expanded, frame, projectionFor)) lines.push(` ${detail}`);
2482
+ for (const detail of foregroundStyleWidgetDetails(child, theme, expanded, Math.max(0, width - 6), frame, projection, fullTask)) lines.push(` ${last ? " " : "\u2502 "}${detail}`);
2483
+ for (const detail of materializedWidgetChildLines(child, theme, Math.max(0, width - 4), expanded, frame, projectionFor, fullTask)) lines.push(` ${detail}`);
2457
2484
  }
2458
2485
  if (shown.length < children.length) lines.push(` +${children.length - shown.length} more workflow children`);
2459
2486
  return lines;
@@ -2537,11 +2564,24 @@ function buildWidgetComponent(jobs, ui, initiallyCollapsed = false, layout) {
2537
2564
  return component;
2538
2565
  };
2539
2566
  }
2567
+ function runningWidgetChildCount(jobs, projectionFor) {
2568
+ let running = 0;
2569
+ for (const job of jobs) {
2570
+ const { steps, materializedKeys, children } = projectionFor(job);
2571
+ if (!steps.length && job.status === "running") running++;
2572
+ for (const step of steps) {
2573
+ if (step.status === "running" && !materializedKeys?.has(step.workflowKey ?? "") && !materializedKeys?.has(step.runId ?? "")) running++;
2574
+ }
2575
+ if (children?.length) running += runningWidgetChildCount(children, projectionFor);
2576
+ }
2577
+ return running;
2578
+ }
2540
2579
  function buildWidgetLinesWithProjection(jobs, theme, width = getTermWidth(), expanded = false, frame, projectionFor = workflowWidgetProjectionLookup()) {
2541
2580
  if (jobs.length === 0) return [];
2581
+ const fullTask = expanded && runningWidgetChildCount(jobs, projectionFor) === 1;
2542
2582
  if (jobs.length === 1) {
2543
- const childLines = materializedWidgetChildLines(jobs[0], theme, width, expanded, frame, projectionFor).map((line) => truncLine(line, width));
2544
- return [...buildSingleWidgetLines(jobs[0], theme, width, expanded, frame, projectionFor(jobs[0]), childLines.length), ...childLines];
2583
+ const childLines = materializedWidgetChildLines(jobs[0], theme, width, expanded, frame, projectionFor, fullTask).map((line) => truncLine(line, width));
2584
+ return [...buildSingleWidgetLines(jobs[0], theme, width, expanded, frame, projectionFor(jobs[0]), childLines.length, fullTask), ...childLines];
2545
2585
  }
2546
2586
  const running = jobs.filter((job) => job.status === "running");
2547
2587
  const queued = jobs.filter((job) => job.status === "queued");
@@ -2565,12 +2605,12 @@ function buildWidgetLinesWithProjection(jobs, theme, width = getTermWidth(), exp
2565
2605
  ` ${theme.fg("dim", `\u23BF ${widgetActivity(job)}`)}`,
2566
2606
  ...widgetLaneDetailLines(job, theme, projection),
2567
2607
  ...workflowChecklistWidgetLines(widgetChecklistWithoutMaterializedChildren(projection), theme, " ", expanded, frame, { includeItemErrors: !expanded || !job.steps?.length, liveWidget: true }),
2568
- ...widgetParallelAgentDetails(job, theme, expanded, width, frame)
2608
+ ...widgetParallelAgentDetails(job, theme, expanded, width, frame, fullTask)
2569
2609
  ];
2570
2610
  const item = [
2571
2611
  compactWorkflow ? compactWorkflowHeaderLine(job, theme, width) : `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`,
2572
2612
  ...details,
2573
- ...materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor)
2613
+ ...materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor, fullTask)
2574
2614
  ];
2575
2615
  items.push(item);
2576
2616
  if (compactWorkflow) compactCards.push({ item, job, projection, bodyLength: details.length });
@@ -11,13 +11,13 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-LGMILZNE.js";
14
+ } from "./chunk-PGU4TZV3.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
18
18
  validatePermissionConfig,
19
19
  writePrivateAtomicJson
20
- } from "./chunk-UX4SCV5N.js";
20
+ } from "./chunk-C3KWLXDH.js";
21
21
  import {
22
22
  FLEET_KEYBINDING_ACTIONS,
23
23
  RUNNER_LAUNCHER_NAME_PATTERN,
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "pi-subagents",
4
- version: "0.85.0",
4
+ version: "0.87.0",
5
5
  private: true,
6
6
  description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
7
7
  author: "Nico Bailon",
@@ -14,20 +14,20 @@ import {
14
14
  resolveCurrentSessionId,
15
15
  resolveWatchdogReviewModel,
16
16
  startWatchdogDiffBaselineCapture
17
- } from "./chunk-IQIWF2VX.js";
17
+ } from "./chunk-AIL46SZU.js";
18
18
  import {
19
19
  agentStreamOptions,
20
20
  opencodeSessionHeaders
21
- } from "./chunk-LTPH2DXH.js";
21
+ } from "./chunk-XV7RTWTS.js";
22
22
  import {
23
23
  registerNativeSupervisorClient
24
- } from "./chunk-T5V5BRCL.js";
24
+ } from "./chunk-W52LJANO.js";
25
25
  import {
26
26
  MODEL_ONLY_TOOL
27
27
  } from "./chunk-HXRB42AF.js";
28
28
  import {
29
29
  inheritedNestedRouteOf
30
- } from "./chunk-LGMILZNE.js";
30
+ } from "./chunk-PGU4TZV3.js";
31
31
  import {
32
32
  CHILD_WATCHDOG_STATUS_EVENT,
33
33
  DEFAULT_WAIT_TOOL_NAME,
@@ -46,7 +46,7 @@ import {
46
46
  toolBudgetSoftNudge,
47
47
  validateAcceptanceReport,
48
48
  validateStructuredOutputValue
49
- } from "./chunk-UX4SCV5N.js";
49
+ } from "./chunk-C3KWLXDH.js";
50
50
  import {
51
51
  INTERCOM_SESSION_IDENTITY_EVENT
52
52
  } from "./chunk-JEZOSEWG.js";