@cjhyy/code-shell-core 0.5.0-rc.2 → 0.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/README.md +13 -10
  2. package/dist/agent/agent-definition-registry.d.ts +3 -0
  3. package/dist/agent/agent-definition-registry.js +3 -1
  4. package/dist/agent/agent-definition.d.ts +15 -0
  5. package/dist/agent/agent-definition.js +27 -3
  6. package/dist/arena/context/context-tools.js +47 -4
  7. package/dist/arena/ledger.js +9 -1
  8. package/dist/arena/strategies/utils.d.ts +1 -4
  9. package/dist/arena/strategies/utils.js +7 -84
  10. package/dist/automation/cron-expr.d.ts +10 -0
  11. package/dist/automation/cron-expr.js +23 -5
  12. package/dist/automation/runner.d.ts +21 -4
  13. package/dist/automation/runner.js +48 -12
  14. package/dist/automation/scheduler.d.ts +38 -0
  15. package/dist/automation/scheduler.js +89 -12
  16. package/dist/automation/store.js +5 -2
  17. package/dist/capability-control/disabled-lists.d.ts +25 -0
  18. package/dist/capability-control/disabled-lists.js +57 -0
  19. package/dist/capability-control/overlay.d.ts +15 -0
  20. package/dist/capability-control/overlay.js +27 -0
  21. package/dist/cc-orchestrator/agent-adapter.d.ts +50 -0
  22. package/dist/cc-orchestrator/agent-adapter.js +133 -0
  23. package/dist/cc-orchestrator/cc-capability.d.ts +19 -0
  24. package/dist/cc-orchestrator/cc-capability.js +53 -0
  25. package/dist/cc-orchestrator/codex-session-discovery.d.ts +24 -0
  26. package/dist/cc-orchestrator/codex-session-discovery.js +191 -0
  27. package/dist/cc-orchestrator/codex-session-history.d.ts +25 -0
  28. package/dist/cc-orchestrator/codex-session-history.js +187 -0
  29. package/dist/cc-orchestrator/external-agent-changes.d.ts +19 -0
  30. package/dist/cc-orchestrator/external-agent-changes.js +214 -0
  31. package/dist/cc-orchestrator/external-agent-driver.d.ts +18 -0
  32. package/dist/cc-orchestrator/external-agent-driver.js +69 -0
  33. package/dist/cc-orchestrator/index.d.ts +8 -0
  34. package/dist/cc-orchestrator/index.js +8 -0
  35. package/dist/cc-orchestrator/relevance-judge.d.ts +15 -0
  36. package/dist/cc-orchestrator/relevance-judge.js +29 -0
  37. package/dist/cc-orchestrator/session-discovery.d.ts +46 -0
  38. package/dist/cc-orchestrator/session-discovery.js +125 -0
  39. package/dist/cc-orchestrator/session-history.d.ts +19 -0
  40. package/dist/cc-orchestrator/session-history.js +67 -0
  41. package/dist/cli/agent-server-stdio.d.ts +15 -1
  42. package/dist/cli/agent-server-stdio.js +115 -17
  43. package/dist/cli/agent-server-tcp.js +40 -26
  44. package/dist/context/compaction.d.ts +56 -0
  45. package/dist/context/compaction.js +186 -0
  46. package/dist/context/manager.js +25 -4
  47. package/dist/cost-tracker.js +5 -61
  48. package/dist/credentials/cipher.d.ts +49 -0
  49. package/dist/credentials/cipher.js +45 -0
  50. package/dist/credentials/cookie-jar.d.ts +24 -0
  51. package/dist/credentials/cookie-jar.js +40 -0
  52. package/dist/credentials/index.d.ts +7 -0
  53. package/dist/credentials/index.js +5 -0
  54. package/dist/credentials/inject-credential-tool.d.ts +20 -0
  55. package/dist/credentials/inject-credential-tool.js +130 -0
  56. package/dist/credentials/store.d.ts +72 -0
  57. package/dist/credentials/store.js +184 -0
  58. package/dist/credentials/types.d.ts +56 -0
  59. package/dist/credentials/use-credential-tool.d.ts +29 -0
  60. package/dist/credentials/use-credential-tool.js +205 -0
  61. package/dist/credentials/use-gate.d.ts +56 -0
  62. package/dist/credentials/use-gate.js +52 -0
  63. package/dist/data/model-metadata.d.ts +77 -0
  64. package/dist/data/model-metadata.js +56 -0
  65. package/dist/data/model-metadata.json +216 -0
  66. package/dist/data/openrouter-models.d.ts +18 -7
  67. package/dist/data/openrouter-models.js +35 -8
  68. package/dist/engine/aux-key.d.ts +10 -0
  69. package/dist/engine/aux-key.js +11 -0
  70. package/dist/engine/dynamic-tool-defs.d.ts +19 -0
  71. package/dist/engine/dynamic-tool-defs.js +36 -0
  72. package/dist/engine/engine.d.ts +267 -138
  73. package/dist/engine/engine.js +957 -191
  74. package/dist/engine/friendly-error.d.ts +18 -0
  75. package/dist/engine/friendly-error.js +63 -0
  76. package/dist/engine/goal.d.ts +145 -0
  77. package/dist/engine/goal.js +144 -0
  78. package/dist/engine/image-policy.d.ts +13 -0
  79. package/dist/engine/image-policy.js +24 -0
  80. package/dist/engine/model-connections-pool.d.ts +17 -0
  81. package/dist/engine/model-connections-pool.js +66 -0
  82. package/dist/engine/model-facade.d.ts +10 -0
  83. package/dist/engine/model-facade.js +25 -0
  84. package/dist/engine/patch-orphaned-tools.js +3 -0
  85. package/dist/engine/resolve-llm-config.d.ts +16 -0
  86. package/dist/engine/resolve-llm-config.js +44 -0
  87. package/dist/engine/runtime.js +2 -1
  88. package/dist/engine/sandbox-cache-key.d.ts +10 -0
  89. package/dist/engine/sandbox-cache-key.js +9 -0
  90. package/dist/engine/sandbox-config.d.ts +31 -0
  91. package/dist/engine/sandbox-config.js +38 -0
  92. package/dist/engine/session-usage.d.ts +19 -0
  93. package/dist/engine/session-usage.js +25 -0
  94. package/dist/engine/steer-queue.d.ts +32 -0
  95. package/dist/engine/steer-queue.js +26 -0
  96. package/dist/engine/streaming-tool-queue.d.ts +12 -0
  97. package/dist/engine/streaming-tool-queue.js +50 -10
  98. package/dist/engine/turn-loop.d.ts +67 -3
  99. package/dist/engine/turn-loop.js +292 -41
  100. package/dist/engine/types.d.ts +175 -0
  101. package/dist/engine/types.js +13 -0
  102. package/dist/external-agents/config.d.ts +2 -0
  103. package/dist/external-agents/config.js +15 -0
  104. package/dist/external-agents/types.d.ts +31 -0
  105. package/dist/external-agents/types.js +1 -0
  106. package/dist/git/utils.js +11 -6
  107. package/dist/git/worktree.d.ts +48 -0
  108. package/dist/git/worktree.js +86 -10
  109. package/dist/hooks/goal-stop-hook.d.ts +28 -0
  110. package/dist/hooks/goal-stop-hook.js +186 -9
  111. package/dist/hooks/registry.d.ts +8 -0
  112. package/dist/hooks/registry.js +19 -0
  113. package/dist/hooks/shell-runner.js +10 -21
  114. package/dist/index.d.ts +49 -6
  115. package/dist/index.js +60 -4
  116. package/dist/llm/capabilities/param-specs.d.ts +14 -0
  117. package/dist/llm/capabilities/param-specs.js +62 -0
  118. package/dist/llm/capabilities/rules.js +4 -0
  119. package/dist/llm/capabilities/types.d.ts +10 -0
  120. package/dist/llm/client-base.d.ts +28 -1
  121. package/dist/llm/client-base.js +119 -13
  122. package/dist/llm/model-cache.js +4 -2
  123. package/dist/llm/model-pool.d.ts +14 -0
  124. package/dist/llm/model-pool.js +13 -0
  125. package/dist/llm/provider-auth.d.ts +41 -0
  126. package/dist/llm/provider-auth.js +76 -0
  127. package/dist/llm/provider-catalog.d.ts +4 -0
  128. package/dist/llm/providers/anthropic.js +64 -14
  129. package/dist/llm/providers/openai.d.ts +36 -0
  130. package/dist/llm/providers/openai.js +257 -51
  131. package/dist/llm/reasoning-setting.d.ts +3 -3
  132. package/dist/llm/reasoning-setting.js +9 -1
  133. package/dist/llm/stream-watchdog.js +5 -1
  134. package/dist/llm/token-counter.js +9 -2
  135. package/dist/llm/types.d.ts +4 -0
  136. package/dist/logging/sanitize-messages.js +22 -0
  137. package/dist/lsp/manager.d.ts +1 -1
  138. package/dist/lsp/manager.js +40 -10
  139. package/dist/model-catalog/builtin.d.ts +12 -0
  140. package/dist/model-catalog/builtin.js +407 -0
  141. package/dist/model-catalog/gen-connections.d.ts +20 -0
  142. package/dist/model-catalog/gen-connections.js +28 -0
  143. package/dist/model-catalog/index.d.ts +41 -0
  144. package/dist/model-catalog/index.js +90 -0
  145. package/dist/model-catalog/params.d.ts +20 -0
  146. package/dist/model-catalog/params.js +45 -0
  147. package/dist/model-catalog/resolve.d.ts +48 -0
  148. package/dist/model-catalog/resolve.js +33 -0
  149. package/dist/model-catalog/save-entry.d.ts +32 -0
  150. package/dist/model-catalog/save-entry.js +104 -0
  151. package/dist/model-catalog/types.d.ts +561 -0
  152. package/dist/model-catalog/types.js +93 -0
  153. package/dist/model-catalog/upsert.d.ts +9 -0
  154. package/dist/model-catalog/upsert.js +8 -0
  155. package/dist/onboarding.d.ts +12 -82
  156. package/dist/onboarding.js +61 -326
  157. package/dist/plugins/gitOps.d.ts +19 -0
  158. package/dist/plugins/gitOps.js +73 -4
  159. package/dist/plugins/installer/checkUpdate.d.ts +16 -0
  160. package/dist/plugins/installer/checkUpdate.js +32 -0
  161. package/dist/plugins/installer/codex/convertCommands.d.ts +19 -0
  162. package/dist/plugins/installer/codex/convertCommands.js +46 -0
  163. package/dist/plugins/installer/codex/convertMcp.d.ts +5 -2
  164. package/dist/plugins/installer/codex/convertMcp.js +45 -5
  165. package/dist/plugins/installer/install.js +25 -1
  166. package/dist/plugins/installer/installFromArchive.d.ts +43 -0
  167. package/dist/plugins/installer/installFromArchive.js +134 -0
  168. package/dist/plugins/installer/installFromSource.js +8 -2
  169. package/dist/plugins/installer/loadPluginAgents.js +6 -2
  170. package/dist/plugins/installer/loadPluginMcp.d.ts +9 -2
  171. package/dist/plugins/installer/loadPluginMcp.js +35 -2
  172. package/dist/plugins/installer/pruneDisabled.d.ts +24 -0
  173. package/dist/plugins/installer/pruneDisabled.js +73 -0
  174. package/dist/plugins/installer/types.d.ts +5 -2
  175. package/dist/plugins/installer/types.js +1 -0
  176. package/dist/plugins/installer/uninstall.js +4 -0
  177. package/dist/plugins/installer/unzip.d.ts +14 -0
  178. package/dist/plugins/installer/unzip.js +82 -0
  179. package/dist/plugins/installer/update.d.ts +14 -0
  180. package/dist/plugins/installer/update.js +53 -21
  181. package/dist/plugins/loadPluginHooks.d.ts +47 -1
  182. package/dist/plugins/loadPluginHooks.js +73 -1
  183. package/dist/plugins/marketplaceManager.d.ts +7 -0
  184. package/dist/plugins/marketplaceManager.js +20 -0
  185. package/dist/plugins/pluginCommandHook.js +4 -18
  186. package/dist/plugins/pluginContent.d.ts +30 -0
  187. package/dist/plugins/pluginContent.js +83 -0
  188. package/dist/plugins/pluginInstaller.d.ts +13 -0
  189. package/dist/plugins/pluginInstaller.js +42 -8
  190. package/dist/plugins/schemas.js +1 -0
  191. package/dist/plugins/types.d.ts +6 -0
  192. package/dist/preset/index.d.ts +7 -1
  193. package/dist/preset/index.js +96 -6
  194. package/dist/product/types.d.ts +1 -1
  195. package/dist/prompt/composer.d.ts +27 -0
  196. package/dist/prompt/composer.js +67 -21
  197. package/dist/prompt/instruction-scanner.js +5 -3
  198. package/dist/prompt/section-loader.js +1 -0
  199. package/dist/prompt/sections/base.md +1 -0
  200. package/dist/prompt/sections/browser.md +10 -0
  201. package/dist/prompt/sections/coding.md +4 -0
  202. package/dist/protocol/chat-session-manager.d.ts +8 -2
  203. package/dist/protocol/chat-session-manager.js +36 -0
  204. package/dist/protocol/chat-session.d.ts +65 -0
  205. package/dist/protocol/chat-session.js +94 -2
  206. package/dist/protocol/client.d.ts +27 -0
  207. package/dist/protocol/client.js +38 -0
  208. package/dist/protocol/server.d.ts +112 -0
  209. package/dist/protocol/server.js +586 -16
  210. package/dist/protocol/transport.js +3 -2
  211. package/dist/protocol/types.d.ts +46 -0
  212. package/dist/protocol/types.js +16 -0
  213. package/dist/quota/credentials.d.ts +3 -0
  214. package/dist/quota/credentials.js +80 -0
  215. package/dist/quota/index.d.ts +36 -0
  216. package/dist/quota/index.js +155 -0
  217. package/dist/quota/types.d.ts +48 -0
  218. package/dist/quota/types.js +13 -0
  219. package/dist/review/review-prompt.d.ts +28 -0
  220. package/dist/review/review-prompt.js +81 -0
  221. package/dist/run/FileRunStore.js +8 -3
  222. package/dist/run/RunApprovalBackend.js +25 -5
  223. package/dist/run/RunManager.d.ts +12 -0
  224. package/dist/run/RunManager.js +35 -0
  225. package/dist/run/factory.d.ts +1 -1
  226. package/dist/runtime/background-shell.d.ts +139 -0
  227. package/dist/runtime/background-shell.js +495 -0
  228. package/dist/runtime/output-clean.d.ts +24 -0
  229. package/dist/runtime/output-clean.js +41 -0
  230. package/dist/runtime/ring-file.d.ts +64 -0
  231. package/dist/runtime/ring-file.js +174 -0
  232. package/dist/runtime/safe-spawn.js +15 -34
  233. package/dist/runtime/spawn-common.d.ts +148 -0
  234. package/dist/runtime/spawn-common.js +303 -0
  235. package/dist/runtime/truncate-output.d.ts +22 -0
  236. package/dist/runtime/truncate-output.js +49 -0
  237. package/dist/runtime/utf8-cut.d.ts +11 -0
  238. package/dist/runtime/utf8-cut.js +23 -0
  239. package/dist/services/auto-dream.d.ts +4 -0
  240. package/dist/services/auto-dream.js +26 -26
  241. package/dist/services/diagnostics.d.ts +1 -2
  242. package/dist/services/diagnostics.js +12 -7
  243. package/dist/services/extract-memories.d.ts +14 -1
  244. package/dist/services/extract-memories.js +45 -6
  245. package/dist/services/memory-orchestrator.d.ts +21 -0
  246. package/dist/services/memory-orchestrator.js +125 -50
  247. package/dist/services/session-memory.js +24 -12
  248. package/dist/session/file-history.d.ts +124 -1
  249. package/dist/session/file-history.js +222 -6
  250. package/dist/session/memory.d.ts +116 -2
  251. package/dist/session/memory.js +250 -28
  252. package/dist/session/session-manager.d.ts +40 -0
  253. package/dist/session/session-manager.js +113 -3
  254. package/dist/session/simple-diff.d.ts +23 -0
  255. package/dist/session/simple-diff.js +84 -0
  256. package/dist/session/transcript.d.ts +25 -1
  257. package/dist/session/transcript.js +35 -2
  258. package/dist/session/undo-target.d.ts +67 -0
  259. package/dist/session/undo-target.js +144 -0
  260. package/dist/settings/disk-defaults.d.ts +9 -2
  261. package/dist/settings/disk-defaults.js +11 -2
  262. package/dist/settings/feature-flags.d.ts +64 -0
  263. package/dist/settings/feature-flags.js +61 -0
  264. package/dist/settings/manager.d.ts +68 -1
  265. package/dist/settings/manager.js +266 -29
  266. package/dist/settings/migrate-config.d.ts +45 -0
  267. package/dist/settings/migrate-config.js +125 -0
  268. package/dist/settings/schema-export.d.ts +25 -0
  269. package/dist/settings/schema-export.js +38 -0
  270. package/dist/settings/schema.d.ts +1186 -771
  271. package/dist/settings/schema.js +268 -97
  272. package/dist/skills/scanner.d.ts +9 -0
  273. package/dist/skills/scanner.js +30 -2
  274. package/dist/stt/resolve-transcribe.d.ts +31 -0
  275. package/dist/stt/resolve-transcribe.js +108 -0
  276. package/dist/stt/transcribe.d.ts +51 -0
  277. package/dist/stt/transcribe.js +65 -0
  278. package/dist/tool-system/browser-bridge.d.ts +226 -0
  279. package/dist/tool-system/browser-bridge.js +163 -0
  280. package/dist/tool-system/builtin/agent-heartbeat.d.ts +49 -0
  281. package/dist/tool-system/builtin/agent-heartbeat.js +89 -0
  282. package/dist/tool-system/builtin/agent-notifications.d.ts +12 -3
  283. package/dist/tool-system/builtin/agent-notifications.js +9 -3
  284. package/dist/tool-system/builtin/agent-output-file.d.ts +38 -0
  285. package/dist/tool-system/builtin/agent-output-file.js +72 -0
  286. package/dist/tool-system/builtin/agent-registry.d.ts +12 -0
  287. package/dist/tool-system/builtin/agent-registry.js +8 -0
  288. package/dist/tool-system/builtin/agent.d.ts +21 -1
  289. package/dist/tool-system/builtin/agent.js +489 -42
  290. package/dist/tool-system/builtin/apply-patch/applier.js +66 -8
  291. package/dist/tool-system/builtin/apply-patch/backup-targets.d.ts +10 -0
  292. package/dist/tool-system/builtin/apply-patch/backup-targets.js +30 -0
  293. package/dist/tool-system/builtin/apply-patch/index.js +0 -15
  294. package/dist/tool-system/builtin/background-jobs.d.ts +76 -0
  295. package/dist/tool-system/builtin/background-jobs.js +124 -0
  296. package/dist/tool-system/builtin/background-shell-tools.d.ts +20 -0
  297. package/dist/tool-system/builtin/background-shell-tools.js +108 -0
  298. package/dist/tool-system/builtin/background-work.d.ts +67 -0
  299. package/dist/tool-system/builtin/background-work.js +86 -0
  300. package/dist/tool-system/builtin/bash-output-style.d.ts +32 -0
  301. package/dist/tool-system/builtin/bash-output-style.js +40 -0
  302. package/dist/tool-system/builtin/bash.d.ts +5 -2
  303. package/dist/tool-system/builtin/bash.js +98 -62
  304. package/dist/tool-system/builtin/browser-tools.d.ts +33 -0
  305. package/dist/tool-system/builtin/browser-tools.js +312 -0
  306. package/dist/tool-system/builtin/cancel-goal.d.ts +31 -0
  307. package/dist/tool-system/builtin/cancel-goal.js +64 -0
  308. package/dist/tool-system/builtin/check-quota.d.ts +15 -0
  309. package/dist/tool-system/builtin/check-quota.js +34 -0
  310. package/dist/tool-system/builtin/config.js +7 -0
  311. package/dist/tool-system/builtin/cron.d.ts +7 -0
  312. package/dist/tool-system/builtin/cron.js +55 -3
  313. package/dist/tool-system/builtin/drive-claude-code.d.ts +30 -0
  314. package/dist/tool-system/builtin/drive-claude-code.js +157 -0
  315. package/dist/tool-system/builtin/edit-model-catalog.d.ts +3 -0
  316. package/dist/tool-system/builtin/edit-model-catalog.js +94 -0
  317. package/dist/tool-system/builtin/edit.js +20 -16
  318. package/dist/tool-system/builtin/eol.d.ts +29 -0
  319. package/dist/tool-system/builtin/eol.js +37 -0
  320. package/dist/tool-system/builtin/file-cache.d.ts +6 -0
  321. package/dist/tool-system/builtin/file-cache.js +8 -0
  322. package/dist/tool-system/builtin/generate-image.d.ts +35 -0
  323. package/dist/tool-system/builtin/generate-image.js +278 -50
  324. package/dist/tool-system/builtin/generate-video.d.ts +55 -0
  325. package/dist/tool-system/builtin/generate-video.js +361 -0
  326. package/dist/tool-system/builtin/glob.js +0 -7
  327. package/dist/tool-system/builtin/grep.js +6 -8
  328. package/dist/tool-system/builtin/image-providers.d.ts +86 -0
  329. package/dist/tool-system/builtin/image-providers.js +190 -0
  330. package/dist/tool-system/builtin/image-uploader.d.ts +33 -0
  331. package/dist/tool-system/builtin/image-uploader.js +74 -0
  332. package/dist/tool-system/builtin/index.d.ts +7 -1
  333. package/dist/tool-system/builtin/index.js +249 -25
  334. package/dist/tool-system/builtin/mcp-tools.js +23 -3
  335. package/dist/tool-system/builtin/memory.js +45 -7
  336. package/dist/tool-system/builtin/notebook-edit.js +0 -7
  337. package/dist/tool-system/builtin/powershell.js +4 -1
  338. package/dist/tool-system/builtin/read.js +10 -10
  339. package/dist/tool-system/builtin/repl.js +4 -1
  340. package/dist/tool-system/builtin/skill.js +9 -0
  341. package/dist/tool-system/builtin/sleep.js +3 -2
  342. package/dist/tool-system/builtin/tool-search.js +25 -7
  343. package/dist/tool-system/builtin/video-providers.d.ts +154 -0
  344. package/dist/tool-system/builtin/video-providers.js +235 -0
  345. package/dist/tool-system/builtin/web-fetch.js +12 -2
  346. package/dist/tool-system/builtin/web-search.js +21 -7
  347. package/dist/tool-system/builtin/worktree.d.ts +2 -1
  348. package/dist/tool-system/builtin/worktree.js +31 -4
  349. package/dist/tool-system/builtin/write.js +0 -6
  350. package/dist/tool-system/context.d.ts +154 -6
  351. package/dist/tool-system/executor.d.ts +3 -1
  352. package/dist/tool-system/executor.js +172 -88
  353. package/dist/tool-system/investigation-guard.js +1 -1
  354. package/dist/tool-system/mcp-manager.d.ts +42 -4
  355. package/dist/tool-system/mcp-manager.js +186 -20
  356. package/dist/tool-system/path-policy.d.ts +5 -0
  357. package/dist/tool-system/path-policy.js +307 -8
  358. package/dist/tool-system/permission.d.ts +36 -1
  359. package/dist/tool-system/permission.js +281 -69
  360. package/dist/tool-system/plan-mode-allowlist.d.ts +13 -2
  361. package/dist/tool-system/plan-mode-allowlist.js +24 -2
  362. package/dist/tool-system/registry.d.ts +1 -0
  363. package/dist/tool-system/registry.js +16 -2
  364. package/dist/tool-system/sandbox/index.d.ts +8 -0
  365. package/dist/tool-system/sandbox/index.js +7 -2
  366. package/dist/tool-system/validate-tool-metadata.d.ts +36 -0
  367. package/dist/tool-system/validate-tool-metadata.js +63 -0
  368. package/dist/types.d.ts +217 -6
  369. package/dist/updater.js +20 -9
  370. package/dist/utils/envUtils.d.ts +0 -9
  371. package/dist/utils/envUtils.js +3 -28
  372. package/dist/utils/exec.d.ts +40 -0
  373. package/dist/utils/exec.js +144 -0
  374. package/dist/utils/json.d.ts +12 -0
  375. package/dist/utils/json.js +92 -0
  376. package/dist/utils/theme.d.ts +1 -1
  377. package/dist/utils/theme.js +1 -1
  378. package/dist/utils/toolDisplay.js +0 -1
  379. package/package.json +13 -7
  380. package/dist/agent/coordinator.d.ts +0 -49
  381. package/dist/agent/coordinator.js +0 -77
  382. package/dist/settings/manager.test.js +0 -73
  383. package/dist/tool-system/builtin/remote-trigger.d.ts +0 -6
  384. package/dist/tool-system/builtin/remote-trigger.js +0 -54
  385. package/dist/tool-system/builtin/send-message.d.ts +0 -6
  386. package/dist/tool-system/builtin/send-message.js +0 -47
  387. /package/dist/{settings/manager.test.d.ts → credentials/types.js} +0 -0
@@ -20,18 +20,28 @@ export declare const CapabilityOverridesSchema: z.ZodOptional<z.ZodObject<{
20
20
  agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
21
21
  mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
22
22
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
23
+ /**
24
+ * Per-hook overlay for PLUGIN-provided hooks, keyed by
25
+ * `pluginHookKey()` (`<plugin>:<RawEvent>:<command>`). Finer-grained
26
+ * than `plugins` (which kills a whole plugin): "off" suppresses one
27
+ * hook for this project only. Only "off" is meaningful today — plugin
28
+ * hooks have no global disable list to force back "on" from.
29
+ */
30
+ pluginHooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
23
31
  }, "strip", z.ZodTypeAny, {
24
32
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
25
33
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
26
34
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
27
35
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
28
36
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
37
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
29
38
  }, {
30
39
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
31
40
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
32
41
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
33
42
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
34
43
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
44
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
35
45
  }>>;
36
46
  export type CapabilityOverrides = z.infer<typeof CapabilityOverridesSchema>;
37
47
  export declare const SettingsSchema: z.ZodObject<{
@@ -78,23 +88,6 @@ export declare const SettingsSchema: z.ZodObject<{
78
88
  compatCodex?: boolean | undefined;
79
89
  } | undefined;
80
90
  }>>;
81
- /**
82
- * Primary source of truth for the active model is settings.activeKey
83
- * (points at models[].key). settings.model is a derived mirror of that
84
- * entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
85
- * which read provider/name/apiKey/baseUrl directly. Writers must update
86
- * both — appendOnboardingResult does this in one shot.
87
- */
88
- activeKey: z.ZodOptional<z.ZodString>;
89
- /**
90
- * Auxiliary-task model — points at a models[].key. Background, non-user-
91
- * facing LLM calls (memory extraction, the auto-dream loop) use this model
92
- * instead of the active one, so per-turn book-keeping doesn't burn the
93
- * expensive primary model. Pick something fast/cheap (e.g. a Haiku or
94
- * DeepSeek key). When unset, those calls fall back to the active model
95
- * (legacy behavior). An invalid/missing key also falls back to active.
96
- */
97
- auxModelKey: z.ZodOptional<z.ZodString>;
98
91
  /**
99
92
  * Toggle background auto-update. When true (default), code-shell checks
100
93
  * npm for newer versions and — if the npm global prefix is writable —
@@ -103,254 +96,215 @@ export declare const SettingsSchema: z.ZodObject<{
103
96
  * Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
104
97
  */
105
98
  autoUpdates: z.ZodDefault<z.ZodBoolean>;
106
- model: z.ZodDefault<z.ZodObject<{
107
- provider: z.ZodDefault<z.ZodString>;
108
- name: z.ZodDefault<z.ZodString>;
109
- apiKey: z.ZodOptional<z.ZodString>;
110
- baseUrl: z.ZodDefault<z.ZodString>;
111
- temperature: z.ZodDefault<z.ZodNumber>;
112
- maxTokens: z.ZodDefault<z.ZodNumber>;
99
+ /**
100
+ * Image generation is a general capability, decoupled from LLM providers
101
+ * (TODO 7.1): a vendor may use different keys/endpoints/models for chat vs
102
+ * image, and image vendors (Gemini, and later 国内 模型) don't fit the LLM
103
+ * `providers[].kind` enum. `imageGen.providers[]` is the canonical config;
104
+ * each entry has a user-chosen `id` (selected via GenerateImage's
105
+ * `provider` arg) and a `kind` that picks the adapter. When `imageGen` is
106
+ * absent, resolution falls back to scanning LLM `providers[]` for an
107
+ * image-capable kind — so existing configs keep working with no migration.
108
+ */
109
+ imageGen: z.ZodOptional<z.ZodObject<{
110
+ defaultProvider: z.ZodOptional<z.ZodString>;
111
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
112
+ /** User-chosen instance name; GenerateImage(provider) selects by this. */
113
+ id: z.ZodString;
114
+ /** Adapter selector — e.g. "openai", "google". */
115
+ kind: z.ZodString;
116
+ baseUrl: z.ZodString;
117
+ apiKey: z.ZodOptional<z.ZodString>;
118
+ /** Default model for this instance when the call omits `model`. */
119
+ defaultModel: z.ZodOptional<z.ZodString>;
120
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
121
+ catalogId: z.ZodOptional<z.ZodString>;
122
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
123
+ apiKeyRef: z.ZodOptional<z.ZodString>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ id: string;
126
+ kind: string;
127
+ baseUrl: string;
128
+ apiKey?: string | undefined;
129
+ defaultModel?: string | undefined;
130
+ catalogId?: string | undefined;
131
+ apiKeyRef?: string | undefined;
132
+ }, {
133
+ id: string;
134
+ kind: string;
135
+ baseUrl: string;
136
+ apiKey?: string | undefined;
137
+ defaultModel?: string | undefined;
138
+ catalogId?: string | undefined;
139
+ apiKeyRef?: string | undefined;
140
+ }>, "many">>;
113
141
  }, "strip", z.ZodTypeAny, {
114
- temperature: number;
115
- name: string;
116
- provider: string;
117
- baseUrl: string;
118
- maxTokens: number;
119
- apiKey?: string | undefined;
142
+ providers: {
143
+ id: string;
144
+ kind: string;
145
+ baseUrl: string;
146
+ apiKey?: string | undefined;
147
+ defaultModel?: string | undefined;
148
+ catalogId?: string | undefined;
149
+ apiKeyRef?: string | undefined;
150
+ }[];
151
+ defaultProvider?: string | undefined;
120
152
  }, {
121
- temperature?: number | undefined;
122
- name?: string | undefined;
123
- provider?: string | undefined;
124
- baseUrl?: string | undefined;
125
- apiKey?: string | undefined;
126
- maxTokens?: number | undefined;
153
+ defaultProvider?: string | undefined;
154
+ providers?: {
155
+ id: string;
156
+ kind: string;
157
+ baseUrl: string;
158
+ apiKey?: string | undefined;
159
+ defaultModel?: string | undefined;
160
+ catalogId?: string | undefined;
161
+ apiKeyRef?: string | undefined;
162
+ }[] | undefined;
127
163
  }>>;
128
- providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
129
- key: z.ZodString;
130
- label: z.ZodOptional<z.ZodString>;
131
- kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
132
- baseUrl: z.ZodString;
133
- apiKey: z.ZodOptional<z.ZodString>;
134
- protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
135
- modelsPath: z.ZodOptional<z.ZodString>;
136
- /**
137
- * Default reasoning/thinking setting for this provider's models.
138
- * Rich shape: {mode:"off"|"on"} | {mode:"effort",effort} |
139
- * {mode:"budget",budgetTokens}. Per-model `reasoning` wins.
140
- */
141
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
142
- mode: z.ZodLiteral<"off">;
143
- }, "strip", z.ZodTypeAny, {
144
- mode: "off";
145
- }, {
146
- mode: "off";
147
- }>, z.ZodObject<{
148
- mode: z.ZodLiteral<"on">;
149
- }, "strip", z.ZodTypeAny, {
150
- mode: "on";
151
- }, {
152
- mode: "on";
153
- }>, z.ZodObject<{
154
- mode: z.ZodLiteral<"effort">;
155
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
156
- }, "strip", z.ZodTypeAny, {
157
- mode: "effort";
158
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
159
- }, {
160
- mode: "effort";
161
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
162
- }>, z.ZodObject<{
163
- mode: z.ZodLiteral<"budget">;
164
- budgetTokens: z.ZodNumber;
164
+ /**
165
+ * Video generation config (TODO 7.1) — same shape as imageGen, decoupled
166
+ * from LLM providers. `videoGen.providers[]` each carry an `id` (selected
167
+ * via GenerateVideo's `provider` arg) + a `kind` picking the adapter. With
168
+ * no real adapters wired yet, this is config-ready: a future getVideoProvider
169
+ * case lights it up. Falls back to scanning LLM providers[] when absent.
170
+ */
171
+ videoGen: z.ZodOptional<z.ZodObject<{
172
+ defaultProvider: z.ZodOptional<z.ZodString>;
173
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
174
+ id: z.ZodString;
175
+ kind: z.ZodString;
176
+ baseUrl: z.ZodString;
177
+ apiKey: z.ZodOptional<z.ZodString>;
178
+ defaultModel: z.ZodOptional<z.ZodString>;
179
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
180
+ catalogId: z.ZodOptional<z.ZodString>;
181
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
182
+ apiKeyRef: z.ZodOptional<z.ZodString>;
165
183
  }, "strip", z.ZodTypeAny, {
166
- mode: "budget";
167
- budgetTokens: number;
184
+ id: string;
185
+ kind: string;
186
+ baseUrl: string;
187
+ apiKey?: string | undefined;
188
+ defaultModel?: string | undefined;
189
+ catalogId?: string | undefined;
190
+ apiKeyRef?: string | undefined;
168
191
  }, {
169
- mode: "budget";
170
- budgetTokens: number;
171
- }>]>>;
172
- }, "strip", z.ZodTypeAny, {
173
- key: string;
174
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
175
- baseUrl: string;
176
- reasoning?: {
177
- mode: "off";
178
- } | {
179
- mode: "on";
180
- } | {
181
- mode: "effort";
182
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
183
- } | {
184
- mode: "budget";
185
- budgetTokens: number;
186
- } | undefined;
187
- label?: string | undefined;
188
- apiKey?: string | undefined;
189
- protocol?: "openai-compat" | "anthropic-style" | undefined;
190
- modelsPath?: string | undefined;
191
- }, {
192
- key: string;
193
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
194
- baseUrl: string;
195
- reasoning?: {
196
- mode: "off";
197
- } | {
198
- mode: "on";
199
- } | {
200
- mode: "effort";
201
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
202
- } | {
203
- mode: "budget";
204
- budgetTokens: number;
205
- } | undefined;
206
- label?: string | undefined;
207
- apiKey?: string | undefined;
208
- protocol?: "openai-compat" | "anthropic-style" | undefined;
209
- modelsPath?: string | undefined;
210
- }>, "many">>;
211
- models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
212
- key: z.ZodString;
213
- label: z.ZodOptional<z.ZodString>;
214
- providerKey: z.ZodOptional<z.ZodString>;
215
- model: z.ZodString;
216
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
217
- maxContextTokens: z.ZodOptional<z.ZodNumber>;
218
- /**
219
- * Which LLM client to use ("openai" or "anthropic"). New name —
220
- * the legacy field is `provider`, which we still accept and
221
- * fold into `protocol` below so old configs keep working.
222
- * NOT the brand/vendor — that's providerKey above.
223
- */
224
- protocol: z.ZodOptional<z.ZodString>;
225
- provider: z.ZodOptional<z.ZodString>;
226
- baseUrl: z.ZodOptional<z.ZodString>;
192
+ id: string;
193
+ kind: string;
194
+ baseUrl: string;
195
+ apiKey?: string | undefined;
196
+ defaultModel?: string | undefined;
197
+ catalogId?: string | undefined;
198
+ apiKeyRef?: string | undefined;
199
+ }>, "many">>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ providers: {
202
+ id: string;
203
+ kind: string;
204
+ baseUrl: string;
205
+ apiKey?: string | undefined;
206
+ defaultModel?: string | undefined;
207
+ catalogId?: string | undefined;
208
+ apiKeyRef?: string | undefined;
209
+ }[];
210
+ defaultProvider?: string | undefined;
211
+ }, {
212
+ defaultProvider?: string | undefined;
213
+ providers?: {
214
+ id: string;
215
+ kind: string;
216
+ baseUrl: string;
217
+ apiKey?: string | undefined;
218
+ defaultModel?: string | undefined;
219
+ catalogId?: string | undefined;
220
+ apiKeyRef?: string | undefined;
221
+ }[] | undefined;
222
+ }>>;
223
+ /**
224
+ * Credentials independent key entities (统一模型接入方案 §3.3). A key
225
+ * lives here, not inlined on a connection, so deleting a connection never
226
+ * loses a key and many connections share one key by referencing the same
227
+ * credential id (LiteLLM credential_list model).
228
+ */
229
+ credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
230
+ /** User-chosen unique credential name. */
231
+ id: z.ZodString;
232
+ /** Catalog template this credential is for (a key belongs to one provider). */
233
+ catalogId: z.ZodString;
227
234
  apiKey: z.ZodOptional<z.ZodString>;
228
- /**
229
- * Per-model reasoning override. Wins over the provider-level
230
- * `reasoning` setting (settings.providers[].reasoning). Use this
231
- * when different models under the same provider need different
232
- * defaults — e.g. one model off (faster) and another on.
233
- */
234
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
235
- mode: z.ZodLiteral<"off">;
236
- }, "strip", z.ZodTypeAny, {
237
- mode: "off";
238
- }, {
239
- mode: "off";
240
- }>, z.ZodObject<{
241
- mode: z.ZodLiteral<"on">;
242
- }, "strip", z.ZodTypeAny, {
243
- mode: "on";
244
- }, {
245
- mode: "on";
246
- }>, z.ZodObject<{
247
- mode: z.ZodLiteral<"effort">;
248
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
249
- }, "strip", z.ZodTypeAny, {
250
- mode: "effort";
251
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
252
- }, {
253
- mode: "effort";
254
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
255
- }>, z.ZodObject<{
256
- mode: z.ZodLiteral<"budget">;
257
- budgetTokens: z.ZodNumber;
258
- }, "strip", z.ZodTypeAny, {
259
- mode: "budget";
260
- budgetTokens: number;
261
- }, {
262
- mode: "budget";
263
- budgetTokens: number;
264
- }>]>>;
235
+ baseUrl: z.ZodOptional<z.ZodString>;
265
236
  }, "strip", z.ZodTypeAny, {
266
- key: string;
267
- model: string;
268
- reasoning?: {
269
- mode: "off";
270
- } | {
271
- mode: "on";
272
- } | {
273
- mode: "effort";
274
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
275
- } | {
276
- mode: "budget";
277
- budgetTokens: number;
278
- } | undefined;
279
- provider?: string | undefined;
280
- maxOutputTokens?: number | undefined;
281
- label?: string | undefined;
237
+ id: string;
238
+ catalogId: string;
282
239
  baseUrl?: string | undefined;
283
240
  apiKey?: string | undefined;
284
- protocol?: string | undefined;
285
- providerKey?: string | undefined;
286
- maxContextTokens?: number | undefined;
287
241
  }, {
288
- key: string;
289
- model: string;
290
- reasoning?: {
291
- mode: "off";
292
- } | {
293
- mode: "on";
294
- } | {
295
- mode: "effort";
296
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
297
- } | {
298
- mode: "budget";
299
- budgetTokens: number;
300
- } | undefined;
301
- provider?: string | undefined;
302
- maxOutputTokens?: number | undefined;
303
- label?: string | undefined;
242
+ id: string;
243
+ catalogId: string;
304
244
  baseUrl?: string | undefined;
305
245
  apiKey?: string | undefined;
306
- protocol?: string | undefined;
307
- providerKey?: string | undefined;
308
- maxContextTokens?: number | undefined;
309
- }>, {
310
- protocol: string | undefined;
311
- provider: string | undefined;
312
- key: string;
246
+ }>, "many">>;
247
+ /**
248
+ * Unified instance layer (统一模型接入方案, see
249
+ * docs/superpowers/specs/2026-06-15-unified-model-catalog-design.md §3.3).
250
+ * One store for text/image/video connections, each pointing at a catalog
251
+ * entry (catalogId), a credential (credentialId), its chosen model, and the
252
+ * param values the user picked. Replaces the legacy split of
253
+ * providers[]/models[]/imageGen/videoGen.
254
+ */
255
+ modelConnections: z.ZodDefault<z.ZodArray<z.ZodObject<{
256
+ /** User-chosen unique instance name. */
257
+ id: z.ZodString;
258
+ /** Catalog template this instance was created from. */
259
+ catalogId: z.ZodString;
260
+ tag: z.ZodEnum<["text", "image", "video", "audio"]>;
261
+ /** Selected modelId (from the entry's modelPresets). */
262
+ model: z.ZodString;
263
+ /** Per-connection baseUrl override (else the credential's / catalog's). */
264
+ baseUrl: z.ZodOptional<z.ZodString>;
265
+ /** Which credential supplies this connection's key. */
266
+ credentialId: z.ZodOptional<z.ZodString>;
267
+ /** Values the user picked for the model's params, e.g. { reasoning: "high" }. */
268
+ paramValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ id: string;
313
271
  model: string;
314
- reasoning?: {
315
- mode: "off";
316
- } | {
317
- mode: "on";
318
- } | {
319
- mode: "effort";
320
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
321
- } | {
322
- mode: "budget";
323
- budgetTokens: number;
324
- } | undefined;
325
- maxOutputTokens?: number | undefined;
326
- label?: string | undefined;
272
+ catalogId: string;
273
+ tag: "text" | "image" | "video" | "audio";
327
274
  baseUrl?: string | undefined;
328
- apiKey?: string | undefined;
329
- providerKey?: string | undefined;
330
- maxContextTokens?: number | undefined;
275
+ credentialId?: string | undefined;
276
+ paramValues?: Record<string, unknown> | undefined;
331
277
  }, {
332
- key: string;
278
+ id: string;
333
279
  model: string;
334
- reasoning?: {
335
- mode: "off";
336
- } | {
337
- mode: "on";
338
- } | {
339
- mode: "effort";
340
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
341
- } | {
342
- mode: "budget";
343
- budgetTokens: number;
344
- } | undefined;
345
- provider?: string | undefined;
346
- maxOutputTokens?: number | undefined;
347
- label?: string | undefined;
280
+ catalogId: string;
281
+ tag: "text" | "image" | "video" | "audio";
348
282
  baseUrl?: string | undefined;
349
- apiKey?: string | undefined;
350
- protocol?: string | undefined;
351
- providerKey?: string | undefined;
352
- maxContextTokens?: number | undefined;
283
+ credentialId?: string | undefined;
284
+ paramValues?: Record<string, unknown> | undefined;
353
285
  }>, "many">>;
286
+ /** Default instance id per tag (replaces activeKey / defaultProvider). */
287
+ defaults: z.ZodDefault<z.ZodObject<{
288
+ text: z.ZodOptional<z.ZodString>;
289
+ image: z.ZodOptional<z.ZodString>;
290
+ video: z.ZodOptional<z.ZodString>;
291
+ /** Default speech-to-text (voice input) connection. */
292
+ audio: z.ZodOptional<z.ZodString>;
293
+ /** Background-task model (replaces auxModelKey). */
294
+ auxText: z.ZodOptional<z.ZodString>;
295
+ }, "strip", z.ZodTypeAny, {
296
+ text?: string | undefined;
297
+ image?: string | undefined;
298
+ video?: string | undefined;
299
+ audio?: string | undefined;
300
+ auxText?: string | undefined;
301
+ }, {
302
+ text?: string | undefined;
303
+ image?: string | undefined;
304
+ video?: string | undefined;
305
+ audio?: string | undefined;
306
+ auxText?: string | undefined;
307
+ }>>;
354
308
  permissions: z.ZodDefault<z.ZodObject<{
355
309
  defaultMode: z.ZodDefault<z.ZodEnum<["default", "acceptEdits", "dontAsk", "bypassPermissions", "auto", "plan"]>>;
356
310
  rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -390,14 +344,17 @@ export declare const SettingsSchema: z.ZodObject<{
390
344
  maxTokens: z.ZodDefault<z.ZodNumber>;
391
345
  compactAtRatio: z.ZodDefault<z.ZodNumber>;
392
346
  summarizeAtRatio: z.ZodDefault<z.ZodNumber>;
347
+ microcompactFloorRatio: z.ZodDefault<z.ZodNumber>;
393
348
  }, "strip", z.ZodTypeAny, {
394
349
  maxTokens: number;
395
350
  compactAtRatio: number;
396
351
  summarizeAtRatio: number;
352
+ microcompactFloorRatio: number;
397
353
  }, {
398
354
  maxTokens?: number | undefined;
399
355
  compactAtRatio?: number | undefined;
400
356
  summarizeAtRatio?: number | undefined;
357
+ microcompactFloorRatio?: number | undefined;
401
358
  }>>;
402
359
  session: z.ZodDefault<z.ZodObject<{
403
360
  storageDir: z.ZodOptional<z.ZodString>;
@@ -409,7 +366,7 @@ export declare const SettingsSchema: z.ZodObject<{
409
366
  storageDir?: string | undefined;
410
367
  maxHistory?: number | undefined;
411
368
  }>>;
412
- mcpServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
369
+ mcpServers: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
413
370
  name: z.ZodString;
414
371
  command: z.ZodOptional<z.ZodString>;
415
372
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -417,6 +374,10 @@ export declare const SettingsSchema: z.ZodObject<{
417
374
  url: z.ZodOptional<z.ZodString>;
418
375
  transport: z.ZodOptional<z.ZodEnum<["stdio", "sse", "streamable-http", "inprocess"]>>;
419
376
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
377
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
378
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
379
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
380
+ credentialRef: z.ZodOptional<z.ZodString>;
420
381
  enabled: z.ZodOptional<z.ZodBoolean>;
421
382
  }, "strip", z.ZodTypeAny, {
422
383
  name: string;
@@ -427,6 +388,10 @@ export declare const SettingsSchema: z.ZodObject<{
427
388
  env?: Record<string, string> | undefined;
428
389
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
429
390
  headers?: Record<string, string> | undefined;
391
+ envVars?: string[] | undefined;
392
+ bearerTokenEnvVar?: string | undefined;
393
+ envHeaders?: Record<string, string> | undefined;
394
+ credentialRef?: string | undefined;
430
395
  }, {
431
396
  name: string;
432
397
  enabled?: boolean | undefined;
@@ -436,6 +401,49 @@ export declare const SettingsSchema: z.ZodObject<{
436
401
  env?: Record<string, string> | undefined;
437
402
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
438
403
  headers?: Record<string, string> | undefined;
404
+ envVars?: string[] | undefined;
405
+ bearerTokenEnvVar?: string | undefined;
406
+ envHeaders?: Record<string, string> | undefined;
407
+ credentialRef?: string | undefined;
408
+ }>>, Record<string, {
409
+ name: string;
410
+ enabled?: boolean | undefined;
411
+ url?: string | undefined;
412
+ args?: string[] | undefined;
413
+ command?: string | undefined;
414
+ env?: Record<string, string> | undefined;
415
+ transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
416
+ headers?: Record<string, string> | undefined;
417
+ envVars?: string[] | undefined;
418
+ bearerTokenEnvVar?: string | undefined;
419
+ envHeaders?: Record<string, string> | undefined;
420
+ credentialRef?: string | undefined;
421
+ }>, unknown>>;
422
+ /**
423
+ * User supplements for PLUGIN-provided MCP servers, keyed by the server's
424
+ * `<plugin>:<server>` name. Layered onto the plugin config at merge time
425
+ * (mergePluginMcpServers). Only env/credential fields are accepted —
426
+ * command/args/url/transport are intentionally absent and `.strict()`
427
+ * rejects them, so a plugin update is never shadowed by a stale copy.
428
+ */
429
+ mcpServerOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
430
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
431
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
432
+ credentialRef: z.ZodOptional<z.ZodString>;
433
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
434
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
435
+ }, "strict", z.ZodTypeAny, {
436
+ env?: Record<string, string> | undefined;
437
+ envVars?: string[] | undefined;
438
+ bearerTokenEnvVar?: string | undefined;
439
+ envHeaders?: Record<string, string> | undefined;
440
+ credentialRef?: string | undefined;
441
+ }, {
442
+ env?: Record<string, string> | undefined;
443
+ envVars?: string[] | undefined;
444
+ bearerTokenEnvVar?: string | undefined;
445
+ envHeaders?: Record<string, string> | undefined;
446
+ credentialRef?: string | undefined;
439
447
  }>>>;
440
448
  /**
441
449
  * Skill names hidden from the LLM. Names include the full
@@ -470,18 +478,62 @@ export declare const SettingsSchema: z.ZodObject<{
470
478
  agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
471
479
  mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
472
480
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
481
+ /**
482
+ * Per-hook overlay for PLUGIN-provided hooks, keyed by
483
+ * `pluginHookKey()` (`<plugin>:<RawEvent>:<command>`). Finer-grained
484
+ * than `plugins` (which kills a whole plugin): "off" suppresses one
485
+ * hook for this project only. Only "off" is meaningful today — plugin
486
+ * hooks have no global disable list to force back "on" from.
487
+ */
488
+ pluginHooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
473
489
  }, "strip", z.ZodTypeAny, {
474
490
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
475
491
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
476
492
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
477
493
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
478
494
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
495
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
479
496
  }, {
480
497
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
481
498
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
482
499
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
483
500
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
484
501
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
502
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
503
+ }>>;
504
+ /**
505
+ * Feature flags overlay: a map of flag name → boolean that overrides the
506
+ * compiled-in defaults (see settings/feature-flags.ts FEATURE_FLAGS).
507
+ * Project settings override user settings via the normal merge, so a flag
508
+ * can be flipped per-workspace. Unknown flag names are tolerated (kept as
509
+ * data) for forward-compat; consumers only read known flags via
510
+ * isFeatureEnabled(). Passthrough record — values coerced to boolean.
511
+ */
512
+ featureFlags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
513
+ /**
514
+ * Cross-session memory knobs. Optional — absence keeps the built-in
515
+ * defaults (see services/extract-memories.ts). `maxCount` caps memories
516
+ * accepted per extraction pass; `maxAge`/`extractionModel` are reserved
517
+ * for the consolidation/extraction pipeline.
518
+ */
519
+ memories: z.ZodOptional<z.ZodObject<{
520
+ maxCount: z.ZodOptional<z.ZodNumber>;
521
+ maxAge: z.ZodOptional<z.ZodNumber>;
522
+ extractionModel: z.ZodOptional<z.ZodString>;
523
+ /** Master switch for end-of-session automatic memory extraction.
524
+ * Absent/true = extract (current behavior); false = skip extraction
525
+ * while keeping session summaries and Dream untouched. */
526
+ autoExtract: z.ZodOptional<z.ZodBoolean>;
527
+ }, "strip", z.ZodTypeAny, {
528
+ maxCount?: number | undefined;
529
+ maxAge?: number | undefined;
530
+ extractionModel?: string | undefined;
531
+ autoExtract?: boolean | undefined;
532
+ }, {
533
+ maxCount?: number | undefined;
534
+ maxAge?: number | undefined;
535
+ extractionModel?: string | undefined;
536
+ autoExtract?: boolean | undefined;
485
537
  }>>;
486
538
  instructions: z.ZodDefault<z.ZodObject<{
487
539
  fileName: z.ZodDefault<z.ZodString>;
@@ -630,24 +682,22 @@ export declare const SettingsSchema: z.ZodObject<{
630
682
  }>>;
631
683
  /**
632
684
  * Image attachment handling. Sub-fields:
633
- * - detail: OpenAI-style fidelity hint applied to every user-
634
- * attached image. "low" = 85 tokens/image fixed (cheap
635
- * thumbnail), "high" = ~768 px tiles (default), "original" =
636
- * keep client-side dimensions (most expensive). Anthropic
637
- * ignores this field today; that's fine — it just gets
638
- * dropped on the Claude path.
685
+ * - detail: provider-agnostic image clarity. Drives the
686
+ * renderer-side downscale (low→~1024 / standard→~1568 /
687
+ * high→~2576 px long edge) so BOTH providers save tokens
688
+ * before send. Legacy "original" is migrated to "high".
639
689
  * - mcpImageTokenBudget: per-turn cap on token cost of images
640
690
  * returned by MCP tools. Codex doesn't enforce this; CC uses
641
691
  * 25 000. Set to 0 to disable.
642
692
  */
643
693
  images: z.ZodOptional<z.ZodObject<{
644
- detail: z.ZodOptional<z.ZodEnum<["low", "high", "original"]>>;
694
+ detail: z.ZodOptional<z.ZodEffects<z.ZodEnum<["low", "standard", "high"]>, "low" | "high" | "standard", unknown>>;
645
695
  mcpImageTokenBudget: z.ZodOptional<z.ZodNumber>;
646
696
  }, "strip", z.ZodTypeAny, {
647
- detail?: "low" | "high" | "original" | undefined;
697
+ detail?: "low" | "high" | "standard" | undefined;
648
698
  mcpImageTokenBudget?: number | undefined;
649
699
  }, {
650
- detail?: "low" | "high" | "original" | undefined;
700
+ detail?: unknown;
651
701
  mcpImageTokenBudget?: number | undefined;
652
702
  }>>;
653
703
  /**
@@ -672,6 +722,21 @@ export declare const SettingsSchema: z.ZodObject<{
672
722
  deniedReads?: string[] | undefined;
673
723
  network?: "allow" | "deny" | undefined;
674
724
  }>>;
725
+ /**
726
+ * Top-level environment variables injected into tool subprocesses (the
727
+ * Bash tool, background shells). Mirrors Claude Code's `env` field: a
728
+ * KEY=VALUE map that can be set globally (~/.code-shell/settings.json) and
729
+ * overridden per-project (.code-shell/settings.json). The canonical home
730
+ * for API keys (e.g. OPENAI_API_KEY) that a skill's script reads — configure
731
+ * once globally and every project's skills can use it.
732
+ *
733
+ * Precedence when merged into the spawn env (lowest → highest):
734
+ * project localEnvironment.env → global env → project env
735
+ * None of these is filtered through the deny regex (see mergeShellEnv):
736
+ * they are values the user typed deliberately, a different trust class from
737
+ * the host process.env passthrough the deny machinery guards against.
738
+ */
739
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
675
740
  /**
676
741
  * Project-local environment profile. Mirrors Codex's local-environment
677
742
  * shape at the settings layer: setup/cleanup scripts can be customized per
@@ -760,19 +825,99 @@ export declare const SettingsSchema: z.ZodObject<{
760
825
  matcher: z.ZodOptional<z.ZodString>;
761
826
  timeout_ms: z.ZodOptional<z.ZodNumber>;
762
827
  cwd: z.ZodOptional<z.ZodString>;
828
+ /** Soft off-switch: the entry stays in the file (and the UI) but
829
+ * registerSettingsHooks skips it. Absent = enabled. */
830
+ disabled: z.ZodOptional<z.ZodBoolean>;
763
831
  }, "strip", z.ZodTypeAny, {
764
832
  command: string;
765
833
  event: string;
834
+ disabled?: boolean | undefined;
766
835
  matcher?: string | undefined;
767
836
  timeout_ms?: number | undefined;
768
837
  cwd?: string | undefined;
769
838
  }, {
770
839
  command: string;
771
840
  event: string;
841
+ disabled?: boolean | undefined;
772
842
  matcher?: string | undefined;
773
843
  timeout_ms?: number | undefined;
774
844
  cwd?: string | undefined;
775
845
  }>, "many">>;
846
+ /**
847
+ * External coding-agent orchestration (Claude Code / Codex CLI).
848
+ * Used by the Mobile Web Remote to launch managed jobs. dangerousArgs
849
+ * is config-provided (not hardcoded) so it tracks CLI flag changes;
850
+ * project-default dangerous mode only applies inside trustedWorkspaces.
851
+ */
852
+ externalAgents: z.ZodOptional<z.ZodObject<{
853
+ claudeCode: z.ZodOptional<z.ZodObject<{
854
+ command: z.ZodOptional<z.ZodString>;
855
+ defaultMode: z.ZodOptional<z.ZodEnum<["safe", "dangerous"]>>;
856
+ dangerousArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
857
+ trustedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
858
+ autoStartInTrustedWorkspaces: z.ZodOptional<z.ZodBoolean>;
859
+ }, "strip", z.ZodTypeAny, {
860
+ defaultMode?: "safe" | "dangerous" | undefined;
861
+ command?: string | undefined;
862
+ dangerousArgs?: string[] | undefined;
863
+ trustedWorkspaces?: string[] | undefined;
864
+ autoStartInTrustedWorkspaces?: boolean | undefined;
865
+ }, {
866
+ defaultMode?: "safe" | "dangerous" | undefined;
867
+ command?: string | undefined;
868
+ dangerousArgs?: string[] | undefined;
869
+ trustedWorkspaces?: string[] | undefined;
870
+ autoStartInTrustedWorkspaces?: boolean | undefined;
871
+ }>>;
872
+ codex: z.ZodOptional<z.ZodObject<{
873
+ command: z.ZodOptional<z.ZodString>;
874
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
875
+ }, "strip", z.ZodTypeAny, {
876
+ args?: string[] | undefined;
877
+ command?: string | undefined;
878
+ }, {
879
+ args?: string[] | undefined;
880
+ command?: string | undefined;
881
+ }>>;
882
+ }, "strip", z.ZodTypeAny, {
883
+ claudeCode?: {
884
+ defaultMode?: "safe" | "dangerous" | undefined;
885
+ command?: string | undefined;
886
+ dangerousArgs?: string[] | undefined;
887
+ trustedWorkspaces?: string[] | undefined;
888
+ autoStartInTrustedWorkspaces?: boolean | undefined;
889
+ } | undefined;
890
+ codex?: {
891
+ args?: string[] | undefined;
892
+ command?: string | undefined;
893
+ } | undefined;
894
+ }, {
895
+ claudeCode?: {
896
+ defaultMode?: "safe" | "dangerous" | undefined;
897
+ command?: string | undefined;
898
+ dangerousArgs?: string[] | undefined;
899
+ trustedWorkspaces?: string[] | undefined;
900
+ autoStartInTrustedWorkspaces?: boolean | undefined;
901
+ } | undefined;
902
+ codex?: {
903
+ args?: string[] | undefined;
904
+ command?: string | undefined;
905
+ } | undefined;
906
+ }>>;
907
+ /**
908
+ * Credential-use gate (凭证模块第二期). Controls whether the AI's
909
+ * `UseCredential` tool prompts before handing a stored credential to a
910
+ * command. `autoApprove: true` skips the prompt entirely (默认关 — every
911
+ * use asks, or is remembered for the session). See
912
+ * docs/superpowers/specs/2026-06-16-credential-use-gate-design.md §5.
913
+ */
914
+ credentialUse: z.ZodOptional<z.ZodObject<{
915
+ autoApprove: z.ZodOptional<z.ZodBoolean>;
916
+ }, "strip", z.ZodTypeAny, {
917
+ autoApprove?: boolean | undefined;
918
+ }, {
919
+ autoApprove?: boolean | undefined;
920
+ }>>;
776
921
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
777
922
  agent: z.ZodDefault<z.ZodObject<{
778
923
  preset: z.ZodDefault<z.ZodString>;
@@ -817,23 +962,6 @@ export declare const SettingsSchema: z.ZodObject<{
817
962
  compatCodex?: boolean | undefined;
818
963
  } | undefined;
819
964
  }>>;
820
- /**
821
- * Primary source of truth for the active model is settings.activeKey
822
- * (points at models[].key). settings.model is a derived mirror of that
823
- * entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
824
- * which read provider/name/apiKey/baseUrl directly. Writers must update
825
- * both — appendOnboardingResult does this in one shot.
826
- */
827
- activeKey: z.ZodOptional<z.ZodString>;
828
- /**
829
- * Auxiliary-task model — points at a models[].key. Background, non-user-
830
- * facing LLM calls (memory extraction, the auto-dream loop) use this model
831
- * instead of the active one, so per-turn book-keeping doesn't burn the
832
- * expensive primary model. Pick something fast/cheap (e.g. a Haiku or
833
- * DeepSeek key). When unset, those calls fall back to the active model
834
- * (legacy behavior). An invalid/missing key also falls back to active.
835
- */
836
- auxModelKey: z.ZodOptional<z.ZodString>;
837
965
  /**
838
966
  * Toggle background auto-update. When true (default), code-shell checks
839
967
  * npm for newer versions and — if the npm global prefix is writable —
@@ -842,254 +970,215 @@ export declare const SettingsSchema: z.ZodObject<{
842
970
  * Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
843
971
  */
844
972
  autoUpdates: z.ZodDefault<z.ZodBoolean>;
845
- model: z.ZodDefault<z.ZodObject<{
846
- provider: z.ZodDefault<z.ZodString>;
847
- name: z.ZodDefault<z.ZodString>;
848
- apiKey: z.ZodOptional<z.ZodString>;
849
- baseUrl: z.ZodDefault<z.ZodString>;
850
- temperature: z.ZodDefault<z.ZodNumber>;
851
- maxTokens: z.ZodDefault<z.ZodNumber>;
973
+ /**
974
+ * Image generation is a general capability, decoupled from LLM providers
975
+ * (TODO 7.1): a vendor may use different keys/endpoints/models for chat vs
976
+ * image, and image vendors (Gemini, and later 国内 模型) don't fit the LLM
977
+ * `providers[].kind` enum. `imageGen.providers[]` is the canonical config;
978
+ * each entry has a user-chosen `id` (selected via GenerateImage's
979
+ * `provider` arg) and a `kind` that picks the adapter. When `imageGen` is
980
+ * absent, resolution falls back to scanning LLM `providers[]` for an
981
+ * image-capable kind — so existing configs keep working with no migration.
982
+ */
983
+ imageGen: z.ZodOptional<z.ZodObject<{
984
+ defaultProvider: z.ZodOptional<z.ZodString>;
985
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
986
+ /** User-chosen instance name; GenerateImage(provider) selects by this. */
987
+ id: z.ZodString;
988
+ /** Adapter selector — e.g. "openai", "google". */
989
+ kind: z.ZodString;
990
+ baseUrl: z.ZodString;
991
+ apiKey: z.ZodOptional<z.ZodString>;
992
+ /** Default model for this instance when the call omits `model`. */
993
+ defaultModel: z.ZodOptional<z.ZodString>;
994
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
995
+ catalogId: z.ZodOptional<z.ZodString>;
996
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
997
+ apiKeyRef: z.ZodOptional<z.ZodString>;
998
+ }, "strip", z.ZodTypeAny, {
999
+ id: string;
1000
+ kind: string;
1001
+ baseUrl: string;
1002
+ apiKey?: string | undefined;
1003
+ defaultModel?: string | undefined;
1004
+ catalogId?: string | undefined;
1005
+ apiKeyRef?: string | undefined;
1006
+ }, {
1007
+ id: string;
1008
+ kind: string;
1009
+ baseUrl: string;
1010
+ apiKey?: string | undefined;
1011
+ defaultModel?: string | undefined;
1012
+ catalogId?: string | undefined;
1013
+ apiKeyRef?: string | undefined;
1014
+ }>, "many">>;
852
1015
  }, "strip", z.ZodTypeAny, {
853
- temperature: number;
854
- name: string;
855
- provider: string;
856
- baseUrl: string;
857
- maxTokens: number;
858
- apiKey?: string | undefined;
1016
+ providers: {
1017
+ id: string;
1018
+ kind: string;
1019
+ baseUrl: string;
1020
+ apiKey?: string | undefined;
1021
+ defaultModel?: string | undefined;
1022
+ catalogId?: string | undefined;
1023
+ apiKeyRef?: string | undefined;
1024
+ }[];
1025
+ defaultProvider?: string | undefined;
859
1026
  }, {
860
- temperature?: number | undefined;
861
- name?: string | undefined;
862
- provider?: string | undefined;
863
- baseUrl?: string | undefined;
864
- apiKey?: string | undefined;
865
- maxTokens?: number | undefined;
1027
+ defaultProvider?: string | undefined;
1028
+ providers?: {
1029
+ id: string;
1030
+ kind: string;
1031
+ baseUrl: string;
1032
+ apiKey?: string | undefined;
1033
+ defaultModel?: string | undefined;
1034
+ catalogId?: string | undefined;
1035
+ apiKeyRef?: string | undefined;
1036
+ }[] | undefined;
866
1037
  }>>;
867
- providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
868
- key: z.ZodString;
869
- label: z.ZodOptional<z.ZodString>;
870
- kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
871
- baseUrl: z.ZodString;
872
- apiKey: z.ZodOptional<z.ZodString>;
873
- protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
874
- modelsPath: z.ZodOptional<z.ZodString>;
875
- /**
876
- * Default reasoning/thinking setting for this provider's models.
877
- * Rich shape: {mode:"off"|"on"} | {mode:"effort",effort} |
878
- * {mode:"budget",budgetTokens}. Per-model `reasoning` wins.
879
- */
880
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
881
- mode: z.ZodLiteral<"off">;
882
- }, "strip", z.ZodTypeAny, {
883
- mode: "off";
884
- }, {
885
- mode: "off";
886
- }>, z.ZodObject<{
887
- mode: z.ZodLiteral<"on">;
888
- }, "strip", z.ZodTypeAny, {
889
- mode: "on";
890
- }, {
891
- mode: "on";
892
- }>, z.ZodObject<{
893
- mode: z.ZodLiteral<"effort">;
894
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
895
- }, "strip", z.ZodTypeAny, {
896
- mode: "effort";
897
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
898
- }, {
899
- mode: "effort";
900
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
901
- }>, z.ZodObject<{
902
- mode: z.ZodLiteral<"budget">;
903
- budgetTokens: z.ZodNumber;
1038
+ /**
1039
+ * Video generation config (TODO 7.1) — same shape as imageGen, decoupled
1040
+ * from LLM providers. `videoGen.providers[]` each carry an `id` (selected
1041
+ * via GenerateVideo's `provider` arg) + a `kind` picking the adapter. With
1042
+ * no real adapters wired yet, this is config-ready: a future getVideoProvider
1043
+ * case lights it up. Falls back to scanning LLM providers[] when absent.
1044
+ */
1045
+ videoGen: z.ZodOptional<z.ZodObject<{
1046
+ defaultProvider: z.ZodOptional<z.ZodString>;
1047
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
1048
+ id: z.ZodString;
1049
+ kind: z.ZodString;
1050
+ baseUrl: z.ZodString;
1051
+ apiKey: z.ZodOptional<z.ZodString>;
1052
+ defaultModel: z.ZodOptional<z.ZodString>;
1053
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
1054
+ catalogId: z.ZodOptional<z.ZodString>;
1055
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
1056
+ apiKeyRef: z.ZodOptional<z.ZodString>;
904
1057
  }, "strip", z.ZodTypeAny, {
905
- mode: "budget";
906
- budgetTokens: number;
1058
+ id: string;
1059
+ kind: string;
1060
+ baseUrl: string;
1061
+ apiKey?: string | undefined;
1062
+ defaultModel?: string | undefined;
1063
+ catalogId?: string | undefined;
1064
+ apiKeyRef?: string | undefined;
907
1065
  }, {
908
- mode: "budget";
909
- budgetTokens: number;
910
- }>]>>;
911
- }, "strip", z.ZodTypeAny, {
912
- key: string;
913
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
914
- baseUrl: string;
915
- reasoning?: {
916
- mode: "off";
917
- } | {
918
- mode: "on";
919
- } | {
920
- mode: "effort";
921
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
922
- } | {
923
- mode: "budget";
924
- budgetTokens: number;
925
- } | undefined;
926
- label?: string | undefined;
927
- apiKey?: string | undefined;
928
- protocol?: "openai-compat" | "anthropic-style" | undefined;
929
- modelsPath?: string | undefined;
930
- }, {
931
- key: string;
932
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
933
- baseUrl: string;
934
- reasoning?: {
935
- mode: "off";
936
- } | {
937
- mode: "on";
938
- } | {
939
- mode: "effort";
940
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
941
- } | {
942
- mode: "budget";
943
- budgetTokens: number;
944
- } | undefined;
945
- label?: string | undefined;
946
- apiKey?: string | undefined;
947
- protocol?: "openai-compat" | "anthropic-style" | undefined;
948
- modelsPath?: string | undefined;
949
- }>, "many">>;
950
- models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
951
- key: z.ZodString;
952
- label: z.ZodOptional<z.ZodString>;
953
- providerKey: z.ZodOptional<z.ZodString>;
954
- model: z.ZodString;
955
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
956
- maxContextTokens: z.ZodOptional<z.ZodNumber>;
957
- /**
958
- * Which LLM client to use ("openai" or "anthropic"). New name —
959
- * the legacy field is `provider`, which we still accept and
960
- * fold into `protocol` below so old configs keep working.
961
- * NOT the brand/vendor — that's providerKey above.
962
- */
963
- protocol: z.ZodOptional<z.ZodString>;
964
- provider: z.ZodOptional<z.ZodString>;
965
- baseUrl: z.ZodOptional<z.ZodString>;
1066
+ id: string;
1067
+ kind: string;
1068
+ baseUrl: string;
1069
+ apiKey?: string | undefined;
1070
+ defaultModel?: string | undefined;
1071
+ catalogId?: string | undefined;
1072
+ apiKeyRef?: string | undefined;
1073
+ }>, "many">>;
1074
+ }, "strip", z.ZodTypeAny, {
1075
+ providers: {
1076
+ id: string;
1077
+ kind: string;
1078
+ baseUrl: string;
1079
+ apiKey?: string | undefined;
1080
+ defaultModel?: string | undefined;
1081
+ catalogId?: string | undefined;
1082
+ apiKeyRef?: string | undefined;
1083
+ }[];
1084
+ defaultProvider?: string | undefined;
1085
+ }, {
1086
+ defaultProvider?: string | undefined;
1087
+ providers?: {
1088
+ id: string;
1089
+ kind: string;
1090
+ baseUrl: string;
1091
+ apiKey?: string | undefined;
1092
+ defaultModel?: string | undefined;
1093
+ catalogId?: string | undefined;
1094
+ apiKeyRef?: string | undefined;
1095
+ }[] | undefined;
1096
+ }>>;
1097
+ /**
1098
+ * Credentials independent key entities (统一模型接入方案 §3.3). A key
1099
+ * lives here, not inlined on a connection, so deleting a connection never
1100
+ * loses a key and many connections share one key by referencing the same
1101
+ * credential id (LiteLLM credential_list model).
1102
+ */
1103
+ credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
1104
+ /** User-chosen unique credential name. */
1105
+ id: z.ZodString;
1106
+ /** Catalog template this credential is for (a key belongs to one provider). */
1107
+ catalogId: z.ZodString;
966
1108
  apiKey: z.ZodOptional<z.ZodString>;
967
- /**
968
- * Per-model reasoning override. Wins over the provider-level
969
- * `reasoning` setting (settings.providers[].reasoning). Use this
970
- * when different models under the same provider need different
971
- * defaults — e.g. one model off (faster) and another on.
972
- */
973
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
974
- mode: z.ZodLiteral<"off">;
975
- }, "strip", z.ZodTypeAny, {
976
- mode: "off";
977
- }, {
978
- mode: "off";
979
- }>, z.ZodObject<{
980
- mode: z.ZodLiteral<"on">;
981
- }, "strip", z.ZodTypeAny, {
982
- mode: "on";
983
- }, {
984
- mode: "on";
985
- }>, z.ZodObject<{
986
- mode: z.ZodLiteral<"effort">;
987
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
988
- }, "strip", z.ZodTypeAny, {
989
- mode: "effort";
990
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
991
- }, {
992
- mode: "effort";
993
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
994
- }>, z.ZodObject<{
995
- mode: z.ZodLiteral<"budget">;
996
- budgetTokens: z.ZodNumber;
997
- }, "strip", z.ZodTypeAny, {
998
- mode: "budget";
999
- budgetTokens: number;
1000
- }, {
1001
- mode: "budget";
1002
- budgetTokens: number;
1003
- }>]>>;
1109
+ baseUrl: z.ZodOptional<z.ZodString>;
1004
1110
  }, "strip", z.ZodTypeAny, {
1005
- key: string;
1006
- model: string;
1007
- reasoning?: {
1008
- mode: "off";
1009
- } | {
1010
- mode: "on";
1011
- } | {
1012
- mode: "effort";
1013
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1014
- } | {
1015
- mode: "budget";
1016
- budgetTokens: number;
1017
- } | undefined;
1018
- provider?: string | undefined;
1019
- maxOutputTokens?: number | undefined;
1020
- label?: string | undefined;
1111
+ id: string;
1112
+ catalogId: string;
1021
1113
  baseUrl?: string | undefined;
1022
1114
  apiKey?: string | undefined;
1023
- protocol?: string | undefined;
1024
- providerKey?: string | undefined;
1025
- maxContextTokens?: number | undefined;
1026
1115
  }, {
1027
- key: string;
1028
- model: string;
1029
- reasoning?: {
1030
- mode: "off";
1031
- } | {
1032
- mode: "on";
1033
- } | {
1034
- mode: "effort";
1035
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1036
- } | {
1037
- mode: "budget";
1038
- budgetTokens: number;
1039
- } | undefined;
1040
- provider?: string | undefined;
1041
- maxOutputTokens?: number | undefined;
1042
- label?: string | undefined;
1116
+ id: string;
1117
+ catalogId: string;
1043
1118
  baseUrl?: string | undefined;
1044
1119
  apiKey?: string | undefined;
1045
- protocol?: string | undefined;
1046
- providerKey?: string | undefined;
1047
- maxContextTokens?: number | undefined;
1048
- }>, {
1049
- protocol: string | undefined;
1050
- provider: string | undefined;
1051
- key: string;
1120
+ }>, "many">>;
1121
+ /**
1122
+ * Unified instance layer (统一模型接入方案, see
1123
+ * docs/superpowers/specs/2026-06-15-unified-model-catalog-design.md §3.3).
1124
+ * One store for text/image/video connections, each pointing at a catalog
1125
+ * entry (catalogId), a credential (credentialId), its chosen model, and the
1126
+ * param values the user picked. Replaces the legacy split of
1127
+ * providers[]/models[]/imageGen/videoGen.
1128
+ */
1129
+ modelConnections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1130
+ /** User-chosen unique instance name. */
1131
+ id: z.ZodString;
1132
+ /** Catalog template this instance was created from. */
1133
+ catalogId: z.ZodString;
1134
+ tag: z.ZodEnum<["text", "image", "video", "audio"]>;
1135
+ /** Selected modelId (from the entry's modelPresets). */
1136
+ model: z.ZodString;
1137
+ /** Per-connection baseUrl override (else the credential's / catalog's). */
1138
+ baseUrl: z.ZodOptional<z.ZodString>;
1139
+ /** Which credential supplies this connection's key. */
1140
+ credentialId: z.ZodOptional<z.ZodString>;
1141
+ /** Values the user picked for the model's params, e.g. { reasoning: "high" }. */
1142
+ paramValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1143
+ }, "strip", z.ZodTypeAny, {
1144
+ id: string;
1052
1145
  model: string;
1053
- reasoning?: {
1054
- mode: "off";
1055
- } | {
1056
- mode: "on";
1057
- } | {
1058
- mode: "effort";
1059
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1060
- } | {
1061
- mode: "budget";
1062
- budgetTokens: number;
1063
- } | undefined;
1064
- maxOutputTokens?: number | undefined;
1065
- label?: string | undefined;
1146
+ catalogId: string;
1147
+ tag: "text" | "image" | "video" | "audio";
1066
1148
  baseUrl?: string | undefined;
1067
- apiKey?: string | undefined;
1068
- providerKey?: string | undefined;
1069
- maxContextTokens?: number | undefined;
1149
+ credentialId?: string | undefined;
1150
+ paramValues?: Record<string, unknown> | undefined;
1070
1151
  }, {
1071
- key: string;
1152
+ id: string;
1072
1153
  model: string;
1073
- reasoning?: {
1074
- mode: "off";
1075
- } | {
1076
- mode: "on";
1077
- } | {
1078
- mode: "effort";
1079
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1080
- } | {
1081
- mode: "budget";
1082
- budgetTokens: number;
1083
- } | undefined;
1084
- provider?: string | undefined;
1085
- maxOutputTokens?: number | undefined;
1086
- label?: string | undefined;
1154
+ catalogId: string;
1155
+ tag: "text" | "image" | "video" | "audio";
1087
1156
  baseUrl?: string | undefined;
1088
- apiKey?: string | undefined;
1089
- protocol?: string | undefined;
1090
- providerKey?: string | undefined;
1091
- maxContextTokens?: number | undefined;
1157
+ credentialId?: string | undefined;
1158
+ paramValues?: Record<string, unknown> | undefined;
1092
1159
  }>, "many">>;
1160
+ /** Default instance id per tag (replaces activeKey / defaultProvider). */
1161
+ defaults: z.ZodDefault<z.ZodObject<{
1162
+ text: z.ZodOptional<z.ZodString>;
1163
+ image: z.ZodOptional<z.ZodString>;
1164
+ video: z.ZodOptional<z.ZodString>;
1165
+ /** Default speech-to-text (voice input) connection. */
1166
+ audio: z.ZodOptional<z.ZodString>;
1167
+ /** Background-task model (replaces auxModelKey). */
1168
+ auxText: z.ZodOptional<z.ZodString>;
1169
+ }, "strip", z.ZodTypeAny, {
1170
+ text?: string | undefined;
1171
+ image?: string | undefined;
1172
+ video?: string | undefined;
1173
+ audio?: string | undefined;
1174
+ auxText?: string | undefined;
1175
+ }, {
1176
+ text?: string | undefined;
1177
+ image?: string | undefined;
1178
+ video?: string | undefined;
1179
+ audio?: string | undefined;
1180
+ auxText?: string | undefined;
1181
+ }>>;
1093
1182
  permissions: z.ZodDefault<z.ZodObject<{
1094
1183
  defaultMode: z.ZodDefault<z.ZodEnum<["default", "acceptEdits", "dontAsk", "bypassPermissions", "auto", "plan"]>>;
1095
1184
  rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1129,14 +1218,17 @@ export declare const SettingsSchema: z.ZodObject<{
1129
1218
  maxTokens: z.ZodDefault<z.ZodNumber>;
1130
1219
  compactAtRatio: z.ZodDefault<z.ZodNumber>;
1131
1220
  summarizeAtRatio: z.ZodDefault<z.ZodNumber>;
1221
+ microcompactFloorRatio: z.ZodDefault<z.ZodNumber>;
1132
1222
  }, "strip", z.ZodTypeAny, {
1133
1223
  maxTokens: number;
1134
1224
  compactAtRatio: number;
1135
1225
  summarizeAtRatio: number;
1226
+ microcompactFloorRatio: number;
1136
1227
  }, {
1137
1228
  maxTokens?: number | undefined;
1138
1229
  compactAtRatio?: number | undefined;
1139
1230
  summarizeAtRatio?: number | undefined;
1231
+ microcompactFloorRatio?: number | undefined;
1140
1232
  }>>;
1141
1233
  session: z.ZodDefault<z.ZodObject<{
1142
1234
  storageDir: z.ZodOptional<z.ZodString>;
@@ -1148,7 +1240,7 @@ export declare const SettingsSchema: z.ZodObject<{
1148
1240
  storageDir?: string | undefined;
1149
1241
  maxHistory?: number | undefined;
1150
1242
  }>>;
1151
- mcpServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1243
+ mcpServers: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1152
1244
  name: z.ZodString;
1153
1245
  command: z.ZodOptional<z.ZodString>;
1154
1246
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1156,6 +1248,10 @@ export declare const SettingsSchema: z.ZodObject<{
1156
1248
  url: z.ZodOptional<z.ZodString>;
1157
1249
  transport: z.ZodOptional<z.ZodEnum<["stdio", "sse", "streamable-http", "inprocess"]>>;
1158
1250
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1251
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1252
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
1253
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1254
+ credentialRef: z.ZodOptional<z.ZodString>;
1159
1255
  enabled: z.ZodOptional<z.ZodBoolean>;
1160
1256
  }, "strip", z.ZodTypeAny, {
1161
1257
  name: string;
@@ -1166,6 +1262,10 @@ export declare const SettingsSchema: z.ZodObject<{
1166
1262
  env?: Record<string, string> | undefined;
1167
1263
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
1168
1264
  headers?: Record<string, string> | undefined;
1265
+ envVars?: string[] | undefined;
1266
+ bearerTokenEnvVar?: string | undefined;
1267
+ envHeaders?: Record<string, string> | undefined;
1268
+ credentialRef?: string | undefined;
1169
1269
  }, {
1170
1270
  name: string;
1171
1271
  enabled?: boolean | undefined;
@@ -1175,6 +1275,49 @@ export declare const SettingsSchema: z.ZodObject<{
1175
1275
  env?: Record<string, string> | undefined;
1176
1276
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
1177
1277
  headers?: Record<string, string> | undefined;
1278
+ envVars?: string[] | undefined;
1279
+ bearerTokenEnvVar?: string | undefined;
1280
+ envHeaders?: Record<string, string> | undefined;
1281
+ credentialRef?: string | undefined;
1282
+ }>>, Record<string, {
1283
+ name: string;
1284
+ enabled?: boolean | undefined;
1285
+ url?: string | undefined;
1286
+ args?: string[] | undefined;
1287
+ command?: string | undefined;
1288
+ env?: Record<string, string> | undefined;
1289
+ transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
1290
+ headers?: Record<string, string> | undefined;
1291
+ envVars?: string[] | undefined;
1292
+ bearerTokenEnvVar?: string | undefined;
1293
+ envHeaders?: Record<string, string> | undefined;
1294
+ credentialRef?: string | undefined;
1295
+ }>, unknown>>;
1296
+ /**
1297
+ * User supplements for PLUGIN-provided MCP servers, keyed by the server's
1298
+ * `<plugin>:<server>` name. Layered onto the plugin config at merge time
1299
+ * (mergePluginMcpServers). Only env/credential fields are accepted —
1300
+ * command/args/url/transport are intentionally absent and `.strict()`
1301
+ * rejects them, so a plugin update is never shadowed by a stale copy.
1302
+ */
1303
+ mcpServerOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1304
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1305
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1306
+ credentialRef: z.ZodOptional<z.ZodString>;
1307
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
1308
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1309
+ }, "strict", z.ZodTypeAny, {
1310
+ env?: Record<string, string> | undefined;
1311
+ envVars?: string[] | undefined;
1312
+ bearerTokenEnvVar?: string | undefined;
1313
+ envHeaders?: Record<string, string> | undefined;
1314
+ credentialRef?: string | undefined;
1315
+ }, {
1316
+ env?: Record<string, string> | undefined;
1317
+ envVars?: string[] | undefined;
1318
+ bearerTokenEnvVar?: string | undefined;
1319
+ envHeaders?: Record<string, string> | undefined;
1320
+ credentialRef?: string | undefined;
1178
1321
  }>>>;
1179
1322
  /**
1180
1323
  * Skill names hidden from the LLM. Names include the full
@@ -1209,18 +1352,62 @@ export declare const SettingsSchema: z.ZodObject<{
1209
1352
  agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1210
1353
  mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1211
1354
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1355
+ /**
1356
+ * Per-hook overlay for PLUGIN-provided hooks, keyed by
1357
+ * `pluginHookKey()` (`<plugin>:<RawEvent>:<command>`). Finer-grained
1358
+ * than `plugins` (which kills a whole plugin): "off" suppresses one
1359
+ * hook for this project only. Only "off" is meaningful today — plugin
1360
+ * hooks have no global disable list to force back "on" from.
1361
+ */
1362
+ pluginHooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1212
1363
  }, "strip", z.ZodTypeAny, {
1213
1364
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
1214
1365
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
1215
1366
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
1216
1367
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
1217
1368
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
1369
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
1218
1370
  }, {
1219
1371
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
1220
1372
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
1221
1373
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
1222
1374
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
1223
1375
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
1376
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
1377
+ }>>;
1378
+ /**
1379
+ * Feature flags overlay: a map of flag name → boolean that overrides the
1380
+ * compiled-in defaults (see settings/feature-flags.ts FEATURE_FLAGS).
1381
+ * Project settings override user settings via the normal merge, so a flag
1382
+ * can be flipped per-workspace. Unknown flag names are tolerated (kept as
1383
+ * data) for forward-compat; consumers only read known flags via
1384
+ * isFeatureEnabled(). Passthrough record — values coerced to boolean.
1385
+ */
1386
+ featureFlags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
1387
+ /**
1388
+ * Cross-session memory knobs. Optional — absence keeps the built-in
1389
+ * defaults (see services/extract-memories.ts). `maxCount` caps memories
1390
+ * accepted per extraction pass; `maxAge`/`extractionModel` are reserved
1391
+ * for the consolidation/extraction pipeline.
1392
+ */
1393
+ memories: z.ZodOptional<z.ZodObject<{
1394
+ maxCount: z.ZodOptional<z.ZodNumber>;
1395
+ maxAge: z.ZodOptional<z.ZodNumber>;
1396
+ extractionModel: z.ZodOptional<z.ZodString>;
1397
+ /** Master switch for end-of-session automatic memory extraction.
1398
+ * Absent/true = extract (current behavior); false = skip extraction
1399
+ * while keeping session summaries and Dream untouched. */
1400
+ autoExtract: z.ZodOptional<z.ZodBoolean>;
1401
+ }, "strip", z.ZodTypeAny, {
1402
+ maxCount?: number | undefined;
1403
+ maxAge?: number | undefined;
1404
+ extractionModel?: string | undefined;
1405
+ autoExtract?: boolean | undefined;
1406
+ }, {
1407
+ maxCount?: number | undefined;
1408
+ maxAge?: number | undefined;
1409
+ extractionModel?: string | undefined;
1410
+ autoExtract?: boolean | undefined;
1224
1411
  }>>;
1225
1412
  instructions: z.ZodDefault<z.ZodObject<{
1226
1413
  fileName: z.ZodDefault<z.ZodString>;
@@ -1369,24 +1556,22 @@ export declare const SettingsSchema: z.ZodObject<{
1369
1556
  }>>;
1370
1557
  /**
1371
1558
  * Image attachment handling. Sub-fields:
1372
- * - detail: OpenAI-style fidelity hint applied to every user-
1373
- * attached image. "low" = 85 tokens/image fixed (cheap
1374
- * thumbnail), "high" = ~768 px tiles (default), "original" =
1375
- * keep client-side dimensions (most expensive). Anthropic
1376
- * ignores this field today; that's fine — it just gets
1377
- * dropped on the Claude path.
1559
+ * - detail: provider-agnostic image clarity. Drives the
1560
+ * renderer-side downscale (low→~1024 / standard→~1568 /
1561
+ * high→~2576 px long edge) so BOTH providers save tokens
1562
+ * before send. Legacy "original" is migrated to "high".
1378
1563
  * - mcpImageTokenBudget: per-turn cap on token cost of images
1379
1564
  * returned by MCP tools. Codex doesn't enforce this; CC uses
1380
1565
  * 25 000. Set to 0 to disable.
1381
1566
  */
1382
1567
  images: z.ZodOptional<z.ZodObject<{
1383
- detail: z.ZodOptional<z.ZodEnum<["low", "high", "original"]>>;
1568
+ detail: z.ZodOptional<z.ZodEffects<z.ZodEnum<["low", "standard", "high"]>, "low" | "high" | "standard", unknown>>;
1384
1569
  mcpImageTokenBudget: z.ZodOptional<z.ZodNumber>;
1385
1570
  }, "strip", z.ZodTypeAny, {
1386
- detail?: "low" | "high" | "original" | undefined;
1571
+ detail?: "low" | "high" | "standard" | undefined;
1387
1572
  mcpImageTokenBudget?: number | undefined;
1388
1573
  }, {
1389
- detail?: "low" | "high" | "original" | undefined;
1574
+ detail?: unknown;
1390
1575
  mcpImageTokenBudget?: number | undefined;
1391
1576
  }>>;
1392
1577
  /**
@@ -1411,6 +1596,21 @@ export declare const SettingsSchema: z.ZodObject<{
1411
1596
  deniedReads?: string[] | undefined;
1412
1597
  network?: "allow" | "deny" | undefined;
1413
1598
  }>>;
1599
+ /**
1600
+ * Top-level environment variables injected into tool subprocesses (the
1601
+ * Bash tool, background shells). Mirrors Claude Code's `env` field: a
1602
+ * KEY=VALUE map that can be set globally (~/.code-shell/settings.json) and
1603
+ * overridden per-project (.code-shell/settings.json). The canonical home
1604
+ * for API keys (e.g. OPENAI_API_KEY) that a skill's script reads — configure
1605
+ * once globally and every project's skills can use it.
1606
+ *
1607
+ * Precedence when merged into the spawn env (lowest → highest):
1608
+ * project localEnvironment.env → global env → project env
1609
+ * None of these is filtered through the deny regex (see mergeShellEnv):
1610
+ * they are values the user typed deliberately, a different trust class from
1611
+ * the host process.env passthrough the deny machinery guards against.
1612
+ */
1613
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1414
1614
  /**
1415
1615
  * Project-local environment profile. Mirrors Codex's local-environment
1416
1616
  * shape at the settings layer: setup/cleanup scripts can be customized per
@@ -1499,19 +1699,99 @@ export declare const SettingsSchema: z.ZodObject<{
1499
1699
  matcher: z.ZodOptional<z.ZodString>;
1500
1700
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1501
1701
  cwd: z.ZodOptional<z.ZodString>;
1702
+ /** Soft off-switch: the entry stays in the file (and the UI) but
1703
+ * registerSettingsHooks skips it. Absent = enabled. */
1704
+ disabled: z.ZodOptional<z.ZodBoolean>;
1502
1705
  }, "strip", z.ZodTypeAny, {
1503
1706
  command: string;
1504
1707
  event: string;
1708
+ disabled?: boolean | undefined;
1505
1709
  matcher?: string | undefined;
1506
1710
  timeout_ms?: number | undefined;
1507
1711
  cwd?: string | undefined;
1508
1712
  }, {
1509
1713
  command: string;
1510
1714
  event: string;
1715
+ disabled?: boolean | undefined;
1511
1716
  matcher?: string | undefined;
1512
1717
  timeout_ms?: number | undefined;
1513
1718
  cwd?: string | undefined;
1514
1719
  }>, "many">>;
1720
+ /**
1721
+ * External coding-agent orchestration (Claude Code / Codex CLI).
1722
+ * Used by the Mobile Web Remote to launch managed jobs. dangerousArgs
1723
+ * is config-provided (not hardcoded) so it tracks CLI flag changes;
1724
+ * project-default dangerous mode only applies inside trustedWorkspaces.
1725
+ */
1726
+ externalAgents: z.ZodOptional<z.ZodObject<{
1727
+ claudeCode: z.ZodOptional<z.ZodObject<{
1728
+ command: z.ZodOptional<z.ZodString>;
1729
+ defaultMode: z.ZodOptional<z.ZodEnum<["safe", "dangerous"]>>;
1730
+ dangerousArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1731
+ trustedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1732
+ autoStartInTrustedWorkspaces: z.ZodOptional<z.ZodBoolean>;
1733
+ }, "strip", z.ZodTypeAny, {
1734
+ defaultMode?: "safe" | "dangerous" | undefined;
1735
+ command?: string | undefined;
1736
+ dangerousArgs?: string[] | undefined;
1737
+ trustedWorkspaces?: string[] | undefined;
1738
+ autoStartInTrustedWorkspaces?: boolean | undefined;
1739
+ }, {
1740
+ defaultMode?: "safe" | "dangerous" | undefined;
1741
+ command?: string | undefined;
1742
+ dangerousArgs?: string[] | undefined;
1743
+ trustedWorkspaces?: string[] | undefined;
1744
+ autoStartInTrustedWorkspaces?: boolean | undefined;
1745
+ }>>;
1746
+ codex: z.ZodOptional<z.ZodObject<{
1747
+ command: z.ZodOptional<z.ZodString>;
1748
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1749
+ }, "strip", z.ZodTypeAny, {
1750
+ args?: string[] | undefined;
1751
+ command?: string | undefined;
1752
+ }, {
1753
+ args?: string[] | undefined;
1754
+ command?: string | undefined;
1755
+ }>>;
1756
+ }, "strip", z.ZodTypeAny, {
1757
+ claudeCode?: {
1758
+ defaultMode?: "safe" | "dangerous" | undefined;
1759
+ command?: string | undefined;
1760
+ dangerousArgs?: string[] | undefined;
1761
+ trustedWorkspaces?: string[] | undefined;
1762
+ autoStartInTrustedWorkspaces?: boolean | undefined;
1763
+ } | undefined;
1764
+ codex?: {
1765
+ args?: string[] | undefined;
1766
+ command?: string | undefined;
1767
+ } | undefined;
1768
+ }, {
1769
+ claudeCode?: {
1770
+ defaultMode?: "safe" | "dangerous" | undefined;
1771
+ command?: string | undefined;
1772
+ dangerousArgs?: string[] | undefined;
1773
+ trustedWorkspaces?: string[] | undefined;
1774
+ autoStartInTrustedWorkspaces?: boolean | undefined;
1775
+ } | undefined;
1776
+ codex?: {
1777
+ args?: string[] | undefined;
1778
+ command?: string | undefined;
1779
+ } | undefined;
1780
+ }>>;
1781
+ /**
1782
+ * Credential-use gate (凭证模块第二期). Controls whether the AI's
1783
+ * `UseCredential` tool prompts before handing a stored credential to a
1784
+ * command. `autoApprove: true` skips the prompt entirely (默认关 — every
1785
+ * use asks, or is remembered for the session). See
1786
+ * docs/superpowers/specs/2026-06-16-credential-use-gate-design.md §5.
1787
+ */
1788
+ credentialUse: z.ZodOptional<z.ZodObject<{
1789
+ autoApprove: z.ZodOptional<z.ZodBoolean>;
1790
+ }, "strip", z.ZodTypeAny, {
1791
+ autoApprove?: boolean | undefined;
1792
+ }, {
1793
+ autoApprove?: boolean | undefined;
1794
+ }>>;
1515
1795
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1516
1796
  agent: z.ZodDefault<z.ZodObject<{
1517
1797
  preset: z.ZodDefault<z.ZodString>;
@@ -1556,23 +1836,6 @@ export declare const SettingsSchema: z.ZodObject<{
1556
1836
  compatCodex?: boolean | undefined;
1557
1837
  } | undefined;
1558
1838
  }>>;
1559
- /**
1560
- * Primary source of truth for the active model is settings.activeKey
1561
- * (points at models[].key). settings.model is a derived mirror of that
1562
- * entry kept in sync for legacy boot paths (cli/main.ts, repl.ts, etc.)
1563
- * which read provider/name/apiKey/baseUrl directly. Writers must update
1564
- * both — appendOnboardingResult does this in one shot.
1565
- */
1566
- activeKey: z.ZodOptional<z.ZodString>;
1567
- /**
1568
- * Auxiliary-task model — points at a models[].key. Background, non-user-
1569
- * facing LLM calls (memory extraction, the auto-dream loop) use this model
1570
- * instead of the active one, so per-turn book-keeping doesn't burn the
1571
- * expensive primary model. Pick something fast/cheap (e.g. a Haiku or
1572
- * DeepSeek key). When unset, those calls fall back to the active model
1573
- * (legacy behavior). An invalid/missing key also falls back to active.
1574
- */
1575
- auxModelKey: z.ZodOptional<z.ZodString>;
1576
1839
  /**
1577
1840
  * Toggle background auto-update. When true (default), code-shell checks
1578
1841
  * npm for newer versions and — if the npm global prefix is writable —
@@ -1581,254 +1844,215 @@ export declare const SettingsSchema: z.ZodObject<{
1581
1844
  * Can also be disabled via env var `DISABLE_AUTOUPDATER=1`.
1582
1845
  */
1583
1846
  autoUpdates: z.ZodDefault<z.ZodBoolean>;
1584
- model: z.ZodDefault<z.ZodObject<{
1585
- provider: z.ZodDefault<z.ZodString>;
1586
- name: z.ZodDefault<z.ZodString>;
1587
- apiKey: z.ZodOptional<z.ZodString>;
1588
- baseUrl: z.ZodDefault<z.ZodString>;
1589
- temperature: z.ZodDefault<z.ZodNumber>;
1590
- maxTokens: z.ZodDefault<z.ZodNumber>;
1847
+ /**
1848
+ * Image generation is a general capability, decoupled from LLM providers
1849
+ * (TODO 7.1): a vendor may use different keys/endpoints/models for chat vs
1850
+ * image, and image vendors (Gemini, and later 国内 模型) don't fit the LLM
1851
+ * `providers[].kind` enum. `imageGen.providers[]` is the canonical config;
1852
+ * each entry has a user-chosen `id` (selected via GenerateImage's
1853
+ * `provider` arg) and a `kind` that picks the adapter. When `imageGen` is
1854
+ * absent, resolution falls back to scanning LLM `providers[]` for an
1855
+ * image-capable kind — so existing configs keep working with no migration.
1856
+ */
1857
+ imageGen: z.ZodOptional<z.ZodObject<{
1858
+ defaultProvider: z.ZodOptional<z.ZodString>;
1859
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
1860
+ /** User-chosen instance name; GenerateImage(provider) selects by this. */
1861
+ id: z.ZodString;
1862
+ /** Adapter selector — e.g. "openai", "google". */
1863
+ kind: z.ZodString;
1864
+ baseUrl: z.ZodString;
1865
+ apiKey: z.ZodOptional<z.ZodString>;
1866
+ /** Default model for this instance when the call omits `model`. */
1867
+ defaultModel: z.ZodOptional<z.ZodString>;
1868
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
1869
+ catalogId: z.ZodOptional<z.ZodString>;
1870
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
1871
+ apiKeyRef: z.ZodOptional<z.ZodString>;
1872
+ }, "strip", z.ZodTypeAny, {
1873
+ id: string;
1874
+ kind: string;
1875
+ baseUrl: string;
1876
+ apiKey?: string | undefined;
1877
+ defaultModel?: string | undefined;
1878
+ catalogId?: string | undefined;
1879
+ apiKeyRef?: string | undefined;
1880
+ }, {
1881
+ id: string;
1882
+ kind: string;
1883
+ baseUrl: string;
1884
+ apiKey?: string | undefined;
1885
+ defaultModel?: string | undefined;
1886
+ catalogId?: string | undefined;
1887
+ apiKeyRef?: string | undefined;
1888
+ }>, "many">>;
1591
1889
  }, "strip", z.ZodTypeAny, {
1592
- temperature: number;
1593
- name: string;
1594
- provider: string;
1595
- baseUrl: string;
1596
- maxTokens: number;
1597
- apiKey?: string | undefined;
1890
+ providers: {
1891
+ id: string;
1892
+ kind: string;
1893
+ baseUrl: string;
1894
+ apiKey?: string | undefined;
1895
+ defaultModel?: string | undefined;
1896
+ catalogId?: string | undefined;
1897
+ apiKeyRef?: string | undefined;
1898
+ }[];
1899
+ defaultProvider?: string | undefined;
1598
1900
  }, {
1599
- temperature?: number | undefined;
1600
- name?: string | undefined;
1601
- provider?: string | undefined;
1602
- baseUrl?: string | undefined;
1603
- apiKey?: string | undefined;
1604
- maxTokens?: number | undefined;
1901
+ defaultProvider?: string | undefined;
1902
+ providers?: {
1903
+ id: string;
1904
+ kind: string;
1905
+ baseUrl: string;
1906
+ apiKey?: string | undefined;
1907
+ defaultModel?: string | undefined;
1908
+ catalogId?: string | undefined;
1909
+ apiKeyRef?: string | undefined;
1910
+ }[] | undefined;
1605
1911
  }>>;
1606
- providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
1607
- key: z.ZodString;
1608
- label: z.ZodOptional<z.ZodString>;
1609
- kind: z.ZodEnum<["openai", "anthropic", "deepseek", "zai", "xai", "mistral", "groq", "google", "openrouter", "ollama", "custom"]>;
1610
- baseUrl: z.ZodString;
1611
- apiKey: z.ZodOptional<z.ZodString>;
1612
- protocol: z.ZodOptional<z.ZodEnum<["openai-compat", "anthropic-style"]>>;
1613
- modelsPath: z.ZodOptional<z.ZodString>;
1614
- /**
1615
- * Default reasoning/thinking setting for this provider's models.
1616
- * Rich shape: {mode:"off"|"on"} | {mode:"effort",effort} |
1617
- * {mode:"budget",budgetTokens}. Per-model `reasoning` wins.
1618
- */
1619
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1620
- mode: z.ZodLiteral<"off">;
1621
- }, "strip", z.ZodTypeAny, {
1622
- mode: "off";
1623
- }, {
1624
- mode: "off";
1625
- }>, z.ZodObject<{
1626
- mode: z.ZodLiteral<"on">;
1627
- }, "strip", z.ZodTypeAny, {
1628
- mode: "on";
1629
- }, {
1630
- mode: "on";
1631
- }>, z.ZodObject<{
1632
- mode: z.ZodLiteral<"effort">;
1633
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
1634
- }, "strip", z.ZodTypeAny, {
1635
- mode: "effort";
1636
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1637
- }, {
1638
- mode: "effort";
1639
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1640
- }>, z.ZodObject<{
1641
- mode: z.ZodLiteral<"budget">;
1642
- budgetTokens: z.ZodNumber;
1912
+ /**
1913
+ * Video generation config (TODO 7.1) — same shape as imageGen, decoupled
1914
+ * from LLM providers. `videoGen.providers[]` each carry an `id` (selected
1915
+ * via GenerateVideo's `provider` arg) + a `kind` picking the adapter. With
1916
+ * no real adapters wired yet, this is config-ready: a future getVideoProvider
1917
+ * case lights it up. Falls back to scanning LLM providers[] when absent.
1918
+ */
1919
+ videoGen: z.ZodOptional<z.ZodObject<{
1920
+ defaultProvider: z.ZodOptional<z.ZodString>;
1921
+ providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
1922
+ id: z.ZodString;
1923
+ kind: z.ZodString;
1924
+ baseUrl: z.ZodString;
1925
+ apiKey: z.ZodOptional<z.ZodString>;
1926
+ defaultModel: z.ZodOptional<z.ZodString>;
1927
+ /** Catalog template this instance was created from (for paramsDoc / displayName回显). */
1928
+ catalogId: z.ZodOptional<z.ZodString>;
1929
+ /** Reuse another instance's key: id of the instance whose apiKey to use (when apiKey is empty). */
1930
+ apiKeyRef: z.ZodOptional<z.ZodString>;
1643
1931
  }, "strip", z.ZodTypeAny, {
1644
- mode: "budget";
1645
- budgetTokens: number;
1932
+ id: string;
1933
+ kind: string;
1934
+ baseUrl: string;
1935
+ apiKey?: string | undefined;
1936
+ defaultModel?: string | undefined;
1937
+ catalogId?: string | undefined;
1938
+ apiKeyRef?: string | undefined;
1646
1939
  }, {
1647
- mode: "budget";
1648
- budgetTokens: number;
1649
- }>]>>;
1650
- }, "strip", z.ZodTypeAny, {
1651
- key: string;
1652
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
1653
- baseUrl: string;
1654
- reasoning?: {
1655
- mode: "off";
1656
- } | {
1657
- mode: "on";
1658
- } | {
1659
- mode: "effort";
1660
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1661
- } | {
1662
- mode: "budget";
1663
- budgetTokens: number;
1664
- } | undefined;
1665
- label?: string | undefined;
1666
- apiKey?: string | undefined;
1667
- protocol?: "openai-compat" | "anthropic-style" | undefined;
1668
- modelsPath?: string | undefined;
1669
- }, {
1670
- key: string;
1671
- kind: "openai" | "anthropic" | "deepseek" | "zai" | "xai" | "mistral" | "groq" | "google" | "openrouter" | "ollama" | "custom";
1672
- baseUrl: string;
1673
- reasoning?: {
1674
- mode: "off";
1675
- } | {
1676
- mode: "on";
1677
- } | {
1678
- mode: "effort";
1679
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1680
- } | {
1681
- mode: "budget";
1682
- budgetTokens: number;
1683
- } | undefined;
1684
- label?: string | undefined;
1685
- apiKey?: string | undefined;
1686
- protocol?: "openai-compat" | "anthropic-style" | undefined;
1687
- modelsPath?: string | undefined;
1688
- }>, "many">>;
1689
- models: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
1690
- key: z.ZodString;
1691
- label: z.ZodOptional<z.ZodString>;
1692
- providerKey: z.ZodOptional<z.ZodString>;
1693
- model: z.ZodString;
1694
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1695
- maxContextTokens: z.ZodOptional<z.ZodNumber>;
1696
- /**
1697
- * Which LLM client to use ("openai" or "anthropic"). New name —
1698
- * the legacy field is `provider`, which we still accept and
1699
- * fold into `protocol` below so old configs keep working.
1700
- * NOT the brand/vendor — that's providerKey above.
1701
- */
1702
- protocol: z.ZodOptional<z.ZodString>;
1703
- provider: z.ZodOptional<z.ZodString>;
1704
- baseUrl: z.ZodOptional<z.ZodString>;
1940
+ id: string;
1941
+ kind: string;
1942
+ baseUrl: string;
1943
+ apiKey?: string | undefined;
1944
+ defaultModel?: string | undefined;
1945
+ catalogId?: string | undefined;
1946
+ apiKeyRef?: string | undefined;
1947
+ }>, "many">>;
1948
+ }, "strip", z.ZodTypeAny, {
1949
+ providers: {
1950
+ id: string;
1951
+ kind: string;
1952
+ baseUrl: string;
1953
+ apiKey?: string | undefined;
1954
+ defaultModel?: string | undefined;
1955
+ catalogId?: string | undefined;
1956
+ apiKeyRef?: string | undefined;
1957
+ }[];
1958
+ defaultProvider?: string | undefined;
1959
+ }, {
1960
+ defaultProvider?: string | undefined;
1961
+ providers?: {
1962
+ id: string;
1963
+ kind: string;
1964
+ baseUrl: string;
1965
+ apiKey?: string | undefined;
1966
+ defaultModel?: string | undefined;
1967
+ catalogId?: string | undefined;
1968
+ apiKeyRef?: string | undefined;
1969
+ }[] | undefined;
1970
+ }>>;
1971
+ /**
1972
+ * Credentials independent key entities (统一模型接入方案 §3.3). A key
1973
+ * lives here, not inlined on a connection, so deleting a connection never
1974
+ * loses a key and many connections share one key by referencing the same
1975
+ * credential id (LiteLLM credential_list model).
1976
+ */
1977
+ credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
1978
+ /** User-chosen unique credential name. */
1979
+ id: z.ZodString;
1980
+ /** Catalog template this credential is for (a key belongs to one provider). */
1981
+ catalogId: z.ZodString;
1705
1982
  apiKey: z.ZodOptional<z.ZodString>;
1706
- /**
1707
- * Per-model reasoning override. Wins over the provider-level
1708
- * `reasoning` setting (settings.providers[].reasoning). Use this
1709
- * when different models under the same provider need different
1710
- * defaults — e.g. one model off (faster) and another on.
1711
- */
1712
- reasoning: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1713
- mode: z.ZodLiteral<"off">;
1714
- }, "strip", z.ZodTypeAny, {
1715
- mode: "off";
1716
- }, {
1717
- mode: "off";
1718
- }>, z.ZodObject<{
1719
- mode: z.ZodLiteral<"on">;
1720
- }, "strip", z.ZodTypeAny, {
1721
- mode: "on";
1722
- }, {
1723
- mode: "on";
1724
- }>, z.ZodObject<{
1725
- mode: z.ZodLiteral<"effort">;
1726
- effort: z.ZodEnum<["minimal", "low", "medium", "high", "xhigh"]>;
1727
- }, "strip", z.ZodTypeAny, {
1728
- mode: "effort";
1729
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1730
- }, {
1731
- mode: "effort";
1732
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1733
- }>, z.ZodObject<{
1734
- mode: z.ZodLiteral<"budget">;
1735
- budgetTokens: z.ZodNumber;
1736
- }, "strip", z.ZodTypeAny, {
1737
- mode: "budget";
1738
- budgetTokens: number;
1739
- }, {
1740
- mode: "budget";
1741
- budgetTokens: number;
1742
- }>]>>;
1983
+ baseUrl: z.ZodOptional<z.ZodString>;
1743
1984
  }, "strip", z.ZodTypeAny, {
1744
- key: string;
1745
- model: string;
1746
- reasoning?: {
1747
- mode: "off";
1748
- } | {
1749
- mode: "on";
1750
- } | {
1751
- mode: "effort";
1752
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1753
- } | {
1754
- mode: "budget";
1755
- budgetTokens: number;
1756
- } | undefined;
1757
- provider?: string | undefined;
1758
- maxOutputTokens?: number | undefined;
1759
- label?: string | undefined;
1985
+ id: string;
1986
+ catalogId: string;
1760
1987
  baseUrl?: string | undefined;
1761
1988
  apiKey?: string | undefined;
1762
- protocol?: string | undefined;
1763
- providerKey?: string | undefined;
1764
- maxContextTokens?: number | undefined;
1765
1989
  }, {
1766
- key: string;
1767
- model: string;
1768
- reasoning?: {
1769
- mode: "off";
1770
- } | {
1771
- mode: "on";
1772
- } | {
1773
- mode: "effort";
1774
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1775
- } | {
1776
- mode: "budget";
1777
- budgetTokens: number;
1778
- } | undefined;
1779
- provider?: string | undefined;
1780
- maxOutputTokens?: number | undefined;
1781
- label?: string | undefined;
1990
+ id: string;
1991
+ catalogId: string;
1782
1992
  baseUrl?: string | undefined;
1783
1993
  apiKey?: string | undefined;
1784
- protocol?: string | undefined;
1785
- providerKey?: string | undefined;
1786
- maxContextTokens?: number | undefined;
1787
- }>, {
1788
- protocol: string | undefined;
1789
- provider: string | undefined;
1790
- key: string;
1994
+ }>, "many">>;
1995
+ /**
1996
+ * Unified instance layer (统一模型接入方案, see
1997
+ * docs/superpowers/specs/2026-06-15-unified-model-catalog-design.md §3.3).
1998
+ * One store for text/image/video connections, each pointing at a catalog
1999
+ * entry (catalogId), a credential (credentialId), its chosen model, and the
2000
+ * param values the user picked. Replaces the legacy split of
2001
+ * providers[]/models[]/imageGen/videoGen.
2002
+ */
2003
+ modelConnections: z.ZodDefault<z.ZodArray<z.ZodObject<{
2004
+ /** User-chosen unique instance name. */
2005
+ id: z.ZodString;
2006
+ /** Catalog template this instance was created from. */
2007
+ catalogId: z.ZodString;
2008
+ tag: z.ZodEnum<["text", "image", "video", "audio"]>;
2009
+ /** Selected modelId (from the entry's modelPresets). */
2010
+ model: z.ZodString;
2011
+ /** Per-connection baseUrl override (else the credential's / catalog's). */
2012
+ baseUrl: z.ZodOptional<z.ZodString>;
2013
+ /** Which credential supplies this connection's key. */
2014
+ credentialId: z.ZodOptional<z.ZodString>;
2015
+ /** Values the user picked for the model's params, e.g. { reasoning: "high" }. */
2016
+ paramValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2017
+ }, "strip", z.ZodTypeAny, {
2018
+ id: string;
1791
2019
  model: string;
1792
- reasoning?: {
1793
- mode: "off";
1794
- } | {
1795
- mode: "on";
1796
- } | {
1797
- mode: "effort";
1798
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1799
- } | {
1800
- mode: "budget";
1801
- budgetTokens: number;
1802
- } | undefined;
1803
- maxOutputTokens?: number | undefined;
1804
- label?: string | undefined;
2020
+ catalogId: string;
2021
+ tag: "text" | "image" | "video" | "audio";
1805
2022
  baseUrl?: string | undefined;
1806
- apiKey?: string | undefined;
1807
- providerKey?: string | undefined;
1808
- maxContextTokens?: number | undefined;
2023
+ credentialId?: string | undefined;
2024
+ paramValues?: Record<string, unknown> | undefined;
1809
2025
  }, {
1810
- key: string;
2026
+ id: string;
1811
2027
  model: string;
1812
- reasoning?: {
1813
- mode: "off";
1814
- } | {
1815
- mode: "on";
1816
- } | {
1817
- mode: "effort";
1818
- effort: "minimal" | "low" | "medium" | "high" | "xhigh";
1819
- } | {
1820
- mode: "budget";
1821
- budgetTokens: number;
1822
- } | undefined;
1823
- provider?: string | undefined;
1824
- maxOutputTokens?: number | undefined;
1825
- label?: string | undefined;
2028
+ catalogId: string;
2029
+ tag: "text" | "image" | "video" | "audio";
1826
2030
  baseUrl?: string | undefined;
1827
- apiKey?: string | undefined;
1828
- protocol?: string | undefined;
1829
- providerKey?: string | undefined;
1830
- maxContextTokens?: number | undefined;
2031
+ credentialId?: string | undefined;
2032
+ paramValues?: Record<string, unknown> | undefined;
1831
2033
  }>, "many">>;
2034
+ /** Default instance id per tag (replaces activeKey / defaultProvider). */
2035
+ defaults: z.ZodDefault<z.ZodObject<{
2036
+ text: z.ZodOptional<z.ZodString>;
2037
+ image: z.ZodOptional<z.ZodString>;
2038
+ video: z.ZodOptional<z.ZodString>;
2039
+ /** Default speech-to-text (voice input) connection. */
2040
+ audio: z.ZodOptional<z.ZodString>;
2041
+ /** Background-task model (replaces auxModelKey). */
2042
+ auxText: z.ZodOptional<z.ZodString>;
2043
+ }, "strip", z.ZodTypeAny, {
2044
+ text?: string | undefined;
2045
+ image?: string | undefined;
2046
+ video?: string | undefined;
2047
+ audio?: string | undefined;
2048
+ auxText?: string | undefined;
2049
+ }, {
2050
+ text?: string | undefined;
2051
+ image?: string | undefined;
2052
+ video?: string | undefined;
2053
+ audio?: string | undefined;
2054
+ auxText?: string | undefined;
2055
+ }>>;
1832
2056
  permissions: z.ZodDefault<z.ZodObject<{
1833
2057
  defaultMode: z.ZodDefault<z.ZodEnum<["default", "acceptEdits", "dontAsk", "bypassPermissions", "auto", "plan"]>>;
1834
2058
  rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1868,14 +2092,17 @@ export declare const SettingsSchema: z.ZodObject<{
1868
2092
  maxTokens: z.ZodDefault<z.ZodNumber>;
1869
2093
  compactAtRatio: z.ZodDefault<z.ZodNumber>;
1870
2094
  summarizeAtRatio: z.ZodDefault<z.ZodNumber>;
2095
+ microcompactFloorRatio: z.ZodDefault<z.ZodNumber>;
1871
2096
  }, "strip", z.ZodTypeAny, {
1872
2097
  maxTokens: number;
1873
2098
  compactAtRatio: number;
1874
2099
  summarizeAtRatio: number;
2100
+ microcompactFloorRatio: number;
1875
2101
  }, {
1876
2102
  maxTokens?: number | undefined;
1877
2103
  compactAtRatio?: number | undefined;
1878
2104
  summarizeAtRatio?: number | undefined;
2105
+ microcompactFloorRatio?: number | undefined;
1879
2106
  }>>;
1880
2107
  session: z.ZodDefault<z.ZodObject<{
1881
2108
  storageDir: z.ZodOptional<z.ZodString>;
@@ -1887,7 +2114,7 @@ export declare const SettingsSchema: z.ZodObject<{
1887
2114
  storageDir?: string | undefined;
1888
2115
  maxHistory?: number | undefined;
1889
2116
  }>>;
1890
- mcpServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
2117
+ mcpServers: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1891
2118
  name: z.ZodString;
1892
2119
  command: z.ZodOptional<z.ZodString>;
1893
2120
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1895,6 +2122,10 @@ export declare const SettingsSchema: z.ZodObject<{
1895
2122
  url: z.ZodOptional<z.ZodString>;
1896
2123
  transport: z.ZodOptional<z.ZodEnum<["stdio", "sse", "streamable-http", "inprocess"]>>;
1897
2124
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2125
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2126
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
2127
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2128
+ credentialRef: z.ZodOptional<z.ZodString>;
1898
2129
  enabled: z.ZodOptional<z.ZodBoolean>;
1899
2130
  }, "strip", z.ZodTypeAny, {
1900
2131
  name: string;
@@ -1905,6 +2136,10 @@ export declare const SettingsSchema: z.ZodObject<{
1905
2136
  env?: Record<string, string> | undefined;
1906
2137
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
1907
2138
  headers?: Record<string, string> | undefined;
2139
+ envVars?: string[] | undefined;
2140
+ bearerTokenEnvVar?: string | undefined;
2141
+ envHeaders?: Record<string, string> | undefined;
2142
+ credentialRef?: string | undefined;
1908
2143
  }, {
1909
2144
  name: string;
1910
2145
  enabled?: boolean | undefined;
@@ -1914,6 +2149,49 @@ export declare const SettingsSchema: z.ZodObject<{
1914
2149
  env?: Record<string, string> | undefined;
1915
2150
  transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
1916
2151
  headers?: Record<string, string> | undefined;
2152
+ envVars?: string[] | undefined;
2153
+ bearerTokenEnvVar?: string | undefined;
2154
+ envHeaders?: Record<string, string> | undefined;
2155
+ credentialRef?: string | undefined;
2156
+ }>>, Record<string, {
2157
+ name: string;
2158
+ enabled?: boolean | undefined;
2159
+ url?: string | undefined;
2160
+ args?: string[] | undefined;
2161
+ command?: string | undefined;
2162
+ env?: Record<string, string> | undefined;
2163
+ transport?: "stdio" | "sse" | "streamable-http" | "inprocess" | undefined;
2164
+ headers?: Record<string, string> | undefined;
2165
+ envVars?: string[] | undefined;
2166
+ bearerTokenEnvVar?: string | undefined;
2167
+ envHeaders?: Record<string, string> | undefined;
2168
+ credentialRef?: string | undefined;
2169
+ }>, unknown>>;
2170
+ /**
2171
+ * User supplements for PLUGIN-provided MCP servers, keyed by the server's
2172
+ * `<plugin>:<server>` name. Layered onto the plugin config at merge time
2173
+ * (mergePluginMcpServers). Only env/credential fields are accepted —
2174
+ * command/args/url/transport are intentionally absent and `.strict()`
2175
+ * rejects them, so a plugin update is never shadowed by a stale copy.
2176
+ */
2177
+ mcpServerOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
2178
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2179
+ envVars: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2180
+ credentialRef: z.ZodOptional<z.ZodString>;
2181
+ bearerTokenEnvVar: z.ZodOptional<z.ZodString>;
2182
+ envHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2183
+ }, "strict", z.ZodTypeAny, {
2184
+ env?: Record<string, string> | undefined;
2185
+ envVars?: string[] | undefined;
2186
+ bearerTokenEnvVar?: string | undefined;
2187
+ envHeaders?: Record<string, string> | undefined;
2188
+ credentialRef?: string | undefined;
2189
+ }, {
2190
+ env?: Record<string, string> | undefined;
2191
+ envVars?: string[] | undefined;
2192
+ bearerTokenEnvVar?: string | undefined;
2193
+ envHeaders?: Record<string, string> | undefined;
2194
+ credentialRef?: string | undefined;
1917
2195
  }>>>;
1918
2196
  /**
1919
2197
  * Skill names hidden from the LLM. Names include the full
@@ -1948,18 +2226,62 @@ export declare const SettingsSchema: z.ZodObject<{
1948
2226
  agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1949
2227
  mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1950
2228
  builtin: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
2229
+ /**
2230
+ * Per-hook overlay for PLUGIN-provided hooks, keyed by
2231
+ * `pluginHookKey()` (`<plugin>:<RawEvent>:<command>`). Finer-grained
2232
+ * than `plugins` (which kills a whole plugin): "off" suppresses one
2233
+ * hook for this project only. Only "off" is meaningful today — plugin
2234
+ * hooks have no global disable list to force back "on" from.
2235
+ */
2236
+ pluginHooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["inherit", "on", "off"]>>>;
1951
2237
  }, "strip", z.ZodTypeAny, {
1952
2238
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
1953
2239
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
1954
2240
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
1955
2241
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
1956
2242
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
2243
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
1957
2244
  }, {
1958
2245
  builtin?: Record<string, "off" | "on" | "inherit"> | undefined;
1959
2246
  mcp?: Record<string, "off" | "on" | "inherit"> | undefined;
1960
2247
  skills?: Record<string, "off" | "on" | "inherit"> | undefined;
1961
2248
  plugins?: Record<string, "off" | "on" | "inherit"> | undefined;
1962
2249
  agents?: Record<string, "off" | "on" | "inherit"> | undefined;
2250
+ pluginHooks?: Record<string, "off" | "on" | "inherit"> | undefined;
2251
+ }>>;
2252
+ /**
2253
+ * Feature flags overlay: a map of flag name → boolean that overrides the
2254
+ * compiled-in defaults (see settings/feature-flags.ts FEATURE_FLAGS).
2255
+ * Project settings override user settings via the normal merge, so a flag
2256
+ * can be flipped per-workspace. Unknown flag names are tolerated (kept as
2257
+ * data) for forward-compat; consumers only read known flags via
2258
+ * isFeatureEnabled(). Passthrough record — values coerced to boolean.
2259
+ */
2260
+ featureFlags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2261
+ /**
2262
+ * Cross-session memory knobs. Optional — absence keeps the built-in
2263
+ * defaults (see services/extract-memories.ts). `maxCount` caps memories
2264
+ * accepted per extraction pass; `maxAge`/`extractionModel` are reserved
2265
+ * for the consolidation/extraction pipeline.
2266
+ */
2267
+ memories: z.ZodOptional<z.ZodObject<{
2268
+ maxCount: z.ZodOptional<z.ZodNumber>;
2269
+ maxAge: z.ZodOptional<z.ZodNumber>;
2270
+ extractionModel: z.ZodOptional<z.ZodString>;
2271
+ /** Master switch for end-of-session automatic memory extraction.
2272
+ * Absent/true = extract (current behavior); false = skip extraction
2273
+ * while keeping session summaries and Dream untouched. */
2274
+ autoExtract: z.ZodOptional<z.ZodBoolean>;
2275
+ }, "strip", z.ZodTypeAny, {
2276
+ maxCount?: number | undefined;
2277
+ maxAge?: number | undefined;
2278
+ extractionModel?: string | undefined;
2279
+ autoExtract?: boolean | undefined;
2280
+ }, {
2281
+ maxCount?: number | undefined;
2282
+ maxAge?: number | undefined;
2283
+ extractionModel?: string | undefined;
2284
+ autoExtract?: boolean | undefined;
1963
2285
  }>>;
1964
2286
  instructions: z.ZodDefault<z.ZodObject<{
1965
2287
  fileName: z.ZodDefault<z.ZodString>;
@@ -2108,24 +2430,22 @@ export declare const SettingsSchema: z.ZodObject<{
2108
2430
  }>>;
2109
2431
  /**
2110
2432
  * Image attachment handling. Sub-fields:
2111
- * - detail: OpenAI-style fidelity hint applied to every user-
2112
- * attached image. "low" = 85 tokens/image fixed (cheap
2113
- * thumbnail), "high" = ~768 px tiles (default), "original" =
2114
- * keep client-side dimensions (most expensive). Anthropic
2115
- * ignores this field today; that's fine — it just gets
2116
- * dropped on the Claude path.
2433
+ * - detail: provider-agnostic image clarity. Drives the
2434
+ * renderer-side downscale (low→~1024 / standard→~1568 /
2435
+ * high→~2576 px long edge) so BOTH providers save tokens
2436
+ * before send. Legacy "original" is migrated to "high".
2117
2437
  * - mcpImageTokenBudget: per-turn cap on token cost of images
2118
2438
  * returned by MCP tools. Codex doesn't enforce this; CC uses
2119
2439
  * 25 000. Set to 0 to disable.
2120
2440
  */
2121
2441
  images: z.ZodOptional<z.ZodObject<{
2122
- detail: z.ZodOptional<z.ZodEnum<["low", "high", "original"]>>;
2442
+ detail: z.ZodOptional<z.ZodEffects<z.ZodEnum<["low", "standard", "high"]>, "low" | "high" | "standard", unknown>>;
2123
2443
  mcpImageTokenBudget: z.ZodOptional<z.ZodNumber>;
2124
2444
  }, "strip", z.ZodTypeAny, {
2125
- detail?: "low" | "high" | "original" | undefined;
2445
+ detail?: "low" | "high" | "standard" | undefined;
2126
2446
  mcpImageTokenBudget?: number | undefined;
2127
2447
  }, {
2128
- detail?: "low" | "high" | "original" | undefined;
2448
+ detail?: unknown;
2129
2449
  mcpImageTokenBudget?: number | undefined;
2130
2450
  }>>;
2131
2451
  /**
@@ -2150,6 +2470,21 @@ export declare const SettingsSchema: z.ZodObject<{
2150
2470
  deniedReads?: string[] | undefined;
2151
2471
  network?: "allow" | "deny" | undefined;
2152
2472
  }>>;
2473
+ /**
2474
+ * Top-level environment variables injected into tool subprocesses (the
2475
+ * Bash tool, background shells). Mirrors Claude Code's `env` field: a
2476
+ * KEY=VALUE map that can be set globally (~/.code-shell/settings.json) and
2477
+ * overridden per-project (.code-shell/settings.json). The canonical home
2478
+ * for API keys (e.g. OPENAI_API_KEY) that a skill's script reads — configure
2479
+ * once globally and every project's skills can use it.
2480
+ *
2481
+ * Precedence when merged into the spawn env (lowest → highest):
2482
+ * project localEnvironment.env → global env → project env
2483
+ * None of these is filtered through the deny regex (see mergeShellEnv):
2484
+ * they are values the user typed deliberately, a different trust class from
2485
+ * the host process.env passthrough the deny machinery guards against.
2486
+ */
2487
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2153
2488
  /**
2154
2489
  * Project-local environment profile. Mirrors Codex's local-environment
2155
2490
  * shape at the settings layer: setup/cleanup scripts can be customized per
@@ -2238,19 +2573,99 @@ export declare const SettingsSchema: z.ZodObject<{
2238
2573
  matcher: z.ZodOptional<z.ZodString>;
2239
2574
  timeout_ms: z.ZodOptional<z.ZodNumber>;
2240
2575
  cwd: z.ZodOptional<z.ZodString>;
2576
+ /** Soft off-switch: the entry stays in the file (and the UI) but
2577
+ * registerSettingsHooks skips it. Absent = enabled. */
2578
+ disabled: z.ZodOptional<z.ZodBoolean>;
2241
2579
  }, "strip", z.ZodTypeAny, {
2242
2580
  command: string;
2243
2581
  event: string;
2582
+ disabled?: boolean | undefined;
2244
2583
  matcher?: string | undefined;
2245
2584
  timeout_ms?: number | undefined;
2246
2585
  cwd?: string | undefined;
2247
2586
  }, {
2248
2587
  command: string;
2249
2588
  event: string;
2589
+ disabled?: boolean | undefined;
2250
2590
  matcher?: string | undefined;
2251
2591
  timeout_ms?: number | undefined;
2252
2592
  cwd?: string | undefined;
2253
2593
  }>, "many">>;
2594
+ /**
2595
+ * External coding-agent orchestration (Claude Code / Codex CLI).
2596
+ * Used by the Mobile Web Remote to launch managed jobs. dangerousArgs
2597
+ * is config-provided (not hardcoded) so it tracks CLI flag changes;
2598
+ * project-default dangerous mode only applies inside trustedWorkspaces.
2599
+ */
2600
+ externalAgents: z.ZodOptional<z.ZodObject<{
2601
+ claudeCode: z.ZodOptional<z.ZodObject<{
2602
+ command: z.ZodOptional<z.ZodString>;
2603
+ defaultMode: z.ZodOptional<z.ZodEnum<["safe", "dangerous"]>>;
2604
+ dangerousArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2605
+ trustedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2606
+ autoStartInTrustedWorkspaces: z.ZodOptional<z.ZodBoolean>;
2607
+ }, "strip", z.ZodTypeAny, {
2608
+ defaultMode?: "safe" | "dangerous" | undefined;
2609
+ command?: string | undefined;
2610
+ dangerousArgs?: string[] | undefined;
2611
+ trustedWorkspaces?: string[] | undefined;
2612
+ autoStartInTrustedWorkspaces?: boolean | undefined;
2613
+ }, {
2614
+ defaultMode?: "safe" | "dangerous" | undefined;
2615
+ command?: string | undefined;
2616
+ dangerousArgs?: string[] | undefined;
2617
+ trustedWorkspaces?: string[] | undefined;
2618
+ autoStartInTrustedWorkspaces?: boolean | undefined;
2619
+ }>>;
2620
+ codex: z.ZodOptional<z.ZodObject<{
2621
+ command: z.ZodOptional<z.ZodString>;
2622
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2623
+ }, "strip", z.ZodTypeAny, {
2624
+ args?: string[] | undefined;
2625
+ command?: string | undefined;
2626
+ }, {
2627
+ args?: string[] | undefined;
2628
+ command?: string | undefined;
2629
+ }>>;
2630
+ }, "strip", z.ZodTypeAny, {
2631
+ claudeCode?: {
2632
+ defaultMode?: "safe" | "dangerous" | undefined;
2633
+ command?: string | undefined;
2634
+ dangerousArgs?: string[] | undefined;
2635
+ trustedWorkspaces?: string[] | undefined;
2636
+ autoStartInTrustedWorkspaces?: boolean | undefined;
2637
+ } | undefined;
2638
+ codex?: {
2639
+ args?: string[] | undefined;
2640
+ command?: string | undefined;
2641
+ } | undefined;
2642
+ }, {
2643
+ claudeCode?: {
2644
+ defaultMode?: "safe" | "dangerous" | undefined;
2645
+ command?: string | undefined;
2646
+ dangerousArgs?: string[] | undefined;
2647
+ trustedWorkspaces?: string[] | undefined;
2648
+ autoStartInTrustedWorkspaces?: boolean | undefined;
2649
+ } | undefined;
2650
+ codex?: {
2651
+ args?: string[] | undefined;
2652
+ command?: string | undefined;
2653
+ } | undefined;
2654
+ }>>;
2655
+ /**
2656
+ * Credential-use gate (凭证模块第二期). Controls whether the AI's
2657
+ * `UseCredential` tool prompts before handing a stored credential to a
2658
+ * command. `autoApprove: true` skips the prompt entirely (默认关 — every
2659
+ * use asks, or is remembered for the session). See
2660
+ * docs/superpowers/specs/2026-06-16-credential-use-gate-design.md §5.
2661
+ */
2662
+ credentialUse: z.ZodOptional<z.ZodObject<{
2663
+ autoApprove: z.ZodOptional<z.ZodBoolean>;
2664
+ }, "strip", z.ZodTypeAny, {
2665
+ autoApprove?: boolean | undefined;
2666
+ }, {
2667
+ autoApprove?: boolean | undefined;
2668
+ }>>;
2254
2669
  }, z.ZodTypeAny, "passthrough">>;
2255
2670
  export type ValidatedSettings = z.infer<typeof SettingsSchema>;
2256
2671
  export declare function validateSettings(raw: unknown): ValidatedSettings;