@vicary/pi-subagents 0.87.0 → 0.88.1

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 (108) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +3 -3
  4. package/bundle/{chunk-3CVOAS77.js → chunk-2DIEL4WG.js} +2 -2
  5. package/bundle/{chunk-75LVXBSA.js → chunk-2HKPEANZ.js} +114 -49
  6. package/bundle/{chunk-ESWW6XSX.js → chunk-47ZN7NKR.js} +1 -1
  7. package/bundle/{chunk-C3KWLXDH.js → chunk-4MVDMA5C.js} +9 -1
  8. package/bundle/{chunk-XV7RTWTS.js → chunk-4ZQBZDF3.js} +21 -6
  9. package/bundle/{chunk-LZKVUWIY.js → chunk-5EMPFFO4.js} +30 -5
  10. package/bundle/{chunk-OOE3R7IQ.js → chunk-6CG2VAG4.js} +2 -2
  11. package/bundle/{chunk-HDICKROY.js → chunk-7OX6O7DQ.js} +31 -14
  12. package/bundle/{chunk-Z4TR7MK6.js → chunk-AZPP3G4N.js} +14 -5
  13. package/bundle/{chunk-PUSTU4Q7.js → chunk-BKISQ5CJ.js} +130 -49
  14. package/bundle/{chunk-NMYBVCGP.js → chunk-CGWNA6EJ.js} +75 -44
  15. package/bundle/{chunk-PGU4TZV3.js → chunk-CPSUJHZE.js} +417 -455
  16. package/bundle/{chunk-W52LJANO.js → chunk-CYKNHFXB.js} +1 -1
  17. package/bundle/{chunk-SIAQXPJ4.js → chunk-D32H53HM.js} +21 -9
  18. package/bundle/{chunk-YEXKJJVS.js → chunk-DSHQWGHO.js} +4 -4
  19. package/bundle/{chunk-6O7YH2QV.js → chunk-GDR2ILWY.js} +1 -1
  20. package/bundle/{chunk-O7A26O6B.js → chunk-IYT7X46U.js} +6 -4
  21. package/bundle/{chunk-NJTSXIMG.js → chunk-JQTHG2ID.js} +12 -12
  22. package/bundle/{chunk-C5QWQSSM.js → chunk-KXW62VBU.js} +1 -1
  23. package/bundle/{chunk-BFF6YDK6.js → chunk-L4YY2TOE.js} +1 -1
  24. package/bundle/{chunk-2NY5PCKQ.js → chunk-LV3CPYXJ.js} +4 -4
  25. package/bundle/{chunk-2D2DQGC2.js → chunk-PYKBTBY6.js} +27 -10
  26. package/bundle/{chunk-M2VBGET6.js → chunk-RMZAAXIR.js} +7 -2
  27. package/bundle/{chunk-HTI7DD5D.js → chunk-V7SZMS6W.js} +2 -2
  28. package/bundle/{chunk-VFUFOZBU.js → chunk-W6HIYD2Z.js} +1 -1
  29. package/bundle/{chunk-USRX7QXD.js → chunk-XIA5GSEU.js} +2 -2
  30. package/bundle/{chunk-CTPAE36Y.js → chunk-YARY7JWU.js} +22 -0
  31. package/bundle/chunk-YDZ7BZD5.js +523 -0
  32. package/bundle/control-channel.js +2 -2
  33. package/bundle/index.js +1 -1
  34. package/bundle/intercom-bridge.js +2 -2
  35. package/bundle/preflight.js +9 -9
  36. package/bundle/project-panes.js +3 -3
  37. package/bundle/required-child-extensions.js +1 -1
  38. package/docs/agents.md +4 -2
  39. package/docs/configuration.md +4 -2
  40. package/docs/observability.md +2 -0
  41. package/docs/tool-reference.md +4 -1
  42. package/docs/workflows.md +3 -1
  43. package/package.json +3 -3
  44. package/skills/pi-subagents/SKILL.md +8 -2
  45. package/src/agents/agent-management.d.ts +1 -0
  46. package/src/agents/agent-management.js +12 -4
  47. package/src/agents/agents.d.ts +1 -0
  48. package/src/agents/agents.js +2 -2
  49. package/src/extension/config.d.ts +9 -0
  50. package/src/extension/config.js +13 -0
  51. package/src/extension/index.d.ts +1 -1
  52. package/src/extension/index.js +47 -23
  53. package/src/extension/schemas.d.ts +2 -0
  54. package/src/extension/schemas.js +1 -0
  55. package/src/extension/subagent-launch-tool.d.ts +6 -2
  56. package/src/extension/subagent-launch-tool.js +13 -9
  57. package/src/extension/tool-activation.js +20 -3
  58. package/src/runs/background/async-resume.js +2 -1
  59. package/src/runs/background/async-retention.d.ts +0 -2
  60. package/src/runs/background/async-retention.js +11 -5
  61. package/src/runs/background/async-status.d.ts +2 -0
  62. package/src/runs/background/async-status.js +4 -0
  63. package/src/runs/background/run-child-session.d.ts +2 -2
  64. package/src/runs/background/run-child-session.js +4 -7
  65. package/src/runs/background/stale-run-reconciler.js +17 -8
  66. package/src/runs/background/steering.d.ts +2 -11
  67. package/src/runs/background/steering.js +11 -6
  68. package/src/runs/background/subagent-runner.d.ts +0 -2
  69. package/src/runs/background/subagent-runner.js +73 -58
  70. package/src/runs/foreground/async-steering-action.js +24 -9
  71. package/src/runs/foreground/execution.js +32 -15
  72. package/src/runs/foreground/prompt-audit.js +1 -0
  73. package/src/runs/foreground/subagent-executor.d.ts +1 -8
  74. package/src/runs/foreground/subagent-executor.js +17 -21
  75. package/src/runs/shared/async-status-projection.d.ts +2 -0
  76. package/src/runs/shared/async-status-projection.js +10 -0
  77. package/src/runs/shared/child-launch.js +6 -3
  78. package/src/runs/shared/child-session.d.ts +1 -1
  79. package/src/runs/shared/child-session.js +24 -30
  80. package/src/runs/shared/mcp-config-sources.d.ts +2 -0
  81. package/src/runs/shared/mcp-direct-tool-allowlist.d.ts +5 -5
  82. package/src/runs/shared/mcp-direct-tool-allowlist.js +26 -15
  83. package/src/runs/shared/subagent-prompt-runtime.js +14 -2
  84. package/src/runs/shared/supervisor-wait-timer.d.ts +16 -0
  85. package/src/runs/shared/supervisor-wait-timer.js +61 -0
  86. package/src/shared/artifacts.d.ts +1 -0
  87. package/src/shared/artifacts.js +107 -9
  88. package/src/shared/compaction-interruption.d.ts +9 -0
  89. package/src/shared/compaction-interruption.js +47 -0
  90. package/src/shared/parent-wake.d.ts +3 -2
  91. package/src/shared/parent-wake.js +14 -3
  92. package/src/shared/reported-progress.d.ts +1 -0
  93. package/src/shared/reported-progress.js +12 -0
  94. package/src/shared/required-child-extensions.d.ts +2 -0
  95. package/src/shared/required-child-extensions.js +27 -0
  96. package/src/shared/status-format.d.ts +1 -0
  97. package/src/shared/status-format.js +1 -1
  98. package/src/shared/types.d.ts +9 -0
  99. package/src/shared/utils.d.ts +3 -1
  100. package/src/shared/utils.js +4 -0
  101. package/src/tui/fleet.d.ts +7 -2
  102. package/src/tui/fleet.js +22 -0
  103. package/src/tui/render.js +33 -2
  104. package/src/watchdog/permission-arbiter.js +1 -0
  105. package/src/watchdog/review.d.ts +0 -5
  106. package/src/watchdog/review.js +2 -1
  107. package/src/workflows/workflow-script-worker.js +3 -1
  108. package/bundle/chunk-XSDYTXHF.js +0 -242
@@ -11,7 +11,7 @@ import {
11
11
  readStatus,
12
12
  writeAtomicJson,
13
13
  writePrivateAtomicJson
14
- } from "./chunk-C3KWLXDH.js";
14
+ } from "./chunk-4MVDMA5C.js";
15
15
  import {
16
16
  ASYNC_DIR,
17
17
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  snapshotRequiredChildExtensions
3
- } from "./chunk-CTPAE36Y.js";
3
+ } from "./chunk-YARY7JWU.js";
4
4
  import {
5
5
  THINKING_LEVELS,
6
6
  findConfiguredProjectRoot,
7
7
  getAgentDir,
8
8
  getConfigDirName,
9
9
  getProjectConfigDir
10
- } from "./chunk-C3KWLXDH.js";
10
+ } from "./chunk-4MVDMA5C.js";
11
11
  import {
12
12
  TEMP_ROOT_DIR
13
13
  } from "./chunk-JEZOSEWG.js";
@@ -509,17 +509,20 @@ function resolveMcpDirectToolResolution(mcpDirectTools, cwd = process.cwd(), run
509
509
  const runtimeSelectionServers = /* @__PURE__ */ new Set([...selectedServers, ...selectedTools.keys()]);
510
510
  const runtimeServers = resolveRuntimeMcpServers(config, runtimeSelectionServers, runtimeSnapshotHost);
511
511
  const resolvedConfig = Object.keys(runtimeServers).length > 0 ? mergeConfigs(config, { mcpServers: runtimeServers }) : config;
512
- validateSelectedServerDefinitions(resolvedConfig, selectors);
512
+ const enabledSelectors = selectors.filter((selector) => resolvedConfig.mcpServers[selector.split("/", 1)[0]]?.disabled !== true);
513
+ validateSelectedServerDefinitions(resolvedConfig, enabledSelectors);
513
514
  const runtime = Object.keys(runtimeServers).length > 0 ? { mcpConfig: resolvedConfig, runtimeServerNames: Object.keys(runtimeServers) } : {};
515
+ if (enabledSelectors.length === 0) return { selections: [], unresolvedSelectors: [], ...runtime };
514
516
  const cache = loadMetadataCache();
515
- if (!cache) return { selections: [], unresolvedSelectors: selectors, ...runtime };
517
+ if (!cache) return { selections: [], unresolvedSelectors: enabledSelectors, ...runtime };
516
518
  const validMetadata = {};
517
519
  for (const [serverName, definition] of Object.entries(resolvedConfig.mcpServers)) {
520
+ if (definition.disabled === true) continue;
518
521
  const serverCache = cache.servers[serverName];
519
522
  if (isServerCacheValid(serverCache, definition)) validMetadata[serverName] = serverCache;
520
523
  }
521
524
  const grant = planMcpDirectToolGrant({
522
- selectors,
525
+ selectors: enabledSelectors,
523
526
  servers: resolvedConfig.mcpServers,
524
527
  metadata: validMetadata,
525
528
  toolPrefix: resolvedConfig.settings?.toolPrefix
@@ -560,8 +563,8 @@ function formatUnresolvedBuiltinMcpSelectors(agentName, selectors) {
560
563
  const subject = agentName ? `Agent '${agentName}'` : "Subagent";
561
564
  return `${subject} selects MCP tools that Pi's built-in MCP does not offer: ${selectors.map((selector) => `mcp:${selector}`).join(", ")}. The server may be missing, disconnected, still connecting, or its tools hidden; check /mcp.`;
562
565
  }
563
- function extensionOnlyMcpServers(selections, host, cwd, projectTrusted) {
564
- const registered = new Set(host.getMcpServers?.().map(({ name }) => name));
566
+ function extensionOnlyMcpServers(selections, host, cwd, projectTrusted, loadedByChild) {
567
+ const registered = new Set(host.getMcpServers?.().filter(({ extensionPath }) => !loadedByChild(extensionPath)).map(({ name }) => name));
565
568
  const servers = [...new Set(selections.map(({ selector }) => selector.split("/")[0]))].filter((server) => registered.has(server));
566
569
  if (servers.length === 0) return [];
567
570
  const files = [path2.join(getAgentDir(), "mcp.json"), ...projectTrusted ? [path2.join(cwd, ".pi", "mcp.json")] : []];
@@ -714,11 +717,20 @@ function parseSettings(value) {
714
717
  function mergeConfigs(base, next) {
715
718
  const imports = [...base.imports ?? [], ...next.imports ?? []];
716
719
  return {
717
- mcpServers: { ...base.mcpServers, ...next.mcpServers },
720
+ mcpServers: mergeServerDefinitions(base.mcpServers, next.mcpServers),
718
721
  imports: imports.length ? [...new Set(imports)] : void 0,
719
722
  settings: next.settings ? { ...base.settings, ...next.settings } : base.settings
720
723
  };
721
724
  }
725
+ function mergeServerDefinitions(base, next) {
726
+ const servers = { ...base };
727
+ for (const [name, definition] of Object.entries(next)) {
728
+ const previous = base[name];
729
+ if (previous && Object.keys(definition).every((key) => key === "disabled")) servers[name] = { ...previous, ...definition };
730
+ else servers[name] = previous?.disabled === void 0 ? definition : { disabled: previous.disabled, ...definition };
731
+ }
732
+ return servers;
733
+ }
722
734
  function expandImports(config, cwd) {
723
735
  if (!config.imports?.length) return config;
724
736
  const importedServers = {};
@@ -738,7 +750,7 @@ function expandImports(config, cwd) {
738
750
  return {
739
751
  imports: config.imports,
740
752
  settings: config.settings,
741
- mcpServers: { ...importedServers, ...config.mcpServers }
753
+ mcpServers: mergeServerDefinitions(importedServers, config.mcpServers)
742
754
  };
743
755
  }
744
756
  function resolveImportPath(importKind, cwd) {
@@ -4,13 +4,13 @@ import {
4
4
  remoteShellCommand,
5
5
  runBoundedCommand,
6
6
  sshMachineAccess
7
- } from "./chunk-6O7YH2QV.js";
7
+ } from "./chunk-GDR2ILWY.js";
8
8
  import {
9
9
  package_default
10
- } from "./chunk-OOE3R7IQ.js";
10
+ } from "./chunk-6CG2VAG4.js";
11
11
  import {
12
12
  ensureSupervisorChannelDir
13
- } from "./chunk-W52LJANO.js";
13
+ } from "./chunk-CYKNHFXB.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-C3KWLXDH.js";
37
+ } from "./chunk-4MVDMA5C.js";
38
38
  import "./chunk-JEZOSEWG.js";
39
39
  import "./chunk-YFCK7H2S.js";
40
40
  import "./chunk-QXASAHIA.js";
@@ -4,7 +4,7 @@ import {
4
4
  getAgentDir,
5
5
  getProjectConfigDir,
6
6
  resolveRexLocalPlacement
7
- } from "./chunk-C3KWLXDH.js";
7
+ } from "./chunk-4MVDMA5C.js";
8
8
 
9
9
  // src/runs/shared/herdr-machine.ts
10
10
  import { spawnSync as spawnSync2 } from "node:child_process";
@@ -8,7 +8,7 @@ import {
8
8
  projectTimeoutRecovery,
9
9
  readAsyncRecoveryDescriptor,
10
10
  utf8Tail
11
- } from "./chunk-XV7RTWTS.js";
11
+ } from "./chunk-4ZQBZDF3.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-PGU4TZV3.js";
24
+ } from "./chunk-CPSUJHZE.js";
25
25
  import {
26
26
  PROJECT_SUBAGENTS_RELATIVE_DIR
27
- } from "./chunk-XSDYTXHF.js";
27
+ } from "./chunk-YDZ7BZD5.js";
28
28
  import {
29
29
  listBackgroundWorkWakeChannels,
30
30
  snapshotBackgroundWork
@@ -50,7 +50,7 @@ import {
50
50
  waitToolName,
51
51
  withSettingsFileLease,
52
52
  writePrivateAtomicJson
53
- } from "./chunk-C3KWLXDH.js";
53
+ } from "./chunk-4MVDMA5C.js";
54
54
  import {
55
55
  DIRS,
56
56
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -820,6 +820,7 @@ var SubagentParamProperties = {
820
820
  description: 'Management/control only; omit for execution. validate accepts workflow: true or a script path. Discover actions with {action:"guide",options:{topic:"tool-reference"}}.'
821
821
  })),
822
822
  capabilities: Type2.Optional(Type2.Boolean({ description: "list: compact capability rows/details without system prompts." })),
823
+ search: Type2.Optional(Type2.String({ minLength: 1, description: "list: case-insensitive match on agent name, alias, or description." })),
823
824
  name: Type2.Optional(Type2.String({ description: "schedule.create name." })),
824
825
  id: Type2.Optional(Type2.String({
825
826
  description: "Run id/prefix for status/control."
@@ -4401,6 +4402,7 @@ async function runWatchdogAttempt(ctx, request, options) {
4401
4402
  hasDiff: diffBaseline !== void 0
4402
4403
  });
4403
4404
  const agent2 = new Agent({
4405
+ sessionId,
4404
4406
  initialState: {
4405
4407
  systemPrompt,
4406
4408
  model: selection.model,
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  rewriteSubagentPrompt
3
- } from "./chunk-Z4TR7MK6.js";
3
+ } from "./chunk-AZPP3G4N.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-OOE3R7IQ.js";
6
+ } from "./chunk-6CG2VAG4.js";
7
7
  import {
8
8
  WATCHDOG_DIFF_TOOL_NAME,
9
9
  captureWatchdogDiffBaseline,
10
10
  createWatchdogDiffTool
11
- } from "./chunk-O7A26O6B.js";
12
- import "./chunk-XV7RTWTS.js";
13
- import "./chunk-W52LJANO.js";
11
+ } from "./chunk-IYT7X46U.js";
12
+ import "./chunk-4ZQBZDF3.js";
13
+ import "./chunk-CYKNHFXB.js";
14
14
  import {
15
15
  MODEL_ONLY_TOOL
16
16
  } from "./chunk-HXRB42AF.js";
17
17
  import "./chunk-W2BZS6UC.js";
18
18
  import {
19
19
  appendAgentRefinementOverlay
20
- } from "./chunk-USRX7QXD.js";
21
- import "./chunk-PGU4TZV3.js";
20
+ } from "./chunk-XIA5GSEU.js";
21
+ import "./chunk-CPSUJHZE.js";
22
22
  import "./chunk-NIXWDZZV.js";
23
- import "./chunk-ESWW6XSX.js";
23
+ import "./chunk-47ZN7NKR.js";
24
24
  import "./chunk-7F6RKT6W.js";
25
25
  import {
26
26
  assertNoToolModifierEntries
27
- } from "./chunk-SIAQXPJ4.js";
28
- import "./chunk-CTPAE36Y.js";
29
- import "./chunk-XSDYTXHF.js";
27
+ } from "./chunk-D32H53HM.js";
28
+ import "./chunk-YARY7JWU.js";
29
+ import "./chunk-YDZ7BZD5.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-C3KWLXDH.js";
46
+ } from "./chunk-4MVDMA5C.js";
47
47
  import "./chunk-JEZOSEWG.js";
48
48
  import "./chunk-YFCK7H2S.js";
49
49
  import "./chunk-QXASAHIA.js";
@@ -8,7 +8,7 @@ import {
8
8
  validateCodeOwnedProfileRunner,
9
9
  validatePermissionRules,
10
10
  validateToolBudgetConfig
11
- } from "./chunk-C3KWLXDH.js";
11
+ } from "./chunk-4MVDMA5C.js";
12
12
 
13
13
  // src/agents/runtime-agent-registry.ts
14
14
  var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  registerRuntimeAgent
3
- } from "./chunk-C5QWQSSM.js";
3
+ } from "./chunk-KXW62VBU.js";
4
4
 
5
5
  // src/agents/runtime-agent-events.ts
6
6
  var RUNTIME_AGENT_REGISTER_EVENT = "pi-subagents:runtime-agent-register:v1";
@@ -12,7 +12,7 @@ import {
12
12
  summarizeContextModes,
13
13
  utf8Tail,
14
14
  workflowPreflightLaneForRuntimeKey
15
- } from "./chunk-XV7RTWTS.js";
15
+ } from "./chunk-4ZQBZDF3.js";
16
16
  import {
17
17
  ownsRun
18
18
  } from "./chunk-HXRB42AF.js";
@@ -34,11 +34,11 @@ import {
34
34
  updateActiveRunIndex,
35
35
  validateModelResponseAliases,
36
36
  writeAsyncResultFile
37
- } from "./chunk-PGU4TZV3.js";
37
+ } from "./chunk-CPSUJHZE.js";
38
38
  import {
39
39
  deliverStopRequest,
40
40
  stopInboxClosedPath
41
- } from "./chunk-VFUFOZBU.js";
41
+ } from "./chunk-W6HIYD2Z.js";
42
42
  import {
43
43
  SUBAGENT_STOPPED_MESSAGE,
44
44
  formatDuration,
@@ -50,7 +50,7 @@ import {
50
50
  waitToolName,
51
51
  writeAtomicJson,
52
52
  writePrivateAtomicJson
53
- } from "./chunk-C3KWLXDH.js";
53
+ } from "./chunk-4MVDMA5C.js";
54
54
  import {
55
55
  DIRS
56
56
  } from "./chunk-JEZOSEWG.js";
@@ -7,37 +7,37 @@ import {
7
7
  safeTranscriptEvent,
8
8
  steerAsyncRun,
9
9
  steerWorkflowForegroundTarget
10
- } from "./chunk-HDICKROY.js";
10
+ } from "./chunk-7OX6O7DQ.js";
11
11
  import {
12
12
  FLEET_STATUS_WIDGET_KEY,
13
13
  runningTone,
14
14
  stepTaskSummary
15
- } from "./chunk-LZKVUWIY.js";
15
+ } from "./chunk-5EMPFFO4.js";
16
16
  import {
17
17
  foregroundChildStateLabel,
18
18
  formatAsyncRunTranscript,
19
19
  stopAsyncRun
20
- } from "./chunk-2NY5PCKQ.js";
20
+ } from "./chunk-LV3CPYXJ.js";
21
21
  import {
22
22
  contextModeBadge,
23
23
  contextModeLabel,
24
24
  decodeUtf8Tail,
25
25
  listAsyncRuns
26
- } from "./chunk-XV7RTWTS.js";
26
+ } from "./chunk-4ZQBZDF3.js";
27
27
  import {
28
28
  reportSessionWarning
29
29
  } from "./chunk-HXRB42AF.js";
30
- import "./chunk-PGU4TZV3.js";
31
- import "./chunk-VFUFOZBU.js";
30
+ import "./chunk-CPSUJHZE.js";
31
+ import "./chunk-W6HIYD2Z.js";
32
32
  import "./chunk-NIXWDZZV.js";
33
- import "./chunk-ESWW6XSX.js";
33
+ import "./chunk-47ZN7NKR.js";
34
34
  import "./chunk-7F6RKT6W.js";
35
- import "./chunk-CTPAE36Y.js";
35
+ import "./chunk-YARY7JWU.js";
36
36
  import "./chunk-7J4ZXMY7.js";
37
37
  import {
38
38
  getArtifactPaths,
39
39
  getArtifactsDir
40
- } from "./chunk-XSDYTXHF.js";
40
+ } from "./chunk-YDZ7BZD5.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-C3KWLXDH.js";
52
+ } from "./chunk-4MVDMA5C.js";
53
53
  import {
54
54
  DIRS
55
55
  } from "./chunk-JEZOSEWG.js";
@@ -940,6 +940,10 @@ var SubagentFleetComponent = class {
940
940
  actionBusy = false;
941
941
  transcriptCache;
942
942
  disposed = false;
943
+ // Undefined until a TUI first focuses the overlay, so a fleet rendered outside one still draws.
944
+ hasFocus;
945
+ // The component focused when the fleet opened (the overlay's preFocus).
946
+ openedOver;
943
947
  refreshTimer;
944
948
  refreshMs;
945
949
  tui;
@@ -951,6 +955,7 @@ var SubagentFleetComponent = class {
951
955
  keybindings;
952
956
  constructor(tui, theme, state, done, options = {}) {
953
957
  this.tui = tui;
958
+ this.openedOver = tui.getFocusedComponent?.();
954
959
  this.viewport = new FleetViewport(() => this.tui.requestRender());
955
960
  this.theme = theme;
956
961
  this.markdownTheme = options.markdownTheme ?? getMarkdownTheme();
@@ -1120,6 +1125,14 @@ var SubagentFleetComponent = class {
1120
1125
  scrollDetail(delta) {
1121
1126
  this.viewport.scroll.scrollBy(delta);
1122
1127
  }
1128
+ get focused() {
1129
+ return this.hasFocus === true;
1130
+ }
1131
+ set focused(value) {
1132
+ if (value === this.hasFocus) return;
1133
+ this.hasFocus = value;
1134
+ this.tui.requestRender();
1135
+ }
1123
1136
  handleMouse(event) {
1124
1137
  if (this.steerDraft !== void 0 || this.redoGuidanceDraft !== void 0 || this.stopConfirming || this.actionBusy) {
1125
1138
  return { handled: true, render: false };
@@ -1417,6 +1430,10 @@ var SubagentFleetComponent = class {
1417
1430
  return { header: [], body: this.withActionLines(lines) };
1418
1431
  }
1419
1432
  render(width) {
1433
+ if (this.hasFocus === false && this.tui.getFocusedComponent?.() !== this.openedOver) {
1434
+ this.renderedLayout = void 0;
1435
+ return [];
1436
+ }
1420
1437
  const layout = fleetLayout(width, this.tui.terminal?.rows ?? 32, this.selected, this.snapshot.items);
1421
1438
  this.renderedLayout = layout;
1422
1439
  if (!layout) return [truncateToWidth2("Subagent fleet needs at least 36 columns. Esc closes.", width)];
@@ -11,13 +11,13 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-PGU4TZV3.js";
14
+ } from "./chunk-CPSUJHZE.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
18
18
  validatePermissionConfig,
19
19
  writePrivateAtomicJson
20
- } from "./chunk-C3KWLXDH.js";
20
+ } from "./chunk-4MVDMA5C.js";
21
21
  import {
22
22
  FLEET_KEYBINDING_ACTIONS,
23
23
  RUNNER_LAUNCHER_NAME_PATTERN,
@@ -702,6 +702,10 @@ function validateConfig(config) {
702
702
  validateOrcaProgressTabsConfig(config.orcaProgressTabs);
703
703
  validateRunnerLaunchersConfig(config.runnerLaunchers);
704
704
  }
705
+ function resolveConfigDefaultTimeoutMs(raw) {
706
+ if (typeof raw !== "number" || !Number.isInteger(raw) || raw <= 0 || raw > 2147483647) return void 0;
707
+ return raw;
708
+ }
705
709
  function getConfigPath() {
706
710
  return path2.join(getAgentDir(), "extensions", "subagent", "config.json");
707
711
  }
@@ -747,6 +751,7 @@ export {
747
751
  acquireActiveAsyncCapacity,
748
752
  transferActiveAsyncCapacity,
749
753
  resolveScheduledStoreRoot,
754
+ resolveConfigDefaultTimeoutMs,
750
755
  resolveAsyncByDefault,
751
756
  loadConfig
752
757
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  appendAgentRefinementOverlay
3
- } from "./chunk-USRX7QXD.js";
3
+ } from "./chunk-XIA5GSEU.js";
4
4
  import {
5
5
  buildAgentMemoryInjection,
6
6
  buildSkillInjection
7
- } from "./chunk-C3KWLXDH.js";
7
+ } from "./chunk-4MVDMA5C.js";
8
8
 
9
9
  // src/runs/shared/effective-system-prompt.ts
10
10
  function appendSection(prompt, section) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveWatchPath,
6
6
  writeAtomicJson
7
- } from "./chunk-C3KWLXDH.js";
7
+ } from "./chunk-4MVDMA5C.js";
8
8
  import {
9
9
  POLL_INTERVAL_MS
10
10
  } from "./chunk-JEZOSEWG.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getProjectSubagentsDir
3
- } from "./chunk-XSDYTXHF.js";
3
+ } from "./chunk-YDZ7BZD5.js";
4
4
  import {
5
5
  discoverAgents,
6
6
  formatUnknownAgentError,
7
7
  resolveAgentName,
8
8
  unknownAgentDiagnosticContext
9
- } from "./chunk-C3KWLXDH.js";
9
+ } from "./chunk-4MVDMA5C.js";
10
10
 
11
11
  // src/agents/agent-refinements.ts
12
12
  import { createHash, randomUUID } from "node:crypto";
@@ -68,6 +68,27 @@ function assertRequiredChildExtensionsAdmitted(snapshots, launch) {
68
68
  const route = launch.machine ? `machine '${launch.machine}'` : launch.runnerType !== void 0 && launch.runnerType !== "pi" ? `runner.type='${launch.runnerType}'` : void 0;
69
69
  if (route) throw new Error(`Agent '${launch.agent}' cannot run on ${route}: the host requires child extensions (${ids.join(", ")}) for every runner, and only local native Pi children load them.`);
70
70
  }
71
+ function childExtensionFileIdentity(extensionPath) {
72
+ if (!path.isAbsolute(extensionPath)) return void 0;
73
+ try {
74
+ const stat = fs.statSync(extensionPath, { bigint: true });
75
+ return stat.isFile() ? `${stat.dev}:${stat.ino}` : void 0;
76
+ } catch {
77
+ return void 0;
78
+ }
79
+ }
80
+ function createRequiredChildExtensionIdentity(requiredPaths) {
81
+ const aliases = new Map([...requiredPaths].map((extensionPath) => [extensionPath, childExtensionFileIdentity(extensionPath) ?? extensionPath]));
82
+ const identities = new Set(aliases.values());
83
+ return (extensionPath) => {
84
+ const known = aliases.get(extensionPath);
85
+ if (known !== void 0) return known;
86
+ const identity = childExtensionFileIdentity(extensionPath);
87
+ if (identity === void 0 || !identities.has(identity)) return void 0;
88
+ aliases.set(extensionPath, identity);
89
+ return identity;
90
+ };
91
+ }
71
92
  function hasMandatoryRequiredChildExtensions(snapshot) {
72
93
  return snapshot?.some((entry) => entry.requireForAllRunners) === true;
73
94
  }
@@ -88,6 +109,7 @@ export {
88
109
  registerRequiredChildExtensions,
89
110
  resolveRequiredChildExtensions,
90
111
  assertRequiredChildExtensionsAdmitted,
112
+ createRequiredChildExtensionIdentity,
91
113
  hasMandatoryRequiredChildExtensions,
92
114
  writeRetainedRequiredChildExtensions,
93
115
  readRetainedRequiredChildExtensions