zidane 6.4.4 → 6.5.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 (99) hide show
  1. package/README.md +1 -0
  2. package/dist/{acp-BLO58K3F.js → acp-B-AOovHz.js} +2 -2
  3. package/dist/{acp-BLO58K3F.js.map → acp-B-AOovHz.js.map} +1 -1
  4. package/dist/acp-cli.js +3 -2
  5. package/dist/acp-cli.js.map +1 -1
  6. package/dist/acp.d.ts +1 -1
  7. package/dist/acp.js +1 -1
  8. package/dist/{agent-8sUadp5M.js → agent-SQ6rxfpT.js} +231 -106
  9. package/dist/agent-SQ6rxfpT.js.map +1 -0
  10. package/dist/agent.d.ts +1 -1
  11. package/dist/agent.js +1 -1
  12. package/dist/chat/pure.d.ts +3 -3
  13. package/dist/chat.d.ts +13 -44
  14. package/dist/chat.d.ts.map +1 -1
  15. package/dist/chat.js +5 -4
  16. package/dist/chat.js.map +1 -1
  17. package/dist/{context-transport-D29WvHcm.js → context-transport-CDBatvQc.js} +3 -3
  18. package/dist/{context-transport-D29WvHcm.js.map → context-transport-CDBatvQc.js.map} +1 -1
  19. package/dist/contexts/daytona.d.ts +1 -1
  20. package/dist/contexts/e2b.d.ts +1 -1
  21. package/dist/eval.d.ts +1 -1
  22. package/dist/extensions.d.ts +2 -2
  23. package/dist/extensions.js +2 -2
  24. package/dist/headless.d.ts +1 -1
  25. package/dist/headless.js +1 -1
  26. package/dist/{index-C-Nd2ZbV.d.ts → index-CWBSrqI6.d.ts} +676 -3
  27. package/dist/index-CWBSrqI6.d.ts.map +1 -0
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +7 -6
  30. package/dist/index.js.map +1 -1
  31. package/dist/{login-CMVVnAHS.js → login-XZDS4K2o.js} +3 -3
  32. package/dist/{login-CMVVnAHS.js.map → login-XZDS4K2o.js.map} +1 -1
  33. package/dist/{mcp-3GXUBwur.js → mcp-D27rP47I.js} +87 -6
  34. package/dist/mcp-D27rP47I.js.map +1 -0
  35. package/dist/mcp.d.ts +2 -2
  36. package/dist/mcp.js +3 -2
  37. package/dist/origin-pinned-fetch-CqG8VZIq.js +159 -0
  38. package/dist/origin-pinned-fetch-CqG8VZIq.js.map +1 -0
  39. package/dist/output/stream-json.d.ts +1 -1
  40. package/dist/output/terminal.d.ts +1 -1
  41. package/dist/plugins-2PMTVcp-.js +1174 -0
  42. package/dist/plugins-2PMTVcp-.js.map +1 -0
  43. package/dist/plugins.d.ts +2 -0
  44. package/dist/plugins.js +2 -0
  45. package/dist/presets.d.ts +1 -1
  46. package/dist/presets.js +1 -1
  47. package/dist/providers/anthropic.d.ts +1 -1
  48. package/dist/providers/arcee.d.ts +1 -1
  49. package/dist/providers/baseten.d.ts +1 -1
  50. package/dist/providers/cerebras.d.ts +1 -1
  51. package/dist/providers/local.d.ts +1 -1
  52. package/dist/providers/openai-compat.d.ts +1 -1
  53. package/dist/providers/openai.d.ts +1 -1
  54. package/dist/providers/openrouter.d.ts +1 -1
  55. package/dist/providers/xai.d.ts +1 -1
  56. package/dist/providers.d.ts +1 -1
  57. package/dist/restate.d.ts +1 -1
  58. package/dist/restate.js +5 -3
  59. package/dist/restate.js.map +1 -1
  60. package/dist/session/sqlite.d.ts +1 -1
  61. package/dist/session.d.ts +1 -1
  62. package/dist/{resolve-CZJxds85.js → skills-Cp9vnBwd.js} +1430 -1006
  63. package/dist/skills-Cp9vnBwd.js.map +1 -0
  64. package/dist/skills.d.ts +1 -1
  65. package/dist/skills.js +1 -2
  66. package/dist/{stdio-BvL8HGYW.js → stdio-O-m9WVkE.js} +2 -2
  67. package/dist/{stdio-BvL8HGYW.js.map → stdio-O-m9WVkE.js.map} +1 -1
  68. package/dist/{stdio-loader-CjfoqBle.js → stdio-loader-BSGQmG4L.js} +2 -2
  69. package/dist/{stdio-loader-CjfoqBle.js.map → stdio-loader-BSGQmG4L.js.map} +1 -1
  70. package/dist/{tool-formatters-DPQjso_C.d.ts → tool-formatters-gFqQbzPY.d.ts} +2 -2
  71. package/dist/{tool-formatters-DPQjso_C.d.ts.map → tool-formatters-gFqQbzPY.d.ts.map} +1 -1
  72. package/dist/tools/fetch-url.d.ts +1 -1
  73. package/dist/tools/web-search.d.ts +1 -1
  74. package/dist/tools.d.ts +1 -1
  75. package/dist/tools.js +1 -1
  76. package/dist/{transcript-anchors-CgDzYin1.js → transcript-anchors-D4IxJifV.js} +42 -5
  77. package/dist/transcript-anchors-D4IxJifV.js.map +1 -0
  78. package/dist/{transcript-anchors-BCUpbNxc.d.ts → transcript-anchors-qCs3wZpu.d.ts} +98 -92
  79. package/dist/transcript-anchors-qCs3wZpu.d.ts.map +1 -0
  80. package/dist/tui.d.ts +38 -4
  81. package/dist/tui.d.ts.map +1 -1
  82. package/dist/tui.js +839 -105
  83. package/dist/tui.js.map +1 -1
  84. package/dist/{turn-operations-Bu2Hkinw.d.ts → turn-operations-M9-jUyDd.d.ts} +3 -3
  85. package/dist/{turn-operations-Bu2Hkinw.d.ts.map → turn-operations-M9-jUyDd.d.ts.map} +1 -1
  86. package/dist/types-BIarq1qE.js.map +1 -1
  87. package/dist/types.d.ts +1 -1
  88. package/docs/PLUGINS.md +340 -0
  89. package/docs/RESTATE.md +69 -3
  90. package/docs/SKILL.md +24 -8
  91. package/package.json +6 -1
  92. package/dist/agent-8sUadp5M.js.map +0 -1
  93. package/dist/index-C-Nd2ZbV.d.ts.map +0 -1
  94. package/dist/mcp-3GXUBwur.js.map +0 -1
  95. package/dist/resolve-CZJxds85.js.map +0 -1
  96. package/dist/skills-Dd6XCi4s.js +0 -420
  97. package/dist/skills-Dd6XCi4s.js.map +0 -1
  98. package/dist/transcript-anchors-BCUpbNxc.d.ts.map +0 -1
  99. package/dist/transcript-anchors-CgDzYin1.js.map +0 -1
@@ -10,11 +10,12 @@ import { i as isOutputExceededMessage } from "./output-cap-C9zukcCj.js";
10
10
  import { r as createProcessContext, t as resolveDetachedTasksCapability } from "./contexts-DWVt7MvF.js";
11
11
  import { n as shellQuote, t as alwaysQuote } from "./shell-quote-BmnhZmdM.js";
12
12
  import { a as AgentProviderError, d as isAbortLikeError, h as toTypedError, i as AgentLengthResumeExhaustedError, n as AgentBudgetExceededError, s as AgentToolPairingError, t as AgentAbortedError, u as errorMessage } from "./errors-BwBxu3zD.js";
13
- import { C as stripShellInterpolations, O as validateResourcePathReal, S as interpolateShellCommands, _ as lastLine, b as resolveSubdirRoot, d as installAllowedToolsGate, f as createSkillActivationState, g as fetchInstallSource, h as defaultWhich, j as projectUserPaths, l as buildCatalog, m as defaultExec, p as InstallSourceError, t as resolveSkills, v as parseInstallSource, x as escapeXml, y as resolveNpmVersion } from "./resolve-CZJxds85.js";
13
+ import { A as createSkillActivationState, D as escapeXml, E as buildCatalog, F as validateResourcePathReal, R as projectUserPaths, _ as lastLine, a as interpolateShellCommands, b as resolveSubdirRoot, g as fetchInstallSource, h as defaultWhich, k as installAllowedToolsGate, m as defaultExec, n as resolveSkills, o as stripShellInterpolations, p as InstallSourceError, v as parseInstallSource, y as resolveNpmVersion } from "./skills-Cp9vnBwd.js";
14
14
  import { n as writeFileAtomicAsync, t as writeFileAtomic } from "./atomic-write-B7zr1ddF.js";
15
+ import { p as resolveStorageDirs, r as loadAgentPlugin } from "./plugins-2PMTVcp-.js";
15
16
  import { r as createLogger, t as consoleSink } from "./logger-DBX9uYOw.js";
16
17
  import { n as reconcileImageMediaType } from "./media-sniff-UKijEaiQ.js";
17
- import { d as wrapDiscoveredMcpTools, i as deriveMcpToolMeta, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-3GXUBwur.js";
18
+ import { f as wrapDiscoveredMcpTools, i as deriveMcpToolMeta, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-D27rP47I.js";
18
19
  import { M as buildPromptMessage, N as canonicalizePrompt } from "./openai-compat-B3c_hzwf.js";
19
20
  import { appendStaticSection, renderSystemForWire } from "./prompt.js";
20
21
  import { a as detectTurnInterruption, c as ensureToolResultPairing, l as filterUnresolvedToolUses, m as resolveContentRefsInMessages, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, p as remintDuplicateToolCallIds, s as ensureEndsWithUserMessage } from "./messages-C01kKGj0.js";
@@ -1224,6 +1225,43 @@ function defineExtension(definition) {
1224
1225
  return definition;
1225
1226
  }
1226
1227
  //#endregion
1228
+ //#region src/debug-log.ts
1229
+ /**
1230
+ * `ZIDANE_DEBUG`-gated diagnostic logging.
1231
+ *
1232
+ * The three subsystems that need this (TUI shell, discovery, extension
1233
+ * scanning) each had their own three-line copy, differing only in the scope
1234
+ * label and — accidentally — in sink and formatting: one used `console.error`
1235
+ * with a raw error object, two used `process.stderr.write` with
1236
+ * {@link errorMessage}. The label is a real per-module difference, so it's a
1237
+ * parameter; the rest was drift.
1238
+ *
1239
+ * Distinct from `./logger`, which is the structured, sink-backed `Logger`
1240
+ * surfaced to extensions and hosts. This is the unstructured "print it when
1241
+ * debugging" path: no levels, no sinks, off unless `ZIDANE_DEBUG` is set, and
1242
+ * always stderr so it can never corrupt stdout for a piped host.
1243
+ */
1244
+ /**
1245
+ * Build a debug logger scoped to a subsystem. Emits
1246
+ * `[zidane/<scope>] <label>: <details…>` on stderr when `ZIDANE_DEBUG` is set,
1247
+ * and is a no-op otherwise.
1248
+ *
1249
+ * `details` are flattened through {@link errorMessage}, so an `Error` prints
1250
+ * its message rather than `[object Object]` and plain strings pass through.
1251
+ *
1252
+ * The env var is read per call rather than captured at module load so a test
1253
+ * (or a host toggling it at runtime) sees the change; the check is a property
1254
+ * read on an already-materialized object, so the cost is irrelevant next to
1255
+ * the I/O it guards.
1256
+ */
1257
+ function createDebugLog(scope) {
1258
+ return (label, ...details) => {
1259
+ if (!process.env.ZIDANE_DEBUG) return;
1260
+ const tail = details.length > 0 ? `: ${details.map(errorMessage).join(" ")}` : "";
1261
+ process.stderr.write(`[zidane/${scope}] ${label}${tail}\n`);
1262
+ };
1263
+ }
1264
+ //#endregion
1227
1265
  //#region src/extensions/with-timeout.ts
1228
1266
  /**
1229
1267
  * Internal: race a promise against a timeout. Shared by the discovery
@@ -1246,6 +1284,11 @@ function withTimeout(promise, timeoutMs, message, onTimeout) {
1246
1284
  //#endregion
1247
1285
  //#region src/extensions/discovery.ts
1248
1286
  /**
1287
+ * Scoped `ZIDANE_DEBUG` logger. A `const` rather than a hoisted function
1288
+ * declaration, so it must precede its call sites.
1289
+ */
1290
+ const debugLog = createDebugLog("extensions");
1291
+ /**
1249
1292
  * Entry-point filenames probed inside each `<name>/` directory, in
1250
1293
  * preference order. Bun loads `.ts` / `.tsx` natively; `.mjs` / `.js`
1251
1294
  * are accepted so pre-compiled extensions (or vibe-coded JS-only ones)
@@ -1657,9 +1700,6 @@ function isExtensionManifest(value) {
1657
1700
  const isStringArray = (x) => Array.isArray(x) && x.every((el) => typeof el === "string");
1658
1701
  return (v.name === void 0 || typeof v.name === "string") && (v.displayName === void 0 || typeof v.displayName === "string") && (v.description === void 0 || typeof v.description === "string") && (v.permissions === void 0 || isStringArray(v.permissions)) && (v.capabilities === void 0 || isStringArray(v.capabilities));
1659
1702
  }
1660
- function debugLog(label, err) {
1661
- if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/extensions] ${label}: ${errorMessage(err)}\n`);
1662
- }
1663
1703
  //#endregion
1664
1704
  //#region src/extensions/host-modules.ts
1665
1705
  const registered = /* @__PURE__ */ new Set();
@@ -2318,86 +2358,6 @@ function stripJsonComments(input) {
2318
2358
  return out;
2319
2359
  }
2320
2360
  //#endregion
2321
- //#region src/chat/xdg.ts
2322
- /**
2323
- * XDG Base Directory resolution for zidane.
2324
- *
2325
- * The user's storage spreads across four logical slots:
2326
- *
2327
- * - **config** — credentials, mcp-credentials, keybindings, config.json,
2328
- * mcps.json, skills (user-editable surface).
2329
- * - **data** — sessions.db (long-lived chat history).
2330
- * - **state** — state.json (per-machine UI bookkeeping: last provider,
2331
- * last model, last agent, settings).
2332
- * - **cache** — persisted tool results, background-task logs,
2333
- * auto-update registry cache (regenerable, safe to wipe).
2334
- *
2335
- * Historically all four collapsed to `~/.zidane/`. This module adds
2336
- * XDG-Base-Directory-aware defaults so a Linux user with no existing
2337
- * `~/.zidane/` lands in the conventional `~/.config/zidane/`,
2338
- * `~/.local/share/zidane/`, `~/.local/state/zidane/`, `~/.cache/zidane/`
2339
- * trio. Existing setups (anyone with a `~/.zidane/` directory or
2340
- * `ZIDANE_STORAGE_DIR` set) keep the single-dir layout unchanged.
2341
- *
2342
- * Resolution flow — applied in this order:
2343
- *
2344
- * 1. Caller passed an explicit `storageDir` (`ChatOptions.storageDir`)
2345
- * OR `ZIDANE_STORAGE_DIR` is set → **legacy-explicit** single-dir
2346
- * layout under `<storageDir>/<prefix>`. The four slots collapse to
2347
- * the same directory.
2348
- * 2. `~/<prefix>/` already exists on disk → **legacy-existing**
2349
- * single-dir layout under that directory. Upgrades never silently
2350
- * shift files around.
2351
- * 3. Any `XDG_*_HOME` env var is set OR `process.platform === 'linux'`
2352
- * → **XDG split**. Each slot lands in its own dir. Per-slot
2353
- * `ZIDANE_{CONFIG,DATA,CACHE,STATE}_DIR` overrides beat the XDG
2354
- * vars for surgical tweaks.
2355
- * 4. Otherwise (macOS/Windows, no XDG signal, no existing dir) →
2356
- * **default** single-dir layout at `~/<prefix>/`. Day-one behavior
2357
- * on these platforms is unchanged.
2358
- *
2359
- * The `userDir` legacy alias always equals `configDir` so existing code
2360
- * that still references `paths.userDir` keeps reading credentials, mcps,
2361
- * etc. from the right place.
2362
- */
2363
- /**
2364
- * Resolve the four storage slots according to the precedence above.
2365
- *
2366
- * Pure aside from one filesystem probe (`existsSync(home/<prefix>)`)
2367
- * — the same probe `resolveStoragePaths` would do anyway when
2368
- * computing `paths.userDir`. No directories are created here; the
2369
- * relevant write paths (state store, credentials writer, persist
2370
- * dir) handle their own lazy `mkdirSync` already.
2371
- */
2372
- function resolveStorageDirs(opts = {}) {
2373
- const env = opts.env ?? process.env;
2374
- const home = opts.home ?? homedir();
2375
- const platform = opts.platform ?? process.platform;
2376
- const rawPrefix = opts.prefix ?? ".zidane";
2377
- const prefixBare = rawPrefix.replace(/^\./, "");
2378
- const explicitStorageDir = opts.storageDir ?? env.ZIDANE_STORAGE_DIR;
2379
- if (explicitStorageDir) return single(resolve(explicitStorageDir, rawPrefix), "legacy-explicit");
2380
- const legacyHomeDir = resolve(home, rawPrefix);
2381
- if (existsSync(legacyHomeDir)) return single(legacyHomeDir, "legacy-existing");
2382
- if (platform === "linux" || !!env.XDG_CONFIG_HOME || !!env.XDG_DATA_HOME || !!env.XDG_CACHE_HOME || !!env.XDG_STATE_HOME || !!env.ZIDANE_CONFIG_DIR || !!env.ZIDANE_DATA_DIR || !!env.ZIDANE_STATE_DIR || !!env.ZIDANE_CACHE_DIR) return {
2383
- configDir: env.ZIDANE_CONFIG_DIR ?? resolve(env.XDG_CONFIG_HOME || resolve(home, ".config"), prefixBare),
2384
- dataDir: env.ZIDANE_DATA_DIR ?? resolve(env.XDG_DATA_HOME || resolve(home, ".local", "share"), prefixBare),
2385
- stateDir: env.ZIDANE_STATE_DIR ?? resolve(env.XDG_STATE_HOME || resolve(home, ".local", "state"), prefixBare),
2386
- cacheDir: env.ZIDANE_CACHE_DIR ?? resolve(env.XDG_CACHE_HOME || resolve(home, ".cache"), prefixBare),
2387
- mode: "xdg"
2388
- };
2389
- return single(legacyHomeDir, "default");
2390
- }
2391
- function single(base, mode) {
2392
- return {
2393
- configDir: base,
2394
- dataDir: base,
2395
- stateDir: base,
2396
- cacheDir: base,
2397
- mode
2398
- };
2399
- }
2400
- //#endregion
2401
2361
  //#region src/tools/path-suggest.ts
2402
2362
  function entryPath$2(entry) {
2403
2363
  return typeof entry === "string" ? entry : entry.path;
@@ -5444,6 +5404,7 @@ function buildSpawnTool(options, state) {
5444
5404
  }, state);
5445
5405
  },
5446
5406
  isConcurrencySafe: true,
5407
+ runsNestedAgent: true,
5447
5408
  spec: {
5448
5409
  name: "spawn",
5449
5410
  description: `Spawn a sub-agent for a self-contained task that benefits from isolation (separate context window, separate retries): for example, a deep research dive or a long codegen pass on a specific file. The sub-agent inherits your tool set (including \`spawn\` itself, depth-capped) and your system prompt unless overridden, runs independently, and returns its final response. Do NOT spawn for sequential steps you could do yourself.${modelCatalog ? " Children can run on a DIFFERENT model via the `model` field: cost-tier your delegation: mechanical, parallelizable, or high-volume search work belongs on cheaper/faster models, while synthesis and judgment stay on your own model." : ""}${options.persist ? " A stopped or failed sub-agent can be CONTINUED instead of restarted: pass `resume` with its child label (e.g. \"child-2\") and put the continuation instruction in `task`; the child picks up with its prior conversation intact." : ""}`,
@@ -5585,15 +5546,31 @@ function buildSpawnTool(options, state) {
5585
5546
  ...ctx.behavior !== void 0 ? { behavior: ctx.behavior } : {}
5586
5547
  };
5587
5548
  const sharedReadState = options.shareReadState ? resolveReadStateMap(ctx) : void 0;
5549
+ const journaledDeadlineMs = ctx.clock?.journaled === true && options.timeoutMs !== void 0 && options.timeoutMs > 0 ? options.timeoutMs : void 0;
5588
5550
  const agent = createAgent({
5589
5551
  ...parentPreset,
5590
5552
  ...options.preset,
5591
5553
  ...inheritedMcp.mcpConnector !== void 0 && options.preset?.mcpServers === void 0 ? { mcpConnector: inheritedMcp.mcpConnector } : {},
5592
5554
  provider: childProvider,
5593
5555
  execution: ctx.execution,
5556
+ ...ctx.clock ? { clock: ctx.clock } : {},
5557
+ ...options.shareHandle && ctx.handle ? { handle: ctx.handle } : {},
5594
5558
  ...options.persist && ctx.session ? { session: ctx.session } : {},
5595
5559
  ...sharedReadState ? { readState: sharedReadState } : {}
5596
5560
  });
5561
+ let reportedStats;
5562
+ agent.hooks.hook("agent:done", (stats) => {
5563
+ reportedStats = stats;
5564
+ });
5565
+ const nowMs = () => ctx.clock ? ctx.clock.now() : Date.now();
5566
+ const spawnStartedMs = await nowMs();
5567
+ let deadlineExceeded = false;
5568
+ if (journaledDeadlineMs !== void 0) agent.hooks.hook("turn:after", (turnCtx) => {
5569
+ if (deadlineExceeded) return;
5570
+ if (turnCtx.message.createdAt - spawnStartedMs < journaledDeadlineMs) return;
5571
+ deadlineExceeded = true;
5572
+ agent.abort();
5573
+ });
5597
5574
  if (forwardHooks) {
5598
5575
  const unregisterEnricher = agent.hooks.hook("tool:before", async (toolCtx) => {
5599
5576
  if (toolCtx.name !== "write_file" && toolCtx.name !== "edit" && toolCtx.name !== "multi_edit") return;
@@ -5614,6 +5591,7 @@ function buildSpawnTool(options, state) {
5614
5591
  const spawnHookCtx = {
5615
5592
  id,
5616
5593
  task,
5594
+ ...ctx.callId ? { callId: ctx.callId } : {},
5617
5595
  ...resumeLabel !== void 0 ? { resumesChildId: resumeLabel } : {},
5618
5596
  depth: childDepth,
5619
5597
  model: announcedModel,
@@ -5631,48 +5609,54 @@ function buildSpawnTool(options, state) {
5631
5609
  signal: ctx.signal,
5632
5610
  depth: childDepth,
5633
5611
  ...options.persist && ctx.runId ? { parentRunId: ctx.runId } : {},
5612
+ ...ctx.callId ? { parentCallId: ctx.callId } : {},
5634
5613
  ...options.persist && ctx.session ? { runLabel: id } : {},
5635
5614
  ...resumeRun ? { resumeRunId: resumeRun.id } : {},
5636
5615
  ...propagatedTracing ? { tracingContext: propagatedTracing } : {}
5637
5616
  });
5638
5617
  try {
5639
- finalStats = await raceWithTimeout(runPromise, options.timeoutMs);
5618
+ finalStats = await raceWithTimeout(runPromise, journaledDeadlineMs === void 0 ? options.timeoutMs : void 0);
5640
5619
  const treeTurns = flattenTurns(finalStats).length;
5641
5620
  const usage = formatTokenUsage(finalStats);
5642
- if (ctx.signal.aborted) {
5621
+ const elapsedMs = await nowMs() - spawnStartedMs;
5622
+ if (deadlineExceeded) {
5623
+ childRunStatus = "timeout";
5624
+ result = `[sub-agent ${id}] Timed out after ${journaledDeadlineMs}ms`;
5625
+ } else if (ctx.signal.aborted) {
5643
5626
  childRunStatus = "aborted";
5644
- result = [`[sub-agent ${id}] Aborted after ${treeTurns} turns (${finalStats.elapsed}ms)`, `Tokens: ${usage}`].join("\n");
5627
+ result = [`[sub-agent ${id}] Aborted after ${treeTurns} turns (${elapsedMs}ms)`, `Tokens: ${usage}`].join("\n");
5645
5628
  } else {
5646
5629
  const response = extractText(agent.turns.at(-1));
5647
5630
  responseText = response ?? "";
5648
5631
  result = [
5649
- `[sub-agent ${id}] Completed in ${treeTurns} turns (${finalStats.elapsed}ms)`,
5632
+ `[sub-agent ${id}] Completed in ${treeTurns} turns (${elapsedMs}ms)`,
5650
5633
  `Tokens: ${usage}`,
5651
5634
  "",
5652
5635
  response || "(no text response)"
5653
5636
  ].join("\n");
5654
5637
  }
5655
5638
  } catch (err) {
5656
- if (err instanceof SpawnTimeoutError) {
5639
+ const timedOutAfterMs = err instanceof SpawnTimeoutError ? err.timeoutMs : deadlineExceeded ? journaledDeadlineMs : void 0;
5640
+ if (timedOutAfterMs !== void 0) {
5657
5641
  childRunStatus = "timeout";
5658
5642
  agent.abort();
5659
5643
  try {
5660
5644
  finalStats = await runPromise;
5661
5645
  } catch {
5662
- finalStats = {
5646
+ finalStats = reportedStats ?? {
5663
5647
  totalIn: 0,
5664
5648
  totalOut: 0,
5665
5649
  totalCacheRead: 0,
5666
5650
  totalCacheCreation: 0,
5667
5651
  turns: 0,
5668
- elapsed: err.timeoutMs
5652
+ elapsed: timedOutAfterMs
5669
5653
  };
5670
5654
  }
5671
- result = `[sub-agent ${id}] Timed out after ${err.timeoutMs}ms`;
5655
+ result = `[sub-agent ${id}] Timed out after ${timedOutAfterMs}ms`;
5672
5656
  } else {
5673
5657
  const error = err instanceof Error ? err : new Error(String(err));
5674
5658
  childRunStatus = "error";
5675
- finalStats = {
5659
+ finalStats = reportedStats ?? {
5676
5660
  totalIn: 0,
5677
5661
  totalOut: 0,
5678
5662
  totalCacheRead: 0,
@@ -5684,6 +5668,7 @@ function buildSpawnTool(options, state) {
5684
5668
  await ctx.hooks.callHook("spawn:error", {
5685
5669
  id,
5686
5670
  task,
5671
+ ...ctx.callId ? { callId: ctx.callId } : {},
5687
5672
  depth: childDepth,
5688
5673
  model: announcedModel,
5689
5674
  provider: childProvider.name,
@@ -5692,7 +5677,7 @@ function buildSpawnTool(options, state) {
5692
5677
  }
5693
5678
  } finally {
5694
5679
  const childHandle = agent.handle;
5695
- if (childHandle && ctx.execution.reassignBackgroundTasks) try {
5680
+ if (childHandle && childHandle.id !== ctx.handle.id && ctx.execution.reassignBackgroundTasks) try {
5696
5681
  const reassigned = await ctx.execution.reassignBackgroundTasks(childHandle, ctx.handle, (info) => {
5697
5682
  Promise.resolve(ctx.hooks.callHook("background:exit", info)).catch(() => {});
5698
5683
  });
@@ -5726,6 +5711,7 @@ function buildSpawnTool(options, state) {
5726
5711
  const childRunStats = {
5727
5712
  id,
5728
5713
  task,
5714
+ ...ctx.callId ? { callId: ctx.callId } : {},
5729
5715
  stats: finalStats,
5730
5716
  depth: childDepth,
5731
5717
  status: childRunStatus,
@@ -5736,6 +5722,7 @@ function buildSpawnTool(options, state) {
5736
5722
  if (destroyError) await ctx.hooks.callHook("spawn:error", {
5737
5723
  id,
5738
5724
  task,
5725
+ ...ctx.callId ? { callId: ctx.callId } : {},
5739
5726
  depth: childDepth,
5740
5727
  model: announcedModel,
5741
5728
  provider: childProvider.name,
@@ -6262,6 +6249,58 @@ function warnUnsafeKey(logger, method, key) {
6262
6249
  logger.warn(`${method}: refused unsafe key`, { key });
6263
6250
  }
6264
6251
  /**
6252
+ * Resolve a path inside one extension's storage root for the given scope.
6253
+ *
6254
+ * A module-level function (rather than a closure inside `makeContext`) so
6255
+ * `ctx.loadAgentPlugin` can derive its `${PLUGIN_DATA}` parent from the same
6256
+ * rules without depending on declaration order within the context builder.
6257
+ */
6258
+ function extensionStoragePath(paths, extensionName, scope, ...segments) {
6259
+ const root = resolve(scope === "cache" ? paths.cacheDir : scope === "data" ? paths.dataDir : scope === "project" || scope === "session" ? paths.projectRoot ?? paths.dataDir : paths.configDir ?? paths.dataDir, "extensions", extensionName);
6260
+ const target = resolve(root, ...segments);
6261
+ if (target !== root && !target.startsWith(root + sep)) return root;
6262
+ return target;
6263
+ }
6264
+ /**
6265
+ * Stamp the contributing extension onto a skill.
6266
+ *
6267
+ * `SkillConfig.source` carries the scope (project / user / inline) and is
6268
+ * defaulted here for extensions that don't set it. The extension NAME goes in
6269
+ * `metadata` under the `zidane.` prefix the Agent Skills spec reserves for
6270
+ * client-specific keys, so the skill stays spec-conformant while a host UI can
6271
+ * still say which extension shipped it.
6272
+ */
6273
+ function withProvenance(skill, source, extensionName) {
6274
+ return {
6275
+ ...skill,
6276
+ source: skill.source ?? source,
6277
+ metadata: {
6278
+ ...skill.metadata,
6279
+ "zidane.extension": extensionName
6280
+ }
6281
+ };
6282
+ }
6283
+ /**
6284
+ * Rejected-plugin placeholder for `ctx.loadAgentPlugin` calls that never
6285
+ * reach the loader (missing `dir`, or a late call after `setup` resolved).
6286
+ * Returning a `LoadedPlugin` with `ok: false` rather than throwing keeps the
6287
+ * method's contract uniform — callers branch on `ok`, never on exceptions.
6288
+ */
6289
+ function emptyPluginHandle(dir) {
6290
+ return {
6291
+ ok: false,
6292
+ dir,
6293
+ root: dir,
6294
+ skills: [],
6295
+ mcpServers: [],
6296
+ components: {
6297
+ skills: "unsupported",
6298
+ mcp: "unsupported"
6299
+ },
6300
+ diagnostics: []
6301
+ };
6302
+ }
6303
+ /**
6265
6304
  * Build the merged registry. `loaded` typically comes from
6266
6305
  * `discoverExtensions()` plus any inline ones via `inlineLoadedExtension`.
6267
6306
  *
@@ -6307,6 +6346,7 @@ async function buildExtensionRegistry(loaded, options = {}) {
6307
6346
  hooks: {},
6308
6347
  mcpServers: [],
6309
6348
  skills: [],
6349
+ plugins: [],
6310
6350
  systemFragments: [],
6311
6351
  contextBreakdownSections: [],
6312
6352
  contextPanelSections: [],
@@ -6467,6 +6507,7 @@ function captureContributions(perExtSinks) {
6467
6507
  hooks: perExtSinks.hooks,
6468
6508
  mcpServers: perExtSinks.mcpServers,
6469
6509
  skills: perExtSinks.skills,
6510
+ plugins: perExtSinks.plugins,
6470
6511
  systemFragments: perExtSinks.systemFragments,
6471
6512
  contextBreakdownSections: perExtSinks.contextBreakdownSections,
6472
6513
  contextPanelSections: perExtSinks.contextPanelSections,
@@ -6544,6 +6585,7 @@ function mergeContributions(active, inactive = [], options = {}) {
6544
6585
  const hooks = {};
6545
6586
  const mcpServers = [];
6546
6587
  const skills = [];
6588
+ const plugins = [];
6547
6589
  const systemFragments = [];
6548
6590
  const contextBreakdownSections = [];
6549
6591
  const contextPanelSections = [];
@@ -6586,6 +6628,7 @@ function mergeContributions(active, inactive = [], options = {}) {
6586
6628
  }
6587
6629
  mcpServers.push(...c.mcpServers);
6588
6630
  skills.push(...c.skills);
6631
+ plugins.push(...c.plugins);
6589
6632
  systemFragments.push(...c.systemFragments);
6590
6633
  contextBreakdownSections.push(...c.contextBreakdownSections);
6591
6634
  contextPanelSections.push(...c.contextPanelSections);
@@ -6659,6 +6702,7 @@ function mergeContributions(active, inactive = [], options = {}) {
6659
6702
  hooks,
6660
6703
  mcpServers,
6661
6704
  skills,
6705
+ plugins,
6662
6706
  systemFragments,
6663
6707
  contextBreakdownSections,
6664
6708
  contextPanelSections,
@@ -6777,6 +6821,46 @@ function filterExtensionRegistry(registry, enabled) {
6777
6821
  const filteredOut = registry.loaded.filter((ext) => !allow.has(ext.name));
6778
6822
  return mergeContributions(filteredActive, [...registry.inactive, ...filteredOut]);
6779
6823
  }
6824
+ /**
6825
+ * Drop the contributions of Agent Plugins the user has disabled.
6826
+ *
6827
+ * `filterExtensionRegistry` keys on EXTENSION names, so it can't express
6828
+ * "this extension runs, but the plugin it loaded does not". Plugin skills and
6829
+ * MCP servers are fanned into the loading extension's sinks by
6830
+ * `ctx.loadAgentPlugin`, which means without this pass `enabledPlugins` would
6831
+ * render a checkbox that changes nothing for extension-loaded plugins.
6832
+ *
6833
+ * Skills are matched by `metadata['zidane.plugin']` (stamped by the loader);
6834
+ * MCP servers carry no such marker, so they're matched by identity against
6835
+ * the server list on each {@link LoadedPluginRecord}.
6836
+ *
6837
+ * Returns the input registry unchanged when nothing is disabled, so callers
6838
+ * can compare identity to skip recomposing.
6839
+ */
6840
+ function filterRegistryPlugins(registry, enabledPlugins, shadowed) {
6841
+ if (registry.plugins.length === 0) return registry;
6842
+ const allow = enabledPlugins === void 0 ? null : new Set(enabledPlugins);
6843
+ const dropped = registry.plugins.filter((record) => allow !== null && !allow.has(record.name) || shadowed?.has(record.name) === true);
6844
+ if (dropped.length === 0) return registry;
6845
+ const droppedNames = new Set(dropped.map((record) => record.name));
6846
+ const droppedServers = new Set(dropped.flatMap((record) => record.plugin.mcpServers));
6847
+ const prune = (ext) => {
6848
+ const contributions = ext.contributions;
6849
+ if (!contributions || contributions.plugins.length === 0) return ext;
6850
+ return {
6851
+ ...ext,
6852
+ contributions: {
6853
+ ...contributions,
6854
+ skills: contributions.skills.filter((skill) => {
6855
+ const owner = skill.metadata?.["zidane.plugin"];
6856
+ return owner === void 0 || !droppedNames.has(owner);
6857
+ }),
6858
+ mcpServers: contributions.mcpServers.filter((server) => !droppedServers.has(server))
6859
+ }
6860
+ };
6861
+ };
6862
+ return mergeContributions(registry.loaded.map(prune), registry.inactive);
6863
+ }
6780
6864
  /** Dispose resources owned by an extension registry. Idempotent per registry. */
6781
6865
  async function disposeExtensionRegistry(registry) {
6782
6866
  await registry.dispose();
@@ -6845,10 +6929,50 @@ function makeContext(opts) {
6845
6929
  logger.warn("registerSkill: missing name");
6846
6930
  return;
6847
6931
  }
6848
- sinks.skills.push({
6849
- ...skill,
6850
- source: skill.source ?? source
6932
+ sinks.skills.push(withProvenance(skill, source, definition.name));
6933
+ };
6934
+ const loadPlugin = async (spec) => {
6935
+ const options = typeof spec === "string" ? { dir: spec } : spec;
6936
+ const requested = options?.dir;
6937
+ if (typeof requested !== "string" || requested.length === 0) {
6938
+ logger.warn("loadAgentPlugin: missing dir");
6939
+ return emptyPluginHandle("");
6940
+ }
6941
+ if (!guardOpen("loadAgentPlugin")) return emptyPluginHandle(requested);
6942
+ const target = isAbsolute(requested) ? requested : resolve(dir ?? paths.cwd, requested);
6943
+ const loaded = await loadAgentPlugin(target, {
6944
+ source,
6945
+ dataRoot: extensionStoragePath(paths, definition.name, "data", "plugin-data"),
6946
+ ...options.skills !== void 0 ? { skills: options.skills } : {},
6947
+ ...options.mcp !== void 0 ? { mcp: options.mcp } : {},
6948
+ ...options.namePrefix !== void 0 ? { namePrefix: options.namePrefix } : {}
6851
6949
  });
6950
+ for (const diagnostic of loaded.diagnostics) {
6951
+ const detail = {
6952
+ plugin: loaded.manifest?.name ?? target,
6953
+ code: diagnostic.code,
6954
+ ...diagnostic.path ? { path: diagnostic.path } : {}
6955
+ };
6956
+ if (diagnostic.severity === "error") logger.error(`loadAgentPlugin: ${diagnostic.message}`, detail);
6957
+ else logger.warn(`loadAgentPlugin: ${diagnostic.message}`, detail);
6958
+ }
6959
+ if (!guardOpen("loadAgentPlugin (completed after setup resolved)")) return loaded;
6960
+ if (loaded.ok) {
6961
+ for (const skill of loaded.skills) sinks.skills.push(withProvenance(skill, source, definition.name));
6962
+ for (const config of loaded.mcpServers) sinks.mcpServers.push(config);
6963
+ }
6964
+ sinks.plugins.push({
6965
+ name: loaded.manifest?.name ?? basename(target),
6966
+ extensionName: definition.name,
6967
+ dir: target,
6968
+ plugin: loaded
6969
+ });
6970
+ logger.debug("loadAgentPlugin: registered", {
6971
+ plugin: loaded.manifest?.name,
6972
+ skills: loaded.skills.length,
6973
+ mcpServers: loaded.mcpServers.length
6974
+ });
6975
+ return loaded;
6852
6976
  };
6853
6977
  const registerCompletionProvider = (provider) => {
6854
6978
  if (!guardOpen("registerCompletionProvider")) return;
@@ -7231,12 +7355,7 @@ function makeContext(opts) {
7231
7355
  const persisted = readSettings?.()?.extensionConfig?.[definition.name]?.[key];
7232
7356
  return resolveExtensionConfigValue(item, persisted);
7233
7357
  } };
7234
- const storageSurface = { path: (scope, ...segments) => {
7235
- const root = resolve(scope === "cache" ? paths.cacheDir : scope === "data" ? paths.dataDir : scope === "project" || scope === "session" ? paths.projectRoot ?? paths.dataDir : paths.configDir ?? paths.dataDir, "extensions", definition.name);
7236
- const target = resolve(root, ...segments);
7237
- if (target !== root && !target.startsWith(root + sep)) return root;
7238
- return target;
7239
- } };
7358
+ const storageSurface = { path: (scope, ...segments) => extensionStoragePath(paths, definition.name, scope, ...segments) };
7240
7359
  const sessionSurface = {
7241
7360
  get: (key) => getExtensionSessionState(currentExtensionSession(), definition.name, key),
7242
7361
  set: (key, value) => setExtensionSessionState(currentExtensionSession(), definition.name, key, value),
@@ -7347,6 +7466,7 @@ function makeContext(opts) {
7347
7466
  registerHook,
7348
7467
  registerMcpServer,
7349
7468
  registerSkill,
7469
+ loadAgentPlugin: loadPlugin,
7350
7470
  registerCompletionProvider,
7351
7471
  registerInlineAutocompleteProvider,
7352
7472
  registerCommand,
@@ -7997,6 +8117,7 @@ const EMPTY_EXTENSION_REGISTRY = Object.freeze({
7997
8117
  hooks: Object.freeze({}),
7998
8118
  mcpServers: Object.freeze([]),
7999
8119
  skills: Object.freeze([]),
8120
+ plugins: Object.freeze([]),
8000
8121
  systemFragments: Object.freeze([]),
8001
8122
  contextBreakdownSections: Object.freeze([]),
8002
8123
  contextPanelSections: Object.freeze([]),
@@ -12511,6 +12632,7 @@ function buildToolHookBase(ctx, turnId, callId, name, displayName, input) {
12511
12632
  input,
12512
12633
  ...ctx.runId !== void 0 ? { runId: ctx.runId } : {},
12513
12634
  ...ctx.parentRunId !== void 0 ? { parentRunId: ctx.parentRunId } : {},
12635
+ ...ctx.parentCallId !== void 0 ? { parentCallId: ctx.parentCallId } : {},
12514
12636
  ...typeof ctx.depth === "number" ? { depth: ctx.depth } : {}
12515
12637
  };
12516
12638
  }
@@ -12722,6 +12844,7 @@ async function runSingleToolDispatch(ctx, call, turnId, fixed) {
12722
12844
  callId,
12723
12845
  runId: ctx.runId,
12724
12846
  ...ctx.parentRunId !== void 0 ? { parentRunId: ctx.parentRunId } : {},
12847
+ ...ctx.parentCallId !== void 0 ? { parentCallId: ctx.parentCallId } : {},
12725
12848
  ...ctx.session ? { session: ctx.session } : {},
12726
12849
  ...ctx.readState ? { readState: ctx.readState } : {},
12727
12850
  ...ctx.toolState ? { state: ctx.toolState.begin(callId) } : {},
@@ -13322,6 +13445,7 @@ async function startDurableToolExecution(ctx, call, turnId, index) {
13322
13445
  callId,
13323
13446
  runId: ctx.runId,
13324
13447
  ...ctx.parentRunId !== void 0 ? { parentRunId: ctx.parentRunId } : {},
13448
+ ...ctx.parentCallId !== void 0 ? { parentCallId: ctx.parentCallId } : {},
13325
13449
  ...ctx.session ? { session: ctx.session } : {},
13326
13450
  ...ctx.readState ? { readState: ctx.readState } : {},
13327
13451
  ...ctx.toolState ? { state: ctx.toolState.begin(callId) } : {},
@@ -15406,6 +15530,7 @@ function createAgent(rawOptions) {
15406
15530
  ...agentReadState ? { readState: agentReadState } : {},
15407
15531
  toolState: toolStateController,
15408
15532
  ...options.parentRunId ? { parentRunId: options.parentRunId } : {},
15533
+ ...options.parentCallId ? { parentCallId: options.parentCallId } : {},
15409
15534
  depth: runDepth,
15410
15535
  thinkingBudget,
15411
15536
  ...taskBudget !== void 0 ? { taskBudget } : {},
@@ -16024,6 +16149,6 @@ function createAgent(rawOptions) {
16024
16149
  };
16025
16150
  }
16026
16151
  //#endregion
16027
- export { removeInstalledExtension as $, readKeybindings as $t, NO_TOOLS_PREAMBLE as A, looksBinary as At, stripImagesFromTurns as B, validateToolArgs as Bt, resolveTasksDir as C, shouldAutoCompact as Cn, createSkillsRunScriptTool as Ct, selectRecentFiles as D, stableStringify as Dn, shell as Dt, selectFilesFromSession as E, normalizeShellCommand as En, createShellTool as Et, buildTailCompactPrompt as F, listFiles as Ft, EMPTY_EXTENSION_REGISTRY as G, KEYBINDING_KEY_COL_WIDTH as Gt, truncateHeadForPtlRetry as H, DEFAULT_KEYBINDINGS as Ht, buildUpToCompactPrompt as I, createInteractionTool as It, fetchExtensionSource as J, groupBindings as Jt, createExtensionPromptBridge as K, ensureKeybindingsFile as Kt, ANCHOR_PREVIEW_MAX_CHARS as L, grep as Lt, buildCompactPrompt as M, createModelSearchTool as Mt, buildFromCompactPrompt as N, formatModelLine as Nt, compactConversation as O, tailTruncate as Ot, buildFullCompactPrompt as P, matchModelEntries as Pt, readExtensionInstallProvenance as Q, parseBindingSpec as Qt, anchorPreviewFor as R, glob as Rt, resolveSessionDir as S, effectiveContextWindow as Sn, createSkillsUseTool as St, selectFilesFromReadState as T, defaultRepeatGuardTracked as Tn, shellKill as Tt, CompactInvalidInputError as U, KEYBINDING_DEFS as Ut, summaryToTurn as V, resolveStorageDirs as Vt, CompactPromptTooLongError as W, KEYBINDING_DEF_BY_ACTION as Wt, listExtensionCandidates as X, matchesBinding as Xt, installExtensionFromSpec as Y, keybindingsPath as Yt, parseExtensionInstallSource as Z, mergeKeybindings as Zt, rehomePersistedStubs as _, resolveExtensionConfigValue as _n, WAIT_TASK_TIMED_OUT_PREFIX as _t, SHELL_CASCADE_CANCEL_MESSAGE as a, defaultExtensionScanPaths as an, composeExtensionPreset as at, resolveMcpWarningsDir as b, AUTO_COMPACT_MIN_GROWTH_FRACTION as bn, createSpawnTool as bt, applyCompactSummaryCutoff as c, isExtensionDefinition as cn, mergeContributions as ct, PERSISTED_STUB_PREFIX as d, defineExtension as dn, createWorkspaceSurface as dt, readKeybindingsRaw as en, updateInstalledExtension as et, PERSISTENCE_PREVIEW_BYTES as f, clampExtensionConfigNumber as fn, composePresets as ft, migrateSessionArtifactDirs as g, resolveExtensionConfig as gn, writeFile$1 as gt, maybePersistToolResult as h, isValidExtensionConfigValue as hn, basic_default as ht, INTERRUPT_MESSAGE_FOR_TOOL_USE as i, ENTRY_CANDIDATES as in, buildExtensionRegistry as it, TRAILER as j, multiEdit as jt, BASE_INSTRUCTIONS as k, readFile$1 as kt, collectNewlyStaleReadPaths as l, parseExtensionScanPathEnv as ln, partitionExtensionCatalog as lt, cleanupPersistedSession as m, isValidExtensionConfigItem as mn, basicTools as mt, normalizeProviders as n, stripJsonComments as nn, discoverAndBuildExtensionRegistry as nt, TOOL_USE_CANCELLED_MESSAGE as o, discoverExtensions as on, disposeExtensionRegistry as ot, buildPersistedStub as p, coerceExtensionConfigInput as pn, definePreset as pt, ExtensionInstallError as q, formatBindingForDisplay as qt, resolveModelTargets as r, registerExtensionHostModules as rn, buildExtensionPreset as rt, TOOL_USE_SKIPPED_MESSAGE as s, inlineLoadedExtension as sn, filterExtensionRegistry as st, createAgent as t, resolveExtensionKeybindings as tn, createExtensionHud as tt, renderStaleReadNotice as u, scanExtensionDirectories as un, createExtensionHostRuntimeBridge as ut, resolveLegacyPersistDir as v, sanitizeExtensionConfigActionPatch as vn, waitTask as vt, buildPostCompactAttachments as w, defaultRepeatGuardNormalize as wn, createSkillsReadTool as wt, resolvePersistDir as x, OUTPUT_RESERVE_TOKENS as xn, isSpawnTool as xt, resolveLegacySessionDir as y, toWireConfigSchema as yn, createToolSearchTool as yt, sliceForCompaction as z, edit as zt };
16152
+ export { removeInstalledExtension as $, readKeybindings as $t, NO_TOOLS_PREAMBLE as A, readFile$1 as At, stripImagesFromTurns as B, edit as Bt, resolveTasksDir as C, effectiveContextWindow as Cn, createSkillsUseTool as Ct, selectRecentFiles as D, normalizeShellCommand as Dn, createShellTool as Dt, selectFilesFromSession as E, defaultRepeatGuardTracked as En, shellKill as Et, buildTailCompactPrompt as F, matchModelEntries as Ft, EMPTY_EXTENSION_REGISTRY as G, KEYBINDING_KEY_COL_WIDTH as Gt, truncateHeadForPtlRetry as H, DEFAULT_KEYBINDINGS as Ht, buildUpToCompactPrompt as I, listFiles as It, fetchExtensionSource as J, groupBindings as Jt, createExtensionPromptBridge as K, ensureKeybindingsFile as Kt, ANCHOR_PREVIEW_MAX_CHARS as L, createInteractionTool as Lt, buildCompactPrompt as M, multiEdit as Mt, buildFromCompactPrompt as N, createModelSearchTool as Nt, compactConversation as O, stableStringify as On, shell as Ot, buildFullCompactPrompt as P, formatModelLine as Pt, readExtensionInstallProvenance as Q, parseBindingSpec as Qt, anchorPreviewFor as R, grep as Rt, resolveSessionDir as S, OUTPUT_RESERVE_TOKENS as Sn, isSpawnTool as St, selectFilesFromReadState as T, defaultRepeatGuardNormalize as Tn, createSkillsReadTool as Tt, CompactInvalidInputError as U, KEYBINDING_DEFS as Ut, summaryToTurn as V, validateToolArgs as Vt, CompactPromptTooLongError as W, KEYBINDING_DEF_BY_ACTION as Wt, listExtensionCandidates as X, matchesBinding as Xt, installExtensionFromSpec as Y, keybindingsPath as Yt, parseExtensionInstallSource as Z, mergeKeybindings as Zt, rehomePersistedStubs as _, resolveExtensionConfig as _n, writeFile$1 as _t, SHELL_CASCADE_CANCEL_MESSAGE as a, defaultExtensionScanPaths as an, composeExtensionPreset as at, resolveMcpWarningsDir as b, toWireConfigSchema as bn, createToolSearchTool as bt, applyCompactSummaryCutoff as c, isExtensionDefinition as cn, filterRegistryPlugins as ct, PERSISTED_STUB_PREFIX as d, createDebugLog as dn, createExtensionHostRuntimeBridge as dt, readKeybindingsRaw as en, updateInstalledExtension as et, PERSISTENCE_PREVIEW_BYTES as f, defineExtension as fn, createWorkspaceSurface as ft, migrateSessionArtifactDirs as g, isValidExtensionConfigValue as gn, basic_default as gt, maybePersistToolResult as h, isValidExtensionConfigItem as hn, basicTools as ht, INTERRUPT_MESSAGE_FOR_TOOL_USE as i, ENTRY_CANDIDATES as in, buildExtensionRegistry as it, TRAILER as j, looksBinary as jt, BASE_INSTRUCTIONS as k, tailTruncate as kt, collectNewlyStaleReadPaths as l, parseExtensionScanPathEnv as ln, mergeContributions as lt, cleanupPersistedSession as m, coerceExtensionConfigInput as mn, definePreset as mt, normalizeProviders as n, stripJsonComments as nn, discoverAndBuildExtensionRegistry as nt, TOOL_USE_CANCELLED_MESSAGE as o, discoverExtensions as on, disposeExtensionRegistry as ot, buildPersistedStub as p, clampExtensionConfigNumber as pn, composePresets as pt, ExtensionInstallError as q, formatBindingForDisplay as qt, resolveModelTargets as r, registerExtensionHostModules as rn, buildExtensionPreset as rt, TOOL_USE_SKIPPED_MESSAGE as s, inlineLoadedExtension as sn, filterExtensionRegistry as st, createAgent as t, resolveExtensionKeybindings as tn, createExtensionHud as tt, renderStaleReadNotice as u, scanExtensionDirectories as un, partitionExtensionCatalog as ut, resolveLegacyPersistDir as v, resolveExtensionConfigValue as vn, WAIT_TASK_TIMED_OUT_PREFIX as vt, buildPostCompactAttachments as w, shouldAutoCompact as wn, createSkillsRunScriptTool as wt, resolvePersistDir as x, AUTO_COMPACT_MIN_GROWTH_FRACTION as xn, createSpawnTool as xt, resolveLegacySessionDir as y, sanitizeExtensionConfigActionPatch as yn, waitTask as yt, sliceForCompaction as z, glob as zt };
16028
16153
 
16029
- //# sourceMappingURL=agent-8sUadp5M.js.map
16154
+ //# sourceMappingURL=agent-SQ6rxfpT.js.map