pi-subagents 0.89.2 → 0.90.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 (76) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/bundle/agents.js +4 -4
  3. package/bundle/child-tool-plan.js +3 -3
  4. package/bundle/{chunk-U753SUBC.js → chunk-2LEBXCLU.js} +29 -19
  5. package/bundle/{chunk-UUW7P6KJ.js → chunk-37EJGDYO.js} +2 -2
  6. package/bundle/{chunk-ME4IS3Y3.js → chunk-4DA22WRU.js} +58 -29
  7. package/bundle/{chunk-77VQEATI.js → chunk-5J2RTMKW.js} +2 -2
  8. package/bundle/{chunk-UBPAMRVL.js → chunk-7HPZIT4W.js} +13 -13
  9. package/bundle/{chunk-SWGB2P5J.js → chunk-7Y4IJMCW.js} +1 -1
  10. package/bundle/{chunk-DGLXVN3F.js → chunk-ACTHBJUI.js} +1 -1
  11. package/bundle/{chunk-76WVWEFE.js → chunk-AJWRYQPH.js} +134 -74
  12. package/bundle/{chunk-TXC7WIPL.js → chunk-C45WQQZX.js} +1 -1
  13. package/bundle/{chunk-YJIU5WF4.js → chunk-CPWZN5KM.js} +1 -1
  14. package/bundle/{chunk-RHKIP45B.js → chunk-DNJ2GHSI.js} +6 -6
  15. package/bundle/{chunk-DYBRIEIF.js → chunk-EBGTTJKP.js} +6 -6
  16. package/bundle/{chunk-LWH7IGI3.js → chunk-F4NSLXB2.js} +8 -6
  17. package/bundle/{chunk-FO2GIU5F.js → chunk-G43SW4BT.js} +11 -10
  18. package/bundle/{chunk-Q4VH72JI.js → chunk-KNVQTRSY.js} +2 -2
  19. package/bundle/{chunk-5TXWZB73.js → chunk-P2M6RIVX.js} +1 -1
  20. package/bundle/{chunk-ROJH7KPK.js → chunk-PSB3VLMH.js} +2 -2
  21. package/bundle/{chunk-VEEUXJDO.js → chunk-PTN7XAXI.js} +2 -2
  22. package/bundle/{chunk-2UCFLUE4.js → chunk-RIBMW6V3.js} +9 -7
  23. package/bundle/{chunk-DHY5TY2Y.js → chunk-SIB2GQHL.js} +3 -3
  24. package/bundle/{chunk-JEZOSEWG.js → chunk-SRWJIAIP.js} +2 -0
  25. package/bundle/{chunk-JEYG7CNC.js → chunk-UC22RDXP.js} +2 -2
  26. package/bundle/{chunk-W2BZS6UC.js → chunk-VMJGZHUL.js} +9 -5
  27. package/bundle/{chunk-FF5K5HQU.js → chunk-WANQBKAZ.js} +5 -5
  28. package/bundle/{chunk-KA4MKMYT.js → chunk-WHHRG32M.js} +27 -20
  29. package/bundle/{chunk-464OJSDP.js → chunk-XIQKWTFY.js} +5 -5
  30. package/bundle/{chunk-4KQW5R6U.js → chunk-XYIVVS3A.js} +7 -3
  31. package/bundle/{chunk-AHGJSJYY.js → chunk-YVDKGAEO.js} +2 -2
  32. package/bundle/{chunk-SRCMJY4F.js → chunk-ZWGOHOGI.js} +5 -5
  33. package/bundle/control-channel.js +3 -3
  34. package/bundle/index.js +1 -1
  35. package/bundle/intercom-bridge.js +3 -3
  36. package/bundle/preflight.js +9 -9
  37. package/bundle/project-panes.js +4 -4
  38. package/bundle/shared-types.js +1 -1
  39. package/bundle/workflow-resources.js +1 -1
  40. package/docs/configuration.md +12 -3
  41. package/docs/models.md +1 -1
  42. package/docs/observability.md +7 -1
  43. package/docs/tool-reference.md +5 -2
  44. package/docs/workflows.md +1 -1
  45. package/package.json +1 -1
  46. package/skills/pi-subagents/SKILL.md +1 -1
  47. package/src/agents/agents.d.ts +2 -0
  48. package/src/agents/agents.js +4 -0
  49. package/src/extension/config.js +3 -0
  50. package/src/extension/public-execution.js +4 -2
  51. package/src/extension/reply-workflow-script.js +10 -1
  52. package/src/extension/schemas.d.ts +1 -0
  53. package/src/extension/schemas.js +2 -0
  54. package/src/extension/subagent-options.d.ts +2 -0
  55. package/src/extension/subagent-options.js +10 -4
  56. package/src/runs/background/async-execution.d.ts +1 -1
  57. package/src/runs/background/async-execution.js +3 -1
  58. package/src/runs/background/async-retention.js +48 -12
  59. package/src/runs/background/async-status.js +32 -17
  60. package/src/runs/background/retained-children.js +1 -1
  61. package/src/runs/foreground/execution.js +5 -7
  62. package/src/runs/foreground/subagent-executor.d.ts +1 -1
  63. package/src/runs/foreground/subagent-executor.js +122 -47
  64. package/src/runs/shared/fast-mode-extension.d.ts +2 -1
  65. package/src/runs/shared/fast-mode-extension.js +5 -3
  66. package/src/shared/capacity-resilient-json.d.ts +7 -3
  67. package/src/shared/capacity-resilient-json.js +8 -6
  68. package/src/shared/disabled-features.d.ts +4 -0
  69. package/src/shared/disabled-features.js +1 -0
  70. package/src/shared/types.d.ts +18 -1
  71. package/src/shared/types.js +2 -0
  72. package/src/tui/fleet.js +1 -0
  73. package/src/workflows/structured-workflow-scripts.js +6 -4
  74. package/src/workflows/workflow-resources.js +4 -2
  75. package/src/workflows/workflow-revival.d.ts +6 -0
  76. package/src/workflows/workflow-revival.js +1 -1
@@ -14,20 +14,20 @@ import {
14
14
  resolveCurrentSessionId,
15
15
  resolveWatchdogReviewModel,
16
16
  startWatchdogDiffBaselineCapture
17
- } from "./chunk-2UCFLUE4.js";
17
+ } from "./chunk-RIBMW6V3.js";
18
18
  import {
19
19
  agentStreamOptions,
20
20
  opencodeSessionHeaders
21
- } from "./chunk-U753SUBC.js";
21
+ } from "./chunk-2LEBXCLU.js";
22
22
  import {
23
23
  registerNativeSupervisorClient
24
- } from "./chunk-VEEUXJDO.js";
24
+ } from "./chunk-PTN7XAXI.js";
25
25
  import {
26
26
  MODEL_ONLY_TOOL
27
27
  } from "./chunk-HXRB42AF.js";
28
28
  import {
29
29
  inheritedNestedRouteOf
30
- } from "./chunk-DHY5TY2Y.js";
30
+ } from "./chunk-SIB2GQHL.js";
31
31
  import {
32
32
  CHILD_WATCHDOG_STATUS_EVENT,
33
33
  DEFAULT_WAIT_TOOL_NAME,
@@ -46,10 +46,10 @@ import {
46
46
  toolBudgetSoftNudge,
47
47
  validateAcceptanceReport,
48
48
  validateStructuredOutputValue
49
- } from "./chunk-LWH7IGI3.js";
49
+ } from "./chunk-F4NSLXB2.js";
50
50
  import {
51
51
  INTERCOM_SESSION_IDENTITY_EVENT
52
- } from "./chunk-JEZOSEWG.js";
52
+ } from "./chunk-SRWJIAIP.js";
53
53
 
54
54
  // src/runs/shared/subagent-prompt-runtime.ts
55
55
  import { createHash } from "node:crypto";
@@ -2,7 +2,7 @@ import {
2
2
  CHAIN_RUNS_DIR,
3
3
  RUNNER_LAUNCHER_NAME_PATTERN,
4
4
  RUNNER_LAUNCHER_NAME_RULE
5
- } from "./chunk-JEZOSEWG.js";
5
+ } from "./chunk-SRWJIAIP.js";
6
6
  import {
7
7
  previewDisplayText,
8
8
  sanitizeDisplayText,
@@ -12,11 +12,6 @@ import {
12
12
  normalizeCapabilityCeilingAllowedAgents
13
13
  } from "./chunk-QXASAHIA.js";
14
14
 
15
- // src/shared/atomic-json.ts
16
- import { createHash } from "node:crypto";
17
- import * as fs from "node:fs";
18
- import * as path from "node:path";
19
-
20
15
  // src/shared/file-system-retry.ts
21
16
  var WAIT_BUFFER = typeof SharedArrayBuffer !== "undefined" ? new SharedArrayBuffer(4) : void 0;
22
17
  var WAIT_VIEW = WAIT_BUFFER ? new Int32Array(WAIT_BUFFER) : void 0;
@@ -75,6 +70,9 @@ function runFileSystemOperationWithRetry(operation, options = {}) {
75
70
  }
76
71
 
77
72
  // src/shared/atomic-json.ts
73
+ import { createHash } from "node:crypto";
74
+ import * as fs from "node:fs";
75
+ import * as path from "node:path";
78
76
  var MAX_PATH_COMPONENT_BYTES = 255;
79
77
  function renameWithRetry(fsImpl, sourcePath, targetPath, retryDelaysMs, wait) {
80
78
  runFileSystemOperationWithRetry(() => {
@@ -4385,6 +4383,9 @@ function formatAvailableAgentLines(agents) {
4385
4383
  if (sorted.length > MAX_LISTED_AGENTS) lines.push(`+${sorted.length - MAX_LISTED_AGENTS} more; {action:"list", options:{search:"<term>"}}`);
4386
4384
  return lines.length ? lines : ["- (none)"];
4387
4385
  }
4386
+ function agentRunDescription(agentName, agent, label) {
4387
+ return label ?? (agent?.description?.trim() || agentName);
4388
+ }
4388
4389
  function suggestAgentName(name, agents) {
4389
4390
  return closestMatch(name.trim(), new Set(agents.flatMap((agent) => [agent.name, ...agent.localName ? [agent.localName] : [], ...agent.aliases ?? []])));
4390
4391
  }
@@ -8851,6 +8852,7 @@ export {
8851
8852
  unknownAgentDiagnosticContext,
8852
8853
  MAX_LISTED_AGENTS,
8853
8854
  formatAvailableAgentLines,
8855
+ agentRunDescription,
8854
8856
  suggestAgentName,
8855
8857
  formatUnknownAgentError,
8856
8858
  resolveAgentName,
@@ -7,37 +7,37 @@ import {
7
7
  safeTranscriptEvent,
8
8
  steerAsyncRun,
9
9
  steerWorkflowForegroundTarget
10
- } from "./chunk-RHKIP45B.js";
10
+ } from "./chunk-DNJ2GHSI.js";
11
11
  import {
12
12
  FLEET_STATUS_WIDGET_KEY,
13
13
  runningTone,
14
14
  stepTaskSummary
15
- } from "./chunk-SRCMJY4F.js";
15
+ } from "./chunk-ZWGOHOGI.js";
16
16
  import {
17
17
  foregroundChildStateLabel,
18
18
  formatAsyncRunTranscript,
19
19
  stopAsyncRun
20
- } from "./chunk-464OJSDP.js";
20
+ } from "./chunk-XIQKWTFY.js";
21
21
  import {
22
22
  contextModeBadge,
23
23
  contextModeLabel,
24
24
  decodeUtf8Tail,
25
25
  listAsyncRuns
26
- } from "./chunk-U753SUBC.js";
26
+ } from "./chunk-2LEBXCLU.js";
27
27
  import {
28
28
  reportSessionWarning
29
29
  } from "./chunk-HXRB42AF.js";
30
- import "./chunk-DHY5TY2Y.js";
31
- import "./chunk-UUW7P6KJ.js";
30
+ import "./chunk-SIB2GQHL.js";
31
+ import "./chunk-37EJGDYO.js";
32
32
  import "./chunk-NIXWDZZV.js";
33
- import "./chunk-YJIU5WF4.js";
33
+ import "./chunk-CPWZN5KM.js";
34
34
  import "./chunk-7F6RKT6W.js";
35
35
  import "./chunk-YARY7JWU.js";
36
36
  import "./chunk-72334PEI.js";
37
37
  import {
38
38
  getArtifactPaths,
39
39
  getArtifactsDir
40
- } from "./chunk-77VQEATI.js";
40
+ } from "./chunk-5J2RTMKW.js";
41
41
  import {
42
42
  snapshotExternalRuns
43
43
  } from "./chunk-UKG4V45O.js";
@@ -49,10 +49,10 @@ import {
49
49
  formatTokens,
50
50
  readStatus,
51
51
  shortenPath
52
- } from "./chunk-LWH7IGI3.js";
52
+ } from "./chunk-F4NSLXB2.js";
53
53
  import {
54
54
  DIRS
55
- } from "./chunk-JEZOSEWG.js";
55
+ } from "./chunk-SRWJIAIP.js";
56
56
  import {
57
57
  safeTerminalText
58
58
  } from "./chunk-YFCK7H2S.js";
@@ -467,6 +467,7 @@ function collectFleetSnapshot(state, options = {}) {
467
467
  entryLimit: MAX_FLEET_HISTORY_CANDIDATES,
468
468
  resultsDir: options.resultsDir ?? DIRS.results,
469
469
  reconcile: false,
470
+ includeNested: false,
470
471
  onCorruptStatus: (warning) => reportSessionWarning(state, warning)
471
472
  }).filter((run) => !trackedIds.has(run.id));
472
473
  runs = [...trackedRuns, ...history];
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getProjectSubagentsDir
3
- } from "./chunk-77VQEATI.js";
3
+ } from "./chunk-5J2RTMKW.js";
4
4
  import {
5
5
  discoverAgents,
6
6
  formatUnknownAgentError,
7
7
  resolveAgentName,
8
8
  unknownAgentDiagnosticContext
9
- } from "./chunk-LWH7IGI3.js";
9
+ } from "./chunk-F4NSLXB2.js";
10
10
 
11
11
  // src/agents/agent-refinements.ts
12
12
  import { createHash, randomUUID } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerRuntimeAgent
3
- } from "./chunk-SWGB2P5J.js";
3
+ } from "./chunk-7Y4IJMCW.js";
4
4
 
5
5
  // src/agents/runtime-agent-events.ts
6
6
  var RUNTIME_AGENT_REGISTER_EVENT = "pi-subagents:runtime-agent-register:v1";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-Q4VH72JI.js";
3
+ } from "./chunk-KNVQTRSY.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-LWH7IGI3.js";
7
+ } from "./chunk-F4NSLXB2.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {
@@ -11,13 +11,13 @@ import {
11
11
  readStatus,
12
12
  writeAtomicJson,
13
13
  writePrivateAtomicJson
14
- } from "./chunk-LWH7IGI3.js";
14
+ } from "./chunk-F4NSLXB2.js";
15
15
  import {
16
16
  ASYNC_DIR,
17
17
  INTERCOM_DETACH_REQUEST_EVENT,
18
18
  POLL_INTERVAL_MS,
19
19
  TEMP_ROOT_DIR
20
- } from "./chunk-JEZOSEWG.js";
20
+ } from "./chunk-SRWJIAIP.js";
21
21
 
22
22
  // src/intercom/native-supervisor-channel.ts
23
23
  import { randomUUID } from "node:crypto";
@@ -8,23 +8,23 @@ import {
8
8
  projectTimeoutRecovery,
9
9
  readAsyncRecoveryDescriptor,
10
10
  utf8Tail
11
- } from "./chunk-U753SUBC.js";
11
+ } from "./chunk-2LEBXCLU.js";
12
12
  import {
13
13
  MAX_ARGS_BYTES,
14
14
  MAX_ARGS_DEPTH,
15
15
  MAX_ARGS_FIELDS,
16
16
  MAX_ARGS_ITEMS
17
- } from "./chunk-W2BZS6UC.js";
17
+ } from "./chunk-VMJGZHUL.js";
18
18
  import {
19
19
  fallbackResultPayloadPathForSessionRun,
20
20
  nestedRunScope,
21
21
  resultFilePath,
22
22
  resultPayloadMatchesSessionRun,
23
23
  resultPayloadPathForSessionRun
24
- } from "./chunk-DHY5TY2Y.js";
24
+ } from "./chunk-SIB2GQHL.js";
25
25
  import {
26
26
  PROJECT_SUBAGENTS_RELATIVE_DIR
27
- } from "./chunk-77VQEATI.js";
27
+ } from "./chunk-5J2RTMKW.js";
28
28
  import {
29
29
  listBackgroundWorkWakeChannels,
30
30
  snapshotBackgroundWork
@@ -50,7 +50,7 @@ import {
50
50
  waitToolName,
51
51
  withSettingsFileLease,
52
52
  writePrivateAtomicJson
53
- } from "./chunk-LWH7IGI3.js";
53
+ } from "./chunk-F4NSLXB2.js";
54
54
  import {
55
55
  DIRS,
56
56
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -60,7 +60,7 @@ import {
60
60
  SUBAGENT_CONTROL_INTERCOM_EVENT,
61
61
  SUBAGENT_FOREGROUND_COMPLETE_EVENT,
62
62
  SUBAGENT_RESULT_INTERCOM_EVENT
63
- } from "./chunk-JEZOSEWG.js";
63
+ } from "./chunk-SRWJIAIP.js";
64
64
 
65
65
  // src/shared/session-identity.ts
66
66
  import * as fs from "node:fs";
@@ -960,7 +960,9 @@ var ModelTopLevelProperties = {
960
960
  action,
961
961
  id,
962
962
  message,
963
- options: Type2.Optional(Type2.Unsafe({ type: "object", additionalProperties: true, description: "Every field not listed here, such as acceptance, timeoutMs, context, view and index; guide tool-reference/parameter-reference." }))
963
+ options: Type2.Optional(Type2.Unsafe({ type: "object", additionalProperties: true, description: "Every field not listed here, such as acceptance, timeoutMs, context, view and index; guide tool-reference/parameter-reference." })),
964
+ // Appended after options so the earlier fields keep their order.
965
+ label: Type2.Optional(Type2.String({ minLength: 1, maxLength: 80, description: "2-4 words on what it does; appears wherever the run is listed." }))
964
966
  };
965
967
  var SubagentParams = keepTopLevelParameterDescriptions(Type2.Object(ModelTopLevelProperties));
966
968
  var StructuredTask = { type: "object", properties: { agent: { type: "string", minLength: 1 }, task: { type: "string" }, cwd: { type: "string" }, model: { type: "string" } }, required: ["agent", "task"], additionalProperties: false };
@@ -5,7 +5,7 @@ import {
5
5
  PROJECT_SUBAGENTS_RELATIVE_DIR,
6
6
  canonicalSessionId,
7
7
  inspectSessionLease
8
- } from "./chunk-77VQEATI.js";
8
+ } from "./chunk-5J2RTMKW.js";
9
9
  import {
10
10
  DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
11
11
  DEFAULT_GLOBAL_CONCURRENCY_LIMIT,
@@ -27,12 +27,12 @@ import {
27
27
  withFileLease,
28
28
  writeAtomicJson,
29
29
  writePrivateAtomicJson
30
- } from "./chunk-LWH7IGI3.js";
30
+ } from "./chunk-F4NSLXB2.js";
31
31
  import {
32
32
  DIRS,
33
33
  SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
34
34
  TEMP_ROOT_DIR
35
- } from "./chunk-JEZOSEWG.js";
35
+ } from "./chunk-SRWJIAIP.js";
36
36
 
37
37
  // src/runs/background/index-segment.ts
38
38
  import { createHash } from "node:crypto";
@@ -11,6 +11,7 @@ var RUNNER_LAUNCHER_NAME_RULE = "must start with a letter or digit and use only
11
11
  var SUBAGENT_ASYNC_COMPLETE_EVENT = "subagent:async-complete";
12
12
  var SUBAGENT_PROCESS_TERMINAL_EVENT = "subagent:process-terminal";
13
13
  var SUBAGENT_FOREGROUND_COMPLETE_EVENT = "subagent:foreground-complete";
14
+ var TASK_SUBAGENT_LIFECYCLE_EVENT = "task:subagent:lifecycle";
14
15
  var SUBAGENT_CONTROL_EVENT = "subagent:control-event";
15
16
  var SUBAGENT_CONTROL_INTERCOM_EVENT = "subagent:control-intercom";
16
17
  var SUBAGENT_STEERING_NOTICE_EVENT = "subagent:steering-notice";
@@ -220,6 +221,7 @@ export {
220
221
  SUBAGENT_ASYNC_COMPLETE_EVENT,
221
222
  SUBAGENT_PROCESS_TERMINAL_EVENT,
222
223
  SUBAGENT_FOREGROUND_COMPLETE_EVENT,
224
+ TASK_SUBAGENT_LIFECYCLE_EVENT,
223
225
  SUBAGENT_CONTROL_EVENT,
224
226
  SUBAGENT_CONTROL_INTERCOM_EVENT,
225
227
  SUBAGENT_STEERING_NOTICE_EVENT,
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-72334PEI.js";
4
4
  import {
5
5
  getProjectSubagentsDir
6
- } from "./chunk-77VQEATI.js";
6
+ } from "./chunk-5J2RTMKW.js";
7
7
  import {
8
8
  getPiSpawnCommand,
9
9
  writeAtomicJson
10
- } from "./chunk-LWH7IGI3.js";
10
+ } from "./chunk-F4NSLXB2.js";
11
11
 
12
12
  // src/inspectors/herdr/project-panes.ts
13
13
  import * as fs from "node:fs";
@@ -112,6 +112,7 @@ import { randomUUID } from "node:crypto";
112
112
  var OUTPUT_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
113
113
  var PLACEHOLDER_PATTERN = /\{(?:task|previous|outputs\.([A-Za-z_][A-Za-z0-9_]*))\}/g;
114
114
  var CHILD_FIELDS = ["cwd", "model"];
115
+ var TASK_FIELDS = [...CHILD_FIELDS, "label"];
115
116
  var SHARED_CHILD_CONTROLS = /* @__PURE__ */ new Set(["worktree", "baseRef", "context", "skill", "fast", "agentScope", "outputMode", "outputSchema", "agentContract", "acceptance", "gate", "toolBudget", "toolTimeoutMs", "control"]);
116
117
  var SCRIPT_CHILD_FIELDS = /* @__PURE__ */ new Set(["key", "label", "phase", "resume", "async", "timeoutMs"]);
117
118
  function unsupportedChildFieldAdvice(fields, scripts) {
@@ -172,9 +173,9 @@ function compileTemplate(template, scope) {
172
173
  function prelude(originalTask) {
173
174
  return originalTask === void 0 ? [SETTLE_HELPER] : [SETTLE_HELPER, `const originalTask = ${JSON.stringify(originalTask)};`];
174
175
  }
175
- function childFields(record, path) {
176
+ function childFields(record, path, allowed = CHILD_FIELDS) {
176
177
  const fields = {};
177
- for (const field of CHILD_FIELDS) {
178
+ for (const field of allowed) {
178
179
  if (record[field] !== void 0) fields[field] = nonEmptyString(record[field], `${path}.${field}`);
179
180
  }
180
181
  return fields;
@@ -202,7 +203,7 @@ function buildTasksScript(steps, originalTask, scripts) {
202
203
  if (!Array.isArray(steps) || steps.length === 0) throw new Error("tasks must be a non-empty array of { agent, task } items.");
203
204
  const children = steps.map((item, index) => {
204
205
  const path = `tasks[${index}]`;
205
- const record = exactFields(item, path, ["agent", "task", ...CHILD_FIELDS], "Each tasks item accepts agent and task, plus optional cwd and model.", scripts);
206
+ const record = exactFields(item, path, ["agent", "task", ...TASK_FIELDS], "Each tasks item accepts agent and task, plus optional cwd, model and label.", scripts);
206
207
  const agent = nonEmptyString(record.agent, `${path}.agent`);
207
208
  const task = nonEmptyString(record.task, `${path}.task`);
208
209
  const taskExpression = compileTemplate(task, {
@@ -211,7 +212,7 @@ function buildTasksScript(steps, originalTask, scripts) {
211
212
  previous: { unavailable: "tasks items may only use {task}." },
212
213
  outputsUnavailable: "tasks items may only use {task}."
213
214
  });
214
- return { key: `task-${index + 1}`, agent, taskExpression, fields: childFields(record, path) };
215
+ return { key: `task-${index + 1}`, agent, taskExpression, fields: childFields(record, path, TASK_FIELDS) };
215
216
  });
216
217
  return [
217
218
  ...prelude(originalTask),
@@ -389,7 +390,10 @@ function resolveRunCi(args) {
389
390
  }
390
391
  function resolveParallel(args) {
391
392
  const unsupported = Object.keys(args).filter((key) => key !== "tasks");
392
- if (unsupported.length > 0) return { error: `workflow 'parallel' args contain unsupported fields: ${unsupported.join(", ")}. Pass args.tasks: [{ agent, task, cwd?, model? }, ...]. ${unsupportedChildFieldAdvice(unsupported, true)}` };
393
+ if (unsupported.length > 0) {
394
+ const concurrencyAdvice = unsupported.includes("concurrency") ? " To cap how many run at once, pass globalConcurrencyLimit at the top level, alongside workflow and args." : "";
395
+ return { error: `workflow 'parallel' args contain unsupported fields: ${unsupported.join(", ")}. Pass args.tasks: [{ agent, task, cwd?, model?, label? }, ...].${concurrencyAdvice} ${unsupportedChildFieldAdvice(unsupported, true)}` };
396
+ }
393
397
  try {
394
398
  return { script: buildStructuredWorkflowScript("tasks", args.tasks, void 0, true) };
395
399
  } catch (error) {
@@ -7,13 +7,13 @@ import {
7
7
  runBoundedCommand,
8
8
  shellScriptCommand,
9
9
  sshMachineAccess
10
- } from "./chunk-TXC7WIPL.js";
10
+ } from "./chunk-C45WQQZX.js";
11
11
  import {
12
12
  package_default
13
- } from "./chunk-DGLXVN3F.js";
13
+ } from "./chunk-ACTHBJUI.js";
14
14
  import {
15
15
  ensureSupervisorChannelDir
16
- } from "./chunk-VEEUXJDO.js";
16
+ } from "./chunk-PTN7XAXI.js";
17
17
  import "./chunk-HXRB42AF.js";
18
18
  import "./chunk-NIXWDZZV.js";
19
19
  import {
@@ -39,8 +39,8 @@ import {
39
39
  resolveRexBinary,
40
40
  rexCommandEnv,
41
41
  rexGlobalArgs
42
- } from "./chunk-LWH7IGI3.js";
43
- import "./chunk-JEZOSEWG.js";
42
+ } from "./chunk-F4NSLXB2.js";
43
+ import "./chunk-SRWJIAIP.js";
44
44
  import "./chunk-YFCK7H2S.js";
45
45
  import "./chunk-QXASAHIA.js";
46
46
 
@@ -11,10 +11,10 @@ import {
11
11
  startWatchdogDiffBaselineCapture,
12
12
  writeUserWatchdogEnabled,
13
13
  writeWatchdogModelSettings
14
- } from "./chunk-2UCFLUE4.js";
14
+ } from "./chunk-RIBMW6V3.js";
15
15
  import {
16
16
  resolveGitRepositoryIdentity
17
- } from "./chunk-464OJSDP.js";
17
+ } from "./chunk-XIQKWTFY.js";
18
18
  import {
19
19
  formatParallelHandoffLines,
20
20
  listAsyncRuns,
@@ -25,14 +25,14 @@ import {
25
25
  readKeptBranches,
26
26
  readWorkflowLaunchRecord,
27
27
  resolveRetainedWorktreeCwd
28
- } from "./chunk-U753SUBC.js";
28
+ } from "./chunk-2LEBXCLU.js";
29
29
  import {
30
30
  ownsRun
31
31
  } from "./chunk-HXRB42AF.js";
32
32
  import {
33
33
  deepFreezeWorkflowArgs,
34
34
  normalizeWorkflowArgs
35
- } from "./chunk-W2BZS6UC.js";
35
+ } from "./chunk-VMJGZHUL.js";
36
36
  import {
37
37
  HOST_STEP_MAX_COUNT,
38
38
  REQUIRE_LAUNCHER_SHAPE_ERROR,
@@ -57,24 +57,24 @@ import {
57
57
  resolveMissionStoreLocation,
58
58
  validateMissionId,
59
59
  workflowRunParamsFingerprint
60
- } from "./chunk-DHY5TY2Y.js";
60
+ } from "./chunk-SIB2GQHL.js";
61
61
  import {
62
62
  requestAsyncCommand,
63
63
  watchAsyncControlInbox
64
- } from "./chunk-UUW7P6KJ.js";
64
+ } from "./chunk-37EJGDYO.js";
65
65
  import {
66
66
  supervisorChannelDir
67
- } from "./chunk-AHGJSJYY.js";
67
+ } from "./chunk-YVDKGAEO.js";
68
68
  import {
69
69
  createRequiredChildExtensionIdentity
70
70
  } from "./chunk-YARY7JWU.js";
71
71
  import {
72
72
  createHerdrClient,
73
73
  detectHerdr
74
- } from "./chunk-JEYG7CNC.js";
74
+ } from "./chunk-UC22RDXP.js";
75
75
  import {
76
76
  getProjectSubagentsDir
77
- } from "./chunk-77VQEATI.js";
77
+ } from "./chunk-5J2RTMKW.js";
78
78
  import {
79
79
  ExternalJobProviderError,
80
80
  getExternalJobProvider,
@@ -84,7 +84,7 @@ import {
84
84
  } from "./chunk-YYREO77V.js";
85
85
  import {
86
86
  mergeRuntimeAgents
87
- } from "./chunk-SWGB2P5J.js";
87
+ } from "./chunk-7Y4IJMCW.js";
88
88
  import {
89
89
  CODE_OWNED_EXTERNAL_CLI_ADAPTER_LABEL,
90
90
  EXTERNAL_CLI_ADAPTER_SAFETY,
@@ -145,7 +145,7 @@ import {
145
145
  withFileLease,
146
146
  writeAtomicJson,
147
147
  writePrivateAtomicJson
148
- } from "./chunk-LWH7IGI3.js";
148
+ } from "./chunk-F4NSLXB2.js";
149
149
  import {
150
150
  DIRS,
151
151
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -158,7 +158,7 @@ import {
158
158
  SUBAGENT_FOREGROUND_COMPLETE_EVENT,
159
159
  SUBAGENT_RESULT_INTERCOM_DELIVERY_EVENT,
160
160
  SUBAGENT_RESULT_INTERCOM_EVENT
161
- } from "./chunk-JEZOSEWG.js";
161
+ } from "./chunk-SRWJIAIP.js";
162
162
  import {
163
163
  previewDisplayText,
164
164
  safeTerminalText,
@@ -4948,8 +4948,9 @@ function normalizePublicSubagentExecution(params, options = {}) {
4948
4948
  const capacityOverrideError = validateWorkflowCapacityOverrides(params);
4949
4949
  if (capacityOverrideError) return { ok: false, error: capacityOverrideError, mode: params.action === void 0 ? "workflow" : "management" };
4950
4950
  const validatesSpawnBudget = typeof params.action === "string" && params.action.trim() === "validate" && params.globalConcurrencyLimit === void 0 && params.maxSubagentSpawnsPerRun !== void 0;
4951
- if (params.action !== void 0 && !validatesSpawnBudget || !hasRawScript) {
4952
- return { ok: false, error: `Workflow capacity overrides are only supported on top-level ${RAW_SCRIPT_FORMS} calls; validate accepts maxSubagentSpawnsPerRun for static budget checks.`, mode: params.action === void 0 ? "workflow" : "management" };
4951
+ const namedConcurrencyLimit = hasNamedWorkflow && params.maxSubagentSpawnsPerRun === void 0;
4952
+ if (params.action !== void 0 && !validatesSpawnBudget || !hasRawScript && !namedConcurrencyLimit) {
4953
+ return { ok: false, error: `Workflow capacity overrides are only supported on top-level ${RAW_SCRIPT_FORMS} calls; named workflow calls accept globalConcurrencyLimit only; validate accepts maxSubagentSpawnsPerRun for static budget checks.`, mode: params.action === void 0 ? "workflow" : "management" };
4953
4954
  }
4954
4955
  }
4955
4956
  if (params.preflight !== void 0 && !hasWorkflowInput) {
@@ -7888,7 +7889,7 @@ function childSessionFactory() {
7888
7889
  }
7889
7890
  function createLazyPlacementFactory(local) {
7890
7891
  let placed;
7891
- const factory = async () => placed ??= (await import("./chunk-FF5K5HQU.js")).createPlacementAwareChildSessionFactory(local);
7892
+ const factory = async () => placed ??= (await import("./chunk-WANQBKAZ.js")).createPlacementAwareChildSessionFactory(local);
7892
7893
  return {
7893
7894
  async create(launch) {
7894
7895
  return launch.machine ? (await factory()).create(launch) : local.create(launch);
@@ -8117,10 +8118,13 @@ import { Value } from "typebox/value";
8117
8118
  var optionKeys = new Set(SUBAGENT_OPTION_KEYS);
8118
8119
  var ALIAS_HINTS = { runId: "id (top-level)", maxRuntimeMs: "options.timeoutMs", isolation: "worktree (top-level)" };
8119
8120
  var optionsValidator = Compile(SubagentOptionParams);
8121
+ function isUnsetPlaceholder(value) {
8122
+ return value === "null";
8123
+ }
8120
8124
  function flattenSubagentToolOptions(params, disabled) {
8121
- params = Object.fromEntries(Object.entries(params).filter(([key, value]) => value !== "null" && !(key === "workflow" && value === "false")));
8125
+ params = Object.fromEntries(Object.entries(params).filter(([key, value]) => !isUnsetPlaceholder(value) && !(key === "workflow" && value === "false")));
8122
8126
  if (params.options && typeof params.options === "object" && !Array.isArray(params.options)) {
8123
- params.options = Object.fromEntries(Object.entries(params.options).filter(([, value]) => value !== "null"));
8127
+ params.options = Object.fromEntries(Object.entries(params.options).filter(([, value]) => !isUnsetPlaceholder(value)));
8124
8128
  }
8125
8129
  const removedTopLevel = removedModelWorkflowFieldError(params);
8126
8130
  if (removedTopLevel) throw new Error(removedTopLevel);
@@ -8132,8 +8136,9 @@ function flattenSubagentToolOptions(params, disabled) {
8132
8136
  const { script, ...rest } = options;
8133
8137
  if (script !== void 0) {
8134
8138
  if (typeof script !== "string" || !script.trim()) throw new Error("subagent: options.script must be the workflow script's source text.");
8135
- if (topLevel.workflow !== void 0) throw new Error("subagent: options.script replaces workflow; pass only one of them.");
8136
- return { ...flattenSubagentToolOptions({ ...topLevel, options: rest }, disabled), workflowScript: script };
8139
+ const { workflow, ...withoutWorkflow } = topLevel;
8140
+ if (workflow !== void 0 && workflow !== true && workflow !== "true") throw new Error("subagent: options.script replaces workflow; pass only one of them.");
8141
+ return { ...flattenSubagentToolOptions({ ...withoutWorkflow, options: rest }, disabled), workflowScript: script };
8137
8142
  }
8138
8143
  const entries = Object.entries(options);
8139
8144
  const enabledKeys = SUBAGENT_OPTION_KEYS.filter((key) => !disabled?.params.has(key));
@@ -8214,7 +8219,7 @@ function boundedTaskSummary(value) {
8214
8219
  return normalized.length > MAX_TASK_SUMMARY_LENGTH ? `${normalized.slice(0, MAX_TASK_SUMMARY_LENGTH - 1)}\u2026` : normalized;
8215
8220
  }
8216
8221
  function listRetainedChildren(asyncDirRoot, sessionId) {
8217
- const children = listAsyncRuns(asyncDirRoot, { sessionId, states: ["complete", "failed", "paused", "stopped"], entryLimit: MAX_RETAINED_CHILD_CANDIDATES, reconcile: false }).flatMap((run) => {
8222
+ const children = listAsyncRuns(asyncDirRoot, { sessionId, states: ["complete", "failed", "paused", "stopped"], entryLimit: MAX_RETAINED_CHILD_CANDIDATES, reconcile: false, includeNested: false }).flatMap((run) => {
8218
8223
  if (!run.parentWorkflowRunId || run.steps.length !== 1) return [];
8219
8224
  if (!isRetainedChildState(run.state)) return [];
8220
8225
  const step = run.steps[0];
@@ -8759,6 +8764,7 @@ export {
8759
8764
  externalJobBridgeEligibility,
8760
8765
  createChildExternalJobBridgeSweeper,
8761
8766
  serviceExternalJobBridgeRequests,
8767
+ REVIVAL_LINK_FILE,
8762
8768
  REVIVAL_ORIGIN_FILE,
8763
8769
  recordWorkflowRevival,
8764
8770
  projectWorkflowKeyRevival,
@@ -8849,6 +8855,7 @@ export {
8849
8855
  manualWorkflowResumeRefusalText,
8850
8856
  workflowResumeTargetId,
8851
8857
  prepareWorkflowResume,
8858
+ isUnsetPlaceholder,
8852
8859
  flattenSubagentToolOptions,
8853
8860
  listRetainedChildren,
8854
8861
  formatRetainedChildren,
@@ -12,7 +12,7 @@ import {
12
12
  summarizeContextModes,
13
13
  utf8Tail,
14
14
  workflowPreflightLaneForRuntimeKey
15
- } from "./chunk-U753SUBC.js";
15
+ } from "./chunk-2LEBXCLU.js";
16
16
  import {
17
17
  ownsRun
18
18
  } from "./chunk-HXRB42AF.js";
@@ -34,11 +34,11 @@ import {
34
34
  updateActiveRunIndex,
35
35
  validateModelResponseAliases,
36
36
  writeAsyncResultFile
37
- } from "./chunk-DHY5TY2Y.js";
37
+ } from "./chunk-SIB2GQHL.js";
38
38
  import {
39
39
  deliverStopRequest,
40
40
  stopInboxClosedPath
41
- } from "./chunk-UUW7P6KJ.js";
41
+ } from "./chunk-37EJGDYO.js";
42
42
  import {
43
43
  SUBAGENT_STOPPED_MESSAGE,
44
44
  formatDuration,
@@ -50,10 +50,10 @@ import {
50
50
  waitToolName,
51
51
  writeAtomicJson,
52
52
  writePrivateAtomicJson
53
- } from "./chunk-LWH7IGI3.js";
53
+ } from "./chunk-F4NSLXB2.js";
54
54
  import {
55
55
  DIRS
56
- } from "./chunk-JEZOSEWG.js";
56
+ } from "./chunk-SRWJIAIP.js";
57
57
  import {
58
58
  safeTerminalText,
59
59
  truncateDisplayText
@@ -11,19 +11,19 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-DHY5TY2Y.js";
14
+ } from "./chunk-SIB2GQHL.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
18
18
  validatePermissionConfig,
19
19
  writePrivateAtomicJson
20
- } from "./chunk-LWH7IGI3.js";
20
+ } from "./chunk-F4NSLXB2.js";
21
21
  import {
22
22
  FLEET_KEYBINDING_ACTIONS,
23
23
  RUNNER_LAUNCHER_NAME_PATTERN,
24
24
  RUNNER_LAUNCHER_NAME_RULE,
25
25
  TEMP_ROOT_DIR
26
- } from "./chunk-JEZOSEWG.js";
26
+ } from "./chunk-SRWJIAIP.js";
27
27
 
28
28
  // src/shared/disabled-features.ts
29
29
  var SUBAGENT_FEATURES = {
@@ -56,6 +56,7 @@ var SUBAGENT_FEATURES = {
56
56
  "control-overrides": { actions: [], params: ["control"] },
57
57
  "extension-bindings": { actions: [], params: ["extensionBindings"] },
58
58
  "external-machines": { actions: [], params: ["machine"] },
59
+ "session-sharing": { actions: [], params: ["share"] },
59
60
  "workflow-scripts": { actions: ["validate"], params: ["workflow", "args", "preflight", "globalConcurrencyLimit", "maxSubagentSpawnsPerRun"] }
60
61
  };
61
62
  var SCHEDULE_SURFACE = {
@@ -670,6 +671,9 @@ function validateConfig(config) {
670
671
  if (config.asyncWidgetLayout !== void 0 && config.asyncWidgetLayout !== "adaptive" && config.asyncWidgetLayout !== "rows") {
671
672
  throw new Error('config.asyncWidgetLayout must be "adaptive" or "rows"');
672
673
  }
674
+ if (config.fastServiceTier !== void 0 && config.fastServiceTier !== "priority" && config.fastServiceTier !== "ultrafast") {
675
+ throw new Error('config.fastServiceTier must be "priority" or "ultrafast"');
676
+ }
673
677
  if (config.programStatus !== void 0 && typeof config.programStatus !== "boolean") {
674
678
  throw new Error("config.programStatus must be a boolean");
675
679
  }
@@ -7,10 +7,10 @@ import {
7
7
  getAgentDir,
8
8
  getConfigDirName,
9
9
  getProjectConfigDir
10
- } from "./chunk-LWH7IGI3.js";
10
+ } from "./chunk-F4NSLXB2.js";
11
11
  import {
12
12
  TEMP_ROOT_DIR
13
- } from "./chunk-JEZOSEWG.js";
13
+ } from "./chunk-SRWJIAIP.js";
14
14
  import {
15
15
  capabilityCeilingAgentRestrictionSources,
16
16
  intersectSubagentCapabilityCeilings,