pi-subagents 0.84.0 → 0.86.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 +83 -0
- package/bundle/agents.js +3 -3
- package/bundle/child-tool-plan.js +2 -2
- package/bundle/{chunk-JG4QKI5M.js → chunk-2IYBCYFU.js} +214 -97
- package/bundle/{chunk-V2BZYLEP.js → chunk-374MZFF4.js} +7 -2
- package/bundle/{chunk-4E7BKDTX.js → chunk-3RKFH2UZ.js} +11 -156
- package/bundle/{chunk-F4ASL6OV.js → chunk-5H4BICQZ.js} +1 -1
- package/bundle/{chunk-PALJGGYC.js → chunk-6VD7BGIC.js} +6 -3
- package/bundle/{chunk-C5P5CHYK.js → chunk-77ASNIEM.js} +1 -1
- package/bundle/{chunk-XDQORLZ5.js → chunk-7ADDXUGF.js} +15 -6
- package/bundle/{chunk-PV63UFUR.js → chunk-7QA7ZA46.js} +183 -28
- package/bundle/{chunk-NKQ6JNAS.js → chunk-7ZUFN6ME.js} +2 -1
- package/bundle/{chunk-SSG7IEP5.js → chunk-A637IMAO.js} +2 -2
- package/bundle/{chunk-L3WFKBEI.js → chunk-BGXEAYUM.js} +247 -153
- package/bundle/{chunk-J5YL7LYR.js → chunk-BU6PFPVX.js} +59 -27
- package/bundle/{chunk-DZDETGRJ.js → chunk-BWC2LVII.js} +259 -216
- package/bundle/{chunk-CGN2TVE7.js → chunk-GJGTMLPE.js} +322 -18
- package/bundle/{chunk-D3JAFGMO.js → chunk-GRJHIXYF.js} +1 -1
- package/bundle/chunk-HXRB42AF.js +108 -0
- package/bundle/{chunk-LFDBD4PW.js → chunk-LGINOOY5.js} +2 -2
- package/bundle/{chunk-G2Z6ZH26.js → chunk-NAFLUJ26.js} +1 -1
- package/bundle/{chunk-235AWJUQ.js → chunk-O3YH7XIY.js} +324 -111
- package/bundle/{chunk-2DHZTCOL.js → chunk-PYOAIN3V.js} +2 -2
- package/bundle/{chunk-LNRJCP2Y.js → chunk-QGO6HXHG.js} +417 -242
- package/bundle/{chunk-VQVVHSY6.js → chunk-QM3JGE4W.js} +22 -11
- package/bundle/{chunk-2S4K53MV.js → chunk-S2Q75LP3.js} +1 -1
- package/bundle/{chunk-NENDSQUY.js → chunk-UR7OW5S7.js} +9 -6
- package/bundle/{chunk-AKOIVLA5.js → chunk-WN2E5XHN.js} +135 -77
- package/bundle/{chunk-2D52JFLF.js → chunk-YK3QYNLE.js} +41 -117
- package/bundle/{chunk-7BWGNDNK.js → chunk-ZJJCPV3L.js} +190 -1177
- package/bundle/chunk-ZPY5QZCS.js +1067 -0
- package/bundle/control-channel.js +2 -2
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +2 -2
- package/bundle/preflight.js +8 -8
- package/bundle/project-panes.js +3 -3
- package/docs/agents.md +23 -2
- package/docs/configuration.md +4 -4
- package/docs/extension-api.md +16 -1
- package/docs/tool-reference.md +2 -0
- package/docs/workflows.md +30 -2
- package/package.json +1 -1
- package/src/agents/agent-management.js +27 -11
- package/src/agents/agent-memory.d.ts +1 -4
- package/src/agents/agent-memory.js +1 -4
- package/src/agents/agents.d.ts +1 -3
- package/src/agents/agents.js +7 -6
- package/src/agents/frontmatter.js +1 -8
- package/src/agents/global-npm-root.d.ts +1 -0
- package/src/agents/global-npm-root.js +11 -3
- package/src/agents/skills.d.ts +0 -3
- package/src/agents/skills.js +0 -3
- package/src/extension/config.js +7 -1
- package/src/extension/herdr-pi-bridge.js +10 -2
- package/src/extension/index.d.ts +0 -13
- package/src/extension/index.js +43 -32
- package/src/extension/public-execution.d.ts +1 -0
- package/src/extension/public-execution.js +4 -0
- package/src/extension/reply-workflow-script.js +24 -4
- package/src/extension/schemas.d.ts +8 -3
- package/src/extension/schemas.js +5 -3
- package/src/extension/session-switch.d.ts +25 -0
- package/src/extension/session-switch.js +138 -0
- package/src/extension/subagent-guide.d.ts +1 -1
- package/src/extension/subagent-guide.js +1 -1
- package/src/extension/subagent-launch-tool.d.ts +25 -0
- package/src/extension/subagent-launch-tool.js +48 -0
- package/src/extension/tool-activation.js +35 -12
- package/src/extension/tool-description.d.ts +1 -1
- package/src/extension/tool-description.js +14 -8
- package/src/inspectors/herdr/actions.d.ts +0 -1
- package/src/inspectors/herdr/actions.js +0 -1
- package/src/inspectors/session-roots-codec.d.ts +0 -1
- package/src/inspectors/session-roots-codec.js +0 -1
- package/src/inspectors/tmux/actions.d.ts +0 -1
- package/src/inspectors/tmux/actions.js +0 -1
- package/src/integrations/herdr-status.js +3 -8
- package/src/intercom/native-supervisor-channel.js +65 -9
- package/src/runs/background/async-execution.d.ts +5 -9
- package/src/runs/background/async-execution.js +62 -27
- package/src/runs/background/async-job-tracker.js +12 -0
- package/src/runs/background/async-resume.d.ts +2 -1
- package/src/runs/background/async-resume.js +112 -39
- package/src/runs/background/async-retention.js +6 -1
- package/src/runs/background/auto-drain.js +2 -1
- package/src/runs/background/boot-id.d.ts +1 -3
- package/src/runs/background/boot-id.js +1 -3
- package/src/runs/background/completion-batcher.d.ts +3 -4
- package/src/runs/background/completion-batcher.js +2 -3
- package/src/runs/background/control-channel.d.ts +0 -6
- package/src/runs/background/control-channel.js +0 -6
- package/src/runs/background/fleet-view.js +2 -3
- package/src/runs/background/notify.d.ts +0 -2
- package/src/runs/background/notify.js +0 -2
- package/src/runs/background/result-watcher.d.ts +1 -0
- package/src/runs/background/result-watcher.js +59 -29
- package/src/runs/background/resume-guidance.js +4 -2
- package/src/runs/background/retained-children.js +2 -1
- package/src/runs/background/run-child-session.d.ts +0 -1
- package/src/runs/background/run-child-session.js +1 -1
- package/src/runs/background/run-status.js +9 -7
- package/src/runs/background/scheduled-runs.d.ts +3 -1
- package/src/runs/background/scheduled-runs.js +13 -16
- package/src/runs/background/subagent-runner.d.ts +2 -4
- package/src/runs/background/subagent-runner.js +15 -12
- package/src/runs/background/subagent-wait.js +12 -15
- package/src/runs/background/wait-config.d.ts +2 -0
- package/src/runs/background/wait-config.js +17 -3
- package/src/runs/background/wait-tool.js +4 -2
- package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
- package/src/runs/background/workflow-terminal-proof.js +0 -1
- package/src/runs/foreground/execution.d.ts +0 -3
- package/src/runs/foreground/execution.js +17 -9
- package/src/runs/foreground/subagent-executor.d.ts +3 -2
- package/src/runs/foreground/subagent-executor.js +107 -26
- package/src/runs/shared/acceptance.js +69 -26
- package/src/runs/shared/child-commands.js +15 -2
- package/src/runs/shared/child-hooks.d.ts +1 -7
- package/src/runs/shared/child-hooks.js +13 -5
- package/src/runs/shared/child-launch.js +6 -2
- package/src/runs/shared/child-runtime-config.d.ts +0 -1
- package/src/runs/shared/child-session.d.ts +1 -1
- package/src/runs/shared/child-session.js +21 -2
- package/src/runs/shared/child-tool-plan.d.ts +0 -1
- package/src/runs/shared/child-tool-plan.js +0 -1
- package/src/runs/shared/claude-code-adapter.js +11 -0
- package/src/runs/shared/external-cli-contract.d.ts +49 -0
- package/src/runs/shared/external-cli-contract.js +18 -13
- package/src/runs/shared/external-cli-runner.js +26 -6
- package/src/runs/shared/herdr-connection.js +2 -1
- package/src/runs/shared/herdr-pane-host.d.ts +2 -2
- package/src/runs/shared/herdr-pane-host.js +17 -1
- package/src/runs/shared/herdr-placed-run.js +48 -22
- package/src/runs/shared/lane-metadata.d.ts +0 -1
- package/src/runs/shared/lane-metadata.js +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.js +8 -1
- package/src/runs/shared/model-resolution-diagnostic.d.ts +0 -1
- package/src/runs/shared/model-resolution.d.ts +2 -2
- package/src/runs/shared/model-resolution.js +7 -1
- package/src/runs/shared/model-scope.d.ts +1 -5
- package/src/runs/shared/model-scope.js +1 -5
- package/src/runs/shared/mutation-evidence.d.ts +1 -1
- package/src/runs/shared/mutation-evidence.js +52 -7
- package/src/runs/shared/nested-events.d.ts +1 -0
- package/src/runs/shared/nested-events.js +1 -1
- package/src/runs/shared/parallel-utils.d.ts +0 -1
- package/src/runs/shared/permissions.js +5 -3
- package/src/runs/shared/placement-host.d.ts +5 -1
- package/src/runs/shared/rex-pane-host.d.ts +0 -1
- package/src/runs/shared/rex-pane-host.js +0 -2
- package/src/runs/shared/run-launch-folder.d.ts +12 -0
- package/src/runs/shared/run-launch-folder.js +21 -0
- package/src/runs/shared/runner-launcher.d.ts +12 -1
- package/src/runs/shared/runner-launcher.js +16 -0
- package/src/runs/shared/single-output.d.ts +3 -3
- package/src/runs/shared/single-output.js +5 -3
- package/src/runs/shared/structured-output.d.ts +8 -0
- package/src/runs/shared/structured-output.js +40 -5
- package/src/runs/shared/subagent-prompt-runtime.d.ts +0 -1
- package/src/runs/shared/subagent-prompt-runtime.js +4 -2
- package/src/runs/shared/tool-timeout.js +2 -1
- package/src/runs/shared/worktree-cleanup-plan.d.ts +0 -1
- package/src/runs/shared/worktree-cleanup-plan.js +0 -1
- package/src/runs/shared/worktree.d.ts +3 -0
- package/src/runs/shared/worktree.js +20 -0
- package/src/shared/capacity-resilient-json.d.ts +1 -1
- package/src/shared/child-cache-retention.d.ts +1 -2
- package/src/shared/child-cache-retention.js +1 -2
- package/src/shared/fleet-transcript-reader.d.ts +51 -0
- package/src/shared/fleet-transcript-reader.js +333 -0
- package/src/shared/formatters.d.ts +0 -18
- package/src/shared/formatters.js +0 -18
- package/src/shared/session-succession.d.ts +16 -1
- package/src/shared/session-succession.js +41 -2
- package/src/shared/session-warnings.d.ts +7 -0
- package/src/shared/session-warnings.js +26 -0
- package/src/shared/settings.d.ts +0 -23
- package/src/shared/settings.js +3 -35
- package/src/shared/types.d.ts +85 -59
- package/src/shared/types.js +0 -12
- package/src/shared/utils.d.ts +0 -14
- package/src/shared/utils.js +0 -22
- package/src/shared/wait-tool-name.d.ts +8 -0
- package/src/shared/wait-tool-name.js +13 -0
- package/src/slash/slash-commands.js +2 -1
- package/src/slash/subagent-cost.d.ts +3 -2
- package/src/slash/subagent-cost.js +22 -3
- package/src/slash/subagents-admin.js +0 -1
- package/src/tui/fleet-status.d.ts +0 -5
- package/src/tui/fleet-status.js +4 -24
- package/src/tui/fleet-transcript.d.ts +1 -44
- package/src/tui/fleet-transcript.js +1 -327
- package/src/tui/fleet.js +6 -4
- package/src/tui/render.d.ts +0 -9
- package/src/tui/render.js +161 -66
- package/src/tui/subagent-messages.js +3 -2
- package/src/watchdog/register-child.d.ts +2 -3
- package/src/watchdog/register-child.js +2 -3
- package/src/watchdog/turn-delta.js +2 -1
- package/src/workflows/scripted-workflow.js +241 -20
- package/src/workflows/workflow-launch-record.d.ts +15 -6
- package/src/workflows/workflow-launch-record.js +30 -12
- package/src/workflows/workflow-receipt.js +36 -53
- package/src/workflows/workflow-resume-claim.js +2 -2
- package/src/workflows/workflow-resume.d.ts +1 -1
- package/src/workflows/workflow-resume.js +11 -8
- package/src/workflows/workflow-script-worker.d.ts +13 -0
- package/src/workflows/workflow-script-worker.js +79 -0
- package/workflow-script-process.cjs +36 -0
- package/workflow-script-worker.cjs +4 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getAgentDir,
|
|
8
8
|
getConfigDirName,
|
|
9
9
|
getProjectConfigDir
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QGO6HXHG.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMP_ROOT_DIR
|
|
13
13
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -353,7 +353,12 @@ function readJson(filePath) {
|
|
|
353
353
|
// src/runs/shared/mcp-direct-tool-grant.ts
|
|
354
354
|
var BUILTIN_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
|
|
355
355
|
function normalizeMcpDirectToolSelectors(selectors) {
|
|
356
|
-
return [...new Set((selectors ?? []).map(
|
|
356
|
+
return [...new Set((selectors ?? []).map(trimTrailingSlashes).filter(Boolean))];
|
|
357
|
+
}
|
|
358
|
+
function trimTrailingSlashes(selector) {
|
|
359
|
+
let end = selector.length;
|
|
360
|
+
while (end > 0 && selector[end - 1] === "/") end -= 1;
|
|
361
|
+
return selector.slice(0, end);
|
|
357
362
|
}
|
|
358
363
|
function parseMcpDirectToolSelectors(selectors) {
|
|
359
364
|
const servers = /* @__PURE__ */ new Set();
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isTrustedRecordedSessionFile,
|
|
3
3
|
resolveSubagentRunId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UR7OW5S7.js";
|
|
5
5
|
import {
|
|
6
6
|
agentStreamOptions,
|
|
7
7
|
opencodeSessionHeaders,
|
|
8
|
-
ownsRun,
|
|
9
8
|
resolveAsyncResumeTarget
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BGXEAYUM.js";
|
|
10
|
+
import {
|
|
11
|
+
ownsRun
|
|
12
|
+
} from "./chunk-HXRB42AF.js";
|
|
11
13
|
import {
|
|
12
14
|
currentCompletionOwnerId,
|
|
13
15
|
listMissions,
|
|
@@ -16,12 +18,12 @@ import {
|
|
|
16
18
|
reconcileAsyncRun,
|
|
17
19
|
resolveAuthorityDecision,
|
|
18
20
|
resolveMissionStoreLocation
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GJGTMLPE.js";
|
|
20
22
|
import {
|
|
21
23
|
deliverInterruptRequest,
|
|
22
24
|
queueRevivalBrief,
|
|
23
25
|
requestAsyncSteer
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5H4BICQZ.js";
|
|
25
27
|
import {
|
|
26
28
|
formatShellCommand
|
|
27
29
|
} from "./chunk-7J4ZXMY7.js";
|
|
@@ -32,7 +34,7 @@ import {
|
|
|
32
34
|
tryLease,
|
|
33
35
|
writeAtomicJson,
|
|
34
36
|
writePrivateAtomicJson
|
|
35
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-QGO6HXHG.js";
|
|
36
38
|
import {
|
|
37
39
|
DIRS
|
|
38
40
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -603,15 +605,12 @@ async function steerWorkflowForegroundTarget(input) {
|
|
|
603
605
|
return { content: [{ type: "text", text: steeringReceipt(message, `Steering failed for foreground run ${control.runId} (request ${requestId}): ${outcome.reason ?? "unknown error"}`) }], isError: true, details: { mode: "management", results: [], steering } };
|
|
604
606
|
}
|
|
605
607
|
|
|
606
|
-
// src/
|
|
608
|
+
// src/shared/fleet-transcript-reader.ts
|
|
607
609
|
import * as fs3 from "node:fs";
|
|
608
610
|
import * as path4 from "node:path";
|
|
609
|
-
import { getLanguageFromPath, highlightCode } from "@earendil-works/pi-coding-agent";
|
|
610
|
-
import { Markdown, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
611
611
|
var DEFAULT_MAX_RECORDS = 240;
|
|
612
612
|
var DEFAULT_MAX_BYTES = 2 * 1024 * 1024;
|
|
613
613
|
var MAX_MESSAGE_CHARS = 64 * 1024;
|
|
614
|
-
var TOOL_PREVIEW_LINES = 7;
|
|
615
614
|
function sanitizeJsonDisplayValue(value) {
|
|
616
615
|
if (typeof value === "string") {
|
|
617
616
|
const safe = safeTerminalText(value);
|
|
@@ -895,151 +894,6 @@ function readFleetTranscript(filePath, options) {
|
|
|
895
894
|
...warnings.length ? { warning: safeTerminalText(warnings.join(" ")) } : {}
|
|
896
895
|
};
|
|
897
896
|
}
|
|
898
|
-
function statusGlyph(event, theme) {
|
|
899
|
-
if (event.status === "running") return theme.fg("warning", "\u25CF");
|
|
900
|
-
if (event.status === "error") return theme.fg("error", "\u2717");
|
|
901
|
-
return theme.fg("success", "\u2713");
|
|
902
|
-
}
|
|
903
|
-
function jsonScalar(value) {
|
|
904
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
905
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
906
|
-
return void 0;
|
|
907
|
-
}
|
|
908
|
-
function parseToolArgs(event) {
|
|
909
|
-
if (!event.argsPayload) return void 0;
|
|
910
|
-
try {
|
|
911
|
-
return objectValue(JSON.parse(event.argsPayload));
|
|
912
|
-
} catch {
|
|
913
|
-
return void 0;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
function toolDuration(event) {
|
|
917
|
-
if (event.startedAt === void 0 || event.endedAt === void 0) return void 0;
|
|
918
|
-
return `${((event.endedAt - event.startedAt) / 1e3).toFixed(1)}s`;
|
|
919
|
-
}
|
|
920
|
-
function renderExpandedTool(event, width, theme) {
|
|
921
|
-
const lines = [];
|
|
922
|
-
const args = parseToolArgs(event);
|
|
923
|
-
const glyph = statusGlyph(event, theme);
|
|
924
|
-
const output = event.output ?? event.error;
|
|
925
|
-
const outputColor = event.status === "error" ? "error" : "toolOutput";
|
|
926
|
-
if (event.name === "bash") {
|
|
927
|
-
const command = jsonScalar(args?.command) ?? event.args ?? "(unknown command)";
|
|
928
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(`$ ${command}`))}`, width, theme));
|
|
929
|
-
if (output) {
|
|
930
|
-
for (const outputLine of output.replace(/\s+$/, "").split(/\r?\n/)) {
|
|
931
|
-
for (const wrapped of renderWrapped(theme.fg(outputColor, outputLine), Math.max(1, width - 4))) {
|
|
932
|
-
lines.push(railLine(` ${wrapped}`, width, theme));
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
const duration = toolDuration(event);
|
|
937
|
-
if (duration) lines.push(railLine(theme.fg("dim", ` Took ${duration}`), width, theme));
|
|
938
|
-
return lines;
|
|
939
|
-
}
|
|
940
|
-
if (event.name === "read") {
|
|
941
|
-
const filePath = jsonScalar(args?.path ?? args?.file_path);
|
|
942
|
-
const language = filePath ? getLanguageFromPath(filePath) : void 0;
|
|
943
|
-
const rendered = !output ? [] : event.status === "error" ? output.split("\n").map((line) => theme.fg("error", line)) : language ? highlightCode(output, language) : output.split("\n");
|
|
944
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(`read ${filePath ?? event.args ?? ""}`))}`, width, theme));
|
|
945
|
-
for (const line of rendered) {
|
|
946
|
-
for (const wrapped of renderWrapped(line, Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
947
|
-
}
|
|
948
|
-
return lines;
|
|
949
|
-
}
|
|
950
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(event.name))}`, width, theme));
|
|
951
|
-
if (event.argsPayload) {
|
|
952
|
-
lines.push(railLine(theme.fg("dim", " args"), width, theme));
|
|
953
|
-
for (const argLine of event.argsPayload.split(/\r?\n/)) {
|
|
954
|
-
for (const wrapped of renderWrapped(theme.fg("muted", argLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
if (output) {
|
|
958
|
-
lines.push(railLine(theme.fg(event.status === "error" ? "error" : "dim", event.status === "error" ? " error" : " output"), width, theme));
|
|
959
|
-
for (const outputLine of output.split(/\r?\n/)) {
|
|
960
|
-
for (const wrapped of renderWrapped(theme.fg(outputColor, outputLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
return lines;
|
|
964
|
-
}
|
|
965
|
-
function bounded(text, width) {
|
|
966
|
-
return truncateToWidth(text, Math.max(0, width));
|
|
967
|
-
}
|
|
968
|
-
function railLine(content, width, theme) {
|
|
969
|
-
return bounded(`${theme.fg("borderMuted", "\u2502")} ${content}`, width);
|
|
970
|
-
}
|
|
971
|
-
function renderWrapped(text, width) {
|
|
972
|
-
return wrapTextWithAnsi(text, Math.max(1, width));
|
|
973
|
-
}
|
|
974
|
-
function renderFleetTranscript(transcript, width, theme, markdownTheme, options = {}) {
|
|
975
|
-
if (width <= 0) return [];
|
|
976
|
-
const lines = [];
|
|
977
|
-
if (transcript.truncated) lines.push(bounded(theme.fg("dim", "\u2191 Earlier activity omitted"), width));
|
|
978
|
-
if (transcript.warning) {
|
|
979
|
-
for (const line of renderWrapped(safeTerminalText(transcript.warning), Math.max(1, width - 2))) {
|
|
980
|
-
lines.push(bounded(`${theme.fg("warning", "!")} ${theme.fg("warning", line)}`, width));
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
for (const rawEvent of transcript.events) {
|
|
984
|
-
const event = safeTranscriptEvent(rawEvent);
|
|
985
|
-
if (event.kind === "tool") {
|
|
986
|
-
if (options.expandedTools && (event.output || event.argsPayload || event.error)) {
|
|
987
|
-
lines.push(...renderExpandedTool(event, width, theme));
|
|
988
|
-
lines.push(railLine(theme.fg("dim", " x to collapse"), width, theme));
|
|
989
|
-
continue;
|
|
990
|
-
}
|
|
991
|
-
const title = theme.fg("toolTitle", theme.bold(event.name));
|
|
992
|
-
const args = event.args ? ` ${theme.fg("dim", event.args)}` : "";
|
|
993
|
-
const suffix = event.status === "running" ? theme.fg("warning", " running") : "";
|
|
994
|
-
lines.push(bounded(`${theme.fg("borderMuted", "\u251C\u2500")} ${statusGlyph(event, theme)} ${title}${args}${suffix}`, width));
|
|
995
|
-
if (event.output && event.status !== "error" && event.name === "bash") {
|
|
996
|
-
const outputLines = event.output.replace(/\s+$/, "").split(/\r?\n/);
|
|
997
|
-
const visible = outputLines.slice(-TOOL_PREVIEW_LINES);
|
|
998
|
-
const hidden = Math.max(0, outputLines.length - visible.length);
|
|
999
|
-
for (const outputLine of visible) {
|
|
1000
|
-
for (const wrapped of renderWrapped(theme.fg("toolOutput", outputLine), Math.max(1, width - 4))) {
|
|
1001
|
-
lines.push(railLine(` ${wrapped}`, width, theme));
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
if (hidden > 0) lines.push(railLine(theme.fg("dim", ` \u2026 ${hidden} earlier lines \xB7 x to expand`), width, theme));
|
|
1005
|
-
const duration = toolDuration(event);
|
|
1006
|
-
lines.push(railLine(theme.fg("dim", ` Took${duration ? ` ${duration}` : ""}`), width, theme));
|
|
1007
|
-
} else if (event.output && event.status !== "error") {
|
|
1008
|
-
const summary = truncateToWidth(event.output.replace(/\s+/g, " ").trim(), Math.max(1, width - 18), "\u2026");
|
|
1009
|
-
if (summary) lines.push(railLine(theme.fg("dim", ` ${summary} \xB7 x to expand`), width, theme));
|
|
1010
|
-
}
|
|
1011
|
-
if (event.error) {
|
|
1012
|
-
for (const errorLine of renderWrapped(event.error, Math.max(1, width - 4))) {
|
|
1013
|
-
lines.push(railLine(theme.fg("error", ` ${errorLine}`), width, theme));
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
continue;
|
|
1017
|
-
}
|
|
1018
|
-
if (event.kind === "notice") {
|
|
1019
|
-
const color = event.tone === "error" ? "error" : event.tone === "warning" ? "warning" : "dim";
|
|
1020
|
-
for (const noticeLine of renderWrapped(event.text, Math.max(1, width - 2))) {
|
|
1021
|
-
lines.push(railLine(theme.fg(color, noticeLine), width, theme));
|
|
1022
|
-
}
|
|
1023
|
-
continue;
|
|
1024
|
-
}
|
|
1025
|
-
const assistant = event.kind === "assistant";
|
|
1026
|
-
const label = assistant ? "Assistant" : "Supervisor";
|
|
1027
|
-
const marker = assistant ? theme.fg("accent", "\u25C6") : theme.fg("warning", "\u25C7");
|
|
1028
|
-
const model = assistant && event.model ? theme.fg("dim", ` \xB7 ${event.model}`) : "";
|
|
1029
|
-
lines.push(bounded(`${marker} ${theme.bold(label)}${model}`, width));
|
|
1030
|
-
if (assistant) {
|
|
1031
|
-
const rendered = new Markdown(event.text, 0, 0, markdownTheme).render(Math.max(1, width - 2));
|
|
1032
|
-
for (const markdownLine of rendered) lines.push(railLine(markdownLine, width, theme));
|
|
1033
|
-
} else {
|
|
1034
|
-
for (const userLine of renderWrapped(event.text, Math.max(1, width - 2))) {
|
|
1035
|
-
lines.push(railLine(userLine, width, theme));
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
lines.push(theme.fg("borderMuted", "\u2502"));
|
|
1039
|
-
}
|
|
1040
|
-
while (lines.length > 0 && visibleWidth(lines.at(-1) ?? "") === 1) lines.pop();
|
|
1041
|
-
return lines;
|
|
1042
|
-
}
|
|
1043
897
|
|
|
1044
898
|
// src/inspectors/types.ts
|
|
1045
899
|
var INSPECTOR_ACTIONS = ["inspector.open", "inspector.command", "inspector.status", "inspector.close"];
|
|
@@ -1325,8 +1179,9 @@ export {
|
|
|
1325
1179
|
resolveWorkflowForegroundSteeringTarget,
|
|
1326
1180
|
steerWorkflowRun,
|
|
1327
1181
|
steerWorkflowForegroundTarget,
|
|
1182
|
+
objectValue,
|
|
1183
|
+
safeTranscriptEvent,
|
|
1328
1184
|
readFleetTranscript,
|
|
1329
|
-
renderFleetTranscript,
|
|
1330
1185
|
INSPECTOR_ACTIONS,
|
|
1331
1186
|
handleInspectorAction,
|
|
1332
1187
|
rewritePromptWithGuidance,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
validateAuthorityPolicy,
|
|
12
12
|
validateMissionStoreConfig,
|
|
13
13
|
validateModelResponseAliases
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GJGTMLPE.js";
|
|
15
15
|
import {
|
|
16
16
|
getAgentDir,
|
|
17
17
|
readStatus,
|
|
18
18
|
validatePermissionConfig,
|
|
19
19
|
writePrivateAtomicJson
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QGO6HXHG.js";
|
|
21
21
|
import {
|
|
22
22
|
FLEET_KEYBINDING_ACTIONS,
|
|
23
23
|
RUNNER_LAUNCHER_NAME_PATTERN,
|
|
@@ -525,7 +525,7 @@ import * as fs2 from "node:fs";
|
|
|
525
525
|
import * as os from "node:os";
|
|
526
526
|
import * as path2 from "node:path";
|
|
527
527
|
import { Key } from "@earendil-works/pi-tui";
|
|
528
|
-
var FAIL_CLOSED_CONFIG_KEYS = ["worktreeProvider", "worktreeBranchPrefix", "modelResponseAliases", "modelExclusions", "checkpointBeforeDeadlineMs", "disabledFeatures", "scheduledRuns", "toolActivation", "authorityPolicy", "permissions", "toolBudget", "runnerLaunchers"];
|
|
528
|
+
var FAIL_CLOSED_CONFIG_KEYS = ["worktreeProvider", "worktreeBranchPrefix", "modelResponseAliases", "modelExclusions", "checkpointBeforeDeadlineMs", "disabledFeatures", "scheduledRuns", "toolActivation", "authorityPolicy", "permissions", "toolBudget", "runnerLaunchers", "globalConcurrencyLimit"];
|
|
529
529
|
var ARTIFACT_DIR_PREFERENCES = /* @__PURE__ */ new Set(["project", "session", "temp"]);
|
|
530
530
|
var FLEET_KEYBINDING_ACTION_SET = new Set(FLEET_KEYBINDING_ACTIONS);
|
|
531
531
|
var KEY_MODIFIERS = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "super"]);
|
|
@@ -658,6 +658,9 @@ function validateConfig(config) {
|
|
|
658
658
|
if (config.maxActiveAsyncRunsPerSession !== void 0 && (typeof config.maxActiveAsyncRunsPerSession !== "number" || !Number.isInteger(config.maxActiveAsyncRunsPerSession) || config.maxActiveAsyncRunsPerSession < 0)) {
|
|
659
659
|
throw new Error("config.maxActiveAsyncRunsPerSession must be a non-negative integer");
|
|
660
660
|
}
|
|
661
|
+
if (config.globalConcurrencyLimit !== void 0 && (typeof config.globalConcurrencyLimit !== "number" || !Number.isInteger(config.globalConcurrencyLimit) || config.globalConcurrencyLimit < 1)) {
|
|
662
|
+
throw new Error("config.globalConcurrencyLimit must be a positive integer");
|
|
663
|
+
}
|
|
661
664
|
if (config.resultScanLogging !== void 0 && config.resultScanLogging !== "all" && config.resultScanLogging !== "activity" && config.resultScanLogging !== "off") {
|
|
662
665
|
throw new Error('config.resultScanLogging must be "all", "activity", or "off"');
|
|
663
666
|
}
|
|
@@ -10,22 +10,27 @@ import {
|
|
|
10
10
|
drainOutstandingWork,
|
|
11
11
|
evaluateChildToolDiagnostic,
|
|
12
12
|
formatWatchdogCwdSection,
|
|
13
|
-
registerNativeSupervisorClient,
|
|
14
13
|
registerWaitTool,
|
|
15
14
|
resolveCurrentSessionId,
|
|
16
15
|
resolveWatchdogReviewModel,
|
|
17
16
|
startWatchdogDiffBaselineCapture
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZJJCPV3L.js";
|
|
19
18
|
import {
|
|
20
|
-
MODEL_ONLY_TOOL,
|
|
21
19
|
agentStreamOptions,
|
|
22
20
|
opencodeSessionHeaders
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BGXEAYUM.js";
|
|
22
|
+
import {
|
|
23
|
+
registerNativeSupervisorClient
|
|
24
|
+
} from "./chunk-ZPY5QZCS.js";
|
|
25
|
+
import {
|
|
26
|
+
MODEL_ONLY_TOOL
|
|
27
|
+
} from "./chunk-HXRB42AF.js";
|
|
24
28
|
import {
|
|
25
29
|
inheritedNestedRouteOf
|
|
26
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GJGTMLPE.js";
|
|
27
31
|
import {
|
|
28
32
|
CHILD_WATCHDOG_STATUS_EVENT,
|
|
33
|
+
DEFAULT_WAIT_TOOL_NAME,
|
|
29
34
|
MISSING_STRUCTURED_ACCEPTANCE_REPORT_ERROR,
|
|
30
35
|
SUBAGENT_WATCHDOG_WARNING_TYPE,
|
|
31
36
|
appendPermissionAudit,
|
|
@@ -34,12 +39,14 @@ import {
|
|
|
34
39
|
getAgentDir,
|
|
35
40
|
permissionArgsPreview,
|
|
36
41
|
permissionDecision,
|
|
42
|
+
prepareStructuredOutputArguments,
|
|
43
|
+
setWaitToolName,
|
|
37
44
|
shouldBlockToolForBudget,
|
|
38
45
|
toolBudgetBlockedMessage,
|
|
39
46
|
toolBudgetSoftNudge,
|
|
40
47
|
validateAcceptanceReport,
|
|
41
48
|
validateStructuredOutputValue
|
|
42
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-QGO6HXHG.js";
|
|
43
50
|
import {
|
|
44
51
|
INTERCOM_SESSION_IDENTITY_EVENT
|
|
45
52
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -786,6 +793,7 @@ function registerStructuredOutputTool(pi, structured) {
|
|
|
786
793
|
label: "Structured Output",
|
|
787
794
|
description: "Submit the required final structured output for this subagent step. This terminates the step.",
|
|
788
795
|
parameters,
|
|
796
|
+
prepareArguments: (args) => prepareStructuredOutputArguments(structured.schema, args),
|
|
789
797
|
async execute(_id, params) {
|
|
790
798
|
const validation = await validateStructuredOutputValue(structured.schema, params.value);
|
|
791
799
|
if (validation.status === "invalid") {
|
|
@@ -839,6 +847,7 @@ function registerSubagentPromptRuntime(pi, config, drainObservation) {
|
|
|
839
847
|
} }
|
|
840
848
|
};
|
|
841
849
|
const nestedRootRunId = inheritedNestedRouteOf(config)?.rootRunId;
|
|
850
|
+
setWaitToolName(config.waitTool.name ?? DEFAULT_WAIT_TOOL_NAME);
|
|
842
851
|
if (typeof pi.registerTool === "function") registerWaitTool(pi, waitState, config.waitTool.enabled, void 0, config.waitTool.defaultTimeoutMs, { nestedRootRunId }, () => config.hasPendingSupervisorRequest?.() === true);
|
|
843
852
|
const supervisorMetadata = childSupervisorMetadata(config);
|
|
844
853
|
let nativeSupervisorClientRegistered = false;
|