pi-subagents 0.89.2 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/bundle/agents.js +4 -4
- package/bundle/child-tool-plan.js +3 -3
- package/bundle/{chunk-U753SUBC.js → chunk-2LEBXCLU.js} +29 -19
- package/bundle/{chunk-UUW7P6KJ.js → chunk-37EJGDYO.js} +2 -2
- package/bundle/{chunk-ME4IS3Y3.js → chunk-4DA22WRU.js} +58 -29
- package/bundle/{chunk-77VQEATI.js → chunk-5J2RTMKW.js} +2 -2
- package/bundle/{chunk-UBPAMRVL.js → chunk-7HPZIT4W.js} +13 -13
- package/bundle/{chunk-SWGB2P5J.js → chunk-7Y4IJMCW.js} +1 -1
- package/bundle/{chunk-DGLXVN3F.js → chunk-ACTHBJUI.js} +1 -1
- package/bundle/{chunk-76WVWEFE.js → chunk-AJWRYQPH.js} +134 -74
- package/bundle/{chunk-TXC7WIPL.js → chunk-C45WQQZX.js} +1 -1
- package/bundle/{chunk-YJIU5WF4.js → chunk-CPWZN5KM.js} +1 -1
- package/bundle/{chunk-RHKIP45B.js → chunk-DNJ2GHSI.js} +6 -6
- package/bundle/{chunk-DYBRIEIF.js → chunk-EBGTTJKP.js} +6 -6
- package/bundle/{chunk-LWH7IGI3.js → chunk-F4NSLXB2.js} +8 -6
- package/bundle/{chunk-FO2GIU5F.js → chunk-G43SW4BT.js} +11 -10
- package/bundle/{chunk-Q4VH72JI.js → chunk-KNVQTRSY.js} +2 -2
- package/bundle/{chunk-5TXWZB73.js → chunk-P2M6RIVX.js} +1 -1
- package/bundle/{chunk-ROJH7KPK.js → chunk-PSB3VLMH.js} +2 -2
- package/bundle/{chunk-VEEUXJDO.js → chunk-PTN7XAXI.js} +2 -2
- package/bundle/{chunk-2UCFLUE4.js → chunk-RIBMW6V3.js} +9 -7
- package/bundle/{chunk-DHY5TY2Y.js → chunk-SIB2GQHL.js} +3 -3
- package/bundle/{chunk-JEZOSEWG.js → chunk-SRWJIAIP.js} +2 -0
- package/bundle/{chunk-JEYG7CNC.js → chunk-UC22RDXP.js} +2 -2
- package/bundle/{chunk-W2BZS6UC.js → chunk-VMJGZHUL.js} +9 -5
- package/bundle/{chunk-FF5K5HQU.js → chunk-WANQBKAZ.js} +5 -5
- package/bundle/{chunk-KA4MKMYT.js → chunk-WHHRG32M.js} +27 -20
- package/bundle/{chunk-464OJSDP.js → chunk-XIQKWTFY.js} +5 -5
- package/bundle/{chunk-4KQW5R6U.js → chunk-XYIVVS3A.js} +7 -3
- package/bundle/{chunk-AHGJSJYY.js → chunk-YVDKGAEO.js} +2 -2
- package/bundle/{chunk-SRCMJY4F.js → chunk-ZWGOHOGI.js} +5 -5
- package/bundle/control-channel.js +3 -3
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +3 -3
- package/bundle/preflight.js +9 -9
- package/bundle/project-panes.js +4 -4
- package/bundle/shared-types.js +1 -1
- package/bundle/workflow-resources.js +1 -1
- package/docs/configuration.md +12 -3
- package/docs/models.md +1 -1
- package/docs/observability.md +7 -1
- package/docs/tool-reference.md +5 -2
- package/docs/workflows.md +1 -1
- package/package.json +1 -1
- package/skills/pi-subagents/SKILL.md +1 -1
- package/src/agents/agents.d.ts +2 -0
- package/src/agents/agents.js +4 -0
- package/src/extension/config.js +3 -0
- package/src/extension/public-execution.js +4 -2
- package/src/extension/reply-workflow-script.js +10 -1
- package/src/extension/schemas.d.ts +1 -0
- package/src/extension/schemas.js +2 -0
- package/src/extension/subagent-options.d.ts +2 -0
- package/src/extension/subagent-options.js +10 -4
- package/src/runs/background/async-execution.d.ts +1 -1
- package/src/runs/background/async-execution.js +3 -1
- package/src/runs/background/async-retention.js +48 -12
- package/src/runs/background/async-status.js +32 -17
- package/src/runs/background/retained-children.js +1 -1
- package/src/runs/foreground/execution.js +5 -7
- package/src/runs/foreground/subagent-executor.d.ts +1 -1
- package/src/runs/foreground/subagent-executor.js +122 -47
- package/src/runs/shared/fast-mode-extension.d.ts +2 -1
- package/src/runs/shared/fast-mode-extension.js +5 -3
- package/src/shared/capacity-resilient-json.d.ts +7 -3
- package/src/shared/capacity-resilient-json.js +8 -6
- package/src/shared/disabled-features.d.ts +4 -0
- package/src/shared/disabled-features.js +1 -0
- package/src/shared/types.d.ts +18 -1
- package/src/shared/types.js +2 -0
- package/src/tui/fleet.js +1 -0
- package/src/workflows/structured-workflow-scripts.js +6 -4
- package/src/workflows/workflow-resources.js +4 -2
- package/src/workflows/workflow-revival.d.ts +6 -0
- package/src/workflows/workflow-revival.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.90.0] - 2026-11-22
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- Give a subagent a short `label` and it shows up by that name in its session, its status row and the events host apps receive, so several runs of the same agent are easy to tell apart.
|
|
10
|
+
- A `parallel` workflow can run its tasks one at a time with `globalConcurrencyLimit: 1`.
|
|
11
|
+
- Finished workflows are now cleaned up from disk like other background runs, instead of piling up to tens of gigabytes.
|
|
12
|
+
- On Windows, a locked status file at the end of a workflow no longer crashes Pi.
|
|
13
|
+
- An install can turn off session sharing with `disabledFeatures: ["session-sharing"]`, so no run can upload a session to a GitHub Gist.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- A direct subagent launch can now be named with a short top-level `label`, for example `subagent({ agent: "worker", task: "…", label: "Fix login redirect" })`, and so can each `args.tasks` item of `workflow: "parallel"`. The label names the child's session and status row, as a workflow child's `runs.run` label already does, and `subagent:async-started` carries it as `description`, so hosts that list running children can tell several runs of the same agent apart. Thanks to [@mmarabel](https://github.com/mmarabel) for the report (#3324).
|
|
18
|
+
- A foreground subagent run now emits `task:subagent:lifecycle` (`started`, then `completed`, `failed` or `aborted`) on Pi's extension event bus, so host apps that only watch `subagent:async-*` can show foreground runs. The payload carries the run id, agent name and a description (the launch's `label`, or else the agent's description), never the task prompt. `subagent:async-started` for single, chain and parallel runs now carries `description` by the same rule. Thanks to [@Andy123qq4](https://github.com/Andy123qq4) for #3318.
|
|
19
|
+
- A named workflow call such as `{ workflow: "parallel", args: { tasks: [...] } }` now accepts a top-level `globalConcurrencyLimit`, so `globalConcurrencyLimit: 1` runs its tasks one at a time; before, the call was refused. When `args.concurrency` is passed to `parallel`, the error now points to `globalConcurrencyLimit`. Thanks to [@mmarabel](https://github.com/mmarabel) for #3320.
|
|
20
|
+
- `disabledFeatures: ["session-sharing"]` now removes `share` from the `subagent` tool, so a run cannot upload a session to a GitHub Gist from that install. A resume whose saved launch enabled `share` is refused before it starts, and the run stays resumable once the setting is gone. Nothing changes when the setting is absent. Before, the only ways to stop the upload were to remove `gh` from `PATH`, revoke the `gist` OAuth scope, or block network access. Thanks to [@jpodivin](https://github.com/jpodivin) for #3323 and to [@marcfargas](https://github.com/marcfargas) for the report (#30).
|
|
21
|
+
- A new `fastServiceTier` setting chooses the OpenAI service tier that `fast: true` requests for native OpenAI-Codex children: `"priority"` (the default, as before) or `"ultrafast"`. Before, fast mode could only request Priority. Thanks to [@FireSpoonYZ](https://github.com/FireSpoonYZ) for #3317.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Finished workflows and their subagents are now deleted from disk like other background runs. Before, async retention kept every workflow run, workflow child and revived child forever, so `async-subagent-runs` could grow to tens of gigabytes. A workflow is now removed with its children once it has finished and passed the 30-day window; it is still kept while it, any of its children, or a revival of one is running, recent or still resumable. Thanks to [@youlikemodernart](https://github.com/youlikemodernart) for the report (#3326).
|
|
26
|
+
- On Windows, an async workflow whose last writes to `status.json` failed with `EPERM` no longer crashes Pi. When another process held the file locked, the error escaped the workflow's teardown and took the whole process down. The failure is now recorded as a `subagent.workflow.status_write_failed` event, the workflow's result is still delivered, and `status.json` catches up with the finished state once the lock clears (Pi keeps retrying for up to a minute without blocking). Thanks to [@M0-3del](https://github.com/M0-3del) for the report (#3325).
|
|
27
|
+
- A background subagent that launches its own nested subagents now shows them in the Fleet status widget, `subagent({ action: "status" })` and its completion result. Before, the nested children were filed under the wrong run id, so status never found them. Thanks to [@dvishoot](https://github.com/dvishoot) for #3316.
|
|
28
|
+
- A `subagent` call with `workflow: true` and `options.script` now runs the script, as `options.script` alone does, instead of failing with `options.script replaces workflow`. A named workflow or a script path together with `options.script` is still refused. Thanks to [@mmarabel](https://github.com/mmarabel) for the report (#3320).
|
|
29
|
+
- A foreground subagent's result in the tool details (`details.results[i]`) no longer carries hidden Symbol keys, so extensions that hash or compare tool results, such as pi-fold, see a plain JSON object. Thanks to [@xiaquwan1001](https://github.com/xiaquwan1001) for the report (#3319).
|
|
30
|
+
- pi-subagents now type-checks against Pi 1.6, whose components return read-only render output, without changing its dependency pins. Thanks to [@Giesch](https://github.com/Giesch) for #3322.
|
|
31
|
+
- The tool reference warns again that a secret Gist is unlisted, not private, and that nothing asks before the upload, and says how to turn sharing off. The warning was lost when the README was split into guides (#30).
|
|
32
|
+
|
|
5
33
|
## [0.89.2] - 2026-11-20
|
|
6
34
|
|
|
7
35
|
### Highlights
|
package/bundle/agents.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
RUNTIME_AGENT_REGISTER_EVENT,
|
|
3
3
|
RUNTIME_AGENT_REGISTER_VERSION,
|
|
4
4
|
registerAgentViaEvents
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P2M6RIVX.js";
|
|
6
6
|
import {
|
|
7
7
|
registerRuntimeAgent
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-7Y4IJMCW.js";
|
|
9
|
+
import "./chunk-F4NSLXB2.js";
|
|
10
|
+
import "./chunk-SRWJIAIP.js";
|
|
11
11
|
import "./chunk-YFCK7H2S.js";
|
|
12
12
|
import "./chunk-QXASAHIA.js";
|
|
13
13
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolvePiLaunchToolPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YVDKGAEO.js";
|
|
4
4
|
import "./chunk-YARY7JWU.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-F4NSLXB2.js";
|
|
6
|
+
import "./chunk-SRWJIAIP.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
|
9
9
|
export {
|
|
@@ -47,10 +47,10 @@ import {
|
|
|
47
47
|
validateModelResponseAliases,
|
|
48
48
|
withWorkflowChildRunModel,
|
|
49
49
|
withWorktreeTransaction
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-SIB2GQHL.js";
|
|
51
51
|
import {
|
|
52
52
|
validateIntercomBridgeConfig
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-CPWZN5KM.js";
|
|
54
54
|
import {
|
|
55
55
|
stableJsonDigest
|
|
56
56
|
} from "./chunk-7F6RKT6W.js";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
} from "./chunk-YARY7JWU.js";
|
|
60
60
|
import {
|
|
61
61
|
missingForkCopyNote
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-5J2RTMKW.js";
|
|
63
63
|
import {
|
|
64
64
|
DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
|
|
65
65
|
assertWorkflowLaneKey,
|
|
@@ -85,12 +85,12 @@ import {
|
|
|
85
85
|
validateToolBudgetConfig,
|
|
86
86
|
waitForFileSystemRetry,
|
|
87
87
|
writeAtomicJson
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-F4NSLXB2.js";
|
|
89
89
|
import {
|
|
90
90
|
DIRS,
|
|
91
91
|
RUNNER_LAUNCHER_NAME_PATTERN,
|
|
92
92
|
TEMP_ROOT_DIR
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-SRWJIAIP.js";
|
|
94
94
|
import {
|
|
95
95
|
previewDisplayText,
|
|
96
96
|
sanitizeDisplayText,
|
|
@@ -2260,7 +2260,7 @@ function deriveAsyncActivityState(asyncDir, status) {
|
|
|
2260
2260
|
lastActivityAt: status.lastActivityAt ?? outputFileMtime(outputPath) ?? currentStep?.lastActivityAt ?? (status.mode === "workflow" ? void 0 : currentStep?.startedAt ?? status.startedAt)
|
|
2261
2261
|
};
|
|
2262
2262
|
}
|
|
2263
|
-
function statusToSummary(asyncDir, status, nestedWarnings = []
|
|
2263
|
+
function statusToSummary(asyncDir, status, nestedWarnings = []) {
|
|
2264
2264
|
const statusPath = path3.join(asyncDir, "status.json");
|
|
2265
2265
|
validateAsyncStatusLaneMetadata(status, `Invalid async status '${statusPath}'`);
|
|
2266
2266
|
const workflowChildren = parseWorkflowChildSummary(status.workflowChildren);
|
|
@@ -2274,7 +2274,6 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
2274
2274
|
if (status.outputFile !== void 0 && typeof status.outputFile !== "string") throw new Error(`Invalid async status '${statusPath}': outputFile must be a string.`);
|
|
2275
2275
|
const { activityState, lastActivityAt } = deriveAsyncActivityState(asyncDir, status);
|
|
2276
2276
|
const processTerminal = readProcessTerminal(asyncDir, { runId: status.runId, runnerProcessInstanceId: status.processTerminal?.runnerProcessInstanceId }) ?? sanitizeProcessTerminal(status.processTerminal, { runId: status.runId, runnerProcessInstanceId: status.processTerminal?.runnerProcessInstanceId }, path3.join(asyncDir, "status.json"));
|
|
2277
|
-
const nestedProjectionAllowed = nestedWarnings.length === 0;
|
|
2278
2277
|
let runFanoutBudget = status.runFanoutBudget;
|
|
2279
2278
|
try {
|
|
2280
2279
|
const runFanoutBudgetDescriptor = readRunFanoutBudgetDescriptor(asyncDir);
|
|
@@ -2285,14 +2284,6 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
2285
2284
|
const steps = status.steps ?? [];
|
|
2286
2285
|
const chainStepCount = status.chainStepCount ?? steps.length;
|
|
2287
2286
|
const parallelGroups = normalizeParallelGroups(status.parallelGroups, steps.length, chainStepCount);
|
|
2288
|
-
let nestedChildren = [];
|
|
2289
|
-
if (nestedProjectionAllowed && nestedRoute) {
|
|
2290
|
-
try {
|
|
2291
|
-
nestedChildren = projectNestedEvents(nestedRoute)?.children ?? [];
|
|
2292
|
-
} catch (error) {
|
|
2293
|
-
nestedWarnings.push(`Nested status unavailable: ${getErrorMessage(error)}`);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
2287
|
const summarizedSteps = steps.map((step, index) => {
|
|
2297
2288
|
const stepActivityState = step.activityState;
|
|
2298
2289
|
const stepLastActivityAt = step.lastActivityAt;
|
|
@@ -2368,7 +2359,7 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
2368
2359
|
...step.children?.length ? { children: step.children } : {}
|
|
2369
2360
|
};
|
|
2370
2361
|
});
|
|
2371
|
-
attachRootChildrenToSteps(status.runId || path3.basename(asyncDir), summarizedSteps,
|
|
2362
|
+
attachRootChildrenToSteps(status.runId || path3.basename(asyncDir), summarizedSteps, void 0);
|
|
2372
2363
|
return {
|
|
2373
2364
|
id: status.runId || path3.basename(asyncDir),
|
|
2374
2365
|
asyncDir,
|
|
@@ -2405,7 +2396,6 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
2405
2396
|
...hostSteps.length ? { hostSteps } : {},
|
|
2406
2397
|
...status.mode === "workflow" && status.workflowGraph ? { workflowGraph: status.workflowGraph } : {},
|
|
2407
2398
|
steps: summarizedSteps,
|
|
2408
|
-
...nestedChildren.length ? { nestedChildren } : {},
|
|
2409
2399
|
...nestedWarnings.length ? { nestedWarnings } : {},
|
|
2410
2400
|
...processTerminal ? { processTerminal } : {},
|
|
2411
2401
|
...runFanoutBudget ? { runFanoutBudget } : {},
|
|
@@ -2431,6 +2421,21 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
|
|
|
2431
2421
|
function summarizeAsyncStatus(asyncDir, status) {
|
|
2432
2422
|
return statusToSummary(asyncDir, status);
|
|
2433
2423
|
}
|
|
2424
|
+
function attachNestedChildren(runs, resolveRoute = (run) => findNestedRouteForRootId(run.id)) {
|
|
2425
|
+
for (const run of runs) {
|
|
2426
|
+
let nestedChildren;
|
|
2427
|
+
try {
|
|
2428
|
+
const route = resolveRoute(run);
|
|
2429
|
+
nestedChildren = route ? projectNestedEvents(route).children : [];
|
|
2430
|
+
} catch (error) {
|
|
2431
|
+
run.nestedWarnings = [...run.nestedWarnings ?? [], `Nested status unavailable: ${getErrorMessage(error)}`];
|
|
2432
|
+
continue;
|
|
2433
|
+
}
|
|
2434
|
+
if (!nestedChildren.length) continue;
|
|
2435
|
+
run.nestedChildren = nestedChildren;
|
|
2436
|
+
attachRootChildrenToSteps(run.id, run.steps, nestedChildren);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2434
2439
|
function sortRuns(runs) {
|
|
2435
2440
|
const rank = (state) => {
|
|
2436
2441
|
switch (state) {
|
|
@@ -2505,6 +2510,7 @@ function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
2505
2510
|
const allowedStates = options.states ? new Set(options.states) : void 0;
|
|
2506
2511
|
const runs = [];
|
|
2507
2512
|
let nestedRouteIndex;
|
|
2513
|
+
const reconciledRoutes = /* @__PURE__ */ new Map();
|
|
2508
2514
|
const resolveNestedRoute = (rootRunId) => {
|
|
2509
2515
|
if (!includeNested) return void 0;
|
|
2510
2516
|
if (activeEntries.has(rootRunId)) return findNestedRouteForRootId(rootRunId);
|
|
@@ -2556,11 +2562,12 @@ function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
2556
2562
|
} catch (error) {
|
|
2557
2563
|
observeStatus?.(null);
|
|
2558
2564
|
nestedWarnings.push(`Nested status unavailable: ${getErrorMessage(error)}`);
|
|
2565
|
+
nestedRoute = void 0;
|
|
2559
2566
|
}
|
|
2560
2567
|
}
|
|
2561
2568
|
let summary;
|
|
2562
2569
|
try {
|
|
2563
|
-
summary = statusToSummary(asyncDir, status, nestedWarnings
|
|
2570
|
+
summary = statusToSummary(asyncDir, status, nestedWarnings);
|
|
2564
2571
|
} catch (error) {
|
|
2565
2572
|
observeStatus?.(null);
|
|
2566
2573
|
if (!activeEntries.has(entry) || !isAsyncStatusIsolationError(asyncDir, error)) throw error;
|
|
@@ -2568,9 +2575,12 @@ function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
|
|
|
2568
2575
|
continue;
|
|
2569
2576
|
}
|
|
2570
2577
|
runs.push(summary);
|
|
2578
|
+
if (nestedRoute) reconciledRoutes.set(summary, nestedRoute);
|
|
2571
2579
|
}
|
|
2572
2580
|
const sorted = sortRuns(runs);
|
|
2573
|
-
|
|
2581
|
+
const listed = options.limit !== void 0 ? sorted.slice(0, options.limit) : sorted;
|
|
2582
|
+
if (includeNested) attachNestedChildren(listed, options.reconcile === false ? void 0 : (run) => reconciledRoutes.get(run));
|
|
2583
|
+
return listed;
|
|
2574
2584
|
}
|
|
2575
2585
|
function formatActivityFacts(input) {
|
|
2576
2586
|
const facts = [];
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
resolveWatchPath,
|
|
6
6
|
writeAtomicJson
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F4NSLXB2.js";
|
|
8
8
|
import {
|
|
9
9
|
POLL_INTERVAL_MS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SRWJIAIP.js";
|
|
11
11
|
|
|
12
12
|
// src/runs/background/control-channel.ts
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
@@ -10,12 +10,13 @@ import {
|
|
|
10
10
|
setInlineWorkflowCoverage,
|
|
11
11
|
setMainThinkingLevelSource,
|
|
12
12
|
widgetRenderKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZWGOHOGI.js";
|
|
14
14
|
import {
|
|
15
15
|
package_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ACTHBJUI.js";
|
|
17
17
|
import {
|
|
18
18
|
EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
|
|
19
|
+
REVIVAL_LINK_FILE,
|
|
19
20
|
REVIVAL_ORIGIN_FILE,
|
|
20
21
|
SUBAGENT_GUIDE_TOPICS,
|
|
21
22
|
attachNestedChildrenToResultChildren,
|
|
@@ -47,6 +48,7 @@ import {
|
|
|
47
48
|
parseSubagentNotifyContent,
|
|
48
49
|
prepareWorkflowResume,
|
|
49
50
|
preservedAgentFrontmatterFields,
|
|
51
|
+
projectWorkflowKeyRevival,
|
|
50
52
|
readWorkflowReceipt,
|
|
51
53
|
recordWorkflowResumeRefusal,
|
|
52
54
|
refusalSentence,
|
|
@@ -66,7 +68,7 @@ import {
|
|
|
66
68
|
takeCompactionAbort,
|
|
67
69
|
workflowResumeClaimState,
|
|
68
70
|
workflowResumeRefusal
|
|
69
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-WHHRG32M.js";
|
|
70
72
|
import {
|
|
71
73
|
SUBAGENT_CHILD_ENV,
|
|
72
74
|
SUBAGENT_PARENT_SESSION_ENV,
|
|
@@ -86,14 +88,14 @@ import {
|
|
|
86
88
|
resolvePiSessionId,
|
|
87
89
|
resolveWaitToolConfig,
|
|
88
90
|
setDeclarationPinning
|
|
89
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-RIBMW6V3.js";
|
|
90
92
|
import {
|
|
91
93
|
deliverAsyncRunStop,
|
|
92
94
|
ownerConfirmedDead,
|
|
93
95
|
readSessionMessagesTail,
|
|
94
96
|
resolveSubagentRunId,
|
|
95
97
|
restoreForegroundRunHistory
|
|
96
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-XIQKWTFY.js";
|
|
97
99
|
import {
|
|
98
100
|
ASYNC_STATUS_SNAPSHOT_KIND,
|
|
99
101
|
ASYNC_STATUS_SNAPSHOT_VERSION,
|
|
@@ -110,7 +112,7 @@ import {
|
|
|
110
112
|
runLaunchDir,
|
|
111
113
|
stopStoppableAsyncStatusChildren,
|
|
112
114
|
summarizeAsyncStatus
|
|
113
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-2LEBXCLU.js";
|
|
114
116
|
import {
|
|
115
117
|
CONTACT_SUPERVISOR_TOOL_NAME,
|
|
116
118
|
NATIVE_SUPERVISOR_TOOL_NAME,
|
|
@@ -120,7 +122,7 @@ import {
|
|
|
120
122
|
parseSupervisorReplyData,
|
|
121
123
|
parseSupervisorRequestDetails,
|
|
122
124
|
topLevelSupervisorTool
|
|
123
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-PTN7XAXI.js";
|
|
124
126
|
import {
|
|
125
127
|
MODEL_ONLY_TOOL,
|
|
126
128
|
canRenderComponents,
|
|
@@ -135,7 +137,7 @@ import {
|
|
|
135
137
|
reportSessionWarning,
|
|
136
138
|
withCachedUiContext
|
|
137
139
|
} from "./chunk-HXRB42AF.js";
|
|
138
|
-
import "./chunk-
|
|
140
|
+
import "./chunk-VMJGZHUL.js";
|
|
139
141
|
import {
|
|
140
142
|
disabledFeatureUseError,
|
|
141
143
|
getActiveAsyncCapacitySnapshot,
|
|
@@ -146,7 +148,7 @@ import {
|
|
|
146
148
|
resolveDisabledFeatureSurface,
|
|
147
149
|
resolveMaxActiveAsyncRunsPerSession,
|
|
148
150
|
resolveScheduledStoreRoot
|
|
149
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-XYIVVS3A.js";
|
|
150
152
|
import {
|
|
151
153
|
ACTIVE_RUN_INDEX_DIR,
|
|
152
154
|
MissionNotFoundError,
|
|
@@ -197,28 +199,28 @@ import {
|
|
|
197
199
|
withWorkflowChildRunModel,
|
|
198
200
|
writeAsyncResultFile,
|
|
199
201
|
writeResultIndexForData
|
|
200
|
-
} from "./chunk-
|
|
201
|
-
import "./chunk-
|
|
202
|
+
} from "./chunk-SIB2GQHL.js";
|
|
203
|
+
import "./chunk-37EJGDYO.js";
|
|
202
204
|
import {
|
|
203
205
|
shouldUseNativeFsWatch
|
|
204
206
|
} from "./chunk-NIXWDZZV.js";
|
|
205
207
|
import {
|
|
206
208
|
validateIntercomBridgeConfig
|
|
207
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-CPWZN5KM.js";
|
|
208
210
|
import "./chunk-7F6RKT6W.js";
|
|
209
|
-
import "./chunk-
|
|
211
|
+
import "./chunk-YVDKGAEO.js";
|
|
210
212
|
import "./chunk-YARY7JWU.js";
|
|
211
213
|
import {
|
|
212
214
|
listHerdrProjectPaneRoots,
|
|
213
215
|
restoreHerdrProjectPaneSnapshots
|
|
214
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-UC22RDXP.js";
|
|
215
217
|
import "./chunk-72334PEI.js";
|
|
216
218
|
import {
|
|
217
219
|
cleanupAllArtifactDirs,
|
|
218
220
|
cleanupOldArtifacts,
|
|
219
221
|
getArtifactPaths,
|
|
220
222
|
getArtifactsDir
|
|
221
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-5J2RTMKW.js";
|
|
222
224
|
import {
|
|
223
225
|
listBackgroundWorkProviders
|
|
224
226
|
} from "./chunk-XA3DY6UG.js";
|
|
@@ -226,12 +228,12 @@ import "./chunk-YYREO77V.js";
|
|
|
226
228
|
import "./chunk-UKG4V45O.js";
|
|
227
229
|
import {
|
|
228
230
|
registerRuntimeAgentEventListener
|
|
229
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-P2M6RIVX.js";
|
|
230
232
|
import {
|
|
231
233
|
clearRuntimeAgentsForPi,
|
|
232
234
|
listRuntimeAgentConfigs,
|
|
233
235
|
mergeRuntimeAgents
|
|
234
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-7Y4IJMCW.js";
|
|
235
237
|
import {
|
|
236
238
|
DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
|
|
237
239
|
DEFAULT_WAIT_TOOL_NAME,
|
|
@@ -275,7 +277,7 @@ import {
|
|
|
275
277
|
waitToolName,
|
|
276
278
|
withSettingsFileLease,
|
|
277
279
|
writeAtomicJson
|
|
278
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-F4NSLXB2.js";
|
|
279
281
|
import {
|
|
280
282
|
DEFAULT_ARTIFACT_CONFIG,
|
|
281
283
|
DIRS,
|
|
@@ -299,7 +301,7 @@ import {
|
|
|
299
301
|
WIDGET_ANIMATION_INTERVAL_MS,
|
|
300
302
|
WIDGET_KEY,
|
|
301
303
|
resolveMaxSubagentSpawnsPerSession
|
|
302
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-SRWJIAIP.js";
|
|
303
305
|
import {
|
|
304
306
|
safeTerminalText,
|
|
305
307
|
sanitizeDisplayText,
|
|
@@ -1533,6 +1535,37 @@ function missionReferenceBlocksReclaim(runDir, resultsDir, runId) {
|
|
|
1533
1535
|
return !(error instanceof MissionNotFoundError);
|
|
1534
1536
|
}
|
|
1535
1537
|
}
|
|
1538
|
+
function runKept(input, runId) {
|
|
1539
|
+
const runDir = path3.join(input.asyncDirRoot, runId);
|
|
1540
|
+
if (!fs4.existsSync(runDir)) return false;
|
|
1541
|
+
const status = readStatus2(runDir);
|
|
1542
|
+
if (status?.runId !== runId || !TERMINAL_STATES.has(status.state)) return true;
|
|
1543
|
+
if (input.protectedRunIds.has(runId) || input.waitRunIds.has(runId) || activeMarkerExists(input.asyncDirRoot, runId)) return true;
|
|
1544
|
+
const timestamp = statusTimestamp(status, runDir);
|
|
1545
|
+
return timestamp === void 0 || timestamp > input.cutoff || timestamp > input.resumableCutoff && hasResumableContract(runDir, status);
|
|
1546
|
+
}
|
|
1547
|
+
function workflowTreeKept(input, workflow) {
|
|
1548
|
+
return (workflow.steps ?? []).some((step) => {
|
|
1549
|
+
if (!step.runId || !validRunId(step.runId)) return false;
|
|
1550
|
+
const revived = step.workflowKey ? projectWorkflowKeyRevival(input.asyncDirRoot, workflow.runId, step.workflowKey, step.runId)?.revivedRunIds ?? [] : [];
|
|
1551
|
+
const chain = [step.runId, ...revived];
|
|
1552
|
+
return fs4.existsSync(path3.join(input.asyncDirRoot, chain.at(-1), REVIVAL_LINK_FILE)) || chain.some((runId) => runKept(input, runId));
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
function workflowKeepsChildren(asyncDirRoot, workflowRunId) {
|
|
1556
|
+
return !validRunId(workflowRunId) || fs4.existsSync(path3.join(asyncDirRoot, workflowRunId));
|
|
1557
|
+
}
|
|
1558
|
+
function workflowReferenceBlocksReclaim(input, runDir, status) {
|
|
1559
|
+
if (status.mode === "workflow" && workflowTreeKept(input, status)) return true;
|
|
1560
|
+
let workflowRunId = status.parentWorkflowRunId;
|
|
1561
|
+
if (fs4.existsSync(path3.join(runDir, REVIVAL_ORIGIN_FILE))) {
|
|
1562
|
+
const origin = readJson(path3.join(runDir, REVIVAL_ORIGIN_FILE));
|
|
1563
|
+
if (typeof origin?.workflowRunId !== "string") return true;
|
|
1564
|
+
workflowRunId = origin.workflowRunId;
|
|
1565
|
+
}
|
|
1566
|
+
if (workflowRunId === void 0) return status.workflowKey !== void 0;
|
|
1567
|
+
return workflowKeepsChildren(input.asyncDirRoot, workflowRunId);
|
|
1568
|
+
}
|
|
1536
1569
|
function runTombstoneMarkerPath(maintenanceRoot, runId) {
|
|
1537
1570
|
return path3.join(maintenanceRoot, RUN_TOMBSTONE_MARKERS_DIR, `${encodeIndexSegment(runId)}.json`);
|
|
1538
1571
|
}
|
|
@@ -1600,8 +1633,7 @@ function runSkipReason(input) {
|
|
|
1600
1633
|
if (input.waitRunIds.has(status.runId)) return "wait-reference";
|
|
1601
1634
|
if (activeMarkerExists(input.asyncDirRoot, status.runId)) return "active-index";
|
|
1602
1635
|
if (!TERMINAL_STATES.has(status.state)) return "non-terminal";
|
|
1603
|
-
if (
|
|
1604
|
-
if (fs4.existsSync(path3.join(runDir, REVIVAL_ORIGIN_FILE))) return "workflow-reference";
|
|
1636
|
+
if (workflowReferenceBlocksReclaim(input, runDir, status)) return "workflow-reference";
|
|
1605
1637
|
if (hasNestedReferences(status)) return "nested-reference";
|
|
1606
1638
|
if (missionReferenceBlocksReclaim(runDir, input.resultsDir, status.runId)) return "mission-reference";
|
|
1607
1639
|
if (hasUnresolvedRunHandoff(runDir, status)) return "handoff-reference";
|
|
@@ -1763,9 +1795,6 @@ function hasUnresolvedResultHandoff(data) {
|
|
|
1763
1795
|
const manifestPath = data.parallelHandoff.path;
|
|
1764
1796
|
return typeof manifestPath !== "string" || !manifestPath || unresolvedHandoff(manifestPath);
|
|
1765
1797
|
}
|
|
1766
|
-
function completionMode(data) {
|
|
1767
|
-
return data.completion && typeof data.completion === "object" && !Array.isArray(data.completion) ? data.completion.mode : void 0;
|
|
1768
|
-
}
|
|
1769
1798
|
function resultSkipReason(input) {
|
|
1770
1799
|
if (!input.data) return "invalid-result";
|
|
1771
1800
|
const runId = resultRunId(input.candidate, input.data);
|
|
@@ -1776,7 +1805,7 @@ function resultSkipReason(input) {
|
|
|
1776
1805
|
if (activeMarkerExists(input.asyncDirRoot, runId)) return "active-index";
|
|
1777
1806
|
if (fs4.existsSync(path3.join(input.asyncDirRoot, runId))) return "run-present";
|
|
1778
1807
|
if (missionObserverIndexExists(input.resultsDir, runId)) return "mission-reference";
|
|
1779
|
-
if (input.data.
|
|
1808
|
+
if (typeof input.data.parentWorkflowRunId === "string" ? workflowKeepsChildren(input.asyncDirRoot, input.data.parentWorkflowRunId) : typeof input.data.workflowKey === "string") return "workflow-reference";
|
|
1780
1809
|
if (hasUnresolvedResultHandoff(input.data)) return "handoff-reference";
|
|
1781
1810
|
const timestamp = resultTimestamp(input.data, input.candidate.path);
|
|
1782
1811
|
if (resultHasResumableSession(input.data) && (timestamp === void 0 || timestamp > input.resumableCutoff)) return "resumable";
|
|
@@ -5439,7 +5468,7 @@ function registerSlashCommands(pi, state, options = {}) {
|
|
|
5439
5468
|
}
|
|
5440
5469
|
fleetOpen = true;
|
|
5441
5470
|
try {
|
|
5442
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
5471
|
+
const { openSubagentFleet } = await import("./chunk-G43SW4BT.js");
|
|
5443
5472
|
await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
|
|
5444
5473
|
} finally {
|
|
5445
5474
|
fleetOpen = false;
|
|
@@ -8853,7 +8882,7 @@ function registerSubagentExtension(pi) {
|
|
|
8853
8882
|
const ctx = withLastUiContext((current) => current);
|
|
8854
8883
|
if (!ctx) return;
|
|
8855
8884
|
try {
|
|
8856
|
-
const { openSubagentFleet } = await import("./chunk-
|
|
8885
|
+
const { openSubagentFleet } = await import("./chunk-G43SW4BT.js");
|
|
8857
8886
|
await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
|
|
8858
8887
|
} catch (error) {
|
|
8859
8888
|
if (isStaleExtensionContextError(error)) {
|
|
@@ -9062,7 +9091,7 @@ function registerSubagentExtension(pi) {
|
|
|
9062
9091
|
let executor;
|
|
9063
9092
|
let executorPromise;
|
|
9064
9093
|
let executorModulePromise;
|
|
9065
|
-
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-
|
|
9094
|
+
const loadExecutorModule = () => executorModulePromise ??= import("./chunk-AJWRYQPH.js");
|
|
9066
9095
|
const getExecutor = () => {
|
|
9067
9096
|
executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
|
|
9068
9097
|
executor = createSubagentExecutor(executorDeps);
|
|
@@ -9076,7 +9105,7 @@ function registerSubagentExtension(pi) {
|
|
|
9076
9105
|
modulePreloadTimer = setTimeout(() => {
|
|
9077
9106
|
loadExecutorModule().catch(() => {
|
|
9078
9107
|
});
|
|
9079
|
-
if (fleetViewEnabled) import("./chunk-
|
|
9108
|
+
if (fleetViewEnabled) import("./chunk-G43SW4BT.js").catch(() => {
|
|
9080
9109
|
});
|
|
9081
9110
|
}, MODULE_PRELOAD_DELAY_MS);
|
|
9082
9111
|
modulePreloadTimer.unref?.();
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createAtomicJsonWriter,
|
|
3
3
|
getAgentDir,
|
|
4
4
|
readStatus
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-F4NSLXB2.js";
|
|
6
6
|
import {
|
|
7
7
|
DIRS,
|
|
8
8
|
TEMP_ARTIFACTS_DIR,
|
|
9
9
|
TEMP_ROOT_DIR
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SRWJIAIP.js";
|
|
11
11
|
|
|
12
12
|
// src/shared/artifacts.ts
|
|
13
13
|
import * as fs2 from "node:fs";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EBGTTJKP.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ACTHBJUI.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-RIBMW6V3.js";
|
|
12
|
+
import "./chunk-2LEBXCLU.js";
|
|
13
|
+
import "./chunk-PTN7XAXI.js";
|
|
14
14
|
import {
|
|
15
15
|
MODEL_ONLY_TOOL
|
|
16
16
|
} from "./chunk-HXRB42AF.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-VMJGZHUL.js";
|
|
18
18
|
import {
|
|
19
19
|
appendAgentRefinementOverlay
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-KNVQTRSY.js";
|
|
21
|
+
import "./chunk-SIB2GQHL.js";
|
|
22
22
|
import "./chunk-NIXWDZZV.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-CPWZN5KM.js";
|
|
24
24
|
import "./chunk-7F6RKT6W.js";
|
|
25
25
|
import {
|
|
26
26
|
assertNoToolModifierEntries
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YVDKGAEO.js";
|
|
28
28
|
import "./chunk-YARY7JWU.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-5J2RTMKW.js";
|
|
30
30
|
import {
|
|
31
31
|
HERDR_PI_MAX_ACCEPTANCE_PROMPT_BYTES,
|
|
32
32
|
HERDR_PI_MAX_FRAME_BYTES,
|
|
@@ -44,8 +44,8 @@ import {
|
|
|
44
44
|
discoverAgents,
|
|
45
45
|
resolveExistingReadPaths,
|
|
46
46
|
resolveSkills
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-F4NSLXB2.js";
|
|
48
|
+
import "./chunk-SRWJIAIP.js";
|
|
49
49
|
import "./chunk-YFCK7H2S.js";
|
|
50
50
|
import "./chunk-QXASAHIA.js";
|
|
51
51
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
validateCodeOwnedProfileRunner,
|
|
9
9
|
validatePermissionRules,
|
|
10
10
|
validateToolBudgetConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F4NSLXB2.js";
|
|
12
12
|
|
|
13
13
|
// src/agents/runtime-agent-registry.ts
|
|
14
14
|
var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
|