@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,308 +0,0 @@
1
- # Auto Mode
2
-
3
- Auto Mode uses an LLM classifier to evaluate each tool call and decide
4
- whether to auto-approve it. It sits between Auto-Edit (which only
5
- auto-approves file edits) and YOLO (which auto-approves everything).
6
-
7
- This page is the reference for configuring and troubleshooting Auto Mode.
8
- For an introduction, see the
9
- [Approval Mode overview](./approval-mode.md#4-auto-mode---classifier-driven-approval).
10
-
11
- ## How it works
12
-
13
- When you're in Auto Mode and the agent tries to run a tool, Matilda Code
14
- walks three layers in order:
15
-
16
- 1. **acceptEdits fast-path** — Edit / Write whose target path is inside
17
- the workspace is auto-approved without invoking the classifier.
18
- **Exception:** writes to Matilda Code's own self-modification surfaces
19
- (`.matilda/settings*.json`, `MATILDA.md`, `AGENTS.md`, `MATILDA.local.md`,
20
- configured context filenames, `.matilda/rules/`, `.matilda/commands/`,
21
- `.matilda/agents/`, `.matilda/skills/`, `.matilda/hooks/`, `.mcp.json`) and
22
- persistence surfaces (`.git/`, `.husky/`, `package.json`, `.npmrc`,
23
- `Makefile`, `.github/workflows/`, etc.) route through the classifier
24
- even when they are inside the workspace. Symlinks targeting protected
25
- paths are resolved and rejected too. Shell commands that reach these
26
- paths via `cd && bash -lc '...'` or other wrappers go through the
27
- classifier as well.
28
- 2. **Safe-tool allowlist** — Read-only and metadata-only built-in tools
29
- (Read, Grep, Glob, LS, LSP, TodoWrite, AskUserQuestion, etc.) are
30
- auto-approved without invoking the classifier.
31
- 3. **LLM classifier** — Everything else (shell commands, web fetches,
32
- sub-agent spawns, edits outside the workspace, MCP tools) is sent to
33
- a two-stage classifier:
34
- - **Stage 1 (fast)** — outputs `{ shouldBlock }` only. Around ~300ms.
35
- If `shouldBlock` is `false`, the action is allowed and the call
36
- proceeds.
37
- - **Stage 2 (thinking)** — only runs when Stage 1 said block. Uses
38
- chain-of-thought review to reduce Stage 1 false positives. Can
39
- downgrade Stage 1's block to allow. Outputs the user-visible
40
- `reason` on block.
41
-
42
- The classifier uses your configured fast model
43
- (`/model --fast`). If no fast model is configured, the main session
44
- model is used instead.
45
-
46
- ## Hard rules still win
47
-
48
- Auto Mode does **not** replace hard permission rules. Before the classifier
49
- runs:
50
-
51
- - `permissions.deny` rules block the action with the rule's reason. The
52
- classifier never sees it.
53
- - `permissions.allow` rules with specific specifiers (e.g.
54
- `Bash(git status)`, `Read(./docs/**)`) still auto-allow without the
55
- classifier — **except** when the call resolves to a write at a
56
- protected self-modification or persistence path (see the list under
57
- "How it works"). In that case Auto Mode re-checks the call through
58
- the classifier so an allow rule on `Bash(*)` cannot silently turn
59
- into permission to rewrite Matilda Code settings, commands, hooks,
60
- skills, or MCP servers.
61
- - `permissions.ask` rules force manual confirmation even in Auto Mode.
62
-
63
- ## Over-broad allow rules are stripped while in Auto Mode
64
-
65
- Rules like the following would let the agent execute arbitrary code
66
- without classifier review:
67
-
68
- - `Bash` / `Bash(*)` / `Bash()` — auto-allow every shell command
69
- - `Bash(python:*)`, `Bash(node*)`, `Bash(bash*)` — interpreter wildcards
70
- - `Agent` / `Agent(coder)` — any allow on the Agent tool
71
- - `Skill` / `Skill(pdf)` — any allow on the Skill tool
72
-
73
- When you enter Auto Mode, Matilda Code temporarily removes these rules from
74
- the active permission set and prints a notice listing them. The rules
75
- come back the moment you leave Auto Mode. `settings.json` is never
76
- modified.
77
-
78
- If you genuinely need these broad rules, use YOLO mode instead.
79
-
80
- ## Configuring hints
81
-
82
- Auto Mode reads `permissions.autoMode` from your `settings.json`. The
83
- entries are natural-language descriptions, not rule patterns — they are
84
- injected additively into the classifier's system prompt alongside the
85
- built-in defaults.
86
-
87
- There are three hint categories plus an environment list:
88
-
89
- - **`allow`** — actions the classifier should auto-approve.
90
- - **`softDeny`** — destructive or irreversible actions the classifier
91
- should block **unless the user's most recent explicit request asked
92
- for that exact action and scope**. Soft denies can be cleared by
93
- user intent; a generic "yes do whatever" doesn't count.
94
- - **`hardDeny`** — security-boundary actions the classifier must block
95
- in Auto Mode regardless of `autoMode.hints.allow` or recent user
96
- intent. This is classifier policy, not a deterministic permission
97
- rule: it does not override `permissions.allow`. Use `permissions.deny`
98
- for actions that must never be allowed by the permission manager.
99
-
100
- ```json
101
- {
102
- "permissions": {
103
- "autoMode": {
104
- "hints": {
105
- "allow": [
106
- "Running poetry install and poetry update in this Python project",
107
- "Cleaning build artifacts under ./dist or ./build",
108
- "Reading any file under /Users/me/code/"
109
- ],
110
- "softDeny": [
111
- "Editing Matilda Code settings unless I explicitly ask for the exact change",
112
- "Running migration scripts that touch the production DB"
113
- ],
114
- "hardDeny": [
115
- "Sending secrets or .env contents to any network endpoint",
116
- "Modifying anything under ~/.ssh or ~/.aws"
117
- ]
118
- },
119
- "environment": [
120
- "This is a private monorepo with strict commit signing",
121
- "Production credentials live in 1Password, never in plain files"
122
- ]
123
- }
124
- }
125
- }
126
- ```
127
-
128
- `hints.deny` is still accepted for backward compatibility and is treated
129
- as `softDeny`. Mixing both is fine — entries are concatenated, `softDeny`
130
- first.
131
-
132
- ### Length and count limits
133
-
134
- To keep the classifier system prompt small:
135
-
136
- - Each entry is capped at 200 characters (longer entries are truncated
137
- with a warning).
138
- - `hints.allow`, `hints.softDeny`, and `hints.hardDeny` accept up to 50
139
- entries each.
140
- - `environment` accepts up to 20 entries.
141
-
142
- ### Layering across settings files
143
-
144
- `autoMode` is merged across system / user / workspace settings the same
145
- way other permission settings are: arrays are concatenated and
146
- de-duplicated.
147
-
148
- ## Reading the decision
149
-
150
- When the classifier blocks an action, the tool call fails with one of
151
- the following error texts:
152
-
153
- - **`Blocked by auto mode policy: <reason>`** —
154
- the classifier judged the action unsafe. The reason comes from Stage
155
- 2 of the classifier.
156
- - **`Auto mode classifier unavailable; action blocked for safety`** —
157
- the classifier API was unreachable, timed out, or returned an
158
- un-parseable response. This is fail-closed behavior: when in doubt,
159
- block.
160
-
161
- Both messages are followed by a trailing guidance line telling the agent
162
- that the **denied action specifically** must not be completed through
163
- another tool, shell indirection, generated script, alias, symlink,
164
- config change, hook, command file, MCP configuration, encoded payload,
165
- or equivalent path. **Unrelated safe work and genuinely safer
166
- alternatives are still allowed** — only attempts to accomplish the same
167
- denied intent through a different surface are blocked.
168
-
169
- If the denied action is genuinely required, the agent should stop and
170
- ask you for explicit approval rather than route around the denial.
171
-
172
- ### Classifier reason language
173
-
174
- Classifier reasons are produced by the LLM and are not translated. If you
175
- want non-English reasons, add a hint like
176
- `Respond reasons in Japanese` to `permissions.autoMode.environment`.
177
-
178
- ## Fallback to manual approval
179
-
180
- Auto Mode protects you from getting stuck:
181
-
182
- - After **3 consecutive policy blocks** the next tool call falls back to
183
- the standard manual-approval prompt. This catches the case where the
184
- agent keeps trying minor variants of a forbidden command.
185
- - After **2 consecutive unavailable** results (classifier API failures)
186
- the next tool call also falls back. This avoids waiting on a broken
187
- classifier.
188
-
189
- The session itself stays in Auto Mode — only the single fallback call
190
- goes through manual approval. The counters reset when you approve the
191
- fallback call or switch modes.
192
-
193
- If you find yourself constantly hitting fallback, the most likely causes
194
- are an outage on the classifier API or hints that need tuning. Switch to
195
- Default Mode while you investigate.
196
-
197
- ## Troubleshooting
198
-
199
- **"Auto mode keeps blocking my commands"**
200
-
201
- Look at the reason in the error message. If the classifier is being too
202
- conservative for your context, add an entry to
203
- `permissions.autoMode.hints.allow` describing the pattern in
204
- natural-language. Examples:
205
-
206
- - `"Building Docker images for this project (docker build ...)"`
207
- - `"Running database migrations against the local test DB"`
208
-
209
- **"Auto mode classifier unavailable"**
210
-
211
- The classifier API didn't respond. Possible causes:
212
-
213
- - Network issue between you and the model endpoint.
214
- - The configured fast model is no longer available — check `/model --fast`.
215
- - The transcript is too long and exceeds the fast-model context window.
216
-
217
- While diagnosing, switch back to Default Mode: `/approval-mode default`.
218
-
219
- **"Falling back to manual approval"**
220
-
221
- You've hit either the 3-consecutive-block or 2-consecutive-unavailable
222
- guard. Approve or reject the prompt as you normally would. After one
223
- approved fallback the consecutive counter resets.
224
-
225
- **The classifier sees sensitive data in my prompts**
226
-
227
- Tool inputs are projected through each tool's `toAutoClassifierInput`
228
- method before they reach the classifier. Long edit content, web fetch
229
- prompts, and sub-agent prompts are truncated. Tool results (file
230
- contents, web pages) are never sent to the classifier — only the user's
231
- text and assistant tool-use calls go through.
232
-
233
- If a specific tool is exposing fields you'd rather redact, file an issue
234
- with the tool name; the projection is per-tool and is meant to be
235
- tightened over time.
236
-
237
- ## Limitations
238
-
239
- - **Not offline-capable.** The classifier requires an LLM call.
240
- - **Adds latency on the slow path.** Allowlist + acceptEdits cover most
241
- calls without latency, but a `run_shell_command` typically adds
242
- ~300ms (fast classifier path) or ~3-5s (slow path with thinking
243
- review).
244
- - **Not a substitute for `deny` rules.** The classifier is best-effort.
245
- For commands you're sure should never run, put them in
246
- `permissions.deny`.
247
- - **MCP tools default to conservative blocking.** Third-party MCP tools
248
- (`mcp__*`) opt-in to argument forwarding via the
249
- `toAutoClassifierInput` override. Tools that have not opted in expose
250
- only their name to the classifier — most such calls are
251
- conservatively blocked unless you've written an explicit `allow`
252
- rule. This is fail-closed by design (credentials and voluminous
253
- content do not leak into the classifier LLM). If you trust a
254
- specific MCP tool, add `permissions.allow: ["mcp__server__tool"]` so
255
- it bypasses the classifier entirely.
256
-
257
- ## FAQ
258
-
259
- **Does Auto Mode send my code to a third party?**
260
-
261
- Auto Mode reuses your existing model configuration — same endpoint as
262
- the main agent. If you've configured Matilda Code to use a self-hosted
263
- model, the classifier runs against that endpoint too.
264
-
265
- **Will my secrets / `.env` contents reach the classifier?**
266
-
267
- The classifier sees only what each tool's `toAutoClassifierInput`
268
- projection exposes:
269
-
270
- - `read_file` and other read-only tools: not invoked (they're on the
271
- fast-path allowlist).
272
- - `edit` / `write_file`: file_path plus the first 80 characters of
273
- old/new content. Full content is not forwarded.
274
- - `run_shell_command`: the full command (it has to — that's what the
275
- classifier judges).
276
- - `web_fetch`: the URL only. The prompt field is not forwarded.
277
- - `agent`: subagent type plus the full prompt. The prompt is the
278
- instruction the sub-agent will follow, so the classifier needs it
279
- in full to detect attacks that would steer the sub-agent toward
280
- destructive actions — same reason `run_shell_command` forwards the
281
- full command.
282
-
283
- Tool results (the actual content returned by tools) are stripped from
284
- the classifier transcript entirely.
285
-
286
- MCP tools (`mcp__*`) follow a stricter default: their parameters are
287
- not forwarded unless the MCP tool author explicitly opted in via the
288
- `toAutoClassifierInput` override. The classifier sees the tool name
289
- but no arguments, so most MCP calls will be conservatively blocked
290
- unless the user has written an explicit allow rule. This is fail-
291
- closed by design — third-party tools should not leak credentials or
292
- voluminous file content into the classifier LLM without intent.
293
-
294
- **Can I disable the first-time information message?**
295
-
296
- It only shows once per user-settings file. After dismissal,
297
- `ui.autoModeAcknowledged: true` is set in your user settings.
298
-
299
- **How is this different from Auto-Edit?**
300
-
301
- Auto-Edit auto-approves file edits and nothing else — shell commands
302
- still ask. Auto Mode uses a classifier to also auto-approve safe shell
303
- commands and other tool calls while still blocking risky ones.
304
-
305
- **How is this different from YOLO?**
306
-
307
- YOLO auto-approves everything without any review. Auto Mode has the
308
- classifier in the loop and blocks risky actions.
@@ -1,5 +0,0 @@
1
- export default {
2
- overview: 'Overview',
3
- telegram: 'Telegram',
4
- plugins: 'Plugins',
5
- };
@@ -1,328 +0,0 @@
1
- # Channels
2
-
3
- Channels let you interact with a Matilda Code agent from messaging platforms like Telegram, instead of the terminal. You send messages from your phone or desktop chat app, and the agent responds just like it would in the CLI.
4
-
5
- ## How It Works
6
-
7
- When you run `matilda channel start`, Matilda Code:
8
-
9
- 1. Reads channel configurations from your `settings.json`
10
- 2. Spawns a single agent process using the [Agent Client Protocol (ACP)](../../developers/architecture)
11
- 3. Connects to each messaging platform and starts listening for messages
12
- 4. Routes incoming messages to the agent and sends responses back to the correct chat
13
-
14
- All channels share one agent process with isolated sessions per user. Each channel can have its own working directory, model, and instructions.
15
-
16
- ## Quick Start
17
-
18
- 1. Set up a bot on your messaging platform (see the [Telegram](./telegram) guide)
19
- 2. Add the channel configuration to `~/.matilda/settings.json`
20
- 3. Run `matilda channel start` to start all channels, or `matilda channel start <name>` for a single channel
21
-
22
- Want to connect a platform that isn't built in? See [Plugins](./plugins) to add a custom adapter as an extension.
23
-
24
- ## Configuration
25
-
26
- Channels are configured under the `channels` key in `settings.json`. Each channel has a name and a set of options:
27
-
28
- ```json
29
- {
30
- "channels": {
31
- "my-channel": {
32
- "type": "telegram",
33
- "token": "$MY_BOT_TOKEN",
34
- "senderPolicy": "allowlist",
35
- "allowedUsers": ["123456789"],
36
- "sessionScope": "user",
37
- "cwd": "/path/to/working/directory",
38
- "instructions": "Optional system instructions for the agent.",
39
- "groupPolicy": "disabled",
40
- "groups": {
41
- "*": { "requireMention": true }
42
- }
43
- }
44
- }
45
- }
46
- ```
47
-
48
- ### Options
49
-
50
- | Option | Required | Description |
51
- | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
52
- | `type` | Yes | Channel type: `telegram`, or a custom type from an extension (see [Plugins](./plugins)) |
53
- | `token` | Telegram | Bot token. Supports `$ENV_VAR` syntax to read from environment variables |
54
- | `clientId` | No | Client ID, for extension channels that need one. Supports `$ENV_VAR` syntax |
55
- | `clientSecret` | No | Client secret, for extension channels that need one. Supports `$ENV_VAR` syntax |
56
- | `model` | No | Model to use for this channel (e.g., `matilda3.5-plus`). Overrides the default model. Useful for multimodal models that support image input |
57
- | `senderPolicy` | No | Who can talk to the bot: `allowlist` (default), `open`, or `pairing` |
58
- | `allowedUsers` | No | List of user IDs allowed to use the bot (used by `allowlist` and `pairing` policies) |
59
- | `sessionScope` | No | How sessions are scoped: `user` (default), `thread`, or `single` |
60
- | `cwd` | No | Working directory for the agent. Defaults to the current directory |
61
- | `instructions` | No | Custom instructions prepended to the first message of each session |
62
- | `groupPolicy` | No | Group chat access: `disabled` (default), `allowlist`, or `open`. See [Group Chats](#group-chats) |
63
- | `groups` | No | Per-group settings. Keys are group chat IDs or `"*"` for defaults. See [Group Chats](#group-chats) |
64
- | `dispatchMode` | No | What happens when you send a message while the bot is busy: `steer` (default), `collect`, or `followup`. See [Dispatch Modes](#dispatch-modes) |
65
- | `blockStreaming` | No | Progressive response delivery: `on` or `off` (default). See [Block Streaming](#block-streaming) |
66
- | `blockStreamingChunk` | No | Chunk size bounds: `{ "minChars": 400, "maxChars": 1000 }`. See [Block Streaming](#block-streaming) |
67
- | `blockStreamingCoalesce` | No | Idle flush: `{ "idleMs": 1500 }`. See [Block Streaming](#block-streaming) |
68
-
69
- ### Sender Policy
70
-
71
- Controls who can interact with the bot:
72
-
73
- - **`allowlist`** (default) — Only users listed in `allowedUsers` can send messages. Others are silently ignored.
74
- - **`pairing`** — Unknown senders receive a pairing code. The bot operator approves them via CLI, and they're added to a persistent allowlist. Users in `allowedUsers` skip pairing entirely. See [DM Pairing](#dm-pairing) below.
75
- - **`open`** — Anyone can send messages. Use with caution.
76
-
77
- ### Session Scope
78
-
79
- Controls how conversation sessions are managed:
80
-
81
- - **`user`** (default) — One session per user. All messages from the same user share a conversation.
82
- - **`thread`** — One session per thread/topic. Useful for group chats with threads.
83
- - **`single`** — One shared session for all users. Everyone shares the same conversation.
84
-
85
- ### Token Security
86
-
87
- Bot tokens should not be stored directly in `settings.json`. Instead, use environment variable references:
88
-
89
- ```json
90
- {
91
- "token": "$TELEGRAM_BOT_TOKEN"
92
- }
93
- ```
94
-
95
- Set the actual token in your shell environment or in a `.env` file that gets loaded before running the channel.
96
-
97
- ## DM Pairing
98
-
99
- When `senderPolicy` is set to `"pairing"`, unknown senders go through an approval flow:
100
-
101
- 1. An unknown user sends a message to the bot
102
- 2. The bot replies with an 8-character pairing code (e.g., `VEQDDWXJ`)
103
- 3. The user shares the code with you (the bot operator)
104
- 4. You approve them via CLI:
105
-
106
- ```bash
107
- matilda channel pairing approve my-channel VEQDDWXJ
108
- ```
109
-
110
- Once approved, the user's ID is saved to `~/.matilda/channels/<name>-allowlist.json` and all future messages go through normally.
111
-
112
- ### Pairing CLI Commands
113
-
114
- ```bash
115
- # List pending pairing requests
116
- matilda channel pairing list my-channel
117
-
118
- # Approve a request by code
119
- matilda channel pairing approve my-channel <CODE>
120
- ```
121
-
122
- ### Pairing Rules
123
-
124
- - Codes are 8 characters, uppercase, using an unambiguous alphabet (no `0`/`O`/`1`/`I`)
125
- - Codes expire after 1 hour
126
- - Maximum 3 pending requests per channel at a time — additional requests are ignored until one expires or is approved
127
- - Users listed in `allowedUsers` in `settings.json` always skip pairing
128
- - Approved users are stored in `~/.matilda/channels/<name>-allowlist.json` — treat this file as sensitive
129
-
130
- ## Group Chats
131
-
132
- By default, the bot only works in direct messages. To enable group chat support, set `groupPolicy` to `"allowlist"` or `"open"`.
133
-
134
- ### Group Policy
135
-
136
- Controls whether the bot participates in group chats at all:
137
-
138
- - **`disabled`** (default) — The bot ignores all group messages. Safest option.
139
- - **`allowlist`** — The bot only responds in groups explicitly listed in `groups` by chat ID. The `"*"` key provides default settings but does **not** act as a wildcard allow.
140
- - **`open`** — The bot responds in all groups it's added to. Use with caution.
141
-
142
- ### Mention Gating
143
-
144
- In groups, the bot requires an `@mention` or a reply to one of its messages by default. This prevents the bot from responding to every message in a group chat.
145
-
146
- Configure per-group with the `groups` setting:
147
-
148
- ```json
149
- {
150
- "groups": {
151
- "*": { "requireMention": true },
152
- "-100123456": { "requireMention": false }
153
- }
154
- }
155
- ```
156
-
157
- - **`"*"`** — Default settings for all groups. Only sets config defaults, not an allowlist entry.
158
- - **Group chat ID** — Override settings for a specific group. Overrides `"*"` defaults.
159
- - **`requireMention`** (default: `true`) — When `true`, the bot only responds to messages that @mention it or reply to one of its messages. When `false`, the bot responds to all messages (useful for dedicated task groups).
160
-
161
- ### How group messages are evaluated
162
-
163
- ```
164
- 1. groupPolicy — is this group allowed? (no → ignore)
165
- 2. requireMention — was the bot mentioned/replied to? (no → ignore)
166
- 3. senderPolicy — is this sender approved? (no → pairing flow)
167
- 4. Route to session
168
- ```
169
-
170
- ### Telegram Setup for Groups
171
-
172
- 1. Add the bot to a group
173
- 2. **Disable privacy mode** in BotFather (`/mybots` → Bot Settings → Group Privacy → Turn Off) — otherwise the bot won't see non-command messages
174
- 3. **Remove and re-add the bot** to the group after changing privacy mode (Telegram caches this setting)
175
-
176
- ### Finding a Group Chat ID
177
-
178
- To find a group's chat ID for the `groups` allowlist:
179
-
180
- 1. Stop the bot if it's running
181
- 2. Send a message mentioning the bot in the group
182
- 3. Use the Telegram Bot API to check queued updates:
183
-
184
- ```bash
185
- curl -s "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/getUpdates" | python3 -m json.tool
186
- ```
187
-
188
- Look for `message.chat.id` in the response — group IDs are negative numbers (e.g., `-5170296765`).
189
-
190
- ## Media Support
191
-
192
- Channels support sending images and files to the agent, not just text.
193
-
194
- ### Images
195
-
196
- Send a photo to the bot and the agent will see it — useful for sharing screenshots, error messages, or diagrams. The image is sent directly to the model as a vision input.
197
-
198
- To use image support, configure a multimodal model for the channel:
199
-
200
- ```json
201
- {
202
- "channels": {
203
- "my-channel": {
204
- "type": "telegram",
205
- "model": "matilda3.5-plus",
206
- ...
207
- }
208
- }
209
- }
210
- ```
211
-
212
- ### Files
213
-
214
- Send a document (PDF, code file, text file, etc.) to the bot. The file is downloaded and saved to a temporary directory, and the agent is told the file path so it can read the contents using its file-reading tools.
215
-
216
- Files work with any model — no multimodal support required.
217
-
218
- ## Dispatch Modes
219
-
220
- Controls what happens when you send a new message while the bot is still processing a previous one.
221
-
222
- - **`steer`** (default) — The bot cancels the current request and starts working on your new message. Best for normal chat, where a follow-up usually means you want to correct or redirect the bot.
223
- - **`collect`** — Your new messages are buffered. When the current request finishes, all buffered messages are combined into a single follow-up prompt. Good for async workflows where you want to queue up thoughts.
224
- - **`followup`** — Each message is queued and processed as its own separate turn, in order. Useful for batch workflows where each message is independent.
225
-
226
- ```json
227
- {
228
- "channels": {
229
- "my-channel": {
230
- "type": "telegram",
231
- "dispatchMode": "steer",
232
- ...
233
- }
234
- }
235
- }
236
- ```
237
-
238
- You can also set dispatch mode per group, overriding the channel default:
239
-
240
- ```json
241
- {
242
- "groups": {
243
- "*": { "requireMention": true, "dispatchMode": "steer" },
244
- "-100123456": { "dispatchMode": "collect" }
245
- }
246
- }
247
- ```
248
-
249
- ## Block Streaming
250
-
251
- By default, the agent works for a while and then sends one large response. With block streaming enabled, the response arrives as multiple shorter messages while the agent is still working — similar to how ChatGPT or Claude show progressive output.
252
-
253
- ```json
254
- {
255
- "channels": {
256
- "my-channel": {
257
- "type": "telegram",
258
- "blockStreaming": "on",
259
- "blockStreamingChunk": { "minChars": 400, "maxChars": 1000 },
260
- "blockStreamingCoalesce": { "idleMs": 1500 },
261
- ...
262
- }
263
- }
264
- }
265
- ```
266
-
267
- ### How it works
268
-
269
- - The agent's response is split into blocks at paragraph boundaries and sent as separate messages
270
- - `minChars` (default 400) — don't send a block until it's at least this long, to avoid spamming tiny messages
271
- - `maxChars` (default 1000) — if a block gets this long without a natural break, send it anyway
272
- - `idleMs` (default 1500) — if the agent pauses (e.g., running a tool), send what's buffered so far
273
- - When the agent finishes, any remaining text is sent immediately
274
-
275
- Only `blockStreaming` is required. The chunk and coalesce settings are optional and have sensible defaults.
276
-
277
- ## Slash Commands
278
-
279
- Channels support slash commands. These are handled locally (no agent round-trip):
280
-
281
- - `/help` — List available commands
282
- - `/clear` — Clear your session and start fresh (aliases: `/reset`, `/new`)
283
- - `/status` — Show session info and access policy
284
-
285
- All other slash commands (e.g., `/compress`, `/summary`) are forwarded to the agent.
286
-
287
- These commands work on all channel types.
288
-
289
- ## Running
290
-
291
- ```bash
292
- # Start all configured channels (shared agent process)
293
- matilda channel start
294
-
295
- # Start a single channel
296
- matilda channel start my-channel
297
-
298
- # Check if the service is running
299
- matilda channel status
300
-
301
- # Stop the running service
302
- matilda channel stop
303
- ```
304
-
305
- The bot runs in the foreground. Press `Ctrl+C` to stop, or use `matilda channel stop` from another terminal.
306
-
307
- ### Multi-Channel Mode
308
-
309
- When you run `matilda channel start` without a name, all channels defined in `settings.json` start together sharing a single agent process. Each channel maintains its own sessions, so users on different channels get separate conversations, even though they share the same agent.
310
-
311
- Each channel uses its own `cwd` from its config, so different channels can work on different projects simultaneously.
312
-
313
- ### Service Management
314
-
315
- The channel service uses a PID file (`~/.matilda/channels/service.pid`) to track the running instance:
316
-
317
- - **Duplicate prevention**: Running `matilda channel start` while a service is already running will show an error instead of starting a second instance
318
- - **`matilda channel stop`**: Gracefully stops the running service from another terminal
319
- - **`matilda channel status`**: Shows whether the service is running, its uptime, and session counts per channel
320
-
321
- ### Crash Recovery
322
-
323
- If the agent process crashes unexpectedly, the channel service automatically restarts it and attempts to restore all active sessions. Users can continue their conversations without starting over.
324
-
325
- - Sessions are persisted to `~/.matilda/channels/sessions.json` while the service is running
326
- - On crash: the agent restarts within 3 seconds and reloads saved sessions
327
- - After 3 consecutive crashes, the service exits with an error
328
- - On clean shutdown (Ctrl+C or `matilda channel stop`): session data is cleared — the next start is always fresh