pi-subagents 0.88.1 → 0.89.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 +36 -1
- package/bundle/agents.js +3 -3
- package/bundle/child-tool-plan.js +2 -2
- package/bundle/{chunk-VTUUOLM4.js → chunk-2I6YN6ET.js} +34 -5
- package/bundle/{chunk-7OX6O7DQ.js → chunk-443LPCRI.js} +5 -5
- package/bundle/{chunk-4QFZZV3O.js → chunk-4AL6LDBY.js} +3 -1
- package/bundle/{chunk-6CG2VAG4.js → chunk-4ALRHKGE.js} +1 -1
- package/bundle/{chunk-4ZQBZDF3.js → chunk-6JD4XCA4.js} +76 -18
- package/bundle/{chunk-LV3CPYXJ.js → chunk-7W2IQFP4.js} +4 -4
- package/bundle/{chunk-W6HIYD2Z.js → chunk-A3INCQ6Z.js} +1 -1
- package/bundle/{chunk-FLNDHNPE.js → chunk-AZW4HXNU.js} +21 -21
- package/bundle/{chunk-ZJ2BT5TI.js → chunk-CHEABMO2.js} +56 -34
- package/bundle/{chunk-CYKNHFXB.js → chunk-EPMRDKQT.js} +1 -1
- package/bundle/{chunk-RMZAAXIR.js → chunk-ETDE2VYK.js} +2 -2
- package/bundle/{chunk-4MVDMA5C.js → chunk-GHJ6BH5U.js} +13 -7
- package/bundle/{chunk-PYKBTBY6.js → chunk-HSHLPYCQ.js} +9 -9
- package/bundle/{chunk-D32H53HM.js → chunk-HZDLR73C.js} +1 -1
- package/bundle/{chunk-2DIEL4WG.js → chunk-JFACGAJT.js} +2 -2
- package/bundle/{chunk-L4YY2TOE.js → chunk-JRO2CU4D.js} +1 -1
- package/bundle/{chunk-KXW62VBU.js → chunk-KOLLMZ2X.js} +1 -1
- package/bundle/{chunk-47ZN7NKR.js → chunk-NONHDYXE.js} +1 -1
- package/bundle/{chunk-DSHQWGHO.js → chunk-NQ26PJSQ.js} +96 -96
- package/bundle/{chunk-6OWNDN7R.js → chunk-PPPAEFRA.js} +2 -2
- package/bundle/{chunk-YDZ7BZD5.js → chunk-S77ZKDLS.js} +1 -1
- package/bundle/{chunk-CPSUJHZE.js → chunk-SLLZJ5EC.js} +39 -10
- package/bundle/{chunk-N6TAAIB3.js → chunk-TGABNSG5.js} +5 -5
- package/bundle/{chunk-XIA5GSEU.js → chunk-UQT2EQ4U.js} +2 -2
- package/bundle/{chunk-5EMPFFO4.js → chunk-WW6GQBBS.js} +4 -4
- package/bundle/{chunk-PCZEQQAQ.js → chunk-X5ZOTDHO.js} +26 -15
- package/bundle/{chunk-YQSTGPEU.js → chunk-YX7R55CR.js} +74 -31
- package/bundle/{chunk-GDR2ILWY.js → chunk-ZSCIHMUI.js} +50 -22
- 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 +78 -22
- 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/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 +47 -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 +33 -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/workflows/workflow-child-summary.d.ts +2 -1
- package/src/workflows/workflow-child-summary.js +14 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildWorkflowChatProgressRows
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7W2IQFP4.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-6JD4XCA4.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-SLLZJ5EC.js";
|
|
38
38
|
import {
|
|
39
39
|
snapshotExternalRuns
|
|
40
40
|
} from "./chunk-UKG4V45O.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
getSingleResultOutput,
|
|
53
53
|
shortenPath,
|
|
54
54
|
unresolvedChildWatchdogBlockers
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-GHJ6BH5U.js";
|
|
56
56
|
import {
|
|
57
57
|
MAX_WIDGET_JOBS,
|
|
58
58
|
WIDGET_ANIMATION_INTERVAL_MS,
|
|
@@ -11,18 +11,21 @@ import {
|
|
|
11
11
|
startWatchdogDiffBaselineCapture,
|
|
12
12
|
writeUserWatchdogEnabled,
|
|
13
13
|
writeWatchdogModelSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TGABNSG5.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveGitRepositoryIdentity
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7W2IQFP4.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-6JD4XCA4.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-SLLZJ5EC.js";
|
|
58
61
|
import {
|
|
59
62
|
requestAsyncCommand,
|
|
60
63
|
watchAsyncControlInbox
|
|
61
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-A3INCQ6Z.js";
|
|
62
65
|
import {
|
|
63
66
|
supervisorChannelDir
|
|
64
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-HZDLR73C.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-JFACGAJT.js";
|
|
72
75
|
import {
|
|
73
76
|
getProjectSubagentsDir
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-S77ZKDLS.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-KOLLMZ2X.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-GHJ6BH5U.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-NQ26PJSQ.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;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2I6YN6ET.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4ALRHKGE.js";
|
|
7
7
|
import {
|
|
8
8
|
WATCHDOG_DIFF_TOOL_NAME,
|
|
9
9
|
captureWatchdogDiffBaseline,
|
|
10
10
|
createWatchdogDiffTool
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-TGABNSG5.js";
|
|
12
|
+
import "./chunk-6JD4XCA4.js";
|
|
13
|
+
import "./chunk-EPMRDKQT.js";
|
|
14
14
|
import {
|
|
15
15
|
MODEL_ONLY_TOOL
|
|
16
16
|
} from "./chunk-HXRB42AF.js";
|
|
17
17
|
import "./chunk-W2BZS6UC.js";
|
|
18
18
|
import {
|
|
19
19
|
appendAgentRefinementOverlay
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-UQT2EQ4U.js";
|
|
21
|
+
import "./chunk-SLLZJ5EC.js";
|
|
22
22
|
import "./chunk-NIXWDZZV.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-NONHDYXE.js";
|
|
24
24
|
import "./chunk-7F6RKT6W.js";
|
|
25
25
|
import {
|
|
26
26
|
assertNoToolModifierEntries
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-HZDLR73C.js";
|
|
28
28
|
import "./chunk-YARY7JWU.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-S77ZKDLS.js";
|
|
30
30
|
import {
|
|
31
|
+
HERDR_PI_MAX_ACCEPTANCE_PROMPT_BYTES,
|
|
31
32
|
HERDR_PI_MAX_FRAME_BYTES,
|
|
32
33
|
HERDR_PI_PROTOCOL,
|
|
33
34
|
HERDR_PI_RUNTIME_DIR_ENV,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
HerdrPiFrameDecoder,
|
|
36
37
|
encodeHerdrPiFrame,
|
|
37
38
|
validateHerdrPiRunId
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-4AL6LDBY.js";
|
|
39
40
|
import "./chunk-XA3DY6UG.js";
|
|
40
41
|
import {
|
|
41
42
|
buildAgentMemoryInjection,
|
|
@@ -43,7 +44,7 @@ import {
|
|
|
43
44
|
discoverAgents,
|
|
44
45
|
resolveExistingReadPaths,
|
|
45
46
|
resolveSkills
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GHJ6BH5U.js";
|
|
47
48
|
import "./chunk-JEZOSEWG.js";
|
|
48
49
|
import "./chunk-YFCK7H2S.js";
|
|
49
50
|
import "./chunk-QXASAHIA.js";
|
|
@@ -63,6 +64,32 @@ function gitEvidence(cwd) {
|
|
|
63
64
|
const dirty = run(["status", "--porcelain"]);
|
|
64
65
|
return { ...head.status === 0 ? { head: head.stdout.trim() } : {}, ...branch.status === 0 ? { branch: branch.stdout.trim() } : {}, dirty: Boolean(dirty.stdout.trim()) };
|
|
65
66
|
}
|
|
67
|
+
var TOOL_ARGS_FRAME_BUDGET = 64 * 1024;
|
|
68
|
+
function boundedToolArgs(args) {
|
|
69
|
+
if (!args || typeof args !== "object" || Array.isArray(args) || Buffer.byteLength(JSON.stringify(args)) <= TOOL_ARGS_FRAME_BUDGET) return args;
|
|
70
|
+
const shortened = Object.fromEntries(Object.entries(args).flatMap(([key, value]) => typeof value === "string" ? [[key, value.slice(0, 4096)]] : typeof value === "number" || typeof value === "boolean" ? [[key, value]] : []));
|
|
71
|
+
return Buffer.byteLength(JSON.stringify(shortened)) <= TOOL_ARGS_FRAME_BUDGET ? shortened : {};
|
|
72
|
+
}
|
|
73
|
+
var MESSAGE_FRAME_BUDGET = HERDR_PI_MAX_FRAME_BYTES - 64 * 1024;
|
|
74
|
+
var fitsMessageBudget = (value) => Buffer.byteLength(JSON.stringify(value)) <= MESSAGE_FRAME_BUDGET;
|
|
75
|
+
var omittedText = (what, bytes) => `[${what} omitted by the pi-subagents bridge: ${bytes} bytes did not fit in one bridge frame]`;
|
|
76
|
+
function boundedMessage(message) {
|
|
77
|
+
if (fitsMessageBudget(message)) return message;
|
|
78
|
+
const record = message;
|
|
79
|
+
const content = Array.isArray(record.content) ? record.content.map((block) => {
|
|
80
|
+
if (block.type === "image") return { type: "text", text: omittedText(`Image (${String(block.mimeType)})`, Buffer.byteLength(String(block.data))) };
|
|
81
|
+
if (block.type === "text" && typeof block.text === "string" && block.text.length > 65536) return { type: "text", text: `${block.text.slice(0, 65536)}
|
|
82
|
+
${omittedText("The rest of this text", Buffer.byteLength(block.text.slice(65536)))}` };
|
|
83
|
+
if (block.type === "thinking" && typeof block.thinking === "string") return { type: "thinking", thinking: block.thinking.length > 4096 ? `${block.thinking.slice(0, 4096)}
|
|
84
|
+
${omittedText("The rest of this thinking", Buffer.byteLength(block.thinking.slice(4096)))}` : block.thinking };
|
|
85
|
+
if (block.type === "toolCall") return { ...block, arguments: boundedToolArgs(block.arguments) };
|
|
86
|
+
return block;
|
|
87
|
+
}) : record.content;
|
|
88
|
+
const shrunk = { ...record, content, details: void 0 };
|
|
89
|
+
if (fitsMessageBudget(shrunk)) return shrunk;
|
|
90
|
+
const kept = Object.fromEntries(["role", "toolCallId", "toolName", "isError", "api", "provider", "model", "usage", "stopReason", "timestamp"].filter((key) => key in record).map((key) => [key, record[key]]));
|
|
91
|
+
return { ...kept, ...typeof record.errorMessage === "string" ? { errorMessage: record.errorMessage.slice(0, 4096) } : {}, content: [{ type: "text", text: omittedText("This message", Buffer.byteLength(JSON.stringify(message))) }] };
|
|
92
|
+
}
|
|
66
93
|
function resolveRemoteHerdrResources(cwd, resources, remoteDefaultTools = []) {
|
|
67
94
|
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(resources.agent) || resources.skills?.some((name) => !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(name)) || resources.toolCeiling?.some((name) => !/^[A-Za-z0-9_-]{1,64}$/u.test(name)) || resources.reads !== void 0 && resources.reads !== false && (!Array.isArray(resources.reads) || resources.reads.some((name) => typeof name !== "string"))) throw new Error("Remote logical resource names are invalid.");
|
|
68
95
|
const discovered = discoverAgents(cwd, "both").agents.filter((agent2) => agent2.name === resources.agent || agent2.aliases?.includes(resources.agent));
|
|
@@ -89,18 +116,10 @@ function registerHerdrPiBridge(pi) {
|
|
|
89
116
|
const runId = validateHerdrPiRunId(process.env[HERDR_PI_RUN_ENV]);
|
|
90
117
|
const runDir = process.env[HERDR_PI_RUNTIME_DIR_ENV];
|
|
91
118
|
if (!runDir || !path.isAbsolute(runDir) || fs.lstatSync(runDir).isSymbolicLink()) throw new Error("Herdr bridge runtime directory was not authoritatively provisioned.");
|
|
92
|
-
fs.chmodSync(runDir, 448);
|
|
93
119
|
const socketPath = path.join(runDir, "bridge.sock");
|
|
94
120
|
const manifestPath = path.join(runDir, "manifest.json");
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const stat = fs.lstatSync(candidate);
|
|
98
|
-
if (stat.isSymbolicLink()) throw new Error(`Refusing symlink at '${candidate}'.`);
|
|
99
|
-
fs.rmSync(candidate, { force: true });
|
|
100
|
-
} catch (error) {
|
|
101
|
-
if (error.code !== "ENOENT") throw error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
121
|
+
const claims = globalThis[/* @__PURE__ */ Symbol.for("pi-subagents.herdr-bridge-claims")] ??= /* @__PURE__ */ new Set();
|
|
122
|
+
let claimed = false;
|
|
104
123
|
let client;
|
|
105
124
|
let context;
|
|
106
125
|
let nativeSessionId;
|
|
@@ -115,8 +134,10 @@ function registerHerdrPiBridge(pi) {
|
|
|
115
134
|
let journalBytes = 0;
|
|
116
135
|
const journal = [];
|
|
117
136
|
const send = (frame) => {
|
|
118
|
-
const record = { protocol: HERDR_PI_PROTOCOL, runId, ...frame, cursor:
|
|
137
|
+
const record = { protocol: HERDR_PI_PROTOCOL, runId, ...frame, cursor: evidenceCursor + 1 };
|
|
119
138
|
const size = Buffer.byteLength(JSON.stringify(record));
|
|
139
|
+
if (size >= HERDR_PI_MAX_FRAME_BYTES) throw new Error(`pi-subagents bridge frame '${frame.type}' is ${size} bytes, over the ${HERDR_PI_MAX_FRAME_BYTES}-byte limit.`);
|
|
140
|
+
evidenceCursor++;
|
|
120
141
|
journal.push(record);
|
|
121
142
|
journalBytes += size;
|
|
122
143
|
while (journal.length > 512 || journalBytes > 8 * 1024 * 1024) {
|
|
@@ -126,6 +147,7 @@ function registerHerdrPiBridge(pi) {
|
|
|
126
147
|
if (!client || client.destroyed) return;
|
|
127
148
|
client.write(encodeHerdrPiFrame(record));
|
|
128
149
|
};
|
|
150
|
+
const sendReady = (ctx) => send({ type: "ready", packageVersion: package_default.version, nativeSessionId, sessionFile: ctx.sessionManager?.getSessionFile?.(), cwd: process.cwd(), tools: pi.getActiveTools(), model: ctx.model?.provider && ctx.model.id ? `${ctx.model.provider}/${ctx.model.id}` : void 0, configured, activeRequestId, evidenceCursor, evidenceFloor: journal[0]?.cursor ?? evidenceCursor + 1, initialGit: gitEvidence(process.cwd()) });
|
|
129
151
|
const sessionId = (ctx) => ctx.sessionManager?.getSessionId?.();
|
|
130
152
|
pi.registerTool({
|
|
131
153
|
name: "contact_supervisor",
|
|
@@ -188,23 +210,44 @@ ${answer}` }], details };
|
|
|
188
210
|
${resolvedSystemPrompt}` } : void 0;
|
|
189
211
|
});
|
|
190
212
|
on("session_start", (_event, ctx) => {
|
|
213
|
+
if (claims.has(runDir)) return;
|
|
191
214
|
context = ctx;
|
|
192
215
|
nativeSessionId = sessionId(ctx);
|
|
193
216
|
if (!nativeSessionId) throw new Error("Pane-native Pi bridge requires a persisted native session identity.");
|
|
217
|
+
claims.add(runDir);
|
|
218
|
+
claimed = true;
|
|
219
|
+
fs.chmodSync(runDir, 448);
|
|
220
|
+
for (const candidate of [socketPath, manifestPath]) {
|
|
221
|
+
try {
|
|
222
|
+
const stat = fs.lstatSync(candidate);
|
|
223
|
+
if (stat.isSymbolicLink()) throw new Error(`Refusing symlink at '${candidate}'.`);
|
|
224
|
+
fs.rmSync(candidate, { force: true });
|
|
225
|
+
} catch (error) {
|
|
226
|
+
if (error.code !== "ENOENT") throw error;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
server.listen(socketPath, () => {
|
|
230
|
+
fs.chmodSync(socketPath, 384);
|
|
231
|
+
});
|
|
194
232
|
fs.writeFileSync(manifestPath, JSON.stringify({ protocol: HERDR_PI_PROTOCOL, packageVersion: package_default.version, runId, socketPath, nativeSessionId, pid: process.pid }), { mode: 384, flag: "wx" });
|
|
195
|
-
|
|
233
|
+
sendReady(ctx);
|
|
196
234
|
});
|
|
197
235
|
on("message_end", (event) => {
|
|
198
|
-
const message = event.message;
|
|
199
|
-
if (message
|
|
236
|
+
const message = boundedMessage(event.message);
|
|
237
|
+
if (message.role === "assistant") finalAssistant = message;
|
|
200
238
|
send({ type: "event", requestId: activeRequestId, event: { ...event, message }, nativeSessionId });
|
|
201
239
|
});
|
|
240
|
+
on("tool_execution_start", (event) => send({ type: "event", requestId: activeRequestId, event: { type: "tool_execution_start", toolCallId: event.toolCallId, toolName: event.toolName, args: boundedToolArgs(event.args) }, nativeSessionId }));
|
|
241
|
+
on("tool_execution_end", (event) => send({ type: "event", requestId: activeRequestId, event: { type: "tool_execution_end", toolCallId: event.toolCallId, toolName: event.toolName, isError: event.isError }, nativeSessionId }));
|
|
202
242
|
on("agent_settled", (_event, ctx) => {
|
|
203
243
|
const requestId = activeRequestId;
|
|
204
244
|
send({ type: "settled", requestId, nativeSessionId, idle: ctx.isIdle(), pending: ctx.hasPendingMessages(), finalAssistant, finalGit: gitEvidence(process.cwd()) });
|
|
205
245
|
if (ctx.isIdle() && !ctx.hasPendingMessages()) activeRequestId = void 0;
|
|
206
246
|
});
|
|
207
247
|
on("session_shutdown", () => {
|
|
248
|
+
if (!claimed) return;
|
|
249
|
+
claimed = false;
|
|
250
|
+
claims.delete(runDir);
|
|
208
251
|
server.close();
|
|
209
252
|
client?.destroy();
|
|
210
253
|
try {
|
|
@@ -243,9 +286,12 @@ ${resolvedSystemPrompt}` } : void 0;
|
|
|
243
286
|
const invalidSkills = resources.skills !== void 0 && (!Array.isArray(resources.skills) || resources.skills.some((name) => typeof name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(name)));
|
|
244
287
|
const invalidReads = resources.reads !== void 0 && resources.reads !== false && (!Array.isArray(resources.reads) || resources.reads.some((name) => typeof name !== "string"));
|
|
245
288
|
if (typeof resources.agent !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(resources.agent) || invalidSkills || invalidReads) throw new Error("Remote logical resource names are invalid.");
|
|
289
|
+
const acceptancePrompt = resources.acceptancePrompt;
|
|
290
|
+
if (acceptancePrompt !== void 0 && (typeof acceptancePrompt !== "string" || Buffer.byteLength(acceptancePrompt) > HERDR_PI_MAX_ACCEPTANCE_PROMPT_BYTES)) throw new Error("Bridge acceptance instructions are invalid or too large.");
|
|
246
291
|
const resolved = resolveRemoteHerdrResources(process.cwd(), { agent: resources.agent, ...resources.skills ? { skills: resources.skills } : {}, ...resources.toolCeiling ? { toolCeiling: resources.toolCeiling } : {}, ...resources.reads !== void 0 ? { reads: resources.reads } : {} }, context ? pi.getActiveTools() : []);
|
|
247
|
-
resolvedSystemPrompt = resolved.systemPrompt;
|
|
248
292
|
resolvedContextPolicy = resolved;
|
|
293
|
+
resolvedSystemPrompt = acceptancePrompt ? `${resolved.systemPrompt}
|
|
294
|
+
${acceptancePrompt}` : resolved.systemPrompt;
|
|
249
295
|
if (resolved.tools.includes(WATCHDOG_DIFF_TOOL_NAME) && !pi.getAllTools().some((tool) => tool.name === WATCHDOG_DIFF_TOOL_NAME)) pi.registerTool(createWatchdogDiffTool(captureWatchdogDiffBaseline(process.cwd()), { workingTreeAtLaunch: true }));
|
|
250
296
|
pi.setActiveTools(resolved.tools);
|
|
251
297
|
const acknowledged = context ? pi.getActiveTools() : [];
|
|
@@ -275,10 +321,7 @@ ${resolvedSystemPrompt}` } : void 0;
|
|
|
275
321
|
socket.on("close", () => {
|
|
276
322
|
if (client === socket) client = void 0;
|
|
277
323
|
});
|
|
278
|
-
if (context && nativeSessionId)
|
|
279
|
-
});
|
|
280
|
-
server.listen(socketPath, () => {
|
|
281
|
-
fs.chmodSync(socketPath, 384);
|
|
324
|
+
if (context && nativeSessionId) sendReady(context);
|
|
282
325
|
});
|
|
283
326
|
}
|
|
284
327
|
export {
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
REX_LOCAL_MACHINE,
|
|
4
4
|
getAgentDir,
|
|
5
5
|
getProjectConfigDir,
|
|
6
|
+
resolveLocalLaunchCwd,
|
|
6
7
|
resolveRexLocalPlacement
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GHJ6BH5U.js";
|
|
8
9
|
|
|
9
10
|
// src/runs/shared/herdr-machine.ts
|
|
10
11
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
@@ -54,12 +55,20 @@ function decodeHerdrJsonLine(line) {
|
|
|
54
55
|
function shellQuoteRemote(value) {
|
|
55
56
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
56
57
|
}
|
|
58
|
+
function shellScriptCommand(script, args = []) {
|
|
59
|
+
return `sh -c ${shellQuoteRemote(script)} sh${args.map((arg) => ` ${shellQuoteRemote(arg)}`).join("")}`;
|
|
60
|
+
}
|
|
57
61
|
function remoteShellCommand(script, args = []) {
|
|
58
|
-
return
|
|
62
|
+
return shellScriptCommand(`PATH="${HERDR_REMOTE_PATH}"; export PATH; ${script}`, args);
|
|
59
63
|
}
|
|
60
64
|
function canonicalHerdrSession(session) {
|
|
61
65
|
return session && session !== "default" ? session : null;
|
|
62
66
|
}
|
|
67
|
+
function herdrLocalEnv(socket, session, source) {
|
|
68
|
+
const { HERDR_SESSION: _session, HERDR_CLIENT_SOCKET_PATH: _client, HERDR_PANE_ID: _pane, HERDR_ENV: _env, HERDR_SOCKET_PATH: _socket, ...env } = source;
|
|
69
|
+
const selected = canonicalHerdrSession(session);
|
|
70
|
+
return { ...env, HERDR_SOCKET_PATH: socket, ...selected ? { HERDR_SESSION: selected } : {} };
|
|
71
|
+
}
|
|
63
72
|
function sshEnvCommand(session, command) {
|
|
64
73
|
const selected = canonicalHerdrSession(session), assignment = selected ? ` HERDR_SESSION=${shellQuoteRemote(selected)}` : "";
|
|
65
74
|
return `/usr/bin/env -u HERDR_SOCKET_PATH -u HERDR_SESSION${assignment} ${remoteShellCommand(command)}`;
|
|
@@ -393,20 +402,13 @@ function parseMachineCatalog(json) {
|
|
|
393
402
|
});
|
|
394
403
|
}
|
|
395
404
|
function readHerdrMachineCatalog(env, herdrBin) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
if (result.error) {
|
|
404
|
-
const code = result.error.code;
|
|
405
|
-
if (code === "ENOENT") throw new Error(`Herdr CLI '${herdrBin}' was not found on PATH. Saved-machine placement needs Herdr installed locally.`);
|
|
406
|
-
throw new Error(`Failed to run herdr machine list --json: ${result.error.message}`);
|
|
407
|
-
}
|
|
408
|
-
if (result.status !== 0) throw new Error(`herdr machine list --json exited with code ${result.status}: ${(result.stderr || result.stdout).trim()}`);
|
|
409
|
-
return parseMachineCatalog(result.stdout);
|
|
405
|
+
return parseMachineCatalog(runLocalHerdr(herdrBin, ["machine", "list", "--json"], env, `Herdr CLI '${herdrBin}' was not found on PATH. Saved-machine placement needs Herdr installed locally.`));
|
|
406
|
+
}
|
|
407
|
+
function runLocalHerdr(bin, args, env, notFound) {
|
|
408
|
+
const result = spawnSync2(bin, args, { env, encoding: "utf-8", maxBuffer: MAX_HERDR_MACHINE_LIST_BYTES, timeout: HERDR_MACHINE_LIST_TIMEOUT_MS, windowsHide: true });
|
|
409
|
+
if (result.error) throw new Error(result.error.code === "ENOENT" ? notFound : `Failed to run herdr ${args.join(" ")}: ${result.error.message}`, { cause: result.error });
|
|
410
|
+
if (result.status !== 0) throw new Error(`herdr ${args.join(" ")} exited with code ${result.status}: ${(result.stderr || result.stdout).trim().slice(0, 512)}`);
|
|
411
|
+
return result.stdout;
|
|
410
412
|
}
|
|
411
413
|
function selectMachine(catalog, requested) {
|
|
412
414
|
const byId = catalog.find((entry) => entry.id === requested);
|
|
@@ -513,12 +515,34 @@ function resolveHerdrMachinePlacement(input) {
|
|
|
513
515
|
...settings?.env ? { env: settings.env } : {}
|
|
514
516
|
};
|
|
515
517
|
}
|
|
518
|
+
function resolveHerdrLocalPlacement(input) {
|
|
519
|
+
if (process.platform === "win32") throw new Error("Machine 'local' runs the child in a Herdr pane, which is not supported on Windows.");
|
|
520
|
+
const env = input.env, paneId = env.HERDR_PANE_ID.trim(), bin = input.herdrBin ?? env.HERDR_BIN ?? "herdr", notFound = `Machine 'local' needs the Herdr CLI, but '${bin}' was not found on PATH.`;
|
|
521
|
+
let endpoint;
|
|
522
|
+
try {
|
|
523
|
+
endpoint = parseHerdrEndpoint(runLocalHerdr(bin, ["status", "server", "--json"], env, notFound), env.HERDR_SESSION);
|
|
524
|
+
} catch (error) {
|
|
525
|
+
throw new Error(`Machine 'local' could not confirm this pane's Herdr server: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
526
|
+
}
|
|
527
|
+
let pane;
|
|
528
|
+
try {
|
|
529
|
+
pane = JSON.parse(runLocalHerdr(bin, ["pane", "get", paneId], herdrLocalEnv(endpoint.socket, endpoint.session, env), notFound));
|
|
530
|
+
} catch (error) {
|
|
531
|
+
throw new Error(`Machine 'local' needs this Pi's Herdr pane ${paneId}, but the Herdr server at ${endpoint.socket} did not return it: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
532
|
+
}
|
|
533
|
+
const result = pane?.result;
|
|
534
|
+
if (result?.type !== "pane_info" || result.pane?.pane_id !== paneId) throw new Error(`The Herdr server at ${endpoint.socket} did not confirm pane ${paneId}.`);
|
|
535
|
+
return { provider: "herdr", id: REX_LOCAL_MACHINE, socket: endpoint.socket, ...endpoint.session ? { session: endpoint.session } : {}, cwd: resolveLocalLaunchCwd(input.cwd, input.stepCwd) };
|
|
536
|
+
}
|
|
516
537
|
function resolveMachinePlacement(input) {
|
|
517
538
|
const requested = validateMachineName(input.machine);
|
|
518
539
|
const settings = input.settings ?? readMachineSettings(input.cwd, [requested]);
|
|
519
540
|
if (requested === REX_LOCAL_MACHINE) {
|
|
520
|
-
if (settings?.rex) throw new Error("Machine 'local' is reserved for a
|
|
521
|
-
|
|
541
|
+
if (settings?.rex) throw new Error("Machine 'local' is reserved for a new tab on this machine; give the Rex SSH host in subagents.machines.local.rex another name.");
|
|
542
|
+
const env = input.env ?? process.env;
|
|
543
|
+
if (env.HERDR_ENV === "1" && env.HERDR_PANE_ID?.trim()) return { machine: resolveHerdrLocalPlacement({ cwd: input.cwd, stepCwd: input.stepCwd, env, herdrBin: input.herdrBin }) };
|
|
544
|
+
if (env.REX_SESSION?.trim()) return { machine: resolveRexLocalPlacement({ cwd: input.cwd, stepCwd: input.stepCwd, env }) };
|
|
545
|
+
throw new Error("Machine 'local' opens the child in a new tab of the terminal this Pi runs in, but this Pi is running in neither Herdr (HERDR_ENV=1 with HERDR_PANE_ID) nor Rex (REX_SESSION).");
|
|
522
546
|
}
|
|
523
547
|
if (settings?.rex) return { machine: { provider: "rex", id: requested, target: settings.rex.ssh, cwd: validateRemoteCwd(remoteMachineCwd(input.stepCwd, settings.cwd, requested), requested) } };
|
|
524
548
|
return resolveHerdrMachinePlacement(input);
|
|
@@ -527,16 +551,17 @@ var PLACED_RESTORE_UNSUPPORTED = "Pane-native remote Pi does not support fork, r
|
|
|
527
551
|
function formatHerdrMachineRunnerUnsupported(input) {
|
|
528
552
|
if (input.machine === void 0) return void 0;
|
|
529
553
|
const name = input.machine.trim();
|
|
554
|
+
const local = name === REX_LOCAL_MACHINE;
|
|
530
555
|
let rex;
|
|
531
556
|
try {
|
|
532
|
-
rex =
|
|
557
|
+
rex = local || userRexMachine(name);
|
|
533
558
|
} catch (error) {
|
|
534
559
|
return error instanceof Error ? error.message : String(error);
|
|
535
560
|
}
|
|
536
561
|
if (rex) {
|
|
537
|
-
if (input.runnerType !== void 0 && input.runnerType !== "pi") return `Agent '${input.agentName}' requested machine '${name}', but Rex supports native Pi children only. Remove the machine or use a native Pi agent.`;
|
|
562
|
+
if (input.runnerType !== void 0 && input.runnerType !== "pi") return `Agent '${input.agentName}' requested machine '${name}', but ${local ? "machine 'local' runs" : "Rex supports"} native Pi children only. Remove the machine or use a native Pi agent.`;
|
|
538
563
|
if (input.worktree === true) return `Agent '${input.agentName}' requested machine '${name}', but managed worktrees cannot be combined with machine placement.`;
|
|
539
|
-
if (process.platform === "win32") return `Machine '${name}' runs the child in a Rex pane, which is not supported on Windows.`;
|
|
564
|
+
if (process.platform === "win32") return `Machine '${name}' runs the child in ${local ? "a Herdr or Rex pane" : "a Rex pane"}, which is not supported on Windows.`;
|
|
540
565
|
return void 0;
|
|
541
566
|
}
|
|
542
567
|
if (input.runnerType !== void 0 && input.runnerType !== "pi" && input.runnerType !== "external-cli") {
|
|
@@ -551,8 +576,11 @@ function formatHerdrMachineRunnerUnsupported(input) {
|
|
|
551
576
|
}
|
|
552
577
|
|
|
553
578
|
export {
|
|
554
|
-
|
|
579
|
+
shellScriptCommand,
|
|
580
|
+
herdrLocalEnv,
|
|
555
581
|
runBoundedCommand,
|
|
582
|
+
parseHerdrEndpoint,
|
|
583
|
+
SocketRpcClient,
|
|
556
584
|
sshMachineAccess,
|
|
557
585
|
connectHerdrMachine,
|
|
558
586
|
resolveMachinePlacement,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestAsyncStop
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A3INCQ6Z.js";
|
|
4
4
|
import "./chunk-NIXWDZZV.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-GHJ6BH5U.js";
|
|
6
6
|
import "./chunk-JEZOSEWG.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
package/bundle/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HERDR_PI_MODE_ENV
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4AL6LDBY.js";
|
|
4
4
|
|
|
5
5
|
// src/shared/package-version.ts
|
|
6
6
|
import * as fs from "node:fs";
|
|
@@ -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-YX7R55CR.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-AZW4HXNU.js")).default;
|
|
21
21
|
function registerSubagentExtension(pi) {
|
|
22
22
|
const installedVersion = readInstalledPackageVersion();
|
|
23
23
|
if (installedVersion !== loadedPackageVersion) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveIntercomSessionTarget
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NONHDYXE.js";
|
|
4
4
|
import "./chunk-7F6RKT6W.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-GHJ6BH5U.js";
|
|
6
6
|
import "./chunk-JEZOSEWG.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
package/bundle/preflight.js
CHANGED
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
buildEffectiveSystemPrompt,
|
|
3
3
|
canPreferForkFromSnapshot,
|
|
4
4
|
resolveSubagentLaunchContext
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-PPPAEFRA.js";
|
|
6
|
+
import "./chunk-UQT2EQ4U.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ETDE2VYK.js";
|
|
10
10
|
import {
|
|
11
11
|
nestedResultsPath,
|
|
12
12
|
processTerminalCandidatePath,
|
|
13
13
|
processTerminalPath,
|
|
14
14
|
resultFilePath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SLLZJ5EC.js";
|
|
16
16
|
import {
|
|
17
17
|
applyIntercomBridgeToAgent,
|
|
18
18
|
resolveIntercomBridge,
|
|
19
19
|
validateIntercomBridgeConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NONHDYXE.js";
|
|
21
21
|
import {
|
|
22
22
|
AGENT_DEFINITION_PROJECTION_VERSION,
|
|
23
23
|
resolveLaunchBinding,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
applyThinkingSuffix,
|
|
28
28
|
resolvePiLaunchToolPlan
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HZDLR73C.js";
|
|
30
30
|
import {
|
|
31
31
|
assertRequiredChildExtensionsAdmitted,
|
|
32
32
|
resolveRequiredChildExtensions
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
getArtifactPaths,
|
|
36
36
|
getArtifactsDir
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-S77ZKDLS.js";
|
|
38
38
|
import {
|
|
39
39
|
assertClaudeCodeModelScope,
|
|
40
40
|
assertThinkingWithinCeiling,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
resolveSkillsWithFallback,
|
|
62
62
|
resolveStepBehavior,
|
|
63
63
|
unknownAgentDiagnosticContext
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-GHJ6BH5U.js";
|
|
65
65
|
import {
|
|
66
66
|
DIRS,
|
|
67
67
|
SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
|
package/bundle/project-panes.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
openProjectPane,
|
|
9
9
|
projectPaneBindingPath,
|
|
10
10
|
readProjectPaneBinding
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JFACGAJT.js";
|
|
12
12
|
import "./chunk-7J4ZXMY7.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-S77ZKDLS.js";
|
|
14
|
+
import "./chunk-GHJ6BH5U.js";
|
|
15
15
|
import "./chunk-JEZOSEWG.js";
|
|
16
16
|
import "./chunk-YFCK7H2S.js";
|
|
17
17
|
import "./chunk-QXASAHIA.js";
|