pi-subagents 0.89.1 → 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.
- package/CHANGELOG.md +48 -0
- package/bundle/agents.js +4 -4
- package/bundle/child-tool-plan.js +3 -3
- package/bundle/{chunk-SG3NCWZW.js → chunk-2LEBXCLU.js} +29 -19
- package/bundle/{chunk-UUW7P6KJ.js → chunk-37EJGDYO.js} +2 -2
- package/bundle/{chunk-IGZTXGPG.js → chunk-4DA22WRU.js} +59 -30
- package/bundle/{chunk-77VQEATI.js → chunk-5J2RTMKW.js} +2 -2
- package/bundle/{chunk-7J4ZXMY7.js → chunk-72334PEI.js} +6 -4
- package/bundle/{chunk-F6PTAPQ3.js → chunk-7HPZIT4W.js} +13 -13
- package/bundle/{chunk-SWGB2P5J.js → chunk-7Y4IJMCW.js} +1 -1
- package/bundle/{chunk-TRN65L4F.js → chunk-ACTHBJUI.js} +1 -1
- package/bundle/{chunk-6D54VW3E.js → chunk-AJWRYQPH.js} +145 -76
- package/bundle/{chunk-TXC7WIPL.js → chunk-C45WQQZX.js} +1 -1
- package/bundle/{chunk-YJIU5WF4.js → chunk-CPWZN5KM.js} +1 -1
- package/bundle/{chunk-BERAWSQQ.js → chunk-DNJ2GHSI.js} +7 -7
- package/bundle/{chunk-CASL47ST.js → chunk-EBGTTJKP.js} +6 -6
- package/bundle/{chunk-LWH7IGI3.js → chunk-F4NSLXB2.js} +8 -6
- package/bundle/{chunk-URKQZHVH.js → chunk-G43SW4BT.js} +29 -19
- package/bundle/{chunk-Q4VH72JI.js → chunk-KNVQTRSY.js} +2 -2
- package/bundle/{chunk-5TXWZB73.js → chunk-P2M6RIVX.js} +1 -1
- package/bundle/{chunk-ROJH7KPK.js → chunk-PSB3VLMH.js} +2 -2
- package/bundle/{chunk-VEEUXJDO.js → chunk-PTN7XAXI.js} +2 -2
- package/bundle/{chunk-TDXVQPZW.js → chunk-RIBMW6V3.js} +69 -15
- package/bundle/{chunk-KCDPTXHT.js → chunk-SIB2GQHL.js} +238 -200
- package/bundle/{chunk-JEZOSEWG.js → chunk-SRWJIAIP.js} +2 -0
- package/bundle/{chunk-OUM6SEVD.js → chunk-UC22RDXP.js} +8 -4
- package/bundle/{chunk-W2BZS6UC.js → chunk-VMJGZHUL.js} +9 -5
- package/bundle/{chunk-MIX3MCIF.js → chunk-WANQBKAZ.js} +12 -7
- package/bundle/{chunk-LUNVS6KP.js → chunk-WHHRG32M.js} +27 -20
- package/bundle/{chunk-C22YEYFZ.js → chunk-XIQKWTFY.js} +5 -5
- package/bundle/{chunk-YLU5JFW2.js → chunk-XYIVVS3A.js} +7 -3
- package/bundle/{chunk-R3NH5XAL.js → chunk-YVDKGAEO.js} +5 -4
- package/bundle/{chunk-4FFKVLBG.js → chunk-ZWGOHOGI.js} +5 -5
- package/bundle/control-channel.js +3 -3
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +3 -3
- package/bundle/preflight.js +13 -11
- package/bundle/project-panes.js +5 -5
- package/bundle/shared-types.js +1 -1
- package/bundle/workflow-resources.js +1 -1
- package/docs/configuration.md +12 -3
- package/docs/models.md +1 -1
- package/docs/observability.md +10 -2
- package/docs/tool-reference.md +5 -2
- package/docs/watchdog.md +3 -2
- package/docs/workflows.md +1 -1
- package/package.json +1 -1
- package/skills/pi-subagents/SKILL.md +1 -1
- package/src/agents/agents.d.ts +2 -0
- package/src/agents/agents.js +4 -0
- package/src/api/preflight.d.ts +1 -0
- package/src/api/preflight.js +2 -1
- package/src/extension/config.js +3 -0
- package/src/extension/public-execution.js +4 -2
- package/src/extension/reply-workflow-script.js +10 -1
- package/src/extension/schemas.d.ts +1 -0
- package/src/extension/schemas.js +2 -0
- package/src/extension/subagent-options.d.ts +2 -0
- package/src/extension/subagent-options.js +10 -4
- package/src/inspectors/herdr/project-panes.d.ts +2 -0
- package/src/inspectors/herdr/project-panes.js +7 -1
- package/src/inspectors/shell-command.d.ts +2 -1
- package/src/inspectors/shell-command.js +7 -5
- package/src/runs/background/active-async-capacity.js +2 -1
- package/src/runs/background/active-run-index.d.ts +1 -0
- package/src/runs/background/active-run-index.js +3 -0
- package/src/runs/background/async-execution.d.ts +2 -0
- package/src/runs/background/async-execution.js +6 -3
- package/src/runs/background/async-retention.js +48 -12
- package/src/runs/background/async-status.js +32 -17
- package/src/runs/background/process-terminal.d.ts +6 -0
- package/src/runs/background/process-terminal.js +34 -2
- package/src/runs/background/retained-children.js +1 -1
- package/src/runs/background/run-status.js +2 -1
- package/src/runs/background/stale-run-reconciler.d.ts +8 -0
- package/src/runs/background/stale-run-reconciler.js +38 -8
- package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
- package/src/runs/background/workflow-terminal-proof.js +4 -4
- package/src/runs/foreground/execution.js +7 -9
- package/src/runs/foreground/subagent-executor.d.ts +2 -0
- package/src/runs/foreground/subagent-executor.js +129 -45
- package/src/runs/shared/fast-mode-extension.d.ts +2 -1
- package/src/runs/shared/fast-mode-extension.js +5 -3
- package/src/runs/shared/herdr-pane-host.js +10 -2
- package/src/runs/shared/mcp-config-sources.d.ts +1 -0
- package/src/runs/shared/mcp-config-sources.js +1 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.js +1 -0
- package/src/shared/capacity-resilient-json.d.ts +7 -3
- package/src/shared/capacity-resilient-json.js +8 -6
- package/src/shared/disabled-features.d.ts +4 -0
- package/src/shared/disabled-features.js +1 -0
- package/src/shared/types.d.ts +19 -0
- package/src/shared/types.js +2 -0
- package/src/tui/fleet-transcript.js +21 -9
- package/src/tui/fleet.js +1 -0
- package/src/watchdog/runtime.d.ts +4 -0
- package/src/watchdog/runtime.js +50 -12
- package/src/watchdog/turn-delta.d.ts +2 -0
- package/src/watchdog/turn-delta.js +21 -0
- package/src/workflows/structured-workflow-scripts.js +6 -4
- package/src/workflows/workflow-resources.js +4 -2
- package/src/workflows/workflow-revival.d.ts +6 -0
- package/src/workflows/workflow-revival.js +1 -1
|
@@ -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,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatShellCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-72334PEI.js";
|
|
4
4
|
import {
|
|
5
5
|
getProjectSubagentsDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5J2RTMKW.js";
|
|
7
7
|
import {
|
|
8
8
|
getPiSpawnCommand,
|
|
9
9
|
writeAtomicJson
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F4NSLXB2.js";
|
|
11
11
|
|
|
12
12
|
// src/inspectors/herdr/project-panes.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -389,10 +389,14 @@ async function inspectPane(client, paneId, signal) {
|
|
|
389
389
|
if (!runtime) return projectPaneError("INVALID_PANE_RESPONSE", `Herdr pane get returned no pane runtime for '${paneId}'.`, { details: live.data });
|
|
390
390
|
return { ok: true, data: runtime };
|
|
391
391
|
}
|
|
392
|
+
function projectPaneShellFlavor(platform, shell) {
|
|
393
|
+
if (platform !== "win32") return "auto";
|
|
394
|
+
return /(^|[\\/])(bash|zsh|sh|dash|ksh)(\.exe)?$/i.test(shell ?? "") ? "posix" : "auto";
|
|
395
|
+
}
|
|
392
396
|
function projectPaneCommand(message) {
|
|
393
397
|
const args = message?.trim() ? [message.trim()] : [];
|
|
394
398
|
const command = getPiSpawnCommand(args);
|
|
395
|
-
return formatShellCommand(command.command, command.args);
|
|
399
|
+
return formatShellCommand(command.command, command.args, process.platform, projectPaneShellFlavor(process.platform, process.env.SHELL));
|
|
396
400
|
}
|
|
397
401
|
function canonicalRuntimePath(value) {
|
|
398
402
|
if (!value) return void 0;
|
|
@@ -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
|
|
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", ...
|
|
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)
|
|
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-
|
|
10
|
+
} from "./chunk-C45WQQZX.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ACTHBJUI.js";
|
|
14
14
|
import {
|
|
15
15
|
ensureSupervisorChannelDir
|
|
16
|
-
} from "./chunk-
|
|
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-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-F4NSLXB2.js";
|
|
43
|
+
import "./chunk-SRWJIAIP.js";
|
|
44
44
|
import "./chunk-YFCK7H2S.js";
|
|
45
45
|
import "./chunk-QXASAHIA.js";
|
|
46
46
|
|
|
@@ -517,14 +517,19 @@ var herdrPaneHost = {
|
|
|
517
517
|
return { owned, terminalId };
|
|
518
518
|
},
|
|
519
519
|
async prompt(connection, identity, text, options = {}) {
|
|
520
|
-
const clock = options.clock ?? { now: () => Date.now(), wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }, deadline = clock.now() + (options.timeoutMs ??
|
|
520
|
+
const clock = options.clock ?? { now: () => Date.now(), wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }, deadline = clock.now() + (options.timeoutMs ?? 2e4), pollMs = options.pollMs ?? 100;
|
|
521
521
|
for (; ; ) {
|
|
522
522
|
try {
|
|
523
523
|
await connection.client.call("agent.prompt", { target: identity.agentName, text });
|
|
524
524
|
return;
|
|
525
525
|
} catch (error) {
|
|
526
526
|
if (!(error instanceof Error) || !error.message.includes("is not an active named agent") || clock.now() >= deadline) throw error;
|
|
527
|
-
|
|
527
|
+
const remainingMs = deadline - clock.now();
|
|
528
|
+
try {
|
|
529
|
+
await connection.client.call("agent.wait", { target: identity.agentName, until: ["idle", "done"], timeout_ms: remainingMs }, remainingMs + 5e3);
|
|
530
|
+
} catch {
|
|
531
|
+
}
|
|
532
|
+
await clock.wait(Math.min(pollMs, Math.max(0, deadline - clock.now())));
|
|
528
533
|
if (options.stopped?.()) throw new Error("Remote Pi prompt was not sent because the run was stopped.", { cause: error });
|
|
529
534
|
}
|
|
530
535
|
}
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
startWatchdogDiffBaselineCapture,
|
|
12
12
|
writeUserWatchdogEnabled,
|
|
13
13
|
writeWatchdogModelSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RIBMW6V3.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveGitRepositoryIdentity
|
|
17
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
60
|
+
} from "./chunk-SIB2GQHL.js";
|
|
61
61
|
import {
|
|
62
62
|
requestAsyncCommand,
|
|
63
63
|
watchAsyncControlInbox
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-37EJGDYO.js";
|
|
65
65
|
import {
|
|
66
66
|
supervisorChannelDir
|
|
67
|
-
} from "./chunk-
|
|
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-
|
|
74
|
+
} from "./chunk-UC22RDXP.js";
|
|
75
75
|
import {
|
|
76
76
|
getProjectSubagentsDir
|
|
77
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
4952
|
-
|
|
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-
|
|
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
|
|
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
|
|
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
|
-
|
|
8136
|
-
|
|
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-
|
|
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-
|
|
37
|
+
} from "./chunk-SIB2GQHL.js";
|
|
38
38
|
import {
|
|
39
39
|
deliverStopRequest,
|
|
40
40
|
stopInboxClosedPath
|
|
41
|
-
} from "./chunk-
|
|
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-
|
|
53
|
+
} from "./chunk-F4NSLXB2.js";
|
|
54
54
|
import {
|
|
55
55
|
DIRS
|
|
56
|
-
} from "./chunk-
|
|
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-
|
|
14
|
+
} from "./chunk-SIB2GQHL.js";
|
|
15
15
|
import {
|
|
16
16
|
getAgentDir,
|
|
17
17
|
readStatus,
|
|
18
18
|
validatePermissionConfig,
|
|
19
19
|
writePrivateAtomicJson
|
|
20
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
10
|
+
} from "./chunk-F4NSLXB2.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMP_ROOT_DIR
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SRWJIAIP.js";
|
|
14
14
|
import {
|
|
15
15
|
capabilityCeilingAgentRestrictionSources,
|
|
16
16
|
intersectSubagentCapabilityCeilings,
|
|
@@ -51,7 +51,7 @@ function isMcpServerDefinition(value) {
|
|
|
51
51
|
for (const field of ["env", "headers"]) {
|
|
52
52
|
if (value[field] !== void 0 && !isStringRecord(value[field])) return false;
|
|
53
53
|
}
|
|
54
|
-
for (const field of ["exposeResources", "literalEnv", "inheritEnv"]) {
|
|
54
|
+
for (const field of ["exposeResources", "literalEnv", "inheritEnv", "openUi"]) {
|
|
55
55
|
if (value[field] !== void 0 && typeof value[field] !== "boolean") return false;
|
|
56
56
|
}
|
|
57
57
|
if (value.requestHeadersCommand !== void 0 && !isRequestHeadersCommand(value.requestHeadersCommand)) return false;
|
|
@@ -802,7 +802,8 @@ function computeMcpServerHash(definition) {
|
|
|
802
802
|
exposeResources: definition.exposeResources,
|
|
803
803
|
includeTools: definition.includeTools,
|
|
804
804
|
excludeTools: definition.excludeTools,
|
|
805
|
-
protocolVersion: definition.protocolVersion
|
|
805
|
+
protocolVersion: definition.protocolVersion,
|
|
806
|
+
...definition.openUi === false ? { openUi: false } : {}
|
|
806
807
|
};
|
|
807
808
|
return createHash("sha256").update(stableStringify(identity)).digest("hex");
|
|
808
809
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildWorkflowChatProgressRows
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XIQKWTFY.js";
|
|
4
4
|
import {
|
|
5
5
|
aggregateStepStatus,
|
|
6
6
|
contextModeBadge,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
projectAsyncWorkflowRows,
|
|
23
23
|
projectWorkflowChecklist,
|
|
24
24
|
workflowGraphStageNodes
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2LEBXCLU.js";
|
|
26
26
|
import {
|
|
27
27
|
isStaleExtensionContextError,
|
|
28
28
|
isUnboundExtensionRuntimeError,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
formatWorkflowJsonPreview,
|
|
35
35
|
hostStepReportName,
|
|
36
36
|
hostStepVerdictLabel
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SIB2GQHL.js";
|
|
38
38
|
import {
|
|
39
39
|
snapshotExternalRuns
|
|
40
40
|
} from "./chunk-UKG4V45O.js";
|
|
@@ -52,12 +52,12 @@ import {
|
|
|
52
52
|
getSingleResultOutput,
|
|
53
53
|
shortenPath,
|
|
54
54
|
unresolvedChildWatchdogBlockers
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-F4NSLXB2.js";
|
|
56
56
|
import {
|
|
57
57
|
MAX_WIDGET_JOBS,
|
|
58
58
|
WIDGET_ANIMATION_INTERVAL_MS,
|
|
59
59
|
WIDGET_KEY
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-SRWJIAIP.js";
|
|
61
61
|
import {
|
|
62
62
|
previewDisplayText,
|
|
63
63
|
sanitizeDisplayText,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestAsyncStop
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-37EJGDYO.js";
|
|
4
4
|
import "./chunk-NIXWDZZV.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-F4NSLXB2.js";
|
|
6
|
+
import "./chunk-SRWJIAIP.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
|
9
9
|
export {
|
package/bundle/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function readInstalledPackageVersion() {
|
|
|
17
17
|
var loadedPackageVersion = readInstalledPackageVersion();
|
|
18
18
|
|
|
19
19
|
// index.ts
|
|
20
|
-
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-
|
|
20
|
+
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-7HPZIT4W.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-4DA22WRU.js")).default;
|
|
21
21
|
function registerSubagentExtension(pi) {
|
|
22
22
|
const installedVersion = readInstalledPackageVersion();
|
|
23
23
|
if (installedVersion !== loadedPackageVersion) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveIntercomSessionTarget
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CPWZN5KM.js";
|
|
4
4
|
import "./chunk-7F6RKT6W.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-F4NSLXB2.js";
|
|
6
|
+
import "./chunk-SRWJIAIP.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
|
9
9
|
export {
|
package/bundle/preflight.js
CHANGED
|
@@ -2,22 +2,23 @@ import {
|
|
|
2
2
|
buildEffectiveSystemPrompt,
|
|
3
3
|
canPreferForkFromSnapshot,
|
|
4
4
|
resolveSubagentLaunchContext
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-PSB3VLMH.js";
|
|
6
|
+
import "./chunk-KNVQTRSY.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XYIVVS3A.js";
|
|
10
10
|
import {
|
|
11
11
|
nestedResultsPath,
|
|
12
12
|
processTerminalCandidatePath,
|
|
13
13
|
processTerminalPath,
|
|
14
|
-
resultFilePath
|
|
15
|
-
|
|
14
|
+
resultFilePath,
|
|
15
|
+
unobservedRunnerExitPath
|
|
16
|
+
} from "./chunk-SIB2GQHL.js";
|
|
16
17
|
import {
|
|
17
18
|
applyIntercomBridgeToAgent,
|
|
18
19
|
resolveIntercomBridge,
|
|
19
20
|
validateIntercomBridgeConfig
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CPWZN5KM.js";
|
|
21
22
|
import {
|
|
22
23
|
AGENT_DEFINITION_PROJECTION_VERSION,
|
|
23
24
|
resolveLaunchBinding,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
import {
|
|
27
28
|
applyThinkingSuffix,
|
|
28
29
|
resolvePiLaunchToolPlan
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YVDKGAEO.js";
|
|
30
31
|
import {
|
|
31
32
|
assertRequiredChildExtensionsAdmitted,
|
|
32
33
|
resolveRequiredChildExtensions
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
import {
|
|
35
36
|
getArtifactPaths,
|
|
36
37
|
getArtifactsDir
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-5J2RTMKW.js";
|
|
38
39
|
import {
|
|
39
40
|
assertClaudeCodeModelScope,
|
|
40
41
|
assertThinkingWithinCeiling,
|
|
@@ -61,12 +62,12 @@ import {
|
|
|
61
62
|
resolveSkillsWithFallback,
|
|
62
63
|
resolveStepBehavior,
|
|
63
64
|
unknownAgentDiagnosticContext
|
|
64
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-F4NSLXB2.js";
|
|
65
66
|
import {
|
|
66
67
|
DIRS,
|
|
67
68
|
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
68
69
|
TEMP_ROOT_DIR
|
|
69
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-SRWJIAIP.js";
|
|
70
71
|
import "./chunk-YFCK7H2S.js";
|
|
71
72
|
import {
|
|
72
73
|
capabilityCeilingAgentRestrictionMessage,
|
|
@@ -409,7 +410,8 @@ async function resolveSubagentLaunchContract(input) {
|
|
|
409
410
|
statusPath: path.join(lifecycleAsyncDir, "status.json"),
|
|
410
411
|
eventsPath: path.join(lifecycleAsyncDir, "events.jsonl"),
|
|
411
412
|
processTerminalPath: processTerminalPath(lifecycleAsyncDir),
|
|
412
|
-
processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir)
|
|
413
|
+
processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir),
|
|
414
|
+
unobservedRunnerExitPath: unobservedRunnerExitPath(lifecycleAsyncDir)
|
|
413
415
|
}
|
|
414
416
|
},
|
|
415
417
|
protocol: {
|
package/bundle/project-panes.js
CHANGED
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
openProjectPane,
|
|
9
9
|
projectPaneBindingPath,
|
|
10
10
|
readProjectPaneBinding
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UC22RDXP.js";
|
|
12
|
+
import "./chunk-72334PEI.js";
|
|
13
|
+
import "./chunk-5J2RTMKW.js";
|
|
14
|
+
import "./chunk-F4NSLXB2.js";
|
|
15
|
+
import "./chunk-SRWJIAIP.js";
|
|
16
16
|
import "./chunk-YFCK7H2S.js";
|
|
17
17
|
import "./chunk-QXASAHIA.js";
|
|
18
18
|
export {
|
package/bundle/shared-types.js
CHANGED