@maincode-ai/matilda-code 0.21.12 → 0.21.13-nightly.20261026.e0eae1d8c
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/bundled/mainy/SKILL.md +0 -2
- package/bundled/mainy/docs/_meta.ts +0 -2
- package/bundled/mainy/docs/configuration/auth.md +5 -10
- package/bundled/mainy/docs/configuration/model-providers.md +31 -217
- package/bundled/mainy/docs/configuration/settings.md +32 -4
- package/bundled/mainy/docs/features/auto-mode.md +1 -1
- package/bundled/mainy/docs/features/channels/_meta.ts +0 -3
- package/bundled/mainy/docs/features/channels/overview.md +8 -16
- package/bundled/mainy/docs/features/commands.md +4 -4
- package/bundled/mainy/docs/features/hooks.md +9 -7
- package/bundled/mainy/docs/features/language.md +2 -29
- package/bundled/mainy/docs/features/sub-agents.md +1 -1
- package/bundled/mainy/docs/features/worktree.md +3 -5
- package/bundled/mainy/docs/integration-github-action.md +3 -3
- package/bundled/mainy/docs/matilda-serve.md +1 -1
- package/bundled/mainy/docs/quickstart.md +2 -2
- package/bundled/mainy/docs/support/troubleshooting.md +3 -10
- package/chunks/agent-4FTU3WN6.js +3 -0
- package/chunks/agent-headless-QJUVHPFC.js +3 -0
- package/chunks/{askUserQuestion-2QI4NSFJ.js → askUserQuestion-QKX4NEFX.js} +1 -1
- package/chunks/{ca-I2HEEIL7.js → ca-C2V7I65K.js} +6 -6
- package/chunks/{chunk-6E766NPX.js → chunk-2ONZZ46N.js} +2 -2
- package/chunks/chunk-36K4HBVM.js +7 -0
- package/chunks/{chunk-EQGA7LH7.js → chunk-3B2HABK7.js} +1 -1
- package/chunks/{chunk-MCQUPLRE.js → chunk-5NMK4Y7C.js} +1 -1
- package/chunks/chunk-5YT4GCK7.js +14 -0
- package/chunks/{chunk-27Q5KW3A.js → chunk-62AFAL4I.js} +10 -10
- package/chunks/chunk-75KP2FVD.js +81 -0
- package/chunks/chunk-7ZODGQO6.js +4 -0
- package/chunks/chunk-BZB7HYRC.js +37 -0
- package/chunks/{chunk-YRQP3SLC.js → chunk-EXNHJQCD.js} +1 -1
- package/chunks/chunk-FCGYRGV4.js +9 -0
- package/chunks/chunk-G4YMVWG4.js +8 -0
- package/chunks/{chunk-6T2GIM76.js → chunk-HDARIAVM.js} +1 -1
- package/chunks/{chunk-YJAKOETP.js → chunk-HM5LCKDB.js} +2 -2
- package/chunks/chunk-IIQ5YERM.js +120 -0
- package/chunks/{chunk-CSJTA7NE.js → chunk-JGJ7BVZN.js} +18 -18
- package/chunks/{chunk-GTVCJCHR.js → chunk-JIKQI4MZ.js} +1 -1
- package/chunks/{chunk-WV3IUPZS.js → chunk-LHDCAN7Z.js} +1 -1
- package/chunks/chunk-LZDHANXA.js +89 -0
- package/chunks/{chunk-PGXQZVLX.js → chunk-NOE4UNQN.js} +1 -1
- package/chunks/chunk-OEZS5R3S.js +207 -0
- package/chunks/{chunk-OOEH6ZSV.js → chunk-PTMCLADZ.js} +1 -1
- package/chunks/{chunk-2HTPVSGT.js → chunk-PYZNGIIR.js} +1 -1
- package/chunks/chunk-QJJTUDDA.js +56 -0
- package/chunks/{chunk-LUNDTQ3G.js → chunk-R34HYLL4.js} +1 -1
- package/chunks/{chunk-QVCGLQCI.js → chunk-RK4LPGBV.js} +3 -3
- package/chunks/{chunk-DE3HKC2W.js → chunk-RYHMPK5G.js} +1 -1
- package/chunks/chunk-SR7ARGUY.js +13 -0
- package/chunks/{chunk-JRECUFB3.js → chunk-SY6JRCN3.js} +636 -654
- package/chunks/chunk-TUKNB5CQ.js +33 -0
- package/chunks/{chunk-VTGICC67.js → chunk-TZ4FRU6B.js} +1 -1
- package/chunks/chunk-U7V7APDV.js +9 -0
- package/chunks/{chunk-CZGZ3KK7.js → chunk-UVWZ44ZW.js} +1 -1
- package/chunks/{chunk-HYVP4472.js → chunk-V6UPUMP3.js} +1 -1
- package/chunks/{chunk-DOOFGSRV.js → chunk-VLDZBRTL.js} +1 -1
- package/chunks/{computer-use-WKDNUTLD.js → computer-use-OXAMR75N.js} +1 -1
- package/chunks/contextCommand-ERLW5VWL.js +3 -0
- package/chunks/{cron-create-F2LXM2OA.js → cron-create-AUDQ6STP.js} +1 -1
- package/chunks/{cron-delete-DE6Q2S2L.js → cron-delete-P5HE3PDD.js} +1 -1
- package/chunks/{cron-list-IAQEJVV7.js → cron-list-NR5FZBK2.js} +1 -1
- package/chunks/{de-AQXFJYZI.js → de-KOUI2CEW.js} +5 -5
- package/chunks/{devtools-5JRKK3E7.js → devtools-G5DWLP2N.js} +1 -1
- package/chunks/dist-XXTQNTKQ.js +42 -0
- package/chunks/dist-ZFZZLIQU.js +3 -0
- package/chunks/{edit-QQNJZ55P.js → edit-REFR5ROS.js} +1 -1
- package/chunks/{en-EJLDYIBM.js → en-RMYRLXC2.js} +4 -4
- package/chunks/{enter-worktree-5X5SAMBJ.js → enter-worktree-WO3DT2G7.js} +1 -1
- package/chunks/{enterPlanMode-HP35SPLN.js → enterPlanMode-PLRHEU5A.js} +1 -1
- package/chunks/{exit-worktree-SRKZBEYF.js → exit-worktree-J5PW6DCV.js} +1 -1
- package/chunks/{exitPlanMode-WSPTGGVN.js → exitPlanMode-KXUPNLCJ.js} +2 -2
- package/chunks/{fr-6TDHK7F2.js → fr-R3QF3LA2.js} +5 -5
- package/chunks/glob-ZVTVRDQO.js +22 -0
- package/chunks/{goal-tools-C6BSBHCF.js → goal-tools-XVKQJL5I.js} +1 -1
- package/chunks/{grep-MVCOBUYW.js → grep-R7CWUNNE.js} +1 -1
- package/chunks/{ja-GGNJR7AR.js → ja-A5OQLXUZ.js} +5 -5
- package/chunks/{keychain-token-storage-KQK6MNOJ.js → keychain-token-storage-IM4UB4P4.js} +1 -1
- package/chunks/{ls-JYJXFSXN.js → ls-DEAFYDVV.js} +1 -1
- package/chunks/{lsp-DYDK6XCS.js → lsp-DL7W47VY.js} +1 -1
- package/chunks/matildaAgentContentGenerator-57EIU5XE.js +8 -0
- package/chunks/mcp-client-X7LEGSP3.js +3 -0
- package/chunks/monitor-KPWTMH3V.js +32 -0
- package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
- package/chunks/notebook-edit-3ZH5M2TC.js +17 -0
- package/chunks/openaiContentGenerator-6PXSD3T7.js +37 -0
- package/chunks/{pt-D6L2QTDM.js → pt-RG3S3KA7.js} +5 -5
- package/chunks/read-file-JNS7WRUP.js +3 -0
- package/chunks/ripGrep-ICJDGIIV.js +3 -0
- package/chunks/{ru-BNJCHDYO.js → ru-5S5HLRT7.js} +5 -5
- package/chunks/scheduler-QC2PPMFP.js +8 -0
- package/chunks/{send-message-P3SMWNEE.js → send-message-V2WYLN5X.js} +1 -1
- package/chunks/{serve-FXH6EBQ6.js → serve-NUVQULZJ.js} +59 -48
- package/chunks/shell-5LNI7URE.js +3 -0
- package/chunks/{skill-HZPFEAPF.js → skill-QFATRHQW.js} +1 -1
- package/chunks/src-6UPZ7TVB.js +3 -0
- package/chunks/src-LZEU4AYF.js +5 -0
- package/chunks/{symbol-search-EAIZPWN7.js → symbol-search-WL6ZHUUN.js} +1 -1
- package/chunks/{syntheticOutput-432LXITX.js → syntheticOutput-3KW6SQAF.js} +1 -1
- package/chunks/task-create-PNW5SN27.js +3 -0
- package/chunks/{task-detach-XMSJ3HBM.js → task-detach-B7PDPFBA.js} +1 -1
- package/chunks/task-list-GGZATGK5.js +9 -0
- package/chunks/{task-stop-NTS62FLG.js → task-stop-UKBBE2KG.js} +1 -1
- package/chunks/{task-update-AR26UFYZ.js → task-update-4RHVUBUV.js} +1 -1
- package/chunks/{team-create-PYXFVIR5.js → team-create-2TJC3X57.js} +1 -1
- package/chunks/team-delete-4UJ7SU65.js +8 -0
- package/chunks/todoWrite-NEBVKOSG.js +3 -0
- package/chunks/{tool-search-RKZDSRYS.js → tool-search-R5GS64YR.js} +1 -1
- package/chunks/{web-fetch-VW3SVDQ6.js → web-fetch-H3XJMAEF.js} +17 -17
- package/chunks/{web-search-XQUIZARL.js → web-search-Q6RWPEIB.js} +1 -1
- package/chunks/{workflow-YXNXDRWZ.js → workflow-3A7KN3E3.js} +2 -2
- package/chunks/write-file-O7Q6SKZC.js +15 -0
- package/cli.js +502 -498
- package/locales/ca.js +1 -28
- package/locales/de.js +1 -28
- package/locales/en.js +1 -30
- package/locales/fr.js +1 -30
- package/locales/ja.js +1 -28
- package/locales/pt.js +1 -28
- package/locales/ru.js +1 -28
- package/package.json +2 -2
- package/sandbox-macos-permissive-closed.sb +0 -1
- package/sandbox-macos-permissive-open.sb +0 -1
- package/sandbox-macos-permissive-proxied.sb +0 -1
- package/sandbox-macos-restrictive-closed.sb +0 -1
- package/sandbox-macos-restrictive-open.sb +0 -1
- package/sandbox-macos-restrictive-proxied.sb +0 -1
- package/bundled/mainy/docs/features/channels/dingtalk.md +0 -134
- package/bundled/mainy/docs/features/channels/feishu.md +0 -186
- package/bundled/mainy/docs/features/channels/weixin.md +0 -106
- package/bundled/mainy/docs/integration-jetbrains.md +0 -81
- package/bundled/mainy/docs/integration-zed.md +0 -72
- package/chunks/agent-WM63A6NK.js +0 -3
- package/chunks/agent-headless-QIUBDKPW.js +0 -3
- package/chunks/anthropicContentGenerator-VKFTAIU3.js +0 -39
- package/chunks/chunk-2MOGYHWM.js +0 -8
- package/chunks/chunk-3IRGBRSP.js +0 -113
- package/chunks/chunk-3YLXGE6T.js +0 -8
- package/chunks/chunk-4F4DA5UI.js +0 -8
- package/chunks/chunk-4J6DC24J.js +0 -59
- package/chunks/chunk-4Q2SNBUH.js +0 -18
- package/chunks/chunk-5C2RJ5RR.js +0 -37
- package/chunks/chunk-6EQMZNIY.js +0 -8
- package/chunks/chunk-6GBNB5Z2.js +0 -3
- package/chunks/chunk-6Z2MV7ZY.js +0 -186
- package/chunks/chunk-BVOCFLC4.js +0 -56
- package/chunks/chunk-FPO57O66.js +0 -39
- package/chunks/chunk-G7R2XEEF.js +0 -7
- package/chunks/chunk-GOJCMVJJ.js +0 -8
- package/chunks/chunk-JCE3JAVC.js +0 -25
- package/chunks/chunk-KHHJYBR5.js +0 -9
- package/chunks/chunk-LJR4RZZ2.js +0 -3
- package/chunks/chunk-MO2HXJG5.js +0 -9
- package/chunks/chunk-O44XK65C.js +0 -8
- package/chunks/chunk-OA56BXPD.js +0 -3
- package/chunks/chunk-PA6532AY.js +0 -6
- package/chunks/chunk-QN6Y6NPA.js +0 -3
- package/chunks/chunk-S3CWEVTS.js +0 -15
- package/chunks/chunk-SDTWBD62.js +0 -8
- package/chunks/chunk-U347OO7S.js +0 -9
- package/chunks/chunk-UIRBHC5X.js +0 -3
- package/chunks/chunk-VI74YQQO.js +0 -8
- package/chunks/chunk-VYZOOSMP.js +0 -30
- package/chunks/chunk-WC2VTVCE.js +0 -27
- package/chunks/chunk-WVY2P6WH.js +0 -26
- package/chunks/chunk-WZ75OGYY.js +0 -14
- package/chunks/chunk-XMZIY7XX.js +0 -13
- package/chunks/chunk-YV3PUOBU.js +0 -65
- package/chunks/contextCommand-DAB3HOHY.js +0 -3
- package/chunks/dist-7UYRLSLE.js +0 -3
- package/chunks/dist-ME6647DQ.js +0 -195
- package/chunks/dist-P6SLWL5V.js +0 -42
- package/chunks/dist-VG3ZDJ2A.js +0 -28
- package/chunks/dist-YTCHM57U.js +0 -23
- package/chunks/fileFromPath-7UCWPD4W.js +0 -3
- package/chunks/geminiContentGenerator-RJ73DQAP.js +0 -8
- package/chunks/glob-QQ6LGKDX.js +0 -22
- package/chunks/matildaAgentContentGenerator-YUYS4336.js +0 -8
- package/chunks/matildaContentGenerator-O4Z2QPCP.js +0 -8
- package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
- package/chunks/mcp-client-RXVQU5VI.js +0 -3
- package/chunks/monitor-77KXDXPR.js +0 -32
- package/chunks/notebook-edit-TKJD2EQZ.js +0 -17
- package/chunks/openaiContentGenerator-2EALAM3U.js +0 -3
- package/chunks/read-file-3KUAH6ND.js +0 -3
- package/chunks/ripGrep-U2PLKXMY.js +0 -3
- package/chunks/scheduler-J7VU2V5Y.js +0 -8
- package/chunks/shell-PXR2AXDD.js +0 -3
- package/chunks/src-RFAEPLY7.js +0 -3
- package/chunks/src-WZTRMETQ.js +0 -5
- package/chunks/task-create-Z3QRCMX4.js +0 -3
- package/chunks/task-list-GXAJW3JP.js +0 -9
- package/chunks/team-delete-OMYVUAQU.js +0 -8
- package/chunks/todoWrite-5NZ7CHTC.js +0 -3
- package/chunks/write-file-XDDLTGSG.js +0 -15
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{b as S}from"./chunk-GZPNIYVZ.js";import{a as j,d as k}from"./chunk-OWGSC52X.js";var De=k((Gt,Le)=>{S();var U=j("constants"),ot=process.cwd,te=null,at=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return te||(te=ot.call(process)),te};try{process.cwd()}catch{}typeof process.chdir=="function"&&(me=process.chdir,process.chdir=function(e){te=null,me.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,me));var me;Le.exports=ct;function ct(e){U.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=u(e.chmodSync),e.fchmodSync=u(e.fchmodSync),e.lchmodSync=u(e.lchmodSync),e.stat=m(e.stat),e.fstat=m(e.fstat),e.lstat=m(e.lstat),e.statSync=E(e.statSync),e.fstatSync=E(e.fstatSync),e.lstatSync=E(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(i,h,c){c&&process.nextTick(c)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(i,h,c,a){a&&process.nextTick(a)},e.lchownSync=function(){}),at==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(i){function h(c,a,l){var _=Date.now(),d=0;i(c,a,function O(C){if(C&&(C.code==="EACCES"||C.code==="EPERM"||C.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){e.stat(a,function(P,X){P&&P.code==="ENOENT"?i(c,a,O):l(C)})},d),d<100&&(d+=10);return}l&&l(C)})}return Object.setPrototypeOf&&Object.setPrototypeOf(h,i),h}(e.rename)),e.read=typeof e.read!="function"?e.read:function(i){function h(c,a,l,_,d,O){var C;if(O&&typeof O=="function"){var P=0;C=function(X,Ie,Fe){if(X&&X.code==="EAGAIN"&&P<10)return P++,i.call(e,c,a,l,_,d,C);O.apply(this,arguments)}}return i.call(e,c,a,l,_,d,C)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,i),h}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(i){return function(h,c,a,l,_){for(var d=0;;)try{return i.call(e,h,c,a,l,_)}catch(O){if(O.code==="EAGAIN"&&d<10){d++;continue}throw O}}}(e.readSync);function t(i){i.lchmod=function(h,c,a){i.open(h,U.O_WRONLY|U.O_SYMLINK,c,function(l,_){if(l){a&&a(l);return}i.fchmod(_,c,function(d){i.close(_,function(O){a&&a(d||O)})})})},i.lchmodSync=function(h,c){var a=i.openSync(h,U.O_WRONLY|U.O_SYMLINK,c),l=!0,_;try{_=i.fchmodSync(a,c),l=!1}finally{if(l)try{i.closeSync(a)}catch{}else i.closeSync(a)}return _}}function r(i){U.hasOwnProperty("O_SYMLINK")&&i.futimes?(i.lutimes=function(h,c,a,l){i.open(h,U.O_SYMLINK,function(_,d){if(_){l&&l(_);return}i.futimes(d,c,a,function(O){i.close(d,function(C){l&&l(O||C)})})})},i.lutimesSync=function(h,c,a){var l=i.openSync(h,U.O_SYMLINK),_,d=!0;try{_=i.futimesSync(l,c,a),d=!1}finally{if(d)try{i.closeSync(l)}catch{}else i.closeSync(l)}return _}):i.futimes&&(i.lutimes=function(h,c,a,l){l&&process.nextTick(l)},i.lutimesSync=function(){})}function n(i){return i&&function(h,c,a){return i.call(e,h,c,function(l){F(l)&&(l=null),a&&a.apply(this,arguments)})}}function u(i){return i&&function(h,c){try{return i.call(e,h,c)}catch(a){if(!F(a))throw a}}}function o(i){return i&&function(h,c,a,l){return i.call(e,h,c,a,function(_){F(_)&&(_=null),l&&l.apply(this,arguments)})}}function s(i){return i&&function(h,c,a){try{return i.call(e,h,c,a)}catch(l){if(!F(l))throw l}}}function m(i){return i&&function(h,c,a){typeof c=="function"&&(a=c,c=null);function l(_,d){d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),a&&a.apply(this,arguments)}return c?i.call(e,h,c,l):i.call(e,h,l)}}function E(i){return i&&function(h,c){var a=c?i.call(e,h,c):i.call(e,h);return a&&(a.uid<0&&(a.uid+=4294967296),a.gid<0&&(a.gid+=4294967296)),a}}function F(i){if(!i||i.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(i.code==="EINVAL"||i.code==="EPERM"))}}});var Me=k((jt,be)=>{S();var Ne=j("stream").Stream;be.exports=ft;function ft(e){return{ReadStream:t,WriteStream:r};function t(n,u){if(!(this instanceof t))return new t(n,u);Ne.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,u=u||{};for(var s=Object.keys(u),m=0,E=s.length;m<E;m++){var F=s[m];this[F]=u[F]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(i,h){if(i){o.emit("error",i),o.readable=!1;return}o.fd=h,o.emit("open",h),o._read()})}function r(n,u){if(!(this instanceof r))return new r(n,u);Ne.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,u=u||{};for(var o=Object.keys(u),s=0,m=o.length;s<m;s++){var E=o[s];this[E]=u[E]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Pe=k((At,Re)=>{"use strict";S();Re.exports=st;var lt=Object.getPrototypeOf||function(e){return e.__proto__};function st(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:lt(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var ve=k(($t,de)=>{S();var x=j("fs"),ht=De(),mt=Me(),pt=Pe(),re=j("util"),R,ie;typeof Symbol=="function"&&typeof Symbol.for=="function"?(R=Symbol.for("graceful-fs.queue"),ie=Symbol.for("graceful-fs.previous")):(R="___graceful-fs.queue",ie="___graceful-fs.previous");function yt(){}function Ge(e,t){Object.defineProperty(e,R,{get:function(){return t}})}var W=yt;re.debuglog?W=re.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(W=function(){var e=re.format.apply(re,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
4
|
+
GFS4: `),console.error(e)});x[R]||(Ce=globalThis[R]||[],Ge(x,Ce),x.close=function(e){function t(r,n){return e.call(x,r,function(u){u||ke(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,ie,{value:e}),t}(x.close),x.closeSync=function(e){function t(r){e.apply(x,arguments),ke()}return Object.defineProperty(t,ie,{value:e}),t}(x.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){W(x[R]),j("assert").equal(x[R].length,0)}));var Ce;globalThis[R]||Ge(globalThis,x[R]);de.exports=pe(pt(x));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!x.__patched&&(de.exports=pe(x),x.__patched=!0);function pe(e){ht(e),e.gracefulify=pe,e.createReadStream=Ie,e.createWriteStream=Fe;var t=e.readFile;e.readFile=r;function r(f,y,p){return typeof y=="function"&&(p=y,y=null),N(f,y,p);function N(b,L,g,I){return t(b,L,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?B([N,[b,L,g],v,I||Date.now(),Date.now()]):typeof g=="function"&&g.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=u;function u(f,y,p,N){return typeof p=="function"&&(N=p,p=null),b(f,y,p,N);function b(L,g,I,v,M){return n(L,g,I,function(w){w&&(w.code==="EMFILE"||w.code==="ENFILE")?B([b,[L,g,I,v],w,M||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(f,y,p,N){return typeof p=="function"&&(N=p,p=null),b(f,y,p,N);function b(L,g,I,v,M){return o(L,g,I,function(w){w&&(w.code==="EMFILE"||w.code==="ENFILE")?B([b,[L,g,I,v],w,M||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var m=e.copyFile;m&&(e.copyFile=E);function E(f,y,p,N){return typeof p=="function"&&(N=p,p=0),b(f,y,p,N);function b(L,g,I,v,M){return m(L,g,I,function(w){w&&(w.code==="EMFILE"||w.code==="ENFILE")?B([b,[L,g,I,v],w,M||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var F=e.readdir;e.readdir=h;var i=/^v[0-5]\./;function h(f,y,p){typeof y=="function"&&(p=y,y=null);var N=i.test(process.version)?function(g,I,v,M){return F(g,b(g,I,v,M))}:function(g,I,v,M){return F(g,I,b(g,I,v,M))};return N(f,y,p);function b(L,g,I,v){return function(M,w){M&&(M.code==="EMFILE"||M.code==="ENFILE")?B([N,[L,g,I],M,v||Date.now(),Date.now()]):(w&&w.sort&&w.sort(),typeof I=="function"&&I.call(this,M,w))}}}if(process.version.substr(0,4)==="v0.8"){var c=mt(e);O=c.ReadStream,P=c.WriteStream}var a=e.ReadStream;a&&(O.prototype=Object.create(a.prototype),O.prototype.open=C);var l=e.WriteStream;l&&(P.prototype=Object.create(l.prototype),P.prototype.open=X),Object.defineProperty(e,"ReadStream",{get:function(){return O},set:function(f){O=f},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return P},set:function(f){P=f},enumerable:!0,configurable:!0});var _=O;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(f){_=f},enumerable:!0,configurable:!0});var d=P;Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(f){d=f},enumerable:!0,configurable:!0});function O(f,y){return this instanceof O?(a.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function C(){var f=this;he(f.path,f.flags,f.mode,function(y,p){y?(f.autoClose&&f.destroy(),f.emit("error",y)):(f.fd=p,f.emit("open",p),f.read())})}function P(f,y){return this instanceof P?(l.apply(this,arguments),this):P.apply(Object.create(P.prototype),arguments)}function X(){var f=this;he(f.path,f.flags,f.mode,function(y,p){y?(f.destroy(),f.emit("error",y)):(f.fd=p,f.emit("open",p))})}function Ie(f,y){return new e.ReadStream(f,y)}function Fe(f,y){return new e.WriteStream(f,y)}var ut=e.open;e.open=he;function he(f,y,p,N){return typeof p=="function"&&(N=p,p=null),b(f,y,p,N);function b(L,g,I,v,M){return ut(L,g,I,function(w,kt){w&&(w.code==="EMFILE"||w.code==="ENFILE")?B([b,[L,g,I,v],w,M||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return e}function B(e){W("ENQUEUE",e[0].name,e[1]),x[R].push(e),ye()}var ne;function ke(){for(var e=Date.now(),t=0;t<x[R].length;++t)x[R][t].length>2&&(x[R][t][3]=e,x[R][t][4]=e);ye()}function ye(){if(clearTimeout(ne),ne=void 0,x[R].length!==0){var e=x[R].shift(),t=e[0],r=e[1],n=e[2],u=e[3],o=e[4];if(u===void 0)W("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-u>=6e4){W("TIMEOUT",t.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var m=Date.now()-o,E=Math.max(o-u,1),F=Math.min(E*1.2,100);m>=F?(W("RETRY",t.name,r),t.apply(null,r.concat([u]))):x[R].push(e)}ne===void 0&&(ne=setTimeout(ye,0))}}});var je=k((Kt,qe)=>{S();function G(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}qe.exports=G;G.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};G.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};G.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,u=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&u.unref(),!0};G.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};G.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};G.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};G.prototype.start=G.prototype.try;G.prototype.errors=function(){return this._errors};G.prototype.attempts=function(){return this._attempts};G.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var u=this._errors[n],o=u.message,s=(e[o]||0)+1;e[o]=s,s>=r&&(t=u,r=s)}return t}});var Ue=k($=>{S();var dt=je();$.operation=function(e){var t=$.timeouts(e);return new dt(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};$.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],u=0;u<t.retries;u++)n.push(this.createTimeout(u,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(u,t)),n.sort(function(o,s){return o-s}),n};$.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout),n};$.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var n in e)typeof e[n]=="function"&&r.push(n)}for(var u=0;u<r.length;u++){var o=r[u],s=e[o];e[o]=function(E){var F=$.operation(t),i=Array.prototype.slice.call(arguments,1),h=i.pop();i.push(function(c){F.retry(c)||(c&&(arguments[0]=F.mainError()),h.apply(this,arguments))}),F.attempt(function(){E.apply(e,i)})}.bind(e,s),e[o].options=t}}});var We=k((Ht,Ae)=>{S();Ae.exports=Ue()});var $e=k((Xt,ue)=>{S();ue.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ue.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ue.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var ze=k((Zt,H)=>{S();var T=globalThis.process,Y=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Y(T)?(Ye=j("assert"),Q=$e(),Ke=/^win/i.test(T.platform),J=j("events"),typeof J!="function"&&(J=J.EventEmitter),T.__signal_exit_emitter__?D=T.__signal_exit_emitter__:(D=T.__signal_exit_emitter__=new J,D.count=0,D.emitted={}),D.infinite||(D.setMaxListeners(1/0),D.infinite=!0),H.exports=function(e,t){if(!Y(globalThis.process))return function(){};Ye.equal(typeof e,"function","a callback must be provided for exit handler"),z===!1&&Se();var r="exit";t&&t.alwaysLast&&(r="afterexit");var n=function(){D.removeListener(r,e),D.listeners("exit").length===0&&D.listeners("afterexit").length===0&&oe()};return D.on(r,e),n},oe=function(){!z||!Y(globalThis.process)||(z=!1,Q.forEach(function(t){try{T.removeListener(t,ae[t])}catch{}}),T.emit=ce,T.reallyExit=_e,D.count-=1)},H.exports.unload=oe,K=function(t,r,n){D.emitted[t]||(D.emitted[t]=!0,D.emit(t,r,n))},ae={},Q.forEach(function(e){ae[e]=function(){if(Y(globalThis.process)){var r=T.listeners(e);r.length===D.count&&(oe(),K("exit",null,e),K("afterexit",null,e),Ke&&e==="SIGHUP"&&(e="SIGINT"),T.kill(T.pid,e))}}}),H.exports.signals=function(){return Q},z=!1,Se=function(){z||!Y(globalThis.process)||(z=!0,D.count+=1,Q=Q.filter(function(t){try{return T.on(t,ae[t]),!0}catch{return!1}}),T.emit=Qe,T.reallyExit=Be)},H.exports.load=Se,_e=T.reallyExit,Be=function(t){Y(globalThis.process)&&(T.exitCode=t||0,K("exit",T.exitCode,null),K("afterexit",T.exitCode,null),_e.call(T,T.exitCode))},ce=T.emit,Qe=function(t,r){if(t==="exit"&&Y(globalThis.process)){r!==void 0&&(T.exitCode=r);var n=ce.apply(this,arguments);return K("exit",T.exitCode,null),K("afterexit",T.exitCode,null),n}else return ce.apply(this,arguments)}):H.exports=function(){return function(){}};var Ye,Q,Ke,J,D,oe,K,ae,z,Se,_e,Be,ce,Qe});var Ve=k((tr,we)=>{"use strict";S();var He=Symbol();function vt(e,t,r){let n=t[He];if(n)return t.stat(e,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let u=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,u,u,o=>{if(o)return r(o);t.stat(e,(s,m)=>{if(s)return r(s);let E=m.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,He,{value:E}),r(null,m.mtime,E)})})}function St(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}we.exports.probe=vt;we.exports.getMtime=St});var tt=k((nr,ee)=>{"use strict";S();var _t=j("path"),Oe=ve(),wt=We(),Tt=ze(),Xe=Ve(),q={};function Z(e,t){return t.lockfilePath||`${e}.lock`}function ge(e,t,r){if(!t.realpath)return r(null,_t.resolve(e));t.fs.realpath(e,r)}function Ee(e,t,r){let n=Z(e,t);t.fs.mkdir(n,u=>{if(!u)return Xe.probe(n,t.fs,(o,s,m)=>{if(o)return t.fs.rmdir(n,()=>{}),r(o);r(null,s,m)});if(u.code!=="EEXIST")return r(u);if(t.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Ee(e,{...t,stale:0},r):r(o);if(!Je(s,t))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));Ze(e,t,m=>{if(m)return r(m);Ee(e,{...t,stale:0},r)})})})}function Je(e,t){return e.mtime.getTime()<Date.now()-t.stale}function Ze(e,t,r){t.fs.rmdir(Z(e,t),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function fe(e,t){let r=q[e];r.updateTimeout||(r.updateDelay=r.updateDelay||t.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,t.fs.stat(r.lockfilePath,(n,u)=>{let o=r.lastUpdate+t.stale<Date.now();if(n)return n.code==="ENOENT"||o?Te(e,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,fe(e,t));if(!(r.mtime.getTime()===u.mtime.getTime()))return Te(e,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let m=Xe.getMtime(r.mtimePrecision);t.fs.utimes(r.lockfilePath,m,m,E=>{let F=r.lastUpdate+t.stale<Date.now();if(!r.released){if(E)return E.code==="ENOENT"||F?Te(e,r,Object.assign(E,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,fe(e,t));r.mtime=m,r.lastUpdate=Date.now(),r.updateDelay=null,fe(e,t)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Te(e,t,r){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),q[e]===t&&delete q[e],t.options.onCompromised(r)}function Et(e,t,r){t={stale:1e4,update:null,realpath:!0,retries:0,fs:Oe,onCompromised:n=>{throw n},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),ge(e,t,(n,u)=>{if(n)return r(n);let o=wt.operation(t.retries);o.attempt(()=>{Ee(u,t,(s,m,E)=>{if(o.retry(s))return;if(s)return r(o.mainError());let F=q[u]={lockfilePath:Z(u,t),mtime:m,mtimePrecision:E,options:t,lastUpdate:Date.now()};fe(u,t),r(null,i=>{if(F.released)return i&&i(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));et(u,{...t,realpath:!1},i)})})})})}function et(e,t,r){t={fs:Oe,realpath:!0,...t},ge(e,t,(n,u)=>{if(n)return r(n);let o=q[u];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete q[u],Ze(u,t,r)})}function Ot(e,t,r){t={stale:1e4,realpath:!0,fs:Oe,...t},t.stale=Math.max(t.stale||0,2e3),ge(e,t,(n,u)=>{if(n)return r(n);t.fs.stat(Z(u,t),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!Je(s,t)))})}function gt(){return q}Tt(()=>{for(let e in q){let t=q[e].options;try{t.fs.rmdirSync(Z(e,t))}catch{}}});ee.exports.lock=Et;ee.exports.unlock=et;ee.exports.check=Ot;ee.exports.getLocks=gt});var nt=k((ur,rt)=>{"use strict";S();var xt=ve();function It(e){let t=["mkdir","realpath","stat","rmdir","utimes"],r={...e};return t.forEach(n=>{r[n]=(...u)=>{let o=u.pop(),s;try{s=e[`${n}Sync`](...u)}catch(m){return o(m)}o(null,s)}}),r}function Ft(e){return(...t)=>new Promise((r,n)=>{t.push((u,o)=>{u?n(u):r(o)}),e(...t)})}function Lt(e){return(...t)=>{let r,n;if(t.push((u,o)=>{r=u,n=o}),e(...t),r)throw r;return n}}function Dt(e){if(e={...e},e.fs=It(e.fs||xt),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}rt.exports={toPromise:Ft,toSync:Lt,toSyncOptions:Dt}});var Ct=k((ar,A)=>{"use strict";S();var V=tt(),{toPromise:le,toSync:se,toSyncOptions:xe}=nt();async function it(e,t){let r=await le(V.lock)(e,t);return le(r)}function Nt(e,t){let r=se(V.lock)(e,xe(t));return se(r)}function bt(e,t){return le(V.unlock)(e,t)}function Mt(e,t){return se(V.unlock)(e,xe(t))}function Rt(e,t){return le(V.check)(e,t)}function Pt(e,t){return se(V.check)(e,xe(t))}A.exports=it;A.exports.lock=it;A.exports.unlock=bt;A.exports.lockSync=Nt;A.exports.unlockSync=Mt;A.exports.check=Rt;A.exports.checkSync=Pt});export{ve as a,Ct as b};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{l as k}from"./chunk-HM5LCKDB.js";import{ec as It,lc as St}from"./chunk-SY6JRCN3.js";import{a as Tt}from"./chunk-LHDCAN7Z.js";import{ha as Ct}from"./chunk-IIQ5YERM.js";import{Hc as ht,h as nt}from"./chunk-OEZS5R3S.js";import{p as st}from"./chunk-2ONZZ46N.js";import{b as C}from"./chunk-GZPNIYVZ.js";import{d as gt,f as Bt}from"./chunk-OWGSC52X.js";var Mt=gt(i=>{"use strict";C();var at=Symbol.for("react.transitional.element"),$t=Symbol.for("react.portal"),Gt=Symbol.for("react.fragment"),jt=Symbol.for("react.strict_mode"),Wt=Symbol.for("react.profiler"),qt=Symbol.for("react.consumer"),Ft=Symbol.for("react.context"),Yt=Symbol.for("react.forward_ref"),Kt=Symbol.for("react.suspense"),Jt=Symbol.for("react.memo"),kt=Symbol.for("react.lazy"),zt=Symbol.for("react.activity"),xt=Symbol.iterator;function Qt(t){return t===null||typeof t!="object"?null:(t=xt&&t[xt]||t["@@iterator"],typeof t=="function"?t:null)}var Rt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vt=Object.assign,Et={};function v(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}v.prototype.isReactComponent={};v.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};v.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function At(){}At.prototype=v.prototype;function ut(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}var mt=ut.prototype=new At;mt.constructor=ut;vt(mt,v.prototype);mt.isPureReactComponent=!0;var bt=Array.isArray;function it(){}var p={H:null,A:null,T:null,S:null},wt=Object.prototype.hasOwnProperty;function lt(t,e,s){var o=s.ref;return{$$typeof:at,type:t,key:e,ref:o!==void 0?o:null,props:s}}function Vt(t,e){return lt(t.type,e,t.props)}function pt(t){return typeof t=="object"&&t!==null&&t.$$typeof===at}function Xt(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(s){return e[s]})}var _t=/\/+/g;function rt(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Xt(""+t.key):e.toString(36)}function Zt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(it,it):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function R(t,e,s,o,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var m=!1;if(t===null)m=!0;else switch(a){case"bigint":case"string":case"number":m=!0;break;case"object":switch(t.$$typeof){case at:case $t:m=!0;break;case kt:return m=t._init,R(m(t._payload),e,s,o,n)}}if(m)return n=n(t),m=o===""?"."+rt(t,0):o,bt(n)?(s="",m!=null&&(s=m.replace(_t,"$&/")+"/"),R(n,e,s,"",function(g){return g})):n!=null&&(pt(n)&&(n=Vt(n,s+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(_t,"$&/")+"/")+m)),e.push(n)),1;m=0;var d=o===""?".":o+":";if(bt(t))for(var c=0;c<t.length;c++)o=t[c],a=d+rt(o,c),m+=R(o,e,s,a,n);else if(c=Qt(t),typeof c=="function")for(t=c.call(t),c=0;!(o=t.next()).done;)o=o.value,a=d+rt(o,c++),m+=R(o,e,s,a,n);else if(a==="object"){if(typeof t.then=="function")return R(Zt(t),e,s,o,n);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return m}function B(t,e,s){if(t==null)return t;var o=[],n=0;return R(t,o,"","",function(a){return e.call(s,a,n++)}),o}function te(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(s){(t._status===0||t._status===-1)&&(t._status=1,t._result=s)},function(s){(t._status===0||t._status===-1)&&(t._status=2,t._result=s)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ht=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ee={map:B,forEach:function(t,e,s){B(t,function(){e.apply(this,arguments)},s)},count:function(t){var e=0;return B(t,function(){e++}),e},toArray:function(t){return B(t,function(e){return e})||[]},only:function(t){if(!pt(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};i.Activity=zt;i.Children=ee;i.Component=v;i.Fragment=Gt;i.Profiler=Wt;i.PureComponent=ut;i.StrictMode=jt;i.Suspense=Kt;i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p;i.__COMPILER_RUNTIME={__proto__:null,c:function(t){return p.H.useMemoCache(t)}};i.cache=function(t){return function(){return t.apply(null,arguments)}};i.cacheSignal=function(){return null};i.cloneElement=function(t,e,s){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var o=vt({},t.props),n=t.key;if(e!=null)for(a in e.key!==void 0&&(n=""+e.key),e)!wt.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(o[a]=e[a]);var a=arguments.length-2;if(a===1)o.children=s;else if(1<a){for(var m=Array(a),d=0;d<a;d++)m[d]=arguments[d+2];o.children=m}return lt(t.type,n,o)};i.createContext=function(t){return t={$$typeof:Ft,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:qt,_context:t},t};i.createElement=function(t,e,s){var o,n={},a=null;if(e!=null)for(o in e.key!==void 0&&(a=""+e.key),e)wt.call(e,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(n[o]=e[o]);var m=arguments.length-2;if(m===1)n.children=s;else if(1<m){for(var d=Array(m),c=0;c<m;c++)d[c]=arguments[c+2];n.children=d}if(t&&t.defaultProps)for(o in m=t.defaultProps,m)n[o]===void 0&&(n[o]=m[o]);return lt(t,a,n)};i.createRef=function(){return{current:null}};i.forwardRef=function(t){return{$$typeof:Yt,render:t}};i.isValidElement=pt;i.lazy=function(t){return{$$typeof:kt,_payload:{_status:-1,_result:t},_init:te}};i.memo=function(t,e){return{$$typeof:Jt,type:t,compare:e===void 0?null:e}};i.startTransition=function(t){var e=p.T,s={};p.T=s;try{var o=t(),n=p.S;n!==null&&n(s,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(it,Ht)}catch(a){Ht(a)}finally{e!==null&&s.types!==null&&(e.types=s.types),p.T=e}};i.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()};i.use=function(t){return p.H.use(t)};i.useActionState=function(t,e,s){return p.H.useActionState(t,e,s)};i.useCallback=function(t,e){return p.H.useCallback(t,e)};i.useContext=function(t){return p.H.useContext(t)};i.useDebugValue=function(){};i.useDeferredValue=function(t,e){return p.H.useDeferredValue(t,e)};i.useEffect=function(t,e){return p.H.useEffect(t,e)};i.useEffectEvent=function(t){return p.H.useEffectEvent(t)};i.useId=function(){return p.H.useId()};i.useImperativeHandle=function(t,e,s){return p.H.useImperativeHandle(t,e,s)};i.useInsertionEffect=function(t,e){return p.H.useInsertionEffect(t,e)};i.useLayoutEffect=function(t,e){return p.H.useLayoutEffect(t,e)};i.useMemo=function(t,e){return p.H.useMemo(t,e)};i.useOptimistic=function(t,e){return p.H.useOptimistic(t,e)};i.useReducer=function(t,e,s){return p.H.useReducer(t,e,s)};i.useRef=function(t){return p.H.useRef(t)};i.useState=function(t){return p.H.useState(t)};i.useSyncExternalStore=function(t,e,s){return p.H.useSyncExternalStore(t,e,s)};i.useTransition=function(){return p.H.useTransition()};i.version="19.2.4"});var Dt=gt((de,Pt)=>{"use strict";C();Pt.exports=Mt()});C();C();C();var fe=Bt(Dt(),1);var oe=["achieved","aborted","failed"];function ge(t){return oe.includes(t)}function ne(t,e){return t>=e.hard?"hard":t>=e.auto?"auto":t>=e.warn?"warn":"safe"}function T(t){if(!t||t.length===0)return 0;let e=0,s=0;for(let o=0;o<t.length;o++)t.charCodeAt(o)<128?e++:s++;return Math.ceil(e/4+s*1.5)}function se(t){if(!t||t.trim().length===0)return[];let e=[],s=/--- Context from: (.+?) ---\n([\s\S]*?)--- End of Context from: \1 ---/g,o;for(;(o=s.exec(t))!==null;){let n=o[1],a=o[2];e.push({path:n,tokens:T(a)})}return e.length===0&&t.trim().length>0&&e.push({path:k("memory"),tokens:T(t)}),e}async function re(t,e){let s=t.getModelDisplayName()||"unknown",o=t.getContentGeneratorConfig(),n=o.contextWindowSize??131072,a=nt.getLastPromptTokenCount(),m=nt.getLastCachedContentTokenCount(),d=It(void 0,s),c=T(d),g=t.getToolRegistry(),M=g?g.getAllTools():[],r=g?g.getFunctionDeclarations():[],P=JSON.stringify(r),_=T(P),H=[],x=[];for(let u of M){if(u.shouldDefer&&!u.alwaysLoad&&!g?.isDeferredToolRevealed(u.name))continue;let h=JSON.stringify(u.schema),S=T(h);u instanceof ht?x.push({name:`${u.serverName}__${u.serverToolName||u.name}`,tokens:S}):u.name!==st.SKILL&&H.push({name:u.name,tokens:S})}let l=t.getUserMemory(),y=se(l),$=y.reduce((u,h)=>u+h.tokens,0),E=M.find(u=>u.name===st.SKILL),G=E?T(JSON.stringify(E.schema)):0,Nt=E&&"getLoadedSkillNames"in E?E.getLoadedSkillNames():new Set,dt=t.getSkillManager(),Ut=dt?await dt.listSkills():[],D=0,j=Ut.map(u=>{let h=T(`<skill>
|
|
4
|
+
<name>
|
|
5
|
+
${u.name}
|
|
6
|
+
</name>
|
|
7
|
+
<description>
|
|
8
|
+
${u.description} (${u.level})
|
|
9
|
+
</description>
|
|
10
|
+
<location>
|
|
11
|
+
${u.level}
|
|
12
|
+
</location>
|
|
13
|
+
</skill>`),S=Nt.has(u.name),A;if(S&&u.body){let et=u.filePath?u.filePath.replace(/\/[^/]+$/,""):"";A=T(Tt(et,u.body)),D+=A}return{name:u.name,tokens:h,loaded:S,bodyTokens:A}}),yt=G+D,Lt=o.samplingParams?.max_tokens??0,W=St(n-Lt),q=Math.max(0,Math.round(n-W.auto)),N=c+_+$+D,F=a===0,Y=x.reduce((u,h)=>u+h.tokens,0),I,U,K,J,L,z,O,Q,V,X,Z,tt;if(F)I=0,U=c,z=yt,K=Math.max(0,_-G-Y),J=Y,L=$,O=0,Q=Math.max(0,n-N-q),V=H,X=x,Z=y,tt=j;else{I=a;let u=N>I?I/N:1;U=Math.round(c*u);let h=Math.round(_*u);L=Math.round($*u),z=Math.round(yt*u);let S=Math.round(Y*u);J=S;let A=Math.round(G*u);K=Math.max(0,h-A-S);let et=U+h+L+Math.round(D*u);m>0?O=Math.max(0,I-m):O=Math.max(0,I-et),Q=Math.max(0,n-I-q);let ot=b=>u<1?b.map(ft=>({...ft,tokens:Math.round(ft.tokens*u)})):b;V=ot(H),X=ot(x),Z=ot(y),tt=u<1?j.map(b=>({...b,tokens:Math.round(b.tokens*u),bodyTokens:b.bodyTokens?Math.round(b.bodyTokens*u):void 0})):j}let Ot={systemPrompt:U,builtinTools:K,mcpTools:J,memoryFiles:L,skills:z,messages:O,freeSpace:Q,autocompactBuffer:q,thresholds:W,currentTier:ne(F?N:a,W)};return{type:"context_usage",modelName:s,totalTokens:I,contextWindowSize:n,breakdown:Ot,builtinTools:e?V:[],mcpTools:e?X:[],memoryFiles:e?Z:[],skills:e?tt:[],isEstimated:F,showDetails:e}}function ct(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:`${t}`}function f(t,e,s,o=" "){let n=s>0?(e/s*100).toFixed(1):"0.0",a=`${ct(e)} tokens (${n}%)`,m=`${o}${t}`,c=Math.max(1,56-m.length-a.length);return`${m}${" ".repeat(c)}${a}`}function w(t){return Math.round(t).toLocaleString("en-US")}function ie(t){let{modelName:e,totalTokens:s,contextWindowSize:o,breakdown:n,builtinTools:a,mcpTools:m,memoryFiles:d,skills:c,isEstimated:g,showDetails:M}=t,r=[];if(r.push("## Context Usage"),r.push(""),g?(r.push("*No API response yet. Send a message to see actual usage.*"),r.push(""),r.push("**Estimated pre-conversation overhead**"),r.push(`Model: ${e} Context window: ${ct(o)} tokens`),r.push("")):(r.push(`Model: ${e} Context window: ${ct(o)} tokens`),r.push(""),r.push(f("Used",s,o)),r.push(f("Free",n.freeSpace,o)),r.push(""),r.push("**Compaction thresholds**"),r.push(` Effective window: ${w(n.thresholds.effectiveWindow)} (window \u2212 ${w(o-n.thresholds.effectiveWindow)} reserve)`),r.push(` Warn threshold: ${w(n.thresholds.warn)}`),r.push(` Auto threshold: ${w(n.thresholds.auto)}`),r.push(` Hard threshold: ${w(n.thresholds.hard)}`),r.push(` Current tier: ${n.currentTier}`),r.push(""),r.push("**Usage by category**")),r.push(f("System prompt",n.systemPrompt,o)),r.push(f("Built-in tools",n.builtinTools,o)),n.mcpTools>0&&r.push(f("MCP tools",n.mcpTools,o)),r.push(f("Memory files",n.memoryFiles,o)),r.push(f("Skills",n.skills,o)),g||r.push(f("Messages",n.messages,o)),M){let P=[...a].sort((l,y)=>y.tokens-l.tokens),_=[...m].sort((l,y)=>y.tokens-l.tokens),H=[...d].sort((l,y)=>y.tokens-l.tokens),x=[...c].sort((l,y)=>l.loaded!==y.loaded?l.loaded?-1:1:y.tokens+(y.bodyTokens??0)-(l.tokens+(l.bodyTokens??0)));if(P.length>0){r.push(""),r.push("**Built-in tools**");for(let l of P)r.push(f(l.name,l.tokens,o," \u2514 "))}if(_.length>0){r.push(""),r.push("**MCP tools**");for(let l of _)r.push(f(l.name,l.tokens,o," \u2514 "))}if(H.length>0){r.push(""),r.push("**Memory files**");for(let l of H)r.push(f(l.path,l.tokens,o," \u2514 "))}if(x.length>0){r.push(""),r.push("**Skills**");for(let l of x){let y=l.loaded?`${l.name} (active)`:l.name;r.push(f(y,l.tokens,o," \u2514 ")),l.loaded&&l.bodyTokens&&l.bodyTokens>0&&r.push(f("body loaded",l.bodyTokens,o," \u2514 "))}}}else r.push(""),r.push("*Run /context detail for per-item breakdown.*");return r.join(`
|
|
14
|
+
`)}var ae={name:"context",get description(){return k('Show context window usage breakdown. Use "/context detail" for per-item breakdown.')},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:async(t,e)=>{let s=e?.trim().toLowerCase(),o=s==="detail"||s==="-d",n=t.executionMode??"interactive",{config:a}=t.services;if(!a){if(n==="interactive"){t.ui.addItem({type:"error",text:k("Config not loaded.")},Date.now());return}return{type:"message",messageType:"error",content:k("Config not loaded.")}}let m=await re(a,o);if(n==="interactive"){t.ui.addItem(m,Date.now());return}return{type:"message",messageType:"info",content:ie(m)}},subCommands:[{name:"detail",get description(){return k("Show per-item context usage breakdown.")},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:async t=>{await ae.action(t,"detail")}}]};export{Dt as a,ge as b,re as c,ie as d,ae as e};
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2025 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* @license
|
|
22
|
+
* Copyright 2025 Matilda
|
|
23
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
24
|
+
*/
|
|
25
|
+
/*! Bundled license information:
|
|
26
|
+
|
|
27
|
+
react/cjs/react.production.js:
|
|
28
|
+
(**
|
|
29
|
+
* @license React
|
|
30
|
+
* react.production.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*)
|
|
37
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{g as o,i as a,p as u,q as n}from"./chunk-
|
|
3
|
+
import{g as o,i as a,p as u,q as n}from"./chunk-2ONZZ46N.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
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{e as g}from"./chunk-5YT4GCK7.js";import{b as h}from"./chunk-7ZODGQO6.js";import{b as M}from"./chunk-TISQNFB5.js";import{c as w}from"./chunk-R34HYLL4.js";import{b as c,ba as b}from"./chunk-62AFAL4I.js";import{b as p}from"./chunk-GZPNIYVZ.js";import{f as E}from"./chunk-OWGSC52X.js";p();var m=null;function D(e){m=e}function _(){return m}function P(){m=null}function S(e,r,o){return m?(m.enqueueApproval({teammateName:e,teammateColor:r,details:o}),!0):!1}function $(e,r,o,t){return{...e,title:`[${r}] ${e.title}`,onConfirm:async(i,s)=>{await o(i,s)}}}p();var C=E(h(),1);import*as a from"node:fs/promises";import*as u from"node:path";var y=b("AGENTS_TEAM_MAILBOX"),N={retries:{retries:10,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:e=>{y.debug("mailbox lock compromised:",e?.message??e)}},d=new Map;function O(e){let r=d.get(e);return r||(r=new M,d.set(e,r)),r}function I(e){let r=g(e),o=0;for(let t of d.keys())u.dirname(t)===r&&(d.delete(t),o++);return o}async function T(e,r){return O(e).runExclusive(async()=>{let o=await C.default.lock(e,N);try{return await r()}finally{await o()}})}function x(e,r){return u.join(g(e),`${r}.json`)}async function X(e,r){let o=x(e,r);try{let t=await a.readFile(o,"utf-8");return JSON.parse(t)}catch(t){if(c(t)&&t.code==="ENOENT")return[];throw t}}var L=5*60*1e3;async function A(e,r,o){let t=x(e,r);await v(t),await T(t,async()=>{let i=await k(t),s=Date.now()-L,l=i.filter(f=>{if(!f.read)return!0;let n=Date.parse(f.timestamp);return Number.isNaN(n)||n>=s});l.push(o),await w(t,l)})}async function z(e,r,o){let t=x(e,r);return await v(t),T(t,async()=>{let i=await k(t),s=n=>!n.read&&(o===void 0||n.type===o),l=i.filter(s);if(l.length===0)return[];let f=i.map(n=>s(n)?{...n,read:!0}:n);return await w(t,f),l})}async function G(e,r){let o=x(e,r);try{await a.unlink(o)}catch(t){if(!c(t)||t.code!=="ENOENT")throw t}}async function K(e){let r=g(e);await a.rm(r,{recursive:!0,force:!0}),I(e)}async function Q(e,r,o){await A(e,r,{from:o.from,text:o.text,timestamp:new Date().toISOString(),read:!1,type:o.type,color:o.color,summary:o.summary})}async function v(e){await a.mkdir(u.dirname(e),{recursive:!0});try{await a.writeFile(e,`[]
|
|
4
|
+
`,{flag:"wx"})}catch(r){if(!c(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(c(r)&&r.code==="ENOENT")return[];let o=r instanceof Error?r.message:String(r);y.warn(`Quarantining corrupt inbox at ${e}: ${o}`);try{await a.rename(e,`${e}.corrupt-${Date.now()}`)}catch(t){let i=t instanceof Error?t.message:String(t);throw y.warn(`Failed to quarantine ${e}: ${i}`),r instanceof Error?r:new Error(`Failed to read inbox at ${e}: ${o}`)}return[]}}export{D as a,_ as b,P as c,S as d,$ as e,I as f,x as g,X as h,A as i,z as j,G as k,K as l,Q as m};
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2025 Matilda
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import{f as T}from"./chunk-5YT4GCK7.js";import{b as X}from"./chunk-7ZODGQO6.js";import{b as P}from"./chunk-TISQNFB5.js";import{c as g}from"./chunk-R34HYLL4.js";import{b as l,ba as $}from"./chunk-62AFAL4I.js";import{b as _}from"./chunk-GZPNIYVZ.js";import{f as W}from"./chunk-OWGSC52X.js";_();var R=W(X(),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"),v=32768,A=16;function C(r){if(!r)return;let e=Buffer.byteLength(JSON.stringify(r),"utf-8");if(e>v)throw new Error(`Task metadata is too large (${e} bytes; max ${v}). Trim the payload or store the bulk content elsewhere.`)}var K={retries:{retries:30,minTimeout:5,maxTimeout:100,factor:2,randomize:!0},stale:5e3,onCompromised:r=>{f.warn("task lock compromised:",r?.message??r)}},j=new Map;function q(r){let e=j.get(r);return e||(e=new P,j.set(r,e)),e}async function h(r,e,t){return q(r).runExclusive(async()=>{let a;try{a=await R.default.lock(r,K)}catch(o){if(l(o)&&o.code==="ENOENT")return t();throw o}try{return await e()}finally{await a()}})}var z="__reciprocal__",L=new Map;function Y(r){let e=L.get(r);return e||(e=new P,L.set(r,e)),e}function G(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 G(e),b.join(T(r),`${e}.json`)}var O=new Set;function ie(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 oe(r,e){C(e.metadata);let t=T(r);await d.mkdir(t,{recursive:!0});let a=15;for(let o=0;o<a;o++){let c=await I(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(i){if(l(i)&&i.code==="EEXIST")continue;throw i}try{await g(n,s)}catch(i){throw await d.unlink(n).catch(()=>{}),i}return k(r),s}throw new Error(`Failed to create task after ${a} attempts (ID contention).`)}async function ce(r,e){let t=m(r,e);try{let a=await d.readFile(t,"utf-8");return JSON.parse(a)}catch(a){if(l(a)&&a.code==="ENOENT")return;throw a}}var p=class extends Error{constructor(t,a,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=a;this.actualOwner=o;this.name="TaskOwnershipError"}};async function F(r,e,t,a){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(a?.callerName!==void 0&&a.callerName!==z&&(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!==a.callerName)throw new p(e,a.callerName,s.owner);if(t.addBlocks?.length){let n=new Set(s.blocks);for(let i of t.addBlocks)n.add(i);s.blocks=Array.from(n)}if(t.addBlockedBy?.length){let n=new Set(s.blockedBy);for(let i of t.addBlockedBy)n.add(i);s.blockedBy=Array.from(n)}if(t.status!==void 0&&(s.status=t.status,t.status==="completed"&&s.blocks.length>0&&await V(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,i]of Object.entries(t.metadata))n==="__proto__"||n==="constructor"||n==="prototype"||(i===null?delete s.metadata[n]:s.metadata[n]=i);Object.keys(s.metadata).length===0&&(s.metadata=void 0),C(s.metadata)}return await g(o,s),k(r),s},()=>{})}async function de(r,e,t){let a=m(r,e),o=await h(a,async()=>{let s;try{let i=await d.readFile(a,"utf-8");s=JSON.parse(i)}catch(i){if(l(i)&&i.code==="ENOENT")return null;throw i}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(a)}catch(i){if(l(i)&&i.code==="ENOENT")return null;throw i}return n},()=>null);if(o===null)return!1;let c=await Promise.allSettled(Array.from(o).map(s=>Q(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 Q(r,e,t){let a=m(r,e);await h(a,async()=>{try{let o=await d.readFile(a,"utf-8"),c=JSON.parse(o),s=c.blocks.length,n=c.blockedBy.length;if(c.blocks=c.blocks.filter(i=>i!==t),c.blockedBy=c.blockedBy.filter(i=>i!==t),c.blocks.length===s&&c.blockedBy.length===n)return;await g(a,c)}catch(o){if(l(o)&&o.code==="ENOENT")return;throw o}},()=>{})}async function x(r,e){let t=T(r),a;try{a=await d.readdir(t)}catch(n){if(l(n)&&n.code==="ENOENT")return[];let i=n instanceof Error?n.message:String(n);throw f.warn(`Failed to list tasks dir ${t}: ${i}`),n instanceof Error?n:new Error(i)}let o=a.filter(n=>n.endsWith(".json")),c=[];for(let n=0;n<o.length;n+=A){let i=o.slice(n,n+A),w=await Promise.all(i.map(async D=>{let y=b.join(t,D),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 J=`${y}.corrupt-${Date.now()}`;try{await d.rename(y,J)}catch(N){let U=N instanceof Error?N.message:String(N);f.warn(`Failed to quarantine ${y}: ${U}`)}return}}));c.push(...w)}let s=c.filter(n=>n!==void 0);return s.sort((n,i)=>Number(n.id)-Number(i.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 V(r,e,t){let a=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),i=n.blockedBy.length;n.blockedBy=n.blockedBy.filter(w=>w!==e),n.blockedBy.length!==i&&await g(c,n)},()=>{})}));for(let o of a)o.status==="rejected"&&f.warn(`unblockDependents(${e}): ${o.reason}`);k(r)}async function ue(r,e,t){await F(r,e,{addBlocks:[t]}),await F(r,t,{addBlockedBy:[e]})}async function fe(r,e,t,a){return a?.checkAgentBusy?Y(t).runExclusive(()=>M(r,e,t,a,!0)):M(r,e,t,a,!1)}async function M(r,e,t,a,o){if(o&&await H(r,t))return;let c=m(r,e);return h(c,async()=>{let s;try{s=await d.readFile(c,"utf-8")}catch(i){if(l(i)&&i.code==="ENOENT")return;throw i}let n=JSON.parse(s);if(n.status==="pending"&&!n.owner)return n.owner=a?.ownerName??t,n.status="in_progress",await g(c,n),k(r),n},()=>{})}async function H(r,e){let t=await x(r,{status:"in_progress"}),a=e.split("@")[0];return t.some(o=>o.owner===e||o.owner===a)}async function Z(r,e,t){let a=m(r,e);return h(a,async()=>{let o;try{o=await d.readFile(a,"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(a,c),!0)},()=>!1)}async function we(r,e){let t=e.split("@")[0],o=(await x(r,{status:"in_progress"})).filter(i=>i.owner===e||i.owner===t),c=await Promise.allSettled(o.map(i=>Z(r,i.id,i.owner))),s=c.filter(i=>i.status==="rejected");s.length>0&&f.warn(`unassignTeammateTasks: ${s.length}/${o.length} task(s) failed to unassign for ${e}`);let n=c.filter(i=>i.status==="fulfilled"&&i.value===!0).length;return n>0&&k(r),n}async function ge(r){let e=await x(r),t=new Map;for(let a of e){if(!a.owner)continue;let o=t.get(a.owner)??{inProgress:0,completed:0};a.status==="in_progress"?o.inProgress++:a.status==="completed"&&o.completed++,t.set(a.owner,o)}return t}async function I(r){let e;try{e=await d.readdir(r)}catch{return"1"}let t=0;for(let a of e){if(!a.endsWith(".json"))continue;let o=parseInt(a.replace(".json",""),10);!isNaN(o)&&o>t&&(t=o)}return String(t+1)}export{z as a,G as b,m as c,ie as d,k as e,oe as f,ce as g,p as h,F as i,de as j,x as k,le as l,ue as m,fe as n,Z as o,we as p,ge as q};
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2025 Matilda
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{w as i}from"./chunk-
|
|
3
|
+
import{w as i}from"./chunk-NOE4UNQN.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,10 +1,10 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{
|
|
3
|
+
import{Gh as T}from"./chunk-SY6JRCN3.js";import{Q as b}from"./chunk-62AFAL4I.js";import{b as o}from"./chunk-GZPNIYVZ.js";import{b as w}from"./chunk-OWGSC52X.js";o();var B=e=>{process.stdout.write(e.endsWith(`
|
|
4
4
|
`)?e:`${e}
|
|
5
5
|
`)},m=e=>{process.stderr.write(e.endsWith(`
|
|
6
6
|
`)?e:`${e}
|
|
7
|
-
`)},W=()=>{console.clear()};o();import*as u from"node:fs";import*as f from"node:path";import{pathToFileURL as N}from"node:url";o();var p=[{code:"en",id:"en-AU",fullName:"Australian English",nativeName:"English (AU)"},{code:"ru",id:"ru-RU",fullName:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"de",id:"de-DE",fullName:"German",nativeName:"Deutsch"},{code:"ja",id:"ja-JP",fullName:"Japanese",nativeName:"\u65E5\u672C\u8A9E"},{code:"pt",id:"pt-BR",fullName:"Portuguese",nativeName:"Portugu\xEAs"},{code:"fr",id:"fr-FR",fullName:"French",nativeName:"Fran\xE7ais"},{code:"ca",id:"ca-ES",fullName:"Catalan",nativeName:"Catal\xE0"}];function A(e){return e.trim().replace(/_/g,"-").toLowerCase()}var M=new Set(["zh","zh-cn","zh-hans","zh-sg","zh-tw","zh-hk","zh-mo","zh-hant","chinese","traditional chinese","simplified chinese","\u4E2D\u6587","\u7B80\u4F53\u4E2D\u6587","\u7E41\u9AD4\u4E2D\u6587","\u7E41\u4F53\u4E2D\u6587"]);function E(e){let t=A(e);return t?M.has(t)?!0:t.startsWith("zh-")||t.startsWith("zh.")||t.startsWith("zh@"):!1}function k(e,t){return e===t||e.startsWith(`${t}-`)||e.startsWith(`${t}.`)||e.startsWith(`${t}@`)}function z(e,t){let n=t.code.toLowerCase(),r=t.id.toLowerCase();if(k(e,r))return r.length;if(k(e,n))return n.length}function l(e){let t=A(e);if(!t)return;if(t==="english"||t==="australian"||t==="australian-english")return"en";let n;for(let r of p){if(t===r.fullName.toLowerCase()||r.nativeName&&t===r.nativeName.toLowerCase())return r.code;let a=z(t,r);a!==void 0&&(!n||a>n.tokenLength)&&(n={code:r.code,tokenLength:a})}return n?.code}function C(e){let t=l(e);return(t?p.find(r=>r.code===t):void 0)?.fullName||"English"}function q(){return[{value:"auto",label:"Auto (detect from system)"},...p.map(e=>({value:e.code,label:e.nativeName?`${e.nativeName} (${e.fullName})`:`${e.fullName} (${e.id})`}))]}o();function h(e){return Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}o();var I=w({"./locales/ca.js":()=>import("./ca-
|
|
7
|
+
`)},W=()=>{console.clear()};o();import*as u from"node:fs";import*as f from"node:path";import{pathToFileURL as N}from"node:url";o();var p=[{code:"en",id:"en-AU",fullName:"Australian English",nativeName:"English (AU)"},{code:"ru",id:"ru-RU",fullName:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"de",id:"de-DE",fullName:"German",nativeName:"Deutsch"},{code:"ja",id:"ja-JP",fullName:"Japanese",nativeName:"\u65E5\u672C\u8A9E"},{code:"pt",id:"pt-BR",fullName:"Portuguese",nativeName:"Portugu\xEAs"},{code:"fr",id:"fr-FR",fullName:"French",nativeName:"Fran\xE7ais"},{code:"ca",id:"ca-ES",fullName:"Catalan",nativeName:"Catal\xE0"}];function A(e){return e.trim().replace(/_/g,"-").toLowerCase()}var M=new Set(["zh","zh-cn","zh-hans","zh-sg","zh-tw","zh-hk","zh-mo","zh-hant","chinese","traditional chinese","simplified chinese","\u4E2D\u6587","\u7B80\u4F53\u4E2D\u6587","\u7E41\u9AD4\u4E2D\u6587","\u7E41\u4F53\u4E2D\u6587"]);function E(e){let t=A(e);return t?M.has(t)?!0:t.startsWith("zh-")||t.startsWith("zh.")||t.startsWith("zh@"):!1}function k(e,t){return e===t||e.startsWith(`${t}-`)||e.startsWith(`${t}.`)||e.startsWith(`${t}@`)}function z(e,t){let n=t.code.toLowerCase(),r=t.id.toLowerCase();if(k(e,r))return r.length;if(k(e,n))return n.length}function l(e){let t=A(e);if(!t)return;if(t==="english"||t==="australian"||t==="australian-english")return"en";let n;for(let r of p){if(t===r.fullName.toLowerCase()||r.nativeName&&t===r.nativeName.toLowerCase())return r.code;let a=z(t,r);a!==void 0&&(!n||a>n.tokenLength)&&(n={code:r.code,tokenLength:a})}return n?.code}function C(e){let t=l(e);return(t?p.find(r=>r.code===t):void 0)?.fullName||"English"}function q(){return[{value:"auto",label:"Auto (detect from system)"},...p.map(e=>({value:e.code,label:e.nativeName?`${e.nativeName} (${e.fullName})`:`${e.fullName} (${e.id})`}))]}o();function h(e){return Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}o();var I=w({"./locales/ca.js":()=>import("./ca-C2V7I65K.js"),"./locales/de.js":()=>import("./de-KOUI2CEW.js"),"./locales/en.js":()=>import("./en-RMYRLXC2.js"),"./locales/fr.js":()=>import("./fr-R3QF3LA2.js"),"./locales/ja.js":()=>import("./ja-A5OQLXUZ.js"),"./locales/pt.js":()=>import("./pt-RG3S3KA7.js"),"./locales/ru.js":()=>import("./ru-5S5HLRT7.js")});var y="en",v={},i={},S={},R=()=>f.join(T(import.meta.url),"locales"),U=()=>f.join(b.getGlobalMatildaDir(),"locales");var D=(e,t=!1)=>{let n=t?U():R();return f.join(n,`${e}.js`)};function O(){let e=process.env.MATILDA_CODE_LANG||process.env.LANG;if(e){let t=l(e);if(t)return t}try{let t=Intl.DateTimeFormat().resolvedOptions().locale,n=l(t);if(n)return n}catch{}return"en"}async function P(e){try{let t=await import(e),n=h(t);return L(n)?{translations:n}:{error:new Error("Module loaded but result is empty or invalid")}}catch(t){return{error:t instanceof Error?t:new Error(String(t))}}}async function $(e){try{let t=await I(`./locales/${e}.js`),n=h(t);return L(n)?{translations:n}:{error:new Error("Module loaded but result is empty or invalid")}}catch(t){return{error:t instanceof Error?t:new Error(String(t))}}}async function j(e){if(i[e])return i[e];let t=S[e];if(t)return t;let n=(async()=>{let r=D(e,!0);if(u.existsSync(U())&&u.existsSync(r)){let s=await P(N(r).href);if(s.translations)return i[e]=s.translations,s.translations;m(`Failed to load translations from user directory for ${e}: ${s.error.message}`)}let a=D(e,!1),x=[];u.existsSync(R())&&u.existsSync(a)&&x.push(N(a).href);let c;for(let s of x){let g=await P(s);if(g.translations)return i[e]=g.translations,g.translations;c=g.error}let d=await $(e);return d.translations?(i[e]=d.translations,d.translations):(c=d.error,c&&m(`Failed to load JS translations for ${e}: ${c.message}`),i[e]={},{})})();return S[e]=n,n.finally(()=>{delete S[e]}),n}function _(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,r)=>t[r]??n):e}function F(e){return e==="auto"?O():E(e)?"en":l(e)??e}async function G(e){y=F(e),v=await j(y)}function le(){return y}function ue(e,t){let n=v[e]??e;return Array.isArray(n)?e:_(n,t)}function ce(e){let t=v[e];return Array.isArray(t)?t:[]}async function de(e){await G(e??"auto")}export{B as a,m as b,W as c,p as d,E as e,l as f,C as g,q as h,O as i,G as j,le as k,ue as l,ce as m,de as n};
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2025 Matilda Team
|