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-JWYG26RE.js → chunk-2IYBCYFU.js} +24 -23
  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-JNXT3MPI.js → chunk-7ADDXUGF.js} +5 -5
  11. package/bundle/{chunk-O7CPL6H4.js → chunk-7QA7ZA46.js} +9 -9
  12. package/bundle/{chunk-HFTBF7SG.js → chunk-7ZUFN6ME.js} +1 -1
  13. package/bundle/{chunk-RQAUNAWG.js → chunk-A637IMAO.js} +2 -2
  14. package/bundle/{chunk-LTPH2DXH.js → chunk-BGXEAYUM.js} +3 -3
  15. package/bundle/{chunk-JO67XSKD.js → chunk-BU6PFPVX.js} +4 -4
  16. package/bundle/{chunk-WOVMHDES.js → chunk-BWC2LVII.js} +39 -45
  17. package/bundle/{chunk-LGMILZNE.js → chunk-GJGTMLPE.js} +2 -2
  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-3UZ5FVVJ.js → chunk-O3YH7XIY.js} +35 -31
  22. package/bundle/{chunk-PVIVCDG2.js → chunk-PYOAIN3V.js} +2 -2
  23. package/bundle/{chunk-UX4SCV5N.js → chunk-QGO6HXHG.js} +80 -35
  24. package/bundle/{chunk-DV2NCNPR.js → chunk-QM3JGE4W.js} +11 -11
  25. package/bundle/{chunk-H2NLFTC5.js → chunk-S2Q75LP3.js} +1 -1
  26. package/bundle/{chunk-KZ34KQQH.js → chunk-UR7OW5S7.js} +4 -4
  27. package/bundle/{chunk-L2ENOFVZ.js → chunk-WN2E5XHN.js} +66 -26
  28. package/bundle/{chunk-N7B2KD74.js → chunk-YK3QYNLE.js} +1 -1
  29. package/bundle/{chunk-IQIWF2VX.js → chunk-ZJJCPV3L.js} +4 -4
  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 +1 -1
  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";
@@ -3,7 +3,7 @@ import {
3
3
  projectRuntimeAcknowledgedExtensions,
4
4
  registerSubagentPromptBoundary,
5
5
  registerSubagentPromptRuntime
6
- } from "./chunk-JNXT3MPI.js";
6
+ } from "./chunk-7ADDXUGF.js";
7
7
  import {
8
8
  INSPECTOR_ACTIONS,
9
9
  canQueueRetainedAsyncFollowUp,
@@ -25,12 +25,12 @@ import {
25
25
  updateSteeringTarget,
26
26
  waitForSteeringAction,
27
27
  workflowAsyncChildSteeringGuidance
28
- } from "./chunk-CS4O36CZ.js";
28
+ } from "./chunk-3RKFH2UZ.js";
29
29
  import {
30
30
  PLACED_RESTORE_UNSUPPORTED,
31
31
  formatHerdrMachineRunnerUnsupported,
32
32
  resolveMachinePlacement
33
- } from "./chunk-N7B2KD74.js";
33
+ } from "./chunk-YK3QYNLE.js";
34
34
  import {
35
35
  COMPLETION_ACTION,
36
36
  DEFAULT_CONTROL_CONFIG,
@@ -119,7 +119,7 @@ import {
119
119
  workflowScriptDigest,
120
120
  workflowStopCause,
121
121
  writeWorkflowReceipt
122
- } from "./chunk-WOVMHDES.js";
122
+ } from "./chunk-BWC2LVII.js";
123
123
  import {
124
124
  SUBAGENT_PARENT_SESSION_ENV,
125
125
  applyWatchdogLaunchRules,
@@ -132,7 +132,7 @@ import {
132
132
  resolveWatchdogConfig,
133
133
  sendRuleViolationWarning,
134
134
  writeWatchdogModelSettings
135
- } from "./chunk-IQIWF2VX.js";
135
+ } from "./chunk-ZJJCPV3L.js";
136
136
  import {
137
137
  MAX_REMEMBERED_FOREGROUND_RUNS,
138
138
  discardRunningForegroundRun,
@@ -145,7 +145,7 @@ import {
145
145
  resolveSubagentRunId,
146
146
  resolveWorkflowChatProgress,
147
147
  stopAsyncRun
148
- } from "./chunk-KZ34KQQH.js";
148
+ } from "./chunk-UR7OW5S7.js";
149
149
  import {
150
150
  RunFanoutLimitError,
151
151
  annotateWorkflowPreflightTrace,
@@ -206,12 +206,12 @@ import {
206
206
  writeRunFanoutBudgetDescriptor,
207
207
  writeWorkflowLaunchRecord,
208
208
  writeWorktreeSetupHandoff
209
- } from "./chunk-LTPH2DXH.js";
209
+ } from "./chunk-BGXEAYUM.js";
210
210
  import {
211
211
  NATIVE_SUPERVISOR_TOOL_NAME,
212
212
  createNativeSupervisorChannel,
213
213
  resolveSupervisorChannelDir
214
- } from "./chunk-T5V5BRCL.js";
214
+ } from "./chunk-ZPY5QZCS.js";
215
215
  import {
216
216
  MODEL_ONLY_TOOL,
217
217
  inheritedSessionIds,
@@ -234,10 +234,10 @@ import {
234
234
  canPreferFork,
235
235
  createForkContextResolver,
236
236
  resolveSubagentLaunchContext
237
- } from "./chunk-RQAUNAWG.js";
237
+ } from "./chunk-A637IMAO.js";
238
238
  import {
239
239
  handleRefinementAction
240
- } from "./chunk-QO75KJBT.js";
240
+ } from "./chunk-LGINOOY5.js";
241
241
  import {
242
242
  ActiveAsyncCapacityError,
243
243
  acquireActiveAsyncCapacity,
@@ -252,7 +252,7 @@ import {
252
252
  resolveDisabledFeatureSurface,
253
253
  resolveMaxActiveAsyncRunsPerSession,
254
254
  transferActiveAsyncCapacity
255
- } from "./chunk-RV5OGHLO.js";
255
+ } from "./chunk-6VD7BGIC.js";
256
256
  import {
257
257
  DEFAULT_STALE_TERMINAL_ACTIVE_MARKER_MS,
258
258
  MACHINE_DIFF_OPTIONS,
@@ -338,7 +338,7 @@ import {
338
338
  writeNestedControlRequest,
339
339
  writeNestedControlResult,
340
340
  writeNestedEvent
341
- } from "./chunk-LGMILZNE.js";
341
+ } from "./chunk-GJGTMLPE.js";
342
342
  import {
343
343
  closeSteerInbox,
344
344
  consumeSteerRequests,
@@ -346,7 +346,7 @@ import {
346
346
  readRevivalBriefs,
347
347
  requestAsyncSteer,
348
348
  watchAsyncControlInbox
349
- } from "./chunk-7MAE3DJV.js";
349
+ } from "./chunk-5H4BICQZ.js";
350
350
  import "./chunk-NIXWDZZV.js";
351
351
  import {
352
352
  INTERCOM_BRIDGE_MARKER,
@@ -355,7 +355,7 @@ import {
355
355
  resolveIntercomBridge,
356
356
  resolveIntercomSessionTarget,
357
357
  resolveSubagentIntercomTarget
358
- } from "./chunk-KDMFBYFM.js";
358
+ } from "./chunk-77ASNIEM.js";
359
359
  import {
360
360
  agentDefinitionDigest,
361
361
  resolveLaunchBinding,
@@ -370,7 +370,7 @@ import {
370
370
  resolvePiLaunchToolPlan,
371
371
  resolveRuntimeModulePath,
372
372
  supervisorChannelDir
373
- } from "./chunk-KEY3UQMQ.js";
373
+ } from "./chunk-374MZFF4.js";
374
374
  import {
375
375
  assertRequiredChildExtensionsAdmitted,
376
376
  hasMandatoryRequiredChildExtensions,
@@ -381,7 +381,7 @@ import {
381
381
  import {
382
382
  HERDR_PROJECT_PANE_ACTIONS,
383
383
  handleHerdrProjectPaneAction
384
- } from "./chunk-PVIVCDG2.js";
384
+ } from "./chunk-PYOAIN3V.js";
385
385
  import "./chunk-7J4ZXMY7.js";
386
386
  import {
387
387
  PROJECT_SUBAGENTS_RELATIVE_DIR,
@@ -394,12 +394,12 @@ import {
394
394
  getProjectSubagentsDir,
395
395
  writeArtifact,
396
396
  writeMetadata
397
- } from "./chunk-PHZP3KHB.js";
397
+ } from "./chunk-GRJHIXYF.js";
398
398
  import "./chunk-XA3DY6UG.js";
399
399
  import {
400
400
  getExternalJobProvider
401
401
  } from "./chunk-YYREO77V.js";
402
- import "./chunk-GCSLVFCX.js";
402
+ import "./chunk-NAFLUJ26.js";
403
403
  import {
404
404
  ChainOutputValidationError,
405
405
  DEFAULT_WAIT_TOOL_NAME,
@@ -550,7 +550,7 @@ import {
550
550
  writeAtomicJson,
551
551
  writeInitialProgressFile,
552
552
  writePrivateAtomicJson
553
- } from "./chunk-UX4SCV5N.js";
553
+ } from "./chunk-QGO6HXHG.js";
554
554
  import {
555
555
  CHAIN_RUNS_DIR,
556
556
  DEFAULT_ARTIFACT_CONFIG,
@@ -8874,10 +8874,11 @@ Extensions denied: ${status.capabilityCeiling.denyExtensions ? "yes" : "no"} (so
8874
8874
  lines.push(` Runner: external-cli (${runner.command}${runner.args.length ? ` ${runner.args.join(" ")}` : ""})`);
8875
8875
  lines.push(` Adapter: ${runner.adapter.id} v${runner.adapter.version} (${runner.adapter.executionMode})`);
8876
8876
  if (runner.safety) {
8877
- if ("approvalPolicy" in runner.safety) lines.push(` Safety: ${"access" in runner.safety ? `access=${runner.safety.access}, ` : ""}sandbox=${runner.safety.sandbox}, approval=${runner.safety.approvalPolicy}, ephemeral=${runner.safety.ephemeral}`);
8878
- else if ("mode" in runner.safety) lines.push(` Safety: access=${runner.safety.access}, auth=${runner.safety.authentication}, mode=${runner.safety.mode}, sandbox=${runner.safety.sandbox}, workspaceTrust=${runner.safety.workspaceTrust}, sessionReuse=${runner.safety.sessionReuse}`);
8879
- else if ("authentication" in runner.safety) lines.push(` Safety: access=${runner.safety.access}, auth=${runner.safety.authentication}, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, settingsTrust=${runner.safety.userSettingsTrust}, persistence=${runner.safety.sessionPersistence}`);
8880
- else lines.push(` Safety: access=read-only, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, persistence=${runner.safety.sessionPersistence}`);
8877
+ const safetyLabel = " Safety (adapter profile, not measured):";
8878
+ if ("approvalPolicy" in runner.safety) lines.push(`${safetyLabel} ${"access" in runner.safety ? `access=${runner.safety.access}, ` : ""}sandbox=${runner.safety.sandbox}, approval=${runner.safety.approvalPolicy}, ephemeral=${runner.safety.ephemeral}`);
8879
+ else if ("mode" in runner.safety) lines.push(`${safetyLabel} access=${runner.safety.access}, auth=${runner.safety.authentication}, mode=${runner.safety.mode}, sandbox=${runner.safety.sandbox}, workspaceTrust=${runner.safety.workspaceTrust}, sessionReuse=${runner.safety.sessionReuse}`);
8880
+ else if ("authentication" in runner.safety) lines.push(`${safetyLabel} access=${runner.safety.access}, auth=${runner.safety.authentication}, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, settingsTrust=${runner.safety.userSettingsTrust}, persistence=${runner.safety.sessionPersistence}`);
8881
+ else lines.push(`${safetyLabel} access=read-only, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, persistence=${runner.safety.sessionPersistence}`);
8881
8882
  }
8882
8883
  lines.push(` Capabilities: stop=${runner.capabilities.stop}, steer=false, resume=false, structuredOutput=false, toolEvents=false, supervisor=unsupported, forkContext=false, extensionBindings=false`);
8883
8884
  lines.push(` Unsupported steer: ${runner.unsupportedReasons.steer}`);
@@ -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";
@@ -14,20 +14,20 @@ import {
14
14
  resolveCurrentSessionId,
15
15
  resolveWatchdogReviewModel,
16
16
  startWatchdogDiffBaselineCapture
17
- } from "./chunk-IQIWF2VX.js";
17
+ } from "./chunk-ZJJCPV3L.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";
@@ -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",
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-QO75KJBT.js";
3
+ } from "./chunk-LGINOOY5.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-UX4SCV5N.js";
7
+ } from "./chunk-QGO6HXHG.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {
@@ -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";
@@ -11,10 +11,10 @@ import {
11
11
  startWatchdogDiffBaselineCapture,
12
12
  writeUserWatchdogEnabled,
13
13
  writeWatchdogModelSettings
14
- } from "./chunk-IQIWF2VX.js";
14
+ } from "./chunk-ZJJCPV3L.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);