@maincode-ai/matilda-code 0.21.11 → 0.21.13

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 (174) hide show
  1. package/bundled/mainy/docs/configuration/model-providers.md +0 -82
  2. package/bundled/mainy/docs/configuration/settings.md +46 -7
  3. package/bundled/mainy/docs/configuration/trusted-folders.md +12 -6
  4. package/bundled/mainy/docs/features/auto-mode.md +1 -1
  5. package/bundled/mainy/docs/features/channels/_meta.ts +0 -3
  6. package/bundled/mainy/docs/features/channels/overview.md +8 -16
  7. package/bundled/mainy/docs/features/commands.md +4 -4
  8. package/bundled/mainy/docs/features/hooks.md +9 -7
  9. package/bundled/mainy/docs/features/language.md +2 -29
  10. package/bundled/mainy/docs/features/worktree.md +0 -2
  11. package/bundled/mainy/docs/integration-github-action.md +3 -3
  12. package/bundled/mainy/docs/quickstart.md +2 -2
  13. package/bundled/mainy/docs/support/troubleshooting.md +1 -1
  14. package/chunks/agent-SRAIVZEE.js +3 -0
  15. package/chunks/agent-headless-XRDOZESG.js +3 -0
  16. package/chunks/{anthropicContentGenerator-IYZILRDW.js → anthropicContentGenerator-LLDIKDMQ.js} +3 -3
  17. package/chunks/{askUserQuestion-XWHJY3DM.js → askUserQuestion-BNSWGD26.js} +1 -1
  18. package/chunks/{ca-EUJBUYX5.js → ca-NPYL24ME.js} +2 -2
  19. package/chunks/{chunk-4YVN5HXG.js → chunk-27HUYW23.js} +2 -2
  20. package/chunks/{chunk-MH2P4YXC.js → chunk-27Q5KW3A.js} +2 -2
  21. package/chunks/{chunk-NYEWHSBL.js → chunk-2HTPVSGT.js} +1 -1
  22. package/chunks/{chunk-EQGA7LH7.js → chunk-3B2HABK7.js} +1 -1
  23. package/chunks/chunk-3MTZTNAU.js +101 -0
  24. package/chunks/{chunk-WHG6N5X2.js → chunk-5OHGYMKP.js} +1 -1
  25. package/chunks/{chunk-QH7736R5.js → chunk-6EQMZNIY.js} +1 -1
  26. package/chunks/chunk-6I6VGTKD.js +8 -0
  27. package/chunks/{chunk-5427BPR2.js → chunk-6M5G5FBH.js} +1 -1
  28. package/chunks/{chunk-4FVBPNTZ.js → chunk-6T2GIM76.js} +1 -1
  29. package/chunks/chunk-7ZODGQO6.js +4 -0
  30. package/chunks/chunk-AOOZREGV.js +9 -0
  31. package/chunks/{chunk-JXUDKX6D.js → chunk-DE3HKC2W.js} +1 -1
  32. package/chunks/chunk-DHDD5YJC.js +207 -0
  33. package/chunks/{chunk-SPW5DXX4.js → chunk-EZDV7A76.js} +1 -1
  34. package/chunks/{chunk-ODZOYHIC.js → chunk-GOJCMVJJ.js} +1 -1
  35. package/chunks/{chunk-FFFZ2QMG.js → chunk-GTVCJCHR.js} +1 -1
  36. package/chunks/{chunk-Q55AVE2N.js → chunk-IJEGHQ7Z.js} +11 -11
  37. package/chunks/{chunk-SUH3UUWZ.js → chunk-JCE3JAVC.js} +1 -1
  38. package/chunks/chunk-KHHJYBR5.js +9 -0
  39. package/chunks/{chunk-GO2GA2GY.js → chunk-LUNDTQ3G.js} +1 -1
  40. package/chunks/{chunk-NIQK6NX3.js → chunk-LWARA7JY.js} +1 -1
  41. package/chunks/{chunk-YMIF2DMT.js → chunk-MEV5XQI2.js} +1 -1
  42. package/chunks/{chunk-4CSSDBOS.js → chunk-P5TG5CON.js} +10 -10
  43. package/chunks/chunk-PEKAUGYV.js +2621 -0
  44. package/chunks/chunk-PGUG43HG.js +24 -0
  45. package/chunks/{chunk-ELH4YHJR.js → chunk-PGXQZVLX.js} +1 -1
  46. package/chunks/{chunk-SNLH42QJ.js → chunk-QZI2ZGZY.js} +1 -1
  47. package/chunks/chunk-RI54U73U.js +56 -0
  48. package/chunks/chunk-RPFSFS7Z.js +39 -0
  49. package/chunks/chunk-SOEIVSM5.js +113 -0
  50. package/chunks/{chunk-4J6DC24J.js → chunk-SVSY6AWS.js} +1 -1
  51. package/chunks/{chunk-T4P4KEDW.js → chunk-TWJLOEAI.js} +2 -2
  52. package/chunks/{chunk-HYVP4472.js → chunk-V6UPUMP3.js} +1 -1
  53. package/chunks/chunk-W4QSMIWO.js +9 -0
  54. package/chunks/chunk-WC2VTVCE.js +27 -0
  55. package/chunks/{chunk-GUFIMKF5.js → chunk-YV3PUOBU.js} +1 -1
  56. package/chunks/chunk-ZX34M2GF.js +14 -0
  57. package/chunks/{computer-use-SXP25RZQ.js → computer-use-J4GAM4M6.js} +1 -1
  58. package/chunks/contextCommand-5F5M7NA4.js +3 -0
  59. package/chunks/{cron-create-2UI4AT4Q.js → cron-create-IDWSZENI.js} +1 -1
  60. package/chunks/{cron-delete-ZB6BOTFF.js → cron-delete-NQCDZDUI.js} +1 -1
  61. package/chunks/{cron-list-YYAXNHB6.js → cron-list-Z4XMC3TO.js} +1 -1
  62. package/chunks/{de-DNEPG7S7.js → de-34YZHGC6.js} +3 -3
  63. package/chunks/{devtools-5JRKK3E7.js → devtools-XRQ4YJ5S.js} +1 -1
  64. package/chunks/{dist-P6SLWL5V.js → dist-PH6JW7XD.js} +1 -1
  65. package/chunks/edit-X2S2ZXRN.js +43 -0
  66. package/chunks/{en-NOD6KQNM.js → en-QLGMD6OS.js} +3 -3
  67. package/chunks/{enter-worktree-X47BSJLE.js → enter-worktree-TUCGNCLO.js} +1 -1
  68. package/chunks/{enterPlanMode-F22ZNTYJ.js → enterPlanMode-SQEZAAIR.js} +1 -1
  69. package/chunks/{exit-worktree-XY5UMDHX.js → exit-worktree-7FLITFZI.js} +1 -1
  70. package/chunks/exitPlanMode-O5UUJ3GM.js +120 -0
  71. package/chunks/{fr-2OE5WLJ4.js → fr-EDNBQACJ.js} +3 -3
  72. package/chunks/geminiContentGenerator-FIZFLPU3.js +8 -0
  73. package/chunks/glob-GSFTYAS2.js +22 -0
  74. package/chunks/{goal-tools-6QTC3UI7.js → goal-tools-YQOA6OKU.js} +1 -1
  75. package/chunks/{grep-6TTPZ524.js → grep-VAB2VSXM.js} +1 -1
  76. package/chunks/{ja-3B6V5KS7.js → ja-LV4RLM3M.js} +3 -3
  77. package/chunks/{keychain-token-storage-54BNK6VH.js → keychain-token-storage-KQK6MNOJ.js} +1 -1
  78. package/chunks/{ls-YWZU3FYL.js → ls-IZJ3CKZY.js} +1 -1
  79. package/chunks/{lsp-4CJDKEEC.js → lsp-NGLDRHZU.js} +1 -1
  80. package/chunks/matildaAgentContentGenerator-QQHPCFJ5.js +8 -0
  81. package/chunks/matildaContentGenerator-W7Z33ONU.js +8 -0
  82. package/chunks/{matildaOAuth2-WOY7ZS43.js → matildaOAuth2-7COTQQR2.js} +1 -1
  83. package/chunks/mcp-client-DXUNIEIB.js +3 -0
  84. package/chunks/monitor-4PFIGAGG.js +32 -0
  85. package/chunks/notebook-edit-MWJYAATJ.js +17 -0
  86. package/chunks/{openaiContentGenerator-MGASUFQL.js → openaiContentGenerator-NDVJL6QL.js} +1 -1
  87. package/chunks/{pt-KP2JCPUY.js → pt-5SQ4DGL7.js} +3 -3
  88. package/chunks/read-file-WPZKPXWA.js +3 -0
  89. package/chunks/ripGrep-7LZDZFTX.js +3 -0
  90. package/chunks/{ru-K7IQQKHC.js → ru-7K24S53N.js} +3 -3
  91. package/chunks/scheduler-DK2MVKXX.js +8 -0
  92. package/chunks/{send-message-OO2HAKCC.js → send-message-TCPX5UDU.js} +1 -1
  93. package/chunks/{serve-ZQX2WBLF.js → serve-GSZPJI2O.js} +59 -48
  94. package/chunks/shell-PRS47PDP.js +3 -0
  95. package/chunks/{skill-KDM3UUML.js → skill-ETQM5NI3.js} +1 -1
  96. package/chunks/src-UB7DZRYK.js +3 -0
  97. package/chunks/{symbol-search-ALYOX5JN.js → symbol-search-HARHZ5AH.js} +1 -1
  98. package/chunks/{syntheticOutput-UASKABJH.js → syntheticOutput-WZDPECYS.js} +1 -1
  99. package/chunks/task-create-XRNIDT4T.js +3 -0
  100. package/chunks/{task-detach-I67ZE5MX.js → task-detach-TBAVUOTC.js} +1 -1
  101. package/chunks/task-list-Z6BDZZID.js +9 -0
  102. package/chunks/{task-stop-ERI5X4AO.js → task-stop-HDSARSJ6.js} +1 -1
  103. package/chunks/{task-update-CD3W556L.js → task-update-MW2VT2XV.js} +1 -1
  104. package/chunks/{team-create-F4KQRGMB.js → team-create-VMYNLZCC.js} +1 -1
  105. package/chunks/team-delete-F7QDC2TE.js +8 -0
  106. package/chunks/todoWrite-SCF5M24M.js +3 -0
  107. package/chunks/{tool-search-JFCD5W5M.js → tool-search-WX6FOE35.js} +1 -1
  108. package/chunks/tree-sitter-bash-2SWKO5B7.js +3 -0
  109. package/chunks/{web-fetch-REWGIRWQ.js → web-fetch-CKYBHGLF.js} +13 -13
  110. package/chunks/{web-search-OX2DPEVN.js → web-search-67DFNS5V.js} +1 -1
  111. package/chunks/{workflow-SEFYGBED.js → workflow-WBSRQG3N.js} +2 -2
  112. package/chunks/write-file-S5FAX4JJ.js +15 -0
  113. package/cli.js +462 -455
  114. package/locales/ca.js +1 -3
  115. package/locales/de.js +1 -3
  116. package/locales/en.js +1 -3
  117. package/locales/fr.js +1 -3
  118. package/locales/ja.js +1 -3
  119. package/locales/pt.js +1 -3
  120. package/locales/ru.js +1 -3
  121. package/package.json +2 -2
  122. package/sandbox-macos-permissive-closed.sb +0 -1
  123. package/sandbox-macos-permissive-open.sb +0 -1
  124. package/sandbox-macos-permissive-proxied.sb +0 -1
  125. package/sandbox-macos-restrictive-closed.sb +3 -1
  126. package/sandbox-macos-restrictive-open.sb +3 -1
  127. package/sandbox-macos-restrictive-proxied.sb +3 -1
  128. package/bundled/mainy/docs/features/channels/dingtalk.md +0 -134
  129. package/bundled/mainy/docs/features/channels/feishu.md +0 -186
  130. package/bundled/mainy/docs/features/channels/weixin.md +0 -106
  131. package/chunks/agent-ZFZ4HJQC.js +0 -3
  132. package/chunks/agent-headless-KH2BKLP7.js +0 -3
  133. package/chunks/chunk-25NCTG5H.js +0 -184
  134. package/chunks/chunk-2HQMJ2IU.js +0 -8
  135. package/chunks/chunk-6GBNB5Z2.js +0 -3
  136. package/chunks/chunk-GHBKFIHC.js +0 -35
  137. package/chunks/chunk-HWOQNYAO.js +0 -27
  138. package/chunks/chunk-LJR4RZZ2.js +0 -3
  139. package/chunks/chunk-NVM7W7TG.js +0 -101
  140. package/chunks/chunk-PA6532AY.js +0 -6
  141. package/chunks/chunk-QFNFLE2I.js +0 -2625
  142. package/chunks/chunk-QN6WSWMM.js +0 -9
  143. package/chunks/chunk-RK2AKQAX.js +0 -39
  144. package/chunks/chunk-U347OO7S.js +0 -9
  145. package/chunks/chunk-UIRBHC5X.js +0 -3
  146. package/chunks/chunk-W5CGKUM4.js +0 -15
  147. package/chunks/chunk-WRQLIPXW.js +0 -113
  148. package/chunks/chunk-WVY2P6WH.js +0 -26
  149. package/chunks/chunk-WZ75OGYY.js +0 -14
  150. package/chunks/chunk-XCFLI3OC.js +0 -9
  151. package/chunks/chunk-XMZIY7XX.js +0 -13
  152. package/chunks/contextCommand-3GN5CAOK.js +0 -3
  153. package/chunks/dist-ME6647DQ.js +0 -195
  154. package/chunks/dist-VG3ZDJ2A.js +0 -28
  155. package/chunks/dist-YTCHM57U.js +0 -23
  156. package/chunks/edit-KX6V4PH3.js +0 -39
  157. package/chunks/exitPlanMode-G3QLIWJ4.js +0 -90
  158. package/chunks/geminiContentGenerator-EQEGOXOV.js +0 -8
  159. package/chunks/glob-KSBEWI3E.js +0 -22
  160. package/chunks/matildaAgentContentGenerator-OV4U6DJD.js +0 -8
  161. package/chunks/matildaContentGenerator-ETIAWE22.js +0 -8
  162. package/chunks/monitor-F4K5HOZX.js +0 -32
  163. package/chunks/notebook-edit-TL7CI5EA.js +0 -17
  164. package/chunks/read-file-6EAPS2KG.js +0 -3
  165. package/chunks/ripGrep-K6SFFUIE.js +0 -3
  166. package/chunks/scheduler-TKWPD4LP.js +0 -8
  167. package/chunks/shell-AZRK5GIO.js +0 -3
  168. package/chunks/src-SGI6VLOS.js +0 -3
  169. package/chunks/task-create-EBJD55TB.js +0 -3
  170. package/chunks/task-list-5BGX4G5N.js +0 -9
  171. package/chunks/team-delete-5U3GBFKJ.js +0 -8
  172. package/chunks/todoWrite-YGG6AZ3A.js +0 -3
  173. package/chunks/tree-sitter-bash-XNCMPQBK.js +0 -3
  174. package/chunks/write-file-UAGVBZMC.js +0 -15
@@ -0,0 +1,14 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{l as f,m as h,n as T,o as w,p as x,q as s}from"./chunk-QKYGQLWC.js";import{c as g}from"./chunk-LUNDTQ3G.js";import{Q as c,b as p}from"./chunk-27Q5KW3A.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();function y(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}o();import*as n from"node:fs/promises";import*as a from"node:path";function M(){return a.join(c.getGlobalMatildaDir(),h)}function d(e){return a.join(M(),e)}function l(e){return a.join(d(e),w)}function I(e){return a.join(d(e),x)}function E(e){return a.join(c.getGlobalMatildaDir(),T,e)}function m(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function j(e,t){return`${m(e)}@${m(t)}`}function R(e,t){let r=m(e);if(!r)throw new Error(`Teammate name "${e}" sanitizes to an empty string. Choose a name with at least one alphanumeric character.`);if(r===f)throw new Error(`"${f}" is reserved for the team leader. Choose a different teammate name.`);let i=new Set(t.map(u=>u.name));if(i.has(r)){let u=[...i].join(", ")||"<none>";throw new Error(`A teammate named "${r}" already exists in this team (existing: ${u}). Choose a different name.`)}return r}function C(e){let t=new Set(e.map(r=>r.color).filter(r=>r!==void 0));for(let r of s)if(!t.has(r))return r;return s[e.length%s.length]}function O(e){return e.map(t=>{let{color:r,...i}=t;return i})}function $(e,t,r){return e.map(i=>i.agentId===t?{...i,isActive:r}:i)}function k(e,t){return e.find(r=>r.agentId===t)}function z(e,t){let r=m(t);return e.find(i=>i.name===r)}function L(e){let t=e.trimStart();if(/^shutdown_approved\b/i.test(t))return"shutdown_approved";if(/^shutdown_rejected\b/i.test(t))return"shutdown_rejected"}async function P(e){let t=l(e);try{let r=await n.readFile(t,"utf-8");return JSON.parse(r)}catch(r){if(p(r)&&r.code==="ENOENT")return;throw r}}async function J(e,t){let r=l(e);await n.mkdir(a.dirname(r),{recursive:!0}),await g(r,t)}async function B(e,t){let r=l(e);await n.mkdir(a.dirname(r),{recursive:!0}),await n.writeFile(r,JSON.stringify(t,null,2)+`
4
+ `,{encoding:"utf-8",flag:"wx"})}async function G(e){let t;try{t=await P(e)}catch{return!1}return t?typeof t.leadPid!="number"||t.leadPid<=0||t.leadPid!==process.pid&&y(t.leadPid)?!1:(await b(e),!0):(await b(e),!0)}async function b(e){let t=d(e),r=E(e);await Promise.allSettled([n.rm(t,{recursive:!0,force:!0}),n.rm(r,{recursive:!0,force:!0})])}async function q(){let e=M();try{return(await n.readdir(e,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}export{y as a,M as b,d as c,l as d,I as e,E as f,m as g,j as h,R as i,C as j,O as k,$ as l,k as m,z as n,L as o,P as p,J as q,B as r,G as s,b as t,q as u};
5
+ /**
6
+ * @license
7
+ * Copyright 2026 Matilda
8
+ * SPDX-License-Identifier: Apache-2.0
9
+ */
10
+ /**
11
+ * @license
12
+ * Copyright 2025 Matilda
13
+ * SPDX-License-Identifier: Apache-2.0
14
+ */
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{If as H,Kf as K,Ue as x,Wi as V}from"./chunk-QFNFLE2I.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-NYEWHSBL.js";import"./chunk-QN6WSWMM.js";import"./chunk-2HQMJ2IU.js";import"./chunk-W5CGKUM4.js";import"./chunk-TISQNFB5.js";import"./chunk-MTMU7JYZ.js";import"./chunk-SPW5DXX4.js";import"./chunk-RNKDFE2S.js";import"./chunk-GHBKFIHC.js";import"./chunk-5427BPR2.js";import"./chunk-47XR7IMP.js";import"./chunk-FFFZ2QMG.js";import"./chunk-SNLH42QJ.js";import"./chunk-HYVP4472.js";import"./chunk-QKYGQLWC.js";import"./chunk-QH7736R5.js";import"./chunk-4CSSDBOS.js";import"./chunk-JXUDKX6D.js";import"./chunk-Q55AVE2N.js";import"./chunk-GUFIMKF5.js";import"./chunk-WRQLIPXW.js";import"./chunk-DC7LAFZZ.js";import"./chunk-4F4DA5UI.js";import"./chunk-SUH3UUWZ.js";import"./chunk-4J6DC24J.js";import"./chunk-LJR4RZZ2.js";import"./chunk-U347OO7S.js";import"./chunk-SDTWBD62.js";import{i as S}from"./chunk-25NCTG5H.js";import"./chunk-WVY2P6WH.js";import"./chunk-UIRBHC5X.js";import"./chunk-ELH4YHJR.js";import"./chunk-WHG6N5X2.js";import{g as G,i as X}from"./chunk-T4P4KEDW.js";import"./chunk-HWOQNYAO.js";import"./chunk-XCFLI3OC.js";import"./chunk-VI74YQQO.js";import"./chunk-3YLXGE6T.js";import"./chunk-GO2GA2GY.js";import"./chunk-MH2P4YXC.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as d}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";d();d();d();import{homedir as we}from"node:os";d();import{join as R}from"node:path";import{homedir as E}from"node:os";var l="0.5.2",me="https://matilda.maincode.com/assets/computer-use",he="https://github.com/trycua/cua/releases/download";function U(e=process.platform,t=process.arch,o=l){let r=o;if(e==="darwin"){let n=`cua-driver-rs-${r}-${t==="arm64"?"darwin-arm64":"darwin-x86_64"}`;return{asset:`${n}.tar.gz`,extractDir:n,binaryRelPath:"CuaDriver.app/Contents/MacOS/cua-driver",hasApp:!0}}if(e==="linux"){if(t!=="x64")throw new Error(`Computer Use: unsupported Linux arch '${t}' (only x64).`);return{asset:`cua-driver-rs-${r}-linux-x86_64-binary.tar.gz`,extractDir:".",binaryRelPath:"cua-driver",hasApp:!1}}if(e==="win32"){let n=`cua-driver-rs-${r}-${t==="arm64"?"windows-arm64":"windows-x86_64"}`;return{asset:`${n}.zip`,extractDir:n,binaryRelPath:"cua-driver.exe",hasApp:!1}}throw new Error(`Computer Use: unsupported platform '${e}'.`)}function N(e,t=process.env,o=l){let r=[],i=t.MATILDA_COMPUTER_USE_DOWNLOAD_HOST;return i&&r.push(`${ye(i)}/cua-driver-rs/v${o}/${e}`),r.push(`${me}/cua-driver-rs/v${o}/${e}`),r.push(`${he}/cua-driver-rs-v${o}/${e}`),r}function Y(e=process.env,t=l){return N("checksums.txt",e,t)}var fe="MATILDA_COMPUTER_USE_MAX_IMAGE_DIMENSION";function J(e){if(e===void 0||typeof e=="string"&&e.trim()==="")return;let t=typeof e=="number"?e:Number(e);if(!(!Number.isInteger(t)||t<0))return t}function Q(e,t=process.env){let o=J(t[fe]);return o!==void 0?o:J(e)}function ge(e=E()){return R(e,".matilda","computer-use")}function M(e=E(),t=l){return R(ge(e),`cua-driver-rs-${t}`)}function u(e=E(),t=process.platform,o=process.arch,r=l){let i=U(t,o,r);return R(M(e,r),i.extractDir,i.binaryRelPath)}function h(e=l){return`cua-driver-rs@${e}`}function ye(e){return e.endsWith("/")?e.slice(0,-1):e}var f=class e{static singleton;binary;onProgress;maxImageDimension;client;startPromise;constructor(t){this.binary=t.binary,this.onProgress=t.onProgress??(()=>{}),this.maxImageDimension=t.maxImageDimension}setMaxImageDimension(t){this.maxImageDimension=t}static shared(){return e.singleton||(e.singleton=new e({binary:u(we())})),e.singleton}static setSharedForTest(t){e.singleton=t}isStarted(){return this.client!==void 0}async start(t){if(!this.client)return this.startPromise?this.startPromise:(this.startPromise=this.doStart(t).finally(()=>{this.startPromise=void 0}),this.startPromise)}async doStart(t){let o=t??this.onProgress;o("Starting Computer Use driver...");let r=new K({command:this.binary,args:["mcp"],env:x()}),i=new H({name:"matilda-code-computer-use",version:"1.0.0"},{capabilities:{}});await i.connect(r),this.client=i,await this.applyRuntimeConfig(i,o)}async applyRuntimeConfig(t,o){if(this.maxImageDimension!==void 0)try{await t.callTool({name:"set_config",arguments:{max_image_dimension:this.maxImageDimension}})}catch(r){let i=r instanceof Error?r.message:String(r);o(`Computer Use: could not apply max_image_dimension=${this.maxImageDimension} (${i}); using driver default.`)}}async listTools(){if(!this.client)throw new Error("ComputerUseClient not started");return this.client.listTools()}async callTool(t,o){if(!this.client)throw new Error("ComputerUseClient not started");try{return await this.client.callTool({name:t,arguments:o})}catch(r){if(!Z(r))throw r;let i=r;for(let n=0;n<3;n++){if(await this.stop(),await this.start(),!this.client)throw new Error("ComputerUseClient reconnect failed");try{return await this.client.callTool({name:t,arguments:o})}catch(s){if(!Z(s))throw s;i=s,await new Promise(a=>setTimeout(a,1e3))}}throw i}}async stop(){let t=this.client;if(this.client=void 0,t)try{await t.close()}catch{}}};function Z(e){let t=e instanceof Error?e.message:String(e);return/connection closed|not connected|connection refused|daemon transport error|os error 61/i.test(t)}d();var j=["bring_to_front","check_for_update","check_permissions","click","double_click","drag","end_session","get_accessibility_tree","get_agent_cursor_state","get_config","get_cursor_position","get_recording_state","get_screen_size","get_window_state","hotkey","kill_app","launch_app","list_apps","list_windows","move_cursor","page","press_key","replay_trajectory","right_click","scroll","set_agent_cursor_enabled","set_agent_cursor_motion","set_agent_cursor_style","set_config","set_value","start_recording","start_session","stop_recording","type_text","zoom"],g={bring_to_front:{description:'Activate a window so subsequent input tools with `dispatch:"foreground"` land on it without a per-call SetForegroundWindow flash. **Windows-only:** on macOS this tool returns an error pointing to the platform-native `NSRunningApplication.activate` (which the macOS input tools don\'t need because CGEvent.postToPid reaches backgrounded windows). On Linux this tool also stubs out; use `wmctrl -a` or `xdotool windowactivate` if you need explicit activation.',parameterSchema:{additionalProperties:!1,properties:{pid:{type:"integer"},window_id:{type:"integer"}},required:["pid"],type:"object"}},check_for_update:{description:"Check whether a newer cua-driver-rs release is available on GitHub. Returns the current and latest versions, an `update_available` boolean, the install one-liner, and the release notes URL. Read-only \u2014 never installs. Mirror of `cua-driver check-update --json`.",parameterSchema:{additionalProperties:!1,properties:{},type:"object"}},check_permissions:{description:"Report TCC permission status for Accessibility and Screen Recording. By default also raises the system permission dialogs for any missing grants \u2014 Apple's request APIs are no-ops when the grant is already active, so this is safe to call repeatedly. Pass {\"prompt\": false} for a purely read-only status check.\n\nReturns: `accessibility` + `screen_recording` (booleans from the TCC preflight APIs), `screen_recording_capturable` (a live ScreenCaptureKit probe \u2014 if it disagrees with `screen_recording`, the preflight grant belongs to a different process), and `source` (which TCC identity the booleans reflect: the CuaDriver daemon vs the launching terminal/IDE). macOS attributes grants to the responsible process, so a standalone call from a terminal reports the terminal's grants, not the driver's.",parameterSchema:{additionalProperties:!1,properties:{prompt:{description:"Raise the system permission prompts for missing grants. Default true.",type:"boolean"}},type:"object"}},click:{description:`Left-click against a target pid. **Prefer \`element_index\` over pixel coordinates** \u2014 element_index works on backgrounded / minimized / hidden / off-Space windows, surfaces a stable handle that survives rebuilds, and tells you what you're clicking via the cached element's role + label. Reach for \`x, y\` only when the target is a canvas / video / WebGL / custom-drawn surface that doesn't appear in the AX tree.
3
+ import{Mi as V,k as H,l as K,u as x}from"./chunk-PEKAUGYV.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-2HTPVSGT.js";import"./chunk-W4QSMIWO.js";import"./chunk-6I6VGTKD.js";import"./chunk-ZX34M2GF.js";import"./chunk-47XR7IMP.js";import"./chunk-MTMU7JYZ.js";import"./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{i as S}from"./chunk-DHDD5YJC.js";import"./chunk-PGXQZVLX.js";import"./chunk-LUNDTQ3G.js";import"./chunk-5OHGYMKP.js";import{g as G,i as X}from"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import{b as d}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";d();d();d();import{homedir as we}from"node:os";d();import{join as R}from"node:path";import{homedir as E}from"node:os";var l="0.5.2",me="https://matilda.maincode.com/assets/computer-use",he="https://github.com/trycua/cua/releases/download";function U(e=process.platform,t=process.arch,o=l){let r=o;if(e==="darwin"){let n=`cua-driver-rs-${r}-${t==="arm64"?"darwin-arm64":"darwin-x86_64"}`;return{asset:`${n}.tar.gz`,extractDir:n,binaryRelPath:"CuaDriver.app/Contents/MacOS/cua-driver",hasApp:!0}}if(e==="linux"){if(t!=="x64")throw new Error(`Computer Use: unsupported Linux arch '${t}' (only x64).`);return{asset:`cua-driver-rs-${r}-linux-x86_64-binary.tar.gz`,extractDir:".",binaryRelPath:"cua-driver",hasApp:!1}}if(e==="win32"){let n=`cua-driver-rs-${r}-${t==="arm64"?"windows-arm64":"windows-x86_64"}`;return{asset:`${n}.zip`,extractDir:n,binaryRelPath:"cua-driver.exe",hasApp:!1}}throw new Error(`Computer Use: unsupported platform '${e}'.`)}function N(e,t=process.env,o=l){let r=[],i=t.MATILDA_COMPUTER_USE_DOWNLOAD_HOST;return i&&r.push(`${ye(i)}/cua-driver-rs/v${o}/${e}`),r.push(`${me}/cua-driver-rs/v${o}/${e}`),r.push(`${he}/cua-driver-rs-v${o}/${e}`),r}function Y(e=process.env,t=l){return N("checksums.txt",e,t)}var fe="MATILDA_COMPUTER_USE_MAX_IMAGE_DIMENSION";function J(e){if(e===void 0||typeof e=="string"&&e.trim()==="")return;let t=typeof e=="number"?e:Number(e);if(!(!Number.isInteger(t)||t<0))return t}function Q(e,t=process.env){let o=J(t[fe]);return o!==void 0?o:J(e)}function ge(e=E()){return R(e,".matilda","computer-use")}function M(e=E(),t=l){return R(ge(e),`cua-driver-rs-${t}`)}function u(e=E(),t=process.platform,o=process.arch,r=l){let i=U(t,o,r);return R(M(e,r),i.extractDir,i.binaryRelPath)}function h(e=l){return`cua-driver-rs@${e}`}function ye(e){return e.endsWith("/")?e.slice(0,-1):e}var f=class e{static singleton;binary;onProgress;maxImageDimension;client;startPromise;constructor(t){this.binary=t.binary,this.onProgress=t.onProgress??(()=>{}),this.maxImageDimension=t.maxImageDimension}setMaxImageDimension(t){this.maxImageDimension=t}static shared(){return e.singleton||(e.singleton=new e({binary:u(we())})),e.singleton}static setSharedForTest(t){e.singleton=t}isStarted(){return this.client!==void 0}async start(t){if(!this.client)return this.startPromise?this.startPromise:(this.startPromise=this.doStart(t).finally(()=>{this.startPromise=void 0}),this.startPromise)}async doStart(t){let o=t??this.onProgress;o("Starting Computer Use driver...");let r=new K({command:this.binary,args:["mcp"],env:x()}),i=new H({name:"matilda-code-computer-use",version:"1.0.0"},{capabilities:{}});await i.connect(r),this.client=i,await this.applyRuntimeConfig(i,o)}async applyRuntimeConfig(t,o){if(this.maxImageDimension!==void 0)try{await t.callTool({name:"set_config",arguments:{max_image_dimension:this.maxImageDimension}})}catch(r){let i=r instanceof Error?r.message:String(r);o(`Computer Use: could not apply max_image_dimension=${this.maxImageDimension} (${i}); using driver default.`)}}async listTools(){if(!this.client)throw new Error("ComputerUseClient not started");return this.client.listTools()}async callTool(t,o){if(!this.client)throw new Error("ComputerUseClient not started");try{return await this.client.callTool({name:t,arguments:o})}catch(r){if(!Z(r))throw r;let i=r;for(let n=0;n<3;n++){if(await this.stop(),await this.start(),!this.client)throw new Error("ComputerUseClient reconnect failed");try{return await this.client.callTool({name:t,arguments:o})}catch(s){if(!Z(s))throw s;i=s,await new Promise(a=>setTimeout(a,1e3))}}throw i}}async stop(){let t=this.client;if(this.client=void 0,t)try{await t.close()}catch{}}};function Z(e){let t=e instanceof Error?e.message:String(e);return/connection closed|not connected|connection refused|daemon transport error|os error 61/i.test(t)}d();var j=["bring_to_front","check_for_update","check_permissions","click","double_click","drag","end_session","get_accessibility_tree","get_agent_cursor_state","get_config","get_cursor_position","get_recording_state","get_screen_size","get_window_state","hotkey","kill_app","launch_app","list_apps","list_windows","move_cursor","page","press_key","replay_trajectory","right_click","scroll","set_agent_cursor_enabled","set_agent_cursor_motion","set_agent_cursor_style","set_config","set_value","start_recording","start_session","stop_recording","type_text","zoom"],g={bring_to_front:{description:'Activate a window so subsequent input tools with `dispatch:"foreground"` land on it without a per-call SetForegroundWindow flash. **Windows-only:** on macOS this tool returns an error pointing to the platform-native `NSRunningApplication.activate` (which the macOS input tools don\'t need because CGEvent.postToPid reaches backgrounded windows). On Linux this tool also stubs out; use `wmctrl -a` or `xdotool windowactivate` if you need explicit activation.',parameterSchema:{additionalProperties:!1,properties:{pid:{type:"integer"},window_id:{type:"integer"}},required:["pid"],type:"object"}},check_for_update:{description:"Check whether a newer cua-driver-rs release is available on GitHub. Returns the current and latest versions, an `update_available` boolean, the install one-liner, and the release notes URL. Read-only \u2014 never installs. Mirror of `cua-driver check-update --json`.",parameterSchema:{additionalProperties:!1,properties:{},type:"object"}},check_permissions:{description:"Report TCC permission status for Accessibility and Screen Recording. By default also raises the system permission dialogs for any missing grants \u2014 Apple's request APIs are no-ops when the grant is already active, so this is safe to call repeatedly. Pass {\"prompt\": false} for a purely read-only status check.\n\nReturns: `accessibility` + `screen_recording` (booleans from the TCC preflight APIs), `screen_recording_capturable` (a live ScreenCaptureKit probe \u2014 if it disagrees with `screen_recording`, the preflight grant belongs to a different process), and `source` (which TCC identity the booleans reflect: the CuaDriver daemon vs the launching terminal/IDE). macOS attributes grants to the responsible process, so a standalone call from a terminal reports the terminal's grants, not the driver's.",parameterSchema:{additionalProperties:!1,properties:{prompt:{description:"Raise the system permission prompts for missing grants. Default true.",type:"boolean"}},type:"object"}},click:{description:`Left-click against a target pid. **Prefer \`element_index\` over pixel coordinates** \u2014 element_index works on backgrounded / minimized / hidden / off-Space windows, surfaces a stable handle that survives rebuilds, and tells you what you're clicking via the cached element's role + label. Reach for \`x, y\` only when the target is a canvas / video / WebGL / custom-drawn surface that doesn't appear in the AX tree.
4
4
 
5
5
  Two addressing modes:
6
6
 
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{c as a,d as b,e as c}from"./chunk-LWARA7JY.js";import"./chunk-27HUYW23.js";import"./chunk-PEKAUGYV.js";import"./chunk-M53RP3YP.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-2HTPVSGT.js";import"./chunk-W4QSMIWO.js";import"./chunk-6I6VGTKD.js";import"./chunk-ZX34M2GF.js";import"./chunk-47XR7IMP.js";import"./chunk-MTMU7JYZ.js";import"./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"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-G7R2XEEF.js";import"./chunk-OA56BXPD.js";import"./chunk-FWDMPRKU.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as collectContextData,c as contextCommand,b as formatContextUsageText};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as p,c as f}from"./chunk-TXMXCR7D.js";import{a as y}from"./chunk-YULUB745.js";import{a as n}from"./chunk-NYEWHSBL.js";import"./chunk-TISQNFB5.js";import{g as m,i as c,p as d,q as h}from"./chunk-T4P4KEDW.js";import"./chunk-GO2GA2GY.js";import"./chunk-MH2P4YXC.js";import"./chunk-FWDMPRKU.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();var i=class extends m{constructor(e,t){super(t);this.config=e}getDescription(){return`${this.params.cron}: ${this.params.prompt}`}async getDefaultPermission(){return"ask"}async execute(){let e=this.config.getCronScheduler(),t=this.params.recurring!==!1,s=this.params.durable===!0;try{p(this.params.cron),f(this.params.cron,new Date);let r=s?await e.createDurable(this.params.cron,this.params.prompt,t):e.create(this.params.cron,this.params.prompt,t),o=y(r.cronExpr),w=`Scheduled ${r.id} (${o})${s?" [durable]":""}`,l=s?`Persisted to ${n}`:"Session-only (not written to disk, dies when Matilda exits)";return{llmContent:t?`Scheduled recurring job ${r.id} (${r.cronExpr}). ${l}. Auto-expires after 7 days. Use CronDelete to cancel sooner.`:`Scheduled one-shot task ${r.id} (${r.cronExpr}). ${l}. It will fire once then auto-delete.`,returnDisplay:w}}catch(r){let o=r instanceof Error?r.message:String(r);return{llmContent:`Error creating cron job: ${o}`,returnDisplay:o,error:{message:o}}}}},g=class a extends c{constructor(e){super(a.Name,h.CRON_CREATE,`Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.
3
+ import{a as p,c as f}from"./chunk-TXMXCR7D.js";import{a as y}from"./chunk-YULUB745.js";import{a as n}from"./chunk-2HTPVSGT.js";import"./chunk-TISQNFB5.js";import"./chunk-LUNDTQ3G.js";import{g as m,i as c,p as d,q as h}from"./chunk-TWJLOEAI.js";import"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as u}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";u();var i=class extends m{constructor(e,t){super(t);this.config=e}getDescription(){return`${this.params.cron}: ${this.params.prompt}`}async getDefaultPermission(){return"ask"}async execute(){let e=this.config.getCronScheduler(),t=this.params.recurring!==!1,s=this.params.durable===!0;try{p(this.params.cron),f(this.params.cron,new Date);let r=s?await e.createDurable(this.params.cron,this.params.prompt,t):e.create(this.params.cron,this.params.prompt,t),o=y(r.cronExpr),w=`Scheduled ${r.id} (${o})${s?" [durable]":""}`,l=s?`Persisted to ${n}`:"Session-only (not written to disk, dies when Matilda exits)";return{llmContent:t?`Scheduled recurring job ${r.id} (${r.cronExpr}). ${l}. Auto-expires after 7 days. Use CronDelete to cancel sooner.`:`Scheduled one-shot task ${r.id} (${r.cronExpr}). ${l}. It will fire once then auto-delete.`,returnDisplay:w}}catch(r){let o=r instanceof Error?r.message:String(r);return{llmContent:`Error creating cron job: ${o}`,returnDisplay:o,error:{message:o}}}}},g=class a extends c{constructor(e){super(a.Name,h.CRON_CREATE,`Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.
4
4
 
5
5
  Uses standard 5-field cron in the user's local timezone: minute hour day-of-month month day-of-week. "0 9 * * *" means 9am local \u2014 no timezone conversion needed.
6
6
 
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as d,f as u}from"./chunk-NYEWHSBL.js";import"./chunk-TISQNFB5.js";import{g as l,i as c,p as m,q as p}from"./chunk-T4P4KEDW.js";import"./chunk-GO2GA2GY.js";import{d as n}from"./chunk-MH2P4YXC.js";import"./chunk-FWDMPRKU.js";import{b as i}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";i();var s=class extends l{constructor(r,o){super(o);this.config=r}getDescription(){return this.params.id}async execute(){let r=this.config.getCronScheduler(),o;try{o=await r.delete(this.params.id),o||(o=await u(this.config.getProjectRoot(),[this.params.id])>0)}catch(e){let t=`Failed to cancel job ${this.params.id}: ${n(e)}`;return{llmContent:t,returnDisplay:t,error:{message:t}}}if(o){let e=`Cancelled job ${this.params.id}.`,t=`Cancelled ${this.params.id}`;return{llmContent:e,returnDisplay:t}}else{let e=`Job ${this.params.id} not found.`;return{llmContent:e,returnDisplay:e,error:{message:e}}}}},f=class a extends c{constructor(r){super(a.Name,p.CRON_DELETE,`Cancel a cron job previously scheduled with CronCreate. Removes it from the in-memory session store or from ${d} (durable jobs).`,"other",{type:"object",properties:{id:{type:"string",description:"Job ID returned by CronCreate."}},required:["id"],additionalProperties:!1},!0,!1,!0,!1,"cron delete cancel remove");this.config=r}static Name=m.CRON_DELETE;createInvocation(r){return new s(this.config,r)}};export{f as CronDeleteTool};
3
+ import{a as d,f as u}from"./chunk-2HTPVSGT.js";import"./chunk-TISQNFB5.js";import"./chunk-LUNDTQ3G.js";import{g as l,i as c,p as m,q as p}from"./chunk-TWJLOEAI.js";import{d as n}from"./chunk-27Q5KW3A.js";import"./chunk-FWDMPRKU.js";import{b as i}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";i();var s=class extends l{constructor(r,o){super(o);this.config=r}getDescription(){return this.params.id}async execute(){let r=this.config.getCronScheduler(),o;try{o=await r.delete(this.params.id),o||(o=await u(this.config.getProjectRoot(),[this.params.id])>0)}catch(e){let t=`Failed to cancel job ${this.params.id}: ${n(e)}`;return{llmContent:t,returnDisplay:t,error:{message:t}}}if(o){let e=`Cancelled job ${this.params.id}.`,t=`Cancelled ${this.params.id}`;return{llmContent:e,returnDisplay:t}}else{let e=`Job ${this.params.id} not found.`;return{llmContent:e,returnDisplay:e,error:{message:e}}}}},f=class a extends c{constructor(r){super(a.Name,p.CRON_DELETE,`Cancel a cron job previously scheduled with CronCreate. Removes it from the in-memory session store or from ${d} (durable jobs).`,"other",{type:"object",properties:{id:{type:"string",description:"Job ID returned by CronCreate."}},required:["id"],additionalProperties:!1},!0,!1,!0,!1,"cron delete cancel remove");this.config=r}static Name=m.CRON_DELETE;createInvocation(r){return new s(this.config,r)}};export{f as CronDeleteTool};
@@ -1,5 +1,5 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as m}from"./chunk-YULUB745.js";import{a as d,c as g}from"./chunk-NYEWHSBL.js";import"./chunk-TISQNFB5.js";import{g as l,i as c,p,q as u}from"./chunk-T4P4KEDW.js";import"./chunk-GO2GA2GY.js";import"./chunk-MH2P4YXC.js";import"./chunk-FWDMPRKU.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var s=class extends l{constructor(e,t){super(t);this.config=e}getDescription(){return""}async execute(){let e=this.config.getCronScheduler(),t;try{t=await g(this.config.getProjectRoot())}catch(r){let o=r instanceof Error?r.message:String(r);return{llmContent:`Error listing cron jobs: ${o}`,returnDisplay:o,error:{message:o}}}let n=[...t.map(r=>({id:r.id,cron:r.cron,prompt:r.prompt,recurring:r.recurring,durable:!0})),...e.list().filter(r=>!r.durable).map(r=>({id:r.id,cron:r.cronExpr,prompt:r.prompt,recurring:r.recurring,durable:!1}))];if(n.length===0){let r="No active cron jobs.";return{llmContent:r,returnDisplay:r}}let y=n.map(r=>{let o=r.recurring?"recurring":"one-shot",h=r.durable?"durable":"session-only";return`${r.id} \u2014 ${r.cron} (${o}) [${h}]: ${r.prompt}`}).join(`
3
+ import{a as m}from"./chunk-YULUB745.js";import{a as d,c as g}from"./chunk-2HTPVSGT.js";import"./chunk-TISQNFB5.js";import"./chunk-LUNDTQ3G.js";import{g as l,i as c,p,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 s=class extends l{constructor(e,t){super(t);this.config=e}getDescription(){return""}async execute(){let e=this.config.getCronScheduler(),t;try{t=await g(this.config.getProjectRoot())}catch(r){let o=r instanceof Error?r.message:String(r);return{llmContent:`Error listing cron jobs: ${o}`,returnDisplay:o,error:{message:o}}}let n=[...t.map(r=>({id:r.id,cron:r.cron,prompt:r.prompt,recurring:r.recurring,durable:!0})),...e.list().filter(r=>!r.durable).map(r=>({id:r.id,cron:r.cronExpr,prompt:r.prompt,recurring:r.recurring,durable:!1}))];if(n.length===0){let r="No active cron jobs.";return{llmContent:r,returnDisplay:r}}let y=n.map(r=>{let o=r.recurring?"recurring":"one-shot",h=r.durable?"durable":"session-only";return`${r.id} \u2014 ${r.cron} (${o}) [${h}]: ${r.prompt}`}).join(`
4
4
  `),T=n.map(r=>`${r.id} ${m(r.cron)} [${r.durable?"durable":"session-only"}]`).join(`
5
5
  `);return{llmContent:y,returnDisplay:T}}},f=class i extends c{constructor(e){super(i.Name,u.CRON_LIST,`List all cron jobs scheduled via CronCreate, both session-only and durable (${d}).`,"other",{type:"object",properties:{},additionalProperties:!1},!0,!1,!0,!1,"cron list scheduled jobs");this.config=e}static Name=p.CRON_LIST;createInvocation(e){return new s(this.config,e)}};export{f as CronListTool};