@vicary/pi-subagents 0.84.0 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/bundle/agents.js +3 -3
- package/bundle/child-tool-plan.js +2 -2
- package/bundle/{chunk-VQVVHSY6.js → chunk-2DITXA3H.js} +22 -11
- package/bundle/{chunk-V2BZYLEP.js → chunk-374MZFF4.js} +7 -2
- package/bundle/{chunk-4E7BKDTX.js → chunk-3RKFH2UZ.js} +11 -156
- package/bundle/{chunk-F4ASL6OV.js → chunk-5H4BICQZ.js} +1 -1
- package/bundle/{chunk-PALJGGYC.js → chunk-6VD7BGIC.js} +6 -3
- package/bundle/{chunk-C5P5CHYK.js → chunk-77ASNIEM.js} +1 -1
- package/bundle/{chunk-PV63UFUR.js → chunk-7QA7ZA46.js} +183 -28
- package/bundle/{chunk-NKQ6JNAS.js → chunk-7ZUFN6ME.js} +2 -1
- package/bundle/{chunk-L3WFKBEI.js → chunk-BGXEAYUM.js} +247 -153
- package/bundle/{chunk-J5YL7LYR.js → chunk-BU6PFPVX.js} +59 -27
- package/bundle/{chunk-7BWGNDNK.js → chunk-CJHFDQFJ.js} +196 -1183
- package/bundle/{chunk-DZDETGRJ.js → chunk-DD22RXYJ.js} +259 -216
- package/bundle/{chunk-CGN2TVE7.js → chunk-GJGTMLPE.js} +322 -18
- package/bundle/{chunk-XDQORLZ5.js → chunk-GLVJMI6R.js} +15 -6
- package/bundle/{chunk-D3JAFGMO.js → chunk-GRJHIXYF.js} +1 -1
- package/bundle/chunk-HXRB42AF.js +108 -0
- package/bundle/{chunk-LFDBD4PW.js → chunk-LGINOOY5.js} +2 -2
- package/bundle/{chunk-G2Z6ZH26.js → chunk-NAFLUJ26.js} +1 -1
- package/bundle/{chunk-2DHZTCOL.js → chunk-PYOAIN3V.js} +2 -2
- package/bundle/{chunk-RSLHTEQV.js → chunk-QFLPV64W.js} +324 -111
- package/bundle/{chunk-LNRJCP2Y.js → chunk-QGO6HXHG.js} +417 -242
- package/bundle/{chunk-2S4K53MV.js → chunk-S2Q75LP3.js} +1 -1
- package/bundle/{chunk-NENDSQUY.js → chunk-UR7OW5S7.js} +9 -6
- package/bundle/{chunk-RWPNQZHS.js → chunk-WHC2XHGF.js} +217 -106
- package/bundle/{chunk-AKOIVLA5.js → chunk-WN2E5XHN.js} +135 -77
- package/bundle/{chunk-4NIY3BE6.js → chunk-XOFYXQKZ.js} +2 -2
- package/bundle/{chunk-2D52JFLF.js → chunk-YK3QYNLE.js} +41 -117
- package/bundle/chunk-ZPY5QZCS.js +1067 -0
- package/bundle/control-channel.js +2 -2
- package/bundle/index.js +1 -1
- package/bundle/intercom-bridge.js +2 -2
- package/bundle/preflight.js +8 -8
- package/bundle/project-panes.js +3 -3
- package/docs/agents.md +24 -3
- package/docs/configuration.md +9 -9
- package/docs/extension-api.md +16 -1
- package/docs/observability.md +1 -1
- package/docs/tool-reference.md +3 -1
- package/docs/workflows.md +31 -3
- package/package.json +2 -2
- package/src/agents/agent-management.js +27 -11
- package/src/agents/agent-memory.d.ts +1 -4
- package/src/agents/agent-memory.js +1 -4
- package/src/agents/agents.d.ts +1 -3
- package/src/agents/agents.js +7 -6
- package/src/agents/frontmatter.js +1 -8
- package/src/agents/global-npm-root.d.ts +1 -0
- package/src/agents/global-npm-root.js +11 -3
- package/src/agents/skills.d.ts +0 -3
- package/src/agents/skills.js +0 -3
- package/src/extension/config.js +7 -1
- package/src/extension/herdr-pi-bridge.js +10 -2
- package/src/extension/index.d.ts +0 -13
- package/src/extension/index.js +43 -32
- package/src/extension/public-execution.d.ts +1 -0
- package/src/extension/public-execution.js +4 -0
- package/src/extension/reply-workflow-script.js +24 -4
- package/src/extension/schemas.d.ts +8 -3
- package/src/extension/schemas.js +6 -4
- package/src/extension/session-switch.d.ts +25 -0
- package/src/extension/session-switch.js +138 -0
- package/src/extension/subagent-guide.d.ts +1 -1
- package/src/extension/subagent-guide.js +1 -1
- package/src/extension/subagent-launch-tool.d.ts +25 -0
- package/src/extension/subagent-launch-tool.js +48 -0
- package/src/extension/tool-activation.js +35 -12
- package/src/extension/tool-description.d.ts +1 -1
- package/src/extension/tool-description.js +14 -8
- package/src/inspectors/herdr/actions.d.ts +0 -1
- package/src/inspectors/herdr/actions.js +0 -1
- package/src/inspectors/session-roots-codec.d.ts +0 -1
- package/src/inspectors/session-roots-codec.js +0 -1
- package/src/inspectors/tmux/actions.d.ts +0 -1
- package/src/inspectors/tmux/actions.js +0 -1
- package/src/integrations/herdr-status.js +3 -8
- package/src/intercom/native-supervisor-channel.js +65 -9
- package/src/runs/background/async-execution.d.ts +5 -10
- package/src/runs/background/async-execution.js +63 -29
- package/src/runs/background/async-job-tracker.js +12 -0
- package/src/runs/background/async-resume.d.ts +2 -1
- package/src/runs/background/async-resume.js +112 -39
- package/src/runs/background/async-retention.js +6 -1
- package/src/runs/background/auto-drain.d.ts +0 -1
- package/src/runs/background/auto-drain.js +7 -6
- package/src/runs/background/boot-id.d.ts +1 -3
- package/src/runs/background/boot-id.js +1 -3
- package/src/runs/background/completion-batcher.d.ts +3 -4
- package/src/runs/background/completion-batcher.js +2 -3
- package/src/runs/background/control-channel.d.ts +0 -6
- package/src/runs/background/control-channel.js +0 -6
- package/src/runs/background/fleet-view.js +2 -3
- package/src/runs/background/notify.d.ts +0 -2
- package/src/runs/background/notify.js +0 -2
- package/src/runs/background/result-watcher.d.ts +1 -0
- package/src/runs/background/result-watcher.js +59 -29
- package/src/runs/background/resume-guidance.js +4 -2
- package/src/runs/background/retained-children.js +2 -1
- package/src/runs/background/run-child-session.d.ts +0 -1
- package/src/runs/background/run-child-session.js +1 -1
- package/src/runs/background/run-status.js +9 -7
- package/src/runs/background/scheduled-runs.d.ts +3 -1
- package/src/runs/background/scheduled-runs.js +13 -16
- package/src/runs/background/subagent-runner.d.ts +2 -4
- package/src/runs/background/subagent-runner.js +15 -12
- package/src/runs/background/subagent-wait.js +12 -15
- package/src/runs/background/wait-config.d.ts +2 -0
- package/src/runs/background/wait-config.js +17 -3
- package/src/runs/background/wait-tool.js +4 -2
- package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
- package/src/runs/background/workflow-terminal-proof.js +0 -1
- package/src/runs/foreground/execution.d.ts +0 -3
- package/src/runs/foreground/execution.js +17 -9
- package/src/runs/foreground/subagent-executor.d.ts +7 -8
- package/src/runs/foreground/subagent-executor.js +113 -44
- package/src/runs/shared/acceptance.js +69 -26
- package/src/runs/shared/child-commands.js +15 -2
- package/src/runs/shared/child-hooks.d.ts +1 -7
- package/src/runs/shared/child-hooks.js +13 -5
- package/src/runs/shared/child-launch.js +6 -2
- package/src/runs/shared/child-runtime-config.d.ts +0 -1
- package/src/runs/shared/child-session.d.ts +1 -1
- package/src/runs/shared/child-session.js +21 -2
- package/src/runs/shared/child-tool-plan.d.ts +0 -1
- package/src/runs/shared/child-tool-plan.js +0 -1
- package/src/runs/shared/claude-code-adapter.js +11 -0
- package/src/runs/shared/external-cli-contract.d.ts +49 -0
- package/src/runs/shared/external-cli-contract.js +18 -13
- package/src/runs/shared/external-cli-runner.js +26 -6
- package/src/runs/shared/herdr-connection.js +2 -1
- package/src/runs/shared/herdr-pane-host.d.ts +2 -2
- package/src/runs/shared/herdr-pane-host.js +17 -1
- package/src/runs/shared/herdr-placed-run.js +48 -22
- package/src/runs/shared/lane-metadata.d.ts +0 -1
- package/src/runs/shared/lane-metadata.js +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.js +8 -1
- package/src/runs/shared/model-resolution-diagnostic.d.ts +0 -1
- package/src/runs/shared/model-resolution.d.ts +2 -2
- package/src/runs/shared/model-resolution.js +7 -1
- package/src/runs/shared/model-scope.d.ts +1 -5
- package/src/runs/shared/model-scope.js +1 -5
- package/src/runs/shared/mutation-evidence.d.ts +1 -1
- package/src/runs/shared/mutation-evidence.js +52 -7
- package/src/runs/shared/nested-events.d.ts +1 -0
- package/src/runs/shared/nested-events.js +1 -1
- package/src/runs/shared/parallel-utils.d.ts +0 -1
- package/src/runs/shared/permissions.js +5 -3
- package/src/runs/shared/placement-host.d.ts +5 -1
- package/src/runs/shared/rex-pane-host.d.ts +0 -1
- package/src/runs/shared/rex-pane-host.js +0 -2
- package/src/runs/shared/run-launch-folder.d.ts +12 -0
- package/src/runs/shared/run-launch-folder.js +21 -0
- package/src/runs/shared/runner-launcher.d.ts +12 -1
- package/src/runs/shared/runner-launcher.js +16 -0
- package/src/runs/shared/single-output.d.ts +3 -3
- package/src/runs/shared/single-output.js +5 -3
- package/src/runs/shared/structured-output.d.ts +8 -0
- package/src/runs/shared/structured-output.js +40 -5
- package/src/runs/shared/subagent-prompt-runtime.d.ts +0 -1
- package/src/runs/shared/subagent-prompt-runtime.js +4 -2
- package/src/runs/shared/tool-timeout.js +2 -1
- package/src/runs/shared/worktree-cleanup-plan.d.ts +0 -1
- package/src/runs/shared/worktree-cleanup-plan.js +0 -1
- package/src/runs/shared/worktree.d.ts +3 -0
- package/src/runs/shared/worktree.js +20 -0
- package/src/shared/capacity-resilient-json.d.ts +1 -1
- package/src/shared/child-cache-retention.d.ts +1 -2
- package/src/shared/child-cache-retention.js +1 -2
- package/src/shared/fleet-transcript-reader.d.ts +51 -0
- package/src/shared/fleet-transcript-reader.js +333 -0
- package/src/shared/formatters.d.ts +0 -18
- package/src/shared/formatters.js +0 -18
- package/src/shared/session-succession.d.ts +16 -1
- package/src/shared/session-succession.js +41 -2
- package/src/shared/session-warnings.d.ts +7 -0
- package/src/shared/session-warnings.js +26 -0
- package/src/shared/settings.d.ts +0 -23
- package/src/shared/settings.js +3 -35
- package/src/shared/types.d.ts +90 -65
- package/src/shared/types.js +0 -12
- package/src/shared/utils.d.ts +0 -14
- package/src/shared/utils.js +0 -22
- package/src/shared/wait-tool-name.d.ts +8 -0
- package/src/shared/wait-tool-name.js +13 -0
- package/src/slash/slash-commands.js +2 -1
- package/src/slash/subagent-cost.d.ts +3 -2
- package/src/slash/subagent-cost.js +22 -3
- package/src/slash/subagents-admin.js +0 -1
- package/src/tui/fleet-status.d.ts +0 -5
- package/src/tui/fleet-status.js +4 -24
- package/src/tui/fleet-transcript.d.ts +1 -44
- package/src/tui/fleet-transcript.js +1 -327
- package/src/tui/fleet.js +6 -4
- package/src/tui/render.d.ts +0 -9
- package/src/tui/render.js +161 -66
- package/src/tui/subagent-messages.js +3 -2
- package/src/watchdog/register-child.d.ts +2 -3
- package/src/watchdog/register-child.js +2 -3
- package/src/watchdog/turn-delta.js +2 -1
- package/src/workflows/scripted-workflow.js +241 -20
- package/src/workflows/workflow-launch-record.d.ts +15 -6
- package/src/workflows/workflow-launch-record.js +30 -12
- package/src/workflows/workflow-receipt.js +36 -53
- package/src/workflows/workflow-resume-claim.js +2 -2
- package/src/workflows/workflow-resume.d.ts +1 -1
- package/src/workflows/workflow-resume.js +11 -8
- package/src/workflows/workflow-script-worker.d.ts +13 -0
- package/src/workflows/workflow-script-worker.js +79 -0
- package/workflow-script-process.cjs +36 -0
- package/workflow-script-worker.cjs +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.86.0] - 2026-11-05
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- Sessions no longer lose their subagent tools after a compaction when pi-subagents had been reloaded or updated earlier in the session.
|
|
10
|
+
- Typed JSON checks pass on KDE desktops again, where common environment values were mistaken for secrets and broke the JSON.
|
|
11
|
+
- With one background agent running, the expanded widget shows its whole task instead of one line cut at 96 characters.
|
|
12
|
+
- Status for Claude Code, Codex and Cursor agents now says plainly that its safety settings are the adapter's defaults, not something measured from the running process.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- When one background child is running, the expanded background-agents widget shows its task as written: line breaks kept, wrapped to the terminal width, up to 8 lines. Before, it was squeezed onto one line and cut at 96 characters. With two or more children running, each keeps a one-line task so every running child stays on screen. The collapsed widget is unchanged. Thanks to [@marshamonkey25-hue](https://github.com/marshamonkey25-hue) for the report. (#3187)
|
|
17
|
+
- The safety settings shown for a Claude Code, Codex or Cursor agent are now labelled `Safety (adapter profile, not measured)`. They are what the adapter asks the CLI for, and a wrapper script set as `runner.command` can grant something different. Run status and workflow receipts also record `safetySource: { measured: false, command }`, naming the command that launched the run; runs on a Herdr saved machine record no command, because the remote machine runs its own CLI. See [Safety record and wrapper commands](docs/agents.md#safety-record-and-wrapper-commands). Thanks to [@drye](https://github.com/drye) for #3199.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- A session whose subagent tools were turned off when pi-subagents was reloaded or updated now gets them back after a compaction. Before, if the reload came before the compaction, the session resumed with neither `subagent` nor `subagents_enable`, and restarting or forking it did not help. Tools you removed yourself stay removed. Thanks to [@chuducandev](https://github.com/chuducandev) for the report. (#3198)
|
|
22
|
+
- A passing `output: "json"` check no longer fails as "not valid JSON" when an environment variable with a secret-looking name holds a common value, such as `KDE_FULL_SESSION=true` or `XDG_SESSION_CLASS=user` on KDE. The output is now parsed first and secrets are hidden afterwards, in the parsed strings, keys and numbers, so values like `true` and `null` are left alone. Thanks to [@nhp](https://github.com/nhp) for the report. (#3191)
|
|
23
|
+
- A child's `structured_output` call no longer crashes with `RangeError: Maximum call stack size exceeded` when the `outputSchema` refers to itself through `$ref` (for example `{"allOf": [{"$ref": "#"}]}`). It now fails with "Structured output validation failed: outputSchema cannot be validated (cyclic or too deep)", and typed checks, dynamic fanout and saved structured output report the same error. Thanks to [@G0-0000](https://github.com/G0-0000) for the report. (#3190)
|
|
24
|
+
- A custom `subagent` tool description that uses `{{compactDescription}}` or `{{fullDescription}}` no longer describes features turned off with `disabledFeatures`. Before, with workflow scripts disabled, the model was still told how to write them. Thanks to [@ohlulu](https://github.com/ohlulu) for the report. (#3192)
|
|
25
|
+
|
|
26
|
+
## [0.85.0] - 2026-11-04
|
|
27
|
+
|
|
28
|
+
### Highlights
|
|
29
|
+
|
|
30
|
+
- Switching sessions while background agents are still working now asks what to do with that work: stay, take it along, or leave it with the current session.
|
|
31
|
+
- Permission extensions such as pi-guard can now see and block each child a workflow starts, including the commands that child's checks will run and the file it will write.
|
|
32
|
+
- Workflow scripts on Node run in a locked-down process, and resuming a sandboxed run no longer trusts files that run could rewrite.
|
|
33
|
+
- Pi no longer exits or freezes when a temp folder is unreadable, a repository is large, or a prompt holds a long run of separators.
|
|
34
|
+
- Children placed on Herdr or Rex machines start and stay connected far more reliably.
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- A call can now require a launcher: `options.requireLauncher: { name, definitionDigest }` makes a single background launch run only under that launcher with that exact agent definition, and refuses it otherwise instead of running without the launcher. Extensions that sandbox children through a launcher can use it to make sure the agent they approved is the one that runs. See [Requiring a launcher](docs/extension-api.md#requiring-a-launcher). Thanks to [@ViperJuice](https://github.com/ViperJuice) for the proposal. (#3163)
|
|
39
|
+
- The wait tool can be renamed with `waitTool.name` in the pi-subagents config, so pi-subagents can run next to another extension that also registers `bg_wait`. Pi refuses to start when two extensions register the same tool name, and before this there was no setting to avoid that. The default name is still `bg_wait`. Thanks to [@Christopher876](https://github.com/Christopher876) for the report. (#3167)
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Switching sessions with `/new`, `/resume`, `/fork` or `/clone` while background subagent work is still running, has undelivered results, or has unanswered questions now asks first: stay here, switch and take the work, or switch and leave the work with the current session (reopen it later to get the results of its background runs). Before, the new session always took the work over, even when it was an unrelated conversation. Sessions without a UI, such as `pi -p`, still hand the work over automatically. Thanks to [@IdrisGit](https://github.com/IdrisGit) for #3170.
|
|
44
|
+
- The Herdr `title-suffix` token is now always `⏳N`, where N is the number of active subagents (plus `⚠` when a child needs attention). Before, it showed the agent name when exactly one run was active and the newest workflow label when one was set, which changed width as runs started and finished and was truncated in narrow sidebar rows. The `summary` token and state labels still carry the agent names and workflow label. Thanks to [@longyuxi](https://github.com/longyuxi) for the report and #3157. (#3156)
|
|
45
|
+
- Resume and auto-resume no longer trust files a background run can write. What a resume starts, who owns it, where it runs and with what permissions now comes only from records kept outside the run's folder. Before, a run sandboxed by a runner launcher could edit its own folder to make the parent start something else at the next session start. Runs started before this update can't be resumed or auto-resumed; relaunch workflows with `options: { reuseFrom: "<id>" }` and start single runs again. Thanks to [@ViperJuice](https://github.com/ViperJuice) for the report. (#3116)
|
|
46
|
+
- Before a workflow starts a child, pi-subagents now makes a nested `subagent_launch` tool call carrying the child's agent, task, working directory and workflow key. Permission extensions such as pi-guard and @gotgenes/pi-permission-system see it in their `tool_call` handler and can block that child, which then fails with the block reason. Extensions that ask about tools they have no rule for will ask once per workflow child until you allow `subagent_launch`, and ones that deny unknown tools in `pi -p` will refuse workflow children there. Schedule ticks, auto-resume, `/prompt-workflow` and prompt-template delegation, RPC launches and workflows inside child agents are not offered; see [Workflows](docs/workflows.md#approving-workflow-children-in-permission-extensions). Thanks to [@ducn1806](https://github.com/ducn1806) for the report and the first implementation in #3123. (#3109)
|
|
47
|
+
- The `subagent_launch` call now also carries the shell commands the child's `gate` or `acceptance.verify` will run on your machine after it finishes, with their working directory and environment, and the absolute path of the file the child writes with `output`. Before, a workflow script could run those commands and write that file with no permission extension able to see them, even with `bash` blocked. Blocking the call stops the commands and the write too. An extension's `bash` rules don't apply to these commands on their own; it has to check `commands`. Thanks to [@ducn1806](https://github.com/ducn1806) for the report. (#3109)
|
|
48
|
+
- On Node, workflow scripts now run in a fresh permission-restricted process with no inherited startup flags or credentials, and cannot write files or start processes through Node APIs even outside the VM. A supervisor exits when the parent disconnects, including when the script is busy. Bun keeps its existing worker boundary. Thanks to [@XLi-hub](https://github.com/XLi-hub) for #3104.
|
|
49
|
+
- Finding agents again after they were already loaded scans the agent folders once instead of twice when chains are loaded too. The agents found are unchanged. Thanks to [@ArietidsZ](https://github.com/ArietidsZ) for #3115.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Checking which tracked files a finished child changed no longer freezes Pi on a large repository. Before, the git calls and the hash of a large diff ran synchronously, so steering, status updates and other children stopped for about a second while several children finished. Thanks to [@windli2018](https://github.com/windli2018) for #3181 and #3183.
|
|
54
|
+
- A paused interval schedule with no next run can now be read. Before, a schedule paused by editing its `schedule.json` and removing `nextRunAt` broke every schedule in the project: `schedule.list`, `run-due` and restore on startup failed, and each background run that finished printed a multi-line stack trace over the input box in every open session. Resuming that schedule now sets its next run, and a schedule file that still can't be read shows one warning per session (one stderr line without a UI). Thanks to [@barjatiyasaurabh](https://github.com/barjatiyasaurabh) for the report (#3180) and #3184.
|
|
55
|
+
- In interactive sessions, the notices about a slow result scan, a slow reload step, an unreadable result file, invalid nested children or a failed result-watcher restart now show once as a TUI warning. Before, they were written straight to the terminal and stayed on screen next to the input box, looking like typed text. A file that fails on every poll warns once per session. Sessions without a UI still get the line on stderr. Thanks to [@shreknitin89](https://github.com/shreknitin89) for #3171, #3178 and #3179.
|
|
56
|
+
- An invalid `globalConcurrencyLimit` in the config file (such as `0`, `2.5` or a string) now fails config loading with a clear message. Before, background runs quietly ran one child at a time and workflow scripts failed only when they started. Thanks to [@windli2018](https://github.com/windli2018) for #3165.
|
|
57
|
+
- An unreadable or full temp directory during the supervisor channel's background poll no longer exits Pi. Before, one failed scan of the supervisor mailbox folder was treated as an uncaught error and ended the session. Now it shows one warning and the poll keeps running; the supervisor tool's `pending` action and the wait tool still report the error instead of saying nothing is pending. Thanks to [@jordan-quan](https://github.com/jordan-quan) for the report and #3168.
|
|
58
|
+
- A filesystem error in three background timers no longer exits Pi: the 1-second activity update of a foreground run, the supervisor-reply poll of a Herdr or Rex placed run, and a child command's `yieldTimeMs` timer. Before, Pi treated the error as uncaught and quit the whole session. Now the activity update shows a warning and still sends its notice, the reply poll tries again on its next tick, and the yielded command's result says its saved state is out of date. Thanks to [@jordan-quan](https://github.com/jordan-quan) for the report. (#3169)
|
|
59
|
+
- The bundled `reviewer` agent, and any agent that declares `watchdog_diff`, can now start as a placed child (Rex `machine: "local"` or a Herdr pane). Before, the child Pi crashed about a second after launch and the parent reported "Remote Pi bridge connection was lost; task state is unknown." A bridge setup error now closes the bridge connection instead of crashing the child Pi, and the error names the tools Pi could not activate. Thanks to [@hecspc](https://github.com/hecspc) for the report and fix. (#3159)
|
|
60
|
+
- A placed child (Rex or Herdr pane) that reported progress or asked its supervisor a question after about a minute idle no longer loses its bridge. Before, the run ended with "Remote Pi reconciliation failed; task state is unknown" while the child kept working, because the parent's cleanup had removed the child's empty supervisor mailbox. Thanks to [@hecspc](https://github.com/hecspc) for the report and fix. (#3158)
|
|
61
|
+
- A child placed on a machine (including Rex `machine: "local"`) no longer fails with "Pane-native remote Pi cannot transfer local extension paths" when an extension in the parent session, such as billion-context, registered a required child extension without `requireForAllRunners`. A placed child now skips those entries, as external runners already do. An entry registered with `requireForAllRunners` still refuses the placed launch. Thanks to [@hecspc](https://github.com/hecspc) for the report. (#3139)
|
|
62
|
+
- `list` with `capabilities: true` and the `models` action now mark an agent's model pin that the session's model registry can't resolve with "(unavailable in the active model registry)", and the capability row gets `unavailable: true`. Before, they showed the pin as usable, and launching that agent then failed with "Unknown subagent model". Thanks to [@koenzhao](https://github.com/koenzhao) for the report. (#3144)
|
|
63
|
+
- When a background child that runs an external CLI (Claude Code, Codex, Cursor or a command runner) can't save its run status, for example because the run directory was removed or isn't writable, the run now stops the CLI, removes its prompt file and scratch directories, and fails with the write error. Before, a failure when the CLI started left it running with no way to stop it, and a failure when it finished left the run unsettled. A full disk is still retried in the background as before. Thanks to [@Osraka](https://github.com/Osraka) for the report and reproduction. (#3149)
|
|
64
|
+
- A `structured_output` call is now checked against the step's `outputSchema` exactly as the model sent it, before Pi converts tool arguments. Before, Pi could turn `"x"` into `["x"]`, or `null` into `""` (Pi 1.2) or `"null"` (Pi 1.5), and the converted value was captured as valid. The check is strict, so a value Pi would have converted, such as `"42"` for a number, is now rejected with the usual validation error and the model calls again. Thanks to [@G0-0000](https://github.com/G0-0000) for the report and first fix in #3142.
|
|
65
|
+
- A workflow script that calls `runs.run` again with a key it already launched now adds one "reused" entry to the workflow trace for that key, not one per call. Before, a script that re-delivered the same call in a loop grew the trace without limit, and because every trace change rewrites the whole trace to the run's status file and event log, one run wrote about 11 GB. Thanks to [@Hu3yLin](https://github.com/Hu3yLin) for the diagnosis and regression test in #3145.
|
|
66
|
+
- A Claude Code run no longer fails with a parser line-length error when it reads an image. Claude Code puts the image's base64 in the tool-result line twice, so one full-page screenshot gives a line of over 1 MB. That line is now skipped and the run keeps going, the way the Cursor adapter already handles large tool calls. Both adapters now skip such lines up to 8 MiB each (it was 1 MiB); the 32 MiB limit on a run's whole output still applies. An oversized assistant line or final result still fails the run, so a dropped answer never passes as a success. Thanks to [@drye](https://github.com/drye) for #3138.
|
|
67
|
+
- Disposing a foreground or in-process background child now also releases the per-session resources that the host's extensions registered with `registerSessionResourceCleanup`, such as a provider's cached WebSocket. Before, under Pi's bundled CLI only the SDK's own copy of the cleanup registry ran, so those resources stayed open and `pi -p` could hang after the run finished. Thanks to [@tmustier](https://github.com/tmustier) for the report and fix. (#3140)
|
|
68
|
+
- Resuming a background run now refuses when the run's status file names a different run than its directory, and the error names both. Before, the resume took the run id from whatever the status file said. Thanks to [@ViperJuice](https://github.com/ViperJuice) for the report. (#3116)
|
|
69
|
+
- Resuming a background run whose saved recovery record does not say which launcher it used, such as a workflow child resumed through its workflow run, now uses the agent file's current `launcher`. Before, the resumed child ran without its launcher. The same applies to a foreground run whose agent file gained a `launcher` since. New background runs record "no launcher" explicitly, so a background run started unwrapped still resumes unwrapped. Thanks to [@ViperJuice](https://github.com/ViperJuice) for the report. (#3116)
|
|
70
|
+
- When a launcher-wrapped background run fails to start, pi-subagents now stops the process the runner reported only if that process is the launcher or one of its descendants. Before, a sandboxed runner could report any process id, and pi-subagents would send it SIGTERM and SIGKILL, including to the parent Pi. A runner that is not stopped exits by itself within 30 seconds when it is never told to proceed. Thanks to [@ViperJuice](https://github.com/ViperJuice) for the report. (#3116)
|
|
71
|
+
- Replying to a supervisor request that has already ended now says how it ended and when: withdrawn because the child's run was stopped, interrupted or timed out (for example when a workflow aborts its other children after one fails), expired because no reply came before the child's ask timeout, closed because the child run ended, or already answered. Before, every such reply got the same "answered, expired or withdrawn" error, which did not say what happened to the child. Thanks to [@saman-mb](https://github.com/saman-mb) for the report. (#3126)
|
|
72
|
+
- Validating a workflow script now reports a `runs.all` item with no `key`, whether it is written in the array or returned by a `map(...)` callback. Before, validation passed and the run failed later with "has an invalid key". At run time that error now says whether the key is missing or invalid and gives the key rule. Items built by a named helper function are still checked only at run time. Thanks to [@saman-mb](https://github.com/saman-mb) for the report. (#3127)
|
|
73
|
+
- Passing a file path as `options.script` now says that `options.script` takes the script's source text and that a file goes in `workflow: "<path>"`. Before, validation reported a parse error such as "Invalid regular expression flag". Thanks to [@saman-mb](https://github.com/saman-mb) for the report. (#3127)
|
|
74
|
+
- When `workflow: true` finds no text in the message that issued the call but an earlier message of the same turn holds a `js` code block, the error now says so and points to `options: { script }` or writing the block and the call in one message. The block is still not run from the earlier message. The other no-text error no longer claims the text "never reached" the session, which was not true on every host. Thanks to [@saman-mb](https://github.com/saman-mb) for the report. (#3127)
|
|
75
|
+
- A workflow no longer stalls on task text with long runs of dashes, colons, slashes, quotes or similar separators. The check that looks for file-changing commands in that text rescanned it from every separator; it now reads it once and finds the same commands. Thanks to [@Yivas](https://github.com/Yivas) for #3122 and #3113.
|
|
76
|
+
- When the collapsed async agents widget above the editor runs out of room for a workflow's rows, it now hides the oldest finished rows behind one `… N earlier done` line instead of cutting the list from the bottom, so the running child, the latest finished rows and the other running jobs stay visible. With details expanded, the bottleneck line now comes right after the checklist summary, and each phase's item list shows only its four newest finished items. Thanks to [@pycaw](https://github.com/pycaw) for the report. (#3118)
|
|
77
|
+
- A child placed on a Herdr saved machine or a Rex machine over SSH no longer fails with "cwd does not exist" when its directory exists only on that machine. The launch checked the remote directory on this host, in the foreground and in background runs. Machine `local` still checks it here, since it shares this disk. Thanks to [@tjcarskadon](https://github.com/tjcarskadon) for the report and patch. (#3119)
|
|
78
|
+
- In pi-web, reopening a session after forking it gives that session back its own async runs. Before, the fork kept claiming them too, so either session could take the completion notice, and the fork could still list, wait on, steer or stop them. Thanks to [@nuzayets](https://github.com/nuzayets) for the report and diagnosis. (#3114)
|
|
79
|
+
- A project `agentOverrides` entry for a builtin agent no longer drops the fields set only in your user `agentOverrides` entry for that agent. Project fields still win where both set the same field, as they already did for custom agents. Before, a project entry that set anything for a builtin, such as `thinking`, silently discarded a user-scope `model` pin. Thanks to [@pfz](https://github.com/pfz) for the report. (#3124)
|
|
80
|
+
- Placing a child on a Herdr machine or a remote Rex session over SSH now works on hosts whose sshd drops sessions that run no command. The socket forwarder used `ssh -N`, so on those hosts it exited within seconds and every placed run failed with "bridge connection lost". It now runs a remote command that waits on the connection and exits when the forwarder closes, so nothing is left running on the remote machine. Thanks to [@tjcarskadon](https://github.com/tjcarskadon) for the report and patch. (#3120)
|
|
81
|
+
- The `cost` RPC and `/subagent-cost` now include background runs that were started without a `subagent` tool call, such as RPC `spawn` launches and their workflow children. Before, these runs were left out of the child rows and totals. Thanks to [@BenedictP](https://github.com/BenedictP) for #3106.
|
|
82
|
+
- A direct MCP tool name ending in a long run of slashes no longer slows Pi down. The slashes are trimmed in one pass instead of rescanning the name from every position, and the result is unchanged. Thanks to [@Yivas](https://github.com/Yivas) for #3112.
|
|
83
|
+
- A task prompt holding a long run of `git` options no longer freezes a workflow. The check that looks for `git` commands in it now reads the text in one pass, so a 198,000-character prompt that never finished now takes milliseconds. Thanks to [@Yivas](https://github.com/Yivas) for #3110.
|
|
84
|
+
- Reloading or switching sessions now stops the `npm root -g` lookup that finds globally installed agent packages. Before, it kept running for up to 5 seconds after the session it served was gone, and then rescanned agents for nothing. Thanks to [@ArietidsZ](https://github.com/ArietidsZ) for #3117.
|
|
85
|
+
- A child placed on another machine with an `output` path is now told to return its artifact in its final reply, which Pi saves to that path. Before, it was told to write to a path on the parent's machine that doesn't exist where it runs, and children stopped to ask what to do. A child in a Rex `local` pane runs on the parent's machine and still writes the file itself. Thanks to [@tjcarskadon](https://github.com/tjcarskadon) for the report and patch. (#3121)
|
|
86
|
+
- A native Pi child placed on a Herdr machine no longer fails on its first prompt with "is not an active named agent". Herdr registers a newly started agent's name a moment after it starts, so the first prompt could arrive too early and end the run before the child saw its task. That refusal is now retried for up to 5 seconds; any other prompt error still fails at once. Thanks to [@tjcarskadon](https://github.com/tjcarskadon) for the report and patch. (#3121)
|
|
87
|
+
|
|
5
88
|
## [0.84.0] - 2026-10-28
|
|
6
89
|
|
|
7
90
|
### Highlights
|
package/bundle/agents.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
RUNTIME_AGENT_REGISTER_EVENT,
|
|
3
3
|
RUNTIME_AGENT_REGISTER_VERSION,
|
|
4
4
|
registerAgentViaEvents
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-S2Q75LP3.js";
|
|
6
6
|
import {
|
|
7
7
|
registerRuntimeAgent
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-NAFLUJ26.js";
|
|
9
|
+
import "./chunk-QGO6HXHG.js";
|
|
10
10
|
import "./chunk-JEZOSEWG.js";
|
|
11
11
|
import "./chunk-YFCK7H2S.js";
|
|
12
12
|
import "./chunk-QXASAHIA.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolvePiLaunchToolPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-374MZFF4.js";
|
|
4
4
|
import "./chunk-CTPAE36Y.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-QGO6HXHG.js";
|
|
6
6
|
import "./chunk-JEZOSEWG.js";
|
|
7
7
|
import "./chunk-YFCK7H2S.js";
|
|
8
8
|
import "./chunk-QXASAHIA.js";
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rewriteSubagentPrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLVJMI6R.js";
|
|
4
4
|
import {
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import
|
|
6
|
+
} from "./chunk-7ZUFN6ME.js";
|
|
7
|
+
import {
|
|
8
|
+
WATCHDOG_DIFF_TOOL_NAME,
|
|
9
|
+
captureWatchdogDiffBaseline,
|
|
10
|
+
createWatchdogDiffTool
|
|
11
|
+
} from "./chunk-CJHFDQFJ.js";
|
|
12
|
+
import "./chunk-BGXEAYUM.js";
|
|
13
|
+
import "./chunk-ZPY5QZCS.js";
|
|
8
14
|
import {
|
|
9
15
|
MODEL_ONLY_TOOL
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HXRB42AF.js";
|
|
11
17
|
import "./chunk-NF7IEKBH.js";
|
|
12
18
|
import {
|
|
13
19
|
appendAgentRefinementOverlay
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-LGINOOY5.js";
|
|
21
|
+
import "./chunk-GJGTMLPE.js";
|
|
16
22
|
import "./chunk-NIXWDZZV.js";
|
|
17
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-77ASNIEM.js";
|
|
18
24
|
import "./chunk-7F6RKT6W.js";
|
|
19
25
|
import {
|
|
20
26
|
assertNoToolModifierEntries
|
|
21
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-374MZFF4.js";
|
|
22
28
|
import "./chunk-CTPAE36Y.js";
|
|
23
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-GRJHIXYF.js";
|
|
24
30
|
import {
|
|
25
31
|
HERDR_PI_MAX_FRAME_BYTES,
|
|
26
32
|
HERDR_PI_PROTOCOL,
|
|
@@ -37,7 +43,7 @@ import {
|
|
|
37
43
|
discoverAgents,
|
|
38
44
|
resolveExistingReadPaths,
|
|
39
45
|
resolveSkills
|
|
40
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-QGO6HXHG.js";
|
|
41
47
|
import "./chunk-JEZOSEWG.js";
|
|
42
48
|
import "./chunk-YFCK7H2S.js";
|
|
43
49
|
import "./chunk-QXASAHIA.js";
|
|
@@ -240,9 +246,11 @@ ${resolvedSystemPrompt}` } : void 0;
|
|
|
240
246
|
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() : []);
|
|
241
247
|
resolvedSystemPrompt = resolved.systemPrompt;
|
|
242
248
|
resolvedContextPolicy = resolved;
|
|
249
|
+
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 }));
|
|
243
250
|
pi.setActiveTools(resolved.tools);
|
|
244
251
|
const acknowledged = context ? pi.getActiveTools() : [];
|
|
245
|
-
|
|
252
|
+
const missing = resolved.tools.filter((tool) => !acknowledged.includes(tool)), extra = acknowledged.filter((tool) => !resolved.tools.includes(tool));
|
|
253
|
+
if (missing.length || extra.length) throw new Error(`Remote Pi did not apply the resolved active-tool set exactly (${[...missing.length ? [`not available: ${missing.join(", ")}`] : [], ...extra.length ? [`unexpected: ${extra.join(", ")}`] : []].join("; ")}).`);
|
|
246
254
|
configured = true;
|
|
247
255
|
send({ type: "configured", requestId: frame.requestId, nativeSessionId, agent: resolved.agent, skills: resolved.skills, model: context?.model?.provider && context.model.id ? `${context.model.provider}/${context.model.id}` : void 0, tools: acknowledged });
|
|
248
256
|
continue;
|
|
@@ -258,9 +266,12 @@ ${resolvedSystemPrompt}` } : void 0;
|
|
|
258
266
|
send({ type: "prepared", requestId: frame.requestId, nativeSessionId });
|
|
259
267
|
}
|
|
260
268
|
} catch (error) {
|
|
269
|
+
context?.ui?.notify(`pi-subagents bridge: ${error.message}`, "error");
|
|
261
270
|
socket.destroy(error);
|
|
262
271
|
}
|
|
263
272
|
});
|
|
273
|
+
socket.on("error", () => {
|
|
274
|
+
});
|
|
264
275
|
socket.on("close", () => {
|
|
265
276
|
if (client === socket) client = void 0;
|
|
266
277
|
});
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getAgentDir,
|
|
8
8
|
getConfigDirName,
|
|
9
9
|
getProjectConfigDir
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QGO6HXHG.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMP_ROOT_DIR
|
|
13
13
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -353,7 +353,12 @@ function readJson(filePath) {
|
|
|
353
353
|
// src/runs/shared/mcp-direct-tool-grant.ts
|
|
354
354
|
var BUILTIN_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
|
|
355
355
|
function normalizeMcpDirectToolSelectors(selectors) {
|
|
356
|
-
return [...new Set((selectors ?? []).map(
|
|
356
|
+
return [...new Set((selectors ?? []).map(trimTrailingSlashes).filter(Boolean))];
|
|
357
|
+
}
|
|
358
|
+
function trimTrailingSlashes(selector) {
|
|
359
|
+
let end = selector.length;
|
|
360
|
+
while (end > 0 && selector[end - 1] === "/") end -= 1;
|
|
361
|
+
return selector.slice(0, end);
|
|
357
362
|
}
|
|
358
363
|
function parseMcpDirectToolSelectors(selectors) {
|
|
359
364
|
const servers = /* @__PURE__ */ new Set();
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isTrustedRecordedSessionFile,
|
|
3
3
|
resolveSubagentRunId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UR7OW5S7.js";
|
|
5
5
|
import {
|
|
6
6
|
agentStreamOptions,
|
|
7
7
|
opencodeSessionHeaders,
|
|
8
|
-
ownsRun,
|
|
9
8
|
resolveAsyncResumeTarget
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BGXEAYUM.js";
|
|
10
|
+
import {
|
|
11
|
+
ownsRun
|
|
12
|
+
} from "./chunk-HXRB42AF.js";
|
|
11
13
|
import {
|
|
12
14
|
currentCompletionOwnerId,
|
|
13
15
|
listMissions,
|
|
@@ -16,12 +18,12 @@ import {
|
|
|
16
18
|
reconcileAsyncRun,
|
|
17
19
|
resolveAuthorityDecision,
|
|
18
20
|
resolveMissionStoreLocation
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GJGTMLPE.js";
|
|
20
22
|
import {
|
|
21
23
|
deliverInterruptRequest,
|
|
22
24
|
queueRevivalBrief,
|
|
23
25
|
requestAsyncSteer
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5H4BICQZ.js";
|
|
25
27
|
import {
|
|
26
28
|
formatShellCommand
|
|
27
29
|
} from "./chunk-7J4ZXMY7.js";
|
|
@@ -32,7 +34,7 @@ import {
|
|
|
32
34
|
tryLease,
|
|
33
35
|
writeAtomicJson,
|
|
34
36
|
writePrivateAtomicJson
|
|
35
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-QGO6HXHG.js";
|
|
36
38
|
import {
|
|
37
39
|
DIRS
|
|
38
40
|
} from "./chunk-JEZOSEWG.js";
|
|
@@ -603,15 +605,12 @@ async function steerWorkflowForegroundTarget(input) {
|
|
|
603
605
|
return { content: [{ type: "text", text: steeringReceipt(message, `Steering failed for foreground run ${control.runId} (request ${requestId}): ${outcome.reason ?? "unknown error"}`) }], isError: true, details: { mode: "management", results: [], steering } };
|
|
604
606
|
}
|
|
605
607
|
|
|
606
|
-
// src/
|
|
608
|
+
// src/shared/fleet-transcript-reader.ts
|
|
607
609
|
import * as fs3 from "node:fs";
|
|
608
610
|
import * as path4 from "node:path";
|
|
609
|
-
import { getLanguageFromPath, highlightCode } from "@earendil-works/pi-coding-agent";
|
|
610
|
-
import { Markdown, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
611
611
|
var DEFAULT_MAX_RECORDS = 240;
|
|
612
612
|
var DEFAULT_MAX_BYTES = 2 * 1024 * 1024;
|
|
613
613
|
var MAX_MESSAGE_CHARS = 64 * 1024;
|
|
614
|
-
var TOOL_PREVIEW_LINES = 7;
|
|
615
614
|
function sanitizeJsonDisplayValue(value) {
|
|
616
615
|
if (typeof value === "string") {
|
|
617
616
|
const safe = safeTerminalText(value);
|
|
@@ -895,151 +894,6 @@ function readFleetTranscript(filePath, options) {
|
|
|
895
894
|
...warnings.length ? { warning: safeTerminalText(warnings.join(" ")) } : {}
|
|
896
895
|
};
|
|
897
896
|
}
|
|
898
|
-
function statusGlyph(event, theme) {
|
|
899
|
-
if (event.status === "running") return theme.fg("warning", "\u25CF");
|
|
900
|
-
if (event.status === "error") return theme.fg("error", "\u2717");
|
|
901
|
-
return theme.fg("success", "\u2713");
|
|
902
|
-
}
|
|
903
|
-
function jsonScalar(value) {
|
|
904
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
905
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
906
|
-
return void 0;
|
|
907
|
-
}
|
|
908
|
-
function parseToolArgs(event) {
|
|
909
|
-
if (!event.argsPayload) return void 0;
|
|
910
|
-
try {
|
|
911
|
-
return objectValue(JSON.parse(event.argsPayload));
|
|
912
|
-
} catch {
|
|
913
|
-
return void 0;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
function toolDuration(event) {
|
|
917
|
-
if (event.startedAt === void 0 || event.endedAt === void 0) return void 0;
|
|
918
|
-
return `${((event.endedAt - event.startedAt) / 1e3).toFixed(1)}s`;
|
|
919
|
-
}
|
|
920
|
-
function renderExpandedTool(event, width, theme) {
|
|
921
|
-
const lines = [];
|
|
922
|
-
const args = parseToolArgs(event);
|
|
923
|
-
const glyph = statusGlyph(event, theme);
|
|
924
|
-
const output = event.output ?? event.error;
|
|
925
|
-
const outputColor = event.status === "error" ? "error" : "toolOutput";
|
|
926
|
-
if (event.name === "bash") {
|
|
927
|
-
const command = jsonScalar(args?.command) ?? event.args ?? "(unknown command)";
|
|
928
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(`$ ${command}`))}`, width, theme));
|
|
929
|
-
if (output) {
|
|
930
|
-
for (const outputLine of output.replace(/\s+$/, "").split(/\r?\n/)) {
|
|
931
|
-
for (const wrapped of renderWrapped(theme.fg(outputColor, outputLine), Math.max(1, width - 4))) {
|
|
932
|
-
lines.push(railLine(` ${wrapped}`, width, theme));
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
const duration = toolDuration(event);
|
|
937
|
-
if (duration) lines.push(railLine(theme.fg("dim", ` Took ${duration}`), width, theme));
|
|
938
|
-
return lines;
|
|
939
|
-
}
|
|
940
|
-
if (event.name === "read") {
|
|
941
|
-
const filePath = jsonScalar(args?.path ?? args?.file_path);
|
|
942
|
-
const language = filePath ? getLanguageFromPath(filePath) : void 0;
|
|
943
|
-
const rendered = !output ? [] : event.status === "error" ? output.split("\n").map((line) => theme.fg("error", line)) : language ? highlightCode(output, language) : output.split("\n");
|
|
944
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(`read ${filePath ?? event.args ?? ""}`))}`, width, theme));
|
|
945
|
-
for (const line of rendered) {
|
|
946
|
-
for (const wrapped of renderWrapped(line, Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
947
|
-
}
|
|
948
|
-
return lines;
|
|
949
|
-
}
|
|
950
|
-
lines.push(railLine(`${glyph} ${theme.fg("toolTitle", theme.bold(event.name))}`, width, theme));
|
|
951
|
-
if (event.argsPayload) {
|
|
952
|
-
lines.push(railLine(theme.fg("dim", " args"), width, theme));
|
|
953
|
-
for (const argLine of event.argsPayload.split(/\r?\n/)) {
|
|
954
|
-
for (const wrapped of renderWrapped(theme.fg("muted", argLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
if (output) {
|
|
958
|
-
lines.push(railLine(theme.fg(event.status === "error" ? "error" : "dim", event.status === "error" ? " error" : " output"), width, theme));
|
|
959
|
-
for (const outputLine of output.split(/\r?\n/)) {
|
|
960
|
-
for (const wrapped of renderWrapped(theme.fg(outputColor, outputLine), Math.max(1, width - 4))) lines.push(railLine(` ${wrapped}`, width, theme));
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
return lines;
|
|
964
|
-
}
|
|
965
|
-
function bounded(text, width) {
|
|
966
|
-
return truncateToWidth(text, Math.max(0, width));
|
|
967
|
-
}
|
|
968
|
-
function railLine(content, width, theme) {
|
|
969
|
-
return bounded(`${theme.fg("borderMuted", "\u2502")} ${content}`, width);
|
|
970
|
-
}
|
|
971
|
-
function renderWrapped(text, width) {
|
|
972
|
-
return wrapTextWithAnsi(text, Math.max(1, width));
|
|
973
|
-
}
|
|
974
|
-
function renderFleetTranscript(transcript, width, theme, markdownTheme, options = {}) {
|
|
975
|
-
if (width <= 0) return [];
|
|
976
|
-
const lines = [];
|
|
977
|
-
if (transcript.truncated) lines.push(bounded(theme.fg("dim", "\u2191 Earlier activity omitted"), width));
|
|
978
|
-
if (transcript.warning) {
|
|
979
|
-
for (const line of renderWrapped(safeTerminalText(transcript.warning), Math.max(1, width - 2))) {
|
|
980
|
-
lines.push(bounded(`${theme.fg("warning", "!")} ${theme.fg("warning", line)}`, width));
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
for (const rawEvent of transcript.events) {
|
|
984
|
-
const event = safeTranscriptEvent(rawEvent);
|
|
985
|
-
if (event.kind === "tool") {
|
|
986
|
-
if (options.expandedTools && (event.output || event.argsPayload || event.error)) {
|
|
987
|
-
lines.push(...renderExpandedTool(event, width, theme));
|
|
988
|
-
lines.push(railLine(theme.fg("dim", " x to collapse"), width, theme));
|
|
989
|
-
continue;
|
|
990
|
-
}
|
|
991
|
-
const title = theme.fg("toolTitle", theme.bold(event.name));
|
|
992
|
-
const args = event.args ? ` ${theme.fg("dim", event.args)}` : "";
|
|
993
|
-
const suffix = event.status === "running" ? theme.fg("warning", " running") : "";
|
|
994
|
-
lines.push(bounded(`${theme.fg("borderMuted", "\u251C\u2500")} ${statusGlyph(event, theme)} ${title}${args}${suffix}`, width));
|
|
995
|
-
if (event.output && event.status !== "error" && event.name === "bash") {
|
|
996
|
-
const outputLines = event.output.replace(/\s+$/, "").split(/\r?\n/);
|
|
997
|
-
const visible = outputLines.slice(-TOOL_PREVIEW_LINES);
|
|
998
|
-
const hidden = Math.max(0, outputLines.length - visible.length);
|
|
999
|
-
for (const outputLine of visible) {
|
|
1000
|
-
for (const wrapped of renderWrapped(theme.fg("toolOutput", outputLine), Math.max(1, width - 4))) {
|
|
1001
|
-
lines.push(railLine(` ${wrapped}`, width, theme));
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
if (hidden > 0) lines.push(railLine(theme.fg("dim", ` \u2026 ${hidden} earlier lines \xB7 x to expand`), width, theme));
|
|
1005
|
-
const duration = toolDuration(event);
|
|
1006
|
-
lines.push(railLine(theme.fg("dim", ` Took${duration ? ` ${duration}` : ""}`), width, theme));
|
|
1007
|
-
} else if (event.output && event.status !== "error") {
|
|
1008
|
-
const summary = truncateToWidth(event.output.replace(/\s+/g, " ").trim(), Math.max(1, width - 18), "\u2026");
|
|
1009
|
-
if (summary) lines.push(railLine(theme.fg("dim", ` ${summary} \xB7 x to expand`), width, theme));
|
|
1010
|
-
}
|
|
1011
|
-
if (event.error) {
|
|
1012
|
-
for (const errorLine of renderWrapped(event.error, Math.max(1, width - 4))) {
|
|
1013
|
-
lines.push(railLine(theme.fg("error", ` ${errorLine}`), width, theme));
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
continue;
|
|
1017
|
-
}
|
|
1018
|
-
if (event.kind === "notice") {
|
|
1019
|
-
const color = event.tone === "error" ? "error" : event.tone === "warning" ? "warning" : "dim";
|
|
1020
|
-
for (const noticeLine of renderWrapped(event.text, Math.max(1, width - 2))) {
|
|
1021
|
-
lines.push(railLine(theme.fg(color, noticeLine), width, theme));
|
|
1022
|
-
}
|
|
1023
|
-
continue;
|
|
1024
|
-
}
|
|
1025
|
-
const assistant = event.kind === "assistant";
|
|
1026
|
-
const label = assistant ? "Assistant" : "Supervisor";
|
|
1027
|
-
const marker = assistant ? theme.fg("accent", "\u25C6") : theme.fg("warning", "\u25C7");
|
|
1028
|
-
const model = assistant && event.model ? theme.fg("dim", ` \xB7 ${event.model}`) : "";
|
|
1029
|
-
lines.push(bounded(`${marker} ${theme.bold(label)}${model}`, width));
|
|
1030
|
-
if (assistant) {
|
|
1031
|
-
const rendered = new Markdown(event.text, 0, 0, markdownTheme).render(Math.max(1, width - 2));
|
|
1032
|
-
for (const markdownLine of rendered) lines.push(railLine(markdownLine, width, theme));
|
|
1033
|
-
} else {
|
|
1034
|
-
for (const userLine of renderWrapped(event.text, Math.max(1, width - 2))) {
|
|
1035
|
-
lines.push(railLine(userLine, width, theme));
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
lines.push(theme.fg("borderMuted", "\u2502"));
|
|
1039
|
-
}
|
|
1040
|
-
while (lines.length > 0 && visibleWidth(lines.at(-1) ?? "") === 1) lines.pop();
|
|
1041
|
-
return lines;
|
|
1042
|
-
}
|
|
1043
897
|
|
|
1044
898
|
// src/inspectors/types.ts
|
|
1045
899
|
var INSPECTOR_ACTIONS = ["inspector.open", "inspector.command", "inspector.status", "inspector.close"];
|
|
@@ -1325,8 +1179,9 @@ export {
|
|
|
1325
1179
|
resolveWorkflowForegroundSteeringTarget,
|
|
1326
1180
|
steerWorkflowRun,
|
|
1327
1181
|
steerWorkflowForegroundTarget,
|
|
1182
|
+
objectValue,
|
|
1183
|
+
safeTranscriptEvent,
|
|
1328
1184
|
readFleetTranscript,
|
|
1329
|
-
renderFleetTranscript,
|
|
1330
1185
|
INSPECTOR_ACTIONS,
|
|
1331
1186
|
handleInspectorAction,
|
|
1332
1187
|
rewritePromptWithGuidance,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
validateAuthorityPolicy,
|
|
12
12
|
validateMissionStoreConfig,
|
|
13
13
|
validateModelResponseAliases
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GJGTMLPE.js";
|
|
15
15
|
import {
|
|
16
16
|
getAgentDir,
|
|
17
17
|
readStatus,
|
|
18
18
|
validatePermissionConfig,
|
|
19
19
|
writePrivateAtomicJson
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QGO6HXHG.js";
|
|
21
21
|
import {
|
|
22
22
|
FLEET_KEYBINDING_ACTIONS,
|
|
23
23
|
RUNNER_LAUNCHER_NAME_PATTERN,
|
|
@@ -525,7 +525,7 @@ import * as fs2 from "node:fs";
|
|
|
525
525
|
import * as os from "node:os";
|
|
526
526
|
import * as path2 from "node:path";
|
|
527
527
|
import { Key } from "@earendil-works/pi-tui";
|
|
528
|
-
var FAIL_CLOSED_CONFIG_KEYS = ["worktreeProvider", "worktreeBranchPrefix", "modelResponseAliases", "modelExclusions", "checkpointBeforeDeadlineMs", "disabledFeatures", "scheduledRuns", "toolActivation", "authorityPolicy", "permissions", "toolBudget", "runnerLaunchers"];
|
|
528
|
+
var FAIL_CLOSED_CONFIG_KEYS = ["worktreeProvider", "worktreeBranchPrefix", "modelResponseAliases", "modelExclusions", "checkpointBeforeDeadlineMs", "disabledFeatures", "scheduledRuns", "toolActivation", "authorityPolicy", "permissions", "toolBudget", "runnerLaunchers", "globalConcurrencyLimit"];
|
|
529
529
|
var ARTIFACT_DIR_PREFERENCES = /* @__PURE__ */ new Set(["project", "session", "temp"]);
|
|
530
530
|
var FLEET_KEYBINDING_ACTION_SET = new Set(FLEET_KEYBINDING_ACTIONS);
|
|
531
531
|
var KEY_MODIFIERS = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "super"]);
|
|
@@ -658,6 +658,9 @@ function validateConfig(config) {
|
|
|
658
658
|
if (config.maxActiveAsyncRunsPerSession !== void 0 && (typeof config.maxActiveAsyncRunsPerSession !== "number" || !Number.isInteger(config.maxActiveAsyncRunsPerSession) || config.maxActiveAsyncRunsPerSession < 0)) {
|
|
659
659
|
throw new Error("config.maxActiveAsyncRunsPerSession must be a non-negative integer");
|
|
660
660
|
}
|
|
661
|
+
if (config.globalConcurrencyLimit !== void 0 && (typeof config.globalConcurrencyLimit !== "number" || !Number.isInteger(config.globalConcurrencyLimit) || config.globalConcurrencyLimit < 1)) {
|
|
662
|
+
throw new Error("config.globalConcurrencyLimit must be a positive integer");
|
|
663
|
+
}
|
|
661
664
|
if (config.resultScanLogging !== void 0 && config.resultScanLogging !== "all" && config.resultScanLogging !== "activity" && config.resultScanLogging !== "off") {
|
|
662
665
|
throw new Error('config.resultScanLogging must be "all", "activity", or "off"');
|
|
663
666
|
}
|