pi-subagents 0.89.1 → 0.89.2
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 +20 -0
- package/bundle/child-tool-plan.js +1 -1
- package/bundle/{chunk-TDXVQPZW.js → chunk-2UCFLUE4.js} +62 -10
- package/bundle/{chunk-C22YEYFZ.js → chunk-464OJSDP.js} +2 -2
- package/bundle/{chunk-YLU5JFW2.js → chunk-4KQW5R6U.js} +1 -1
- package/bundle/{chunk-7J4ZXMY7.js → chunk-72334PEI.js} +6 -4
- package/bundle/{chunk-6D54VW3E.js → chunk-76WVWEFE.js} +24 -15
- package/bundle/{chunk-R3NH5XAL.js → chunk-AHGJSJYY.js} +3 -2
- package/bundle/{chunk-TRN65L4F.js → chunk-DGLXVN3F.js} +1 -1
- package/bundle/{chunk-KCDPTXHT.js → chunk-DHY5TY2Y.js} +235 -197
- package/bundle/{chunk-CASL47ST.js → chunk-DYBRIEIF.js} +3 -3
- package/bundle/{chunk-MIX3MCIF.js → chunk-FF5K5HQU.js} +8 -3
- package/bundle/{chunk-URKQZHVH.js → chunk-FO2GIU5F.js} +23 -14
- package/bundle/{chunk-OUM6SEVD.js → chunk-JEYG7CNC.js} +6 -2
- package/bundle/{chunk-LUNVS6KP.js → chunk-KA4MKMYT.js} +7 -7
- package/bundle/{chunk-IGZTXGPG.js → chunk-ME4IS3Y3.js} +15 -15
- package/bundle/{chunk-BERAWSQQ.js → chunk-RHKIP45B.js} +4 -4
- package/bundle/{chunk-4FFKVLBG.js → chunk-SRCMJY4F.js} +3 -3
- package/bundle/{chunk-SG3NCWZW.js → chunk-U753SUBC.js} +1 -1
- package/bundle/{chunk-F6PTAPQ3.js → chunk-UBPAMRVL.js} +6 -6
- package/bundle/index.js +1 -1
- package/bundle/preflight.js +7 -5
- package/bundle/project-panes.js +2 -2
- package/docs/observability.md +3 -1
- package/docs/watchdog.md +3 -2
- package/package.json +1 -1
- package/src/api/preflight.d.ts +1 -0
- package/src/api/preflight.js +2 -1
- package/src/inspectors/herdr/project-panes.d.ts +2 -0
- package/src/inspectors/herdr/project-panes.js +7 -1
- package/src/inspectors/shell-command.d.ts +2 -1
- package/src/inspectors/shell-command.js +7 -5
- package/src/runs/background/active-async-capacity.js +2 -1
- package/src/runs/background/active-run-index.d.ts +1 -0
- package/src/runs/background/active-run-index.js +3 -0
- package/src/runs/background/async-execution.d.ts +2 -0
- package/src/runs/background/async-execution.js +3 -2
- package/src/runs/background/process-terminal.d.ts +6 -0
- package/src/runs/background/process-terminal.js +34 -2
- package/src/runs/background/run-status.js +2 -1
- package/src/runs/background/stale-run-reconciler.d.ts +8 -0
- package/src/runs/background/stale-run-reconciler.js +38 -8
- package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
- package/src/runs/background/workflow-terminal-proof.js +4 -4
- package/src/runs/foreground/execution.js +2 -2
- package/src/runs/foreground/subagent-executor.d.ts +2 -0
- package/src/runs/foreground/subagent-executor.js +10 -1
- package/src/runs/shared/herdr-pane-host.js +10 -2
- package/src/runs/shared/mcp-config-sources.d.ts +1 -0
- package/src/runs/shared/mcp-config-sources.js +1 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.js +1 -0
- package/src/shared/types.d.ts +2 -0
- package/src/tui/fleet-transcript.js +21 -9
- package/src/watchdog/runtime.d.ts +4 -0
- package/src/watchdog/runtime.js +50 -12
- package/src/watchdog/turn-delta.d.ts +2 -0
- package/src/watchdog/turn-delta.js +21 -0
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
resolveCurrentSessionId,
|
|
15
15
|
resolveWatchdogReviewModel,
|
|
16
16
|
startWatchdogDiffBaselineCapture
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2UCFLUE4.js";
|
|
18
18
|
import {
|
|
19
19
|
agentStreamOptions,
|
|
20
20
|
opencodeSessionHeaders
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-U753SUBC.js";
|
|
22
22
|
import {
|
|
23
23
|
registerNativeSupervisorClient
|
|
24
24
|
} from "./chunk-VEEUXJDO.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-HXRB42AF.js";
|
|
28
28
|
import {
|
|
29
29
|
inheritedNestedRouteOf
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DHY5TY2Y.js";
|
|
31
31
|
import {
|
|
32
32
|
CHILD_WATCHDOG_STATUS_EVENT,
|
|
33
33
|
DEFAULT_WAIT_TOOL_NAME,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-TXC7WIPL.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DGLXVN3F.js";
|
|
14
14
|
import {
|
|
15
15
|
ensureSupervisorChannelDir
|
|
16
16
|
} from "./chunk-VEEUXJDO.js";
|
|
@@ -517,14 +517,19 @@ var herdrPaneHost = {
|
|
|
517
517
|
return { owned, terminalId };
|
|
518
518
|
},
|
|
519
519
|
async prompt(connection, identity, text, options = {}) {
|
|
520
|
-
const clock = options.clock ?? { now: () => Date.now(), wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }, deadline = clock.now() + (options.timeoutMs ??
|
|
520
|
+
const clock = options.clock ?? { now: () => Date.now(), wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }, deadline = clock.now() + (options.timeoutMs ?? 2e4), pollMs = options.pollMs ?? 100;
|
|
521
521
|
for (; ; ) {
|
|
522
522
|
try {
|
|
523
523
|
await connection.client.call("agent.prompt", { target: identity.agentName, text });
|
|
524
524
|
return;
|
|
525
525
|
} catch (error) {
|
|
526
526
|
if (!(error instanceof Error) || !error.message.includes("is not an active named agent") || clock.now() >= deadline) throw error;
|
|
527
|
-
|
|
527
|
+
const remainingMs = deadline - clock.now();
|
|
528
|
+
try {
|
|
529
|
+
await connection.client.call("agent.wait", { target: identity.agentName, until: ["idle", "done"], timeout_ms: remainingMs }, remainingMs + 5e3);
|
|
530
|
+
} catch {
|
|
531
|
+
}
|
|
532
|
+
await clock.wait(Math.min(pollMs, Math.max(0, deadline - clock.now())));
|
|
528
533
|
if (options.stopped?.()) throw new Error("Remote Pi prompt was not sent because the run was stopped.", { cause: error });
|
|
529
534
|
}
|
|
530
535
|
}
|
|
@@ -7,33 +7,33 @@ import {
|
|
|
7
7
|
safeTranscriptEvent,
|
|
8
8
|
steerAsyncRun,
|
|
9
9
|
steerWorkflowForegroundTarget
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RHKIP45B.js";
|
|
11
11
|
import {
|
|
12
12
|
FLEET_STATUS_WIDGET_KEY,
|
|
13
13
|
runningTone,
|
|
14
14
|
stepTaskSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SRCMJY4F.js";
|
|
16
16
|
import {
|
|
17
17
|
foregroundChildStateLabel,
|
|
18
18
|
formatAsyncRunTranscript,
|
|
19
19
|
stopAsyncRun
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-464OJSDP.js";
|
|
21
21
|
import {
|
|
22
22
|
contextModeBadge,
|
|
23
23
|
contextModeLabel,
|
|
24
24
|
decodeUtf8Tail,
|
|
25
25
|
listAsyncRuns
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-U753SUBC.js";
|
|
27
27
|
import {
|
|
28
28
|
reportSessionWarning
|
|
29
29
|
} from "./chunk-HXRB42AF.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-DHY5TY2Y.js";
|
|
31
31
|
import "./chunk-UUW7P6KJ.js";
|
|
32
32
|
import "./chunk-NIXWDZZV.js";
|
|
33
33
|
import "./chunk-YJIU5WF4.js";
|
|
34
34
|
import "./chunk-7F6RKT6W.js";
|
|
35
35
|
import "./chunk-YARY7JWU.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-72334PEI.js";
|
|
37
37
|
import {
|
|
38
38
|
getArtifactPaths,
|
|
39
39
|
getArtifactsDir
|
|
@@ -154,8 +154,15 @@ function renderExpandedTool(event, width, theme) {
|
|
|
154
154
|
const output = event.output ?? event.error;
|
|
155
155
|
const outputColor = event.status === "error" ? "error" : "toolOutput";
|
|
156
156
|
if (event.name === "bash") {
|
|
157
|
-
const command = jsonScalar(args?.command)
|
|
158
|
-
|
|
157
|
+
const command = jsonScalar(args?.command);
|
|
158
|
+
let first = true;
|
|
159
|
+
for (const commandLine of (command ?? event.args ?? "(unknown command)").split(/\r?\n/)) {
|
|
160
|
+
for (const wrapped of renderWrapped(theme.fg("toolTitle", theme.bold(first ? `$ ${commandLine}` : commandLine)), Math.max(1, width - 4))) {
|
|
161
|
+
lines.push(railLine(`${first ? glyph : " "} ${wrapped}`, width, theme));
|
|
162
|
+
first = false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (command === void 0 && !args && event.argsPayload) lines.push(...renderArgsPayload(event.argsPayload, width, theme));
|
|
159
166
|
if (output) {
|
|
160
167
|
for (const outputLine of output.replace(/\s+$/, "").split(/\r?\n/)) {
|
|
161
168
|
for (const wrapped of renderWrapped(theme.fg(outputColor, outputLine), Math.max(1, width - 4))) {
|
|
@@ -178,12 +185,7 @@ function renderExpandedTool(event, width, theme) {
|
|
|
178
185
|
return lines;
|
|
179
186
|
}
|
|
180
187
|
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(event.name))}`, width, theme));
|
|
181
|
-
if (event.argsPayload)
|
|
182
|
-
lines.push(railLine(theme.fg("dim", " args"), width, theme));
|
|
183
|
-
for (const argLine of event.argsPayload.split(/\r?\n/)) {
|
|
184
|
-
for (const wrapped of renderWrapped(theme.fg("muted", argLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
188
|
+
if (event.argsPayload) lines.push(...renderArgsPayload(event.argsPayload, width, theme));
|
|
187
189
|
if (output) {
|
|
188
190
|
lines.push(railLine(theme.fg(event.status === "error" ? "error" : "dim", event.status === "error" ? " error" : " output"), width, theme));
|
|
189
191
|
for (const outputLine of output.split(/\r?\n/)) {
|
|
@@ -195,6 +197,13 @@ function renderExpandedTool(event, width, theme) {
|
|
|
195
197
|
function bounded(text, width) {
|
|
196
198
|
return truncateToWidth(text, Math.max(0, width));
|
|
197
199
|
}
|
|
200
|
+
function renderArgsPayload(payload, width, theme) {
|
|
201
|
+
const lines = [railLine(theme.fg("dim", " args"), width, theme)];
|
|
202
|
+
for (const argLine of payload.split(/\r?\n/)) {
|
|
203
|
+
for (const wrapped of renderWrapped(theme.fg("muted", argLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
204
|
+
}
|
|
205
|
+
return lines;
|
|
206
|
+
}
|
|
198
207
|
function railLine(content, width, theme) {
|
|
199
208
|
return bounded(`${theme.fg("borderMuted", "\u2502")} ${content}`, width);
|
|
200
209
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatShellCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-72334PEI.js";
|
|
4
4
|
import {
|
|
5
5
|
getProjectSubagentsDir
|
|
6
6
|
} from "./chunk-77VQEATI.js";
|
|
@@ -389,10 +389,14 @@ async function inspectPane(client, paneId, signal) {
|
|
|
389
389
|
if (!runtime) return projectPaneError("INVALID_PANE_RESPONSE", `Herdr pane get returned no pane runtime for '${paneId}'.`, { details: live.data });
|
|
390
390
|
return { ok: true, data: runtime };
|
|
391
391
|
}
|
|
392
|
+
function projectPaneShellFlavor(platform, shell) {
|
|
393
|
+
if (platform !== "win32") return "auto";
|
|
394
|
+
return /(^|[\\/])(bash|zsh|sh|dash|ksh)(\.exe)?$/i.test(shell ?? "") ? "posix" : "auto";
|
|
395
|
+
}
|
|
392
396
|
function projectPaneCommand(message) {
|
|
393
397
|
const args = message?.trim() ? [message.trim()] : [];
|
|
394
398
|
const command = getPiSpawnCommand(args);
|
|
395
|
-
return formatShellCommand(command.command, command.args);
|
|
399
|
+
return formatShellCommand(command.command, command.args, process.platform, projectPaneShellFlavor(process.platform, process.env.SHELL));
|
|
396
400
|
}
|
|
397
401
|
function canonicalRuntimePath(value) {
|
|
398
402
|
if (!value) return void 0;
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
startWatchdogDiffBaselineCapture,
|
|
12
12
|
writeUserWatchdogEnabled,
|
|
13
13
|
writeWatchdogModelSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2UCFLUE4.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveGitRepositoryIdentity
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-464OJSDP.js";
|
|
18
18
|
import {
|
|
19
19
|
formatParallelHandoffLines,
|
|
20
20
|
listAsyncRuns,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
readKeptBranches,
|
|
26
26
|
readWorkflowLaunchRecord,
|
|
27
27
|
resolveRetainedWorktreeCwd
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-U753SUBC.js";
|
|
29
29
|
import {
|
|
30
30
|
ownsRun
|
|
31
31
|
} from "./chunk-HXRB42AF.js";
|
|
@@ -57,21 +57,21 @@ import {
|
|
|
57
57
|
resolveMissionStoreLocation,
|
|
58
58
|
validateMissionId,
|
|
59
59
|
workflowRunParamsFingerprint
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-DHY5TY2Y.js";
|
|
61
61
|
import {
|
|
62
62
|
requestAsyncCommand,
|
|
63
63
|
watchAsyncControlInbox
|
|
64
64
|
} from "./chunk-UUW7P6KJ.js";
|
|
65
65
|
import {
|
|
66
66
|
supervisorChannelDir
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-AHGJSJYY.js";
|
|
68
68
|
import {
|
|
69
69
|
createRequiredChildExtensionIdentity
|
|
70
70
|
} from "./chunk-YARY7JWU.js";
|
|
71
71
|
import {
|
|
72
72
|
createHerdrClient,
|
|
73
73
|
detectHerdr
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-JEYG7CNC.js";
|
|
75
75
|
import {
|
|
76
76
|
getProjectSubagentsDir
|
|
77
77
|
} from "./chunk-77VQEATI.js";
|
|
@@ -7888,7 +7888,7 @@ function childSessionFactory() {
|
|
|
7888
7888
|
}
|
|
7889
7889
|
function createLazyPlacementFactory(local) {
|
|
7890
7890
|
let placed;
|
|
7891
|
-
const factory = async () => placed ??= (await import("./chunk-
|
|
7891
|
+
const factory = async () => placed ??= (await import("./chunk-FF5K5HQU.js")).createPlacementAwareChildSessionFactory(local);
|
|
7892
7892
|
return {
|
|
7893
7893
|
async create(launch) {
|
|
7894
7894
|
return launch.machine ? (await factory()).create(launch) : local.create(launch);
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
setInlineWorkflowCoverage,
|
|
11
11
|
setMainThinkingLevelSource,
|
|
12
12
|
widgetRenderKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SRCMJY4F.js";
|
|
14
14
|
import {
|
|
15
15
|
package_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DGLXVN3F.js";
|
|
17
17
|
import {
|
|
18
18
|
EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
|
|
19
19
|
REVIVAL_ORIGIN_FILE,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
takeCompactionAbort,
|
|
67
67
|
workflowResumeClaimState,
|
|
68
68
|
workflowResumeRefusal
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-KA4MKMYT.js";
|
|
70
70
|
import {
|
|
71
71
|
SUBAGENT_CHILD_ENV,
|
|
72
72
|
SUBAGENT_PARENT_SESSION_ENV,
|
|
@@ -86,14 +86,14 @@ import {
|
|
|
86
86
|
resolvePiSessionId,
|
|
87
87
|
resolveWaitToolConfig,
|
|
88
88
|
setDeclarationPinning
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-2UCFLUE4.js";
|
|
90
90
|
import {
|
|
91
91
|
deliverAsyncRunStop,
|
|
92
92
|
ownerConfirmedDead,
|
|
93
93
|
readSessionMessagesTail,
|
|
94
94
|
resolveSubagentRunId,
|
|
95
95
|
restoreForegroundRunHistory
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-464OJSDP.js";
|
|
97
97
|
import {
|
|
98
98
|
ASYNC_STATUS_SNAPSHOT_KIND,
|
|
99
99
|
ASYNC_STATUS_SNAPSHOT_VERSION,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
runLaunchDir,
|
|
111
111
|
stopStoppableAsyncStatusChildren,
|
|
112
112
|
summarizeAsyncStatus
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-U753SUBC.js";
|
|
114
114
|
import {
|
|
115
115
|
CONTACT_SUPERVISOR_TOOL_NAME,
|
|
116
116
|
NATIVE_SUPERVISOR_TOOL_NAME,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
resolveDisabledFeatureSurface,
|
|
147
147
|
resolveMaxActiveAsyncRunsPerSession,
|
|
148
148
|
resolveScheduledStoreRoot
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-4KQW5R6U.js";
|
|
150
150
|
import {
|
|
151
151
|
ACTIVE_RUN_INDEX_DIR,
|
|
152
152
|
MissionNotFoundError,
|
|
@@ -197,7 +197,7 @@ import {
|
|
|
197
197
|
withWorkflowChildRunModel,
|
|
198
198
|
writeAsyncResultFile,
|
|
199
199
|
writeResultIndexForData
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-DHY5TY2Y.js";
|
|
201
201
|
import "./chunk-UUW7P6KJ.js";
|
|
202
202
|
import {
|
|
203
203
|
shouldUseNativeFsWatch
|
|
@@ -206,13 +206,13 @@ import {
|
|
|
206
206
|
validateIntercomBridgeConfig
|
|
207
207
|
} from "./chunk-YJIU5WF4.js";
|
|
208
208
|
import "./chunk-7F6RKT6W.js";
|
|
209
|
-
import "./chunk-
|
|
209
|
+
import "./chunk-AHGJSJYY.js";
|
|
210
210
|
import "./chunk-YARY7JWU.js";
|
|
211
211
|
import {
|
|
212
212
|
listHerdrProjectPaneRoots,
|
|
213
213
|
restoreHerdrProjectPaneSnapshots
|
|
214
|
-
} from "./chunk-
|
|
215
|
-
import "./chunk-
|
|
214
|
+
} from "./chunk-JEYG7CNC.js";
|
|
215
|
+
import "./chunk-72334PEI.js";
|
|
216
216
|
import {
|
|
217
217
|
cleanupAllArtifactDirs,
|
|
218
218
|
cleanupOldArtifacts,
|
|
@@ -5439,7 +5439,7 @@ function registerSlashCommands(pi, state, options = {}) {
|
|
|
5439
5439
|
}
|
|
5440
5440
|
fleetOpen = true;
|
|
5441
5441
|
try {
|
|
5442
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
5442
|
+
const { openSubagentFleet } = await import("./chunk-FO2GIU5F.js");
|
|
5443
5443
|
await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
|
|
5444
5444
|
} finally {
|
|
5445
5445
|
fleetOpen = false;
|
|
@@ -8853,7 +8853,7 @@ function registerSubagentExtension(pi) {
|
|
|
8853
8853
|
const ctx = withLastUiContext((current) => current);
|
|
8854
8854
|
if (!ctx) return;
|
|
8855
8855
|
try {
|
|
8856
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
8856
|
+
const { openSubagentFleet } = await import("./chunk-FO2GIU5F.js");
|
|
8857
8857
|
await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
|
|
8858
8858
|
} catch (error) {
|
|
8859
8859
|
if (isStaleExtensionContextError(error)) {
|
|
@@ -9062,7 +9062,7 @@ function registerSubagentExtension(pi) {
|
|
|
9062
9062
|
let executor;
|
|
9063
9063
|
let executorPromise;
|
|
9064
9064
|
let executorModulePromise;
|
|
9065
|
-
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-
|
|
9065
|
+
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-76WVWEFE.js");
|
|
9066
9066
|
const getExecutor = () => {
|
|
9067
9067
|
executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
|
|
9068
9068
|
executor = createSubagentExecutor(executorDeps);
|
|
@@ -9076,7 +9076,7 @@ function registerSubagentExtension(pi) {
|
|
|
9076
9076
|
modulePreloadTimer = setTimeout(() => {
|
|
9077
9077
|
loadExecutorModule().catch(() => {
|
|
9078
9078
|
});
|
|
9079
|
-
if (fleetViewEnabled) import("./chunk-
|
|
9079
|
+
if (fleetViewEnabled) import("./chunk-FO2GIU5F.js").catch(() => {
|
|
9080
9080
|
});
|
|
9081
9081
|
}, MODULE_PRELOAD_DELAY_MS);
|
|
9082
9082
|
modulePreloadTimer.unref?.();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isTrustedRecordedSessionFile,
|
|
3
3
|
resolveSubagentRunId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-464OJSDP.js";
|
|
5
5
|
import {
|
|
6
6
|
agentStreamOptions,
|
|
7
7
|
opencodeSessionHeaders,
|
|
8
8
|
resolveAsyncResumeTarget
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-U753SUBC.js";
|
|
10
10
|
import {
|
|
11
11
|
ownsRun
|
|
12
12
|
} from "./chunk-HXRB42AF.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
reconcileAsyncRun,
|
|
19
19
|
resolveAuthorityDecision,
|
|
20
20
|
resolveMissionStoreLocation
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DHY5TY2Y.js";
|
|
22
22
|
import {
|
|
23
23
|
deliverInterruptRequest,
|
|
24
24
|
queueRevivalBrief,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-UUW7P6KJ.js";
|
|
27
27
|
import {
|
|
28
28
|
formatShellCommand
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-72334PEI.js";
|
|
30
30
|
import {
|
|
31
31
|
readStatus,
|
|
32
32
|
redactSecretValues,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildWorkflowChatProgressRows
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-464OJSDP.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-U753SUBC.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-DHY5TY2Y.js";
|
|
38
38
|
import {
|
|
39
39
|
snapshotExternalRuns
|
|
40
40
|
} from "./chunk-UKG4V45O.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DYBRIEIF.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DGLXVN3F.js";
|
|
7
7
|
import {
|
|
8
8
|
WATCHDOG_DIFF_TOOL_NAME,
|
|
9
9
|
captureWatchdogDiffBaseline,
|
|
10
10
|
createWatchdogDiffTool
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-2UCFLUE4.js";
|
|
12
|
+
import "./chunk-U753SUBC.js";
|
|
13
13
|
import "./chunk-VEEUXJDO.js";
|
|
14
14
|
import {
|
|
15
15
|
MODEL_ONLY_TOOL
|
|
@@ -18,13 +18,13 @@ import "./chunk-W2BZS6UC.js";
|
|
|
18
18
|
import {
|
|
19
19
|
appendAgentRefinementOverlay
|
|
20
20
|
} from "./chunk-Q4VH72JI.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-DHY5TY2Y.js";
|
|
22
22
|
import "./chunk-NIXWDZZV.js";
|
|
23
23
|
import "./chunk-YJIU5WF4.js";
|
|
24
24
|
import "./chunk-7F6RKT6W.js";
|
|
25
25
|
import {
|
|
26
26
|
assertNoToolModifierEntries
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AHGJSJYY.js";
|
|
28
28
|
import "./chunk-YARY7JWU.js";
|
|
29
29
|
import "./chunk-77VQEATI.js";
|
|
30
30
|
import {
|
package/bundle/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function readInstalledPackageVersion() {
|
|
|
17
17
|
var loadedPackageVersion = readInstalledPackageVersion();
|
|
18
18
|
|
|
19
19
|
// index.ts
|
|
20
|
-
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-
|
|
20
|
+
var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-UBPAMRVL.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-ME4IS3Y3.js")).default;
|
|
21
21
|
function registerSubagentExtension(pi) {
|
|
22
22
|
const installedVersion = readInstalledPackageVersion();
|
|
23
23
|
if (installedVersion !== loadedPackageVersion) {
|
package/bundle/preflight.js
CHANGED
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
import "./chunk-Q4VH72JI.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4KQW5R6U.js";
|
|
10
10
|
import {
|
|
11
11
|
nestedResultsPath,
|
|
12
12
|
processTerminalCandidatePath,
|
|
13
13
|
processTerminalPath,
|
|
14
|
-
resultFilePath
|
|
15
|
-
|
|
14
|
+
resultFilePath,
|
|
15
|
+
unobservedRunnerExitPath
|
|
16
|
+
} from "./chunk-DHY5TY2Y.js";
|
|
16
17
|
import {
|
|
17
18
|
applyIntercomBridgeToAgent,
|
|
18
19
|
resolveIntercomBridge,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
import {
|
|
27
28
|
applyThinkingSuffix,
|
|
28
29
|
resolvePiLaunchToolPlan
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AHGJSJYY.js";
|
|
30
31
|
import {
|
|
31
32
|
assertRequiredChildExtensionsAdmitted,
|
|
32
33
|
resolveRequiredChildExtensions
|
|
@@ -409,7 +410,8 @@ async function resolveSubagentLaunchContract(input) {
|
|
|
409
410
|
statusPath: path.join(lifecycleAsyncDir, "status.json"),
|
|
410
411
|
eventsPath: path.join(lifecycleAsyncDir, "events.jsonl"),
|
|
411
412
|
processTerminalPath: processTerminalPath(lifecycleAsyncDir),
|
|
412
|
-
processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir)
|
|
413
|
+
processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir),
|
|
414
|
+
unobservedRunnerExitPath: unobservedRunnerExitPath(lifecycleAsyncDir)
|
|
413
415
|
}
|
|
414
416
|
},
|
|
415
417
|
protocol: {
|
package/bundle/project-panes.js
CHANGED
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
openProjectPane,
|
|
9
9
|
projectPaneBindingPath,
|
|
10
10
|
readProjectPaneBinding
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-JEYG7CNC.js";
|
|
12
|
+
import "./chunk-72334PEI.js";
|
|
13
13
|
import "./chunk-77VQEATI.js";
|
|
14
14
|
import "./chunk-LWH7IGI3.js";
|
|
15
15
|
import "./chunk-JEZOSEWG.js";
|
package/docs/observability.md
CHANGED
|
@@ -120,7 +120,7 @@ Default keys:
|
|
|
120
120
|
- `↑`/`↓` or `j`/`k` — select a child
|
|
121
121
|
- `K`/`J` (Shift+k / Shift+j) — scroll output one line
|
|
122
122
|
- `PgUp`/`PgDn` — scroll output one body viewport page (structured headers stay pinned)
|
|
123
|
-
- `x`/`Ctrl+O` — toggle tool details
|
|
123
|
+
- `x`/`Ctrl+O` — toggle tool details, including the full `bash` command (multiline commands show every line)
|
|
124
124
|
- `r` — refresh
|
|
125
125
|
- `Esc` — close
|
|
126
126
|
- `Enter` — open the selected inspectable async child through the available Inspect plugin
|
|
@@ -271,6 +271,8 @@ Lifecycle artifacts include `process-terminal-candidate.json` (private runner ev
|
|
|
271
271
|
|
|
272
272
|
A proof is `observed` only after the live parent observes the exact detached runner's `close` event and any tracked canonical-session lease is free. Children run inside the runner process, so the candidate records no separate writer processes. If the observer is unavailable, the proof is `unknown`; do not infer process exit from `endedAt`, result-file existence, PID disappearance, or lease-directory absence.
|
|
273
273
|
|
|
274
|
+
When a finished run's runner PID is confirmed dead and `process-terminal.json` is still `pending`, for example because the Pi that launched it has exited, a status read writes `process-terminal-unobserved.json` with an `unknown` proof (reason `observer-unavailable`). It never touches `process-terminal.json`; status readers report it only while `process-terminal.json` is still `pending` for the same runner, so a close that is observed later still wins.
|
|
275
|
+
|
|
274
276
|
The `subagent:process-terminal` event and RPC `ping.capabilities.processTerminalProof` expose this status. Process proof is point-in-time evidence and remains separate from execution success or stopped/non-resumable state.
|
|
275
277
|
|
|
276
278
|
### Child session events
|
package/docs/watchdog.md
CHANGED
|
@@ -69,8 +69,9 @@ Child watchdog findings are lifted into the parent in three ways:
|
|
|
69
69
|
|
|
70
70
|
## What the reviewer is given
|
|
71
71
|
|
|
72
|
-
- **Turn delta** with changed repo paths. Over-long input keeps the first 6,000 characters and the tail.
|
|
72
|
+
- **Turn delta** with changed repo paths. Over-long input keeps up to the first 6,000 characters and the tail. Whenever any of the run's turn text was left out to fit (whole turns dropped, or one long turn or the delta cut), the delta starts with a note saying how much, and the reviewer is told not to report an instruction as missing when it may be in an omitted part.
|
|
73
73
|
- **Current scope** (`scope.enabled`, default on): bounded real user prompts. Side questions are additive; only explicit changes supersede older requirements. Scope survives compaction within the current session.
|
|
74
|
+
- **Supervisor replies** (with scope, child watchdogs): paired `contact_supervisor` decision and interview requests with their non-error replies, kept outside the turn delta so a long run cannot drop them. Each entry is bounded to 3,000 characters, with a 6,000-character recent tail kept for the session like scope.
|
|
74
75
|
- **`watchdog_diff`** when inside git: diff since the session-start commit, including later commits, plus untracked paths to inspect with `read`; accepts `path` and `stat:true`.
|
|
75
76
|
- **`WATCHDOG.md`** standing instructions, read fresh on every review: `<project>/.pi/WATCHDOG.md` first, then `~/.pi/agent/WATCHDOG.md`, capped at 8,000 characters. Set `guidance.watchdogMd: false` to ignore them.
|
|
76
77
|
- **LSP diagnostics** from `typescript-language-server`, auto-detected in `node_modules/.bin` or `PATH`; it is never installed and never run over the whole workspace. Errors become blockers, warnings concerns, and info/hints stay in status.
|
|
@@ -122,7 +123,7 @@ With this opt-in, completed `turn_end` events retain a recent actual-activity ta
|
|
|
122
123
|
|
|
123
124
|
New unreviewed activity permits at most one additional boundary review per user prompt even with no local edit. Side questions keep earlier authorized task evidence available; they do not themselves trigger a model call. Activity gathered after that prompt's extra review remains available for the next prompt. Warning continuations cannot supply fresh triggering activity. No polling, task scheduling, cross-worktree scans or idle calls are added.
|
|
124
125
|
|
|
125
|
-
**Visibility limit:** external task/gate completions are visible when returned through those parent tool results. Standalone native completion notifications, arbitrary custom messages, direct shell/CI output, and events not delivered to the parent through these contracts are not ingested by this activity tail. Existing scope retains at most eight prompts (2,000 characters each); new streaming user input cancels an active review
|
|
126
|
+
**Visibility limit:** external task/gate completions are visible when returned through those parent tool results. Standalone native completion notifications, arbitrary custom messages, direct shell/CI output, and events not delivered to the parent through these contracts are not ingested by this activity tail. Existing scope retains at most eight prompts (2,000 characters each); new streaming user input cancels an active review and is added to scope. Reminders depend on retained evidence and model judgment, not an exhaustive view of running work.
|
|
126
127
|
|
|
127
128
|
Set `subagents.watchdog.clarification: true` in Pi settings alongside `enabled: true`. It defaults to `false` and applies **only to the main watchdog**, not child watchdogs or child permission arbitration.
|
|
128
129
|
|
package/package.json
CHANGED
package/src/api/preflight.d.ts
CHANGED
package/src/api/preflight.js
CHANGED
|
@@ -22,7 +22,7 @@ import { loadConfig } from "../extension/config.js";
|
|
|
22
22
|
import { applyIntercomBridgeToAgent, resolveIntercomBridge, validateIntercomBridgeConfig } from "../intercom/intercom-bridge.js";
|
|
23
23
|
import { AGENT_DEFINITION_PROJECTION_VERSION, resolveLaunchBinding, stableJsonDigest } from "../shared/launch-contract.js";
|
|
24
24
|
import { DIRS, TEMP_ROOT_DIR } from "../shared/types.js";
|
|
25
|
-
import { processTerminalCandidatePath, processTerminalPath } from "../runs/background/process-terminal.js";
|
|
25
|
+
import { processTerminalCandidatePath, processTerminalPath, unobservedRunnerExitPath } from "../runs/background/process-terminal.js";
|
|
26
26
|
import { resultFilePath } from "../runs/background/result-files.js";
|
|
27
27
|
import { nestedResultsPath } from "../runs/shared/nested-events.js";
|
|
28
28
|
import { normalizeExtensionBindings } from "../runs/shared/extension-bindings.js";
|
|
@@ -398,6 +398,7 @@ export async function resolveSubagentLaunchContract(input) {
|
|
|
398
398
|
eventsPath: path.join(lifecycleAsyncDir, "events.jsonl"),
|
|
399
399
|
processTerminalPath: processTerminalPath(lifecycleAsyncDir),
|
|
400
400
|
processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir),
|
|
401
|
+
unobservedRunnerExitPath: unobservedRunnerExitPath(lifecycleAsyncDir),
|
|
401
402
|
},
|
|
402
403
|
},
|
|
403
404
|
protocol: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
2
2
|
import type { Details, SubagentState } from "../../shared/types.ts";
|
|
3
3
|
import { type HerdrClient, type HerdrErrorCode } from "./client.ts";
|
|
4
|
+
import { type ShellFlavor } from "../shell-command.ts";
|
|
4
5
|
export declare const HERDR_PROJECT_PANE_ACTIONS: readonly ["project.open", "project.status", "project.close"];
|
|
5
6
|
export type HerdrProjectPaneAction = typeof HERDR_PROJECT_PANE_ACTIONS[number];
|
|
6
7
|
/** Versioned public contract exported through `pi-subagents/project-panes`. */
|
|
@@ -127,6 +128,7 @@ export declare function readHerdrProjectPaneBinding(projectRoot: string): HerdrP
|
|
|
127
128
|
/** Strict public reader for extension integrations. */
|
|
128
129
|
export declare function readProjectPaneBinding(projectRoot: string): ProjectPaneResult<HerdrProjectPaneBinding | undefined>;
|
|
129
130
|
export declare function restoreHerdrProjectPaneSnapshots(state: SubagentState, projectRoots: Iterable<string>, now?: number): void;
|
|
131
|
+
export declare function projectPaneShellFlavor(platform: NodeJS.Platform, shell: string | undefined): ShellFlavor;
|
|
130
132
|
export declare function createProjectPaneManager(options?: ProjectPaneManagerOptions): ProjectPaneManager;
|
|
131
133
|
export declare function openProjectPane(options: OpenProjectPaneOptions): Promise<ProjectPaneResult<OpenProjectPaneData>>;
|
|
132
134
|
export declare function getProjectPaneStatus(options: GetProjectPaneStatusOptions): Promise<ProjectPaneResult<ProjectPaneStatusData>>;
|
|
@@ -254,10 +254,16 @@ async function inspectPane(client, paneId, signal) {
|
|
|
254
254
|
return projectPaneError("INVALID_PANE_RESPONSE", `Herdr pane get returned no pane runtime for '${paneId}'.`, { details: live.data });
|
|
255
255
|
return { ok: true, data: runtime };
|
|
256
256
|
}
|
|
257
|
+
export function projectPaneShellFlavor(platform, shell) {
|
|
258
|
+
// Herdr types the command into the pane's own shell: Git Bash on Windows cannot parse PowerShell's `&` call operator.
|
|
259
|
+
if (platform !== "win32")
|
|
260
|
+
return "auto";
|
|
261
|
+
return /(^|[\\/])(bash|zsh|sh|dash|ksh)(\.exe)?$/i.test(shell ?? "") ? "posix" : "auto";
|
|
262
|
+
}
|
|
257
263
|
function projectPaneCommand(message) {
|
|
258
264
|
const args = message?.trim() ? [message.trim()] : [];
|
|
259
265
|
const command = getPiSpawnCommand(args);
|
|
260
|
-
return formatShellCommand(command.command, command.args);
|
|
266
|
+
return formatShellCommand(command.command, command.args, process.platform, projectPaneShellFlavor(process.platform, process.env.SHELL));
|
|
261
267
|
}
|
|
262
268
|
function canonicalRuntimePath(value) {
|
|
263
269
|
if (!value)
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ShellFlavor = "auto" | "posix";
|
|
2
|
+
export declare function formatShellCommand(exe: string, args: readonly string[], platform?: NodeJS.Platform, flavor?: ShellFlavor): string;
|
|
@@ -6,11 +6,13 @@ function shellQuote(value, platform) {
|
|
|
6
6
|
function isBareExecutable(value) {
|
|
7
7
|
return /^[\w./@:-]+$/.test(value);
|
|
8
8
|
}
|
|
9
|
-
export function formatShellCommand(exe, args, platform = process.platform) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export function formatShellCommand(exe, args, platform = process.platform, flavor = "auto") {
|
|
10
|
+
const posix = flavor === "posix" || (flavor === "auto" && platform !== "win32");
|
|
11
|
+
const quotePlatform = posix ? "linux" : platform;
|
|
12
|
+
const quotedArgs = args.map((arg) => shellQuote(arg, quotePlatform));
|
|
13
|
+
if (!posix)
|
|
14
|
+
return `& ${[shellQuote(exe, quotePlatform), ...quotedArgs].join(" ")}`;
|
|
13
15
|
// Nushell treats a leading quoted token as a string, so use a bare invoker for paths that need quoting.
|
|
14
|
-
const invocation = isBareExecutable(exe) ? exe : `sh -c 'exec "$0" "$@"' ${shellQuote(exe,
|
|
16
|
+
const invocation = isBareExecutable(exe) ? exe : `sh -c 'exec "$0" "$@"' ${shellQuote(exe, quotePlatform)}`;
|
|
15
17
|
return [invocation, ...quotedArgs].join(" ");
|
|
16
18
|
}
|