@maincode-ai/matilda-code 0.21.13 → 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-BNSWGD26.js → askUserQuestion-RZYBOPLR.js} +3 -3
- package/chunks/ca-JKEHLTNL.js +23 -0
- package/chunks/chunk-225CZWD7.js +89 -0
- package/chunks/{chunk-MEV5XQI2.js → chunk-2XSB5XHX.js} +1 -1
- package/chunks/chunk-453BANK3.js +8 -0
- package/chunks/{chunk-6M5G5FBH.js → chunk-4UGPARBR.js} +1 -1
- package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
- package/chunks/chunk-5ETLURI6.js +3 -0
- package/chunks/chunk-6NXVLJ3X.js +56 -0
- package/chunks/{chunk-QZI2ZGZY.js → chunk-7B65UIHB.js} +1 -1
- package/chunks/{chunk-27Q5KW3A.js → chunk-7E2YCGHS.js} +13 -13
- package/chunks/{chunk-DHDD5YJC.js → chunk-ARAB5QTM.js} +69 -69
- package/chunks/chunk-DUB7JMQV.js +13 -0
- package/chunks/chunk-G3F3ZCH2.js +9 -0
- package/chunks/chunk-GT6MSEK4.js +3 -0
- package/chunks/chunk-HEJO7OBH.js +3 -0
- package/chunks/{chunk-6T2GIM76.js → chunk-IHWAOFCQ.js} +1 -1
- package/chunks/chunk-ILHNCXBC.js +8 -0
- package/chunks/chunk-J3ZCE3TA.js +8 -0
- package/chunks/{chunk-AOOZREGV.js → chunk-LBQNFSZ2.js} +1 -1
- package/chunks/{chunk-5OHGYMKP.js → chunk-LM6OIN4B.js} +1 -1
- package/chunks/{chunk-EZDV7A76.js → chunk-LMZBADPW.js} +1 -1
- package/chunks/chunk-MGRXOZAG.js +8 -0
- package/chunks/chunk-NBLBE7PE.js +2609 -0
- package/chunks/chunk-POGNX7U3.js +31 -0
- package/chunks/chunk-PQZ6HKKW.js +80 -0
- package/chunks/chunk-QXSBPCBA.js +8 -0
- package/chunks/chunk-RHSUTILA.js +9 -0
- package/chunks/{chunk-P5TG5CON.js → chunk-RPXRN7E6.js} +1 -1
- package/chunks/chunk-TUKNB5CQ.js +33 -0
- package/chunks/chunk-UM6CLO7D.js +7 -0
- package/chunks/chunk-V2VUANFI.js +120 -0
- package/chunks/chunk-V4VILMIK.js +14 -0
- package/chunks/chunk-ZSGBDQXU.js +11 -0
- package/chunks/{computer-use-J4GAM4M6.js → computer-use-PBCWDTJR.js} +1 -1
- package/chunks/{cron-create-IDWSZENI.js → cron-create-PHQ43NYA.js} +1 -1
- package/chunks/cron-delete-7RCQIU2U.js +3 -0
- package/chunks/cron-list-KKNLLMNN.js +5 -0
- package/chunks/de-GMGNR5CZ.js +23 -0
- package/chunks/{devtools-XRQ4YJ5S.js → devtools-7YNCRYZV.js} +1 -1
- package/chunks/{chunk-OOEH6ZSV.js → dist-UWUWLWTO.js} +2 -2
- package/chunks/{edit-X2S2ZXRN.js → edit-ELHNQB5E.js} +1 -1
- package/chunks/en-3NQMLVKW.js +23 -0
- package/chunks/{enter-worktree-TUCGNCLO.js → enter-worktree-UZIBOBV3.js} +1 -1
- package/chunks/enterPlanMode-UHY3DZXE.js +18 -0
- package/chunks/{exit-worktree-7FLITFZI.js → exit-worktree-HLG4PDMX.js} +1 -1
- package/chunks/{exitPlanMode-O5UUJ3GM.js → exitPlanMode-V4HYNH3J.js} +2 -2
- package/chunks/fr-WS3EBB36.js +23 -0
- package/chunks/{getMachineId-bsd-ZYBNK2JG.js → getMachineId-bsd-ETKQTB6C.js} +1 -1
- package/chunks/{getMachineId-darwin-CM2MQGUI.js → getMachineId-darwin-AKNRWOWB.js} +1 -1
- package/chunks/{getMachineId-linux-SYE2KMCW.js → getMachineId-linux-2QSD7FTP.js} +1 -1
- package/chunks/{getMachineId-unsupported-6IHVG2XO.js → getMachineId-unsupported-UXSV7I24.js} +1 -1
- package/chunks/{getMachineId-win-S3J3JSUM.js → getMachineId-win-4MTFXGP3.js} +1 -1
- package/chunks/glob-C5CTWXLP.js +22 -0
- package/chunks/{goal-tools-YQOA6OKU.js → goal-tools-BGIWEJ3K.js} +3 -3
- package/chunks/{grep-VAB2VSXM.js → grep-BEFTGKHW.js} +1 -1
- package/chunks/ja-GBCDQ43R.js +23 -0
- package/chunks/keychain-token-storage-FEJZYJBB.js +3 -0
- package/chunks/ls-XH55NAD3.js +15 -0
- package/chunks/{lsp-NGLDRHZU.js → lsp-BKDCR37G.js} +1 -1
- package/chunks/mcp-client-GAQG7MCT.js +3 -0
- package/chunks/monitor-NSVUUKCM.js +32 -0
- package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
- 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-GJSEMAZB.js +8 -0
- package/chunks/shell-J5Q2UEXH.js +3 -0
- package/chunks/{skill-ETQM5NI3.js → skill-3RWNSUNE.js} +1 -1
- package/chunks/src-LZEU4AYF.js +5 -0
- package/chunks/symbol-search-4VM6J5Y4.js +19 -0
- package/chunks/{syntheticOutput-WZDPECYS.js → syntheticOutput-O7LEF3AM.js} +1 -1
- package/chunks/task-create-N4IRJBTF.js +3 -0
- package/chunks/{task-detach-TBAVUOTC.js → task-detach-RGNQUX3H.js} +1 -1
- package/chunks/task-list-Z7JUB4QK.js +9 -0
- package/chunks/{task-stop-HDSARSJ6.js → task-stop-L2OWK2PJ.js} +1 -1
- package/chunks/{task-update-MW2VT2XV.js → task-update-H5AXVXDS.js} +1 -1
- package/chunks/{team-create-VMYNLZCC.js → team-create-FWTIQ2FT.js} +2 -2
- package/chunks/team-delete-D45ALROH.js +8 -0
- package/chunks/todoWrite-LCQOQBI7.js +3 -0
- package/chunks/{tool-search-WX6FOE35.js → tool-search-X6UUCSPU.js} +1 -1
- package/chunks/{web-fetch-CKYBHGLF.js → web-fetch-244KUWSX.js} +17 -17
- package/chunks/web-search-YRZ3BZ3X.js +26 -0
- package/chunks/{workflow-WBSRQG3N.js → workflow-EP4AFR24.js} +2 -2
- package/chunks/write-file-EXWGRN4Q.js +15 -0
- package/cli.js +641 -678
- package/examples/starter/README.md +0 -3
- package/locales/ca.js +3 -87
- package/locales/de.js +3 -91
- package/locales/en.js +3 -91
- package/locales/fr.js +3 -88
- package/locales/ja.js +3 -92
- package/locales/pt.js +3 -92
- package/locales/ru.js +3 -91
- package/package.json +2 -2
- package/sandbox-macos-permissive-proxied.sb +1 -1
- package/sandbox-macos-restrictive-closed.sb +14 -1
- package/sandbox-macos-restrictive-open.sb +14 -1
- package/sandbox-macos-restrictive-proxied.sb +15 -2
- package/bundled/mainy/SKILL.md +0 -157
- package/bundled/mainy/docs/_meta.ts +0 -32
- package/bundled/mainy/docs/common-workflow.md +0 -571
- package/bundled/mainy/docs/configuration/_meta.ts +0 -7
- package/bundled/mainy/docs/configuration/auth.md +0 -82
- package/bundled/mainy/docs/configuration/matilda-ignore.md +0 -55
- package/bundled/mainy/docs/configuration/model-providers.md +0 -516
- package/bundled/mainy/docs/configuration/settings.md +0 -818
- package/bundled/mainy/docs/configuration/themes.md +0 -199
- package/bundled/mainy/docs/configuration/trusted-folders.md +0 -67
- package/bundled/mainy/docs/extension/_meta.ts +0 -9
- package/bundled/mainy/docs/extension/extension-releasing.md +0 -204
- package/bundled/mainy/docs/extension/getting-started-extensions.md +0 -299
- package/bundled/mainy/docs/extension/introduction.md +0 -338
- package/bundled/mainy/docs/features/_meta.ts +0 -27
- package/bundled/mainy/docs/features/approval-mode.md +0 -388
- package/bundled/mainy/docs/features/arena.md +0 -219
- package/bundled/mainy/docs/features/auto-mode.md +0 -308
- package/bundled/mainy/docs/features/channels/_meta.ts +0 -5
- package/bundled/mainy/docs/features/channels/overview.md +0 -328
- package/bundled/mainy/docs/features/channels/plugins.md +0 -87
- package/bundled/mainy/docs/features/channels/telegram.md +0 -120
- package/bundled/mainy/docs/features/code-review.md +0 -291
- package/bundled/mainy/docs/features/commands.md +0 -528
- package/bundled/mainy/docs/features/dual-output.md +0 -627
- package/bundled/mainy/docs/features/followup-suggestions.md +0 -109
- package/bundled/mainy/docs/features/headless.md +0 -448
- package/bundled/mainy/docs/features/hooks.md +0 -1308
- package/bundled/mainy/docs/features/language.md +0 -144
- package/bundled/mainy/docs/features/lsp.md +0 -496
- package/bundled/mainy/docs/features/markdown-rendering.md +0 -183
- package/bundled/mainy/docs/features/mcp.md +0 -423
- package/bundled/mainy/docs/features/memory.md +0 -185
- package/bundled/mainy/docs/features/sandbox.md +0 -249
- package/bundled/mainy/docs/features/scheduled-tasks.md +0 -139
- package/bundled/mainy/docs/features/skills.md +0 -347
- package/bundled/mainy/docs/features/status-line.md +0 -397
- package/bundled/mainy/docs/features/structured-output.md +0 -309
- package/bundled/mainy/docs/features/sub-agents.md +0 -737
- package/bundled/mainy/docs/features/tips.md +0 -54
- package/bundled/mainy/docs/features/token-caching.md +0 -29
- package/bundled/mainy/docs/features/tool-use-summaries.md +0 -178
- package/bundled/mainy/docs/features/worktree.md +0 -343
- package/bundled/mainy/docs/ide-integration/_meta.ts +0 -4
- package/bundled/mainy/docs/ide-integration/ide-companion-spec.md +0 -182
- package/bundled/mainy/docs/ide-integration/ide-integration.md +0 -144
- package/bundled/mainy/docs/integration-github-action.md +0 -241
- package/bundled/mainy/docs/integration-jetbrains.md +0 -81
- package/bundled/mainy/docs/integration-vscode.md +0 -39
- package/bundled/mainy/docs/integration-zed.md +0 -72
- package/bundled/mainy/docs/matilda-serve-deploy-local.md +0 -221
- package/bundled/mainy/docs/matilda-serve.md +0 -661
- package/bundled/mainy/docs/overview.md +0 -64
- package/bundled/mainy/docs/quickstart.md +0 -234
- package/bundled/mainy/docs/reference/_meta.ts +0 -3
- package/bundled/mainy/docs/reference/keyboard-shortcuts.md +0 -91
- package/bundled/mainy/docs/support/Uninstall.md +0 -65
- package/bundled/mainy/docs/support/_meta.ts +0 -6
- package/bundled/mainy/docs/support/tos-privacy.md +0 -94
- package/bundled/mainy/docs/support/troubleshooting.md +0 -127
- package/chunks/agent-SRAIVZEE.js +0 -3
- package/chunks/agent-headless-XRDOZESG.js +0 -3
- package/chunks/anthropicContentGenerator-LLDIKDMQ.js +0 -39
- package/chunks/ca-NPYL24ME.js +0 -25
- package/chunks/chunk-27HUYW23.js +0 -22
- package/chunks/chunk-2HTPVSGT.js +0 -3
- package/chunks/chunk-3B2HABK7.js +0 -30
- package/chunks/chunk-3MTZTNAU.js +0 -101
- package/chunks/chunk-3YLXGE6T.js +0 -8
- package/chunks/chunk-47XR7IMP.js +0 -8
- package/chunks/chunk-4F4DA5UI.js +0 -8
- package/chunks/chunk-4Q2SNBUH.js +0 -18
- package/chunks/chunk-6EQMZNIY.js +0 -8
- package/chunks/chunk-6I6VGTKD.js +0 -8
- package/chunks/chunk-DC7LAFZZ.js +0 -8
- package/chunks/chunk-DE3HKC2W.js +0 -9
- package/chunks/chunk-FWDMPRKU.js +0 -3
- package/chunks/chunk-G7R2XEEF.js +0 -7
- package/chunks/chunk-GOJCMVJJ.js +0 -8
- package/chunks/chunk-GTVCJCHR.js +0 -8
- package/chunks/chunk-IJEGHQ7Z.js +0 -32
- package/chunks/chunk-JCE3JAVC.js +0 -25
- package/chunks/chunk-KHHJYBR5.js +0 -9
- package/chunks/chunk-LUNDTQ3G.js +0 -8
- package/chunks/chunk-LWARA7JY.js +0 -37
- package/chunks/chunk-M53RP3YP.js +0 -31
- package/chunks/chunk-MTMU7JYZ.js +0 -11
- package/chunks/chunk-O44XK65C.js +0 -8
- package/chunks/chunk-OA56BXPD.js +0 -3
- package/chunks/chunk-PEKAUGYV.js +0 -2621
- package/chunks/chunk-PGUG43HG.js +0 -24
- package/chunks/chunk-PGXQZVLX.js +0 -8
- package/chunks/chunk-QKYGQLWC.js +0 -8
- package/chunks/chunk-QN6Y6NPA.js +0 -3
- package/chunks/chunk-RI54U73U.js +0 -56
- package/chunks/chunk-RPFSFS7Z.js +0 -39
- package/chunks/chunk-SDTWBD62.js +0 -8
- package/chunks/chunk-SOEIVSM5.js +0 -113
- package/chunks/chunk-SVSY6AWS.js +0 -59
- package/chunks/chunk-T2T2UEPY.js +0 -4
- package/chunks/chunk-TISQNFB5.js +0 -3
- package/chunks/chunk-TWJLOEAI.js +0 -31
- package/chunks/chunk-VI74YQQO.js +0 -8
- package/chunks/chunk-VYZOOSMP.js +0 -30
- package/chunks/chunk-W4QSMIWO.js +0 -9
- package/chunks/chunk-WC2VTVCE.js +0 -27
- package/chunks/chunk-YV3PUOBU.js +0 -65
- package/chunks/chunk-ZX34M2GF.js +0 -14
- package/chunks/contextCommand-5F5M7NA4.js +0 -3
- package/chunks/cron-delete-NQCDZDUI.js +0 -3
- package/chunks/cron-list-Z4XMC3TO.js +0 -5
- package/chunks/de-34YZHGC6.js +0 -25
- package/chunks/dist-7UYRLSLE.js +0 -3
- package/chunks/dist-PH6JW7XD.js +0 -42
- package/chunks/en-QLGMD6OS.js +0 -25
- package/chunks/enterPlanMode-SQEZAAIR.js +0 -18
- package/chunks/fileFromPath-7UCWPD4W.js +0 -3
- package/chunks/fr-EDNBQACJ.js +0 -25
- package/chunks/geminiContentGenerator-FIZFLPU3.js +0 -8
- package/chunks/glob-GSFTYAS2.js +0 -22
- package/chunks/ja-LV4RLM3M.js +0 -25
- package/chunks/keychain-token-storage-KQK6MNOJ.js +0 -3
- package/chunks/ls-IZJ3CKZY.js +0 -15
- package/chunks/matildaAgentContentGenerator-QQHPCFJ5.js +0 -8
- package/chunks/matildaContentGenerator-W7Z33ONU.js +0 -8
- package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
- package/chunks/mcp-client-DXUNIEIB.js +0 -3
- package/chunks/monitor-4PFIGAGG.js +0 -32
- package/chunks/notebook-edit-MWJYAATJ.js +0 -17
- package/chunks/openaiContentGenerator-NDVJL6QL.js +0 -3
- package/chunks/pt-5SQ4DGL7.js +0 -25
- package/chunks/read-file-WPZKPXWA.js +0 -3
- package/chunks/ripGrep-7LZDZFTX.js +0 -3
- package/chunks/ru-7K24S53N.js +0 -25
- package/chunks/scheduler-DK2MVKXX.js +0 -8
- package/chunks/send-message-TCPX5UDU.js +0 -8
- package/chunks/serve-GSZPJI2O.js +0 -1026
- package/chunks/shell-PRS47PDP.js +0 -3
- package/chunks/src-UB7DZRYK.js +0 -3
- package/chunks/src-WZTRMETQ.js +0 -5
- package/chunks/symbol-search-HARHZ5AH.js +0 -19
- package/chunks/task-create-XRNIDT4T.js +0 -3
- package/chunks/task-list-Z6BDZZID.js +0 -9
- package/chunks/team-delete-F7QDC2TE.js +0 -8
- package/chunks/todoWrite-SCF5M24M.js +0 -3
- package/chunks/web-search-67DFNS5V.js +0 -26
- package/chunks/write-file-S5FAX4JJ.js +0 -15
package/chunks/chunk-PGUG43HG.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{b as le}from"./chunk-7ZODGQO6.js";import{b as E}from"./chunk-TISQNFB5.js";import{g as $}from"./chunk-SDTWBD62.js";import{e as D}from"./chunk-LUNDTQ3G.js";import{ba as q}from"./chunk-27Q5KW3A.js";import{b as m}from"./chunk-GZPNIYVZ.js";import{f as ue}from"./chunk-OWGSC52X.js";m();import f from"node:fs";import O from"node:path";import _ from"node:readline";import{finished as fe}from"node:stream/promises";var y=q("JSONL"),C=new Map;function pe(n){return C.has(n)||C.set(n,new E),C.get(n)}function me(n){let e=[],t=0,r=!1,i=!1,o=-1;for(let s=0;s<n.length;s++){let a=n[s];if(i){i=!1;continue}if(r){a==="\\"?i=!0:a==='"'&&(r=!1);continue}if(a==='"'){r=!0;continue}if(a==="{")t===0&&(o=s),t++;else if(a==="}")if(t--,t===0&&o>=0){let d=n.slice(o,s+1);try{e.push(JSON.parse(d))}catch{}o=-1}else t<0&&(t=0,o=-1)}return e}function x(n,e){try{let t=JSON.parse(n);return t!==null&&typeof t=="object"&&!Array.isArray(t)?[t]:(y.warn(`Skipping non-object JSONL value in ${e}`),[])}catch{let t=me(n);return t.length===0?y.warn(`Failed to parse line in ${e}`):y.warn(`Recovered ${t.length} record(s) from malformed line in ${e}`),t}}async function R(n,e){if(n?.close(),!e||e.closed)return;let t=fe(e,{cleanup:!0}).catch(()=>{});e.destroyed||e.destroy(),await t}async function ze(n,e){let t,r;try{t=f.createReadStream(n),r=_.createInterface({input:t,crlfDelay:1/0});let i=[];for await(let o of r){if(i.length>=e)break;let s=o.trim();if(s.length!==0)for(let a of x(s,n)){if(i.length>=e)break;i.push(a)}}return i}catch(i){return i.code!=="ENOENT"&&y.error(`Error reading first ${e} lines from ${n}:`,i),[]}finally{await R(r,t)}}async function We(n){let e,t;try{e=f.createReadStream(n),t=_.createInterface({input:e,crlfDelay:1/0});let r=[];for await(let i of t){let o=i.trim();if(o.length!==0)for(let s of x(o,n))r.push(s)}return r}catch(r){return r.code!=="ENOENT"&&y.error(`Error reading ${n}:`,r),[]}finally{await R(t,e)}}var P=new Set;function N(n){let e=f.openSync(n,"a+");try{let t=f.fstatSync(e).size;if(t===0)return;let r=Buffer.alloc(1);f.readSync(e,r,0,1,t-1),r[0]!==10&&f.writeSync(e,`
|
|
4
|
-
`)}finally{f.closeSync(e)}}function Ve(){P.clear()}async function Ke(n,e){await A(n,`${JSON.stringify(e)}
|
|
5
|
-
`)}async function A(n,e){await pe(n).runExclusive(async()=>{let r=O.dirname(n);P.has(r)||(await f.promises.mkdir(r,{recursive:!0}),P.add(r)),await f.promises.appendFile(n,Buffer.from(e,"utf8"),{flush:!0})})}function Ge(n,e){let t=`${JSON.stringify(e)}
|
|
6
|
-
`,r=O.dirname(n);f.existsSync(r)||f.mkdirSync(r,{recursive:!0}),f.appendFileSync(n,Buffer.from(t,"utf8"),{flush:!0})}function Xe(n,e){let t=e.map(i=>JSON.stringify(i)).join(`
|
|
7
|
-
`),r=O.dirname(n);f.existsSync(r)||f.mkdirSync(r,{recursive:!0}),D(n,`${t}
|
|
8
|
-
`,{encoding:"utf8"})}async function Ye(n){let e,t;try{e=f.createReadStream(n),t=_.createInterface({input:e,crlfDelay:1/0});let r=0;for await(let i of t)i.trim().length>0&&r++;return r}catch(r){return r.code!=="ENOENT"&&y.error(`Error counting lines in ${n}:`,r),0}finally{await R(t,e)}}function Qe(n){try{let e=f.statSync(n);return e.isFile()&&e.size>0}catch{return!1}}m();import{createHash as ae,randomUUID as Re}from"node:crypto";import h from"node:fs/promises";import S from"node:path";m();import l from"node:fs";import X from"node:os";import Y from"node:path";import{randomUUID as j}from"node:crypto";var Q=ue(le(),1);m();import{createHash as ye}from"node:crypto";import{execFileSync as ge}from"node:child_process";var we=/"IOPlatformUUID" = "([0-9A-F]{8}(?:-[0-9A-F]{4}){3}-[0-9A-F]{12})"/i,L;function F(){if(L===void 0){let n=process.platform==="darwin"?Se():"";L=n?ye("sha256").update(n).digest("hex").slice(0,32):""}return L}function Se(){try{let n=ge("/usr/sbin/ioreg",["-rd1","-c","IOPlatformExpertDevice"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}),e=we.exec(n)?.[1]??"";return/[1-9A-F]/i.test(e)?e:""}catch{return""}}var Z=1,H=".writer.lock",be=".recovery",z=1e4,Ee=4096,xe=256,v=128,ve=255,k=class extends Error{constructor(t,r){super(`Session ${t} already has an active transcript writer`);this.sessionId=t;this.owner=r;this.name="SessionTranscriptBusyError"}code="SESSION_TRANSCRIPT_BUSY"};function Ie(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return e.version===Z&&typeof e.sessionId=="string"&&e.sessionId.length>0&&e.sessionId.length<=xe&&typeof e.ownerId=="string"&&e.ownerId.length>0&&e.ownerId.length<=v&&typeof e.writerEpoch=="string"&&e.writerEpoch.length>0&&e.writerEpoch.length<=v&&Number.isInteger(e.pid)&&e.pid>0&&typeof e.hostname=="string"&&e.hostname.length>0&&e.hostname.length<=ve&&(e.pidSpaceId===void 0||typeof e.pidSpaceId=="string"&&e.pidSpaceId.length>0&&e.pidSpaceId.length<=v)&&typeof e.createdAt=="string"&&e.createdAt.length>0&&e.createdAt.length<=v}function I(n){try{let e=l.lstatSync(n);if(!e.isFile()||e.size>Ee)return{};let t=l.readFileSync(n,"utf8"),r=JSON.parse(t);return Ie(r)?{raw:t,owner:r}:{raw:t}}catch{return{}}}function ke(n){try{return process.kill(n,0),"alive"}catch(e){let t=e.code;return t==="ESRCH"?"dead":t==="EPERM"?"alive":"unknown"}}function ee(n,e,t){let r=n.parentUuid,i=n.committedPosition;return{offset:e,length:t,...typeof n.uuid=="string"?{uuid:n.uuid}:{},...typeof r=="string"||r===null?{parentUuid:r}:{},...typeof n.writerEpoch=="string"?{writerEpoch:n.writerEpoch}:{},...Number.isSafeInteger(i)?{committedPosition:i}:{},...typeof n.messageId=="string"?{messageId:n.messageId}:{},rewind:n.subtype==="rewind",valid:!0}}async function W(n){let e;try{e=await l.promises.readFile(n)}catch(a){if(a.code==="ENOENT")return{entries:[],bytes:0,nextPosition:1};throw a}let t=[],r=0,i=0,o=0;for(;o<e.length;){let a=e.indexOf(10,o),d=a<0?e.length:a+1,u=e.toString("utf8",o,a<0?d:a).trim();if(u.length>0){let c;try{c=JSON.parse(u)}catch{c=void 0}if(c&&typeof c=="object"&&!Array.isArray(c)){let p=ee(c,o,d-o);t.push(p),r++,(p.committedPosition??0)>i&&(i=p.committedPosition)}else{t.push({offset:o,length:d-o,rewind:!1,valid:!1});for(let p of x(u,n))r++,Number.isSafeInteger(p.committedPosition)&&p.committedPosition>i&&(i=p.committedPosition)}}o=d}let s=Math.max(r,i)+1;if(!Number.isSafeInteger(s))throw new Error("Session transcript committed position is exhausted");return{entries:t,bytes:e.length,nextPosition:s}}async function Te(n,e,t,r){if(t>=r)return[];let i=e[t].offset,o=e[r-1],s=Buffer.alloc(o.offset+o.length-i),a=await l.promises.open(n,"r");try{let u=0;for(;u<s.length;){let{bytesRead:c}=await a.read(s,u,s.length-u,i+u);if(c===0)throw new Error("Session transcript ended before its committed end");u+=c}}finally{await a.close()}let d=[];for(let u=t;u<r;u++){let c=e[u];try{if(!c.valid)throw new Error("Not a single record");d.push(JSON.parse(s.toString("utf8",c.offset-i,c.offset-i+c.length)))}catch(p){throw new Error("Session transcript contains an invalid record",{cause:p})}}return d}function te(n){if(n.length===0)return!1;let e=n.toString("utf8");try{return JSON.parse(e),!1}catch(t){return e.trimStart().startsWith("{")&&t instanceof SyntaxError&&(t.message==="Unexpected end of JSON input"||t.message.startsWith("Unterminated string in JSON")||t.message.includes(`in JSON at position ${e.length} (`))}}var Ce=64*1024;async function ut(n){let e;try{e=await l.promises.open(n,"r")}catch(t){if(t.code==="ENOENT")return;throw t}try{for(;;){let t=await Pe(e);if(t!==void 0)return t}}finally{await e.close()}}async function Pe(n){let{size:e}=await n.stat(),t=[],r=e;for(;r>0;){let a=Math.min(Ce,r);r-=a;let d=Buffer.alloc(a),{bytesRead:u}=await n.read(d,0,a,r);if(u<a)return;if(t.unshift(d),d.includes(10))break}let i=Buffer.concat(t),o=i.lastIndexOf(10),s=i.subarray(o+1);return te(s)?r+o+1:s.length>0?e+1:e}function V(n){let e=l.readFileSync(n),t=e.lastIndexOf(10)+1,r=e.subarray(t);if(!te(r))return;if(l.writeFileSync(`${n}.interrupted-${j()}`,r,{flag:"wx",mode:384,flush:!0}),process.platform!=="win32"){let o=l.openSync(Y.dirname(n),"r");try{l.fsyncSync(o)}finally{l.closeSync(o)}}let i=l.openSync(n,"r+");try{l.ftruncateSync(i,t),l.fsyncSync(i)}finally{l.closeSync(i)}}var w=new Map,K=!1;function Oe(){K||(K=!0,process.once("exit",()=>{for(let n of w.values())n.releaseSync()}))}function G(n){return!n||!_e(n)?!1:n.pid===process.pid?![...w.values()].some(e=>e.owner.ownerId===n.ownerId):ke(n.pid)==="dead"}function _e(n){return n.pidSpaceId?n.pidSpaceId===F():n.hostname===X.hostname()}var J=class n{constructor(e,t){this.filePath=e;this.owner=t;this.lockPath=`${e}${H}`}lockPath;released=!1;static acquire(e,t){let r=`${e}${H}`;l.mkdirSync(Y.dirname(e),{recursive:!0});let i=F();for(let o=0;o<2;o++){let s={version:Z,sessionId:t,ownerId:j(),writerEpoch:j(),pid:process.pid,hostname:X.hostname(),...i?{pidSpaceId:i}:{},createdAt:new Date().toISOString()},a;try{a=l.openSync(r,"wx",384),l.writeFileSync(a,`${JSON.stringify(s)}
|
|
9
|
-
`,"utf8"),l.fsyncSync(a),l.closeSync(a),a=void 0;let d=new n(e,s);return w.set(r,d),Oe(),d}catch(d){if(a!==void 0){try{l.closeSync(a)}catch{}try{l.unlinkSync(r)}catch{}}if(d.code!=="EEXIST")throw d;let u=I(r);if(o===0&&u.raw!==void 0&&G(u.owner)){let p=`${r}${be}`,U;try{U=Q.default.lockSync(r,{lockfilePath:p,realpath:!1,stale:z,update:z/2});let g=I(r);if(g.raw===u.raw&&G(g.owner)){l.unlinkSync(r);continue}}catch(g){if(g.code!=="ELOCKED")throw g}finally{U?.()}}let c=I(r).owner;throw new k(t,{...c?{pid:c.pid,hostname:c.hostname,createdAt:c.createdAt,writerEpoch:c.writerEpoch}:{},verifiable:c!==void 0})}}throw new k(t,{verifiable:!1})}releaseSync(){if(this.released)return;if(I(this.lockPath).owner?.ownerId===this.owner.ownerId)try{l.unlinkSync(this.lockPath)}catch{return}this.released=!0,w.get(this.lockPath)===this&&w.delete(this.lockPath)}},T=class n{constructor(e,t,r){this.lease=e;this.writeFilePath=t;this.adoptScan(r)}appendMutex=new E;nextPosition=1;closed=!1;needsPositionRecovery=!1;entries=[];entryByPosition=new Map;firstEntryByUuid=new Map;committedBytes=0;adoptScan(e){this.entries=[],this.entryByPosition=new Map,this.firstEntryByUuid=new Map;for(let t of e.entries)this.addEntry(t);this.committedBytes=e.bytes,this.nextPosition=e.nextPosition}addEntry(e){let t=this.entries.length;this.entries.push(e),e.committedPosition!==void 0&&!this.entryByPosition.has(e.committedPosition)&&this.entryByPosition.set(e.committedPosition,t),e.uuid!==void 0&&!this.firstEntryByUuid.has(e.uuid)&&this.firstEntryByUuid.set(e.uuid,t)}static async open(e,t){return this.openWithOwnership(e,e,t)}static async openStaged(e,t,r){return this.openWithOwnership(e,t,r)}static async openWithOwnership(e,t,r){let i=J.acquire(t,r);try{return l.existsSync(e)&&(V(e),N(e)),new n(i,e,await W(e))}catch(o){throw i.releaseSync(),o}}async append(e){return this.appendMutex.runExclusive(async()=>{if(this.closed)throw new Error("Session transcript writer is closed");this.needsPositionRecovery&&(l.existsSync(this.writeFilePath)&&(V(this.writeFilePath),N(this.writeFilePath)),this.adoptScan(await W(this.writeFilePath)),this.needsPositionRecovery=!1);let t=this.nextPosition,r=this.lease.owner.writerEpoch;e.writerEpoch=r,e.committedPosition=t;let i=`${JSON.stringify(e)}
|
|
10
|
-
`;try{await A(this.writeFilePath,i)}catch(s){throw this.needsPositionRecovery=!0,delete e.writerEpoch,delete e.committedPosition,s}let o=Buffer.byteLength(i,"utf8");return this.addEntry(ee(e,this.committedBytes,o)),this.committedBytes+=o,this.nextPosition++,{recordUuid:e.uuid,writerEpoch:r,committedPosition:t}})}committedMessageIdOf(e){let t=this.firstEntryByUuid.get(e);return t===void 0?void 0:this.entries[t].messageId??e}committedLength(){return this.committedBytes}committedTail(){let e=this.entries.at(-1);if(!(e?.uuid===void 0||e.writerEpoch===void 0||e.committedPosition===void 0))return{recordUuid:e.uuid,writerEpoch:e.writerEpoch,committedPosition:e.committedPosition}}indexView(){if(this.closed||this.needsPositionRecovery)throw new Error("Session transcript has no acknowledged read boundary");let e=this.entries,t=e.length,r=this.entryByPosition,i=this.firstEntryByUuid,o=this.writeFilePath,s=a=>a!==void 0&&a<t?a:void 0;return{entries:e,count:t,entryAtPosition:a=>s(r.get(a)),firstEntryOf:a=>s(i.get(a)),readRecords:(a,d)=>Te(o,e,a,Math.min(d,t))}}async readRecords(){return this.appendMutex.runExclusive(async()=>{if(this.closed||this.needsPositionRecovery)throw new Error("Session transcript has no acknowledged read boundary");let e;try{e=await l.promises.readFile(this.writeFilePath,"utf8")}catch(t){if(t.code==="ENOENT"&&this.nextPosition===1)return[];throw t}try{return e.split(`
|
|
11
|
-
`).filter(t=>t.trim().length>0).map(t=>JSON.parse(t))}catch(t){throw new Error("Session transcript contains an invalid record",{cause:t})}})}async close(){await this.appendMutex.runExclusive(async()=>{this.closed||(this.closed=!0,this.lease.releaseSync())})}};var ne=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,re=/^[0-9a-f]{64}$/,ie=16*1024*1024;function M(n){let e=new URL(n);if(e.username||e.password||e.search||e.hash||!(e.hostname==="matilda.maincode.com"&&e.protocol==="https:"&&!e.port||e.hostname==="core-api.matilda"&&["https:","http:"].includes(e.protocol)))throw new Error("Code credit recovery requires the first-party Core endpoint.");return e.origin}function B(n,e){let t;try{t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString()).sub}catch{}if(typeof t!="string"||!t||t.length>512)throw new Error("Code credits require a Matilda OAuth session.");return ae("sha256").update(JSON.stringify(["matilda-code-credit-account:v1",M(n),t])).digest("hex")}function Ne(n,e){if(!e||e.length>256)throw new Error("Invalid Code credit session.");let t=ae("sha256").update(e).digest("hex");return S.join(n,"code-credit",`${t}.jsonl`)}function oe(n,e){if(!n||typeof n!="object")return!1;let t=n;try{if(M(t.origin)!==t.origin)return!1}catch{return!1}return t.version===1&&ne.test(t.uuid)&&ne.test(t.intent)&&t.sessionId===e&&typeof t.promptId=="string"&&t.promptId.length>0&&t.promptId.length<=512&&re.test(t.account)&&re.test(t.requestHash)&&(t.organizationId===null||typeof t.organizationId=="string"&&/^[0-9a-f-]{36}$/.test(t.organizationId))&&Number.isSafeInteger(t.maximumMinor)&&t.maximumMinor>0&&t.maximumMinor<=1e9&&t.currency==="usd"&&["included","paid"].includes(t.funding)&&["attempted","completed"].includes(t.state)&&typeof t.timestamp=="string"&&Number.isFinite(Date.parse(t.timestamp))}var se=class{constructor(e,t){this.sessionId=t;this.filePath=Ne(e,t)}filePath;writer;closed=!1;async read(){let e;try{let r=await h.lstat(this.filePath);if(!r.isFile()||r.size>ie)throw new Error("Invalid Code credit journal.");e=await h.readFile(this.filePath,"utf8")}catch(r){if(r.code==="ENOENT")return[];throw r}e&&!e.endsWith(`
|
|
12
|
-
`)&&(e=e.slice(0,e.lastIndexOf(`
|
|
13
|
-
`)+1));let t=[];for(let r of e.split(`
|
|
14
|
-
`).filter(Boolean)){let i;try{i=JSON.parse(r)}catch{throw new Error("Invalid Code credit journal.")}if(!oe(i,this.sessionId))throw new Error("Invalid Code credit journal.");t.push(i)}return t}async open(){await this.read();let e=S.dirname(this.filePath),t=await h.mkdir(e,{recursive:!0,mode:448});if(!(await h.lstat(e)).isDirectory())throw new Error("Invalid Code credit directory.");let r=await T.open(this.filePath,this.sessionId);try{let i=await h.open(this.filePath,"a",384);try{await i.sync()}finally{await i.close()}if(process.platform!=="win32"){let o=t?S.dirname(t):e;for(let s=e;;s=S.dirname(s)){let a=await h.open(s,"r");try{await a.sync()}finally{await a.close()}if(s===o||S.dirname(s)===s)break}}return r}catch(i){throw await r.close(),i}}async append(e){if(this.closed)throw new Error("Code credit journal is closed.");let t={...e,uuid:Re(),version:1,sessionId:this.sessionId,timestamp:new Date().toISOString()};if(!oe(t,this.sessionId))throw new Error("Invalid Code credit journal record.");this.writer??=this.open();let r=await this.writer;if((await h.stat(this.filePath)).size>=ie)throw new Error("Code credit journal is full; start a new session.");await r.append(t)}async close(){this.closed=!0,await(await this.writer?.catch(()=>{}))?.close()}};async function gt(n,e,t,r=fetch){let i=M(t);if(n.origin!==i||n.account!==B(i,e))throw new Error("This Code credit request belongs to another account or endpoint.");if(n.funding!=="paid")return{schemaVersion:1,state:"no_paid_submission_recorded",output:"unknown"};let o=await r(new URL("/api/v1/code/requests/recovery",i),{method:"GET",headers:{Authorization:`Bearer ${e}`,"Idempotency-Key":n.intent},redirect:"error",cache:"no-store",signal:AbortSignal.timeout(1e4)});if(!o.ok)throw new Error(`Code credit recovery unavailable (HTTP ${o.status}). Original intent retained.`);let s=await o.json();if(!s||typeof s!="object"||!("schemaVersion"in s)||s.schemaVersion!==1||!("state"in s)||s.state!=="not_found"&&!(s.state==="found"&&"requestState"in s&&["open","closed","settled","review"].includes(String(s.requestState))))throw new Error("Invalid Code credit recovery response. Original intent retained.");if(s.state==="not_found")return{schemaVersion:1,state:"not_found",claimState:null,requestState:null};if(!("claimState"in s)||!["not_claimed","claimed"].includes(String(s.claimState)))throw new Error("Invalid Code credit recovery response. Original intent retained.");return{schemaVersion:1,state:"found",claimState:s.claimState,requestState:"requestState"in s?s.requestState:null}}m();import{AsyncLocalStorage as Ae}from"node:async_hooks";import{createHash as Le,randomUUID as Fe}from"node:crypto";function It(n){if(n===void 0)return;if(typeof n!="string"&&typeof n!="number")throw new Error("--code-credit-limit-minor must be one positive whole number.");let e=String(n);if(!/^[1-9][0-9]{0,9}$/.test(e)||Number(e)>1e9)throw new Error("--code-credit-limit-minor must be between 1 and 1000000000 USD cents per generation.");return Number(e)}var je=new Set(["model","messages","stream","stream_options","temperature","top_p","top_k","min_p","presence_penalty","frequency_penalty","repetition_penalty","max_tokens","max_completion_tokens","n","best_of","stop","seed","tools","tool_choice","parallel_tool_calls","response_format","reasoning_effort","chat_template_kwargs","user"]),Je=new Set(["role","content","name","tool_call_id","tool_calls","function_call","reasoning_content"]);function kt(n){let e=JSON.parse(JSON.stringify(n));if(delete e.metadata,e.enable_thinking!==void 0){let i=e.chat_template_kwargs;if(i!==void 0&&(!i||typeof i!="object"||Array.isArray(i)))throw new Error("Invalid Code thinking options.");if(i&&"enable_thinking"in i&&i.enable_thinking!==e.enable_thinking)throw new Error("Conflicting Code thinking options.");e.chat_template_kwargs={...i,enable_thinking:e.enable_thinking},delete e.enable_thinking}if(Object.keys(e).some(i=>!je.has(i)))throw new Error("This request has fields unsupported by Code credit spending.");for(let i of["n","best_of"])if(e[i]!==void 0&&e[i]!==1)throw new Error("Code credit spending supports one completion.");let t=[e.max_tokens,e.max_completion_tokens].filter(i=>i!==void 0);if(t.some(i=>typeof i!="number"||!Number.isSafeInteger(i)||i<1))throw new Error("Invalid Code output limit.");let r=Math.min(32768,...t);if(e.max_tokens=r,e.max_completion_tokens!==void 0&&(e.max_completion_tokens=r),!Array.isArray(e.messages))throw new Error("Invalid Code messages.");for(let i of e.messages){if(!i||typeof i!="object"||Array.isArray(i))throw new Error("Invalid Code message.");let o=i;if(delete o.cache_control,o.reasoning===o.reasoning_content&&delete o.reasoning,Object.keys(o).some(s=>!Je.has(s)))throw new Error("This message is unsupported by Code credit spending.");Array.isArray(o.content)&&(o.content=o.content.map(s=>{if(!s||typeof s!="object"||!("type"in s)||s.type!=="text"||!("text"in s)||typeof s.text!="string")throw new Error("Code credit spending currently requires text-only messages.");return s.text}).join(""))}if(Array.isArray(e.tools))for(let i of e.tools)delete i.cache_control;return e}var b=new Ae;function Tt(){let n=$()?.attemptPurpose;return n==="compaction"||n==="unknown"?void 0:b.getStore()}function ce(n){try{let e=n.get("authorization")?.match(/^Bearer ([^ ]+)$/i)?.[1],t=JSON.parse(Buffer.from(e?.split(".")[1]??"","base64url").toString());return t&&typeof t=="object"&&"sub"in t&&typeof t.sub=="string"?t.sub:void 0}catch{return}}var de=class{constructor(e,t,r="unknown"){this.maximumMinor=e;this.journal=t;this.promptId=r}intent=Fe();paidAttempted=!1;completed=!1;body;actor;payer=null;destination;readRecovery;includedAttempted=!1;lastJournalRecord;async markCompleted(){this.lastJournalRecord&&this.journal&&await this.journal.append({...this.lastJournalRecord,state:"completed"}),this.completed=!0}async recordAttempt(e,t,r,i){this.completed=!1,this.journal&&(this.lastJournalRecord={intent:this.intent,promptId:this.promptId,origin:t.origin,account:B(t.origin,e.get("authorization")?.replace(/^Bearer /i,"")??""),organizationId:e.get("x-matilda-organization-id"),maximumMinor:this.maximumMinor,currency:"usd",requestHash:Le("sha256").update(r).digest("hex"),funding:i,state:"attempted"},await this.journal.append(this.lastJournalRecord))}async recoveryError(){let e=await this.readRecovery?.().catch(()=>"unavailable")??"unavailable";return new Error(`Code credit request ${this.intent} stopped (${e}). Its result may be incomplete. No new paid generation was started; inspect the original intent before retrying.`)}async fetch(e,t,r){let i=new Headers(r.headers),o=new URL(t instanceof Request?t.url:String(t));if(i.has("idempotency-key"))throw new Error("Idempotency-Key is managed by Code credit spending.");let s=ce(i);if(typeof r.body!="string")throw new Error("Code credit requests require a serialized body.");if(this.paidAttempted&&this.actor!==s)throw new Error(`Code credit request ${this.intent} belongs to the original account. Sign back in to inspect it.`);if(this.paidAttempted&&(this.payer!==i.get("x-matilda-organization-id")||this.destination!==o.href))throw new Error(`Code credit request ${this.intent} must keep its original payer and endpoint.`);if(this.paidAttempted&&this.body!==r.body)throw await this.recoveryError();if(this.readRecovery=async()=>{if(ce(i)!==this.actor)return"original account required";let a=new Headers(i);a.delete("content-type"),a.delete("x-matilda-usage-credit-limit-minor"),a.delete("x-matilda-usage-credit-currency"),a.set("Idempotency-Key",this.intent);let d=new URL("/api/v1/code/requests/recovery",o),u=await e(d,{method:"GET",headers:a,redirect:"error",signal:AbortSignal.timeout(5e3)});if(!u.ok)return await u.body?.cancel(),"recovery unavailable";let c=await u.json();return!c||typeof c!="object"||!("schemaVersion"in c)||c.schemaVersion!==1||!("state"in c)?"recovery unavailable":c.state==="not_found"?"registration not observed; outcome unknown":c.state!=="found"||!("requestState"in c)||!["open","closed","settled","review"].includes(String(c.requestState))?"recovery unavailable":`financial state ${String(c.requestState)}`},!this.paidAttempted){let a=!this.includedAttempted;this.includedAttempted=!0,await this.recordAttempt(i,o,r.body,"included");let d=await e(t,r);if(!a||d.status!==429||d.headers.get("x-matilda-code-credit-fallback")!=="1")return d;let u=await d.clone().json().catch(()=>null);if(u?.error?.code!=="insufficient_quota"||u.error.type!=="insufficient_quota")return d;if(!s)throw new Error("Code credit spending requires a Matilda OAuth session.");await d.body?.cancel(),this.body=r.body,this.actor=s,this.payer=i.get("x-matilda-organization-id"),this.destination=o.href,this.paidAttempted=!0}return i.set("Idempotency-Key",this.intent),i.set("x-matilda-usage-credit-currency","usd"),i.set("x-matilda-usage-credit-limit-minor",String(this.maximumMinor)),await this.recordAttempt(i,o,this.body,"paid"),e(t,{...r,body:this.body,headers:i,redirect:"error"})}};function Ct(n,e){let t={next:(...o)=>b.run(n,()=>e.next(...o)),return:o=>b.run(n,()=>e.return(o)),throw:o=>b.run(n,()=>e.throw(o)),[Symbol.asyncIterator]:()=>t},r=Symbol.asyncDispose,i=r&&e[r];return r&&typeof i=="function"&&(t[r]=()=>b.run(n,()=>i.call(e))),t}export{me as a,x as b,ze as c,We as d,N as e,Ve as f,Ke as g,A as h,Ge as i,Xe as j,Ye as k,Qe as l,k as m,ut as n,J as o,T as p,M as q,B as r,Ne as s,se as t,gt as u,It as v,kt as w,Tt as x,de as y,Ct as z};
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2025 Matilda
|
|
18
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* @license
|
|
22
|
-
* Copyright 2026 Matilda
|
|
23
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
24
|
-
*/
|
package/chunks/chunk-PGXQZVLX.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{I as l,L as M,Q as A,w as g}from"./chunk-27Q5KW3A.js";import{b as h}from"./chunk-GZPNIYVZ.js";h();import*as s from"node:fs";import*as t from"node:path";var f="memory",y="MEMORY.md",x="meta.json",R="extract-cursor.json",O="consolidation.lock",T="memories";function D(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 j(r){let o=D(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 _(){return process.env.MATILDA_CODE_MEMORY_BASE_DIR?M(void 0,process.env.MATILDA_CODE_MEMORY_BASE_DIR):A.getRuntimeBaseDir()}var c=new Map;function u(r){let o=process.env.MATILDA_CODE_MEMORY_LOCAL==="1",e=o?"":_(),n=`${o?"local":e}\0${r}`,i=c.get(n);if(i!==void 0)return i;let a;if(o)a=t.join(r,g,f);else{let d=j(r)??t.resolve(r);a=t.join(e,"projects",l(d),f)}return c.set(n,a),a}function S(){c.clear()}function p(r){return t.dirname(u(r))}function I(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 v(r){return t.join(u(r),y)}function U(r){return t.join(p(r),x)}function F(r){return t.join(p(r),R)}function N(r){return t.join(p(r),O)}function E(r){return`${r}.md`}function Y(r,o){return t.join(u(r),E(o))}function z(r,o){return t.join(u(r),o)}function m(){return t.join(_(),T)}function k(){return t.join(m(),y)}function b(r){return t.join(m(),E(r))}function C(r){let o=t.normalize(r),e=t.normalize(m()),n=t.relative(e,o);return n===""||!n.startsWith("..")&&!t.isAbsolute(n)}function w(r,o){return I(r,o)||C(r)}export{f as a,y as b,x as c,R as d,O as e,T as f,_ as g,u as h,S as i,p as j,I as k,v as l,U as m,F as n,N as o,E as p,Y as q,z as r,m as s,k as t,b as u,C as v,w};
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright 2025 Google LLC
|
|
7
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
*/
|
package/chunks/chunk-QKYGQLWC.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import{b as t}from"./chunk-GZPNIYVZ.js";t();import{AsyncLocalStorage as o}from"node:async_hooks";var e=new o;function m(){return e.getStore()}function s(){return e.getStore()!==void 0}function d(){return e.getStore()?.agentName}function a(){return e.getStore()?.teamName}function g(n){return a()??n}var p=s;function c(){return e.getStore()?.isTeamLead??!1}function u(){return e.getStore()?.color}function T(n,r){return e.run(n,r)}t();var f=10,A="leader",I="teams",y="tasks",S="config.json",b="inboxes",E=["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#DDA0DD","#F0E68C","#87CEEB","#FFB347","#B0E0E6"];export{e as a,m as b,s as c,d,a as e,g as f,p as g,c as h,u as i,T as j,f as k,A as l,I as m,y as n,S as o,b as p,E as q};
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright 2025 Matilda
|
|
7
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
*/
|