@myagentroam/node 0.9.31 → 0.9.33

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/dist/workspace.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* mar-release-protected */
2
- const _0x4be827=_0x598f;(function(_0xcee718,_0x3e1561){const _0x1fe898=_0x598f,_0x5661ec=_0xcee718();while(!![]){try{const _0x5c1e53=-parseInt(_0x1fe898(0xf1))/(-0x1c57+-0x33*-0x56+0xb36)*(parseInt(_0x1fe898(0x15a))/(0x4*0x43c+-0xd86+-0x368))+-parseInt(_0x1fe898(0xbd))/(0x2056*0x1+0x1941+-0x3994)+parseInt(_0x1fe898(0x120))/(-0x1328*0x2+0x98a+-0x6e*-0x43)+parseInt(_0x1fe898(0x183))/(0x1bca+0x78c+0x2351*-0x1)+parseInt(_0x1fe898(0x199))/(-0x4dc*0x4+-0x7c8+0x13d*0x16)*(-parseInt(_0x1fe898(0x15d))/(-0x1e14+0x474+0x19a7))+parseInt(_0x1fe898(0x9c))/(-0x10c0+0x21e+0x2*0x755)+-parseInt(_0x1fe898(0x1a6))/(-0x133+-0x2622+0x275e)*(-parseInt(_0x1fe898(0x115))/(0x1810+-0x2fa*-0x1+-0x360*0x8));if(_0x5c1e53===_0x3e1561)break;else _0x5661ec['push'](_0x5661ec['shift']());}catch(_0x156246){_0x5661ec['push'](_0x5661ec['shift']());}}}(_0x5585,-0x13e*-0xcae+-0x49*0x557+-0x2e3*0x187));import{createHash,randomUUID}from'node:crypto';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x204681}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';const GIT_TIMEOUT_MS=-0x855+-0x1027+0x2c04,GIT_OUTPUT_LIMIT=(0x19c3+0x1*0x2ad+-0x9*0x2f0)*(0x1*0x2015+-0x1*0x1977+-0x29e),FILE_READ_LIMIT=(-0x23eb+-0x1e5b+0x2*0x2223)*(0x1*0x413+-0x1f92+0x2dd*0xb),DIRECTORY_PAGE_LIMIT=-0x27*0x3a+-0x21c2+0x2b60,DIRECTORY_PICKER_LIMIT=-0x52*0x71+0x21*-0xc9+0x3ee3,SEARCH_RESULT_LIMIT=0xb19+-0xe46+0x1*0x3f5,FILE_INDEX_IDLE_TTL_MS=(-0x16cb+0x1e6c+-0x765)*(-0x1bd1+0x214+-0x1*-0x19f9)*(-0x42c+-0x40b+-0x1d*-0x6b),FILE_INDEX_FRESHNESS_TTL_MS=-0xb08b*-0x1+-0xb208+0x30b*0x27,FILE_INDEX_ENTRY_LIMIT=0x2cda4+-0x19cb7+0x47*0x135,FILE_INDEX_METADATA_CONCURRENCY=-0x475+-0xa57+0xeec,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x4be827(0x16e),_0x4be827(0x187),_0x4be827(0xac),_0x4be827(0x194),_0x4be827(0xb2),_0x4be827(0x9e),_0x4be827(0xaf),_0x4be827(0x9d),_0x4be827(0x174),_0x4be827(0xe1),_0x4be827(0x1ae),_0x4be827(0xdd),_0x4be827(0x138),_0x4be827(0xd8),_0x4be827(0x161),_0x4be827(0x17c),_0x4be827(0xe7),_0x4be827(0x105),_0x4be827(0x18f),_0x4be827(0x195),_0x4be827(0x130),_0x4be827(0x134),_0x4be827(0xca),_0x4be827(0x116),_0x4be827(0x179)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x548d70,_0x5350ab,_0x1a0e5d){const _0x154cd6=_0x4be827,_0x4cc7ce=_0x5350ab[_0x154cd6(0x190)]();if(_0x4cc7ce[_0x154cd6(0xa0)]===0x16c*-0x1b+0x4a6+-0xe*-0x269||_0x4cc7ce[_0x154cd6(0xa0)]>0x2056+-0x21a3*-0x1+-0x40fa||_0x4cc7ce==='.'||_0x4cc7ce==='..'||_0x4cc7ce[_0x154cd6(0x108)]('/')||_0x4cc7ce[_0x154cd6(0x108)]('\x5c')||_0x4cc7ce[_0x154cd6(0x108)]('\x00'))throw new Error(_0x154cd6(0xcb));const _0x5587ba=await Promise[_0x154cd6(0xd2)](_0x1a0e5d[_0x154cd6(0x19c)](_0x14945f=>realpath(_0x14945f))),_0x270fe5=await realpath(_0x548d70)[_0x154cd6(0x19a)](()=>{const _0x2876f3=_0x154cd6;throw new Error(_0x2876f3(0x173));}),_0x2bbad5=await stat(_0x270fe5)[_0x154cd6(0x19a)](()=>undefined);if(_0x2bbad5?.[_0x154cd6(0xeb)]()!==!![]||!isWithinAllowedRoot(_0x270fe5,_0x5587ba))throw new Error(_0x154cd6(0x173));const _0x17ee6e=resolve(_0x270fe5,_0x4cc7ce);if(dirname(_0x17ee6e)!==_0x270fe5||!isWithinAllowedRoot(_0x17ee6e,_0x5587ba))throw new Error(_0x154cd6(0xcb));try{await mkdir(_0x17ee6e);}catch(_0x40f91a){if(_0x40f91a[_0x154cd6(0x1ac)]===_0x154cd6(0x193))throw new Error(_0x154cd6(0x18e));throw _0x40f91a;}return _0x17ee6e;}export class WorkspaceFileIndex{[_0x4be827(0xb4)];[_0x4be827(0x149)];[_0x4be827(0x197)]=[];[_0x4be827(0x18b)]=![];[_0x4be827(0x12a)];[_0x4be827(0x145)];[_0x4be827(0x1ab)]=!![];[_0x4be827(0xf9)];[_0x4be827(0x17b)]=0x141a+-0x1dc*0x11+-0xb82*-0x1;[_0x4be827(0x10b)]=-0x6e6+-0x1fe7*0x1+0x26cd;constructor(_0x3373ae,_0x2fdfd3={}){const _0x504d0c=_0x4be827;this[_0x504d0c(0xb4)]=_0x3373ae,this[_0x504d0c(0x149)]=_0x2fdfd3;}async[_0x4be827(0xc1)](){const _0x2f7473=_0x4be827;return await this[_0x2f7473(0x1aa)](),this[_0x2f7473(0xb7)](),{'entries':this[_0x2f7473(0x197)][_0x2f7473(0x177)](_0x794d1c=>_0x794d1c[_0x2f7473(0x17e)]===_0x2f7473(0x10a)),'truncated':this[_0x2f7473(0x18b)]};}[_0x4be827(0x123)](){const _0x1d2648=_0x4be827;if(this[_0x1d2648(0xf9)]!==undefined)clearTimeout(this[_0x1d2648(0xf9)]);this[_0x1d2648(0xf9)]=undefined,this[_0x1d2648(0x197)]=[],this[_0x1d2648(0x18b)]=![],this[_0x1d2648(0x1ab)]=!![],this[_0x1d2648(0x17b)]=0x1*0x246f+0x2*0x10e4+-0x19*0x2cf,this[_0x1d2648(0x10b)]=-0x4d9+-0x1*0x146f+-0x652*-0x4;}async[_0x4be827(0xa8)](_0x33b1bf,_0x32d6c2,_0x557b22=SEARCH_RESULT_LIMIT,_0x51a0a4=![]){const _0x594f3e=_0x4be827;if(_0x33b1bf[_0x594f3e(0x190)]()[_0x594f3e(0xa0)]===0x21a4+0x1643+0x37e7*-0x1||_0x33b1bf[_0x594f3e(0xa0)]>0x257+-0xbcb*0x3+-0x220a*-0x1||!Number[_0x594f3e(0xc0)](_0x557b22)||_0x557b22<0x4d2+0x2010+-0x3*0xc4b||_0x557b22>SEARCH_RESULT_LIMIT)throw new Error(_0x594f3e(0xf6));await this[_0x594f3e(0x1aa)](),this[_0x594f3e(0xb7)]();const _0x21db55=decodeSearchCursor(_0x32d6c2,_0x33b1bf),_0x575646=_0x21db55===undefined?undefined:this[_0x594f3e(0x197)][_0x594f3e(0x19e)](_0x414ffe=>_0x414ffe[_0x594f3e(0x118)]===_0x21db55&&(_0x51a0a4||_0x414ffe[_0x594f3e(0x17e)]===_0x594f3e(0x10a))),_0x563362=_0x575646===undefined?-(0x19e9+-0x5fa*0x1+-0x13ee):fuzzyPathScore(_0x575646[_0x594f3e(0x118)],_0x33b1bf),_0x24bbb7=_0x575646===undefined||_0x563362<-0x1*0x110a+-0x2*-0x59+0x1058?undefined:{'entry':_0x575646,'score':_0x563362},_0x5d8113=new RankedCandidateHeap(_0x557b22+(0x1d3a+0x287*-0x1+-0x1ab2));for(const _0x122951 of this[_0x594f3e(0x197)]){if(!_0x51a0a4&&_0x122951[_0x594f3e(0x17e)]!==_0x594f3e(0x10a))continue;const _0x21cbbf=fuzzyPathScore(_0x122951[_0x594f3e(0x118)],_0x33b1bf);if(_0x21cbbf<-0x1c+-0x1*0x1369+-0x107*-0x13)continue;const _0x5d717c={'entry':_0x122951,'score':_0x21cbbf};if(_0x24bbb7!==undefined&&compareRankedCandidate(_0x5d717c,_0x24bbb7)<=0xd8c+-0xbac+-0x1e0)continue;_0x5d8113[_0x594f3e(0x100)](_0x5d717c);}const _0x58b7de=_0x5d8113[_0x594f3e(0x15b)](),_0xc23ed6=_0x58b7de[_0x594f3e(0x17d)](-0x1*0x153+0xe95*0x1+0x6a1*-0x2,_0x557b22)[_0x594f3e(0x19c)](_0xe69e54=>_0xe69e54[_0x594f3e(0xad)]),_0x51666f=_0x58b7de[_0x557b22]?.[_0x594f3e(0xad)][_0x594f3e(0x118)];return{'entries':_0xc23ed6,'nextCursor':_0x51666f===undefined?null:encodeSearchCursor(_0x33b1bf,_0xc23ed6['at'](-(-0x92*-0x2e+0x13e3*-0x1+-0x658))?.[_0x594f3e(0x118)]??_0x21db55??''),'truncated':_0x51666f!==undefined||this[_0x594f3e(0x18b)]};}async[_0x4be827(0x1aa)](){const _0x456a86=_0x4be827;if(!this[_0x456a86(0x1ab)]&&this[_0x456a86(0x12a)]!==undefined){if(Date[_0x456a86(0x19b)]()-this[_0x456a86(0x10b)]>=(this[_0x456a86(0x149)][_0x456a86(0xb8)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x456a86(0x16f)]();return;}this[_0x456a86(0x145)]===undefined&&(this[_0x456a86(0x145)]=this[_0x456a86(0x15e)]()[_0x456a86(0x9b)](()=>{const _0x59533f=_0x456a86;this[_0x59533f(0x145)]=undefined;})),await this[_0x456a86(0x145)];}[_0x4be827(0xb7)](){const _0x5ad16e=_0x4be827;if(this[_0x5ad16e(0xf9)]!==undefined)clearTimeout(this[_0x5ad16e(0xf9)]);this[_0x5ad16e(0xf9)]=setTimeout(()=>this[_0x5ad16e(0x123)](),this[_0x5ad16e(0x149)][_0x5ad16e(0x167)]??FILE_INDEX_IDLE_TTL_MS),this[_0x5ad16e(0xf9)][_0x5ad16e(0x101)]();}async[_0x4be827(0x15e)](){const _0x56cb50=_0x4be827,_0x21e030=await resolveRegisteredWorkspaceRoot(this[_0x56cb50(0xb4)]),_0x1aa6ec=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x21e030)],_0x544963=[],_0x43ce59=this[_0x56cb50(0x149)][_0x56cb50(0x14d)]??FILE_INDEX_ENTRY_LIMIT;let _0x5b7efa=![];const _0x5060ff=['.'];let _0xe612b8=-0x24d1+-0x110+-0x25e1*-0x1;while(_0xe612b8<_0x5060ff[_0x56cb50(0xa0)]&&!_0x5b7efa){const _0x4a9aec=_0x5060ff[_0xe612b8];_0xe612b8+=0xd8*-0x22+0x416+-0x1*-0x189b;const _0x1aee94=await resolveWorkspaceEntryFromCanonicalRoot(_0x21e030,_0x4a9aec,!![])[_0x56cb50(0x19a)](()=>undefined);if(_0x1aee94===undefined)continue;const _0x3ae108=await opendir(_0x1aee94)[_0x56cb50(0x19a)](()=>undefined);if(_0x3ae108===undefined)continue;let _0x56b14d=[];const _0x1418bf=async()=>{const _0x40d3a8=_0x56cb50,_0x400520=await Promise[_0x40d3a8(0xd2)](_0x56b14d);_0x56b14d=[];for(const _0x53076f of _0x400520){if(_0x53076f===undefined)continue;if(_0x53076f[_0x40d3a8(0x118)]===_0x40d3a8(0x10f)||_0x53076f[_0x40d3a8(0x118)][_0x40d3a8(0x184)](_0x40d3a8(0x180))||isExcluded(_0x53076f[_0x40d3a8(0x118)],_0x1aa6ec))continue;if(_0x53076f[_0x40d3a8(0x17e)]===_0x40d3a8(0xfb))_0x5060ff[_0x40d3a8(0x1a3)](_0x53076f[_0x40d3a8(0x118)]);_0x544963[_0x40d3a8(0x1a3)](_0x53076f);if(_0x544963[_0x40d3a8(0xa0)]>=_0x43ce59){_0x5b7efa=!![];break;}}};for await(const _0x197e3b of _0x3ae108){const _0x490edb=_0x4a9aec==='.'?_0x197e3b[_0x56cb50(0xf0)]:posix[_0x56cb50(0x135)](_0x4a9aec[_0x56cb50(0xff)]('\x5c','/'),_0x197e3b[_0x56cb50(0xf0)]);if(_0x490edb===_0x56cb50(0x10f)||_0x490edb[_0x56cb50(0x184)](_0x56cb50(0x180))||isExcluded(_0x490edb,_0x1aa6ec))continue;_0x56b14d[_0x56cb50(0x1a3)](inspectWorkspaceIndexEntry(_0x21e030,_0x490edb,_0x197e3b[_0x56cb50(0xf0)]));if(_0x56b14d[_0x56cb50(0xa0)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x1418bf();if(_0x5b7efa)break;}if(!_0x5b7efa&&_0x56b14d[_0x56cb50(0xa0)]>-0x783+0x1998+-0x1*0x1215)await _0x1418bf();}this[_0x56cb50(0x12a)]=_0x21e030,this[_0x56cb50(0x197)]=_0x544963,this[_0x56cb50(0x18b)]=_0x5b7efa,this[_0x56cb50(0x1ab)]=![],this[_0x56cb50(0x17b)]=Date[_0x56cb50(0x19b)](),this[_0x56cb50(0x10b)]=this[_0x56cb50(0x17b)];}[_0x4be827(0x16f)](){const _0x566201=_0x4be827;if(this[_0x566201(0x145)]!==undefined)return;this[_0x566201(0x10b)]=Date[_0x566201(0x19b)](),this[_0x566201(0x145)]=this[_0x566201(0x15e)]()[_0x566201(0x19a)](()=>undefined)[_0x566201(0x9b)](()=>{const _0x230a93=_0x566201;this[_0x230a93(0x145)]=undefined;});}}async function workspaceExcludePatterns(_0xade4d){const _0x27621d=_0x4be827,_0x31a802=resolve(_0xade4d,_0x27621d(0x11c)),_0x554c32=await readFile(_0x31a802,_0x27621d(0x152))[_0x27621d(0x12f)](JSON[_0x27621d(0x191)])[_0x27621d(0x19a)](()=>undefined);if(typeof _0x554c32!==_0x27621d(0xae)||_0x554c32===null)return[];return[_0x27621d(0x122),_0x27621d(0x147)][_0x27621d(0x14e)](_0x54c241=>{const _0x521cd6=_0x27621d,_0x242775=_0x554c32[_0x54c241];return typeof _0x242775===_0x521cd6(0xae)&&_0x242775!==null?Object[_0x521cd6(0x197)](_0x242775)[_0x521cd6(0x14e)](([_0x274527,_0x3e0a5e])=>_0x3e0a5e===!![]?[_0x274527]:[]):[];});}function isExcluded(_0x22417b,_0x3babcb){const _0x56fb48=_0x4be827;return _0x3babcb[_0x56fb48(0xa1)](_0x25ca64=>minimatch(_0x22417b,_0x25ca64,{'dot':!![],'nocase':_0x204681()!==_0x56fb48(0xe2)})||minimatch(_0x22417b+'/',_0x25ca64,{'dot':!![],'nocase':_0x204681()!==_0x56fb48(0xe2)}));}function compareRankedCandidate(_0x474129,_0x5ea1f6){const _0x1b7751=_0x4be827;return _0x5ea1f6[_0x1b7751(0xba)]-_0x474129[_0x1b7751(0xba)]||_0x474129[_0x1b7751(0xad)][_0x1b7751(0x118)][_0x1b7751(0x124)](_0x5ea1f6[_0x1b7751(0xad)][_0x1b7751(0x118)]);}class RankedCandidateHeap{[_0x4be827(0xce)];[_0x4be827(0xa2)]=[];constructor(_0x19978b){const _0x49293b=_0x4be827;this[_0x49293b(0xce)]=_0x19978b;}[_0x4be827(0x100)](_0x4581dc){const _0x5c82e2=_0x4be827;if(this[_0x5c82e2(0xa2)][_0x5c82e2(0xa0)]<this[_0x5c82e2(0xce)]){this[_0x5c82e2(0xa2)][_0x5c82e2(0x1a3)](_0x4581dc),this[_0x5c82e2(0xbb)](this[_0x5c82e2(0xa2)][_0x5c82e2(0xa0)]-(0x29*-0x18+-0x32b*0xb+0x26b2));return;}if(compareRankedCandidate(_0x4581dc,this[_0x5c82e2(0xa2)][-0x5ef*-0x5+0x1*0x2117+-0x3ec2])>=0x81*0x43+-0x21d2+0x3*0x5)return;this[_0x5c82e2(0xa2)][0xd1f*-0x2+0x18fc+0x142]=_0x4581dc,this[_0x5c82e2(0xf3)](-0x1902+-0x1a*-0x45+0x1200);}[_0x4be827(0x15b)](){const _0x2ab388=_0x4be827;return[...this[_0x2ab388(0xa2)]][_0x2ab388(0xdc)](compareRankedCandidate);}[_0x4be827(0xbb)](_0x27f797){const _0x263ed7=_0x4be827;let _0x189118=_0x27f797;while(_0x189118>-0x1*0xb3f+-0x25d9+0xc46*0x4){const _0x396b8d=Math[_0x263ed7(0x16b)]((_0x189118-(-0x1a09+-0x2364+0x3d6e))/(0x464*-0x5+0x1*-0xdca+0x160*0x1a));if(compareRankedCandidate(this[_0x263ed7(0xa2)][_0x189118],this[_0x263ed7(0xa2)][_0x396b8d])<=-0x8*0x110+-0x1db1+0x3*0xcbb)break;[this[_0x263ed7(0xa2)][_0x189118],this[_0x263ed7(0xa2)][_0x396b8d]]=[this[_0x263ed7(0xa2)][_0x396b8d],this[_0x263ed7(0xa2)][_0x189118]],_0x189118=_0x396b8d;}}[_0x4be827(0xf3)](_0x40b0d2){const _0x22c915=_0x4be827;let _0x110940=_0x40b0d2;while(!![]){const _0x545793=_0x110940*(0x14de+0x14d2+-0x29ae)+(0x708+-0x4*-0x4d+-0x83b);if(_0x545793>=this[_0x22c915(0xa2)][_0x22c915(0xa0)])return;const _0x40e066=_0x545793+(0x10*-0x251+-0x1690+0x47*0xd7),_0x102542=_0x40e066<this[_0x22c915(0xa2)][_0x22c915(0xa0)]&&compareRankedCandidate(this[_0x22c915(0xa2)][_0x40e066],this[_0x22c915(0xa2)][_0x545793])>-0x17de+-0x6d*0x37+0x327*0xf?_0x40e066:_0x545793;if(compareRankedCandidate(this[_0x22c915(0xa2)][_0x102542],this[_0x22c915(0xa2)][_0x110940])<=0x71b*0x1+-0xc6c*-0x3+-0x2c5f)return;[this[_0x22c915(0xa2)][_0x110940],this[_0x22c915(0xa2)][_0x102542]]=[this[_0x22c915(0xa2)][_0x102542],this[_0x22c915(0xa2)][_0x110940]],_0x110940=_0x102542;}}}function fuzzyPathScore(_0x516828,_0x2d8799){const _0x285c36=_0x4be827,_0x2947b3=_0x516828[_0x285c36(0x137)](),_0x2622bf=_0x2d8799[_0x285c36(0x190)]()[_0x285c36(0x137)]();let _0x849f07=-0x65*0x5+-0xe2*0x1f+-0xcb*-0x25,_0x38ca3e=-0x3*-0x380+0x36d*0x8+-0x25e8,_0x43ecfd=-(0x1317*-0x1+0x2*-0x985+0x2623);for(const _0x45fa6b of _0x2622bf){const _0x13350d=_0x2947b3[_0x285c36(0xe9)](_0x45fa6b,_0x849f07);if(_0x13350d===-(-0x11b2*0x1+-0xad7*0x1+0x1c8a))return-(-0x35*0x43+-0x12b+-0x1*-0xf0b);_0x38ca3e+=_0x13350d===_0x43ecfd+(0x1720+-0x2635+0x1*0xf16)?-0x51*0x23+0x1*-0x1552+0xb*0x2f3:-0xcd+-0x1505+0x15d3*0x1;if(_0x13350d===0x2078+-0x1def+-0x3b*0xb||_0x285c36(0xb3)[_0x285c36(0x108)](_0x2947b3[_0x13350d-(0x4*0x7db+0x2*-0xa44+-0x3*0x3a1)]??''))_0x38ca3e+=0x2130+-0x5c4+-0x1b64;_0x43ecfd=_0x13350d,_0x849f07=_0x13350d+(-0xdfd+-0xff8+0x1df6);}const _0x4f2e10=_0x516828[_0x285c36(0x17d)](_0x516828[_0x285c36(0x14c)]('/')+(0x227*0x3+0x1e47+0x1*-0x24bb))[_0x285c36(0x137)]();if(_0x4f2e10[_0x285c36(0x108)](_0x2622bf))_0x38ca3e+=0x4a4*-0x2+0x7*-0x501+-0x1*-0x2c77;else{if(_0x2947b3[_0x285c36(0x108)](_0x2622bf))_0x38ca3e+=-0x1912+-0x800+0x2122;}return _0x38ca3e-_0x516828[_0x285c36(0xa0)]/(0x181d*-0x1+0x1733*0x1+0x4d2);}export async function listWorkspaceDirectories(_0x2789c3,_0x43173a,_0x11fa51=homedir()){const _0x128883=_0x4be827,_0xa20e49=await realpath(_0x11fa51),_0x150a72=await Promise[_0x128883(0xd2)](_0x43173a[_0x128883(0x19c)](_0x235d0b=>realpath(_0x235d0b))),_0x1d9737=[...new Set([_0xa20e49,..._0x150a72])],_0x3d9f78=_0x2789c3===undefined?_0x150a72[-0x31*0x6+-0x1d*0xbd+0x168f]??_0xa20e49:await realpath(_0x2789c3),_0x3c151c=await stat(_0x3d9f78);if(!_0x3c151c[_0x128883(0xeb)]()||!isWithinAllowedRoot(_0x3d9f78,_0x1d9737))throw new Error(_0x128883(0x173));const _0x551700=await readdir(_0x3d9f78,{'withFileTypes':!![]}),_0x44b763=[];for(const _0x229246 of _0x551700[_0x128883(0xdc)]((_0x3cc9ea,_0x405596)=>_0x3cc9ea[_0x128883(0xf0)][_0x128883(0x124)](_0x405596[_0x128883(0xf0)]))){if(!_0x229246[_0x128883(0xeb)]()&&!_0x229246[_0x128883(0x186)]())continue;const _0x407558=await realpath(resolve(_0x3d9f78,_0x229246[_0x128883(0xf0)]))[_0x128883(0x19a)](()=>undefined);if(_0x407558===undefined||!isWithinAllowedRoot(_0x407558,_0x1d9737))continue;const _0x4f7c33=await stat(_0x407558)[_0x128883(0x19a)](()=>undefined);if(_0x4f7c33===undefined||!_0x4f7c33[_0x128883(0xeb)]())continue;_0x44b763[_0x128883(0x1a3)]({'path':_0x407558,'name':_0x229246[_0x128883(0xf0)],'selectable':isWithinAllowedRoot(_0x407558,_0x150a72)});if(_0x44b763[_0x128883(0xa0)]>DIRECTORY_PICKER_LIMIT)break;}const _0x314ef4=dirname(_0x3d9f78);return{'homePath':_0xa20e49,'currentPath':_0x3d9f78,'parentPath':_0x314ef4===_0x3d9f78||!isWithinAllowedRoot(_0x314ef4,_0x1d9737)?null:_0x314ef4,'browseRoots':_0x150a72,'selectable':isWithinAllowedRoot(_0x3d9f78,_0x150a72),'entries':_0x44b763[_0x128883(0x17d)](-0x527+0x121c+-0xcf5,DIRECTORY_PICKER_LIMIT),'truncated':_0x44b763[_0x128883(0xa0)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x58e2ce,_0x2b9933='.',_0x5e31f0,_0x36c92f=DIRECTORY_PAGE_LIMIT){const _0x5d6d1d=_0x4be827;if(!Number[_0x5d6d1d(0xc0)](_0x36c92f)||_0x36c92f<0x2374+0xa8b+-0x2dfe||_0x36c92f>DIRECTORY_PAGE_LIMIT)throw new Error(_0x5d6d1d(0x14f));const _0x58f79a=await resolveRegisteredWorkspaceRoot(_0x58e2ce),_0x4befc7=await resolveWorkspaceEntryFromCanonicalRoot(_0x58f79a,_0x2b9933,!![]),_0x3399fd=await readdir(_0x4befc7,{'withFileTypes':!![]}),_0x34b66b=decodeDirectoryCursor(_0x5e31f0,_0x2b9933),_0x254acb=_0x3399fd[_0x5d6d1d(0x177)](_0x36cf01=>_0x36cf01[_0x5d6d1d(0xf0)]!==_0x5d6d1d(0x10f)&&!isWorkspaceUploadTemporaryName(_0x36cf01[_0x5d6d1d(0xf0)]))[_0x5d6d1d(0x19c)](_0x5a9f10=>_0x5a9f10[_0x5d6d1d(0xf0)])[_0x5d6d1d(0xdc)]((_0x43a251,_0x56f01a)=>_0x43a251[_0x5d6d1d(0x124)](_0x56f01a)),_0x47723a=_0x34b66b===undefined?0x1be4+-0x1d18+-0x9a*-0x2:_0x254acb[_0x5d6d1d(0x129)](_0xb156a4=>_0xb156a4>_0x34b66b);if(_0x34b66b!==undefined&&_0x47723a===-(-0x2*-0xe8f+-0x19a0+-0x37d))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x18018b=_0x254acb[_0x5d6d1d(0x17d)](_0x47723a,_0x47723a+_0x36c92f),_0x23f58d=[];for(const _0x184af9 of _0x18018b){const _0x18ad20=await resolveWorkspaceEntry(_0x58f79a,relative(_0x58f79a,resolve(_0x4befc7,_0x184af9)),![])[_0x5d6d1d(0x19a)](_0x183a8d=>{if(isSkippableWorkspaceEntryError(_0x183a8d))return undefined;throw _0x183a8d;});if(_0x18ad20===undefined)continue;const _0xa5bcab=await lstat(_0x18ad20)[_0x5d6d1d(0x19a)](_0x116c2b=>{const _0x235622=_0x5d6d1d;if(_0x116c2b[_0x235622(0x1ac)]===_0x235622(0x133))return undefined;throw _0x116c2b;});if(_0xa5bcab===undefined||!_0xa5bcab[_0x5d6d1d(0x18a)]()&&!_0xa5bcab[_0x5d6d1d(0xeb)]())continue;_0x23f58d[_0x5d6d1d(0x1a3)]({'path':relative(_0x58f79a,_0x18ad20)[_0x5d6d1d(0x9a)](sep)[_0x5d6d1d(0x135)]('/'),'name':_0x184af9,'kind':_0xa5bcab[_0x5d6d1d(0xeb)]()?_0x5d6d1d(0xfb):_0x5d6d1d(0x10a),'size':_0xa5bcab[_0x5d6d1d(0x18a)]()?_0xa5bcab[_0x5d6d1d(0xa5)]:null,'modifiedAt':_0xa5bcab[_0x5d6d1d(0xbf)]});}const _0x2a2d69=_0x254acb[_0x47723a+_0x18018b[_0x5d6d1d(0xa0)]];return{'entries':_0x23f58d,'nextCursor':_0x2a2d69===undefined||_0x18018b[_0x5d6d1d(0xa0)]===0xa4d*-0x1+0x820+0x22d?null:encodeDirectoryCursor(_0x2b9933,_0x18018b[_0x18018b[_0x5d6d1d(0xa0)]-(-0x7ff*0x1+0x1376+0x6*-0x1e9)]),'truncated':_0x2a2d69!==undefined};}export async function mutateWorkspaceFile(_0x3bba56,_0x358674){const _0x127883=_0x4be827,_0x1f6ef5=await resolveRegisteredWorkspaceRoot(_0x3bba56);if(_0x358674[_0x127883(0x1a5)]===_0x127883(0xa7)||_0x358674[_0x127883(0x1a5)]===_0x127883(0xd7)){const _0x22d02d=await resolveNewWorkspaceEntry(_0x1f6ef5,_0x358674[_0x127883(0x118)]);if(_0x358674[_0x127883(0x1a5)]===_0x127883(0xa7))await writeFile(_0x22d02d,'',{'flag':'wx'});else await mkdir(_0x22d02d);return{'path':workspaceRelativePath(_0x1f6ef5,_0x22d02d)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x1f6ef5,_0x358674[_0x127883(0x118)]);const _0x296403=await resolveWorkspaceEntryMetadata(_0x1f6ef5,_0x358674[_0x127883(0x118)]);if(workspaceRelativePath(_0x1f6ef5,_0x296403[_0x127883(0x118)])==='.')throw new Error(_0x127883(0x1ad));if(_0x358674[_0x127883(0x1a5)]===_0x127883(0x1a1))return await rm(_0x296403[_0x127883(0x118)],{'recursive':_0x296403[_0x127883(0x192)][_0x127883(0xeb)](),'force':![]}),{'deleted':!![]};const _0x560853=await resolveNewWorkspaceEntry(_0x1f6ef5,_0x358674[_0x127883(0x11f)]);if(_0x296403[_0x127883(0x192)][_0x127883(0xeb)]()){const _0x21e686=relative(_0x296403[_0x127883(0x118)],_0x560853);if(_0x21e686===''||!isAbsolute(_0x21e686)&&_0x21e686!=='..'&&!_0x21e686[_0x127883(0x184)]('..'+sep))throw new Error(_0x127883(0xdb));}return await rename(_0x296403[_0x127883(0x118)],_0x560853),{'path':workspaceRelativePath(_0x1f6ef5,_0x560853)};}async function resolveNewWorkspaceEntry(_0x5c045c,_0x536d5b){const _0x42a8cc=_0x4be827,_0x284da3=_0x536d5b[_0x42a8cc(0xff)]('\x5c','/'),_0xcf1acb=_0x284da3[_0x42a8cc(0x9a)]('/'),_0x48c77a=_0xcf1acb['at'](-(-0x1d7+0x1*-0x1a7d+0x1c55));if(_0x536d5b[_0x42a8cc(0x108)]('\x00')||_0x284da3[_0x42a8cc(0x184)]('/')||isAbsolute(_0x536d5b)||win32[_0x42a8cc(0x153)](_0x284da3)||_0x48c77a===undefined||_0x48c77a[_0x42a8cc(0xa0)]===0xeae+-0x1f8d+0x10df||_0xcf1acb[_0x42a8cc(0xa1)](invalidWorkspaceMutationSegment))throw new Error(_0x42a8cc(0xed));const _0x1f88b2=_0xcf1acb[_0x42a8cc(0xa0)]===0xbc6*0x1+-0x334*-0x1+-0xef9?'.':_0xcf1acb[_0x42a8cc(0x17d)](0x721*-0x2+0x1479+-0x637,-(0x1*0x26f6+0xbb2+-0x1*0x32a7))[_0x42a8cc(0x135)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x5c045c,_0x1f88b2);const _0x4d8566=await resolveWorkspaceEntryFromCanonicalRoot(_0x5c045c,_0x1f88b2,!![]),_0x145f93=resolve(_0x4d8566,_0x48c77a);try{await lstat(_0x145f93);throw new Error(_0x42a8cc(0x156));}catch(_0x245678){if(_0x245678[_0x42a8cc(0x1ac)]!==_0x42a8cc(0x133))throw _0x245678;}return _0x145f93;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x42a2e3,_0x9aa2a2){const _0x48fa74=_0x4be827,_0x10a87c=_0x9aa2a2[_0x48fa74(0xff)]('\x5c','/');if(_0x10a87c==='.')return;const _0x3576b8=_0x10a87c[_0x48fa74(0x9a)]('/');if(_0x9aa2a2[_0x48fa74(0x108)]('\x00')||_0x10a87c[_0x48fa74(0x184)]('/')||isAbsolute(_0x9aa2a2)||win32[_0x48fa74(0x153)](_0x10a87c)||_0x3576b8[_0x48fa74(0xa1)](invalidWorkspaceMutationSegment))throw new Error(_0x48fa74(0xed));let _0x235cec=_0x42a2e3;for(const _0x48ed05 of _0x3576b8){_0x235cec=resolve(_0x235cec,_0x48ed05);const _0x294355=await lstat(_0x235cec)[_0x48fa74(0x19a)](_0x3336c0=>{const _0x398e86=_0x48fa74;if(_0x3336c0[_0x398e86(0x1ac)]===_0x398e86(0x133))throw new Error(_0x398e86(0x159));throw _0x3336c0;});if(_0x294355[_0x48fa74(0x186)]())throw new Error(_0x48fa74(0xed));}}function invalidWorkspaceMutationSegment(_0x13b8f9){const _0x21e450=_0x4be827;if(_0x13b8f9[_0x21e450(0xa0)]===0x20bb+-0x1*-0x12dc+0x119*-0x2f||_0x13b8f9==='.'||_0x13b8f9==='..'||_0x13b8f9===_0x21e450(0x10f))return!![];if(_0x204681()!==_0x21e450(0x16c))return![];const _0x5a94da=_0x13b8f9[_0x21e450(0xd1)](/[. ]+$/u,'')[_0x21e450(0x198)]();return/[<>:"|?*]/u[_0x21e450(0xec)](_0x13b8f9)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x21e450(0xec)](_0x5a94da);}function workspaceRelativePath(_0x5ae657,_0x5f0f7b){const _0x392260=_0x4be827,_0x543fa2=relative(_0x5ae657,_0x5f0f7b)[_0x392260(0x9a)](sep)[_0x392260(0x135)]('/');return _0x543fa2[_0x392260(0xa0)]===0x1bcb*0x1+-0x22*-0x7c+-0x2c43?'.':_0x543fa2;}function isSkippableWorkspaceEntryError(_0x58c2cb){const _0x47e109=_0x4be827;return _0x58c2cb instanceof Error&&(_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0xed)||_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0x159)||_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0x188));}export async function preflightWorkspaceUpload(_0x37f79a,_0x1d3b14,_0x407b3b){const _0x430d7e=_0x4be827;if(_0x407b3b[_0x430d7e(0xa0)]===-0x1*-0x1f7f+0x37a+-0x22f9*0x1||_0x407b3b==='.'||_0x407b3b==='..'||_0x407b3b[_0x430d7e(0x108)]('\x00')||_0x407b3b[_0x430d7e(0x108)]('/')||_0x407b3b[_0x430d7e(0x108)]('\x5c')||isWorkspaceUploadTemporaryName(_0x407b3b))return{'path':'','absolutePath':'','status':_0x430d7e(0x182)};const _0x5e2fd5=await resolveRegisteredWorkspaceRoot(_0x37f79a),_0x15cbd3=await resolveWorkspaceEntry(_0x5e2fd5,_0x1d3b14,!![]),_0x5656c9=resolve(_0x15cbd3,_0x407b3b);if(dirname(_0x5656c9)!==_0x15cbd3)throw new Error(_0x430d7e(0xed));const _0x55a5a9=relative(_0x5e2fd5,_0x5656c9)[_0x430d7e(0x9a)](sep)[_0x430d7e(0x135)]('/'),_0x28209e=await lstat(_0x5656c9)[_0x430d7e(0x19a)](_0x58425a=>{const _0x2766bb=_0x430d7e;if(_0x58425a[_0x2766bb(0x1ac)]===_0x2766bb(0x133))return undefined;throw _0x58425a;});if(_0x28209e===undefined)return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x10c)};if(_0x28209e[_0x430d7e(0x186)]())throw new Error(_0x430d7e(0xed));if(_0x28209e[_0x430d7e(0x18a)]())return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x169)};return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x144)};}export function workspaceUploadTemporaryName(_0x365031){const _0x36ad46=_0x4be827;return _0x36ad46(0xcd)+_0x365031+_0x36ad46(0x146);}function isWorkspaceUploadTemporaryName(_0x28f220){const _0x14e3a2=_0x4be827;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x14e3a2(0xec)](_0x28f220)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x14e3a2(0xec)](_0x28f220);}export async function readWorkspaceTextFile(_0x138268,_0xf8a686,_0x5ddb3e=-0xd3a+-0x14bc+0x21f6,_0xd27610=FILE_READ_LIMIT){const _0x27f4cf=_0x4be827;if(!Number[_0x27f4cf(0xc0)](_0x5ddb3e)||_0x5ddb3e<0x19cc+0x59*0x59+0x7*-0x81b||!Number[_0x27f4cf(0xc0)](_0xd27610)||_0xd27610<-0x22cd+-0x9ef*0x1+0x2cbd||_0xd27610>FILE_READ_LIMIT)throw new Error(_0x27f4cf(0x185));const _0x501b09=await resolveRegisteredWorkspaceRoot(_0x138268),_0x34bb8c=await resolveWorkspaceEntry(_0x501b09,_0xf8a686,![]),_0x42e9cf=await lstat(_0x34bb8c);if(!_0x42e9cf[_0x27f4cf(0x18a)]())throw new Error(_0x27f4cf(0x188));if(_0x42e9cf[_0x27f4cf(0xa5)]>FILE_READ_LIMIT*(-0x19e7+-0x2501+0x3ef8))throw new Error(_0x27f4cf(0x15c));const _0x36258e=await readFile(_0x34bb8c),_0xfd5faf=createHash(_0x27f4cf(0x150))[_0x27f4cf(0x10e)](_0x36258e)[_0x27f4cf(0x17a)](_0x27f4cf(0xf8)),_0x3ea6b1=_0x36258e[_0x27f4cf(0x108)](-0x3d7+0x4*0x655+0x1*-0x157d)||!isValidUtf8(_0x36258e);if(_0x3ea6b1){const _0x343a6c=Math[_0x27f4cf(0x176)](_0x36258e[_0x27f4cf(0xa0)],_0x5ddb3e+_0xd27610),_0x55e044=_0x36258e[_0x27f4cf(0x171)](_0x5ddb3e,_0x343a6c);return{'path':relative(_0x501b09,_0x34bb8c)[_0x27f4cf(0x9a)](sep)[_0x27f4cf(0x135)]('/'),'encoding':_0x27f4cf(0xf2),'size':_0x36258e[_0x27f4cf(0xa0)],'content':_0x55e044[_0x27f4cf(0x19d)](_0x27f4cf(0xf2)),'truncated':_0x343a6c<_0x36258e[_0x27f4cf(0xa0)],'nextOffset':_0x343a6c<_0x36258e[_0x27f4cf(0xa0)]?_0x343a6c:null,'revision':_0xfd5faf};}if(_0x5ddb3e>-0x11*-0xda+0xc21+-0x1a9b&&_0x5ddb3e<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x5ddb3e]))throw new Error(_0x27f4cf(0x185));let _0x2adea6=Math[_0x27f4cf(0x176)](_0x36258e[_0x27f4cf(0xa0)],_0x5ddb3e+_0xd27610);if(_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x2adea6])){while(_0x2adea6>_0x5ddb3e&&isUtf8ContinuationByte(_0x36258e[_0x2adea6]))_0x2adea6-=-0xb*-0x11a+0x164b+0xc*-0x2de;if(_0x2adea6===_0x5ddb3e){_0x2adea6+=-0x21ad+-0x557*0x4+-0xa*-0x581;while(_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x2adea6]))_0x2adea6+=-0x22*-0x7c+0x58d+-0x4*0x581;}}const _0x1818ff=_0x36258e[_0x27f4cf(0x171)](_0x5ddb3e,_0x2adea6),_0x3da6e7=new TextDecoder(_0x27f4cf(0xfa),{'fatal':!![]})[_0x27f4cf(0xbc)](_0x1818ff),_0x58e874=_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]?_0x2adea6:null;return{'path':relative(_0x501b09,_0x34bb8c)[_0x27f4cf(0x9a)](sep)[_0x27f4cf(0x135)]('/'),'encoding':_0x27f4cf(0xfa),'size':_0x36258e[_0x27f4cf(0xa0)],'content':_0x3da6e7,'truncated':_0x58e874!==null,'nextOffset':_0x58e874,'revision':_0xfd5faf};}export async function writeWorkspaceTextFile(_0x1f73da,_0x5ea1b8,_0x463479,_0xb6a935){const _0x48643a=_0x4be827;if(!/^[0-9a-f]{64}$/u[_0x48643a(0xec)](_0xb6a935))throw new Error(_0x48643a(0xc3));const _0x53653f=Buffer[_0x48643a(0x13e)](_0x463479,_0x48643a(0x152));if(_0x53653f[_0x48643a(0xa0)]>FILE_READ_LIMIT*(0x1f7c+-0x6*-0x582+-0x4078))throw new Error(_0x48643a(0x15c));if(_0x53653f[_0x48643a(0x108)](-0x1d53+0x1*-0x17d2+-0x3525*-0x1))throw new Error(_0x48643a(0x164));const _0x377aab=await resolveRegisteredWorkspaceRoot(_0x1f73da);await assertWorkspaceMutationPathHasNoSymlinks(_0x377aab,_0x5ea1b8);const _0x2b1a97=await resolveWorkspaceEntry(_0x377aab,_0x5ea1b8,![]),_0x55a9c9=await lstat(_0x2b1a97);if(!_0x55a9c9[_0x48643a(0x18a)]())throw new Error(_0x48643a(0x188));const _0x5782dd=await readFile(_0x2b1a97);if(_0x5782dd[_0x48643a(0x108)](-0x201f+0x136c+0xcb3)||!isValidUtf8(_0x5782dd))throw new Error(_0x48643a(0x164));const _0x66c41=createHash(_0x48643a(0x150))[_0x48643a(0x10e)](_0x5782dd)[_0x48643a(0x17a)](_0x48643a(0xf8));if(_0x66c41!==_0xb6a935)throw new Error(_0x48643a(0x14a));const _0x3a2756=createHash(_0x48643a(0x150))[_0x48643a(0x10e)](_0x53653f)[_0x48643a(0x17a)](_0x48643a(0xf8)),_0x3b6091=resolve(dirname(_0x2b1a97),_0x48643a(0x143)+randomUUID()+_0x48643a(0x146));try{await writeFile(_0x3b6091,_0x53653f,{'flag':'wx','mode':_0x55a9c9[_0x48643a(0xa4)]}),await rename(_0x3b6091,_0x2b1a97);}finally{await rm(_0x3b6091,{'force':!![]})[_0x48643a(0x19a)](()=>undefined);}return{'path':workspaceRelativePath(_0x377aab,_0x2b1a97),'revision':_0x3a2756,'size':_0x53653f[_0x48643a(0xa0)]};}export async function readWorkspaceFileContentRange(_0x5856b2,_0x2769d7,_0x2d4bdc=-0x193+-0x1*-0x89+0x10a,_0x5cf880=FILE_READ_LIMIT){const _0x36bf36=_0x4be827;if(!Number[_0x36bf36(0xc0)](_0x2d4bdc)||_0x2d4bdc<0x1*-0x14e5+-0x2200+0x263*0x17||!Number[_0x36bf36(0xc0)](_0x5cf880)||_0x5cf880<-0x2432+-0x2078+0x44ab*0x1||_0x5cf880>FILE_READ_LIMIT)throw new Error(_0x36bf36(0x185));const _0x297929=await resolveRegisteredWorkspaceRoot(_0x5856b2),_0x330bfa=await resolveWorkspaceEntry(_0x297929,_0x2769d7,![]),_0x2b4f5b=await lstat(_0x330bfa);if(!_0x2b4f5b[_0x36bf36(0x18a)]())throw new Error(_0x36bf36(0x188));if(_0x2d4bdc>_0x2b4f5b[_0x36bf36(0xa5)])throw new Error(_0x36bf36(0x185));const _0x3aaee6=Math[_0x36bf36(0x176)](_0x5cf880,_0x2b4f5b[_0x36bf36(0xa5)]-_0x2d4bdc),_0xf10140=Buffer[_0x36bf36(0x107)](_0x3aaee6),_0x41c3d4=await open(_0x330bfa,'r');try{const {bytesRead:_0x568726}=await _0x41c3d4[_0x36bf36(0x139)](_0xf10140,-0x1*0x37e+0x2047*0x1+-0x1cc9,_0x3aaee6,_0x2d4bdc),_0x1b85f3=_0x2d4bdc+_0x568726;return{'path':relative(_0x297929,_0x330bfa)[_0x36bf36(0x9a)](sep)[_0x36bf36(0x135)]('/'),'size':_0x2b4f5b[_0x36bf36(0xa5)],'offset':_0x2d4bdc,'contentBase64':_0xf10140[_0x36bf36(0x171)](-0x2112+0xe*-0x28d+-0x2*-0x2264,_0x568726)[_0x36bf36(0x19d)](_0x36bf36(0xf2)),'nextOffset':_0x1b85f3<_0x2b4f5b[_0x36bf36(0xa5)]?_0x1b85f3:null};}finally{await _0x41c3d4[_0x36bf36(0xc4)]();}}function _0x598f(_0x2a3f54,_0x231158){_0x2a3f54=_0x2a3f54-(0x1e76*0x1+-0x8bf*-0x2+-0x1*0x2f5f);const _0xc3f520=_0x5585();let _0x22c635=_0xc3f520[_0x2a3f54];if(_0x598f['zEOXBJ']===undefined){var _0xff301d=function(_0x5b1cc6){const _0x527055='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1beb0f='',_0x4670da='';for(let _0x1d040a=0x2693+0xf7a+-0x360d,_0x572791,_0x58be81,_0x2a08af=0x1*-0xf6e+-0x1f13+0x1*0x2e81;_0x58be81=_0x5b1cc6['charAt'](_0x2a08af++);~_0x58be81&&(_0x572791=_0x1d040a%(-0x259*-0x4+0x4*-0x20f+-0x1*0x124)?_0x572791*(-0xfb0+-0x23eb+0x33db)+_0x58be81:_0x58be81,_0x1d040a++%(-0x1be5*-0x1+0x1*0x371+-0x1f52))?_0x1beb0f+=String['fromCharCode'](0x260a+0x15c9+-0x3c*0xfb&_0x572791>>(-(-0x648+-0x1c67+-0x53*-0x6b)*_0x1d040a&0x1b0f+-0x3*-0x472+-0x285f)):-0xdc7*0x2+-0x1f39*-0x1+-0x3ab){_0x58be81=_0x527055['indexOf'](_0x58be81);}for(let _0x428f79=-0x674*0x1+-0x1bd1+-0x1*-0x2245,_0x6b99c=_0x1beb0f['length'];_0x428f79<_0x6b99c;_0x428f79++){_0x4670da+='%'+('00'+_0x1beb0f['charCodeAt'](_0x428f79)['toString'](-0x42c+-0x40b+-0xd*-0xa3))['slice'](-(-0x1d6d*-0x1+-0x1dac+0xd*0x5));}return decodeURIComponent(_0x4670da);};_0x598f['FyybKm']=_0xff301d,_0x598f['TRGXKW']={},_0x598f['zEOXBJ']=!![];}const _0xd5884=_0xc3f520[0x23e2+-0x14a3+0x3*-0x515];_0x598f['spctPb']!==_0xd5884&&(_0x598f['TRGXKW']={},_0x598f['spctPb']=_0xd5884);const _0x355c1a=_0x598f['TRGXKW'][_0x2a3f54];return _0x355c1a===undefined?(_0x22c635=_0x598f['FyybKm'](_0x22c635),_0x598f['TRGXKW'][_0x2a3f54]=_0x22c635):_0x22c635=_0x355c1a,_0x22c635;}export async function readAllowedFileContentRange(_0x155a0c,_0x20e1ed,_0x1cb1d5=0x412*-0x7+0x2203+-0x585,_0x33165d=FILE_READ_LIMIT){const _0x2294f3=_0x4be827;if(!Number[_0x2294f3(0xc0)](_0x1cb1d5)||_0x1cb1d5<-0x105a+-0x1d63*0x1+-0x3*-0xf3f||!Number[_0x2294f3(0xc0)](_0x33165d)||_0x33165d<0x1253+-0x17d9+0x587||_0x33165d>FILE_READ_LIMIT)throw new Error(_0x2294f3(0x185));const {file:_0x31ff1a,metadata:_0x2f9048}=await resolveAllowedFile(_0x155a0c,_0x20e1ed);if(_0x1cb1d5>_0x2f9048[_0x2294f3(0xa5)])throw new Error(_0x2294f3(0x185));const _0x49134f=Math[_0x2294f3(0x176)](_0x33165d,_0x2f9048[_0x2294f3(0xa5)]-_0x1cb1d5),_0x2100e8=Buffer[_0x2294f3(0x107)](_0x49134f),_0x5c1019=await open(_0x31ff1a,'r');try{const {bytesRead:_0x365e4a}=await _0x5c1019[_0x2294f3(0x139)](_0x2100e8,0x4b*-0x27+-0x6c3+0x1230,_0x49134f,_0x1cb1d5),_0x3bc5f6=_0x1cb1d5+_0x365e4a;return{'path':_0x31ff1a,'size':_0x2f9048[_0x2294f3(0xa5)],'offset':_0x1cb1d5,'contentBase64':_0x2100e8[_0x2294f3(0x171)](0x260c*0x1+-0x153d+0xd*-0x14b,_0x365e4a)[_0x2294f3(0x19d)](_0x2294f3(0xf2)),'nextOffset':_0x3bc5f6<_0x2f9048[_0x2294f3(0xa5)]?_0x3bc5f6:null};}finally{await _0x5c1019[_0x2294f3(0xc4)]();}}export async function readAllowedTextFile(_0x393125,_0x20e7eb,_0x3cdbfb=-0x1*-0x14e3+-0x1a*0xbf+0x17d*-0x1,_0xc83050=FILE_READ_LIMIT){const _0x5ba350=_0x4be827,{file:_0x3a68a,metadata:_0x697c87}=await resolveAllowedFile(_0x393125,_0x20e7eb);if(_0x697c87[_0x5ba350(0xa5)]>FILE_READ_LIMIT*(0x44f*-0x1+0x1748+-0x12e9*0x1))throw new Error(_0x5ba350(0x15c));if(!Number[_0x5ba350(0xc0)](_0x3cdbfb)||_0x3cdbfb<0x1f8d+-0x1*0x10b1+0x13d*-0xc||!Number[_0x5ba350(0xc0)](_0xc83050)||_0xc83050<0x487*0x5+-0x2*0x29d+-0x1168||_0xc83050>FILE_READ_LIMIT)throw new Error(_0x5ba350(0x185));const _0x5616c5=await readFile(_0x3a68a),_0x2924e8=_0x5616c5[_0x5ba350(0x108)](0x86*0x42+0x1e8c+-0x1*0x4118)||!isValidUtf8(_0x5616c5),_0x4e5caa=Math[_0x5ba350(0x176)](_0x5616c5[_0x5ba350(0xa0)],_0x3cdbfb+_0xc83050);if(_0x2924e8){const _0x932881=_0x5616c5[_0x5ba350(0x171)](_0x3cdbfb,_0x4e5caa);return{'path':_0x3a68a,'encoding':_0x5ba350(0xf2),'size':_0x5616c5[_0x5ba350(0xa0)],'content':_0x932881[_0x5ba350(0x19d)](_0x5ba350(0xf2)),'truncated':_0x4e5caa<_0x5616c5[_0x5ba350(0xa0)],'nextOffset':_0x4e5caa<_0x5616c5[_0x5ba350(0xa0)]?_0x4e5caa:null};}if(_0x3cdbfb>-0x209*0x7+-0x3*0xde+0x10d9&&_0x3cdbfb<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x3cdbfb]))throw new Error(_0x5ba350(0x185));let _0x4e9a47=_0x4e5caa;if(_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47])){while(_0x4e9a47>_0x3cdbfb&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47]))_0x4e9a47-=0x1a8+-0x1*0xbe3+0xa3c;if(_0x4e9a47===_0x3cdbfb){_0x4e9a47+=0x8f3+-0x23ab+0x1*0x1ab9;while(_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47]))_0x4e9a47+=-0x251+0xdac*-0x1+0x2*0x7ff;}}const _0x3163c5=_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]?_0x4e9a47:null;return{'path':_0x3a68a,'encoding':_0x5ba350(0xfa),'size':_0x5616c5[_0x5ba350(0xa0)],'content':new TextDecoder(_0x5ba350(0xfa),{'fatal':!![]})[_0x5ba350(0xbc)](_0x5616c5[_0x5ba350(0x171)](_0x3cdbfb,_0x4e9a47)),'truncated':_0x3163c5!==null,'nextOffset':_0x3163c5};}export function normalizeFilePreviewPath(_0x36db69){const _0x2c49a4=_0x4be827;if(!/^sandbox:/iu[_0x2c49a4(0xec)](_0x36db69))return _0x36db69;let _0x16c7c3;try{_0x16c7c3=decodeURIComponent(_0x36db69[_0x2c49a4(0x17d)](_0x36db69[_0x2c49a4(0xe9)](':')+(-0x140b+-0x1443+0x25f*0x11)));}catch{throw new Error(_0x2c49a4(0xed));}const _0x2092cc=_0x16c7c3[_0x2c49a4(0xd1)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x2092cc[_0x2c49a4(0xa0)]===0x1f97+-0x18d1+-0x6c6*0x1||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x2c49a4(0xec)](_0x16c7c3)||!isAbsolute(_0x2092cc)&&!win32[_0x2c49a4(0x153)](_0x2092cc)||_0x2092cc[_0x2c49a4(0x108)]('\x00')||_0x2092cc[_0x2c49a4(0x108)]('?')||_0x2092cc[_0x2c49a4(0x108)]('#'))throw new Error(_0x2c49a4(0xed));return _0x2092cc;}async function resolveAllowedFile(_0x33e511,_0x505d80){const _0x5da709=_0x4be827;if(!isAbsolute(_0x33e511))throw new Error(_0x5da709(0xed));const _0x2c5119=await realpath(_0x33e511)[_0x5da709(0x19a)](_0x109ec8=>{const _0x4ef949=_0x5da709;if(_0x109ec8[_0x4ef949(0x1ac)]===_0x4ef949(0x133))throw new Error(_0x4ef949(0x159));throw _0x109ec8;}),_0x16a8b6=await Promise[_0x5da709(0xd2)](_0x505d80[_0x5da709(0x19c)](_0x41f372=>realpath(_0x41f372)));if(!isWithinAllowedRoot(_0x2c5119,_0x16a8b6))throw new Error(_0x5da709(0xed));const _0x4bd3dc=await lstat(_0x2c5119);if(!_0x4bd3dc[_0x5da709(0x18a)]())throw new Error(_0x5da709(0x188));return{'file':_0x2c5119,'metadata':_0x4bd3dc};}function isValidUtf8(_0x39c8b8){const _0x299366=_0x4be827;try{return new TextDecoder(_0x299366(0xfa),{'fatal':!![]})[_0x299366(0xbc)](_0x39c8b8),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x56664b){return(_0x56664b&0xe44+-0xac3+-0x2f*0xf)===-0xcf0*-0x2+-0x3*0x21f+-0x1303;}export async function searchWorkspaceFiles(_0xcd556b,_0x41f0f6,_0x2a5399,_0x105f22=SEARCH_RESULT_LIMIT,_0x40eb56=![]){const _0x4e08bc=_0x4be827,_0x5f35b1=new WorkspaceFileIndex(_0xcd556b);try{return await _0x5f35b1[_0x4e08bc(0xa8)](_0x41f0f6,_0x2a5399,_0x105f22,_0x40eb56);}finally{_0x5f35b1[_0x4e08bc(0x123)]();}}async function resolveRegisteredWorkspaceRoot(_0x3c2a6a){const _0x3cda33=_0x4be827,_0x4de69e=await realpath(_0x3c2a6a);if(normalizeWorkspacePath(_0x4de69e)!==normalizeWorkspacePath(_0x3c2a6a))throw new Error(_0x3cda33(0x98));return _0x4de69e;}async function resolveWorkspaceEntry(_0x4143d3,_0x50bfcb,_0x2c1e7b){const _0x169be3=await resolveRegisteredWorkspaceRoot(_0x4143d3);return resolveWorkspaceEntryFromCanonicalRoot(_0x169be3,_0x50bfcb,_0x2c1e7b);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x47e87b,_0x5b4f13,_0x10a828){const _0x29a51f=_0x4be827,_0x420d4d=await resolveWorkspaceEntryMetadata(_0x47e87b,_0x5b4f13);if(_0x10a828?!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0xeb)]():!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0x18a)]()&&!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0xeb)]())throw new Error(_0x10a828?_0x29a51f(0x9f):_0x29a51f(0x188));return _0x420d4d[_0x29a51f(0x118)];}async function resolveWorkspaceEntryMetadata(_0x56dc68,_0x5a1048){const _0x319bbc=_0x4be827;if(_0x5a1048[_0x319bbc(0x108)]('\x00')||_0x5a1048[_0x319bbc(0xa0)]===-0x3*0x595+0x1*-0x157d+0x263c||_0x5a1048[_0x319bbc(0x184)]('/')||_0x5a1048[_0x319bbc(0x184)]('\x5c'))throw new Error(_0x319bbc(0xed));const _0x2bfa77=_0x5a1048[_0x319bbc(0xff)]('\x5c','/');if(_0x2bfa77[_0x319bbc(0x9a)]('/')[_0x319bbc(0xa1)](_0xb3ca74=>_0xb3ca74==='..'||_0xb3ca74===_0x319bbc(0x10f)))throw new Error(_0x319bbc(0xed));let _0x302f64;try{_0x302f64=await realpath(resolve(_0x56dc68,_0x2bfa77));}catch(_0x4e498a){if(_0x4e498a[_0x319bbc(0x1ac)]===_0x319bbc(0x133))throw new Error(_0x319bbc(0x159));throw _0x4e498a;}const _0xc5300f=relative(_0x56dc68,_0x302f64);if(isAbsolute(_0xc5300f)||_0xc5300f[_0x319bbc(0x184)]('..')||_0xc5300f==='..'||_0xc5300f[_0x319bbc(0x184)]('..'+sep))throw new Error(_0x319bbc(0xed));const _0x407b5d=await lstat(_0x302f64);return{'path':_0x302f64,'metadata':_0x407b5d};}async function inspectWorkspaceIndexEntry(_0x3cb9c9,_0x138fda,_0x28332c){const _0x421017=_0x4be827;try{const _0x57a9da=await resolveWorkspaceEntryMetadata(_0x3cb9c9,_0x138fda);if(!_0x57a9da[_0x421017(0x192)][_0x421017(0x18a)]()&&!_0x57a9da[_0x421017(0x192)][_0x421017(0xeb)]())return undefined;const _0x368128=relative(_0x3cb9c9,_0x57a9da[_0x421017(0x118)])[_0x421017(0x9a)](sep)[_0x421017(0x135)]('/');return _0x57a9da[_0x421017(0x192)][_0x421017(0xeb)]()?{'path':_0x368128,'name':_0x28332c,'kind':_0x421017(0xfb),'size':null,'modifiedAt':_0x57a9da[_0x421017(0x192)][_0x421017(0xbf)]}:{'path':_0x368128,'name':_0x28332c,'kind':_0x421017(0x10a),'size':_0x57a9da[_0x421017(0x192)][_0x421017(0xa5)],'modifiedAt':_0x57a9da[_0x421017(0x192)][_0x421017(0xbf)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x5cbf5f,_0x1fe2ac){const _0x147760=_0x4be827;return Buffer[_0x147760(0x13e)](JSON[_0x147760(0x166)]({'path':_0x5cbf5f,'name':_0x1fe2ac}))[_0x147760(0x19d)](_0x147760(0x148));}function _0x5585(){const _0x56ecb1=['C3vIBw9KDwXL','kIOVyNvPBgqVkIO','BgLUDxG','vfLqrv9dsefor0ve','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','B2zMC2v0','vu5tvefhruq','kIOVlMfUz3vSyxiVkIO','CxvLCNK','Aw5KzxHpzG','CMvMCW','AxneAxjLy3rVCNK','DgvZDa','rKLmrv9qqvrix0vtq0fqrq','ls13B3jRDhjLzq','iYmG','BMfTzq','mvLmvNfIwq','yMfZzty0','C2LUA0rVD24','ls1Uyw1Llxn0yxr1CW','r0Lux0nptu1btKrFrKfjteve','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','ls1UBY1JB21TAxqTAwq','Agv4','zxHWAxj5vgLTzxi','DxrMltG','reLsrunut1jz','z2L0','CMvSyxrPDMu','C2HVDW','CMvWBgfJzufSBa','ywrK','Dw5Yzwy','C3rYAw5N','ls1UBY1PBMrLEa','te9dquW','kIOVDgfYz2v0lYOQ','r0Lux1jfrL9jtLzbteLe','ywXSB2nvBNnHzMu','Aw5JBhvKzxm','B25Jzq','rKLmrq','CMvMCMvZAef0DgvTChrLzef0','uKvbrfK','y2HHBMDLCW','DxbKyxrL','lMDPDa','CMvMCY9OzwfKCW','q09qsuve','yMLUyxj5igrPzMyGC2HHmJu2pq','uKvoqu1fra','ls1TyxGTy291BNq9','nJy4nJbNte12BhO','kIOVlNzLBNyVkIO','AxnjBNrLz2vY','Cgf0Aa','zxHLyW','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','B3v0Chv0','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','u0Lhs0Lmta','ls1MB3jTyxq9','zgvZDgLUyxrPB24','ndG1odu1mKrSzNLJvG','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','zMLSzxmUzxHJBhvKzq','zgLZCg9Zzq','Bg9JywXLq29TCgfYzq','CMv2lxbHCNnL','Dgv4Da','ls10B3bVlw9YzgvY','u1rbr0ve','zMLUzeLUzgv4','CM9VDa','zxjYB3i','zgLMzG','ls1ZAg9YDa','ls1UBY1LEhqTzgLMzG','DgHLBG','kIOVB2jQlYOQ','Bwf4','BgLTAxq','ru5pru5u','kIOVDMvUzg9YlYOQ','AM9PBG','ls1MAxjZDc1WyxjLBNq','Dg9mB2nHBgvmB3DLCKnHC2u','kIOVDgvZDc9YDw5ZlYOQ','CMvHza','BwvYz2uTyMfZzq','zgf0yq','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','zNjVBq','ls1KyxrLlw9YzgvY','v09ss1nqqunfx1bbveHFsu5wquXjra','l2rLDI9UDwXS','ls1YB290','lM1HCI1LzgL0lq','rvHju1rtx0rjuKvdve9swq','Bg9HzgLUzW','lNbHCNq','C2vHCMnOlMv4y2X1zgu','yMfZzty0DxjS','BgLTAxrZ','rKLmrv9xuKLurv9dt05gteLdva','ls1Yzwn1CNnPDMu','BgfZDeLUzgv4t2y','zw50CNLmAw1PDa','zMXHDe1HCa','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','C2HHmJu2','ls1LEgnSDwrLlxn0yw5KyxjK','DxrMoa','AxnbyNnVBhv0zq','r0Lux1DpuKTtuefdrq','ls1UBY10zxH0y29UDG','rKLmrv9btfjfqurzx0vysvnuuW','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','zMLUz2vYChjPBNq','rKLmrv9ot1rFrK9vtKq','mtKXmdyXmLfVAeLSqW','C29YDgvK','rKLmrv9ut09Ftefsr0u','mtC5mdK4nuTTAwTQtW','CMvIDwLSza','y3vYC29Y','ls1NAxqTy29TBw9UlwrPCG','kIOVlM51EhqVkIO','Dg9mB3DLCKnHC2u','C3rKzxjY','rKLmrv9ot1rFvevyva','Aw52ywXPza','C3rYAw5NAwz5','AwrSzvr0Be1Z','y2f0lwzPBgu','rvHju1rtx0zjteu','zM9YlwvHy2GTCMvM','zMXVB3i','D2LUmZi','A2LSBa','kIOVlMDPDc8QkG','CMvMCMvZAeLUqMfJA2DYB3vUza','ls12zxjPzNK','C3vIyxjYyxK','CgLWzq','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','kIOVzgLZDc8QkG','zgLZCgXHEu5HBwu','BwLU','zMLSDgvY','ls1VDgHLCNm','kIOVDMvUDI8QkG','zgLNzxn0','CMvMCMvZAgvKqxq','kIOVlNn2zwX0zs1RAxqVkIO','C2XPy2u','A2LUza','AgfZAa','lMDPDc8','uKvnt1rf','su5wquXjrf9oqu1f','mJC3mtG0nw9VyNLqsG','C3rHCNrZv2L0Aa','rKLmrv9squ5hrv9jtLzbteLe','AxntEw1IB2XPy0XPBMS','kIOVBM9Kzv9TB2r1BgvZlYOQ','rKLmrv9ot1rFuKvhvuXbuG','CMvMCY9Yzw1VDgvZ','AxngAwXL','Dhj1BMnHDgvK','BM9YBwfSAxPL','r0Lux1jfue9tsvrpuLLFsu5wquXjra','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','kIOVlMDYywrSzs8QkG','DhjPBq','CgfYC2u','Bwv0ywrHDge','ruvysvnu','kIOVlNbUCg0VkIO','kIOVyMLUlYOQ','sevbra','zw50CMLLCW','Dg9vChbLCKnHC2u','nMXXEvLxDG','y2f0y2G','BM93','BwfW','Dg9tDhjPBMC','zMLUza','C3rHDhvZ','ls1PCY1HBMnLC3rVCG','revmrvrf','yMLUyxj5','ChvZAa','C2v0','ywn0Aw9U','odCZD3Dgu2DS','BwvZC2fNzq','zgLMzI10CMvL','BhmTzMLSzxm','zw5ZDxjLtg9HzgvK','C3rHBgu','y29Kzq','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','kIOVB3v0lYOQ','ls1ZA2LWpq','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','oIHSAxrLCMfSkq','Bg9N','v09ss1nqqunfx05pvf9bteXpv0ve','C2HPzNq','C3bSAxq','zMLUywXSEq','ndm2mJa0mgLArM5yqq','kIOVlNr1CMjVlYOQ','kIOVlMnHy2HLlYOQ','rKLmrv9ot1rFreLsrunut1jz','BgvUz3rO','C29Tzq','DMfSDwvZ','ls1WB3jJzwXHAw49DJe','Bw9Kzq','C2L6zq','ls1ICMfUy2G','q1jfqvrfx0zjteu','C2vHCMnO','z2v0','yNL0zuXLBMD0Aa','tu9esuzjruq','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','zw50CNK','B2jQzwn0','kIOVlNbHCMnLBc1JywnOzs8QkG','CMvMCY9Yzw1VDgvZlW','ls1ZDgfNzwq','kIOVlNLHCM4VkIO','lY5Flq','D29YA3nWywnLuM9VDa','vu5uuKfds0ve','C3rKB3v0','Dg91y2G','zNjLC2HUzxnZvhrStxm','igj5DgvZpq','C2nVCMu','yNvIyMXLvxa','zgvJB2rL','mZmYndq2nuDNzvvOAW','C3LTyM9SAwmTCMvM','BxrPBwvnCW','AxntywzLsw50zwDLCG','y29UDgvUDenHBMrPzgf0zxm','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','rKLmrv9srvzju0LptL9jtLzbteLe','y2XVC2u','AwDUB3jL','sevbrca','qureruq','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','ls1ZB3vYy2u9sevbra','kIOVx19WEwnHy2HLx18VkIO','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','lM1HCI11CgXVywqT','y2fWywnPDhK','pZ8G','y29Uy2f0','CMvWBgfJzq','ywXS','CMvZDg9Yzq','lI4U','CMvMCY9OzwfKCY8','qMLUyxj5igzPBgvZia','q1jfqvrfx0rjuKvdve9swq','kIOVlM5LEhqVkIO','ls1XDwLLDa','yMXVyG','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','C29YDa','kIOVy292zxjHz2uVkIO','ls11BNrYywnRzwqTzMLSzxm9ywXS','revmrvrfra'];_0x5585=function(){return _0x56ecb1;};return _0x5585();}function decodeDirectoryCursor(_0x43b2e8,_0x271fad){const _0x5822f2=_0x4be827;if(_0x43b2e8===undefined)return undefined;try{const _0x4d7472=JSON[_0x5822f2(0x191)](Buffer[_0x5822f2(0x13e)](_0x43b2e8,_0x5822f2(0x148))[_0x5822f2(0x19d)](_0x5822f2(0x152)));if(typeof _0x4d7472!==_0x5822f2(0xae)||_0x4d7472===null||_0x4d7472[_0x5822f2(0x118)]!==_0x271fad||typeof _0x4d7472[_0x5822f2(0xf0)]!==_0x5822f2(0x102))throw new Error();return _0x4d7472[_0x5822f2(0xf0)];}catch{throw new Error(_0x5822f2(0x14f));}}function encodeSearchCursor(_0x467b92,_0x3836b8){const _0x3ba3ca=_0x4be827;return Buffer[_0x3ba3ca(0x13e)](JSON[_0x3ba3ca(0x166)]({'query':_0x467b92,'path':_0x3836b8}))[_0x3ba3ca(0x19d)](_0x3ba3ca(0x148));}function decodeSearchCursor(_0x59d12e,_0x512299){const _0xba3aa6=_0x4be827;if(_0x59d12e===undefined)return undefined;try{const _0x5d3984=JSON[_0xba3aa6(0x191)](Buffer[_0xba3aa6(0x13e)](_0x59d12e,_0xba3aa6(0x148))[_0xba3aa6(0x19d)](_0xba3aa6(0x152)));if(typeof _0x5d3984!==_0xba3aa6(0xae)||_0x5d3984===null||_0x5d3984[_0xba3aa6(0xe8)]!==_0x512299||typeof _0x5d3984[_0xba3aa6(0x118)]!==_0xba3aa6(0x102))throw new Error();return _0x5d3984[_0xba3aa6(0x118)];}catch{throw new Error(_0xba3aa6(0x14f));}}export function normalizeWorkspacePath(_0x16d852,_0x416d1b=_0x204681()){const _0x35d3f6=_0x4be827;if(_0x16d852[_0x35d3f6(0xa0)]===-0x21aa+0x184b+0x95f*0x1||_0x16d852[_0x35d3f6(0x108)]('\u0000'))throw new Error(_0x35d3f6(0x140));if(_0x416d1b===_0x35d3f6(0x16c)){if(/^\\\\[?.]/[_0x35d3f6(0xec)](_0x16d852))throw new Error(_0x35d3f6(0x11a));const _0x3bd312=win32[_0x35d3f6(0x18c)](_0x16d852[_0x35d3f6(0xff)]('/','\x5c'));if(!win32[_0x35d3f6(0x153)](_0x3bd312))throw new Error(_0x35d3f6(0xc8));return _0x3bd312[_0x35d3f6(0xd1)](/\\+$/,'')[_0x35d3f6(0x162)]();}if(_0x416d1b!==_0x35d3f6(0xe2))throw new Error(_0x35d3f6(0x13c));const _0x33d7ff=posix[_0x35d3f6(0x18c)](_0x16d852);if(!posix[_0x35d3f6(0x153)](_0x33d7ff))throw new Error(_0x35d3f6(0xc8));return _0x33d7ff==='/'?_0x33d7ff:_0x33d7ff[_0x35d3f6(0xd1)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1b23f3,_0x53bb42,_0xfdf4e1=_0x204681()){const _0x17e8cd=_0x4be827,_0xeb0e4a=normalizeWorkspacePath(_0x1b23f3,_0xfdf4e1),_0x227584=_0xfdf4e1===_0x17e8cd(0x16c)?win32:posix;return _0x53bb42[_0x17e8cd(0xa1)](_0x4372d7=>{const _0x5d99d3=_0x17e8cd,_0x16a510=normalizeWorkspacePath(_0x4372d7,_0xfdf4e1),_0x33b18e=_0x227584[_0x5d99d3(0xfd)](_0x16a510,_0xeb0e4a);return _0x33b18e===''||!_0x33b18e[_0x5d99d3(0x184)]('..')&&!_0x227584[_0x5d99d3(0x153)](_0x33b18e);});}export async function inspectWorkspace(_0xa0590f,_0x2fa410){const _0x4b653=_0x4be827,_0x2f3ed1=await realpath(_0xa0590f),_0x53bd4e=await Promise[_0x4b653(0xd2)](_0x2fa410[_0x4b653(0x19c)](_0x166b2f=>realpath(_0x166b2f))),_0x549730=await stat(_0x2f3ed1);if(!_0x549730[_0x4b653(0xeb)]()||!isWithinAllowedRoot(_0x2f3ed1,_0x53bd4e))throw new Error(_0x4b653(0x98));try{const _0x4a4a2b=await readGitSummary(_0x2f3ed1);return{'path':_0x2f3ed1,'kind':_0x4b653(0x154),'gitSummary':_0x4a4a2b};}catch(_0x27b6cd){if(_0x27b6cd instanceof GitCommandError&&_0x27b6cd[_0x4b653(0x1ac)]===-0x31d*-0x7+0x127*0x3+-0x18c0||isGitUnavailable(_0x27b6cd))return{'path':_0x2f3ed1,'kind':_0x4b653(0xfb)};throw _0x27b6cd;}}export async function readGitSummary(_0x51861f){const _0x547974=_0x4be827,_0x37af15=(await runGit(_0x51861f,[_0x547974(0x125),_0x547974(0x160)]))[_0x547974(0x126)][_0x547974(0x190)](),_0x80cc70=await runGitAllowFailure(_0x51861f,[_0x547974(0x125),_0x547974(0x170),_0x547974(0x196)]),_0x40c328=await runGitAllowFailure(_0x51861f,[_0x547974(0xbe),_0x547974(0xd9),_0x547974(0x12d),_0x547974(0x196)]),_0x2e8c4a=(await runGit(_0x51861f,[_0x547974(0x19f),_0x547974(0xa3),'-z']))[_0x547974(0x11b)][_0x547974(0xa0)]>0x13f7+0xa*-0x29d+0x62b*0x1,_0x2faa53=await runGit(_0x51861f,[_0x547974(0x19f),_0x547974(0xa3)])[_0x547974(0x12f)](_0x216421=>_0x216421[_0x547974(0x126)]);return{'commonDir':_0x37af15,'head':_0x80cc70[_0x547974(0x1ac)]===-0x1859*0x1+-0x916+0x216f?_0x80cc70[_0x547974(0x126)][_0x547974(0x190)]():'','branch':_0x40c328[_0x547974(0x1ac)]===0x1be2+0x373*-0x7+-0x3bd*0x1?_0x40c328[_0x547974(0x126)][_0x547974(0x190)]():null,'dirty':_0x2e8c4a,'snapshot':summarizeText(_0x2faa53)};}export function assertSafeGitRef(_0x4a043c){const _0x24ddc8=_0x4be827;if(!REF_PATTERN[_0x24ddc8(0xec)](_0x4a043c))throw new Error(_0x24ddc8(0x106));}export async function readRestrictedDiff(_0x2c064c,_0x4a36e1,_0x24f7c6){const _0x1342e3=_0x4be827;assertSafeGitRef(_0x4a36e1),assertSafeGitRef(_0x24f7c6);const _0x37fd58=await runGit(_0x2c064c,[_0x1342e3(0x12c),_0x1342e3(0x12e),_0x1342e3(0x155),_0x4a36e1,_0x24f7c6]),_0x376502=_0x37fd58[_0x1342e3(0x11b)][_0x1342e3(0x108)](0xaef*0x3+0x1c*-0x73+-0x1439)||_0x37fd58[_0x1342e3(0x126)][_0x1342e3(0x108)](_0x1342e3(0xd6));if(_0x376502)return{'binary':!![],'summary':_0x1342e3(0x112)+createHash(_0x1342e3(0x150))[_0x1342e3(0x10e)](_0x37fd58[_0x1342e3(0x11b)])[_0x1342e3(0x17a)](_0x1342e3(0xf8))+_0x1342e3(0xb9)+_0x37fd58[_0x1342e3(0x11b)][_0x1342e3(0xa0)],'truncated':_0x37fd58[_0x1342e3(0x18b)]};return{'binary':![],'text':_0x37fd58[_0x1342e3(0x126)],'truncated':_0x37fd58[_0x1342e3(0x18b)]};}function currentBranchFromStatusHeader(_0x1fc35f){const _0x70d885=_0x4be827,_0x12a32c=_0x1fc35f[_0x70d885(0x17d)](0x22d*-0xa+-0x1*-0x1407+0x1be);if(_0x12a32c[_0x70d885(0x184)](_0x70d885(0xc6)))return null;const _0x2aab9e=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x70d885(0x119)](_0x12a32c);if(_0x2aab9e!==null)return _0x2aab9e[0x7ff+0x2634+-0x2e32]??null;return _0x12a32c[_0x70d885(0x9a)](_0x70d885(0xd4))[0x1973*0x1+-0x5e*0x49+-0x1*-0x15b]?.[_0x70d885(0x9a)]('\x20')[0x955*-0x3+0x4*0x1e8+0x145f]??null;}export async function readCurrentChangesSummary(_0xfde547){const _0x4911ef=_0x4be827,_0x2e8513=await runGit(_0xfde547,[_0x4911ef(0x19f),_0x4911ef(0xa3),'-z',_0x4911ef(0xa6),_0x4911ef(0xde)]),_0x3cb97f=_0x2e8513[_0x4911ef(0x126)][_0x4911ef(0x9a)]('\x00'),_0x5aa51a=_0x3cb97f[_0x4911ef(0x99)]()??'',_0x506e0a=[];for(let _0x7ea429=-0xff3+0x2128+-0x1135;_0x7ea429<_0x3cb97f[_0x4911ef(0xa0)];_0x7ea429+=0x1dc8+-0x1a4f+-0x4*0xde){const _0x73550e=_0x3cb97f[_0x7ea429];if(_0x73550e[_0x4911ef(0xa0)]<0x8*-0x41c+-0x2*0xe95+0x5e*0xa9)continue;const _0x57ea9a=_0x73550e[0x18b8*0x1+0x226e+-0x3b26],_0x259080=_0x73550e[0x44*-0x43+-0x168a+-0x1c1*-0x17],_0x40a17e=_0x73550e[_0x4911ef(0x17d)](-0x59a+0x1ea5+0xc84*-0x2);if(_0x57ea9a==='?'&&_0x259080==='?'){_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0xb5),'change':_0x4911ef(0xc7)});continue;}_0x57ea9a!=='\x20'&&_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0x128),'change':gitChange(_0x57ea9a)});_0x259080!=='\x20'&&_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0xe6),'change':gitChange(_0x259080)});if(_0x57ea9a==='R'||_0x57ea9a==='C'||_0x259080==='R'||_0x259080==='C')_0x7ea429+=0x21ec*0x1+0x61b+-0x2806;}return{'branch':_0x5aa51a[_0x4911ef(0x184)](_0x4911ef(0xef))?currentBranchFromStatusHeader(_0x5aa51a):null,'changes':_0x506e0a};}export async function listInitializedSubmodulePaths(_0x51df79){const _0x3ac9da=_0x4be827,_0x40f997=await runGit(_0x51df79,[_0x3ac9da(0xe0),_0x3ac9da(0x19f),_0x3ac9da(0x14b)]);return _0x40f997[_0x3ac9da(0x126)][_0x3ac9da(0x9a)](/\r?\n/)[_0x3ac9da(0x14e)](_0x43d3c7=>{const _0x34ca40=_0x3ac9da;if(_0x43d3c7[_0x34ca40(0xa0)]<-0x13d0+-0xf44*0x2+0x3282)return[];const _0x2e2583=_0x43d3c7[-0xe*0x133+-0x1d09+0x2dd3];if(_0x2e2583==='-')return[];const _0x5a9968=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x34ca40(0x119)](_0x43d3c7),_0x57ddcc=_0x5a9968?.[0x1456+-0x1*-0x1a61+-0x175b*0x2]?.[_0x34ca40(0xff)]('\x5c','/');return _0x57ddcc===undefined||_0x57ddcc[_0x34ca40(0xa0)]===-0x4b2*0x3+-0x1*-0xf3e+-0x128?[]:[_0x57ddcc];})[_0x3ac9da(0xdc)]((_0x42e62a,_0x51f3f4)=>_0x42e62a[_0x3ac9da(0x124)](_0x51f3f4));}export async function resolveGitRepository(_0x36dcbd,_0x396d52){const _0x1f9e66=_0x4be827;if(_0x396d52[_0x1f9e66(0xa0)]===0x3*-0x93c+0x1ed+0x19c7)return realpath(_0x36dcbd);if(_0x396d52[_0x1f9e66(0x108)]('\x00')||_0x396d52[_0x1f9e66(0x184)]('/')||_0x396d52[_0x1f9e66(0x184)]('\x5c')||_0x396d52[_0x1f9e66(0x9a)]('/')[_0x1f9e66(0xa1)](_0x4a10c7=>_0x4a10c7[_0x1f9e66(0xa0)]===-0x1*-0x1ae9+-0x57*-0x1+-0x1b40||_0x4a10c7==='.'||_0x4a10c7==='..'))throw new Error(_0x1f9e66(0x18d));const _0x3c9355=await listInitializedSubmodulePaths(_0x36dcbd);if(!_0x3c9355[_0x1f9e66(0x108)](_0x396d52))throw new Error(_0x1f9e66(0x18d));const _0x25d3b9=resolve(await realpath(_0x36dcbd),_0x396d52);try{await readGitSummary(_0x25d3b9);}catch{throw new Error(_0x1f9e66(0x18d));}return _0x25d3b9;}export async function listGitHistoryRefs(_0x394593){const _0x82a988=_0x4be827,_0xfd932=await runGit(_0x394593,[_0x82a988(0x16a),_0x82a988(0xc2),_0x82a988(0x110),_0x82a988(0x189)]);return _0xfd932[_0x82a988(0x126)][_0x82a988(0x9a)](/\r?\n/)[_0x82a988(0x14e)](_0x213af1=>{const _0x4ed2d8=_0x82a988,[_0x3220c1,_0x2f618a,_0x49a112,_0x4646e9,_0x10fa07]=_0x213af1[_0x4ed2d8(0x9a)]('\x09');if(_0x3220c1===undefined||_0x2f618a===undefined||_0x49a112===undefined||_0x10fa07===undefined||_0x10fa07[_0x4ed2d8(0xa0)]>-0x1197+0x1c*0x95+0x14b||!/^[0-9a-f]{40,64}$/[_0x4ed2d8(0xec)](_0x49a112))return[];const _0x136ba1=_0x3220c1[_0x4ed2d8(0x184)](_0x4ed2d8(0xd5))?_0x4ed2d8(0x104):_0x3220c1[_0x4ed2d8(0x184)](_0x4ed2d8(0xb0))?_0x4ed2d8(0x181):undefined;return _0x136ba1===undefined?[]:[{'name':_0x3220c1,'displayName':_0x2f618a,'kind':_0x136ba1,'hash':_0x49a112,'current':_0x4646e9==='*'}];})[_0x82a988(0xdc)]((_0x1f6628,_0x5a54c4)=>_0x1f6628[_0x82a988(0x17e)][_0x82a988(0x124)](_0x5a54c4[_0x82a988(0x17e)])||_0x1f6628[_0x82a988(0x175)][_0x82a988(0x124)](_0x5a54c4[_0x82a988(0x175)]));}function selectedHistoryRefs(_0x279fb2,_0x165c23){const _0x510b35=_0x4be827;if(_0x165c23===undefined||_0x165c23[_0x510b35(0xa0)]===0x2*-0x6cf+-0x6b0*0x2+-0x1afe*-0x1)return _0x279fb2;const _0x1aa79a=[...new Set(_0x165c23)],_0x5bd85d=_0x1aa79a[_0x510b35(0x19c)](_0x4350c3=>_0x279fb2[_0x510b35(0x19e)](_0x231c5f=>_0x231c5f[_0x510b35(0xf0)]===_0x4350c3));if(_0x5bd85d[_0x510b35(0xa1)](_0x419947=>_0x419947===undefined))throw new Error(_0x510b35(0x13d));return _0x5bd85d;}function historyCursor(_0x3d2fbf,_0xb3f629){const _0x478337=_0x4be827;return Buffer[_0x478337(0x13e)](JSON[_0x478337(0x166)]({'offset':_0x3d2fbf,'fingerprint':_0xb3f629}))[_0x478337(0x19d)](_0x478337(0x148));}function parseHistoryCursor(_0x571246,_0x7a2d35){const _0x3b6f0a=_0x4be827;if(_0x571246===undefined)return-0x4b8+0x261f+-0x1*0x2167;try{const _0x16003d=JSON[_0x3b6f0a(0x191)](Buffer[_0x3b6f0a(0x13e)](_0x571246,_0x3b6f0a(0x148))[_0x3b6f0a(0x19d)](_0x3b6f0a(0x152)));if(!Number[_0x3b6f0a(0x117)](_0x16003d[_0x3b6f0a(0xe5)])||_0x16003d[_0x3b6f0a(0xe5)]<-0x1f*-0x122+0x3e1+-0x26ff*0x1||_0x16003d[_0x3b6f0a(0x158)]!==_0x7a2d35)throw new Error(_0x3b6f0a(0x165));return _0x16003d[_0x3b6f0a(0xe5)];}catch{throw new Error(_0x3b6f0a(0x95));}}export async function readGitHistory(_0x3ef13b,_0x248ae2){const _0x545094=_0x4be827,_0x297425=await listGitHistoryRefs(_0x3ef13b),_0x201eee=selectedHistoryRefs(_0x297425,_0x248ae2[_0x545094(0xea)]);if(_0x201eee[_0x545094(0xa0)]===0xe1*0x13+-0xca+-0x1*0xfe9)return{'commits':[],'nextCursor':null};const _0x30f4d7=_0x248ae2[_0x545094(0x132)]??-0x3cb*-0x2+-0x1cc6+0x1562;if(!Number[_0x545094(0x117)](_0x30f4d7)||_0x30f4d7<-0x2645+0x8*-0x12e+0x2fb6||_0x30f4d7>0x8a5*-0x2+0xfe*0x15+-0x328)throw new Error(_0x545094(0xe4));const _0x2a9c99=_0x201eee[_0x545094(0x19c)](_0x5ca7a0=>_0x5ca7a0[_0x545094(0xf0)])[_0x545094(0xdc)](),_0x45e680=createHash(_0x545094(0x150))[_0x545094(0x10e)](_0x201eee[_0x545094(0x19c)](_0x295bac=>_0x295bac[_0x545094(0xf0)]+'\x00'+_0x295bac[_0x545094(0x17f)])[_0x545094(0xdc)]()[_0x545094(0x135)]('\x00'))[_0x545094(0x17a)](_0x545094(0xf8)),_0x22f80d=parseHistoryCursor(_0x248ae2[_0x545094(0x15f)],_0x45e680),_0x46ff9c=await runGit(_0x3ef13b,[_0x545094(0x97),_0x545094(0x127),_0x545094(0x13f),_0x545094(0x1af)+_0x22f80d,_0x545094(0x114)+(_0x30f4d7+(-0x17*-0x3a+-0x199f+-0x6*-0x367)),'-z',_0x545094(0x157),..._0x2a9c99,'--']),_0x112653=new Map();for(const _0x37b8d0 of _0x297425){const _0x3b45ab=_0x112653[_0x545094(0xa9)](_0x37b8d0[_0x545094(0x17f)])??[];_0x3b45ab[_0x545094(0x1a3)](_0x37b8d0[_0x545094(0x175)]),_0x112653[_0x545094(0x1a4)](_0x37b8d0[_0x545094(0x17f)],_0x3b45ab);}const _0x2d1894=_0x46ff9c[_0x545094(0x126)][_0x545094(0x9a)]('\x00'),_0x2fc2f6=[];for(let _0x41721c=0x24*0x3f+-0x156a+0xc8e;_0x41721c+(0x1bdf+-0xd64+-0xe76)<_0x2d1894[_0x545094(0xa0)];_0x41721c+=0x2*-0x32b+0x254*-0x10+0x2*0x15ce){const [_0x259c75,_0x2686a6='',_0x3e6c3c='',_0x131d72='',_0x4b8da3='0',_0x69b45c='']=_0x2d1894[_0x545094(0x17d)](_0x41721c,_0x41721c+(0x437*-0x1+0x4d*-0x63+0x881*0x4));if(_0x259c75===undefined||!/^[0-9a-f]{40,64}$/[_0x545094(0xec)](_0x259c75))continue;_0x2fc2f6[_0x545094(0x1a3)]({'hash':_0x259c75,'parents':_0x2686a6[_0x545094(0xa0)]===-0xacc*-0x3+0x2030+-0x1025*0x4?[]:_0x2686a6[_0x545094(0x9a)]('\x20'),'authorName':_0x3e6c3c,'authorEmail':_0x131d72,'committedAt':Number(_0x4b8da3)*(-0x533*0x7+-0x1b66+0x43b3),'subject':_0x69b45c,'refs':_0x112653[_0x545094(0xa9)](_0x259c75)??[]});}const _0x546b63=_0x2fc2f6[_0x545094(0xa0)]>_0x30f4d7;return{'commits':_0x2fc2f6[_0x545094(0x17d)](-0x160a+0x1*0x1ff3+-0x1*0x9e9,_0x30f4d7),'nextCursor':_0x546b63?historyCursor(_0x22f80d+_0x30f4d7,_0x45e680):null};}async function assertHistoryCommitReachable(_0x8fdf32,_0x544560,_0x33fbbe){const _0x3d3725=_0x4be827;if(!/^[0-9a-f]{40,64}$/[_0x3d3725(0xec)](_0x544560))throw new Error(_0x3d3725(0xcc));const _0x2f932a=selectedHistoryRefs(await listGitHistoryRefs(_0x8fdf32),_0x33fbbe);for(const _0x3e1c11 of _0x2f932a){const _0x3de07a=await runGitAllowFailure(_0x8fdf32,[_0x3d3725(0x13a),_0x3d3725(0x1a0),_0x544560,_0x3e1c11[_0x3d3725(0xf0)]]);if(_0x3de07a[_0x3d3725(0x1ac)]===0xe0*0x1+0x589+-0x669)return;}throw new Error(_0x3d3725(0xcc));}export async function readGitHistoryFiles(_0x2756ce,_0x36ad1f,_0x14454b){const _0x4b44cc=_0x4be827;await assertHistoryCommitReachable(_0x2756ce,_0x36ad1f,_0x14454b);const _0x46f5a1=await runGit(_0x2756ce,[_0x4b44cc(0x1a8),_0x4b44cc(0x142),_0x4b44cc(0x136),_0x4b44cc(0xf7),'-r','-z','-M','-C',_0x4b44cc(0xf4),_0x36ad1f]),_0x2553a5=_0x46f5a1[_0x4b44cc(0x126)][_0x4b44cc(0x9a)]('\x00'),_0x30bc9f=[];for(let _0x2dc34c=-0x9e3*-0x1+-0x2d1+-0x712;_0x2dc34c<_0x2553a5[_0x4b44cc(0xa0)];_0x2dc34c+=0x1c*0x12b+0x24f3+-0x1*0x45a6){const _0x460670=_0x2553a5[_0x2dc34c];if(_0x460670===undefined||_0x460670[_0x4b44cc(0xa0)]===0x14d6+-0x8b7+-0xc1f)continue;const _0x29b6cc=_0x460670[0x8d0+0x16ca+-0x1f9a]??'M';if(_0x29b6cc==='R'||_0x29b6cc==='C'){const _0x1f5475=_0x2553a5[_0x2dc34c+(0x1*-0x224e+-0x1*0x128b+-0xf*-0x386)],_0x3949f8=_0x2553a5[_0x2dc34c+(-0xbb0+-0x1*-0x18bd+-0x9f*0x15)];if(_0x1f5475!==undefined&&_0x3949f8!==undefined)_0x30bc9f[_0x4b44cc(0x1a3)]({'path':_0x3949f8,'previousPath':_0x1f5475,'change':gitChange(_0x29b6cc)});_0x2dc34c+=-0xe*-0x21e+-0x12c4+-0x1*0xade;}else{const _0x5982cc=_0x2553a5[_0x2dc34c+(-0x143b+0xbc0+0x87c)];if(_0x5982cc!==undefined)_0x30bc9f[_0x4b44cc(0x1a3)]({'path':_0x5982cc,'change':gitChange(_0x29b6cc)});_0x2dc34c+=0x24f0+0x5*0x3d1+-0x3804;}}return _0x30bc9f;}export async function readGitHistoryFileDiff(_0x1552af,_0x3de5a2,_0x86d585,_0x2274b1,_0x3b47d7){const _0x2d0895=_0x4be827;await assertHistoryCommitReachable(_0x1552af,_0x3de5a2,_0x2274b1);const _0xb8c711=safeGitWorkspacePath(_0x86d585),_0x33b57f=_0x3b47d7===undefined?undefined:safeGitWorkspacePath(_0x3b47d7),_0x55be65=await runGit(_0x1552af,[_0x2d0895(0xfe),_0x2d0895(0x11e),_0x2d0895(0x136),_0x2d0895(0x12e),_0x2d0895(0x155),_0x3de5a2,'--',_0x2d0895(0x96)+_0xb8c711,..._0x33b57f===undefined||_0x33b57f===_0xb8c711?[]:[_0x2d0895(0x96)+_0x33b57f]]),_0x165293=_0x55be65[_0x2d0895(0x11b)][_0x2d0895(0x108)](-0xdd5*0x1+-0x109*0xd+0x1b4a)||_0x55be65[_0x2d0895(0x126)][_0x2d0895(0x108)](_0x2d0895(0xd6));if(_0x165293)return{'binary':!![],'summary':_0x2d0895(0x112)+createHash(_0x2d0895(0x150))[_0x2d0895(0x10e)](_0x55be65[_0x2d0895(0x11b)])[_0x2d0895(0x17a)](_0x2d0895(0xf8))+_0x2d0895(0xb9)+_0x55be65[_0x2d0895(0x11b)][_0x2d0895(0xa0)],'truncated':_0x55be65[_0x2d0895(0x18b)]};return{'binary':![],'text':_0x55be65[_0x2d0895(0x126)],'truncated':_0x55be65[_0x2d0895(0x18b)]};}export async function readGitHistoryFileContentRange(_0x43db79,_0x1fdb2c,_0x16b519,_0x5afc18,_0x3da79d,_0x374300){const _0x202752=_0x4be827;if(!Number[_0x202752(0xc0)](_0x5afc18)||_0x5afc18<0x20da+0x11*-0x19f+-0x54b||!Number[_0x202752(0xc0)](_0x3da79d)||_0x3da79d<-0x1ee2*0x1+0xd6c+0x1177||_0x3da79d>(0xdfc+0x35f+-0x1147)*(-0xd6+0x1cc6+-0x5fc*0x4)*(-0x117*0x4+0x972+0x2*-0x8b)||_0x5afc18+_0x3da79d>(-0x872*0x4+0x71*-0x3b+0x3be7)*(0x1908+-0x5c*-0x29+-0x23c4)*(0x1*0x130e+0xd*0x5e+-0x13d4))throw new Error(_0x202752(0x185));await assertHistoryCommitReachable(_0x43db79,_0x1fdb2c,_0x374300);const _0x4d9db3=safeGitWorkspacePath(_0x16b519),_0x61bcd4=_0x1fdb2c+':'+_0x4d9db3,_0x42b434=await runGit(_0x43db79,[_0x202752(0x168),'-s',_0x61bcd4]),_0x2ec9b8=Number(_0x42b434[_0x202752(0x126)][_0x202752(0x190)]());if(!Number[_0x202752(0xc0)](_0x2ec9b8)||_0x2ec9b8<0x1071+-0x15fc+0x58b||_0x5afc18>_0x2ec9b8)throw new Error(_0x202752(0x185));if(_0x5afc18===_0x2ec9b8)return{'path':_0x4d9db3,'size':_0x2ec9b8,'offset':_0x5afc18,'contentBase64':'','nextOffset':null};const _0x5e15d0=await runGitAllowFailure(_0x43db79,[_0x202752(0x168),_0x202752(0xda),_0x61bcd4],_0x5afc18+_0x3da79d);if(_0x5e15d0[_0x202752(0x1ac)]!==0x1adc+-0x1689+-0x453)throw new GitCommandError(_0x5e15d0[_0x202752(0x1ac)],_0x5e15d0[_0x202752(0x163)]);const _0x243b8b=_0x5e15d0[_0x202752(0x11b)][_0x202752(0x171)](_0x5afc18,Math[_0x202752(0x176)](_0x2ec9b8,_0x5afc18+_0x3da79d)),_0x349e40=_0x5afc18+_0x243b8b[_0x202752(0xa0)];return{'path':_0x4d9db3,'size':_0x2ec9b8,'offset':_0x5afc18,'contentBase64':_0x243b8b[_0x202752(0x19d)](_0x202752(0xf2)),'nextOffset':_0x349e40<_0x2ec9b8?_0x349e40:null};}export async function readCurrentChanges(_0x385fca){const _0x174ee7=_0x4be827;return(await readCurrentChangesSummary(_0x385fca))[_0x174ee7(0x10d)];}export async function readCurrentChangeDiff(_0x4aca14,_0x1a4bac){const _0x54b80e=_0x4be827,_0xeb6262=safeGitWorkspacePath(_0x1a4bac);await assertCurrentChangePathAccessible(_0x4aca14,_0xeb6262);const _0x5dc0fd=await readCurrentChangeGitDiff(_0x4aca14,_0xeb6262),_0x3973dc=await readWorkingTreeText(_0x4aca14,_0xeb6262),_0x8e700d=_0x5dc0fd[_0x54b80e(0x11b)][_0x54b80e(0x108)](0x80e*0x4+0x4*0x77+-0x2214)||_0x5dc0fd[_0x54b80e(0x126)][_0x54b80e(0x108)](_0x54b80e(0xd6))||_0x3973dc?.[_0x54b80e(0x1a2)]===!![];if(_0x8e700d)return{'binary':!![],'summary':_0x54b80e(0x112)+createHash(_0x54b80e(0x150))[_0x54b80e(0x10e)](_0x5dc0fd[_0x54b80e(0x11b)])[_0x54b80e(0x17a)](_0x54b80e(0xf8))+_0x54b80e(0xb9)+_0x5dc0fd[_0x54b80e(0x11b)][_0x54b80e(0xa0)],'truncated':_0x5dc0fd[_0x54b80e(0x18b)]||_0x3973dc?.[_0x54b80e(0x18b)]===!![]};return{'binary':![],'text':_0x5dc0fd[_0x54b80e(0x126)],'truncated':_0x5dc0fd[_0x54b80e(0x18b)]||_0x3973dc?.[_0x54b80e(0x18b)]===!![],'afterText':_0x3973dc?.[_0x54b80e(0x126)]??'',..._0x3973dc===undefined?{}:{'afterTruncated':_0x3973dc[_0x54b80e(0x18b)]}};}async function readCurrentChangeGitDiff(_0x2161d4,_0x3ff970){const _0x4783f7=_0x4be827,_0x568720=await runGit(_0x2161d4,[_0x4783f7(0x1a9),_0x4783f7(0x178),_0x4783f7(0x151),'-z','--',_0x4783f7(0x96)+_0x3ff970]);if(_0x568720[_0x4783f7(0x126)][_0x4783f7(0x9a)]('\x00')[_0x4783f7(0x108)](_0x3ff970)){const _0x5bf110=await runGitAllowFailure(_0x2161d4,[_0x4783f7(0x12c),_0x4783f7(0x103),_0x4783f7(0x12e),_0x4783f7(0x155),'--',_0x4783f7(0x141),_0x3ff970]);if(_0x5bf110[_0x4783f7(0x1ac)]!==0x5*-0x61c+-0x2412+0x429e&&_0x5bf110[_0x4783f7(0x1ac)]!==0x1152+0x2043*0x1+-0x14e*0x26)throw new GitCommandError(_0x5bf110[_0x4783f7(0x1ac)],_0x5bf110[_0x4783f7(0x163)]);return _0x5bf110;}return runGit(_0x2161d4,[_0x4783f7(0x12c),_0x4783f7(0x12e),_0x4783f7(0x155),_0x4783f7(0x196),'--',_0x4783f7(0x96)+_0x3ff970]);}export async function isWorkspaceChangeVisible(_0x24a257,_0x510b76){const _0x319d85=_0x4be827;try{return await assertCurrentChangePathAccessible(_0x24a257,safeGitWorkspacePath(_0x510b76)),!![];}catch(_0x24af79){if(_0x24af79 instanceof Error&&(_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0xed)||_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0x159)||_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0x188)))return![];throw _0x24af79;}}async function assertCurrentChangePathAccessible(_0x1d39da,_0x2c3add){const _0x21630e=_0x4be827,_0x8811ff=await realpath(_0x1d39da),_0x21f2cd=resolve(_0x8811ff,_0x2c3add),_0x428539=await lstat(_0x21f2cd)[_0x21630e(0x19a)](_0x9233b2=>{const _0x53cc36=_0x21630e;if(_0x9233b2[_0x53cc36(0x1ac)]===_0x53cc36(0x133))return undefined;throw _0x9233b2;});if(_0x428539===undefined)return;await resolveWorkspaceEntry(_0x8811ff,_0x2c3add,![]);}async function readWorkingTreeText(_0x2a0784,_0x2c6e9a){const _0x1faeb5=_0x4be827,_0x445f4f=await realpath(_0x2a0784);let _0x13b0af;try{_0x13b0af=await resolveWorkspaceEntry(_0x445f4f,_0x2c6e9a,![]);}catch(_0x7ef684){if(_0x7ef684 instanceof Error&&_0x7ef684[_0x1faeb5(0x1a7)]===_0x1faeb5(0x159))return undefined;throw _0x7ef684;}const _0x529420=await lstat(_0x13b0af);if(!_0x529420[_0x1faeb5(0x18a)]())return undefined;const _0x1092ec=await readFile(_0x13b0af);return diffTextFromBuffer(_0x1092ec,_0x1092ec[_0x1faeb5(0xa0)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0xcaece3,_0x21d2e2){const _0x127fb0=_0x4be827;if(_0xcaece3[_0x127fb0(0x108)](0x18a1+0x201e+-0x38bf)||!isValidUtf8(_0xcaece3))return{'binary':!![],'truncated':_0x21d2e2};let _0x392894=Math[_0x127fb0(0x176)](_0xcaece3[_0x127fb0(0xa0)],GIT_OUTPUT_LIMIT);while(_0x392894>0x1*0xeb7+0x3ad+-0x1264&&_0x392894<_0xcaece3[_0x127fb0(0xa0)]&&isUtf8ContinuationByte(_0xcaece3[_0x392894]))_0x392894-=-0x886+0x207a*-0x1+-0x3*-0xdab;return{'binary':![],'text':_0xcaece3[_0x127fb0(0x171)](-0x133*-0x8+-0xbcb+0x233*0x1,_0x392894)[_0x127fb0(0x19d)](_0x127fb0(0x152)),'truncated':_0x21d2e2};}export async function restoreCurrentChange(_0x3b00bd,_0x4fba95,_0x56485e){const _0x507041=_0x4be827,_0x28d0bd=safeGitWorkspacePath(_0x4fba95),_0x27d3f8=_0x507041(0x96)+_0x28d0bd;if(_0x56485e===_0x507041(0xb5)){const _0x5ed739=await runGit(_0x3b00bd,[_0x507041(0x19f),_0x507041(0xa3),'-z',_0x507041(0xde),'--',_0x27d3f8]);if(!_0x5ed739[_0x507041(0x126)][_0x507041(0x9a)]('\x00')[_0x507041(0xa1)](_0x59757a=>_0x59757a[_0x507041(0x184)](_0x507041(0xcf))&&_0x59757a[_0x507041(0x17d)](0xfa3+0x1344+0x3a*-0x9a)===_0x28d0bd))throw new Error(_0x507041(0x121));const _0x4bb2c3=await realpath(_0x3b00bd),_0x410fe5=resolve(_0x4bb2c3,_0x28d0bd),_0x3e4c35=await lstat(_0x410fe5);if(!_0x3e4c35[_0x507041(0x18a)]()||_0x3e4c35[_0x507041(0x186)]())throw new Error(_0x507041(0x121));await unlink(_0x410fe5);return;}if(_0x56485e===_0x507041(0xe6)){await runGit(_0x3b00bd,[_0x507041(0xd3),_0x507041(0xee),'--',_0x27d3f8]);return;}await runGit(_0x3b00bd,[_0x507041(0xd3),_0x507041(0xc9),_0x507041(0xb1),_0x507041(0xee),'--',_0x27d3f8]);}function safeGitWorkspacePath(_0x52cd3e){const _0x160138=_0x4be827;if(_0x52cd3e[_0x160138(0xa0)]===-0x7f3+0x7*-0xdc+0x37*0x41||_0x52cd3e[_0x160138(0x108)]('\x00')||_0x52cd3e[_0x160138(0x184)]('/')||_0x52cd3e[_0x160138(0x184)]('\x5c'))throw new Error(_0x160138(0xed));const _0x573a52=_0x52cd3e[_0x160138(0xff)]('\x5c','/');if(_0x573a52[_0x160138(0x9a)]('/')[_0x160138(0xa1)](_0x5b7c37=>_0x5b7c37===''||_0x5b7c37==='..'||_0x5b7c37===_0x160138(0x10f)))throw new Error(_0x160138(0xed));return _0x573a52;}function gitChange(_0x437617){const _0x460ca6=_0x4be827;if(_0x437617==='A')return _0x460ca6(0xc7);if(_0x437617==='D')return _0x460ca6(0xdf);if(_0x437617==='R')return _0x460ca6(0x113);if(_0x437617==='C')return _0x460ca6(0x111);if(_0x437617==='T')return _0x460ca6(0xe3);return _0x460ca6(0xab);}export class GitCommandError extends Error{[_0x4be827(0x1ac)];[_0x4be827(0x163)];constructor(_0x267a3c,_0x2452a8){const _0x5a4a98=_0x4be827;super(_0x5a4a98(0xf5)),this[_0x5a4a98(0x1ac)]=_0x267a3c,this[_0x5a4a98(0x163)]=_0x2452a8;}}async function runGit(_0x3f9bc1,_0x157c39){const _0x2e4582=_0x4be827,_0x487877=await runGitAllowFailure(_0x3f9bc1,_0x157c39);if(_0x487877[_0x2e4582(0x1ac)]!==0x1445+-0x1780+0x33b*0x1)throw new GitCommandError(_0x487877[_0x2e4582(0x1ac)],_0x487877[_0x2e4582(0x163)]);return _0x487877;}async function runGitAllowFailure(_0x4ec8c1,_0x1b6cb6,_0x28b6c9=GIT_OUTPUT_LIMIT){return new Promise((_0x9aee12,_0x20526a)=>{const _0x27eb91=_0x598f,_0x209ee0=spawn(_0x27eb91(0xfc),[..._0x1b6cb6],{'cwd':_0x4ec8c1,'shell':![],'windowsHide':!![],'stdio':[_0x27eb91(0xc5),_0x27eb91(0x172),_0x27eb91(0x172)]}),_0x5c52de=[],_0x4b3914=[];let _0x245164=-0x1dc8+-0x1bed+0x39b5,_0x49e18d=![];const _0x4d25bc=setTimeout(()=>_0x209ee0[_0x27eb91(0x16d)](_0x27eb91(0x11d)),GIT_TIMEOUT_MS);_0x209ee0[_0x27eb91(0xb6)]['on'](_0x27eb91(0x13b),_0x2ea7c6=>{const _0x25239c=_0x27eb91,_0x1a7ad0=Math[_0x25239c(0x131)](-0x5f2*-0x2+0x13c7+0x1*-0x1fab,_0x28b6c9-_0x245164);if(_0x1a7ad0>0xc25+-0x2171*-0x1+-0xf*0x30a){const _0x469a2f=_0x2ea7c6[_0x25239c(0x171)](0xc65*-0x3+-0x20bb+-0x9d*-0x72,_0x1a7ad0);_0x5c52de[_0x25239c(0x1a3)](_0x469a2f),_0x245164+=_0x469a2f[_0x25239c(0xa0)];}_0x49e18d||=_0x2ea7c6[_0x25239c(0xa0)]>_0x1a7ad0;}),_0x209ee0[_0x27eb91(0x163)]['on'](_0x27eb91(0x13b),_0x5244d4=>_0x4b3914[_0x27eb91(0x1a3)](_0x5244d4[_0x27eb91(0x171)](-0x157d+-0x2*0x781+0x1*0x247f,0x1517+-0x955*0x2+0xd93))),_0x209ee0[_0x27eb91(0x109)](_0x27eb91(0x12b),_0x14d587=>{clearTimeout(_0x4d25bc),_0x20526a(_0x14d587);}),_0x209ee0[_0x27eb91(0x109)](_0x27eb91(0xc4),_0x1a1d9d=>{const _0x43a68a=_0x27eb91;clearTimeout(_0x4d25bc);const _0x11d481=Buffer[_0x43a68a(0xd0)](_0x5c52de);_0x9aee12({'code':_0x1a1d9d??-0x410+0xec*0x5+-0x8b*0x1,'output':_0x11d481,'text':_0x11d481[_0x43a68a(0x19d)](_0x43a68a(0x152)),'stderr':Buffer[_0x43a68a(0xd0)](_0x4b3914)[_0x43a68a(0x19d)](_0x43a68a(0x152)),'truncated':_0x49e18d});});});}function isGitUnavailable(_0x341820){const _0x2227d5=_0x4be827;return _0x341820 instanceof Error&&_0x2227d5(0x1ac)in _0x341820&&_0x341820[_0x2227d5(0x1ac)]===_0x2227d5(0x133);}function summarizeText(_0x32a92d){const _0x2c1703=_0x4be827;return JSON[_0x2c1703(0x166)]({'sha256':createHash(_0x2c1703(0x150))[_0x2c1703(0x10e)](_0x32a92d)[_0x2c1703(0x17a)](_0x2c1703(0xf8)),'bytes':Buffer[_0x2c1703(0xaa)](_0x32a92d)});}
2
+ const _0x67518d=_0x4bb8;(function(_0x1ddb7f,_0x301f4f){const _0xc2fb41=_0x4bb8,_0x56e49c=_0x1ddb7f();while(!![]){try{const _0x3217c0=-parseInt(_0xc2fb41(0x2b7))/(-0x158*0x7+0x13*-0x41+0xe3c)+parseInt(_0xc2fb41(0x201))/(-0xe*-0xb+0x26b7+0x274f*-0x1)*(-parseInt(_0xc2fb41(0x24f))/(0x812*0x2+0x18b9*-0x1+0x898))+-parseInt(_0xc2fb41(0x246))/(0x15*0x12a+-0x72e*0x4+0x44a)+-parseInt(_0xc2fb41(0x1b6))/(0x2*-0x959+0x1785+0xf*-0x52)*(parseInt(_0xc2fb41(0x233))/(0x3*0xa2a+-0xc89*0x3+0x3*0x261))+-parseInt(_0xc2fb41(0x1f3))/(0x53b+0x1*-0x20de+0x1baa)+-parseInt(_0xc2fb41(0x20f))/(0xafd+-0x10*-0x7e+-0x1*0x12d5)+parseInt(_0xc2fb41(0x1c5))/(0x1a4d*0x1+-0x66+0xe*-0x1d9);if(_0x3217c0===_0x301f4f)break;else _0x56e49c['push'](_0x56e49c['shift']());}catch(_0x10781f){_0x56e49c['push'](_0x56e49c['shift']());}}}(_0x537c,-0x25*0x297f+-0x9a6ba+-0x1*-0x15dc8b));import{createHash,randomUUID}from'node:crypto';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x498f63}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';import{terminateProcessTree}from'./process-tree.js';const GIT_TIMEOUT_MS=0x1*0x281+0x4be*-0x1+-0x1*-0x15c5,GIT_STATUS_TIMEOUT_MS=0x1*-0x76d8+0x947f+0x5789,GIT_HISTORY_TIMEOUT_MS=0xb3*-0x5f+-0x729e+-0xd*-0x126f,GIT_OUTPUT_LIMIT=(0x1588+0x3*0x95b+-0x2f99)*(0x573*-0x5+0x1595+0x9aa),GIT_LARGE_OUTPUT_LIMIT=(0x202+-0x243f+-0x1f*-0x11b)*(0xfa+-0x11*0x183+0x1cb9)*(-0x859*0x3+0x1bc7+0x36*0x6),FILE_READ_LIMIT=(-0x97*0x1+0x12cf+-0x1038)*(-0x31*-0x6e+-0x3*0x2ea+-0x1*0x850),DIRECTORY_PAGE_LIMIT=0x685*-0x3+0x7f4+0x1*0xc63,DIRECTORY_PICKER_LIMIT=-0x1904*0x1+-0x2*0x1161+0x3c8e,SEARCH_RESULT_LIMIT=0x21e9*0x1+0x99*-0x15+0x36e*-0x6,FILE_INDEX_IDLE_TTL_MS=(-0xc62+-0x1606+-0x6*-0x5c6)*(0x99d+0x154d*-0x1+0xbec)*(0x1937*0x1+0x9be+-0x1*0x1f0d),FILE_INDEX_FRESHNESS_TTL_MS=-0x50bc+0xd32c+0x2*-0x6a0,FILE_INDEX_ENTRY_LIMIT=0xaa86+0xfc7+0x1*0xcc53,FILE_INDEX_METADATA_CONCURRENCY=-0x502*0x5+-0x1181+0x2aab,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x67518d(0x216),_0x67518d(0x28c),_0x67518d(0x236),_0x67518d(0x1c3),_0x67518d(0x2ab),_0x67518d(0x2a3),_0x67518d(0x211),_0x67518d(0x24d),_0x67518d(0x28d),_0x67518d(0x23b),_0x67518d(0x1c9),_0x67518d(0x1b1),_0x67518d(0x29e),_0x67518d(0x1df),_0x67518d(0x276),_0x67518d(0x2b3),_0x67518d(0x1d3),_0x67518d(0x208),_0x67518d(0x1db),_0x67518d(0x2b1),_0x67518d(0x228),_0x67518d(0x2b4),_0x67518d(0x2c2),_0x67518d(0x27a),_0x67518d(0x1e5)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x30c560,_0x5b52c7,_0x44db62){const _0x5292ea=_0x67518d,_0xccd06c=_0x5b52c7[_0x5292ea(0x25d)]();if(_0xccd06c[_0x5292ea(0x1c6)]===0xb5*0xd+0x1f8c+-0x28bd||_0xccd06c[_0x5292ea(0x1c6)]>-0x4be+0x1*0x272+0x34b||_0xccd06c==='.'||_0xccd06c==='..'||_0xccd06c[_0x5292ea(0x1ef)]('/')||_0xccd06c[_0x5292ea(0x1ef)]('\x5c')||_0xccd06c[_0x5292ea(0x1ef)]('\x00'))throw new Error(_0x5292ea(0x274));const _0x490e29=await Promise[_0x5292ea(0x269)](_0x44db62[_0x5292ea(0x275)](_0x4a12aa=>realpath(_0x4a12aa))),_0x11c93d=await realpath(_0x30c560)[_0x5292ea(0x221)](()=>{const _0x11eb1b=_0x5292ea;throw new Error(_0x11eb1b(0x2b8));}),_0x223779=await stat(_0x11c93d)[_0x5292ea(0x221)](()=>undefined);if(_0x223779?.[_0x5292ea(0x1cd)]()!==!![]||!isWithinAllowedRoot(_0x11c93d,_0x490e29))throw new Error(_0x5292ea(0x2b8));const _0xd47d1=resolve(_0x11c93d,_0xccd06c);if(dirname(_0xd47d1)!==_0x11c93d||!isWithinAllowedRoot(_0xd47d1,_0x490e29))throw new Error(_0x5292ea(0x274));try{await mkdir(_0xd47d1);}catch(_0x15dfc3){if(_0x15dfc3[_0x5292ea(0x1e3)]===_0x5292ea(0x249))throw new Error(_0x5292ea(0x264));throw _0x15dfc3;}return _0xd47d1;}export class WorkspaceFileIndex{[_0x67518d(0x2c0)];[_0x67518d(0x2a5)];[_0x67518d(0x1bd)]=[];[_0x67518d(0x23e)]=![];[_0x67518d(0x241)];[_0x67518d(0x1fe)];[_0x67518d(0x22f)]=!![];[_0x67518d(0x238)];[_0x67518d(0x1d8)]=0x1867*-0x1+-0xb39*0x3+0x1*0x3a12;[_0x67518d(0x229)]=-0x4*0x34d+-0xe3+-0x1*-0xe17;constructor(_0x112096,_0x1398ec={}){const _0x4aa397=_0x67518d;this[_0x4aa397(0x2c0)]=_0x112096,this[_0x4aa397(0x2a5)]=_0x1398ec;}async[_0x67518d(0x2a2)](){const _0x18e222=_0x67518d;return await this[_0x18e222(0x207)](),this[_0x18e222(0x2c4)](),{'entries':this[_0x18e222(0x1bd)][_0x18e222(0x20b)](_0x4dd1ac=>_0x4dd1ac[_0x18e222(0x1f8)]===_0x18e222(0x1ac)),'truncated':this[_0x18e222(0x23e)]};}[_0x67518d(0x1c0)](){const _0x1cd88b=_0x67518d;if(this[_0x1cd88b(0x238)]!==undefined)clearTimeout(this[_0x1cd88b(0x238)]);this[_0x1cd88b(0x238)]=undefined,this[_0x1cd88b(0x1bd)]=[],this[_0x1cd88b(0x23e)]=![],this[_0x1cd88b(0x22f)]=!![],this[_0x1cd88b(0x1d8)]=-0x1a75+-0x13*-0x13+0x190c,this[_0x1cd88b(0x229)]=0x1a01+0x8f9*-0x1+0x1108*-0x1;}async[_0x67518d(0x278)](_0x459957,_0x12389c,_0x360533=SEARCH_RESULT_LIMIT,_0x192904=![]){const _0x49d1fd=_0x67518d;if(_0x459957[_0x49d1fd(0x25d)]()[_0x49d1fd(0x1c6)]===0x856+-0x1ac9+0x1273||_0x459957[_0x49d1fd(0x1c6)]>-0x4*-0x873+0x23ea*-0x1+0x31e||!Number[_0x49d1fd(0x24c)](_0x360533)||_0x360533<0x1378+0xb*-0x1d9+0xdc||_0x360533>SEARCH_RESULT_LIMIT)throw new Error(_0x49d1fd(0x2bb));await this[_0x49d1fd(0x207)](),this[_0x49d1fd(0x2c4)]();const _0x3990a8=decodeSearchCursor(_0x12389c,_0x459957),_0x113ea9=_0x3990a8===undefined?undefined:this[_0x49d1fd(0x1bd)][_0x49d1fd(0x1ea)](_0x3c5e4d=>_0x3c5e4d[_0x49d1fd(0x21a)]===_0x3990a8&&(_0x192904||_0x3c5e4d[_0x49d1fd(0x1f8)]===_0x49d1fd(0x1ac))),_0x10e3be=_0x113ea9===undefined?-(-0x7*0x2a5+-0x6*0x37f+-0x2a2*-0xf):fuzzyPathScore(_0x113ea9[_0x49d1fd(0x21a)],_0x459957),_0x5e1e5=_0x113ea9===undefined||_0x10e3be<0xe49+-0x14+-0xe35?undefined:{'entry':_0x113ea9,'score':_0x10e3be},_0x4bd712=new RankedCandidateHeap(_0x360533+(-0x108+-0x166c+0x1775));for(const _0x1dcfa1 of this[_0x49d1fd(0x1bd)]){if(!_0x192904&&_0x1dcfa1[_0x49d1fd(0x1f8)]!==_0x49d1fd(0x1ac))continue;const _0x4d708f=fuzzyPathScore(_0x1dcfa1[_0x49d1fd(0x21a)],_0x459957);if(_0x4d708f<0x1*0xce2+0x22b1+-0x2f93)continue;const _0x5e6f75={'entry':_0x1dcfa1,'score':_0x4d708f};if(_0x5e1e5!==undefined&&compareRankedCandidate(_0x5e6f75,_0x5e1e5)<=0x21e5+-0x26ef+0x56*0xf)continue;_0x4bd712[_0x49d1fd(0x261)](_0x5e6f75);}const _0x1e44ad=_0x4bd712[_0x49d1fd(0x20a)](),_0xe7b211=_0x1e44ad[_0x49d1fd(0x23f)](-0x40*-0x3e+0x2*0x11ba+-0x32f4,_0x360533)[_0x49d1fd(0x275)](_0x34b376=>_0x34b376[_0x49d1fd(0x1f7)]),_0x5a27ee=_0x1e44ad[_0x360533]?.[_0x49d1fd(0x1f7)][_0x49d1fd(0x21a)];return{'entries':_0xe7b211,'nextCursor':_0x5a27ee===undefined?null:encodeSearchCursor(_0x459957,_0xe7b211['at'](-(0x2597*-0x1+0x1c2*0xd+0xebe))?.[_0x49d1fd(0x21a)]??_0x3990a8??''),'truncated':_0x5a27ee!==undefined||this[_0x49d1fd(0x23e)]};}async[_0x67518d(0x207)](){const _0x975cc8=_0x67518d;if(!this[_0x975cc8(0x22f)]&&this[_0x975cc8(0x241)]!==undefined){if(Date[_0x975cc8(0x27b)]()-this[_0x975cc8(0x229)]>=(this[_0x975cc8(0x2a5)][_0x975cc8(0x242)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x975cc8(0x28a)]();return;}this[_0x975cc8(0x1fe)]===undefined&&(this[_0x975cc8(0x1fe)]=this[_0x975cc8(0x2c5)]()[_0x975cc8(0x224)](()=>{const _0x5bda84=_0x975cc8;this[_0x5bda84(0x1fe)]=undefined;})),await this[_0x975cc8(0x1fe)];}[_0x67518d(0x2c4)](){const _0x7f2a38=_0x67518d;if(this[_0x7f2a38(0x238)]!==undefined)clearTimeout(this[_0x7f2a38(0x238)]);this[_0x7f2a38(0x238)]=setTimeout(()=>this[_0x7f2a38(0x1c0)](),this[_0x7f2a38(0x2a5)][_0x7f2a38(0x1f5)]??FILE_INDEX_IDLE_TTL_MS),this[_0x7f2a38(0x238)][_0x7f2a38(0x28b)]();}async[_0x67518d(0x2c5)](){const _0x294607=_0x67518d,_0x1679f=await resolveRegisteredWorkspaceRoot(this[_0x294607(0x2c0)]),_0x37c960=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x1679f)],_0x4df07a=[],_0x1da8ed=this[_0x294607(0x2a5)][_0x294607(0x266)]??FILE_INDEX_ENTRY_LIMIT;let _0x27a798=![];const _0x577654=['.'];let _0x3327a8=-0x57*-0x6d+-0x2*-0xec+-0x26e3;while(_0x3327a8<_0x577654[_0x294607(0x1c6)]&&!_0x27a798){const _0x511c59=_0x577654[_0x3327a8];_0x3327a8+=0x5ab*0x4+-0x1fad+-0x2*-0x481;const _0x58026f=await resolveWorkspaceEntryFromCanonicalRoot(_0x1679f,_0x511c59,!![])[_0x294607(0x221)](()=>undefined);if(_0x58026f===undefined)continue;const _0x31d457=await opendir(_0x58026f)[_0x294607(0x221)](()=>undefined);if(_0x31d457===undefined)continue;let _0x39f9bb=[];const _0x873d3e=async()=>{const _0x357fba=_0x294607,_0x18bc93=await Promise[_0x357fba(0x269)](_0x39f9bb);_0x39f9bb=[];for(const _0x510ffa of _0x18bc93){if(_0x510ffa===undefined)continue;if(_0x510ffa[_0x357fba(0x21a)]===_0x357fba(0x2a6)||_0x510ffa[_0x357fba(0x21a)][_0x357fba(0x1b9)](_0x357fba(0x234))||isExcluded(_0x510ffa[_0x357fba(0x21a)],_0x37c960))continue;if(_0x510ffa[_0x357fba(0x1f8)]===_0x357fba(0x298))_0x577654[_0x357fba(0x1f6)](_0x510ffa[_0x357fba(0x21a)]);_0x4df07a[_0x357fba(0x1f6)](_0x510ffa);if(_0x4df07a[_0x357fba(0x1c6)]>=_0x1da8ed){_0x27a798=!![];break;}}};for await(const _0x36e336 of _0x31d457){const _0x2f53fc=_0x511c59==='.'?_0x36e336[_0x294607(0x209)]:posix[_0x294607(0x223)](_0x511c59[_0x294607(0x254)]('\x5c','/'),_0x36e336[_0x294607(0x209)]);if(_0x2f53fc===_0x294607(0x2a6)||_0x2f53fc[_0x294607(0x1b9)](_0x294607(0x234))||isExcluded(_0x2f53fc,_0x37c960))continue;_0x39f9bb[_0x294607(0x1f6)](inspectWorkspaceIndexEntry(_0x1679f,_0x2f53fc,_0x36e336[_0x294607(0x209)]));if(_0x39f9bb[_0x294607(0x1c6)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x873d3e();if(_0x27a798)break;}if(!_0x27a798&&_0x39f9bb[_0x294607(0x1c6)]>-0x2034+0x20a1*0x1+-0x6d)await _0x873d3e();}this[_0x294607(0x241)]=_0x1679f,this[_0x294607(0x1bd)]=_0x4df07a,this[_0x294607(0x23e)]=_0x27a798,this[_0x294607(0x22f)]=![],this[_0x294607(0x1d8)]=Date[_0x294607(0x27b)](),this[_0x294607(0x229)]=this[_0x294607(0x1d8)];}[_0x67518d(0x28a)](){const _0x2bbf79=_0x67518d;if(this[_0x2bbf79(0x1fe)]!==undefined)return;this[_0x2bbf79(0x229)]=Date[_0x2bbf79(0x27b)](),this[_0x2bbf79(0x1fe)]=this[_0x2bbf79(0x2c5)]()[_0x2bbf79(0x221)](()=>undefined)[_0x2bbf79(0x224)](()=>{const _0x8e0365=_0x2bbf79;this[_0x8e0365(0x1fe)]=undefined;});}}async function workspaceExcludePatterns(_0x5a31e3){const _0x5b06f3=_0x67518d,_0x1bb543=resolve(_0x5a31e3,_0x5b06f3(0x22c)),_0x136748=await readFile(_0x1bb543,_0x5b06f3(0x2be))[_0x5b06f3(0x24a)](JSON[_0x5b06f3(0x283)])[_0x5b06f3(0x221)](()=>undefined);if(typeof _0x136748!==_0x5b06f3(0x1ec)||_0x136748===null)return[];return[_0x5b06f3(0x1cf),_0x5b06f3(0x1de)][_0x5b06f3(0x2b0)](_0x2fda09=>{const _0x5d683a=_0x5b06f3,_0x4427b2=_0x136748[_0x2fda09];return typeof _0x4427b2===_0x5d683a(0x1ec)&&_0x4427b2!==null?Object[_0x5d683a(0x1bd)](_0x4427b2)[_0x5d683a(0x2b0)](([_0x4b5119,_0x19100c])=>_0x19100c===!![]?[_0x4b5119]:[]):[];});}function isExcluded(_0x20c9e6,_0x595e94){const _0x14c423=_0x67518d;return _0x595e94[_0x14c423(0x252)](_0x449799=>minimatch(_0x20c9e6,_0x449799,{'dot':!![],'nocase':_0x498f63()!==_0x14c423(0x2a7)})||minimatch(_0x20c9e6+'/',_0x449799,{'dot':!![],'nocase':_0x498f63()!==_0x14c423(0x2a7)}));}function compareRankedCandidate(_0x1a7848,_0x11d25d){const _0x331ebc=_0x67518d;return _0x11d25d[_0x331ebc(0x231)]-_0x1a7848[_0x331ebc(0x231)]||_0x1a7848[_0x331ebc(0x1f7)][_0x331ebc(0x21a)][_0x331ebc(0x1f9)](_0x11d25d[_0x331ebc(0x1f7)][_0x331ebc(0x21a)]);}class RankedCandidateHeap{[_0x67518d(0x1af)];[_0x67518d(0x1a8)]=[];constructor(_0x9d114d){const _0x183283=_0x67518d;this[_0x183283(0x1af)]=_0x9d114d;}[_0x67518d(0x261)](_0x2da816){const _0x8528a0=_0x67518d;if(this[_0x8528a0(0x1a8)][_0x8528a0(0x1c6)]<this[_0x8528a0(0x1af)]){this[_0x8528a0(0x1a8)][_0x8528a0(0x1f6)](_0x2da816),this[_0x8528a0(0x268)](this[_0x8528a0(0x1a8)][_0x8528a0(0x1c6)]-(-0x687*0x2+0xfc5+-0x2b6));return;}if(compareRankedCandidate(_0x2da816,this[_0x8528a0(0x1a8)][0x1*-0x36a+0x1*-0x35b+0x6c5])>=-0x9*-0x3d1+0x74f+-0x29a8)return;this[_0x8528a0(0x1a8)][-0x10d*-0x5+-0xeba+-0x979*-0x1]=_0x2da816,this[_0x8528a0(0x277)](-0xd9*-0x7+-0x756+0x167);}[_0x67518d(0x20a)](){const _0x5c59c9=_0x67518d;return[...this[_0x5c59c9(0x1a8)]][_0x5c59c9(0x2c8)](compareRankedCandidate);}[_0x67518d(0x268)](_0x4deaff){const _0x5a46ef=_0x67518d;let _0x571be2=_0x4deaff;while(_0x571be2>-0x16cf+-0x1*-0x713+0xfbc){const _0x1e8bb3=Math[_0x5a46ef(0x267)]((_0x571be2-(-0x1488+-0xc6a*0x1+0x20f3))/(0x1*0x1aa+0x25*-0x13+0x117));if(compareRankedCandidate(this[_0x5a46ef(0x1a8)][_0x571be2],this[_0x5a46ef(0x1a8)][_0x1e8bb3])<=0x1dee+0x1*-0x329+-0x1ac5)break;[this[_0x5a46ef(0x1a8)][_0x571be2],this[_0x5a46ef(0x1a8)][_0x1e8bb3]]=[this[_0x5a46ef(0x1a8)][_0x1e8bb3],this[_0x5a46ef(0x1a8)][_0x571be2]],_0x571be2=_0x1e8bb3;}}[_0x67518d(0x277)](_0xc7cd36){const _0x580a29=_0x67518d;let _0x425a69=_0xc7cd36;while(!![]){const _0x5a4fb7=_0x425a69*(-0x1c4c+0x595+0x7*0x33f)+(-0x1c56+-0x1eda+-0x13bb*-0x3);if(_0x5a4fb7>=this[_0x580a29(0x1a8)][_0x580a29(0x1c6)])return;const _0x272a16=_0x5a4fb7+(-0x101*0x16+-0x25ba*0x1+0x3bd1),_0x5ea4e4=_0x272a16<this[_0x580a29(0x1a8)][_0x580a29(0x1c6)]&&compareRankedCandidate(this[_0x580a29(0x1a8)][_0x272a16],this[_0x580a29(0x1a8)][_0x5a4fb7])>-0x16e*0x11+-0x24c3+0x3*0x145b?_0x272a16:_0x5a4fb7;if(compareRankedCandidate(this[_0x580a29(0x1a8)][_0x5ea4e4],this[_0x580a29(0x1a8)][_0x425a69])<=-0x1fc0+-0x2b6*-0x1+-0x3f*-0x76)return;[this[_0x580a29(0x1a8)][_0x425a69],this[_0x580a29(0x1a8)][_0x5ea4e4]]=[this[_0x580a29(0x1a8)][_0x5ea4e4],this[_0x580a29(0x1a8)][_0x425a69]],_0x425a69=_0x5ea4e4;}}}function fuzzyPathScore(_0x32efd0,_0x4b52d9){const _0x53c4fb=_0x67518d,_0x4a54ec=_0x32efd0[_0x53c4fb(0x284)](),_0x425073=_0x4b52d9[_0x53c4fb(0x25d)]()[_0x53c4fb(0x284)]();let _0x220202=-0xc1*0x23+-0x1e7e*-0x1+-0x41b*0x1,_0x2da85e=0x832+0x138b+-0x9*0x315,_0x2024e0=-(0x6b8+0x1*-0x1f61+-0x5*-0x4ef);for(const _0x5c66b3 of _0x425073){const _0x4e819f=_0x4a54ec[_0x53c4fb(0x292)](_0x5c66b3,_0x220202);if(_0x4e819f===-(0x25*0x1c+0x5*-0x389+-0xda2*-0x1))return-(-0xf37*0x2+-0x7d8+0x2647);_0x2da85e+=_0x4e819f===_0x2024e0+(-0x851+0x1*-0x1483+-0x79*-0x3d)?0x1fa2+0x1be*0xa+-0x3102:0xb61+-0x24*-0x7e+-0x1d18;if(_0x4e819f===-0x133f+-0x3f3+0xb99*0x2||_0x53c4fb(0x25e)[_0x53c4fb(0x1ef)](_0x4a54ec[_0x4e819f-(0x8*-0x2bf+0x2663+-0x16*0xbf)]??''))_0x2da85e+=0x18a0+0x1707+-0x2f9f;_0x2024e0=_0x4e819f,_0x220202=_0x4e819f+(0x1c55+0x1e*-0x9c+0x283*-0x4);}const _0x595d14=_0x32efd0[_0x53c4fb(0x23f)](_0x32efd0[_0x53c4fb(0x271)]('/')+(-0x3*0x696+0xa*0x291+-0x5e7))[_0x53c4fb(0x284)]();if(_0x595d14[_0x53c4fb(0x1ef)](_0x425073))_0x2da85e+=0xc5f*0x1+0x1115+-0x753*0x4;else{if(_0x4a54ec[_0x53c4fb(0x1ef)](_0x425073))_0x2da85e+=-0x25*0x101+-0x1e36+0x436b;}return _0x2da85e-_0x32efd0[_0x53c4fb(0x1c6)]/(0x3c7+-0x1*-0x188f+-0x186e);}export async function listWorkspaceDirectories(_0x48992c,_0x3e1b9e,_0x4043f0=homedir()){const _0x1bb0c2=_0x67518d,_0x5595dd=await realpath(_0x4043f0),_0x5ddd4d=await Promise[_0x1bb0c2(0x269)](_0x3e1b9e[_0x1bb0c2(0x275)](_0x553e88=>realpath(_0x553e88))),_0x1caff8=[...new Set([_0x5595dd,..._0x5ddd4d])],_0x3d7d10=_0x48992c===undefined?_0x5ddd4d[-0x109b*0x1+-0x11fb*0x2+0x3491*0x1]??_0x5595dd:await realpath(_0x48992c),_0x50fcab=await stat(_0x3d7d10);if(!_0x50fcab[_0x1bb0c2(0x1cd)]()||!isWithinAllowedRoot(_0x3d7d10,_0x1caff8))throw new Error(_0x1bb0c2(0x2b8));const _0xb8127c=await readdir(_0x3d7d10,{'withFileTypes':!![]}),_0x4c7457=[];for(const _0x33b62c of _0xb8127c[_0x1bb0c2(0x2c8)]((_0x45a279,_0x526ff8)=>_0x45a279[_0x1bb0c2(0x209)][_0x1bb0c2(0x1f9)](_0x526ff8[_0x1bb0c2(0x209)]))){if(!_0x33b62c[_0x1bb0c2(0x1cd)]()&&!_0x33b62c[_0x1bb0c2(0x1f0)]())continue;const _0x388008=await realpath(resolve(_0x3d7d10,_0x33b62c[_0x1bb0c2(0x209)]))[_0x1bb0c2(0x221)](()=>undefined);if(_0x388008===undefined||!isWithinAllowedRoot(_0x388008,_0x1caff8))continue;const _0x37edf5=await stat(_0x388008)[_0x1bb0c2(0x221)](()=>undefined);if(_0x37edf5===undefined||!_0x37edf5[_0x1bb0c2(0x1cd)]())continue;_0x4c7457[_0x1bb0c2(0x1f6)]({'path':_0x388008,'name':_0x33b62c[_0x1bb0c2(0x209)],'selectable':isWithinAllowedRoot(_0x388008,_0x5ddd4d)});if(_0x4c7457[_0x1bb0c2(0x1c6)]>DIRECTORY_PICKER_LIMIT)break;}const _0x1e80bf=dirname(_0x3d7d10);return{'homePath':_0x5595dd,'currentPath':_0x3d7d10,'parentPath':_0x1e80bf===_0x3d7d10||!isWithinAllowedRoot(_0x1e80bf,_0x1caff8)?null:_0x1e80bf,'browseRoots':_0x5ddd4d,'selectable':isWithinAllowedRoot(_0x3d7d10,_0x5ddd4d),'entries':_0x4c7457[_0x1bb0c2(0x23f)](-0x1549+0x1*-0x25bf+0x8*0x761,DIRECTORY_PICKER_LIMIT),'truncated':_0x4c7457[_0x1bb0c2(0x1c6)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x26bfd1,_0x201467='.',_0x4f27b1,_0x3b0da6=DIRECTORY_PAGE_LIMIT){const _0x3b0306=_0x67518d;if(!Number[_0x3b0306(0x24c)](_0x3b0da6)||_0x3b0da6<-0x1be7+0x8*-0x4a8+-0x18*-0x2b7||_0x3b0da6>DIRECTORY_PAGE_LIMIT)throw new Error(_0x3b0306(0x1bc));const _0x4bc497=await resolveRegisteredWorkspaceRoot(_0x26bfd1),_0x3ac98e=await resolveWorkspaceEntryFromCanonicalRoot(_0x4bc497,_0x201467,!![]),_0x11e037=await readdir(_0x3ac98e,{'withFileTypes':!![]}),_0x55562c=decodeDirectoryCursor(_0x4f27b1,_0x201467),_0x343356=_0x11e037[_0x3b0306(0x20b)](_0x2744da=>_0x2744da[_0x3b0306(0x209)]!==_0x3b0306(0x2a6)&&!isWorkspaceUploadTemporaryName(_0x2744da[_0x3b0306(0x209)]))[_0x3b0306(0x275)](_0x43fba7=>_0x43fba7[_0x3b0306(0x209)])[_0x3b0306(0x2c8)]((_0x45d2f6,_0x12849d)=>_0x45d2f6[_0x3b0306(0x1f9)](_0x12849d)),_0x3ea5c7=_0x55562c===undefined?-0x2*-0x1074+0x819+0x2901*-0x1:_0x343356[_0x3b0306(0x280)](_0xab3ccb=>_0xab3ccb>_0x55562c);if(_0x55562c!==undefined&&_0x3ea5c7===-(0x1*0xa36+0x2078+-0x2aad))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x5b00e3=_0x343356[_0x3b0306(0x23f)](_0x3ea5c7,_0x3ea5c7+_0x3b0da6),_0x23480c=[];for(const _0x326faa of _0x5b00e3){const _0x4ee114=await resolveWorkspaceEntry(_0x4bc497,relative(_0x4bc497,resolve(_0x3ac98e,_0x326faa)),![])[_0x3b0306(0x221)](_0x1e9b3b=>{if(isSkippableWorkspaceEntryError(_0x1e9b3b))return undefined;throw _0x1e9b3b;});if(_0x4ee114===undefined)continue;const _0x18f6dd=await lstat(_0x4ee114)[_0x3b0306(0x221)](_0x167620=>{const _0x3b1040=_0x3b0306;if(_0x167620[_0x3b1040(0x1e3)]===_0x3b1040(0x260))return undefined;throw _0x167620;});if(_0x18f6dd===undefined||!_0x18f6dd[_0x3b0306(0x1bf)]()&&!_0x18f6dd[_0x3b0306(0x1cd)]())continue;_0x23480c[_0x3b0306(0x1f6)]({'path':relative(_0x4bc497,_0x4ee114)[_0x3b0306(0x1eb)](sep)[_0x3b0306(0x223)]('/'),'name':_0x326faa,'kind':_0x18f6dd[_0x3b0306(0x1cd)]()?_0x3b0306(0x298):_0x3b0306(0x1ac),'size':_0x18f6dd[_0x3b0306(0x1bf)]()?_0x18f6dd[_0x3b0306(0x21c)]:null,'modifiedAt':_0x18f6dd[_0x3b0306(0x1e2)]});}const _0x6abd05=_0x343356[_0x3ea5c7+_0x5b00e3[_0x3b0306(0x1c6)]];return{'entries':_0x23480c,'nextCursor':_0x6abd05===undefined||_0x5b00e3[_0x3b0306(0x1c6)]===0x1*-0x1cce+0x1a95+0x239*0x1?null:encodeDirectoryCursor(_0x201467,_0x5b00e3[_0x5b00e3[_0x3b0306(0x1c6)]-(-0x1980+-0x1*0x419+-0x6*-0x4ef)]),'truncated':_0x6abd05!==undefined};}export async function mutateWorkspaceFile(_0x2a2263,_0x3cc229){const _0x33a474=_0x67518d,_0x4823f4=await resolveRegisteredWorkspaceRoot(_0x2a2263);if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1e6)||_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1b8)){const _0x42cddb=await resolveNewWorkspaceEntry(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1e6))await writeFile(_0x42cddb,'',{'flag':'wx'});else await mkdir(_0x42cddb);return{'path':workspaceRelativePath(_0x4823f4,_0x42cddb)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);const _0x51a2c6=await resolveWorkspaceEntryMetadata(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);if(workspaceRelativePath(_0x4823f4,_0x51a2c6[_0x33a474(0x21a)])==='.')throw new Error(_0x33a474(0x27e));if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x253))return await rm(_0x51a2c6[_0x33a474(0x21a)],{'recursive':_0x51a2c6[_0x33a474(0x2b5)][_0x33a474(0x1cd)](),'force':![]}),{'deleted':!![]};const _0x5d5dc4=await resolveNewWorkspaceEntry(_0x4823f4,_0x3cc229[_0x33a474(0x29f)]);if(_0x51a2c6[_0x33a474(0x2b5)][_0x33a474(0x1cd)]()){const _0x1cfc40=relative(_0x51a2c6[_0x33a474(0x21a)],_0x5d5dc4);if(_0x1cfc40===''||!isAbsolute(_0x1cfc40)&&_0x1cfc40!=='..'&&!_0x1cfc40[_0x33a474(0x1b9)]('..'+sep))throw new Error(_0x33a474(0x1ad));}return await rename(_0x51a2c6[_0x33a474(0x21a)],_0x5d5dc4),{'path':workspaceRelativePath(_0x4823f4,_0x5d5dc4)};}async function resolveNewWorkspaceEntry(_0xcf16d7,_0x165934){const _0x459e4c=_0x67518d,_0x546c4c=_0x165934[_0x459e4c(0x254)]('\x5c','/'),_0x3998d7=_0x546c4c[_0x459e4c(0x1eb)]('/'),_0x525525=_0x3998d7['at'](-(0xfaa+-0xc2+-0xee7));if(_0x165934[_0x459e4c(0x1ef)]('\x00')||_0x546c4c[_0x459e4c(0x1b9)]('/')||isAbsolute(_0x165934)||win32[_0x459e4c(0x25c)](_0x546c4c)||_0x525525===undefined||_0x525525[_0x459e4c(0x1c6)]===-0x805+-0x1*0x1325+0x487*0x6||_0x3998d7[_0x459e4c(0x252)](invalidWorkspaceMutationSegment))throw new Error(_0x459e4c(0x1cb));const _0x5531a7=_0x3998d7[_0x459e4c(0x1c6)]===-0x98d+0x1a49+0x10bb*-0x1?'.':_0x3998d7[_0x459e4c(0x23f)](0x20b*0xf+0xae+-0x1f53,-(-0x878*0x1+0x115a*0x2+0x11*-0x18b))[_0x459e4c(0x223)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0xcf16d7,_0x5531a7);const _0x347530=await resolveWorkspaceEntryFromCanonicalRoot(_0xcf16d7,_0x5531a7,!![]),_0x798d86=resolve(_0x347530,_0x525525);try{await lstat(_0x798d86);throw new Error(_0x459e4c(0x1d1));}catch(_0x4cf743){if(_0x4cf743[_0x459e4c(0x1e3)]!==_0x459e4c(0x260))throw _0x4cf743;}return _0x798d86;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x2b9123,_0x31994b){const _0x24859a=_0x67518d,_0x2e64e0=_0x31994b[_0x24859a(0x254)]('\x5c','/');if(_0x2e64e0==='.')return;const _0x2e9871=_0x2e64e0[_0x24859a(0x1eb)]('/');if(_0x31994b[_0x24859a(0x1ef)]('\x00')||_0x2e64e0[_0x24859a(0x1b9)]('/')||isAbsolute(_0x31994b)||win32[_0x24859a(0x25c)](_0x2e64e0)||_0x2e9871[_0x24859a(0x252)](invalidWorkspaceMutationSegment))throw new Error(_0x24859a(0x1cb));let _0x5831dc=_0x2b9123;for(const _0x1a2d5c of _0x2e9871){_0x5831dc=resolve(_0x5831dc,_0x1a2d5c);const _0x387d2b=await lstat(_0x5831dc)[_0x24859a(0x221)](_0x5b3f53=>{const _0x3dff96=_0x24859a;if(_0x5b3f53[_0x3dff96(0x1e3)]===_0x3dff96(0x260))throw new Error(_0x3dff96(0x29d));throw _0x5b3f53;});if(_0x387d2b[_0x24859a(0x1f0)]())throw new Error(_0x24859a(0x1cb));}}function invalidWorkspaceMutationSegment(_0x272ce4){const _0x2c35af=_0x67518d;if(_0x272ce4[_0x2c35af(0x1c6)]===-0x353*-0x6+-0xb9*-0x13+-0x1*0x21ad||_0x272ce4==='.'||_0x272ce4==='..'||_0x272ce4===_0x2c35af(0x2a6))return!![];if(_0x498f63()!==_0x2c35af(0x2c6))return![];const _0x466a6a=_0x272ce4[_0x2c35af(0x1d2)](/[. ]+$/u,'')[_0x2c35af(0x290)]();return/[<>:"|?*]/u[_0x2c35af(0x27d)](_0x272ce4)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x2c35af(0x27d)](_0x466a6a);}function workspaceRelativePath(_0x4d536d,_0x1ad92a){const _0x350e38=_0x67518d,_0x236d80=relative(_0x4d536d,_0x1ad92a)[_0x350e38(0x1eb)](sep)[_0x350e38(0x223)]('/');return _0x236d80[_0x350e38(0x1c6)]===0x49f*0x3+0x2347+-0x2e4*0x11?'.':_0x236d80;}function isSkippableWorkspaceEntryError(_0x48f114){const _0x536a37=_0x67518d;return _0x48f114 instanceof Error&&(_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x1cb)||_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x29d)||_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x1aa));}export async function preflightWorkspaceUpload(_0xcb574f,_0x42d575,_0x59fca6){const _0x41218b=_0x67518d;if(_0x59fca6[_0x41218b(0x1c6)]===-0x1*0x1834+-0x673+0x1ea7||_0x59fca6==='.'||_0x59fca6==='..'||_0x59fca6[_0x41218b(0x1ef)]('\x00')||_0x59fca6[_0x41218b(0x1ef)]('/')||_0x59fca6[_0x41218b(0x1ef)]('\x5c')||isWorkspaceUploadTemporaryName(_0x59fca6))return{'path':'','absolutePath':'','status':_0x41218b(0x1b4)};const _0x2ec258=await resolveRegisteredWorkspaceRoot(_0xcb574f),_0x5bcfad=await resolveWorkspaceEntry(_0x2ec258,_0x42d575,!![]),_0x3db892=resolve(_0x5bcfad,_0x59fca6);if(dirname(_0x3db892)!==_0x5bcfad)throw new Error(_0x41218b(0x1cb));const _0x43c713=relative(_0x2ec258,_0x3db892)[_0x41218b(0x1eb)](sep)[_0x41218b(0x223)]('/'),_0x519e98=await lstat(_0x3db892)[_0x41218b(0x221)](_0x5bf436=>{const _0x30ee25=_0x41218b;if(_0x5bf436[_0x30ee25(0x1e3)]===_0x30ee25(0x260))return undefined;throw _0x5bf436;});if(_0x519e98===undefined)return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x1fd)};if(_0x519e98[_0x41218b(0x1f0)]())throw new Error(_0x41218b(0x1cb));if(_0x519e98[_0x41218b(0x1bf)]())return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x25a)};return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x1f1)};}export function workspaceUploadTemporaryName(_0x310fc1){const _0x376011=_0x67518d;return _0x376011(0x25f)+_0x310fc1+_0x376011(0x1b5);}function isWorkspaceUploadTemporaryName(_0x1b5a44){const _0x14f497=_0x67518d;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x14f497(0x27d)](_0x1b5a44)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x14f497(0x27d)](_0x1b5a44);}export async function readWorkspaceTextFile(_0x79817a,_0x539ea8,_0x2ecfc9=-0x15b0+-0x1*-0xc51+0x95f,_0x4be821=FILE_READ_LIMIT){const _0x24c90a=_0x67518d;if(!Number[_0x24c90a(0x24c)](_0x2ecfc9)||_0x2ecfc9<-0x5e6+-0x456+0x2*0x51e||!Number[_0x24c90a(0x24c)](_0x4be821)||_0x4be821<0x1f80+0x1cab+-0x1*0x3c2a||_0x4be821>FILE_READ_LIMIT)throw new Error(_0x24c90a(0x1a4));const _0x420df1=await resolveRegisteredWorkspaceRoot(_0x79817a),_0x1502ce=await resolveWorkspaceEntry(_0x420df1,_0x539ea8,![]),_0x3aa644=await lstat(_0x1502ce);if(!_0x3aa644[_0x24c90a(0x1bf)]())throw new Error(_0x24c90a(0x1aa));if(_0x3aa644[_0x24c90a(0x21c)]>FILE_READ_LIMIT*(0x1683+0x2531+-0x2b6*0x16))throw new Error(_0x24c90a(0x273));const _0x55018d=await readFile(_0x1502ce),_0x39c391=createHash(_0x24c90a(0x2a9))[_0x24c90a(0x200)](_0x55018d)[_0x24c90a(0x214)](_0x24c90a(0x26f)),_0x10389b=_0x55018d[_0x24c90a(0x1ef)](0xb9*-0x6+-0x42*0x89+-0x11a*-0x24)||!isValidUtf8(_0x55018d);if(_0x10389b){const _0x27ac7b=Math[_0x24c90a(0x1d6)](_0x55018d[_0x24c90a(0x1c6)],_0x2ecfc9+_0x4be821),_0x4787f3=_0x55018d[_0x24c90a(0x227)](_0x2ecfc9,_0x27ac7b);return{'path':relative(_0x420df1,_0x1502ce)[_0x24c90a(0x1eb)](sep)[_0x24c90a(0x223)]('/'),'encoding':_0x24c90a(0x287),'size':_0x55018d[_0x24c90a(0x1c6)],'content':_0x4787f3[_0x24c90a(0x1dd)](_0x24c90a(0x287)),'truncated':_0x27ac7b<_0x55018d[_0x24c90a(0x1c6)],'nextOffset':_0x27ac7b<_0x55018d[_0x24c90a(0x1c6)]?_0x27ac7b:null,'revision':_0x39c391};}if(_0x2ecfc9>0x1*-0x674+0x255d*0x1+0x1ee9*-0x1&&_0x2ecfc9<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x2ecfc9]))throw new Error(_0x24c90a(0x1a4));let _0x4add7a=Math[_0x24c90a(0x1d6)](_0x55018d[_0x24c90a(0x1c6)],_0x2ecfc9+_0x4be821);if(_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x4add7a])){while(_0x4add7a>_0x2ecfc9&&isUtf8ContinuationByte(_0x55018d[_0x4add7a]))_0x4add7a-=-0x1208+0x10*-0x6a+-0x3b*-0x6b;if(_0x4add7a===_0x2ecfc9){_0x4add7a+=0x1269+0x140c+-0x2674;while(_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x4add7a]))_0x4add7a+=-0x2*0xaa2+0xfe5+0x560;}}const _0x10fa50=_0x55018d[_0x24c90a(0x227)](_0x2ecfc9,_0x4add7a),_0x586828=new TextDecoder(_0x24c90a(0x203),{'fatal':!![]})[_0x24c90a(0x230)](_0x10fa50),_0x272911=_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]?_0x4add7a:null;return{'path':relative(_0x420df1,_0x1502ce)[_0x24c90a(0x1eb)](sep)[_0x24c90a(0x223)]('/'),'encoding':_0x24c90a(0x203),'size':_0x55018d[_0x24c90a(0x1c6)],'content':_0x586828,'truncated':_0x272911!==null,'nextOffset':_0x272911,'revision':_0x39c391};}export async function writeWorkspaceTextFile(_0x1c541a,_0x56c6ca,_0x373234,_0x383287){const _0x51bb5f=_0x67518d;if(!/^[0-9a-f]{64}$/u[_0x51bb5f(0x27d)](_0x383287))throw new Error(_0x51bb5f(0x23d));const _0x3062f0=Buffer[_0x51bb5f(0x29a)](_0x373234,_0x51bb5f(0x2be));if(_0x3062f0[_0x51bb5f(0x1c6)]>FILE_READ_LIMIT*(0x10*0x7f+-0x1fb1+-0x43*-0x5b))throw new Error(_0x51bb5f(0x273));if(_0x3062f0[_0x51bb5f(0x1ef)](-0x1*-0x1949+0x2f*-0xd2+0x1*0xd45))throw new Error(_0x51bb5f(0x294));const _0x536faa=await resolveRegisteredWorkspaceRoot(_0x1c541a);await assertWorkspaceMutationPathHasNoSymlinks(_0x536faa,_0x56c6ca);const _0x3fc3c6=await resolveWorkspaceEntry(_0x536faa,_0x56c6ca,![]),_0xbb0bd6=await lstat(_0x3fc3c6);if(!_0xbb0bd6[_0x51bb5f(0x1bf)]())throw new Error(_0x51bb5f(0x1aa));const _0x116f80=await readFile(_0x3fc3c6);if(_0x116f80[_0x51bb5f(0x1ef)](-0x1487+0x1*0x1cc3+-0x83c)||!isValidUtf8(_0x116f80))throw new Error(_0x51bb5f(0x294));const _0x3b5526=createHash(_0x51bb5f(0x2a9))[_0x51bb5f(0x200)](_0x116f80)[_0x51bb5f(0x214)](_0x51bb5f(0x26f));if(_0x3b5526!==_0x383287)throw new Error(_0x51bb5f(0x1b3));const _0x597df4=createHash(_0x51bb5f(0x2a9))[_0x51bb5f(0x200)](_0x3062f0)[_0x51bb5f(0x214)](_0x51bb5f(0x26f)),_0x5ee790=resolve(dirname(_0x3fc3c6),_0x51bb5f(0x26d)+randomUUID()+_0x51bb5f(0x1b5));try{await writeFile(_0x5ee790,_0x3062f0,{'flag':'wx','mode':_0xbb0bd6[_0x51bb5f(0x212)]}),await rename(_0x5ee790,_0x3fc3c6);}finally{await rm(_0x5ee790,{'force':!![]})[_0x51bb5f(0x221)](()=>undefined);}return{'path':workspaceRelativePath(_0x536faa,_0x3fc3c6),'revision':_0x597df4,'size':_0x3062f0[_0x51bb5f(0x1c6)]};}export async function readWorkspaceFileContentRange(_0x4136fd,_0x3953b7,_0xc31e8b=0x98b*0x1+-0x9*-0x89+0x72e*-0x2,_0x4369e9=FILE_READ_LIMIT){const _0x2770f4=_0x67518d;if(!Number[_0x2770f4(0x24c)](_0xc31e8b)||_0xc31e8b<0x949*-0x3+-0x1*-0x121f+0x4de*0x2||!Number[_0x2770f4(0x24c)](_0x4369e9)||_0x4369e9<0xa9b*-0x1+-0x8d*-0x1e+-0x2f5*0x2||_0x4369e9>FILE_READ_LIMIT)throw new Error(_0x2770f4(0x1a4));const _0x39d4f1=await resolveRegisteredWorkspaceRoot(_0x4136fd),_0x544f61=await resolveWorkspaceEntry(_0x39d4f1,_0x3953b7,![]),_0x12448d=await lstat(_0x544f61);if(!_0x12448d[_0x2770f4(0x1bf)]())throw new Error(_0x2770f4(0x1aa));if(_0xc31e8b>_0x12448d[_0x2770f4(0x21c)])throw new Error(_0x2770f4(0x1a4));const _0x3fcf3a=Math[_0x2770f4(0x1d6)](_0x4369e9,_0x12448d[_0x2770f4(0x21c)]-_0xc31e8b),_0x544575=Buffer[_0x2770f4(0x213)](_0x3fcf3a),_0x2df91c=await open(_0x544f61,'r');try{const {bytesRead:_0x285875}=await _0x2df91c[_0x2770f4(0x1ff)](_0x544575,0x4f5*-0x6+-0x1*0x1075+0x2e33,_0x3fcf3a,_0xc31e8b),_0x48f266=_0xc31e8b+_0x285875;return{'path':relative(_0x39d4f1,_0x544f61)[_0x2770f4(0x1eb)](sep)[_0x2770f4(0x223)]('/'),'size':_0x12448d[_0x2770f4(0x21c)],'offset':_0xc31e8b,'contentBase64':_0x544575[_0x2770f4(0x227)](0x8*-0x2dd+0xe3a+0x16*0x65,_0x285875)[_0x2770f4(0x1dd)](_0x2770f4(0x287)),'nextOffset':_0x48f266<_0x12448d[_0x2770f4(0x21c)]?_0x48f266:null};}finally{await _0x2df91c[_0x2770f4(0x232)]();}}export async function readAllowedFileContentRange(_0x4b091c,_0x4a7853,_0x5267e5=0x3*-0xc4c+0x258a+-0xa6*0x1,_0x1b8f6a=FILE_READ_LIMIT){const _0x3a6028=_0x67518d;if(!Number[_0x3a6028(0x24c)](_0x5267e5)||_0x5267e5<0x1*-0xe5a+-0x9b+0xef5||!Number[_0x3a6028(0x24c)](_0x1b8f6a)||_0x1b8f6a<0x158b+-0x85b+0x2d*-0x4b||_0x1b8f6a>FILE_READ_LIMIT)throw new Error(_0x3a6028(0x1a4));const {file:_0x194e7a,metadata:_0x102b50}=await resolveAllowedFile(_0x4b091c,_0x4a7853);if(_0x5267e5>_0x102b50[_0x3a6028(0x21c)])throw new Error(_0x3a6028(0x1a4));const _0xd36e40=Math[_0x3a6028(0x1d6)](_0x1b8f6a,_0x102b50[_0x3a6028(0x21c)]-_0x5267e5),_0x48777e=Buffer[_0x3a6028(0x213)](_0xd36e40),_0x5f51ae=await open(_0x194e7a,'r');try{const {bytesRead:_0x25ba6c}=await _0x5f51ae[_0x3a6028(0x1ff)](_0x48777e,0x1521*0x1+-0x3a*0xa9+-0x1129*-0x1,_0xd36e40,_0x5267e5),_0x20ad36=_0x5267e5+_0x25ba6c;return{'path':_0x194e7a,'size':_0x102b50[_0x3a6028(0x21c)],'offset':_0x5267e5,'contentBase64':_0x48777e[_0x3a6028(0x227)](0x1fe5+-0x21e0+0x1fb,_0x25ba6c)[_0x3a6028(0x1dd)](_0x3a6028(0x287)),'nextOffset':_0x20ad36<_0x102b50[_0x3a6028(0x21c)]?_0x20ad36:null};}finally{await _0x5f51ae[_0x3a6028(0x232)]();}}export async function readAllowedTextFile(_0x192c99,_0x7f4193,_0x514492=-0x17f*-0x2+0x517*0x3+-0x5*0x3a7,_0x253a58=FILE_READ_LIMIT){const _0x3ebecf=_0x67518d,{file:_0x1466ae,metadata:_0x2f096f}=await resolveAllowedFile(_0x192c99,_0x7f4193);if(_0x2f096f[_0x3ebecf(0x21c)]>FILE_READ_LIMIT*(0x49*0x4f+-0x722+-0xf55))throw new Error(_0x3ebecf(0x273));if(!Number[_0x3ebecf(0x24c)](_0x514492)||_0x514492<0x1f2*0x5+0x1a54+-0x163*0x1a||!Number[_0x3ebecf(0x24c)](_0x253a58)||_0x253a58<-0x6c*-0x7+-0x134d+-0x2e*-0x5b||_0x253a58>FILE_READ_LIMIT)throw new Error(_0x3ebecf(0x1a4));const _0x35ed75=await readFile(_0x1466ae),_0x42d51c=_0x35ed75[_0x3ebecf(0x1ef)](-0x2*0x11f+0x5ae*0x2+-0x91e)||!isValidUtf8(_0x35ed75),_0x9552a4=Math[_0x3ebecf(0x1d6)](_0x35ed75[_0x3ebecf(0x1c6)],_0x514492+_0x253a58);if(_0x42d51c){const _0x5af87f=_0x35ed75[_0x3ebecf(0x227)](_0x514492,_0x9552a4);return{'path':_0x1466ae,'encoding':_0x3ebecf(0x287),'size':_0x35ed75[_0x3ebecf(0x1c6)],'content':_0x5af87f[_0x3ebecf(0x1dd)](_0x3ebecf(0x287)),'truncated':_0x9552a4<_0x35ed75[_0x3ebecf(0x1c6)],'nextOffset':_0x9552a4<_0x35ed75[_0x3ebecf(0x1c6)]?_0x9552a4:null};}if(_0x514492>-0xaf1+-0xce*-0x16+0x241*-0x3&&_0x514492<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x514492]))throw new Error(_0x3ebecf(0x1a4));let _0x506567=_0x9552a4;if(_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x506567])){while(_0x506567>_0x514492&&isUtf8ContinuationByte(_0x35ed75[_0x506567]))_0x506567-=0x1a1*0x9+-0x788+-0x4*0x1c8;if(_0x506567===_0x514492){_0x506567+=-0x1fed+0x1*-0xa22+-0x542*-0x8;while(_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x506567]))_0x506567+=0x1*0xf21+0x1*0x12b9+0x21d9*-0x1;}}const _0x334627=_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]?_0x506567:null;return{'path':_0x1466ae,'encoding':_0x3ebecf(0x203),'size':_0x35ed75[_0x3ebecf(0x1c6)],'content':new TextDecoder(_0x3ebecf(0x203),{'fatal':!![]})[_0x3ebecf(0x230)](_0x35ed75[_0x3ebecf(0x227)](_0x514492,_0x506567)),'truncated':_0x334627!==null,'nextOffset':_0x334627};}export function normalizeFilePreviewPath(_0x293246){const _0x18eb8d=_0x67518d;if(!/^sandbox:/iu[_0x18eb8d(0x27d)](_0x293246))return _0x293246;let _0x218fd2;try{_0x218fd2=decodeURIComponent(_0x293246[_0x18eb8d(0x23f)](_0x293246[_0x18eb8d(0x292)](':')+(0x35e*0x7+-0xb63+-0xc2e)));}catch{throw new Error(_0x18eb8d(0x1cb));}const _0x4fb340=_0x218fd2[_0x18eb8d(0x1d2)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x4fb340[_0x18eb8d(0x1c6)]===0x1d*0xd7+-0x3*-0x1fd+-0x1e52||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x18eb8d(0x27d)](_0x218fd2)||!isAbsolute(_0x4fb340)&&!win32[_0x18eb8d(0x25c)](_0x4fb340)||_0x4fb340[_0x18eb8d(0x1ef)]('\x00')||_0x4fb340[_0x18eb8d(0x1ef)]('?')||_0x4fb340[_0x18eb8d(0x1ef)]('#'))throw new Error(_0x18eb8d(0x1cb));return _0x4fb340;}async function resolveAllowedFile(_0x757e5b,_0x5f58ea){const _0x3420f7=_0x67518d;if(!isAbsolute(_0x757e5b))throw new Error(_0x3420f7(0x1cb));const _0x2a15ec=await realpath(_0x757e5b)[_0x3420f7(0x221)](_0x183a69=>{const _0x43f0da=_0x3420f7;if(_0x183a69[_0x43f0da(0x1e3)]===_0x43f0da(0x260))throw new Error(_0x43f0da(0x29d));throw _0x183a69;}),_0x40455b=await Promise[_0x3420f7(0x269)](_0x5f58ea[_0x3420f7(0x275)](_0x419775=>realpath(_0x419775)));if(!isWithinAllowedRoot(_0x2a15ec,_0x40455b))throw new Error(_0x3420f7(0x1cb));const _0x2f07b0=await lstat(_0x2a15ec);if(!_0x2f07b0[_0x3420f7(0x1bf)]())throw new Error(_0x3420f7(0x1aa));return{'file':_0x2a15ec,'metadata':_0x2f07b0};}function isValidUtf8(_0x9a8fa9){const _0x1d2b6=_0x67518d;try{return new TextDecoder(_0x1d2b6(0x203),{'fatal':!![]})[_0x1d2b6(0x230)](_0x9a8fa9),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x4f6e58){return(_0x4f6e58&-0x10f1*-0x2+-0xb50+-0x26*0x93)===-0xb08+0x36+-0xa1*-0x12;}export async function searchWorkspaceFiles(_0x3bb75e,_0xeec753,_0x397e5e,_0x317d8b=SEARCH_RESULT_LIMIT,_0x2c41fa=![]){const _0xec686=_0x67518d,_0x194aaa=new WorkspaceFileIndex(_0x3bb75e);try{return await _0x194aaa[_0xec686(0x278)](_0xeec753,_0x397e5e,_0x317d8b,_0x2c41fa);}finally{_0x194aaa[_0xec686(0x1c0)]();}}async function resolveRegisteredWorkspaceRoot(_0x3e3c78){const _0x2a841e=_0x67518d,_0x1c7932=await realpath(_0x3e3c78);if(normalizeWorkspacePath(_0x1c7932)!==normalizeWorkspacePath(_0x3e3c78))throw new Error(_0x2a841e(0x1e9));return _0x1c7932;}async function resolveWorkspaceEntry(_0x2c3cbb,_0x7f59f0,_0x8c6669){const _0x4a00d4=await resolveRegisteredWorkspaceRoot(_0x2c3cbb);return resolveWorkspaceEntryFromCanonicalRoot(_0x4a00d4,_0x7f59f0,_0x8c6669);}function _0x4bb8(_0x4eb3cc,_0x4ed1f5){_0x4eb3cc=_0x4eb3cc-(-0xc5*-0x1+-0x223+0x4d*0xa);const _0x591490=_0x537c();let _0x4ec3b3=_0x591490[_0x4eb3cc];if(_0x4bb8['ecaKKI']===undefined){var _0x4d0195=function(_0x14ce7f){const _0xc7071a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1ae36c='',_0x389563='';for(let _0x1d2319=0x1*-0x21a7+0x963+0x2*0xc22,_0x3b6c41,_0x15b0ff,_0x29110d=-0x1*-0xd06+0x2423+0x347*-0xf;_0x15b0ff=_0x14ce7f['charAt'](_0x29110d++);~_0x15b0ff&&(_0x3b6c41=_0x1d2319%(0x12d+-0x1378+0x124f)?_0x3b6c41*(0x10be+-0x1*-0x1462+0x24e*-0x10)+_0x15b0ff:_0x15b0ff,_0x1d2319++%(-0x1*0x508+0x1416+0x785*-0x2))?_0x1ae36c+=String['fromCharCode'](0x2256+-0x1867*0x1+-0x8f0&_0x3b6c41>>(-(-0x398+-0x21d7*-0x1+-0x1e3d)*_0x1d2319&0x15ef+-0xc29+0x34*-0x30)):0x17f5*-0x1+-0x5bf+0x1*0x1db4){_0x15b0ff=_0xc7071a['indexOf'](_0x15b0ff);}for(let _0x4f75df=-0x1bc5+-0x2*0xcbf+-0x2d*-0x12f,_0x5a58b2=_0x1ae36c['length'];_0x4f75df<_0x5a58b2;_0x4f75df++){_0x389563+='%'+('00'+_0x1ae36c['charCodeAt'](_0x4f75df)['toString'](-0x1*-0x1841+-0xe2d+0x4*-0x281))['slice'](-(0x4*0x5b0+-0x1b95+0x4d7));}return decodeURIComponent(_0x389563);};_0x4bb8['YkgbPQ']=_0x4d0195,_0x4bb8['tvBYGw']={},_0x4bb8['ecaKKI']=!![];}const _0x4e769d=_0x591490[-0x3*-0xa1b+-0x25e5+-0x5*-0x184];_0x4bb8['EkcmCC']!==_0x4e769d&&(_0x4bb8['tvBYGw']={},_0x4bb8['EkcmCC']=_0x4e769d);const _0x20929a=_0x4bb8['tvBYGw'][_0x4eb3cc];return _0x20929a===undefined?(_0x4ec3b3=_0x4bb8['YkgbPQ'](_0x4ec3b3),_0x4bb8['tvBYGw'][_0x4eb3cc]=_0x4ec3b3):_0x4ec3b3=_0x20929a,_0x4ec3b3;}async function resolveWorkspaceEntryFromCanonicalRoot(_0x3c18d2,_0x36fbbf,_0xa992f7){const _0x490418=_0x67518d,_0x202efa=await resolveWorkspaceEntryMetadata(_0x3c18d2,_0x36fbbf);if(_0xa992f7?!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1cd)]():!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1bf)]()&&!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1cd)]())throw new Error(_0xa992f7?_0x490418(0x1fa):_0x490418(0x1aa));return _0x202efa[_0x490418(0x21a)];}async function resolveWorkspaceEntryMetadata(_0x25b3bc,_0x55c0fd){const _0x42b9ff=_0x67518d;if(_0x55c0fd[_0x42b9ff(0x1ef)]('\x00')||_0x55c0fd[_0x42b9ff(0x1c6)]===-0x1a5*-0x7+-0x2f*-0xc7+-0x6*0x802||_0x55c0fd[_0x42b9ff(0x1b9)]('/')||_0x55c0fd[_0x42b9ff(0x1b9)]('\x5c'))throw new Error(_0x42b9ff(0x1cb));const _0xfbc209=_0x55c0fd[_0x42b9ff(0x254)]('\x5c','/');if(_0xfbc209[_0x42b9ff(0x1eb)]('/')[_0x42b9ff(0x252)](_0x3e3c54=>_0x3e3c54==='..'||_0x3e3c54===_0x42b9ff(0x2a6)))throw new Error(_0x42b9ff(0x1cb));let _0xcced74;try{_0xcced74=await realpath(resolve(_0x25b3bc,_0xfbc209));}catch(_0x485a92){if(_0x485a92[_0x42b9ff(0x1e3)]===_0x42b9ff(0x260))throw new Error(_0x42b9ff(0x29d));throw _0x485a92;}const _0x13c4e4=relative(_0x25b3bc,_0xcced74);if(isAbsolute(_0x13c4e4)||_0x13c4e4[_0x42b9ff(0x1b9)]('..')||_0x13c4e4==='..'||_0x13c4e4[_0x42b9ff(0x1b9)]('..'+sep))throw new Error(_0x42b9ff(0x1cb));const _0x2b40ef=await lstat(_0xcced74);return{'path':_0xcced74,'metadata':_0x2b40ef};}async function inspectWorkspaceIndexEntry(_0x2a1d96,_0x35f69e,_0xf958f5){const _0x42618a=_0x67518d;try{const _0x2a5743=await resolveWorkspaceEntryMetadata(_0x2a1d96,_0x35f69e);if(!_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1bf)]()&&!_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1cd)]())return undefined;const _0xd77873=relative(_0x2a1d96,_0x2a5743[_0x42618a(0x21a)])[_0x42618a(0x1eb)](sep)[_0x42618a(0x223)]('/');return _0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1cd)]()?{'path':_0xd77873,'name':_0xf958f5,'kind':_0x42618a(0x298),'size':null,'modifiedAt':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1e2)]}:{'path':_0xd77873,'name':_0xf958f5,'kind':_0x42618a(0x1ac),'size':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x21c)],'modifiedAt':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1e2)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x196062,_0x383f7d){const _0x36d621=_0x67518d;return Buffer[_0x36d621(0x29a)](JSON[_0x36d621(0x1a9)]({'path':_0x196062,'name':_0x383f7d}))[_0x36d621(0x1dd)](_0x36d621(0x288));}function decodeDirectoryCursor(_0x45371e,_0xa4e593){const _0x114a20=_0x67518d;if(_0x45371e===undefined)return undefined;try{const _0x123567=JSON[_0x114a20(0x283)](Buffer[_0x114a20(0x29a)](_0x45371e,_0x114a20(0x288))[_0x114a20(0x1dd)](_0x114a20(0x2be)));if(typeof _0x123567!==_0x114a20(0x1ec)||_0x123567===null||_0x123567[_0x114a20(0x21a)]!==_0xa4e593||typeof _0x123567[_0x114a20(0x209)]!==_0x114a20(0x1f4))throw new Error();return _0x123567[_0x114a20(0x209)];}catch{throw new Error(_0x114a20(0x1bc));}}function encodeSearchCursor(_0x4504ef,_0x4305b0){const _0x2c24f2=_0x67518d;return Buffer[_0x2c24f2(0x29a)](JSON[_0x2c24f2(0x1a9)]({'query':_0x4504ef,'path':_0x4305b0}))[_0x2c24f2(0x1dd)](_0x2c24f2(0x288));}function decodeSearchCursor(_0x24ce8f,_0x574477){const _0x8b4542=_0x67518d;if(_0x24ce8f===undefined)return undefined;try{const _0x1b8ea5=JSON[_0x8b4542(0x283)](Buffer[_0x8b4542(0x29a)](_0x24ce8f,_0x8b4542(0x288))[_0x8b4542(0x1dd)](_0x8b4542(0x2be)));if(typeof _0x1b8ea5!==_0x8b4542(0x1ec)||_0x1b8ea5===null||_0x1b8ea5[_0x8b4542(0x251)]!==_0x574477||typeof _0x1b8ea5[_0x8b4542(0x21a)]!==_0x8b4542(0x1f4))throw new Error();return _0x1b8ea5[_0x8b4542(0x21a)];}catch{throw new Error(_0x8b4542(0x1bc));}}export function normalizeWorkspacePath(_0x170cfd,_0x2d182b=_0x498f63()){const _0x237c64=_0x67518d;if(_0x170cfd[_0x237c64(0x1c6)]===-0x4ec+0xda*-0x1e+0x2*0xf3c||_0x170cfd[_0x237c64(0x1ef)]('\u0000'))throw new Error(_0x237c64(0x1a5));if(_0x2d182b===_0x237c64(0x2c6)){if(/^\\\\[?.]/[_0x237c64(0x27d)](_0x170cfd))throw new Error(_0x237c64(0x28f));const _0x40d8d6=win32[_0x237c64(0x285)](_0x170cfd[_0x237c64(0x254)]('/','\x5c'));if(!win32[_0x237c64(0x25c)](_0x40d8d6))throw new Error(_0x237c64(0x1ce));return _0x40d8d6[_0x237c64(0x1d2)](/\\+$/,'')[_0x237c64(0x1a7)]();}if(_0x2d182b!==_0x237c64(0x2a7))throw new Error(_0x237c64(0x27f));const _0x538449=posix[_0x237c64(0x285)](_0x170cfd);if(!posix[_0x237c64(0x25c)](_0x538449))throw new Error(_0x237c64(0x1ce));return _0x538449==='/'?_0x538449:_0x538449[_0x237c64(0x1d2)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1a29cd,_0x97f32b,_0x140ae2=_0x498f63()){const _0x2a8134=_0x67518d,_0x5405ea=normalizeWorkspacePath(_0x1a29cd,_0x140ae2),_0xdad8d3=_0x140ae2===_0x2a8134(0x2c6)?win32:posix;return _0x97f32b[_0x2a8134(0x252)](_0x375c02=>{const _0x368a0c=_0x2a8134,_0x2dc824=normalizeWorkspacePath(_0x375c02,_0x140ae2),_0x5835be=_0xdad8d3[_0x368a0c(0x2aa)](_0x2dc824,_0x5405ea);return _0x5835be===''||!_0x5835be[_0x368a0c(0x1b9)]('..')&&!_0xdad8d3[_0x368a0c(0x25c)](_0x5835be);});}export async function inspectWorkspace(_0x3a05cb,_0x8242ff){const _0x1c7358=_0x67518d,_0x361fb5=await realpath(_0x3a05cb),_0x18c5e5=await Promise[_0x1c7358(0x269)](_0x8242ff[_0x1c7358(0x275)](_0x51cb92=>realpath(_0x51cb92))),_0x4f75ae=await stat(_0x361fb5);if(!_0x4f75ae[_0x1c7358(0x1cd)]()||!isWithinAllowedRoot(_0x361fb5,_0x18c5e5))throw new Error(_0x1c7358(0x1e9));try{const _0x58168e=await readGitSummary(_0x361fb5);return{'path':_0x361fb5,'kind':_0x1c7358(0x215),'gitSummary':_0x58168e};}catch(_0xd1249a){if(_0xd1249a instanceof GitCommandError&&_0xd1249a[_0x1c7358(0x1e3)]===-0xe*0xef+-0xe5c+0x11e*0x19||isGitUnavailable(_0xd1249a))return{'path':_0x361fb5,'kind':_0x1c7358(0x298)};throw _0xd1249a;}}export async function readGitSummary(_0x5e4c72){const _0x402ee2=_0x67518d,_0x3e6882=(await runReadOnlyGit(_0x5e4c72,[_0x402ee2(0x240),_0x402ee2(0x1b2)]))[_0x402ee2(0x247)][_0x402ee2(0x25d)](),_0x3b76ed=await runReadOnlyGitAllowFailure(_0x5e4c72,[_0x402ee2(0x240),_0x402ee2(0x235),_0x402ee2(0x1c1)]),_0x11662d=await runReadOnlyGitAllowFailure(_0x5e4c72,[_0x402ee2(0x22d),_0x402ee2(0x22a),_0x402ee2(0x250),_0x402ee2(0x1c1)]),_0x4ee619={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x3b523a=await runReadOnlyGit(_0x5e4c72,[_0x402ee2(0x220),_0x402ee2(0x2a8)],_0x4ee619);return{'commonDir':_0x3e6882,'head':_0x3b76ed[_0x402ee2(0x1e3)]===-0x1e29*0x1+-0x98+0x1ec1?_0x3b76ed[_0x402ee2(0x247)][_0x402ee2(0x25d)]():'','branch':_0x11662d[_0x402ee2(0x1e3)]===-0xc61*0x1+0xa8*0x3b+0x1*-0x1a57?_0x11662d[_0x402ee2(0x247)][_0x402ee2(0x25d)]():null,'dirty':_0x3b523a[_0x402ee2(0x2a4)][_0x402ee2(0x1c6)]>-0x1*0x110b+0x507*-0x7+0x343c,'snapshot':summarizeText(_0x3b523a[_0x402ee2(0x247)])};}export function assertSafeGitRef(_0xd18e54){const _0x30ddb0=_0x67518d;if(!REF_PATTERN[_0x30ddb0(0x27d)](_0xd18e54))throw new Error(_0x30ddb0(0x1fb));}export async function readRestrictedDiff(_0x1f24fe,_0x5f0f24,_0x50c3b7){const _0x169b2e=_0x67518d;assertSafeGitRef(_0x5f0f24),assertSafeGitRef(_0x50c3b7);const _0x2d232e=await runReadOnlyGit(_0x1f24fe,[_0x169b2e(0x20c),_0x169b2e(0x1c8),_0x169b2e(0x20d),_0x5f0f24,_0x50c3b7]),_0x36a70f=_0x2d232e[_0x169b2e(0x2a4)][_0x169b2e(0x1ef)](0x1*0xa2b+-0x734*0x1+-0x2f7)||_0x2d232e[_0x169b2e(0x247)][_0x169b2e(0x1ef)](_0x169b2e(0x226));if(_0x36a70f)return{'binary':!![],'summary':_0x169b2e(0x1e4)+createHash(_0x169b2e(0x2a9))[_0x169b2e(0x200)](_0x2d232e[_0x169b2e(0x2a4)])[_0x169b2e(0x214)](_0x169b2e(0x26f))+_0x169b2e(0x282)+_0x2d232e[_0x169b2e(0x2a4)][_0x169b2e(0x1c6)],'truncated':_0x2d232e[_0x169b2e(0x23e)]};return{'binary':![],'text':_0x2d232e[_0x169b2e(0x247)],'truncated':_0x2d232e[_0x169b2e(0x23e)]};}function currentBranchFromStatusHeader(_0x11975b){const _0x5ab548=_0x67518d,_0x3fb951=_0x11975b[_0x5ab548(0x23f)](-0xb74+0x203c+-0x14c5);if(_0x3fb951[_0x5ab548(0x1b9)](_0x5ab548(0x1be)))return null;const _0x396f2c=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x5ab548(0x22e)](_0x3fb951);if(_0x396f2c!==null)return _0x396f2c[-0x2*0xc38+0x7*-0x18b+0x233e]??null;return _0x3fb951[_0x5ab548(0x1eb)](_0x5ab548(0x245))[-0x2d*0xbf+0x2*-0x83+0x2299]?.[_0x5ab548(0x1eb)]('\x20')[-0x1*-0x96d+0x1*0x2668+-0x4f*0x9b]??null;}export async function readCurrentChangesSummary(_0x2aa641){const _0x205e84=_0x67518d,_0x2a92a4=await runReadOnlyGit(_0x2aa641,[_0x205e84(0x220),_0x205e84(0x2a8),'-z',_0x205e84(0x26b),_0x205e84(0x248)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x2abd80=_0x2a92a4[_0x205e84(0x247)][_0x205e84(0x1eb)]('\x00'),_0x1ad2e7=_0x2abd80[_0x205e84(0x23c)]()??'',_0x2859c5=[];for(let _0xb96f22=0x30b*-0x3+-0x161e+-0x1f3f*-0x1;_0xb96f22<_0x2abd80[_0x205e84(0x1c6)];_0xb96f22+=-0x1947*-0x1+0x1*0x1982+-0x32c8){const _0x20391b=_0x2abd80[_0xb96f22];if(_0x20391b[_0x205e84(0x1c6)]<0x1dc5+0x1327+-0x30e8)continue;const _0x31ae38=_0x20391b[-0x1070+0x2c*0x3d+-0x7f*-0xc],_0x3993b0=_0x20391b[0x1e7d*0x1+-0x22d*-0x7+-0x2db7],_0x1759d3=_0x20391b[_0x205e84(0x23f)](-0x3d*-0x14+-0x7*-0x2fb+-0x199e);if(_0x31ae38==='?'&&_0x3993b0==='?'){_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x29b),'change':_0x205e84(0x297)});continue;}_0x31ae38!=='\x20'&&_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x20e),'change':gitChange(_0x31ae38)});_0x3993b0!=='\x20'&&_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x26c),'change':gitChange(_0x3993b0)});if(_0x31ae38==='R'||_0x31ae38==='C'||_0x3993b0==='R'||_0x3993b0==='C')_0xb96f22+=-0x26a6+0x78e+0x1f19*0x1;}return{'branch':_0x1ad2e7[_0x205e84(0x1b9)](_0x205e84(0x2a0))?currentBranchFromStatusHeader(_0x1ad2e7):null,'changes':_0x2859c5};}export async function listInitializedSubmodulePaths(_0x24f712){const _0x441019=_0x67518d,_0x4de737=await runReadOnlyGit(_0x24f712,[_0x441019(0x1d0),_0x441019(0x220),_0x441019(0x219)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x4de737[_0x441019(0x247)][_0x441019(0x1eb)](/\r?\n/)[_0x441019(0x2b0)](_0x3dbf67=>{const _0xcdb049=_0x441019;if(_0x3dbf67[_0xcdb049(0x1c6)]<-0x3a*0x85+-0x1a48*0x1+0x354*0x11)return[];const _0x46c8f1=_0x3dbf67[0x114+-0x43*-0x43+-0x129d];if(_0x46c8f1==='-')return[];const _0x1b898c=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0xcdb049(0x22e)](_0x3dbf67),_0x474f07=_0x1b898c?.[0xd*0xf8+0x1540+-0x21d7]?.[_0xcdb049(0x254)]('\x5c','/');return _0x474f07===undefined||_0x474f07[_0xcdb049(0x1c6)]===0x3b*-0x9f+-0x22af+0x4754*0x1?[]:[_0x474f07];})[_0x441019(0x2c8)]((_0x3e70ba,_0x4a371b)=>_0x3e70ba[_0x441019(0x1f9)](_0x4a371b));}export async function resolveGitRepository(_0x4e5e23,_0x18d397,_0x3dce04){const _0x259fd1=_0x67518d,_0x55e69e=await realpath(_0x4e5e23);if(_0x18d397[_0x259fd1(0x1c6)]===0x1*0x1e19+-0x236c+0x553)return _0x55e69e;if(_0x18d397[_0x259fd1(0x1ef)]('\x00')||_0x18d397[_0x259fd1(0x1b9)]('/')||_0x18d397[_0x259fd1(0x1b9)]('\x5c')||_0x18d397[_0x259fd1(0x1eb)]('/')[_0x259fd1(0x252)](_0x1039e0=>_0x1039e0[_0x259fd1(0x1c6)]===-0x2*0x7ce+-0x4*0x243+0x18a8||_0x1039e0==='.'||_0x1039e0==='..'))throw new Error(_0x259fd1(0x218));try{const _0x3fe054=resolve(_0x55e69e,_0x18d397),_0x32541c=await realpath(_0x3fe054);if(normalizeWorkspacePath(_0x3fe054)!==normalizeWorkspacePath(_0x32541c)||!isWithinAllowedRoot(_0x32541c,[_0x55e69e]))throw new Error(_0x259fd1(0x2b6));if(_0x3dce04!==undefined){if(!_0x3dce04[_0x259fd1(0x1ef)](_0x18d397))throw new Error(_0x259fd1(0x2b6));return _0x32541c;}return await assertGitSuperprojectChain(_0x55e69e,_0x32541c),_0x32541c;}catch{throw new Error(_0x259fd1(0x218));}}async function assertGitSuperprojectChain(_0x649d3a,_0x49cc22){const _0xcbc349=_0x67518d,_0x5267a2=normalizeWorkspacePath(_0x649d3a);let _0x1ae0f5=_0x49cc22;const _0x274645=new Set();for(let _0x95888c=-0x20e8+-0x165a*0x1+0x3742;_0x95888c<-0xd92+-0xbf1*0x3+0x31a5;_0x95888c+=0x20e+0xe7c+0x33*-0x53){const _0x59b2a8=normalizeWorkspacePath(_0x1ae0f5);if(_0x59b2a8===_0x5267a2)return;if(_0x274645[_0xcbc349(0x205)](_0x59b2a8))throw new Error(_0xcbc349(0x2b6));_0x274645[_0xcbc349(0x261)](_0x59b2a8);const _0x5d5bf3=await runReadOnlyGit(_0x1ae0f5,[_0xcbc349(0x240),_0xcbc349(0x279),_0xcbc349(0x1da)]),[_0x293760,_0x10e9d9]=_0x5d5bf3[_0xcbc349(0x247)][_0xcbc349(0x1eb)](/\r?\n/);if(_0x293760===undefined||_0x10e9d9===undefined||_0x10e9d9[_0xcbc349(0x1c6)]===0x119*0xa+0x1c09*0x1+0x2703*-0x1)throw new Error(_0xcbc349(0x2b6));const _0x560888=await realpath(_0x293760),_0x480729=await realpath(_0x10e9d9);if(normalizeWorkspacePath(_0x560888)!==_0x59b2a8||normalizeWorkspacePath(_0x480729)===_0x59b2a8||!isWithinAllowedRoot(_0x480729,[_0x649d3a])||!isWithinAllowedRoot(_0x1ae0f5,[_0x480729]))throw new Error(_0xcbc349(0x2b6));_0x1ae0f5=_0x480729;}throw new Error(_0xcbc349(0x2b6));}export async function listGitHistoryRefs(_0x5768db){const _0x2c749f=_0x67518d,_0x41231b=await runReadOnlyGit(_0x5768db,[_0x2c749f(0x299),_0x2c749f(0x289),_0x2c749f(0x29c),_0x2c749f(0x222)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x41231b[_0x2c749f(0x247)][_0x2c749f(0x1eb)](/\r?\n/)[_0x2c749f(0x2b0)](_0x3c0c0f=>{const _0xd733eb=_0x2c749f,[_0x3389f6,_0x48aad8,_0x3d8a28,_0x129f9d,_0x5386d2]=_0x3c0c0f[_0xd733eb(0x1eb)]('\x09');if(_0x3389f6===undefined||_0x48aad8===undefined||_0x3d8a28===undefined||_0x5386d2===undefined||_0x5386d2[_0xd733eb(0x1c6)]>-0x8*-0x3f2+0x252+0x2*-0x10f1||!/^[0-9a-f]{40,64}$/[_0xd733eb(0x27d)](_0x3d8a28))return[];const _0x3ef399=_0x3389f6[_0xd733eb(0x1b9)](_0xd733eb(0x258))?_0xd733eb(0x204):_0x3389f6[_0xd733eb(0x1b9)](_0xd733eb(0x2ad))?_0xd733eb(0x24b):undefined;return _0x3ef399===undefined?[]:[{'name':_0x3389f6,'displayName':_0x48aad8,'kind':_0x3ef399,'hash':_0x3d8a28,'current':_0x129f9d==='*'}];})[_0x2c749f(0x2c8)]((_0x59e8a1,_0x412b1a)=>_0x59e8a1[_0x2c749f(0x1f8)][_0x2c749f(0x1f9)](_0x412b1a[_0x2c749f(0x1f8)])||_0x59e8a1[_0x2c749f(0x281)][_0x2c749f(0x1f9)](_0x412b1a[_0x2c749f(0x281)]));}function selectedHistoryRefs(_0xa0b927,_0x3f1e1b){const _0x377dbf=_0x67518d;if(_0x3f1e1b===undefined||_0x3f1e1b[_0x377dbf(0x1c6)]===-0x1*0x1199+-0x25a0+0x1*0x3739)return _0xa0b927;const _0xfff8a4=[...new Set(_0x3f1e1b)],_0x37b18a=_0xfff8a4[_0x377dbf(0x275)](_0xee1e93=>_0xa0b927[_0x377dbf(0x1ea)](_0x47e4cc=>_0x47e4cc[_0x377dbf(0x209)]===_0xee1e93));if(_0x37b18a[_0x377dbf(0x252)](_0x4adaf9=>_0x4adaf9===undefined))throw new Error(_0x377dbf(0x1d5));return _0x37b18a;}function historyCursor(_0xc20a4c,_0x182600){const _0x2d3026=_0x67518d;return Buffer[_0x2d3026(0x29a)](JSON[_0x2d3026(0x1a9)]({'offset':_0xc20a4c,'fingerprint':_0x182600}))[_0x2d3026(0x1dd)](_0x2d3026(0x288));}function parseHistoryCursor(_0xf99dc3,_0x39051f){const _0x250379=_0x67518d;if(_0xf99dc3===undefined)return-0x1872+0x7f7*-0x2+0x2860;try{const _0x51f751=JSON[_0x250379(0x283)](Buffer[_0x250379(0x29a)](_0xf99dc3,_0x250379(0x288))[_0x250379(0x1dd)](_0x250379(0x2be)));if(!Number[_0x250379(0x259)](_0x51f751[_0x250379(0x1f2)])||_0x51f751[_0x250379(0x1f2)]<-0xccf+-0x1d6b+0x2a3a||_0x51f751[_0x250379(0x2b2)]!==_0x39051f)throw new Error(_0x250379(0x2b6));return _0x51f751[_0x250379(0x1f2)];}catch{throw new Error(_0x250379(0x1c4));}}export async function readGitHistory(_0x2e217e,_0x503de7){const _0x509e6a=_0x67518d,_0x4248f9=await listGitHistoryRefs(_0x2e217e),_0x741b0e=selectedHistoryRefs(_0x4248f9,_0x503de7[_0x509e6a(0x239)]);if(_0x741b0e[_0x509e6a(0x1c6)]===-0x1*-0x1b9b+-0x1*0x17ef+-0x3ac)return{'commits':[],'nextCursor':null};const _0x4154c3=_0x503de7[_0x509e6a(0x1b7)]??-0x891+-0x177+0xa3a;if(!Number[_0x509e6a(0x259)](_0x4154c3)||_0x4154c3<-0x85+0x1ea2+-0x29*0xbc||_0x4154c3>0x1691*-0x1+-0x153*-0x5+0x1056)throw new Error(_0x509e6a(0x1dc));const _0xfbb0e9=_0x741b0e[_0x509e6a(0x275)](_0x5b1c41=>_0x5b1c41[_0x509e6a(0x209)])[_0x509e6a(0x2c8)](),_0x340274=_0x503de7[_0x509e6a(0x239)]===undefined||_0x503de7[_0x509e6a(0x239)][_0x509e6a(0x1c6)]===-0x1488+-0xd4d+0x21d5||_0x741b0e[_0x509e6a(0x1c6)]===_0x4248f9[_0x509e6a(0x1c6)]&&_0x741b0e[_0x509e6a(0x293)](_0x441fcd=>_0x4248f9[_0x509e6a(0x252)](_0x2def2f=>_0x2def2f[_0x509e6a(0x209)]===_0x441fcd[_0x509e6a(0x209)])),_0x501ef6=_0x340274?[_0x509e6a(0x2bc),_0x509e6a(0x210)]:_0xfbb0e9,_0x2be41e=createHash(_0x509e6a(0x2a9))[_0x509e6a(0x200)](_0x741b0e[_0x509e6a(0x275)](_0x2469cb=>_0x2469cb[_0x509e6a(0x209)]+'\x00'+_0x2469cb[_0x509e6a(0x1c2)])[_0x509e6a(0x2c8)]()[_0x509e6a(0x223)]('\x00'))[_0x509e6a(0x214)](_0x509e6a(0x26f)),_0x150331=parseHistoryCursor(_0x503de7[_0x509e6a(0x2c3)],_0x2be41e),_0x37967f=await runReadOnlyGit(_0x2e217e,[_0x509e6a(0x225),_0x509e6a(0x2ba),_0x509e6a(0x2ae),_0x509e6a(0x1bb)+_0x150331,_0x509e6a(0x1e0)+(_0x4154c3+(-0x19a0+0x29f+-0x1f*-0xbe)),'-z',_0x509e6a(0x2c1),..._0x501ef6,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x92751=new Map();for(const _0x19cc42 of _0x4248f9){const _0x1400ee=_0x92751[_0x509e6a(0x244)](_0x19cc42[_0x509e6a(0x1c2)])??[];_0x1400ee[_0x509e6a(0x1f6)](_0x19cc42[_0x509e6a(0x281)]),_0x92751[_0x509e6a(0x1b0)](_0x19cc42[_0x509e6a(0x1c2)],_0x1400ee);}const _0x452de7=_0x37967f[_0x509e6a(0x247)][_0x509e6a(0x1eb)]('\x00'),_0x5d6de6=[];for(let _0x1426a9=0x499*-0x7+-0x837*0x3+0x38d4;_0x1426a9+(-0x2*-0x73a+-0x1*-0x1312+-0x2181)<_0x452de7[_0x509e6a(0x1c6)];_0x1426a9+=0x4*0x8ea+-0x2681+0xf*0x31){const [_0x3b9f0a,_0x47e154='',_0x44e730='',_0x1bee6f='',_0xde271a='0',_0x2a53c1='']=_0x452de7[_0x509e6a(0x23f)](_0x1426a9,_0x1426a9+(0x2*-0x3e1+0x1810+-0x1048));if(_0x3b9f0a===undefined||!/^[0-9a-f]{40,64}$/[_0x509e6a(0x27d)](_0x3b9f0a))continue;_0x5d6de6[_0x509e6a(0x1f6)]({'hash':_0x3b9f0a,'parents':_0x47e154[_0x509e6a(0x1c6)]===-0x26b6+-0x19f8+0x22*0x1e7?[]:_0x47e154[_0x509e6a(0x1eb)]('\x20'),'authorName':_0x44e730,'authorEmail':_0x1bee6f,'committedAt':Number(_0xde271a)*(-0x25+0x1545+-0x1138),'subject':_0x2a53c1,'refs':_0x92751[_0x509e6a(0x244)](_0x3b9f0a)??[]});}const _0x5a3159=_0x5d6de6[_0x509e6a(0x1c6)]>_0x4154c3;return{'commits':_0x5d6de6[_0x509e6a(0x23f)](-0x1c9*0x7+0x3*0xb67+-0x15b6,_0x4154c3),'nextCursor':_0x5a3159?historyCursor(_0x150331+_0x4154c3,_0x2be41e):null};}async function assertHistoryCommitReachable(_0x206caf,_0x60b35c,_0x531174){const _0x662538=_0x67518d;if(!/^[0-9a-f]{40,64}$/[_0x662538(0x27d)](_0x60b35c))throw new Error(_0x662538(0x1e1));const _0x10c2d2=selectedHistoryRefs(await listGitHistoryRefs(_0x206caf),_0x531174);for(const _0x3cbd8f of _0x10c2d2){const _0x4b69b1=await runReadOnlyGitAllowFailure(_0x206caf,[_0x662538(0x270),_0x662538(0x21d),_0x60b35c,_0x3cbd8f[_0x662538(0x209)]]);if(_0x4b69b1[_0x662538(0x1e3)]===0x24ca+0x359+0x1*-0x2823)return;}throw new Error(_0x662538(0x1e1));}export async function readGitHistoryFiles(_0x18a4df,_0xe5d54a,_0x1765c3){const _0x22be58=_0x67518d;await assertHistoryCommitReachable(_0x18a4df,_0xe5d54a,_0x1765c3);const _0x548a20=await runReadOnlyGit(_0x18a4df,[_0x22be58(0x1ba),_0x22be58(0x1ee),_0x22be58(0x217),_0x22be58(0x255),'-r','-z','-M','-C',_0x22be58(0x243),_0xe5d54a],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x5035aa=_0x548a20[_0x22be58(0x247)][_0x22be58(0x1eb)]('\x00'),_0x282ec5=[];for(let _0x1abcb9=-0x291*0x9+-0x111d*-0x2+-0xb21*0x1;_0x1abcb9<_0x5035aa[_0x22be58(0x1c6)];_0x1abcb9+=-0x1*0x18ad+0x2d+0x11*0x171){const _0x309a67=_0x5035aa[_0x1abcb9];if(_0x309a67===undefined||_0x309a67[_0x22be58(0x1c6)]===-0xedb*0x2+0x1c1b*-0x1+0x39d1)continue;const _0x3a847e=_0x309a67[-0x1*-0x1d1d+0x6*-0x1e1+0x1*-0x11d7]??'M';if(_0x3a847e==='R'||_0x3a847e==='C'){const _0x26411c=_0x5035aa[_0x1abcb9+(-0x1*0x1897+0x2*0x90f+0x33d*0x2)],_0x4aba5a=_0x5035aa[_0x1abcb9+(0xf*-0x1+0x2701+-0x26f0)];if(_0x26411c!==undefined&&_0x4aba5a!==undefined)_0x282ec5[_0x22be58(0x1f6)]({'path':_0x4aba5a,'previousPath':_0x26411c,'change':gitChange(_0x3a847e)});_0x1abcb9+=0x13f6+0x10*-0xb4+-0x8b4;}else{const _0x57376f=_0x5035aa[_0x1abcb9+(0x1483+0x149*0x1c+-0x387e)];if(_0x57376f!==undefined)_0x282ec5[_0x22be58(0x1f6)]({'path':_0x57376f,'change':gitChange(_0x3a847e)});_0x1abcb9+=0x157*-0x4+-0x12e7+0x1844;}}return _0x282ec5;}export async function readGitHistoryFileDiff(_0x1a96fb,_0x2e289c,_0x2ebf56,_0x54dc6c,_0x2c6ab6){const _0x13cfd6=_0x67518d;await assertHistoryCommitReachable(_0x1a96fb,_0x2e289c,_0x54dc6c);const _0x30ef1a=safeGitWorkspacePath(_0x2ebf56),_0x342522=_0x2c6ab6===undefined?undefined:safeGitWorkspacePath(_0x2c6ab6),_0x6d9967=await runReadOnlyGit(_0x1a96fb,[_0x13cfd6(0x25b),_0x13cfd6(0x21f),_0x13cfd6(0x217),_0x13cfd6(0x1c8),_0x13cfd6(0x20d),_0x2e289c,'--',_0x13cfd6(0x262)+_0x30ef1a,..._0x342522===undefined||_0x342522===_0x30ef1a?[]:[_0x13cfd6(0x262)+_0x342522]]),_0x3c880d=_0x6d9967[_0x13cfd6(0x2a4)][_0x13cfd6(0x1ef)](0x1838+0x13*-0x3+-0x17ff)||_0x6d9967[_0x13cfd6(0x247)][_0x13cfd6(0x1ef)](_0x13cfd6(0x226));if(_0x3c880d)return{'binary':!![],'summary':_0x13cfd6(0x1e4)+createHash(_0x13cfd6(0x2a9))[_0x13cfd6(0x200)](_0x6d9967[_0x13cfd6(0x2a4)])[_0x13cfd6(0x214)](_0x13cfd6(0x26f))+_0x13cfd6(0x282)+_0x6d9967[_0x13cfd6(0x2a4)][_0x13cfd6(0x1c6)],'truncated':_0x6d9967[_0x13cfd6(0x23e)]};return{'binary':![],'text':_0x6d9967[_0x13cfd6(0x247)],'truncated':_0x6d9967[_0x13cfd6(0x23e)]};}export async function readGitHistoryFileContentRange(_0x17440e,_0x511951,_0x579a2a,_0x487d47,_0x3d61d5,_0x40320b){const _0x521e53=_0x67518d;if(!Number[_0x521e53(0x24c)](_0x487d47)||_0x487d47<-0x11b*-0x1f+0x20ea+-0x75*0x93||!Number[_0x521e53(0x24c)](_0x3d61d5)||_0x3d61d5<0x1b6e+-0x186f+-0x2fe||_0x3d61d5>(-0x1142*0x1+-0xc3*-0x2d+-0x10f1)*(0x3*-0xada+0x14*0x116+0x3*0x4f2)*(-0x1ae8+0x19b5+0x533)||_0x487d47+_0x3d61d5>(0xe57+0x1afd+-0x2940)*(-0x170c+-0x74a+0x2256)*(-0x1*-0xd91+-0x1fbd*0x1+0x2*0xb16))throw new Error(_0x521e53(0x1a4));await assertHistoryCommitReachable(_0x17440e,_0x511951,_0x40320b);const _0xb65682=safeGitWorkspacePath(_0x579a2a),_0x553234=_0x511951+':'+_0xb65682,_0x1d32a3=await runReadOnlyGit(_0x17440e,[_0x521e53(0x206),'-s',_0x553234]),_0x149243=Number(_0x1d32a3[_0x521e53(0x247)][_0x521e53(0x25d)]());if(!Number[_0x521e53(0x24c)](_0x149243)||_0x149243<0xc90*-0x1+-0x1b9c+0x6b2*0x6||_0x487d47>_0x149243)throw new Error(_0x521e53(0x1a4));if(_0x487d47===_0x149243)return{'path':_0xb65682,'size':_0x149243,'offset':_0x487d47,'contentBase64':'','nextOffset':null};const _0x29bbaa=await runReadOnlyGitAllowFailure(_0x17440e,[_0x521e53(0x206),_0x521e53(0x2a1),_0x553234],{'outputLimit':_0x487d47+_0x3d61d5,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0x29bbaa[_0x521e53(0x1e3)]!==-0x2*0x1072+0xfb6+0x112e)throw new GitCommandError(_0x29bbaa[_0x521e53(0x1e3)],_0x29bbaa[_0x521e53(0x1d7)]);const _0x4c2634=_0x29bbaa[_0x521e53(0x2a4)][_0x521e53(0x227)](_0x487d47,Math[_0x521e53(0x1d6)](_0x149243,_0x487d47+_0x3d61d5)),_0x2be114=_0x487d47+_0x4c2634[_0x521e53(0x1c6)];return{'path':_0xb65682,'size':_0x149243,'offset':_0x487d47,'contentBase64':_0x4c2634[_0x521e53(0x1dd)](_0x521e53(0x287)),'nextOffset':_0x2be114<_0x149243?_0x2be114:null};}export async function readCurrentChanges(_0x1fe211){const _0x1f1fec=_0x67518d;return(await readCurrentChangesSummary(_0x1fe211))[_0x1f1fec(0x1d4)];}export async function readCurrentChangeDiff(_0x1f0022,_0x4c9a57){const _0x124335=_0x67518d,_0x10f0d4=safeGitWorkspacePath(_0x4c9a57);await assertCurrentChangePathAccessible(_0x1f0022,_0x10f0d4);const _0x40b14f=await readCurrentChangeGitDiff(_0x1f0022,_0x10f0d4),_0x1cea65=await readWorkingTreeText(_0x1f0022,_0x10f0d4),_0x44f935=_0x40b14f[_0x124335(0x2a4)][_0x124335(0x1ef)](-0x103f+0x2263+-0x1224)||_0x40b14f[_0x124335(0x247)][_0x124335(0x1ef)](_0x124335(0x226))||_0x1cea65?.[_0x124335(0x265)]===!![];if(_0x44f935)return{'binary':!![],'summary':_0x124335(0x1e4)+createHash(_0x124335(0x2a9))[_0x124335(0x200)](_0x40b14f[_0x124335(0x2a4)])[_0x124335(0x214)](_0x124335(0x26f))+_0x124335(0x282)+_0x40b14f[_0x124335(0x2a4)][_0x124335(0x1c6)],'truncated':_0x40b14f[_0x124335(0x23e)]||_0x1cea65?.[_0x124335(0x23e)]===!![]};return{'binary':![],'text':_0x40b14f[_0x124335(0x247)],'truncated':_0x40b14f[_0x124335(0x23e)]||_0x1cea65?.[_0x124335(0x23e)]===!![],'afterText':_0x1cea65?.[_0x124335(0x247)]??'',..._0x1cea65===undefined?{}:{'afterTruncated':_0x1cea65[_0x124335(0x23e)]}};}async function readCurrentChangeGitDiff(_0xc2cae4,_0x46a47c){const _0x2d4950=_0x67518d,_0x41978b=await runReadOnlyGit(_0xc2cae4,[_0x2d4950(0x1d9),_0x2d4950(0x2ac),_0x2d4950(0x1cc),'-z','--',_0x2d4950(0x262)+_0x46a47c]);if(_0x41978b[_0x2d4950(0x247)][_0x2d4950(0x1eb)]('\x00')[_0x2d4950(0x1ef)](_0x46a47c)){const _0x12f8e4=await runReadOnlyGitAllowFailure(_0xc2cae4,[_0x2d4950(0x20c),_0x2d4950(0x296),_0x2d4950(0x1c8),_0x2d4950(0x20d),'--',_0x2d4950(0x1c7),_0x46a47c]);if(_0x12f8e4[_0x2d4950(0x1e3)]!==0x1657+-0x49*0x62+0x59b&&_0x12f8e4[_0x2d4950(0x1e3)]!==0x22d5+-0x21fc+-0xd8)throw new GitCommandError(_0x12f8e4[_0x2d4950(0x1e3)],_0x12f8e4[_0x2d4950(0x1d7)]);return _0x12f8e4;}return runReadOnlyGit(_0xc2cae4,[_0x2d4950(0x20c),_0x2d4950(0x1c8),_0x2d4950(0x20d),_0x2d4950(0x1c1),'--',_0x2d4950(0x262)+_0x46a47c]);}export async function isWorkspaceChangeVisible(_0x487893,_0x3676fd){const _0x11a7fa=_0x67518d;try{return await assertCurrentChangePathAccessible(_0x487893,safeGitWorkspacePath(_0x3676fd)),!![];}catch(_0x5e49d9){if(_0x5e49d9 instanceof Error&&(_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x1cb)||_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x29d)||_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x1aa)))return![];throw _0x5e49d9;}}async function assertCurrentChangePathAccessible(_0x3e3b64,_0x13fe90){const _0x3500dc=_0x67518d,_0x209817=await realpath(_0x3e3b64),_0x26fb07=resolve(_0x209817,_0x13fe90),_0x52253a=await lstat(_0x26fb07)[_0x3500dc(0x221)](_0x1f114f=>{const _0x5c2cec=_0x3500dc;if(_0x1f114f[_0x5c2cec(0x1e3)]===_0x5c2cec(0x260))return undefined;throw _0x1f114f;});if(_0x52253a===undefined)return;await resolveWorkspaceEntry(_0x209817,_0x13fe90,![]);}async function readWorkingTreeText(_0x5564fe,_0x221146){const _0x12739f=_0x67518d,_0x194455=await realpath(_0x5564fe);let _0x2baab3;try{_0x2baab3=await resolveWorkspaceEntry(_0x194455,_0x221146,![]);}catch(_0x3b78e0){if(_0x3b78e0 instanceof Error&&_0x3b78e0[_0x12739f(0x26a)]===_0x12739f(0x29d))return undefined;throw _0x3b78e0;}const _0x27513a=await lstat(_0x2baab3);if(!_0x27513a[_0x12739f(0x1bf)]())return undefined;const _0x4d6b4f=await readFile(_0x2baab3);return diffTextFromBuffer(_0x4d6b4f,_0x4d6b4f[_0x12739f(0x1c6)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x36445e,_0x14eb25){const _0x263870=_0x67518d;if(_0x36445e[_0x263870(0x1ef)](0x2392+-0x2706+0x374)||!isValidUtf8(_0x36445e))return{'binary':!![],'truncated':_0x14eb25};let _0x3bf7b7=Math[_0x263870(0x1d6)](_0x36445e[_0x263870(0x1c6)],GIT_OUTPUT_LIMIT);while(_0x3bf7b7>0x3*-0x89b+0x708+0x2af*0x7&&_0x3bf7b7<_0x36445e[_0x263870(0x1c6)]&&isUtf8ContinuationByte(_0x36445e[_0x3bf7b7]))_0x3bf7b7-=-0x1dd2+0x662+0x1771;return{'binary':![],'text':_0x36445e[_0x263870(0x227)](-0xadc+-0x1*-0x5e9+0x4f3,_0x3bf7b7)[_0x263870(0x1dd)](_0x263870(0x2be)),'truncated':_0x14eb25};}function _0x537c(){const _0x359b6c=['lM1HCI1LzgL0lq','A2LSBa','Agv4','BwvYz2uTyMfZzq','BgfZDeLUzgv4t2y','uKvoqu1fra','rKLmrv9ut09Ftefsr0u','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','BwfW','kIOVlM51EhqVkIO','C2LUA0rVD24','C2vHCMnO','ls1ZAg93lxrVCgXLDMvS','kIOVlNzLBNyVkIO','BM93','r0Lux0nptu1btKrFrKfjteve','DgvZDa','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','zMLUzeLUzgv4','zgLZCgXHEu5HBwu','igj5DgvZpq','CgfYC2u','Dg9mB2nHBgvmB3DLCKnHC2u','BM9YBwfSAxPL','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','yMfZzty0','yMfZzty0DxjS','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','CMvMCMvZAeLUqMfJA2DYB3vUza','Dw5Yzwy','kIOVBM9Kzv9TB2r1BgvZlYOQ','kIOVzgLZDc8QkG','q09qsuve','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','Dg9vChbLCKnHC2u','Bwf4','Aw5KzxHpzG','zxzLCNK','rKLmrv9ot1rFvevyva','pZ8G','ls1UBY1PBMrLEa','qureruq','reLsrunut1jz','zM9YlwvHy2GTCMvM','zNjVBq','vu5uuKfds0ve','CMvMCY9OzwfKCW','rKLmrv9ot1rFrK9vtKq','kIOVDgvZDc9YDw5ZlYOQ','zgvZDgLUyxrPB24','iYmG','yMXVyG','y29UDgvUDenHBMrPzgf0zxm','kIOVlMnHy2HLlYOQ','B3v0Chv0','BgLTAxrZ','lMDPDa','BgLUDxG','ls1WB3jJzwXHAw49DJe','C2HHmJu2','CMvSyxrPDMu','kIOVlNLHCM4VkIO','ls1VDgHLCNm','CMvMCY9Yzw1VDgvZlW','ls1KyxrLlw9YzgvY','ls13B3jRDhjLzq','zMXHDe1HCa','kIOVyMLUlYOQ','zMLUz2vYChjPBNq','kIOVlNn2zwX0zs1RAxqVkIO','kIOVDMvUzg9YlYOQ','Bwv0ywrHDge','Aw52ywXPza','nJaXndKYzfzVyxDu','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','y29Uy2f0','ls10B3bVlw9YzgvY','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','ls1ICMfUy2HLCW','tu9esuzjruq','DxrMoa','zxjYB3i','D29YA3nWywnLuM9VDa','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','kIOVx19WEwnHy2HLx18VkIO','y3vYC29Y','Dg91y2G','CMvIDwLSza','D2LUmZi','yNL0zuXLBMD0Aa','C29YDa','rKLmrv9squ5hrv9jtLzbteLe','v09ss1nqqunfx1bbveHFsu5wquXjra','revmrvrfra','Dg9mB3DLCKnHC2u','DMfSDwvZ','C3rYAw5NAwz5','rKLmrv9ot1rFuKvhvuXbuG','B25Jzq','rKLmrq','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','C3rKB3v0','y2fWywnPDhK','C2v0','kIOVy292zxjHz2uVkIO','ls1NAxqTy29TBw9UlwrPCG','rKLmrv9xuKLurv9dt05gteLdva','su5wquXjrf9oqu1f','lNbHCNq','mti1ntyWEejWBxzN','BgLTAxq','q1jfqvrfx0rjuKvdve9swq','C3rHCNrZv2L0Aa','zgLMzI10CMvL','ls1ZA2LWpq','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','zw50CMLLCW','sevbrca','AxngAwXL','zgLZCg9Zzq','sevbra','AgfZAa','kIOVlNbUCg0VkIO','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','mtK2otyWodznrNLNv1O','BgvUz3rO','l2rLDI9UDwXS','ls1UBY1LEhqTzgLMzG','kIOVB3v0lYOQ','ywn0Aw9U','rKLmrv9qqvrix0vtq0fqrq','ls1LEgnSDwrLlxn0yw5KyxjK','AxneAxjLy3rVCNK','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','zMLSzxmUzxHJBhvKzq','C3vIBw9KDwXL','rKLmrv9btfjfqurzx0vysvnuuW','CMvWBgfJzq','kIOVlMfUz3vSyxiVkIO','y2HHBMDLCW','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','BwLU','C3rKzxjY','CMvMCMvZAgvKqxq','BhmTzMLSzxm','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','kIOVlMDYywrSzs8QkG','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','Dg9tDhjPBMC','C2vHCMnOlMv4y2X1zgu','kIOVlM5LEhqVkIO','ls1TyxGTy291BNq9','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','BxrPBwvnCW','y29Kzq','yMLUyxj5igrPzMyGC2HHmJu2pq','kIOVDMvUDI8QkG','q1jfqvrfx0zjteu','zgf0yq','AwDUB3jL','v09ss1nqqunfx05pvf9bteXpv0ve','zMLUza','C3bSAxq','B2jQzwn0','ls1ZDgfNzwq','ls1YB290','Aw5JBhvKzxm','AxntEw1IB2XPy0XPBMS','rvHju1rtx0rjuKvdve9swq','B2zMC2v0','mZyWmduZnfHAsxvJua','C3rYAw5N','AwrSzvr0Be1Z','ChvZAa','zw50CNK','A2LUza','Bg9JywXLq29TCgfYzq','rKLmrv9ot1rFreLsrunut1jz','r0Lux1jfrL9jtLzbteLe','CMvZDg9Yzq','uKvbrfK','Bg9HzgLUzW','CMvHza','DxbKyxrL','mJe4nMHmuLzzrq','CgLWzq','DxrMltG','te9dquW','AgfZ','y2f0lwzPBgu','zw5ZDxjLtg9HzgvK','kIOVDgfYz2v0lYOQ','BMfTzq','C29YDgvK','zMLSDgvY','zgLMzG','ls1UBY10zxH0y29UDG','u1rbr0ve','mtC4mZyWAK9fz0f5','ls1Yzw1VDgvZ','kIOVlNbHCMnLBc1JywnOzs8QkG','Bw9Kzq','ywXSB2nvBNnHzMu','zgLNzxn0','r0Lux1DpuKTtuefdrq','kIOVlMDPDc8QkG','ls1MAxjZDc1WyxjLBNq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','ls1Yzwn1CNnPDMu','Cgf0Aa','DgLTzw91De1Z','C2L6zq','ls1PCY1HBMnLC3rVCG','z2L0','ls1MB3jTyxq9','C3rHDhvZ','y2f0y2G','CMvMCY9Yzw1VDgvZ','AM9PBG','zMLUywXSEq','Bg9N','qMLUyxj5igzPBgvZia','C3vIyxjYyxK','kIOVB2jQlYOQ','CMvMCMvZAef0DgvTChrLzef0','ls1XDwLLDa','B3v0Chv0tgLTAxq','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','C3LTyM9SAwmTCMvM','zxHLyW','C3rHBgu','zgvJB2rL','C2nVCMu','y2XVC2u','mJrXtxrVCwe','lMDPDc8','ls12zxjPzNK','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','u0Lhs0Lmta','zxHWAxj5vgLTzxi','CMvMCW','CMvHze9UBhK','kIOVyNvPBgqVkIO','C2HPzNq','rKLmrv9srvzju0LptL9jtLzbteLe','Dhj1BMnHDgvK','C2XPy2u','CMv2lxbHCNnL','CM9VDa','zNjLC2HUzxnZvhrStxm','ls1Uyw1Llxn0yxr1CW','z2v0','lI4U','odaYmZyWBfHgteHg','Dgv4Da','ls11BNrYywnRzwqTzMLSzxm9ywXS','ruvysvnu','DgHLBG','uKvnt1rf','AxntywzLsw50zwDLCG','kIOVlNr1CMjVlYOQ','CgXHDgzVCM0','otm5sxHtCeXT','ls1ZAg9YDa','CxvLCNK','C29Tzq','revmrvrf','CMvWBgfJzufSBa','ls1UBY1JB21TAxqTAwq','ls1ZB3vYy2u9sevbra','vfLqrv9dsefor0ve','CMvMCY9OzwfKCY8','AxnjBNrLz2vY','rvHju1rtx0zjteu','C2HVDW','AxnbyNnVBhv0zq','DhjPBq','lY5Flq','lM1HCI11CgXVywqT','ru5pru5u','ywrK','oIHSAxrLCMfSkq','CgLK','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','yMLUyxj5','zw50CNLmAw1PDa','zMXVB3i','yNvIyMXLvxa','ywXS','BwvZC2fNzq','ls1ICMfUy2G','vu5tvefhruq'];_0x537c=function(){return _0x359b6c;};return _0x537c();}export async function restoreCurrentChange(_0x4354b7,_0x57224d,_0x15abd3){const _0x350950=_0x67518d,_0x16112e=safeGitWorkspacePath(_0x57224d),_0x2104fa=_0x350950(0x262)+_0x16112e;if(_0x15abd3===_0x350950(0x29b)){const _0x167d34=await runReadOnlyGit(_0x4354b7,[_0x350950(0x220),_0x350950(0x2a8),'-z',_0x350950(0x248),'--',_0x2104fa]);if(!_0x167d34[_0x350950(0x247)][_0x350950(0x1eb)]('\x00')[_0x350950(0x252)](_0x219642=>_0x219642[_0x350950(0x1b9)](_0x350950(0x295))&&_0x219642[_0x350950(0x23f)](0xa24+-0x5*-0x3c7+0x6*-0x4d6)===_0x16112e))throw new Error(_0x350950(0x286));const _0x5e6bd9=await realpath(_0x4354b7),_0x34b273=resolve(_0x5e6bd9,_0x16112e),_0xe3a551=await lstat(_0x34b273);if(!_0xe3a551[_0x350950(0x1bf)]()||_0xe3a551[_0x350950(0x1f0)]())throw new Error(_0x350950(0x286));await unlink(_0x34b273);return;}if(_0x15abd3===_0x350950(0x26c)){await runGit(_0x4354b7,[_0x350950(0x1fc),_0x350950(0x2af),'--',_0x2104fa]);return;}await runGit(_0x4354b7,[_0x350950(0x1fc),_0x350950(0x256),_0x350950(0x1ed),_0x350950(0x2af),'--',_0x2104fa]);}function safeGitWorkspacePath(_0x2cbbe6){const _0x3d4487=_0x67518d;if(_0x2cbbe6[_0x3d4487(0x1c6)]===0xd96+-0x2593+-0x17*-0x10b||_0x2cbbe6[_0x3d4487(0x1ef)]('\x00')||_0x2cbbe6[_0x3d4487(0x1b9)]('/')||_0x2cbbe6[_0x3d4487(0x1b9)]('\x5c'))throw new Error(_0x3d4487(0x1cb));const _0x1da11a=_0x2cbbe6[_0x3d4487(0x254)]('\x5c','/');if(_0x1da11a[_0x3d4487(0x1eb)]('/')[_0x3d4487(0x252)](_0x5d0034=>_0x5d0034===''||_0x5d0034==='..'||_0x5d0034===_0x3d4487(0x2a6)))throw new Error(_0x3d4487(0x1cb));return _0x1da11a;}function gitChange(_0xa3c581){const _0x1e0ea4=_0x67518d;if(_0xa3c581==='A')return _0x1e0ea4(0x297);if(_0xa3c581==='D')return _0x1e0ea4(0x1a6);if(_0xa3c581==='R')return _0x1e0ea4(0x272);if(_0xa3c581==='C')return _0x1e0ea4(0x28e);if(_0xa3c581==='T')return _0x1e0ea4(0x257);return _0x1e0ea4(0x2bd);}export class GitCommandError extends Error{[_0x67518d(0x1e3)];[_0x67518d(0x1d7)];constructor(_0x1b3f03,_0x3057a5){const _0x22d70a=_0x67518d;super(_0x22d70a(0x27c)),this[_0x22d70a(0x1e3)]=_0x1b3f03,this[_0x22d70a(0x1d7)]=_0x3057a5;}}async function runReadOnlyGit(_0x55852b,_0x544600,_0x7c20dc={}){return runGit(_0x55852b,_0x544600,{..._0x7c20dc,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0x246ee3,_0x1df834,_0x137c4d={}){return runGitAllowFailure(_0x246ee3,_0x1df834,{..._0x137c4d,'readOnly':!![]});}async function runGit(_0x2c357d,_0x349d66,_0x19c82f={}){const _0x25eb60=_0x67518d,_0xfa907a=await runGitAllowFailure(_0x2c357d,_0x349d66,_0x19c82f);if(_0xfa907a[_0x25eb60(0x1e3)]!==-0x20a3+-0x1c8+-0x10b*-0x21)throw new GitCommandError(_0xfa907a[_0x25eb60(0x1e3)],_0xfa907a[_0x25eb60(0x1d7)]);return _0xfa907a;}async function runGitAllowFailure(_0x51f12b,_0x4d60bb,_0x290819={}){return new Promise((_0x3df2aa,_0x1811c8)=>{const _0x167660=_0x4bb8,_0x823980=_0x290819[_0x167660(0x22b)]??GIT_OUTPUT_LIMIT,_0x567e4b=spawn(_0x167660(0x21e),[..._0x4d60bb],{'cwd':_0x51f12b,'shell':![],'windowsHide':!![],'stdio':[_0x167660(0x1e8),_0x167660(0x202),_0x167660(0x202)],..._0x290819[_0x167660(0x23a)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x5850ce=[],_0x4d1ded=[];let _0x1c2e36=-0x2667+0xaa+0x25bd,_0x35061c=0x2667+-0x5*0x2dd+-0x1816,_0x41a043=![];const _0x3307a3=setTimeout(()=>{const _0x1e649c=_0x167660;if(process[_0x1e649c(0x24e)]===_0x1e649c(0x2c6)){const _0x5a439a=_0x567e4b[_0x1e649c(0x263)];if(_0x5a439a===undefined){_0x567e4b[_0x1e649c(0x26e)](_0x1e649c(0x237));return;}void terminateProcessTree({'pid':_0x5a439a,'kill':_0x4d951f=>_0x567e4b[_0x1e649c(0x26e)](_0x4d951f)},_0x1e649c(0x2c6))[_0x1e649c(0x221)](()=>{const _0x12a71b=_0x1e649c;try{_0x567e4b[_0x12a71b(0x26e)](_0x12a71b(0x237));}catch{}});return;}_0x567e4b[_0x1e649c(0x26e)](_0x1e649c(0x237));},_0x290819[_0x167660(0x21b)]??GIT_TIMEOUT_MS);_0x567e4b[_0x167660(0x1ae)]['on'](_0x167660(0x1e7),_0x59a6f6=>{const _0xf82826=_0x167660,_0x106f1f=Math[_0xf82826(0x291)](-0x2f*-0xb5+-0xd10+-0x3*0x6b9,_0x823980-_0x1c2e36);if(_0x106f1f>0x249b*-0x1+0x204*0xc+0xc6b){const _0x3333f7=_0x59a6f6[_0xf82826(0x227)](-0xb*-0x251+-0x3*0x9cc+0x3e9,_0x106f1f);_0x5850ce[_0xf82826(0x1f6)](_0x3333f7),_0x1c2e36+=_0x3333f7[_0xf82826(0x1c6)];}_0x41a043||=_0x59a6f6[_0xf82826(0x1c6)]>_0x106f1f;}),_0x567e4b[_0x167660(0x1d7)]['on'](_0x167660(0x1e7),_0xac25cf=>{const _0x378788=_0x167660,_0x48635b=Math[_0x378788(0x291)](-0x5*-0xd4+0x6*-0x4b+0x3d*-0xa,0x890+-0x83a+0xfaa-_0x35061c);if(_0x48635b===-0x23db+-0x15d*-0x5+0x213*0xe)return;const _0x4b1ac2=_0xac25cf[_0x378788(0x227)](-0x59+-0x1693+0x7a4*0x3,_0x48635b);_0x4d1ded[_0x378788(0x1f6)](_0x4b1ac2),_0x35061c+=_0x4b1ac2[_0x378788(0x1c6)];}),_0x567e4b[_0x167660(0x1ab)](_0x167660(0x2bf),_0x4ed517=>{clearTimeout(_0x3307a3),_0x1811c8(_0x4ed517);}),_0x567e4b[_0x167660(0x1ab)](_0x167660(0x232),_0x59b83=>{const _0x3e1cd0=_0x167660;clearTimeout(_0x3307a3);const _0x5e5393=Buffer[_0x3e1cd0(0x2b9)](_0x5850ce);_0x3df2aa({'code':_0x59b83??-0x1d78+-0x18ac+-0x53*-0xa7,'output':_0x5e5393,'text':_0x5e5393[_0x3e1cd0(0x1dd)](_0x3e1cd0(0x2be)),'stderr':Buffer[_0x3e1cd0(0x2b9)](_0x4d1ded)[_0x3e1cd0(0x1dd)](_0x3e1cd0(0x2be)),'truncated':_0x41a043});});});}function isGitUnavailable(_0x2d31fc){const _0x499600=_0x67518d;return _0x2d31fc instanceof Error&&_0x499600(0x1e3)in _0x2d31fc&&_0x2d31fc[_0x499600(0x1e3)]===_0x499600(0x260);}function summarizeText(_0xf1ccf7){const _0x5cf2f6=_0x67518d;return JSON[_0x5cf2f6(0x1a9)]({'sha256':createHash(_0x5cf2f6(0x2a9))[_0x5cf2f6(0x200)](_0xf1ccf7)[_0x5cf2f6(0x214)](_0x5cf2f6(0x26f)),'bytes':Buffer[_0x5cf2f6(0x2c7)](_0xf1ccf7)});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.31",
3
+ "version": "0.9.33",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "type": "module",
6
6
  "files": [
@@ -25,8 +25,8 @@
25
25
  "node-pty": "1.1.0",
26
26
  "ws": "^8.21.3",
27
27
  "zod": "4.4.3",
28
- "@myagentroam/agent": "^0.9.31",
29
- "@myagentroam/protocol": "^0.9.31"
28
+ "@myagentroam/agent": "^0.9.33",
29
+ "@myagentroam/protocol": "^0.9.33"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ws": "^8.18.1"