@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,8 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import{b as u,ba as M}from"./chunk-27Q5KW3A.js";import{b as I}from"./chunk-GZPNIYVZ.js";I();import*as P from"node:crypto";import*as n from"node:fs";import*as f from"node:fs/promises";import*as O from"node:path";var C=M("ATOMIC_WRITE");async function L(t,o,e,i,w=f.rename){for(let a=0;a<=e;a++)try{await w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;await new Promise(v=>setTimeout(v,i*2**a))}}async function $(t){let e=t;for(let w=0;w<40;w++){let a;try{a=await f.lstat(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=await f.readlink(e);if(O.isAbsolute(c))e=c;else{let l=await f.realpath(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}async function B(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??f.rename,F=i?.writeFile??f.writeFile,x=i?.open??f.open,T=i?.chmod??f.chmod,A=i?.fchmod??((d,s)=>d.chmod(s)),b=i?.unlink??f.unlink,r=e?.noFollow?t:await $(t).catch(d=>{throw N(d,t)}),S;try{S=await f.stat(r)}catch(d){if(!u(d)||d.code!=="ENOENT")throw d}let W;(!e?.forceMode||e?.mode===void 0)&&(W=S!==void 0?S.mode&4095:void 0);let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=async d=>{if(y!==void 0)try{await T(d,y)}catch(s){if(!u(s)||s.code!=="ENOSYS"&&s.code!=="ENOTSUP")throw s}},h=()=>{if(S===void 0||process.platform==="win32")return!1;let d=process.geteuid?.();return d===void 0?!1:S.uid!==d};if(S!==void 0&&S.isFile()&&h()){await f.writeFile(r,o,p),await k(r);return}let m=`${r}.${P.randomBytes(6).toString("hex")}.tmp`;try{await F(m,o,p),await k(m),await L(m,r,w,a,v)}catch(d){try{await b(m)}catch{}if(u(d)&&d.code==="EXDEV")try{if(e?.noFollow){try{await b(r)}catch(g){if(!u(g)||g.code!=="ENOENT")throw g}let s=await x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),E=!1;try{try{if(await s.writeFile(typeof o=="string"?Buffer.from(o,l):o),c&&await s.sync(),y!==void 0)try{await A(s,y)}catch(g){if(!u(g)||g.code!=="ENOSYS"&&g.code!=="ENOTSUP")throw g}E=!0}finally{await s.close()}}catch(g){if(!E)try{await b(r)}catch(R){C.debug(`orphan unlink failed for ${r}:`,R)}throw g}}else await F(r,o,p),await k(r);return}catch(s){throw N(s,r)}throw N(d,r)}}function N(t,o,e="atomicWriteFile"){return t instanceof Error&&!t.message.startsWith(`${e}(`)&&(t.message=`${e}(${JSON.stringify(o)}): ${t.message}`),t}async function X(t,o,e){await B(t,JSON.stringify(o,null,2),{encoding:"utf-8",...e})}function H(t){if(t<=0)return;let o=new SharedArrayBuffer(4),e=new Int32Array(o);Atomics.wait(e,0,0,t)}function Y(t,o,e,i,w=n.renameSync){for(let a=0;a<=e;a++)try{w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;H(i*2**a)}}function D(t){let e=t;for(let w=0;w<40;w++){let a;try{a=n.lstatSync(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=n.readlinkSync(e);if(O.isAbsolute(c))e=c;else{let l=n.realpathSync(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}function V(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??n.renameSync,F=i?.writeFile??n.writeFileSync,x=i?.open??n.openSync,T=i?.chmod??n.chmodSync,A=i?.fchmod??n.fchmodSync,b=i?.unlink??n.unlinkSync,r;if(e?.noFollow)r=t;else try{r=D(t)}catch(h){throw N(h,t,"atomicWriteFileSync")}let S=`${r}.${P.randomBytes(6).toString("hex")}.tmp`,W;if(!e?.forceMode||e?.mode===void 0)try{W=n.statSync(r).mode&4095}catch(h){if(!u(h)||h.code!=="ENOENT")throw h}let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=h=>{if(y!==void 0)try{T(h,y)}catch(m){if(!u(m)||m.code!=="ENOSYS"&&m.code!=="ENOTSUP")throw m}};try{F(S,o,p),k(S),Y(S,r,w,a,v)}catch(h){try{b(S)}catch{}if(u(h)&&h.code==="EXDEV")try{if(e?.noFollow){try{b(r)}catch(s){if(!u(s)||s.code!=="ENOENT")throw s}let m=x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),d=!1;try{try{let s=typeof o=="string"?Buffer.from(o,l):o;if(n.writeFileSync(m,s),c&&n.fsyncSync(m),y!==void 0)try{A(m,y)}catch(E){if(!u(E)||E.code!=="ENOSYS"&&E.code!=="ENOTSUP")throw E}d=!0}finally{n.closeSync(m)}}catch(s){if(!d)try{b(r)}catch(E){C.debug(`orphan unlink failed for ${r}:`,E)}throw s}}else F(r,o,p),k(r);return}catch(m){throw N(m,r,"atomicWriteFileSync")}throw N(h,r,"atomicWriteFileSync")}}export{L as a,B as b,X as c,Y as d,V as e};
4
- /**
5
- * @license
6
- * Copyright 2025 Matilda Team
7
- * SPDX-License-Identifier: Apache-2.0
8
- */
@@ -1,37 +0,0 @@
1
- // Force strict mode and setup for ESM
2
- "use strict";
3
- import{l as k}from"./chunk-27HUYW23.js";import{oc as It,vc as St}from"./chunk-PEKAUGYV.js";import{a as Tt}from"./chunk-EZDV7A76.js";import{m as Ct}from"./chunk-JCE3JAVC.js";import{Ic as ht,h as nt}from"./chunk-DHDD5YJC.js";import{p as st}from"./chunk-TWJLOEAI.js";import{b as C}from"./chunk-GZPNIYVZ.js";import{d as gt,f as Bt}from"./chunk-OWGSC52X.js";var Mt=gt(i=>{"use strict";C();var at=Symbol.for("react.transitional.element"),$t=Symbol.for("react.portal"),Gt=Symbol.for("react.fragment"),jt=Symbol.for("react.strict_mode"),Wt=Symbol.for("react.profiler"),qt=Symbol.for("react.consumer"),Ft=Symbol.for("react.context"),Yt=Symbol.for("react.forward_ref"),Kt=Symbol.for("react.suspense"),Jt=Symbol.for("react.memo"),kt=Symbol.for("react.lazy"),zt=Symbol.for("react.activity"),xt=Symbol.iterator;function Qt(t){return t===null||typeof t!="object"?null:(t=xt&&t[xt]||t["@@iterator"],typeof t=="function"?t:null)}var Rt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vt=Object.assign,Et={};function v(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}v.prototype.isReactComponent={};v.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};v.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function At(){}At.prototype=v.prototype;function ut(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}var mt=ut.prototype=new At;mt.constructor=ut;vt(mt,v.prototype);mt.isPureReactComponent=!0;var bt=Array.isArray;function it(){}var p={H:null,A:null,T:null,S:null},wt=Object.prototype.hasOwnProperty;function lt(t,e,s){var o=s.ref;return{$$typeof:at,type:t,key:e,ref:o!==void 0?o:null,props:s}}function Vt(t,e){return lt(t.type,e,t.props)}function pt(t){return typeof t=="object"&&t!==null&&t.$$typeof===at}function Xt(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(s){return e[s]})}var _t=/\/+/g;function rt(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Xt(""+t.key):e.toString(36)}function Zt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(it,it):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function R(t,e,s,o,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var m=!1;if(t===null)m=!0;else switch(a){case"bigint":case"string":case"number":m=!0;break;case"object":switch(t.$$typeof){case at:case $t:m=!0;break;case kt:return m=t._init,R(m(t._payload),e,s,o,n)}}if(m)return n=n(t),m=o===""?"."+rt(t,0):o,bt(n)?(s="",m!=null&&(s=m.replace(_t,"$&/")+"/"),R(n,e,s,"",function(g){return g})):n!=null&&(pt(n)&&(n=Vt(n,s+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(_t,"$&/")+"/")+m)),e.push(n)),1;m=0;var d=o===""?".":o+":";if(bt(t))for(var c=0;c<t.length;c++)o=t[c],a=d+rt(o,c),m+=R(o,e,s,a,n);else if(c=Qt(t),typeof c=="function")for(t=c.call(t),c=0;!(o=t.next()).done;)o=o.value,a=d+rt(o,c++),m+=R(o,e,s,a,n);else if(a==="object"){if(typeof t.then=="function")return R(Zt(t),e,s,o,n);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return m}function B(t,e,s){if(t==null)return t;var o=[],n=0;return R(t,o,"","",function(a){return e.call(s,a,n++)}),o}function te(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(s){(t._status===0||t._status===-1)&&(t._status=1,t._result=s)},function(s){(t._status===0||t._status===-1)&&(t._status=2,t._result=s)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ht=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ee={map:B,forEach:function(t,e,s){B(t,function(){e.apply(this,arguments)},s)},count:function(t){var e=0;return B(t,function(){e++}),e},toArray:function(t){return B(t,function(e){return e})||[]},only:function(t){if(!pt(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};i.Activity=zt;i.Children=ee;i.Component=v;i.Fragment=Gt;i.Profiler=Wt;i.PureComponent=ut;i.StrictMode=jt;i.Suspense=Kt;i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p;i.__COMPILER_RUNTIME={__proto__:null,c:function(t){return p.H.useMemoCache(t)}};i.cache=function(t){return function(){return t.apply(null,arguments)}};i.cacheSignal=function(){return null};i.cloneElement=function(t,e,s){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var o=vt({},t.props),n=t.key;if(e!=null)for(a in e.key!==void 0&&(n=""+e.key),e)!wt.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(o[a]=e[a]);var a=arguments.length-2;if(a===1)o.children=s;else if(1<a){for(var m=Array(a),d=0;d<a;d++)m[d]=arguments[d+2];o.children=m}return lt(t.type,n,o)};i.createContext=function(t){return t={$$typeof:Ft,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:qt,_context:t},t};i.createElement=function(t,e,s){var o,n={},a=null;if(e!=null)for(o in e.key!==void 0&&(a=""+e.key),e)wt.call(e,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(n[o]=e[o]);var m=arguments.length-2;if(m===1)n.children=s;else if(1<m){for(var d=Array(m),c=0;c<m;c++)d[c]=arguments[c+2];n.children=d}if(t&&t.defaultProps)for(o in m=t.defaultProps,m)n[o]===void 0&&(n[o]=m[o]);return lt(t,a,n)};i.createRef=function(){return{current:null}};i.forwardRef=function(t){return{$$typeof:Yt,render:t}};i.isValidElement=pt;i.lazy=function(t){return{$$typeof:kt,_payload:{_status:-1,_result:t},_init:te}};i.memo=function(t,e){return{$$typeof:Jt,type:t,compare:e===void 0?null:e}};i.startTransition=function(t){var e=p.T,s={};p.T=s;try{var o=t(),n=p.S;n!==null&&n(s,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(it,Ht)}catch(a){Ht(a)}finally{e!==null&&s.types!==null&&(e.types=s.types),p.T=e}};i.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()};i.use=function(t){return p.H.use(t)};i.useActionState=function(t,e,s){return p.H.useActionState(t,e,s)};i.useCallback=function(t,e){return p.H.useCallback(t,e)};i.useContext=function(t){return p.H.useContext(t)};i.useDebugValue=function(){};i.useDeferredValue=function(t,e){return p.H.useDeferredValue(t,e)};i.useEffect=function(t,e){return p.H.useEffect(t,e)};i.useEffectEvent=function(t){return p.H.useEffectEvent(t)};i.useId=function(){return p.H.useId()};i.useImperativeHandle=function(t,e,s){return p.H.useImperativeHandle(t,e,s)};i.useInsertionEffect=function(t,e){return p.H.useInsertionEffect(t,e)};i.useLayoutEffect=function(t,e){return p.H.useLayoutEffect(t,e)};i.useMemo=function(t,e){return p.H.useMemo(t,e)};i.useOptimistic=function(t,e){return p.H.useOptimistic(t,e)};i.useReducer=function(t,e,s){return p.H.useReducer(t,e,s)};i.useRef=function(t){return p.H.useRef(t)};i.useState=function(t){return p.H.useState(t)};i.useSyncExternalStore=function(t,e,s){return p.H.useSyncExternalStore(t,e,s)};i.useTransition=function(){return p.H.useTransition()};i.version="19.2.4"});var Dt=gt((de,Pt)=>{"use strict";C();Pt.exports=Mt()});C();C();C();var fe=Bt(Dt(),1);var oe=["achieved","aborted","failed"];function ge(t){return oe.includes(t)}function ne(t,e){return t>=e.hard?"hard":t>=e.auto?"auto":t>=e.warn?"warn":"safe"}function T(t){if(!t||t.length===0)return 0;let e=0,s=0;for(let o=0;o<t.length;o++)t.charCodeAt(o)<128?e++:s++;return Math.ceil(e/4+s*1.5)}function se(t){if(!t||t.trim().length===0)return[];let e=[],s=/--- Context from: (.+?) ---\n([\s\S]*?)--- End of Context from: \1 ---/g,o;for(;(o=s.exec(t))!==null;){let n=o[1],a=o[2];e.push({path:n,tokens:T(a)})}return e.length===0&&t.trim().length>0&&e.push({path:k("memory"),tokens:T(t)}),e}async function re(t,e){let s=t.getModelDisplayName()||"unknown",o=t.getContentGeneratorConfig(),n=o.contextWindowSize??131072,a=nt.getLastPromptTokenCount(),m=nt.getLastCachedContentTokenCount(),d=It(void 0,s),c=T(d),g=t.getToolRegistry(),M=g?g.getAllTools():[],r=g?g.getFunctionDeclarations():[],P=JSON.stringify(r),_=T(P),H=[],x=[];for(let u of M){if(u.shouldDefer&&!u.alwaysLoad&&!g?.isDeferredToolRevealed(u.name))continue;let h=JSON.stringify(u.schema),S=T(h);u instanceof ht?x.push({name:`${u.serverName}__${u.serverToolName||u.name}`,tokens:S}):u.name!==st.SKILL&&H.push({name:u.name,tokens:S})}let l=t.getUserMemory(),y=se(l),$=y.reduce((u,h)=>u+h.tokens,0),E=M.find(u=>u.name===st.SKILL),G=E?T(JSON.stringify(E.schema)):0,Nt=E&&"getLoadedSkillNames"in E?E.getLoadedSkillNames():new Set,dt=t.getSkillManager(),Ut=dt?await dt.listSkills():[],D=0,j=Ut.map(u=>{let h=T(`<skill>
4
- <name>
5
- ${u.name}
6
- </name>
7
- <description>
8
- ${u.description} (${u.level})
9
- </description>
10
- <location>
11
- ${u.level}
12
- </location>
13
- </skill>`),S=Nt.has(u.name),A;if(S&&u.body){let et=u.filePath?u.filePath.replace(/\/[^/]+$/,""):"";A=T(Tt(et,u.body)),D+=A}return{name:u.name,tokens:h,loaded:S,bodyTokens:A}}),yt=G+D,Lt=o.samplingParams?.max_tokens??0,W=St(n-Lt),q=Math.max(0,Math.round(n-W.auto)),N=c+_+$+D,F=a===0,Y=x.reduce((u,h)=>u+h.tokens,0),I,U,K,J,L,z,O,Q,V,X,Z,tt;if(F)I=0,U=c,z=yt,K=Math.max(0,_-G-Y),J=Y,L=$,O=0,Q=Math.max(0,n-N-q),V=H,X=x,Z=y,tt=j;else{I=a;let u=N>I?I/N:1;U=Math.round(c*u);let h=Math.round(_*u);L=Math.round($*u),z=Math.round(yt*u);let S=Math.round(Y*u);J=S;let A=Math.round(G*u);K=Math.max(0,h-A-S);let et=U+h+L+Math.round(D*u);m>0?O=Math.max(0,I-m):O=Math.max(0,I-et),Q=Math.max(0,n-I-q);let ot=b=>u<1?b.map(ft=>({...ft,tokens:Math.round(ft.tokens*u)})):b;V=ot(H),X=ot(x),Z=ot(y),tt=u<1?j.map(b=>({...b,tokens:Math.round(b.tokens*u),bodyTokens:b.bodyTokens?Math.round(b.bodyTokens*u):void 0})):j}let Ot={systemPrompt:U,builtinTools:K,mcpTools:J,memoryFiles:L,skills:z,messages:O,freeSpace:Q,autocompactBuffer:q,thresholds:W,currentTier:ne(F?N:a,W)};return{type:"context_usage",modelName:s,totalTokens:I,contextWindowSize:n,breakdown:Ot,builtinTools:e?V:[],mcpTools:e?X:[],memoryFiles:e?Z:[],skills:e?tt:[],isEstimated:F,showDetails:e}}function ct(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:`${t}`}function f(t,e,s,o=" "){let n=s>0?(e/s*100).toFixed(1):"0.0",a=`${ct(e)} tokens (${n}%)`,m=`${o}${t}`,c=Math.max(1,56-m.length-a.length);return`${m}${" ".repeat(c)}${a}`}function w(t){return Math.round(t).toLocaleString("en-US")}function ie(t){let{modelName:e,totalTokens:s,contextWindowSize:o,breakdown:n,builtinTools:a,mcpTools:m,memoryFiles:d,skills:c,isEstimated:g,showDetails:M}=t,r=[];if(r.push("## Context Usage"),r.push(""),g?(r.push("*No API response yet. Send a message to see actual usage.*"),r.push(""),r.push("**Estimated pre-conversation overhead**"),r.push(`Model: ${e} Context window: ${ct(o)} tokens`),r.push("")):(r.push(`Model: ${e} Context window: ${ct(o)} tokens`),r.push(""),r.push(f("Used",s,o)),r.push(f("Free",n.freeSpace,o)),r.push(""),r.push("**Compaction thresholds**"),r.push(` Effective window: ${w(n.thresholds.effectiveWindow)} (window \u2212 ${w(o-n.thresholds.effectiveWindow)} reserve)`),r.push(` Warn threshold: ${w(n.thresholds.warn)}`),r.push(` Auto threshold: ${w(n.thresholds.auto)}`),r.push(` Hard threshold: ${w(n.thresholds.hard)}`),r.push(` Current tier: ${n.currentTier}`),r.push(""),r.push("**Usage by category**")),r.push(f("System prompt",n.systemPrompt,o)),r.push(f("Built-in tools",n.builtinTools,o)),n.mcpTools>0&&r.push(f("MCP tools",n.mcpTools,o)),r.push(f("Memory files",n.memoryFiles,o)),r.push(f("Skills",n.skills,o)),g||r.push(f("Messages",n.messages,o)),M){let P=[...a].sort((l,y)=>y.tokens-l.tokens),_=[...m].sort((l,y)=>y.tokens-l.tokens),H=[...d].sort((l,y)=>y.tokens-l.tokens),x=[...c].sort((l,y)=>l.loaded!==y.loaded?l.loaded?-1:1:y.tokens+(y.bodyTokens??0)-(l.tokens+(l.bodyTokens??0)));if(P.length>0){r.push(""),r.push("**Built-in tools**");for(let l of P)r.push(f(l.name,l.tokens,o," \u2514 "))}if(_.length>0){r.push(""),r.push("**MCP tools**");for(let l of _)r.push(f(l.name,l.tokens,o," \u2514 "))}if(H.length>0){r.push(""),r.push("**Memory files**");for(let l of H)r.push(f(l.path,l.tokens,o," \u2514 "))}if(x.length>0){r.push(""),r.push("**Skills**");for(let l of x){let y=l.loaded?`${l.name} (active)`:l.name;r.push(f(y,l.tokens,o," \u2514 ")),l.loaded&&l.bodyTokens&&l.bodyTokens>0&&r.push(f("body loaded",l.bodyTokens,o," \u2514 "))}}}else r.push(""),r.push("*Run /context detail for per-item breakdown.*");return r.join(`
14
- `)}var ae={name:"context",get description(){return k('Show context window usage breakdown. Use "/context detail" for per-item breakdown.')},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:async(t,e)=>{let s=e?.trim().toLowerCase(),o=s==="detail"||s==="-d",n=t.executionMode??"interactive",{config:a}=t.services;if(!a){if(n==="interactive"){t.ui.addItem({type:"error",text:k("Config not loaded.")},Date.now());return}return{type:"message",messageType:"error",content:k("Config not loaded.")}}let m=await re(a,o);if(n==="interactive"){t.ui.addItem(m,Date.now());return}return{type:"message",messageType:"info",content:ie(m)}},subCommands:[{name:"detail",get description(){return k("Show per-item context usage breakdown.")},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:async t=>{await ae.action(t,"detail")}}]};export{Dt as a,ge as b,re as c,ie as d,ae as e};
15
- /**
16
- * @license
17
- * Copyright 2025 Google LLC
18
- * SPDX-License-Identifier: Apache-2.0
19
- */
20
- /**
21
- * @license
22
- * Copyright 2025 Matilda
23
- * SPDX-License-Identifier: Apache-2.0
24
- */
25
- /*! Bundled license information:
26
-
27
- react/cjs/react.production.js:
28
- (**
29
- * @license React
30
- * react.production.js
31
- *
32
- * Copyright (c) Meta Platforms, Inc. and affiliates.
33
- *
34
- * This source code is licensed under the MIT license found in the
35
- * LICENSE file in the root directory of this source tree.
36
- *)
37
- */