pi-subagents 0.88.1 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -1
- package/bundle/agents.js +3 -3
- package/bundle/child-tool-plan.js +2 -2
- package/bundle/{chunk-4QFZZV3O.js → chunk-4AL6LDBY.js} +3 -1
- package/bundle/{chunk-5EMPFFO4.js → chunk-4FFKVLBG.js} +4 -4
- package/bundle/{chunk-L4YY2TOE.js → chunk-5TXWZB73.js} +1 -1
- package/bundle/{chunk-ZJ2BT5TI.js → chunk-6D54VW3E.js} +56 -34
- package/bundle/{chunk-YDZ7BZD5.js → chunk-77VQEATI.js} +1 -1
- package/bundle/{chunk-7OX6O7DQ.js → chunk-BERAWSQQ.js} +5 -5
- package/bundle/{chunk-LV3CPYXJ.js → chunk-C22YEYFZ.js} +4 -4
- package/bundle/{chunk-VTUUOLM4.js → chunk-CASL47ST.js} +34 -5
- package/bundle/{chunk-YQSTGPEU.js → chunk-F6PTAPQ3.js} +75 -32
- package/bundle/{chunk-FLNDHNPE.js → chunk-IGZTXGPG.js} +98 -29
- package/bundle/{chunk-CPSUJHZE.js → chunk-KCDPTXHT.js} +39 -10
- package/bundle/{chunk-PCZEQQAQ.js → chunk-LUNVS6KP.js} +26 -15
- package/bundle/{chunk-4MVDMA5C.js → chunk-LWH7IGI3.js} +21 -7
- package/bundle/{chunk-DSHQWGHO.js → chunk-MIX3MCIF.js} +96 -96
- package/bundle/{chunk-2DIEL4WG.js → chunk-OUM6SEVD.js} +2 -2
- package/bundle/{chunk-XIA5GSEU.js → chunk-Q4VH72JI.js} +2 -2
- package/bundle/{chunk-D32H53HM.js → chunk-R3NH5XAL.js} +1 -1
- package/bundle/{chunk-6OWNDN7R.js → chunk-ROJH7KPK.js} +2 -2
- package/bundle/{chunk-4ZQBZDF3.js → chunk-SG3NCWZW.js} +86 -20
- package/bundle/{chunk-KXW62VBU.js → chunk-SWGB2P5J.js} +1 -1
- package/bundle/{chunk-N6TAAIB3.js → chunk-TDXVQPZW.js} +5 -5
- package/bundle/{chunk-6CG2VAG4.js → chunk-TRN65L4F.js} +1 -1
- package/bundle/{chunk-GDR2ILWY.js → chunk-TXC7WIPL.js} +51 -22
- package/bundle/{chunk-PYKBTBY6.js → chunk-URKQZHVH.js} +9 -9
- package/bundle/{chunk-W6HIYD2Z.js → chunk-UUW7P6KJ.js} +1 -1
- package/bundle/{chunk-CYKNHFXB.js → chunk-VEEUXJDO.js} +1 -1
- package/bundle/{chunk-47ZN7NKR.js → chunk-YJIU5WF4.js} +1 -1
- package/bundle/{chunk-RMZAAXIR.js → chunk-YLU5JFW2.js} +2 -2
- package/bundle/control-channel.js +2 -2
- package/bundle/index.js +2 -2
- package/bundle/intercom-bridge.js +2 -2
- package/bundle/preflight.js +8 -8
- package/bundle/project-panes.js +3 -3
- package/docs/agents.md +10 -4
- package/docs/configuration.md +2 -0
- package/docs/extension-api.md +1 -1
- package/docs/tool-reference.md +1 -1
- package/docs/workflows.md +5 -3
- package/package.json +1 -1
- package/src/extension/herdr-pi-bridge.js +79 -23
- package/src/extension/schemas.js +1 -1
- package/src/extension/subagent-options.js +5 -0
- package/src/intercom/result-intercom.js +3 -2
- package/src/runs/background/async-job-tracker.js +85 -9
- package/src/runs/background/async-status.d.ts +2 -0
- package/src/runs/background/async-status.js +8 -3
- package/src/runs/background/notify.d.ts +3 -0
- package/src/runs/background/notify.js +7 -2
- package/src/runs/background/run-status.js +3 -2
- package/src/runs/background/runner-child-launch.js +1 -0
- package/src/runs/background/subagent-runner.js +11 -8
- package/src/runs/foreground/execution.js +8 -7
- package/src/runs/foreground/subagent-executor.js +31 -5
- package/src/runs/shared/child-launch.d.ts +2 -0
- package/src/runs/shared/child-launch.js +1 -1
- package/src/runs/shared/child-session.d.ts +2 -1
- package/src/runs/shared/herdr-connection.d.ts +6 -0
- package/src/runs/shared/herdr-connection.js +11 -1
- package/src/runs/shared/herdr-machine.d.ts +2 -2
- package/src/runs/shared/herdr-machine.js +49 -22
- package/src/runs/shared/herdr-pane-host.d.ts +7 -19
- package/src/runs/shared/herdr-pane-host.js +48 -33
- package/src/runs/shared/herdr-pi-protocol.d.ts +1 -0
- package/src/runs/shared/herdr-pi-protocol.js +3 -2
- package/src/runs/shared/herdr-placed-run.d.ts +2 -12
- package/src/runs/shared/herdr-placed-run.js +10 -8
- package/src/runs/shared/kept-branch-text.d.ts +8 -0
- package/src/runs/shared/kept-branch-text.js +24 -0
- package/src/runs/shared/local-machine-access.d.ts +4 -1
- package/src/runs/shared/local-machine-access.js +6 -3
- package/src/runs/shared/mutation-evidence.d.ts +7 -1
- package/src/runs/shared/mutation-evidence.js +18 -2
- package/src/runs/shared/parallel-handoff.js +19 -7
- package/src/runs/shared/placed-run-owner.d.ts +4 -2
- package/src/runs/shared/placed-run-owner.js +15 -7
- package/src/runs/shared/rex-machine.d.ts +7 -3
- package/src/runs/shared/rex-machine.js +12 -9
- package/src/runs/shared/rex-pane-host.js +7 -27
- package/src/runs/shared/single-output.js +2 -2
- package/src/runs/shared/subagent-prompt-runtime.js +34 -0
- package/src/runs/shared/tool-availability.d.ts +4 -0
- package/src/runs/shared/tool-availability.js +7 -0
- package/src/runs/shared/worktree-cleanup-plan.js +2 -2
- package/src/runs/shared/worktree.d.ts +4 -14
- package/src/runs/shared/worktree.js +38 -8
- package/src/shared/types.d.ts +26 -2
- package/src/shared/utils.d.ts +2 -0
- package/src/shared/utils.js +9 -0
- package/src/workflows/workflow-child-summary.d.ts +2 -1
- package/src/workflows/workflow-child-summary.js +14 -6
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PROJECT_SUBAGENTS_RELATIVE_DIR,
|
|
6
6
|
canonicalSessionId,
|
|
7
7
|
inspectSessionLease
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-77VQEATI.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
|
|
11
11
|
DEFAULT_GLOBAL_CONCURRENCY_LIMIT,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
withFileLease,
|
|
28
28
|
writeAtomicJson,
|
|
29
29
|
writePrivateAtomicJson
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LWH7IGI3.js";
|
|
31
31
|
import {
|
|
32
32
|
DIRS,
|
|
33
33
|
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
|
@@ -6451,8 +6451,13 @@ async function probeWorktreeSource(tx, cwd) {
|
|
|
6451
6451
|
if (repoCheck.status !== 0 || repoCheck.stdout.trim() !== "true") throw new Error("worktree isolation requires a git repository");
|
|
6452
6452
|
const toplevel = (await tx.gitChecked(cwd, ["rev-parse", "--show-toplevel"])).trim();
|
|
6453
6453
|
const status = await tx.gitChecked(toplevel, ["status", "--porcelain", "--", `:!${PROJECT_SUBAGENTS_RELATIVE_DIR}`]);
|
|
6454
|
-
|
|
6455
|
-
|
|
6454
|
+
const changes = status.split("\n").filter((line) => line.trim().length > 0);
|
|
6455
|
+
if (changes.length > 0) {
|
|
6456
|
+
const shown = changes.slice(0, 10).map((line) => ` ${line}`);
|
|
6457
|
+
if (changes.length > shown.length) shown.push(` \u2026 and ${changes.length - shown.length} more`);
|
|
6458
|
+
throw new Error(`worktree isolation requires a clean git working tree: ${toplevel} has ${changes.length} uncommitted change(s):
|
|
6459
|
+
${shown.join("\n")}
|
|
6460
|
+
Commit or stash them first.`);
|
|
6456
6461
|
}
|
|
6457
6462
|
return toplevel;
|
|
6458
6463
|
}
|
|
@@ -7103,6 +7108,7 @@ function cleanupSingleWorktree(setup, worktree, intent) {
|
|
|
7103
7108
|
const errors = [];
|
|
7104
7109
|
let worktreeRemoved = false;
|
|
7105
7110
|
let branchRemoved = false;
|
|
7111
|
+
let keptBranchTip;
|
|
7106
7112
|
if (intent.kind === "preserve" && intent.cleanupBlocker) {
|
|
7107
7113
|
return {
|
|
7108
7114
|
index: worktree.index,
|
|
@@ -7201,11 +7207,29 @@ function cleanupSingleWorktree(setup, worktree, intent) {
|
|
|
7201
7207
|
errors.push(`worktree removal failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
7202
7208
|
}
|
|
7203
7209
|
if (worktreeRemoved) {
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7210
|
+
let deleteBranch = true;
|
|
7211
|
+
if (intent.kind === "preserve") {
|
|
7212
|
+
try {
|
|
7213
|
+
const tip = runGitChecked(setup.cwd, ["rev-parse", "--verify", `refs/heads/${worktree.branch}^{commit}`]).trim();
|
|
7214
|
+
if (tip !== setup.baseCommit) {
|
|
7215
|
+
const containing = runGitChecked(setup.cwd, ["for-each-ref", "--contains", tip, "--format=%(refname)", "refs/heads", "refs/remotes", "refs/tags"]);
|
|
7216
|
+
if (!containing.split("\n").some((ref) => ref && ref !== `refs/heads/${worktree.branch}`)) {
|
|
7217
|
+
keptBranchTip = tip;
|
|
7218
|
+
deleteBranch = false;
|
|
7219
|
+
}
|
|
7220
|
+
}
|
|
7221
|
+
} catch (error) {
|
|
7222
|
+
deleteBranch = false;
|
|
7223
|
+
errors.push(`branch check failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
7224
|
+
}
|
|
7225
|
+
}
|
|
7226
|
+
if (deleteBranch) {
|
|
7227
|
+
try {
|
|
7228
|
+
runGitChecked(setup.cwd, ["branch", "-D", worktree.branch]);
|
|
7229
|
+
branchRemoved = true;
|
|
7230
|
+
} catch (error) {
|
|
7231
|
+
errors.push(`branch removal failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
7232
|
+
}
|
|
7209
7233
|
}
|
|
7210
7234
|
}
|
|
7211
7235
|
return {
|
|
@@ -7217,6 +7241,7 @@ function cleanupSingleWorktree(setup, worktree, intent) {
|
|
|
7217
7241
|
...worktree.recordedBaseDir ? { recordedBaseDir: worktree.recordedBaseDir } : {},
|
|
7218
7242
|
worktreeRemoved,
|
|
7219
7243
|
branchRemoved,
|
|
7244
|
+
...keptBranchTip ? { keptBranchTip } : {},
|
|
7220
7245
|
...errors.length ? { errors } : {}
|
|
7221
7246
|
};
|
|
7222
7247
|
}
|
|
@@ -7417,6 +7442,9 @@ function diffWorktrees(setup, agents, diffsDir) {
|
|
|
7417
7442
|
setup.capturedDiffs = diffs;
|
|
7418
7443
|
return diffs;
|
|
7419
7444
|
}
|
|
7445
|
+
function isWorktreeCleanupTaskDone(task) {
|
|
7446
|
+
return task.worktreeRemoved && (task.branchRemoved || task.keptBranchTip !== void 0);
|
|
7447
|
+
}
|
|
7420
7448
|
function cleanupWorktrees(setup, intent = { kind: "preserve", ...setup.capturedDiffs ? { capturedDiffs: setup.capturedDiffs } : {} }) {
|
|
7421
7449
|
assertWorktreeMutationAllowed();
|
|
7422
7450
|
const tasks = [];
|
|
@@ -7432,7 +7460,7 @@ function cleanupWorktrees(setup, intent = { kind: "preserve", ...setup.capturedD
|
|
|
7432
7460
|
} catch (error) {
|
|
7433
7461
|
errors.push(`worktree prune failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
7434
7462
|
}
|
|
7435
|
-
const state = tasks.every(
|
|
7463
|
+
const state = tasks.every(isWorktreeCleanupTaskDone) && pruned ? "complete" : "partial";
|
|
7436
7464
|
return {
|
|
7437
7465
|
state,
|
|
7438
7466
|
tasks,
|
|
@@ -7626,6 +7654,7 @@ export {
|
|
|
7626
7654
|
resolveExpectedWorktreeAgentCwd,
|
|
7627
7655
|
createWorktrees,
|
|
7628
7656
|
diffWorktrees,
|
|
7657
|
+
isWorktreeCleanupTaskDone,
|
|
7629
7658
|
cleanupWorktrees,
|
|
7630
7659
|
formatWorktreeDiffSummary,
|
|
7631
7660
|
validateModelResponseAliases
|
|
@@ -11,18 +11,21 @@ import {
|
|
|
11
11
|
startWatchdogDiffBaselineCapture,
|
|
12
12
|
writeUserWatchdogEnabled,
|
|
13
13
|
writeWatchdogModelSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TDXVQPZW.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveGitRepositoryIdentity
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-C22YEYFZ.js";
|
|
18
18
|
import {
|
|
19
|
+
formatParallelHandoffLines,
|
|
19
20
|
listAsyncRuns,
|
|
20
21
|
parallelHandoffPath,
|
|
22
|
+
parseKeptBranchLines,
|
|
21
23
|
parseWorkflowChildSummary,
|
|
22
24
|
readAsyncRecoveryDescriptor,
|
|
25
|
+
readKeptBranches,
|
|
23
26
|
readWorkflowLaunchRecord,
|
|
24
27
|
resolveRetainedWorktreeCwd
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SG3NCWZW.js";
|
|
26
29
|
import {
|
|
27
30
|
ownsRun
|
|
28
31
|
} from "./chunk-HXRB42AF.js";
|
|
@@ -54,24 +57,24 @@ import {
|
|
|
54
57
|
resolveMissionStoreLocation,
|
|
55
58
|
validateMissionId,
|
|
56
59
|
workflowRunParamsFingerprint
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-KCDPTXHT.js";
|
|
58
61
|
import {
|
|
59
62
|
requestAsyncCommand,
|
|
60
63
|
watchAsyncControlInbox
|
|
61
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-UUW7P6KJ.js";
|
|
62
65
|
import {
|
|
63
66
|
supervisorChannelDir
|
|
64
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-R3NH5XAL.js";
|
|
65
68
|
import {
|
|
66
69
|
createRequiredChildExtensionIdentity
|
|
67
70
|
} from "./chunk-YARY7JWU.js";
|
|
68
71
|
import {
|
|
69
72
|
createHerdrClient,
|
|
70
73
|
detectHerdr
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-OUM6SEVD.js";
|
|
72
75
|
import {
|
|
73
76
|
getProjectSubagentsDir
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-77VQEATI.js";
|
|
75
78
|
import {
|
|
76
79
|
ExternalJobProviderError,
|
|
77
80
|
getExternalJobProvider,
|
|
@@ -81,7 +84,7 @@ import {
|
|
|
81
84
|
} from "./chunk-YYREO77V.js";
|
|
82
85
|
import {
|
|
83
86
|
mergeRuntimeAgents
|
|
84
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-SWGB2P5J.js";
|
|
85
88
|
import {
|
|
86
89
|
CODE_OWNED_EXTERNAL_CLI_ADAPTER_LABEL,
|
|
87
90
|
EXTERNAL_CLI_ADAPTER_SAFETY,
|
|
@@ -142,7 +145,7 @@ import {
|
|
|
142
145
|
withFileLease,
|
|
143
146
|
writeAtomicJson,
|
|
144
147
|
writePrivateAtomicJson
|
|
145
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-LWH7IGI3.js";
|
|
146
149
|
import {
|
|
147
150
|
DIRS,
|
|
148
151
|
INTERCOM_DETACH_REQUEST_EVENT,
|
|
@@ -1263,7 +1266,7 @@ function formatSubagentResultIntercomMessage(input) {
|
|
|
1263
1266
|
}
|
|
1264
1267
|
if (input.asyncId) lines.push(`Async id: ${input.asyncId}`);
|
|
1265
1268
|
if (input.asyncDir) lines.push(`Async dir: ${input.asyncDir}`);
|
|
1266
|
-
if (input.parallelHandoff) lines.push(
|
|
1269
|
+
if (input.parallelHandoff) lines.push(...formatParallelHandoffLines(input.parallelHandoff.path, input.parallelHandoff.keptBranches));
|
|
1267
1270
|
const resumeGuidance = asyncResumeGuidance(input);
|
|
1268
1271
|
if (resumeGuidance) lines.push(resumeGuidance);
|
|
1269
1272
|
if (input.children.some((child) => child.intercomTarget)) {
|
|
@@ -1368,7 +1371,7 @@ function formatSubagentResultReceipt(input) {
|
|
|
1368
1371
|
`Run: ${input.runId}`,
|
|
1369
1372
|
`Children: ${formatStatusCounts(counts)}`
|
|
1370
1373
|
];
|
|
1371
|
-
if (input.payload.parallelHandoff) lines.push(
|
|
1374
|
+
if (input.payload.parallelHandoff) lines.push(...formatParallelHandoffLines(input.payload.parallelHandoff.path, input.payload.parallelHandoff.keptBranches));
|
|
1372
1375
|
const artifacts = input.payload.children.filter((child) => typeof child.artifactPath === "string");
|
|
1373
1376
|
if (artifacts.length > 0) {
|
|
1374
1377
|
lines.push("Artifacts:");
|
|
@@ -5629,7 +5632,7 @@ function formatSingleCompletion(details) {
|
|
|
5629
5632
|
formatResultPreview(details),
|
|
5630
5633
|
...watchdogLines.length ? ["", ...watchdogLines] : [],
|
|
5631
5634
|
details.handoffPath ? "" : void 0,
|
|
5632
|
-
details.handoffPath ?
|
|
5635
|
+
...details.handoffPath ? formatParallelHandoffLines(details.handoffPath, details.keptBranches) : [],
|
|
5633
5636
|
correlationLines.length && !details.handoffPath ? "" : void 0,
|
|
5634
5637
|
...correlationLines,
|
|
5635
5638
|
sessionLine ? "" : void 0,
|
|
@@ -5691,6 +5694,7 @@ function parseSubagentNotifyContent(content) {
|
|
|
5691
5694
|
const resultEnd = firstMetadataIndex > 0 && body[firstMetadataIndex - 1]?.trim() === "" ? firstMetadataIndex - 1 : firstMetadataIndex;
|
|
5692
5695
|
const resultPreview = body.slice(0, resultEnd).join("\n").trim() || "(no output)";
|
|
5693
5696
|
const handoffPath = handoffIndex >= 0 ? body[handoffIndex].slice("Parallel handoff: ".length).trim() : void 0;
|
|
5697
|
+
const keptBranches = handoffIndex >= 0 ? parseKeptBranchLines(body.slice(handoffIndex + 1)) : [];
|
|
5694
5698
|
const workflowRunId = workflowRunIndex >= 0 ? body[workflowRunIndex].slice("Workflow run: ".length).trim() : void 0;
|
|
5695
5699
|
const childRuns = childRunsIndex >= 0 ? body[childRunsIndex].slice("Child runs: ".length).split(", ").map((part) => {
|
|
5696
5700
|
const trimmed = part.trim();
|
|
@@ -5716,6 +5720,7 @@ function parseSubagentNotifyContent(content) {
|
|
|
5716
5720
|
...workflowReceiptPath2 ? { workflowReceiptPath: workflowReceiptPath2 } : {},
|
|
5717
5721
|
resultPreview,
|
|
5718
5722
|
...handoffPath ? { handoffPath } : {},
|
|
5723
|
+
...keptBranches.length ? { keptBranches } : {},
|
|
5719
5724
|
...workflowRunId ? { workflowRunId } : {},
|
|
5720
5725
|
...resumeNotice ? { resumeNotice } : {},
|
|
5721
5726
|
...childRuns?.length ? { childRuns } : {},
|
|
@@ -5735,7 +5740,7 @@ function formatGroupedCompletion(details) {
|
|
|
5735
5740
|
if (detail.workflowReceiptPath) blocks.push(`Workflow receipt: ${detail.workflowReceiptPath}`);
|
|
5736
5741
|
blocks.push(formatResultPreview(detail));
|
|
5737
5742
|
blocks.push(...formatWatchdogBlockerLines(detail));
|
|
5738
|
-
if (detail.handoffPath) blocks.push(
|
|
5743
|
+
if (detail.handoffPath) blocks.push(...formatParallelHandoffLines(detail.handoffPath, detail.keptBranches));
|
|
5739
5744
|
blocks.push(...formatCorrelationLines(detail));
|
|
5740
5745
|
if (sessionLine) blocks.push(sessionLine);
|
|
5741
5746
|
blocks.push("");
|
|
@@ -5877,6 +5882,7 @@ function buildCompletionDetails(result5) {
|
|
|
5877
5882
|
const taskInfo = runningChildren > 0 ? ` (${status === "completed" ? "dispatch complete; " : ""}${runningChildren} ${runningChildren === 1 ? "child" : "children"} running or uncollected)` : result5.taskIndex !== void 0 && result5.totalTasks !== void 0 ? ` (${result5.taskIndex + 1}/${result5.totalTasks})` : void 0;
|
|
5878
5883
|
const parallelHandoff = result5.parallelHandoff && typeof result5.parallelHandoff === "object" ? result5.parallelHandoff : void 0;
|
|
5879
5884
|
const handoffPath = typeof parallelHandoff?.path === "string" ? parallelHandoff.path : void 0;
|
|
5885
|
+
const keptBranches = readKeptBranches(parallelHandoff?.keptBranches);
|
|
5880
5886
|
const receipt = result5.workflowReceipt;
|
|
5881
5887
|
const receiptPath = receipt && typeof receipt === "object" && !Array.isArray(receipt) ? receipt.path : void 0;
|
|
5882
5888
|
const workflowReceiptPath2 = typeof receiptPath === "string" && receiptPath ? receiptPath : void 0;
|
|
@@ -5975,6 +5981,7 @@ High-importance watchdog concerns:
|
|
|
5975
5981
|
${watchdogConcerns.map((warning) => `- ${warning}`).join("\n")}` : resultPreview,
|
|
5976
5982
|
...typeof result5.durationMs === "number" ? { durationMs: result5.durationMs } : {},
|
|
5977
5983
|
...handoffPath ? { handoffPath } : {},
|
|
5984
|
+
...handoffPath && keptBranches.length ? { keptBranches } : {},
|
|
5978
5985
|
...rawRunId ? { runId: rawRunId } : {},
|
|
5979
5986
|
...workflowRunId ? { workflowRunId } : {},
|
|
5980
5987
|
...resumeNotice ? { resumeNotice } : {},
|
|
@@ -7881,7 +7888,7 @@ function childSessionFactory() {
|
|
|
7881
7888
|
}
|
|
7882
7889
|
function createLazyPlacementFactory(local) {
|
|
7883
7890
|
let placed;
|
|
7884
|
-
const factory = async () => placed ??= (await import("./chunk-
|
|
7891
|
+
const factory = async () => placed ??= (await import("./chunk-MIX3MCIF.js")).createPlacementAwareChildSessionFactory(local);
|
|
7885
7892
|
return {
|
|
7886
7893
|
async create(launch) {
|
|
7887
7894
|
return launch.machine ? (await factory()).create(launch) : local.create(launch);
|
|
@@ -8111,6 +8118,10 @@ var optionKeys = new Set(SUBAGENT_OPTION_KEYS);
|
|
|
8111
8118
|
var ALIAS_HINTS = { runId: "id (top-level)", maxRuntimeMs: "options.timeoutMs", isolation: "worktree (top-level)" };
|
|
8112
8119
|
var optionsValidator = Compile(SubagentOptionParams);
|
|
8113
8120
|
function flattenSubagentToolOptions(params, disabled) {
|
|
8121
|
+
params = Object.fromEntries(Object.entries(params).filter(([key, value]) => value !== "null" && !(key === "workflow" && value === "false")));
|
|
8122
|
+
if (params.options && typeof params.options === "object" && !Array.isArray(params.options)) {
|
|
8123
|
+
params.options = Object.fromEntries(Object.entries(params.options).filter(([, value]) => value !== "null"));
|
|
8124
|
+
}
|
|
8114
8125
|
const removedTopLevel = removedModelWorkflowFieldError(params);
|
|
8115
8126
|
if (removedTopLevel) throw new Error(removedTopLevel);
|
|
8116
8127
|
const { options, ...topLevel } = params;
|
|
@@ -6561,6 +6561,9 @@ var REX_EXIT_UNREACHABLE = 4;
|
|
|
6561
6561
|
function isRexLocalMachine(machine) {
|
|
6562
6562
|
return machine?.provider === "rex" && !("target" in machine);
|
|
6563
6563
|
}
|
|
6564
|
+
function editsLocalDisk(machine) {
|
|
6565
|
+
return machine !== void 0 && !("target" in machine);
|
|
6566
|
+
}
|
|
6564
6567
|
var REX_BUNDLE_BIN = "Library/Application Support/com.superlogical.rex/RexServer/Versions/Current/Rex Server.app/Contents/MacOS/rex";
|
|
6565
6568
|
var REX_CALL_TIMEOUT_MS = 15e3;
|
|
6566
6569
|
var REX_MAX_OUTPUT = 1024 * 1024;
|
|
@@ -6604,9 +6607,12 @@ function resolveRexLocalPlacement(input) {
|
|
|
6604
6607
|
if (result.status === REX_EXIT_UNREACHABLE) throw new Error("Machine 'local' needs the Rex server, but it is unreachable.");
|
|
6605
6608
|
if (result.status !== 0) throw new Error(`rex session inspect exited with code ${result.status}: ${(result.stderr || result.stdout).trim().slice(0, 512)}`);
|
|
6606
6609
|
if (!sessionConfirmed(result.stdout, session)) throw new Error(`The Rex server did not confirm session ${session}.`);
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
+
return { provider: "rex", id: REX_LOCAL_MACHINE, session, cwd: resolveLocalLaunchCwd(input.cwd, input.stepCwd), ...server ? { server } : {} };
|
|
6611
|
+
}
|
|
6612
|
+
function resolveLocalLaunchCwd(parentCwd, stepCwd) {
|
|
6613
|
+
const step = stepCwd?.trim();
|
|
6614
|
+
const home = step === "~" || step?.startsWith("~/") ? path12.join(os4.homedir(), step.slice(1)) : void 0;
|
|
6615
|
+
const requested = home ?? (step ? path12.resolve(parentCwd, step) : parentCwd);
|
|
6610
6616
|
let cwd;
|
|
6611
6617
|
try {
|
|
6612
6618
|
cwd = fs12.realpathSync(requested);
|
|
@@ -6614,9 +6620,7 @@ function resolveRexLocalPlacement(input) {
|
|
|
6614
6620
|
throw new Error(`Machine 'local' cwd does not exist: ${requested}.`, { cause: error });
|
|
6615
6621
|
}
|
|
6616
6622
|
if (!fs12.statSync(cwd).isDirectory()) throw new Error(`Machine 'local' cwd is not a directory: ${requested}.`);
|
|
6617
|
-
|
|
6618
|
-
if (server) machine.server = server;
|
|
6619
|
-
return machine;
|
|
6623
|
+
return cwd;
|
|
6620
6624
|
}
|
|
6621
6625
|
|
|
6622
6626
|
// src/runs/shared/single-output.ts
|
|
@@ -6701,7 +6705,7 @@ function outputPathMappingFromTask(task, savedPath) {
|
|
|
6701
6705
|
}
|
|
6702
6706
|
function injectSingleOutputInstruction(task, outputPath, capabilities, machine) {
|
|
6703
6707
|
if (!outputPath) return task;
|
|
6704
|
-
const remote = machine !== void 0 && !
|
|
6708
|
+
const remote = machine !== void 0 && !editsLocalDisk(machine);
|
|
6705
6709
|
const delivery = !remote && (!capabilities || hasOutputWriteCapability(capabilities.tools, capabilities.mcpDirectTools)) ? `Write your findings to exactly this path: ${outputPath}` : [
|
|
6706
6710
|
"Return the complete artifact in your final response.",
|
|
6707
6711
|
`The runtime will persist it to exactly this path: ${outputPath}`,
|
|
@@ -7660,6 +7664,13 @@ function resolveChildCwd(baseCwd, childCwd) {
|
|
|
7660
7664
|
function isNotFoundError(error) {
|
|
7661
7665
|
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
7662
7666
|
}
|
|
7667
|
+
function isStatusAccessError(error, asyncDir) {
|
|
7668
|
+
const code = error?.cause?.code;
|
|
7669
|
+
if (code !== "EACCES" && code !== "EPERM") return false;
|
|
7670
|
+
const message = error instanceof Error ? error.message : "";
|
|
7671
|
+
const quotedPath = `'${path16.join(asyncDir, "status.json")}':`;
|
|
7672
|
+
return message.startsWith(`Failed to inspect async status file ${quotedPath}`) || message.startsWith(`Failed to read async status file ${quotedPath}`);
|
|
7673
|
+
}
|
|
7663
7674
|
function readStatus(asyncDir) {
|
|
7664
7675
|
if (Buffer.byteLength(path16.basename(asyncDir), "utf-8") > 255) {
|
|
7665
7676
|
return null;
|
|
@@ -8629,6 +8640,7 @@ export {
|
|
|
8629
8640
|
REX_EXIT_GONE,
|
|
8630
8641
|
REX_EXIT_UNREACHABLE,
|
|
8631
8642
|
isRexLocalMachine,
|
|
8643
|
+
editsLocalDisk,
|
|
8632
8644
|
REX_BUNDLE_BIN,
|
|
8633
8645
|
REX_CALL_TIMEOUT_MS,
|
|
8634
8646
|
REX_MAX_OUTPUT,
|
|
@@ -8636,6 +8648,7 @@ export {
|
|
|
8636
8648
|
resolveRexBinary,
|
|
8637
8649
|
rexCommandEnv,
|
|
8638
8650
|
resolveRexLocalPlacement,
|
|
8651
|
+
resolveLocalLaunchCwd,
|
|
8639
8652
|
extractChildWrittenOutput,
|
|
8640
8653
|
normalizeSingleOutputOverride,
|
|
8641
8654
|
resolveSingleOutputPath,
|
|
@@ -8714,6 +8727,7 @@ export {
|
|
|
8714
8727
|
getProjectConfigDir,
|
|
8715
8728
|
getAgentDir,
|
|
8716
8729
|
resolveChildCwd,
|
|
8730
|
+
isStatusAccessError,
|
|
8717
8731
|
readStatus,
|
|
8718
8732
|
findLatestSessionFile,
|
|
8719
8733
|
assistantMessageError,
|