@maincode-ai/matilda-code 0.22.1 → 0.22.2-nightly.20261107.317646b99

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 (122) hide show
  1. package/README.md +1 -1
  2. package/chunks/agent-CUHHPELW.js +3 -0
  3. package/chunks/agent-headless-P2DULOWS.js +3 -0
  4. package/chunks/{askUserQuestion-A46IDHKS.js → askUserQuestion-DHYKAZWH.js} +1 -1
  5. package/chunks/ca-3NRDXS7D.js +23 -0
  6. package/chunks/chunk-355M6IU5.js +80 -0
  7. package/chunks/chunk-3TTI3ZQT.js +56 -0
  8. package/chunks/{chunk-CI5CVVGI.js → chunk-42UM7T4B.js} +53 -53
  9. package/chunks/{chunk-6RK6IJY5.js → chunk-46FFWNRO.js} +1 -1
  10. package/chunks/chunk-55YW6EUC.js +8 -0
  11. package/chunks/chunk-BQDEPKIG.js +46 -0
  12. package/chunks/{chunk-LONWTJOE.js → chunk-BS7Q7KA6.js} +8 -8
  13. package/chunks/chunk-DZKI2CAC.js +3 -0
  14. package/chunks/{chunk-TDFF4ZGY.js → chunk-E2KMVG7F.js} +1 -1
  15. package/chunks/chunk-ECXO253T.js +2580 -0
  16. package/chunks/chunk-FPGKJJJY.js +13 -0
  17. package/chunks/chunk-FY3LL4OC.js +8 -0
  18. package/chunks/chunk-HJK3NKAR.js +8 -0
  19. package/chunks/{chunk-ZABAV4XA.js → chunk-HRD7WD3P.js} +3 -3
  20. package/chunks/{chunk-GCMUSGTT.js → chunk-L2FKLLEC.js} +1 -1
  21. package/chunks/chunk-MZ73LBEY.js +9 -0
  22. package/chunks/chunk-N2BE647T.js +10 -0
  23. package/chunks/chunk-O2WOUWDJ.js +121 -0
  24. package/chunks/{chunk-UICLGQTV.js → chunk-OWEBLTAN.js} +1 -1
  25. package/chunks/{chunk-KYNP66YS.js → chunk-P24OL22U.js} +8 -8
  26. package/chunks/chunk-PFXCFIHY.js +8 -0
  27. package/chunks/{chunk-FI2FSW7J.js → chunk-VWM3GUBH.js} +1 -1
  28. package/chunks/chunk-WL27X35X.js +44 -0
  29. package/chunks/chunk-ZUQRP3N6.js +9 -0
  30. package/chunks/{computer-use-V2DT2IKO.js → computer-use-DIGHVJ7N.js} +7 -7
  31. package/chunks/{cron-create-JINCFLKY.js → cron-create-5RRFCP36.js} +1 -1
  32. package/chunks/{cron-delete-RF6JLUAV.js → cron-delete-7DTRWCSV.js} +1 -1
  33. package/chunks/{cron-list-VXLBAXZ3.js → cron-list-HY6XJD7D.js} +1 -1
  34. package/chunks/de-MINTIKBC.js +23 -0
  35. package/chunks/{edit-ZB4SONLT.js → edit-IVOZQDG7.js} +17 -17
  36. package/chunks/en-V4AM2EKE.js +23 -0
  37. package/chunks/{enter-worktree-CAFTW46C.js → enter-worktree-LQKNE24C.js} +1 -1
  38. package/chunks/{enterPlanMode-XSNXJJMC.js → enterPlanMode-AMKRMA4Q.js} +1 -1
  39. package/chunks/{exit-worktree-U37YLKJC.js → exit-worktree-353X52E6.js} +1 -1
  40. package/chunks/{exitPlanMode-XKAZCVAV.js → exitPlanMode-FA7FBOPZ.js} +1 -1
  41. package/chunks/fr-XRDTBTRU.js +23 -0
  42. package/chunks/{glob-LPIFPVGX.js → glob-OLQLERJP.js} +1 -1
  43. package/chunks/{goal-tools-VAH424PW.js → goal-tools-POD6LCKM.js} +1 -1
  44. package/chunks/grep-WCOSLJAC.js +22 -0
  45. package/chunks/ja-OYFHC7MP.js +23 -0
  46. package/chunks/{keychain-token-storage-UTWIIKCK.js → keychain-token-storage-BCODB632.js} +1 -1
  47. package/chunks/ls-JORGCXES.js +15 -0
  48. package/chunks/{lsp-H4EXPHFD.js → lsp-Y46R5DO5.js} +1 -1
  49. package/chunks/mcp-client-UUQFLTQ2.js +3 -0
  50. package/chunks/monitor-S7LII2PV.js +32 -0
  51. package/chunks/notebook-edit-R35SRELR.js +17 -0
  52. package/chunks/openaiContentGenerator-7UTX34FH.js +52 -0
  53. package/chunks/pt-6DJAKXHE.js +23 -0
  54. package/chunks/read-file-UNA4JSSL.js +3 -0
  55. package/chunks/ripGrep-LSOMEB27.js +3 -0
  56. package/chunks/ru-4UMYCMY6.js +23 -0
  57. package/chunks/scheduler-BCZEO32E.js +8 -0
  58. package/chunks/{send-message-5XHDGHSN.js → send-message-VY4DP63A.js} +1 -1
  59. package/chunks/shell-BXOPTHWD.js +3 -0
  60. package/chunks/{skill-FCVSGCSN.js → skill-3RC6M3O5.js} +4 -4
  61. package/chunks/symbol-search-YNGX4Z5T.js +19 -0
  62. package/chunks/{syntheticOutput-OIPRFBVD.js → syntheticOutput-4JANVS4D.js} +1 -1
  63. package/chunks/{task-create-QP44DKH4.js → task-create-NRBVXURQ.js} +1 -1
  64. package/chunks/{task-detach-AUTU6C4G.js → task-detach-VHDDAO2K.js} +1 -1
  65. package/chunks/{task-list-U2WAGMM7.js → task-list-T2IET466.js} +1 -1
  66. package/chunks/{task-stop-GN5WZ3IA.js → task-stop-OEAEE5R7.js} +1 -1
  67. package/chunks/{task-update-26N2AUQT.js → task-update-4ANRU74G.js} +1 -1
  68. package/chunks/{team-create-TN2KN27J.js → team-create-RUBIKSDJ.js} +1 -1
  69. package/chunks/team-delete-M4ORNSTT.js +8 -0
  70. package/chunks/{todoWrite-JN3ZV5O2.js → todoWrite-RN2OP46T.js} +1 -1
  71. package/chunks/{tool-search-VPMEQKAS.js → tool-search-O2ZT6LK7.js} +1 -1
  72. package/chunks/{web-fetch-CVAOVOZM.js → web-fetch-VA2BZ4VR.js} +1 -1
  73. package/chunks/{web-search-77CUPTFY.js → web-search-TZUX7I6D.js} +3 -5
  74. package/chunks/{workflow-JNZRGHJ4.js → workflow-7YOFJC77.js} +2 -2
  75. package/chunks/write-file-NK4IW2I5.js +15 -0
  76. package/cli.js +473 -451
  77. package/locales/ca.js +6 -3
  78. package/locales/de.js +6 -3
  79. package/locales/en.js +35 -3
  80. package/locales/fr.js +6 -3
  81. package/locales/ja.js +6 -3
  82. package/locales/pt.js +6 -3
  83. package/locales/ru.js +6 -3
  84. package/npm-postinstall.js +1 -1
  85. package/package.json +2 -2
  86. package/chunks/agent-JDATO222.js +0 -3
  87. package/chunks/agent-headless-ZOFNY4CF.js +0 -3
  88. package/chunks/ca-JKEHLTNL.js +0 -23
  89. package/chunks/chunk-2LVAK6TV.js +0 -80
  90. package/chunks/chunk-5JCW6FH6.js +0 -8
  91. package/chunks/chunk-7AEOFDY3.js +0 -8
  92. package/chunks/chunk-AEYNMLMW.js +0 -36
  93. package/chunks/chunk-DEN6RR3B.js +0 -3
  94. package/chunks/chunk-DUB7JMQV.js +0 -13
  95. package/chunks/chunk-HRCRNKY2.js +0 -8
  96. package/chunks/chunk-IV6PS6DB.js +0 -8
  97. package/chunks/chunk-QNXNECWR.js +0 -2602
  98. package/chunks/chunk-RH3AEZWO.js +0 -9
  99. package/chunks/chunk-SMTY6M3W.js +0 -10
  100. package/chunks/chunk-TKEFJ3O3.js +0 -9
  101. package/chunks/chunk-V2V3OF76.js +0 -56
  102. package/chunks/chunk-Y3SZK63U.js +0 -120
  103. package/chunks/chunk-ZSGBDQXU.js +0 -11
  104. package/chunks/de-GMGNR5CZ.js +0 -23
  105. package/chunks/en-3NQMLVKW.js +0 -23
  106. package/chunks/fr-WS3EBB36.js +0 -23
  107. package/chunks/grep-IF4GTD5A.js +0 -22
  108. package/chunks/ja-GBCDQ43R.js +0 -23
  109. package/chunks/ls-3EEHZY4W.js +0 -15
  110. package/chunks/mcp-client-EUPXG3VF.js +0 -3
  111. package/chunks/monitor-KBWRPPZ5.js +0 -32
  112. package/chunks/notebook-edit-K3KNR6DI.js +0 -17
  113. package/chunks/openaiContentGenerator-2NF5JGUC.js +0 -47
  114. package/chunks/pt-VID6J2CM.js +0 -23
  115. package/chunks/read-file-SRDZKBNS.js +0 -3
  116. package/chunks/ripGrep-675JNT4W.js +0 -3
  117. package/chunks/ru-EB6V6EAN.js +0 -23
  118. package/chunks/scheduler-O36AJTWS.js +0 -8
  119. package/chunks/shell-A7NRVDCY.js +0 -3
  120. package/chunks/symbol-search-ZM3HFCUV.js +0 -19
  121. package/chunks/team-delete-XCKD5FBZ.js +0 -8
  122. package/chunks/write-file-FJCU2PYT.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{ma as P}from"./chunk-ECXO253T.js";import"./chunk-FY3LL4OC.js";import"./chunk-BQDEPKIG.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-DZKI2CAC.js";import"./chunk-ZUQRP3N6.js";import"./chunk-OWEBLTAN.js";import"./chunk-3TTI3ZQT.js";import"./chunk-L2FKLLEC.js";import"./chunk-N2BE647T.js";import"./chunk-QXSBPCBA.js";import"./chunk-HRD7WD3P.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-55YW6EUC.js";import"./chunk-355M6IU5.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-O2WOUWDJ.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-FPGKJJJY.js";import"./chunk-42UM7T4B.js";import"./chunk-HJK3NKAR.js";import"./chunk-46FFWNRO.js";import"./chunk-BS7Q7KA6.js";import"./chunk-MZ73LBEY.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import"./chunk-P24OL22U.js";import{P as l,ea as c}from"./chunk-WL27X35X.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
+ */
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
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-KYNP66YS.js";import"./chunk-AEYNMLMW.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};
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-P24OL22U.js";import"./chunk-WL27X35X.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
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Matilda
@@ -0,0 +1,3 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{$b as d,Yb as a,Zb as b,_b as c,ac as e,bc as f,cc as g}from"./chunk-ECXO253T.js";import"./chunk-FY3LL4OC.js";import"./chunk-BQDEPKIG.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-DZKI2CAC.js";import"./chunk-ZUQRP3N6.js";import"./chunk-OWEBLTAN.js";import"./chunk-3TTI3ZQT.js";import"./chunk-L2FKLLEC.js";import"./chunk-N2BE647T.js";import"./chunk-QXSBPCBA.js";import"./chunk-HRD7WD3P.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-55YW6EUC.js";import"./chunk-355M6IU5.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-O2WOUWDJ.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-FPGKJJJY.js";import"./chunk-42UM7T4B.js";import"./chunk-HJK3NKAR.js";import"./chunk-46FFWNRO.js";import"./chunk-BS7Q7KA6.js";import"./chunk-MZ73LBEY.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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-ZABAV4XA.js";import"./chunk-V6UPUMP3.js";import"./chunk-Y3SZK63U.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import{Pb as a,Xa as o}from"./chunk-CI5CVVGI.js";import"./chunk-IV6PS6DB.js";import"./chunk-6RK6IJY5.js";import"./chunk-TKEFJ3O3.js";import"./chunk-7AEOFDY3.js";import"./chunk-XPVKH5TC.js";import{f as S,g as v,m as y,n as b}from"./chunk-KYNP66YS.js";import{Y as f}from"./chunk-AEYNMLMW.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
3
+ import{a as p,b as C,d as E,e as w}from"./chunk-HRD7WD3P.js";import"./chunk-V6UPUMP3.js";import"./chunk-O2WOUWDJ.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-FPGKJJJY.js";import{Pb as r,Xa as a}from"./chunk-42UM7T4B.js";import"./chunk-HJK3NKAR.js";import"./chunk-46FFWNRO.js";import"./chunk-MZ73LBEY.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import{f as S,g as v,m as y,n as b}from"./chunk-P24OL22U.js";import{ea as u}from"./chunk-WL27X35X.js";import"./chunk-UM6CLO7D.js";import"./chunk-HEJO7OBH.js";import{b as f}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";f();import L from"path";var t=u("SKILL"),D=`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.
@@ -24,10 +24,10 @@ Important:
24
24
  - \`bash scripts/init.sh\` -> \`bash /path/to/skill/scripts/init.sh\`
25
25
  - \`python scripts/helper.py\` -> \`python /path/to/skill/scripts/helper.py\`
26
26
  - \`reference.md\` -> \`/path/to/skill/reference.md\`
27
- </skills_instructions>`,w=class n extends v{constructor(s){let m={type:"object",properties:{skill:{type:"string",description:'The skill or command name. E.g., "pdf" or "xlsx"'},args:{type:"string",description:"Optional arguments for model-invocable slash commands."}},required:["skill"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema#"};super(n.Name,b.SKILL,$,"read",m,!1,!1);this.config=s;let k=s.getSkillManager();if(!k)throw new Error("SkillManager not available");this.skillManager=k,this.removeChangeListener=this.skillManager.addChangeListener(()=>this.refreshSkills()),this.refreshSkills()}static Name=y.SKILL;skillManager;availableSkills=[];pendingConditionalSkillNames=new Set;modelInvocableCommands=[];loadedSkillNames=new Set;removeChangeListener;async refreshSkills(){try{let s=await C(this.skillManager,this.config);this.availableSkills=s.availableSkills,this.pendingConditionalSkillNames=s.pendingConditionalSkillNames,this.modelInvocableCommands=s.modelInvocableCommands}catch(s){r.warn("Failed to load skills for Skills tool:",s),this.availableSkills=[],this.pendingConditionalSkillNames=new Set,this.modelInvocableCommands=[]}}validateToolParams(s){if(!s.skill||typeof s.skill!="string"||s.skill.trim()==="")return'Parameter "skill" must be a non-empty string.';if(s.args!==void 0&&typeof s.args!="string")return'Parameter "args" must be a string when provided.';if(this.availableSkills.some(i=>i.name===s.skill)||this.modelInvocableCommands.some(i=>i.name===s.skill))return null;if(this.config.getDisabledSkillNames().has(s.skill.toLowerCase()))return`Skill "${s.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;if(this.pendingConditionalSkillNames.has(s.skill))return`Skill "${s.skill}" is gated by path-based activation (paths: frontmatter) and is not yet available. Access a file matching its paths patterns first to activate it.`;let e=[...this.availableSkills.map(i=>i.name),...this.modelInvocableCommands.map(i=>i.name)];return e.length===0?`Skill "${s.skill}" not found. No skills are currently available.`:`Skill "${s.skill}" not found. Available skills: ${e.join(", ")}`}createInvocation(s){return new g(this.config,this.skillManager,s,m=>this.loadedSkillNames.add(m),this.config.getModelInvocableCommandsExecutor())}toAutoClassifierInput(s){return s.args===void 0?{skill:s.skill}:{skill:s.skill,args:s.args}}getAvailableSkillNames(){return this.availableSkills.map(s=>s.name)}getLoadedSkillNames(){return this.loadedSkillNames}clearLoadedSkills(){this.loadedSkillNames.clear()}dispose(){this.removeChangeListener()}},g=class extends S{constructor(s,m,k,e,i=null){super(k);this.config=s;this.skillManager=m;this.onSkillLoaded=e;this.commandExecutor=i}promptId="";setPromptId(s){this.promptId=s}getDescription(){return this.params.args===void 0?`Use skill: "${this.params.skill}"`:`Use skill: "${this.params.skill}" with args: "${D(this.params.args)}"`}async getDefaultPermission(){return"ask"}async execute(s,m){if(this.config.getDisabledSkillNames().has(this.params.skill.toLowerCase())){if(this.commandExecutor)try{let i=await this.commandExecutor(this.params.skill,this.params.args??"");if(i&&typeof i=="object"&&"error"in i)return{llmContent:i.error,returnDisplay:i.error};if(typeof i=="string")return{llmContent:[{text:i}],returnDisplay:`Delegated to command: ${this.params.skill}`}}catch{}o(this.config,new a(this.params.skill,!1,this.promptId));let e=`Skill "${this.params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;return{llmContent:e,returnDisplay:e}}try{let e=await this.skillManager.loadSkillForRuntime(this.params.skill);if(!e){if(this.commandExecutor){let l=await this.commandExecutor(this.params.skill,this.params.args??"");if(l&&typeof l=="object"&&"error"in l)return o(this.config,new a(this.params.skill,!1,this.promptId)),{llmContent:l.error,returnDisplay:l.error};if(typeof l=="string")return o(this.config,new a(this.params.skill,!0,this.promptId)),this.onSkillLoaded(this.params.skill),{llmContent:[{text:l}],returnDisplay:`Executed command: ${this.params.skill}`}}o(this.config,new a(this.params.skill,!1,this.promptId));let d=this.skillManager.getParseErrors(),t=[];for(let[l,x]of d)l.includes(this.params.skill)&&t.push(`Parse error at ${l}: ${x.message}`);let c=t.length>0?`
27
+ </skills_instructions>`,I=class n extends v{constructor(s){let m={type:"object",properties:{skill:{type:"string",description:'The skill or command name. E.g., "pdf" or "xlsx"'},args:{type:"string",description:"Optional arguments for model-invocable slash commands."}},required:["skill"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema#"};super(n.Name,b.SKILL,D,"read",m,!1,!1);this.config=s;let k=s.getSkillManager();if(!k)throw new Error("SkillManager not available");this.skillManager=k,this.removeChangeListener=this.skillManager.addChangeListener(()=>this.refreshSkills()),this.refreshSkills()}static Name=y.SKILL;skillManager;availableSkills=[];pendingConditionalSkillNames=new Set;modelInvocableCommands=[];loadedSkillNames=new Set;removeChangeListener;async refreshSkills(){try{let s=await C(this.skillManager,this.config);this.availableSkills=s.availableSkills,this.pendingConditionalSkillNames=s.pendingConditionalSkillNames,this.modelInvocableCommands=s.modelInvocableCommands}catch(s){t.warn("Failed to load skills for Skills tool:",s),this.availableSkills=[],this.pendingConditionalSkillNames=new Set,this.modelInvocableCommands=[]}}validateToolParams(s){if(!s.skill||typeof s.skill!="string"||s.skill.trim()==="")return'Parameter "skill" must be a non-empty string.';if(s.args!==void 0&&typeof s.args!="string")return'Parameter "args" must be a string when provided.';if(this.availableSkills.some(i=>i.name===s.skill)||this.modelInvocableCommands.some(i=>i.name===s.skill))return null;if(this.config.getDisabledSkillNames().has(s.skill.toLowerCase()))return`Skill "${s.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;if(this.pendingConditionalSkillNames.has(s.skill))return`Skill "${s.skill}" is gated by path-based activation (paths: frontmatter) and is not yet available. Access a file matching its paths patterns first to activate it.`;let e=[...this.availableSkills.map(i=>i.name),...this.modelInvocableCommands.map(i=>i.name)];return e.length===0?`Skill "${s.skill}" not found. No skills are currently available.`:`Skill "${s.skill}" not found. Available skills: ${e.join(", ")}`}createInvocation(s){return new g(this.config,this.skillManager,s,m=>this.loadedSkillNames.add(m),this.config.getModelInvocableCommandsExecutor())}toAutoClassifierInput(s){return s.args===void 0?{skill:s.skill}:{skill:s.skill,args:s.args}}getAvailableSkillNames(){return this.availableSkills.map(s=>s.name)}getLoadedSkillNames(){return this.loadedSkillNames}clearLoadedSkills(){this.loadedSkillNames.clear()}dispose(){this.removeChangeListener()}},g=class extends S{constructor(s,m,k,e,i=null){super(k);this.config=s;this.skillManager=m;this.onSkillLoaded=e;this.commandExecutor=i}promptId="";setPromptId(s){this.promptId=s}getDescription(){return this.params.args===void 0?`Use skill: "${this.params.skill}"`:`Use skill: "${this.params.skill}" with args: "${M(this.params.args)}"`}async getDefaultPermission(){return"ask"}async execute(s,m){if(this.config.getDisabledSkillNames().has(this.params.skill.toLowerCase())){if(this.commandExecutor)try{let i=await this.commandExecutor(this.params.skill,this.params.args??"");if(i&&typeof i=="object"&&"error"in i)return{llmContent:i.error,returnDisplay:i.error};if(typeof i=="string")return{llmContent:[{text:i}],returnDisplay:`Delegated to command: ${this.params.skill}`}}catch{}a(this.config,new r(this.params.skill,!1,this.promptId));let e=`Skill "${this.params.skill}" is disabled. Re-enable it via /skills or remove it from skills.disabled.`;return{llmContent:e,returnDisplay:e}}try{let e=await this.skillManager.loadSkillForRuntime(this.params.skill);if(!e){if(this.commandExecutor){let l=await this.commandExecutor(this.params.skill,this.params.args??"");if(l&&typeof l=="object"&&"error"in l)return a(this.config,new r(this.params.skill,!1,this.promptId)),{llmContent:l.error,returnDisplay:l.error};if(typeof l=="string")return a(this.config,new r(this.params.skill,!0,this.promptId)),this.onSkillLoaded(this.params.skill),{llmContent:[{text:l}],returnDisplay:`Executed command: ${this.params.skill}`}}a(this.config,new r(this.params.skill,!1,this.promptId));let d=this.skillManager.getParseErrors(),o=[];for(let[l,$]of d)l.includes(this.params.skill)&&o.push(`Parse error at ${l}: ${$.message}`);let h=o.length>0?`
28
28
  Errors:
29
- ${t.join(`
30
- `)}`:"";return{llmContent:`Skill "${this.params.skill}" not found.${c}`,returnDisplay:`Skill "${this.params.skill}" not found.${c}`}}if(o(this.config,new a(this.params.skill,!0,this.promptId)),this.onSkillLoaded(this.params.skill),E(this.config.getPermissionManager(),e.allowedTools),r.debug("Skill hooks check:",{hasHooks:!!e.hooks,hooksKeys:e.hooks?Object.keys(e.hooks):[],skillName:e.name}),e.hooks){let d=this.config.getHookSystem(),t=this.config.getSessionId();if(r.debug("Hook system and session:",{hasHookSystem:!!d,sessionId:t}),d&&t){let c=d.getSessionHooksManager(),l=I(c,t,e);l>0?r.info(`Registered ${l} hooks from skill "${this.params.skill}"`):r.warn(`No hooks registered from skill "${this.params.skill}"`)}}else r.warn(`Skill "${this.params.skill}" has no hooks to register`);let i=L.dirname(e.filePath);return{llmContent:[{text:p(i,e.body)}],returnDisplay:e.description,modelOverride:e.model}}catch(e){let i=e instanceof Error?e.message:String(e);return r.error(`[SkillsTool] Error using skill: ${i}`),o(this.config,new a(this.params.skill,!1,this.promptId)),{llmContent:`Failed to load skill "${this.params.skill}": ${i}`,returnDisplay:`Failed to load skill "${this.params.skill}": ${i}`}}}};function D(n){let h=s=>s.replace(/([\\`*_{}[\]()#+\-.!|>])/g,"\\$1");return n.length>120?`${h(n.slice(0,117))}...`:h(n)}export{w as SkillTool,p as buildSkillLlmContent};
29
+ ${o.join(`
30
+ `)}`:"";return{llmContent:`Skill "${this.params.skill}" not found.${h}`,returnDisplay:`Skill "${this.params.skill}" not found.${h}`}}a(this.config,new r(this.params.skill,!0,this.promptId)),this.onSkillLoaded(this.params.skill);let i=e.level!=="project"||this.config.isTrustedFolder();if(i||t.warn(`Skill "${this.params.skill}" is from an untrusted folder: its allowed tools and hooks are not applied`),i&&E(this.config.getPermissionManager(),e.allowedTools),t.debug("Skill hooks check:",{hasHooks:!!e.hooks,hooksKeys:e.hooks?Object.keys(e.hooks):[],skillName:e.name}),e.hooks&&i){let d=this.config.getHookSystem(),o=this.config.getSessionId();if(t.debug("Hook system and session:",{hasHookSystem:!!d,sessionId:o}),d&&o){let h=d.getSessionHooksManager(),l=w(h,o,e);l>0?t.info(`Registered ${l} hooks from skill "${this.params.skill}"`):t.warn(`No hooks registered from skill "${this.params.skill}"`)}}else t.warn(`Skill "${this.params.skill}" has no hooks to register`);let x=L.dirname(e.filePath);return{llmContent:[{text:p(x,e.body)}],returnDisplay:e.description,modelOverride:e.model}}catch(e){let i=e instanceof Error?e.message:String(e);return t.error(`[SkillsTool] Error using skill: ${i}`),a(this.config,new r(this.params.skill,!1,this.promptId)),{llmContent:`Failed to load skill "${this.params.skill}": ${i}`,returnDisplay:`Failed to load skill "${this.params.skill}": ${i}`}}}};function M(n){let c=s=>s.replace(/([\\`*_{}[\]()#+\-.!|>])/g,"\\$1");return n.length>120?`${c(n.slice(0,117))}...`:c(n)}export{I as SkillTool,p as buildSkillLlmContent};
31
31
  /**
32
32
  * @license
33
33
  * Copyright 2025 Matilda
@@ -0,0 +1,19 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import{ya as w,za as A}from"./chunk-BQDEPKIG.js";import{f as h,g as x,m as d,n as S}from"./chunk-P24OL22U.js";import{ea as g}from"./chunk-WL27X35X.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-6RK6IJY5.js";import"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.js";import"./chunk-HEJO7OBH.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-46FFWNRO.js";import"./chunk-P24OL22U.js";import"./chunk-WL27X35X.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as STRUCTURED_OUTPUT_REDACTED_ARGS,b as SyntheticOutputTool};
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a,b}from"./chunk-FI2FSW7J.js";import"./chunk-HRCRNKY2.js";import"./chunk-UICLGQTV.js";import"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-7AEOFDY3.js";import"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as TaskCreateTool,a as truncateForConfirmation};
3
+ import{a,b}from"./chunk-VWM3GUBH.js";import"./chunk-FY3LL4OC.js";import"./chunk-OWEBLTAN.js";import"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-PFXCFIHY.js";import"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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-SMTY6M3W.js";import"./chunk-V6UPUMP3.js";import{f as i,g as c,m as n,n as u}from"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.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.`)+`
3
+ import{a as d}from"./chunk-N2BE647T.js";import"./chunk-V6UPUMP3.js";import{f as i,g as c,m as n,n as u}from"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{i as d}from"./chunk-HRCRNKY2.js";import"./chunk-UICLGQTV.js";import{c as u,d as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-7AEOFDY3.js";import{f as l,g as m,m as p,n as c}from"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.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(`
3
+ import{i as d}from"./chunk-FY3LL4OC.js";import"./chunk-OWEBLTAN.js";import{c as u,d as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-PFXCFIHY.js";import{f as l,g as m,m as p,n as c}from"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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
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
5
  /**
6
6
  * @license
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{f as T,g as y,m as h,n as $}from"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.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}".
3
+ import{f as T,g as y,m as h,n as $}from"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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-FI2FSW7J.js";import{a as h,b as f,e as $,f as y,g,h as v,i as I}from"./chunk-HRCRNKY2.js";import"./chunk-UICLGQTV.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-7AEOFDY3.js";import{f as T,g as C,m as b,n as D}from"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.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(`
3
+ import{a as N}from"./chunk-VWM3GUBH.js";import{a as h,b as f,e as $,f as y,g,h as v,i as I}from"./chunk-FY3LL4OC.js";import"./chunk-OWEBLTAN.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-PFXCFIHY.js";import{f as T,g as C,m as b,n as D}from"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{Nc as u,Oc as C}from"./chunk-QNXNECWR.js";import{j as A}from"./chunk-HRCRNKY2.js";import"./chunk-ZSGBDQXU.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-DEN6RR3B.js";import{i as v}from"./chunk-RH3AEZWO.js";import{b as y,d as w,e as T,f as k,l as o,m as b}from"./chunk-UICLGQTV.js";import"./chunk-V2V3OF76.js";import"./chunk-GCMUSGTT.js";import"./chunk-SMTY6M3W.js";import{g as f}from"./chunk-QXSBPCBA.js";import"./chunk-ZABAV4XA.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-5JCW6FH6.js";import"./chunk-2LVAK6TV.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-Y3SZK63U.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-DUB7JMQV.js";import"./chunk-CI5CVVGI.js";import"./chunk-IV6PS6DB.js";import"./chunk-6RK6IJY5.js";import"./chunk-LONWTJOE.js";import"./chunk-TKEFJ3O3.js";import"./chunk-7AEOFDY3.js";import"./chunk-XPVKH5TC.js";import{f as c,g,m as h,n as p}from"./chunk-KYNP66YS.js";import{c as d}from"./chunk-AEYNMLMW.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:
3
+ import{Ec as u,Fc as C}from"./chunk-ECXO253T.js";import{j as A}from"./chunk-FY3LL4OC.js";import"./chunk-BQDEPKIG.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-DZKI2CAC.js";import{i as v}from"./chunk-ZUQRP3N6.js";import{b as y,d as w,e as T,f as k,l as o,m as b}from"./chunk-OWEBLTAN.js";import"./chunk-3TTI3ZQT.js";import"./chunk-L2FKLLEC.js";import"./chunk-N2BE647T.js";import{g as f}from"./chunk-QXSBPCBA.js";import"./chunk-HRD7WD3P.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-55YW6EUC.js";import"./chunk-355M6IU5.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-O2WOUWDJ.js";import"./chunk-225CZWD7.js";import"./chunk-LBQNFSZ2.js";import"./chunk-FPGKJJJY.js";import"./chunk-42UM7T4B.js";import"./chunk-HJK3NKAR.js";import"./chunk-46FFWNRO.js";import"./chunk-BS7Q7KA6.js";import"./chunk-MZ73LBEY.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import{f as c,g,m as h,n as p}from"./chunk-P24OL22U.js";import{c as d}from"./chunk-WL27X35X.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
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
@@ -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-ZUQRP3N6.js";import{n as o}from"./chunk-OWEBLTAN.js";import{e as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-PFXCFIHY.js";import{f as l,g as c,m as p,n as u}from"./chunk-P24OL22U.js";import{ea as i}from"./chunk-WL27X35X.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
+ */
@@ -1,3 +1,3 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{a,b,c}from"./chunk-LONWTJOE.js";import"./chunk-TKEFJ3O3.js";import"./chunk-7AEOFDY3.js";import"./chunk-XPVKH5TC.js";import"./chunk-KYNP66YS.js";import"./chunk-AEYNMLMW.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{c as TodoWriteTool,b as listTodoSessions,a as readTodosForSession};
3
+ import{a,b,c}from"./chunk-BS7Q7KA6.js";import"./chunk-MZ73LBEY.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import"./chunk-P24OL22U.js";import"./chunk-WL27X35X.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{lb as N}from"./chunk-CI5CVVGI.js";import"./chunk-IV6PS6DB.js";import"./chunk-6RK6IJY5.js";import"./chunk-7AEOFDY3.js";import"./chunk-XPVKH5TC.js";import{f as v,g as R,m as E,n as L}from"./chunk-KYNP66YS.js";import{Y as S}from"./chunk-AEYNMLMW.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.
3
+ import{lb as N}from"./chunk-42UM7T4B.js";import"./chunk-HJK3NKAR.js";import"./chunk-46FFWNRO.js";import"./chunk-PFXCFIHY.js";import"./chunk-XPVKH5TC.js";import{f as v,g as R,m as E,n as L}from"./chunk-P24OL22U.js";import{ea as S}from"./chunk-WL27X35X.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