@maincode-ai/matilda-code 0.22.2 → 0.22.3-nightly.20261110.cb1234773

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 (123) hide show
  1. package/README.md +1 -1
  2. package/chunks/agent-7LLN72GU.js +3 -0
  3. package/chunks/agent-headless-APBRBFN3.js +3 -0
  4. package/chunks/{askUserQuestion-DHYKAZWH.js → askUserQuestion-76LPP5ST.js} +1 -1
  5. package/chunks/{chunk-MZ73LBEY.js → chunk-3EQIOCSJ.js} +1 -1
  6. package/chunks/chunk-4SDFTVQW.js +62 -0
  7. package/chunks/chunk-B7BF33U4.js +31 -0
  8. package/chunks/chunk-BEP4F3GO.js +2556 -0
  9. package/chunks/chunk-DERMLVT6.js +68 -0
  10. package/chunks/{chunk-OWEBLTAN.js → chunk-EEPSTT7K.js} +1 -1
  11. package/chunks/{chunk-OF7ORAN6.js → chunk-GDRS4OWI.js} +71 -67
  12. package/chunks/chunk-HK3QQSM7.js +18 -0
  13. package/chunks/{chunk-PFXCFIHY.js → chunk-J6NYCXUR.js} +1 -1
  14. package/chunks/chunk-JVQHQDDE.js +10 -0
  15. package/chunks/chunk-JZMGEGR6.js +12 -0
  16. package/chunks/{chunk-HJK3NKAR.js → chunk-M5ABGGE7.js} +1 -1
  17. package/chunks/chunk-N3AQRPV5.js +207 -0
  18. package/chunks/{chunk-DZKI2CAC.js → chunk-NO6BFSGG.js} +1 -1
  19. package/chunks/chunk-QKAKC34Q.js +8 -0
  20. package/chunks/{chunk-VWM3GUBH.js → chunk-QUITDDTB.js} +1 -1
  21. package/chunks/{chunk-ZUQRP3N6.js → chunk-R373GBK6.js} +1 -1
  22. package/chunks/{chunk-BS7Q7KA6.js → chunk-T6MRYRLI.js} +1 -1
  23. package/chunks/{chunk-REUZDMLM.js → chunk-TVNM3PQ7.js} +25 -25
  24. package/chunks/chunk-VBZS7ARJ.js +8 -0
  25. package/chunks/{chunk-FY3LL4OC.js → chunk-VNSW4TSX.js} +1 -1
  26. package/chunks/{chunk-HRD7WD3P.js → chunk-WAZCC4SE.js} +1 -1
  27. package/chunks/chunk-YUCEPXGG.js +12 -0
  28. package/chunks/{computer-use-5T3ZH24D.js → computer-use-RIDTFLYZ.js} +5 -17
  29. package/chunks/cron-create-T5QOBRRU.js +38 -0
  30. package/chunks/cron-delete-JXDOHSJF.js +3 -0
  31. package/chunks/cron-list-ZQ76A2FW.js +5 -0
  32. package/chunks/{edit-Y7YSDGLT.js → edit-LDTYXEVU.js} +1 -1
  33. package/chunks/en-SCZAH2YB.js +23 -0
  34. package/chunks/{enter-worktree-5ZGIYDUE.js → enter-worktree-FOFQXTPW.js} +1 -1
  35. package/chunks/enterPlanMode-2GHHILQY.js +18 -0
  36. package/chunks/{exit-worktree-3F5UY76U.js → exit-worktree-OK7AD7DC.js} +1 -1
  37. package/chunks/{exitPlanMode-HWK5EUVS.js → exitPlanMode-EANVOWTX.js} +30 -27
  38. package/chunks/{glob-H7DNNPJ4.js → glob-VZD7TOML.js} +1 -1
  39. package/chunks/{goal-tools-CJINJJ3Y.js → goal-tools-REBEAKVP.js} +1 -1
  40. package/chunks/{grep-5MCMGW6A.js → grep-JPEHWEM3.js} +1 -1
  41. package/chunks/ls-EP4ZVFNW.js +15 -0
  42. package/chunks/{lsp-Y46R5DO5.js → lsp-ULZTGWC4.js} +1 -1
  43. package/chunks/monitor-5WDGSYNZ.js +33 -0
  44. package/chunks/notebook-edit-W42S562V.js +17 -0
  45. package/chunks/openaiContentGenerator-QLDLWN4P.js +52 -0
  46. package/chunks/read-file-4M76GCWT.js +3 -0
  47. package/chunks/ripGrep-LF2E2V6N.js +3 -0
  48. package/chunks/scheduler-G4LEIBL4.js +8 -0
  49. package/chunks/send-message-TDOMZHNJ.js +8 -0
  50. package/chunks/shell-NUMSSUOV.js +3 -0
  51. package/chunks/{skill-5EMGSWRM.js → skill-IVESDHGG.js} +1 -1
  52. package/chunks/symbol-search-BLJAKP7C.js +19 -0
  53. package/chunks/syntheticOutput-5SCRQCXN.js +3 -0
  54. package/chunks/task-create-T4DIVG5X.js +3 -0
  55. package/chunks/task-detach-ES3IMGJ4.js +9 -0
  56. package/chunks/task-list-LYK4TOBS.js +9 -0
  57. package/chunks/{task-stop-OEAEE5R7.js → task-stop-FETAYKFU.js} +1 -1
  58. package/chunks/{task-update-4ANRU74G.js → task-update-I6PVT46S.js} +1 -1
  59. package/chunks/{team-create-G4N2NCFN.js → team-create-QQD472XN.js} +1 -1
  60. package/chunks/team-delete-P5F32IYK.js +8 -0
  61. package/chunks/todoWrite-ADAGHJLI.js +3 -0
  62. package/chunks/tool-call-W6PAJOF6.js +3 -0
  63. package/chunks/tool-search-LGTQYGTC.js +26 -0
  64. package/chunks/{web-fetch-VA2BZ4VR.js → web-fetch-5X37JMDH.js} +1 -1
  65. package/chunks/{web-search-OVFXJQDS.js → web-search-62YZTP3D.js} +1 -1
  66. package/chunks/{workflow-6VMVM5BG.js → workflow-OT4I6TMY.js} +2 -2
  67. package/chunks/write-file-GMIHG7AP.js +15 -0
  68. package/cli.js +472 -486
  69. package/locales/en.js +45 -113
  70. package/npm-postinstall.js +2 -2
  71. package/package.json +2 -2
  72. package/chunks/agent-IJOGVY62.js +0 -3
  73. package/chunks/agent-headless-FZGKJCVK.js +0 -3
  74. package/chunks/ca-HHQCT6S2.js +0 -23
  75. package/chunks/chunk-225CZWD7.js +0 -89
  76. package/chunks/chunk-3BT7ZYAM.js +0 -121
  77. package/chunks/chunk-3IG6LNQ3.js +0 -2581
  78. package/chunks/chunk-46FFWNRO.js +0 -12
  79. package/chunks/chunk-55YW6EUC.js +0 -8
  80. package/chunks/chunk-BQDEPKIG.js +0 -46
  81. package/chunks/chunk-E2KMVG7F.js +0 -8
  82. package/chunks/chunk-FPGKJJJY.js +0 -13
  83. package/chunks/chunk-L2FKLLEC.js +0 -12
  84. package/chunks/chunk-N2BE647T.js +0 -10
  85. package/chunks/chunk-P24OL22U.js +0 -31
  86. package/chunks/chunk-VWE5BSHV.js +0 -56
  87. package/chunks/chunk-WL27X35X.js +0 -44
  88. package/chunks/cron-create-5RRFCP36.js +0 -38
  89. package/chunks/cron-delete-7DTRWCSV.js +0 -3
  90. package/chunks/cron-list-HY6XJD7D.js +0 -5
  91. package/chunks/de-MJBGC47E.js +0 -23
  92. package/chunks/en-JITX7JKV.js +0 -23
  93. package/chunks/enterPlanMode-TWD4MXCW.js +0 -18
  94. package/chunks/fr-WT3R2JCR.js +0 -23
  95. package/chunks/ja-OEXP6Z3S.js +0 -23
  96. package/chunks/keychain-token-storage-BCODB632.js +0 -3
  97. package/chunks/ls-JORGCXES.js +0 -15
  98. package/chunks/mcp-client-54J5M542.js +0 -3
  99. package/chunks/monitor-BRJR6PR3.js +0 -32
  100. package/chunks/notebook-edit-UCCVQ4JP.js +0 -17
  101. package/chunks/openaiContentGenerator-H6JOS3XU.js +0 -52
  102. package/chunks/pt-PCVIFK7H.js +0 -23
  103. package/chunks/read-file-LVMBCRCT.js +0 -3
  104. package/chunks/ripGrep-F6AJSDKU.js +0 -3
  105. package/chunks/ru-CB5SIZZM.js +0 -23
  106. package/chunks/scheduler-XAOD6LG6.js +0 -8
  107. package/chunks/send-message-VY4DP63A.js +0 -8
  108. package/chunks/shell-QUDC6MJK.js +0 -3
  109. package/chunks/symbol-search-YNGX4Z5T.js +0 -19
  110. package/chunks/syntheticOutput-4JANVS4D.js +0 -3
  111. package/chunks/task-create-NRBVXURQ.js +0 -3
  112. package/chunks/task-detach-VHDDAO2K.js +0 -9
  113. package/chunks/task-list-T2IET466.js +0 -9
  114. package/chunks/team-delete-M4ORNSTT.js +0 -8
  115. package/chunks/todoWrite-RN2OP46T.js +0 -3
  116. package/chunks/tool-search-WEUURHFZ.js +0 -28
  117. package/chunks/write-file-5ZAZVXBB.js +0 -15
  118. package/locales/ca.js +0 -1895
  119. package/locales/de.js +0 -1935
  120. package/locales/fr.js +0 -1936
  121. package/locales/ja.js +0 -1698
  122. package/locales/pt.js +0 -1921
  123. package/locales/ru.js +0 -1911
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a as f}from"./chunk-GT6MSEK4.js";import{b as g}from"./chunk-PFXCFIHY.js";import{H as d,P as m,ea as p}from"./chunk-WL27X35X.js";import{b as u}from"./chunk-GZPNIYVZ.js";u();import*as a from"node:fs/promises";import*as s from"node:path";var x=p("CRON_TASKS_FILE"),T="scheduled_tasks.json",L=`~/.matilda/tmp/<project-hash>/${T}`,E=15,w=2e3,b=3e3,P=0,h=new Map;function C(e){let t=h.get(e);return t||(t=new f,h.set(e,t)),t}function c(e){return s.join(m.getGlobalTempDir(),d(e),T)}async function k(e){let t=c(e),i;try{i=await a.readFile(t,"utf-8")}catch(o){if(o.code==="ENOENT")return[];throw o}let r;try{r=JSON.parse(i)}catch{throw new Error(`Malformed JSON in ${t} \u2014 fix or delete the file; refusing to treat it as an empty schedule.`)}if(!Array.isArray(r))throw new Error(`Expected a JSON array in ${t} \u2014 fix or delete the file; refusing to treat it as an empty schedule.`);let n=r.filter(A);return n.length!==r.length&&x.warn(`Dropped ${r.length-n.length} invalid task entr${r.length-n.length===1?"y":"ies"} from ${t}; a later write will persist without ${r.length-n.length===1?"it":"them"}.`),n}async function D(e,t){let i=c(e);await a.mkdir(s.dirname(i),{recursive:!0}),await g(i,t,{noFollow:!0})}async function _(e){let t=`${e}.lock`;await a.mkdir(s.dirname(t),{recursive:!0});let i=Date.now()+b;for(;;){if(Date.now()>i)throw new Error(`Timed out waiting for scheduled-tasks lock (${t})`);try{return await a.writeFile(t,String(process.pid),{flag:"wx"}),async()=>{await a.unlink(t).catch(()=>{})}}catch(r){if(r.code!=="EEXIST")throw r}try{let r=await a.stat(t);if(Date.now()-r.mtimeMs>w){let n=`${t}.stale.${process.pid}.${P++}`;try{await a.rename(t,n)}catch{continue}let o=await a.stat(n).catch(()=>null);o&&Date.now()-o.mtimeMs<=w&&await a.link(n,t).catch(()=>{}),await a.unlink(n).catch(()=>{});continue}}catch{continue}await new Promise(r=>setTimeout(r,E))}}async function y(e,t){let i=c(e);return C(i).runExclusive(async()=>{let r=await _(i);try{let n=await k(e),o=t(n);o!==n&&await D(e,o)}finally{await r()}})}async function F(e,t){await y(e,i=>[...i,t])}async function J(e,t){let i=new Set(t);if(!(await k(e)).some(o=>i.has(o.id)))return 0;let n=0;return await y(e,o=>{let l=o.filter(S=>!i.has(S.id));return n=o.length-l.length,n===0?o:l}),n}function A(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id=="string"&&typeof t.cron=="string"&&typeof t.prompt=="string"&&typeof t.recurring=="boolean"&&typeof t.createdAt=="number"&&(t.lastFiredAt===null||typeof t.lastFiredAt=="number")}export{L as a,c as b,k as c,y as d,F as e,J as f};
3
+ import{a as f}from"./chunk-GT6MSEK4.js";import{b as g}from"./chunk-J6NYCXUR.js";import{H as d,P as m,ea as p}from"./chunk-4SDFTVQW.js";import{b as u}from"./chunk-GZPNIYVZ.js";u();import*as a from"node:fs/promises";import*as s from"node:path";var x=p("CRON_TASKS_FILE"),T="scheduled_tasks.json",L=`~/.matilda/tmp/<project-hash>/${T}`,E=15,w=2e3,b=3e3,P=0,h=new Map;function C(e){let t=h.get(e);return t||(t=new f,h.set(e,t)),t}function c(e){return s.join(m.getGlobalTempDir(),d(e),T)}async function k(e){let t=c(e),i;try{i=await a.readFile(t,"utf-8")}catch(o){if(o.code==="ENOENT")return[];throw o}let r;try{r=JSON.parse(i)}catch{throw new Error(`Malformed JSON in ${t} \u2014 fix or delete the file; refusing to treat it as an empty schedule.`)}if(!Array.isArray(r))throw new Error(`Expected a JSON array in ${t} \u2014 fix or delete the file; refusing to treat it as an empty schedule.`);let n=r.filter(A);return n.length!==r.length&&x.warn(`Dropped ${r.length-n.length} invalid task entr${r.length-n.length===1?"y":"ies"} from ${t}; a later write will persist without ${r.length-n.length===1?"it":"them"}.`),n}async function D(e,t){let i=c(e);await a.mkdir(s.dirname(i),{recursive:!0}),await g(i,t,{noFollow:!0})}async function _(e){let t=`${e}.lock`;await a.mkdir(s.dirname(t),{recursive:!0});let i=Date.now()+b;for(;;){if(Date.now()>i)throw new Error(`Timed out waiting for scheduled-tasks lock (${t})`);try{return await a.writeFile(t,String(process.pid),{flag:"wx"}),async()=>{await a.unlink(t).catch(()=>{})}}catch(r){if(r.code!=="EEXIST")throw r}try{let r=await a.stat(t);if(Date.now()-r.mtimeMs>w){let n=`${t}.stale.${process.pid}.${P++}`;try{await a.rename(t,n)}catch{continue}let o=await a.stat(n).catch(()=>null);o&&Date.now()-o.mtimeMs<=w&&await a.link(n,t).catch(()=>{}),await a.unlink(n).catch(()=>{});continue}}catch{continue}await new Promise(r=>setTimeout(r,E))}}async function y(e,t){let i=c(e);return C(i).runExclusive(async()=>{let r=await _(i);try{let n=await k(e),o=t(n);o!==n&&await D(e,o)}finally{await r()}})}async function F(e,t){await y(e,i=>[...i,t])}async function J(e,t){let i=new Set(t);if(!(await k(e)).some(o=>i.has(o.id)))return 0;let n=0;return await y(e,o=>{let l=o.filter(S=>!i.has(S.id));return n=o.length-l.length,n===0?o:l}),n}function A(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id=="string"&&typeof t.cron=="string"&&typeof t.prompt=="string"&&typeof t.recurring=="boolean"&&typeof t.createdAt=="number"&&(t.lastFiredAt===null||typeof t.lastFiredAt=="number")}export{L as a,c as b,k as c,y as d,F as e,J as f};
@@ -0,0 +1,8 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{ka as s,la as i,ra as o,sa as l}from"./chunk-4SDFTVQW.js";import{b as a}from"./chunk-GZPNIYVZ.js";a();function u(r){let e=r??{};if(typeof e=="string")try{e=JSON.parse(e)}catch{return}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function T(r){if(r.name!==o.TOOL_CALL)return r;let e=r.args?.name,t=u(r.args?.arguments);return typeof e!="string"||!e||!t||e===o.TOOL_CALL?r:{...r,name:e,args:t}}var n=class extends s{getDescription(){return this.params.name}execute(e){let t=`${o.TOOL_CALL} takes the name of a deferred tool and that tool's arguments, and cannot call itself.`;return Promise.resolve({llmContent:`Error: ${t}`,returnDisplay:t,error:{message:t,type:"invalid_tool_params"}})}},m=class r extends i{static Name=o.TOOL_CALL;constructor(){super(r.Name,l.TOOL_CALL,"Invokes a deferred tool after its schema has been reviewed with tool_search. Pass the exact deferred tool name and arguments matching the reviewed schema. Permissions, hooks, and approvals apply to the deferred tool.","other",{type:"object",properties:{name:{type:"string",description:"Exact deferred tool name returned by tool_search.",minLength:1},arguments:{type:"object",description:"Arguments matching the deferred tool schema returned by tool_search."}},required:["name","arguments"],additionalProperties:!1},!0,!1,!1,!0)}createInvocation(e){return new n(e)}};export{T as a,m as b};
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Matilda Team
7
+ * SPDX-License-Identifier: Apache-2.0
8
+ */
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{d as f}from"./chunk-FY3LL4OC.js";import{d as u}from"./chunk-QXSBPCBA.js";import{f as m,g as c,m as l,n as p}from"./chunk-P24OL22U.js";import{b as n}from"./chunk-GZPNIYVZ.js";n();var o=2e3;function T(e){return e.length<=o?e:`${e.slice(0,o)}
3
+ import{d as f}from"./chunk-VNSW4TSX.js";import{d as u}from"./chunk-QXSBPCBA.js";import{ka as m,la as c,ra as l,sa as p}from"./chunk-4SDFTVQW.js";import{b as n}from"./chunk-GZPNIYVZ.js";n();var o=2e3;function T(e){return e.length<=o?e:`${e.slice(0,o)}
4
4
  \u2026 (${e.length-o} more characters)`}var s=class extends m{constructor(t,r){super(r);this.config=t}getDescription(){return`Create task: ${this.params.subject}`}async getDefaultPermission(){return"ask"}getConfirmationDetails(t){let r={type:"info",title:"Confirm TaskCreate",prompt:`Create task: ${this.params.subject}
5
5
 
6
6
  `+T(this.params.description),onConfirm:async()=>{}};return Promise.resolve(r)}async execute(){let t=u(this.config.getTeamContext()?.teamName);if(!t){let a="No active team. Create a team first.";return{llmContent:a,returnDisplay:a,error:{message:a}}}let r=await f(t,{subject:this.params.subject,description:this.params.description,activeForm:this.params.activeForm,metadata:this.params.metadata}),i=`Task #${r.id} created: "${r.subject}"`;return{llmContent:i,returnDisplay:i}}},d=class e extends c{constructor(t){super(e.Name,p.TASK_CREATE,"Create a new task in the team task list. Tasks are automatically assigned to idle teammates.","other",{type:"object",properties:{subject:{type:"string",description:"Short title for the task.",maxLength:200},description:{type:"string",description:"Detailed description of the task.",maxLength:1e4},activeForm:{type:"string",maxLength:200,description:'Present tense label for UI (e.g., "Running tests").'},metadata:{type:"object",description:"Optional arbitrary metadata."}},required:["subject","description"],additionalProperties:!1});this.config=t}static Name=l.TASK_CREATE;createInvocation(t){return new s(this.config,t)}toAutoClassifierInput(t){return{subject:t.subject,description:t.description}}};export{T as a,d as b};
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{c as p}from"./chunk-OWEBLTAN.js";import{b as h}from"./chunk-7ZODGQO6.js";import{a as M}from"./chunk-GT6MSEK4.js";import{b as d}from"./chunk-PFXCFIHY.js";import{c as f,ea as b}from"./chunk-WL27X35X.js";import{b as u}from"./chunk-GZPNIYVZ.js";import{f as E}from"./chunk-OWGSC52X.js";u();var x=null;function D(){x=null}function _(e,r,t){return x?(x.enqueueApproval({teammateName:e,teammateColor:r,details:t}),!0):!1}function P(e,r,t,o){return{...e,title:`[${r}] ${e.title}`,onConfirm:async(i,s)=>{await t(i,s)}}}u();var C=E(h(),1);import*as a from"node:fs/promises";import*as c from"node:path";var w=b("AGENTS_TEAM_MAILBOX"),N={retries:{retries:10,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:e=>{w.debug("mailbox lock compromised:",e?.message??e)}},g=new Map;function O(e){let r=g.get(e);return r||(r=new M,g.set(e,r)),r}function I(e){let r=p(e),t=0;for(let o of g.keys())c.dirname(o)===r&&(g.delete(o),t++);return t}async function T(e,r){return O(e).runExclusive(async()=>{let t=await C.default.lock(e,N);try{return await r()}finally{await t()}})}function y(e,r){return c.join(p(e),`${r}.json`)}async function B(e,r){let t=y(e,r);try{let o=await a.readFile(t,"utf-8");return JSON.parse(o)}catch(o){if(f(o)&&o.code==="ENOENT")return[];throw o}}var L=5*60*1e3;async function A(e,r,t){let o=y(e,r);await v(o),await T(o,async()=>{let i=await k(o),s=Date.now()-L,l=i.filter(m=>{if(!m.read)return!0;let n=Date.parse(m.timestamp);return Number.isNaN(n)||n>=s});l.push(t),await d(o,l)})}async function W(e,r,t){let o=y(e,r);return await v(o),T(o,async()=>{let i=await k(o),s=n=>!n.read&&(t===void 0||n.type===t),l=i.filter(s);if(l.length===0)return[];let m=i.map(n=>s(n)?{...n,read:!0}:n);return await d(o,m),l})}async function X(e){let r=p(e);await a.rm(r,{recursive:!0,force:!0}),I(e)}async function z(e,r,t){await A(e,r,{from:t.from,text:t.text,timestamp:new Date().toISOString(),read:!1,type:t.type,color:t.color,summary:t.summary})}async function v(e){await a.mkdir(c.dirname(e),{recursive:!0});try{await a.writeFile(e,`[]
3
+ import{c as p}from"./chunk-EEPSTT7K.js";import{b as h}from"./chunk-7ZODGQO6.js";import{a as M}from"./chunk-GT6MSEK4.js";import{b as d}from"./chunk-J6NYCXUR.js";import{c as f,ea as b}from"./chunk-4SDFTVQW.js";import{b as u}from"./chunk-GZPNIYVZ.js";import{f as E}from"./chunk-OWGSC52X.js";u();var x=null;function D(){x=null}function _(e,r,t){return x?(x.enqueueApproval({teammateName:e,teammateColor:r,details:t}),!0):!1}function P(e,r,t,o){return{...e,title:`[${r}] ${e.title}`,onConfirm:async(i,s)=>{await t(i,s)}}}u();var C=E(h(),1);import*as a from"node:fs/promises";import*as c from"node:path";var w=b("AGENTS_TEAM_MAILBOX"),N={retries:{retries:10,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:e=>{w.debug("mailbox lock compromised:",e?.message??e)}},g=new Map;function O(e){let r=g.get(e);return r||(r=new M,g.set(e,r)),r}function I(e){let r=p(e),t=0;for(let o of g.keys())c.dirname(o)===r&&(g.delete(o),t++);return t}async function T(e,r){return O(e).runExclusive(async()=>{let t=await C.default.lock(e,N);try{return await r()}finally{await t()}})}function y(e,r){return c.join(p(e),`${r}.json`)}async function B(e,r){let t=y(e,r);try{let o=await a.readFile(t,"utf-8");return JSON.parse(o)}catch(o){if(f(o)&&o.code==="ENOENT")return[];throw o}}var L=5*60*1e3;async function A(e,r,t){let o=y(e,r);await v(o),await T(o,async()=>{let i=await k(o),s=Date.now()-L,l=i.filter(m=>{if(!m.read)return!0;let n=Date.parse(m.timestamp);return Number.isNaN(n)||n>=s});l.push(t),await d(o,l)})}async function W(e,r,t){let o=y(e,r);return await v(o),T(o,async()=>{let i=await k(o),s=n=>!n.read&&(t===void 0||n.type===t),l=i.filter(s);if(l.length===0)return[];let m=i.map(n=>s(n)?{...n,read:!0}:n);return await d(o,m),l})}async function X(e){let r=p(e);await a.rm(r,{recursive:!0,force:!0}),I(e)}async function z(e,r,t){await A(e,r,{from:t.from,text:t.text,timestamp:new Date().toISOString(),read:!1,type:t.type,color:t.color,summary:t.summary})}async function v(e){await a.mkdir(c.dirname(e),{recursive:!0});try{await a.writeFile(e,`[]
4
4
  `,{flag:"wx"})}catch(r){if(!f(r)||r.code!=="EEXIST")throw r}}async function k(e){try{let r=await a.readFile(e,"utf-8");return JSON.parse(r)}catch(r){if(f(r)&&r.code==="ENOENT")return[];let t=r instanceof Error?r.message:String(r);w.warn(`Quarantining corrupt inbox at ${e}: ${t}`);try{await a.rename(e,`${e}.corrupt-${Date.now()}`)}catch(o){let i=o instanceof Error?o.message:String(o);throw w.warn(`Failed to quarantine ${e}: ${i}`),r instanceof Error?r:new Error(`Failed to read inbox at ${e}: ${t}`)}return[]}}export{D as a,_ as b,P as c,I as d,y as e,B as f,A as g,W as h,X as i,z as j};
5
5
  /**
6
6
  * @license
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{h as P,r as R}from"./chunk-MZ73LBEY.js";import{a as C}from"./chunk-PFXCFIHY.js";import{f as O,g as S,m as A,n as W}from"./chunk-P24OL22U.js";import{P as T,ea as I}from"./chunk-WL27X35X.js";import{b as E}from"./chunk-GZPNIYVZ.js";E();import*as h from"fs/promises";import*as f from"fs";import*as u from"path";var D=I("TODO_WRITE");function U(o){return new P(o.finalOutput).isBlockingDecision()}var q={name:"todo_write",description:"Creates and manages a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.",parametersJsonSchema:{type:"object",properties:{todos:{type:"array",items:{type:"object",properties:{content:{type:"string",minLength:1},status:{type:"string",enum:["pending","in_progress","completed"]},id:{type:"string"}},required:["content","status","id"],additionalProperties:!1},description:"The updated todo list"}},required:["todos"],$schema:"http://json-schema.org/draft-07/schema#"}},H=`
3
+ import{h as P,r as R}from"./chunk-3EQIOCSJ.js";import{a as C}from"./chunk-J6NYCXUR.js";import{P as T,ea as I,ka as O,la as S,ra as A,sa as W}from"./chunk-4SDFTVQW.js";import{b as E}from"./chunk-GZPNIYVZ.js";E();import*as h from"fs/promises";import*as f from"fs";import*as u from"path";var D=I("TODO_WRITE");function U(o){return new P(o.finalOutput).isBlockingDecision()}var q={name:"todo_write",description:"Creates and manages a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.",parametersJsonSchema:{type:"object",properties:{todos:{type:"array",items:{type:"object",properties:{content:{type:"string",minLength:1},status:{type:"string",enum:["pending","in_progress","completed"]},id:{type:"string"}},required:["content","status","id"],additionalProperties:!1},description:"The updated todo list"}},required:["todos"],$schema:"http://json-schema.org/draft-07/schema#"}},H=`
4
4
  Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
5
5
  It also helps the user understand the progress of the task and overall progress of their requests.
6
6