@maincode-ai/matilda-code 0.21.13-preview.0 → 0.22.0-nightly.20261101.b0ad315a4
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/chunks/agent-IUINB66G.js +3 -0
- package/chunks/agent-headless-YA2RKYEZ.js +3 -0
- package/chunks/{askUserQuestion-6WS5ZWRA.js → askUserQuestion-RZYBOPLR.js} +1 -1
- package/chunks/ca-JKEHLTNL.js +23 -0
- package/chunks/{chunk-LVDDFAK4.js → chunk-225CZWD7.js} +1 -1
- package/chunks/{chunk-G4XYQR6C.js → chunk-2XSB5XHX.js} +1 -1
- package/chunks/{chunk-QFGR7ORH.js → chunk-453BANK3.js} +1 -1
- package/chunks/{chunk-3KKFNVI6.js → chunk-4UGPARBR.js} +1 -1
- package/chunks/{chunk-AH4W5RL2.js → chunk-5ETLURI6.js} +1 -1
- package/chunks/chunk-6NXVLJ3X.js +56 -0
- package/chunks/{chunk-OFP2ROZ7.js → chunk-7B65UIHB.js} +1 -1
- package/chunks/{chunk-XYAIE36G.js → chunk-7E2YCGHS.js} +9 -9
- package/chunks/{chunk-VW6Q43PZ.js → chunk-ARAB5QTM.js} +59 -59
- package/chunks/chunk-DUB7JMQV.js +13 -0
- package/chunks/{chunk-VENUGZ5L.js → chunk-G3F3ZCH2.js} +1 -1
- package/chunks/{chunk-RBGGCVWD.js → chunk-IHWAOFCQ.js} +1 -1
- package/chunks/{chunk-E2WUZZFL.js → chunk-ILHNCXBC.js} +1 -1
- package/chunks/{chunk-5WRYWBB4.js → chunk-J3ZCE3TA.js} +1 -1
- package/chunks/{chunk-VTBFOUDI.js → chunk-LM6OIN4B.js} +1 -1
- package/chunks/{chunk-JD4JPY2P.js → chunk-LMZBADPW.js} +1 -1
- package/chunks/{chunk-IR3O4MBT.js → chunk-MGRXOZAG.js} +1 -1
- package/chunks/{chunk-LQYPJU36.js → chunk-NBLBE7PE.js} +970 -976
- package/chunks/{chunk-R5KAUFJR.js → chunk-POGNX7U3.js} +1 -1
- package/chunks/{chunk-WLB26FDD.js → chunk-PQZ6HKKW.js} +32 -30
- package/chunks/{chunk-DP2GG4BM.js → chunk-RHSUTILA.js} +1 -1
- package/chunks/{chunk-QBGN32YW.js → chunk-RPXRN7E6.js} +1 -1
- package/chunks/chunk-V2VUANFI.js +120 -0
- package/chunks/{chunk-OIJ6FGWD.js → chunk-V4VILMIK.js} +1 -1
- package/chunks/{computer-use-YXOX3Q5O.js → computer-use-PBCWDTJR.js} +1 -1
- package/chunks/{cron-create-OCYM4HNG.js → cron-create-PHQ43NYA.js} +1 -1
- package/chunks/{cron-delete-LAWZU6LE.js → cron-delete-7RCQIU2U.js} +1 -1
- package/chunks/{cron-list-BCIXV7CX.js → cron-list-KKNLLMNN.js} +1 -1
- package/chunks/de-GMGNR5CZ.js +23 -0
- package/chunks/{edit-YZ6XRSXL.js → edit-ELHNQB5E.js} +1 -1
- package/chunks/en-3NQMLVKW.js +23 -0
- package/chunks/{enter-worktree-GZPML7CR.js → enter-worktree-UZIBOBV3.js} +1 -1
- package/chunks/{enterPlanMode-CVXXBWOO.js → enterPlanMode-UHY3DZXE.js} +1 -1
- package/chunks/{exit-worktree-JXDNEOAW.js → exit-worktree-HLG4PDMX.js} +1 -1
- package/chunks/{exitPlanMode-TFVL2QJO.js → exitPlanMode-V4HYNH3J.js} +1 -1
- package/chunks/fr-WS3EBB36.js +23 -0
- package/chunks/{glob-5L6T2OAD.js → glob-C5CTWXLP.js} +1 -1
- package/chunks/{goal-tools-DBHXH5DG.js → goal-tools-BGIWEJ3K.js} +1 -1
- package/chunks/{grep-J7T4EXPY.js → grep-BEFTGKHW.js} +1 -1
- package/chunks/ja-GBCDQ43R.js +23 -0
- package/chunks/{keychain-token-storage-RQFXZUKF.js → keychain-token-storage-FEJZYJBB.js} +1 -1
- package/chunks/{ls-LVWC7JN2.js → ls-XH55NAD3.js} +1 -1
- package/chunks/{lsp-5VYXJ3SM.js → lsp-BKDCR37G.js} +1 -1
- package/chunks/mcp-client-GAQG7MCT.js +3 -0
- package/chunks/monitor-NSVUUKCM.js +32 -0
- package/chunks/notebook-edit-AXKYC64C.js +17 -0
- package/chunks/openaiContentGenerator-66YY6CIM.js +47 -0
- package/chunks/pt-VID6J2CM.js +23 -0
- package/chunks/read-file-YFJMLS7V.js +3 -0
- package/chunks/ripGrep-BEHEB23R.js +3 -0
- package/chunks/ru-EB6V6EAN.js +23 -0
- package/chunks/scheduler-GKQOREMS.js +8 -0
- package/chunks/{send-message-YR63X46X.js → send-message-GJSEMAZB.js} +1 -1
- package/chunks/shell-J5Q2UEXH.js +3 -0
- package/chunks/{skill-UQMCUAST.js → skill-3RWNSUNE.js} +1 -1
- package/chunks/{symbol-search-UTRGJAO2.js → symbol-search-4VM6J5Y4.js} +1 -1
- package/chunks/{syntheticOutput-653VCVMY.js → syntheticOutput-O7LEF3AM.js} +1 -1
- package/chunks/{task-create-TAKTFQSW.js → task-create-N4IRJBTF.js} +1 -1
- package/chunks/{task-detach-H3FZKL54.js → task-detach-RGNQUX3H.js} +1 -1
- package/chunks/{task-list-ICQNSQZS.js → task-list-Z7JUB4QK.js} +1 -1
- package/chunks/{task-stop-4I3A3RGM.js → task-stop-L2OWK2PJ.js} +1 -1
- package/chunks/{task-update-COPYWCFV.js → task-update-H5AXVXDS.js} +1 -1
- package/chunks/{team-create-RVBZSB6O.js → team-create-FWTIQ2FT.js} +3 -3
- package/chunks/{team-delete-CCIBYEVZ.js → team-delete-D45ALROH.js} +1 -1
- package/chunks/todoWrite-LCQOQBI7.js +3 -0
- package/chunks/{tool-search-EJ4DEPVO.js → tool-search-X6UUCSPU.js} +1 -1
- package/chunks/{web-fetch-WCGA252Q.js → web-fetch-244KUWSX.js} +1 -1
- package/chunks/web-search-YRZ3BZ3X.js +26 -0
- package/chunks/{workflow-F5KP553F.js → workflow-EP4AFR24.js} +2 -2
- package/chunks/write-file-EXWGRN4Q.js +15 -0
- package/cli.js +463 -468
- package/locales/ca.js +2 -52
- package/locales/de.js +2 -51
- package/locales/en.js +2 -50
- package/locales/fr.js +2 -51
- package/locales/ja.js +2 -52
- package/locales/pt.js +2 -52
- package/locales/ru.js +2 -51
- package/package.json +2 -2
- package/chunks/agent-4WVOGPYV.js +0 -3
- package/chunks/agent-headless-KZCTMP7N.js +0 -3
- package/chunks/ca-GTBBJB6L.js +0 -25
- package/chunks/chunk-4OWMT5UV.js +0 -120
- package/chunks/chunk-EVIJ4V55.js +0 -56
- package/chunks/chunk-EYZPVR7N.js +0 -13
- package/chunks/chunk-FKHUEFMK.js +0 -8
- package/chunks/chunk-WYUJ36HZ.js +0 -8
- package/chunks/de-CEHU2QRR.js +0 -25
- package/chunks/en-Y755FYW7.js +0 -25
- package/chunks/fr-PCCFNMP6.js +0 -25
- package/chunks/ja-C4IJKHYL.js +0 -25
- package/chunks/mcp-client-EZSMZWGS.js +0 -3
- package/chunks/monitor-HJCMPNDI.js +0 -32
- package/chunks/notebook-edit-62T7J5RF.js +0 -17
- package/chunks/openaiContentGenerator-SPSIXCCZ.js +0 -52
- package/chunks/pt-GM4GVS7E.js +0 -25
- package/chunks/read-file-PMRIGC6D.js +0 -3
- package/chunks/ripGrep-MFGKGCKA.js +0 -3
- package/chunks/ru-FGESI6LX.js +0 -25
- package/chunks/scheduler-3O76VPWP.js +0 -8
- package/chunks/shell-44X3D7YA.js +0 -3
- package/chunks/todoWrite-RKNGMZ5N.js +0 -3
- package/chunks/web-search-RHTJAF72.js +0 -26
- package/chunks/write-file-3GA55J4D.js +0 -15
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{b as r}from"./chunk-GZPNIYVZ.js";r();r();var _="MATILDA_API_KEY";var d="matilda-code-1.0",f="Matilda",x="https://matilda.maincode.com/api/v1/code";var C={id:"matilda",label:"Matilda",description:"Connect to the Matilda Core code API endpoint",protocol:"openai",baseUrl:x,envKey:_,models:[{id:d,displayName:f,contextWindowSize:1048576,description:"Matilda Code model",generationConfig:{openAIRequestProfile:"matilda-code",timeout:6e5,samplingParams:{max_tokens:65536,chat_template_kwargs:{enable_thinking:!0}},schemaCompliance:"openapi_30",splitToolMedia:!0,customHeaders:{"User-Agent":"MatildaCode/0.1"}}}],modelNamePrefix:"",documentationUrl:"https://matilda.maincode.help/welcome/external-api",uiGroup:"third-party"};var b=d,k="text-embedding-v4";r();import{AsyncLocalStorage as y}from"node:async_hooks";import{randomUUID as O}from"node:crypto";r();import{AsyncLocalStorage as g}from"node:async_hooks";var l=new g;var R="x-matilda-reported-operation-id",A="x-matilda-reported-attempt-purpose",P=[R,A],D=new Set(P),I=["answer","tool_followup","continuation","retry","compaction","unknown"],h=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,M=new Set(I),c=new y,E=new WeakSet;function m(){return O()}function s(t,e){let o=Object.freeze({operationId:t,attemptPurpose:e});return E.add(o),o}function B(t){return D.has(t.toLowerCase())}function p(){let t=c.getStore();return t&&E.has(t)?t:void 0}var T=class{activeOperationId;begin(e){return this.activeOperationId=m(),s(this.activeOperationId,e)}continue(e){let o=p()?.operationId??this.activeOperationId??m();return this.activeOperationId=o,s(o,e)}};function i(t,e){return c.run(t,e)}function K(t){c.enterWith(t)}function q(t,e){let o=p();return o?i(s(o.operationId,t),e):e()}function w(t,e){let o={next:(...n)=>i(t,()=>e.next(...n)),return:n=>i(t,()=>e.return(n)),throw:n=>i(t,()=>e.throw(n)),[Symbol.asyncIterator]:()=>o},a=Symbol.asyncDispose,u=a&&e[a];return a&&typeof u=="function"&&(o[a]=()=>i(t,()=>u.call(e))),o}function z(t,e){let o=p();return o?w(s(o.operationId,t),e):e}function F(){let t=p();if(!t||!h.test(t.operationId))return{};let e=l.getStore()?.attempt,o=e!==void 0&&e>1?"retry":t.attemptPurpose;return M.has(o)?{[R]:t.operationId,[A]:o}:{}}export{l as a,R as b,A as c,P as d,B as e,p as f,T as g,i as h,K as i,q as j,w as k,z as l,F as m,_ as n,d as o,f as p,x as q,C as r,b as s,k as t};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2026 Matilda Team
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2025 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{c as p}from"./chunk-
|
|
3
|
+
import{c as p}from"./chunk-V4VILMIK.js";import{b as h}from"./chunk-7ZODGQO6.js";import{a as M}from"./chunk-GT6MSEK4.js";import{b as d}from"./chunk-J3ZCE3TA.js";import{V as b,b as f}from"./chunk-7E2YCGHS.js";import{b as u}from"./chunk-GZPNIYVZ.js";import{f as E}from"./chunk-OWGSC52X.js";u();var x=null;function D(){x=null}function _(e,r,t){return x?(x.enqueueApproval({teammateName:e,teammateColor:r,details:t}),!0):!1}function P(e,r,t,o){return{...e,title:`[${r}] ${e.title}`,onConfirm:async(i,s)=>{await t(i,s)}}}u();var C=E(h(),1);import*as a from"node:fs/promises";import*as c from"node:path";var w=b("AGENTS_TEAM_MAILBOX"),N={retries:{retries:10,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:e=>{w.debug("mailbox lock compromised:",e?.message??e)}},g=new Map;function O(e){let r=g.get(e);return r||(r=new M,g.set(e,r)),r}function I(e){let r=p(e),t=0;for(let o of g.keys())c.dirname(o)===r&&(g.delete(o),t++);return t}async function T(e,r){return O(e).runExclusive(async()=>{let t=await C.default.lock(e,N);try{return await r()}finally{await t()}})}function y(e,r){return c.join(p(e),`${r}.json`)}async function B(e,r){let t=y(e,r);try{let o=await a.readFile(t,"utf-8");return JSON.parse(o)}catch(o){if(f(o)&&o.code==="ENOENT")return[];throw o}}var L=5*60*1e3;async function A(e,r,t){let o=y(e,r);await v(o),await T(o,async()=>{let i=await k(o),s=Date.now()-L,l=i.filter(m=>{if(!m.read)return!0;let n=Date.parse(m.timestamp);return Number.isNaN(n)||n>=s});l.push(t),await d(o,l)})}async function W(e,r,t){let o=y(e,r);return await v(o),T(o,async()=>{let i=await k(o),s=n=>!n.read&&(t===void 0||n.type===t),l=i.filter(s);if(l.length===0)return[];let m=i.map(n=>s(n)?{...n,read:!0}:n);return await d(o,m),l})}async function X(e){let r=p(e);await a.rm(r,{recursive:!0,force:!0}),I(e)}async function z(e,r,t){await A(e,r,{from:t.from,text:t.text,timestamp:new Date().toISOString(),read:!1,type:t.type,color:t.color,summary:t.summary})}async function v(e){await a.mkdir(c.dirname(e),{recursive:!0});try{await a.writeFile(e,`[]
|
|
4
4
|
`,{flag:"wx"})}catch(r){if(!f(r)||r.code!=="EEXIST")throw r}}async function k(e){try{let r=await a.readFile(e,"utf-8");return JSON.parse(r)}catch(r){if(f(r)&&r.code==="ENOENT")return[];let t=r instanceof Error?r.message:String(r);w.warn(`Quarantining corrupt inbox at ${e}: ${t}`);try{await a.rename(e,`${e}.corrupt-${Date.now()}`)}catch(o){let i=o instanceof Error?o.message:String(o);throw w.warn(`Failed to quarantine ${e}: ${i}`),r instanceof Error?r:new Error(`Failed to read inbox at ${e}: ${t}`)}return[]}}export{D as a,_ as b,P as c,I as d,y as e,B as f,A as g,W as h,X as i,z as j};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{l as i}from"./chunk-
|
|
3
|
+
import{l as i}from"./chunk-ILHNCXBC.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{
|
|
3
|
+
import{E as h,H as g,L as l,w as m}from"./chunk-7E2YCGHS.js";import{b as p}from"./chunk-GZPNIYVZ.js";p();import*as s from"node:fs";import*as t from"node:path";var M="memory",f="MEMORY.md",d="meta.json",x="extract-cursor.json",R="consolidation.lock",O="memories";function T(r){let o=t.resolve(r);for(;;){let e=t.join(o,".git");if(s.existsSync(e))return o;let n=t.dirname(o);if(n===o)return null;o=n}}function D(r){let o=T(r);if(!o)return null;try{let e=s.readFileSync(t.join(o,".git"),"utf-8").trim();if(!e.startsWith("gitdir:"))return o;let n=t.resolve(o,e.slice(7).trim()),i=t.resolve(n,s.readFileSync(t.join(n,"commondir"),"utf-8").trim());return t.resolve(t.dirname(n))!==t.join(i,"worktrees")||s.realpathSync(s.readFileSync(t.join(n,"gitdir"),"utf-8").trim())!==t.join(s.realpathSync(o),".git")?o:t.basename(i)!==".git"?i.normalize("NFC"):t.dirname(i).normalize("NFC")}catch{return o}}function y(){return process.env.MATILDA_CODE_MEMORY_BASE_DIR?g(void 0,process.env.MATILDA_CODE_MEMORY_BASE_DIR):l.getRuntimeBaseDir()}var A=new Map;function u(r){let o=process.env.MATILDA_CODE_MEMORY_LOCAL==="1",e=o?"":y(),n=`${o?"local":e}\0${r}`,i=A.get(n);if(i!==void 0)return i;let a;if(o)a=t.join(r,m,M);else{let E=D(r)??t.resolve(r);a=t.join(e,"projects",h(E),M)}return A.set(n,a),a}function c(r){return t.dirname(u(r))}function j(r,o){let e=t.normalize(r),n=t.normalize(u(o)),i=t.relative(n,e);return i===""||!i.startsWith("..")&&!t.isAbsolute(i)}function L(r){return t.join(u(r),f)}function S(r){return t.join(c(r),d)}function v(r){return t.join(c(r),x)}function U(r){return t.join(c(r),R)}function _(){return t.join(y(),O)}function F(){return t.join(_(),f)}function I(r){let o=t.normalize(r),e=t.normalize(_()),n=t.relative(e,o);return n===""||!n.startsWith("..")&&!t.isAbsolute(n)}function N(r,o){return j(r,o)||I(r)}export{f as a,y as b,u as c,c as d,j as e,L as f,S as g,v as h,U as i,_ as j,F as k,N as l};
|
|
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{
|
|
3
|
+
import{V as M,b as u}from"./chunk-7E2YCGHS.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,V as c};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{f as o,g as a,m as u,n}from"./chunk-
|
|
3
|
+
import{f as o,g as a,m as u,n}from"./chunk-POGNX7U3.js";import{b as s}from"./chunk-GZPNIYVZ.js";s();var i=`Submit your final answer as structured JSON that conforms to the provided schema.
|
|
4
4
|
|
|
5
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
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{a as r}from"./chunk-V6UPUMP3.js";import{
|
|
3
|
+
import{a as r}from"./chunk-V6UPUMP3.js";import{V as g}from"./chunk-7E2YCGHS.js";import{b as f}from"./chunk-GZPNIYVZ.js";f();function h(n,o){return`Base directory for this skill: ${n}
|
|
4
4
|
Important: ALWAYS resolve absolute paths from this base directory when working with skills.
|
|
5
5
|
|
|
6
6
|
${o}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{d as T}from"./chunk-
|
|
3
|
+
import{d as T}from"./chunk-V4VILMIK.js";import{b as W}from"./chunk-7ZODGQO6.js";import{a as P}from"./chunk-GT6MSEK4.js";import{b as g}from"./chunk-J3ZCE3TA.js";import{V as _,b as l}from"./chunk-7E2YCGHS.js";import{b as x}from"./chunk-GZPNIYVZ.js";import{f as U}from"./chunk-OWGSC52X.js";x();var F=U(W(),1);import*as d from"node:fs/promises";import{constants as B}from"node:fs";import*as b from"node:path";var f=_("AGENTS_TEAM_TASKS"),$=32768,v=16;function M(r){if(!r)return;let e=Buffer.byteLength(JSON.stringify(r),"utf-8");if(e>$)throw new Error(`Task metadata is too large (${e} bytes; max ${$}). Trim the payload or store the bulk content elsewhere.`)}var X={retries:{retries:30,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:r=>{f.warn("task lock compromised:",r?.message??r)}},A=new Map;function K(r){let e=A.get(r);return e||(e=new P,A.set(r,e)),e}async function h(r,e,t){return K(r).runExclusive(async()=>{let i;try{i=await F.default.lock(r,X)}catch(o){if(l(o)&&o.code==="ENOENT")return t();throw o}try{return await e()}finally{await i()}})}var q="__reciprocal__",j=new Map;function z(r){let e=j.get(r);return e||(e=new P,j.set(r,e)),e}function Y(r){if(!/^[1-9]\d*$/.test(r))throw new Error(`Invalid task ID "${r}". Task IDs must be positive integers.`)}function m(r,e){return Y(e),b.join(T(r),`${e}.json`)}var O=new Set;function ae(r){return O.add(r),()=>{O.delete(r)}}function k(r){for(let e of O)try{e(r)}catch(t){f.warn(`task update listener failed: ${t}`)}}async function ie(r,e){M(e.metadata);let t=T(r);await d.mkdir(t,{recursive:!0});let i=15;for(let o=0;o<i;o++){let c=await Z(t),s={id:c,subject:e.subject,description:e.description,activeForm:e.activeForm,owner:e.owner,status:"pending",blocks:[],blockedBy:[],metadata:e.metadata},n=b.join(t,`${c}.json`);try{await(await d.open(n,B.O_WRONLY|B.O_CREAT|B.O_EXCL)).close()}catch(a){if(l(a)&&a.code==="EEXIST")continue;throw a}try{await g(n,s)}catch(a){throw await d.unlink(n).catch(()=>{}),a}return k(r),s}throw new Error(`Failed to create task after ${i} attempts (ID contention).`)}async function oe(r,e){let t=m(r,e);try{let i=await d.readFile(t,"utf-8");return JSON.parse(i)}catch(i){if(l(i)&&i.code==="ENOENT")return;throw i}}var p=class extends Error{constructor(t,i,o){super(`Task #${t} is owned by "${o}". Only the leader or the owner can change status / owner / subject / description / blocks.`);this.taskId=t;this.callerName=i;this.actualOwner=o;this.name="TaskOwnershipError"}};async function ce(r,e,t,i){let o=m(r,e);return h(o,async()=>{let c;try{c=await d.readFile(o,"utf-8")}catch(n){if(l(n)&&n.code==="ENOENT")return;throw n}let s=JSON.parse(c);if(i?.callerName!==void 0&&i.callerName!==q&&(t.status!==void 0||t.owner!==void 0||t.subject!==void 0||t.description!==void 0||(t.addBlocks?.length??0)>0||(t.addBlockedBy?.length??0)>0)&&s.owner&&s.owner!==i.callerName)throw new p(e,i.callerName,s.owner);if(t.addBlocks?.length){let n=new Set(s.blocks);for(let a of t.addBlocks)n.add(a);s.blocks=Array.from(n)}if(t.addBlockedBy?.length){let n=new Set(s.blockedBy);for(let a of t.addBlockedBy)n.add(a);s.blockedBy=Array.from(n)}if(t.status!==void 0&&(s.status=t.status,t.status==="completed"&&s.blocks.length>0&&await Q(r,e,s.blocks)),t.owner!==void 0&&(s.owner=t.owner?t.owner:void 0),t.subject!==void 0&&(s.subject=t.subject),t.description!==void 0&&(s.description=t.description),t.activeForm!==void 0&&(s.activeForm=t.activeForm??void 0),t.metadata!==void 0){s.metadata=s.metadata??{};for(let[n,a]of Object.entries(t.metadata))n==="__proto__"||n==="constructor"||n==="prototype"||(a===null?delete s.metadata[n]:s.metadata[n]=a);Object.keys(s.metadata).length===0&&(s.metadata=void 0),M(s.metadata)}return await g(o,s),k(r),s},()=>{})}async function de(r,e,t){let i=m(r,e),o=await h(i,async()=>{let s;try{let a=await d.readFile(i,"utf-8");s=JSON.parse(a)}catch(a){if(l(a)&&a.code==="ENOENT")return null;throw a}if(t?.callerName!==void 0&&s.owner&&s.owner!==t.callerName)throw new p(e,t.callerName,s.owner);let n=new Set([...s.blocks,...s.blockedBy]);n.delete(e);try{await d.unlink(i)}catch(a){if(l(a)&&a.code==="ENOENT")return null;throw a}return n},()=>null);if(o===null)return!1;let c=await Promise.allSettled(Array.from(o).map(s=>G(r,s,e)));for(let s of c)s.status==="rejected"&&f.warn(`deleteTask(${e}): edge cleanup failed: ${s.reason}`);return k(r),!0}async function G(r,e,t){let i=m(r,e);await h(i,async()=>{try{let o=await d.readFile(i,"utf-8"),c=JSON.parse(o),s=c.blocks.length,n=c.blockedBy.length;if(c.blocks=c.blocks.filter(a=>a!==t),c.blockedBy=c.blockedBy.filter(a=>a!==t),c.blocks.length===s&&c.blockedBy.length===n)return;await g(i,c)}catch(o){if(l(o)&&o.code==="ENOENT")return;throw o}},()=>{})}async function R(r,e){let t=T(r),i;try{i=await d.readdir(t)}catch(n){if(l(n)&&n.code==="ENOENT")return[];let a=n instanceof Error?n.message:String(n);throw f.warn(`Failed to list tasks dir ${t}: ${a}`),n instanceof Error?n:new Error(a)}let o=i.filter(n=>n.endsWith(".json")),c=[];for(let n=0;n<o.length;n+=v){let a=o.slice(n,n+v),w=await Promise.all(a.map(async C=>{let y=b.join(t,C),S;try{S=await d.readFile(y,"utf-8")}catch(u){if(l(u)&&u.code==="ENOENT")return;let E=u instanceof Error?u.message:String(u);f.warn(`Failed to read task file ${y}: ${E}`);return}if(S.trim()!=="")try{return JSON.parse(S)}catch(u){let E=u instanceof Error?u.message:String(u);f.warn(`Quarantining corrupt task file ${y}: ${E}`);let D=`${y}.corrupt-${Date.now()}`;try{await d.rename(y,D)}catch(N){let J=N instanceof Error?N.message:String(N);f.warn(`Failed to quarantine ${y}: ${J}`)}return}}));c.push(...w)}let s=c.filter(n=>n!==void 0);return s.sort((n,a)=>Number(n.id)-Number(a.id)),e?s.filter(n=>!(e.status!==void 0&&n.status!==e.status||e.owner!==void 0&&n.owner!==e.owner||e.blockedBy!==void 0&&!n.blockedBy.includes(e.blockedBy))):s}async function le(r){let e=T(r);await d.rm(e,{recursive:!0,force:!0}),k(r)}async function Q(r,e,t){let i=await Promise.allSettled(t.map(async o=>{let c=m(r,o);await h(c,async()=>{let s;try{s=await d.readFile(c,"utf-8")}catch(w){if(l(w)&&w.code==="ENOENT")return;throw w}let n=JSON.parse(s),a=n.blockedBy.length;n.blockedBy=n.blockedBy.filter(w=>w!==e),n.blockedBy.length!==a&&await g(c,n)},()=>{})}));for(let o of i)o.status==="rejected"&&f.warn(`unblockDependents(${e}): ${o.reason}`);k(r)}async function ue(r,e,t,i){return i?.checkAgentBusy?z(t).runExclusive(()=>L(r,e,t,i,!0)):L(r,e,t,i,!1)}async function L(r,e,t,i,o){if(o&&await V(r,t))return;let c=m(r,e);return h(c,async()=>{let s;try{s=await d.readFile(c,"utf-8")}catch(a){if(l(a)&&a.code==="ENOENT")return;throw a}let n=JSON.parse(s);if(n.status==="pending"&&!n.owner)return n.owner=i?.ownerName??t,n.status="in_progress",await g(c,n),k(r),n},()=>{})}async function V(r,e){let t=await R(r,{status:"in_progress"}),i=e.split("@")[0];return t.some(o=>o.owner===e||o.owner===i)}async function H(r,e,t){let i=m(r,e);return h(i,async()=>{let o;try{o=await d.readFile(i,"utf-8")}catch(s){if(l(s)&&s.code==="ENOENT")return!1;throw s}let c=JSON.parse(o);return c.status!=="in_progress"||c.owner!==t?!1:(c.owner=void 0,c.status="pending",await g(i,c),!0)},()=>!1)}async function fe(r,e){let t=e.split("@")[0],o=(await R(r,{status:"in_progress"})).filter(a=>a.owner===e||a.owner===t),c=await Promise.allSettled(o.map(a=>H(r,a.id,a.owner))),s=c.filter(a=>a.status==="rejected");s.length>0&&f.warn(`unassignTeammateTasks: ${s.length}/${o.length} task(s) failed to unassign for ${e}`);let n=c.filter(a=>a.status==="fulfilled"&&a.value===!0).length;return n>0&&k(r),n}async function Z(r){let e;try{e=await d.readdir(r)}catch{return"1"}let t=0;for(let i of e){if(!i.endsWith(".json"))continue;let o=parseInt(i.replace(".json",""),10);!isNaN(o)&&o>t&&(t=o)}return String(t+1)}export{q as a,Y as b,ae as c,ie as d,oe as e,p as f,ce as g,de as h,R as i,le as j,ue as k,fe as l};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda
|