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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-shapes-BjW4l6U0.js","names":[],"sources":["../src/chat/browser/url.ts","../src/chat/settings-defaults.ts","../src/chat/themes/catppuccin.ts","../src/chat/themes/crush.ts","../src/chat/themes/gruvbox.ts","../src/chat/themes/light.ts","../src/chat/themes/vaporwave.ts","../src/chat/theme.ts","../src/chat/settings-catalog.ts","../src/chat/secret-shapes.ts"],"sourcesContent":["/**\n * What the dev browser will load. It is a browser for the app you are\n * building, not the web at large: http(s) only, bare local addresses\n * default to http, anything that looks like a host gets https. Shared by the\n * GUI address bar and the agent's `browser_open` / `browser_navigate`.\n */\n\nconst LOCAL_HOST = /^(?:localhost|127(?:\\.\\d{1,3}){3}|0\\.0\\.0\\.0|\\[::1\\]|[\\w-]+\\.localhost)(?::\\d+)?(?:[/?#]|$)/i\nconst HOST_LIKE = /^(?:[\\w-]+\\.)+[a-z]{2,}(?::\\d+)?(?:[/?#]|$)/i\nconst PORT_ONLY = /^:?(\\d{2,5})([/?#].*)?$/\n\n/**\n * Normalize address-bar input to a loadable URL, or `null` when it is not one.\n *\n * @param input - Text typed in the address bar. A bare port means a local dev server.\n */\nexport function normalizeBrowserUrl(input: string): string | null {\n const text = input.trim()\n if (!text)\n return null\n // `:5173` or `5173` means a local dev server.\n const port = PORT_ONLY.exec(text)\n if (port)\n return canonical(`http://localhost:${port[1]}${port[2] ?? ''}`)\n if (/^[a-z][a-z\\d+.-]*:\\/\\//i.test(text))\n return isAllowedBrowserUrl(text) ? canonical(text) : null\n if (/\\s/.test(text))\n return null\n if (LOCAL_HOST.test(text))\n return canonical(`http://${text}`)\n if (HOST_LIKE.test(text))\n return canonical(`https://${text}`)\n return null\n}\n\n/**\n * Only http(s) pages (and the blank page) ever load in the dev browser.\n *\n * @param url - URL to test.\n */\nexport function isAllowedBrowserUrl(url: string): boolean {\n if (url === 'about:blank')\n return true\n try {\n const { protocol } = new URL(url)\n return protocol === 'http:' || protocol === 'https:'\n }\n catch {\n return false\n }\n}\n\n/**\n * A loopback address: the dev servers the browser exists for.\n *\n * @param url - URL to test.\n */\nexport function isLocalBrowserUrl(url: string): boolean {\n try {\n const host = new URL(url).hostname\n return host === 'localhost' || host.endsWith('.localhost') || host === '0.0.0.0' || host === '[::1]' || /^127(?:\\.\\d{1,3}){3}$/.test(host)\n }\n catch {\n return false\n }\n}\n\nfunction canonical(url: string): string | null {\n try {\n return new URL(url).toString()\n }\n catch {\n return null\n }\n}\n","/**\n * The canonical `Settings` defaults, in a leaf with no React and no node\n * imports so `zidane/chat/pure` (the GUI renderer) shares the same object.\n */\nimport type { ApprovalMode, Settings } from './types'\n\n/** Default value of every setting. */\nexport const DEFAULT_SETTINGS: Settings = {\n showRowIcons: true,\n showThinking: true,\n thinkingAutoExpand: false,\n // Tool calls render as clean per-tool summaries by default — `↳ Read\n // src/foo.ts` instead of `↳ read_file({\"path\":\"src/foo.ts\"})`. Flip\n // to `'full'` for the JSON-debug view, `'hidden'` to drop them.\n toolCallDisplay: 'formatted',\n showToolResults: true,\n groupToolCalls: true,\n // `!` shell output renders a 10-line tail window by default; the toggle\n // shows every line (display-only — the persisted result stays trimmed).\n showFullShellOutput: false,\n showRunReceipt: true,\n showCacheNotices: false,\n approvalMode: 'ask',\n // Off by default — sessions run in-process unless the user opts into the\n // background daemon.\n useDaemon: false,\n // Off; Settings → Remote hosts (see `remoteHostsGate`).\n remoteHosts: false,\n orchestration: false,\n // Off by default — project extensions (`<project>/.zidane/extensions`)\n // execute arbitrary local code, so they stay gated until the user opts\n // in. The `ZIDANE_TRUST_PROJECT_EXTENSIONS=1` env flag is still honored\n // as a fallback.\n loadProjectExtensions: false,\n // Off by default — foreign MCP entries are stdio commands from files\n // zidane doesn't own, so importing them is an explicit opt-in.\n importForeignConfigs: false,\n // On by default — `.ruler/` is an intentional committed config source\n // (see the Settings doc), unlike the per-tool state files above.\n importRulerConfigs: true,\n hideSubagentOutput: true,\n // On by default — when the agent's providers expose a model catalog, the\n // spawn tool gains a `model` field (+ `model_search`) so the main model\n // can delegate mechanical work to cheaper models. Flip off to force\n // children onto the parent's model.\n subagentModels: true,\n // On by default: the tool only exists when a provider can generate images.\n // Calls bill the provider; safe mode gates them unless `generate_image` is\n // safelisted, and with safe mode off they run without asking.\n imageGeneration: true,\n // '' = the first available provider's default image model.\n imageModel: '',\n // The spawn tool's own default. 0 lifts the cap.\n maxParallelSubagents: 3,\n // On by default — mid-run prompts wait in the queue until the run ends.\n // Off steers them into the live run.\n queueMessages: true,\n // `DEFAULT_THEME.id`, spelled out so this leaf does not pull the theme tables.\n theme: 'default',\n // Off by default — the sessions list filters to the current project\n // (git root / cwd) so the user only sees the conversations relevant\n // to where they're working. Toggle on to inspect or jump across\n // projects, plus see pre-tagging legacy sessions.\n showAllProjects: false,\n // Off by default — Spaces is opt-in. The list starts empty; readers\n // normalize it (`normalizeSpaces`) so the Default space always exists.\n spaces: false,\n spaceList: [],\n // On by default — the TUI picks up where you left off. Users who prefer\n // a clean slate on launch can flip this off; resume-on-launch then falls\n // through to the sessions list (or a fresh session when the list is\n // empty).\n resumeLastSession: true,\n // On by default — large tool results (>8 KiB) get written to disk and\n // replaced inline with a `<persisted-output>` stub. Shrinks the prompt\n // prefix on shell/grep-heavy sessions; the model can still re-read the\n // full payload via `read_file` on the persisted path. Flip off to keep\n // every tool result inline regardless of size (also useful when\n // debugging tool output).\n persistToolResults: true,\n // On by default = `toolSearch.mode: 'dispatch'`: surfaced MCP tools are\n // invoked through `call_tool` so discovery never rewrites the prompt cache.\n // Off = `'unlock'`, appending them to the tool list.\n stableToolList: true,\n // On by default: a session keeps the system prompt of its first run and\n // hears about later changes through notes, so rebuilds keep the cache.\n freezeSessionPrompt: true,\n // Off by default (experiments): compact long idle sessions before their\n // prompt cache expires, and list MCP tools by name only in the prompt.\n compactBeforeCacheExpiry: false,\n compactToolCatalog: false,\n // On by default: sessions get the codemode tool (`behavior.codemode: true`)\n // and the Codemode agent. Off removes both. The library itself keeps\n // codemode off until a caller sets `behavior.codemode`.\n codemode: true,\n // Off by default: a script's calls stay folded into its Codemode row.\n codemodeShowCalls: false,\n // Off by default — the OS sandbox (Seatbelt / bwrap) changes what shell\n // commands may write and read, which breaks tools that cache under `~`\n // until the user widens `sandboxAllowWrite`. Explicit opt-in; the shell\n // path stays byte-identical to before while it's off.\n sandbox: false,\n // Allow by default: denying network breaks `bun install` / `git fetch` /\n // `gh` on day one. The setting description is explicit that write\n // containment alone does not stop exfiltration.\n sandboxNetwork: 'allow',\n sandboxAllowWrite: '',\n // On by default — auto-fire compaction once the latest turn's input\n // usage crosses `autoCompactThreshold` of the effective context window.\n // The shipped `compactConversation` is otherwise manual-only; without\n // this trigger most users never reach for `/compact` and let sessions\n // degrade silently.\n autoCompact: true,\n // 80% of the effective window — comfortable headroom before the model\n // hits the wall, aligned with Claude Code's `AUTOCOMPACT_BUFFER_TOKENS`\n // (~167k of 200k = 83.5%). The settings modal cycles 0.6 / 0.7 / 0.8 /\n // 0.9 so users can tune down for verbose workflows (frequent\n // compactions) or up for context-heavy ones (delay until near full).\n autoCompactThreshold: 0.8,\n // Output / runaway caps — all default to \"off\" (model-driven, uncapped) so\n // the agent follows the model's output to completion out of the box. Opt\n // into any ceiling from the Settings modal; the budget breakers\n // (`maxCostUsd` / `maxTotalTokens` / `maxWallMinutes`) and `maxTurns` arm only\n // when set to a positive value.\n resumeOnMaxTokens: false,\n maxOutputTokens: 0,\n maxTurns: 0,\n // 0 = library default (3 attempts). Exposed so flaky-network / heavily\n // rate-limited setups can raise the budget without an SDK override.\n retryMaxAttempts: 0,\n maxCostUsd: 0,\n maxTotalTokens: 0,\n maxWallMinutes: 0,\n // Anthropic only. Server-side drop of replayed thinking whose prefix\n // changed — the request succeeds instead of failing with a 400.\n thinkingBinding: 'drop_block',\n // On by default — `edit` / `multi_edit` / `write_file` calls render as\n // a unified diff. The paired success result is suppressed (the diff\n // already shows it worked); errors still surface. Flip off to keep\n // the raw `↳ edit({\"path\":\"…\",\"old_string\":\"…\"})` JSON dump.\n showEditDiffs: true,\n // Full unified diff in the transcript by default. Switch to `'compact'`\n // for a one-line per-hunk summary (file path + `+N −M` + first\n // changed line preview) — much quieter on edit-heavy turns; the\n // approval modal still shows the full diff when an approval prompt fires.\n editDiffDisplay: 'full',\n // `'compact'` folds each exchange's thinking and tool calls behind one\n // row and keeps only the prose; `'full'` is the historical per-row view.\n transcriptDensity: 'compact',\n // Off by default — the compaction boundary card stays metadata-only\n // (⎯⎯ N turns compacted, model, tokens). Flip on to also render the\n // LLM-generated summary text under the card, so you can audit exactly\n // what context the model carries forward across the boundary.\n showCompactionSummary: false,\n // '' = summarize on the main model. Set from the settings modal's\n // \"Compaction model\" action row via the cross-provider model picker.\n compactionModel: '',\n defaultAgent: '',\n defaultModel: '',\n defaultEffort: '',\n defaultModelOptions: {},\n // Off by default: decisions call a separate paid endpoint. On =\n // `ctx.decide` / `agent.decide` reach the decision model below.\n decisions: false,\n // '' = the first available decision model. Set from the settings'\n // \"Decision model\" row.\n decisionModel: '',\n // Off by default: re-titling calls the decision model after runs.\n autoTitle: false,\n // '' = automatic: the session provider's smallest current model.\n textModel: '',\n // 60fps target — matches most displays, doubles OpenTUI's stock 30fps\n // default for visibly snappier scroll + modal animations + cursor.\n // Settings modal cycles 30 / 60 / 120; applied live via the renderer's\n // `targetFps` / `maxFps` setters.\n targetFps: 60,\n // On by default — clicks, hovers, and wheel scrolling work throughout\n // the TUI. Off releases the mouse to the terminal emulator (native\n // selection / copy / scrollback) by disabling mouse reporting at the\n // renderer, which turns off every clickable surface at once.\n mouseInteractions: true,\n // Ask by default. Skip keeps the tools but resolves them automatically;\n // Disabled strips both tools on the next session activation.\n interactionMode: 'ask',\n // On by default — the assistant's streaming text drips in at a smooth\n // cadence (typewriter effect) instead of landing in batches. The\n // display rate is capped + bursts when behind. Turn-boundary events\n // queue behind any remaining backlog and apply once it has typed out.\n // Off drains every buffered delta on each tick.\n smoothStreaming: true,\n // Off by default: no logs directory or file is created until the user\n // opts in. The in-TUI Logs panel works regardless (in-memory buffer).\n fileLogging: false,\n // On by default — the inline indicator above the prompt is a single\n // muted line (\"▸ <in-progress todo>\"), only present while the active\n // run has an `in_progress` item. Users who don't want even that\n // subtle line flip this off; the explicit `ctrl+t` modal still works.\n showTodoIndicator: true,\n showUsageIndicator: true,\n // Off by default — the streaming throbber (cycling hex/symbol glyphs)\n // is a stylistic flourish, not a load-bearing affordance. Streaming\n // already shows itself through the prompt's status row and the\n // incremental markdown updates, so we keep the transcript calm out\n // of the box and let users opt back in.\n showThrobber: false,\n // On by default — the detectors are command-gated (never free text) and\n // recording is best-effort; off hides every artifact surface at once.\n artifacts: true,\n preserveScroll: true,\n browser: true,\n browserAgent: true,\n browserAutoShow: true,\n terminal: true,\n terminalAgent: true,\n terminalAgentTasks: true,\n closeTerminalOnCleanExit: true,\n confirmGitSync: true,\n sidebarRunDetails: true,\n notifications: false,\n notificationSound: true,\n openIn: 'panel',\n // On by default — one warm-cache HTTP roundtrip per 24 h, never\n // blocks boot, swallows errors. CI / NO_UPDATE_NOTIFIER / ZIDANE_NO_UPDATE\n // force-disable. The explicit `zidane upgrade` subcommand bypasses\n // this toggle.\n checkForUpdates: true,\n // On by default — no request until a provider is picked, and only for\n // providers already signed in. ZIDANE_NO_USAGE_CHECK / CI force-disable;\n // with the toggle off the panel's ctrl+r still fetches on demand.\n subscriptionUsage: true,\n // `'full'` by default — match the historical chat-screen chrome with\n // every shortcut advertised in the bottom bar, prompt overlay, and\n // title meta. `'minimal'` is the explicit opt-in for the lighter\n // surface (agent / model / keybindings + `@` / `/` triggers).\n uiMode: 'full',\n // `'both'` by default — merge `~/.agents`, `~/.zidane`, `~/.claude`\n // user files with project-local `AGENTS.md` / `CLAUDE.md`. Flip to\n // `'user'` for cross-repo defaults only, `'project'` to scope down\n // when running zidane against an unfamiliar codebase.\n userInstructionsScope: 'both',\n ctrlCBehavior: 'quit',\n // Off by default — leave the terminal title alone so launching zidane\n // doesn't clobber whatever the user's shell set. Opt into `'app'`\n // (always \"zidane\"), `'session'` (track the active session title), or\n // `'icon-session'` (`{sessionIcon} · {title}`) from the UI settings tab.\n terminalTitle: 'off',\n // Free-text icon prefixed onto the title in `'icon-session'` mode.\n // Empty falls back to ⚽ (see the title effect in the TUI shell).\n sessionIcon: '',\n // Swap-in icon while the agent waits on user input (tool approval,\n // ask_user / present_plan). Empty falls back to ⚠️. Same\n // `'icon-session'`-only scope as `sessionIcon`.\n attentionIcon: '',\n // Swap-in icon while a run is in flight (streaming/working). Empty\n // falls back to ⚡. Loses to `attentionIcon` when the run is blocked\n // on user input. Same `'icon-session'`-only scope as `sessionIcon`.\n activeIcon: '',\n // On by default — preserves the historical paste-as-attachment\n // pipeline (drag-and-drop a file → image/binary attachment,\n // multiline paste → `paste.txt` document attachment). Flip off\n // and every paste lands inline in the textarea verbatim.\n attachmentsEnabled: true,\n // On by default — pressing the `openExternalEditor` key (ctrl+g) opens\n // the current prompt draft in `$EDITOR` / `$VISUAL` and reloads it on\n // save, git-style. Inert until that key is pressed, and degrades to a\n // notice when no editor is configured, so on-by-default is safe. Flip\n // off to make the key fall through to its normal textarea behavior.\n externalEditor: true,\n // On by default: the built-in provider completes paths from a directory\n // listing and calls no model. Extensions can add providers of their own.\n // Providers only run while the prompt is focused and the completion popup\n // is closed.\n inlineAutocomplete: true,\n // Off until the suggestion quality eval passes: one text-model call per run.\n promptSuggestions: false,\n // `enabledSkills` / `enabledMcps` deliberately default to `undefined`\n // (NOT `[]`): every discovered skill + server is enabled until the user\n // explicitly toggles. The Settings modal seeds the allowlist with the\n // current discovery on first toggle so future additions don't auto-opt\n // out.\n //\n // `disabledMcpTools` is a per-server DENY-LIST (opposite polarity from\n // the `enabledX` allowlists above) — missing key / empty array means\n // every advertised tool is enabled. That polarity flip is deliberate:\n // a new tool shipped by an MCP server we already trust should auto-\n // enable, the same way a new server we explicitly added shouldn't.\n // Default is `undefined` (no per-tool customization).\n}\n\n/** Key of the stored `settings` slice naming the defaults revision it was migrated to. */\nexport const SETTINGS_DEFAULTS_VERSION_KEY = 'settingsDefaultsVersion'\n\n/** Current defaults revision. Bump it with a new {@link PREVIOUS_DEFAULTS} entry when a default changes. */\nexport const SETTINGS_DEFAULTS_VERSION = 1\n\n/**\n * Defaults that changed, by the revision that changed them, with the value\n * they had before. Older writers saved the whole merged object, so a stored\n * value equal to the old default says nothing about the user: the migration\n * drops it and the key follows the new default. Any other value is the\n * user's choice and stays.\n */\nconst PREVIOUS_DEFAULTS: readonly (readonly [version: number, values: Readonly<Record<string, unknown>>])[] = [\n [1, { transcriptDensity: 'full', groupToolCalls: false, showCacheNotices: true, openIn: 'editor' }],\n]\n\n/** Settings that no longer exist; stored values of them are dropped. */\nconst RETIRED_SETTINGS = ['notificationSoundName', 'notifyOnRunDone', 'notifyOnRunFailed', 'notifyOnApproval', 'notifyOnQuestion']\n\n/**\n * Bring a stored `settings` slice (`state.json`) up to date: maps the\n * legacy `allowInteraction` and `showToolCalls` booleans (never over the\n * modern key), the interim `runReceipt` mode and the legacy `safeMode` boolean, drops\n * retired keys and, once per defaults revision, drops values equal to a\n * since-changed default. The result carries the\n * {@link SETTINGS_DEFAULTS_VERSION_KEY} marker, so writers that persist it\n * never migrate the same slice twice (a value the user picks later, even an\n * old default, then sticks).\n *\n * @param stored - The `settings` slice as read from disk.\n * @returns The migrated slice, marker included. `stored` is not mutated.\n */\nexport function migrateStoredSettings(stored: Readonly<Record<string, unknown>>): Record<string, unknown> {\n const out: Record<string, unknown> = { ...stored }\n\n if ('allowInteraction' in out) {\n if (!('interactionMode' in out))\n out.interactionMode = out.allowInteraction === false ? 'disabled' : 'ask'\n delete out.allowInteraction\n }\n if ('showToolCalls' in out) {\n if (!('toolCallDisplay' in out))\n out.toolCallDisplay = out.showToolCalls === false ? 'hidden' : 'formatted'\n delete out.showToolCalls\n }\n\n if ('runReceipt' in out) {\n if (!('showRunReceipt' in out) && out.runReceipt === 'off')\n out.showRunReceipt = false\n delete out.runReceipt\n }\n\n migrateSafeMode(out)\n for (const key of RETIRED_SETTINGS)\n delete out[key]\n\n const marker = out[SETTINGS_DEFAULTS_VERSION_KEY]\n const from = typeof marker === 'number' && Number.isFinite(marker) ? marker : 0\n if (from >= SETTINGS_DEFAULTS_VERSION)\n return out\n\n for (const [version, values] of PREVIOUS_DEFAULTS) {\n if (version <= from)\n continue\n for (const [key, value] of Object.entries(values)) {\n if (key in out && Object.is(out[key], value))\n delete out[key]\n }\n }\n out[SETTINGS_DEFAULTS_VERSION_KEY] = SETTINGS_DEFAULTS_VERSION\n return out\n}\n\n/**\n * The explicitly-set settings of a stored slice, migrated, without the\n * storage marker: what readers layer over {@link DEFAULT_SETTINGS}.\n *\n * @param stored - The `settings` slice as read from disk.\n * @returns The user's settings.\n */\nexport function settingsFromStored(stored: Readonly<Record<string, unknown>>): Partial<Settings> {\n const { [SETTINGS_DEFAULTS_VERSION_KEY]: _marker, ...rest } = migrateStoredSettings(stored)\n return rest as Partial<Settings>\n}\n\n/**\n * The slice a settings writer persists: the stored keys (migrated) plus the\n * keys it sets, never the defaults, so a later default change reaches every\n * key the user did not set.\n *\n * @param stored - The `settings` slice as read from disk (`undefined` when absent).\n * @param patch - The keys to set: the user's change and any key an invariant forced.\n * @param reset - Keys to remove from the slice so they follow their default again (the setup wizard returning a key to its default). A key in `patch` wins.\n * @returns The slice to write under `settings`.\n */\nexport function sparseSettingsUpdate(\n stored: Readonly<Record<string, unknown>> | undefined,\n patch: Readonly<Record<string, unknown>>,\n reset: readonly string[] = [],\n): Record<string, unknown> {\n const base = migrateStoredSettings(stored ?? {})\n for (const key of reset) {\n if (!(key in patch))\n delete base[key]\n }\n // Migrated again over the patch: an older client's `safeMode` maps like a stored one.\n return migrateStoredSettings({ ...base, ...patch })\n}\n\n/**\n * Whether the agent gets decisions: the user turned them on, or Model\n * decision approvals (`approvalMode: 'decide'`) need their answers.\n *\n * @param settings - Settings that hold the `decisions` switch and the approval mode.\n */\nexport function decisionsEnabled(settings: Partial<Pick<Settings, 'decisions' | 'approvalMode'>>): boolean {\n return settings.decisions === true || settings.approvalMode === 'decide'\n}\n\nfunction isApprovalMode(value: unknown): value is ApprovalMode {\n return value === 'ask' || value === 'decide' || value === 'off'\n}\n\n/**\n * The approval mode an older client means by the legacy `safeMode` boolean:\n * `false` is full access; `true` brings `'off'` back to `'ask'` and\n * leaves another mode (a `'decide'` choice the old client can't express).\n *\n * @param safeMode - The legacy value.\n * @param current - The approval mode it applies over.\n * @returns The mode to store.\n */\nexport function approvalModeFromSafeMode(safeMode: boolean, current: ApprovalMode): ApprovalMode {\n return safeMode ? (current === 'off' ? 'ask' : current) : 'off'\n}\n\n/**\n * Fold the legacy `safeMode` of a stored slice into `approvalMode`. Writers\n * no longer store `safeMode`, so one present was written by an older client\n * after `approvalMode`: it applies over it.\n */\nfunction migrateSafeMode(out: Record<string, unknown>): void {\n if (!isApprovalMode(out.approvalMode))\n delete out.approvalMode\n if (!('safeMode' in out))\n return\n const legacy = out.safeMode\n delete out.safeMode\n if (typeof legacy !== 'boolean')\n return\n const current = isApprovalMode(out.approvalMode) ? out.approvalMode : undefined\n const next = approvalModeFromSafeMode(legacy, current ?? DEFAULT_SETTINGS.approvalMode)\n // An untouched default stays unstored, so it follows the default.\n if (current !== undefined || next !== DEFAULT_SETTINGS.approvalMode)\n out.approvalMode = next\n}\n","import type { Theme } from '../theme'\n\n// ---------------------------------------------------------------------------\n// Catppuccin — four flavors built from the official palette.\n//\n// Hex values mirror catppuccin/palette v1.8.0 verbatim. The palette is the\n// data; `catppuccinTheme()` is the mapping into our `Theme` shape — accent\n// → role colors, semantic UI tokens (mantle = modal), and Tree-sitter syntax\n// token mappings that line up with the official Catppuccin styleguide.\n//\n// `Latte` is a light flavor (`base = #eff1f5`, `text = #4c4f69`) and only\n// looks correct in a light terminal — same caveat as the upstream VSCode\n// theme. The other three are dark.\n// ---------------------------------------------------------------------------\n\n/**\n * One Catppuccin flavor as a flat hex map. Mirrors the structure of\n * `catppuccin/palette` so the builder below maps named colors → roles\n * without any per-flavor branching.\n */\ninterface CatppuccinPalette {\n rosewater: string\n flamingo: string\n pink: string\n mauve: string\n red: string\n maroon: string\n peach: string\n yellow: string\n green: string\n teal: string\n sky: string\n sapphire: string\n blue: string\n lavender: string\n text: string\n subtext1: string\n subtext0: string\n overlay2: string\n overlay1: string\n overlay0: string\n surface2: string\n surface1: string\n surface0: string\n base: string\n mantle: string\n crust: string\n}\n\nconst LATTE: CatppuccinPalette = {\n rosewater: '#dc8a78',\n flamingo: '#dd7878',\n pink: '#ea76cb',\n mauve: '#8839ef',\n red: '#d20f39',\n maroon: '#e64553',\n peach: '#fe640b',\n yellow: '#df8e1d',\n green: '#40a02b',\n teal: '#179299',\n sky: '#04a5e5',\n sapphire: '#209fb5',\n blue: '#1e66f5',\n lavender: '#7287fd',\n text: '#4c4f69',\n subtext1: '#5c5f77',\n subtext0: '#6c6f85',\n overlay2: '#7c7f93',\n overlay1: '#8c8fa1',\n overlay0: '#9ca0b0',\n surface2: '#acb0be',\n surface1: '#bcc0cc',\n surface0: '#ccd0da',\n base: '#eff1f5',\n mantle: '#e6e9ef',\n crust: '#dce0e8',\n}\n\nconst FRAPPE: CatppuccinPalette = {\n rosewater: '#f2d5cf',\n flamingo: '#eebebe',\n pink: '#f4b8e4',\n mauve: '#ca9ee6',\n red: '#e78284',\n maroon: '#ea999c',\n peach: '#ef9f76',\n yellow: '#e5c890',\n green: '#a6d189',\n teal: '#81c8be',\n sky: '#99d1db',\n sapphire: '#85c1dc',\n blue: '#8caaee',\n lavender: '#babbf1',\n text: '#c6d0f5',\n subtext1: '#b5bfe2',\n subtext0: '#a5adce',\n overlay2: '#949cbb',\n overlay1: '#838ba7',\n overlay0: '#737994',\n surface2: '#626880',\n surface1: '#51576d',\n surface0: '#414559',\n base: '#303446',\n mantle: '#292c3c',\n crust: '#232634',\n}\n\nconst MACCHIATO: CatppuccinPalette = {\n rosewater: '#f4dbd6',\n flamingo: '#f0c6c6',\n pink: '#f5bde6',\n mauve: '#c6a0f6',\n red: '#ed8796',\n maroon: '#ee99a0',\n peach: '#f5a97f',\n yellow: '#eed49f',\n green: '#a6da95',\n teal: '#8bd5ca',\n sky: '#91d7e3',\n sapphire: '#7dc4e4',\n blue: '#8aadf4',\n lavender: '#b7bdf8',\n text: '#cad3f5',\n subtext1: '#b8c0e0',\n subtext0: '#a5adcb',\n overlay2: '#939ab7',\n overlay1: '#8087a2',\n overlay0: '#6e738d',\n surface2: '#5b6078',\n surface1: '#494d64',\n surface0: '#363a4f',\n base: '#24273a',\n mantle: '#1e2030',\n crust: '#181926',\n}\n\nconst MOCHA: CatppuccinPalette = {\n rosewater: '#f5e0dc',\n flamingo: '#f2cdcd',\n pink: '#f5c2e7',\n mauve: '#cba6f7',\n red: '#f38ba8',\n maroon: '#eba0ac',\n peach: '#fab387',\n yellow: '#f9e2af',\n green: '#a6e3a1',\n teal: '#94e2d5',\n sky: '#89dceb',\n sapphire: '#74c7ec',\n blue: '#89b4fa',\n lavender: '#b4befe',\n text: '#cdd6f4',\n subtext1: '#bac2de',\n subtext0: '#a6adc8',\n overlay2: '#9399b2',\n overlay1: '#7f849c',\n overlay0: '#6c7086',\n surface2: '#585b70',\n surface1: '#45475a',\n surface0: '#313244',\n base: '#1e1e2e',\n mantle: '#181825',\n crust: '#11111b',\n}\n\n/**\n * Compose a `Theme` from a Catppuccin palette flavor.\n *\n * Role-color picks follow the upstream Catppuccin styleguide:\n * - `mauve` is the canonical accent — used here as the brand color.\n * - `green` / `red` / `yellow` keep their universal semantic meaning.\n * - `blue` carries function / model identity (matches the VSCode plugin's\n * `support.function` mapping).\n * - `subtext1` / `overlay0` form the dim/mute pair (one step apart so the\n * two tiers stay visually distinct on every flavor).\n * - `surface1` / `overlay0` give the resting/active border pair.\n *\n * Syntax token mappings line up with the official Catppuccin token rules\n * (keyword = mauve, string = green, function = blue, type = yellow, …) so\n * code fences match what users see in their editor.\n */\nfunction catppuccinTheme(id: string, label: string, p: CatppuccinPalette): Theme {\n return {\n id,\n label,\n colors: {\n brand: p.mauve,\n accent: p.green,\n model: p.blue,\n warn: p.yellow,\n error: p.red,\n dim: p.subtext1,\n mute: p.overlay0,\n border: p.surface1,\n borderActive: p.overlay0,\n // Throbber sweeps mauve → pink — keeps the gradient inside\n // Catppuccin's warm violet/pink family. The fallback `brand →\n // accent` would interpolate mauve → green through grey.\n throbber: { from: p.mauve, to: p.pink },\n },\n select: {\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: p.mauve,\n textColor: p.subtext1,\n descriptionColor: p.overlay0,\n selectedDescriptionColor: p.subtext0,\n },\n surfaces: {\n // `crust` is the deepest tier in the palette — one step below\n // `mantle`, so the root surface stays distinct from the modal\n // elevation on every flavor (including Latte, where `crust` is\n // the darkest light-flavor tone).\n background: p.crust,\n // `mantle` is one shade darker than `base`, mirroring how the upstream\n // VSCode theme paints the sidebar against the editor — a subtle but\n // present elevation cue for the modal panel.\n modal: p.mantle,\n // Chip pills — skills on `mauve` (the canonical Catppuccin accent,\n // matches the brand role) and files on `blue` (function/identifier\n // accent in the upstream styleguide, so file mentions visually\n // rhyme with code references). Foreground is `base` for all\n // pills so dark flavors read light-on-dark and Latte's mauve/blue\n // are dark enough that `base` (`#eff1f5`) contrasts.\n chips: {\n default: { bg: p.mauve, fg: p.base },\n skills: { bg: p.mauve, fg: p.base },\n files: { bg: p.blue, fg: p.base },\n },\n // `surface0` is Catppuccin's canonical \"row highlight\" tier — one\n // step above `base`, designed for subtle elevation. Works on every\n // flavor including Latte (where it darkens against the light base).\n selection: p.surface0,\n // Diff blocks ride the palette's `green` / `red` accents pre-mixed\n // against `base`. We lean on `surface0` / `surface1` for the row\n // paint and the brighter palette accents for the sign glyph so the\n // `+` / `-` markers pop against the dimmer row tint. Catppuccin\n // doesn't ship `*Container` tokens, so we just compose with the\n // surface tiers — works on every flavor (including Latte by\n // virtue of `surface*` darkening against the light base).\n diff: {\n addBg: p.surface0,\n removeBg: p.surface0,\n addContentBg: p.surface1,\n removeContentBg: p.surface1,\n addFg: p.green,\n removeFg: p.red,\n },\n },\n syntax: {\n 'default': { fg: p.text },\n\n // ---- markdown structure ----\n 'markup.heading': { fg: p.mauve, bold: true },\n 'markup.heading.1': { fg: p.mauve, bold: true },\n 'markup.heading.2': { fg: p.lavender, bold: true },\n 'markup.heading.3': { fg: p.blue, bold: true },\n 'markup.bold': { fg: p.text, bold: true },\n 'markup.strong': { fg: p.text, bold: true },\n 'markup.italic': { fg: p.text, italic: true },\n 'markup.link': { fg: p.sky, underline: true },\n 'markup.link.url': { fg: p.sky, underline: true },\n 'markup.list': { fg: p.peach },\n 'markup.raw': { fg: p.green },\n 'markup.raw.block': { fg: p.green },\n 'markup.quote': { fg: p.overlay2, italic: true },\n\n // ---- code ----\n 'keyword': { fg: p.mauve, bold: true },\n 'keyword.import': { fg: p.pink, bold: true },\n 'keyword.operator': { fg: p.sky },\n 'string': { fg: p.green },\n 'string.escape': { fg: p.pink, bold: true },\n 'character': { fg: p.teal },\n 'comment': { fg: p.overlay1, italic: true },\n 'number': { fg: p.peach },\n 'boolean': { fg: p.peach },\n 'constant': { fg: p.peach },\n 'constant.builtin': { fg: p.peach },\n 'function': { fg: p.blue },\n 'function.call': { fg: p.blue },\n 'function.method': { fg: p.blue },\n 'function.method.call': { fg: p.blue },\n 'function.builtin': { fg: p.blue },\n 'function.macro': { fg: p.teal },\n 'type': { fg: p.yellow },\n 'type.builtin': { fg: p.yellow },\n 'constructor': { fg: p.yellow },\n 'attribute': { fg: p.yellow },\n 'tag': { fg: p.lavender },\n 'variable': { fg: p.text },\n 'variable.builtin': { fg: p.red },\n 'variable.parameter': { fg: p.maroon, italic: true },\n 'variable.member': { fg: p.text },\n 'property': { fg: p.lavender },\n 'operator': { fg: p.sky },\n 'punctuation': { fg: p.overlay2 },\n 'punctuation.bracket': { fg: p.overlay2 },\n 'punctuation.delimiter': { fg: p.overlay2 },\n 'label': { fg: p.sapphire },\n },\n }\n}\n\n/** Catppuccin Mocha, the darkest Catppuccin flavor. */\nexport const CATPPUCCIN_MOCHA = catppuccinTheme('catppuccin-mocha', 'Catppuccin Mocha', MOCHA)\n/** Catppuccin Macchiato, a dark flavor between Frappe and Mocha. */\nexport const CATPPUCCIN_MACCHIATO = catppuccinTheme('catppuccin-macchiato', 'Catppuccin Macchiato', MACCHIATO)\n/** Catppuccin Frappe, the lightest of the dark Catppuccin flavors. */\nexport const CATPPUCCIN_FRAPPE = catppuccinTheme('catppuccin-frappe', 'Catppuccin Frappé', FRAPPE)\n// Latte assumes a *light* terminal background (`base = #eff1f5`,\n// `text = #4c4f69`). The label is suffixed so the picker reads correctly\n// regardless of where in the cycle it lands.\n/** Catppuccin Latte, the light Catppuccin flavor. It assumes a light terminal background. */\nexport const CATPPUCCIN_LATTE = catppuccinTheme('catppuccin-latte', 'Catppuccin Latte (light)', LATTE)\n","import type { Theme } from '../theme'\n\n// ---------------------------------------------------------------------------\n// Crush — Charm's CharmTone \"Pantera\" dark theme.\n//\n// Palette hex values are copied verbatim from\n// `charmbracelet/x/exp/charmtone/charmtone.go`. Role assignments and visual\n// paint follow `charmbracelet/crush`'s `internal/ui/styles/quickstyle.go`\n// (the actual `Styles` struct populated for Pantera), not just the\n// `quickStyleOpts` palette — because the Chroma map, Glamour heading\n// banner, link split, and diff overrides all diverge from a naive\n// \"primary → brand\" reading.\n//\n// Notable Pantera idiosyncrasies preserved here:\n// - Headings ride `info` (Malibu blue) + bold, not the brand violet. The\n// brand violet only appears as H1's *banner background*, with `Zest`\n// yellow body text. See `quickstyle.go` `Heading` / `H1`.\n// - Inline code is `destructive` (Coral) on `bgLessVisible` (Charcoal).\n// - LinkText is `successMostSubtle` (Guac) bold; URLs are `Zinc` teal\n// with underline.\n// - Diff line / symbol / code colors are *muted* forest/maroon\n// (`#629657` / `#a45c59`) on `#323931` / `#383030`, overriding the\n// brighter `Turtle` / `Cherry` defaults in `diffview/style.go`.\n// - Surface tier cascade is Pepper → BBQ (modal) → Charcoal (selection),\n// matching `bgBase` → `bgLeastVisible` → `bgLessVisible` in Crush.\n// ---------------------------------------------------------------------------\n\nconst CHARMTONE = {\n // warm / red\n cumin: '#BF976F',\n bengal: '#FF6E63',\n sriracha: '#EB4268',\n coral: '#FF577D',\n salmon: '#FF7F90',\n cherry: '#FF388B',\n // pinks / magentas\n cheeky: '#FF79D0',\n blush: '#FF84FF',\n dolly: '#FF60FF',\n pony: '#FF4FBF',\n // purples\n mauve: '#D46EFF',\n hazy: '#8B75FF',\n charple: '#6B50FF',\n // blues\n guppy: '#7272FF',\n malibu: '#00A4FF',\n sardine: '#4FBEFE',\n // greens / teals\n zinc: '#10B1AE',\n turtle: '#0ADCD9',\n guac: '#12C78F',\n julep: '#00FFB2',\n bok: '#68FFD6',\n // yellows\n mustard: '#F5EF34',\n citron: '#E8FF27',\n zest: '#E8FE96',\n // neutrals (dark → light)\n pepper: '#201F26',\n bbq: '#2D2C35',\n charcoal: '#3A3943',\n iron: '#4D4C57',\n oyster: '#605F6B',\n squid: '#858392',\n smoke: '#BFBCC8',\n ash: '#DFDBDD',\n salt: '#F1EFEF',\n butter: '#FFFAF1',\n} as const\n\nconst c = CHARMTONE\n\nexport const CRUSH_THEME: Theme = {\n id: 'crush',\n label: 'Crush (Pantera)',\n colors: {\n // `Charple` is Pantera's `primary` — Crush dialog frames, focused\n // user-message borders, completions selection all paint with this.\n brand: c.charple,\n // `Bok` is the `accent` role (see `themes.go`). Soft mint that reads\n // as \"alive\" without competing with the brand violet.\n accent: c.bok,\n // `Malibu` is Pantera's `info` — also where headings and tool names\n // land, so it doubles as the model-identity tone here.\n model: c.malibu,\n warn: c.julep,\n // `Zest` is Charmtone's dim-yellow; reserved here for the footer's\n // cost indicator so the money figure reads as money even though\n // Crush's `warn` role intentionally stays mint (see above).\n money: c.zest,\n error: c.sriracha,\n // `Smoke` is `fgSubtle` — the body color Markdown documents inherit.\n dim: c.smoke,\n // `Oyster` is `fgMostSubtle` — tertiary tone, dimmer than `dim`.\n mute: c.oyster,\n // `Charcoal` is `separator` / `bgLessVisible` — Crush's resting border.\n border: c.charcoal,\n // Focused elements in Crush get a `primary` (Charple) rim — dialog\n // frames, focused message borders, the compact details panel.\n borderActive: c.charple,\n // Working-throbber gradient: `primary` → `secondary`, exactly the\n // `WorkingGradFromColor` / `WorkingGradToColor` pair Crush's\n // `quickStyle` populates for the `Anim` spinner.\n throbber: { from: c.charple, to: c.dolly },\n },\n select: {\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: c.charple,\n textColor: c.smoke,\n descriptionColor: c.oyster,\n selectedDescriptionColor: c.squid,\n },\n surfaces: {\n // Surface cascade mirrors Crush's neutral tier ladder:\n // Pepper (bgBase) → BBQ (bgLeastVisible) → Charcoal (bgLessVisible).\n background: c.pepper,\n modal: c.bbq,\n // Chips:\n // - skills (slash commands) ride `primary` / `onPrimary` — the same\n // pair Crush uses for `Completions.Focused` and\n // `Dialog.SelectedItem`.\n // - files ride `info` / `onPrimary` — `info` carries tool / file /\n // reference identity throughout Crush (JobToolName, MCPName).\n chips: {\n default: { bg: c.charple, fg: c.butter },\n skills: { bg: c.charple, fg: c.butter },\n files: { bg: c.malibu, fg: c.butter },\n },\n // Selected-turn lift — `Charcoal`, the same tier Crush uses for\n // separators and resting borders. One step above `modal` (BBQ).\n selection: c.charcoal,\n // Diff blocks — values from Crush's `Styles.Diff` overrides in\n // `quickstyle.go` (lines ~480–500), not the brighter `DefaultDarkStyle`\n // in `diffview/style.go`. Symbol fg `#629657` / `#a45c59` rides the\n // muted forest / maroon Crush actually renders.\n diff: {\n addBg: '#2b322a',\n removeBg: '#312929',\n addContentBg: '#323931',\n removeContentBg: '#383030',\n addFg: '#629657',\n removeFg: '#a45c59',\n },\n },\n syntax: {\n // Chroma `Text` → `fgSubtle` (Smoke). Code body reads one tier below\n // `Ash` / `Salt` — matches Crush's `CodeBlock.Chroma.Text` color.\n 'default': { fg: c.smoke },\n\n // ---- markdown structure ----\n // Heading parent block: `info` + bold. H2-H5 inherit this in Crush\n // (they only add prefix tokens), so we replicate Malibu+bold across\n // levels and override H1 with the brand banner below.\n 'markup.heading': { fg: c.malibu, bold: true },\n // H1 is Crush's signature: bold body text on a `primary` (Charple)\n // background banner. Crush ships `warningSubtle` (Zest yellow) text\n // there; we use `onPrimary` (Butter) cream instead — same banner\n // vibe, drops the yellow that was bleeding into the rest of the UI.\n 'markup.heading.1': { fg: c.butter, bg: c.charple, bold: true },\n 'markup.heading.2': { fg: c.malibu, bold: true },\n 'markup.heading.3': { fg: c.malibu, bold: true },\n // Strong / Emph in Crush set only weight/slant — color inherits from\n // the Document (Smoke). We match by keeping `fg: smoke`.\n 'markup.bold': { fg: c.smoke, bold: true },\n 'markup.strong': { fg: c.smoke, bold: true },\n 'markup.italic': { fg: c.smoke, italic: true },\n // Crush splits links: `LinkText` (the visible label) is\n // `successMostSubtle` (Guac) + bold; `Link` (the URL) is `Zinc`\n // (teal) + underline.\n 'markup.link': { fg: c.guac, bold: true },\n 'markup.link.url': { fg: c.zinc, underline: true },\n // List `Item` in Crush has no color override — bullets inherit\n // Document color (Smoke).\n 'markup.list': { fg: c.smoke },\n // Inline `Code`: `destructive` (Coral) on `bgLessVisible` (Charcoal).\n 'markup.raw': { fg: c.coral, bg: c.charcoal },\n 'markup.raw.block': { fg: c.coral, bg: c.charcoal },\n // BlockQuote in Crush is just indented with `│ ` — no color or italic.\n // We keep `fg: smoke` to match Document inheritance.\n 'markup.quote': { fg: c.smoke },\n\n // ---- code (Chroma mapping from `quickstyle.go`) ----\n 'keyword': { fg: c.malibu }, // Chroma `Keyword` → info\n 'keyword.import': { fg: c.pony }, // KeywordNamespace\n 'keyword.operator': { fg: c.salmon }, // Operator\n 'string': { fg: c.cumin }, // LiteralString\n 'string.escape': { fg: c.bok }, // LiteralStringEscape → successMoreSubtle\n 'character': { fg: c.cumin },\n 'comment': { fg: c.oyster, italic: true }, // fgMostSubtle (italic kept for legibility)\n 'number': { fg: c.julep }, // LiteralNumber → success\n 'boolean': { fg: c.julep },\n 'constant': { fg: c.julep },\n 'constant.builtin': { fg: c.julep },\n 'function': { fg: c.guac }, // NameFunction → successMostSubtle\n 'function.call': { fg: c.guac },\n 'function.method': { fg: c.guac },\n 'function.method.call': { fg: c.guac },\n 'function.builtin': { fg: c.cheeky }, // NameBuiltin\n 'function.macro': { fg: c.bok }, // NameDecorator\n 'type': { fg: c.guppy }, // KeywordType\n 'type.builtin': { fg: c.guppy },\n // `NameClass` in Crush is `Salt` + bold + underline. We drop underline\n // (noisy for non-class types in our broader `constructor` capture).\n 'constructor': { fg: c.salt, bold: true },\n 'attribute': { fg: c.hazy }, // NameAttribute\n 'tag': { fg: c.mauve }, // NameTag\n 'variable': { fg: c.smoke }, // Name → fgSubtle\n 'variable.builtin': { fg: c.cheeky },\n 'variable.parameter': { fg: c.smoke, italic: true },\n 'variable.member': { fg: c.smoke },\n 'property': { fg: c.smoke },\n 'operator': { fg: c.salmon },\n // Crush maps `Punctuation → warningSubtle` (Zest), but at our token\n // granularity that paints every bracket / comma / dot yellow — too\n // much yellow in dense code. Drop to `Squid` (fgMoreSubtle) so\n // punctuation recedes behind the colored tokens it separates.\n 'punctuation': { fg: c.squid },\n 'punctuation.bracket': { fg: c.squid },\n 'punctuation.delimiter': { fg: c.squid },\n 'label': { fg: c.malibu },\n },\n}\n","import type { Theme } from '../theme'\n\ninterface GruvboxPalette {\n dark: boolean\n bg0: string\n bg1: string\n bg2: string\n bg3: string\n bg4: string\n fg0: string\n fg1: string\n fg2: string\n fg3: string\n fg4: string\n red: string\n green: string\n yellow: string\n blue: string\n purple: string\n aqua: string\n orange: string\n gray: string\n}\n\nconst DARK: GruvboxPalette = {\n dark: true,\n bg0: '#282828',\n bg1: '#3c3836',\n bg2: '#504945',\n bg3: '#665c54',\n bg4: '#7c6f64',\n fg0: '#fbf1c7',\n fg1: '#ebdbb2',\n fg2: '#d5c4a1',\n fg3: '#bdae93',\n fg4: '#a89984',\n red: '#fb4934',\n green: '#b8bb26',\n yellow: '#fabd2f',\n blue: '#83a598',\n purple: '#d3869b',\n aqua: '#8ec07c',\n orange: '#fe8019',\n gray: '#928374',\n}\n\nconst LIGHT: GruvboxPalette = {\n dark: false,\n bg0: '#fbf1c7',\n bg1: '#ebdbb2',\n bg2: '#d5c4a1',\n bg3: '#bdae93',\n bg4: '#a89984',\n fg0: '#282828',\n fg1: '#3c3836',\n fg2: '#504945',\n fg3: '#665c54',\n fg4: '#7c6f64',\n red: '#cc241d',\n green: '#98971a',\n yellow: '#d79921',\n blue: '#458588',\n purple: '#b16286',\n aqua: '#689d6a',\n orange: '#d65d0e',\n gray: '#928374',\n}\n\nfunction gruvboxTheme(id: string, label: string, p: GruvboxPalette): Theme {\n return {\n id,\n label,\n colors: {\n brand: p.yellow,\n accent: p.green,\n model: p.blue,\n warn: p.orange,\n error: p.red,\n dim: p.fg3,\n mute: p.gray,\n border: p.bg2,\n borderActive: p.bg4,\n throbber: { from: p.yellow, to: p.orange },\n money: p.yellow,\n },\n select: {\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: p.yellow,\n textColor: p.fg2,\n descriptionColor: p.fg4,\n selectedDescriptionColor: p.fg3,\n },\n surfaces: {\n background: p.dark ? '#1d2021' : '#f9f5d7',\n modal: p.bg0,\n chips: {\n default: { bg: p.yellow, fg: p.dark ? p.bg0 : p.fg0 },\n skills: { bg: p.yellow, fg: p.dark ? p.bg0 : p.fg0 },\n files: { bg: p.blue, fg: p.dark ? p.bg0 : '#fbf1c7' },\n },\n selection: p.bg1,\n diff: {\n addBg: p.bg1,\n removeBg: p.bg1,\n addContentBg: p.bg2,\n removeContentBg: p.bg2,\n addFg: p.green,\n removeFg: p.red,\n },\n },\n syntax: {\n 'default': { fg: p.fg1 },\n 'markup.heading': { fg: p.yellow, bold: true },\n 'markup.heading.1': { fg: p.yellow, bold: true },\n 'markup.heading.2': { fg: p.orange, bold: true },\n 'markup.heading.3': { fg: p.blue, bold: true },\n 'markup.bold': { fg: p.fg0, bold: true },\n 'markup.strong': { fg: p.fg0, bold: true },\n 'markup.italic': { fg: p.fg1, italic: true },\n 'markup.link': { fg: p.blue, underline: true },\n 'markup.link.url': { fg: p.blue, underline: true },\n 'markup.list': { fg: p.orange },\n 'markup.raw': { fg: p.green },\n 'markup.raw.block': { fg: p.green },\n 'markup.quote': { fg: p.fg4, italic: true },\n\n 'keyword': { fg: p.red, bold: true },\n 'keyword.import': { fg: p.red, bold: true },\n 'keyword.operator': { fg: p.orange },\n 'string': { fg: p.green },\n 'string.escape': { fg: p.orange, bold: true },\n 'character': { fg: p.aqua },\n 'comment': { fg: p.gray, italic: true },\n 'number': { fg: p.purple },\n 'boolean': { fg: p.purple },\n 'constant': { fg: p.purple },\n 'constant.builtin': { fg: p.purple },\n 'function': { fg: p.blue },\n 'function.call': { fg: p.blue },\n 'function.method': { fg: p.blue },\n 'function.method.call': { fg: p.blue },\n 'function.builtin': { fg: p.blue },\n 'function.macro': { fg: p.aqua },\n 'type': { fg: p.yellow },\n 'type.builtin': { fg: p.yellow },\n 'constructor': { fg: p.yellow },\n 'attribute': { fg: p.aqua },\n 'tag': { fg: p.aqua },\n 'variable': { fg: p.fg1 },\n 'variable.builtin': { fg: p.red },\n 'variable.parameter': { fg: p.orange, italic: true },\n 'variable.member': { fg: p.fg1 },\n 'property': { fg: p.blue },\n 'operator': { fg: p.orange },\n 'punctuation': { fg: p.fg4 },\n 'punctuation.bracket': { fg: p.fg2 },\n 'punctuation.delimiter': { fg: p.fg4 },\n 'label': { fg: p.aqua },\n },\n }\n}\n\n/** Gruvbox with a dark background. */\nexport const GRUVBOX_DARK = gruvboxTheme('gruvbox-dark', 'Gruvbox Dark', DARK)\n/** Gruvbox with a light background. */\nexport const GRUVBOX_LIGHT = gruvboxTheme('gruvbox-light', 'Gruvbox Light', LIGHT)\n","import type { Theme } from '../theme'\n\n// ---------------------------------------------------------------------------\n// Light — the vanilla light theme every mainstream app ships (Slack, VS Code,\n// Zed, google.com): white background, near-black text, one restrained blue\n// brand accent, conventional green / red / amber for success / error / warn.\n// Not a \"flavor\" of any palette family — deliberately neutral so users who\n// just want \"regular light mode\" have an opt-in that isn't a special theme.\n//\n// Palette draws from the GitHub Light register because it's the most widely\n// recognized neutral light palette in developer tooling and reads correctly\n// on every light terminal background.\n// ---------------------------------------------------------------------------\n\nconst TEXT = '#1f2328' // primary foreground — graphite, not pure black\nconst DIM = '#656d76' // secondary text — captions, helper rows\nconst MUTE = '#8c959f' // tertiary text — separators, the `┃` bar\nconst BORDER = '#d0d7de' // resting border\nconst BORDER_ACTIVE = '#0969da' // brand blue — focused / active rims\n\nconst BRAND = '#0969da' // GitHub link blue — the universal \"click me\" hue\nconst ACCENT = '#1a7f37' // success green\nconst MODEL = '#0550ae' // deeper brand sibling — model id, links\nconst WARN = '#9a6700' // amber on light — readable, doesn't blow out\nconst ERROR = '#d1242f' // danger red\n\nexport const LIGHT_THEME: Theme = {\n id: 'light',\n label: 'Light',\n colors: {\n brand: BRAND,\n accent: ACCENT,\n model: MODEL,\n warn: WARN,\n error: ERROR,\n dim: DIM,\n mute: MUTE,\n border: BORDER,\n borderActive: BORDER_ACTIVE,\n // Throbber sweeps the two brand-blue siblings — stays in-family\n // without detouring through green via the fallback.\n throbber: { from: BRAND, to: MODEL },\n },\n select: {\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: BRAND,\n textColor: TEXT,\n descriptionColor: MUTE,\n selectedDescriptionColor: DIM,\n },\n surfaces: {\n background: '#ffffff',\n // One tier up from the body — same elevation cue every light app\n // uses (GitHub `canvas.subtle`, VS Code light sidebar, …).\n modal: '#f6f8fa',\n // Skills get the saturated brand pill (blue bg, near-white fg).\n // Files get the inverse — pale blue bg with deep brand fg — so\n // the two reference kinds read as paired counterparts on light.\n chips: {\n default: { bg: BRAND, fg: '#ffffff' },\n skills: { bg: BRAND, fg: '#ffffff' },\n files: { bg: '#ddf4ff', fg: '#0550ae' },\n },\n // Neutral, one step below the page: lifted, not tinted.\n selection: '#eceef1',\n // GitHub diff palette. Row paint is the pale `*Subtle` tier; the\n // content column punches a half-tier deeper so syntax-highlighted\n // code contrasts cleanly against the gutter.\n diff: {\n addBg: '#dafbe1',\n removeBg: '#ffebe9',\n addContentBg: '#aceebb',\n removeContentBg: '#ffcecb',\n addFg: ACCENT,\n removeFg: ERROR,\n },\n },\n syntax: {\n // ---- markdown structure ----\n // Headings cascade through brand blue → deeper brand → graphite so\n // the outline reads as one related family. Body rides `TEXT`.\n 'default': { fg: TEXT },\n 'markup.heading': { fg: BRAND, bold: true },\n 'markup.heading.1': { fg: BRAND, bold: true },\n 'markup.heading.2': { fg: MODEL, bold: true },\n 'markup.heading.3': { fg: TEXT, bold: true },\n 'markup.bold': { fg: TEXT, bold: true },\n 'markup.strong': { fg: TEXT, bold: true },\n 'markup.italic': { fg: TEXT, italic: true },\n 'markup.link': { fg: BRAND, underline: true },\n 'markup.link.url': { fg: BRAND, underline: true },\n 'markup.list': { fg: '#953800' }, // warm orange — stands apart from headings + body\n 'markup.raw': { fg: '#953800' },\n 'markup.raw.block': { fg: '#953800' },\n 'markup.quote': { fg: DIM, italic: true },\n\n // ---- code (GitHub Light token mapping) ----\n 'keyword': { fg: '#cf222e', bold: true },\n 'keyword.import': { fg: '#cf222e', bold: true },\n 'keyword.operator': { fg: '#cf222e' },\n 'string': { fg: '#0a3069' },\n 'string.escape': { fg: '#0a3069', bold: true },\n 'character': { fg: '#0a3069' },\n 'comment': { fg: '#6e7781', italic: true },\n 'number': { fg: '#0550ae' },\n 'boolean': { fg: '#0550ae' },\n 'constant': { fg: '#0550ae' },\n 'constant.builtin': { fg: '#0550ae' },\n 'function': { fg: '#8250df' },\n 'function.call': { fg: '#8250df' },\n 'function.method': { fg: '#8250df' },\n 'function.method.call': { fg: '#8250df' },\n 'function.builtin': { fg: '#8250df' },\n 'function.macro': { fg: '#8250df' },\n 'type': { fg: '#953800' },\n 'type.builtin': { fg: '#953800' },\n 'constructor': { fg: '#953800' },\n 'attribute': { fg: '#0550ae' },\n 'tag': { fg: '#116329' },\n 'variable': { fg: TEXT },\n 'variable.builtin': { fg: '#0550ae' },\n 'variable.parameter': { fg: '#953800' },\n 'variable.member': { fg: '#0550ae' },\n 'property': { fg: '#0550ae' },\n 'operator': { fg: '#cf222e' },\n 'punctuation': { fg: DIM },\n 'punctuation.bracket': { fg: TEXT },\n 'punctuation.delimiter': { fg: TEXT },\n 'label': { fg: '#0550ae' },\n },\n}\n","import type { Theme } from '../theme'\n\n// ---------------------------------------------------------------------------\n// Vaporwave — neon-on-dark, ported from this-fifo/vaporwave-theme-vscode.\n//\n// Hex values come straight from the upstream `vaporwave-color-theme.json`\n// (terminal ANSI table + tokenColors). The signature pink (#E95378) carries\n// the brand role; the bright pink (#FF71CE) is reserved for the keyword\n// token so headings and keywords visually rhyme without competing.\n// ---------------------------------------------------------------------------\n\nconst PALETTE = {\n pink: '#E95378',\n pinkBright: '#FF71CE',\n cyan: '#01CDFE',\n cyanBright: '#59E1E3',\n blue: '#94D0FF',\n green: '#29D398',\n greenBright: '#09F7A0',\n yellow: '#FFFB96',\n red: '#F43E5C',\n text: '#D5D8DA',\n /**\n * ~70% of `text` — used for captions / helper / \"dim\" text so that\n * secondary copy is visually distinct from primary copy. Matches the\n * upstream theme's sidebar foreground (`#b7c5d3`) tonality.\n */\n textDim: '#B7C5D3',\n textBright: '#EEFFFF',\n comment: '#BBBBBB',\n muted: '#6C6F93',\n surface: '#2E303E',\n panel: '#232530',\n // One step below `panel` — mirrors the upstream theme's editor background\n // relative to widgets so modals continue to read as elevated.\n bgDeep: '#1a1c26',\n}\n\n/** Vaporwave, a dark theme with neon colors. */\nexport const VAPORWAVE_THEME: Theme = {\n id: 'vaporwave',\n label: 'Vaporwave',\n colors: {\n brand: PALETTE.pink,\n accent: PALETTE.greenBright,\n model: PALETTE.blue,\n warn: PALETTE.yellow,\n error: PALETTE.red,\n dim: PALETTE.textDim,\n mute: PALETTE.muted,\n border: PALETTE.surface,\n borderActive: PALETTE.muted,\n // The iconic vaporwave gradient — hot pink to electric cyan. The\n // fallback `brand → accent` would sweep pink → neon green, which\n // misses the synth-cassette aesthetic entirely.\n throbber: { from: PALETTE.pink, to: PALETTE.cyan },\n },\n select: {\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: PALETTE.pink,\n textColor: PALETTE.text,\n descriptionColor: PALETTE.muted,\n selectedDescriptionColor: PALETTE.text,\n },\n surfaces: {\n // Root paint — sits one tier below `modal` so overlaid panels still\n // read as elevated.\n background: PALETTE.bgDeep,\n // Upstream uses `#232530` for editor widgets / dropdowns — same elevation\n // role as our modal panels.\n modal: PALETTE.panel,\n // Chip pills — skills on the signature vaporwave pink (brand role)\n // and files on cyan (the upstream's secondary neon accent). Both\n // read unmistakably against the dark panel foreground.\n chips: {\n default: { bg: PALETTE.pink, fg: PALETTE.panel },\n skills: { bg: PALETTE.pink, fg: PALETTE.panel },\n files: { bg: PALETTE.cyan, fg: PALETTE.panel },\n },\n // `surface` is one shade above `panel` — a quiet purple-grey lift\n // that reads as \"active row\" without clashing with the neon pink.\n selection: PALETTE.surface,\n // Diff blocks — vaporwave doesn't ship desaturated red/green palette\n // tones, so we hand-mix dark wines + dark teals against `panel` for\n // the row paint and brighter neon `green` / `red` for the sign\n // glyph. Keeps the neon vibe without drowning the syntax-highlighted\n // code under saturated bands.\n diff: {\n addBg: '#1a3528',\n removeBg: '#3a1a23',\n addContentBg: '#234c39',\n removeContentBg: '#52232f',\n addFg: PALETTE.greenBright,\n removeFg: PALETTE.red,\n },\n },\n syntax: {\n 'default': { fg: PALETTE.text },\n\n // ---- markdown structure ----\n 'markup.heading': { fg: PALETTE.pink, bold: true },\n 'markup.heading.1': { fg: PALETTE.pink, bold: true },\n 'markup.heading.2': { fg: PALETTE.pinkBright, bold: true },\n 'markup.heading.3': { fg: PALETTE.blue, bold: true },\n 'markup.bold': { fg: PALETTE.textBright, bold: true },\n 'markup.strong': { fg: PALETTE.textBright, bold: true },\n 'markup.italic': { fg: PALETTE.greenBright, italic: true },\n 'markup.link': { fg: PALETTE.yellow, underline: true },\n 'markup.link.url': { fg: PALETTE.yellow, underline: true },\n 'markup.list': { fg: PALETTE.textBright },\n 'markup.raw': { fg: PALETTE.yellow },\n 'markup.raw.block': { fg: PALETTE.yellow },\n 'markup.quote': { fg: PALETTE.yellow, italic: true },\n\n // ---- code (mirrors the upstream tokenColors mapping) ----\n 'keyword': { fg: PALETTE.pinkBright, bold: true },\n 'keyword.import': { fg: PALETTE.pinkBright, bold: true },\n 'keyword.operator': { fg: PALETTE.comment },\n 'string': { fg: PALETTE.yellow },\n 'string.escape': { fg: PALETTE.greenBright, bold: true },\n 'character': { fg: PALETTE.yellow },\n 'comment': { fg: PALETTE.comment, italic: true },\n 'number': { fg: PALETTE.textBright },\n 'boolean': { fg: PALETTE.textBright },\n 'constant': { fg: PALETTE.textBright },\n 'constant.builtin': { fg: PALETTE.textBright },\n 'function': { fg: PALETTE.greenBright },\n 'function.call': { fg: PALETTE.greenBright },\n 'function.method': { fg: PALETTE.greenBright },\n 'function.method.call': { fg: PALETTE.greenBright },\n 'function.builtin': { fg: PALETTE.greenBright },\n 'function.macro': { fg: PALETTE.greenBright },\n 'type': { fg: PALETTE.greenBright },\n 'type.builtin': { fg: PALETTE.greenBright },\n 'constructor': { fg: PALETTE.greenBright },\n 'attribute': { fg: PALETTE.yellow },\n 'tag': { fg: PALETTE.blue },\n 'variable': { fg: PALETTE.blue },\n 'variable.builtin': { fg: PALETTE.cyanBright },\n 'variable.parameter': { fg: PALETTE.text },\n 'variable.member': { fg: PALETTE.blue },\n 'property': { fg: PALETTE.blue },\n 'operator': { fg: PALETTE.comment },\n 'punctuation': { fg: PALETTE.comment },\n 'punctuation.bracket': { fg: PALETTE.textBright },\n 'punctuation.delimiter': { fg: PALETTE.comment },\n 'label': { fg: PALETTE.cyan },\n },\n}\n","/**\n * Renderer-agnostic theme system.\n *\n * A `Theme` bundles every variable that can change visually between\n * \"themes\" — colors, select-row styling, code/markdown syntax highlight\n * tokens, panel backgrounds. Plain JSON: no OpenTUI dependency, no React,\n * no functions. The TUI consumes the theme by reading from `useTheme()`\n * and converting hex strings into OpenTUI's `RGBA`/`SyntaxStyle`; a future\n * GUI consumes the same theme by converting into CSS variables or Tailwind\n * tokens.\n *\n * Components should always read theme values through `useTheme()` /\n * `useColors()` so a runtime theme switch (Settings → Theme) re-paints\n * the whole tree. Importing a raw theme object directly bypasses the\n * context and pins the component to a single look.\n *\n * Built-in flavors (light, Catppuccin, Gruvbox, Crush, Vaporwave) live in `./themes/`. This file\n * just defines the shape + the default theme + the registry.\n */\n\nimport {\n CATPPUCCIN_FRAPPE,\n CATPPUCCIN_LATTE,\n CATPPUCCIN_MACCHIATO,\n CATPPUCCIN_MOCHA,\n} from './themes/catppuccin'\nimport { CRUSH_THEME } from './themes/crush'\nimport { GRUVBOX_DARK, GRUVBOX_LIGHT } from './themes/gruvbox'\nimport { LIGHT_THEME } from './themes/light'\nimport { VAPORWAVE_THEME } from './themes/vaporwave'\n\n/** Role-named color palette. Reused throughout the UI for text, borders, accents. */\nexport interface ThemeColors {\n /** Primary accent — selected text, brand emphasis (e.g. `▶` markers). */\n brand: string\n /** Success / progress accent — used sparingly. */\n accent: string\n /** Model badge accent (provider/model name in the footer, links). */\n model: string\n /** Warnings — busy spinner, approval picker border, esc hints. */\n warn: string\n /** Errors — `✗` prefix on error events, validation messages. */\n error: string\n /** Secondary text — captions, helper text, dim transcript lines. */\n dim: string\n /** Tertiary text — separators, descriptions, the `┃` tool-result bar. */\n mute: string\n /** Resting border color. */\n border: string\n /** Border color on focused / active elements. */\n borderActive: string\n /**\n * Optional gradient endpoints for the in-chat working throbber\n * (`<CrushThrobber>`). Falls back to `[brand, accent]` when unset.\n * Themes can pin a richer pair here — e.g. Crush's `Charple` →\n * `Dolly` purple-to-pink — without having to repurpose `accent`.\n */\n throbber?: { from: string, to: string }\n /**\n * Optional tone for the footer's session-cost indicator. Falls back\n * to `warn` when unset. Carved out as its own role because some\n * themes (e.g. Crush) intentionally bind `warn` to a non-yellow tone\n * and a separate \"money\" color reads more naturally on the footer.\n */\n money?: string\n}\n\n/** Select-component styling. Plain prop shape; both OpenTUI's `<select>` and any GUI equivalent can consume this. */\nexport interface ThemeSelect {\n /** Background of an unselected row. */\n backgroundColor: string\n /** Background of the focused row. */\n focusedBackgroundColor: string\n /** Background of the selected row. */\n selectedBackgroundColor: string\n /** Text color of the selected row. */\n selectedTextColor: string\n /** Text color of an unselected row. */\n textColor: string\n /** Description color of an unselected row. */\n descriptionColor: string\n /** Description color of the selected row. */\n selectedDescriptionColor: string\n}\n\n/** Background + foreground pair for a completion-reference chip pill. */\nexport interface ChipColor {\n /** Background paint — the pill itself. High-saturation by convention. */\n bg: string\n /** Foreground paint — the chip text. Pre-paired with {@link ChipColor.bg} for legibility. */\n fg: string\n}\n\n/**\n * Chip colors keyed by completion-provider id (`'skills'`, `'files'`, …).\n * `default` is the required fallback used by any provider id without an\n * explicit entry — keeps host-registered providers themable out of the\n * box. Use {@link resolveChipColor} to perform the kind-specific → default\n * lookup rather than indexing the map directly.\n */\n/**\n * Map of provider id → chip color pair. `default` is required so callers\n * always have a fallback; every other key is optional so direct indexing\n * (`chips['unknown']`) surfaces as `ChipColor | undefined` and nudges\n * consumers toward {@link resolveChipColor}, which encodes the fallback.\n */\nexport type ChipColorMap = { default: ChipColor } & Partial<Record<string, ChipColor>>\n\n/**\n * Look up the chip color pair for a provider id, falling back to\n * `chips.default` when the theme has no kind-specific entry. Mirrors\n * `resolveChipStyleId` so both rendering surfaces (submitted echo +\n * live textarea) share one canonical lookup rule.\n *\n * @param chips - The theme's chip color map.\n * @param providerId - Completion provider id to look up.\n */\nexport function resolveChipColor(chips: ChipColorMap, providerId: string): ChipColor {\n return chips[providerId] ?? chips.default\n}\n\n/** Panel / surface backgrounds. */\nexport interface ThemeSurfaces {\n /**\n * Solid paint for the app's root surface. Covers the whole TUI viewport\n * so transparent / translucent terminals don't show desktop windows\n * underneath. Conventionally one tier deeper than {@link modal} so\n * modal panels still read as elevated above the body.\n */\n background: string\n /** Background of an overlaid modal panel (settings, model picker, …). */\n modal: string\n /**\n * Completion-chip color pairs keyed by provider id. Built-in themes\n * ship distinct `skills` + `files` tones so the two reference kinds\n * read differently in both the submitted echo and the live textarea.\n */\n chips: ChipColorMap\n /**\n * Background paint for the selected turn's events in select-turn mode.\n * Subtle, low-saturation lift from the terminal default so the whole\n * span of the selected turn reads as one continuous highlighted block\n * without overpowering the foreground text. Inverse-tinted on the\n * light flavor (Latte) so the same visual role works there.\n */\n selection: string\n /**\n * Edit-diff color block. Drives the native `<diff>` renderable used\n * by {@link Settings.showEditDiffs}. Pre-mixed against each theme's\n * primary surface so terminals without true alpha-blend get a\n * legible \"subtle red / subtle green\" effect rather than a flat\n * saturated band.\n *\n * - `*Bg` row-level paint (gutter + content)\n * - `*ContentBg` content-only paint (overrides `*Bg` on the text\n * column). Set when a deeper hue should punch\n * through behind the syntax-highlighted code; omit\n * to let `*Bg` carry the full row.\n * - `*Fg` color for the `+` / `-` glyph in the sign gutter.\n */\n diff: DiffSurfaces\n}\n\n/** Per-row paints used by the native `<diff>` renderable. */\nexport interface DiffSurfaces {\n addBg: string\n removeBg: string\n contextBg?: string\n addContentBg?: string\n removeContentBg?: string\n addFg: string\n removeFg: string\n}\n\n/**\n * One entry in a `SyntaxStyles` map — what OpenTUI's `SyntaxStyle.fromStyles`\n * accepts, minus the `RGBA` conversion. Renderer-agnostic JSON.\n */\nexport interface SyntaxTokenStyle {\n /** Foreground color. */\n fg?: string\n /** Background color. */\n bg?: string\n /** Whether the text is bold. */\n bold?: boolean\n /** Whether the text is italic. */\n italic?: boolean\n /** Whether the text is underlined. */\n underline?: boolean\n /** Whether the text is dimmed. */\n dim?: boolean\n}\n\n/**\n * Map of Tree-sitter / markdown capture group → token style.\n *\n * Two flavours of keys live in the same table:\n * - `markup.*` — the markdown structure captures (heading, bold, italic,\n * list, quote, raw inline + block, link). OpenTUI's markdown parser\n * emits these for the markdown text itself.\n * - bare token names (`keyword`, `string`, `function`, …) — emitted by\n * the embedded language Tree-sitter grammars when a code fence\n * declares a language. OpenTUI passes the same `SyntaxStyle` down to\n * the fenced-code renderable, so this map drives both surfaces.\n */\nexport type SyntaxStyles = Record<string, SyntaxTokenStyle>\n\n/** Full theme bundle. */\nexport interface Theme {\n /** Stable identifier, used as the key in `BUILTIN_THEMES` and `Settings.theme`. */\n id: string\n /** Human-readable label shown in the settings picker. */\n label: string\n /** Semantic text and border colors. */\n colors: ThemeColors\n /** Styling of select lists. */\n select: ThemeSelect\n /** Panel and surface backgrounds. */\n surfaces: ThemeSurfaces\n /** Token styles for markdown and fenced code. */\n syntax: SyntaxStyles\n}\n\n// ---------------------------------------------------------------------------\n// Default theme — a cool blue-accent palette mapped to our role-named slots\n//\n// Source: a dark design-system palette + dark-theme semantic tokens. We\n// pick the dark variants because the TUI almost always renders on dark\n// terminals; the few light-terminal users get the same hues a step\n// brighter / cooler than the comparable light-theme tokens, which still\n// reads as \"brand blue / orange / red / green\" and remains accessible.\n//\n// Color-role mapping. Every \"accent\" slot stays inside the blue brand\n// cascade (brand-300 → brand-400 → brand-500 → brand-600) so the\n// chrome reads as one cool family rather than a mosaic of warm + cool\n// dots. Warm tones (orange, red) are reserved for genuine error /\n// danger contexts only:\n//\n// brand-600 borderActive #1488fc focused / active rims\n// brand-500 brand #2ba6ff signature accent — session title, ▶\n// brand-400 warn #53c4ff shortcut keys, spinner, accent numbers\n// brand-300 model #8adaff model id, links, soft brand sibling\n// green-500 accent #22c55e success — spawn markers, ✓\n// red-500 error #ef4444 errors, ✗ glyphs\n// neutral-400 dim #a3a3ac secondary text\n// neutral-600 mute #525258 separators, `┃` bar\n// neutral-700 border #3c3c41 resting borders\n//\n// `warn` lives in the brand cascade rather than orange so the hint\n// rows (which use it for every shortcut key) don't strafe orange dots\n// across an otherwise cool surface. The spinner + approval picker\n// pick up the same brand-tinted accent — reads as \"working / attention\"\n// without competing with the red of `error`.\n//\n// Defined as a local constant first so `BUILTIN_THEMES` references it\n// by name, and so the markdown-structure entries can interpolate the\n// role-named colors without redeclaring them.\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_COLORS: ThemeColors = {\n brand: '#2ba6ff', // brand-500\n accent: '#22c55e', // green-500 (success)\n model: '#8adaff', // brand-300 (soft sky)\n warn: '#53c4ff', // brand-400 (cool accent — keys, spinner, \"attention\")\n error: '#ef4444', // red-500 (danger)\n dim: '#a3a3ac', // neutral-400\n mute: '#525258', // neutral-600\n border: '#3c3c41', // neutral-700\n borderActive: '#1488fc', // brand-600\n // Throbber sweeps brand-500 → brand-300 — a brand-family blue\n // gradient that stays on-message instead of detouring through\n // `accent` green via the fallback.\n throbber: { from: '#2ba6ff', to: '#8adaff' },\n}\n\n/** The default dark theme. */\nexport const DEFAULT_THEME: Theme = {\n id: 'default',\n label: 'Default',\n colors: DEFAULT_COLORS,\n select: {\n // Transparent backgrounds keep the highlight bar from filling with a\n // different color than the surrounding box. The `▶` marker + brand-\n // colored selected text carry the focus affordance instead.\n backgroundColor: 'transparent',\n focusedBackgroundColor: 'transparent',\n selectedBackgroundColor: 'transparent',\n selectedTextColor: DEFAULT_COLORS.brand,\n textColor: DEFAULT_COLORS.dim,\n descriptionColor: DEFAULT_COLORS.mute,\n selectedDescriptionColor: DEFAULT_COLORS.dim,\n },\n surfaces: {\n // One tier below `modal` — neutral-1000-ish — so modal panels still\n // read as elevated above the body when both paint at the same time.\n background: '#0a0a0c',\n // The `--surface` dark tone — neutral-950.\n modal: '#111114',\n // Skills (slash-commands, user verbs) get the signature bold-brand\n // pill — saturated `brand-500` background with very light brand\n // text on top: primary action, attention-getting. Files (resource\n // references) get the *inverted* sibling — bright `brand-300`\n // background with deep `brand-950` text. Both pills are vibrant\n // and clearly in the brand family, but they sit on opposite ends\n // of the saturation/lightness axis, so they read as deliberately\n // paired counterparts rather than two pills competing for the\n // same visual role.\n chips: {\n default: { bg: DEFAULT_COLORS.brand, fg: '#eef9ff' },\n skills: { bg: DEFAULT_COLORS.brand, fg: '#eef9ff' },\n files: { bg: '#8adaff', fg: '#122f59' },\n },\n // A neutral lift: a selected turn reads as lifted, not as a blue wash\n // over the whole reply.\n selection: '#1c1c21',\n // Diff blocks — `green-950` / `red-950` pre-mixed over neutral-950 at\n // ~12% (the row paint) with brighter `green-900` / `red-900` at ~25%\n // for the content column so the code text contrasts cleanly against\n // the gutter. Sign glyph fg rides the role colors (`accent` / `error`)\n // for instant visual parity with `✓` / `✗`.\n diff: {\n addBg: '#0e2218',\n removeBg: '#2a1414',\n addContentBg: '#143728',\n removeContentBg: '#3d1d1d',\n addFg: '#22c55e',\n removeFg: '#ef4444',\n },\n },\n syntax: {\n // ---- markdown structure ----\n // Headings cascade through brand-500 → brand-400 → brand-300 so the\n // outline reads as one related family rather than three random\n // accents. Body text rides `--textPrimary` (`#fefeff`).\n 'default': { fg: '#fefeff' },\n 'markup.heading': { fg: '#2ba6ff', bold: true },\n 'markup.heading.1': { fg: '#2ba6ff', bold: true },\n 'markup.heading.2': { fg: '#53c4ff', bold: true },\n 'markup.heading.3': { fg: '#8adaff', bold: true },\n 'markup.bold': { fg: '#ffffff', bold: true },\n 'markup.strong': { fg: '#ffffff', bold: true },\n 'markup.italic': { fg: '#fefeff', italic: true },\n 'markup.link': { fg: DEFAULT_COLORS.model, underline: true },\n 'markup.link.url': { fg: DEFAULT_COLORS.model, underline: true },\n // Bullet markers in markdown rides the warm `orange-400` rather\n // than `warn` (cool brand-400). Lists are dense and\n // benefit from a hue that stands apart from headings + body text,\n // and warm tones are appropriate inside the rendered-markdown\n // surface where they don't accumulate into the chrome.\n 'markup.list': { fg: '#fb923c' },\n // Inline / block `code` rides brand-200 — readable on dark, distinct\n // from regular text + headings without leaving the brand family.\n 'markup.raw': { fg: '#bae7ff' },\n 'markup.raw.block': { fg: '#bae7ff' },\n 'markup.quote': { fg: DEFAULT_COLORS.dim, italic: true },\n\n // ---- code (Tree-sitter language tokens inside fenced blocks) ----\n // The palette has no purple/violet step, so we lean on green for functions\n // (callable / \"alive\") and reserve orange for types + parameters.\n // String constants live in brand-200, numeric/property tokens in\n // brand-300 so they read as one cool family against the warm types.\n 'keyword': { fg: '#f87171', bold: true }, // dangerHighlight\n 'keyword.import': { fg: '#f87171', bold: true },\n 'keyword.operator': { fg: '#f87171' },\n 'string': { fg: '#bae7ff' }, // brand-200\n 'string.escape': { fg: '#bae7ff', bold: true },\n 'character': { fg: '#bae7ff' },\n 'comment': { fg: '#73737b', italic: true }, // neutral-500\n 'number': { fg: '#8adaff' }, // brand-300\n 'boolean': { fg: '#8adaff' },\n 'constant': { fg: '#8adaff' },\n 'constant.builtin': { fg: '#8adaff' },\n 'function': { fg: '#86efac' }, // green-300\n 'function.call': { fg: '#86efac' },\n 'function.method': { fg: '#86efac' },\n 'function.method.call': { fg: '#86efac' },\n 'function.builtin': { fg: '#86efac' },\n 'function.macro': { fg: '#86efac' },\n 'type': { fg: '#fb923c' }, // warningHighlight (orange-400)\n 'type.builtin': { fg: '#fb923c' },\n 'constructor': { fg: '#fb923c' },\n 'attribute': { fg: '#fb923c' },\n 'tag': { fg: '#4ade80' }, // green-400\n 'variable': { fg: '#fefeff' },\n 'variable.builtin': { fg: '#8adaff' },\n 'variable.parameter': { fg: '#fb923c' },\n 'variable.member': { fg: '#8adaff' },\n 'property': { fg: '#8adaff' },\n 'operator': { fg: '#f87171' },\n 'punctuation': { fg: DEFAULT_COLORS.mute },\n 'punctuation.bracket': { fg: '#fefeff' },\n 'punctuation.delimiter': { fg: '#d4d4dd' }, // neutral-300\n 'label': { fg: '#8adaff' },\n },\n}\n\n/**\n * Built-in theme registry, keyed by `theme.id`. The TUI looks up the active\n * theme here using `Settings.theme`; unknown ids fall back to\n * `DEFAULT_THEME`. Extensions add themes with `ctx.registerTheme`. The\n * resolver receives them as `extraThemes`, and built-ins win on an id collision.\n *\n * Insertion order is the picker cycle order — keep `default` first so a\n * fresh install (no `theme` in `state.json`) sees the default theme\n * before the others.\n */\nexport const BUILTIN_THEMES: Readonly<Record<string, Theme>> = {\n [DEFAULT_THEME.id]: DEFAULT_THEME,\n [LIGHT_THEME.id]: LIGHT_THEME,\n [CATPPUCCIN_MOCHA.id]: CATPPUCCIN_MOCHA,\n [CATPPUCCIN_MACCHIATO.id]: CATPPUCCIN_MACCHIATO,\n [CATPPUCCIN_FRAPPE.id]: CATPPUCCIN_FRAPPE,\n [CATPPUCCIN_LATTE.id]: CATPPUCCIN_LATTE,\n [GRUVBOX_DARK.id]: GRUVBOX_DARK,\n [GRUVBOX_LIGHT.id]: GRUVBOX_LIGHT,\n [CRUSH_THEME.id]: CRUSH_THEME,\n [VAPORWAVE_THEME.id]: VAPORWAVE_THEME,\n}\n\n/**\n * Resolve a theme id to its full `Theme`, falling back to default on unknown ids.\n *\n * @param id - Theme id, usually from `Settings.theme`.\n * @param extraThemes - Additional themes keyed by id. Built-ins win on an id collision.\n */\nexport function resolveTheme(\n id: string | undefined,\n extraThemes?: Readonly<Record<string, Theme>>,\n): Theme {\n if (id) {\n // Built-ins win on id collision so a third-party theme can't shadow\n // the user's \"default\" / \"catppuccin-mocha\" pick — those names are\n // the contract surface for everyone.\n if (BUILTIN_THEMES[id])\n return BUILTIN_THEMES[id]\n if (extraThemes && extraThemes[id])\n return extraThemes[id]\n }\n return DEFAULT_THEME\n}\n","/**\n * The settings catalog: bounds, invariants, and the toggle / choice / input\n * tables the settings UIs render. Renderer-neutral and React-free, so hosts\n * and clients (`zidane/ipc/remote`, the daemon) read it without React.\n * `settings-context.tsx` adds the React provider on top and re-exports this.\n */\nimport type { ApprovalMode, Settings } from './types'\nimport { decisionsEnabled, DEFAULT_SETTINGS } from './settings-defaults'\nimport { BUILTIN_THEMES } from './theme'\n\nexport { DEFAULT_SETTINGS }\n\n// ---------------------------------------------------------------------------\n// Bounds\n// ---------------------------------------------------------------------------\n\n/** Lowest and highest `targetFps` that `clampFps` lets through. */\nconst MIN_TARGET_FPS = 1\nconst MAX_TARGET_FPS = 240\n\n/**\n * Hard-clamp a `targetFps` value to a safe range (1 to 240) before handing it\n * to the renderer. Rounds to an integer. A non-finite or non-positive value\n * falls back to `DEFAULT_SETTINGS.targetFps`. Defends against an out-of-band\n * edit to `state.json` (`0`, negative, `NaN`, absurd values) silently\n * pegging the loop or tripping the frame-time math. The settings modal only\n * exposes `30 / 60 / 120` so the typical path never trips the clamp; this\n * guard exists for the \"user hand-edited state.json\" case.\n *\n * @param value - The stored `targetFps` value.\n */\nexport function clampFps(value: number): number {\n if (!Number.isFinite(value) || value <= 0)\n return DEFAULT_SETTINGS.targetFps\n return Math.min(MAX_TARGET_FPS, Math.max(MIN_TARGET_FPS, Math.round(value)))\n}\n\n/**\n * Keys of `Settings` whose value type is exactly `boolean`. Used to type\n * the toggle table so `SETTINGS_TOGGLES.key` only ever points to a\n * boolean-valued setting — string- and array-valued settings (theme,\n * enabledSkills, …) live in `SETTINGS_CHOICES` or actions.\n *\n * `-?` strips optionality from the mapped output so `Settings[K]` doesn't\n * silently broaden into `T | undefined` and short-circuit the `extends\n * boolean` check via `undefined`.\n */\nexport type BooleanSettingKey = {\n [K in keyof Settings]-?: Settings[K] extends boolean ? K : never\n}[keyof Settings]\n\n/**\n * Setting categories — drives the tab grouping in the TUI's\n * `SettingsModal` and, more importantly, gives any embedder (GUI,\n * web settings panel, …) a stable taxonomy to bucket settings under\n * without re-hardcoding the split.\n *\n * - `'agent'` — agent behaviour, capabilities, persistence,\n * data handling, auth. \"What zidane DOES.\"\n * - `'ui'` — display, rendering, theming, animations,\n * chrome density, keybindings. \"How zidane LOOKS\n * and feels.\"\n *\n * Borderline calls (`showAllProjects`, `hideSubagentOutput`) are documented\n * inline at their rows.\n */\nexport type SettingsCategory = 'agent' | 'ui'\n\n/** Display data for one {@link SettingsCategory}. */\nexport interface SettingsCategoryDescriptor {\n /** The category this entry describes. */\n id: SettingsCategory\n /** Display label — used by the TUI tab strip + any GUI tab/section header. */\n label: string\n /** One-line gloss the GUI can show as a section subtitle. The TUI omits this. */\n description: string\n}\n\n/**\n * Ordered list of categories. Display order in any consumer (TUI tabs,\n * GUI sidebar, settings JSON dump) should match this array — keeps\n * mental model consistent across surfaces.\n */\nexport const SETTINGS_CATEGORIES: readonly SettingsCategoryDescriptor[] = [\n { id: 'agent', label: 'Agent', description: 'behavior, capabilities, persistence, auth' },\n { id: 'ui', label: 'UI', description: 'display, themes, animations, keybindings' },\n]\n\n/**\n * Static description of every togglable setting, in display order. The TUI's\n * `SettingsModal` and the GUI settings panel build their row list\n * from this so labels/descriptions stay in one place.\n */\nexport interface SettingsToggle {\n /** Setting the row flips. */\n key: BooleanSettingKey\n /** Row label. */\n label: string\n /** One-line explanation of the setting. */\n description: string\n /** Tab the row belongs to. */\n category: SettingsCategory\n /**\n * Another boolean setting this one is meaningless without. Renderers grey\n * the row out and say so while the requirement is off; the write layer\n * (`enforceSettingsInvariants`) guarantees the value can never be `true`\n * while the requirement is `false`, whichever client or file wrote it.\n */\n requires?: BooleanSettingKey\n /**\n * The setting drives something only the desktop app shows (its browser,\n * its terminals). The TUI still lets you change it, and says so.\n */\n desktopOnly?: true\n /**\n * Env var of the feature gate's kill switch (`FEATURE_GATES`). While it is\n * `'1'` the feature is off whatever the setting says, so renderers grey the\n * row out and name the variable.\n */\n killSwitchEnv?: string\n}\n\n/**\n * Section headers for the settings lists: each tab shows its rows grouped\n * under these titles, in this order. A key missing from the table lands in\n * `Other` at the end, so a new setting still shows up somewhere.\n */\nexport const SETTINGS_SECTIONS: readonly { title: string, keys: readonly string[] }[] = [\n { title: 'Sessions', keys: ['resumeLastSession', 'useDaemon', 'remoteHosts', 'orchestration', 'checkForUpdates', 'showAllProjects', 'spaces'] },\n { title: 'Guardrails', keys: ['approvalMode', 'interactionMode'] },\n { title: 'Sandbox', keys: ['sandbox', 'sandboxNetwork', 'sandboxAllowWrite'] },\n { title: 'Project trust', keys: ['loadProjectExtensions', 'importForeignConfigs', 'importRulerConfigs'] },\n { title: 'Context', keys: ['autoCompact', 'autoCompactThreshold', 'persistToolResults', 'stableToolList', 'freezeSessionPrompt', 'compactBeforeCacheExpiry', 'compactToolCatalog', 'userInstructionsScope', 'thinkingBinding'] },\n { title: 'Experimental', keys: ['codemode', 'codemodeShowCalls'] },\n { title: 'Models', keys: ['subagentModels', 'imageGeneration', 'resumeOnMaxTokens', 'maxOutputTokens', 'retryMaxAttempts', 'reauth', 'decisions', 'decision-model', 'decision-model-test', 'autoTitle'] },\n { title: 'Run limits', keys: ['maxTurns', 'maxCostUsd', 'maxTotalTokens', 'maxWallMinutes', 'maxParallelSubagents'] },\n { title: 'Composer', keys: ['queueMessages', 'attachmentsEnabled', 'externalEditor', 'inlineAutocomplete'] },\n { title: 'Usage', keys: ['subscriptionUsage', 'showUsageIndicator'] },\n { title: 'Transcript', keys: ['transcriptDensity', 'showRowIcons', 'showThinking', 'thinkingAutoExpand', 'hideSubagentOutput', 'showToolResults', 'toolCallDisplay', 'groupToolCalls', 'showEditDiffs', 'editDiffDisplay', 'showFullShellOutput', 'showRunReceipt', 'showCacheNotices', 'showCompactionSummary', 'smoothStreaming', 'showThrobber', 'artifacts', 'preserveScroll'] },\n { title: 'Footer', keys: ['uiMode', 'showTodoIndicator'] },\n { title: 'Look and feel', keys: ['theme', 'targetFps', 'mouseInteractions', 'ctrlCBehavior', 'openIn', 'keybindings'] },\n { title: 'Terminal tab', keys: ['terminalTitle', 'sessionIcon', 'attentionIcon', 'activeIcon'] },\n { title: 'Desktop app', keys: ['browser', 'browserAutoShow', 'browserAgent', 'terminal', 'terminalAgent', 'terminalAgentTasks', 'closeTerminalOnCleanExit', 'confirmGitSync', 'sidebarRunDetails', 'promptSuggestions'] },\n { title: 'Notifications', keys: ['notifications', 'notificationSound'] },\n { title: 'Logs', keys: ['fileLogging'] },\n]\n\n/**\n * Words people search for that a row's label and description don't say\n * (`finder` for `openIn`). Settings search in the TUI and the desktop app\n * matches these next to the label, description and raw key.\n */\nexport const SETTINGS_KEYWORDS: Readonly<Record<string, readonly string[]>> = {\n openIn: ['finder', 'editor', 'vscode', 'cursor', 'external', 'panel', 'click'],\n transcriptDensity: ['compact', 'condensed', 'fold', 'classic', 'full', 'layout'],\n groupToolCalls: ['compact', 'batch', 'collapse', 'fold'],\n showRunReceipt: ['receipt', 'details', 'tokens', 'cost', 'stats'],\n showRowIcons: ['badges', 'dots', 'avatars', 'gutter', 'timeline'],\n showCacheNotices: ['prompt cache', 'cache hit', 'reasoning dropped', 'thinking dropped'],\n showThinking: ['reasoning', 'thoughts'],\n thinkingAutoExpand: ['reasoning', 'thoughts', 'expand', 'open', 'live'],\n thinkingBinding: ['reasoning', 'thoughts', 'signature'],\n approvalMode: ['approval', 'approve', 'permissions', 'ask', 'auto approve', 'yolo', 'safe mode'],\n interactionMode: ['questions', 'ask user', 'plan'],\n notifications: ['notification', 'notify', 'alert', 'badge', 'banner'],\n notificationSound: ['notification', 'sound', 'chime', 'beep'],\n autoCompact: ['compact', 'summarize', 'context window'],\n autoCompactThreshold: ['compact', 'summarize', 'context window'],\n useDaemon: ['daemon', 'background', 'server', 'terminal'],\n orchestration: ['orchestrator', 'main session', 'daemon'],\n sidebarRunDetails: ['sidebar', 'status', 'commits', 'pull requests'],\n inlineAutocomplete: ['autocomplete', 'ghost text', 'completion', 'suggest'],\n promptSuggestions: ['suggestion', 'next prompt', 'follow-up'],\n preserveScroll: ['remember', 'restore', 'switch', 'jump'],\n queueMessages: ['queue', 'send while running', 'steer'],\n maxCostUsd: ['budget', 'spend', 'money', 'dollars'],\n maxParallelSubagents: ['concurrency', 'concurrent', 'simultaneous', 'spawn', 'sub-agents'],\n sandbox: ['isolation', 'seatbelt', 'container'],\n confirmGitSync: ['git', 'push', 'pull', 'sync'],\n theme: ['color', 'colors', 'dark mode', 'light mode'],\n}\n\n/**\n * A row's search keywords (`SETTINGS_KEYWORDS`), empty when it has none.\n *\n * @param key - Settings key of the row.\n */\nexport function settingKeywords(key: string): readonly string[] {\n return SETTINGS_KEYWORDS[key] ?? []\n}\n\n/** The section a settings key belongs to, and its position for sorting (section, then row). */\nexport function settingsSectionOf(key: string): { title: string, order: number } {\n const i = SETTINGS_SECTIONS.findIndex(section => section.keys.includes(key))\n return i < 0\n ? { title: 'Other', order: SETTINGS_SECTIONS.length * 100 }\n : { title: SETTINGS_SECTIONS[i]!.title, order: i * 100 + SETTINGS_SECTIONS[i]!.keys.indexOf(key) }\n}\n\n/** Every boolean setting the settings UI lists, in display order. */\nexport const SETTINGS_TOGGLES: readonly SettingsToggle[] = [\n // ----- Agent (behaviour / data handling) -------------------------------\n { category: 'agent', key: 'orchestration', requires: 'useDaemon', label: 'Main session', description: 'Pin a session that starts, steers and reads your other sessions. Needs the daemon.' },\n { category: 'agent', key: 'useDaemon', label: 'Use daemon runtime', description: 'Run sessions in a background process, the daemon. Runs keep going when windows close, and show in every window. Applies to new sessions.' },\n { category: 'agent', key: 'remoteHosts', killSwitchEnv: 'ZIDANE_NO_REMOTE', label: 'Remote hosts', description: 'Run sessions on other machines through zidane-server.' },\n { category: 'agent', key: 'resumeLastSession', label: 'Start from last session', description: 'Open the last session on launch instead of the sessions list.' },\n { category: 'agent', key: 'persistToolResults', label: 'Persist large tool results', description: 'Save tool outputs over 8 KB to disk and keep a preview in the chat.' },\n { category: 'agent', key: 'stableToolList', label: 'Stable tool list (call_tool)', description: 'Use found MCP tools through call_tool so the prompt cache stays valid. Off adds them to the tool list instead. Applies to new sessions.' },\n { category: 'agent', key: 'freezeSessionPrompt', label: 'Freeze session prompt', description: 'Keep each session\\'s system prompt as its first run saw it and tell the model about later changes, so the prompt cache stays valid. /refresh re-reads it.' },\n { category: 'agent', key: 'compactBeforeCacheExpiry', label: 'Compact before the cache expires', description: 'Experimental. When a long session sits idle, compact it a minute before its prompt cache runs out, so your next message reads a short summary instead of re-reading the whole conversation.' },\n { category: 'agent', key: 'compactToolCatalog', label: 'Short MCP tool list', description: 'Experimental. List MCP tools by name only in the prompt; the model looks up a tool before using it. Saves tokens when many tools are connected. Applies to new sessions.' },\n { category: 'agent', key: 'codemodeShowCalls', requires: 'codemode', label: 'Show codemode tool calls', description: 'List the calls each codemode script makes under its row. Calls that start a subagent always show.' },\n { category: 'agent', key: 'codemode', label: 'Codemode', description: 'The model runs several tool calls at once, in one short script inside a sandbox.' },\n { category: 'agent', key: 'sandbox', label: 'Sandbox shell commands', description: 'Keep the commands and edits of the agent inside the project, and hide your credentials from them. MCP servers and your own ! commands run outside the sandbox. Applies to new sessions.' },\n { category: 'agent', key: 'loadProjectExtensions', label: 'Load project extensions', description: 'Run the extensions of this project. They can run any code on your computer.' },\n { category: 'agent', key: 'importForeignConfigs', label: 'Import configurations from other agents', description: 'Use other agents\\' servers, skills, commands and subagents. Imported servers run commands from files zidane does not own.' },\n { category: 'agent', key: 'importRulerConfigs', label: 'Support Ruler configuration (.ruler)', description: 'Read .ruler folders. Their servers need \"Import configurations from other agents\".' },\n { category: 'agent', key: 'attachmentsEnabled', label: 'Paste attachments', description: 'Turn dropped files and long pastes into attachments.' },\n { category: 'agent', key: 'externalEditor', label: 'Edit prompt in $EDITOR', description: 'Press ctrl+g to write the prompt in $EDITOR.' },\n { category: 'agent', key: 'inlineAutocomplete', label: 'Inline autocomplete', description: 'Suggest the rest of a path or command as you type. Press Tab to accept.' },\n { category: 'agent', key: 'promptSuggestions', desktopOnly: true, label: 'Suggest the next prompt', description: 'After a run, suggest a next message in the empty composer. Uses the text model.' },\n { category: 'agent', key: 'autoCompact', label: 'Auto-compact', description: 'Summarize the conversation when the context passes the threshold below.' },\n { category: 'agent', key: 'queueMessages', label: 'Queue messages', description: 'Hold messages sent during a run until it ends. When off, they go into the running turn.' },\n { category: 'agent', key: 'subagentModels', label: 'Allow subagents to use different models', description: 'Let the agent hand work to cheaper models.' },\n { category: 'agent', key: 'imageGeneration', label: 'Image generation', description: 'Let the agent generate images with your providers\\' image models. Each image is billed by the provider.' },\n { category: 'agent', key: 'decisions', label: 'Decisions', description: 'Hooks and extensions ask a decision model for quick yes/no, choice and score answers. Your provider bills each call.' },\n { category: 'agent', key: 'autoTitle', requires: 'decisions', label: 'Auto-update session titles', description: 'Title sessions after their first run, and rename them when the topic changes. Titles that you typed stay.' },\n { category: 'agent', key: 'resumeOnMaxTokens', label: 'Auto-resume on output limit', description: 'Keep going when an answer hits the model\\'s output limit.' },\n { category: 'agent', key: 'checkForUpdates', label: 'Check for updates', description: 'Check daily for a new release and show it in the footer.' },\n { category: 'agent', key: 'subscriptionUsage', label: 'Check usage', description: 'Fetch plan limits and credits from signed-in providers and GitHub.' },\n // ----- UI (display / rendering) ----------------------------------------\n // `showAllProjects` / `hideSubagentOutput` are arguably feature flags\n // but their visible effect is purely \"what shows up in the transcript /\n // sessions list\" — bucketing as UI keeps the Agent tab focused on\n // behaviour the agent observes, not what the user sees.\n { category: 'ui', key: 'spaces', label: 'Spaces', description: 'Group sessions into spaces, like Personal and Work, each with its own default model.' },\n { category: 'ui', key: 'showAllProjects', label: 'All projects', description: 'List sessions from every project, not only this one.' },\n { category: 'ui', key: 'showRowIcons', desktopOnly: true, label: 'Row icons', description: 'Show an icon next to each message and step.' },\n { category: 'ui', key: 'hideSubagentOutput', label: 'Hide subagent output', description: 'Fold subagent runs down to their start and finish lines.' },\n { category: 'ui', key: 'showThinking', label: 'Thinking blocks', description: 'Show the agent\\'s reasoning in the chat.' },\n { category: 'ui', key: 'thinkingAutoExpand', desktopOnly: true, label: 'Expand thinking while it streams', description: 'Keep a thinking block open while the agent reasons.' },\n { category: 'ui', key: 'showToolResults', label: 'Tool outputs', description: 'Show the output under each tool call.' },\n { category: 'ui', key: 'groupToolCalls', label: 'Group tool calls', description: 'Fold each exchange\\'s tool calls into one row.' },\n { category: 'ui', key: 'showFullShellOutput', label: 'Full shell output', description: 'Show every line of ! command output, not only the last 10.' },\n { category: 'ui', key: 'showRunReceipt', label: 'Run receipt', description: 'Show model, time, cost and tokens after each run.' },\n { category: 'ui', key: 'showCacheNotices', label: 'Cache notices', description: 'Add a row to the chat when the prompt cache expires or resets, or the provider drops earlier reasoning.' },\n { category: 'ui', key: 'showEditDiffs', label: 'Edit diffs', description: 'Show file edits as diffs.' },\n { category: 'ui', key: 'showCompactionSummary', label: 'Compaction summaries', description: 'Show the summary text under the compaction line.' },\n { category: 'ui', key: 'smoothStreaming', label: 'Smooth streaming', description: 'Reveal replies character by character as they stream.' },\n { category: 'ui', key: 'showTodoIndicator', label: 'Todo indicator', description: 'Show the todo count in the footer. ctrl+t opens the list.' },\n { category: 'ui', key: 'showUsageIndicator', label: 'Usage indicator', description: 'Show plan usage in the footer. ctrl+p opens the panel.' },\n { category: 'ui', key: 'showThrobber', label: 'Streaming throbber', description: 'Animate an indicator while the agent works.' },\n { category: 'ui', key: 'artifacts', label: 'Artifacts', description: 'Track each session\\'s pull requests, branches, commits and files.' },\n { category: 'ui', key: 'preserveScroll', desktopOnly: true, label: 'Keep scroll position', description: 'Reopen each conversation where you left it.' },\n { category: 'ui', key: 'browser', desktopOnly: true, label: 'Browser tab', description: 'Show a browser tab next to the chat to preview your app.' },\n // No `requires: 'browser'` on these two: that would force them off for good while\n // the browser is off. They are simply ignored then, and come back as they were.\n { category: 'ui', key: 'browserAutoShow', desktopOnly: true, label: 'Show the browser when the agent uses it', description: 'Open the browser tab when the agent starts using it.' },\n { category: 'agent', key: 'browserAgent', desktopOnly: true, label: 'Agent can use the browser', description: 'Let the agent open, read, click and type in pages to check its work.' },\n { category: 'ui', key: 'terminal', desktopOnly: true, label: 'Terminals', description: 'Show terminals next to the chat. They run where the session runs.' },\n { category: 'agent', key: 'terminalAgent', desktopOnly: true, requires: 'terminal', label: 'Agent can use your terminals', description: 'Let the agent read your terminals and type in them after you approve.' },\n { category: 'agent', key: 'terminalAgentTasks', desktopOnly: true, requires: 'terminal', label: 'Agent\\'s background tasks in terminals', description: 'Give each background command the agent starts its own terminal tab.' },\n { category: 'ui', key: 'closeTerminalOnCleanExit', desktopOnly: true, requires: 'terminal', label: 'Close terminals that exit cleanly', description: 'Close a terminal once its shell exits cleanly. Failed ones stay open.' },\n { category: 'ui', key: 'confirmGitSync', desktopOnly: true, label: 'Ask before syncing', description: 'Confirm before the git bar pulls, pushes or publishes your branch.' },\n { category: 'ui', key: 'sidebarRunDetails', desktopOnly: true, label: 'Run details in the sidebar', description: 'Show each run\\'s activity, time, commits and pull requests in the sidebar.' },\n { category: 'ui', key: 'notifications', desktopOnly: true, label: 'Notifications', description: 'If no Zidane window is focused, notify you when a run ends or needs you.' },\n // No `requires: 'notifications'`: that would force it off for good while notifications are off.\n { category: 'ui', key: 'notificationSound', desktopOnly: true, label: 'Notification sound', description: 'Play the system sound with each notification.' },\n { category: 'ui', key: 'fileLogging', label: 'File logging', description: 'Save this session\\'s logs to ~/.zidane/logs.' },\n { category: 'ui', key: 'mouseInteractions', label: 'Clickable UI', description: 'Click, hover and scroll rows. When off, the terminal\\'s own selection works.' },\n]\n\n/**\n * Return type of {@link enforceSettingsInvariants}: the input shape with every\n * boolean setting widened to `boolean`. The function exists to flip toggles,\n * so a literal `true` from a call-site object literal must not survive into\n * the result type — it would let `expect(next.x).toBe(false)` fail to compile\n * against a value that is, in fact, `false`.\n */\nexport type WithInvariants<T> = { [K in keyof T]: K extends BooleanSettingKey ? boolean : T[K] }\n\n/**\n * Cross-setting invariants, applied at EVERY write: resets every toggle whose\n * `requires` setting is off.\n *\n * Settings are a shared file with three writers (the TUI, the GUI main\n * process, the daemon) and no lock; a rule enforced in one client is a rule\n * the others break. So this is the single definition, derived from the\n * `requires` declarations on the toggle rows themselves — adding a\n * dependency is one field on one row, and the UI hint and the write-time\n * guarantee follow from it together.\n *\n * Pure and idempotent: returns the same object when nothing changes, so React\n * state and file writers can short-circuit on identity.\n *\n * @param settings - The settings to check.\n */\nexport function enforceSettingsInvariants<T extends Partial<Settings>>(settings: T): WithInvariants<T> {\n let next: T | null = null\n for (const row of SETTINGS_TOGGLES) {\n if (!row.requires)\n continue\n if ((next ?? settings)[row.key] === true && !requirementMet(next ?? settings, row.requires))\n next = { ...(next ?? settings), [row.key]: false }\n }\n return (next ?? settings) as WithInvariants<T>\n}\n\n/**\n * Whether a toggle's `requires` setting is on. `decisions` is also on while\n * approvals use Model decision (`decisionsEnabled`).\n *\n * @param settings - The settings to check.\n * @param key - The required setting.\n */\nexport function requirementMet(settings: Partial<Settings>, key: BooleanSettingKey): boolean {\n return key === 'decisions' ? decisionsEnabled(settings) : settings[key] === true\n}\n\n/**\n * Why a toggle is on whatever its own value says: `decisions` while\n * approvals use Model decision, which needs its answers. Renderers show the\n * row on and inert with this note. `undefined` when the row's value applies.\n *\n * @param key - The toggle's setting.\n * @param settings - The settings to check.\n */\nexport function toggleHeldOn(key: BooleanSettingKey, settings: Pick<Settings, 'approvalMode'>): string | undefined {\n return key === 'decisions' && settings.approvalMode === 'decide' ? 'On for Model decision approvals' : undefined\n}\n\n/**\n * String-valued settings that pick between a known set of options. The\n * `SettingsModal` renders these as one row showing the active label, where\n * `enter` cycles to the next option (wrapping back to the first). Same\n * shape any GUI settings panel can consume — render the options array as a\n * dropdown or segmented control.\n *\n * Keep `options` in stable display order; cycling depends on it.\n */\nexport interface SettingsChoice<K extends keyof Settings = keyof Settings> {\n /** Setting the row writes. */\n key: K\n /** Row label. */\n label: string\n /** One-line explanation of the setting. */\n description: string\n /** Selectable values with their labels, in cycling order. */\n options: readonly { value: Settings[K], label: string }[]\n /** Tab the row belongs to. */\n category: SettingsCategory\n}\n\n/** The `approvalMode` options, with what each one does: the one list every settings UI shows. */\nexport const APPROVAL_MODE_OPTIONS: readonly { value: ApprovalMode, label: string, description: string }[] = [\n { value: 'ask', label: 'Ask', description: 'Ask you before each tool call, except commands you safelisted.' },\n { value: 'decide', label: 'Model decision', description: 'A small model, the decision model, approves safe calls and blocks risky ones. If it is not sure, it asks you.' },\n { value: 'off', label: 'Full access', description: 'Run every tool call without asking. Typing into a terminal you opened still asks.' },\n]\n\n/** Every option-valued setting the settings UI lists, in display order. */\nexport const SETTINGS_CHOICES: readonly SettingsChoice[] = [\n // ----- Agent (behaviour / data handling) -------------------------------\n {\n category: 'agent',\n key: 'approvalMode',\n label: 'Tool approvals',\n description: 'Who approves tool calls: you, the decision model, or nobody. Commands you safelisted always run.',\n options: APPROVAL_MODE_OPTIONS,\n },\n {\n category: 'agent',\n key: 'interactionMode',\n label: 'Interaction mode',\n description: 'How the agent handles questions: ask you, answer from the repository, or turn questions off.',\n options: [\n { value: 'ask', label: 'Ask normally' },\n { value: 'skip', label: 'Skip interactions' },\n { value: 'disabled', label: 'Disable tools' },\n ],\n },\n {\n category: 'ui',\n key: 'openIn',\n label: 'Open files and diffs in',\n description: 'Where clicked files and diffs open: your editor or the desktop panels.',\n options: [\n { value: 'editor', label: '$EDITOR' },\n { value: 'panel', label: 'Panels' },\n ],\n },\n {\n category: 'agent',\n key: 'sandboxNetwork',\n label: 'Sandbox network',\n description: 'Allow keeps installs and git working. Deny blocks every connection.',\n options: [\n { value: 'allow', label: 'Allow' },\n { value: 'deny', label: 'Deny' },\n ],\n },\n {\n category: 'agent',\n key: 'autoCompactThreshold',\n label: 'Auto-compact threshold',\n description: 'How full the context gets before zidane summarizes it.',\n options: [\n { value: 0.6, label: '60%' },\n { value: 0.7, label: '70%' },\n { value: 0.8, label: '80%' },\n { value: 0.9, label: '90%' },\n ],\n },\n {\n category: 'agent',\n key: 'userInstructionsScope',\n label: 'User instructions',\n description: 'Which AGENTS.md and CLAUDE.md files the agent reads.',\n options: [\n { value: 'both', label: 'Both (merged)' },\n { value: 'user', label: 'User only' },\n { value: 'project', label: 'Project only' },\n { value: 'none', label: 'None' },\n ],\n },\n {\n category: 'agent',\n key: 'maxOutputTokens',\n label: 'Max output tokens',\n description: 'The most the model may write per turn.',\n options: [\n { value: 0, label: 'Model max' },\n { value: 8192, label: '8K' },\n { value: 16384, label: '16K' },\n { value: 32000, label: '32K' },\n { value: 64000, label: '64K' },\n ],\n },\n {\n category: 'agent',\n key: 'retryMaxAttempts',\n label: 'Provider retry attempts',\n description: 'How many times to retry a failed or stalled provider call.',\n options: [\n { value: 0, label: 'Default (3)' },\n { value: 1, label: '1 (no retry)' },\n { value: 2, label: '2' },\n { value: 3, label: '3' },\n { value: 5, label: '5' },\n { value: 8, label: '8' },\n ],\n },\n {\n category: 'agent',\n key: 'maxTurns',\n label: 'Max turns per run',\n description: 'Stop a run after this many turns.',\n options: [\n { value: 0, label: 'Unlimited' },\n { value: 25, label: '25' },\n { value: 50, label: '50' },\n { value: 100, label: '100' },\n { value: 200, label: '200' },\n ],\n },\n {\n category: 'agent',\n key: 'maxCostUsd',\n label: 'Max cost per run',\n description: 'Stop a run once its estimated cost passes this amount.',\n options: [\n { value: 0, label: 'Unlimited' },\n { value: 1, label: '$1' },\n { value: 5, label: '$5' },\n { value: 10, label: '$10' },\n { value: 25, label: '$25' },\n ],\n },\n {\n category: 'agent',\n key: 'maxTotalTokens',\n label: 'Max tokens per run',\n description: 'Stop a run once it has used this many tokens.',\n options: [\n { value: 0, label: 'Unlimited' },\n { value: 500_000, label: '500K' },\n { value: 1_000_000, label: '1M' },\n { value: 2_000_000, label: '2M' },\n { value: 5_000_000, label: '5M' },\n ],\n },\n {\n category: 'agent',\n key: 'maxWallMinutes',\n label: 'Max run time',\n description: 'Stop a run after this much time.',\n options: [\n { value: 0, label: 'Unlimited' },\n { value: 5, label: '5 min' },\n { value: 15, label: '15 min' },\n { value: 30, label: '30 min' },\n { value: 60, label: '60 min' },\n ],\n },\n {\n category: 'agent',\n key: 'maxParallelSubagents',\n label: 'Max parallel subagents',\n description: 'How many subagents a session runs at once. More wait for a free slot.',\n options: [\n { value: 1, label: '1' },\n { value: 2, label: '2' },\n { value: 3, label: '3' },\n { value: 5, label: '5' },\n { value: 10, label: '10' },\n { value: 0, label: 'Unlimited' },\n ],\n },\n {\n category: 'agent',\n key: 'thinkingBinding',\n label: 'Preserved thinking (Anthropic only)',\n description: 'What to do with reasoning that no longer matches the conversation.',\n options: [\n { value: 'drop_block', label: 'Drop silently' },\n { value: 'error', label: 'Fail the run' },\n { value: 'off', label: 'Account default' },\n ],\n },\n // ----- UI (display / rendering) ----------------------------------------\n {\n category: 'ui',\n key: 'toolCallDisplay',\n label: 'Tool calls display',\n description: 'Show tool calls as a summary, their full input, or not at all.',\n options: [\n { value: 'formatted', label: 'Formatted' },\n { value: 'full', label: 'Full' },\n { value: 'hidden', label: 'Hidden' },\n ],\n },\n {\n category: 'ui',\n key: 'transcriptDensity',\n label: 'Transcript density',\n description: 'Full shows every step. Compact folds each exchange\\'s work into one row.',\n options: [\n { value: 'full', label: 'Full' },\n { value: 'compact', label: 'Compact' },\n ],\n },\n {\n category: 'ui',\n key: 'editDiffDisplay',\n label: 'Edit diff density',\n description: 'Show edits as a full diff or a short summary.',\n options: [\n { value: 'full', label: 'Full' },\n { value: 'compact', label: 'Compact' },\n ],\n },\n {\n category: 'ui',\n key: 'theme',\n label: 'Theme',\n description: 'Colors for the interface, markdown and code.',\n options: Object.values(BUILTIN_THEMES).map(t => ({ value: t.id, label: t.label })),\n },\n {\n category: 'ui',\n key: 'uiMode',\n label: 'UI mode',\n description: 'Full shows every shortcut in the footer. Minimal hides them until you press ctrl+y.',\n options: [\n { value: 'full', label: 'Full' },\n { value: 'minimal', label: 'Minimal' },\n ],\n },\n {\n category: 'ui',\n key: 'targetFps',\n label: 'Renderer FPS',\n description: '30 saves power, 60 is recommended, 120 suits fast displays.',\n options: [\n { value: 30, label: '30 fps' },\n { value: 60, label: '60 fps' },\n { value: 120, label: '120 fps' },\n ],\n },\n {\n category: 'ui',\n key: 'ctrlCBehavior',\n label: 'Ctrl+C behavior',\n description: 'Quit right away, ask first, or stop what is running and quit on a second press.',\n options: [\n { value: 'quit', label: 'Quit' },\n { value: 'quit-confirm', label: 'Confirm' },\n { value: 'stop-then-quit', label: 'Stop, then quit' },\n ],\n },\n {\n category: 'ui',\n key: 'terminalTitle',\n label: 'Terminal title',\n description: 'What the terminal tab title shows.',\n options: [\n { value: 'off', label: 'Off' },\n { value: 'app', label: 'zidane' },\n { value: 'session', label: 'Session title' },\n { value: 'icon-session', label: 'Icon + session' },\n ],\n },\n]\n\n/**\n * Keys of `Settings` whose value type is exactly `string`. Bounds the\n * input table's `key` the same way {@link BooleanSettingKey} bounds the\n * toggle table — a free-text row can only point at a string-valued\n * setting.\n */\nexport type StringSettingKey = {\n [K in keyof Settings]-?: Settings[K] extends string ? K : never\n}[keyof Settings]\n\n/**\n * Free-text settings edited via a single-line input. The `SettingsModal`\n * renders these as a row showing the current value (or `placeholder` when\n * empty); `enter` opens an inline editor. Same shape a GUI can consume as\n * a text field.\n */\nexport interface SettingsInput {\n /** Setting the row writes. */\n key: StringSettingKey\n /** Row label. */\n label: string\n /** One-line explanation of the setting. */\n description: string\n /** Shown when the value is empty — also the conventional \"default\" hint. */\n placeholder: string\n /** Tab the row belongs to. */\n category: SettingsCategory\n}\n\n/** Every free-text setting the settings UI lists, in display order. */\nexport const SETTINGS_INPUTS: readonly SettingsInput[] = [\n {\n category: 'agent',\n key: 'sandboxAllowWrite',\n label: 'Sandbox writable paths',\n description: 'Extra folders sandboxed commands may write to, comma separated.',\n placeholder: '~/.cache, ~/.bun/install/cache',\n },\n {\n category: 'ui',\n key: 'sessionIcon',\n label: 'Session icon',\n description: 'Shown before the session title in the terminal tab.',\n placeholder: '⚽',\n },\n {\n category: 'ui',\n key: 'attentionIcon',\n label: 'Attention icon',\n description: 'Replaces the session icon while zidane waits on you.',\n placeholder: '⚠️',\n },\n {\n category: 'ui',\n key: 'activeIcon',\n label: 'Active icon',\n description: 'Replaces the session icon while zidane works.',\n placeholder: '⚡',\n },\n]\n","/**\n * What a credential looks like, as pure predicates: secret-looking names\n * (`--api-key`, `DB_PASS`, `\"apiKey\"`), known token shapes (`sk-…`,\n * `ghp_…`, `zds_…`) and high-entropy values. Shared by everything that must\n * keep a token out of what it shows or saves: the host's MCP catalog\n * redaction (`src/ipc/daemon/redact.ts`) and the remote host URL check\n * (`./hosts/url.ts`). Node-free.\n *\n * Over-matching an ordinary word is a cosmetic loss; under-matching leaks a\n * credential, so the rules lean wide, but stay off file paths, package names\n * and plain words (`passthrough`, `bypass`, `keymap`).\n */\n\n/**\n * A secret-looking name: a flag (`--auth-token`), a variable (`DB_PASS`), a\n * JSON key (`apiKey`) or a connection-string key (`Password`). `pass` and\n * `key` count only as a whole word or a `-` / `_` segment at the end.\n */\nconst SECRET_NAME = /token|secret|passw(?:or)?d|passphrase|pwd|api[-_]?key|access[-_]?key|private[-_]?key|auth|credential|bearer|cookie|(?:^|[-_])(?:pass|key)$/i\n\n/** Token prefixes issued by common services, with enough body to be a credential. */\nexport const KNOWN_TOKEN = /(?<![\\w-])(?:sk-[\\w-]{16,}|sk_(?:live|test)_\\w{16,}|gh[pousr]_\\w{20,}|github_pat_\\w{20,}|xox[abposr]-[\\w-]{10,}|(?:AKIA|ASIA)[0-9A-Z]{16}|glpat-[\\w-]{20,}|zds_[\\w-]{20,}|AIza[\\w-]{30,})/g\n\nexport function isSecretName(name: string): boolean {\n return SECRET_NAME.test(name)\n}\n\n/** A known token shape somewhere in `value`. */\nfunction containsKnownToken(value: string): boolean {\n KNOWN_TOKEN.lastIndex = 0\n return KNOWN_TOKEN.test(value)\n}\n\nfunction entropy(value: string): number {\n const counts = new Map<string, number>()\n for (const char of value)\n counts.set(char, (counts.get(char) ?? 0) + 1)\n let bits = 0\n for (const count of counts.values()) {\n const p = count / value.length\n bits -= p * Math.log2(p)\n }\n return bits\n}\n\n/**\n * A whole value that looks like a credential: a known token shape, a long\n * hex / UUID-like id, or a long random mix of cases and digits. Words joined\n * by dashes (`server-2024-edition`) and paths stay readable.\n */\nexport function looksLikeSecret(value: string): boolean {\n KNOWN_TOKEN.lastIndex = 0\n const known = KNOWN_TOKEN.exec(value)\n if (known && known[0] === value)\n return true\n if (value.length < 20 || !/^[\\w\\-+=.~]+$/.test(value) || !/\\d/.test(value) || !/[a-z]/i.test(value))\n return false\n const digits = value.replace(/\\D/g, '').length\n if (/^[\\da-f-]+$/i.test(value))\n return digits / value.length >= 0.25\n return /[a-z]/.test(value) && /[A-Z]/.test(value) && entropy(value) >= 4\n}\n\nfunction safeDecode(segment: string): string {\n try {\n return decodeURIComponent(segment)\n }\n catch {\n return segment\n }\n}\n\n/** A URL path segment that carries a credential (as is, or percent-decoded). */\nexport function isSecretPathSegment(segment: string): boolean {\n const decoded = safeDecode(segment)\n return looksLikeSecret(segment) || looksLikeSecret(decoded) || containsKnownToken(decoded)\n}\n"],"mappings":";;;;;;;AAOA,MAAM,aAAa;AACnB,MAAM,YAAY;AAClB,MAAM,YAAY;;;;;;AAOlB,SAAgB,oBAAoB,OAA8B;CAChE,MAAM,OAAO,MAAM,KAAK;CACxB,IAAI,CAAC,MACH,OAAO;CAET,MAAM,OAAO,UAAU,KAAK,IAAI;CAChC,IAAI,MACF,OAAO,UAAU,oBAAoB,KAAK,KAAK,KAAK,MAAM,IAAI;CAChE,IAAI,0BAA0B,KAAK,IAAI,GACrC,OAAO,oBAAoB,IAAI,IAAI,UAAU,IAAI,IAAI;CACvD,IAAI,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AAO;CACT,MAAM,SAAS,MAAM,QAAQ,OAAO,EAAE,CAAC,CAAC;CACxC,IAAI,eAAe,KAAK,KAAK,GAC3B,OAAO,SAAS,MAAM,UAAU;CAClC,OAAO,QAAQ,KAAK,KAAK,KAAK,QAAQ,KAAK,KAAK,KAAK,QAAQ,KAAK,KAAK;AACzE;AAEA,SAAS,WAAW,SAAyB;CAC3C,IAAI;EACF,OAAO,mBAAmB,OAAO;CACnC,QACM;EACJ,OAAO;CACT;AACF;;AAGA,SAAgB,oBAAoB,SAA0B;CAC5D,MAAM,UAAU,WAAW,OAAO;CAClC,OAAO,gBAAgB,OAAO,KAAK,gBAAgB,OAAO,KAAK,mBAAmB,OAAO;AAC3F"}
@@ -1,4 +1,4 @@
1
- import { _E as SessionStore } from "../index-CidMTcxS.js";
1
+ import { PE as SessionStore } from "../index-DyQyDLX1.js";
2
2
  //#region src/session/sqlite.d.ts
3
3
  /** Options for {@link createSqliteStore}. */
4
4
  interface SqliteStoreOptions {
@@ -1,13 +1,13 @@
1
- import { S as resolveLegacySessionDir, T as resolveSessionDir, _ as cleanupPersistedSession, b as rehomePersistedStubs, w as resolvePersistDir, x as resolveLegacyPersistDir } from "./agent-DecDtKA_.js";
1
+ import { S as resolveLegacySessionDir, T as resolveSessionDir, _ as cleanupPersistedSession, b as rehomePersistedStubs, w as resolvePersistDir, x as resolveLegacyPersistDir } from "./agent-CBQglXtH.js";
2
2
  import { n as definePreset, t as composePresets } from "./compose-Db9ZMbyD.js";
3
3
  import { joinSystemPrompt, replaceDynamicSection, splitSystemPrompt } from "./prompt.js";
4
4
  import { t as createSession } from "./session-7TUHs42_.js";
5
5
  import { a as shell, n as waitTask, r as shellKill } from "./wait-task-BZiNOAcc.js";
6
6
  import { a as projectRootOf } from "./project-root-BOgUA6n5.js";
7
- import { a as listFiles, i as multiEdit, n as readFile, o as edit, t as writeFile, u as createSpawnTool } from "./write-file-B4vi3SvQ.js";
7
+ import { c as edit, f as createSpawnTool, n as readFile, o as multiEdit, s as listFiles, t as writeFile } from "./write-file-QYrcDdl3.js";
8
8
  import { n as DEFAULT_MEDIA_BUDGET, t as DEFAULT_MAX_IMAGE_EDGE } from "./defaults-Cx3zvDOV.js";
9
- import { m as editSessionMetadata } from "./system-freeze-DXvJpveP.js";
10
- import { n as grep, r as glob } from "./tools-9Dpm8F-f.js";
9
+ import { m as editSessionMetadata } from "./system-freeze-Um9ZJiPo.js";
10
+ import { n as grep, r as glob } from "./tools-pZVFIJ_K.js";
11
11
  import { r as fetchUrl } from "./fetch-url-C7AfqZN3.js";
12
12
  import { webSearch } from "./tools/web-search.js";
13
13
  import { c as environmentMetadata, f as readSessionEnvironment, r as LOCAL_ENVIRONMENT } from "./environment-B4asakh7.js";
@@ -1805,4 +1805,4 @@ function setMetaEntries(session, entries) {
1805
1805
  //#endregion
1806
1806
  export { buildPlanSystem as $, applyTodosSnapshot as A, todoProgressLabel as B, sessionComposition as C, TODOS_METADATA_KEY as D, TODOREAD_TOOL as E, pickActiveRunId as F, IDENTITY_PREFIX as G, ACTIONS_WITH_CARE_DOCTRINE as H, pruneTodosByRun as I, PLAN_MODE_DOCTRINE as J, INTERACTION_GUIDANCE as K, sanitizeTodoItems as L, getArchivedTodosForRun as M, getTodosForRun as N, TODOWRITE_TOOL as O, isTodoTool as P, buildBuildSystem as Q, selectActiveTodos as R, resolveAgentId as S, DEFAULT_MAX_TODO_ITEMS as T, COMMUNICATION_DOCTRINE as U, useActiveTodos as V, DOING_TASKS_DOCTRINE as W, SUBAGENT_GUIDANCE as X, PLAN_MODE_DOCTRINE_NO_PROMPTS as Y, TOKEN_DISCIPLINE_DOCTRINE as Z, compositionByKey as _, forkSession as a, profileComposition as b, BUILD_CODEMODE_AGENT as c, DEFAULT_BUDGET_EXCLUDE_TOOLS as d, envSection as et, DEFAULT_PERSIST_EXCLUDE_TOOLS as f, builtInPromptOf as g, availableAgents as h, describeForkFailure as i, createTodoTools as j, TODO_WRITE_COUNTS_METADATA_KEY as k, BUILTIN_AGENTS as l, READ_ONLY_TOOLS as m, createSessionInStore as n, replaceEnvSection as nt, newSession as o, PLAN_AGENT as p, INTERACTION_GUIDANCE_NO_PROMPTS as q, deleteSessionData as r, BUILD_AGENT as s, createMainSession as t, envSectionDate as tt, DEFAULT_AGENT_ID as u, compositionFits as v, singleAgentRegistry as w, profileTools as x, compositionTools as y, setTodosForRun as z };
1807
1807
 
1808
- //# sourceMappingURL=session-factory-BazyVdzj.js.map
1808
+ //# sourceMappingURL=session-factory-CMwIXE-7.js.map