@vicary/pi-subagents 0.85.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +2 -2
  4. package/bundle/{chunk-QZL2ZZPM.js → chunk-2DITXA3H.js} +11 -11
  5. package/bundle/{chunk-KEY3UQMQ.js → chunk-374MZFF4.js} +1 -1
  6. package/bundle/{chunk-CS4O36CZ.js → chunk-3RKFH2UZ.js} +5 -5
  7. package/bundle/{chunk-7MAE3DJV.js → chunk-5H4BICQZ.js} +1 -1
  8. package/bundle/{chunk-RV5OGHLO.js → chunk-6VD7BGIC.js} +2 -2
  9. package/bundle/{chunk-KDMFBYFM.js → chunk-77ASNIEM.js} +1 -1
  10. package/bundle/{chunk-O7CPL6H4.js → chunk-7QA7ZA46.js} +9 -9
  11. package/bundle/{chunk-HFTBF7SG.js → chunk-7ZUFN6ME.js} +1 -1
  12. package/bundle/{chunk-LTPH2DXH.js → chunk-BGXEAYUM.js} +3 -3
  13. package/bundle/{chunk-JO67XSKD.js → chunk-BU6PFPVX.js} +4 -4
  14. package/bundle/{chunk-A7VJ5XXE.js → chunk-CJHFDQFJ.js} +4 -4
  15. package/bundle/{chunk-B3OOJJA6.js → chunk-DD22RXYJ.js} +39 -45
  16. package/bundle/{chunk-LGMILZNE.js → chunk-GJGTMLPE.js} +2 -2
  17. package/bundle/{chunk-HS4WPO6B.js → chunk-GLVJMI6R.js} +5 -5
  18. package/bundle/{chunk-PHZP3KHB.js → chunk-GRJHIXYF.js} +1 -1
  19. package/bundle/{chunk-QO75KJBT.js → chunk-LGINOOY5.js} +2 -2
  20. package/bundle/{chunk-GCSLVFCX.js → chunk-NAFLUJ26.js} +1 -1
  21. package/bundle/{chunk-PVIVCDG2.js → chunk-PYOAIN3V.js} +2 -2
  22. package/bundle/{chunk-YZBCREP5.js → chunk-QFLPV64W.js} +35 -31
  23. package/bundle/{chunk-UX4SCV5N.js → chunk-QGO6HXHG.js} +80 -35
  24. package/bundle/{chunk-H2NLFTC5.js → chunk-S2Q75LP3.js} +1 -1
  25. package/bundle/{chunk-KZ34KQQH.js → chunk-UR7OW5S7.js} +4 -4
  26. package/bundle/{chunk-VEZMZDTW.js → chunk-WHC2XHGF.js} +24 -23
  27. package/bundle/{chunk-L2ENOFVZ.js → chunk-WN2E5XHN.js} +66 -26
  28. package/bundle/{chunk-JHBQ7N2L.js → chunk-XOFYXQKZ.js} +2 -2
  29. package/bundle/{chunk-N7B2KD74.js → chunk-YK3QYNLE.js} +1 -1
  30. package/bundle/{chunk-T5V5BRCL.js → chunk-ZPY5QZCS.js} +1 -1
  31. package/bundle/control-channel.js +2 -2
  32. package/bundle/index.js +1 -1
  33. package/bundle/intercom-bridge.js +2 -2
  34. package/bundle/preflight.js +8 -8
  35. package/bundle/project-panes.js +3 -3
  36. package/docs/agents.md +6 -0
  37. package/docs/configuration.md +2 -2
  38. package/docs/tool-reference.md +2 -0
  39. package/package.json +2 -2
  40. package/src/extension/tool-activation.js +10 -1
  41. package/src/extension/tool-description.d.ts +1 -1
  42. package/src/extension/tool-description.js +8 -8
  43. package/src/runs/background/run-status.js +5 -4
  44. package/src/runs/background/subagent-runner.js +6 -6
  45. package/src/runs/shared/acceptance.js +69 -26
  46. package/src/runs/shared/external-cli-contract.d.ts +49 -0
  47. package/src/runs/shared/external-cli-contract.js +18 -13
  48. package/src/runs/shared/structured-output.js +10 -3
  49. package/src/shared/types.d.ts +57 -48
  50. package/src/tui/render.js +83 -22
  51. package/src/workflows/workflow-receipt.js +36 -53
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
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
+
5
26
  ## [0.85.0] - 2026-11-04
6
27
 
7
28
  ### 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-H2NLFTC5.js";
5
+ } from "./chunk-S2Q75LP3.js";
6
6
  import {
7
7
  registerRuntimeAgent
8
- } from "./chunk-GCSLVFCX.js";
9
- import "./chunk-UX4SCV5N.js";
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-KEY3UQMQ.js";
3
+ } from "./chunk-374MZFF4.js";
4
4
  import "./chunk-CTPAE36Y.js";
5
- import "./chunk-UX4SCV5N.js";
5
+ import "./chunk-QGO6HXHG.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-QXASAHIA.js";
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  rewriteSubagentPrompt
3
- } from "./chunk-HS4WPO6B.js";
3
+ } from "./chunk-GLVJMI6R.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-HFTBF7SG.js";
6
+ } from "./chunk-7ZUFN6ME.js";
7
7
  import {
8
8
  WATCHDOG_DIFF_TOOL_NAME,
9
9
  captureWatchdogDiffBaseline,
10
10
  createWatchdogDiffTool
11
- } from "./chunk-A7VJ5XXE.js";
12
- import "./chunk-LTPH2DXH.js";
13
- import "./chunk-T5V5BRCL.js";
11
+ } from "./chunk-CJHFDQFJ.js";
12
+ import "./chunk-BGXEAYUM.js";
13
+ import "./chunk-ZPY5QZCS.js";
14
14
  import {
15
15
  MODEL_ONLY_TOOL
16
16
  } from "./chunk-HXRB42AF.js";
17
17
  import "./chunk-NF7IEKBH.js";
18
18
  import {
19
19
  appendAgentRefinementOverlay
20
- } from "./chunk-QO75KJBT.js";
21
- import "./chunk-LGMILZNE.js";
20
+ } from "./chunk-LGINOOY5.js";
21
+ import "./chunk-GJGTMLPE.js";
22
22
  import "./chunk-NIXWDZZV.js";
23
- import "./chunk-KDMFBYFM.js";
23
+ import "./chunk-77ASNIEM.js";
24
24
  import "./chunk-7F6RKT6W.js";
25
25
  import {
26
26
  assertNoToolModifierEntries
27
- } from "./chunk-KEY3UQMQ.js";
27
+ } from "./chunk-374MZFF4.js";
28
28
  import "./chunk-CTPAE36Y.js";
29
- import "./chunk-PHZP3KHB.js";
29
+ import "./chunk-GRJHIXYF.js";
30
30
  import {
31
31
  HERDR_PI_MAX_FRAME_BYTES,
32
32
  HERDR_PI_PROTOCOL,
@@ -43,7 +43,7 @@ import {
43
43
  discoverAgents,
44
44
  resolveExistingReadPaths,
45
45
  resolveSkills
46
- } from "./chunk-UX4SCV5N.js";
46
+ } from "./chunk-QGO6HXHG.js";
47
47
  import "./chunk-JEZOSEWG.js";
48
48
  import "./chunk-YFCK7H2S.js";
49
49
  import "./chunk-QXASAHIA.js";
@@ -7,7 +7,7 @@ import {
7
7
  getAgentDir,
8
8
  getConfigDirName,
9
9
  getProjectConfigDir
10
- } from "./chunk-UX4SCV5N.js";
10
+ } from "./chunk-QGO6HXHG.js";
11
11
  import {
12
12
  TEMP_ROOT_DIR
13
13
  } from "./chunk-JEZOSEWG.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isTrustedRecordedSessionFile,
3
3
  resolveSubagentRunId
4
- } from "./chunk-KZ34KQQH.js";
4
+ } from "./chunk-UR7OW5S7.js";
5
5
  import {
6
6
  agentStreamOptions,
7
7
  opencodeSessionHeaders,
8
8
  resolveAsyncResumeTarget
9
- } from "./chunk-LTPH2DXH.js";
9
+ } from "./chunk-BGXEAYUM.js";
10
10
  import {
11
11
  ownsRun
12
12
  } from "./chunk-HXRB42AF.js";
@@ -18,12 +18,12 @@ import {
18
18
  reconcileAsyncRun,
19
19
  resolveAuthorityDecision,
20
20
  resolveMissionStoreLocation
21
- } from "./chunk-LGMILZNE.js";
21
+ } from "./chunk-GJGTMLPE.js";
22
22
  import {
23
23
  deliverInterruptRequest,
24
24
  queueRevivalBrief,
25
25
  requestAsyncSteer
26
- } from "./chunk-7MAE3DJV.js";
26
+ } from "./chunk-5H4BICQZ.js";
27
27
  import {
28
28
  formatShellCommand
29
29
  } from "./chunk-7J4ZXMY7.js";
@@ -34,7 +34,7 @@ import {
34
34
  tryLease,
35
35
  writeAtomicJson,
36
36
  writePrivateAtomicJson
37
- } from "./chunk-UX4SCV5N.js";
37
+ } from "./chunk-QGO6HXHG.js";
38
38
  import {
39
39
  DIRS
40
40
  } from "./chunk-JEZOSEWG.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveWatchPath,
6
6
  writeAtomicJson
7
- } from "./chunk-UX4SCV5N.js";
7
+ } from "./chunk-QGO6HXHG.js";
8
8
  import {
9
9
  POLL_INTERVAL_MS
10
10
  } from "./chunk-JEZOSEWG.js";
@@ -11,13 +11,13 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-LGMILZNE.js";
14
+ } from "./chunk-GJGTMLPE.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
18
18
  validatePermissionConfig,
19
19
  writePrivateAtomicJson
20
- } from "./chunk-UX4SCV5N.js";
20
+ } from "./chunk-QGO6HXHG.js";
21
21
  import {
22
22
  FLEET_KEYBINDING_ACTIONS,
23
23
  RUNNER_LAUNCHER_NAME_PATTERN,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7F6RKT6W.js";
4
4
  import {
5
5
  getAgentDir
6
- } from "./chunk-UX4SCV5N.js";
6
+ } from "./chunk-QGO6HXHG.js";
7
7
 
8
8
  // src/intercom/intercom-bridge.ts
9
9
  import * as fs from "node:fs";
@@ -7,37 +7,37 @@ import {
7
7
  safeTranscriptEvent,
8
8
  steerAsyncRun,
9
9
  steerWorkflowForegroundTarget
10
- } from "./chunk-CS4O36CZ.js";
10
+ } from "./chunk-3RKFH2UZ.js";
11
11
  import {
12
12
  FLEET_STATUS_WIDGET_KEY,
13
13
  runningTone,
14
14
  stepTaskSummary
15
- } from "./chunk-L2ENOFVZ.js";
15
+ } from "./chunk-WN2E5XHN.js";
16
16
  import {
17
17
  foregroundChildStateLabel,
18
18
  formatAsyncRunTranscript,
19
19
  stopAsyncRun
20
- } from "./chunk-KZ34KQQH.js";
20
+ } from "./chunk-UR7OW5S7.js";
21
21
  import {
22
22
  contextModeBadge,
23
23
  contextModeLabel,
24
24
  decodeUtf8Tail,
25
25
  listAsyncRuns
26
- } from "./chunk-LTPH2DXH.js";
26
+ } from "./chunk-BGXEAYUM.js";
27
27
  import {
28
28
  reportSessionWarning
29
29
  } from "./chunk-HXRB42AF.js";
30
- import "./chunk-LGMILZNE.js";
31
- import "./chunk-7MAE3DJV.js";
30
+ import "./chunk-GJGTMLPE.js";
31
+ import "./chunk-5H4BICQZ.js";
32
32
  import "./chunk-NIXWDZZV.js";
33
- import "./chunk-KDMFBYFM.js";
33
+ import "./chunk-77ASNIEM.js";
34
34
  import "./chunk-7F6RKT6W.js";
35
35
  import "./chunk-CTPAE36Y.js";
36
36
  import "./chunk-7J4ZXMY7.js";
37
37
  import {
38
38
  getArtifactPaths,
39
39
  getArtifactsDir
40
- } from "./chunk-PHZP3KHB.js";
40
+ } from "./chunk-GRJHIXYF.js";
41
41
  import {
42
42
  snapshotExternalRuns
43
43
  } from "./chunk-UKG4V45O.js";
@@ -49,7 +49,7 @@ import {
49
49
  formatTokens,
50
50
  readStatus,
51
51
  shortenPath
52
- } from "./chunk-UX4SCV5N.js";
52
+ } from "./chunk-QGO6HXHG.js";
53
53
  import {
54
54
  DIRS
55
55
  } from "./chunk-JEZOSEWG.js";
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "pi-subagents",
4
- version: "0.85.0",
4
+ version: "0.86.0",
5
5
  private: true,
6
6
  description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
7
7
  author: "Nico Bailon",
@@ -46,10 +46,10 @@ import {
46
46
  validateModelResponseAliases,
47
47
  withWorkflowChildRunModel,
48
48
  withWorktreeTransaction
49
- } from "./chunk-LGMILZNE.js";
49
+ } from "./chunk-GJGTMLPE.js";
50
50
  import {
51
51
  validateIntercomBridgeConfig
52
- } from "./chunk-KDMFBYFM.js";
52
+ } from "./chunk-77ASNIEM.js";
53
53
  import {
54
54
  stableJsonDigest
55
55
  } from "./chunk-7F6RKT6W.js";
@@ -80,7 +80,7 @@ import {
80
80
  validateToolBudgetConfig,
81
81
  waitForFileSystemRetry,
82
82
  writeAtomicJson
83
- } from "./chunk-UX4SCV5N.js";
83
+ } from "./chunk-QGO6HXHG.js";
84
84
  import {
85
85
  DIRS,
86
86
  RUNNER_LAUNCHER_NAME_PATTERN,
@@ -4,13 +4,13 @@ import {
4
4
  remoteShellCommand,
5
5
  runBoundedCommand,
6
6
  sshMachineAccess
7
- } from "./chunk-N7B2KD74.js";
7
+ } from "./chunk-YK3QYNLE.js";
8
8
  import {
9
9
  package_default
10
- } from "./chunk-HFTBF7SG.js";
10
+ } from "./chunk-7ZUFN6ME.js";
11
11
  import {
12
12
  ensureSupervisorChannelDir
13
- } from "./chunk-T5V5BRCL.js";
13
+ } from "./chunk-ZPY5QZCS.js";
14
14
  import "./chunk-HXRB42AF.js";
15
15
  import "./chunk-NIXWDZZV.js";
16
16
  import {
@@ -34,7 +34,7 @@ import {
34
34
  resolveRexBinary,
35
35
  rexCommandEnv,
36
36
  rexGlobalArgs
37
- } from "./chunk-UX4SCV5N.js";
37
+ } from "./chunk-QGO6HXHG.js";
38
38
  import "./chunk-JEZOSEWG.js";
39
39
  import "./chunk-YFCK7H2S.js";
40
40
  import "./chunk-QXASAHIA.js";
@@ -8,7 +8,7 @@ import {
8
8
  projectTimeoutRecovery,
9
9
  readAsyncRecoveryDescriptor,
10
10
  utf8Tail
11
- } from "./chunk-LTPH2DXH.js";
11
+ } from "./chunk-BGXEAYUM.js";
12
12
  import {
13
13
  MAX_ARGS_BYTES,
14
14
  MAX_ARGS_DEPTH,
@@ -21,10 +21,10 @@ import {
21
21
  resultFilePath,
22
22
  resultPayloadMatchesSessionRun,
23
23
  resultPayloadPathForSessionRun
24
- } from "./chunk-LGMILZNE.js";
24
+ } from "./chunk-GJGTMLPE.js";
25
25
  import {
26
26
  PROJECT_SUBAGENTS_RELATIVE_DIR
27
- } from "./chunk-PHZP3KHB.js";
27
+ } from "./chunk-GRJHIXYF.js";
28
28
  import {
29
29
  listBackgroundWorkWakeChannels,
30
30
  snapshotBackgroundWork
@@ -49,7 +49,7 @@ import {
49
49
  waitToolName,
50
50
  withSettingsFileLease,
51
51
  writePrivateAtomicJson
52
- } from "./chunk-UX4SCV5N.js";
52
+ } from "./chunk-QGO6HXHG.js";
53
53
  import {
54
54
  DIRS,
55
55
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -11,10 +11,10 @@ import {
11
11
  startWatchdogDiffBaselineCapture,
12
12
  writeUserWatchdogEnabled,
13
13
  writeWatchdogModelSettings
14
- } from "./chunk-A7VJ5XXE.js";
14
+ } from "./chunk-CJHFDQFJ.js";
15
15
  import {
16
16
  resolveGitRepositoryIdentity
17
- } from "./chunk-KZ34KQQH.js";
17
+ } from "./chunk-UR7OW5S7.js";
18
18
  import {
19
19
  listAsyncRuns,
20
20
  parallelHandoffPath,
@@ -22,7 +22,7 @@ import {
22
22
  readAsyncRecoveryDescriptor,
23
23
  readWorkflowLaunchRecord,
24
24
  resolveRetainedWorktreeCwd
25
- } from "./chunk-LTPH2DXH.js";
25
+ } from "./chunk-BGXEAYUM.js";
26
26
  import {
27
27
  ownsRun
28
28
  } from "./chunk-HXRB42AF.js";
@@ -54,21 +54,21 @@ import {
54
54
  resolveMissionStoreLocation,
55
55
  validateMissionId,
56
56
  workflowRunParamsFingerprint
57
- } from "./chunk-LGMILZNE.js";
57
+ } from "./chunk-GJGTMLPE.js";
58
58
  import {
59
59
  requestAsyncCommand,
60
60
  watchAsyncControlInbox
61
- } from "./chunk-7MAE3DJV.js";
61
+ } from "./chunk-5H4BICQZ.js";
62
62
  import {
63
63
  supervisorChannelDir
64
- } from "./chunk-KEY3UQMQ.js";
64
+ } from "./chunk-374MZFF4.js";
65
65
  import {
66
66
  createHerdrClient,
67
67
  detectHerdr
68
- } from "./chunk-PVIVCDG2.js";
68
+ } from "./chunk-PYOAIN3V.js";
69
69
  import {
70
70
  getProjectSubagentsDir
71
- } from "./chunk-PHZP3KHB.js";
71
+ } from "./chunk-GRJHIXYF.js";
72
72
  import {
73
73
  ExternalJobProviderError,
74
74
  getExternalJobProvider,
@@ -78,9 +78,10 @@ import {
78
78
  } from "./chunk-YYREO77V.js";
79
79
  import {
80
80
  mergeRuntimeAgents
81
- } from "./chunk-GCSLVFCX.js";
81
+ } from "./chunk-NAFLUJ26.js";
82
82
  import {
83
83
  CODE_OWNED_EXTERNAL_CLI_ADAPTER_LABEL,
84
+ EXTERNAL_CLI_ADAPTER_SAFETY,
84
85
  PI_CODING_AGENT_PACKAGE,
85
86
  PI_CODING_AGENT_PACKAGE_ROOT_ENV,
86
87
  PROMPT_REDACTED,
@@ -135,7 +136,7 @@ import {
135
136
  withFileLease,
136
137
  writeAtomicJson,
137
138
  writePrivateAtomicJson
138
- } from "./chunk-UX4SCV5N.js";
139
+ } from "./chunk-QGO6HXHG.js";
139
140
  import {
140
141
  DIRS,
141
142
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -2578,12 +2579,29 @@ function parseExternalCliMachine(value, label) {
2578
2579
  const unknownRemoteGit = Object.keys(remoteGit).filter((field) => !["head", "branch", "dirty"].includes(field));
2579
2580
  if (unknownRemoteGit.length > 0 || remoteGit.head !== void 0 && (typeof remoteGit.head !== "string" || !remoteGit.head.trim()) || remoteGit.branch !== void 0 && (typeof remoteGit.branch !== "string" || !remoteGit.branch.trim()) || remoteGit.dirty !== void 0 && typeof remoteGit.dirty !== "boolean") throw new Error(`${label}.machine.remoteGit is invalid.`);
2580
2581
  }
2582
+ function parseCodeOwnedSafety(value, adapter, label) {
2583
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${label}.safety is missing.`);
2584
+ const safety = value;
2585
+ const profile = EXTERNAL_CLI_ADAPTER_SAFETY[adapter];
2586
+ const unknownSafety = Object.keys(safety).filter((field) => !Object.hasOwn(profile, field));
2587
+ if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2588
+ if (Object.entries(profile).some(([field, expected]) => safety[field] !== expected)) throw new Error(`${label}.safety is invalid.`);
2589
+ }
2590
+ function parseExternalCliSafetySource(value, label) {
2591
+ if (value === void 0) return false;
2592
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${label}.safetySource must be an object.`);
2593
+ const source = value;
2594
+ const unknownSource = Object.keys(source).filter((field) => !["measured", "command"].includes(field));
2595
+ if (unknownSource.length > 0) throw new Error(`${label}.safetySource has unsupported fields: ${unknownSource.join(", ")}.`);
2596
+ if (source.measured !== false || source.command !== void 0 && (typeof source.command !== "string" || !source.command.trim())) throw new Error(`${label}.safetySource is invalid.`);
2597
+ return true;
2598
+ }
2581
2599
  function parseExternalCliReceiptMetadata(value, key, source) {
2582
2600
  if (value === void 0) return void 0;
2583
2601
  const label = `Invalid workflow receipt '${source}': entry '${key}' externalAdapter`;
2584
2602
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${label} must be an object.`);
2585
2603
  const metadata = value;
2586
- const unknownMetadata = Object.keys(metadata).filter((field) => !["adapter", "capabilities", "machine", "safety", "outputArtifacts", "handoff", "supervisor", "nonResumableReason"].includes(field));
2604
+ const unknownMetadata = Object.keys(metadata).filter((field) => !["adapter", "capabilities", "machine", "safety", "safetySource", "outputArtifacts", "handoff", "supervisor", "nonResumableReason"].includes(field));
2587
2605
  if (unknownMetadata.length > 0) throw new Error(`${label} has unsupported fields: ${unknownMetadata.join(", ")}.`);
2588
2606
  const adapter = metadata.adapter;
2589
2607
  if (!adapter || typeof adapter !== "object" || Array.isArray(adapter)) throw new Error(`${label}.adapter must be an object.`);
@@ -2601,47 +2619,23 @@ function parseExternalCliReceiptMetadata(value, key, source) {
2601
2619
  }
2602
2620
  if (metadata.machine !== void 0) parseExternalCliMachine(metadata.machine, label);
2603
2621
  const safety = metadata.safety;
2604
- if (adapterRecord.id === "codex-exec") {
2605
- if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2606
- const safetyRecord = safety;
2607
- const unknownSafety = Object.keys(safetyRecord).filter((field) => !["sandbox", "approvalPolicy", "ephemeral"].includes(field));
2608
- if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2609
- if (safetyRecord.sandbox !== "read-only" || safetyRecord.approvalPolicy !== "never" || safetyRecord.ephemeral !== true) throw new Error(`${label}.safety is invalid.`);
2610
- } else if (adapterRecord.id === "codex-exec-writer") {
2611
- if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2612
- const safetyRecord = safety;
2613
- const unknownSafety = Object.keys(safetyRecord).filter((field) => !["access", "sandbox", "approvalPolicy", "ephemeral"].includes(field));
2614
- if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2615
- if (safetyRecord.access !== "workspace-write" || safetyRecord.sandbox !== "workspace-write" || safetyRecord.approvalPolicy !== "never" || safetyRecord.ephemeral !== true) throw new Error(`${label}.safety is invalid.`);
2616
- } else if (adapterRecord.id === "claude-code") {
2617
- if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2618
- const safetyRecord = safety;
2619
- const legacy = safetyRecord.authentication === void 0;
2620
- const unknownSafety = Object.keys(safetyRecord).filter((field) => !(legacy ? ["permissionMode", "tools", "mcp", "settingSources", "sessionPersistence"] : ["access", "authentication", "permissionMode", "tools", "mcp", "settingSources", "userSettingsTrust", "sessionPersistence"]).includes(field));
2621
- if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2622
- if (legacy) {
2623
- if (safetyRecord.permissionMode !== "plan" || safetyRecord.tools !== "none" || safetyRecord.mcp !== "empty-strict" || safetyRecord.settingSources !== "none" || safetyRecord.sessionPersistence !== false) throw new Error(`${label}.safety is invalid.`);
2624
- } else if (safetyRecord.access !== "read-only" || safetyRecord.authentication !== "existing-cli-required" || safetyRecord.permissionMode !== "plan" || safetyRecord.tools !== "none" || safetyRecord.mcp !== "empty-strict" || safetyRecord.settingSources !== "user" || safetyRecord.userSettingsTrust !== "required" || safetyRecord.sessionPersistence !== false) throw new Error(`${label}.safety is invalid.`);
2625
- } else if (adapterRecord.id === "claude-code-writer") {
2626
- if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2627
- const safetyRecord = safety;
2628
- const unknownSafety = Object.keys(safetyRecord).filter((field) => !["access", "authentication", "permissionMode", "tools", "mcp", "settingSources", "userSettingsTrust", "sessionPersistence"].includes(field));
2629
- if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2630
- if (safetyRecord.access !== "workspace-write" || safetyRecord.authentication !== "existing-cli-required" || safetyRecord.permissionMode !== "acceptEdits" || safetyRecord.tools !== "Read,Write,Edit,Glob,Grep" || safetyRecord.mcp !== "empty-strict" || safetyRecord.settingSources !== "user" || safetyRecord.userSettingsTrust !== "required" || safetyRecord.sessionPersistence !== false) throw new Error(`${label}.safety is invalid.`);
2631
- } else if (adapterRecord.id === "cursor-agent" || adapterRecord.id === "cursor-agent-writer") {
2632
- if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2622
+ const hasSafetySource = parseExternalCliSafetySource(metadata.safetySource, label);
2623
+ if (adapterRecord.id === "claude-code" && !hasSafetySource && safety && typeof safety === "object" && !Array.isArray(safety) && safety.authentication === void 0) {
2633
2624
  const safetyRecord = safety;
2634
- const unknownSafety = Object.keys(safetyRecord).filter((field) => !["access", "authentication", "mode", "sandbox", "workspaceTrust", "sessionReuse"].includes(field));
2625
+ const unknownSafety = Object.keys(safetyRecord).filter((field) => !["permissionMode", "tools", "mcp", "settingSources", "sessionPersistence"].includes(field));
2635
2626
  if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2636
- const writer = adapterRecord.id === "cursor-agent-writer";
2637
- if (safetyRecord.access !== (writer ? "workspace-write" : "read-only") || safetyRecord.authentication !== "cursor-api-key-or-existing-login" || safetyRecord.mode !== (writer ? "print" : "ask") || safetyRecord.sandbox !== "enabled" || safetyRecord.workspaceTrust !== "existing-required" || safetyRecord.sessionReuse !== false) throw new Error(`${label}.safety is invalid.`);
2627
+ if (safetyRecord.permissionMode !== "plan" || safetyRecord.tools !== "none" || safetyRecord.mcp !== "empty-strict" || safetyRecord.settingSources !== "none" || safetyRecord.sessionPersistence !== false) throw new Error(`${label}.safety is invalid.`);
2628
+ } else if (isCodeOwnedExternalCliAdapterId(adapterRecord.id)) {
2629
+ parseCodeOwnedSafety(safety, adapterRecord.id, label);
2638
2630
  } else if (adapterRecord.id === "grok-build") {
2631
+ if (hasSafetySource) throw new Error(`${label}.safetySource is invalid for the legacy grok-build adapter.`);
2639
2632
  if (!safety || typeof safety !== "object" || Array.isArray(safety)) throw new Error(`${label}.safety is missing.`);
2640
2633
  const safetyRecord = safety;
2641
2634
  const unknownSafety = Object.keys(safetyRecord).filter((field) => !["access", "authentication", "permissionMode", "tools", "deniedTools", "sandbox", "webSearch", "subagents", "config", "updates", "sessionPersistence"].includes(field));
2642
2635
  if (unknownSafety.length > 0) throw new Error(`${label}.safety has unsupported fields: ${unknownSafety.join(", ")}.`);
2643
2636
  if (safetyRecord.access !== "read-only" || safetyRecord.authentication !== "xai-api-key-required" || safetyRecord.permissionMode !== "plan" || safetyRecord.tools !== "read_file,grep,list_dir" || safetyRecord.deniedTools !== "run_terminal_cmd,search_replace,Agent,Bash,Edit,Write,MCPTool" || safetyRecord.sandbox !== "read-only" || safetyRecord.webSearch !== false || safetyRecord.subagents !== false || safetyRecord.config !== "temporary-home" || safetyRecord.updates !== "disabled" || safetyRecord.sessionPersistence !== false) throw new Error(`${label}.safety is invalid.`);
2644
- } else if (safety !== void 0) throw new Error(`${label}.safety is invalid for the generic adapter.`);
2637
+ } else if (hasSafetySource) throw new Error(`${label}.safetySource is invalid for the generic adapter.`);
2638
+ else if (safety !== void 0) throw new Error(`${label}.safety is invalid for the generic adapter.`);
2645
2639
  const handoff = metadata.handoff;
2646
2640
  if (!handoff || typeof handoff !== "object" || Array.isArray(handoff)) throw new Error(`${label}.handoff must be an object.`);
2647
2641
  const handoffRecord = handoff;
@@ -7725,7 +7719,7 @@ function childSessionFactory() {
7725
7719
  }
7726
7720
  function createLazyPlacementFactory(local) {
7727
7721
  let placed;
7728
- const factory = async () => placed ??= (await import("./chunk-JO67XSKD.js")).createPlacementAwareChildSessionFactory(local);
7722
+ const factory = async () => placed ??= (await import("./chunk-BU6PFPVX.js")).createPlacementAwareChildSessionFactory(local);
7729
7723
  return {
7730
7724
  async create(launch) {
7731
7725
  return launch.machine ? (await factory()).create(launch) : local.create(launch);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7F6RKT6W.js";
4
4
  import {
5
5
  PROJECT_SUBAGENTS_RELATIVE_DIR
6
- } from "./chunk-PHZP3KHB.js";
6
+ } from "./chunk-GRJHIXYF.js";
7
7
  import {
8
8
  DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
9
9
  DEFAULT_GLOBAL_CONCURRENCY_LIMIT,
@@ -25,7 +25,7 @@ import {
25
25
  withFileLease,
26
26
  writeAtomicJson,
27
27
  writePrivateAtomicJson
28
- } from "./chunk-UX4SCV5N.js";
28
+ } from "./chunk-QGO6HXHG.js";
29
29
  import {
30
30
  DIRS,
31
31
  SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
@@ -14,20 +14,20 @@ import {
14
14
  resolveCurrentSessionId,
15
15
  resolveWatchdogReviewModel,
16
16
  startWatchdogDiffBaselineCapture
17
- } from "./chunk-A7VJ5XXE.js";
17
+ } from "./chunk-CJHFDQFJ.js";
18
18
  import {
19
19
  agentStreamOptions,
20
20
  opencodeSessionHeaders
21
- } from "./chunk-LTPH2DXH.js";
21
+ } from "./chunk-BGXEAYUM.js";
22
22
  import {
23
23
  registerNativeSupervisorClient
24
- } from "./chunk-T5V5BRCL.js";
24
+ } from "./chunk-ZPY5QZCS.js";
25
25
  import {
26
26
  MODEL_ONLY_TOOL
27
27
  } from "./chunk-HXRB42AF.js";
28
28
  import {
29
29
  inheritedNestedRouteOf
30
- } from "./chunk-LGMILZNE.js";
30
+ } from "./chunk-GJGTMLPE.js";
31
31
  import {
32
32
  CHILD_WATCHDOG_STATUS_EVENT,
33
33
  DEFAULT_WAIT_TOOL_NAME,
@@ -46,7 +46,7 @@ import {
46
46
  toolBudgetSoftNudge,
47
47
  validateAcceptanceReport,
48
48
  validateStructuredOutputValue
49
- } from "./chunk-UX4SCV5N.js";
49
+ } from "./chunk-QGO6HXHG.js";
50
50
  import {
51
51
  INTERCOM_SESSION_IDENTITY_EVENT
52
52
  } from "./chunk-JEZOSEWG.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAgentDir
3
- } from "./chunk-UX4SCV5N.js";
3
+ } from "./chunk-QGO6HXHG.js";
4
4
  import {
5
5
  TEMP_ARTIFACTS_DIR
6
6
  } from "./chunk-JEZOSEWG.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getProjectSubagentsDir
3
- } from "./chunk-PHZP3KHB.js";
3
+ } from "./chunk-GRJHIXYF.js";
4
4
  import {
5
5
  discoverAgents,
6
6
  formatUnknownAgentError,
7
7
  resolveAgentName,
8
8
  unknownAgentDiagnosticContext
9
- } from "./chunk-UX4SCV5N.js";
9
+ } from "./chunk-QGO6HXHG.js";
10
10
 
11
11
  // src/agents/agent-refinements.ts
12
12
  import { createHash, randomUUID } from "node:crypto";
@@ -8,7 +8,7 @@ import {
8
8
  validateCodeOwnedProfileRunner,
9
9
  validatePermissionRules,
10
10
  validateToolBudgetConfig
11
- } from "./chunk-UX4SCV5N.js";
11
+ } from "./chunk-QGO6HXHG.js";
12
12
 
13
13
  // src/agents/runtime-agent-registry.ts
14
14
  var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-7J4ZXMY7.js";
4
4
  import {
5
5
  getProjectSubagentsDir
6
- } from "./chunk-PHZP3KHB.js";
6
+ } from "./chunk-GRJHIXYF.js";
7
7
  import {
8
8
  getPiSpawnCommand,
9
9
  writeAtomicJson
10
- } from "./chunk-UX4SCV5N.js";
10
+ } from "./chunk-QGO6HXHG.js";
11
11
 
12
12
  // src/inspectors/herdr/project-panes.ts
13
13
  import * as fs from "node:fs";