@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
@@ -0,0 +1,8 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{b as E}from"./chunk-7ZATDBWL.js";import{Ba as P}from"./chunk-NBLBE7PE.js";import"./chunk-MGRXOZAG.js";import"./chunk-ZSGBDQXU.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-5ETLURI6.js";import"./chunk-G3F3ZCH2.js";import"./chunk-V4VILMIK.js";import"./chunk-6NXVLJ3X.js";import"./chunk-4UGPARBR.js";import"./chunk-7B65UIHB.js";import"./chunk-QXSBPCBA.js";import"./chunk-LMZBADPW.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-453BANK3.js";import"./chunk-PQZ6HKKW.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-V2VUANFI.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import"./chunk-ARAB5QTM.js";import"./chunk-ILHNCXBC.js";import"./chunk-LM6OIN4B.js";import"./chunk-RPXRN7E6.js";import"./chunk-RHSUTILA.js";import"./chunk-J3ZCE3TA.js";import"./chunk-POGNX7U3.js";import{L as l,V as c}from"./chunk-7E2YCGHS.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import{b as s}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";s();import{stat as V}from"node:fs/promises";import{join as p}from"node:path";s();import{readdir as N,stat as H,rm as F,rmdir as A}from"node:fs/promises";import{join as y}from"node:path";var k=c("HOUSEKEEPING"),U=24*60*60*1e3,$=60*60*1e3,_=20;function T(e){let t=e>0?e*U:$;return new Date(Date.now()-t)}async function b(e){let t={removed:0,errors:0},r=y(l.getGlobalMatildaDir(),P),i=e.excludeSessionIds??new Set,o;try{o=await N(r,{withFileTypes:!0})}catch(n){return G(n)||k.error("readdir failed",n),t}let a=o.filter(n=>n.isDirectory()&&!i.has(n.name)).map(n=>y(r,n.name));for(let n=0;n<a.length;n+=_){let v=a.slice(n,n+_);await Promise.all(v.map(async g=>{try{(await H(g)).mtime<e.cutoffDate&&(await F(g,{recursive:!0,force:!0}),t.removed++)}catch(w){t.errors++,k.error(`failed to sweep ${g}`,w)}}))}return await A(r).catch(()=>{}),t}function G(e){return e?.code==="ENOENT"}s();import{mkdir as Y,open as K,stat as I,unlink as D,writeFile as j}from"node:fs/promises";import{dirname as B}from"node:path";var m=c("HOUSEKEEPING"),q=24*60*60*1e3,J=60*60*1e3;async function R(e,t){let r=e.minIntervalMs??q,i=e.staleLockMs??J;if(await Y(B(e.lockPath),{recursive:!0,mode:448}).catch(()=>{}),await C(e.markerPath,r,e.name))return!1;let o=await h(e.lockPath);if(!o){try{let a=await I(e.lockPath);Date.now()-a.mtimeMs>i&&(await D(e.lockPath).catch(()=>{}),o=await h(e.lockPath))}catch{o=await h(e.lockPath)}if(!o)return m.debug(`${e.name}: skipping, lock held`),!1}try{if(await C(e.markerPath,r,e.name))return!1;let a=!1;try{await t(),a=!0}finally{if(a)try{await j(e.markerPath,new Date().toISOString())}catch(n){m.debug(`${e.name}: marker write failed (cleanup succeeded)`,n)}}return a}finally{await D(e.lockPath).catch(()=>{m.debug(`${e.name}: lock unlink failed (harmless)`)})}}async function C(e,t,r){try{let i=await I(e),o=Date.now()-i.mtimeMs;if(o<t)return m.debug(`${r}: skipping, ran ${o}ms ago`),!0}catch{}return!1}async function h(e){try{return await(await K(e,"wx")).close(),!0}catch(t){if(t?.code==="EEXIST")return!1;throw t}}var u=c("HOUSEKEEPING"),O=10*60*1e3,W=24*60*60*1e3,X=60*1e3,z=7*24*60*60*1e3,Q=60*1e3,f=".file-history-cleanup",d=!1;function pe(e,t){d||(d=!0,Z(e,t).catch(r=>{d=!1,u.error("scheduleFirstPass failed; chain will retry on next start",r)}))}async function Z(e,t){let r=p(l.getGlobalMatildaDir(),f),i=await L(r)?Q:O;u.debug(`first pass in ${i/1e3}s`),setTimeout(()=>S(e,t),i).unref()}async function L(e){try{let t=await V(e);return Date.now()-t.mtimeMs>z}catch{return!0}}async function M(e,t){if(E()<X){u.debug("user active, deferring 10 min"),setTimeout(()=>S(e,t),O).unref();return}try{await x(e,t)}catch(r){u.error("housekeeping pass failed; will retry next cycle",r)}setTimeout(()=>S(e,t),W).unref()}function S(e,t){M(e,t).catch(r=>{u.error("runPass rejected unexpectedly",r)})}async function x(e,t){let r=t.merged.general?.cleanupPeriodDays??30,i=T(r),o=e.getSessionId(),a=l.getGlobalMatildaDir();await R({name:"file-history-cleanup",markerPath:p(a,f),lockPath:p(a,f+".lock")},async()=>{let n=await b({cutoffDate:i,excludeSessionIds:new Set([o])});u.debug(`file-history: removed=${n.removed} errors=${n.errors}`)})}function Se(){d=!1}var we=L,Pe=x,Ee=M,ye=f;export{ye as _FILE_HISTORY_MARKER_FOR_TESTING,we as _needsCatchUpForTesting,Se as _resetForTesting,Pe as _runHousekeepingForTesting,Ee as _runPassForTesting,pe as startBackgroundHousekeeping};
4
+ /**
5
+ * @license
6
+ * Copyright 2025 Google LLC
7
+ * SPDX-License-Identifier: Apache-2.0
8
+ */
@@ -0,0 +1,8 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{b as n,e as h,g as i}from"./chunk-QXSBPCBA.js";import{f as g,g as p,m as c,n as l}from"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as d}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";d();var m=class extends g{constructor(s,a){super(a);this.config=s}getDescription(){if(this.params.task_id)return`Send message to task ${this.params.task_id}`;let s=this.params.summary??this.params.message.slice(0,50);return`Send to ${this.params.to}: ${s}`}async getDefaultPermission(){return"ask"}async execute(s){if(this.params.task_id){let e=this.config.getBackgroundTaskRegistry(),t=e.get(this.params.task_id);return t?t.status==="paused"?await this.config.resumeBackgroundAgent(this.params.task_id,this.params.message)?{llmContent:`Background task "${this.params.task_id}" resumed with your message as the first continuation instruction.`,returnDisplay:`Resumed ${t.description}`}:{llmContent:`Error: Background task "${this.params.task_id}" could not be resumed.`,returnDisplay:"Task could not be resumed.",error:{message:`Task could not be resumed: ${this.params.task_id}`,type:"send_message_not_running"}}:t.status!=="running"?{llmContent:`Error: Background task "${this.params.task_id}" is not running (status: ${t.status}). Cannot send messages to stopped tasks.`,returnDisplay:`Task not running (${t.status}).`,error:{message:`Task is ${t.status}: ${this.params.task_id}`,type:"send_message_not_running"}}:(e.queueMessage(this.params.task_id,this.params.message),{llmContent:`Message queued for delivery to background task "${this.params.task_id}". The task will receive it at the next tool-round boundary.`,returnDisplay:`Message queued for ${t.description}`}):{llmContent:`Error: No background task found with ID "${this.params.task_id}".`,returnDisplay:"Task not found.",error:{message:`Task not found: ${this.params.task_id}`,type:"send_message_not_found"}}}let a=this.config.getTeamManager();if(!a){let e="No active team and no task_id provided. Either create a team first, or pass `task_id` to message a background task.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let o=this.params.to;if(!o){let e='Recipient "to" is required.';return{llmContent:e,returnDisplay:e,error:{message:e}}}try{if(this.params.type==="shutdown_request"){if(h()){let r="Only the team leader can request shutdowns.";return{llmContent:r,returnDisplay:r,error:{message:r}}}await a.requestShutdown(o);let t=`Shutdown requested for "${o}".`;return{llmContent:t,returnDisplay:t}}if(o==="*"){let t=n()??i;await a.broadcast(this.params.message,t);let r="Message broadcast to all teammates.";return{llmContent:r,returnDisplay:r}}await a.sendMessage(o,this.params.message,n()??i,this.params.summary);let e=`Message sent to "${o}".`;return{llmContent:e,returnDisplay:e}}catch(e){let t=e instanceof Error?e.message:String(e);return{llmContent:`Failed to send message: ${t}`,returnDisplay:`Failed to send message: ${t}`,error:{message:t}}}}},k=class u extends p{constructor(s){super(u.Name,l.SEND_MESSAGE,'Send a message to a teammate (use "to") or to a running background task (use "task_id"). For teams, set "to" to a bare teammate name (no @) or "*" to broadcast. For background tasks, set "task_id" to the id from the launch response or a recovered paused task. Running tasks receive it at the next tool-round boundary; paused recovered tasks are resumed with the message as their first continuation instruction. Your text output is NOT visible to other agents \u2014 use this tool to communicate.',"other",{type:"object",properties:{to:{type:"string",description:'Recipient teammate name, or "*" for broadcast.'},task_id:{type:"string",description:"The ID of the background task (from the launch response or a recovered paused task)."},message:{type:"string",description:"Message text to send.",maxLength:65536},summary:{type:"string",description:"Optional 5-10 word summary for UI display."},type:{type:"string",enum:["shutdown_request"],description:"Structured message type for control flow. When set, routes through the mailbox instead of plain text delivery."}},required:["message"],oneOf:[{required:["to"]},{required:["task_id"]}],additionalProperties:!1},!0,!1,!0,!1,"send message task teammate team communicate notify");this.config=s}static Name=c.SEND_MESSAGE;createInvocation(s){return new m(this.config,s)}toAutoClassifierInput(s){return{to:s.to,task_id:s.task_id,message:s.message,type:s.type}}};export{k as SendMessageTool};
4
+ /**
5
+ * @license
6
+ * Copyright 2025 Matilda
7
+ * SPDX-License-Identifier: Apache-2.0
8
+ */
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{ic as a,jc as b,kc as c,lc as d,mc as e,nc as f,oc as g}from"./chunk-NBLBE7PE.js";import"./chunk-MGRXOZAG.js";import"./chunk-ZSGBDQXU.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-5ETLURI6.js";import"./chunk-G3F3ZCH2.js";import"./chunk-V4VILMIK.js";import"./chunk-6NXVLJ3X.js";import"./chunk-4UGPARBR.js";import"./chunk-7B65UIHB.js";import"./chunk-QXSBPCBA.js";import"./chunk-LMZBADPW.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-453BANK3.js";import"./chunk-PQZ6HKKW.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-V2VUANFI.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import"./chunk-ARAB5QTM.js";import"./chunk-ILHNCXBC.js";import"./chunk-LM6OIN4B.js";import"./chunk-RPXRN7E6.js";import"./chunk-RHSUTILA.js";import"./chunk-J3ZCE3TA.js";import"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as OUTPUT_UPDATE_INTERVAL_MS,g as ShellTool,f as ShellToolInvocation,c as buildLongRunningForegroundHint,d as detectBlockedSleepPattern,a as parseNumstat,e as repairLeakedShellToolArgMarkup};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as p,b as C,d as E,e as I}from"./chunk-EZDV7A76.js";import"./chunk-V6UPUMP3.js";import"./chunk-DE3HKC2W.js";import"./chunk-SOEIVSM5.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-3YLXGE6T.js";import"./chunk-JCE3JAVC.js";import"./chunk-SVSY6AWS.js";import"./chunk-AOOZREGV.js";import"./chunk-SDTWBD62.js";import{nc as o,rd as a}from"./chunk-DHDD5YJC.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-5OHGYMKP.js";import{g as S,i as v,p as y,q as b}from"./chunk-TWJLOEAI.js";import{ba as f}from"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();import L from"path";var r=f("SKILL"),$=`Execute a skill within the main conversation
3
+ import{a as p,b as C,d as E,e as I}from"./chunk-LMZBADPW.js";import"./chunk-V6UPUMP3.js";import"./chunk-V2VUANFI.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import{Pb as a,Xa as o}from"./chunk-ARAB5QTM.js";import"./chunk-ILHNCXBC.js";import"./chunk-LM6OIN4B.js";import"./chunk-RHSUTILA.js";import"./chunk-J3ZCE3TA.js";import{f as S,g as v,m as y,n as b}from"./chunk-POGNX7U3.js";import{V as f}from"./chunk-7E2YCGHS.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();import L from"path";var r=f("SKILL"),$=`Execute a skill within the main conversation
4
4
 
5
5
  <skills_instructions>
6
6
  When users ask you to perform tasks, check if any of the available skills can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
@@ -0,0 +1,5 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{a as q,b as ze,c as Ne,d as z,e as fe,f as ce,g as De,h as Me,i as We,j as Ve,k as Ge}from"./chunk-TUKNB5CQ.js";import{b as l}from"./chunk-GZPNIYVZ.js";import{c as g}from"./chunk-OWGSC52X.js";function Ke(r){if(!/^data:/i.test(r))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');r=r.replace(/\r?\n/g,"");let e=r.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let t=r.substring(5,e).split(";"),n="",o=!1,s=t[0]||"text/plain",i=s;for(let x=1;x<t.length;x++)t[x]==="base64"?o=!0:t[x]&&(i+=`;${t[x]}`,t[x].indexOf("charset=")===0&&(n=t[x].substring(8)));!t[0]&&!n.length&&(i+=";charset=US-ASCII",n="US-ASCII");let c=o?"base64":"ascii",u=unescape(r.substring(e+1)),a=Buffer.from(u,c);return a.type=s,a.typeFull=i,a.charset=n,a}var le,ue=g(()=>{l();le=Ke});var v,W=g(()=>{l();v=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var m,ee=g(()=>{l();W();m=class extends v{constructor(e,t,n){super(e,t),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var V,re,N,he,de,pe,G=g(()=>{l();V=Symbol.toStringTag,re=r=>typeof r=="object"&&typeof r.append=="function"&&typeof r.delete=="function"&&typeof r.get=="function"&&typeof r.getAll=="function"&&typeof r.has=="function"&&typeof r.set=="function"&&typeof r.sort=="function"&&r[V]==="URLSearchParams",N=r=>r&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&typeof r.constructor=="function"&&/^(Blob|File)$/.test(r[V]),he=r=>typeof r=="object"&&(r[V]==="AbortSignal"||r[V]==="EventTarget"),de=(r,e)=>{let t=new URL(e).hostname,n=new URL(r).hostname;return t===n||t.endsWith(`.${n}`)},pe=(r,e)=>{let t=new URL(e).protocol,n=new URL(r).protocol;return t===n}});import B,{PassThrough as me}from"node:stream";import{types as ye,deprecate as oe,promisify as Ye}from"node:util";import{Buffer as S}from"node:buffer";async function te(r){if(r[y].disturbed)throw new TypeError(`body used already for: ${r.url}`);if(r[y].disturbed=!0,r[y].error)throw r[y].error;let{body:e}=r;if(e===null)return S.alloc(0);if(!(e instanceof B))return S.alloc(0);let t=[],n=0;try{for await(let o of e){if(r.size>0&&n+o.length>r.size){let s=new m(`content size at ${r.url} over limit: ${r.size}`,"max-size");throw e.destroy(s),s}n+=o.length,t.push(o)}}catch(o){throw o instanceof v?o:new m(`Invalid response body while trying to fetch ${r.url}: ${o.message}`,"system",o)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return t.every(o=>typeof o=="string")?S.from(t.join("")):S.concat(t,n)}catch(o){throw new m(`Could not create Buffer from response body for ${r.url}: ${o.message}`,"system",o)}else throw new m(`Premature close of server response while trying to fetch ${r.url}`)}var Je,y,P,k,_e,K,ge,we,Y=g(()=>{l();ze();ce();ee();W();G();Je=Ye(B.pipeline),y=Symbol("Body internals"),P=class{constructor(e,{size:t=0}={}){let n=null;e===null?e=null:re(e)?e=S.from(e.toString()):N(e)||S.isBuffer(e)||(ye.isAnyArrayBuffer(e)?e=S.from(e):ArrayBuffer.isView(e)?e=S.from(e.buffer,e.byteOffset,e.byteLength):e instanceof B||(e instanceof z?(e=fe(e),n=e.type.split("=")[1]):e=S.from(String(e))));let o=e;S.isBuffer(e)?o=B.Readable.from(e):N(e)&&(o=B.Readable.from(e.stream())),this[y]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=t,e instanceof B&&e.on("error",s=>{let i=s instanceof v?s:new m(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[y].error=i})}get body(){return this[y].stream}get bodyUsed(){return this[y].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:n}=await te(this);return e.slice(t,t+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new z,o=new URLSearchParams(await this.text());for(let[s,i]of o)n.append(s,i);return n}let{toFormData:t}=await import("./multipart-parser-FKHYAVGR.js");return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[y].body&&this[y].body.type||"",t=await this.arrayBuffer();return new q([t],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await te(this);return new TextDecoder().decode(e)}buffer(){return te(this)}};P.prototype.buffer=oe(P.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(P.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:oe(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});k=(r,e)=>{let t,n,{body:o}=r[y];if(r.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof B&&typeof o.getBoundary!="function"&&(t=new me({highWaterMark:e}),n=new me({highWaterMark:e}),o.pipe(t),o.pipe(n),r[y].stream=t,o=n),o},_e=oe(r=>r.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),K=(r,e)=>r===null?null:typeof r=="string"?"text/plain;charset=UTF-8":re(r)?"application/x-www-form-urlencoded;charset=UTF-8":N(r)?r.type||null:S.isBuffer(r)||ye.isAnyArrayBuffer(r)||ArrayBuffer.isView(r)?null:r instanceof z?`multipart/form-data; boundary=${e[y].boundary}`:r&&typeof r.getBoundary=="function"?`multipart/form-data;boundary=${_e(r)}`:r instanceof B?null:"text/plain;charset=UTF-8",ge=r=>{let{body:e}=r[y];return e===null?0:N(e)?e.size:S.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},we=async(r,{body:e})=>{e===null?r.end():await Je(e,r)}});import{types as be}from"node:util";import _ from"node:http";function Se(r=[]){return new w(r.reduce((e,t,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,t])=>{try{return J(e),ne(e,String(t)),!0}catch{return!1}}))}var J,ne,w,Z=g(()=>{l();J=typeof _.validateHeaderName=="function"?_.validateHeaderName:r=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(r)){let e=new TypeError(`Header name must be a valid HTTP token [${r}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},ne=typeof _.validateHeaderValue=="function"?_.validateHeaderValue:(r,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let t=new TypeError(`Invalid character in header content ["${r}"]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_CHAR"}),t}},w=class r extends URLSearchParams{constructor(e){let t=[];if(e instanceof r){let n=e.raw();for(let[o,s]of Object.entries(n))t.push(...s.map(i=>[o,i]))}else if(e!=null)if(typeof e=="object"&&!be.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)t.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");t=[...e].map(o=>{if(typeof o!="object"||be.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return t=t.length>0?t.map(([n,o])=>(J(n),ne(n,String(o)),[String(n).toLowerCase(),String(o)])):void 0,super(t),new Proxy(this,{get(n,o,s){switch(o){case"append":case"set":return(i,c)=>(J(i),ne(i,String(c)),URLSearchParams.prototype[o].call(n,String(i).toLowerCase(),String(c)));case"delete":case"has":case"getAll":return i=>(J(i),URLSearchParams.prototype[o].call(n,String(i).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,o,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(t.length===0)return null;let n=t.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,t=void 0){for(let n of this.keys())Reflect.apply(e,t,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,t)=>(e[t]=this.getAll(t),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,t)=>{let n=this.getAll(t);return t==="host"?e[t]=n[0]:e[t]=n.length>1?n:n[0],e},{})}};Object.defineProperties(w.prototype,["get","entries","forEach","values"].reduce((r,e)=>(r[e]={enumerable:!0},r),{}))});var Ze,Q,se=g(()=>{l();Ze=new Set([301,302,303,307,308]),Q=r=>Ze.has(r)});var R,T,Te=g(()=>{l();Z();Y();se();R=Symbol("Response internals"),T=class r extends P{constructor(e=null,t={}){super(e,t);let n=t.status!=null?t.status:200,o=new w(t.headers);if(e!==null&&!o.has("Content-Type")){let s=K(e,this);s&&o.append("Content-Type",s)}this[R]={type:"default",url:t.url,status:n,statusText:t.statusText||"",headers:o,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[R].type}get url(){return this[R].url||""}get status(){return this[R].status}get ok(){return this[R].status>=200&&this[R].status<300}get redirected(){return this[R].counter>0}get statusText(){return this[R].statusText}get headers(){return this[R].headers}get highWaterMark(){return this[R].highWaterMark}clone(){return new r(k(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!Q(t))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new r(null,{headers:{location:new URL(e).toString()},status:t})}static error(){let e=new r(null,{status:0,statusText:""});return e[R].type="error",e}static json(e=void 0,t={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let o=new w(t&&t.headers);return o.has("content-type")||o.set("content-type","application/json"),new r(n,{...t,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(T.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Re,xe=g(()=>{l();Re=r=>{if(r.search)return r.search;let e=r.href.length-1,t=r.hash||(r.href[e]==="#"?"#":"");return r.href[e-t.length]==="?"?"?":""}});import{isIP as Qe}from"node:net";function Ee(r,e=!1){return r==null||(r=new URL(r),/^(about|blob|data):$/.test(r.protocol))?"no-referrer":(r.username="",r.password="",r.hash="",e&&(r.pathname="",r.search=""),r)}function Ue(r){if(!Pe.has(r))throw new TypeError(`Invalid referrerPolicy: ${r}`);return r}function Xe(r){if(/^(http|ws)s:$/.test(r.protocol))return!0;let e=r.host.replace(/(^\[)|(]$)/g,""),t=Qe(e);return t===4&&/^127\./.test(e)||t===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:r.host==="localhost"||r.host.endsWith(".localhost")?!1:r.protocol==="file:"}function O(r){return/^about:(blank|srcdoc)$/.test(r)||r.protocol==="data:"||/^(blob|filesystem):$/.test(r.protocol)?!0:Xe(r)}function ve(r,{referrerURLCallback:e,referrerOriginCallback:t}={}){if(r.referrer==="no-referrer"||r.referrerPolicy==="")return null;let n=r.referrerPolicy;if(r.referrer==="about:client")return"no-referrer";let o=r.referrer,s=Ee(o),i=Ee(o,!0);s.toString().length>4096&&(s=i),e&&(s=e(s)),t&&(i=t(i));let c=new URL(r.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return i;case"unsafe-url":return s;case"strict-origin":return O(s)&&!O(c)?"no-referrer":i.toString();case"strict-origin-when-cross-origin":return s.origin===c.origin?s:O(s)&&!O(c)?"no-referrer":i;case"same-origin":return s.origin===c.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===c.origin?s:i;case"no-referrer-when-downgrade":return O(s)&&!O(c)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function Be(r){let e=(r.get("referrer-policy")||"").split(/[,\s]+/),t="";for(let n of e)n&&Pe.has(n)&&(t=n);return t}var Pe,Le,ie=g(()=>{l();Pe=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Le="strict-origin-when-cross-origin"});import{format as je}from"node:url";import{deprecate as qe}from"node:util";var h,D,er,$,Ae,Ce=g(()=>{l();Z();Y();G();xe();ie();h=Symbol("Request internals"),D=r=>typeof r=="object"&&typeof r[h]=="object",er=qe(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),$=class r extends P{constructor(e,t={}){let n;if(D(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let o=t.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!D(t)&&"data"in t&&er(),(t.body!=null||D(e)&&e.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=t.body?t.body:D(e)&&e.body!==null?k(e):null;super(s,{size:t.size||e.size||0});let i=new w(t.headers||e.headers||{});if(s!==null&&!i.has("Content-Type")){let a=K(s,this);a&&i.set("Content-Type",a)}let c=D(e)?e.signal:null;if("signal"in t&&(c=t.signal),c!=null&&!he(c))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let u=t.referrer==null?e.referrer:t.referrer;if(u==="")u="no-referrer";else if(u){let a=new URL(u);u=/^about:(\/\/)?client$/.test(a)?"client":a}else u=void 0;this[h]={method:o,redirect:t.redirect||e.redirect||"follow",headers:i,parsedURL:n,signal:c,referrer:u},this.follow=t.follow===void 0?e.follow===void 0?20:e.follow:t.follow,this.compress=t.compress===void 0?e.compress===void 0?!0:e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||""}get method(){return this[h].method}get url(){return je(this[h].parsedURL)}get headers(){return this[h].headers}get redirect(){return this[h].redirect}get signal(){return this[h].signal}get referrer(){if(this[h].referrer==="no-referrer")return"";if(this[h].referrer==="client")return"about:client";if(this[h].referrer)return this[h].referrer.toString()}get referrerPolicy(){return this[h].referrerPolicy}set referrerPolicy(e){this[h].referrerPolicy=Ue(e)}clone(){return new r(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties($.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});Ae=r=>{let{parsedURL:e}=r[h],t=new w(r[h].headers);t.has("Accept")||t.set("Accept","*/*");let n=null;if(r.body===null&&/^(post|put)$/i.test(r.method)&&(n="0"),r.body!==null){let c=ge(r);typeof c=="number"&&!Number.isNaN(c)&&(n=String(c))}n&&t.set("Content-Length",n),r.referrerPolicy===""&&(r.referrerPolicy=Le),r.referrer&&r.referrer!=="no-referrer"?r[h].referrer=ve(r):r[h].referrer="no-referrer",r[h].referrer instanceof URL&&t.set("Referer",r.referrer),t.has("User-Agent")||t.set("User-Agent","node-fetch"),r.compress&&!t.has("Accept-Encoding")&&t.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=r;typeof o=="function"&&(o=o(e));let s=Re(e),i={path:e.pathname+s,method:r.method,headers:t[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:r.insecureHTTPParser,agent:o};return{parsedURL:e,options:i}}});var X,$e=g(()=>{l();W();X=class extends v{constructor(e,t="aborted"){super(e,t)}}});import rr from"node:http";import tr from"node:https";import H from"node:zlib";import Fe,{PassThrough as ke,pipeline as I}from"node:stream";import{Buffer as j}from"node:buffer";async function Oe(r,e){return new Promise((t,n)=>{let o=new $(r,e),{parsedURL:s,options:i}=Ae(o);if(!or.has(s.protocol))throw new TypeError(`node-fetch cannot load ${r}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let f=le(o.url),L=new T(f,{headers:{"Content-Type":f.typeFull}});t(L);return}let c=(s.protocol==="https:"?tr:rr).request,{signal:u}=o,a=null,x=()=>{let f=new X("The operation was aborted.");n(f),o.body&&o.body instanceof Fe.Readable&&o.body.destroy(f),!(!a||!a.body)&&a.body.emit("error",f)};if(u&&u.aborted){x();return}let M=()=>{x(),C()},A=c(s.toString(),i);u&&u.addEventListener("abort",M);let C=()=>{A.abort(),u&&u.removeEventListener("abort",M)};A.on("error",f=>{n(new m(`request to ${o.url} failed, reason: ${f.message}`,"system",f)),C()}),nr(A,f=>{a&&a.body&&a.body.destroy(f)}),process.version<"v14"&&A.on("socket",f=>{let L;f.prependListener("end",()=>{L=f._eventsCount}),f.prependListener("close",d=>{if(a&&L<f._eventsCount&&!d){let U=new Error("Premature close");U.code="ERR_STREAM_PREMATURE_CLOSE",a.body.emit("error",U)}})}),A.on("response",f=>{A.setTimeout(0);let L=Se(f.rawHeaders);if(Q(f.statusCode)){let p=L.get("Location"),E=null;try{E=p===null?null:new URL(p,o.url)}catch{if(o.redirect!=="manual"){n(new m(`uri requested responds with an invalid redirect URL: ${p}`,"invalid-redirect")),C();return}}switch(o.redirect){case"error":n(new m(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),C();return;case"manual":break;case"follow":{if(E===null)break;if(o.counter>=o.follow){n(new m(`maximum redirect reached at: ${o.url}`,"max-redirect")),C();return}let b={headers:new w(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:k(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!de(o.url,E)||!pe(o.url,E))for(let Ie of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(Ie);if(f.statusCode!==303&&o.body&&e.body instanceof Fe.Readable){n(new m("Cannot follow redirect with body being a readable stream","unsupported-redirect")),C();return}(f.statusCode===303||(f.statusCode===301||f.statusCode===302)&&o.method==="POST")&&(b.method="GET",b.body=void 0,b.headers.delete("content-length"));let ae=Be(L);ae&&(b.referrerPolicy=ae),t(Oe(new $(E,b))),C();return}default:return n(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}u&&f.once("end",()=>{u.removeEventListener("abort",M)});let d=I(f,new ke,p=>{p&&n(p)});process.version<"v12.10"&&f.on("aborted",M);let U={url:o.url,status:f.statusCode,statusText:f.statusMessage,headers:L,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},F=L.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||F===null||f.statusCode===204||f.statusCode===304){a=new T(d,U),t(a);return}let He={flush:H.Z_SYNC_FLUSH,finishFlush:H.Z_SYNC_FLUSH};if(F==="gzip"||F==="x-gzip"){d=I(d,H.createGunzip(He),p=>{p&&n(p)}),a=new T(d,U),t(a);return}if(F==="deflate"||F==="x-deflate"){let p=I(f,new ke,E=>{E&&n(E)});p.once("data",E=>{(E[0]&15)===8?d=I(d,H.createInflate(),b=>{b&&n(b)}):d=I(d,H.createInflateRaw(),b=>{b&&n(b)}),a=new T(d,U),t(a)}),p.once("end",()=>{a||(a=new T(d,U),t(a))});return}if(F==="br"){d=I(d,H.createBrotliDecompress(),p=>{p&&n(p)}),a=new T(d,U),t(a);return}a=new T(d,U),t(a)}),we(A,o).catch(n)})}function nr(r,e){let t=j.from(`0\r
4
+ \r
5
+ `),n=!1,o=!1,s;r.on("response",i=>{let{headers:c}=i;n=c["transfer-encoding"]==="chunked"&&!c["content-length"]}),r.on("socket",i=>{let c=()=>{if(n&&!o){let a=new Error("Premature close");a.code="ERR_STREAM_PREMATURE_CLOSE",e(a)}},u=a=>{o=j.compare(a.slice(-5),t)===0,!o&&s&&(o=j.compare(s.slice(-3),t.slice(0,3))===0&&j.compare(a.slice(-2),t.slice(3))===0),s=a};i.prependListener("close",c),i.on("data",u),r.on("close",()=>{i.removeListener("close",c),i.removeListener("data",u)})})}var or,sr=g(()=>{l();ue();Y();Te();Z();Ce();ee();$e();se();ce();G();ie();Ge();or=new Set(["data:","http:","https:"])});sr();export{X as AbortError,q as Blob,m as FetchError,Ne as File,z as FormData,w as Headers,$ as Request,T as Response,Me as blobFrom,De as blobFromSync,Oe as default,We as fileFrom,Ve as fileFromSync,Q as isRedirect};
@@ -0,0 +1,19 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{c as w,d as A}from"./chunk-ZSGBDQXU.js";import{f as h,g as x,m as d,n as S}from"./chunk-POGNX7U3.js";import{V as g}from"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();import C from"node:path";u();import k from"node:fs/promises";import f from"node:path";u();var D={".ts":"typescript",".tsx":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".go":"go",".rs":"rust",".java":"java"},T={typescript:[{kind:"interface",re:/^\s*(?:export\s+)?interface\s+([A-Za-z_$][\w$]*)/},{kind:"type",re:/^\s*(?:export\s+)?type\s+([A-Za-z_$][\w$]*)\s*=/},{kind:"enum",re:/^\s*(?:export\s+)?enum\s+([A-Za-z_$][\w$]*)/},{kind:"class",re:/^\s*(?:export\s+)?(?:abstract\s+)?class\s+([A-Za-z_$][\w$]*)/},{kind:"function",re:/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/},{kind:"const",re:/^\s*(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\(|function\b)/},{kind:"method",re:/^\s+(?:public|private|protected|async|static|readonly|\s)*([A-Za-z_$][\w$]*)\s*\([^;]*\)\s*[:{]/}],javascript:[{kind:"class",re:/^\s*(?:export\s+)?class\s+([A-Za-z_$][\w$]*)/},{kind:"function",re:/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/},{kind:"const",re:/^\s*(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\(|function\b)/}],python:[{kind:"class",re:/^\s*class\s+([A-Za-z_][\w]*)\s*[(:]/},{kind:"function",re:/^\s*(?:async\s+)?def\s+([A-Za-z_][\w]*)\s*\(/}],go:[{kind:"function",re:/^func\s+(?:\([^)]+\)\s+)?([A-Za-z_][\w]*)\s*\(/},{kind:"type",re:/^type\s+([A-Za-z_][\w]*)\s+(?:struct|interface|func|=)/}],rust:[{kind:"function",re:/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+([A-Za-z_][\w]*)/},{kind:"class",re:/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:struct|enum|trait)\s+([A-Za-z_][\w]*)/}],java:[{kind:"class",re:/^\s*(?:public|private|protected)?\s*(?:abstract|final)?\s*class\s+([A-Za-z_][\w]*)/},{kind:"interface",re:/^\s*(?:public|private|protected)?\s*interface\s+([A-Za-z_][\w]*)/},{kind:"method",re:/^\s+(?:public|private|protected)\s+(?:static\s+)?[\w<>,\s[\]]+\s+([A-Za-z_][\w]*)\s*\(/}]};function y(m){let i=m.toLowerCase(),t=i.lastIndexOf(".");if(!(t<0))return D[i.slice(t)]}function _(m,i){let t=y(m);if(!t)return[];let o=T[t];if(!o)return[];let a=[],r=i.split(/\r?\n/);for(let e=0;e<r.length;e++){let s=r[e];for(let{kind:c,re:n}of o){let l=n.exec(s);if(l?.[1]&&!(l[1]==="if"||l[1]==="for"||l[1]==="while"||l[1]==="switch")){a.push({name:l[1],kind:c,filePath:m,line:e+1,snippet:s.trim().slice(0,200)});break}}}return a}var z=2e3,E=512*1024,p=class{constructor(i,t,o={}){this.rootDir=i;this.filePaths=t;this.opts=o}symbols=[];built=!1;async build(i){let t=this.opts.maxFiles??z,o=this.opts.maxFileBytes??E,a=[],r=0;for(let e of this.filePaths){if(i?.aborted||r>=t)break;let s=f.isAbsolute(e)?e:f.join(this.rootDir,e);if(!y(s))continue;let c;try{let l=await k.stat(s);if(!l.isFile()||l.size>o)continue;c=await k.readFile(s,"utf8")}catch{continue}let n=f.relative(this.rootDir,s)||s;a.push(..._(n,c)),r+=1}return this.symbols=a,this.built=!0,this.symbols.length}isBuilt(){return this.built}size(){return this.symbols.length}search(i){let t=i.query.trim().toLowerCase();if(!t)return[];let o=i.maxResults??25,a=i.pathPrefix?.replace(/\\/g,"/").toLowerCase(),r=[];for(let e of this.symbols){if(i.kind&&e.kind!==i.kind||a&&!e.filePath.replace(/\\/g,"/").toLowerCase().includes(a))continue;let s=e.name.toLowerCase(),c=0;if(s===t)c=100;else if(s.startsWith(t))c=80;else if(s.includes(t))c=50;else if(e.snippet.toLowerCase().includes(t))c=20;else continue;r.push({s:e,score:c})}return r.sort((e,s)=>s.score-e.score||e.s.filePath.localeCompare(s.s.filePath)),r.slice(0,o).map(e=>e.s)}};var $=g("SYMBOL_SEARCH"),v=new Map,F=6e4,b=class extends h{constructor(t,o){super(o);this.config=t}async getDefaultPermission(){return"allow"}getDescription(){return`Find symbol \`${this.params.query}\``}async execute(t){let o=this.params.query?.trim();if(!o)return{llmContent:"Error: query is required",returnDisplay:"Error: query is required",error:{message:"query is required",type:"invalid_tool_params"}};let a=this.config.getTargetDir();try{let r=await this.getOrBuildIndex(a,t),e=r.search({query:o,pathPrefix:this.params.path,kind:this.params.kind,maxResults:this.params.max_results??25});if(e.length===0)return{llmContent:`No symbols matching "${o}". Try grep_search for textual matches.`,returnDisplay:"No symbols found"};let s=e.map(n=>`${n.kind} ${n.name} \u2014 ${n.filePath}:${n.line}
4
+ ${n.snippet}`);return{llmContent:[`Found ${e.length} symbol(s) for "${o}" (index size ${r.size()}):`,...s].join(`
5
+ `),returnDisplay:`Found ${e.length} symbol(s)`}}catch(r){let e=r instanceof Error?r.message:String(r);return $.debug(`symbol_search failed: ${e}`),{llmContent:`symbol_search failed: ${e}`,returnDisplay:"symbol_search failed",error:{message:e,type:"execution_failed"}}}}async getOrBuildIndex(t,o){let a=v.get(t);if(a&&Date.now()-a.builtAt<F&&a.index.isBuilt())return a.index;let r=A({projectRoot:t,useGitignore:!0,useMatildaignore:!0,ignoreDirs:["node_modules","dist",".git","coverage","vendor"]}),e=[];try{e=await w({crawlDirectory:t,cwd:t,ignore:r,useGitignore:!0,maxDepth:12,maxFiles:5e3,cache:!0,cacheTtl:60})}catch(n){$.debug(`crawl failed, indexing empty: ${n instanceof Error?n.message:String(n)}`),e=[]}if(o.aborted)throw new Error("symbol_search aborted");let s=e.map(n=>C.isAbsolute(n)&&C.relative(t,n)||n),c=new p(t,s);return await c.build(o),v.set(t,{index:c,builtAt:Date.now()}),c}},P=class extends x{constructor(t){super(d.SYMBOL_SEARCH,S.SYMBOL_SEARCH,"Search the workspace for code symbols (functions, classes, types, methods) by name. Prefer this over blind grep when looking for definitions. Falls back gracefully when a language is not indexed.","search",{type:"object",properties:{query:{type:"string",description:"Symbol name or substring to find"},path:{type:"string",description:"Optional path prefix to limit the search"},kind:{type:"string",enum:["function","class","method","interface","type","const","enum"],description:"Optional symbol kind filter"},max_results:{type:"number",description:"Maximum results to return (default 25)"}},required:["query"]});this.config=t}static Name=d.SYMBOL_SEARCH;createInvocation(t){return new b(this.config,t)}};export{P as SymbolSearchTool};
6
+ /**
7
+ * @license
8
+ * Copyright 2026 Matilda Team
9
+ * SPDX-License-Identifier: Apache-2.0
10
+ *
11
+ * Lightweight symbol extraction for the symbol_search tool.
12
+ * Regex-based MVP — tree-sitter grammars can replace per language later
13
+ * without changing the CodeIndex / tool surface.
14
+ */
15
+ /**
16
+ * @license
17
+ * Copyright 2026 Matilda Team
18
+ * SPDX-License-Identifier: Apache-2.0
19
+ */
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a,b}from"./chunk-5OHGYMKP.js";import"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as STRUCTURED_OUTPUT_REDACTED_ARGS,b as SyntheticOutputTool};
3
+ import{a,b}from"./chunk-LM6OIN4B.js";import"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as STRUCTURED_OUTPUT_REDACTED_ARGS,b as SyntheticOutputTool};
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{a,b}from"./chunk-2XSB5XHX.js";import"./chunk-MGRXOZAG.js";import"./chunk-V4VILMIK.js";import"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-J3ZCE3TA.js";import"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as TaskCreateTool,a as truncateForConfirmation};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as d}from"./chunk-QZI2ZGZY.js";import"./chunk-V6UPUMP3.js";import{g as i,i as c,p as n,q as u}from"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var o=class extends i{constructor(r,e){super(e);this.config=r}getDescription(){return`Detach background task ${this.params.task_id}`}async execute(r){let e=this.params.task_id,t=this.config.getBackgroundTaskRegistry().get(e)??this.config.getBackgroundShellRegistry().get(e)??this.config.getMonitorRegistry().get(e);return t?t.status!=="running"?{llmContent:`Error: Background ${t.kind} "${e}" is not running (status: ${t.status}).`,returnDisplay:`Task not running (${t.status}).`,error:{message:`${t.kind} is ${t.status}: ${e}`,type:"task_detach_not_running"}}:{llmContent:(d.detach(t)?`Detached background ${t.kind} "${e}". It keeps running after the current request ends and reports its completion separately. Stop it with ${n.TASK_STOP} when it is no longer needed.`:`Background ${t.kind} "${e}" is not holding a request open; it keeps running.`)+`
3
+ import{a as d}from"./chunk-7B65UIHB.js";import"./chunk-V6UPUMP3.js";import{f as i,g as c,m as n,n as u}from"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var o=class extends i{constructor(r,e){super(e);this.config=r}getDescription(){return`Detach background task ${this.params.task_id}`}async execute(r){let e=this.params.task_id,t=this.config.getBackgroundTaskRegistry().get(e)??this.config.getBackgroundShellRegistry().get(e)??this.config.getMonitorRegistry().get(e);return t?t.status!=="running"?{llmContent:`Error: Background ${t.kind} "${e}" is not running (status: ${t.status}).`,returnDisplay:`Task not running (${t.status}).`,error:{message:`${t.kind} is ${t.status}: ${e}`,type:"task_detach_not_running"}}:{llmContent:(d.detach(t)?`Detached background ${t.kind} "${e}". It keeps running after the current request ends and reports its completion separately. Stop it with ${n.TASK_STOP} when it is no longer needed.`:`Background ${t.kind} "${e}" is not holding a request open; it keeps running.`)+`
4
4
  Description: ${t.description}`,returnDisplay:`Detached: ${t.description}`}:{llmContent:`Error: No background task found with ID "${e}".`,returnDisplay:"Task not found.",error:{message:`Task not found: ${e}`,type:"task_detach_not_found"}}}},l=class s extends c{constructor(r){super(s.Name,u.TASK_DETACH,"Let a running background task keep running after the current request ends. Background tasks join the request that started them by default, and the request cannot finish until they do. Detach servers, watchers and other work that should outlive the request; its completion is reported separately.","other",{type:"object",properties:{task_id:{type:"string",description:"The ID of the background task to detach (from the launch response or notification)."}},required:["task_id"],additionalProperties:!1},!0,!1,!0,!1,"task detach background server watcher keep running");this.config=r}static Name=n.TASK_DETACH;createInvocation(r){return new o(this.config,r)}};export{l as TaskDetachTool};
5
5
  /**
6
6
  * @license
@@ -0,0 +1,9 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{i as d}from"./chunk-MGRXOZAG.js";import"./chunk-V4VILMIK.js";import{c as u,d as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-J3ZCE3TA.js";import{f as l,g as m,m as p,n as c}from"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as n}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";n();var r=class extends l{constructor(t,a){super(a);this.config=t}getDescription(){let t=[];return this.params.status&&t.push(`status=${this.params.status}`),this.params.owner&&t.push(`owner=${this.params.owner}`),this.params.blockedBy&&t.push(`blockedBy=${this.params.blockedBy}`),t.length>0?`List tasks (${t.join(", ")})`:"List all tasks"}async execute(){let t=g(this.config.getTeamContext()?.teamName);if(!t){let s="No active team. Create a team first.";return{llmContent:s,returnDisplay:s,error:{message:s}}}let a=await d(t,{status:this.params.status,owner:this.params.owner,blockedBy:this.params.blockedBy});if(a.length===0){let s="No tasks found.";return{llmContent:s,returnDisplay:s}}let e=a.map(s=>`#${s.id} [${s.status}]`+(s.owner?` @${s.owner}`:"")+` \u2014 ${s.subject}`),o=this.config.getTeamManager();if(o&&!u()){try{let s=await o.getLeaderMessages();if(s.length>0){e.push(""),e.push("--- Teammate messages ---");for(let y of o.formatLeaderEnvelope(s))e.push(y)}}catch{}o.hasActiveTeammates()&&(e.push(""),e.push("NOTE: Teammates are still working. Their results will be delivered as messages \u2014 do NOT call task_list again to check. End your turn and wait for teammate messages."))}let h=e.join(`
4
+ `),k={type:"task_list",tasks:a.map(s=>({id:s.id,subject:s.subject,status:s.status,owner:s.owner}))};return{llmContent:h,returnDisplay:k}}},f=class i extends m{constructor(t){super(i.Name,c.TASK_LIST,"List tasks in the team task list. All filter parameters are optional.","read",{type:"object",properties:{status:{type:"string",enum:["pending","in_progress","completed"],description:"Filter by task status."},owner:{type:"string",description:"Filter by owner agent name."},blockedBy:{type:"string",description:"Filter for tasks blocked by this task ID."}},additionalProperties:!1});this.config=t}static Name=p.TASK_LIST;createInvocation(t){return new r(this.config,t)}};export{f as TaskListTool};
5
+ /**
6
+ * @license
7
+ * Copyright 2025 Matilda
8
+ * SPDX-License-Identifier: Apache-2.0
9
+ */
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{g as T,i as y,p as h,q as $}from"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as f}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";f();var u=class extends T{constructor(e,t){super(t);this.config=e}getDescription(){return`Stop background task ${this.params.task_id}`}async execute(e){let t=this.params.task_id,d=this.config.getBackgroundTaskRegistry(),a=d.get(t);if(a){if(a.status==="paused"){if(!this.config.abandonBackgroundAgent(t))return{llmContent:`Error: Background agent "${t}" could not be cancelled from paused state.`,returnDisplay:"Task could not be cancelled.",error:{message:`Task could not be cancelled: ${t}`,type:"task_stop_not_running"}};let k=a.description;return{llmContent:`Cancelled paused background agent "${t}".
3
+ import{f as T,g as y,m as h,n as $}from"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as f}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";f();var u=class extends T{constructor(e,t){super(t);this.config=e}getDescription(){return`Stop background task ${this.params.task_id}`}async execute(e){let t=this.params.task_id,d=this.config.getBackgroundTaskRegistry(),a=d.get(t);if(a){if(a.status==="paused"){if(!this.config.abandonBackgroundAgent(t))return{llmContent:`Error: Background agent "${t}" could not be cancelled from paused state.`,returnDisplay:"Task could not be cancelled.",error:{message:`Task could not be cancelled: ${t}`,type:"task_stop_not_running"}};let k=a.description;return{llmContent:`Cancelled paused background agent "${t}".
4
4
  Description: ${k}`,returnDisplay:`Cancelled: ${k}`}}if(a.status!=="running")return l("agent",t,a.status);d.cancel(t);let c=a.description;return{llmContent:`Cancellation requested for background agent "${t}". A final task-notification carrying the agent's last result will follow.
5
5
  Description: ${c}`,returnDisplay:`Cancelled: ${c}`}}let g=this.config.getBackgroundShellRegistry(),r=g.get(t);if(r)return r.status!=="running"?l("shell",t,r.status):(g.requestCancel(t),{llmContent:`Cancellation requested for background shell "${t}". Final status will be visible via /tasks (text) or the interactive Background tasks dialog (focus the footer Background tasks pill, then Enter) once the process drains; captured output remains at ${r.outputPath}.
6
6
  Command: ${r.command}`,returnDisplay:`Cancelled shell: ${r.command}`});let m=this.config.getMonitorRegistry(),s=m.get(t);if(s)return s.status!=="running"?l("monitor",t,s.status):(m.cancel(t),{llmContent:`Monitor "${t}" cancelled. Status is visible via /tasks (text) or the interactive Background tasks dialog (focus the footer Background tasks pill, then Enter).
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as N}from"./chunk-MEV5XQI2.js";import{a as h,b as f,g as $,h as y,i as g,j as v,k as I}from"./chunk-6I6VGTKD.js";import"./chunk-ZX34M2GF.js";import{d as k,f as j,g as P}from"./chunk-QKYGQLWC.js";import"./chunk-7ZODGQO6.js";import"./chunk-TISQNFB5.js";import"./chunk-LUNDTQ3G.js";import{g as T,i as C,p as b,q as D}from"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as w}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";w();async function A(u,n,e,s){let i=await I(u),d=new Map,l=(t,r)=>{let a=d.get(t);a||(a=new Set,d.set(t,a)),a.add(r)};for(let t of i){for(let r of t.blocks)l(t.id,r);for(let r of t.blockedBy)l(r,t.id)}for(let t of e)l(n,t);for(let t of s)l(t,n);let o=[],c=new Set,p=t=>{o.push(t);for(let r of d.get(t)??[]){if(r===n)return[...o,n];if(c.has(r))continue;c.add(r);let a=p(r);if(a)return a}return o.pop(),null};return c.add(n),p(n)}var B=class extends T{constructor(e,s){super(s);this.config=e}getDescription(){let e=[`Task #${this.params.taskId}`];return this.params.status&&e.push(`\u2192 ${this.params.status}`),this.params.owner&&e.push(`owner: ${this.params.owner}`),e.join(" ")}async getDefaultPermission(){return"ask"}getConfirmationDetails(e){let s=[this.getDescription()];this.params.subject!==void 0&&s.push(`subject: ${this.params.subject}`),this.params.addBlocks?.length&&s.push(`blocks: ${this.params.addBlocks.join(", ")}`),this.params.addBlockedBy?.length&&s.push(`blocked by: ${this.params.addBlockedBy.join(", ")}`),this.params.description!==void 0&&s.push("",N(this.params.description));let i={type:"info",title:"Confirm TaskUpdate",prompt:s.join(`
3
+ import{a as N}from"./chunk-2XSB5XHX.js";import{a as h,b as f,e as $,f as y,g,h as v,i as I}from"./chunk-MGRXOZAG.js";import"./chunk-V4VILMIK.js";import{b as k,d as j,e as P}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-J3ZCE3TA.js";import{f as T,g as C,m as b,n as D}from"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as w}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";w();async function A(u,n,e,s){let i=await I(u),d=new Map,l=(t,r)=>{let a=d.get(t);a||(a=new Set,d.set(t,a)),a.add(r)};for(let t of i){for(let r of t.blocks)l(t.id,r);for(let r of t.blockedBy)l(r,t.id)}for(let t of e)l(n,t);for(let t of s)l(t,n);let o=[],c=new Set,p=t=>{o.push(t);for(let r of d.get(t)??[]){if(r===n)return[...o,n];if(c.has(r))continue;c.add(r);let a=p(r);if(a)return a}return o.pop(),null};return c.add(n),p(n)}var B=class extends T{constructor(e,s){super(s);this.config=e}getDescription(){let e=[`Task #${this.params.taskId}`];return this.params.status&&e.push(`\u2192 ${this.params.status}`),this.params.owner&&e.push(`owner: ${this.params.owner}`),e.join(" ")}async getDefaultPermission(){return"ask"}getConfirmationDetails(e){let s=[this.getDescription()];this.params.subject!==void 0&&s.push(`subject: ${this.params.subject}`),this.params.addBlocks?.length&&s.push(`blocks: ${this.params.addBlocks.join(", ")}`),this.params.addBlockedBy?.length&&s.push(`blocked by: ${this.params.addBlockedBy.join(", ")}`),this.params.description!==void 0&&s.push("",N(this.params.description));let i={type:"info",title:"Confirm TaskUpdate",prompt:s.join(`
4
4
  `),onConfirm:async()=>{}};return Promise.resolve(i)}async execute(){let e=j(this.config.getTeamContext()?.teamName);if(!e){let t="No active team. Create a team first.";return{llmContent:t,returnDisplay:t,error:{message:t}}}let{taskId:s}=this.params;try{f(s);for(let t of this.params.addBlocks??[])f(t);for(let t of this.params.addBlockedBy??[])f(t)}catch(t){let r=t instanceof Error?t.message:String(t);return{llmContent:r,returnDisplay:r,error:{message:r}}}let i=P()?k():void 0;if(this.params.status==="deleted"){let t;try{t=await v(e,s,i!==void 0?{callerName:i}:void 0)}catch(a){if(a instanceof y)return{llmContent:a.message,returnDisplay:a.message,error:{message:a.message}};throw a}if(!t){let a=`Task #${s} not found.`;return{llmContent:a,returnDisplay:a,error:{message:a}}}let r=`Task #${s} deleted.`;return{llmContent:r,returnDisplay:r}}if(this.params.addBlocks?.includes(s)||this.params.addBlockedBy?.includes(s)){let t=`Cannot update task #${s}: a task cannot block or be blocked by itself.`;return{llmContent:t,returnDisplay:t,error:{message:t}}}let d=new Set;for(let t of this.params.addBlocks??[])t!==s&&d.add(t);for(let t of this.params.addBlockedBy??[])t!==s&&d.add(t);if(d.size>0){let t=[];if(await Promise.all(Array.from(d).map(async a=>{await $(e,a)||t.push(a)})),t.length>0){let a=t.sort().map(U=>`#${U}`).join(", "),m=`Cannot update task #${s}: referenced task${t.length===1?"":"s"} ${a} not found.`;return{llmContent:m,returnDisplay:m,error:{message:m}}}let r=await A(e,s,this.params.addBlocks??[],this.params.addBlockedBy??[]);if(r){let a=`Cannot update task #${s}: this would create a dependency cycle (${r.map(m=>`#${m}`).join(" \u2192 ")}).`;return{llmContent:a,returnDisplay:a,error:{message:a}}}}let l=this.params.status==="in_progress"&&this.params.owner===void 0?k():void 0;if(this.params.status==="in_progress"&&!this.params.owner&&!l){let t=`Cannot move task #${s} to in_progress without an owner. Specify the "owner" parameter.`;return{llmContent:t,returnDisplay:t,error:{message:t}}}let o;try{o=await g(e,s,{status:this.params.status,owner:this.params.owner??l,subject:this.params.subject,description:this.params.description,activeForm:this.params.activeForm,metadata:this.params.metadata,addBlocks:this.params.addBlocks,addBlockedBy:this.params.addBlockedBy},i!==void 0?{callerName:i}:void 0)}catch(t){if(t instanceof y)return{llmContent:t.message,returnDisplay:t.message,error:{message:t.message}};throw t}if(!o){let t=`Task #${s} not found.`;return{llmContent:t,returnDisplay:t,error:{message:t}}}let c=[];if(this.params.addBlocks?.length&&this.params.status!=="completed")for(let t of this.params.addBlocks)t!==s&&c.push(g(e,t,{addBlockedBy:[s]},{callerName:h}));if(this.params.addBlockedBy?.length)for(let t of this.params.addBlockedBy)t!==s&&c.push(g(e,t,{addBlocks:[s]},{callerName:h}));c.length>0&&await Promise.all(c);let p=`Task #${s} updated (status: ${o.status}`+(o.owner?`, owner: ${o.owner}`:"")+").";return{llmContent:p,returnDisplay:p}}},S=class u extends C{constructor(e){super(u.Name,D.TASK_UPDATE,'Update an existing task. Can change status, owner, subject, description, and blocking relationships. Set status to "deleted" to remove a task. Setting status to "in_progress" auto-assigns you as owner if no owner is set.',"other",{type:"object",properties:{taskId:{type:"string",description:"ID of the task to update."},status:{type:"string",enum:["pending","in_progress","completed","deleted"],description:"New task status."},owner:{type:"string",description:"New owner agent name. Set to empty string to unassign."},subject:{type:"string",maxLength:200,description:"Updated task title."},description:{type:"string",maxLength:1e4,description:"Updated task description."},activeForm:{type:"string",maxLength:200,description:"Present tense label for UI."},metadata:{type:"object",description:"Metadata to merge. Set a key to null to delete it."},addBlocks:{type:"array",items:{type:"string"},description:"Task IDs that this task blocks."},addBlockedBy:{type:"array",items:{type:"string"},description:"Task IDs that block this task."}},required:["taskId"],additionalProperties:!1});this.config=e}static Name=b.TASK_UPDATE;createInvocation(e){return new B(this.config,e)}toAutoClassifierInput(e){return{taskId:e.taskId,status:e.status,owner:e.owner,subject:e.subject,description:e.description,addBlocks:e.addBlocks,addBlockedBy:e.addBlockedBy}}};export{S as TaskUpdateTool};
5
5
  /**
6
6
  * @license
@@ -1,7 +1,7 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{_g as u,jh as D}from"./chunk-PEKAUGYV.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-2HTPVSGT.js";import{l as A}from"./chunk-W4QSMIWO.js";import{l as C}from"./chunk-6I6VGTKD.js";import{c as w,f as T,g as k,h as b,r as o,s as v}from"./chunk-ZX34M2GF.js";import"./chunk-47XR7IMP.js";import"./chunk-MTMU7JYZ.js";import{k as f,l as y}from"./chunk-QKYGQLWC.js";import"./chunk-EZDV7A76.js";import"./chunk-RNKDFE2S.js";import"./chunk-RI54U73U.js";import"./chunk-6M5G5FBH.js";import"./chunk-QZI2ZGZY.js";import"./chunk-V6UPUMP3.js";import"./chunk-WC2VTVCE.js";import"./chunk-KHHJYBR5.js";import"./chunk-6EQMZNIY.js";import"./chunk-P5TG5CON.js";import"./chunk-DE3HKC2W.js";import"./chunk-GTVCJCHR.js";import"./chunk-IJEGHQ7Z.js";import"./chunk-PGUG43HG.js";import"./chunk-7ZODGQO6.js";import"./chunk-TISQNFB5.js";import"./chunk-VI74YQQO.js";import"./chunk-YV3PUOBU.js";import"./chunk-SOEIVSM5.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-3YLXGE6T.js";import"./chunk-JCE3JAVC.js";import"./chunk-SVSY6AWS.js";import"./chunk-AOOZREGV.js";import"./chunk-SDTWBD62.js";import"./chunk-DHDD5YJC.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-5OHGYMKP.js";import{g as c,i as g,p as h,q as p}from"./chunk-TWJLOEAI.js";import{b as d}from"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as l}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";l();var i=class extends c{constructor(e,a){super(a);this.config=e}getDescription(){return`Create team "${this.params.team_name}"`}async execute(){let e=k(this.params.team_name);if(!e){let t="Team name is required.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getArenaManager()){let t="Cannot create a team while an Arena session is active. End the Arena session first.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getTeamManager()){let t="A team is already active. Delete it before creating a new one.";return{llmContent:t,returnDisplay:t,error:{message:t}}}let a=b(y,e),s={name:e,description:this.params.description,createdAt:Date.now(),leadAgentId:a,leadSessionId:this.config.getSessionId(),leadPid:process.pid,members:[]};try{await o(e,s)}catch(t){if(d(t)&&t.code==="EEXIST"){if(!await v(e)){let n=`Team "${e}" already exists and appears to be owned by a live matilda-code session. Pick a different name, or \u2014 if you're sure no other session is using it \u2014 remove the on-disk artifacts manually:
4
- rm -rf "${w(e)}" "${T(e)}"`;return{llmContent:n,returnDisplay:n,error:{message:n}}}await o(e,s)}else throw t}await C(e),await A(e);let m=new u(this.config);await m.init();let x=new D(m,s,this.config.getSubagentManager(),{maxTeammates:this.config.getAgentsSettings().team?.maxTeammates});this.config.setTeamManager(x);let N={teamName:e,leadAgentId:a,teammates:{}};this.config.setTeamContext(N);let E={type:"team_result",teamName:e,action:"created"};return{llmContent:`Team "${e}" created.`+(this.params.description?` Description: ${this.params.description}`:""),returnDisplay:E}}},I=class r extends g{constructor(e){super(r.Name,p.TEAM_CREATE,`# TeamCreate
3
+ import{Qc as u,Rc as C}from"./chunk-NBLBE7PE.js";import{j as A}from"./chunk-MGRXOZAG.js";import"./chunk-ZSGBDQXU.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-5ETLURI6.js";import{i as v}from"./chunk-G3F3ZCH2.js";import{b as y,d as w,e as T,f as k,l as o,m as b}from"./chunk-V4VILMIK.js";import"./chunk-6NXVLJ3X.js";import"./chunk-4UGPARBR.js";import"./chunk-7B65UIHB.js";import{g as f}from"./chunk-QXSBPCBA.js";import"./chunk-LMZBADPW.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-453BANK3.js";import"./chunk-PQZ6HKKW.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-V2VUANFI.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import"./chunk-ARAB5QTM.js";import"./chunk-ILHNCXBC.js";import"./chunk-LM6OIN4B.js";import"./chunk-RPXRN7E6.js";import"./chunk-RHSUTILA.js";import"./chunk-J3ZCE3TA.js";import{f as c,g,m as h,n as p}from"./chunk-POGNX7U3.js";import{b as d}from"./chunk-7E2YCGHS.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import{b as l}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";l();var i=class extends c{constructor(e,a){super(a);this.config=e}getDescription(){return`Create team "${this.params.team_name}"`}async execute(){let e=T(this.params.team_name);if(!e){let t="Team name is required.";return{llmContent:t,returnDisplay:t,error:{message:t}}}if(this.config.getTeamManager()){let t="A team is already active. Delete it before creating a new one.";return{llmContent:t,returnDisplay:t,error:{message:t}}}let a=k(f,e),s={name:e,description:this.params.description,createdAt:Date.now(),leadAgentId:a,leadSessionId:this.config.getSessionId(),leadPid:process.pid,members:[]};try{await o(e,s)}catch(t){if(d(t)&&t.code==="EEXIST"){if(!await b(e)){let n=`Team "${e}" already exists and appears to be owned by a live matilda-code session. Pick a different name, or \u2014 if you're sure no other session is using it \u2014 remove the on-disk artifacts manually:
4
+ rm -rf "${y(e)}" "${w(e)}"`;return{llmContent:n,returnDisplay:n,error:{message:n}}}await o(e,s)}else throw t}await A(e),await v(e);let m=new u(this.config);await m.init();let x=new C(m,s,this.config.getSubagentManager(),{maxTeammates:this.config.getAgentsSettings().team?.maxTeammates});this.config.setTeamManager(x);let M={teamName:e,leadAgentId:a,teammates:{}};this.config.setTeamContext(M);let N={type:"team_result",teamName:e,action:"created"};return{llmContent:`Team "${e}" created.`+(this.params.description?` Description: ${this.params.description}`:""),returnDisplay:N}}},I=class r extends g{constructor(e){super(r.Name,p.TEAM_CREATE,`# TeamCreate
5
5
 
6
6
  ## When to Use
7
7
 
@@ -0,0 +1,8 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{a as T,d as f}from"./chunk-G3F3ZCH2.js";import{n as o}from"./chunk-V4VILMIK.js";import{e as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-J3ZCE3TA.js";import{f as l,g as c,m as p,n as u}from"./chunk-POGNX7U3.js";import{V as i}from"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import{b as m}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";m();var E=i("TEAM_DELETE"),r=class extends l{constructor(t,n){super(n);this.config=t}getDescription(){return"Delete current team"}async execute(){if(g()){let e="Only the team leader can delete the team.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let t=this.config.getTeamManager();if(!t){let e="No active team to delete.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let a=t.getTeamFile().name;try{await t.cleanup()}catch(e){E.warn("Team cleanup failed; resetting team state anyway:",e)}await o(a),await new Promise(e=>setTimeout(e,250)),await o(a),f(a),this.config.setTeamManager(null),this.config.setTeamContext(null),T();let y={type:"team_result",teamName:a,action:"deleted"};return{llmContent:`Team "${a}" deleted.`,returnDisplay:y}}},d=class s extends c{constructor(t){super(s.Name,u.TEAM_DELETE,"Delete the current team. Stops all teammates, cleans up team files, tasks, and inboxes. Only the team leader can use this.","delete",{type:"object",properties:{},additionalProperties:!1});this.config=t}static Name=p.TEAM_DELETE;createInvocation(t){return new r(this.config,t)}};export{d as TeamDeleteTool};
4
+ /**
5
+ * @license
6
+ * Copyright 2025 Matilda
7
+ * SPDX-License-Identifier: Apache-2.0
8
+ */
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{a,b,c}from"./chunk-RPXRN7E6.js";import"./chunk-RHSUTILA.js";import"./chunk-J3ZCE3TA.js";import"./chunk-POGNX7U3.js";import"./chunk-7E2YCGHS.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{c as TodoWriteTool,b as listTodoSessions,a as readTodosForSession};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Ic as N}from"./chunk-DHDD5YJC.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-5OHGYMKP.js";import{g as v,i as R,p as E,q as L}from"./chunk-TWJLOEAI.js";import{ba as S}from"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as C}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";C();var y=S("TOOL_SEARCH"),D=5,A=20,b=10,x=5,$=4,k=2,q=12,M=6,P=`Fetches function declarations for deferred tools and registers them with the active session so subsequent turns can call them.
3
+ import{lb as N}from"./chunk-ARAB5QTM.js";import"./chunk-ILHNCXBC.js";import"./chunk-LM6OIN4B.js";import"./chunk-J3ZCE3TA.js";import{f as v,g as R,m as E,n as L}from"./chunk-POGNX7U3.js";import{V as S}from"./chunk-7E2YCGHS.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import{b as C}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";C();var y=S("TOOL_SEARCH"),D=5,A=20,b=10,x=5,$=4,k=2,q=12,M=6,P=`Fetches function declarations for deferred tools and registers them with the active session so subsequent turns can call them.
4
4
 
5
5
  Deferred tools appear by name in the deferred-tools startup reminder. Until fetched, only the name is known \u2014 there is no parameter schema, so the tool cannot be invoked. This tool takes a query, matches it against the deferred tool list, and returns the matched tools' function declarations (name + description + parameter schema) inside a <functions> block.
6
6