zidane 8.2.1 → 8.2.3

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 (187) hide show
  1. package/dist/acp-cli.js +8 -8
  2. package/dist/{acp-D7Pr8NGt.js → acp-oYRjlh71.js} +6 -6
  3. package/dist/{acp-D7Pr8NGt.js.map → acp-oYRjlh71.js.map} +1 -1
  4. package/dist/acp.d.ts +2 -2
  5. package/dist/acp.js +1 -1
  6. package/dist/{agent-DecDtKA_.js → agent-CBQglXtH.js} +9 -379
  7. package/dist/agent-CBQglXtH.js.map +1 -0
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/agent.js +1 -1
  10. package/dist/{builtin-artifact-kinds-B_OEgf8b.js → builtin-artifact-kinds-BmorPkgz.js} +36 -9
  11. package/dist/builtin-artifact-kinds-BmorPkgz.js.map +1 -0
  12. package/dist/chat/pure.d.ts +4 -4
  13. package/dist/chat/pure.js +6 -6
  14. package/dist/chat.d.ts +4 -4
  15. package/dist/chat.js +15 -15
  16. package/dist/{cli-shared-Dx4vmif6.js → cli-shared-E5m_pI8A.js} +2 -2
  17. package/dist/{cli-shared-Dx4vmif6.js.map → cli-shared-E5m_pI8A.js.map} +1 -1
  18. package/dist/{client-core-imHuBWV3.d.ts → client-core-EEEX_u6D.d.ts} +24 -5
  19. package/dist/{client-core-imHuBWV3.d.ts.map → client-core-EEEX_u6D.d.ts.map} +1 -1
  20. package/dist/{connection-loop-CdHt3iQi.d.ts → connection-loop-CpgfUmuw.d.ts} +3 -3
  21. package/dist/{connection-loop-CdHt3iQi.d.ts.map → connection-loop-CpgfUmuw.d.ts.map} +1 -1
  22. package/dist/contexts/daytona.d.ts +1 -1
  23. package/dist/contexts/e2b.d.ts +1 -1
  24. package/dist/{credentials-Dti61yoi.js → credentials-B9DfBJP9.js} +11 -7
  25. package/dist/credentials-B9DfBJP9.js.map +1 -0
  26. package/dist/daemon-cli.js +2 -2
  27. package/dist/{dispatcher-vy3J6JMA.js → dispatcher-Bv9-c6I2.js} +28 -14
  28. package/dist/dispatcher-Bv9-c6I2.js.map +1 -0
  29. package/dist/{engine-BN6PjWAW.js → engine-XmoPPB6U.js} +5 -5
  30. package/dist/{engine-BN6PjWAW.js.map → engine-XmoPPB6U.js.map} +1 -1
  31. package/dist/{eval-BaJtxLCW.js → eval-CfQlBR81.js} +2 -2
  32. package/dist/{eval-BaJtxLCW.js.map → eval-CfQlBR81.js.map} +1 -1
  33. package/dist/eval.d.ts +1 -1
  34. package/dist/eval.js +1 -1
  35. package/dist/{executor-CT4oUkg6.js → executor-BhthPE1q.js} +3 -3
  36. package/dist/{executor-CT4oUkg6.js.map → executor-BhthPE1q.js.map} +1 -1
  37. package/dist/{extensions-BKt7lxxv.js → extensions-BgBwogRW.js} +114 -113
  38. package/dist/extensions-BgBwogRW.js.map +1 -0
  39. package/dist/extensions.d.ts +1 -1
  40. package/dist/extensions.js +2 -2
  41. package/dist/{fold-rules-BYedvsH7.d.ts → fold-rules-DSypi36k.d.ts} +2 -2
  42. package/dist/{fold-rules-BYedvsH7.d.ts.map → fold-rules-DSypi36k.d.ts.map} +1 -1
  43. package/dist/google-O6pRnddf.js +881 -0
  44. package/dist/google-O6pRnddf.js.map +1 -0
  45. package/dist/{headless-Ebd1ZEzC.js → headless-R4pbpTkm.js} +3 -3
  46. package/dist/{headless-Ebd1ZEzC.js.map → headless-R4pbpTkm.js.map} +1 -1
  47. package/dist/headless.d.ts +1 -1
  48. package/dist/headless.js +1 -1
  49. package/dist/{host-scoped-settings-Cy_zbmB_.js → host-scoped-settings-C-Nmb6vr.js} +2 -2
  50. package/dist/{host-scoped-settings-Cy_zbmB_.js.map → host-scoped-settings-C-Nmb6vr.js.map} +1 -1
  51. package/dist/{host-signals-Cx2IAbHh.js → host-signals-BFudPyCT.js} +5 -5
  52. package/dist/{host-signals-Cx2IAbHh.js.map → host-signals-BFudPyCT.js.map} +1 -1
  53. package/dist/{index-pc71ADi6.d.ts → index-AqRZ3gEz.d.ts} +71 -4
  54. package/dist/index-AqRZ3gEz.d.ts.map +1 -0
  55. package/dist/{index-Bt_G2Z_2.d.ts → index-CDS7YdUC.d.ts} +5 -5
  56. package/dist/{index-Bt_G2Z_2.d.ts.map → index-CDS7YdUC.d.ts.map} +1 -1
  57. package/dist/{index-CidMTcxS.d.ts → index-DyQyDLX1.d.ts} +167 -10
  58. package/dist/index-DyQyDLX1.d.ts.map +1 -0
  59. package/dist/index.d.ts +3 -3
  60. package/dist/index.js +15 -15
  61. package/dist/ipc/remote.d.ts +5 -5
  62. package/dist/ipc/remote.js +3 -3
  63. package/dist/ipc.d.ts +5 -5
  64. package/dist/ipc.js +7 -7
  65. package/dist/{links-DSZ4uQ5w.js → links-rFaWqS2Y.js} +10 -10
  66. package/dist/{links-DSZ4uQ5w.js.map → links-rFaWqS2Y.js.map} +1 -1
  67. package/dist/{mcp-allowlist-BQ5MvhHi.js → mcp-allowlist-CLXweyxk.js} +14 -3
  68. package/dist/mcp-allowlist-CLXweyxk.js.map +1 -0
  69. package/dist/mcp.d.ts +1 -1
  70. package/dist/{oauth-BSqXgads.js → oauth-7_48zR7n.js} +226 -40
  71. package/dist/oauth-7_48zR7n.js.map +1 -0
  72. package/dist/{openai-dTmPxM6T.js → openai-Rh6u5NXF.js} +121 -2
  73. package/dist/openai-Rh6u5NXF.js.map +1 -0
  74. package/dist/{openrouter-CtZbQDa0.js → openrouter-Dg0yaI-o.js} +91 -2
  75. package/dist/openrouter-Dg0yaI-o.js.map +1 -0
  76. package/dist/output/stream-json.d.ts +1 -1
  77. package/dist/output/terminal.d.ts +1 -1
  78. package/dist/plugins.d.ts +1 -1
  79. package/dist/{presets-EzlHyFSi.js → presets-DXeHsd24.js} +3 -3
  80. package/dist/{presets-EzlHyFSi.js.map → presets-DXeHsd24.js.map} +1 -1
  81. package/dist/presets.d.ts +1 -1
  82. package/dist/presets.js +1 -1
  83. package/dist/{prompts-D2lPHLOV.d.ts → prompts-DmY13jvF.d.ts} +2 -1
  84. package/dist/prompts-DmY13jvF.d.ts.map +1 -0
  85. package/dist/protocol-BIv1Yuvl.js.map +1 -1
  86. package/dist/providers/anthropic.d.ts +1 -1
  87. package/dist/providers/arcee.d.ts +1 -1
  88. package/dist/providers/baseten.d.ts +1 -1
  89. package/dist/providers/cerebras.d.ts +1 -1
  90. package/dist/providers/google.d.ts +1 -1
  91. package/dist/providers/google.js +1 -784
  92. package/dist/providers/local.d.ts +1 -1
  93. package/dist/providers/neuralwatt.d.ts +1 -1
  94. package/dist/providers/openai-compat.d.ts +1 -1
  95. package/dist/providers/openai.d.ts +1 -1
  96. package/dist/providers/openai.js +1 -1
  97. package/dist/providers/openrouter.d.ts +1 -1
  98. package/dist/providers/openrouter.js +1 -1
  99. package/dist/providers/xai.d.ts +1 -1
  100. package/dist/providers/xai.js +1 -101
  101. package/dist/providers.d.ts +2 -2
  102. package/dist/providers.js +6 -5
  103. package/dist/{registry-BBaEgTsX.js → registry-eourRLY2.js} +3 -3
  104. package/dist/{registry-BBaEgTsX.js.map → registry-eourRLY2.js.map} +1 -1
  105. package/dist/{remote-hosts-bO7wOt44.js → remote-hosts-DY2J07ut.js} +4 -4
  106. package/dist/{remote-hosts-bO7wOt44.js.map → remote-hosts-DY2J07ut.js.map} +1 -1
  107. package/dist/restate.d.ts +1 -1
  108. package/dist/{secret-shapes-Cda65uDH.js → secret-shapes-BjW4l6U0.js} +17 -3
  109. package/dist/secret-shapes-BjW4l6U0.js.map +1 -0
  110. package/dist/session/sqlite.d.ts +1 -1
  111. package/dist/{session-factory-BazyVdzj.js → session-factory-CMwIXE-7.js} +5 -5
  112. package/dist/{session-factory-BazyVdzj.js.map → session-factory-CMwIXE-7.js.map} +1 -1
  113. package/dist/session.d.ts +1 -1
  114. package/dist/{settings-keys-zYaer8DY.js → settings-keys-CPdmkTz7.js} +3 -3
  115. package/dist/{settings-keys-zYaer8DY.js.map → settings-keys-CPdmkTz7.js.map} +1 -1
  116. package/dist/{shell-path-od9XHRPt.js → shell-path-B8b3EOtK.js} +3 -3
  117. package/dist/{shell-path-od9XHRPt.js.map → shell-path-B8b3EOtK.js.map} +1 -1
  118. package/dist/{skills-use-D68a1gyZ.js → skills-use-CssTEaIj.js} +375 -2
  119. package/dist/skills-use-CssTEaIj.js.map +1 -0
  120. package/dist/skills.d.ts +1 -1
  121. package/dist/store-L01W0gGI.js.map +1 -1
  122. package/dist/{system-freeze-DXvJpveP.js → system-freeze-Um9ZJiPo.js} +24 -9
  123. package/dist/system-freeze-Um9ZJiPo.js.map +1 -0
  124. package/dist/{todo-edits-CmqNFvLJ.js → todo-edits-BERpCRPj.js} +3 -3
  125. package/dist/{todo-edits-CmqNFvLJ.js.map → todo-edits-BERpCRPj.js.map} +1 -1
  126. package/dist/tools/fetch-url.d.ts +1 -1
  127. package/dist/tools/prompts.d.ts +1 -1
  128. package/dist/tools/prompts.js +7 -0
  129. package/dist/tools/prompts.js.map +1 -1
  130. package/dist/tools/web-search.d.ts +1 -1
  131. package/dist/{tools-9Dpm8F-f.js → tools-pZVFIJ_K.js} +273 -2
  132. package/dist/tools-pZVFIJ_K.js.map +1 -0
  133. package/dist/tools.d.ts +3 -3
  134. package/dist/tools.js +4 -4
  135. package/dist/{transcript-anchors-B3TFJqr_.js → transcript-anchors-jHrg-r-H.js} +10 -10
  136. package/dist/{transcript-anchors-B3TFJqr_.js.map → transcript-anchors-jHrg-r-H.js.map} +1 -1
  137. package/dist/{transcript-reconcile-BC2DbTmp.js → transcript-reconcile-CPdrNbbR.js} +19 -2
  138. package/dist/{transcript-reconcile-BC2DbTmp.js.map → transcript-reconcile-CPdrNbbR.js.map} +1 -1
  139. package/dist/tui.d.ts +7 -7
  140. package/dist/tui.js +25 -23
  141. package/dist/tui.js.map +1 -1
  142. package/dist/{turn-operations-CIFoOebZ.d.ts → turn-operations-DuGtKuc_.d.ts} +10 -3
  143. package/dist/turn-operations-DuGtKuc_.d.ts.map +1 -0
  144. package/dist/{types-iFLlZKd0.d.ts → types-C0PJmBaO.d.ts} +2 -2
  145. package/dist/{types-iFLlZKd0.d.ts.map → types-C0PJmBaO.d.ts.map} +1 -1
  146. package/dist/types-JzccL5GE.js +24 -0
  147. package/dist/types-JzccL5GE.js.map +1 -0
  148. package/dist/types.d.ts +2 -2
  149. package/dist/{url-BTH-HE9Y.js → url-D8KZ7Edw.js} +2 -2
  150. package/dist/{url-BTH-HE9Y.js.map → url-D8KZ7Edw.js.map} +1 -1
  151. package/dist/{version-4T82xRxQ.js → version-bd3DQJkc.js} +2 -2
  152. package/dist/{version-4T82xRxQ.js.map → version-bd3DQJkc.js.map} +1 -1
  153. package/dist/wire-DH77Z-rr.js +80 -0
  154. package/dist/wire-DH77Z-rr.js.map +1 -0
  155. package/dist/{workspace-exec-stream-By8na6vz.js → workspace-exec-stream-CyfYgqAh.js} +4 -4
  156. package/dist/{workspace-exec-stream-By8na6vz.js.map → workspace-exec-stream-CyfYgqAh.js.map} +1 -1
  157. package/dist/{write-file-B4vi3SvQ.js → write-file-QYrcDdl3.js} +3 -3
  158. package/dist/{write-file-B4vi3SvQ.js.map → write-file-QYrcDdl3.js.map} +1 -1
  159. package/dist/{ws-CS312Jpx.js → ws-CURQ2igk.js} +5 -5
  160. package/dist/{ws-CS312Jpx.js.map → ws-CURQ2igk.js.map} +1 -1
  161. package/dist/{ws-client-wWka-Jku.js → ws-client-BVljYbdb.js} +3 -3
  162. package/dist/{ws-client-wWka-Jku.js.map → ws-client-BVljYbdb.js.map} +1 -1
  163. package/dist/xai-CStTwCV2.js +182 -0
  164. package/dist/xai-CStTwCV2.js.map +1 -0
  165. package/docs/ARCHITECTURE.md +1 -0
  166. package/docs/ARTIFACTS.md +1 -1
  167. package/docs/EXTENSIONS.md +9 -5
  168. package/package.json +2 -2
  169. package/dist/agent-DecDtKA_.js.map +0 -1
  170. package/dist/builtin-artifact-kinds-B_OEgf8b.js.map +0 -1
  171. package/dist/credentials-Dti61yoi.js.map +0 -1
  172. package/dist/dispatcher-vy3J6JMA.js.map +0 -1
  173. package/dist/extensions-BKt7lxxv.js.map +0 -1
  174. package/dist/index-CidMTcxS.d.ts.map +0 -1
  175. package/dist/index-pc71ADi6.d.ts.map +0 -1
  176. package/dist/mcp-allowlist-BQ5MvhHi.js.map +0 -1
  177. package/dist/oauth-BSqXgads.js.map +0 -1
  178. package/dist/openai-dTmPxM6T.js.map +0 -1
  179. package/dist/openrouter-CtZbQDa0.js.map +0 -1
  180. package/dist/prompts-D2lPHLOV.d.ts.map +0 -1
  181. package/dist/providers/google.js.map +0 -1
  182. package/dist/providers/xai.js.map +0 -1
  183. package/dist/secret-shapes-Cda65uDH.js.map +0 -1
  184. package/dist/skills-use-D68a1gyZ.js.map +0 -1
  185. package/dist/system-freeze-DXvJpveP.js.map +0 -1
  186. package/dist/tools-9Dpm8F-f.js.map +0 -1
  187. package/dist/turn-operations-CIFoOebZ.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-freeze-DXvJpveP.js","names":[],"sources":["../src/extension-authoring.ts","../src/system-freeze.ts"],"sourcesContent":["/**\n * Host glue for the \"edit / create extension\" and \"edit skill\" authoring\n * flows (TUI + GUI).\n *\n * Pure, renderer-neutral helpers consumed by the hosts — deliberately kept OUT\n * of `src/extensions/**` (the extension loader / registry core) so the\n * authoring UX can never entangle with discovery / registration. Imports only\n * the skills lib and node builtins.\n *\n * - {@link extensionScaffold} — minimal `index.ts` for a new extension.\n * - {@link resolveExtensionDocsDir} — locate the shipped `docs/` directory.\n * - {@link buildZidaneExtensionSkill} — the inline extension docs skill.\n * - {@link buildZidaneSkillEditSkill} — the inline skill-editing skill.\n * - {@link withZidaneExtensionSkill} / {@link withZidaneSkillEditSkill}\n * — inject either into a `SkillsConfig`.\n * - {@link editSessionMetadata} — the ONE canonical \"open an editing session\n * with preset context\" seed both hosts stamp at session creation.\n * - {@link EXTENSION_EDIT_METADATA_KEY} / {@link SKILL_EDIT_METADATA_KEY} /\n * {@link ZIDANE_EXTENSION_SKILL_NAME} / {@link ZIDANE_SKILL_EDIT_SKILL_NAME}\n * — constants shared by both hosts.\n */\nimport type { SkillConfig, SkillsConfig } from './skills'\nimport { existsSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { defineSkill } from './skills'\n\n/**\n * Session-metadata key marking an \"edit / create extension\" session. The value\n * is an {@link ExtensionEditMarker}. Both hosts stamp it at session creation so\n * the agent build can scope the docs skill to exactly these sessions (and it\n * survives reload because metadata is persisted).\n */\nexport const EXTENSION_EDIT_METADATA_KEY = 'zidane.extensionEdit'\n\n/** Name of the inline docs skill auto-activated in extension edit sessions. */\nexport const ZIDANE_EXTENSION_SKILL_NAME = 'zidane-extension'\n\n/**\n * Session-metadata key marking an \"edit skill\" session — the skill-editing\n * counterpart of {@link EXTENSION_EDIT_METADATA_KEY}. The value is a\n * {@link SkillEditMarker}. Stamped at session creation by both hosts (via\n * {@link editSessionMetadata}); persisted metadata means it survives reload.\n */\nexport const SKILL_EDIT_METADATA_KEY = 'zidane.skillEdit'\n\n/** Name of the inline preset skill auto-activated in skill edit sessions. */\nexport const ZIDANE_SKILL_EDIT_SKILL_NAME = 'zidane-skill'\n\n/** Per-edit-session marker persisted on `session.metadata[EXTENSION_EDIT_METADATA_KEY]`. */\nexport interface ExtensionEditMarker {\n /** Absolute path to the extension's directory (the session's cwd). */\n dir: string\n}\n\n/** Per-edit-session marker persisted on `session.metadata[SKILL_EDIT_METADATA_KEY]`. */\nexport interface SkillEditMarker {\n /** Absolute path to the skill's directory (the session's cwd). */\n dir: string\n /** The skill's name (frontmatter-first, as discovered). */\n name: string\n}\n\n/**\n * What an editing session targets. `dir` becomes the session's cwd; `name`\n * feeds the preset wording (and the skill marker).\n */\nexport interface EditSessionTarget {\n /** Whether the session edits an extension or a skill. */\n kind: 'extension' | 'skill'\n /** Name of the extension or skill. */\n name: string\n /** Absolute path of the extension or skill directory. */\n dir: string\n}\n\n/**\n * THE canonical seed for \"open an editing session with preset context\" —\n * the session metadata both hosts stamp at creation time. The engines read\n * the marker back and inject + auto-activate the matching inline preset\n * skill ({@link buildZidaneExtensionSkill} / {@link buildZidaneSkillEditSkill}),\n * so the preset rides as real conversation context from turn one.\n *\n * @param target - The extension or skill the editing session targets.\n */\nexport function editSessionMetadata(target: EditSessionTarget): Record<string, unknown> {\n return target.kind === 'extension'\n ? { [EXTENSION_EDIT_METADATA_KEY]: { dir: target.dir } satisfies ExtensionEditMarker }\n : { [SKILL_EDIT_METADATA_KEY]: { dir: target.dir, name: target.name } satisfies SkillEditMarker }\n}\n\n/**\n * Parse a persisted {@link SkillEditMarker} back out of session metadata.\n * Tolerant: anything that isn't `{ dir: string, name: string }` → `null`\n * (older sessions, manual metadata edits, type drift).\n *\n * @param raw - Value read from `session.metadata`, of unknown shape.\n */\nexport function readSkillEditMarker(raw: unknown): SkillEditMarker | null {\n if (typeof raw !== 'object' || raw === null)\n return null\n const { dir, name } = raw as Record<string, unknown>\n if (typeof dir !== 'string' || dir.length === 0 || typeof name !== 'string' || name.length === 0)\n return null\n return { dir, name }\n}\n\n/**\n * Minimal valid extension module for a freshly-created extension. `name` MUST\n * equal the folder name or the loader rejects it (see `src/extensions/discovery`).\n * Does nothing by default — the author registers contributions via `ctx.*`\n * inside `setup`; the auto-activated docs skill guides them from there.\n *\n * @param name - Extension name. Must equal the extension's folder name.\n */\nexport function extensionScaffold(name: string): string {\n return `import { defineExtension } from 'zidane'\n\n/**\n * ${name} — a zidane extension.\n *\n * Register tools / hooks / skills / MCP servers / subagents / config / themes /\n * agents / keybindings via the \\`ctx\\` surface inside \\`setup\\`.\n *\n * Authoring reference: activate the \\`${ZIDANE_EXTENSION_SKILL_NAME}\\` skill — it carries\n * the full \\`ctx\\` API + invariants and is available whenever you open this\n * folder in zidane (or run \\`zidane\\` from inside it).\n */\nexport default defineExtension({\n name: '${name}',\n setup(ctx) {\n // e.g. ctx.registerTool('${name}_hello', {\n // spec: { name: '${name}_hello', description: 'say hi', inputSchema: { type: 'object', properties: {} } },\n // isConcurrencySafe: true,\n // async execute() { return 'hello from ${name}' },\n // })\n },\n})\n`\n}\n\n/**\n * Locate the shipped `docs/` directory (`docs/EXTENSIONS.md` + siblings).\n *\n * The docs ship via `package.json` `files`, so an installed consumer has\n * `<root>/node_modules/zidane/docs` and the repo itself has `<repo>/docs`.\n * Returns the first existing candidate, or `null` (the skill then falls back to\n * the literal `node_modules/zidane/docs` hint, which the model's file tools can\n * still attempt from cwd).\n *\n * @param cwd - Directory used for the `node_modules/zidane/docs` fallback lookup. Defaults to `process.cwd()`.\n */\nexport function resolveExtensionDocsDir(cwd: string = process.cwd()): string | null {\n const candidates: string[] = []\n\n // 1) The installed (or self-linked) zidane package, via its package.json\n // (exposed through `exports[\"./package.json\"]`).\n try {\n const req = createRequire(import.meta.url)\n candidates.push(join(dirname(req.resolve('zidane/package.json')), 'docs'))\n }\n catch {\n // No resolvable package (compiled binary / odd layout) — fall through.\n }\n\n // 2) Relative to this module: the bundled chunk in `dist/` -> `../docs`, or\n // walking up from `src/` when running from source.\n try {\n let dir = dirname(fileURLToPath(import.meta.url))\n for (let i = 0; i < 6; i++) {\n if (existsSync(join(dir, 'docs', 'EXTENSIONS.md'))) {\n candidates.push(join(dir, 'docs'))\n break\n }\n dir = dirname(dir)\n }\n }\n catch {\n // `import.meta.url` is virtual under `bun build --compile` — fall through.\n }\n\n // 3) cwd-relative — the project the author is actually editing.\n candidates.push(join(cwd, 'node_modules', 'zidane', 'docs'))\n\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'EXTENSIONS.md')))\n return candidate\n }\n return null\n}\n\n/** Entry-file probe order for an extension dir (mirrors the loader's discovery). */\nconst EXTENSION_ENTRY_FILES = ['index.ts', 'index.tsx', 'index.mjs', 'index.js'] as const\n\n/**\n * If `cwd` sits inside a zidane extension, return that extension's root dir,\n * else `null`. Mirrors the discovery layout\n * `<scope>/.{agents,zidane}/extensions/<name>/` — the root is the `<name>` dir\n * (parent `extensions`, grandparent `.agents` / `.zidane`) holding an entry\n * file. Walks up from `cwd`, so the nearest enclosing extension wins. Lets the\n * hosts surface the authoring skill for a plain `zidane` launched from an\n * extension folder, not just sessions opened through the edit/create flow.\n *\n * @param cwd - Directory to start the upward walk from. Defaults to `process.cwd()`.\n */\nexport function extensionDirForCwd(cwd: string = process.cwd()): string | null {\n let dir = resolve(cwd)\n // Bounded walk to the filesystem root (the `parent === dir` guard is the real\n // terminator; the cap is just belt-and-braces against pathological inputs).\n for (let i = 0; i < 64; i++) {\n const parent = dirname(dir)\n if (\n basename(parent) === 'extensions'\n && (basename(dirname(parent)) === '.agents' || basename(dirname(parent)) === '.zidane')\n && EXTENSION_ENTRY_FILES.some(f => existsSync(join(dir, f)))\n ) {\n return dir\n }\n if (parent === dir)\n break\n dir = parent\n }\n return null\n}\n\n/**\n * The authoring reference embedded into the skill body. Kept INLINE (not a\n * filesystem path) on purpose: a `bun build --compile` TUI binary has no\n * resolvable `node_modules/zidane/docs`, no real `import.meta.url`, and the\n * edited extension's own cwd has no `node_modules` — so a path reference dead-\n * ends there. The model gets the API verbatim on activation regardless of host.\n *\n * Mirrors `ExtensionContext` (src/extensions/types.ts) — keep in sync when the\n * `ctx.*` surface changes.\n */\nconst EXTENSION_AUTHORING_CHEATSHEET = `## defineExtension\n\nA zidane extension is a module at \\`<scope>/.{agents,zidane}/extensions/<name>/index.{ts,tsx,mjs,js}\\`\nthat default-exports \\`defineExtension({ ... })\\`. It runs in-process in the host (TUI / GUI / SDK).\n\n\\`\\`\\`ts\nimport { defineExtension } from 'zidane'\n\nexport default defineExtension({\n name: 'my-ext', // MUST equal the folder name\n apiVersion: 1, // optional; omitted means v1\n version: '0.1.0', // optional — shown in Settings → Extensions\n displayName: 'My Ext', // optional UI label\n description: 'what it does',\n capabilities: ['tools'], // optional descriptive manifest labels\n permissions: [], // optional descriptive labels; not a sandbox\n setup(ctx) { /* register everything here; may be async */ },\n teardown() {}, // optional, reserved (no hot-reload yet)\n})\n\\`\\`\\`\n\nZero-import form — required INSIDE compiled binaries, which can't \\`import 'zidane'\\` at runtime:\n\\`\\`\\`ts\nimport type { ExtensionContext } from 'zidane' // type-only: erased at runtime\nexport default {\n name: 'my-ext',\n setup(ctx: ExtensionContext) { /* ... */ },\n}\n\\`\\`\\`\n\n## ctx surface (call everything inside setup)\n\nIdentity / utilities:\n- ctx.name / ctx.version / ctx.dir / ctx.scope ('project' | 'user' | 'inline' | 'builtin')\n- ctx.logger — Logger namespaced \\`extension:<name>\\`\n- ctx.config — read THIS extension's config, default-first: \\`ctx.config.get(key)\\`\n- ctx.paths — cwd/projectRoot/dataDir/cacheDir/configDir/stateDir\n- ctx.storage.path(scope, ...segments) — extension-scoped storage path\n- ctx.session — JSON-only per-session state: get / set / delete\n\nRenderer-agnostic registration:\n- ctx.registerTool(name, toolDef)\n- ctx.registerHook(event, handler) — an AgentHooks event; fires on the PARENT agent (use child:* for subagents)\n- ctx.registerMcpServer(config)\n- ctx.registerSkill(skillConfig) — a defineSkill() shape\n- ctx.registerCompletionProvider(provider) — single-char '/' '@' '!' trigger\n- ctx.tui.notify(text, { tone? }) — one-shot transcript line (info/warn/error); buffered pre-mount\n- ctx.tui.setStatus(text | null, { loader?, timeout?, sessionId? }) — single dim status line (transcript-tail slot); loader glyph, auto-clear ms; sessionId scopes it to one session (the GUI shows it as a badge in that session's composer; null with the same id clears it)\n- ctx.composer.setBadge(id, { label, count?, icon?, tone?, loader?, highlight?, title?, panel?, order? } | null, { sessionId, timeout? }) — a badge in that session's composer (desktop app; the TUI ignores it): panel = the tab a click opens (bare id = this extension's panel), highlight only while something waits on the user; max 8 per extension and session\n- ctx.tui.setBanner(lines | null, { timeout? }) — short block above the prompt (stacked with the todo indicator); auto-clear ms\n- ctx.submitPrompt(text, { delivery? }) — submit as the user: 'auto' (run-or-queue), 'steer', 'followUp'; false when detached\n- ctx.registerToolPolicy({ tools?, decide }) — gate tool calls: allow / { block } / { patch } (patches re-validated by the loop)\n- ctx.registerToolResultTransform(fn) — middleware over finished tool results (chained)\n- ctx.registerContextTransform(fn) — rewrite wire messages before each provider call\n- ctx.registerPromptTransform(fn) — transform or consume submitted prompts (after / commands, before skills)\n- ctx.runtime / ctx.sessions — late-bound host controls: model()/thinking()/setThinking(), sessions list/switch/create\n- ctx.appendNote(blocks) — durable display-only transcript note (command-output block vocabulary)\n- ctx.workspace.exec/readFile/writeFile/listFiles/fileSize — shell + files through the SESSION'S execution context (sandbox-correct; host child_process silently targets the wrong filesystem under docker/e2b). Detached ⇒ rejects; guard with \\`await ctx.workspace.available()\\`.\n- ctx.tui.registerToolRenderer({ tools?, render }) — custom view for tool-result rows; return null to fall through to the default. View-layer only: never persisted, error-bounded per row, TUI-scoped.\n- ctx.tui.registerRenderer(id, render) + emit/appendNote \\`custom: { renderer, data }\\` blocks — custom components in the transcript. \\`data\\` must be JSON-safe (it persists); the block's \\`text\\` is the MANDATORY markdown fallback (disabled extension, headless host, GUI, renderer throw). appendNote auto-prefixes bare ids; command emit needs \\`<ext>/<id>\\`.\n- Renderer components: import \\`react\\` / \\`@opentui/react\\` BARE (never as your own dependency) — the host maps them to its live instances at load time, so hooks work. Async data: render() stays sync; return a component that fetches with useState/useEffect.\n- Renderer async caching: \\`useSessionState(id, initial)\\` (per-row, session-persisted — rehydrates on reload) + \\`useRowVisible()\\` (latched viewport gate) from \\`zidane/tui\\` — fetch once, only when scrolled in.\n- ctx.registerCommand(command) — a '/<name>' workflow (handler or steps[]); step ctx: emit (local output),\n runAgent (interactive sub-run), generateData (silent zod/JSON-Schema JSON),\n session? (read-only turns/runs view), interaction? (confirm / askUser forms /\n presentPlan approval — both optional; guard for bare hosts)\n- ctx.registerTheme(theme)\n- ctx.registerAgent(profile) — extra agent profile in the picker; same \\`family\\` = one shared agent (tools = every\n member's, prompt = the first registered member's), so a switch keeps the prompt\n cache; a gate refuses tools the active profile lacks; \\`switchNote\\` (string or\n ({ tools, allowInteraction }) => string) tells the model about the switch\n- ctx.registerSubagent(def) — spawnable subagent (the spawn tool's subagent_type)\n- ctx.registerSubagentOverride(name, fn) — edit/delete an existing subagent\n- ctx.registerProvider(descriptor) — LLM provider; its oauthProvider joins the OAuth registry with it (id = credential\n key), usage probe via descriptor.usage, helpers in 'zidane/oauth' + googleCompatible\n- ctx.registerSystemPromptFragment(text)\n- ctx.registerContextBreakdownSection(fn) — render extension-owned rows in the context panel\n- ctx.registerContextPanelSection(section) — richer context panel section with rows/load\n- ctx.registerToolResultMetadata(registration) — project namespaced tool-result metadata into context\n- ctx.registerRunTransform(fn) — sync rewrite of agent.run options\n- ctx.registerBehaviorTransform(fn) — sync rewrite of resolved behavior\n- ctx.registerProviderMiddleware(fn) — wrap provider instances\n- ctx.registerToolCatalogTransform(fn) — shape/hide/rename tools before disclosure/execution\n- ctx.registerMcpConfigTransform(fn) — rewrite MCP server configs before connect\n- ctx.registerSkillPolicy(policy) — auto-activate skills by run context\n- ctx.registerConfigCategory(category)\n- ctx.registerConfigItem([categoryId,] item) — typed setting; supports scope/onChange metadata\n\nTUI-only (ctx.tui.* — silently ignored on non-TUI hosts):\n- ctx.tui.registerKeybinding(binding)\n- ctx.tui.registerFooterHint(hint)\n- ctx.tui.registerModal(modal) — keep UI lazy: \\`node: () => import('./panel')\\`\n\nSide panels (both hosts):\n- ctx.registerPanel({ id, label, icon?, scope?, load, subscribe?, onAction? })\n — declarative tab in the TUI rail / GUI side panel; load gets\n { cwd, scope, sessionId?, focus? }. scope 'session' (default),\n 'project' or 'both' opts into showing without a session\n (ctx.gui.registerPanel is a deprecated alias)\n\nCompletion providers may also implement submit hooks:\n- resolveReferences(refs, ctx, signal)\n- onSubmit({ text, cursor, references }, signal)\nBoth TUI and GUI call these before dispatching a submitted prompt.\n\n## ToolDef shape\n\\`\\`\\`ts\nctx.registerTool('my_tool', {\n spec: { name: 'my_tool', description: '...', inputSchema: { type: 'object', properties: {} } },\n isConcurrencySafe: true, // default false (barrier/write); true = read-only, fans out in parallel\n async execute(args) { return 'result' },\n})\n\\`\\`\\`\n\n## Invariants\n- The folder name MUST equal \\`name\\`, or the loader rejects the extension.\n- Optional metadata lives in \\`extension.json\\` or \\`package.json#zidane\\`; unsupported \\`apiVersion\\` is rejected.\n- Export as \\`default\\` (or a named \\`extension\\` export).\n- Register ONLY inside \\`setup\\` — calls after it resolves are dropped (logger.warn).\n- A throw in \\`setup\\` is caught and shown on the extension's Settings row; the rest of boot continues.\n- Discovery order, first per name wins: project \\`.agents\\` → project \\`.zidane\\` → \\`~/.agents\\` → \\`~/.zidane\\`.\n- \\`/reload\\` is a TRUE hot-reload: re-discover + re-run setup, and each extension's module graph is re-imported fresh — code edits (deep imports included) apply live. Module-level state resets; clean up external resources in \\`teardown\\`.\n\n## Distribution\n- Users install via Settings → Extensions → \\`ctrl+g\\` (source input + scope picker) — GitHub (\\`owner/repo[#ref][:sub/dir]\\`, tree URLs) or npm (\\`pkg[@version]\\`, exact versions / dist-tags).\n- Update / remove: Settings → Extensions, \\`ctrl+u\\` / \\`ctrl+x\\` on the focused row (update replays the recorded \\`.install.json\\` provenance in place, skipping when the recorded commit/version still matches the remote).\n- Shape your repo/package as a root \\`index.ts\\` (single extension) or \\`extensions/<name>/index.*\\` dirs (collection).\n- Reference packages to copy: \\`extensions/git-flow\\` in the zidane repo (zero-dep \\`/commit\\` command) and \\`extensions/headroom\\` (hooks + tool + config).\n- Declare runtime deps in \\`package.json#dependencies\\` — installed with bun/npm/… WITHOUT lifecycle scripts; don't rely on postinstall.\n- The installed folder is named from your exported \\`definition.name\\` — pick it to be folder-safe ([A-Za-z0-9_.-]).`\n\n// ---------------------------------------------------------------------------\n// Edit-session presets — the first line of each inline skill's instructions.\n// Kept next to each other so the two flows stay phrased consistently.\n// ---------------------------------------------------------------------------\n\n/** Preset preamble for \"edit / create extension\" sessions. */\nconst EXTENSION_EDIT_PRESET\n = 'You are authoring / editing a zidane extension. Authoritative API reference:'\n\n/** Preset preamble for \"edit skill\" sessions — same spirit, skill-flavored. */\nfunction skillEditPreset(marker: SkillEditMarker): string {\n return `We are going to work on ${marker.name}, in ${marker.dir} directory, `\n + 'next messages will be requests at modifying and improving the skill or '\n + 'understanding how it works better.'\n}\n\n/**\n * The inline `zidane-extension` skill. Carries the authoring reference IN its\n * body ({@link EXTENSION_AUTHORING_CHEATSHEET}) so it works in every host —\n * incl. compiled binaries where the on-disk docs aren't resolvable. The shipped\n * `EXTENSIONS.md` (prose long-form) is appended as a \"see also\" only when found\n * on disk. `source: 'inline'` (the `defineSkill` default) survives the\n * project-trust gate.\n *\n * @param opts - Options. `cwd` is the directory used to locate the shipped docs. Defaults to `process.cwd()`.\n */\nexport function buildZidaneExtensionSkill(opts: { cwd?: string } = {}): SkillConfig {\n const docsDir = resolveExtensionDocsDir(opts.cwd)\n const seeAlso = docsDir\n ? `\\n\\n---\\nFull prose reference on disk: ${join(docsDir, 'EXTENSIONS.md')}\\n`\n + 'Sibling docs cover related surfaces (ARCHITECTURE.md, CHAT.md, TUI.md, SKILL.md, HEADLESS.md, …).'\n : '\\n\\n---\\nFuller prose reference, when present: node_modules/zidane/docs/EXTENSIONS.md '\n + '(often absent in compiled binaries — the API above is authoritative).'\n return defineSkill({\n name: ZIDANE_EXTENSION_SKILL_NAME,\n description:\n 'Authoring or editing a zidane extension (a module calling defineExtension, under '\n + '.zidane/extensions/** or .agents/extensions/**). Carries the extension authoring reference.',\n instructions: `${EXTENSION_EDIT_PRESET}\\n\\n${EXTENSION_AUTHORING_CHEATSHEET}${seeAlso}`,\n })\n}\n\n/**\n * Inject the `zidane-extension` skill into an already-merged {@link SkillsConfig}.\n *\n * Call this on the FINAL merged skills object (after folding extension / preset\n * skills): `composePresets` is last-wins on `catalog`, so injecting earlier\n * would be silently dropped whenever an extension also contributes skills.\n *\n * Adds the skill to the catalog and, when an `enabled` allowlist is in force,\n * force-includes the name so the allowlist filter can't hide it (mirrors how\n * extension-contributed skill names are force-included). When skills are fully\n * disabled (`enabled === false`), the edit session still gets just this skill.\n *\n * @param skills - Merged skills configuration to extend.\n * @param opts - Options. `cwd` is the directory used to locate the shipped docs. Defaults to `process.cwd()`.\n */\nexport function withZidaneExtensionSkill(skills: SkillsConfig, opts: { cwd?: string } = {}): SkillsConfig {\n return injectInlineSkill(skills, buildZidaneExtensionSkill(opts))\n}\n\n/**\n * Compact skill-authoring reference embedded into the skill-edit skill body.\n * Inline for the same reason as {@link EXTENSION_AUTHORING_CHEATSHEET}: works\n * in compiled binaries where on-disk docs don't resolve.\n */\nconst SKILL_AUTHORING_CHEATSHEET = `## SKILL.md anatomy\n\nA skill is a directory holding a \\`SKILL.md\\` (YAML frontmatter + markdown body)\nper the Agent Skills standard (agentskills.io/specification):\n\n\\`\\`\\`md\n---\nname: my-skill # 1-64 chars, lowercase alphanumeric + hyphens; SHOULD match the directory name\ndescription: what it does AND when to use it (drives activation — 1-1024 chars)\nlicense: MIT # optional\ncompatibility: … # optional environment requirements\nallowed-tools: # optional — restricts the agent to these tools while active\n - read_file\nmetadata: # optional flat string map; zidane-specific keys use the \\`zidane.\\` prefix\n some-key: value\n---\nThe body is the skill's instructions — injected into context when the skill\nis activated. Keep it token-lean: move depth into references/.\n\\`\\`\\`\n\n## Bundled resources (all optional, discovered automatically)\n- \\`references/\\` — docs loaded on demand via \\`skills_read\\`\n- \\`scripts/\\` — executables run via \\`skills_run_script\\` (honor shebangs)\n- \\`assets/\\` — templates / static files\n\n## Guidance\n- The description is the activation trigger — write it for the ROUTER (\"use when …\"), the body for the ACTIVATED agent.\n- Prefer small bodies + lazy references over one giant SKILL.md.\n- Shell interpolation (exclamation mark + backtick-quoted command) in the body runs at activation — use sparingly; hosts may gate or disable it.\n- Validate names: mismatched frontmatter name vs directory loads with a warning diagnostic.`\n\n/**\n * The inline skill auto-activated in \"edit skill\" sessions. Body = the\n * session preset (which skill, which directory, what the next messages will\n * be about) + a compact SKILL.md authoring reference — the skill-editing\n * counterpart of {@link buildZidaneExtensionSkill}.\n *\n * @param marker - Marker naming the skill's directory and name.\n * @param opts - Options. `cwd` is the directory used to locate the shipped docs. Defaults to `process.cwd()`.\n */\nexport function buildZidaneSkillEditSkill(marker: SkillEditMarker, opts: { cwd?: string } = {}): SkillConfig {\n const docsDir = resolveExtensionDocsDir(opts.cwd)\n const seeAlso = docsDir && existsSync(join(docsDir, 'SKILL.md'))\n ? `\\n\\n---\\nFull prose reference on disk: ${join(docsDir, 'SKILL.md')}`\n : ''\n return defineSkill({\n name: ZIDANE_SKILL_EDIT_SKILL_NAME,\n description:\n `Editing or improving the \"${marker.name}\" agent skill (its SKILL.md, references, `\n + 'scripts, and assets). Carries the skill-authoring reference for this edit session.',\n instructions: `${skillEditPreset(marker)}\\n\\n${SKILL_AUTHORING_CHEATSHEET}${seeAlso}`,\n })\n}\n\n/**\n * Inject the skill-edit preset skill into an already-merged {@link SkillsConfig}.\n * Same contract as {@link withZidaneExtensionSkill} — call on the FINAL merged\n * skills object.\n *\n * @param skills - Merged skills configuration to extend.\n * @param marker - Marker naming the skill's directory and name.\n * @param opts - Options. `cwd` is the directory used to locate the shipped docs. Defaults to `process.cwd()`.\n */\nexport function withZidaneSkillEditSkill(\n skills: SkillsConfig,\n marker: SkillEditMarker,\n opts: { cwd?: string } = {},\n): SkillsConfig {\n return injectInlineSkill(skills, buildZidaneSkillEditSkill(marker, opts))\n}\n\n/**\n * Shared injector: add `skill` to the catalog and, when an `enabled`\n * allowlist is in force, force-include its name so the filter can't hide it\n * (mirrors how extension-contributed skill names are force-included). When\n * skills are fully disabled (`enabled === false`), the edit session still\n * gets just this skill.\n */\nfunction injectInlineSkill(skills: SkillsConfig, skill: SkillConfig): SkillsConfig {\n const catalog = [...(skills.catalog ?? []), skill]\n const enabled = skills.enabled\n const nextEnabled: SkillsConfig['enabled']\n = enabled === undefined\n ? undefined\n : Array.isArray(enabled)\n ? (enabled.includes(skill.name) ? enabled : [...enabled, skill.name])\n : [skill.name]\n return {\n ...skills,\n catalog,\n ...(nextEnabled !== undefined ? { enabled: nextEnabled } : {}),\n }\n}\n","/**\n * Building blocks for hosts that freeze a conversation's system prompt (see\n * `AgentRunOptions.systemFreeze`): the out-of-band snapshot turn, lookup of\n * the newest snapshot for a prompt key, section digests, and the notes\n * announcing changes to the sections the SDK appends to every run's prompt\n * (skills catalog, searchable tools catalog, MCP server instructions).\n *\n * Which other sections a host tracks, and when it clears a snapshot, is the\n * host's policy.\n */\n\nimport type { FrozenPromptSections, SessionTurn, SystemNote, SystemPromptSnapshot } from './types'\nimport { createHash } from 'node:crypto'\n\n/** The newest snapshot for a prompt key, with its prompt text and the index of the turn holding it. */\nexport interface FrozenSystemPrompt {\n /** The frozen system prompt. */\n text: string\n /** The snapshot's bookkeeping. */\n snapshot: SystemPromptSnapshot\n /** Index of the snapshot turn in the session's turns. */\n index: number\n}\n\n/** A note announcing one changed section, with the text the model reads. */\nexport type SectionChangeNote = SystemNote & { text: string }\n\n/** The SDK-appended sections, in announcement order. */\nexport const FROZEN_PROMPT_SECTION_KINDS = ['skills', 'tools', 'mcp'] as const\n\n/**\n * Short stable digest of a section's text.\n *\n * @param text - Section text.\n */\nexport function sectionDigest(text: string): string {\n return createHash('sha256').update(text).digest('hex').slice(0, 16)\n}\n\n/**\n * Digest of every section present, by section kind.\n *\n * @param sections - Section texts by kind; `undefined` entries are skipped.\n */\nexport function sectionDigests(sections: Readonly<Record<string, string | undefined>>): Record<string, string> {\n const digests: Record<string, string> = {}\n for (const [kind, text] of Object.entries(sections)) {\n if (text !== undefined)\n digests[kind] = sectionDigest(text)\n }\n return digests\n}\n\n/**\n * The out-of-band `role: 'system'` turn recording a frozen prompt, or\n * clearing the one recorded for `key` (every key when omitted).\n *\n * @param input - Turn id and time, plus the prompt and its snapshot, or `cleared` with an optional key.\n */\nexport function systemSnapshotTurn(input: { id: string, createdAt: number } & ({ cleared: true, key?: string } | { system: string, snapshot: Omit<SystemPromptSnapshot, 'v' | 'cleared'> })): SessionTurn {\n if ('cleared' in input) {\n return {\n id: input.id,\n role: 'system',\n createdAt: input.createdAt,\n content: [],\n systemSnapshot: { v: 1, ...(input.key !== undefined ? { key: input.key } : {}), cleared: true, digests: {} },\n }\n }\n return {\n id: input.id,\n role: 'system',\n createdAt: input.createdAt,\n content: [{ type: 'text', text: input.system }],\n systemSnapshot: { v: 1, ...input.snapshot },\n }\n}\n\n/**\n * The newest frozen prompt recorded for `key`. A cleared snapshot for the\n * same key, or one with no key, ends the search with `undefined`; snapshots\n * for other keys are skipped.\n *\n * @param turns - Session turns, oldest first.\n * @param key - The prompt key the snapshot was recorded under; omitted matches keyless snapshots.\n */\nexport function latestSystemSnapshot(turns: readonly SessionTurn[], key?: string): FrozenSystemPrompt | undefined {\n for (let index = turns.length - 1; index >= 0; index--) {\n const turn = turns[index]!\n const snapshot = turn.systemSnapshot\n if (turn.role !== 'system' || !snapshot)\n continue\n if (snapshot.cleared) {\n if (snapshot.key === undefined || snapshot.key === key)\n return undefined\n continue\n }\n if (snapshot.key !== key)\n continue\n const block = turn.content.find(b => b.type === 'text')\n return block?.type === 'text' && block.text ? { text: block.text, snapshot, index } : undefined\n }\n return undefined\n}\n\n/**\n * Digest of a section as the model was last told it: the newest note of\n * `kind` carrying a digest after the snapshot, else the snapshot's digest.\n *\n * @param frozen - The frozen prompt.\n * @param turns - Session turns, oldest first.\n * @param kind - Section kind.\n */\nexport function announcedDigest(frozen: FrozenSystemPrompt, turns: readonly SessionTurn[], kind: string): string | undefined {\n for (let t = turns.length - 1; t > frozen.index; t--) {\n const content = turns[t]!.content\n for (let b = content.length - 1; b >= 0; b--) {\n const block = content[b]!\n if (block.type === 'text' && block.systemNote?.kind === kind && block.systemNote.digest !== undefined)\n return block.systemNote.digest\n }\n }\n return frozen.snapshot.digests[kind]\n}\n\n/**\n * Notes for each SDK-appended section whose live text differs from what the\n * model was last told (see {@link announcedDigest}). A section the model was\n * told about that is now absent is announced as emptied; tools changes list\n * the entries added and removed. Deterministic.\n *\n * @param input - The frozen prompt, the session turns and this run's sections.\n * @param input.frozen - The frozen prompt.\n * @param input.turns - Session turns, oldest first.\n * @param input.sections - The sections the SDK appended to this run's fresh prompt.\n */\nexport function catalogChangeNotes(input: { frozen: FrozenSystemPrompt, turns: readonly SessionTurn[], sections: FrozenPromptSections }): SectionChangeNote[] {\n const { frozen, turns, sections } = input\n const notes: SectionChangeNote[] = []\n for (const kind of FROZEN_PROMPT_SECTION_KINDS) {\n const text = sections[kind] ?? ''\n const digest = sectionDigest(text)\n const told = announcedDigest(frozen, turns, kind)\n if (told === digest || (told === undefined && text === ''))\n continue\n notes.push({ kind, digest, ...sectionNote(kind, text, frozen, turns) })\n }\n return notes\n}\n\nfunction sectionNote(kind: (typeof FROZEN_PROMPT_SECTION_KINDS)[number], text: string, frozen: FrozenSystemPrompt, turns: readonly SessionTurn[]): { label: string, text: string } {\n switch (kind) {\n case 'skills':\n return text\n ? { label: 'Skills catalog changed', text: `The skills catalog changed. It now reads:\\n\\n${text}` }\n : { label: 'No skills available', text: 'The skills catalog is now empty: no skills are available.' }\n case 'tools':\n return toolsNote(text, frozenToolsBlock(frozen.text), noteTexts(frozen, turns, 'tools'))\n case 'mcp':\n return text\n ? { label: 'MCP server instructions changed', text: `The MCP server instructions changed. They now read:\\n\\n${text}` }\n : { label: 'MCP server instructions removed', text: 'The MCP server instructions were removed. The ones given earlier no longer apply.' }\n }\n}\n\n/** Texts of the notes of `kind` after the snapshot, oldest first. */\nfunction noteTexts(frozen: FrozenSystemPrompt, turns: readonly SessionTurn[], kind: string): string[] {\n const texts: string[] = []\n for (const turn of turns.slice(frozen.index + 1)) {\n for (const block of turn.content) {\n if (block.type === 'text' && block.systemNote?.kind === kind)\n texts.push(block.text)\n }\n }\n return texts\n}\n\n/** The last `<searchable_tools>` block of a frozen prompt. */\nfunction frozenToolsBlock(system: string): string | undefined {\n const start = system.lastIndexOf('<searchable_tools>')\n const end = start < 0 ? -1 : system.indexOf('</searchable_tools>', start)\n return end < 0 ? undefined : system.slice(start, end + '</searchable_tools>'.length)\n}\n\n/** Tool names listed in a `<searchable_tools>` block, either catalog detail. */\nfunction catalogEntries(block: string | undefined): Set<string> {\n const names = new Set<string>()\n for (const match of (block ?? '').matchAll(/<tool name=\"([^\"]*)\">/g))\n names.add(match[1]!)\n for (const match of (block ?? '').matchAll(/<(?:server name=\"[^\"]*\"|tools)>([^<\\n]+)<\\/(?:server|tools)>/g)) {\n for (const name of match[1]!.split(', '))\n names.add(name)\n }\n return names\n}\n\nconst ADDED = 'Added: '\nconst REMOVED = 'Removed: '\n\n/** The catalog entries added and removed since the frozen catalog and the tools notes after it. */\nfunction toolsNote(text: string, frozen: string | undefined, history: readonly string[]): { label: string, text: string } {\n let told = catalogEntries(frozen)\n for (const note of history) {\n if (note.includes('<searchable_tools>')) {\n told = catalogEntries(note)\n continue\n }\n for (const line of note.split('\\n')) {\n if (line.startsWith(ADDED))\n line.slice(ADDED.length).split(', ').forEach(name => told.add(name))\n else if (line.startsWith(REMOVED))\n line.slice(REMOVED.length).split(', ').forEach(name => told.delete(name))\n }\n }\n const now = catalogEntries(text)\n const added = [...now].filter(name => !told.has(name))\n const removed = [...told].filter(name => !now.has(name))\n if (added.length + removed.length === 0)\n return { label: 'Searchable tools catalog changed', text: `The searchable tools catalog changed. It now reads:\\n\\n${text}` }\n return {\n label: `Searchable tools: +${added.length} / -${removed.length}`,\n text: [\n 'The searchable tools catalog changed.',\n ...(added.length > 0 ? [`${ADDED}${added.join(', ')}`] : []),\n ...(removed.length > 0 ? [`${REMOVED}${removed.join(', ')}`] : []),\n ].join('\\n'),\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,MAAa,8BAA8B;;AAG3C,MAAa,8BAA8B;;;;;;;AAQ3C,MAAa,0BAA0B;;AAGvC,MAAa,+BAA+B;;;;;;;;;;AAsC5C,SAAgB,oBAAoB,QAAoD;CACtF,OAAO,OAAO,SAAS,cACnB,GAAG,8BAA8B,EAAE,KAAK,OAAO,IAAI,EAAgC,IACnF,GAAG,0BAA0B;EAAE,KAAK,OAAO;EAAK,MAAM,OAAO;CAAK,EAA4B;AACpG;;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,UAAU,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;EAClE,CAAC,CAAC,KAAK,IAAI;CACb;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools-9Dpm8F-f.js","names":[],"sources":["../src/tools/glob.ts","../src/tools/grep.ts","../src/tools/interaction.ts"],"sourcesContent":["import type { ListFileMetadata, ListFilesEntry } from '../contexts'\nimport type { ToolContext, ToolDef } from './types'\nimport { errorMessage, isAbortLikeError } from '../errors'\nimport { ToolFailure } from './failure'\nimport { toolPrompts } from './prompts'\n\n/** Default cap on returned matches. A `limit` argument overrides it. */\nconst DEFAULT_LIMIT = 1000\n\n/** Backstop so a pathological walk can never hang the agent's turn. */\nconst GLOB_TIMEOUT_MS = 20_000\n\nfunction entryPath(entry: ListFilesEntry): string {\n return typeof entry === 'string' ? entry : entry.path\n}\n\nfunction entryMetadata(entry: ListFilesEntry): ListFileMetadata | undefined {\n return typeof entry === 'string' ? undefined : entry\n}\n\nfunction renderEntry(entry: ListFilesEntry, wantMetadata: boolean): string {\n const path = entryPath(entry)\n const meta = entryMetadata(entry)\n if (!wantMetadata || typeof meta?.size !== 'number' || typeof meta.mtimeMs !== 'number')\n return path\n return `${path}\\t${meta.size}\\t${new Date(meta.mtimeMs).toISOString()}`\n}\n\n/**\n * The `glob` tool. Lists files in the execution context that match a glob pattern.\n *\n * Delegates matching to {@link ExecutionContext.listFiles} with `{ glob:\n * true }`. This keeps filesystem semantics inside the execution context\n * (process / docker / sandbox) instead of reaching around it from the tool.\n *\n * Results are capped at 1000 entries by default to keep model input bounded.\n * The cap applies after the directory filter, so dirs don't consume the\n * file budget.\n *\n * Patterns are deliberately NOT confined to the workspace: like\n * `read_file`, `../`-prefixed patterns may match outside the cwd — the\n * execution context is the sandbox boundary, not this tool.\n *\n * By default, contexts that can cheaply provide metadata return\n * `<path>\\t<size>\\t<mtime>` rows. Contexts without cheap metadata support return\n * paths only. Pass `metadata: false` to request plain newline-separated paths.\n */\nexport const glob: ToolDef = {\n // Filesystem listing only — safe to fan out alongside other reads.\n isConcurrencySafe: true,\n spec: {\n name: 'glob',\n description: toolPrompts.glob,\n inputSchema: {\n type: 'object',\n properties: {\n pattern: {\n type: 'string',\n description: 'Glob pattern (e.g. \"src/**/*.ts\", \"*.md\", \"test/**/fixtures/*\").',\n },\n limit: {\n type: 'number',\n description: `Maximum number of matches to return. Default: ${DEFAULT_LIMIT}.`,\n },\n metadata: {\n type: 'boolean',\n description: 'Append size (bytes) and mtime (ISO) per row, tab-separated. Default: true. In-process only; non-process execution contexts always return paths.',\n },\n gitignore: {\n type: 'boolean',\n description: 'Skip files git ignores (.gitignore, .git/info/exclude, global excludes). Default: true. Set false to include ignored files like node_modules. Honored where git is available; a no-op otherwise.',\n },\n },\n required: ['pattern'],\n },\n },\n async execute({ pattern, limit, metadata, gitignore }, ctx: ToolContext) {\n const pat = pattern as string\n const max = typeof limit === 'number' && limit > 0 ? limit : DEFAULT_LIMIT\n const wantMetadata = metadata !== false\n\n try {\n if (ctx.execution.capabilities.glob !== true)\n throw new Error(`The active execution context (${ctx.execution.type}) does not support glob matching.`)\n\n // Backstop: a pathological walk must never hang the turn. Abort the\n // listing and return a steer after GLOB_TIMEOUT_MS — raced so the tool\n // settles on time even if a streaming matcher is slow to yield control.\n // The controller is also linked to the caller's signal.\n const controller = new AbortController()\n const onAbort = () => controller.abort()\n ctx.signal.addEventListener('abort', onAbort, { once: true })\n let timer: ReturnType<typeof setTimeout> | undefined\n const timeout = new Promise<'timeout'>((resolve) => {\n timer = setTimeout(() => {\n controller.abort()\n resolve('timeout')\n }, GLOB_TIMEOUT_MS)\n })\n try {\n const outcome = await Promise.race([\n ctx.execution.listFiles(ctx.handle, pat, {\n glob: true,\n limit: max,\n metadata: wantMetadata,\n gitignore: gitignore as boolean | undefined,\n signal: controller.signal,\n }),\n timeout,\n ])\n if (outcome === 'timeout')\n return `Glob timed out after ${GLOB_TIMEOUT_MS}ms: narrow the pattern (anchor a literal prefix like \\`src/**\\`) or scope it to a subdirectory.`\n if (outcome.length === 0)\n return '(no matches)'\n return outcome.map(entry => renderEntry(entry, wantMetadata)).join('\\n')\n }\n finally {\n clearTimeout(timer)\n ctx.signal.removeEventListener('abort', onAbort)\n }\n }\n catch (err) {\n if (isAbortLikeError(err))\n throw err\n throw new ToolFailure(`Glob error: ${errorMessage(err)}`)\n }\n },\n}\n","import type { ToolContext, ToolDef } from './types'\nimport { Buffer } from 'node:buffer'\nimport { GIT_LS_FILES_COMMAND, parseGitLsFiles } from '../contexts/git-ls-files'\nimport { errorMessage, isAbortLikeError } from '../errors'\nimport { isToolFailure, ToolFailure } from './failure'\nimport { toolPrompts } from './prompts'\nimport { shellQuote } from './shell-quote'\n\n/** Default cap on output lines (`head_limit`). */\nconst DEFAULT_HEAD_LIMIT = 250\n\n/**\n * Per-line byte cap. ripgrep reports a match as the whole matching LINE, so a\n * minified / single-line file (one line = the entire file) would otherwise be\n * returned in full. Clip each line so a single line can't dump unbounded bytes\n * into the model context.\n */\nconst MAX_LINE_BYTES = 2000\n\n/**\n * OOM guard for the no-ripgrep fallback: it reads each candidate WHOLE\n * into memory (the execution interface has no streaming read), so one\n * multi-GB artifact would take the process down. Enforced twice — the\n * `find` walk excludes oversized files via the portable `-size`\n * predicate (POSIX `c` suffix, GNU + BSD), and the read loop probes\n * process-local sizes to cover the single-file fast path that bypasses\n * the walk. A documented divergence from the ripgrep path, which\n * streams and searches such files fine.\n */\nconst FALLBACK_MAX_FILE_BYTES = 16 * 1024 * 1024\n\n/** Total output byte cap, mirroring read_file's `DEFAULT_BYTE_CAP`. */\nconst OUTPUT_BYTE_CAP = 262_144\n\nconst DEFAULT_OUTPUT_MODE: OutputMode = 'files_with_matches'\n\ntype OutputMode = 'content' | 'files_with_matches' | 'count'\n\ninterface GrepInput {\n 'pattern': string\n 'patterns'?: string[]\n 'exclude'?: string\n 'fixed_strings'?: boolean\n '-w'?: boolean\n 'path'?: string\n 'paths'?: string[]\n 'glob'?: string\n 'type'?: string\n 'output_mode'?: OutputMode\n '-i'?: boolean\n '-n'?: boolean\n '-A'?: number\n '-B'?: number\n '-C'?: number\n 'multiline'?: boolean\n 'head_limit'?: number\n 'offset'?: number\n 'gitignore'?: boolean\n}\n\n/**\n * The `grep` tool. Searches file contents for regular expressions, using ripgrep when it is available and a JavaScript fallback otherwise.\n *\n * Wraps ripgrep (`rg`) when available; when it's not, falls back to a\n * regex search that enumerates files via the execution context's shell\n * (`find` over `exec`) and reads them via `ctx.execution.readFile`. Both\n * legs go through the {@link ToolContext.execution} seam, so the search\n * runs wherever the context's files actually live — in-process, a\n * container, or a remote sandbox — without the tool ever touching the host\n * filesystem directly.\n *\n * The tool surface mirrors Claude Code's `Grep` so models authored against the\n * Anthropic tool surface need no relearning. Output modes:\n * - `files_with_matches` (default) — newline-separated paths.\n * - `content` — `path:line:match` (line numbers on by default).\n * - `count` — `path:N` per matching file.\n *\n * Results are capped via `head_limit` (default 250) to keep model input\n * bounded; `offset` lets the caller page through. Pagination operates on\n * OUTPUT LINES, not match groups — in content mode, context lines and `--`\n * separators consume the budget too (documented in the schema).\n *\n * A line cap is not enough on its own: ripgrep is line-oriented, so a minified\n * / single-line file collapses to ONE match line that is the entire file, and\n * `head_limit` would happily return megabytes — enough to blow the model's\n * context window. Output is therefore ALSO byte-bounded: each line is clipped\n * to `MAX_LINE_BYTES` and the total to `OUTPUT_BYTE_CAP`, mirroring the byte\n * discipline `read_file` already enforces.\n *\n * `path` is deliberately NOT confined to the workspace: like `read_file`,\n * absolute paths and `../` traversal are allowed — the execution context is\n * the sandbox boundary, not this tool.\n */\n\nexport const grep: ToolDef = {\n // Searches files without touching them — concurrency-safe.\n isConcurrencySafe: true,\n spec: {\n name: 'grep',\n description: toolPrompts.grep,\n inputSchema: {\n type: 'object',\n properties: {\n 'pattern': { type: 'string', description: 'Regex (PCRE-flavored via ripgrep, JS regex via fallback).' },\n 'patterns': { type: 'array', items: { type: 'string' }, description: 'More regexes; a line matches if it matches `pattern` OR any of these (like `rg -e a -e b`).' },\n 'exclude': { type: 'string', description: 'Drop output lines matching this regex (applied to the whole output line, like piping through `grep -v`).' },\n 'fixed_strings': { type: 'boolean', description: 'Treat patterns as literal strings, not regexes (`-F`).' },\n '-w': { type: 'boolean', description: 'Match whole words only.' },\n 'path': { type: 'string', description: 'File or directory to search. Default: \".\". May be absolute or outside the workspace (no confinement; consistent with read_file).' },\n 'paths': { type: 'array', items: { type: 'string' }, description: 'Several files or directories to search in one call (combined with `path` when both are set).' },\n 'glob': { type: 'string', description: 'Restrict to files matching this glob, e.g. \"**/*.ts\".' },\n 'type': { type: 'string', description: 'rg file type filter, e.g. \"ts\", \"py\", \"rust\". Ignored by the fallback.' },\n 'output_mode': { type: 'string', enum: ['content', 'files_with_matches', 'count'], description: 'Default: \"files_with_matches\".' },\n '-i': { type: 'boolean', description: 'Case-insensitive match.' },\n '-n': { type: 'boolean', description: 'Show line numbers (content mode). Default: true.' },\n '-A': { type: 'integer', description: 'Lines of trailing context (content mode).' },\n '-B': { type: 'integer', description: 'Lines of leading context (content mode).' },\n '-C': { type: 'integer', description: 'Lines of surrounding context (content mode). Overridden by -A/-B if set.' },\n 'multiline': { type: 'boolean', description: 'Allow patterns to match across line boundaries.' },\n 'gitignore': { type: 'boolean', description: 'Skip files git ignores (.gitignore, .git/info/exclude, global excludes). Default: true. Set false to also search ignored files like node_modules.' },\n 'head_limit': { type: 'integer', description: `Cap output lines. Default: 250. Set 0 for unlimited lines. In content mode, context lines (-A/-B/-C) and \"--\" separators count toward the cap, so the number of matches shown may be lower. Output is independently byte-bounded: each line is clipped to ${MAX_LINE_BYTES} bytes and the total to ${OUTPUT_BYTE_CAP} bytes, so long (e.g. minified) lines never overflow the context window.` },\n 'offset': { type: 'integer', description: 'Skip first N output lines. Default: 0.' },\n },\n required: ['pattern'],\n },\n },\n async execute(rawInput, ctx: ToolContext) {\n const input = rawInput as unknown as GrepInput\n const invalid = validateInput(input)\n if (invalid)\n throw new ToolFailure(`grep error: ${invalid}`)\n\n try {\n if (await isRipgrepAvailable(ctx))\n return await runViaRipgrep(input, ctx)\n return await runFallback(input, ctx)\n }\n catch (err) {\n // grep must never leak a raw exception to the model. An abort is the\n // sole exception we re-throw — the loop renders its canonical\n // interrupt/cascade marker; everything else (a broken `exec`, an\n // unreadable tree, a remote transport error) becomes a `grep error:`.\n if (isAbortLikeError(err) || isToolFailure(err))\n throw err\n throw new ToolFailure(`grep error: ${errorMessage(err)}`)\n }\n },\n}\n\n// ---------------------------------------------------------------------------\n// ripgrep path\n// ---------------------------------------------------------------------------\n\n/**\n * Probe ripgrep availability **per call**. The probe is intentionally not\n * cached: caching at module scope would leak across execution contexts (an\n * orchestrator running an in-process agent and a docker agent in the same\n * Node process must be able to differ on whether `rg` exists), and caching\n * per handle adds bookkeeping for negligible savings — `rg --version` is\n * ~5 ms, and grep is invoked at most a few times per turn.\n */\nasync function isRipgrepAvailable(ctx: ToolContext): Promise<boolean> {\n const result = await ctx.execution.exec(ctx.handle, 'rg --version', { signal: ctx.signal })\n return result.exitCode === 0\n}\n\n/**\n * Every regex the call matches on: `pattern` plus non-empty `patterns`. An\n * empty `pattern` next to non-empty `patterns` is dropped: it would match\n * every line.\n */\nfunction allPatterns(input: GrepInput): string[] {\n const extra = Array.isArray(input.patterns) ? input.patterns.filter(p => typeof p === 'string' && p.length > 0) : []\n if (input.pattern === '' && extra.length > 0)\n return extra\n return [input.pattern, ...extra]\n}\n\n/** Search roots: `path` and `paths` combined, defaulting to `.`. */\nfunction searchRoots(input: GrepInput): string[] {\n const roots = [\n ...(typeof input.path === 'string' && input.path.length > 0 ? [input.path] : []),\n ...(Array.isArray(input.paths) ? input.paths.filter(p => typeof p === 'string' && p.length > 0) : []),\n ]\n return roots.length > 0 ? [...new Set(roots)] : ['.']\n}\n\nfunction validateInput(input: GrepInput): string | undefined {\n if (typeof input.pattern !== 'string')\n return '`pattern` must be a string.'\n if (input.patterns !== undefined && (!Array.isArray(input.patterns) || input.patterns.some(p => typeof p !== 'string')))\n return '`patterns` must be an array of strings.'\n if (input.paths !== undefined && (!Array.isArray(input.paths) || input.paths.some(p => typeof p !== 'string')))\n return '`paths` must be an array of strings.'\n if (input.exclude !== undefined) {\n if (typeof input.exclude !== 'string')\n return '`exclude` must be a string.'\n try {\n void new RegExp(input.exclude)\n }\n catch (err) {\n return `invalid exclude regex: ${errorMessage(err)}`\n }\n }\n return undefined\n}\n\nasync function runViaRipgrep(input: GrepInput, ctx: ToolContext): Promise<string> {\n const args = ['rg']\n const mode = (input.output_mode ?? DEFAULT_OUTPUT_MODE) as OutputMode\n\n if (mode === 'files_with_matches')\n args.push('--files-with-matches')\n else if (mode === 'count')\n args.push('--count')\n else\n args.push((input['-n'] ?? true) ? '--line-number' : '--no-line-number')\n\n if (input['-i'])\n args.push('-i')\n if (input.fixed_strings)\n args.push('--fixed-strings')\n if (input['-w'])\n args.push('--word-regexp')\n\n if (mode === 'content') {\n if (typeof input['-A'] === 'number')\n args.push('-A', String(input['-A']))\n if (typeof input['-B'] === 'number')\n args.push('-B', String(input['-B']))\n if (typeof input['-C'] === 'number' && typeof input['-A'] !== 'number' && typeof input['-B'] !== 'number')\n args.push('-C', String(input['-C']))\n }\n\n if (input.multiline)\n args.push('--multiline', '--multiline-dotall')\n\n // ripgrep respects .gitignore by default; only disable it on explicit opt-out.\n if (input.gitignore === false)\n args.push('--no-ignore')\n\n if (input.glob)\n args.push('--glob', input.glob)\n\n if (input.type)\n args.push('--type', input.type)\n\n // `-e` per pattern (OR semantics); `-e` also keeps a leading-dash pattern\n // from parsing as a flag.\n for (const pattern of allPatterns(input))\n args.push('-e', pattern)\n\n // Always pass a path — rg reads from stdin when invoked from a non-TTY child\n // process without a path argument, which hangs forever waiting for input.\n args.push('--', ...searchRoots(input))\n\n const command = args.map(shellQuote).join(' ')\n const result = await ctx.execution.exec(ctx.handle, command, { signal: ctx.signal })\n\n // ripgrep exits 1 when there are no matches — that's not an error here.\n if (result.exitCode !== 0 && result.exitCode !== 1) {\n throw new ToolFailure(`grep error: ${result.stderr.trim() || `rg exited with code ${result.exitCode}`}`)\n }\n\n return formatPaginated(result.stdout, input)\n}\n\n// ---------------------------------------------------------------------------\n// Fallback path (context-routed `find` enumeration + readFile + JS regex)\n// ---------------------------------------------------------------------------\n\nasync function runFallback(input: GrepInput, ctx: ToolContext): Promise<string> {\n const mode = (input.output_mode ?? DEFAULT_OUTPUT_MODE) as OutputMode\n const flags = `${input['-i'] ? 'i' : ''}${input.multiline ? 's' : ''}${mode !== 'content' ? '' : 'g'}`\n\n let regex: RegExp\n try {\n regex = new RegExp(fallbackSource(input), flags || undefined)\n }\n catch (err) {\n throw new ToolFailure(`grep error: invalid regex: ${errorMessage(err)}`)\n }\n\n const multilineRegex = input.multiline ? new RegExp(regex.source, `${flags.replace(/g/, '')}g`) : undefined\n const files: string[] = []\n for (const root of searchRoots(input)) {\n for (const file of await enumerateFiles(input, root, ctx)) {\n if (!files.includes(file))\n files.push(file)\n }\n }\n const showLineNumbers = input['-n'] ?? true\n const before = (input['-B'] ?? input['-C'] ?? 0)\n const after = (input['-A'] ?? input['-C'] ?? 0)\n\n // Second layer of the fallback's OOM guard, scoped to the single-file\n // fast path ONLY: walk-enumerated files are already size-filtered by\n // the find predicate, and probing each of them would cost one exec per\n // file on exec-probed contexts (docker/sandbox) — N extra round-trips\n // for zero added protection. The fast path bypasses the walk, so it is\n // the one entry that needs the probe. (Contexts without the capability\n // proceed unguarded: same accepted residual as whole-read-guard.ts.)\n const viaSingleFileFastPath = files.length === 1 && searchRoots(input).includes(files[0] as string)\n if (viaSingleFileFastPath) {\n const size = await ctx.execution.fileSize?.(ctx.handle, files[0] as string) ?? null\n if (size !== null && size > FALLBACK_MAX_FILE_BYTES)\n return '(no matches)'\n }\n\n const lines: string[] = []\n for (const path of files) {\n let content: string\n try {\n content = await ctx.execution.readFile(ctx.handle, path)\n }\n catch (err) {\n // Skip unreadable / binary / vanished files — but let an abort\n // propagate (a remote readFile may reject with AbortError on cancel).\n if (isAbortLikeError(err))\n throw err\n continue\n }\n if (multilineRegex) {\n // Multiline mode: scan the whole buffer with /g semantics.\n const allMatches = [...content.matchAll(multilineRegex)]\n if (allMatches.length === 0)\n continue\n if (mode === 'files_with_matches') {\n lines.push(path)\n continue\n }\n if (mode === 'count') {\n lines.push(`${path}:${allMatches.length}`)\n continue\n }\n // content mode — emit each match's surrounding line context. Line\n // numbers advance incrementally (matches arrive in index order) instead\n // of re-splitting the prefix per match (which costs O(matches x size)).\n let lineNo = 1\n let scannedTo = 0\n for (const m of allMatches) {\n const lineStart = content.lastIndexOf('\\n', m.index! - 1) + 1\n const lineEnd = content.indexOf('\\n', m.index!)\n const snippet = content.slice(lineStart, lineEnd === -1 ? undefined : lineEnd)\n for (let nl = content.indexOf('\\n', scannedTo); nl !== -1 && nl < m.index!; nl = content.indexOf('\\n', nl + 1))\n lineNo++\n scannedTo = m.index!\n lines.push(formatContentLine(path, lineNo, snippet, showLineNumbers))\n }\n continue\n }\n\n const fileLines = content.split('\\n')\n const matched: number[] = []\n for (let i = 0; i < fileLines.length; i++) {\n regex.lastIndex = 0\n if (regex.test(fileLines[i]))\n matched.push(i)\n }\n if (matched.length === 0)\n continue\n\n if (mode === 'files_with_matches') {\n lines.push(path)\n continue\n }\n if (mode === 'count') {\n lines.push(`${path}:${matched.length}`)\n continue\n }\n\n const includeLineNos = new Set<number>()\n for (const m of matched) {\n for (let i = Math.max(0, m - before); i <= Math.min(fileLines.length - 1, m + after); i++)\n includeLineNos.add(i)\n }\n const sorted = [...includeLineNos].sort((a, b) => a - b)\n let prev = -2\n for (const lineNo of sorted) {\n if (lineNo > prev + 1 && lines.length > 0)\n lines.push('--')\n const snippet = fileLines[lineNo]\n lines.push(formatContentLine(path, lineNo + 1, snippet, showLineNumbers))\n prev = lineNo\n }\n }\n\n return formatPaginated(lines.join('\\n'), input)\n}\n\nfunction formatContentLine(path: string, lineNo: number, snippet: string, showLineNumbers: boolean): string {\n return showLineNumbers ? `${path}:${lineNo}:${snippet}` : `${path}:${snippet}`\n}\n\n/**\n * JS regex source for the fallback: patterns OR'ed together, escaped under\n * `fixed_strings`, wrapped in word boundaries under `-w`.\n */\nfunction fallbackSource(input: GrepInput): string {\n const parts = allPatterns(input).map(p => input.fixed_strings ? p.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') : p)\n const joined = parts.length === 1 ? parts[0] : parts.map(p => `(?:${p})`).join('|')\n return input['-w'] ? `\\\\b(?:${joined})\\\\b` : joined\n}\n\nasync function enumerateFiles(input: GrepInput, root: string, ctx: ToolContext): Promise<string[]> {\n // Single-file fast path: if the root names a file, search just it. Routed\n // through `exec` so the check runs inside the context, not on the host.\n if (root !== '.' && !root.includes('*') && !root.includes('?')) {\n const probe = await ctx.execution.exec(ctx.handle, `test -f ${shellQuote(root)} && echo file || echo dir`, { signal: ctx.signal })\n if (probe.stdout.trim() === 'file')\n return [root]\n }\n\n // Enumerate through the execution context's shell so the listing comes from\n // wherever the context's files live — never the host filesystem. `find` is\n // the same primitive the `glob` tool's portable path uses.\n const result = await ctx.execution.exec(ctx.handle, buildFindCommand(root, input.glob), { signal: ctx.signal })\n\n // A non-zero exit with NO output is a real failure (find unavailable, bad\n // root) — surface it like ripgrep would for a bad path. A non-zero exit WITH\n // output is a partial walk (e.g. an unreadable subdir): keep what we got.\n // `find` writes diagnostics to\n // stderr, so stdout stays a clean newline-separated path list either way.\n if (result.exitCode !== 0 && !result.stdout.trim())\n throw new Error(result.stderr.trim() || `find exited with code ${result.exitCode}`)\n\n const files = result.stdout\n .split('\\n')\n .map(line => line.replace(/^\\.\\//, ''))\n .filter(line => line.length > 0)\n .sort()\n\n // `find` honors no ignore rules, so the no-`rg` fallback would otherwise\n // walk `node_modules` etc. — inconsistent with the ripgrep path. Restrict to\n // git's non-ignored set by default; `gitignore: false` keeps everything.\n if (input.gitignore === false)\n return files\n return filterByGitignore(files, root, ctx)\n}\n\n/**\n * Best-effort intersection of `files` with `git ls-files` (non-ignored set).\n * Returns `files` unchanged when git is unavailable, the dir isn't a repo, or\n * `root` escapes the repo (absolute / `..`) — the filter can only fail open.\n */\nasync function filterByGitignore(files: string[], root: string, ctx: ToolContext): Promise<string[]> {\n if (files.length === 0)\n return files\n if (root !== '.' && (root.startsWith('/') || root.split('/').includes('..')))\n return files\n try {\n const res = await ctx.execution.exec(ctx.handle, GIT_LS_FILES_COMMAND, { signal: ctx.signal })\n if (res.exitCode !== 0)\n return files\n const allowed = new Set(parseGitLsFiles(res.stdout))\n if (allowed.size === 0)\n return files\n return files.filter(file => allowed.has(file))\n }\n catch {\n return files\n }\n}\n\n/**\n * Build a `find` command listing files under `root`, optionally filtered by\n * `glob`. Mirrors `glob`'s shell fallback:\n * - a bare basename, or one behind a leading recursive-wildcard segment,\n * with no inner slash → `-name` (matches at any depth, including the top\n * level — preserving the recursive-glob semantics).\n * - anything with a slash → `-path` against the full relative path. `find`'s\n * `*` spans `/`, so the single- and double-star forms collapse to the\n * same matcher; close enough for the no-`rg` fallback.\n */\nfunction buildFindCommand(root: string, glob?: string): string {\n const findRoot = normalizeFindRoot(root)\n const base = shellQuote(findRoot)\n const sizeGuard = `! -size +${FALLBACK_MAX_FILE_BYTES}c`\n if (!glob)\n return `find ${base} -type f ${sizeGuard}`\n const anyDepth = glob.match(/^(?:\\*\\*\\/)?([^/]+)$/)\n if (anyDepth)\n return `find ${base} -type f ${sizeGuard} -name ${shellQuote(anyDepth[1])}`\n const normRoot = findRoot.replace(/\\/$/, '')\n const pathPattern = root === '.' ? `./${glob}` : `${normRoot}/${glob}`\n return `find ${base} -type f ${sizeGuard} -path ${shellQuote(pathPattern)}`\n}\n\nfunction normalizeFindRoot(root: string): string {\n // POSIX `find` parses a leading-dash first operand as an expression/option.\n // Prefix relative paths like `-fixtures` so they remain path operands.\n return root.startsWith('-') ? `./${root}` : root\n}\n\nfunction formatPaginated(text: string, input: GrepInput): string {\n const headLimit = typeof input.head_limit === 'number' && input.head_limit >= 0\n ? input.head_limit\n : DEFAULT_HEAD_LIMIT\n const offset = typeof input.offset === 'number' && input.offset > 0\n ? Math.floor(input.offset)\n : 0\n\n if (!text.trim())\n return '(no matches)'\n\n const lines = applyExclude(text.split('\\n').filter(l => l.length > 0), input.exclude)\n if (lines.length === 0)\n return '(no matches after exclude)'\n const total = lines.length\n\n const sliced = headLimit === 0\n ? lines.slice(offset)\n : lines.slice(offset, offset + headLimit)\n\n if (sliced.length === 0)\n return '(no matches in this slice)'\n\n // Byte budget. `head_limit` caps the LINE count, but a single line can be\n // arbitrarily large (a minified / one-line file is one match line = the whole\n // file), so a line cap alone leaves byte output unbounded and can overflow the\n // model context. Clip each line, then stop once the total crosses the cap.\n const capped: string[] = []\n let bytesUsed = 0\n let byteCut = false\n for (const line of sliced) {\n const clipped = clipLine(line)\n const lineBytes = Buffer.byteLength(clipped) + 1 // +1 for the rejoining '\\n'\n if (bytesUsed + lineBytes > OUTPUT_BYTE_CAP && capped.length > 0) {\n byteCut = true\n break\n }\n capped.push(clipped)\n bytesUsed += lineBytes\n }\n\n const shown = capped.length\n const truncatedHead = offset > 0\n // Lines withheld by the line-count window, independent of the byte cut.\n const lineCutTail = headLimit > 0 && offset + headLimit < total\n\n // Markers say \"lines\", not \"matches\" — in content mode the pagination\n // unit includes context lines and `--` separators.\n let out = capped.join('\\n')\n if (truncatedHead)\n out = `…(${offset} earlier lines skipped)…\\n${out}`\n if (byteCut)\n out = `${out}\\n…(output truncated at ${OUTPUT_BYTE_CAP} bytes after ${shown} of ${total - offset} matching lines; narrow the pattern or page with offset=${offset + shown})`\n else if (lineCutTail)\n out = `${out}\\n…(${total - offset - headLimit} more lines; re-run with offset=${offset + headLimit} or larger head_limit)`\n return out\n}\n\n/**\n * Drop output lines matching `exclude` (validated upfront). Context-group\n * `--` separators are kept only between surviving lines, never doubled or at\n * the edges.\n */\nfunction applyExclude(lines: string[], exclude: string | undefined): string[] {\n if (!exclude)\n return lines\n const re = new RegExp(exclude)\n const kept: string[] = []\n for (const line of lines) {\n if (line === '--') {\n if (kept.length > 0 && kept[kept.length - 1] !== '--')\n kept.push(line)\n continue\n }\n if (!re.test(line))\n kept.push(line)\n }\n while (kept.length > 0 && kept[kept.length - 1] === '--')\n kept.pop()\n return kept\n}\n\n/**\n * Clip one output line to `MAX_LINE_BYTES` at a UTF-8-safe boundary, appending\n * a marker that reports how many bytes were withheld. Lines within budget pass\n * through untouched.\n */\nfunction clipLine(line: string): string {\n if (Buffer.byteLength(line) <= MAX_LINE_BYTES)\n return line\n let cut = Math.min(line.length, MAX_LINE_BYTES)\n while (cut > 0 && Buffer.byteLength(line.slice(0, cut)) > MAX_LINE_BYTES)\n cut--\n const omitted = Buffer.byteLength(line) - Buffer.byteLength(line.slice(0, cut))\n return `${line.slice(0, cut)}… [line clipped, ${omitted} more bytes]`\n}\n","/**\n * Interaction tool — lets the agent request structured input from the outside world.\n *\n * Not included in any preset by default. Add it explicitly:\n *\n * import { createInteractionTool } from 'zidane'\n *\n * const askUser = createInteractionTool({\n * schema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },\n * onRequest: async (payload) => {\n * const answer = await promptUser(payload.question)\n * return { answer }\n * },\n * })\n *\n * const preset = definePreset({ name: 'interactive', tools: { ...basicTools, ask_user: askUser } })\n */\n\nimport type { ToolContext, ToolDef } from './types'\nimport { toolPrompts } from './prompts'\n\nfunction abortReason(signal: AbortSignal): string {\n return typeof signal.reason === 'string' && signal.reason.length > 0\n ? signal.reason\n : 'Interaction aborted'\n}\n\n/** Options for {@link createInteractionTool}. */\nexport interface InteractionToolOptions {\n /** JSON Schema for the request payload the model sends */\n schema: Record<string, unknown>\n /** Tool name (default: 'interaction') */\n name?: string\n /** Tool description shown to the model */\n description?: string\n /** Called when the model invokes this tool. Receives the validated payload and tool context, returns data for the model. */\n onRequest: (payload: Record<string, unknown>, ctx: ToolContext) => Promise<Record<string, unknown> | string>\n}\n\n/**\n * Create an interaction tool that lets the agent request structured input.\n *\n * The model calls this tool with a payload matching the schema.\n * `onRequest` is called with the payload and should return the response\n * (string or object) that gets sent back to the model as the tool result.\n * @param options - Payload schema, optional name and description, and the `onRequest` handler.\n * @example\n * ```ts\n * import { createInteractionTool } from 'zidane/tools'\n *\n * const askUser = createInteractionTool({\n * name: 'ask_user',\n * schema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },\n * onRequest: async payload => `Answer to: ${String(payload.question)}`,\n * })\n * ```\n */\nexport function createInteractionTool(options: InteractionToolOptions): ToolDef {\n const name = options.name ?? 'interaction'\n const description = options.description ?? toolPrompts.interaction\n\n return {\n spec: {\n name,\n description,\n inputSchema: options.schema,\n },\n async execute(input, ctx) {\n // Race the host resolver against the run's abort signal. `onRequest`\n // settles only on external (human/system) action, so without this an\n // `agent.abort()` / `agent.destroy()` — every teardown/cancel path —\n // would leave the tool body (and the run) hanging on a promise that can\n // never settle. On abort we reject so the loop unwinds cleanly.\n const { signal } = ctx\n if (signal?.aborted)\n throw new Error(abortReason(signal))\n\n let onAbort: (() => void) | undefined\n const abortPromise = signal\n ? new Promise<never>((_, reject) => {\n onAbort = () => reject(new Error(abortReason(signal)))\n signal.addEventListener('abort', onAbort, { once: true })\n })\n : undefined\n\n try {\n const result = abortPromise\n ? await Promise.race([options.onRequest(input, ctx), abortPromise])\n : await options.onRequest(input, ctx)\n return typeof result === 'string' ? result : JSON.stringify(result)\n }\n finally {\n if (signal && onAbort)\n signal.removeEventListener('abort', onAbort)\n }\n },\n }\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,gBAAgB;;AAGtB,MAAM,kBAAkB;AAExB,SAAS,UAAU,OAA+B;CAChD,OAAO,OAAO,UAAU,WAAW,QAAQ,MAAM;AACnD;AAEA,SAAS,cAAc,OAAqD;CAC1E,OAAO,OAAO,UAAU,WAAW,KAAA,IAAY;AACjD;AAEA,SAAS,YAAY,OAAuB,cAA+B;CACzE,MAAM,OAAO,UAAU,KAAK;CAC5B,MAAM,OAAO,cAAc,KAAK;CAChC,IAAI,CAAC,gBAAgB,OAAO,MAAM,SAAS,YAAY,OAA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,OAAO,WAAW,WAAW,SAAS,KAAK,UAAU,MAAM;GACpE,UACQ;IACN,IAAI,UAAU,SACZ,OAAO,oBAAoB,SAAS,OAAO;GAC/C;EACF;CACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"turn-operations-CIFoOebZ.d.ts","names":["Session","StoredSession","ApprovalOriginator","Session","_$__tutorials0.TutorialTopic","_$__tutorials0.TutorialWords"],"sources":["../src/chat/cred-keys.ts","../src/chat/agents-md.ts","../src/chat/model-chain-metadata.ts","../src/chat/session-factory.ts","../src/chat/system-md.ts","../src/chat/todo-glyphs.ts","../src/chat/todos.ts","../src/chat/workspace-confinement.ts","../src/chat/safe-mode-context.tsx","../src/start/shared-options.ts","../src/chat/keybinding-spec.ts","../src/chat/keybindings.ts","../src/chat/settings-defaults.ts","../src/chat/settings-catalog.ts","../src/chat/onboarding/types.ts","../src/chat/turn-selection.ts","../src/chat/store.ts","../src/chat/config.ts","../src/chat/browser/protocol.ts","../src/tools/edit-utils.ts","../src/chat/edit-diff.ts","../src/chat/machine-protocol.ts","../src/chat/terminal/protocol.ts","../src/chat/host/provider-diagnostic.ts","../src/chat/host/signals.ts","../src/chat/host/environment.ts","../src/chat/host/approvals.ts","../src/chat/host/browser.ts","../src/chat/host/launch-overrides.ts","../src/chat/host/interactions.ts","../src/chat/host/machines/folders.ts","../src/chat/mcps-discovery.ts","../src/chat/host/machines/project-files.ts","../src/chat/host/machines/link.ts","../src/chat/host/machines/registry.ts","../src/chat/host/orchestration/types.ts","../src/chat/host/terminal/types.ts","../src/chat/plugins-discovery.ts","../src/chat/host/edit-outcome-ledger.ts","../src/chat/host/compaction/run.ts","../src/chat/text-model.ts","../src/chat/host/text-model.ts","../src/chat/host/session-title.ts","../src/chat/host/host-api.ts","../src/chat/host/cache-view/index.ts","../src/chat/cache-hint.ts","../src/chat/color-gradient.ts","../src/chat/completion-chats.ts","../src/chat/completion-commands.ts","../src/chat/files-discovery.ts","../src/chat/completion-files.ts","../src/chat/completion-skills.ts","../src/chat/daemon-health.ts","../src/chat/edit-approval.ts","../src/chat/feature-gate.ts","../src/chat/footer-chips.ts","../src/chat/generate-title.ts","../src/chat/history-search.ts","../src/chat/hosts/types.ts","../src/chat/hosts/url.ts","../src/chat/markdown-segments.ts","../src/chat/mcp-allowlist.ts","../src/chat/mcp-auth-state.ts","../src/chat/mcp-test-outcome.ts","../src/chat/model-approval.ts","../src/chat/model-catalog.ts","../src/chat/model-lineup.ts","../src/chat/model-setting.ts","../src/chat/onboarding/brands.ts","../src/chat/onboarding/connectors.ts","../src/chat/onboarding/features.ts","../src/chat/onboarding/flow.ts","../src/chat/onboarding/imports.ts","../src/chat/onboarding/native-extensions.ts","../src/chat/onboarding/presets.ts","../src/chat/onboarding/preview.ts","../src/chat/onboarding/tutorials.ts","../src/chat/onboarding/words.ts","../src/chat/onboarding/recap.ts","../src/chat/onboarding/result.ts","../src/chat/onboarding/run.ts","../src/chat/onboarding/steps.ts","../src/chat/onboarding/tradeoffs.ts","../src/chat/prompt-segments.ts","../src/chat/run-activity.ts","../src/chat/session-title-text.ts","../src/chat/spawn-tree.ts","../src/chat/streaming-pure.ts","../src/chat/tool-formatters.ts","../src/chat/transcript-reconcile.ts","../src/chat/turn-operations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAea;;;;;;;;cASA;;;;;cAMA;;;;;;;;;;;;;;;;;;;;iBAqBG,iBAAiB;;;;;;;;;;;;;iBAgBjB,eAAe,iBAAiB;;;;;;;iBAUhC,iBAAiB,iBAAiB;;;;;;;;;;;;;iBAgDlC,iBAAiB,SAAS,SAAS,0BAA0B,iBAAiB;;;;;;;;cAcjF;;cAGA;;;;;;iBAOG,kBAAkB;EAAc;;;;;;;;;;;iBAchC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCtHjB;;EAEf;;EAEA;;EAEA;;;UAIe;;EAEf,gBAAgB;;;;;;EAMhB;;;;;;;;;;;;;;;KAmBU;;UAGK;;EAEf;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