@maincode-ai/matilda-code 0.21.13 → 0.22.0-nightly.20261102.db95a17c4

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-4GIFJO5G.js +3 -0
  2. package/chunks/agent-headless-DXJESNI4.js +3 -0
  3. package/chunks/{askUserQuestion-BNSWGD26.js → askUserQuestion-7PM7G5YF.js} +3 -3
  4. package/chunks/ca-JKEHLTNL.js +23 -0
  5. package/chunks/chunk-225CZWD7.js +89 -0
  6. package/chunks/chunk-2QIC3OCV.js +9 -0
  7. package/chunks/chunk-33UVJMVE.js +120 -0
  8. package/chunks/chunk-35BBGAHD.js +2604 -0
  9. package/chunks/{chunk-DHDD5YJC.js → chunk-4KS2KEXK.js} +69 -69
  10. package/chunks/chunk-4MLFC664.js +3 -0
  11. package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
  12. package/chunks/chunk-66WJUORA.js +8 -0
  13. package/chunks/chunk-6U5VOTWB.js +56 -0
  14. package/chunks/chunk-7MUWF4DK.js +80 -0
  15. package/chunks/{chunk-6M5G5FBH.js → chunk-BVTXZTL3.js} +1 -1
  16. package/chunks/chunk-CVGGYRNK.js +31 -0
  17. package/chunks/chunk-DUB7JMQV.js +13 -0
  18. package/chunks/chunk-ESNPNLMQ.js +8 -0
  19. package/chunks/chunk-GT6MSEK4.js +3 -0
  20. package/chunks/chunk-HEJO7OBH.js +3 -0
  21. package/chunks/chunk-JNHB73E3.js +9 -0
  22. package/chunks/chunk-JR5CSCG4.js +8 -0
  23. package/chunks/{chunk-EZDV7A76.js → chunk-KRVXBQRC.js} +1 -1
  24. package/chunks/{chunk-AOOZREGV.js → chunk-LBQNFSZ2.js} +1 -1
  25. package/chunks/{chunk-MEV5XQI2.js → chunk-QBXL5UBB.js} +1 -1
  26. package/chunks/{chunk-P5TG5CON.js → chunk-QDWS3VZT.js} +1 -1
  27. package/chunks/{chunk-QZI2ZGZY.js → chunk-QMZREVY3.js} +1 -1
  28. package/chunks/chunk-QUYQBKDE.js +8 -0
  29. package/chunks/chunk-QXSBPCBA.js +8 -0
  30. package/chunks/chunk-S2E5ZRPH.js +14 -0
  31. package/chunks/chunk-TUKNB5CQ.js +33 -0
  32. package/chunks/chunk-UM6CLO7D.js +7 -0
  33. package/chunks/{chunk-6T2GIM76.js → chunk-VVUY7VKR.js} +1 -1
  34. package/chunks/{chunk-5OHGYMKP.js → chunk-WENVHSCJ.js} +1 -1
  35. package/chunks/{chunk-27Q5KW3A.js → chunk-ZABH4QIL.js} +10 -10
  36. package/chunks/chunk-ZSGBDQXU.js +11 -0
  37. package/chunks/{computer-use-J4GAM4M6.js → computer-use-IZGLKENV.js} +1 -1
  38. package/chunks/{cron-create-IDWSZENI.js → cron-create-BTSJUVNT.js} +1 -1
  39. package/chunks/cron-delete-PTE3RC2W.js +3 -0
  40. package/chunks/cron-list-SINKHOIZ.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-MDQEZ7BA.js} +1 -1
  45. package/chunks/en-3NQMLVKW.js +23 -0
  46. package/chunks/{enter-worktree-TUCGNCLO.js → enter-worktree-SZK65VXF.js} +1 -1
  47. package/chunks/enterPlanMode-5VWIIVHI.js +18 -0
  48. package/chunks/{exit-worktree-7FLITFZI.js → exit-worktree-OBHUK4TF.js} +1 -1
  49. package/chunks/{exitPlanMode-O5UUJ3GM.js → exitPlanMode-SXFQC4G2.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-JKIZ3ZJQ.js +22 -0
  57. package/chunks/{goal-tools-YQOA6OKU.js → goal-tools-YJMECZYD.js} +3 -3
  58. package/chunks/{grep-VAB2VSXM.js → grep-Q4T5AE6K.js} +1 -1
  59. package/chunks/ja-GBCDQ43R.js +23 -0
  60. package/chunks/keychain-token-storage-4PY5J6U6.js +3 -0
  61. package/chunks/ls-BQCCCPIX.js +15 -0
  62. package/chunks/{lsp-NGLDRHZU.js → lsp-MHJJJ7K3.js} +1 -1
  63. package/chunks/mcp-client-CSF5QZEY.js +3 -0
  64. package/chunks/monitor-JUAVWVLY.js +32 -0
  65. package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
  66. package/chunks/notebook-edit-NNOMEUER.js +17 -0
  67. package/chunks/openaiContentGenerator-DTKOYRBL.js +47 -0
  68. package/chunks/pt-VID6J2CM.js +23 -0
  69. package/chunks/read-file-4EX4B3TB.js +3 -0
  70. package/chunks/ripGrep-JL6UDNCR.js +3 -0
  71. package/chunks/ru-EB6V6EAN.js +23 -0
  72. package/chunks/scheduler-GCGZAI7D.js +8 -0
  73. package/chunks/send-message-S4P5QKSW.js +8 -0
  74. package/chunks/shell-J7EX7B57.js +3 -0
  75. package/chunks/{skill-ETQM5NI3.js → skill-V6NTJ4O4.js} +1 -1
  76. package/chunks/src-LZEU4AYF.js +5 -0
  77. package/chunks/symbol-search-5QJNW7PY.js +19 -0
  78. package/chunks/{syntheticOutput-WZDPECYS.js → syntheticOutput-3XIAIUIR.js} +1 -1
  79. package/chunks/task-create-KGPY7O4J.js +3 -0
  80. package/chunks/{task-detach-TBAVUOTC.js → task-detach-ZD3A7225.js} +1 -1
  81. package/chunks/task-list-P7GQWYAD.js +9 -0
  82. package/chunks/{task-stop-HDSARSJ6.js → task-stop-VFJRBA6P.js} +1 -1
  83. package/chunks/{task-update-MW2VT2XV.js → task-update-OOMH4WRA.js} +1 -1
  84. package/chunks/{team-create-VMYNLZCC.js → team-create-POMZOM44.js} +2 -2
  85. package/chunks/team-delete-ZJBEQDPE.js +8 -0
  86. package/chunks/todoWrite-EWYRFK7W.js +3 -0
  87. package/chunks/{tool-search-WX6FOE35.js → tool-search-5Z7MO565.js} +1 -1
  88. package/chunks/{web-fetch-CKYBHGLF.js → web-fetch-M4TUYAFG.js} +17 -17
  89. package/chunks/web-search-CBKF36JM.js +26 -0
  90. package/chunks/{workflow-WBSRQG3N.js → workflow-F57TWWPS.js} +2 -2
  91. package/chunks/write-file-UK4BVL3M.js +15 -0
  92. package/cli.js +642 -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,144 +0,0 @@
1
- # Internationalization (i18n) & Language
2
-
3
- Matilda Code is built for multilingual workflows: it supports UI localization (i18n/l10n) in the CLI, lets you choose the assistant output language, and allows custom UI language packs.
4
-
5
- ## Overview
6
-
7
- From a user point of view, Matilda Code’s “internationalization” spans multiple layers:
8
-
9
- | Capability / Setting | What it controls | Where stored |
10
- | ------------------------ | ---------------------------------------------------------------------- | ------------------------------- |
11
- | `/language ui` | Terminal UI text (menus, system messages, prompts) | `~/.matilda/settings.json` |
12
- | `/language output` | Language the AI responds in (an output preference, not UI translation) | `~/.matilda/output-language.md` |
13
- | Custom UI language packs | Overrides/extends built-in UI translations | `~/.matilda/locales/*.js` |
14
-
15
- ## UI Language
16
-
17
- This is the CLI’s UI localization layer (i18n/l10n): it controls the language of menus, prompts, and system messages.
18
-
19
- ### Setting the UI Language
20
-
21
- Use the `/language ui` command:
22
-
23
- ```bash
24
- /language ui en-US # English
25
- /language ui ru-RU # Russian
26
- /language ui de-DE # German
27
- /language ui ja-JP # Japanese
28
- /language ui pt-BR # Portuguese (Brazil)
29
- /language ui fr-FR # French
30
- /language ui ca-ES # Catalan
31
- ```
32
-
33
- Aliases are also supported:
34
-
35
- ```bash
36
- /language ui en # English
37
- /language ui ru # Russian
38
- /language ui de # German
39
- /language ui ja # Japanese
40
- /language ui pt # Portuguese
41
- /language ui fr # French
42
- /language ui ca # Catalan
43
- ```
44
-
45
- ### Auto-detection
46
-
47
- On first startup, Matilda Code detects your system locale and sets the UI language automatically.
48
-
49
- Detection priority:
50
-
51
- 1. `MATILDA_CODE_LANG` environment variable
52
- 2. `LANG` environment variable
53
- 3. System locale via JavaScript Intl API
54
- 4. Default: English
55
-
56
- ## LLM Output Language
57
-
58
- The LLM output language controls what language the AI assistant responds in, regardless of what language you type your questions in.
59
-
60
- ### How It Works
61
-
62
- The LLM output language is controlled by a rule file at `~/.matilda/output-language.md`. This file is automatically included in the LLM's context during startup, instructing it to respond in the specified language.
63
-
64
- ### Auto-detection
65
-
66
- On first startup, if no `output-language.md` file exists, Matilda Code automatically creates one based on your system locale. For example:
67
-
68
- - System locale `en` creates a rule for English responses
69
- - System locale `ru` creates a rule for Russian responses
70
- - System locale `de` creates a rule for German responses
71
- - System locale `ja` creates a rule for Japanese responses
72
- - System locale `pt` creates a rule for Portuguese responses
73
- - System locale `fr` creates a rule for French responses
74
- - System locale `ca` creates a rule for Catalan responses
75
-
76
- ### Manual Setting
77
-
78
- Use `/language output <language>` to change:
79
-
80
- ```bash
81
- /language output English
82
- /language output Japanese
83
- /language output German
84
- ```
85
-
86
- The LLM will be instructed to respond in that language.
87
-
88
- > [!note]
89
- >
90
- > After changing the output language, restart Matilda Code for the change to take effect.
91
-
92
- ### File Location
93
-
94
- ```
95
- ~/.matilda/output-language.md
96
- ```
97
-
98
- ## Configuration
99
-
100
- ### Via Settings Dialog
101
-
102
- 1. Run `/settings`
103
- 2. Find "Language" under General
104
- 3. Select your preferred UI language
105
-
106
- ### Via Environment Variable
107
-
108
- ```bash
109
- export MATILDA_CODE_LANG=de
110
- ```
111
-
112
- This influences auto-detection on first startup (if you haven’t set a UI language and no `output-language.md` file exists yet).
113
-
114
- ## Custom Language Packs
115
-
116
- For UI translations, you can create custom language packs in `~/.matilda/locales/`:
117
-
118
- - Example: `~/.matilda/locales/es.js` for Spanish
119
- - Example: `~/.matilda/locales/fr.js` for French
120
-
121
- User directory takes precedence over built-in translations.
122
-
123
- > [!tip]
124
- >
125
- > Contributions are welcome! If you’d like to improve built-in translations or add new languages.
126
- > For a concrete example, see [PR #1238: feat(i18n): add Russian language support](https://github.com/MaincodeHQ/matilda-code/pull/1238).
127
-
128
- ### Language Pack Format
129
-
130
- ```javascript
131
- // ~/.matilda/locales/es.js
132
- export default {
133
- Hello: 'Hola',
134
- Settings: 'Configuracion',
135
- // ... more translations
136
- };
137
- ```
138
-
139
- ## Related Commands
140
-
141
- - `/language` - Show current language settings
142
- - `/language ui [lang]` - Set UI language
143
- - `/language output <language>` - Set LLM output language
144
- - `/settings` - Open settings dialog
@@ -1,496 +0,0 @@
1
- # Language Server Protocol (LSP) Support
2
-
3
- Matilda Code provides native Language Server Protocol (LSP) support, enabling advanced code intelligence features like go-to-definition, find references, diagnostics, and code actions. This integration allows the AI agent to understand your code more deeply and provide more accurate assistance.
4
-
5
- ## Overview
6
-
7
- LSP support in Matilda Code works by connecting to language servers that understand your code. Once you configure servers via `.lsp.json` (or extensions), Matilda Code can start them and use them to:
8
-
9
- - Navigate to symbol definitions
10
- - Find all references to a symbol
11
- - Get hover information (documentation, type info)
12
- - View diagnostic messages (errors, warnings)
13
- - Access code actions (quick fixes, refactorings)
14
- - Analyze call hierarchies
15
-
16
- ## Quick Start
17
-
18
- LSP is an experimental feature in Matilda Code. To enable it, use the `--experimental-lsp` command line flag:
19
-
20
- ```bash
21
- matilda --experimental-lsp
22
- ```
23
-
24
- LSP servers are configuration-driven. You must define them in `.lsp.json` (or via extensions) for Matilda Code to start them.
25
-
26
- ### Prerequisites
27
-
28
- You need to have the language server for your programming language installed:
29
-
30
- | Language | Language Server | Install Command |
31
- | --------------------- | -------------------------- | ------------------------------------------------------------------------------ |
32
- | TypeScript/JavaScript | typescript-language-server | `npm install -g typescript-language-server typescript` |
33
- | Python | pylsp | `pip install python-lsp-server` |
34
- | Go | gopls | `go install golang.org/x/tools/gopls@latest` |
35
- | Rust | rust-analyzer | [Installation guide](https://rust-analyzer.github.io/manual.html#installation) |
36
- | C/C++ | clangd | Install LLVM/clangd via your package manager |
37
- | Java | jdtls | Install JDTLS and a JDK |
38
-
39
- ## Configuration
40
-
41
- ### .lsp.json File
42
-
43
- You can configure language servers using a `.lsp.json` file in your project root. Each top-level key is a language identifier, and its value is the server configuration object.
44
-
45
- **Basic format:**
46
-
47
- ```json
48
- {
49
- "typescript": {
50
- "command": "typescript-language-server",
51
- "args": ["--stdio"],
52
- "extensionToLanguage": {
53
- ".ts": "typescript",
54
- ".tsx": "typescriptreact",
55
- ".js": "javascript",
56
- ".jsx": "javascriptreact"
57
- }
58
- }
59
- }
60
- ```
61
-
62
- ### C/C++ (clangd) configuration
63
-
64
- Dependencies:
65
-
66
- - clangd (LLVM) must be installed and available in PATH.
67
- - A compile database (`compile_commands.json`) or `compile_flags.txt` is required for accurate results.
68
-
69
- Example:
70
-
71
- ```json
72
- {
73
- "cpp": {
74
- "command": "clangd",
75
- "args": [
76
- "--background-index",
77
- "--clang-tidy",
78
- "--header-insertion=iwyu",
79
- "--completion-style=detailed"
80
- ]
81
- }
82
- }
83
- ```
84
-
85
- ### Java (jdtls) configuration
86
-
87
- Dependencies:
88
-
89
- - JDK installed and available in PATH (`java`).
90
- - JDTLS installed and available in PATH (`jdtls`).
91
-
92
- Example:
93
-
94
- ```json
95
- {
96
- "java": {
97
- "command": "jdtls",
98
- "args": ["-configuration", ".jdtls-config", "-data", ".jdtls-workspace"]
99
- }
100
- }
101
- ```
102
-
103
- ### Configuration Options
104
-
105
- #### Required Fields
106
-
107
- | Option | Type | Description |
108
- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
109
- | `command` | string | Command to start the LSP server. Supports bare command names resolved via `PATH` (e.g. `clangd`) and absolute paths (e.g. `/opt/llvm/bin/clangd`) |
110
-
111
- #### Optional Fields
112
-
113
- | Option | Type | Default | Description |
114
- | ----------------------- | -------- | --------- | ------------------------------------------------------- |
115
- | `args` | string[] | `[]` | Command line arguments |
116
- | `transport` | string | `"stdio"` | Transport type: `stdio`, `tcp`, or `socket` |
117
- | `env` | object | - | Environment variables |
118
- | `initializationOptions` | object | - | LSP initialization options |
119
- | `settings` | object | - | Server settings via `workspace/didChangeConfiguration` |
120
- | `extensionToLanguage` | object | - | Maps file extensions to language identifiers |
121
- | `workspaceFolder` | string | - | Override workspace folder (must be within project root) |
122
- | `startupTimeout` | number | `10000` | Startup timeout in milliseconds |
123
- | `shutdownTimeout` | number | `5000` | Shutdown timeout in milliseconds |
124
- | `restartOnCrash` | boolean | `false` | Auto-restart on crash |
125
- | `maxRestarts` | number | `3` | Maximum restart attempts |
126
- | `trustRequired` | boolean | `true` | Require trusted workspace |
127
-
128
- ### TCP/Socket Transport
129
-
130
- For servers that use TCP or Unix socket transport:
131
-
132
- ```json
133
- {
134
- "remote-lsp": {
135
- "transport": "tcp",
136
- "socket": {
137
- "host": "127.0.0.1",
138
- "port": 9999
139
- },
140
- "extensionToLanguage": {
141
- ".custom": "custom"
142
- }
143
- }
144
- }
145
- ```
146
-
147
- ## Available LSP Operations
148
-
149
- Matilda Code exposes LSP functionality through the unified `lsp` tool. Here are the available operations:
150
-
151
- Location-based operations (`goToDefinition`, `findReferences`, `hover`, `goToImplementation`, and `prepareCallHierarchy`) require an exact `filePath` + `line` + `character` position. If you do not know the exact position, use `workspaceSymbol` or `documentSymbol` first to locate the symbol.
152
-
153
- ### Code Navigation
154
-
155
- #### Go to Definition
156
-
157
- Find where a symbol is defined.
158
-
159
- ```
160
- Operation: goToDefinition
161
- Parameters:
162
- - filePath: Path to the file
163
- - line: Line number (1-based)
164
- - character: Column number (1-based)
165
- ```
166
-
167
- #### Find References
168
-
169
- Find all references to a symbol.
170
-
171
- ```
172
- Operation: findReferences
173
- Parameters:
174
- - filePath: Path to the file
175
- - line: Line number (1-based)
176
- - character: Column number (1-based)
177
- - includeDeclaration: Include the declaration itself (optional)
178
- ```
179
-
180
- #### Go to Implementation
181
-
182
- Find implementations of an interface or abstract method.
183
-
184
- ```
185
- Operation: goToImplementation
186
- Parameters:
187
- - filePath: Path to the file
188
- - line: Line number (1-based)
189
- - character: Column number (1-based)
190
- ```
191
-
192
- ### Symbol Information
193
-
194
- #### Hover
195
-
196
- Get documentation and type information for a symbol.
197
-
198
- ```
199
- Operation: hover
200
- Parameters:
201
- - filePath: Path to the file
202
- - line: Line number (1-based)
203
- - character: Column number (1-based)
204
- ```
205
-
206
- #### Document Symbols
207
-
208
- Get all symbols in a document.
209
-
210
- ```
211
- Operation: documentSymbol
212
- Parameters:
213
- - filePath: Path to the file
214
- ```
215
-
216
- #### Workspace Symbol Search
217
-
218
- Search for symbols across the workspace.
219
-
220
- ```
221
- Operation: workspaceSymbol
222
- Parameters:
223
- - query: Search query string
224
- - limit: Maximum results (optional)
225
- ```
226
-
227
- ### Call Hierarchy
228
-
229
- #### Prepare Call Hierarchy
230
-
231
- Get the call hierarchy item at a position.
232
-
233
- ```
234
- Operation: prepareCallHierarchy
235
- Parameters:
236
- - filePath: Path to the file
237
- - line: Line number (1-based)
238
- - character: Column number (1-based)
239
- ```
240
-
241
- #### Incoming Calls
242
-
243
- Find all functions that call the given function.
244
-
245
- ```
246
- Operation: incomingCalls
247
- Parameters:
248
- - callHierarchyItem: Item from prepareCallHierarchy
249
- ```
250
-
251
- #### Outgoing Calls
252
-
253
- Find all functions called by the given function.
254
-
255
- ```
256
- Operation: outgoingCalls
257
- Parameters:
258
- - callHierarchyItem: Item from prepareCallHierarchy
259
- ```
260
-
261
- ### Diagnostics
262
-
263
- #### File Diagnostics
264
-
265
- Get diagnostic messages (errors, warnings) for a file.
266
-
267
- ```
268
- Operation: diagnostics
269
- Parameters:
270
- - filePath: Path to the file
271
- ```
272
-
273
- #### Workspace Diagnostics
274
-
275
- Get all diagnostic messages across the workspace.
276
-
277
- ```
278
- Operation: workspaceDiagnostics
279
- Parameters:
280
- - limit: Maximum results (optional)
281
- ```
282
-
283
- #### Automatic diagnostics after edits
284
-
285
- When LSP is enabled, the agent does not need to ask for diagnostics explicitly after changing a file. Immediately after a successful file edit or write, the configured language servers are queried for that file and any errors and warnings are appended to the tool result, so the agent can correct mistakes in the same turn.
286
-
287
- This is best-effort: it only runs while LSP is enabled, it is bounded by a short timeout so a slow server never stalls the turn, it reports errors and warnings only (capped in volume), and a failure to fetch diagnostics never affects the edit itself. Servers that do not implement pull diagnostics contribute nothing to this feedback.
288
-
289
- ### Code Actions
290
-
291
- #### Get Code Actions
292
-
293
- Get available code actions (quick fixes, refactorings) at a location.
294
-
295
- ```
296
- Operation: codeActions
297
- Parameters:
298
- - filePath: Path to the file
299
- - line: Start line number (1-based)
300
- - character: Start column number (1-based)
301
- - endLine: End line number (optional, defaults to line)
302
- - endCharacter: End column (optional, defaults to character)
303
- - diagnostics: Diagnostics to get actions for (optional)
304
- - codeActionKinds: Filter by action kind (optional)
305
- ```
306
-
307
- Code action kinds:
308
-
309
- - `quickfix` - Quick fixes for errors/warnings
310
- - `refactor` - Refactoring operations
311
- - `refactor.extract` - Extract to function/variable
312
- - `refactor.inline` - Inline function/variable
313
- - `source` - Source code actions
314
- - `source.organizeImports` - Organize imports
315
- - `source.fixAll` - Fix all auto-fixable issues
316
-
317
- ## Security
318
-
319
- LSP servers are only started in trusted workspaces by default. This is because language servers run with your user permissions and can execute code.
320
-
321
- ### Trust Controls
322
-
323
- - **Trusted Workspace**: LSP servers start if configured
324
- - **Untrusted Workspace**: LSP servers won't start unless `trustRequired: false` is set in the server configuration
325
-
326
- To mark a workspace as trusted, use the `/trust` command.
327
-
328
- ### Per-Server Trust Override
329
-
330
- You can override trust requirements for specific servers in their configuration:
331
-
332
- ```json
333
- {
334
- "safe-server": {
335
- "command": "safe-language-server",
336
- "args": ["--stdio"],
337
- "trustRequired": false,
338
- "extensionToLanguage": {
339
- ".safe": "safe"
340
- }
341
- }
342
- }
343
- ```
344
-
345
- ## Troubleshooting
346
-
347
- ### Server Not Starting
348
-
349
- 1. **Verify `--experimental-lsp` flag**: Make sure you're using the flag when starting Matilda Code
350
- 2. **Check if the server is installed**: Run the command manually (e.g. `clangd --version`) to verify
351
- 3. **Check the command**: The server binary must be in your system `PATH`, or specified as an absolute path (e.g. `/opt/llvm/bin/clangd`). Relative paths that escape the workspace are blocked
352
- 4. **Check workspace trust**: The workspace must be trusted for LSP (use `/trust`)
353
- 5. **Check logs**: Start Matilda Code with `--debug`, then search for LSP-related entries in the debug log (see Debugging section below)
354
- 6. **Check the process**: Run `ps aux | grep <server-name>` to verify the server process is running
355
-
356
- ### Slow Performance
357
-
358
- 1. **Large projects**: Consider excluding `node_modules` and other large directories
359
- 2. **Server timeout**: Increase `startupTimeout` in server configuration for slow servers
360
-
361
- ### No Results
362
-
363
- 1. **Server not ready**: The server may still be indexing. For C/C++ projects with clangd, ensure `--background-index` is in the args and a `compile_commands.json` (or `compile_flags.txt`) exists in the project root or a parent directory. Use `--compile-commands-dir=<path>` if it is in a build subdirectory
364
- 2. **File not saved**: Save your file for the server to pick up changes
365
- 3. **Wrong language**: Check if the correct server is running for your language
366
- 4. **Check the process**: Run `ps aux | grep <server-name>` to verify the server is actually running
367
-
368
- ### Debugging
369
-
370
- LSP does not have a separate debug flag. Use Matilda Code's normal debug mode together with the LSP feature flag:
371
-
372
- ```bash
373
- matilda --experimental-lsp --debug
374
- ```
375
-
376
- Debug logs are written to the session debug log directory. To check LSP-related entries:
377
-
378
- ```bash
379
- # Default runtime directory
380
- rg "LSP|Native LSP|clangd|connection closed" ~/.matilda/debug/latest
381
- # Or, without ripgrep:
382
- grep -E "LSP|Native LSP|clangd|connection closed" ~/.matilda/debug/latest
383
-
384
- # If MATILDA_RUNTIME_DIR is configured
385
- rg "LSP|Native LSP|clangd|connection closed" "$MATILDA_RUNTIME_DIR/debug/latest"
386
- ```
387
-
388
- Useful entries include:
389
-
390
- - `[LSP] ...`: Logs emitted by the native LSP service and server manager.
391
- - `[CONFIG] Native LSP status after discovery: ...`: LSP server configuration discovered for the session.
392
- - `[CONFIG] Native LSP status after startup: ...`: Server startup result, including ready/failed counts.
393
- - `[STATUS] LSP status snapshot for /status: ...`: Status snapshot printed when running `/status` in debug mode.
394
-
395
- You can also run `/status` in the CLI to see a short LSP summary:
396
-
397
- ```text
398
- LSP: disabled
399
- LSP: enabled, 1/1 ready
400
- LSP: enabled, 0/1 ready (1 failed)
401
- LSP: enabled, no servers configured
402
- LSP: enabled, status unavailable
403
- ```
404
-
405
- For per-server details, run `/lsp`:
406
-
407
- ```text
408
- **LSP Server Status**
409
-
410
- | Server | Command | Languages | Status |
411
- |--------|---------|-----------|--------|
412
- | clangd | `clangd` | c, cpp | READY |
413
- | pyright | `pyright-langserver` | python | FAILED - startup failed |
414
- ```
415
-
416
- Common error messages to look for:
417
-
418
- ```text
419
- command path is unsafe -> relative path escapes workspace, use absolute path or add to PATH
420
- command not found -> server binary not installed or not in PATH
421
- requires trusted workspace -> run /trust first
422
- LSP connection closed -> server started but exited or closed stdio before replying to initialize
423
- ```
424
-
425
- For clangd startup failures, verify the server directly from the project root:
426
-
427
- ```bash
428
- clangd --version
429
- clangd --check=/path/to/file.cpp --log=verbose
430
- ```
431
-
432
- C/C++ projects should usually provide a `compile_commands.json` or `compile_flags.txt`. If the compile database is in a build directory, pass it to clangd:
433
-
434
- ```json
435
- {
436
- "cpp": {
437
- "command": "clangd",
438
- "args": ["--background-index", "--compile-commands-dir=build"]
439
- }
440
- }
441
- ```
442
-
443
- ```bash
444
- ps aux | grep clangd # or typescript-language-server, jdtls, etc.
445
- ```
446
-
447
- ## Extension LSP Configuration
448
-
449
- Extensions can provide LSP server configurations through the `lspServers` field in their `plugin.json`. This can be either an inline object or a path to a `.lsp.json` file. Matilda Code loads these configs when the extension is enabled. The format is the same language-keyed layout used in project `.lsp.json` files.
450
-
451
- ## Best Practices
452
-
453
- 1. **Install language servers globally**: This ensures they're available in all projects
454
- 2. **Use project-specific settings**: Configure server options per project when needed via `.lsp.json`
455
- 3. **Keep servers updated**: Update your language servers regularly for best results
456
- 4. **Trust wisely**: Only trust workspaces from trusted sources
457
-
458
- ## FAQ
459
-
460
- ### Q: How do I enable LSP?
461
-
462
- Use the `--experimental-lsp` flag when starting Matilda Code:
463
-
464
- ```bash
465
- matilda --experimental-lsp
466
- ```
467
-
468
- ### Q: How do I know which language servers are running?
469
-
470
- Start Matilda Code with LSP and debug mode enabled:
471
-
472
- ```bash
473
- matilda --experimental-lsp --debug
474
- ```
475
-
476
- Then run `/status` for a short summary, `/lsp` for per-server status, or inspect the debug log:
477
-
478
- ```bash
479
- # Default runtime directory
480
- rg "LSP|Native LSP|<server-name>" ~/.matilda/debug/latest
481
- # Or:
482
- grep -E "LSP|Native LSP|<server-name>" ~/.matilda/debug/latest
483
-
484
- # If MATILDA_RUNTIME_DIR is configured
485
- rg "LSP|Native LSP|<server-name>" "$MATILDA_RUNTIME_DIR/debug/latest"
486
- ```
487
-
488
- LSP uses Matilda Code's normal `--debug` mode; there is no separate LSP debug flag.
489
-
490
- ### Q: Can I use multiple language servers for the same file type?
491
-
492
- Yes, but only one will be used for each operation. The first server that returns results wins.
493
-
494
- ### Q: Does LSP work in sandbox mode?
495
-
496
- LSP servers run outside the sandbox to access your code. They're subject to workspace trust controls.