@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{d as f}from"./chunk-
|
|
3
|
+
import{d as f}from"./chunk-7SPPCSW2.js";import{d as u}from"./chunk-QXSBPCBA.js";import{ka as m,la as c,ra as l,sa as p}from"./chunk-6SPPO7RK.js";import{b as n}from"./chunk-GZPNIYVZ.js";n();var o=2e3;function T(e){return e.length<=o?e:`${e.slice(0,o)}
|
|
4
4
|
\u2026 (${e.length-o} more characters)`}var s=class extends m{constructor(t,r){super(r);this.config=t}getDescription(){return`Create task: ${this.params.subject}`}async getDefaultPermission(){return"ask"}getConfirmationDetails(t){let r={type:"info",title:"Confirm TaskCreate",prompt:`Create task: ${this.params.subject}
|
|
5
5
|
|
|
6
6
|
`+T(this.params.description),onConfirm:async()=>{}};return Promise.resolve(r)}async execute(){let t=u(this.config.getTeamContext()?.teamName);if(!t){let a="No active team. Create a team first.";return{llmContent:a,returnDisplay:a,error:{message:a}}}let r=await f(t,{subject:this.params.subject,description:this.params.description,activeForm:this.params.activeForm,metadata:this.params.metadata}),i=`Task #${r.id} created: "${r.subject}"`;return{llmContent:i,returnDisplay:i}}},d=class e extends c{constructor(t){super(e.Name,p.TASK_CREATE,"Create a new task in the team task list. Tasks are automatically assigned to idle teammates.","other",{type:"object",properties:{subject:{type:"string",description:"Short title for the task.",maxLength:200},description:{type:"string",description:"Detailed description of the task.",maxLength:1e4},activeForm:{type:"string",maxLength:200,description:'Present tense label for UI (e.g., "Running tests").'},metadata:{type:"object",description:"Optional arbitrary metadata."}},required:["subject","description"],additionalProperties:!1});this.config=t}static Name=l.TASK_CREATE;createInvocation(t){return new s(this.config,t)}toAutoClassifierInput(t){return{subject:t.subject,description:t.description}}};export{T as a,d as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{c as u,ea as M}from"./chunk-
|
|
3
|
+
import{c as u,ea as M}from"./chunk-6SPPO7RK.js";import{b as I}from"./chunk-GZPNIYVZ.js";I();import*as P from"node:crypto";import*as n from"node:fs";import*as f from"node:fs/promises";import*as O from"node:path";var C=M("ATOMIC_WRITE");async function L(t,o,e,i,w=f.rename){for(let a=0;a<=e;a++)try{await w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;await new Promise(v=>setTimeout(v,i*2**a))}}async function $(t){let e=t;for(let w=0;w<40;w++){let a;try{a=await f.lstat(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=await f.readlink(e);if(O.isAbsolute(c))e=c;else{let l=await f.realpath(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}async function B(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??f.rename,F=i?.writeFile??f.writeFile,x=i?.open??f.open,T=i?.chmod??f.chmod,A=i?.fchmod??((d,s)=>d.chmod(s)),b=i?.unlink??f.unlink,r=e?.noFollow?t:await $(t).catch(d=>{throw N(d,t)}),S;try{S=await f.stat(r)}catch(d){if(!u(d)||d.code!=="ENOENT")throw d}let W;(!e?.forceMode||e?.mode===void 0)&&(W=S!==void 0?S.mode&4095:void 0);let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=async d=>{if(y!==void 0)try{await T(d,y)}catch(s){if(!u(s)||s.code!=="ENOSYS"&&s.code!=="ENOTSUP")throw s}},h=()=>{if(S===void 0||process.platform==="win32")return!1;let d=process.geteuid?.();return d===void 0?!1:S.uid!==d};if(S!==void 0&&S.isFile()&&h()){await f.writeFile(r,o,p),await k(r);return}let m=`${r}.${P.randomBytes(6).toString("hex")}.tmp`;try{await F(m,o,p),await k(m),await L(m,r,w,a,v)}catch(d){try{await b(m)}catch{}if(u(d)&&d.code==="EXDEV")try{if(e?.noFollow){try{await b(r)}catch(g){if(!u(g)||g.code!=="ENOENT")throw g}let s=await x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),E=!1;try{try{if(await s.writeFile(typeof o=="string"?Buffer.from(o,l):o),c&&await s.sync(),y!==void 0)try{await A(s,y)}catch(g){if(!u(g)||g.code!=="ENOSYS"&&g.code!=="ENOTSUP")throw g}E=!0}finally{await s.close()}}catch(g){if(!E)try{await b(r)}catch(R){C.debug(`orphan unlink failed for ${r}:`,R)}throw g}}else await F(r,o,p),await k(r);return}catch(s){throw N(s,r)}throw N(d,r)}}function N(t,o,e="atomicWriteFile"){return t instanceof Error&&!t.message.startsWith(`${e}(`)&&(t.message=`${e}(${JSON.stringify(o)}): ${t.message}`),t}async function X(t,o,e){await B(t,JSON.stringify(o,null,2),{encoding:"utf-8",...e})}function H(t){if(t<=0)return;let o=new SharedArrayBuffer(4),e=new Int32Array(o);Atomics.wait(e,0,0,t)}function Y(t,o,e,i,w=n.renameSync){for(let a=0;a<=e;a++)try{w(t,o);return}catch(c){if(!(u(c)&&(c.code==="EPERM"||c.code==="EACCES"))||a===e)throw c;H(i*2**a)}}function D(t){let e=t;for(let w=0;w<40;w++){let a;try{a=n.lstatSync(e)}catch(l){if(u(l)&&l.code==="ENOENT")return e;throw l}if(!a.isSymbolicLink())return e;let c=n.readlinkSync(e);if(O.isAbsolute(c))e=c;else{let l=n.realpathSync(O.dirname(e));e=O.resolve(l,c)}}let i=new Error(`ELOOP: too many levels of symbolic links, resolve '${t}'`);throw i.code="ELOOP",i}function V(t,o,e,i){let w=e?.retries??3,a=e?.delayMs??50,c=e?.flush??!0,l=e?.encoding??"utf-8",v=i?.rename??n.renameSync,F=i?.writeFile??n.writeFileSync,x=i?.open??n.openSync,T=i?.chmod??n.chmodSync,A=i?.fchmod??n.fchmodSync,b=i?.unlink??n.unlinkSync,r;if(e?.noFollow)r=t;else try{r=D(t)}catch(h){throw N(h,t,"atomicWriteFileSync")}let S=`${r}.${P.randomBytes(6).toString("hex")}.tmp`,W;if(!e?.forceMode||e?.mode===void 0)try{W=n.statSync(r).mode&4095}catch(h){if(!u(h)||h.code!=="ENOENT")throw h}let y=W??e?.mode,p={};typeof o=="string"&&(p.encoding=l),c&&(p.flush=!0),y!==void 0&&(p.mode=y);let k=h=>{if(y!==void 0)try{T(h,y)}catch(m){if(!u(m)||m.code!=="ENOSYS"&&m.code!=="ENOTSUP")throw m}};try{F(S,o,p),k(S),Y(S,r,w,a,v)}catch(h){try{b(S)}catch{}if(u(h)&&h.code==="EXDEV")try{if(e?.noFollow){try{b(r)}catch(s){if(!u(s)||s.code!=="ENOENT")throw s}let m=x(r,n.constants.O_WRONLY|n.constants.O_CREAT|n.constants.O_EXCL,y??438),d=!1;try{try{let s=typeof o=="string"?Buffer.from(o,l):o;if(n.writeFileSync(m,s),c&&n.fsyncSync(m),y!==void 0)try{A(m,y)}catch(E){if(!u(E)||E.code!=="ENOSYS"&&E.code!=="ENOTSUP")throw E}d=!0}finally{n.closeSync(m)}}catch(s){if(!d)try{b(r)}catch(E){C.debug(`orphan unlink failed for ${r}:`,E)}throw s}}else F(r,o,p),k(r);return}catch(m){throw N(m,r,"atomicWriteFileSync")}throw N(h,r,"atomicWriteFileSync")}}export{B as a,X as b,D as c,V as d};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda Team
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{i,na as c,ta as y}from"./chunk-ZRUOQBYQ.js";import{ia as l}from"./chunk-6SPPO7RK.js";import{b as g}from"./chunk-GZPNIYVZ.js";g();import{readFile as S}from"node:fs/promises";function T(t){return t?`side-query:${t}`:"side-query"}function x(t,e){return e??t.getFastModel?.()??t.getModel()??y}function C(t){let e=t?.thinkingConfig;return{...t??{},thinkingConfig:e?{includeThoughts:!1,...e}:{includeThoughts:!1}}}async function h(t){let e=t.getOutputLanguageFilePath?.();if(e)try{let n=(await S(e,"utf8")).trim();return n?["Follow the user-visible output language preference below for this side query.",n].join(`
|
|
4
|
+
|
|
5
|
+
`):void 0}catch{return}}function R(t,e){return e?t===void 0?e:typeof t=="string"?`${t}
|
|
6
|
+
|
|
7
|
+
${e}`:Array.isArray(t)?[...t,{text:e}]:typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)?{...t,parts:[...t.parts,{text:e}]}:[t,{text:e}]:t}function O(t){return t.schema!==void 0&&t.schema!==null}async function v(t,e){return c(t,()=>Q(t,e))}async function Q(t,e){let n=x(t,e.model),o=e.promptId??T(e.purpose),s=C(e.config),a=R(e.systemInstruction,await h(t)),u=e.purpose==="chat-compression"?"compaction":"unknown";if(O(e)){let r=await i(u,()=>t.getBaseLlmClient().generateJson({contents:e.contents,schema:e.schema,abortSignal:e.abortSignal,model:n,systemInstruction:a,promptId:o,config:s,...e.maxAttempts!==void 0&&{maxAttempts:e.maxAttempts}})),f=l.validate(e.schema,r);if(f)throw new Error(`Invalid side query response: ${f}`);let m=e.validate?.(r);if(m)throw new Error(m);return r}let p=await i(u,()=>t.getBaseLlmClient().generateText({contents:e.contents,model:n,systemInstruction:a,abortSignal:e.abortSignal,promptId:o,config:s,...e.maxAttempts!==void 0&&{maxAttempts:e.maxAttempts},...e.stream&&{stream:!0}})),d=e.validate?.(p.text);if(d)throw new Error(d);return p}export{v as a};
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2025 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{d as b}from"./chunk-XPVKH5TC.js";import{ea as P}from"./chunk-
|
|
3
|
+
import{d as b}from"./chunk-XPVKH5TC.js";import{ea as P}from"./chunk-6SPPO7RK.js";import{b as S}from"./chunk-GZPNIYVZ.js";S();var H=P("TRUSTED_HOOKS");var C=(n=>(n.PreToolUse="PreToolUse",n.PostToolUse="PostToolUse",n.PostToolUseFailure="PostToolUseFailure",n.PostToolBatch="PostToolBatch",n.Notification="Notification",n.UserPromptSubmit="UserPromptSubmit",n.UserPromptExpansion="UserPromptExpansion",n.SessionStart="SessionStart",n.Stop="Stop",n.SubagentStart="SubagentStart",n.SubagentStop="SubagentStop",n.PreCompact="PreCompact",n.PostCompact="PostCompact",n.SessionEnd="SessionEnd",n.PermissionRequest="PermissionRequest",n.PermissionDenied="PermissionDenied",n.StopFailure="StopFailure",n.TodoCreated="TodoCreated",n.TodoCompleted="TodoCompleted",n.InstructionsLoaded="InstructionsLoaded",n))(C||{});var N=["enabled","disabled","notifications"];function M(t){let e=t.name??"";switch(t.type){case"command":return e?`${e}:${t.command}`:t.command;case"http":return e?`${e}:${t.url}`:t.url;case"function":return e?`${e}:${t.id??"function"}`:t.id??"function";case"prompt":return e?`${e}:${t.prompt}`:t.prompt;default:return e||"unknown"}}function y(t){switch(t.type){case"command":return typeof t.command=="string"&&t.command!=="";case"http":return typeof t.url=="string"&&t.url!=="";case"prompt":return typeof t.prompt=="string"&&t.prompt!=="";case"function":return typeof t.callback=="function";default:return!1}}function B(t){if(typeof t!="object"||t===null||!y(t))return;if(t.name===void 0||typeof t.name=="string")return t;let e={...t};return delete e.name,e}var I=["ask","block","deny","approve","allow"],T=1e4;function R(t){return b(t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),0,T).replace(/&(?:a(?:mp?)?|lt?|gt?)?$/,"")}var c=t=>typeof t=="string",f=t=>typeof t=="boolean";function d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var w=[["decision",t=>I.includes(t)],["continue",f],["hookSpecificOutput",d],["reason",c],["stopReason",c],["systemMessage",c],["suppressOutput",f],["terminalSequence",c]],D=[["message",c],["updatedInput",d],["updatedPermissions",Array.isArray],["interrupt",f]];function E(t){if(!d(t))return!1;let{behavior:e,updatedInput:i}=t;return e==="deny"?!0:e==="allow"&&(i==null||d(i))}function v(t){return[["permissionDecision",e=>t==="PreToolUse"&&(e==="allow"||e==="deny"||e==="ask")],["decision",e=>t==="PermissionRequest"&&E(e)],["permissionDecisionReason",c],["additionalContext",c],["tool_input",d]]}function m(t,e,i,s){let o={...t};for(let[r,p]of e){let a=o[r];a===void 0||a!==null&&p(a)||(a!==null&&s.push(`${i}${r}`),delete o[r])}return o}var q=t=>d(t.hookSpecificOutput);function L(t,e){switch(t){case"PreToolUse":return new l(e);case"PostToolUse":return new k(e);case"PostToolUseFailure":return new x(e);case"UserPromptExpansion":return new h(e);case"PostToolBatch":return new O(e);case"Stop":case"SubagentStop":return new _(e);case"PermissionRequest":return new g(e);default:return new u(e)}}var u=class{continue;stopReason;suppressOutput;systemMessage;terminalSequence;decision;reason;hookSpecificOutput;constructor(e={}){this.continue=e.continue,this.stopReason=e.stopReason,this.suppressOutput=e.suppressOutput,this.systemMessage=e.systemMessage,this.terminalSequence=e.terminalSequence,this.decision=e.decision,this.reason=e.reason,this.hookSpecificOutput=e.hookSpecificOutput}isBlockingDecision(){return this.decision==="block"||this.decision==="deny"}shouldStopExecution(){return this.continue===!1}getEffectiveReason(){return this.stopReason||this.reason||"No reason provided"}getRawAdditionalContext(){if(this.hookSpecificOutput&&"additionalContext"in this.hookSpecificOutput){let e=this.hookSpecificOutput.additionalContext;return typeof e=="string"?e:void 0}}getAdditionalContext(){let e=this.getRawAdditionalContext();if(e!==void 0)return e.replace(/</g,"<").replace(/>/g,">")}getBlockingError(){return this.isBlockingDecision()?{blocked:!0,reason:this.getEffectiveReason()}:{blocked:!1,reason:""}}shouldClearContext(){return!1}},l=class extends u{getPermissionDecision(){if(this.hookSpecificOutput&&"permissionDecision"in this.hookSpecificOutput){let e=this.hookSpecificOutput.permissionDecision;if(e==="allow"||e==="deny"||e==="ask")return e}if(this.decision==="allow"||this.decision==="approve")return"allow";if(this.decision==="deny"||this.decision==="block")return"deny";if(this.decision==="ask")return"ask"}getPermissionDecisionReason(){if(this.hookSpecificOutput&&"permissionDecisionReason"in this.hookSpecificOutput){let e=this.hookSpecificOutput.permissionDecisionReason;if(typeof e=="string")return e}return this.reason}isDenied(){return this.getPermissionDecision()==="deny"}isAsk(){return this.getPermissionDecision()==="ask"}isAllowed(){return this.getPermissionDecision()==="allow"}},k=class extends u{decision;reason;constructor(e={}){super(e),this.decision=e.decision??"allow",this.reason=e.reason??"No reason provided",e.decision===void 0&&H.debug('PostToolUseHookOutput: No explicit decision set, defaulting to "allow"'),e.reason===void 0&&H.debug('PostToolUseHookOutput: No explicit reason set, defaulting to "No reason provided"')}},x=class extends u{getAdditionalContext(){return super.getAdditionalContext()}},h=class extends u{getAdditionalContext(){let e=this.getRawAdditionalContext();if(e!==void 0)return R(e)}},O=class extends u{shouldStopExecution(){return super.shouldStopExecution()||this.isBlockingDecision()}},_=class extends u{stopReason;constructor(e={}){super(e),this.stopReason=e.stopReason}getStopReason(){if(this.stopReason)return`Stop hook feedback:
|
|
4
4
|
${this.stopReason}`}},g=class extends u{getPermissionDecision(){if(this.hookSpecificOutput&&"decision"in this.hookSpecificOutput){let e=this.hookSpecificOutput.decision;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let{behavior:i}=e;if(i==="allow"||i==="deny")return e}}return this.isBlockingDecision()?{behavior:"deny",message:this.reason}:void 0}isPermissionDenied(){return this.getPermissionDecision()?.behavior==="deny"}getDenyMessage(){return this.getPermissionDecision()?.message}shouldInterrupt(){return this.getPermissionDecision()?.interrupt===!0}getUpdatedToolInput(){return this.getPermissionDecision()?.updatedInput}getUpdatedPermissions(){return this.getPermissionDecision()?.updatedPermissions}};function $(t,e,i){let s=U(t,e??{}).output,o=s.reason||i,r={...s,decision:"deny",reason:o};if(t==="PreToolUse"){let p=new l(s);r.hookSpecificOutput={...s.hookSpecificOutput,permissionDecision:"deny",permissionDecisionReason:p.isDenied()&&p.getPermissionDecisionReason()||o}}if(t==="PermissionRequest"){let p=new g(s).getPermissionDecision(),a=p?.behavior==="deny"?p:void 0;r.hookSpecificOutput={...s.hookSpecificOutput,decision:{...a,behavior:"deny",message:a?.message||o}}}return r}function U(t,e){let i=[],s=m(e,w,"",i);if(s.hookSpecificOutput){let o=m(s.hookSpecificOutput,v(t),"hookSpecificOutput.",i);d(o.decision)&&(o.decision=m(o.decision,D,"hookSpecificOutput.decision.",i)),s.hookSpecificOutput=o}return{output:s,...i.length>0&&{unusableField:i[0]}}}function j(t,e){let i=new Map(t.map(o=>[o.id,o])),s={created:[],completed:[]};for(let o of e){let r=i.get(o.id);r?r.status!=="completed"&&o.status==="completed"&&s.completed.push(o):s.created.push(o)}return s}export{C as a,N as b,M as c,B as d,R as e,q as f,L as g,u as h,l as i,k as j,x as k,h as l,O as m,_ as n,g as o,$ as p,U as q,j as r};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{A as m,I as g,L as h,P as l,W as M}from"./chunk-
|
|
3
|
+
import{A as m,I as g,L as h,P as l,W as M}from"./chunk-6SPPO7RK.js";import{b as p}from"./chunk-GZPNIYVZ.js";p();import*as s from"node:fs";import*as t from"node:path";var A="memory",y="MEMORY.md",x="meta.json",R="extract-cursor.json",O="consolidation.lock",T="memories";function D(r){let e=t.resolve(r);for(;;){let n=t.join(e,".git");if(s.existsSync(n))return e;let o=t.dirname(e);if(o===e)return null;e=o}}function j(r){let e=D(r);if(!e)return null;try{let n=s.readFileSync(t.join(e,".git"),"utf-8").trim();if(!n.startsWith("gitdir:"))return e;let o=t.resolve(e,n.slice(7).trim()),i=t.resolve(o,s.readFileSync(t.join(o,"commondir"),"utf-8").trim());return t.resolve(t.dirname(o))!==t.join(i,"worktrees")||s.realpathSync(s.readFileSync(t.join(o,"gitdir"),"utf-8").trim())!==t.join(s.realpathSync(e),".git")?e:t.basename(i)!==".git"?i.normalize("NFC"):t.dirname(i).normalize("NFC")}catch{return e}}function E(){return process.env.MATILDA_CODE_MEMORY_BASE_DIR?h(void 0,process.env.MATILDA_CODE_MEMORY_BASE_DIR):l.getRuntimeBaseDir()}var f=new Map;function c(r){let e=process.env.MATILDA_CODE_MEMORY_LOCAL==="1",n=e?"":E(),o=`${e?"local":n}\0${r}`,i=f.get(o);if(i!==void 0)return i;let a;if(e)a=t.join(r,m,A);else{let d=j(r)??t.resolve(r);a=t.join(n,"projects",g(d),A)}return f.set(o,a),a}function u(r){return t.dirname(c(r))}function C(r,e){let n=t.normalize(r),o=t.normalize(c(e)),i=t.relative(o,n);return i===""||!i.startsWith("..")&&!t.isAbsolute(i)}function N(r){return t.join(c(r),y)}function U(r){return t.join(u(r),x)}function F(r){return t.join(u(r),R)}function Y(r){return t.join(u(r),O)}function _(){return t.join(E(),T)}function k(){return t.join(_(),y)}function I(r){let e=t.normalize(r),n=t.normalize(_()),o=t.relative(n,e);return o===""||!o.startsWith("..")&&!t.isAbsolute(o)}function S(r,e){return C(r,e)||I(r)}var z="A secret in this text was stored as ***REDACTED***, as a memory should keep none.";function b(r,e,n){return S(t.resolve(r),e)?M(n):n}export{y as a,E as b,c,u as d,C as e,N as f,U as g,F as h,Y as i,_ as j,k,S as l,z as m,b as n};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Google LLC
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{g as f,h,i as T,j as w,k as x,l as s}from"./chunk-QXSBPCBA.js";import{b as g}from"./chunk-
|
|
3
|
+
import{g as f,h,i as T,j as w,k as x,l as s}from"./chunk-QXSBPCBA.js";import{b as g}from"./chunk-JRGQUM3K.js";import{P as c,c as p}from"./chunk-6SPPO7RK.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();import*as n from"node:fs/promises";import*as i from"node:path";o();function y(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function M(){return i.join(c.getGlobalMatildaDir(),h)}function d(e){return i.join(M(),e)}function l(e){return i.join(d(e),w)}function I(e){return i.join(d(e),x)}function E(e){return i.join(c.getGlobalMatildaDir(),T,e)}function m(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function j(e,t){return`${m(e)}@${m(t)}`}function R(e,t){let r=m(e);if(!r)throw new Error(`Teammate name "${e}" sanitizes to an empty string. Choose a name with at least one alphanumeric character.`);if(r===f)throw new Error(`"${f}" is reserved for the team leader. Choose a different teammate name.`);let a=new Set(t.map(u=>u.name));if(a.has(r)){let u=[...a].join(", ")||"<none>";throw new Error(`A teammate named "${r}" already exists in this team (existing: ${u}). Choose a different name.`)}return r}function C(e){let t=new Set(e.map(r=>r.color).filter(r=>r!==void 0));for(let r of s)if(!t.has(r))return r;return s[e.length%s.length]}function O(e,t){let r=m(t);return e.find(a=>a.name===r)}function $(e){let t=e.trimStart();if(/^shutdown_approved\b/i.test(t))return"shutdown_approved";if(/^shutdown_rejected\b/i.test(t))return"shutdown_rejected"}async function P(e){let t=l(e);try{let r=await n.readFile(t,"utf-8");return JSON.parse(r)}catch(r){if(p(r)&&r.code==="ENOENT")return;throw r}}async function k(e,t){let r=l(e);await n.mkdir(i.dirname(r),{recursive:!0}),await g(r,t)}async function z(e,t){let r=l(e);await n.mkdir(i.dirname(r),{recursive:!0}),await n.writeFile(r,JSON.stringify(t,null,2)+`
|
|
4
4
|
`,{encoding:"utf-8",flag:"wx"})}async function L(e){let t;try{t=await P(e)}catch{return!1}return t?typeof t.leadPid!="number"||t.leadPid<=0||t.leadPid!==process.pid&&y(t.leadPid)?!1:(await b(e),!0):(await b(e),!0)}async function b(e){let t=d(e),r=E(e);await Promise.allSettled([n.rm(t,{recursive:!0,force:!0}),n.rm(r,{recursive:!0,force:!0})])}export{y as a,d as b,I as c,E as d,m as e,j as f,R as g,C as h,O as i,$ as j,k,z as l,L as m,b as n};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{ka as n,la as u,ra as e,sa as a}from"./chunk-6SPPO7RK.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();var d=`Submit your final answer as structured JSON that conforms to the provided schema.
|
|
4
|
+
|
|
5
|
+
CRITICAL: In structured-output mode, this is the ONLY way to deliver the final result. Call this tool to deliver the final result; the first call with valid arguments ends the session. Do not emit the final answer as plain text \u2014 it will be discarded. Use other tools (Read, Grep, etc.) to gather the information you need before calling this tool.
|
|
6
|
+
|
|
7
|
+
The arguments you pass MUST validate against the tool's parameter schema. If validation fails you will receive the error and may retry with corrected fields.`,i={__redacted:"structured_output payload (see stdout result)"};function p(t){return t.name===e.STRUCTURED_OUTPUT?{...i}:t.name===e.TOOL_CALL&&t.args?.name===e.STRUCTURED_OUTPUT?{name:e.STRUCTURED_OUTPUT,arguments:{...i}}:void 0}var l=class t extends u{static Name=e.STRUCTURED_OUTPUT;constructor(r){super(t.Name,a.STRUCTURED_OUTPUT,d,"think",r,!1,!1,!1,!0,"structured output json schema final result submit")}createInvocation(r){return new s(r)}},s=class extends n{getDescription(){return"Submit structured result"}async execute(r){return{llmContent:"Structured output accepted. The session will end now \u2014 do not send further content.",returnDisplay:"Structured output accepted."}}};export{i as a,p as b,l as c};
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2025 Matilda
|
|
11
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{h as P,r as R}from"./chunk-
|
|
3
|
+
import{h as P,r as R}from"./chunk-RDTF45AP.js";import{a as C}from"./chunk-JRGQUM3K.js";import{P as T,ea as I,ka as O,la as S,ra as A,sa as W}from"./chunk-6SPPO7RK.js";import{b as E}from"./chunk-GZPNIYVZ.js";E();import*as h from"fs/promises";import*as f from"fs";import*as u from"path";var D=I("TODO_WRITE");function U(o){return new P(o.finalOutput).isBlockingDecision()}var q={name:"todo_write",description:"Creates and manages a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.",parametersJsonSchema:{type:"object",properties:{todos:{type:"array",items:{type:"object",properties:{content:{type:"string",minLength:1},status:{type:"string",enum:["pending","in_progress","completed"]},id:{type:"string"}},required:["content","status","id"],additionalProperties:!1},description:"The updated todo list"}},required:["todos"],$schema:"http://json-schema.org/draft-07/schema#"}},H=`
|
|
4
4
|
Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
5
5
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{l as i}from"./chunk-
|
|
3
|
+
import{l as i}from"./chunk-SHISTILE.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();import l from"node:path";function d(t,n){if(t.getApprovalMode()!=="bogan")return null;let r=l.resolve(n),s=t.getProjectRoot?.()??t.getTargetDir();if(i(r,s))return null;let e=t.getWorkspaceContext?.();if(!e||(typeof e.isPathWithinWorkspaceFresh=="function"?e.isPathWithinWorkspaceFresh(r):e.isPathWithinWorkspace(r)))return null;let a=e.getDirectories?.()??[t.getTargetDir()],p=t.getChannel?.()==="desktop"?"Approve the folder from Matilda Desktop, then retry the write.":"Use --include-directories to add extra roots, or a non-BOGAN approval mode for intentional external writes.";return`Refusing out-of-workspace write in BOGAN mode: ${r}. Workspace root(s): ${a.join(", ")}. This blocks path typos (e.g. writing under $HOME when the project is elsewhere). `+p}export{d as a};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda Team
|