@maincode-ai/matilda-code 0.21.13 → 0.22.0-nightly.20261101.b0ad315a4

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 (252) hide show
  1. package/chunks/agent-IUINB66G.js +3 -0
  2. package/chunks/agent-headless-YA2RKYEZ.js +3 -0
  3. package/chunks/{askUserQuestion-BNSWGD26.js → askUserQuestion-RZYBOPLR.js} +3 -3
  4. package/chunks/ca-JKEHLTNL.js +23 -0
  5. package/chunks/chunk-225CZWD7.js +89 -0
  6. package/chunks/{chunk-MEV5XQI2.js → chunk-2XSB5XHX.js} +1 -1
  7. package/chunks/chunk-453BANK3.js +8 -0
  8. package/chunks/{chunk-6M5G5FBH.js → chunk-4UGPARBR.js} +1 -1
  9. package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
  10. package/chunks/chunk-5ETLURI6.js +3 -0
  11. package/chunks/chunk-6NXVLJ3X.js +56 -0
  12. package/chunks/{chunk-QZI2ZGZY.js → chunk-7B65UIHB.js} +1 -1
  13. package/chunks/{chunk-27Q5KW3A.js → chunk-7E2YCGHS.js} +13 -13
  14. package/chunks/{chunk-DHDD5YJC.js → chunk-ARAB5QTM.js} +69 -69
  15. package/chunks/chunk-DUB7JMQV.js +13 -0
  16. package/chunks/chunk-G3F3ZCH2.js +9 -0
  17. package/chunks/chunk-GT6MSEK4.js +3 -0
  18. package/chunks/chunk-HEJO7OBH.js +3 -0
  19. package/chunks/{chunk-6T2GIM76.js → chunk-IHWAOFCQ.js} +1 -1
  20. package/chunks/chunk-ILHNCXBC.js +8 -0
  21. package/chunks/chunk-J3ZCE3TA.js +8 -0
  22. package/chunks/{chunk-AOOZREGV.js → chunk-LBQNFSZ2.js} +1 -1
  23. package/chunks/{chunk-5OHGYMKP.js → chunk-LM6OIN4B.js} +1 -1
  24. package/chunks/{chunk-EZDV7A76.js → chunk-LMZBADPW.js} +1 -1
  25. package/chunks/chunk-MGRXOZAG.js +8 -0
  26. package/chunks/chunk-NBLBE7PE.js +2609 -0
  27. package/chunks/chunk-POGNX7U3.js +31 -0
  28. package/chunks/chunk-PQZ6HKKW.js +80 -0
  29. package/chunks/chunk-QXSBPCBA.js +8 -0
  30. package/chunks/chunk-RHSUTILA.js +9 -0
  31. package/chunks/{chunk-P5TG5CON.js → chunk-RPXRN7E6.js} +1 -1
  32. package/chunks/chunk-TUKNB5CQ.js +33 -0
  33. package/chunks/chunk-UM6CLO7D.js +7 -0
  34. package/chunks/chunk-V2VUANFI.js +120 -0
  35. package/chunks/chunk-V4VILMIK.js +14 -0
  36. package/chunks/chunk-ZSGBDQXU.js +11 -0
  37. package/chunks/{computer-use-J4GAM4M6.js → computer-use-PBCWDTJR.js} +1 -1
  38. package/chunks/{cron-create-IDWSZENI.js → cron-create-PHQ43NYA.js} +1 -1
  39. package/chunks/cron-delete-7RCQIU2U.js +3 -0
  40. package/chunks/cron-list-KKNLLMNN.js +5 -0
  41. package/chunks/de-GMGNR5CZ.js +23 -0
  42. package/chunks/{devtools-XRQ4YJ5S.js → devtools-7YNCRYZV.js} +1 -1
  43. package/chunks/{chunk-OOEH6ZSV.js → dist-UWUWLWTO.js} +2 -2
  44. package/chunks/{edit-X2S2ZXRN.js → edit-ELHNQB5E.js} +1 -1
  45. package/chunks/en-3NQMLVKW.js +23 -0
  46. package/chunks/{enter-worktree-TUCGNCLO.js → enter-worktree-UZIBOBV3.js} +1 -1
  47. package/chunks/enterPlanMode-UHY3DZXE.js +18 -0
  48. package/chunks/{exit-worktree-7FLITFZI.js → exit-worktree-HLG4PDMX.js} +1 -1
  49. package/chunks/{exitPlanMode-O5UUJ3GM.js → exitPlanMode-V4HYNH3J.js} +2 -2
  50. package/chunks/fr-WS3EBB36.js +23 -0
  51. package/chunks/{getMachineId-bsd-ZYBNK2JG.js → getMachineId-bsd-ETKQTB6C.js} +1 -1
  52. package/chunks/{getMachineId-darwin-CM2MQGUI.js → getMachineId-darwin-AKNRWOWB.js} +1 -1
  53. package/chunks/{getMachineId-linux-SYE2KMCW.js → getMachineId-linux-2QSD7FTP.js} +1 -1
  54. package/chunks/{getMachineId-unsupported-6IHVG2XO.js → getMachineId-unsupported-UXSV7I24.js} +1 -1
  55. package/chunks/{getMachineId-win-S3J3JSUM.js → getMachineId-win-4MTFXGP3.js} +1 -1
  56. package/chunks/glob-C5CTWXLP.js +22 -0
  57. package/chunks/{goal-tools-YQOA6OKU.js → goal-tools-BGIWEJ3K.js} +3 -3
  58. package/chunks/{grep-VAB2VSXM.js → grep-BEFTGKHW.js} +1 -1
  59. package/chunks/ja-GBCDQ43R.js +23 -0
  60. package/chunks/keychain-token-storage-FEJZYJBB.js +3 -0
  61. package/chunks/ls-XH55NAD3.js +15 -0
  62. package/chunks/{lsp-NGLDRHZU.js → lsp-BKDCR37G.js} +1 -1
  63. package/chunks/mcp-client-GAQG7MCT.js +3 -0
  64. package/chunks/monitor-NSVUUKCM.js +32 -0
  65. package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
  66. package/chunks/notebook-edit-AXKYC64C.js +17 -0
  67. package/chunks/openaiContentGenerator-66YY6CIM.js +47 -0
  68. package/chunks/pt-VID6J2CM.js +23 -0
  69. package/chunks/read-file-YFJMLS7V.js +3 -0
  70. package/chunks/ripGrep-BEHEB23R.js +3 -0
  71. package/chunks/ru-EB6V6EAN.js +23 -0
  72. package/chunks/scheduler-GKQOREMS.js +8 -0
  73. package/chunks/send-message-GJSEMAZB.js +8 -0
  74. package/chunks/shell-J5Q2UEXH.js +3 -0
  75. package/chunks/{skill-ETQM5NI3.js → skill-3RWNSUNE.js} +1 -1
  76. package/chunks/src-LZEU4AYF.js +5 -0
  77. package/chunks/symbol-search-4VM6J5Y4.js +19 -0
  78. package/chunks/{syntheticOutput-WZDPECYS.js → syntheticOutput-O7LEF3AM.js} +1 -1
  79. package/chunks/task-create-N4IRJBTF.js +3 -0
  80. package/chunks/{task-detach-TBAVUOTC.js → task-detach-RGNQUX3H.js} +1 -1
  81. package/chunks/task-list-Z7JUB4QK.js +9 -0
  82. package/chunks/{task-stop-HDSARSJ6.js → task-stop-L2OWK2PJ.js} +1 -1
  83. package/chunks/{task-update-MW2VT2XV.js → task-update-H5AXVXDS.js} +1 -1
  84. package/chunks/{team-create-VMYNLZCC.js → team-create-FWTIQ2FT.js} +2 -2
  85. package/chunks/team-delete-D45ALROH.js +8 -0
  86. package/chunks/todoWrite-LCQOQBI7.js +3 -0
  87. package/chunks/{tool-search-WX6FOE35.js → tool-search-X6UUCSPU.js} +1 -1
  88. package/chunks/{web-fetch-CKYBHGLF.js → web-fetch-244KUWSX.js} +17 -17
  89. package/chunks/web-search-YRZ3BZ3X.js +26 -0
  90. package/chunks/{workflow-WBSRQG3N.js → workflow-EP4AFR24.js} +2 -2
  91. package/chunks/write-file-EXWGRN4Q.js +15 -0
  92. package/cli.js +641 -678
  93. package/examples/starter/README.md +0 -3
  94. package/locales/ca.js +3 -87
  95. package/locales/de.js +3 -91
  96. package/locales/en.js +3 -91
  97. package/locales/fr.js +3 -88
  98. package/locales/ja.js +3 -92
  99. package/locales/pt.js +3 -92
  100. package/locales/ru.js +3 -91
  101. package/package.json +2 -2
  102. package/sandbox-macos-permissive-proxied.sb +1 -1
  103. package/sandbox-macos-restrictive-closed.sb +14 -1
  104. package/sandbox-macos-restrictive-open.sb +14 -1
  105. package/sandbox-macos-restrictive-proxied.sb +15 -2
  106. package/bundled/mainy/SKILL.md +0 -157
  107. package/bundled/mainy/docs/_meta.ts +0 -32
  108. package/bundled/mainy/docs/common-workflow.md +0 -571
  109. package/bundled/mainy/docs/configuration/_meta.ts +0 -7
  110. package/bundled/mainy/docs/configuration/auth.md +0 -82
  111. package/bundled/mainy/docs/configuration/matilda-ignore.md +0 -55
  112. package/bundled/mainy/docs/configuration/model-providers.md +0 -516
  113. package/bundled/mainy/docs/configuration/settings.md +0 -818
  114. package/bundled/mainy/docs/configuration/themes.md +0 -199
  115. package/bundled/mainy/docs/configuration/trusted-folders.md +0 -67
  116. package/bundled/mainy/docs/extension/_meta.ts +0 -9
  117. package/bundled/mainy/docs/extension/extension-releasing.md +0 -204
  118. package/bundled/mainy/docs/extension/getting-started-extensions.md +0 -299
  119. package/bundled/mainy/docs/extension/introduction.md +0 -338
  120. package/bundled/mainy/docs/features/_meta.ts +0 -27
  121. package/bundled/mainy/docs/features/approval-mode.md +0 -388
  122. package/bundled/mainy/docs/features/arena.md +0 -219
  123. package/bundled/mainy/docs/features/auto-mode.md +0 -308
  124. package/bundled/mainy/docs/features/channels/_meta.ts +0 -5
  125. package/bundled/mainy/docs/features/channels/overview.md +0 -328
  126. package/bundled/mainy/docs/features/channels/plugins.md +0 -87
  127. package/bundled/mainy/docs/features/channels/telegram.md +0 -120
  128. package/bundled/mainy/docs/features/code-review.md +0 -291
  129. package/bundled/mainy/docs/features/commands.md +0 -528
  130. package/bundled/mainy/docs/features/dual-output.md +0 -627
  131. package/bundled/mainy/docs/features/followup-suggestions.md +0 -109
  132. package/bundled/mainy/docs/features/headless.md +0 -448
  133. package/bundled/mainy/docs/features/hooks.md +0 -1308
  134. package/bundled/mainy/docs/features/language.md +0 -144
  135. package/bundled/mainy/docs/features/lsp.md +0 -496
  136. package/bundled/mainy/docs/features/markdown-rendering.md +0 -183
  137. package/bundled/mainy/docs/features/mcp.md +0 -423
  138. package/bundled/mainy/docs/features/memory.md +0 -185
  139. package/bundled/mainy/docs/features/sandbox.md +0 -249
  140. package/bundled/mainy/docs/features/scheduled-tasks.md +0 -139
  141. package/bundled/mainy/docs/features/skills.md +0 -347
  142. package/bundled/mainy/docs/features/status-line.md +0 -397
  143. package/bundled/mainy/docs/features/structured-output.md +0 -309
  144. package/bundled/mainy/docs/features/sub-agents.md +0 -737
  145. package/bundled/mainy/docs/features/tips.md +0 -54
  146. package/bundled/mainy/docs/features/token-caching.md +0 -29
  147. package/bundled/mainy/docs/features/tool-use-summaries.md +0 -178
  148. package/bundled/mainy/docs/features/worktree.md +0 -343
  149. package/bundled/mainy/docs/ide-integration/_meta.ts +0 -4
  150. package/bundled/mainy/docs/ide-integration/ide-companion-spec.md +0 -182
  151. package/bundled/mainy/docs/ide-integration/ide-integration.md +0 -144
  152. package/bundled/mainy/docs/integration-github-action.md +0 -241
  153. package/bundled/mainy/docs/integration-jetbrains.md +0 -81
  154. package/bundled/mainy/docs/integration-vscode.md +0 -39
  155. package/bundled/mainy/docs/integration-zed.md +0 -72
  156. package/bundled/mainy/docs/matilda-serve-deploy-local.md +0 -221
  157. package/bundled/mainy/docs/matilda-serve.md +0 -661
  158. package/bundled/mainy/docs/overview.md +0 -64
  159. package/bundled/mainy/docs/quickstart.md +0 -234
  160. package/bundled/mainy/docs/reference/_meta.ts +0 -3
  161. package/bundled/mainy/docs/reference/keyboard-shortcuts.md +0 -91
  162. package/bundled/mainy/docs/support/Uninstall.md +0 -65
  163. package/bundled/mainy/docs/support/_meta.ts +0 -6
  164. package/bundled/mainy/docs/support/tos-privacy.md +0 -94
  165. package/bundled/mainy/docs/support/troubleshooting.md +0 -127
  166. package/chunks/agent-SRAIVZEE.js +0 -3
  167. package/chunks/agent-headless-XRDOZESG.js +0 -3
  168. package/chunks/anthropicContentGenerator-LLDIKDMQ.js +0 -39
  169. package/chunks/ca-NPYL24ME.js +0 -25
  170. package/chunks/chunk-27HUYW23.js +0 -22
  171. package/chunks/chunk-2HTPVSGT.js +0 -3
  172. package/chunks/chunk-3B2HABK7.js +0 -30
  173. package/chunks/chunk-3MTZTNAU.js +0 -101
  174. package/chunks/chunk-3YLXGE6T.js +0 -8
  175. package/chunks/chunk-47XR7IMP.js +0 -8
  176. package/chunks/chunk-4F4DA5UI.js +0 -8
  177. package/chunks/chunk-4Q2SNBUH.js +0 -18
  178. package/chunks/chunk-6EQMZNIY.js +0 -8
  179. package/chunks/chunk-6I6VGTKD.js +0 -8
  180. package/chunks/chunk-DC7LAFZZ.js +0 -8
  181. package/chunks/chunk-DE3HKC2W.js +0 -9
  182. package/chunks/chunk-FWDMPRKU.js +0 -3
  183. package/chunks/chunk-G7R2XEEF.js +0 -7
  184. package/chunks/chunk-GOJCMVJJ.js +0 -8
  185. package/chunks/chunk-GTVCJCHR.js +0 -8
  186. package/chunks/chunk-IJEGHQ7Z.js +0 -32
  187. package/chunks/chunk-JCE3JAVC.js +0 -25
  188. package/chunks/chunk-KHHJYBR5.js +0 -9
  189. package/chunks/chunk-LUNDTQ3G.js +0 -8
  190. package/chunks/chunk-LWARA7JY.js +0 -37
  191. package/chunks/chunk-M53RP3YP.js +0 -31
  192. package/chunks/chunk-MTMU7JYZ.js +0 -11
  193. package/chunks/chunk-O44XK65C.js +0 -8
  194. package/chunks/chunk-OA56BXPD.js +0 -3
  195. package/chunks/chunk-PEKAUGYV.js +0 -2621
  196. package/chunks/chunk-PGUG43HG.js +0 -24
  197. package/chunks/chunk-PGXQZVLX.js +0 -8
  198. package/chunks/chunk-QKYGQLWC.js +0 -8
  199. package/chunks/chunk-QN6Y6NPA.js +0 -3
  200. package/chunks/chunk-RI54U73U.js +0 -56
  201. package/chunks/chunk-RPFSFS7Z.js +0 -39
  202. package/chunks/chunk-SDTWBD62.js +0 -8
  203. package/chunks/chunk-SOEIVSM5.js +0 -113
  204. package/chunks/chunk-SVSY6AWS.js +0 -59
  205. package/chunks/chunk-T2T2UEPY.js +0 -4
  206. package/chunks/chunk-TISQNFB5.js +0 -3
  207. package/chunks/chunk-TWJLOEAI.js +0 -31
  208. package/chunks/chunk-VI74YQQO.js +0 -8
  209. package/chunks/chunk-VYZOOSMP.js +0 -30
  210. package/chunks/chunk-W4QSMIWO.js +0 -9
  211. package/chunks/chunk-WC2VTVCE.js +0 -27
  212. package/chunks/chunk-YV3PUOBU.js +0 -65
  213. package/chunks/chunk-ZX34M2GF.js +0 -14
  214. package/chunks/contextCommand-5F5M7NA4.js +0 -3
  215. package/chunks/cron-delete-NQCDZDUI.js +0 -3
  216. package/chunks/cron-list-Z4XMC3TO.js +0 -5
  217. package/chunks/de-34YZHGC6.js +0 -25
  218. package/chunks/dist-7UYRLSLE.js +0 -3
  219. package/chunks/dist-PH6JW7XD.js +0 -42
  220. package/chunks/en-QLGMD6OS.js +0 -25
  221. package/chunks/enterPlanMode-SQEZAAIR.js +0 -18
  222. package/chunks/fileFromPath-7UCWPD4W.js +0 -3
  223. package/chunks/fr-EDNBQACJ.js +0 -25
  224. package/chunks/geminiContentGenerator-FIZFLPU3.js +0 -8
  225. package/chunks/glob-GSFTYAS2.js +0 -22
  226. package/chunks/ja-LV4RLM3M.js +0 -25
  227. package/chunks/keychain-token-storage-KQK6MNOJ.js +0 -3
  228. package/chunks/ls-IZJ3CKZY.js +0 -15
  229. package/chunks/matildaAgentContentGenerator-QQHPCFJ5.js +0 -8
  230. package/chunks/matildaContentGenerator-W7Z33ONU.js +0 -8
  231. package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
  232. package/chunks/mcp-client-DXUNIEIB.js +0 -3
  233. package/chunks/monitor-4PFIGAGG.js +0 -32
  234. package/chunks/notebook-edit-MWJYAATJ.js +0 -17
  235. package/chunks/openaiContentGenerator-NDVJL6QL.js +0 -3
  236. package/chunks/pt-5SQ4DGL7.js +0 -25
  237. package/chunks/read-file-WPZKPXWA.js +0 -3
  238. package/chunks/ripGrep-7LZDZFTX.js +0 -3
  239. package/chunks/ru-7K24S53N.js +0 -25
  240. package/chunks/scheduler-DK2MVKXX.js +0 -8
  241. package/chunks/send-message-TCPX5UDU.js +0 -8
  242. package/chunks/serve-GSZPJI2O.js +0 -1026
  243. package/chunks/shell-PRS47PDP.js +0 -3
  244. package/chunks/src-UB7DZRYK.js +0 -3
  245. package/chunks/src-WZTRMETQ.js +0 -5
  246. package/chunks/symbol-search-HARHZ5AH.js +0 -19
  247. package/chunks/task-create-XRNIDT4T.js +0 -3
  248. package/chunks/task-list-Z6BDZZID.js +0 -9
  249. package/chunks/team-delete-F7QDC2TE.js +0 -8
  250. package/chunks/todoWrite-SCF5M24M.js +0 -3
  251. package/chunks/web-search-67DFNS5V.js +0 -26
  252. package/chunks/write-file-S5FAX4JJ.js +0 -15
@@ -1,516 +0,0 @@
1
- # Model Providers
2
-
3
- Matilda Code allows you to configure multiple model providers through the `modelProviders` setting in your `settings.json`. This enables you to switch between different AI models and providers using the `/model` command.
4
-
5
- ## Overview
6
-
7
- Use `modelProviders` to declare curated model lists per auth type that the `/model` picker can switch between. Keys must be valid auth types (`openai`, `anthropic`, `gemini`, etc.). Each entry requires an `id` and **must include `envKey`**, with optional `name`, `description`, `baseUrl`, and `generationConfig`. Credentials are never persisted in settings; the runtime reads them from `process.env[envKey]`. Matilda OAuth models remain hard-coded and cannot be overridden.
8
-
9
- > [!note]
10
-
11
- > [!note]
12
- >
13
- > **Model uniqueness:** Models within the same `authType` are uniquely identified by the combination of `id` + `baseUrl`. This means you can define the same model ID (e.g., `"gpt-4o"`) multiple times under a single `authType` as long as each entry has a different `baseUrl` — for example, one pointing to OpenAI directly and another to a proxy endpoint. If two entries share both the same `id` and the same `baseUrl` (or both omit `baseUrl`), the first occurrence wins and subsequent duplicates are skipped with a warning.
14
-
15
- ## Configuration Examples by Auth Type
16
-
17
- Below are comprehensive configuration examples for different authentication types, showing the available parameters and their combinations.
18
-
19
- ### Supported Auth Types
20
-
21
- The `modelProviders` object keys must be valid `authType` values. Currently supported auth types are:
22
-
23
- | Auth Type | Description |
24
- | --------------- | --------------------------------------------------------------------------------------- |
25
- | `openai` | OpenAI-compatible APIs (OpenAI, Azure OpenAI, local inference servers like vLLM/Ollama) |
26
- | `anthropic` | Anthropic Claude API |
27
- | `gemini` | Google Gemini API |
28
- | `matilda-oauth` | Matilda OAuth (hard-coded, cannot be overridden in `modelProviders`) |
29
-
30
- > [!warning]
31
- > If an invalid auth type key is used (e.g., a typo like `"openai-custom"`), the configuration will be **silently skipped** and the models will not appear in the `/model` picker. Always use one of the supported auth type values listed above.
32
-
33
- ### SDKs Used for API Requests
34
-
35
- Matilda Code uses the following official SDKs to send requests to each provider:
36
-
37
- | Auth Type | SDK Package |
38
- | --------------- | ----------------------------------------------------------------------------------------------------- |
39
- | `openai` | [`openai`](https://www.npmjs.com/package/openai) - Official OpenAI Node.js SDK |
40
- | `anthropic` | [`@anthropic-ai/sdk`](https://www.npmjs.com/package/@anthropic-ai/sdk) - Official Anthropic SDK |
41
- | `gemini` | [`@google/genai`](https://www.npmjs.com/package/@google/genai) - Official Google GenAI SDK |
42
- | `matilda-oauth` | [`openai`](https://www.npmjs.com/package/openai) with custom provider (Matilda-compatible-compatible) |
43
-
44
- This means the `baseUrl` you configure should be compatible with the corresponding SDK's expected API format. For example, when using `openai` auth type, the endpoint must accept OpenAI API format requests.
45
-
46
- ### OpenAI-compatible providers (`openai`)
47
-
48
- This auth type supports not only OpenAI's official API but also any OpenAI-compatible endpoint, including aggregated model providers like OpenRouter.
49
-
50
- ```json
51
- {
52
- "env": {
53
- "OPENAI_API_KEY": "sk-your-actual-openai-key-here",
54
- "OPENROUTER_API_KEY": "sk-or-your-actual-openrouter-key-here"
55
- },
56
- "modelProviders": {
57
- "openai": [
58
- {
59
- "id": "gpt-4o",
60
- "name": "GPT-4o",
61
- "envKey": "OPENAI_API_KEY",
62
- "baseUrl": "https://api.openai.com/v1",
63
- "generationConfig": {
64
- "timeout": 60000,
65
- "maxRetries": 3,
66
- "enableCacheControl": true,
67
- "contextWindowSize": 128000,
68
- "modalities": {
69
- "image": true
70
- },
71
- "customHeaders": {
72
- "X-Client-Request-ID": "req-123"
73
- },
74
- "extra_body": {
75
- "enable_thinking": true,
76
- "service_tier": "priority"
77
- },
78
- "samplingParams": {
79
- "temperature": 0.2,
80
- "top_p": 0.8,
81
- "max_tokens": 4096,
82
- "presence_penalty": 0.1,
83
- "frequency_penalty": 0.1
84
- }
85
- }
86
- },
87
- {
88
- "id": "gpt-4o-mini",
89
- "name": "GPT-4o Mini",
90
- "envKey": "OPENAI_API_KEY",
91
- "baseUrl": "https://api.openai.com/v1",
92
- "generationConfig": {
93
- "timeout": 30000,
94
- "samplingParams": {
95
- "temperature": 0.5,
96
- "max_tokens": 2048
97
- }
98
- }
99
- },
100
- {
101
- "id": "openai/gpt-4o",
102
- "name": "GPT-4o (via OpenRouter)",
103
- "envKey": "OPENROUTER_API_KEY",
104
- "baseUrl": "https://openrouter.ai/api/v1",
105
- "generationConfig": {
106
- "timeout": 120000,
107
- "maxRetries": 3,
108
- "samplingParams": {
109
- "temperature": 0.7
110
- }
111
- }
112
- }
113
- ]
114
- }
115
- }
116
- ```
117
-
118
- ### Anthropic (`anthropic`)
119
-
120
- ```json
121
- {
122
- "env": {
123
- "ANTHROPIC_API_KEY": "sk-ant-your-actual-anthropic-key-here"
124
- },
125
- "modelProviders": {
126
- "anthropic": [
127
- {
128
- "id": "claude-3-5-sonnet",
129
- "name": "Claude 3.5 Sonnet",
130
- "envKey": "ANTHROPIC_API_KEY",
131
- "baseUrl": "https://api.anthropic.com/v1",
132
- "generationConfig": {
133
- "timeout": 120000,
134
- "maxRetries": 3,
135
- "contextWindowSize": 200000,
136
- "samplingParams": {
137
- "temperature": 0.7,
138
- "max_tokens": 8192,
139
- "top_p": 0.9
140
- }
141
- }
142
- },
143
- {
144
- "id": "claude-3-opus",
145
- "name": "Claude 3 Opus",
146
- "envKey": "ANTHROPIC_API_KEY",
147
- "baseUrl": "https://api.anthropic.com/v1",
148
- "generationConfig": {
149
- "timeout": 180000,
150
- "samplingParams": {
151
- "temperature": 0.3,
152
- "max_tokens": 4096
153
- }
154
- }
155
- }
156
- ]
157
- }
158
- }
159
- ```
160
-
161
- ### Google Gemini (`gemini`)
162
-
163
- ```json
164
- {
165
- "env": {
166
- "GEMINI_API_KEY": "AIza-your-actual-gemini-key-here"
167
- },
168
- "modelProviders": {
169
- "gemini": [
170
- {
171
- "id": "gemini-2.0-flash",
172
- "name": "Gemini 2.0 Flash",
173
- "envKey": "GEMINI_API_KEY",
174
- "baseUrl": "https://generativelanguage.googleapis.com",
175
- "capabilities": {
176
- "vision": true
177
- },
178
- "generationConfig": {
179
- "timeout": 60000,
180
- "maxRetries": 2,
181
- "contextWindowSize": 1000000,
182
- "schemaCompliance": "auto",
183
- "samplingParams": {
184
- "temperature": 0.4,
185
- "top_p": 0.95,
186
- "max_tokens": 8192,
187
- "top_k": 40
188
- }
189
- }
190
- }
191
- ]
192
- }
193
- }
194
- ```
195
-
196
- ### Local Self-Hosted Models (via OpenAI-compatible API)
197
-
198
- Most local inference servers (vLLM, Ollama, LM Studio, etc.) provide an OpenAI-compatible API endpoint. Configure them using the `openai` auth type with a local `baseUrl`:
199
-
200
- ```json
201
- {
202
- "env": {
203
- "OLLAMA_API_KEY": "ollama",
204
- "VLLM_API_KEY": "not-needed",
205
- "LMSTUDIO_API_KEY": "lm-studio"
206
- },
207
- "modelProviders": {
208
- "openai": [
209
- {
210
- "id": "matilda2.5-7b",
211
- "name": "Matilda2.5 7B (Ollama)",
212
- "envKey": "OLLAMA_API_KEY",
213
- "baseUrl": "http://localhost:11434/v1",
214
- "generationConfig": {
215
- "timeout": 300000,
216
- "maxRetries": 1,
217
- "contextWindowSize": 32768,
218
- "samplingParams": {
219
- "temperature": 0.7,
220
- "top_p": 0.9,
221
- "max_tokens": 4096
222
- }
223
- }
224
- },
225
- {
226
- "id": "llama-3.1-8b",
227
- "name": "Llama 3.1 8B (vLLM)",
228
- "envKey": "VLLM_API_KEY",
229
- "baseUrl": "http://localhost:8000/v1",
230
- "generationConfig": {
231
- "timeout": 120000,
232
- "maxRetries": 2,
233
- "contextWindowSize": 128000,
234
- "samplingParams": {
235
- "temperature": 0.6,
236
- "max_tokens": 8192
237
- }
238
- }
239
- },
240
- {
241
- "id": "local-model",
242
- "name": "Local Model (LM Studio)",
243
- "envKey": "LMSTUDIO_API_KEY",
244
- "baseUrl": "http://localhost:1234/v1",
245
- "generationConfig": {
246
- "timeout": 60000,
247
- "samplingParams": {
248
- "temperature": 0.5
249
- }
250
- }
251
- }
252
- ]
253
- }
254
- }
255
- ```
256
-
257
- For local servers that don't require authentication, you can use any placeholder value for the API key:
258
-
259
- ```bash
260
- # For Ollama (no auth required)
261
- export OLLAMA_API_KEY="ollama"
262
-
263
- # For vLLM (if no auth is configured)
264
- export VLLM_API_KEY="not-needed"
265
- ```
266
-
267
- > [!note]
268
- >
269
- > The `extra_body` parameter is **only supported for OpenAI-compatible providers** (`openai`, `matilda-oauth`). It is ignored for Anthropic, and Gemini providers.
270
-
271
- > [!note]
272
- >
273
- > **About `envKey`**: The `envKey` field specifies the **name of an environment variable**, not the actual API key value. For the configuration to work, you need to ensure the corresponding environment variable is set with your real API key. There are two ways to do this:
274
- >
275
- > - **Option 1: Using a `.env` file** (recommended for security):
276
- > ```bash
277
- > # ~/.matilda/.env (or project root)
278
- > OPENAI_API_KEY=sk-your-actual-key-here
279
- > ```
280
- > Be sure to add `.env` to your `.gitignore` to prevent accidentally committing secrets.
281
- > - **Option 2: Using the `env` field in `settings.json`** (as shown in the examples above):
282
- > ```json
283
- > {
284
- > "env": {
285
- > "OPENAI_API_KEY": "sk-your-actual-key-here"
286
- > }
287
- > }
288
- > ```
289
- >
290
- > Each provider example includes an `env` field to illustrate how the API key should be configured.
291
-
292
- ## Resolution Layers and Atomicity
293
-
294
- The effective auth/model/credential values are chosen per field using the following precedence (first present wins). You can combine `--auth-type` with `--model` to point directly at a provider entry; these CLI flags run before other layers.
295
-
296
- | Layer (highest → lowest) | authType | model | apiKey | baseUrl | apiKeyEnvKey | proxy |
297
- | -------------------------- | -------------------------------------- | ------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------- | ---------------------- | --------------------------------- |
298
- | Programmatic overrides | `/auth` | `/auth` input | `/auth` input | `/auth` input | — | — |
299
- | Model provider selection | — | `modelProvider.id` | `env[modelProvider.envKey]` | `modelProvider.baseUrl` | `modelProvider.envKey` | — |
300
- | CLI arguments | `--auth-type` | `--model` | `--openaiApiKey` (or provider-specific equivalents) | `--openaiBaseUrl` (or provider-specific equivalents) | — | — |
301
- | Environment variables | — | Provider-specific mapping (e.g. `OPENAI_MODEL`) | Provider-specific mapping (e.g. `OPENAI_API_KEY`) | Provider-specific mapping (e.g. `OPENAI_BASE_URL`) | — | — |
302
- | Settings (`settings.json`) | `security.auth.selectedType` | `model.name` | `security.auth.apiKey` | `security.auth.baseUrl` | — | — |
303
- | Default / computed | Falls back to `AuthType.MATILDA_OAUTH` | Built-in default (OpenAI ⇒ `matilda3-coder-plus`) | — | — | — | `Config.getProxy()` if configured |
304
-
305
- \*When present, CLI auth flags override settings. Otherwise, `security.auth.selectedType` or the implicit default determine the auth type. Matilda OAuth and OpenAI are the only auth types surfaced without extra configuration.
306
-
307
- > [!warning]
308
- >
309
- > **Deprecation of `security.auth.apiKey` and `security.auth.baseUrl`:** Directly configuring API credentials via `security.auth.apiKey` and `security.auth.baseUrl` in `settings.json` is deprecated. These settings were used in historical versions for credentials entered through the UI, but the credential input flow was removed in version 0.10.1. These fields will be fully removed in a future release. **It is strongly recommended to migrate to `modelProviders`** for all model and credential configurations. Use `envKey` in `modelProviders` to reference environment variables for secure credential management instead of hardcoding credentials in settings files.
310
-
311
- ## Generation Config Layering: The Impermeable Provider Layer
312
-
313
- The configuration resolution follows a strict layering model with one crucial rule: **the modelProvider layer is impermeable**.
314
-
315
- ### How it works
316
-
317
- 1. **When a modelProvider model IS selected** (e.g., via `/model` command choosing a provider-configured model):
318
- - The entire `generationConfig` from the provider is applied **atomically**
319
- - **The provider layer is completely impermeable** — lower layers (CLI, env, settings) do not participate in generationConfig resolution at all
320
- - All fields defined in `modelProviders[].generationConfig` use the provider's values
321
- - All fields **not defined** by the provider are set to `undefined` (not inherited from settings)
322
- - This ensures provider configurations act as a complete, self-contained "sealed package"
323
-
324
- If a model is listed in `modelProviders`, put all model-specific
325
- generation settings for that model in the matching provider entry. Top-level
326
- `model.generationConfig` values, including `contextWindowSize`,
327
- `modalities`, `customHeaders`, and `extra_body`, are ignored for provider
328
- models. Configure those fields under
329
- `modelProviders[authType][].generationConfig` for them to apply.
330
-
331
- 2. **When NO modelProvider model is selected** (e.g., using `--model` with a raw model ID, or using CLI/env/settings directly):
332
- - The resolution falls through to lower layers
333
- - Fields are populated from CLI → env → settings → defaults
334
- - This creates a **Runtime Model** (see next section)
335
-
336
- ### Per-field precedence for `generationConfig`
337
-
338
- | Priority | Source | Behavior |
339
- | -------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
340
- | 1 | Programmatic overrides | Runtime `/model`, `/auth` changes |
341
- | 2 | `modelProviders[authType][].generationConfig` | **Impermeable layer** - completely replaces all generationConfig fields; lower layers do not participate |
342
- | 3 | `settings.model.generationConfig` | Only used for **Runtime Models** (when no provider model is selected) |
343
- | 4 | Content-generator defaults | Provider-specific defaults (e.g., OpenAI vs Gemini) - only for Runtime Models |
344
-
345
- ### Atomic field treatment
346
-
347
- The following fields are treated as atomic objects - provider values completely replace the entire object, no merging occurs:
348
-
349
- - `samplingParams` - Temperature, top_p, max_tokens, etc.
350
- - `customHeaders` - Custom HTTP headers
351
- - `extra_body` - Extra request body parameters
352
-
353
- ### Example
354
-
355
- ```json
356
- // User settings (~/.matilda/settings.json)
357
- {
358
- "model": {
359
- "generationConfig": {
360
- "timeout": 30000,
361
- "samplingParams": { "temperature": 0.5, "max_tokens": 1000 }
362
- }
363
- }
364
- }
365
-
366
- // modelProviders configuration
367
- {
368
- "modelProviders": {
369
- "openai": [{
370
- "id": "gpt-4o",
371
- "envKey": "OPENAI_API_KEY",
372
- "generationConfig": {
373
- "timeout": 60000,
374
- "samplingParams": { "temperature": 0.2 }
375
- }
376
- }]
377
- }
378
- }
379
- ```
380
-
381
- When `gpt-4o` is selected from modelProviders:
382
-
383
- - `timeout` = 60000 (from provider, overrides settings)
384
- - `samplingParams.temperature` = 0.2 (from provider, completely replaces settings object)
385
- - `samplingParams.max_tokens` = **undefined** (not defined in provider, and provider layer does not inherit from settings — fields are explicitly set to undefined if not provided)
386
-
387
- When using a raw model via `--model gpt-4` (not from modelProviders, creates a Runtime Model):
388
-
389
- - `timeout` = 30000 (from settings)
390
- - `samplingParams.temperature` = 0.5 (from settings)
391
- - `samplingParams.max_tokens` = 1000 (from settings)
392
-
393
- The merge strategy for `modelProviders` itself is REPLACE: the entire `modelProviders` from project settings will override the corresponding section in user settings, rather than merging the two.
394
-
395
- ## Reasoning / thinking configuration
396
-
397
- The optional `reasoning` field under `generationConfig` controls how aggressively the model reasons before responding. The Anthropic and Gemini converters always honor it. The OpenAI-compatible pipeline honors it **unless** `generationConfig.samplingParams` is set — see the "Interaction with `samplingParams`" caveat below.
398
-
399
- ```jsonc
400
- {
401
- "modelProviders": {
402
- "openai": [
403
- {
404
- "id": "deepseek-v4-pro",
405
- "name": "DeepSeek V4 Pro",
406
- "baseUrl": "https://api.deepseek.com/v1",
407
- "envKey": "DEEPSEEK_API_KEY",
408
- "generationConfig": {
409
- // The four-tier scale:
410
- // 'low' | 'medium' — server-mapped to 'high' on DeepSeek
411
- // 'high' — default reasoning intensity
412
- // 'max' — DeepSeek-specific extra-strong tier
413
- // Or set `false` to disable reasoning entirely.
414
- "reasoning": { "effort": "max" },
415
- },
416
- },
417
- ],
418
- },
419
- }
420
- ```
421
-
422
- ### Per-provider behavior
423
-
424
- | Protocol / provider | Wire shape | Notes |
425
- | -------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
426
- | **OpenAI / DeepSeek** (`api.deepseek.com`) | Flat `reasoning_effort: <effort>` body parameter | When `reasoning.effort` is set in the nested config shape, it's rewritten to flat `reasoning_effort` and `'low'`/`'medium'` are normalized to `'high'`, `'xhigh'` to `'max'` — mirroring DeepSeek's [server-side back-compat](https://api-docs.deepseek.com/zh-cn/api/create-chat-completion). Top-level `samplingParams.reasoning_effort` or `extra_body.reasoning_effort` overrides skip this normalization and ship verbatim. |
427
- | **OpenAI** (other compatible servers) | `reasoning: { effort, ... }` passed through verbatim | Set via `samplingParams` (e.g. `samplingParams.reasoning_effort` for GPT-5/o-series) when the provider expects a different shape. |
428
- | **Anthropic** (real `api.anthropic.com`) | `output_config: { effort }` plus the `effort-2025-11-24` beta header | Real Anthropic accepts `'low'`/`'medium'`/`'high'` only. `'max'` is **clamped to `'high'`** with a `debugLogger.warn` line (once per generator); if you want max effort, switch the baseURL to a DeepSeek-compatible endpoint that supports it. |
429
- | **Anthropic** (`api.deepseek.com/anthropic`) | Same `output_config: { effort }` + beta header | `'max'` is passed through unchanged. |
430
- | **Gemini** (`@google/genai`) | `thinkingConfig: { includeThoughts: true, thinkingLevel }` | `'low'` → `LOW`, `'high'`/`'max'` → `HIGH`, others → `THINKING_LEVEL_UNSPECIFIED` (Gemini has no `MAX` tier). |
431
-
432
- ### `reasoning: false`
433
-
434
- Setting `reasoning: false` (the literal boolean) explicitly disables thinking on every provider — useful for cheap side queries that don't benefit from reasoning. This is honored at the request level too via `request.config.thinkingConfig.includeThoughts: false` for one-off calls (e.g. suggestion generation).
435
-
436
- On a `api.deepseek.com` baseURL, the OpenAI pipeline emits the explicit `thinking: { type: 'disabled' }` field that DeepSeek V4+ requires — the server-side default is `'enabled'`, so simply omitting `reasoning_effort` would still pay thinking latency/cost. Self-hosted DeepSeek backends (sglang/vllm) and other OpenAI-compatible servers do **not** receive this field; if you need to disable thinking on those, inject `thinking: { type: 'disabled' }` (or whatever knob your inference framework exposes) via `samplingParams`/`extra_body`.
437
-
438
- ### Interaction with `samplingParams` (OpenAI-compatible only)
439
-
440
- > [!warning]
441
- >
442
- > When `generationConfig.samplingParams` is set on an OpenAI-compatible provider, the pipeline ships those keys to the wire **verbatim** and skips the separate `reasoning` injection entirely. So a config like `{ samplingParams: { temperature: 0.5 }, reasoning: { effort: 'max' } }` will silently drop the reasoning field on OpenAI/DeepSeek requests.
443
- >
444
- > If you set `samplingParams`, include the reasoning knob inside it directly — for DeepSeek that's `samplingParams.reasoning_effort`, for GPT-5/o-series it's `samplingParams.reasoning_effort` (their flat field) or `samplingParams.reasoning` (the nested object). For OpenRouter and other providers the field name varies; consult the provider docs.
445
- >
446
- > The Anthropic and Gemini converters are unaffected — they always read `reasoning.effort` directly regardless of `samplingParams`.
447
-
448
- ### `budget_tokens`
449
-
450
- You can pin an exact thinking-token budget by including `budget_tokens` alongside `effort`:
451
-
452
- ```jsonc
453
- "reasoning": { "effort": "high", "budget_tokens": 50000 }
454
- ```
455
-
456
- For Anthropic this becomes `thinking.budget_tokens`. For OpenAI/DeepSeek the field is preserved but currently ignored by the server — `reasoning_effort` is the load-bearing knob.
457
-
458
- ## Provider Models vs Runtime Models
459
-
460
- Matilda Code distinguishes between two types of model configurations:
461
-
462
- ### Provider Model
463
-
464
- - Defined in `modelProviders` configuration
465
- - Has a complete, atomic configuration package
466
- - When selected, its configuration is applied as an impermeable layer
467
- - Appears in `/model` command list with full metadata (name, description, capabilities)
468
- - Recommended for multi-model workflows and team consistency
469
-
470
- ### Runtime Model
471
-
472
- - Created dynamically when using raw model IDs via CLI (`--model`), environment variables, or settings
473
- - Not defined in `modelProviders`
474
- - Configuration is built by "projecting" through resolution layers (CLI → env → settings → defaults)
475
- - Automatically captured as a **RuntimeModelSnapshot** when a complete configuration is detected
476
- - Allows reuse without re-entering credentials
477
-
478
- ### RuntimeModelSnapshot lifecycle
479
-
480
- When you configure a model without using `modelProviders`, Matilda Code automatically creates a RuntimeModelSnapshot to preserve your configuration:
481
-
482
- ```bash
483
- # This creates a RuntimeModelSnapshot with ID: $runtime|openai|my-custom-model
484
- matilda --auth-type openai --model my-custom-model --openaiApiKey $KEY --openaiBaseUrl https://api.example.com/v1
485
- ```
486
-
487
- The snapshot:
488
-
489
- - Captures model ID, API key, base URL, and generation config
490
- - Persists across sessions (stored in memory during runtime)
491
- - Appears in the `/model` command list as a runtime option
492
- - Can be switched to using `/model $runtime|openai|my-custom-model`
493
-
494
- ### Key differences
495
-
496
- | Aspect | Provider Model | Runtime Model |
497
- | ----------------------- | --------------------------------- | ------------------------------------------ |
498
- | Configuration source | `modelProviders` in settings | CLI, env, settings layers |
499
- | Configuration atomicity | Complete, impermeable package | Layered, each field resolved independently |
500
- | Reusability | Always available in `/model` list | Captured as snapshot, appears if complete |
501
- | Team sharing | Yes (via committed settings) | No (user-local) |
502
- | Credential storage | Reference via `envKey` only | May capture actual key in snapshot |
503
-
504
- ### When to use each
505
-
506
- - **Use Provider Models** when: You have standard models shared across a team, need consistent configurations, or want to prevent accidental overrides
507
- - **Use Runtime Models** when: Quickly testing a new model, using temporary credentials, or working with ad-hoc endpoints
508
-
509
- ## Selection Persistence and Recommendations
510
-
511
- > [!important]
512
- >
513
- > Define `modelProviders` in the user-scope `~/.matilda/settings.json` whenever possible and avoid persisting credential overrides in any scope. Keeping the provider catalog in user settings prevents merge/override conflicts between project and user scopes and ensures `/auth` and `/model` updates always write back to a consistent scope.
514
-
515
- - `/model` and `/auth` persist `model.name` (where applicable) and `security.auth.selectedType` to the closest writable scope that already defines `modelProviders`; otherwise they fall back to the user scope. This keeps workspace/user files in sync with the active provider catalog.
516
- - Without `modelProviders`, the resolver mixes CLI/env/settings layers, creating Runtime Models. This is fine for single-provider setups but cumbersome when frequently switching. Define provider catalogs whenever multi-model workflows are common so that switches stay atomic, source-attributed, and debuggable.