@maincode-ai/matilda-code 0.21.13 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,183 +0,0 @@
1
- # Markdown Rendering
2
-
3
- Matilda Code renders common Markdown structures directly in the TUI so model
4
- answers are easier to scan without leaving the terminal. The renderer is
5
- designed to keep the original source reachable, especially for visual blocks
6
- such as Mermaid diagrams and LaTeX math.
7
-
8
- ## Render and Raw Modes
9
-
10
- By default, Markdown is shown in `render` mode. Supported blocks render as
11
- visual previews where possible:
12
-
13
- - Mermaid fenced code blocks
14
- - Markdown tables
15
- - task lists
16
- - blockquotes
17
- - inline and block LaTeX math
18
- - fenced code blocks with syntax highlighting
19
-
20
- Press `Alt/Option+M` to toggle the current session between modes. On macOS,
21
- the terminal must send Option as Meta for this shortcut; otherwise Option+M is
22
- treated as normal text input.
23
-
24
- - `render`: show rich terminal previews for supported Markdown.
25
- - `raw`: show source-oriented Markdown for visual blocks such as Mermaid,
26
- tables, and LaTeX.
27
-
28
- To start Matilda Code in raw mode by default, set `ui.renderMode`:
29
-
30
- ```json
31
- {
32
- "ui": {
33
- "renderMode": "raw"
34
- }
35
- }
36
- ```
37
-
38
- Accepted values are `"render"` and `"raw"`. The shortcut only changes the
39
- current session view; it does not rewrite your settings file.
40
-
41
- ## Mermaid
42
-
43
- Fenced `mermaid` code blocks render visually in `render` mode. The TUI uses a
44
- layered strategy:
45
-
46
- 1. If enabled and supported, Matilda Code asks Mermaid CLI (`mmdc`) to render the
47
- diagram to a PNG and sends it to the terminal image protocol.
48
- 2. If terminal images are unavailable but `chafa` is installed, the same PNG can
49
- be converted to ANSI block graphics.
50
- 3. Otherwise, Matilda Code falls back to a terminal wireframe or compact text
51
- preview.
52
- 4. If a Mermaid diagram type cannot be previewed, Matilda Code shows the original
53
- fenced source instead of hiding it behind a placeholder.
54
-
55
- Mermaid image rendering is disabled by default because it requires external
56
- renderers and terminal image support. Enable it with:
57
-
58
- ```bash
59
- MATILDA_CODE_MERMAID_IMAGE_RENDERING=1 matilda
60
- ```
61
-
62
- Optional environment variables:
63
-
64
- | Variable | Description |
65
- | ---------------------------------------------- | -------------------------------------------------------------------------------------- |
66
- | `MATILDA_CODE_MERMAID_IMAGE_RENDERING=1` | Enables external Mermaid image rendering. |
67
- | `MATILDA_CODE_DISABLE_MERMAID_IMAGES=1` | Disables Mermaid image rendering even when enabled elsewhere. |
68
- | `MATILDA_CODE_MERMAID_IMAGE_PROTOCOL=kitty` | Forces Kitty protocol output. Useful for terminals such as Kitty and Ghostty. |
69
- | `MATILDA_CODE_MERMAID_IMAGE_PROTOCOL=iterm2` | Requests iTerm2 inline images. Interactive TUI rendering falls back to text/ANSI. |
70
- | `MATILDA_CODE_MERMAID_IMAGE_PROTOCOL=off` | Disables terminal image protocols and allows text or `chafa` fallback. |
71
- | `MATILDA_CODE_MERMAID_MMD_CLI=/path/to/mmdc` | Uses a specific Mermaid CLI executable. |
72
- | `MATILDA_CODE_MERMAID_ALLOW_NPX=1` | Allows Matilda Code to run `npx @mermaid-js/mermaid-cli` when `mmdc` is not installed. |
73
- | `MATILDA_CODE_MERMAID_ALLOW_LOCAL_RENDERERS=1` | Allows project-local renderer binaries under `node_modules/.bin`. |
74
- | `MATILDA_CODE_MERMAID_RENDER_WIDTH=1200` | Overrides the PNG render width. |
75
- | `MATILDA_CODE_MERMAID_RENDER_TIMEOUT_MS=10000` | Overrides the external render timeout, capped at 60000 ms. |
76
- | `MATILDA_CODE_MERMAID_CELL_ASPECT_RATIO=0.5` | Adjusts image row fitting for terminal font cell geometry. |
77
-
78
- The first image render can be slow, especially when `npx` needs to resolve or
79
- download Mermaid CLI. During streaming, Matilda Code shows a bounded text preview
80
- and attempts image rendering only after the model response is complete.
81
-
82
- ### Mermaid Source Copy
83
-
84
- Every rendered Mermaid block includes a source hint such as:
85
-
86
- ```text
87
- Mermaid flowchart (TD) · source: /copy mermaid 1
88
- ```
89
-
90
- Use these commands to copy Mermaid source from the last AI response:
91
-
92
- | Command | Behavior |
93
- | ---------------------- | --------------------------------------------- |
94
- | `/copy mermaid` | Copies the last Mermaid block. |
95
- | `/copy mermaid 1` | Copies the first Mermaid block. |
96
- | `/copy code mermaid` | Copies the last fenced `mermaid` code block. |
97
- | `/copy code mermaid 1` | Copies the first fenced `mermaid` code block. |
98
-
99
- `/copy code 1` counts all fenced code blocks, not only Mermaid blocks. Use
100
- `/copy mermaid N` when you want the Mermaid-specific sequence shown in the
101
- rendered title.
102
-
103
- ## LaTeX Math
104
-
105
- Matilda Code supports basic inline and block LaTeX rendering in the terminal:
106
-
107
- ```markdown
108
- Inline math: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
109
-
110
- $$
111
- \sum_{n=1}^{\infty} 1/n^2 = \pi^2/6
112
- $$
113
- ```
114
-
115
- The renderer focuses on common symbols and readable terminal output. It is not
116
- a full TeX engine; complex layouts such as matrices, aligned equations, and
117
- large nested expressions may be simplified.
118
-
119
- Inline `$...$` expressions are intentionally bounded to 1024 characters per
120
- line so malformed or very large generated Markdown cannot stall terminal
121
- rendering. Longer formulas remain visible as source text and can still be
122
- copied from raw mode or the original response.
123
-
124
- ### LaTeX Source Copy
125
-
126
- Use these commands to copy LaTeX source from the last AI response:
127
-
128
- | Command | Behavior |
129
- | ---------------------- | --------------------------------------- |
130
- | `/copy latex` | Copies the last block LaTeX expression. |
131
- | `/copy latex 2` | Copies the second block expression. |
132
- | `/copy latex inline` | Copies the last inline expression. |
133
- | `/copy latex inline 2` | Copies the second inline expression. |
134
- | `/copy inline-latex 2` | Alias for `/copy latex inline 2`. |
135
-
136
- Inline LaTeX does not show a per-expression copy hint in rendered text to avoid
137
- making prose noisy. Switch to raw mode with `Alt/Option+M` when you want to
138
- inspect inline source in place; on macOS this requires Option-as-Meta terminal
139
- input.
140
-
141
- ## General Code Copy
142
-
143
- The `/copy code` command reads fenced code blocks from the last AI Markdown
144
- response:
145
-
146
- | Command | Behavior |
147
- | ----------------------- | ---------------------------------------- |
148
- | `/copy code` | Copies the last fenced code block. |
149
- | `/copy code 2` | Copies the second fenced code block. |
150
- | `/copy code typescript` | Copies the last `typescript` code block. |
151
- | `/copy code mermaid 1` | Copies the first `mermaid` code block. |
152
-
153
- ## Selecting an Earlier AI Message
154
-
155
- By default `/copy` targets the most recent AI message. Prefix the command with
156
- a positive integer to copy from the Nth-last AI message instead — handy when
157
- the latest reply is something low-signal (e.g., a TODO update) and the
158
- substantive output is one or two turns back.
159
-
160
- | Command | Behavior |
161
- | --------------------- | ------------------------------------------------------ |
162
- | `/copy 2` | Copies the second-to-last AI message in full. |
163
- | `/copy 3` | Copies the third-to-last AI message in full. |
164
- | `/copy 2 code python` | Copies the last `python` code block from the 2nd-last. |
165
- | `/copy 3 latex` | Copies the last LaTeX block from the 3rd-last message. |
166
-
167
- `/copy 1` is equivalent to `/copy`. If `N` exceeds the number of AI messages
168
- in the session, `/copy` reports the actual count instead of copying anything.
169
- Without a leading integer, sub-selectors such as `/copy code python 2` keep
170
- their existing meaning (the 2nd `python` block in the last message).
171
-
172
- ## Current Limits
173
-
174
- - Mermaid image rendering depends on Mermaid CLI plus terminal image support.
175
- - Async iTerm2 inline image placement is disabled in the TUI because the
176
- protocol is cursor-position bound; use Kitty/Ghostty or ANSI fallback for
177
- interactive image previews.
178
- - Wireframe Mermaid rendering is a readable terminal preview, not a full
179
- Mermaid layout engine.
180
- - Raw mode is global for rendered Markdown blocks; it is not a per-block toggle.
181
- - LaTeX rendering covers common symbols and expressions, not full TeX layout.
182
- - Source copy commands target the last AI response by default, or the Nth-last
183
- when invoked as `/copy N ...`.
@@ -1,423 +0,0 @@
1
- # Connect Matilda Code to tools via MCP
2
-
3
- Matilda Code can connect to external tools and data sources through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction). MCP servers give Matilda Code access to your tools, databases, and APIs.
4
-
5
- ## What you can do with MCP
6
-
7
- With MCP servers connected, you can ask Matilda Code to:
8
-
9
- - Work with files and repos (read/search/write, depending on the tools you enable)
10
- - Query databases (schema inspection, queries, reporting)
11
- - Integrate internal services (wrap your APIs as MCP tools)
12
- - Automate workflows (repeatable tasks exposed as tools/prompts)
13
-
14
- > [!tip]
15
- >
16
- > If you’re looking for the “one command to get started”, jump to [Quick start](#quick-start).
17
-
18
- ## Quick start
19
-
20
- Matilda Code loads MCP servers from `mcpServers` in your `settings.json`. You can configure servers either:
21
-
22
- - By editing `settings.json` directly
23
- - By using `matilda mcp` commands (see [CLI reference](#matilda-mcp-cli))
24
-
25
- ### Add your first server
26
-
27
- 1. Add a server (example: remote HTTP MCP server):
28
-
29
- ```bash
30
- matilda mcp add --transport http my-server http://localhost:3000/mcp
31
- ```
32
-
33
- 2. Open MCP management dialog to view and manage servers:
34
-
35
- ```bash
36
- matilda mcp
37
- ```
38
-
39
- 3. Restart Matilda Code in the same project (or start it if it wasn’t running yet), then ask the model to use tools from that server.
40
-
41
- ## Where configuration is stored (scopes)
42
-
43
- Most users only need these two scopes:
44
-
45
- - **Project scope (default)**: `.matilda/settings.json` in your project root
46
- - **User scope**: `~/.matilda/settings.json` across all projects on your machine
47
-
48
- Write to user scope:
49
-
50
- ```bash
51
- matilda mcp add --scope user --transport http my-server http://localhost:3000/mcp
52
- ```
53
-
54
- > [!tip]
55
- >
56
- > For advanced configuration layers (system defaults/system settings and precedence rules), see [Settings](../configuration/settings).
57
-
58
- ## Configure servers
59
-
60
- ### Choose a transport
61
-
62
- | Transport | When to use | JSON field(s) |
63
- | --------- | ----------------------------------------------------------------- | ------------------------------------------- |
64
- | `http` | Recommended for remote services; works well for cloud MCP servers | `httpUrl` (+ optional `headers`) |
65
- | `sse` | Legacy/deprecated servers that only support Server-Sent Events | `url` (+ optional `headers`) |
66
- | `stdio` | Local process (scripts, CLIs, Docker) on your machine | `command`, `args` (+ optional `cwd`, `env`) |
67
-
68
- > [!note]
69
- >
70
- > If a server supports both, prefer **HTTP** over **SSE**.
71
-
72
- ### Configure via `settings.json` vs `matilda mcp add`
73
-
74
- Both approaches produce the same `mcpServers` entries in your `settings.json`—use whichever you prefer.
75
-
76
- #### Stdio server (local process)
77
-
78
- JSON (`.matilda/settings.json`):
79
-
80
- ```json
81
- {
82
- "mcpServers": {
83
- "pythonTools": {
84
- "command": "python",
85
- "args": ["-m", "my_mcp_server", "--port", "8080"],
86
- "cwd": "./mcp-servers/python",
87
- "env": {
88
- "DATABASE_URL": "$DB_CONNECTION_STRING",
89
- "API_KEY": "${EXTERNAL_API_KEY}"
90
- },
91
- "timeout": 15000
92
- }
93
- }
94
- }
95
- ```
96
-
97
- CLI (writes to project scope by default):
98
-
99
- ```bash
100
- matilda mcp add pythonTools -e DATABASE_URL=$DB_CONNECTION_STRING -e API_KEY=$EXTERNAL_API_KEY \
101
- --timeout 15000 python -m my_mcp_server --port 8080
102
- ```
103
-
104
- #### HTTP server (remote streamable HTTP)
105
-
106
- JSON:
107
-
108
- ```json
109
- {
110
- "mcpServers": {
111
- "httpServerWithAuth": {
112
- "httpUrl": "http://localhost:3000/mcp",
113
- "headers": {
114
- "Authorization": "Bearer your-api-token"
115
- },
116
- "timeout": 5000
117
- }
118
- }
119
- }
120
- ```
121
-
122
- CLI:
123
-
124
- ```bash
125
- matilda mcp add --transport http httpServerWithAuth http://localhost:3000/mcp \
126
- --header "Authorization: Bearer your-api-token" --timeout 5000
127
- ```
128
-
129
- #### SSE server (remote Server-Sent Events)
130
-
131
- JSON:
132
-
133
- ```json
134
- {
135
- "mcpServers": {
136
- "sseServer": {
137
- "url": "http://localhost:8080/sse",
138
- "timeout": 30000
139
- }
140
- }
141
- }
142
- ```
143
-
144
- CLI:
145
-
146
- ```bash
147
- matilda mcp add --transport sse sseServer http://localhost:8080/sse --timeout 30000
148
- ```
149
-
150
- ## Progressive availability and discovery timeouts
151
-
152
- Matilda Code discovers MCP servers in the background after the UI is already
153
- interactive. You see the cli's first prompt within a few hundred
154
- milliseconds even when one of your MCP servers takes several seconds
155
- (or never responds), and the model's tool list updates within roughly
156
- one frame (~16 ms) of each server completing its discover handshake.
157
-
158
- - **Interactive mode**: the UI appears immediately; an MCP status pill in
159
- the bottom-right shows `N/M MCP servers ready` while discovery is in
160
- flight. Sending a prompt before MCP finishes simply means the model
161
- sees the tools that are ready _at that moment_; subsequent prompts see
162
- more tools as servers come online.
163
- - **Non-interactive mode** (`--prompt`, stream-json, ACP): the cli still
164
- waits for MCP discovery to settle before sending the first prompt, so
165
- scripted / piped invocations see the same complete tool set the
166
- legacy synchronous behavior produced.
167
-
168
- ### Per-server `discoveryTimeoutMs`
169
-
170
- Each MCP server gets a discovery-only timeout that caps how long the
171
- initial handshake (`connect` + `tools/list` + `prompts/list` +
172
- `resources/list`) is allowed to take. Defaults:
173
-
174
- - **stdio servers**: 30 s
175
- - **remote HTTP / SSE servers**: 5 s (network risk is higher)
176
-
177
- Override per server when needed:
178
-
179
- ```jsonc
180
- {
181
- "mcpServers": {
182
- "slow-stdio": {
183
- "command": "node",
184
- "args": ["./slow-server.js"],
185
- "discoveryTimeoutMs": 60000,
186
- },
187
- "flaky-remote": {
188
- "httpUrl": "https://example.com/mcp",
189
- "discoveryTimeoutMs": 10000,
190
- },
191
- },
192
- }
193
- ```
194
-
195
- The existing `timeout` field is **tool-call** timeout (used for each
196
- `tools/call` request, default 10 minutes) and is unaffected by
197
- `discoveryTimeoutMs` — a long-running tool invocation is not a startup
198
- pathology.
199
-
200
- ### Rolling back progressive MCP
201
-
202
- If you need the old synchronous behavior (cli waits for every MCP server
203
- before showing any UI), set `MATILDA_CODE_LEGACY_MCP_BLOCKING=1` in your
204
- environment. This is kept as an escape hatch for at least one release.
205
-
206
- ## Safety and control
207
-
208
- ### Trust (skip confirmations)
209
-
210
- - **Server trust** (`trust: true`): bypasses confirmation prompts for that server (use sparingly).
211
-
212
- ### OAuth authentication
213
-
214
- Matilda Code supports OAuth 2.0 authentication for MCP servers. This is useful when accessing remote servers that require authentication.
215
-
216
- #### Basic usage
217
-
218
- When you add an MCP server with OAuth credentials, Matilda Code will automatically handle the authentication flow:
219
-
220
- ```bash
221
- matilda mcp add --transport sse oauth-server https://api.example.com/sse/ \
222
- --oauth-client-id your-client-id \
223
- --oauth-redirect-uri https://your-server.com/oauth/callback \
224
- --oauth-authorization-url https://provider.example.com/authorize \
225
- --oauth-token-url https://provider.example.com/token
226
- ```
227
-
228
- #### Important: Redirect URI configuration
229
-
230
- The OAuth flow requires a redirect URI where the authorization provider sends the authentication code.
231
-
232
- - **Local development**: By default, Matilda Code uses `http://localhost:7777/callback`. This works when running Matilda Code on your local machine with a local browser.
233
-
234
- - **Remote/cloud deployments**: When running Matilda Code on remote servers, cloud IDEs, or web terminals, the default `localhost` redirect will NOT work. You MUST configure `--oauth-redirect-uri` to point to a publicly accessible URL that can receive the OAuth callback.
235
-
236
- Example for remote servers:
237
-
238
- ```bash
239
- matilda mcp add --transport sse remote-server https://api.example.com/sse/ \
240
- --oauth-redirect-uri https://your-remote-server.example.com/oauth/callback
241
- ```
242
-
243
- #### Manual configuration via settings.json
244
-
245
- You can also configure OAuth by editing `settings.json` directly:
246
-
247
- ```json
248
- {
249
- "mcpServers": {
250
- "oauthServer": {
251
- "url": "https://api.example.com/sse/",
252
- "oauth": {
253
- "enabled": true,
254
- "clientId": "your-client-id",
255
- "clientSecret": "your-client-secret",
256
- "authorizationUrl": "https://provider.example.com/authorize",
257
- "tokenUrl": "https://provider.example.com/token",
258
- "redirectUri": "https://your-server.com/oauth/callback",
259
- "scopes": ["read", "write"]
260
- }
261
- }
262
- }
263
- }
264
- ```
265
-
266
- OAuth configuration properties:
267
-
268
- | Property | Description |
269
- | ------------------ | --------------------------------------------------------------------------------------------------------------------- |
270
- | `enabled` | Enable OAuth for this server (boolean) |
271
- | `clientId` | OAuth client identifier (string, optional with dynamic registration) |
272
- | `clientSecret` | OAuth client secret (string, optional for public clients) |
273
- | `authorizationUrl` | OAuth authorization endpoint (string, auto-discovered if omitted) |
274
- | `tokenUrl` | OAuth token endpoint (string, auto-discovered if omitted) |
275
- | `scopes` | Required OAuth scopes (array of strings) |
276
- | `redirectUri` | Custom redirect URI (string). **Critical for remote deployments**. Defaults to `http://localhost:7777/callback` |
277
- | `tokenParamName` | Query parameter name for tokens in SSE URLs (string) |
278
- | `audiences` | Audiences the token is valid for (array of strings) |
279
-
280
- #### Token management
281
-
282
- OAuth tokens are automatically:
283
-
284
- - **Stored securely** in `~/.matilda/mcp-oauth-tokens-v2.json` (AES-256-GCM encrypted), with keychain storage preferred when available
285
- - **Refreshed** when expired (if refresh tokens are available)
286
- - **Validated** before each connection attempt
287
-
288
- Use the `/mcp auth` command within Matilda Code to manage OAuth authentication interactively.
289
-
290
- ### Tool filtering (allow/deny tools per server)
291
-
292
- Use `includeTools` / `excludeTools` to restrict tools exposed by a server (from Matilda Code’s perspective).
293
-
294
- Example: include only a few tools:
295
-
296
- ```json
297
- {
298
- "mcpServers": {
299
- "filteredServer": {
300
- "command": "python",
301
- "args": ["-m", "my_mcp_server"],
302
- "includeTools": ["safe_tool", "file_reader", "data_processor"],
303
- "timeout": 30000
304
- }
305
- }
306
- }
307
- ```
308
-
309
- ### Global allow/deny lists
310
-
311
- The `mcp` object in your `settings.json` defines global rules for all MCP servers:
312
-
313
- - `mcp.allowed`: allow-list of MCP server names (keys in `mcpServers`)
314
- - `mcp.excluded`: deny-list of MCP server names
315
-
316
- Example:
317
-
318
- ```json
319
- {
320
- "mcp": {
321
- "allowed": ["my-trusted-server"],
322
- "excluded": ["experimental-server"]
323
- }
324
- }
325
- ```
326
-
327
- ## Troubleshooting
328
-
329
- - **Server shows “Disconnected” in `matilda mcp list`**: verify the URL/command is correct, then increase `timeout`.
330
- - **Stdio server fails to start**: use an absolute `command` path, and double-check `cwd`/`env`.
331
- - **Environment variables in JSON don’t resolve**: ensure they exist in the environment where Matilda Code runs (shell vs GUI app environments can differ).
332
-
333
- ## Reference
334
-
335
- ### `settings.json` structure
336
-
337
- #### Server-specific configuration (`mcpServers`)
338
-
339
- Add an `mcpServers` object to your `settings.json` file:
340
-
341
- ```json
342
- // ... file contains other config objects
343
- {
344
- "mcpServers": {
345
- "serverName": {
346
- "command": "path/to/server",
347
- "args": ["--arg1", "value1"],
348
- "env": {
349
- "API_KEY": "$MY_API_TOKEN"
350
- },
351
- "cwd": "./server-directory",
352
- "timeout": 30000,
353
- "trust": false
354
- }
355
- }
356
- }
357
- ```
358
-
359
- Configuration properties:
360
-
361
- Required (one of the following):
362
-
363
- | Property | Description |
364
- | --------- | ------------------------------------------------------ |
365
- | `command` | Path to the executable for Stdio transport |
366
- | `url` | SSE endpoint URL (e.g., `"http://localhost:8080/sse"`) |
367
- | `httpUrl` | HTTP streaming endpoint URL |
368
-
369
- Optional:
370
-
371
- | Property | Type/Default | Description |
372
- | ---------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
373
- | `args` | array | Command-line arguments for Stdio transport |
374
- | `headers` | object | Custom HTTP headers when using `url` or `httpUrl` |
375
- | `env` | object | Environment variables for the server process. Values can reference environment variables using `$VAR_NAME` or `${VAR_NAME}` syntax |
376
- | `cwd` | string | Working directory for Stdio transport |
377
- | `timeout` | number<br>(default: 600,000) | Request timeout in milliseconds (default: 600,000ms = 10 minutes) |
378
- | `trust` | boolean<br>(default: false) | When `true`, bypasses all tool call confirmations for this server (default: `false`) |
379
- | `includeTools` | array | List of tool names to include from this MCP server. When specified, only the tools listed here will be available from this server (allowlist behavior). If not specified, all tools from the server are enabled by default. |
380
- | `excludeTools` | array | List of tool names to exclude from this MCP server. Tools listed here will not be available to the model, even if they are exposed by the server.<br>Note: `excludeTools` takes precedence over `includeTools` - if a tool is in both lists, it will be excluded. |
381
- | `targetAudience` | string | The OAuth Client ID allowlisted on the IAP-protected application you are trying to access. Used with `authProviderType: 'service_account_impersonation'`. |
382
- | `targetServiceAccount` | string | The email address of the Google Cloud Service Account to impersonate. Used with `authProviderType: 'service_account_impersonation'`. |
383
-
384
- <a id="matilda-mcp-cli"></a>
385
-
386
- ### Manage MCP servers with `matilda mcp`
387
-
388
- You can always configure MCP servers by manually editing `settings.json`, but the CLI is usually faster.
389
-
390
- #### Adding a server (`matilda mcp add`)
391
-
392
- ```bash
393
- matilda mcp add [options] <name> <commandOrUrl> [args...]
394
- ```
395
-
396
- | Argument/Option | Description | Default | Example |
397
- | --------------------------- | ------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------ |
398
- | `<name>` | A unique name for the server. | — | `example-server` |
399
- | `<commandOrUrl>` | The command to execute (for `stdio`) or the URL (for `http`/`sse`). | — | `/usr/bin/python` or `http://localhost:8` |
400
- | `[args...]` | Optional arguments for a `stdio` command. | — | `--port 5000` |
401
- | `-s`, `--scope` | Configuration scope (user or project). | `project` | `-s user` |
402
- | `-t`, `--transport` | Transport type (`stdio`, `sse`, `http`). | `stdio` | `-t sse` |
403
- | `-e`, `--env` | Set environment variables. | — | `-e KEY=value` |
404
- | `-H`, `--header` | Set HTTP headers for SSE and HTTP transports. | — | `-H "X-Api-Key: abc123"` |
405
- | `--timeout` | Set connection timeout in milliseconds. | — | `--timeout 30000` |
406
- | `--trust` | Trust the server (bypass all tool call confirmation prompts). | — (`false`) | `--trust` |
407
- | `--description` | Set the description for the server. | — | `--description "Local tools"` |
408
- | `--include-tools` | A comma-separated list of tools to include. | all tools included | `--include-tools mytool,othertool` |
409
- | `--exclude-tools` | A comma-separated list of tools to exclude. | none | `--exclude-tools mytool` |
410
- | `--oauth-client-id` | OAuth client ID for MCP server authentication. | — | `--oauth-client-id your-client-id` |
411
- | `--oauth-client-secret` | OAuth client secret for MCP server authentication. | — | `--oauth-client-secret your-client-secret` |
412
- | `--oauth-redirect-uri` | OAuth redirect URI for authentication callback. | `http://localhost:7777/callback` | `--oauth-redirect-uri https://your-server.com/oauth/callback` |
413
- | `--oauth-authorization-url` | OAuth authorization URL. | — | `--oauth-authorization-url https://provider.example.com/authorize` |
414
- | `--oauth-token-url` | OAuth token URL. | — | `--oauth-token-url https://provider.example.com/token` |
415
- | `--oauth-scopes` | OAuth scopes (comma-separated). | — | `--oauth-scopes scope1,scope2` |
416
-
417
- > `--oauth-*` flags apply only to `--transport sse` and `--transport http`. Combining them with `--transport stdio` is rejected.
418
-
419
- #### Removing a server (`matilda mcp remove`)
420
-
421
- ```bash
422
- matilda mcp remove <name>
423
- ```