@maincode-ai/matilda-code 0.22.2 → 0.22.3-nightly.20261109.f08200276
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.
- package/README.md +1 -1
- package/chunks/agent-B3ZDDRG6.js +3 -0
- package/chunks/agent-headless-SGYTO6WW.js +3 -0
- package/chunks/{askUserQuestion-DHYKAZWH.js → askUserQuestion-Y66GA5LV.js} +1 -1
- package/chunks/ca-KKKDEIJT.js +23 -0
- package/chunks/chunk-6SPPO7RK.js +62 -0
- package/chunks/chunk-6X3HPMAU.js +56 -0
- package/chunks/{chunk-FY3LL4OC.js → chunk-7SPPCSW2.js} +1 -1
- package/chunks/{chunk-BQDEPKIG.js → chunk-ADMI5U2X.js} +2 -2
- package/chunks/chunk-AXPU2T2O.js +10 -0
- package/chunks/{chunk-DZKI2CAC.js → chunk-C2AKSF3S.js} +1 -1
- package/chunks/{chunk-HRD7WD3P.js → chunk-GFKFHWDN.js} +1 -1
- package/chunks/chunk-HAM3C2JN.js +2586 -0
- package/chunks/{chunk-OF7ORAN6.js → chunk-HSSKS2BO.js} +30 -30
- package/chunks/{chunk-VWM3GUBH.js → chunk-I4KER2VG.js} +1 -1
- package/chunks/{chunk-PFXCFIHY.js → chunk-JRGQUM3K.js} +1 -1
- package/chunks/chunk-PZF4OFAZ.js +12 -0
- package/chunks/{chunk-MZ73LBEY.js → chunk-RDTF45AP.js} +1 -1
- package/chunks/{chunk-HJK3NKAR.js → chunk-SHISTILE.js} +1 -1
- package/chunks/{chunk-OWEBLTAN.js → chunk-TGRZ364D.js} +1 -1
- package/chunks/chunk-TVTJEK4V.js +12 -0
- package/chunks/{chunk-BS7Q7KA6.js → chunk-U6ATDQUV.js} +1 -1
- package/chunks/{chunk-E2KMVG7F.js → chunk-UJWYKBZM.js} +1 -1
- package/chunks/{chunk-REUZDMLM.js → chunk-W3ZB63AP.js} +25 -25
- package/chunks/chunk-YTKDUEUJ.js +8 -0
- package/chunks/{chunk-ZUQRP3N6.js → chunk-YZ33K24S.js} +1 -1
- package/chunks/chunk-ZRUOQBYQ.js +207 -0
- package/chunks/{computer-use-5T3ZH24D.js → computer-use-ZUTEIFET.js} +5 -17
- package/chunks/{cron-create-5RRFCP36.js → cron-create-4AQ43RPW.js} +1 -1
- package/chunks/cron-delete-HB7V5CZ5.js +3 -0
- package/chunks/cron-list-DIZZQW44.js +5 -0
- package/chunks/{de-MJBGC47E.js → de-2Z3VYN7K.js} +1 -1
- package/chunks/{edit-Y7YSDGLT.js → edit-ESBQCHHP.js} +1 -1
- package/chunks/en-WPNO63RZ.js +23 -0
- package/chunks/{enter-worktree-5ZGIYDUE.js → enter-worktree-3DNEZJHH.js} +1 -1
- package/chunks/{enterPlanMode-TWD4MXCW.js → enterPlanMode-AVYWCGBL.js} +1 -1
- package/chunks/{exit-worktree-3F5UY76U.js → exit-worktree-JRQ6Z7AB.js} +1 -1
- package/chunks/{exitPlanMode-HWK5EUVS.js → exitPlanMode-DRWHFT3R.js} +10 -10
- package/chunks/fr-S2YBRXGB.js +23 -0
- package/chunks/{glob-H7DNNPJ4.js → glob-ZJ2IBSBL.js} +1 -1
- package/chunks/{goal-tools-CJINJJ3Y.js → goal-tools-APHZOFAF.js} +1 -1
- package/chunks/{grep-5MCMGW6A.js → grep-7SKE6UM4.js} +1 -1
- package/chunks/{ja-OEXP6Z3S.js → ja-NOFHSWYP.js} +1 -1
- package/chunks/ls-I6JUFOTE.js +15 -0
- package/chunks/{lsp-Y46R5DO5.js → lsp-JMVZE3IL.js} +1 -1
- package/chunks/mcp-client-WGLA6WFP.js +3 -0
- package/chunks/monitor-24WFRG6D.js +32 -0
- package/chunks/notebook-edit-75IBMHFG.js +17 -0
- package/chunks/openaiContentGenerator-SK6CIVEM.js +52 -0
- package/chunks/{pt-PCVIFK7H.js → pt-PF7EEIOB.js} +1 -1
- package/chunks/read-file-PLW5HG6G.js +3 -0
- package/chunks/ripGrep-5I2QHVHA.js +3 -0
- package/chunks/{ru-CB5SIZZM.js → ru-X7QWJTM4.js} +1 -1
- package/chunks/scheduler-V6VOAQ5Q.js +8 -0
- package/chunks/send-message-F2OT25N7.js +8 -0
- package/chunks/shell-3HCOYZFM.js +3 -0
- package/chunks/{skill-5EMGSWRM.js → skill-WUXCNHR2.js} +1 -1
- package/chunks/symbol-search-R7VDY7D2.js +19 -0
- package/chunks/syntheticOutput-ULZO4GEC.js +3 -0
- package/chunks/task-create-ARA6A3IM.js +3 -0
- package/chunks/task-detach-4JGQ6IFW.js +9 -0
- package/chunks/task-list-MUF5W3YQ.js +9 -0
- package/chunks/{task-stop-OEAEE5R7.js → task-stop-JDLVQ7YB.js} +1 -1
- package/chunks/{task-update-4ANRU74G.js → task-update-Z6PWEP2K.js} +1 -1
- package/chunks/{team-create-G4N2NCFN.js → team-create-MERVIMYO.js} +1 -1
- package/chunks/team-delete-7YXVWNUC.js +8 -0
- package/chunks/todoWrite-RJABGUPD.js +3 -0
- package/chunks/tool-call-O4FMFOGR.js +3 -0
- package/chunks/tool-search-UQPAGXZY.js +26 -0
- package/chunks/{web-fetch-VA2BZ4VR.js → web-fetch-3LOJYO2U.js} +1 -1
- package/chunks/{web-search-OVFXJQDS.js → web-search-MPPPKAJ7.js} +1 -1
- package/chunks/{workflow-6VMVM5BG.js → workflow-JA2PZCN3.js} +2 -2
- package/chunks/write-file-R7UW3VKA.js +15 -0
- package/cli.js +449 -465
- package/locales/ca.js +2 -3
- package/locales/de.js +2 -3
- package/locales/en.js +11 -22
- package/locales/fr.js +2 -3
- package/locales/ja.js +2 -3
- package/locales/pt.js +2 -3
- package/locales/ru.js +2 -3
- package/npm-postinstall.js +2 -2
- package/package.json +2 -2
- package/chunks/agent-IJOGVY62.js +0 -3
- package/chunks/agent-headless-FZGKJCVK.js +0 -3
- package/chunks/ca-HHQCT6S2.js +0 -23
- package/chunks/chunk-225CZWD7.js +0 -89
- package/chunks/chunk-3BT7ZYAM.js +0 -121
- package/chunks/chunk-3IG6LNQ3.js +0 -2581
- package/chunks/chunk-46FFWNRO.js +0 -12
- package/chunks/chunk-55YW6EUC.js +0 -8
- package/chunks/chunk-FPGKJJJY.js +0 -13
- package/chunks/chunk-L2FKLLEC.js +0 -12
- package/chunks/chunk-N2BE647T.js +0 -10
- package/chunks/chunk-P24OL22U.js +0 -31
- package/chunks/chunk-VWE5BSHV.js +0 -56
- package/chunks/chunk-WL27X35X.js +0 -44
- package/chunks/cron-delete-7DTRWCSV.js +0 -3
- package/chunks/cron-list-HY6XJD7D.js +0 -5
- package/chunks/en-JITX7JKV.js +0 -23
- package/chunks/fr-WT3R2JCR.js +0 -23
- package/chunks/keychain-token-storage-BCODB632.js +0 -3
- package/chunks/ls-JORGCXES.js +0 -15
- package/chunks/mcp-client-54J5M542.js +0 -3
- package/chunks/monitor-BRJR6PR3.js +0 -32
- package/chunks/notebook-edit-UCCVQ4JP.js +0 -17
- package/chunks/openaiContentGenerator-H6JOS3XU.js +0 -52
- package/chunks/read-file-LVMBCRCT.js +0 -3
- package/chunks/ripGrep-F6AJSDKU.js +0 -3
- package/chunks/scheduler-XAOD6LG6.js +0 -8
- package/chunks/send-message-VY4DP63A.js +0 -8
- package/chunks/shell-QUDC6MJK.js +0 -3
- package/chunks/symbol-search-YNGX4Z5T.js +0 -19
- package/chunks/syntheticOutput-4JANVS4D.js +0 -3
- package/chunks/task-create-NRBVXURQ.js +0 -3
- package/chunks/task-detach-VHDDAO2K.js +0 -9
- package/chunks/task-list-T2IET466.js +0 -9
- package/chunks/team-delete-M4ORNSTT.js +0 -8
- package/chunks/todoWrite-RN2OP46T.js +0 -3
- package/chunks/tool-search-WEUURHFZ.js +0 -28
- package/chunks/write-file-5ZAZVXBB.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{pa as P}from"./chunk-HAM3C2JN.js";import"./chunk-7SPPCSW2.js";import"./chunk-ADMI5U2X.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-C2AKSF3S.js";import"./chunk-YZ33K24S.js";import"./chunk-TGRZ364D.js";import"./chunk-6X3HPMAU.js";import"./chunk-PZF4OFAZ.js";import"./chunk-AXPU2T2O.js";import"./chunk-QXSBPCBA.js";import"./chunk-GFKFHWDN.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-W3ZB63AP.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-ZRUOQBYQ.js";import"./chunk-LBQNFSZ2.js";import"./chunk-HSSKS2BO.js";import"./chunk-SHISTILE.js";import"./chunk-YTKDUEUJ.js";import"./chunk-U6ATDQUV.js";import"./chunk-RDTF45AP.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-UM6CLO7D.js";import"./chunk-TVTJEK4V.js";import{P as l,ea as c}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as s}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";s();import{stat as V}from"node:fs/promises";import{join as p}from"node:path";s();import{readdir as N,stat as H,rm as F,rmdir as A}from"node:fs/promises";import{join as y}from"node:path";var k=c("HOUSEKEEPING"),U=24*60*60*1e3,$=60*60*1e3,_=20;function T(e){let t=e>0?e*U:$;return new Date(Date.now()-t)}async function b(e){let t={removed:0,errors:0},r=y(l.getGlobalMatildaDir(),P),i=e.excludeSessionIds??new Set,o;try{o=await N(r,{withFileTypes:!0})}catch(n){return G(n)||k.error("readdir failed",n),t}let a=o.filter(n=>n.isDirectory()&&!i.has(n.name)).map(n=>y(r,n.name));for(let n=0;n<a.length;n+=_){let v=a.slice(n,n+_);await Promise.all(v.map(async g=>{try{(await H(g)).mtime<e.cutoffDate&&(await F(g,{recursive:!0,force:!0}),t.removed++)}catch(w){t.errors++,k.error(`failed to sweep ${g}`,w)}}))}return await A(r).catch(()=>{}),t}function G(e){return e?.code==="ENOENT"}s();import{mkdir as Y,open as K,stat as I,unlink as D,writeFile as j}from"node:fs/promises";import{dirname as B}from"node:path";var m=c("HOUSEKEEPING"),q=24*60*60*1e3,J=60*60*1e3;async function R(e,t){let r=e.minIntervalMs??q,i=e.staleLockMs??J;if(await Y(B(e.lockPath),{recursive:!0,mode:448}).catch(()=>{}),await C(e.markerPath,r,e.name))return!1;let o=await h(e.lockPath);if(!o){try{let a=await I(e.lockPath);Date.now()-a.mtimeMs>i&&(await D(e.lockPath).catch(()=>{}),o=await h(e.lockPath))}catch{o=await h(e.lockPath)}if(!o)return m.debug(`${e.name}: skipping, lock held`),!1}try{if(await C(e.markerPath,r,e.name))return!1;let a=!1;try{await t(),a=!0}finally{if(a)try{await j(e.markerPath,new Date().toISOString())}catch(n){m.debug(`${e.name}: marker write failed (cleanup succeeded)`,n)}}return a}finally{await D(e.lockPath).catch(()=>{m.debug(`${e.name}: lock unlink failed (harmless)`)})}}async function C(e,t,r){try{let i=await I(e),o=Date.now()-i.mtimeMs;if(o<t)return m.debug(`${r}: skipping, ran ${o}ms ago`),!0}catch{}return!1}async function h(e){try{return await(await K(e,"wx")).close(),!0}catch(t){if(t?.code==="EEXIST")return!1;throw t}}var u=c("HOUSEKEEPING"),O=10*60*1e3,W=24*60*60*1e3,X=60*1e3,z=7*24*60*60*1e3,Q=60*1e3,f=".file-history-cleanup",d=!1;function pe(e,t){d||(d=!0,Z(e,t).catch(r=>{d=!1,u.error("scheduleFirstPass failed; chain will retry on next start",r)}))}async function Z(e,t){let r=p(l.getGlobalMatildaDir(),f),i=await L(r)?Q:O;u.debug(`first pass in ${i/1e3}s`),setTimeout(()=>S(e,t),i).unref()}async function L(e){try{let t=await V(e);return Date.now()-t.mtimeMs>z}catch{return!0}}async function M(e,t){if(E()<X){u.debug("user active, deferring 10 min"),setTimeout(()=>S(e,t),O).unref();return}try{await x(e,t)}catch(r){u.error("housekeeping pass failed; will retry next cycle",r)}setTimeout(()=>S(e,t),W).unref()}function S(e,t){M(e,t).catch(r=>{u.error("runPass rejected unexpectedly",r)})}async function x(e,t){let r=t.merged.general?.cleanupPeriodDays??30,i=T(r),o=e.getSessionId(),a=l.getGlobalMatildaDir();await R({name:"file-history-cleanup",markerPath:p(a,f),lockPath:p(a,f+".lock")},async()=>{let n=await b({cutoffDate:i,excludeSessionIds:new Set([o])});u.debug(`file-history: removed=${n.removed} errors=${n.errors}`)})}function Se(){d=!1}var we=L,Pe=x,Ee=M,ye=f;export{ye as _FILE_HISTORY_MARKER_FOR_TESTING,we as _needsCatchUpForTesting,Se as _resetForTesting,Pe as _runHousekeepingForTesting,Ee as _runPassForTesting,pe as startBackgroundHousekeeping};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2025 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{b as n,e as h,g as i}from"./chunk-QXSBPCBA.js";import{ka as g,la as p,ra as c,sa as l}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as d}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";d();var m=class extends g{constructor(s,a){super(a);this.config=s}getDescription(){if(this.params.task_id)return`Send message to task ${this.params.task_id}`;let s=this.params.summary??this.params.message.slice(0,50);return`Send to ${this.params.to}: ${s}`}async getDefaultPermission(){return"ask"}async execute(s){if(this.params.task_id){let e=this.config.getBackgroundTaskRegistry(),t=e.get(this.params.task_id);return t?t.status==="paused"?await this.config.resumeBackgroundAgent(this.params.task_id,this.params.message)?{llmContent:`Background task "${this.params.task_id}" resumed with your message as the first continuation instruction.`,returnDisplay:`Resumed ${t.description}`}:{llmContent:`Error: Background task "${this.params.task_id}" could not be resumed.`,returnDisplay:"Task could not be resumed.",error:{message:`Task could not be resumed: ${this.params.task_id}`,type:"send_message_not_running"}}:t.status!=="running"?{llmContent:`Error: Background task "${this.params.task_id}" is not running (status: ${t.status}). Cannot send messages to stopped tasks.`,returnDisplay:`Task not running (${t.status}).`,error:{message:`Task is ${t.status}: ${this.params.task_id}`,type:"send_message_not_running"}}:(e.queueMessage(this.params.task_id,this.params.message),{llmContent:`Message queued for delivery to background task "${this.params.task_id}". The task will receive it at the next tool-round boundary.`,returnDisplay:`Message queued for ${t.description}`}):{llmContent:`Error: No background task found with ID "${this.params.task_id}".`,returnDisplay:"Task not found.",error:{message:`Task not found: ${this.params.task_id}`,type:"send_message_not_found"}}}let a=this.config.getTeamManager();if(!a){let e="No active team and no task_id provided. Either create a team first, or pass `task_id` to message a background task.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let o=this.params.to;if(!o){let e='Recipient "to" is required.';return{llmContent:e,returnDisplay:e,error:{message:e}}}try{if(this.params.type==="shutdown_request"){if(h()){let r="Only the team leader can request shutdowns.";return{llmContent:r,returnDisplay:r,error:{message:r}}}await a.requestShutdown(o);let t=`Shutdown requested for "${o}".`;return{llmContent:t,returnDisplay:t}}if(o==="*"){let t=n()??i;await a.broadcast(this.params.message,t);let r="Message broadcast to all teammates.";return{llmContent:r,returnDisplay:r}}await a.sendMessage(o,this.params.message,n()??i,this.params.summary);let e=`Message sent to "${o}".`;return{llmContent:e,returnDisplay:e}}catch(e){let t=e instanceof Error?e.message:String(e);return{llmContent:`Failed to send message: ${t}`,returnDisplay:`Failed to send message: ${t}`,error:{message:t}}}}},k=class u extends p{constructor(s){super(u.Name,l.SEND_MESSAGE,'Send a message to a teammate (use "to") or to a running background task (use "task_id"). For teams, set "to" to a bare teammate name (no @) or "*" to broadcast. For background tasks, set "task_id" to the id from the launch response or a recovered paused task. Running tasks receive it at the next tool-round boundary; paused recovered tasks are resumed with the message as their first continuation instruction. Your text output is NOT visible to other agents \u2014 use this tool to communicate.',"other",{type:"object",properties:{to:{type:"string",description:'Recipient teammate name, or "*" for broadcast.'},task_id:{type:"string",description:"The ID of the background task (from the launch response or a recovered paused task)."},message:{type:"string",description:"Message text to send.",maxLength:65536},summary:{type:"string",description:"Optional 5-10 word summary for UI display."},type:{type:"string",enum:["shutdown_request"],description:"Structured message type for control flow. When set, routes through the mailbox instead of plain text delivery."}},required:["message"],oneOf:[{required:["to"]},{required:["task_id"]}],additionalProperties:!1},!0,!1,!0,!1,"send message task teammate team communicate notify");this.config=s}static Name=c.SEND_MESSAGE;createInvocation(s){return new m(this.config,s)}toAutoClassifierInput(s){return{to:s.to,task_id:s.task_id,message:s.message,type:s.type}}};export{k as SendMessageTool};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2025 Matilda
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{ac as a,bc as b,cc as c,dc as d,ec as e,fc as f,gc as g}from"./chunk-HAM3C2JN.js";import"./chunk-7SPPCSW2.js";import"./chunk-ADMI5U2X.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-C2AKSF3S.js";import"./chunk-YZ33K24S.js";import"./chunk-TGRZ364D.js";import"./chunk-6X3HPMAU.js";import"./chunk-PZF4OFAZ.js";import"./chunk-AXPU2T2O.js";import"./chunk-QXSBPCBA.js";import"./chunk-GFKFHWDN.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-W3ZB63AP.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-ZRUOQBYQ.js";import"./chunk-LBQNFSZ2.js";import"./chunk-HSSKS2BO.js";import"./chunk-SHISTILE.js";import"./chunk-YTKDUEUJ.js";import"./chunk-U6ATDQUV.js";import"./chunk-RDTF45AP.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-UM6CLO7D.js";import"./chunk-TVTJEK4V.js";import"./chunk-6SPPO7RK.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 w}from"./chunk-
|
|
3
|
+
import{a as p,b as C,d as E,e as w}from"./chunk-GFKFHWDN.js";import"./chunk-V6UPUMP3.js";import"./chunk-ZRUOQBYQ.js";import"./chunk-LBQNFSZ2.js";import{Pb as r,Xa as a}from"./chunk-HSSKS2BO.js";import"./chunk-SHISTILE.js";import"./chunk-RDTF45AP.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-UM6CLO7D.js";import"./chunk-TVTJEK4V.js";import{ea as u,ka as S,la as v,ra as y,sa as b}from"./chunk-6SPPO7RK.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.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{Aa as w,Ba as A}from"./chunk-ADMI5U2X.js";import{ea as g,ka as h,la as x,ra as d,sa as S}from"./chunk-6SPPO7RK.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
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{a,b,c}from"./chunk-TVTJEK4V.js";import"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{a as STRUCTURED_OUTPUT_REDACTED_ARGS,c as SyntheticOutputTool,b as redactedStructuredOutputArgs};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{a,b}from"./chunk-I4KER2VG.js";import"./chunk-7SPPCSW2.js";import"./chunk-TGRZ364D.js";import"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-JRGQUM3K.js";import"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{b as TaskCreateTool,a as truncateForConfirmation};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{a as u}from"./chunk-AXPU2T2O.js";import"./chunk-V6UPUMP3.js";import{ka as i,la as c,ra as o,sa as d}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as a}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";a();var n=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:(u.detach(t)?`Detached background ${t.kind} "${e}". It keeps running after the current request ends, until Matilda Code exits, and reports its completion separately. Stop it with ${o.TASK_STOP} when it is no longer needed.`:`Background ${t.kind} "${e}" is not holding a request open; it keeps running until Matilda Code exits.`)+`
|
|
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,d.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. A detached shell still stops when Matilda Code exits.","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=o.TASK_DETACH;createInvocation(r){return new n(this.config,r)}};export{l as TaskDetachTool};
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2026 Matilda Team
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{i as d}from"./chunk-7SPPCSW2.js";import"./chunk-TGRZ364D.js";import{c as u,d as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-JRGQUM3K.js";import{ka as l,la as m,ra as p,sa as c}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as n}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";n();var r=class extends l{constructor(t,a){super(a);this.config=t}getDescription(){let t=[];return this.params.status&&t.push(`status=${this.params.status}`),this.params.owner&&t.push(`owner=${this.params.owner}`),this.params.blockedBy&&t.push(`blockedBy=${this.params.blockedBy}`),t.length>0?`List tasks (${t.join(", ")})`:"List all tasks"}async execute(){let t=g(this.config.getTeamContext()?.teamName);if(!t){let s="No active team. Create a team first.";return{llmContent:s,returnDisplay:s,error:{message:s}}}let a=await d(t,{status:this.params.status,owner:this.params.owner,blockedBy:this.params.blockedBy});if(a.length===0){let s="No tasks found.";return{llmContent:s,returnDisplay:s}}let e=a.map(s=>`#${s.id} [${s.status}]`+(s.owner?` @${s.owner}`:"")+` \u2014 ${s.subject}`),o=this.config.getTeamManager();if(o&&!u()){try{let s=await o.getLeaderMessages();if(s.length>0){e.push(""),e.push("--- Teammate messages ---");for(let y of o.formatLeaderEnvelope(s))e.push(y)}}catch{}o.hasActiveTeammates()&&(e.push(""),e.push("NOTE: Teammates are still working. Their results will be delivered as messages \u2014 do NOT call task_list again to check. End your turn and wait for teammate messages."))}let h=e.join(`
|
|
4
|
+
`),k={type:"task_list",tasks:a.map(s=>({id:s.id,subject:s.subject,status:s.status,owner:s.owner}))};return{llmContent:h,returnDisplay:k}}},f=class i extends m{constructor(t){super(i.Name,c.TASK_LIST,"List tasks in the team task list. All filter parameters are optional.","read",{type:"object",properties:{status:{type:"string",enum:["pending","in_progress","completed"],description:"Filter by task status."},owner:{type:"string",description:"Filter by owner agent name."},blockedBy:{type:"string",description:"Filter for tasks blocked by this task ID."}},additionalProperties:!1});this.config=t}static Name=p.TASK_LIST;createInvocation(t){return new r(this.config,t)}};export{f as TaskListTool};
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2025 Matilda
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{
|
|
3
|
+
import{ka as T,la as y,ra as h,sa as $}from"./chunk-6SPPO7RK.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-
|
|
3
|
+
import{a as N}from"./chunk-I4KER2VG.js";import{a as h,b as f,e as $,f as y,g,h as v,i as I}from"./chunk-7SPPCSW2.js";import"./chunk-TGRZ364D.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-JRGQUM3K.js";import{ka as T,la as C,ra as b,sa as D}from"./chunk-6SPPO7RK.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{
|
|
3
|
+
import{Jc as u,Kc as C}from"./chunk-HAM3C2JN.js";import{j as A}from"./chunk-7SPPCSW2.js";import"./chunk-ADMI5U2X.js";import"./chunk-TXMXCR7D.js";import"./chunk-YULUB745.js";import"./chunk-C2AKSF3S.js";import{i as v}from"./chunk-YZ33K24S.js";import{b as y,d as w,e as T,f as k,l as o,m as b}from"./chunk-TGRZ364D.js";import"./chunk-6X3HPMAU.js";import"./chunk-PZF4OFAZ.js";import"./chunk-AXPU2T2O.js";import{g as f}from"./chunk-QXSBPCBA.js";import"./chunk-GFKFHWDN.js";import"./chunk-V6UPUMP3.js";import"./chunk-5B2QERWR.js";import"./chunk-W3ZB63AP.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-ZRUOQBYQ.js";import"./chunk-LBQNFSZ2.js";import"./chunk-HSSKS2BO.js";import"./chunk-SHISTILE.js";import"./chunk-YTKDUEUJ.js";import"./chunk-U6ATDQUV.js";import"./chunk-RDTF45AP.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-UM6CLO7D.js";import"./chunk-TVTJEK4V.js";import{c as d,ka as c,la as g,ra as h,sa as p}from"./chunk-6SPPO7RK.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-YZ33K24S.js";import{n as o}from"./chunk-TGRZ364D.js";import{e as g}from"./chunk-QXSBPCBA.js";import"./chunk-7ZODGQO6.js";import"./chunk-GT6MSEK4.js";import"./chunk-JRGQUM3K.js";import{ea as i,ka as l,la as c,ra as p,sa as u}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as m}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";m();var E=i("TEAM_DELETE"),r=class extends l{constructor(t,n){super(n);this.config=t}getDescription(){return"Delete current team"}async execute(){if(g()){let e="Only the team leader can delete the team.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let t=this.config.getTeamManager();if(!t){let e="No active team to delete.";return{llmContent:e,returnDisplay:e,error:{message:e}}}let a=t.getTeamFile().name;try{await t.cleanup()}catch(e){E.warn("Team cleanup failed; resetting team state anyway:",e)}await o(a),await new Promise(e=>setTimeout(e,250)),await o(a),f(a),this.config.setTeamManager(null),this.config.setTeamContext(null),T();let y={type:"team_result",teamName:a,action:"deleted"};return{llmContent:`Team "${a}" deleted.`,returnDisplay:y}}},d=class s extends c{constructor(t){super(s.Name,u.TEAM_DELETE,"Delete the current team. Stops all teammates, cleans up team files, tasks, and inboxes. Only the team leader can use this.","delete",{type:"object",properties:{},additionalProperties:!1});this.config=t}static Name=p.TEAM_DELETE;createInvocation(t){return new r(this.config,t)}};export{d as TeamDeleteTool};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2025 Matilda
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{a,b,c}from"./chunk-U6ATDQUV.js";import"./chunk-RDTF45AP.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";export{c as TodoWriteTool,b as listTodoSessions,a as readTodosForSession};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{lb as L}from"./chunk-HSSKS2BO.js";import"./chunk-SHISTILE.js";import"./chunk-XPVKH5TC.js";import"./chunk-JRGQUM3K.js";import"./chunk-UM6CLO7D.js";import"./chunk-TVTJEK4V.js";import{ea as w,ka as C,la as S,ra as _,sa as A}from"./chunk-6SPPO7RK.js";import"./chunk-HEJO7OBH.js";import{b as T}from"./chunk-GZPNIYVZ.js";import"./chunk-OWGSC52X.js";T();var D=w("TOOL_SEARCH"),R=5,E=20,v=10,x=5,b=4,M=2,q=12,k=6,O=`Reviews function declarations for deferred tools without changing the active tool list.
|
|
4
|
+
|
|
5
|
+
Deferred tools appear by name in the deferred-tools startup reminder. 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
|
+
|
|
7
|
+
The returned <functions> block is informational. After reviewing a hidden deferred tool's schema, invoke it through tool_call with its exact name and schema-shaped arguments. Do not call a hidden deferred tool directly.
|
|
8
|
+
|
|
9
|
+
Query forms:
|
|
10
|
+
- "select:ToolA,ToolB" \u2014 fetch these exact tools by name
|
|
11
|
+
- "keyword phrase" \u2014 keyword search, up to max_results best matches
|
|
12
|
+
- "+must-word other" \u2014 require "must-word" in the name, rank remaining terms
|
|
13
|
+
`,p=class extends C{constructor(r,n){super(n);this.config=r}getDescription(){return this.params.query}async execute(r){let n=(this.params.query??"").trim();if(!n)return{llmContent:"Error: query is empty. Use `select:ToolName` or free-text keywords.",returnDisplay:"Empty query",error:{message:"Empty query"}};let f=$(this.params.max_results??R,1,E);if(n.toLowerCase().startsWith("select:")){let e=new Set,o=[],h=[];for(let g of n.slice(7).split(",")){let m=I(g.trim());if(!m)continue;let y=m.toLowerCase();if(!e.has(y)){if(e.add(y),o.length>=f){h.push(m);continue}o.push(m)}}return this.loadAndReturnSchemas(o,h)}let c=P(n),u=c.filter(e=>e.startsWith("+")).map(e=>e.slice(1)).filter(e=>e.length>0),l=c.map(e=>e.startsWith("+")?e.slice(1):e).filter(e=>e.length>0);if(l.length===0)return{llmContent:"Error: no search terms extracted from query. Use `select:ToolName` or include keywords.",returnDisplay:"No search terms",error:{message:"No search terms"}};let i=this.collectCandidates(),a=[];for(let e of i){if(!U(e,u))continue;let o=B(e,l);o>0&&a.push({tool:e,score:o})}a.sort((e,o)=>o.score!==e.score?o.score-e.score:e.tool.name.localeCompare(o.tool.name));let d=a.slice(0,f).map(e=>e.tool.name);return d.length===0?{llmContent:`No tools found matching '${n}'. Try broader keywords or use \`select:ToolName\`.`,returnDisplay:`No matches for '${n}'`}:this.loadAndReturnSchemas(d)}collectCandidates(){return this.config.getToolRegistry().getAllTools().filter(r=>r.shouldDefer&&!r.alwaysLoad)}async loadAndReturnSchemas(r,n=[]){if(r.length===0)return{llmContent:"Error: no tool names provided.",returnDisplay:"No tool names",error:{message:"No tool names"}};let f=this.config.getToolRegistry(),c=[],u=[],l=new Map;for(let o of f.getAllToolNames())l.set(o.toLowerCase(),o);for(let o of r){let h=l.get(o.toLowerCase());if(!h){u.push(o);continue}let g;try{g=await f.ensureTool(h)}catch(m){D.warn(`ensureTool failed for ${h}:`,m),process.stderr.write(`[ToolSearch] ensureTool failed for "${h}": ${m instanceof Error?m.message:String(m)}
|
|
14
|
+
`)}if(!g){u.push(o);continue}c.push(g)}let i=c.map(o=>`<function>${JSON.stringify(o.schema).replace(/</g,"\\u003c")}</function>`),a="";i.length>0&&(a+=`<functions>
|
|
15
|
+
${i.join(`
|
|
16
|
+
`)}
|
|
17
|
+
</functions>`),u.length>0&&(a+=`${a?`
|
|
18
|
+
|
|
19
|
+
`:""}Not found: ${u.join(", ")}`),n.length>0&&(a+=`${a?`
|
|
20
|
+
|
|
21
|
+
`:""}Truncated by max_results \u2014 request these in a follow-up call: ${n.join(", ")}`);let d=[];c.length>0&&d.push(`Loaded ${c.length} tool(s)`),u.length>0&&d.push(`${u.length} missing`),n.length>0&&d.push(`${n.length} truncated`);let e=d.join(", ")||"No tools loaded";return{llmContent:a,returnDisplay:e}}},N=class t extends S{constructor(r){super(t.Name,A.TOOL_SEARCH,O,"other",{type:"object",properties:{query:{type:"string",description:'Query to find deferred tools. Use "select:<tool_name>" for direct selection, or keywords to search.',minLength:1},max_results:{type:"integer",description:"Maximum number of results to return (default: 5)",minimum:1,maximum:E,default:R}},required:["query"],additionalProperties:!1},!0,!1,!1,!0,"tool search discover find schema");this.config=r}static Name=_.TOOL_SEARCH;createInvocation(r){return new p(this.config,r)}};function P(t){return t.toLowerCase().split(/\s+/g).map(s=>s.trim()).filter(s=>s.length>0)}function $(t,s,r){return Number.isFinite(t)?Math.min(r,Math.max(s,Math.floor(t))):s}function I(t){if(t.length<2)return t;let s=t[0],r=t[t.length-1];return s==='"'&&r==='"'||s==="'"&&r==="'"?t.slice(1,-1):t}function U(t,s){if(s.length===0)return!0;let r=t.name.toLowerCase();return s.every(n=>r.includes(n))}function B(t,s){let r=t instanceof L,n=t.name.toLowerCase(),f=(t.description??"").toLowerCase(),c=(t.searchHint??"").toLowerCase(),u=c?c.split(/\s+/g).filter(Boolean):[],l=0;for(let i of s)i.length!==0&&(n===i||n.endsWith("_"+i)||n.endsWith("."+i)?l+=r?q:v:n.includes(i)&&(l+=r?k:x),u.some(a=>a===i)&&(l+=b),f.includes(i)&&(l+=M));return l}export{N as ToolSearchTool,B as scoreTool,P as tokenize};
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2025 Matilda Team
|
|
25
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
26
|
+
*/
|