@myagentroam/node 0.9.57 → 0.9.59

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 _0x58ce9e=_0x4dec;(function(_0x510311,_0x44fff3){const _0x3a8371=_0x4dec,_0x119170=_0x510311();while(!![]){try{const _0x1066b5=parseInt(_0x3a8371(0x1a7))/(-0x6*-0x7f+-0x1*-0x2039+-0x2332)*(-parseInt(_0x3a8371(0x1b8))/(-0x20e0+0x1d*0x6b+0x14c3))+-parseInt(_0x3a8371(0x17f))/(-0x125b+-0x19f*0x7+0x1db7*0x1)*(parseInt(_0x3a8371(0x281))/(-0xd24+-0x24b2+-0x9*-0x58a))+parseInt(_0x3a8371(0x299))/(-0x2107*0x1+0xbb5*-0x3+0x442b)*(-parseInt(_0x3a8371(0x1d7))/(-0xc95*-0x1+0xdf4+-0x1a83))+-parseInt(_0x3a8371(0x173))/(-0x74b*0x1+0x20f9*0x1+-0x19a7)+parseInt(_0x3a8371(0x246))/(-0x23e+-0x1603+0x1849)+-parseInt(_0x3a8371(0x258))/(-0xe3c+0x1827+0x4f1*-0x2)*(parseInt(_0x3a8371(0x1e5))/(0x1496*0x1+0xf66+-0x23f2))+parseInt(_0x3a8371(0x17c))/(-0x1*0x24f+-0x95*0x1b+0x1211);if(_0x1066b5===_0x44fff3)break;else _0x119170['push'](_0x119170['shift']());}catch(_0x1ffefe){_0x119170['push'](_0x119170['shift']());}}}(_0x4569,-0x2ed*0x3f+0x1*-0x70c11+0xf4f39));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 _0x41ebff}from'node:os';import{basename,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=0x1714+-0x1498+0x110c,GIT_STATUS_TIMEOUT_MS=0x7d34+0x16af*-0xa+0xdad2,GIT_HISTORY_TIMEOUT_MS=0x5676+0x115*-0x5e+0x49d8,GIT_OUTPUT_LIMIT=(0x9bd+0x11cb+0x56*-0x4c)*(-0xa56+0x54f+0x1*0x907),GIT_LARGE_OUTPUT_LIMIT=(-0x1f29+0xd69*-0x1+-0x1*-0x2c9a)*(0xf6b+-0x23ee+0x1883)*(-0x772+0x1b*-0x16c+0x31d6),FILE_READ_LIMIT=(0x1c3c+-0x2114+0x6d8)*(-0x2177+-0x1*-0x258a+-0x13*0x1),DIRECTORY_PAGE_LIMIT=-0x870+0x2170+0x4*-0x60e,DIRECTORY_PICKER_LIMIT=-0x1fe6+0x7f3+0x18bb,SEARCH_RESULT_LIMIT=0x1322+0x12d0+0x47*-0x86,GIT_WORKTREE_LIST_LIMIT=0x5*0x1cf+0x57*-0x2+-0x7dd,FILE_INDEX_IDLE_TTL_MS=(0x7*-0x92+0x1cce+-0x1894)*(0x13*0x81+-0x47*0x4c+-0xbbd*-0x1)*(0x8*0x2ff+-0xd08+-0x708),FILE_INDEX_FRESHNESS_TTL_MS=-0x1*-0x8d27+0x2e1c*0x1+-0x1*0x4613,FILE_INDEX_ENTRY_LIMIT=0x1*-0x11449+0xa30b+0x1f7de*0x1,FILE_INDEX_METADATA_CONCURRENCY=-0xaf1+0xf28*0x2+-0x133f,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x58ce9e(0x170),_0x58ce9e(0x1f9),_0x58ce9e(0x1e4),_0x58ce9e(0x1e9),_0x58ce9e(0x1cc),_0x58ce9e(0x225),_0x58ce9e(0x26a),_0x58ce9e(0x217),_0x58ce9e(0x1b7),_0x58ce9e(0x257),_0x58ce9e(0x260),_0x58ce9e(0x210),_0x58ce9e(0x22f),_0x58ce9e(0x203),_0x58ce9e(0x23b),_0x58ce9e(0x211),_0x58ce9e(0x187),_0x58ce9e(0x18b),_0x58ce9e(0x285),_0x58ce9e(0x216),_0x58ce9e(0x28c),_0x58ce9e(0x21f),_0x58ce9e(0x1f3),_0x58ce9e(0x209),_0x58ce9e(0x23e)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x298374,_0x519d38,_0x52bf12){const _0x59e0d6=_0x58ce9e,_0x1545f0=_0x519d38[_0x59e0d6(0x1ab)]();if(_0x1545f0[_0x59e0d6(0x212)]===0x953+0x10be+-0x1a11||_0x1545f0[_0x59e0d6(0x212)]>0xf4a+0x3*-0xc2e+-0x43*-0x55||_0x1545f0==='.'||_0x1545f0==='..'||_0x1545f0[_0x59e0d6(0x198)]('/')||_0x1545f0[_0x59e0d6(0x198)]('\x5c')||_0x1545f0[_0x59e0d6(0x198)]('\x00'))throw new Error(_0x59e0d6(0x1a8));const _0xdaaba=await Promise[_0x59e0d6(0x1e6)](_0x52bf12[_0x59e0d6(0x23c)](_0x401e48=>realpath(_0x401e48))),_0xed5b0e=await realpath(_0x298374)[_0x59e0d6(0x195)](()=>{const _0x282721=_0x59e0d6;throw new Error(_0x282721(0x189));}),_0x104d73=await stat(_0xed5b0e)[_0x59e0d6(0x195)](()=>undefined);if(_0x104d73?.[_0x59e0d6(0x25d)]()!==!![]||!isWithinAllowedRoot(_0xed5b0e,_0xdaaba))throw new Error(_0x59e0d6(0x189));const _0x27ef3c=resolve(_0xed5b0e,_0x1545f0);if(dirname(_0x27ef3c)!==_0xed5b0e||!isWithinAllowedRoot(_0x27ef3c,_0xdaaba))throw new Error(_0x59e0d6(0x1a8));try{await mkdir(_0x27ef3c);}catch(_0x2eb3bd){if(_0x2eb3bd[_0x59e0d6(0x286)]===_0x59e0d6(0x1f6))throw new Error(_0x59e0d6(0x1da));throw _0x2eb3bd;}return _0x27ef3c;}export class WorkspaceFileIndex{[_0x58ce9e(0x19e)];[_0x58ce9e(0x247)];[_0x58ce9e(0x1db)]=[];[_0x58ce9e(0x26f)]=![];[_0x58ce9e(0x28d)];[_0x58ce9e(0x16a)];[_0x58ce9e(0x1dc)]=!![];[_0x58ce9e(0x20a)];[_0x58ce9e(0x200)]=0x13d+-0x132+0xb*-0x1;[_0x58ce9e(0x1a4)]=0x224f*0x1+-0x1f8c+-0x2c3;constructor(_0x224b3c,_0x302c28={}){const _0x158ada=_0x58ce9e;this[_0x158ada(0x19e)]=_0x224b3c,this[_0x158ada(0x247)]=_0x302c28;}async[_0x58ce9e(0x24f)](){const _0x37b754=_0x58ce9e;return await this[_0x37b754(0x204)](),this[_0x37b754(0x184)](),{'entries':this[_0x37b754(0x1db)][_0x37b754(0x265)](_0x3e443b=>_0x3e443b[_0x37b754(0x1a2)]===_0x37b754(0x251)),'truncated':this[_0x37b754(0x26f)]};}[_0x58ce9e(0x293)](){const _0x182230=_0x58ce9e;if(this[_0x182230(0x20a)]!==undefined)clearTimeout(this[_0x182230(0x20a)]);this[_0x182230(0x20a)]=undefined,this[_0x182230(0x1db)]=[],this[_0x182230(0x26f)]=![],this[_0x182230(0x1dc)]=!![],this[_0x182230(0x200)]=-0x2173+0x2*-0xbc+0x22eb,this[_0x182230(0x1a4)]=0x1a4f+0x12de+-0x303*0xf;}async[_0x58ce9e(0x194)](_0x524b61,_0xc70fb2,_0x47530e=SEARCH_RESULT_LIMIT,_0x1c1aec=![]){const _0x330b10=_0x58ce9e;if(_0x524b61[_0x330b10(0x1ab)]()[_0x330b10(0x212)]===0x1*0x8f0+0x17*0xf1+-0xbf*0x29||_0x524b61[_0x330b10(0x212)]>0x38*-0x5c+0x95*0x3f+-0xf8b||!Number[_0x330b10(0x238)](_0x47530e)||_0x47530e<-0x120e+-0x2*0xb87+0x291d||_0x47530e>SEARCH_RESULT_LIMIT)throw new Error(_0x330b10(0x21b));await this[_0x330b10(0x204)](),this[_0x330b10(0x184)]();const _0x2c1eb7=decodeSearchCursor(_0xc70fb2,_0x524b61),_0x45b2a6=_0x2c1eb7===undefined?undefined:this[_0x330b10(0x1db)][_0x330b10(0x282)](_0x570da6=>_0x570da6[_0x330b10(0x1bd)]===_0x2c1eb7&&(_0x1c1aec||_0x570da6[_0x330b10(0x1a2)]===_0x330b10(0x251))),_0x503112=_0x45b2a6===undefined?-(0x219b+0x1*0x167e+-0x3818):fuzzyPathScore(_0x45b2a6[_0x330b10(0x1bd)],_0x524b61),_0x44ab01=_0x45b2a6===undefined||_0x503112<0x3ab+0x131b*0x2+-0x29e1?undefined:{'entry':_0x45b2a6,'score':_0x503112},_0xa6ee1b=new RankedCandidateHeap(_0x47530e+(-0xc*0xc5+-0x22c+-0x7f*-0x17));for(const _0x1efd5d of this[_0x330b10(0x1db)]){if(!_0x1c1aec&&_0x1efd5d[_0x330b10(0x1a2)]!==_0x330b10(0x251))continue;const _0x2ce023=fuzzyPathScore(_0x1efd5d[_0x330b10(0x1bd)],_0x524b61);if(_0x2ce023<0x15*0x157+-0xd*0xf+-0x3*0x920)continue;const _0x10d4d3={'entry':_0x1efd5d,'score':_0x2ce023};if(_0x44ab01!==undefined&&compareRankedCandidate(_0x10d4d3,_0x44ab01)<=0xb*0x1e2+0x299*0xe+-0x3914)continue;_0xa6ee1b[_0x330b10(0x1fc)](_0x10d4d3);}const _0x2cd593=_0xa6ee1b[_0x330b10(0x1e3)](),_0x57d9b3=_0x2cd593[_0x330b10(0x250)](0xb83+-0x65*0x61+0x19*0x112,_0x47530e)[_0x330b10(0x23c)](_0x5aea37=>_0x5aea37[_0x330b10(0x172)]),_0x552e43=_0x2cd593[_0x47530e]?.[_0x330b10(0x172)][_0x330b10(0x1bd)];return{'entries':_0x57d9b3,'nextCursor':_0x552e43===undefined?null:encodeSearchCursor(_0x524b61,_0x57d9b3['at'](-(0x982*0x1+-0x17*-0x47+0xd6*-0x13))?.[_0x330b10(0x1bd)]??_0x2c1eb7??''),'truncated':_0x552e43!==undefined||this[_0x330b10(0x26f)]};}async[_0x58ce9e(0x204)](){const _0x2b61f1=_0x58ce9e;if(!this[_0x2b61f1(0x1dc)]&&this[_0x2b61f1(0x28d)]!==undefined){if(Date[_0x2b61f1(0x1ba)]()-this[_0x2b61f1(0x1a4)]>=(this[_0x2b61f1(0x247)][_0x2b61f1(0x202)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x2b61f1(0x205)]();return;}this[_0x2b61f1(0x16a)]===undefined&&(this[_0x2b61f1(0x16a)]=this[_0x2b61f1(0x27a)]()[_0x2b61f1(0x269)](()=>{const _0x40b9fc=_0x2b61f1;this[_0x40b9fc(0x16a)]=undefined;})),await this[_0x2b61f1(0x16a)];}[_0x58ce9e(0x184)](){const _0x32af07=_0x58ce9e;if(this[_0x32af07(0x20a)]!==undefined)clearTimeout(this[_0x32af07(0x20a)]);this[_0x32af07(0x20a)]=setTimeout(()=>this[_0x32af07(0x293)](),this[_0x32af07(0x247)][_0x32af07(0x1c7)]??FILE_INDEX_IDLE_TTL_MS),this[_0x32af07(0x20a)][_0x32af07(0x1cf)]();}async[_0x58ce9e(0x27a)](){const _0x1b622f=_0x58ce9e,_0x2e9bf8=await resolveRegisteredWorkspaceRoot(this[_0x1b622f(0x19e)]),_0x52869b=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x2e9bf8)],_0x4b24c1=[],_0x528819=this[_0x1b622f(0x247)][_0x1b622f(0x235)]??FILE_INDEX_ENTRY_LIMIT;let _0x374327=![];const _0x28e2e6=['.'];let _0x318343=-0x4e6+0x14d0+-0x246*0x7;while(_0x318343<_0x28e2e6[_0x1b622f(0x212)]&&!_0x374327){const _0x5ccf13=_0x28e2e6[_0x318343];_0x318343+=0x74*0x35+0xbad+-0x23b0;const _0x4c7611=await resolveWorkspaceEntryFromCanonicalRoot(_0x2e9bf8,_0x5ccf13,!![])[_0x1b622f(0x195)](()=>undefined);if(_0x4c7611===undefined)continue;const _0x39feac=await opendir(_0x4c7611)[_0x1b622f(0x195)](()=>undefined);if(_0x39feac===undefined)continue;let _0x26b6e2=[];const _0x9bc806=async()=>{const _0x1ec6ff=_0x1b622f,_0x5cd298=await Promise[_0x1ec6ff(0x1e6)](_0x26b6e2);_0x26b6e2=[];for(const _0x2dbf7e of _0x5cd298){if(_0x2dbf7e===undefined)continue;if(_0x2dbf7e[_0x1ec6ff(0x1bd)]===_0x1ec6ff(0x1d0)||_0x2dbf7e[_0x1ec6ff(0x1bd)][_0x1ec6ff(0x174)](_0x1ec6ff(0x249))||isExcluded(_0x2dbf7e[_0x1ec6ff(0x1bd)],_0x52869b))continue;if(_0x2dbf7e[_0x1ec6ff(0x1a2)]===_0x1ec6ff(0x25e))_0x28e2e6[_0x1ec6ff(0x28a)](_0x2dbf7e[_0x1ec6ff(0x1bd)]);_0x4b24c1[_0x1ec6ff(0x28a)](_0x2dbf7e);if(_0x4b24c1[_0x1ec6ff(0x212)]>=_0x528819){_0x374327=!![];break;}}};for await(const _0x75c753 of _0x39feac){const _0x28d8d4=_0x5ccf13==='.'?_0x75c753[_0x1b622f(0x192)]:posix[_0x1b622f(0x241)](_0x5ccf13[_0x1b622f(0x27b)]('\x5c','/'),_0x75c753[_0x1b622f(0x192)]);if(_0x28d8d4===_0x1b622f(0x1d0)||_0x28d8d4[_0x1b622f(0x174)](_0x1b622f(0x249))||isExcluded(_0x28d8d4,_0x52869b))continue;_0x26b6e2[_0x1b622f(0x28a)](inspectWorkspaceIndexEntry(_0x2e9bf8,_0x28d8d4,_0x75c753[_0x1b622f(0x192)]));if(_0x26b6e2[_0x1b622f(0x212)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x9bc806();if(_0x374327)break;}if(!_0x374327&&_0x26b6e2[_0x1b622f(0x212)]>-0x7a4+-0x26f*0x5+0x13cf)await _0x9bc806();}this[_0x1b622f(0x28d)]=_0x2e9bf8,this[_0x1b622f(0x1db)]=_0x4b24c1,this[_0x1b622f(0x26f)]=_0x374327,this[_0x1b622f(0x1dc)]=![],this[_0x1b622f(0x200)]=Date[_0x1b622f(0x1ba)](),this[_0x1b622f(0x1a4)]=this[_0x1b622f(0x200)];}[_0x58ce9e(0x205)](){const _0x27dfce=_0x58ce9e;if(this[_0x27dfce(0x16a)]!==undefined)return;this[_0x27dfce(0x1a4)]=Date[_0x27dfce(0x1ba)](),this[_0x27dfce(0x16a)]=this[_0x27dfce(0x27a)]()[_0x27dfce(0x195)](()=>undefined)[_0x27dfce(0x269)](()=>{const _0x3317fe=_0x27dfce;this[_0x3317fe(0x16a)]=undefined;});}}async function workspaceExcludePatterns(_0x3db5fa){const _0x48f3e3=_0x58ce9e,_0xb11bb6=resolve(_0x3db5fa,_0x48f3e3(0x227)),_0x462528=await readFile(_0xb11bb6,_0x48f3e3(0x16e))[_0x48f3e3(0x1fb)](JSON[_0x48f3e3(0x171)])[_0x48f3e3(0x195)](()=>undefined);if(typeof _0x462528!==_0x48f3e3(0x18e)||_0x462528===null)return[];return[_0x48f3e3(0x270),_0x48f3e3(0x1ef)][_0x48f3e3(0x23a)](_0x1c70b7=>{const _0xdf3c2b=_0x48f3e3,_0x229621=_0x462528[_0x1c70b7];return typeof _0x229621===_0xdf3c2b(0x18e)&&_0x229621!==null?Object[_0xdf3c2b(0x1db)](_0x229621)[_0xdf3c2b(0x23a)](([_0x153b47,_0x103728])=>_0x103728===!![]?[_0x153b47]:[]):[];});}function isExcluded(_0x2e3bb6,_0x49d977){const _0x543db3=_0x58ce9e;return _0x49d977[_0x543db3(0x1a1)](_0x32db84=>minimatch(_0x2e3bb6,_0x32db84,{'dot':!![],'nocase':_0x41ebff()!==_0x543db3(0x1b3)})||minimatch(_0x2e3bb6+'/',_0x32db84,{'dot':!![],'nocase':_0x41ebff()!==_0x543db3(0x1b3)}));}function compareRankedCandidate(_0x35d2ca,_0x479af1){const _0x5bcd61=_0x58ce9e;return _0x479af1[_0x5bcd61(0x230)]-_0x35d2ca[_0x5bcd61(0x230)]||_0x35d2ca[_0x5bcd61(0x172)][_0x5bcd61(0x1bd)][_0x5bcd61(0x29a)](_0x479af1[_0x5bcd61(0x172)][_0x5bcd61(0x1bd)]);}class RankedCandidateHeap{[_0x58ce9e(0x1ec)];[_0x58ce9e(0x1cb)]=[];constructor(_0x4cd8e5){const _0xbb5acd=_0x58ce9e;this[_0xbb5acd(0x1ec)]=_0x4cd8e5;}[_0x58ce9e(0x1fc)](_0x3a6df5){const _0x1d2f02=_0x58ce9e;if(this[_0x1d2f02(0x1cb)][_0x1d2f02(0x212)]<this[_0x1d2f02(0x1ec)]){this[_0x1d2f02(0x1cb)][_0x1d2f02(0x28a)](_0x3a6df5),this[_0x1d2f02(0x16f)](this[_0x1d2f02(0x1cb)][_0x1d2f02(0x212)]-(0x16*0x194+-0x246f+0xa*0x2c));return;}if(compareRankedCandidate(_0x3a6df5,this[_0x1d2f02(0x1cb)][0x158e+0xa1*0x1+-0x162f])>=0x3*-0x95d+-0xd2b+0x2942)return;this[_0x1d2f02(0x1cb)][0x115*0xf+0x1f8e+-0x2fc9]=_0x3a6df5,this[_0x1d2f02(0x1e1)](-0x4*0x5e7+0x2272+-0xad6);}[_0x58ce9e(0x1e3)](){const _0x1a1830=_0x58ce9e;return[...this[_0x1a1830(0x1cb)]][_0x1a1830(0x1b5)](compareRankedCandidate);}[_0x58ce9e(0x16f)](_0x4de753){const _0x94f5e8=_0x58ce9e;let _0x57f3c4=_0x4de753;while(_0x57f3c4>-0x101*-0xe+0xeeb+0x1cf9*-0x1){const _0x46dede=Math[_0x94f5e8(0x1e8)]((_0x57f3c4-(-0x104b+-0x20*-0x97+-0x294))/(0x38c+-0x2672+-0x4*-0x8ba));if(compareRankedCandidate(this[_0x94f5e8(0x1cb)][_0x57f3c4],this[_0x94f5e8(0x1cb)][_0x46dede])<=0x1*-0x228a+0x17*0x152+0x42c)break;[this[_0x94f5e8(0x1cb)][_0x57f3c4],this[_0x94f5e8(0x1cb)][_0x46dede]]=[this[_0x94f5e8(0x1cb)][_0x46dede],this[_0x94f5e8(0x1cb)][_0x57f3c4]],_0x57f3c4=_0x46dede;}}[_0x58ce9e(0x1e1)](_0x118761){const _0x65abc9=_0x58ce9e;let _0x17d9eb=_0x118761;while(!![]){const _0x3298ae=_0x17d9eb*(-0x155e+-0x1fcc+0x352c)+(-0x543*-0x4+-0xd86*-0x1+-0x2291);if(_0x3298ae>=this[_0x65abc9(0x1cb)][_0x65abc9(0x212)])return;const _0x15922e=_0x3298ae+(-0x1ede+-0x3c*-0x2e+0x1417),_0x4b87f7=_0x15922e<this[_0x65abc9(0x1cb)][_0x65abc9(0x212)]&&compareRankedCandidate(this[_0x65abc9(0x1cb)][_0x15922e],this[_0x65abc9(0x1cb)][_0x3298ae])>-0x43c*-0x7+-0x8*-0x496+0x4254*-0x1?_0x15922e:_0x3298ae;if(compareRankedCandidate(this[_0x65abc9(0x1cb)][_0x4b87f7],this[_0x65abc9(0x1cb)][_0x17d9eb])<=0x21eb+0x1b29+0x3*-0x145c)return;[this[_0x65abc9(0x1cb)][_0x17d9eb],this[_0x65abc9(0x1cb)][_0x4b87f7]]=[this[_0x65abc9(0x1cb)][_0x4b87f7],this[_0x65abc9(0x1cb)][_0x17d9eb]],_0x17d9eb=_0x4b87f7;}}}function fuzzyPathScore(_0x4a1c66,_0x347a33){const _0x5e4a41=_0x58ce9e,_0x3fbce4=_0x4a1c66[_0x5e4a41(0x180)](),_0x331915=_0x347a33[_0x5e4a41(0x1ab)]()[_0x5e4a41(0x180)]();let _0x5b40ed=0x10b5+-0x2428+0x1373,_0x3ee07a=-0x6*-0x366+-0x61b+-0xe49,_0x167451=-(-0x1efb+-0x231d+-0x1*-0x421a);for(const _0x392e96 of _0x331915){const _0x252861=_0x3fbce4[_0x5e4a41(0x188)](_0x392e96,_0x5b40ed);if(_0x252861===-(0x152b+0x416*-0x5+-0xbc))return-(-0x123+0xf5b+-0x3*0x4bd);_0x3ee07a+=_0x252861===_0x167451+(0xd30+-0xad*0x15+0x102)?-0x44*0x72+-0x7b2+0x2606:-0x8b9+0x201b*-0x1+0x28d5;if(_0x252861===0x22d1+0x930+-0xeab*0x3||_0x5e4a41(0x296)[_0x5e4a41(0x198)](_0x3fbce4[_0x252861-(-0xe05+0x1*0x2537+-0x1731*0x1)]??''))_0x3ee07a+=0x1*0x1fe1+-0x8ce+-0x170b;_0x167451=_0x252861,_0x5b40ed=_0x252861+(0x131d+0x5e5+-0x1901);}const _0x2cddc5=_0x4a1c66[_0x5e4a41(0x250)](_0x4a1c66[_0x5e4a41(0x259)]('/')+(-0x26d6*0x1+0x1d*0x12d+0x25f*0x2))[_0x5e4a41(0x180)]();if(_0x2cddc5[_0x5e4a41(0x198)](_0x331915))_0x3ee07a+=0x1541*0x1+0x19*-0xb5+-0x36c;else{if(_0x3fbce4[_0x5e4a41(0x198)](_0x331915))_0x3ee07a+=-0x95*0x1+0x1df7+-0x1d52;}return _0x3ee07a-_0x4a1c66[_0x5e4a41(0x212)]/(0x6*-0xa4+0xa92+-0x2d2);}export async function listWorkspaceDirectories(_0x4dfdbb,_0x2aa944,_0x421f5b=homedir()){const _0x3388b5=_0x58ce9e,_0x5894f9=await realpath(_0x421f5b),_0x15fbcd=await Promise[_0x3388b5(0x1e6)](_0x2aa944[_0x3388b5(0x23c)](_0x1412f=>realpath(_0x1412f))),_0x40db2a=[...new Set([_0x5894f9,..._0x15fbcd])],_0x59861d=_0x4dfdbb===undefined?_0x15fbcd[0xb51+-0x2a9*0x1+-0x8a8]??_0x5894f9:await realpath(_0x4dfdbb),_0x411d68=await stat(_0x59861d);if(!_0x411d68[_0x3388b5(0x25d)]()||!isWithinAllowedRoot(_0x59861d,_0x40db2a))throw new Error(_0x3388b5(0x189));const _0x2bb470=await readdir(_0x59861d,{'withFileTypes':!![]}),_0x2c34b6=[];for(const _0x3f174f of _0x2bb470[_0x3388b5(0x1b5)]((_0x42923b,_0x413717)=>_0x42923b[_0x3388b5(0x192)][_0x3388b5(0x29a)](_0x413717[_0x3388b5(0x192)]))){if(!_0x3f174f[_0x3388b5(0x25d)]()&&!_0x3f174f[_0x3388b5(0x1ad)]())continue;const _0x4891c=await realpath(resolve(_0x59861d,_0x3f174f[_0x3388b5(0x192)]))[_0x3388b5(0x195)](()=>undefined);if(_0x4891c===undefined||!isWithinAllowedRoot(_0x4891c,_0x40db2a))continue;const _0xd68923=await stat(_0x4891c)[_0x3388b5(0x195)](()=>undefined);if(_0xd68923===undefined||!_0xd68923[_0x3388b5(0x25d)]())continue;_0x2c34b6[_0x3388b5(0x28a)]({'path':_0x4891c,'name':_0x3f174f[_0x3388b5(0x192)],'selectable':isWithinAllowedRoot(_0x4891c,_0x15fbcd)});if(_0x2c34b6[_0x3388b5(0x212)]>DIRECTORY_PICKER_LIMIT)break;}const _0xe0a67=dirname(_0x59861d);return{'homePath':_0x5894f9,'currentPath':_0x59861d,'parentPath':_0xe0a67===_0x59861d||!isWithinAllowedRoot(_0xe0a67,_0x40db2a)?null:_0xe0a67,'browseRoots':_0x15fbcd,'selectable':isWithinAllowedRoot(_0x59861d,_0x15fbcd),'entries':_0x2c34b6[_0x3388b5(0x250)](0x4*0x36d+0x36f*0x6+-0x1*0x224e,DIRECTORY_PICKER_LIMIT),'truncated':_0x2c34b6[_0x3388b5(0x212)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x535d01,_0x396580='.',_0x4a38f9,_0x414056=DIRECTORY_PAGE_LIMIT){const _0x50e142=_0x58ce9e;if(!Number[_0x50e142(0x238)](_0x414056)||_0x414056<-0x1*-0x721+0xe87*0x1+0x1*-0x15a7||_0x414056>DIRECTORY_PAGE_LIMIT)throw new Error(_0x50e142(0x1d3));const _0x31bd95=await resolveRegisteredWorkspaceRoot(_0x535d01),_0x526ba4=await resolveWorkspaceEntryFromCanonicalRoot(_0x31bd95,_0x396580,!![]),_0x206f3b=await readdir(_0x526ba4,{'withFileTypes':!![]}),_0x4e3f4d=decodeDirectoryCursor(_0x4a38f9,_0x396580),_0x9e602=_0x206f3b[_0x50e142(0x265)](_0x58533d=>_0x58533d[_0x50e142(0x192)]!==_0x50e142(0x1d0)&&!isWorkspaceUploadTemporaryName(_0x58533d[_0x50e142(0x192)]))[_0x50e142(0x23c)](_0x17a604=>_0x17a604[_0x50e142(0x192)])[_0x50e142(0x1b5)]((_0x1a6140,_0x665791)=>_0x1a6140[_0x50e142(0x29a)](_0x665791)),_0x124e1b=_0x4e3f4d===undefined?-0x257*-0x9+0x189d+-0x2dac:_0x9e602[_0x50e142(0x199)](_0x176a8e=>_0x176a8e>_0x4e3f4d);if(_0x4e3f4d!==undefined&&_0x124e1b===-(0x147e+0x1b0d+-0x2f8a))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x4b92d3=_0x9e602[_0x50e142(0x250)](_0x124e1b,_0x124e1b+_0x414056),_0x586117=[];for(const _0x10d62b of _0x4b92d3){const _0x3ce4c=await resolveWorkspaceEntry(_0x31bd95,relative(_0x31bd95,resolve(_0x526ba4,_0x10d62b)),![])[_0x50e142(0x195)](_0x14a563=>{if(isSkippableWorkspaceEntryError(_0x14a563))return undefined;throw _0x14a563;});if(_0x3ce4c===undefined)continue;const _0x2e1096=await lstat(_0x3ce4c)[_0x50e142(0x195)](_0x81799e=>{const _0x1a5369=_0x50e142;if(_0x81799e[_0x1a5369(0x286)]===_0x1a5369(0x177))return undefined;throw _0x81799e;});if(_0x2e1096===undefined||!_0x2e1096[_0x50e142(0x1fa)]()&&!_0x2e1096[_0x50e142(0x25d)]())continue;_0x586117[_0x50e142(0x28a)]({'path':relative(_0x31bd95,_0x3ce4c)[_0x50e142(0x283)](sep)[_0x50e142(0x241)]('/'),'name':_0x10d62b,'kind':_0x2e1096[_0x50e142(0x25d)]()?_0x50e142(0x25e):_0x50e142(0x251),'size':_0x2e1096[_0x50e142(0x1fa)]()?_0x2e1096[_0x50e142(0x27f)]:null,'modifiedAt':_0x2e1096[_0x50e142(0x23d)]});}const _0x550fc9=_0x9e602[_0x124e1b+_0x4b92d3[_0x50e142(0x212)]];return{'entries':_0x586117,'nextCursor':_0x550fc9===undefined||_0x4b92d3[_0x50e142(0x212)]===0x124*0xa+0x1*0x2272+0x2dda*-0x1?null:encodeDirectoryCursor(_0x396580,_0x4b92d3[_0x4b92d3[_0x50e142(0x212)]-(-0x2439+0x10c8+-0x9b9*-0x2)]),'truncated':_0x550fc9!==undefined};}export async function mutateWorkspaceFile(_0x304193,_0x3d4480){const _0x15d012=_0x58ce9e,_0x7a4156=await resolveRegisteredWorkspaceRoot(_0x304193);if(_0x3d4480[_0x15d012(0x1c6)]===_0x15d012(0x23f)||_0x3d4480[_0x15d012(0x1c6)]===_0x15d012(0x1f4)){const _0x1709c6=await resolveNewWorkspaceEntry(_0x7a4156,_0x3d4480[_0x15d012(0x1bd)]);if(_0x3d4480[_0x15d012(0x1c6)]===_0x15d012(0x23f))await writeFile(_0x1709c6,'',{'flag':'wx'});else await mkdir(_0x1709c6);return{'path':workspaceRelativePath(_0x7a4156,_0x1709c6)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x7a4156,_0x3d4480[_0x15d012(0x1bd)]);const _0x2793f0=await resolveWorkspaceEntryMetadata(_0x7a4156,_0x3d4480[_0x15d012(0x1bd)]);if(workspaceRelativePath(_0x7a4156,_0x2793f0[_0x15d012(0x1bd)])==='.')throw new Error(_0x15d012(0x1bf));if(_0x3d4480[_0x15d012(0x1c6)]===_0x15d012(0x1b2))return await rm(_0x2793f0[_0x15d012(0x1bd)],{'recursive':_0x2793f0[_0x15d012(0x24b)][_0x15d012(0x25d)](),'force':![]}),{'deleted':!![]};const _0x4b4bb7=await resolveNewWorkspaceEntry(_0x7a4156,_0x3d4480[_0x15d012(0x169)]);if(_0x2793f0[_0x15d012(0x24b)][_0x15d012(0x25d)]()){const _0x5b83b4=relative(_0x2793f0[_0x15d012(0x1bd)],_0x4b4bb7);if(_0x5b83b4===''||!isAbsolute(_0x5b83b4)&&_0x5b83b4!=='..'&&!_0x5b83b4[_0x15d012(0x174)]('..'+sep))throw new Error(_0x15d012(0x21c));}return await rename(_0x2793f0[_0x15d012(0x1bd)],_0x4b4bb7),{'path':workspaceRelativePath(_0x7a4156,_0x4b4bb7)};}async function resolveNewWorkspaceEntry(_0xc40c76,_0x38d449){const _0x5699c9=_0x58ce9e,_0x55399d=_0x38d449[_0x5699c9(0x27b)]('\x5c','/'),_0xc1b82f=_0x55399d[_0x5699c9(0x283)]('/'),_0x1460da=_0xc1b82f['at'](-(-0x16ea+-0x123*-0x21+0x1*-0xe98));if(_0x38d449[_0x5699c9(0x198)]('\x00')||_0x55399d[_0x5699c9(0x174)]('/')||isAbsolute(_0x38d449)||win32[_0x5699c9(0x25f)](_0x55399d)||_0x1460da===undefined||_0x1460da[_0x5699c9(0x212)]===-0x4a*-0x8+-0x14fc+0x12ac||_0xc1b82f[_0x5699c9(0x1a1)](invalidWorkspaceMutationSegment))throw new Error(_0x5699c9(0x182));const _0x5bba21=_0xc1b82f[_0x5699c9(0x212)]===0xcc8+-0x1f46+0x127f?'.':_0xc1b82f[_0x5699c9(0x250)](0x1*-0xd8b+-0x1*-0x2407+-0x167c,-(0xb6d+0x5f6+0x1162*-0x1))[_0x5699c9(0x241)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0xc40c76,_0x5bba21);const _0x3e9fd1=await resolveWorkspaceEntryFromCanonicalRoot(_0xc40c76,_0x5bba21,!![]),_0x1f5147=resolve(_0x3e9fd1,_0x1460da);try{await lstat(_0x1f5147);throw new Error(_0x5699c9(0x239));}catch(_0x57d42d){if(_0x57d42d[_0x5699c9(0x286)]!==_0x5699c9(0x177))throw _0x57d42d;}return _0x1f5147;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x3ba1f3,_0x44a552){const _0x3ac465=_0x58ce9e,_0x23c03a=_0x44a552[_0x3ac465(0x27b)]('\x5c','/');if(_0x23c03a==='.')return;const _0x2d611b=_0x23c03a[_0x3ac465(0x283)]('/');if(_0x44a552[_0x3ac465(0x198)]('\x00')||_0x23c03a[_0x3ac465(0x174)]('/')||isAbsolute(_0x44a552)||win32[_0x3ac465(0x25f)](_0x23c03a)||_0x2d611b[_0x3ac465(0x1a1)](invalidWorkspaceMutationSegment))throw new Error(_0x3ac465(0x182));let _0x43a4a4=_0x3ba1f3;for(const _0x45ef68 of _0x2d611b){_0x43a4a4=resolve(_0x43a4a4,_0x45ef68);const _0x4bf0c7=await lstat(_0x43a4a4)[_0x3ac465(0x195)](_0x5ca4ec=>{const _0x449ece=_0x3ac465;if(_0x5ca4ec[_0x449ece(0x286)]===_0x449ece(0x177))throw new Error(_0x449ece(0x273));throw _0x5ca4ec;});if(_0x4bf0c7[_0x3ac465(0x1ad)]())throw new Error(_0x3ac465(0x182));}}function invalidWorkspaceMutationSegment(_0xd1541d){const _0x19994b=_0x58ce9e;if(_0xd1541d[_0x19994b(0x212)]===0x7c*-0x30+-0xa1b+0x1*0x215b||_0xd1541d==='.'||_0xd1541d==='..'||_0xd1541d===_0x19994b(0x1d0))return!![];if(_0x41ebff()!==_0x19994b(0x16b))return![];const _0x11e4be=_0xd1541d[_0x19994b(0x1be)](/[. ]+$/u,'')[_0x19994b(0x295)]();return/[<>:"|?*]/u[_0x19994b(0x272)](_0xd1541d)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x19994b(0x272)](_0x11e4be);}function workspaceRelativePath(_0x4a1f81,_0x1ae1fe){const _0x48bc7e=_0x58ce9e,_0x2f256a=relative(_0x4a1f81,_0x1ae1fe)[_0x48bc7e(0x283)](sep)[_0x48bc7e(0x241)]('/');return _0x2f256a[_0x48bc7e(0x212)]===-0xff5+-0xf80+0x1f75?'.':_0x2f256a;}function isSkippableWorkspaceEntryError(_0x154f7f){const _0x35ad94=_0x58ce9e;return _0x154f7f instanceof Error&&(_0x154f7f[_0x35ad94(0x19b)]===_0x35ad94(0x182)||_0x154f7f[_0x35ad94(0x19b)]===_0x35ad94(0x273)||_0x154f7f[_0x35ad94(0x19b)]===_0x35ad94(0x27e));}export async function preflightWorkspaceUpload(_0x4ac9d5,_0x4c7d1b,_0x538569){const _0x3c80b7=_0x58ce9e;if(_0x538569[_0x3c80b7(0x212)]===-0xcf1+0x1c1b+-0xf2a||_0x538569==='.'||_0x538569==='..'||_0x538569[_0x3c80b7(0x198)]('\x00')||_0x538569[_0x3c80b7(0x198)]('/')||_0x538569[_0x3c80b7(0x198)]('\x5c')||isWorkspaceUploadTemporaryName(_0x538569))return{'path':'','absolutePath':'','status':_0x3c80b7(0x1d4)};const _0xb87341=await resolveRegisteredWorkspaceRoot(_0x4ac9d5),_0x4c7037=await resolveWorkspaceEntry(_0xb87341,_0x4c7d1b,!![]),_0x445dcd=resolve(_0x4c7037,_0x538569);if(dirname(_0x445dcd)!==_0x4c7037)throw new Error(_0x3c80b7(0x182));const _0x46421d=relative(_0xb87341,_0x445dcd)[_0x3c80b7(0x283)](sep)[_0x3c80b7(0x241)]('/'),_0x31f07c=await lstat(_0x445dcd)[_0x3c80b7(0x195)](_0x164dd0=>{const _0x5b4661=_0x3c80b7;if(_0x164dd0[_0x5b4661(0x286)]===_0x5b4661(0x177))return undefined;throw _0x164dd0;});if(_0x31f07c===undefined)return{'path':_0x46421d,'absolutePath':_0x445dcd,'status':_0x3c80b7(0x25c)};if(_0x31f07c[_0x3c80b7(0x1ad)]())throw new Error(_0x3c80b7(0x182));if(_0x31f07c[_0x3c80b7(0x1fa)]())return{'path':_0x46421d,'absolutePath':_0x445dcd,'status':_0x3c80b7(0x26b)};return{'path':_0x46421d,'absolutePath':_0x445dcd,'status':_0x3c80b7(0x197)};}export function workspaceUploadTemporaryName(_0x17efa5){const _0x4a9c34=_0x58ce9e;return _0x4a9c34(0x22a)+_0x17efa5+_0x4a9c34(0x220);}function isWorkspaceUploadTemporaryName(_0x23032b){const _0x128c80=_0x58ce9e;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x128c80(0x272)](_0x23032b)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x128c80(0x272)](_0x23032b);}export async function readWorkspaceTextFile(_0x481df5,_0x2ef5da,_0x59414e=-0xb2c+-0x88b+0x31*0x67,_0x807b9e=FILE_READ_LIMIT){const _0x3f5b32=_0x58ce9e;if(!Number[_0x3f5b32(0x238)](_0x59414e)||_0x59414e<-0x3*-0xaab+-0x1*0x1faf+0x29*-0x2||!Number[_0x3f5b32(0x238)](_0x807b9e)||_0x807b9e<-0x15d7+-0x1574+-0x28c*-0x11||_0x807b9e>FILE_READ_LIMIT)throw new Error(_0x3f5b32(0x24d));const _0x39e693=await resolveRegisteredWorkspaceRoot(_0x481df5),_0x42eb28=await resolveWorkspaceEntry(_0x39e693,_0x2ef5da,![]),_0x40ff66=await lstat(_0x42eb28);if(!_0x40ff66[_0x3f5b32(0x1fa)]())throw new Error(_0x3f5b32(0x27e));if(_0x40ff66[_0x3f5b32(0x27f)]>FILE_READ_LIMIT*(-0xf32+-0x1f3*0x1+0x1135))throw new Error(_0x3f5b32(0x289));const _0x155334=await readFile(_0x42eb28),_0x54468f=createHash(_0x3f5b32(0x231))[_0x3f5b32(0x17b)](_0x155334)[_0x3f5b32(0x22e)](_0x3f5b32(0x1bc)),_0x3d8890=_0x155334[_0x3f5b32(0x198)](-0x1*0x1549+0x1b1b*-0x1+-0x28c*-0x13)||!isValidUtf8(_0x155334);if(_0x3d8890){const _0x6e3f0b=Math[_0x3f5b32(0x1ac)](_0x155334[_0x3f5b32(0x212)],_0x59414e+_0x807b9e),_0x5ca5ba=_0x155334[_0x3f5b32(0x27d)](_0x59414e,_0x6e3f0b);return{'path':relative(_0x39e693,_0x42eb28)[_0x3f5b32(0x283)](sep)[_0x3f5b32(0x241)]('/'),'encoding':_0x3f5b32(0x18c),'size':_0x155334[_0x3f5b32(0x212)],'content':_0x5ca5ba[_0x3f5b32(0x275)](_0x3f5b32(0x18c)),'truncated':_0x6e3f0b<_0x155334[_0x3f5b32(0x212)],'nextOffset':_0x6e3f0b<_0x155334[_0x3f5b32(0x212)]?_0x6e3f0b:null,'revision':_0x54468f};}if(_0x59414e>0x1376+-0x237+-0x113f&&_0x59414e<_0x155334[_0x3f5b32(0x212)]&&isUtf8ContinuationByte(_0x155334[_0x59414e]))throw new Error(_0x3f5b32(0x24d));let _0xcfc4f8=Math[_0x3f5b32(0x1ac)](_0x155334[_0x3f5b32(0x212)],_0x59414e+_0x807b9e);if(_0xcfc4f8<_0x155334[_0x3f5b32(0x212)]&&isUtf8ContinuationByte(_0x155334[_0xcfc4f8])){while(_0xcfc4f8>_0x59414e&&isUtf8ContinuationByte(_0x155334[_0xcfc4f8]))_0xcfc4f8-=0x1a4d+0x14de+-0x2f2a;if(_0xcfc4f8===_0x59414e){_0xcfc4f8+=-0x1aef+0x24ac+-0x9bc;while(_0xcfc4f8<_0x155334[_0x3f5b32(0x212)]&&isUtf8ContinuationByte(_0x155334[_0xcfc4f8]))_0xcfc4f8+=-0x23a1*0x1+0x18a0+0x581*0x2;}}const _0x978ccb=_0x155334[_0x3f5b32(0x27d)](_0x59414e,_0xcfc4f8),_0x28ea77=new TextDecoder(_0x3f5b32(0x229),{'fatal':!![]})[_0x3f5b32(0x261)](_0x978ccb),_0xf2268e=_0xcfc4f8<_0x155334[_0x3f5b32(0x212)]?_0xcfc4f8:null;return{'path':relative(_0x39e693,_0x42eb28)[_0x3f5b32(0x283)](sep)[_0x3f5b32(0x241)]('/'),'encoding':_0x3f5b32(0x229),'size':_0x155334[_0x3f5b32(0x212)],'content':_0x28ea77,'truncated':_0xf2268e!==null,'nextOffset':_0xf2268e,'revision':_0x54468f};}export async function writeWorkspaceTextFile(_0x55063f,_0x3318ef,_0x391844,_0x64e586){const _0x29fe84=_0x58ce9e;if(!/^[0-9a-f]{64}$/u[_0x29fe84(0x272)](_0x64e586))throw new Error(_0x29fe84(0x291));const _0x39dcd0=Buffer[_0x29fe84(0x218)](_0x391844,_0x29fe84(0x16e));if(_0x39dcd0[_0x29fe84(0x212)]>FILE_READ_LIMIT*(0x1*0x132f+0x14c0+-0xad*0x3b))throw new Error(_0x29fe84(0x289));if(_0x39dcd0[_0x29fe84(0x198)](0x17e7+-0x1*-0x1cc1+-0x34a8))throw new Error(_0x29fe84(0x20d));const _0x58292e=await resolveRegisteredWorkspaceRoot(_0x55063f);await assertWorkspaceMutationPathHasNoSymlinks(_0x58292e,_0x3318ef);const _0x5c4378=await resolveWorkspaceEntry(_0x58292e,_0x3318ef,![]),_0x1c6004=await lstat(_0x5c4378);if(!_0x1c6004[_0x29fe84(0x1fa)]())throw new Error(_0x29fe84(0x27e));const _0x437e32=await readFile(_0x5c4378);if(_0x437e32[_0x29fe84(0x198)](0x1*-0x269b+0x14b7*-0x1+0x3b52)||!isValidUtf8(_0x437e32))throw new Error(_0x29fe84(0x20d));const _0x5a126f=createHash(_0x29fe84(0x231))[_0x29fe84(0x17b)](_0x437e32)[_0x29fe84(0x22e)](_0x29fe84(0x1bc));if(_0x5a126f!==_0x64e586)throw new Error(_0x29fe84(0x1fd));const _0x5b1624=createHash(_0x29fe84(0x231))[_0x29fe84(0x17b)](_0x39dcd0)[_0x29fe84(0x22e)](_0x29fe84(0x1bc)),_0x1cd9ee=resolve(dirname(_0x5c4378),_0x29fe84(0x24c)+randomUUID()+_0x29fe84(0x220));try{await writeFile(_0x1cd9ee,_0x39dcd0,{'flag':'wx','mode':_0x1c6004[_0x29fe84(0x29b)]}),await rename(_0x1cd9ee,_0x5c4378);}finally{await rm(_0x1cd9ee,{'force':!![]})[_0x29fe84(0x195)](()=>undefined);}return{'path':workspaceRelativePath(_0x58292e,_0x5c4378),'revision':_0x5b1624,'size':_0x39dcd0[_0x29fe84(0x212)]};}function _0x4569(){const _0x1b2924=['ls1WB3jJzwXHAw4','ruvysvnu','yMfYzq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','kIOVBM9Kzv9TB2r1BgvZlYOQ','AxngAwXL','DgHLBG','ywrK','rKLmrv9xuKLurv9dt05gteLdva','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','A2LSBa','CMvMCMvZAgvKqxq','CgLWzq','zNjLC2HUzxnZvhrStxm','kIOVlM5LEhqVkIO','zw5ZDxjLtg9HzgvK','CMvMCMvZAeLUqMfJA2DYB3vUza','u0Lhs0Lmta','ls1ZAg93lxrVCgXLDMvS','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','kIOVlNzLBNyVkIO','zxHWAxj5vgLTzxi','C2HVDW','ls1ICMfUy2G','rKLmrv9ot1rFvevyva','C2HPzNq','Dgv4Da','kIOVy292zxjHz2uVkIO','kIOVlNn2zwX0zs1RAxqVkIO','BgvUz3rO','AgfZAa','C3rYAw5N','zMLUz2vYChjPBNq','kIOVyMLUlYOQ','kIOVlNr1CMjVlYOQ','zNjVBq','zgLMzI10CMvL','r0Lux1DpuKTtuefdrq','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','ls1WB3jJzwXHAw49DJe','u1rbr0ve','kIOVDMvUzg9YlYOQ','lNbHCNq','ls1Yzwn1CNnPDMu','CgLK','ls1MB3jTyxq9','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','kIOVlMnHy2HLlYOQ','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','ls1UBY1JB21TAxqTAwq','DxrMltG','lM1HCI11CgXVywqT','ywXSB2nvBNnHzMu','C3rKzxjY','q09qsuve','zgLNzxn0','kIOVDgvZDc9YDw5ZlYOQ','C2nVCMu','C2HHmJu2','ls1PCY1HBMnLC3rVCG','sevbrca','Dg9mB3DLCKnHC2u','zw50CNLmAw1PDa','ls1TyxGTy291BNq9','yMfZzty0DxjS','AxntywzLsw50zwDLCG','rKLmrv9btfjfqurzx0vysvnuuW','zMXHDe1HCa','kIOVlM51EhqVkIO','BwfW','BxrPBwvnCW','kIOVDMvUDI8QkG','q1jfqvrfx0zjteu','z2v0','AM9PBG','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','BhmTzMLSzxm','AxnjBNrLz2vY','mJmYnJG4mgHuBhjHBa','BgLTAxrZ','AwDUB3jL','lMDPDc8','yMLUyxj5igrPzMyGC2HHmJu2pq','Bwv0ywrHDge','lM1HCI1LzgL0lq','rKLmrv9squ5hrv9jtLzbteLe','ls10B3bVlw9YzgvY','y29UDgvUDenHBMrPzgf0zxm','C2XPy2u','rKLmrq','ls13B3jRDhjLzq','iYmG','oIHSAxrLCMfSkq','y29Uy2f0','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','kIOVyNvPBgqVkIO','mZm4ng1IwwnlDW','BgfZDeLUzgv4t2y','ls12zxjPzNK','C3vIBw9KDwXL','uKvbrfK','AxneAxjLy3rVCNK','reLsrunut1jz','AxnbyNnVBhv0zq','kIOVB3v0lYOQ','zgvJB2rL','CMvMCY9OzwfKCW','zxHLyW','ls1XDwLLDa','zMLSDgvY','ls1LEgnSDwrLlxn0yw5KyxjK','ls1MAxjZDc1WyxjLBNq','C2v0','zMLUywXSEq','kIOVlNbHCMnLBc1JywnOzs8QkG','rvHju1rtx0zjteu','zM9YlwvHy2GTCMvM','Bg9JA2vK','vu5tvefhruq','Dhj1BMnHDgvK','zMLSzxmUzxHJBhvKzq','sevbra','DgvZDa','rKLmrv9ot1rFrK9vtKq','te9dquW','Dg9tDhjPBMC','v09ss1nqqunfx05pvf9bteXpv0ve','zgLMzG','Chj1BMfIBgu','igj5DgvZpq','CMvIDwLSza','CMvWBgfJzufSBa','qMLUyxj5igzPBgvZia','C3vIyxjYyxK','rKLmrv9ot1rFuKvhvuXbuG','C2L6zq','CMvMCY9OzwfKCY8','mtzYwwL5ENK','zMLUza','C3bSAxq','ls1KyxrLlw9YzgvY','kIOVlMDYywrSzs8QkG','y29Kzq','ls1UBY1PBMrLEa','Bwf4','rKLmrv9ut09Ftefsr0u','ChvZAa','CMvMCY9Yzw1VDgvZlW','kIOVB2jQlYOQ','CM9VDa','CMvZDg9Yzq','C3LTyM9SAwmTCMvM','ls1VDgHLCNm','rKLmrv9srvzju0LptL9jtLzbteLe','ls1NAxqTy29TBw9UlwrPCG','zgLZCg9Zzq','D29YA3rYzwuG','Dg9vChbLCKnHC2u','lY5Flq','ls1YB290','CMv2lxbHCNnL','mZuZmgrzsujUqq','Bg9JywXLq29TCgfYzq','Bw9Kzq','zgvZDgLUyxrPB24','Bg9HzgLUzW','D2LUmZi','DgLTzw91De1Z','vu5uuKfds0ve','DxrMoa','yNvIyMXLvxa','kIOVlMDPDc8QkG','CgfYC2u','zw50CNK','nJu1ntu5mwz1DKH6sW','C3rHCNrZv2L0Aa','lI4U','zgv0ywnOzwq','ru5pru5u','yNL0zuXLBMD0Aa','yMLUyxj5','CMvMCW','DxbKyxrL','nde3nJC1mtDsBhjqyKy','yNjHBMnOia','C3rHDhvZ','nJm0nZC2v3r3wMjN','Dg9mB2nHBgvmB3DLCKnHC2u','D29YA3rYzwu','rKLmrv9qqvrix0vtq0fqrq','CgXHDgzVCM0','Dg91y2G','r0Lux1DpuKTuuKvfx0Xju1rFsu5wquXjra','yMXVyG','kIOVlMfUz3vSyxiVkIO','Aw5KzxHpzG','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','r0Lux1jfrL9jtLzbteLe','kIOVDgfYz2v0lYOQ','yMfZzty0','AgfZ','B2jQzwn0','CMvHze9UBhK','ls1Yzw1VDgvZ','C3rKB3v0','BMfTzq','ls1ZA2LWpq','C2vHCMnO','y2f0y2G','ls1UBY10zxH0y29UDG','rvHju1rtx0rjuKvdve9swq','Aw5JBhvKzxm','zMLUzeLUzgv4','tu9esuzjruq','BwvZC2fNzq','ls11BNrYywnRzwqTzMLSzxm9ywXS','zgLZCgXHEu5HBwu','D29YA3nWywnLuM9VDa','CMvSyxrPDMu','y2XVC2u','C29Tzq','A2LUza','qureruq','CMvMCMvZAef0DgvTChrLzef0','rKLmrv9ot1rFreLsrunut1jz','ls1UBY1LEhqTzgLMzG','nwzlDMTbBG','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','B3v0Chv0','vfLqrv9dsefor0ve','DhjPBq','BwLU','AxntEw1IB2XPy0XPBMS','r0Lux0nptu1btKrFrKfjteve','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','zxzLCNK','l2rLDI9UDwXS','revmrvrf','BgLUDxG','CMvMCY9Yzw1VDgvZ','C29YDa','zgf0yq','kIOVzgLZDc8QkG','mJi0ntK0t0T1ywTK','ls1ZB3vYy2u9sevbra','BM93','CxvLCNK','Agv4','Cgf0Aa','CMvWBgfJzq','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','Aw52ywXPza','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','z2L0','B2zMC2v0','B3v0Chv0tgLTAxq','ls1ZDgfNzwq','ywn0Aw9U','AwrSzvr0Be1Z','Chj1BMfIBguG','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','ls1ZAg9YDa','DMfSDwvZ','kIOVlNLHCM4VkIO','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','revmrvrfra','Dw5Yzwy','lMDPDa','BM9YBwfSAxPL','BgLZDa','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','su5wquXjrf9oqu1f','B25Jzq','Bg9N','nZGYnefAEevIsq','uKvnt1rf','y2f0lwzPBgu','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','zw50CMLLCW','C3rHBgu','y3vYC29Y','BwvYz2uTyMfZzq','y2HHBMDLCW','ls1ICMfUy2HLCW','C2LUA0rVD24','v09ss1nqqunfx1bbveHFsu5wquXjra','C29YDgvK','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','odC0mfj0CNjVuG','ywXS','C3rYAw5NAwz5','zMXVB3i','kIOVlNbUCg0VkIO','zxjYB3i','ls1Uyw1Llxn0yxr1CW','y2fWywnPDhK','pZ8G','BgLTAxq','C2vHCMnOlMv4y2X1zgu','CMvHza','Bg9JA2vKia','uKvoqu1fra','kIOVx19WEwnHy2HLx18VkIO','q1jfqvrfx0rjuKvdve9swq'];_0x4569=function(){return _0x1b2924;};return _0x4569();}export async function readWorkspaceFileContentRange(_0x2c1089,_0x321291,_0x4a2c74=-0x189e+0x505+0x1399,_0x3f993f=FILE_READ_LIMIT){const _0x5e1dbe=_0x58ce9e;if(!Number[_0x5e1dbe(0x238)](_0x4a2c74)||_0x4a2c74<0x19a0+0x2408+-0x2*0x1ed4||!Number[_0x5e1dbe(0x238)](_0x3f993f)||_0x3f993f<-0x245d*0x1+0x180b+-0x1*-0xc53||_0x3f993f>FILE_READ_LIMIT)throw new Error(_0x5e1dbe(0x24d));const _0x25aa13=await resolveRegisteredWorkspaceRoot(_0x2c1089),_0x162e9f=await resolveWorkspaceEntry(_0x25aa13,_0x321291,![]),_0x46a915=await lstat(_0x162e9f);if(!_0x46a915[_0x5e1dbe(0x1fa)]())throw new Error(_0x5e1dbe(0x27e));if(_0x4a2c74>_0x46a915[_0x5e1dbe(0x27f)])throw new Error(_0x5e1dbe(0x24d));const _0x1f0441=Math[_0x5e1dbe(0x1ac)](_0x3f993f,_0x46a915[_0x5e1dbe(0x27f)]-_0x4a2c74),_0x583a92=Buffer[_0x5e1dbe(0x22b)](_0x1f0441),_0x3890e1=await open(_0x162e9f,'r');try{const {bytesRead:_0x58f12c}=await _0x3890e1[_0x5e1dbe(0x1f0)](_0x583a92,0x1*0x1a03+0x194e+-0x57*0x97,_0x1f0441,_0x4a2c74),_0x9c8c63=_0x4a2c74+_0x58f12c;return{'path':relative(_0x25aa13,_0x162e9f)[_0x5e1dbe(0x283)](sep)[_0x5e1dbe(0x241)]('/'),'size':_0x46a915[_0x5e1dbe(0x27f)],'offset':_0x4a2c74,'contentBase64':_0x583a92[_0x5e1dbe(0x27d)](-0xc16+-0x13b1*-0x1+-0x79b,_0x58f12c)[_0x5e1dbe(0x275)](_0x5e1dbe(0x18c)),'nextOffset':_0x9c8c63<_0x46a915[_0x5e1dbe(0x27f)]?_0x9c8c63:null};}finally{await _0x3890e1[_0x5e1dbe(0x1a0)]();}}export async function readAllowedFileContentRange(_0x22fbc1,_0x5291f1,_0x1ab68b=-0x2247+-0x1*-0xa67+0x17e0,_0x3cbe01=FILE_READ_LIMIT){const _0x55a644=_0x58ce9e;if(!Number[_0x55a644(0x238)](_0x1ab68b)||_0x1ab68b<-0xe*-0xce+0x338+-0xe7c||!Number[_0x55a644(0x238)](_0x3cbe01)||_0x3cbe01<-0x1*-0x1407+-0x8*-0x2a5+-0x292e*0x1||_0x3cbe01>FILE_READ_LIMIT)throw new Error(_0x55a644(0x24d));const {file:_0x3bb1b7,metadata:_0x392e20}=await resolveAllowedFile(_0x22fbc1,_0x5291f1);if(_0x1ab68b>_0x392e20[_0x55a644(0x27f)])throw new Error(_0x55a644(0x24d));const _0x104208=Math[_0x55a644(0x1ac)](_0x3cbe01,_0x392e20[_0x55a644(0x27f)]-_0x1ab68b),_0x1cd050=Buffer[_0x55a644(0x22b)](_0x104208),_0x49d08d=await open(_0x3bb1b7,'r');try{const {bytesRead:_0x2af141}=await _0x49d08d[_0x55a644(0x1f0)](_0x1cd050,-0x1a38+0x1*-0x6c3+0x20fb,_0x104208,_0x1ab68b),_0x1c7827=_0x1ab68b+_0x2af141;return{'path':_0x3bb1b7,'size':_0x392e20[_0x55a644(0x27f)],'offset':_0x1ab68b,'contentBase64':_0x1cd050[_0x55a644(0x27d)](0xd49+0x1c5a+0xd1*-0x33,_0x2af141)[_0x55a644(0x275)](_0x55a644(0x18c)),'nextOffset':_0x1c7827<_0x392e20[_0x55a644(0x27f)]?_0x1c7827:null};}finally{await _0x49d08d[_0x55a644(0x1a0)]();}}export async function readAllowedTextFile(_0x22efb9,_0x20dc3e,_0x276680=-0x1e*-0x56+0x1dea+-0x27fe*0x1,_0x327497=FILE_READ_LIMIT){const _0x4ce22c=_0x58ce9e,{file:_0x5f160a,metadata:_0x3297ee}=await resolveAllowedFile(_0x22efb9,_0x20dc3e);if(_0x3297ee[_0x4ce22c(0x27f)]>FILE_READ_LIMIT*(-0x2*-0x8d3+0x3*-0x1ca+0x2e*-0x44))throw new Error(_0x4ce22c(0x289));if(!Number[_0x4ce22c(0x238)](_0x276680)||_0x276680<0x1*0xac0+0x4e3*-0x5+0x71*0x1f||!Number[_0x4ce22c(0x238)](_0x327497)||_0x327497<0x209*0x8+-0x493*-0x1+-0x14da||_0x327497>FILE_READ_LIMIT)throw new Error(_0x4ce22c(0x24d));const _0x816435=await readFile(_0x5f160a),_0x29db8e=_0x816435[_0x4ce22c(0x198)](0x3*0x22f+0x1*-0x815+-0xc4*-0x2)||!isValidUtf8(_0x816435),_0x384c61=Math[_0x4ce22c(0x1ac)](_0x816435[_0x4ce22c(0x212)],_0x276680+_0x327497);if(_0x29db8e){const _0x4d2e0c=_0x816435[_0x4ce22c(0x27d)](_0x276680,_0x384c61);return{'path':_0x5f160a,'encoding':_0x4ce22c(0x18c),'size':_0x816435[_0x4ce22c(0x212)],'content':_0x4d2e0c[_0x4ce22c(0x275)](_0x4ce22c(0x18c)),'truncated':_0x384c61<_0x816435[_0x4ce22c(0x212)],'nextOffset':_0x384c61<_0x816435[_0x4ce22c(0x212)]?_0x384c61:null};}if(_0x276680>-0x3*0x5a0+-0x4*0x36+0x11b8&&_0x276680<_0x816435[_0x4ce22c(0x212)]&&isUtf8ContinuationByte(_0x816435[_0x276680]))throw new Error(_0x4ce22c(0x24d));let _0x1d6aea=_0x384c61;if(_0x1d6aea<_0x816435[_0x4ce22c(0x212)]&&isUtf8ContinuationByte(_0x816435[_0x1d6aea])){while(_0x1d6aea>_0x276680&&isUtf8ContinuationByte(_0x816435[_0x1d6aea]))_0x1d6aea-=-0x1214+0x672+-0x3e1*-0x3;if(_0x1d6aea===_0x276680){_0x1d6aea+=0x1e19+0x134a+-0x12d*0x2a;while(_0x1d6aea<_0x816435[_0x4ce22c(0x212)]&&isUtf8ContinuationByte(_0x816435[_0x1d6aea]))_0x1d6aea+=-0x801*-0x3+-0xf1+-0x1711;}}const _0x2a8daa=_0x1d6aea<_0x816435[_0x4ce22c(0x212)]?_0x1d6aea:null;return{'path':_0x5f160a,'encoding':_0x4ce22c(0x229),'size':_0x816435[_0x4ce22c(0x212)],'content':new TextDecoder(_0x4ce22c(0x229),{'fatal':!![]})[_0x4ce22c(0x261)](_0x816435[_0x4ce22c(0x27d)](_0x276680,_0x1d6aea)),'truncated':_0x2a8daa!==null,'nextOffset':_0x2a8daa};}export function normalizeFilePreviewPath(_0x118dae){const _0x3f9ab6=_0x58ce9e;if(!/^sandbox:/iu[_0x3f9ab6(0x272)](_0x118dae))return _0x118dae;let _0x3edaf8;try{_0x3edaf8=decodeURIComponent(_0x118dae[_0x3f9ab6(0x250)](_0x118dae[_0x3f9ab6(0x188)](':')+(0x142f*-0x1+-0xef*-0xb+0x9eb)));}catch{throw new Error(_0x3f9ab6(0x182));}const _0x224830=_0x3edaf8[_0x3f9ab6(0x1be)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x224830[_0x3f9ab6(0x212)]===-0x8eb+-0x1712+0x1ffd||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x3f9ab6(0x272)](_0x3edaf8)||!isAbsolute(_0x224830)&&!win32[_0x3f9ab6(0x25f)](_0x224830)||_0x224830[_0x3f9ab6(0x198)]('\x00')||_0x224830[_0x3f9ab6(0x198)]('?')||_0x224830[_0x3f9ab6(0x198)]('#'))throw new Error(_0x3f9ab6(0x182));return _0x224830;}async function resolveAllowedFile(_0x77da31,_0x1a0a45){const _0x146e19=_0x58ce9e;if(!isAbsolute(_0x77da31))throw new Error(_0x146e19(0x182));const _0x51ece3=await realpath(_0x77da31)[_0x146e19(0x195)](_0x25cbf8=>{const _0x3697a5=_0x146e19;if(_0x25cbf8[_0x3697a5(0x286)]===_0x3697a5(0x177))throw new Error(_0x3697a5(0x273));throw _0x25cbf8;}),_0x162619=await Promise[_0x146e19(0x1e6)](_0x1a0a45[_0x146e19(0x23c)](_0x42d1bd=>realpath(_0x42d1bd)));if(!isWithinAllowedRoot(_0x51ece3,_0x162619))throw new Error(_0x146e19(0x182));const _0x530bfb=await lstat(_0x51ece3);if(!_0x530bfb[_0x146e19(0x1fa)]())throw new Error(_0x146e19(0x27e));return{'file':_0x51ece3,'metadata':_0x530bfb};}function isValidUtf8(_0x9ea99c){const _0x4ee14=_0x58ce9e;try{return new TextDecoder(_0x4ee14(0x229),{'fatal':!![]})[_0x4ee14(0x261)](_0x9ea99c),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x391795){return(_0x391795&0xdb3+-0xaa5+-0x24e)===0x13be*0x1+0x5*0x1d0+-0x1c4e;}export async function searchWorkspaceFiles(_0x115ea7,_0x3a645e,_0x43d3d6,_0x7fa8eb=SEARCH_RESULT_LIMIT,_0x4a15b3=![]){const _0x36dc96=_0x58ce9e,_0x14d981=new WorkspaceFileIndex(_0x115ea7);try{return await _0x14d981[_0x36dc96(0x194)](_0x3a645e,_0x43d3d6,_0x7fa8eb,_0x4a15b3);}finally{_0x14d981[_0x36dc96(0x293)]();}}async function resolveRegisteredWorkspaceRoot(_0x1d4f3f){const _0x5fc14e=_0x58ce9e,_0x1f9afb=await realpath(_0x1d4f3f);if(normalizeWorkspacePath(_0x1f9afb)!==normalizeWorkspacePath(_0x1d4f3f))throw new Error(_0x5fc14e(0x276));return _0x1f9afb;}async function resolveWorkspaceEntry(_0xeb9b44,_0x38e82d,_0x4f258d){const _0x1a1bb5=await resolveRegisteredWorkspaceRoot(_0xeb9b44);return resolveWorkspaceEntryFromCanonicalRoot(_0x1a1bb5,_0x38e82d,_0x4f258d);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x584c3e,_0x125d82,_0x4b1767){const _0x1d9111=_0x58ce9e,_0x369015=await resolveWorkspaceEntryMetadata(_0x584c3e,_0x125d82);if(_0x4b1767?!_0x369015[_0x1d9111(0x24b)][_0x1d9111(0x25d)]():!_0x369015[_0x1d9111(0x24b)][_0x1d9111(0x1fa)]()&&!_0x369015[_0x1d9111(0x24b)][_0x1d9111(0x25d)]())throw new Error(_0x4b1767?_0x1d9111(0x1a5):_0x1d9111(0x27e));return _0x369015[_0x1d9111(0x1bd)];}async function resolveWorkspaceEntryMetadata(_0x2851a5,_0xa12676){const _0x4bfb57=_0x58ce9e;if(_0xa12676[_0x4bfb57(0x198)]('\x00')||_0xa12676[_0x4bfb57(0x212)]===-0x15ff*0x1+0x3*0xc5a+0x3*-0x505||_0xa12676[_0x4bfb57(0x174)]('/')||_0xa12676[_0x4bfb57(0x174)]('\x5c'))throw new Error(_0x4bfb57(0x182));const _0xf8b791=_0xa12676[_0x4bfb57(0x27b)]('\x5c','/');if(_0xf8b791[_0x4bfb57(0x283)]('/')[_0x4bfb57(0x1a1)](_0x303807=>_0x303807==='..'||_0x303807===_0x4bfb57(0x1d0)))throw new Error(_0x4bfb57(0x182));let _0x5424ca;try{_0x5424ca=await realpath(resolve(_0x2851a5,_0xf8b791));}catch(_0x3ae823){if(_0x3ae823[_0x4bfb57(0x286)]===_0x4bfb57(0x177))throw new Error(_0x4bfb57(0x273));throw _0x3ae823;}const _0x22cfa4=relative(_0x2851a5,_0x5424ca);if(isAbsolute(_0x22cfa4)||_0x22cfa4[_0x4bfb57(0x174)]('..')||_0x22cfa4==='..'||_0x22cfa4[_0x4bfb57(0x174)]('..'+sep))throw new Error(_0x4bfb57(0x182));const _0x52442b=await lstat(_0x5424ca);return{'path':_0x5424ca,'metadata':_0x52442b};}async function inspectWorkspaceIndexEntry(_0x3c57d7,_0x407e65,_0xf299e3){const _0xd48fe1=_0x58ce9e;try{const _0x191d0e=await resolveWorkspaceEntryMetadata(_0x3c57d7,_0x407e65);if(!_0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x1fa)]()&&!_0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x25d)]())return undefined;const _0x69dfb=relative(_0x3c57d7,_0x191d0e[_0xd48fe1(0x1bd)])[_0xd48fe1(0x283)](sep)[_0xd48fe1(0x241)]('/');return _0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x25d)]()?{'path':_0x69dfb,'name':_0xf299e3,'kind':_0xd48fe1(0x25e),'size':null,'modifiedAt':_0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x23d)]}:{'path':_0x69dfb,'name':_0xf299e3,'kind':_0xd48fe1(0x251),'size':_0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x27f)],'modifiedAt':_0x191d0e[_0xd48fe1(0x24b)][_0xd48fe1(0x23d)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x542fa8,_0x523bd5){const _0x378279=_0x58ce9e;return Buffer[_0x378279(0x218)](JSON[_0x378279(0x1e7)]({'path':_0x542fa8,'name':_0x523bd5}))[_0x378279(0x275)](_0x378279(0x237));}function decodeDirectoryCursor(_0x256b7d,_0x254666){const _0x287b02=_0x58ce9e;if(_0x256b7d===undefined)return undefined;try{const _0x19940=JSON[_0x287b02(0x171)](Buffer[_0x287b02(0x218)](_0x256b7d,_0x287b02(0x237))[_0x287b02(0x275)](_0x287b02(0x16e)));if(typeof _0x19940!==_0x287b02(0x18e)||_0x19940===null||_0x19940[_0x287b02(0x1bd)]!==_0x254666||typeof _0x19940[_0x287b02(0x192)]!==_0x287b02(0x214))throw new Error();return _0x19940[_0x287b02(0x192)];}catch{throw new Error(_0x287b02(0x1d3));}}function encodeSearchCursor(_0xc1a87,_0x1b7dc3){const _0x1c2f64=_0x58ce9e;return Buffer[_0x1c2f64(0x218)](JSON[_0x1c2f64(0x1e7)]({'query':_0xc1a87,'path':_0x1b7dc3}))[_0x1c2f64(0x275)](_0x1c2f64(0x237));}function decodeSearchCursor(_0x20c57f,_0x494418){const _0x3db154=_0x58ce9e;if(_0x20c57f===undefined)return undefined;try{const _0x4e38fc=JSON[_0x3db154(0x171)](Buffer[_0x3db154(0x218)](_0x20c57f,_0x3db154(0x237))[_0x3db154(0x275)](_0x3db154(0x16e)));if(typeof _0x4e38fc!==_0x3db154(0x18e)||_0x4e38fc===null||_0x4e38fc[_0x3db154(0x1bb)]!==_0x494418||typeof _0x4e38fc[_0x3db154(0x1bd)]!==_0x3db154(0x214))throw new Error();return _0x4e38fc[_0x3db154(0x1bd)];}catch{throw new Error(_0x3db154(0x1d3));}}export function normalizeWorkspacePath(_0x5c13a0,_0x178536=_0x41ebff()){const _0x3cd946=_0x58ce9e;if(_0x5c13a0[_0x3cd946(0x212)]===0x17*0xc9+0xe2*0xf+0x3*-0xa6f||_0x5c13a0[_0x3cd946(0x198)]('\u0000'))throw new Error(_0x3cd946(0x1e2));if(_0x178536===_0x3cd946(0x16b)){if(/^\\\\[?.]/[_0x3cd946(0x272)](_0x5c13a0))throw new Error(_0x3cd946(0x242));const _0x252213=win32[_0x3cd946(0x1d1)](_0x5c13a0[_0x3cd946(0x27b)]('/','\x5c'));if(!win32[_0x3cd946(0x25f)](_0x252213))throw new Error(_0x3cd946(0x1cd));return _0x252213[_0x3cd946(0x1be)](/\\+$/,'')[_0x3cd946(0x234)]();}if(_0x178536!==_0x3cd946(0x1b3))throw new Error(_0x3cd946(0x226));const _0x1fbc7b=posix[_0x3cd946(0x1d1)](_0x5c13a0);if(!posix[_0x3cd946(0x25f)](_0x1fbc7b))throw new Error(_0x3cd946(0x1cd));return _0x1fbc7b==='/'?_0x1fbc7b:_0x1fbc7b[_0x3cd946(0x1be)](/\/+$/,'');}export function isWithinAllowedRoot(_0x250dc1,_0x3a2e35,_0x216c26=_0x41ebff()){const _0x17ab2d=_0x58ce9e,_0x526e54=normalizeWorkspacePath(_0x250dc1,_0x216c26),_0x3bfd0c=_0x216c26===_0x17ab2d(0x16b)?win32:posix;return _0x3a2e35[_0x17ab2d(0x1a1)](_0x43f7dc=>{const _0x3fb421=_0x17ab2d,_0x110d64=normalizeWorkspacePath(_0x43f7dc,_0x216c26),_0x50d2f1=_0x3bfd0c[_0x3fb421(0x19f)](_0x110d64,_0x526e54);return _0x50d2f1===''||!_0x50d2f1[_0x3fb421(0x174)]('..')&&!_0x3bfd0c[_0x3fb421(0x25f)](_0x50d2f1);});}export async function inspectWorkspace(_0x4d2ff4,_0x2aedcc){const _0x424045=_0x58ce9e,_0x5b0913=await realpath(_0x4d2ff4),_0x49baf3=await Promise[_0x424045(0x1e6)](_0x2aedcc[_0x424045(0x23c)](_0x4fc009=>realpath(_0x4fc009))),_0x351b09=await stat(_0x5b0913);if(!_0x351b09[_0x424045(0x25d)]()||!isWithinAllowedRoot(_0x5b0913,_0x49baf3))throw new Error(_0x424045(0x276));try{const _0x3492bd=await readGitSummary(_0x5b0913);return{'path':_0x5b0913,'kind':_0x424045(0x21a),'gitSummary':_0x3492bd};}catch(_0x1ebeaa){if(_0x1ebeaa instanceof GitCommandError&&_0x1ebeaa[_0x424045(0x286)]===0x24e6+0xea5*0x2+-0x106c*0x4||isGitUnavailable(_0x1ebeaa))return{'path':_0x5b0913,'kind':_0x424045(0x25e)};throw _0x1ebeaa;}}export async function readGitSummary(_0x473514){const _0x1eb18b=_0x58ce9e,_0x12586e=(await runReadOnlyGit(_0x473514,[_0x1eb18b(0x298),_0x1eb18b(0x292)]))[_0x1eb18b(0x20f)][_0x1eb18b(0x1ab)](),_0x1c7e72=await runReadOnlyGitAllowFailure(_0x473514,[_0x1eb18b(0x298),_0x1eb18b(0x25a),_0x1eb18b(0x271)]),_0x209818=await runReadOnlyGitAllowFailure(_0x473514,[_0x1eb18b(0x28f),_0x1eb18b(0x264),_0x1eb18b(0x1ca),_0x1eb18b(0x271)]),_0x49deca={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x69ed55=await runReadOnlyGit(_0x473514,[_0x1eb18b(0x17e),_0x1eb18b(0x21d)],_0x49deca);return{'commonDir':_0x12586e,'head':_0x1c7e72[_0x1eb18b(0x286)]===0x1*0x1079+-0x64a+-0x1*0xa2f?_0x1c7e72[_0x1eb18b(0x20f)][_0x1eb18b(0x1ab)]():'','branch':_0x209818[_0x1eb18b(0x286)]===0xa8+0x24f4+-0x259c?_0x209818[_0x1eb18b(0x20f)][_0x1eb18b(0x1ab)]():null,'dirty':_0x69ed55[_0x1eb18b(0x1a9)][_0x1eb18b(0x212)]>-0x131c+-0x12bc+0x25d8,'snapshot':summarizeText(_0x69ed55[_0x1eb18b(0x20f)])};}export function assertSafeGitRef(_0x1fd4ae){const _0x44d431=_0x58ce9e;if(!REF_PATTERN[_0x44d431(0x272)](_0x1fd4ae))throw new Error(_0x44d431(0x18a));}function _0x4dec(_0x3ab9aa,_0x2edc5c){_0x3ab9aa=_0x3ab9aa-(0xd6*0x29+0x1940+0x57*-0xab);const _0x502654=_0x4569();let _0x3f4aef=_0x502654[_0x3ab9aa];if(_0x4dec['VuuRQu']===undefined){var _0x54d214=function(_0x2ad063){const _0x52d8ab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5a9fa9='',_0x3be99e='';for(let _0x1d7660=0x56*0x22+0x330+-0xe9c,_0x1d44aa,_0x3b5fad,_0x15f62f=-0x4dc*0x1+-0x40a+0x43*0x22;_0x3b5fad=_0x2ad063['charAt'](_0x15f62f++);~_0x3b5fad&&(_0x1d44aa=_0x1d7660%(-0x6f8+0x1cd2+0x56*-0x41)?_0x1d44aa*(-0xd8f*0x2+0x9bd+0x11a1*0x1)+_0x3b5fad:_0x3b5fad,_0x1d7660++%(-0xa56+0x54f+0x1*0x50b))?_0x5a9fa9+=String['fromCharCode'](-0x1f29+0xd69*-0x1+-0x1*-0x2d91&_0x1d44aa>>(-(0xf6b+-0x23ee+0x1485)*_0x1d7660&-0x772+0x1b*-0x16c+0x2ddc)):0x1c3c+-0x2114+0x4d8){_0x3b5fad=_0x52d8ab['indexOf'](_0x3b5fad);}for(let _0x3f93ab=-0x2177+-0x1*-0x258a+-0x413*0x1,_0x3cbf21=_0x5a9fa9['length'];_0x3f93ab<_0x3cbf21;_0x3f93ab++){_0x3be99e+='%'+('00'+_0x5a9fa9['charCodeAt'](_0x3f93ab)['toString'](-0x870+0x2170+0x4*-0x63c))['slice'](-(-0x1fe6+0x7f3+0x17f5));}return decodeURIComponent(_0x3be99e);};_0x4dec['LfICxZ']=_0x54d214,_0x4dec['CKMEBg']={},_0x4dec['VuuRQu']=!![];}const _0x56350f=_0x502654[0x1322+0x12d0+0x6*-0x653];_0x4dec['EcJiii']!==_0x56350f&&(_0x4dec['CKMEBg']={},_0x4dec['EcJiii']=_0x56350f);const _0x252d93=_0x4dec['CKMEBg'][_0x3ab9aa];return _0x252d93===undefined?(_0x3f4aef=_0x4dec['LfICxZ'](_0x3f4aef),_0x4dec['CKMEBg'][_0x3ab9aa]=_0x3f4aef):_0x3f4aef=_0x252d93,_0x3f4aef;}export async function readRestrictedDiff(_0x20b0f0,_0x45f0fb,_0x1409f6){const _0x246bf9=_0x58ce9e;assertSafeGitRef(_0x45f0fb),assertSafeGitRef(_0x1409f6);const _0x53d976=await runReadOnlyGit(_0x20b0f0,[_0x246bf9(0x277),_0x246bf9(0x1a6),_0x246bf9(0x196),_0x45f0fb,_0x1409f6]),_0x375c87=_0x53d976[_0x246bf9(0x1a9)][_0x246bf9(0x198)](-0x1e25*0x1+-0x4*0x59d+-0x5*-0xa85)||_0x53d976[_0x246bf9(0x20f)][_0x246bf9(0x198)](_0x246bf9(0x27c));if(_0x375c87)return{'binary':!![],'summary':_0x246bf9(0x24a)+createHash(_0x246bf9(0x231))[_0x246bf9(0x17b)](_0x53d976[_0x246bf9(0x1a9)])[_0x246bf9(0x22e)](_0x246bf9(0x1bc))+_0x246bf9(0x279)+_0x53d976[_0x246bf9(0x1a9)][_0x246bf9(0x212)],'truncated':_0x53d976[_0x246bf9(0x26f)]};return{'binary':![],'text':_0x53d976[_0x246bf9(0x20f)],'truncated':_0x53d976[_0x246bf9(0x26f)]};}function currentBranchFromStatusHeader(_0x7de75b){const _0x1ebece=_0x58ce9e,_0x1be3c8=_0x7de75b[_0x1ebece(0x250)](0x1*0x2415+0x1f18+-0x2195*0x2);if(_0x1be3c8[_0x1ebece(0x174)](_0x1ebece(0x233)))return null;const _0x55468e=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x1ebece(0x263)](_0x1be3c8);if(_0x55468e!==null)return _0x55468e[0x1*0x108+0x8ec+-0x9f3]??null;return _0x1be3c8[_0x1ebece(0x283)](_0x1ebece(0x175))[-0xa6f*0x2+0x21cb+-0xced]?.[_0x1ebece(0x283)]('\x20')[-0xb5*0x11+0x13*0x200+0x3*-0x8a9]??null;}export async function listGitWorktrees(_0x51ed3b){const _0x15da7b=_0x58ce9e,_0x2ed089={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x868724=await runReadOnlyGitAllowFailure(_0x51ed3b,[_0x15da7b(0x181),_0x15da7b(0x1d2),_0x15da7b(0x1f5),'-z'],_0x2ed089);if(_0x868724[_0x15da7b(0x286)]===-0x112d*-0x2+0x7c1*0x2+-0x31dc)return parseGitWorktreeList(_0x51ed3b,_0x868724,!![]);if(!canRetryGitWorktreeListWithoutNullOutput(_0x868724))throw new GitCommandError(_0x868724[_0x15da7b(0x286)],_0x868724[_0x15da7b(0x22c)]);const _0x288779=await runReadOnlyGit(_0x51ed3b,[_0x15da7b(0x181),_0x15da7b(0x1d2),_0x15da7b(0x1f5)],_0x2ed089);return parseGitWorktreeList(_0x51ed3b,_0x288779,![]);}async function parseGitWorktreeList(_0x5f10e8,_0x23e46a,_0x5b9816){const _0x54a55b=_0x58ce9e,_0x27f776=normalizeWorkspacePath(await realpath(_0x5f10e8)),_0x2505d7=[];let _0x1bc744=_0x23e46a[_0x54a55b(0x26f)];const _0x119686=_0x5b9816?_0x23e46a[_0x54a55b(0x20f)][_0x54a55b(0x283)]('\x00\x00'):_0x23e46a[_0x54a55b(0x20f)][_0x54a55b(0x283)](/\r?\n\r?\n/);for(const _0x566191 of _0x119686){if(_0x566191[_0x54a55b(0x212)]===0x1c2c+0x897+-0x24c3)continue;if(_0x2505d7[_0x54a55b(0x212)]>=GIT_WORKTREE_LIST_LIMIT){_0x1bc744=!![];break;}const _0x24c5da=(_0x5b9816?_0x566191[_0x54a55b(0x283)]('\x00'):_0x566191[_0x54a55b(0x283)](/\r?\n/))[_0x54a55b(0x265)](_0x577712=>_0x577712[_0x54a55b(0x212)]>-0x832+0x14e6+-0xcb4);if(!_0x5b9816&&_0x24c5da[_0x54a55b(0x1a1)](_0x137edb=>!(_0x137edb[_0x54a55b(0x174)](_0x54a55b(0x294))||_0x137edb[_0x54a55b(0x174)](_0x54a55b(0x233))||_0x137edb[_0x54a55b(0x174)](_0x54a55b(0x17d))||_0x137edb===_0x54a55b(0x1f7)||_0x137edb===_0x54a55b(0x176)||_0x137edb===_0x54a55b(0x26d)||_0x137edb[_0x54a55b(0x174)](_0x54a55b(0x1f1))||_0x137edb===_0x54a55b(0x278)||_0x137edb[_0x54a55b(0x174)](_0x54a55b(0x1c8)))))throw new Error(_0x54a55b(0x185));if(_0x24c5da[_0x54a55b(0x1a1)](_0x5775e8=>_0x5775e8===_0x54a55b(0x1f7)))continue;const _0xff31dd=_0x24c5da[_0x54a55b(0x282)](_0x2931ab=>_0x2931ab[_0x54a55b(0x174)](_0x54a55b(0x294))),_0x418695=_0x24c5da[_0x54a55b(0x282)](_0x59dbfc=>_0x59dbfc[_0x54a55b(0x174)](_0x54a55b(0x233))),_0x200d3c=_0xff31dd?.[_0x54a55b(0x250)](_0x54a55b(0x294)[_0x54a55b(0x212)]),_0x463c1a=_0x418695?.[_0x54a55b(0x250)](_0x54a55b(0x233)[_0x54a55b(0x212)]);if(_0x200d3c===undefined||_0x200d3c[_0x54a55b(0x212)]===-0x11b1+-0xf1+0x12a2||_0x463c1a===undefined||!/^[0-9a-f]{40,64}$/u[_0x54a55b(0x272)](_0x463c1a)){if(_0x23e46a[_0x54a55b(0x26f)]){_0x1bc744=!![];continue;}throw new Error(_0x54a55b(0x185));}const _0x1e5f6b=_0x24c5da[_0x54a55b(0x282)](_0x4008c1=>_0x4008c1[_0x54a55b(0x174)](_0x54a55b(0x17d))),_0x1c0936=_0x1e5f6b?.[_0x54a55b(0x250)](_0x54a55b(0x17d)[_0x54a55b(0x212)]),_0x369fae=_0x1c0936===undefined?null:_0x1c0936[_0x54a55b(0x174)](_0x54a55b(0x280))?_0x1c0936[_0x54a55b(0x250)](_0x54a55b(0x280)[_0x54a55b(0x212)]):_0x1c0936,_0x3bd471=(basename(_0x200d3c)[_0x54a55b(0x1ab)]()||_0x369fae||_0x463c1a[_0x54a55b(0x250)](-0xc*-0x12e+-0x5d3+-0x4f*0x1b,0x122b+-0x281*-0xe+-0x352d))[_0x54a55b(0x250)](-0x1dd0+-0x1a9+0x1f79,-0x24a4+0xdd2*0x2+-0x10*-0xb0);_0x2505d7[_0x54a55b(0x28a)]({'path':_0x200d3c,'directoryName':_0x3bd471,'branch':_0x369fae,'head':_0x463c1a,'current':normalizeWorkspacePath(_0x200d3c)===_0x27f776,'locked':_0x24c5da[_0x54a55b(0x1a1)](_0x5c6dfd=>_0x5c6dfd===_0x54a55b(0x26d)||_0x5c6dfd[_0x54a55b(0x174)](_0x54a55b(0x1f1))),'prunable':_0x24c5da[_0x54a55b(0x1a1)](_0x3f8a09=>_0x3f8a09===_0x54a55b(0x278)||_0x3f8a09[_0x54a55b(0x174)](_0x54a55b(0x1c8)))});}return{'entries':_0x2505d7,'truncated':_0x1bc744};}export async function readCurrentChangesSummary(_0x463fbc){const _0x3bef66=_0x58ce9e,_0x2d211a=await runReadOnlyGit(_0x463fbc,[_0x3bef66(0x17e),_0x3bef66(0x21d),'-z',_0x3bef66(0x20c),_0x3bef66(0x19c)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x39b1d6=_0x2d211a[_0x3bef66(0x20f)][_0x3bef66(0x283)]('\x00'),_0x383115=_0x39b1d6[_0x3bef66(0x20e)]()??'',_0x162e6b=[];for(let _0x499364=-0x22f5*-0x1+-0xd*-0x28e+-0x442b;_0x499364<_0x39b1d6[_0x3bef66(0x212)];_0x499364+=0x89d*-0x2+-0x11*-0xe7+0x1e4){const _0x3d1463=_0x39b1d6[_0x499364];if(_0x3d1463[_0x3bef66(0x212)]<0x2681+-0x1e8e+0x1*-0x7ef)continue;const _0x2abf51=_0x3d1463[0x8eb+0x1545+-0x1e30],_0x3c991a=_0x3d1463[0x1688+-0x43*0x89+-0xd54*-0x1],_0x53f9c2=_0x3d1463[_0x3bef66(0x250)](-0x2bc+-0x129b+0x155a);if(_0x2abf51==='?'&&_0x3c991a==='?'){_0x162e6b[_0x3bef66(0x28a)]({'path':_0x53f9c2,'state':_0x3bef66(0x16d),'change':_0x3bef66(0x1a3)});continue;}_0x2abf51!=='\x20'&&_0x162e6b[_0x3bef66(0x28a)]({'path':_0x53f9c2,'state':_0x3bef66(0x21e),'change':gitChange(_0x2abf51)});_0x3c991a!=='\x20'&&_0x162e6b[_0x3bef66(0x28a)]({'path':_0x53f9c2,'state':_0x3bef66(0x26e),'change':gitChange(_0x3c991a)});if(_0x2abf51==='R'||_0x2abf51==='C'||_0x3c991a==='R'||_0x3c991a==='C')_0x499364+=0x10e4+0x13*0x100+-0x1*0x23e3;}return{'branch':_0x383115[_0x3bef66(0x174)](_0x3bef66(0x253))?currentBranchFromStatusHeader(_0x383115):null,'changes':_0x162e6b};}export async function listInitializedSubmodulePaths(_0x27dc5b){const _0x341fe4=_0x58ce9e,_0x11813f=await runReadOnlyGit(_0x27dc5b,[_0x341fe4(0x25b),_0x341fe4(0x17e),_0x341fe4(0x221)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x11813f[_0x341fe4(0x20f)][_0x341fe4(0x283)](/\r?\n/)[_0x341fe4(0x23a)](_0x5c7fd3=>{const _0xd9cea2=_0x341fe4;if(_0x5c7fd3[_0xd9cea2(0x212)]<-0x121+-0x4*0x2f+0x207)return[];const _0x5697fe=_0x5c7fd3[-0x2*0x134f+-0x9c1+-0x6e9*-0x7];if(_0x5697fe==='-')return[];const _0x1499ff=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0xd9cea2(0x263)](_0x5c7fd3),_0x3b3168=_0x1499ff?.[-0x1d9f+0x1c6*0xd+0x692]?.[_0xd9cea2(0x27b)]('\x5c','/');return _0x3b3168===undefined||_0x3b3168[_0xd9cea2(0x212)]===-0x2467+0x13c8+0x109f?[]:[_0x3b3168];})[_0x341fe4(0x1b5)]((_0x123009,_0x365bce)=>_0x123009[_0x341fe4(0x29a)](_0x365bce));}export async function resolveGitRepository(_0x3f07ab,_0xa11917,_0x11c35a){const _0x435765=_0x58ce9e,_0x542ac0=await realpath(_0x3f07ab);if(_0xa11917[_0x435765(0x212)]===0x21f1+-0x1358*-0x1+-0x3549)return _0x542ac0;if(_0xa11917[_0x435765(0x198)]('\x00')||_0xa11917[_0x435765(0x174)]('/')||_0xa11917[_0x435765(0x174)]('\x5c')||_0xa11917[_0x435765(0x283)]('/')[_0x435765(0x1a1)](_0x2985a9=>_0x2985a9[_0x435765(0x212)]===-0x1*0x253d+-0x18ff+0x472*0xe||_0x2985a9==='.'||_0x2985a9==='..'))throw new Error(_0x435765(0x1f8));try{const _0x1da94f=resolve(_0x542ac0,_0xa11917),_0x260209=await realpath(_0x1da94f);if(normalizeWorkspacePath(_0x1da94f)!==normalizeWorkspacePath(_0x260209)||!isWithinAllowedRoot(_0x260209,[_0x542ac0]))throw new Error(_0x435765(0x1c0));if(_0x11c35a!==undefined){if(!_0x11c35a[_0x435765(0x198)](_0xa11917))throw new Error(_0x435765(0x1c0));return _0x260209;}return await assertGitSuperprojectChain(_0x542ac0,_0x260209),_0x260209;}catch{throw new Error(_0x435765(0x1f8));}}export async function resolveGitRepositoryTarget(_0x572c47,_0x2cd532,_0x43e306,_0x4686c1){const _0x4e13be=_0x58ce9e;if(_0x43e306===undefined)return resolveGitRepository(_0x572c47,_0x2cd532,_0x4686c1);if(_0x2cd532[_0x4e13be(0x212)]!==0x1ffc+-0xb*0x39+-0x1d89||_0x43e306[_0x4e13be(0x212)]===0x54e+-0x1b88+0x472*0x5||_0x43e306[_0x4e13be(0x212)]>-0x52d+-0x22d9+0x3806||_0x43e306[_0x4e13be(0x198)]('\x00'))throw new Error(_0x4e13be(0x1f8));const _0x302ff8=normalizeWorkspacePath(_0x43e306),_0x4f103f=await listGitWorktrees(_0x572c47),_0x196c00=_0x4f103f[_0x4e13be(0x1db)][_0x4e13be(0x282)](_0x4347a5=>normalizeWorkspacePath(_0x4347a5[_0x4e13be(0x1bd)])===_0x302ff8);if(_0x196c00===undefined||_0x196c00[_0x4e13be(0x278)])throw new Error(_0x4e13be(0x1f8));try{return await realpath(_0x196c00[_0x4e13be(0x1bd)]);}catch{throw new Error(_0x4e13be(0x1f8));}}async function assertGitSuperprojectChain(_0x52ffb0,_0x4c8df2){const _0x179283=_0x58ce9e,_0x3f94be=normalizeWorkspacePath(_0x52ffb0);let _0x335292=_0x4c8df2;const _0x7a3f7=new Set();for(let _0xb52aaf=-0x1a86+0x1ca5+-0x1*0x21f;_0xb52aaf<-0x8a5*-0x4+0x1*0x1229+-0x347d*0x1;_0xb52aaf+=0x19ac+0x6f*-0x3b+0x1*-0x16){const _0x27e0e8=normalizeWorkspacePath(_0x335292);if(_0x27e0e8===_0x3f94be)return;if(_0x7a3f7[_0x179283(0x18d)](_0x27e0e8))throw new Error(_0x179283(0x1c0));_0x7a3f7[_0x179283(0x1fc)](_0x27e0e8);const _0x3a220f=await runReadOnlyGit(_0x335292,[_0x179283(0x298),_0x179283(0x207),_0x179283(0x243)]),[_0xfb5b11,_0x3fedd]=_0x3a220f[_0x179283(0x20f)][_0x179283(0x283)](/\r?\n/);if(_0xfb5b11===undefined||_0x3fedd===undefined||_0x3fedd[_0x179283(0x212)]===-0xa0f*0x3+-0x35*0x92+0x3c67)throw new Error(_0x179283(0x1c0));const _0x38545d=await realpath(_0xfb5b11),_0x363102=await realpath(_0x3fedd);if(normalizeWorkspacePath(_0x38545d)!==_0x27e0e8||normalizeWorkspacePath(_0x363102)===_0x27e0e8||!isWithinAllowedRoot(_0x363102,[_0x52ffb0])||!isWithinAllowedRoot(_0x335292,[_0x363102]))throw new Error(_0x179283(0x1c0));_0x335292=_0x363102;}throw new Error(_0x179283(0x1c0));}export async function listGitHistoryRefs(_0x2c2baf){const _0xd48123=_0x58ce9e,_0x1e8cca=await runReadOnlyGit(_0x2c2baf,[_0xd48123(0x26c),_0xd48123(0x256),_0xd48123(0x262),_0xd48123(0x1b4)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x1e8cca[_0xd48123(0x20f)][_0xd48123(0x283)](/\r?\n/)[_0xd48123(0x23a)](_0x6601b1=>{const _0x1f151b=_0xd48123,[_0x454a79,_0xd44127,_0x3bc140,_0xc65be0,_0x1a835a]=_0x6601b1[_0x1f151b(0x283)]('\x09');if(_0x454a79===undefined||_0xd44127===undefined||_0x3bc140===undefined||_0x1a835a===undefined||_0x1a835a[_0x1f151b(0x212)]>0x2*0x12bd+0x1e31+0x43ab*-0x1||!/^[0-9a-f]{40,64}$/[_0x1f151b(0x272)](_0x3bc140))return[];const _0x5e8058=_0x454a79[_0x1f151b(0x174)](_0x1f151b(0x280))?_0x1f151b(0x274):_0x454a79[_0x1f151b(0x174)](_0x1f151b(0x28b))?_0x1f151b(0x1d8):undefined;return _0x5e8058===undefined?[]:[{'name':_0x454a79,'displayName':_0xd44127,'kind':_0x5e8058,'hash':_0x3bc140,'current':_0xc65be0==='*'}];})[_0xd48123(0x1b5)]((_0x3c8136,_0x3d0a50)=>_0x3c8136[_0xd48123(0x1a2)][_0xd48123(0x29a)](_0x3d0a50[_0xd48123(0x1a2)])||_0x3c8136[_0xd48123(0x19d)][_0xd48123(0x29a)](_0x3d0a50[_0xd48123(0x19d)]));}function selectedHistoryRefs(_0x59b937,_0x434832){const _0x300428=_0x58ce9e;if(_0x434832===undefined||_0x434832[_0x300428(0x212)]===-0x6d5*-0x5+-0x48b+0x22*-0xdf)return _0x59b937;const _0x3492b8=[...new Set(_0x434832)],_0x43781b=_0x3492b8[_0x300428(0x23c)](_0x1a15c8=>_0x59b937[_0x300428(0x282)](_0x4489e4=>_0x4489e4[_0x300428(0x192)]===_0x1a15c8));if(_0x43781b[_0x300428(0x1a1)](_0x56d877=>_0x56d877===undefined))throw new Error(_0x300428(0x1c1));return _0x43781b;}function historyCursor(_0x2fc715,_0x42f4be){const _0x116c31=_0x58ce9e;return Buffer[_0x116c31(0x218)](JSON[_0x116c31(0x1e7)]({'offset':_0x2fc715,'fingerprint':_0x42f4be}))[_0x116c31(0x275)](_0x116c31(0x237));}function parseHistoryCursor(_0x448a57,_0x3f7f16){const _0x3a24fc=_0x58ce9e;if(_0x448a57===undefined)return 0x1927+-0x3b3*-0x3+-0x14*0x1d0;try{const _0x575a56=JSON[_0x3a24fc(0x171)](Buffer[_0x3a24fc(0x218)](_0x448a57,_0x3a24fc(0x237))[_0x3a24fc(0x275)](_0x3a24fc(0x16e)));if(!Number[_0x3a24fc(0x245)](_0x575a56[_0x3a24fc(0x1c3)])||_0x575a56[_0x3a24fc(0x1c3)]<-0x6e6+-0x2a+-0x1*-0x710||_0x575a56[_0x3a24fc(0x215)]!==_0x3f7f16)throw new Error(_0x3a24fc(0x1c0));return _0x575a56[_0x3a24fc(0x1c3)];}catch{throw new Error(_0x3a24fc(0x224));}}export async function readGitHistory(_0x1158f4,_0x33b380){const _0x59fecb=_0x58ce9e,_0x4b59a7=await listGitHistoryRefs(_0x1158f4),_0x3ebcb2=selectedHistoryRefs(_0x4b59a7,_0x33b380[_0x59fecb(0x17a)]);if(_0x3ebcb2[_0x59fecb(0x212)]===0x1d2f+0x9*0xb7+-0x239e)return{'commits':[],'nextCursor':null};const _0x2d86b6=_0x33b380[_0x59fecb(0x1ee)]??0x235e+0x184e+0x2e*-0x14b;if(!Number[_0x59fecb(0x245)](_0x2d86b6)||_0x2d86b6<0x287+-0x1e4c+0x1bc6||_0x2d86b6>0x2073*-0x1+-0x220f+0x42e6)throw new Error(_0x59fecb(0x208));const _0x3b0c9a=_0x3ebcb2[_0x59fecb(0x23c)](_0x19aa09=>_0x19aa09[_0x59fecb(0x192)])[_0x59fecb(0x1b5)](),_0x583f86=_0x33b380[_0x59fecb(0x17a)]===undefined||_0x33b380[_0x59fecb(0x17a)][_0x59fecb(0x212)]===-0x3*-0x85e+-0x1a15+0xfb*0x1||_0x3ebcb2[_0x59fecb(0x212)]===_0x4b59a7[_0x59fecb(0x212)]&&_0x3ebcb2[_0x59fecb(0x1b0)](_0x263c40=>_0x4b59a7[_0x59fecb(0x1a1)](_0x4847a7=>_0x4847a7[_0x59fecb(0x192)]===_0x263c40[_0x59fecb(0x192)])),_0x46564a=_0x583f86?[_0x59fecb(0x1e0),_0x59fecb(0x190)]:_0x3b0c9a,_0x351019=createHash(_0x59fecb(0x231))[_0x59fecb(0x17b)](_0x3ebcb2[_0x59fecb(0x23c)](_0x17a89f=>_0x17a89f[_0x59fecb(0x192)]+'\x00'+_0x17a89f[_0x59fecb(0x213)])[_0x59fecb(0x1b5)]()[_0x59fecb(0x241)]('\x00'))[_0x59fecb(0x22e)](_0x59fecb(0x1bc)),_0x16374b=parseHistoryCursor(_0x33b380[_0x59fecb(0x1dd)],_0x351019),_0x290c78=await runReadOnlyGit(_0x1158f4,[_0x59fecb(0x1d6),_0x59fecb(0x24e),_0x59fecb(0x284),_0x59fecb(0x193)+_0x16374b,_0x59fecb(0x236)+(_0x2d86b6+(-0x887*0x3+0x2*0x6e0+-0x3*-0x3f2)),'-z',_0x59fecb(0x1c9),..._0x46564a,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x5ec944=new Map();for(const _0x369f36 of _0x4b59a7){const _0x48e7eb=_0x5ec944[_0x59fecb(0x240)](_0x369f36[_0x59fecb(0x213)])??[];_0x48e7eb[_0x59fecb(0x28a)](_0x369f36[_0x59fecb(0x19d)]),_0x5ec944[_0x59fecb(0x268)](_0x369f36[_0x59fecb(0x213)],_0x48e7eb);}const _0x3546d0=_0x290c78[_0x59fecb(0x20f)][_0x59fecb(0x283)]('\x00'),_0x5ac9b0=[];for(let _0x38f74d=-0x11dc+-0xb89+0xd7*0x23;_0x38f74d+(0x1ced+-0x200e+0x326)<_0x3546d0[_0x59fecb(0x212)];_0x38f74d+=0x1a3f+-0x1*-0x246e+-0x3ea7){const [_0x2b7dca,_0x4b227a='',_0x59a858='',_0x52e7b9='',_0x51bda7='0',_0x1e6983='']=_0x3546d0[_0x59fecb(0x250)](_0x38f74d,_0x38f74d+(0x3*0x821+0x65c*-0x2+-0xba5));if(_0x2b7dca===undefined||!/^[0-9a-f]{40,64}$/[_0x59fecb(0x272)](_0x2b7dca))continue;_0x5ac9b0[_0x59fecb(0x28a)]({'hash':_0x2b7dca,'parents':_0x4b227a[_0x59fecb(0x212)]===-0x1cb5*0x1+-0xaa2*0x1+-0x9*-0x45f?[]:_0x4b227a[_0x59fecb(0x283)]('\x20'),'authorName':_0x59a858,'authorEmail':_0x52e7b9,'committedAt':Number(_0x51bda7)*(0x2*-0xf73+0x1621+0xcad*0x1),'subject':_0x1e6983,'refs':_0x5ec944[_0x59fecb(0x240)](_0x2b7dca)??[]});}const _0x17f2c9=_0x5ac9b0[_0x59fecb(0x212)]>_0x2d86b6;return{'commits':_0x5ac9b0[_0x59fecb(0x250)](0x13c8+0x1eb1+-0x1*0x3279,_0x2d86b6),'nextCursor':_0x17f2c9?historyCursor(_0x16374b+_0x2d86b6,_0x351019):null};}async function assertHistoryCommitReachable(_0x50ad59,_0x58aad7,_0x3fad23){const _0x39dbe6=_0x58ce9e;if(!/^[0-9a-f]{40,64}$/[_0x39dbe6(0x272)](_0x58aad7))throw new Error(_0x39dbe6(0x1af));const _0x4ffa93=selectedHistoryRefs(await listGitHistoryRefs(_0x50ad59),_0x3fad23);for(const _0x569d0c of _0x4ffa93){const _0xa1cdf7=await runReadOnlyGitAllowFailure(_0x50ad59,[_0x39dbe6(0x1de),_0x39dbe6(0x232),_0x58aad7,_0x569d0c[_0x39dbe6(0x192)]]);if(_0xa1cdf7[_0x39dbe6(0x286)]===-0x1*-0xcd7+-0x15a4+0x8cd)return;}throw new Error(_0x39dbe6(0x1af));}export async function readGitHistoryFiles(_0x2f4bd1,_0x300ba9,_0x42a1ce){const _0x5638c0=_0x58ce9e;await assertHistoryCommitReachable(_0x2f4bd1,_0x300ba9,_0x42a1ce);const _0x74992b=await runReadOnlyGit(_0x2f4bd1,[_0x5638c0(0x219),_0x5638c0(0x297),_0x5638c0(0x267),_0x5638c0(0x228),'-r','-z','-M','-C',_0x5638c0(0x1eb),_0x300ba9],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x5c4456=_0x74992b[_0x5638c0(0x20f)][_0x5638c0(0x283)]('\x00'),_0x41c7f2=[];for(let _0x2749a8=-0x26ab+0x20ef*-0x1+-0x23cd*-0x2;_0x2749a8<_0x5c4456[_0x5638c0(0x212)];_0x2749a8+=0x2285+-0x1bfb+0x1*-0x689){const _0x3ece50=_0x5c4456[_0x2749a8];if(_0x3ece50===undefined||_0x3ece50[_0x5638c0(0x212)]===-0x3*0x5f1+-0x1e*0x20+0x1593)continue;const _0x36249f=_0x3ece50[-0x638+0x198d+-0x1355]??'M';if(_0x36249f==='R'||_0x36249f==='C'){const _0x282ef6=_0x5c4456[_0x2749a8+(0x19a5*-0x1+0x1b3c+-0xcb*0x2)],_0x31a385=_0x5c4456[_0x2749a8+(0x224+-0x1*0x1dd+-0x45)];if(_0x282ef6!==undefined&&_0x31a385!==undefined)_0x41c7f2[_0x5638c0(0x28a)]({'path':_0x31a385,'previousPath':_0x282ef6,'change':gitChange(_0x36249f)});_0x2749a8+=0x1*0x59a+-0x2*0x10dd+-0xd*-0x22a;}else{const _0x17ec1c=_0x5c4456[_0x2749a8+(0x71*-0x4a+0x1*-0x3b5+0x2460)];if(_0x17ec1c!==undefined)_0x41c7f2[_0x5638c0(0x28a)]({'path':_0x17ec1c,'change':gitChange(_0x36249f)});_0x2749a8+=0xd*-0x182+-0x17b9*0x1+0x2b54;}}return _0x41c7f2;}export async function readGitHistoryFileDiff(_0x3c3088,_0x5ae2e9,_0x22cd82,_0x562c04,_0x36c205){const _0x33230e=_0x58ce9e;await assertHistoryCommitReachable(_0x3c3088,_0x5ae2e9,_0x562c04);const _0x59883d=safeGitWorkspacePath(_0x22cd82),_0x32d929=_0x36c205===undefined?undefined:safeGitWorkspacePath(_0x36c205),_0x292c05=await runReadOnlyGit(_0x3c3088,[_0x33230e(0x20b),_0x33230e(0x223),_0x33230e(0x267),_0x33230e(0x1a6),_0x33230e(0x196),_0x5ae2e9,'--',_0x33230e(0x254)+_0x59883d,..._0x32d929===undefined||_0x32d929===_0x59883d?[]:[_0x33230e(0x254)+_0x32d929]]),_0x17497d=_0x292c05[_0x33230e(0x1a9)][_0x33230e(0x198)](0x379*0x2+-0x1c0c+-0x49*-0x4a)||_0x292c05[_0x33230e(0x20f)][_0x33230e(0x198)](_0x33230e(0x27c));if(_0x17497d)return{'binary':!![],'summary':_0x33230e(0x24a)+createHash(_0x33230e(0x231))[_0x33230e(0x17b)](_0x292c05[_0x33230e(0x1a9)])[_0x33230e(0x22e)](_0x33230e(0x1bc))+_0x33230e(0x279)+_0x292c05[_0x33230e(0x1a9)][_0x33230e(0x212)],'truncated':_0x292c05[_0x33230e(0x26f)]};return{'binary':![],'text':_0x292c05[_0x33230e(0x20f)],'truncated':_0x292c05[_0x33230e(0x26f)]};}export async function readGitHistoryFileContentRange(_0x2a6b68,_0x122779,_0x5d2280,_0x2e23b2,_0xf096ba,_0x33c846){const _0x28f916=_0x58ce9e;if(!Number[_0x28f916(0x238)](_0x2e23b2)||_0x2e23b2<0x7c*0x7+0x5*0x2cf+0x116f*-0x1||!Number[_0x28f916(0x238)](_0xf096ba)||_0xf096ba<0x23b5+-0x183b*-0x1+0x3bef*-0x1||_0xf096ba>(-0x6fb+-0x576+0xc85*0x1)*(-0x11c*0x1f+-0xf5c+0xac0*0x5)*(-0x1*-0x1a1e+0xb3*-0x29+-0x81*-0xd)||_0x2e23b2+_0xf096ba>(-0x1d12+-0x141b+0x579*0x9)*(0x14c+-0x1993*-0x1+-0x16df)*(0x46*0xa+0x242*0xa+-0x1550))throw new Error(_0x28f916(0x24d));await assertHistoryCommitReachable(_0x2a6b68,_0x122779,_0x33c846);const _0x1b4d34=safeGitWorkspacePath(_0x5d2280),_0x4f3515=_0x122779+':'+_0x1b4d34,_0x2f0148=await runReadOnlyGit(_0x2a6b68,[_0x28f916(0x1d9),'-s',_0x4f3515]),_0x4d80cd=Number(_0x2f0148[_0x28f916(0x20f)][_0x28f916(0x1ab)]());if(!Number[_0x28f916(0x238)](_0x4d80cd)||_0x4d80cd<-0xecf*0x2+-0x1*0x1e02+-0x4f8*-0xc||_0x2e23b2>_0x4d80cd)throw new Error(_0x28f916(0x24d));if(_0x2e23b2===_0x4d80cd)return{'path':_0x1b4d34,'size':_0x4d80cd,'offset':_0x2e23b2,'contentBase64':'','nextOffset':null};const _0xe11812=await runReadOnlyGitAllowFailure(_0x2a6b68,[_0x28f916(0x1d9),_0x28f916(0x186),_0x4f3515],{'outputLimit':_0x2e23b2+_0xf096ba,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0xe11812[_0x28f916(0x286)]!==0x779*-0x2+-0x23a3*0x1+-0x1*-0x3295)throw new GitCommandError(_0xe11812[_0x28f916(0x286)],_0xe11812[_0x28f916(0x22c)]);const _0x39ac56=_0xe11812[_0x28f916(0x1a9)][_0x28f916(0x27d)](_0x2e23b2,Math[_0x28f916(0x1ac)](_0x4d80cd,_0x2e23b2+_0xf096ba)),_0x5ab68d=_0x2e23b2+_0x39ac56[_0x28f916(0x212)];return{'path':_0x1b4d34,'size':_0x4d80cd,'offset':_0x2e23b2,'contentBase64':_0x39ac56[_0x28f916(0x275)](_0x28f916(0x18c)),'nextOffset':_0x5ab68d<_0x4d80cd?_0x5ab68d:null};}export async function readCurrentChanges(_0x302e72){const _0x3760b6=_0x58ce9e;return(await readCurrentChangesSummary(_0x302e72))[_0x3760b6(0x1df)];}export async function readCurrentChangeDiff(_0x399aff,_0x23f92b){const _0x5c5e89=_0x58ce9e,_0x330e53=safeGitWorkspacePath(_0x23f92b);await assertCurrentChangePathAccessible(_0x399aff,_0x330e53);const _0x8c5379=await readCurrentChangeGitDiff(_0x399aff,_0x330e53),_0x267e5d=await readWorkingTreeText(_0x399aff,_0x330e53),_0x4be45d=_0x8c5379[_0x5c5e89(0x1a9)][_0x5c5e89(0x198)](-0x1*-0x12db+-0x7b1*0x1+-0xb2a)||_0x8c5379[_0x5c5e89(0x20f)][_0x5c5e89(0x198)](_0x5c5e89(0x27c))||_0x267e5d?.[_0x5c5e89(0x179)]===!![];if(_0x4be45d)return{'binary':!![],'summary':_0x5c5e89(0x24a)+createHash(_0x5c5e89(0x231))[_0x5c5e89(0x17b)](_0x8c5379[_0x5c5e89(0x1a9)])[_0x5c5e89(0x22e)](_0x5c5e89(0x1bc))+_0x5c5e89(0x279)+_0x8c5379[_0x5c5e89(0x1a9)][_0x5c5e89(0x212)],'truncated':_0x8c5379[_0x5c5e89(0x26f)]||_0x267e5d?.[_0x5c5e89(0x26f)]===!![]};return{'binary':![],'text':_0x8c5379[_0x5c5e89(0x20f)],'truncated':_0x8c5379[_0x5c5e89(0x26f)]||_0x267e5d?.[_0x5c5e89(0x26f)]===!![],'afterText':_0x267e5d?.[_0x5c5e89(0x20f)]??'',..._0x267e5d===undefined?{}:{'afterTruncated':_0x267e5d[_0x5c5e89(0x26f)]}};}async function readCurrentChangeGitDiff(_0x42996d,_0x4e0264){const _0x4911bc=_0x58ce9e,_0x245bac=await runReadOnlyGit(_0x42996d,[_0x4911bc(0x244),_0x4911bc(0x290),_0x4911bc(0x266),'-z','--',_0x4911bc(0x254)+_0x4e0264]);if(_0x245bac[_0x4911bc(0x20f)][_0x4911bc(0x283)]('\x00')[_0x4911bc(0x198)](_0x4e0264)){const _0x56526c=await runReadOnlyGitAllowFailure(_0x42996d,[_0x4911bc(0x277),_0x4911bc(0x287),_0x4911bc(0x1a6),_0x4911bc(0x196),'--',_0x4911bc(0x1b1),_0x4e0264]);if(_0x56526c[_0x4911bc(0x286)]!==-0x2*0x10e1+0x100a+-0x3*-0x5e8&&_0x56526c[_0x4911bc(0x286)]!==-0xcd6*-0x2+0x1*0x26ce+0x4079*-0x1)throw new GitCommandError(_0x56526c[_0x4911bc(0x286)],_0x56526c[_0x4911bc(0x22c)]);return _0x56526c;}return runReadOnlyGit(_0x42996d,[_0x4911bc(0x277),_0x4911bc(0x1a6),_0x4911bc(0x196),_0x4911bc(0x271),'--',_0x4911bc(0x254)+_0x4e0264]);}export async function isWorkspaceChangeVisible(_0x5e8d8b,_0x20f0f6){const _0x20e540=_0x58ce9e;try{return await assertCurrentChangePathAccessible(_0x5e8d8b,safeGitWorkspacePath(_0x20f0f6)),!![];}catch(_0x346bbc){if(_0x346bbc instanceof Error&&(_0x346bbc[_0x20e540(0x19b)]===_0x20e540(0x182)||_0x346bbc[_0x20e540(0x19b)]===_0x20e540(0x273)||_0x346bbc[_0x20e540(0x19b)]===_0x20e540(0x27e)))return![];throw _0x346bbc;}}async function assertCurrentChangePathAccessible(_0x330b7c,_0x3b46a9){const _0xf9015e=_0x58ce9e,_0x5e10d7=await realpath(_0x330b7c),_0xbea4cf=resolve(_0x5e10d7,_0x3b46a9),_0x439205=await lstat(_0xbea4cf)[_0xf9015e(0x195)](_0x42a136=>{const _0x311f4c=_0xf9015e;if(_0x42a136[_0x311f4c(0x286)]===_0x311f4c(0x177))return undefined;throw _0x42a136;});if(_0x439205===undefined)return;await resolveWorkspaceEntry(_0x5e10d7,_0x3b46a9,![]);}async function readWorkingTreeText(_0xfdf5b,_0x43bf37){const _0x2e98be=_0x58ce9e,_0x17ca22=await realpath(_0xfdf5b);let _0x211eec;try{_0x211eec=await resolveWorkspaceEntry(_0x17ca22,_0x43bf37,![]);}catch(_0x5e690a){if(_0x5e690a instanceof Error&&_0x5e690a[_0x2e98be(0x19b)]===_0x2e98be(0x273))return undefined;throw _0x5e690a;}const _0x37b34=await lstat(_0x211eec);if(!_0x37b34[_0x2e98be(0x1fa)]())return undefined;const _0x519b75=await readFile(_0x211eec);return diffTextFromBuffer(_0x519b75,_0x519b75[_0x2e98be(0x212)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x4c8a58,_0x5ac80e){const _0x375c34=_0x58ce9e;if(_0x4c8a58[_0x375c34(0x198)](0x17da+-0x22a5+0xacb)||!isValidUtf8(_0x4c8a58))return{'binary':!![],'truncated':_0x5ac80e};let _0x4c7c9c=Math[_0x375c34(0x1ac)](_0x4c8a58[_0x375c34(0x212)],GIT_OUTPUT_LIMIT);while(_0x4c7c9c>-0x1*0x752+0x9*-0x111+0x10eb&&_0x4c7c9c<_0x4c8a58[_0x375c34(0x212)]&&isUtf8ContinuationByte(_0x4c8a58[_0x4c7c9c]))_0x4c7c9c-=-0x2*0x1297+-0xb65+0x3094;return{'binary':![],'text':_0x4c8a58[_0x375c34(0x27d)](0x13d3*0x1+-0x1768+-0x7*-0x83,_0x4c7c9c)[_0x375c34(0x275)](_0x375c34(0x16e)),'truncated':_0x5ac80e};}export async function restoreCurrentChange(_0x34045c,_0x347730,_0x2b7aa2){const _0x53b1dc=_0x58ce9e,_0x1762bb=safeGitWorkspacePath(_0x347730),_0x38f57a=_0x53b1dc(0x254)+_0x1762bb;if(_0x2b7aa2===_0x53b1dc(0x16d)){const _0x5aa268=await runReadOnlyGit(_0x34045c,[_0x53b1dc(0x17e),_0x53b1dc(0x21d),'-z',_0x53b1dc(0x19c),'--',_0x38f57a]);if(!_0x5aa268[_0x53b1dc(0x20f)][_0x53b1dc(0x283)]('\x00')[_0x53b1dc(0x1a1)](_0x465f36=>_0x465f36[_0x53b1dc(0x174)](_0x53b1dc(0x1ed))&&_0x465f36[_0x53b1dc(0x250)](0x371+0x18e9*0x1+0x1*-0x1c57)===_0x1762bb))throw new Error(_0x53b1dc(0x1fe));const _0x3dbf31=await realpath(_0x34045c),_0x2b8c31=resolve(_0x3dbf31,_0x1762bb),_0x187c9a=await lstat(_0x2b8c31);if(!_0x187c9a[_0x53b1dc(0x1fa)]()||_0x187c9a[_0x53b1dc(0x1ad)]())throw new Error(_0x53b1dc(0x1fe));await unlink(_0x2b8c31);return;}if(_0x2b7aa2===_0x53b1dc(0x26e)){await runGit(_0x34045c,[_0x53b1dc(0x28e),_0x53b1dc(0x252),'--',_0x38f57a]);return;}await runGit(_0x34045c,[_0x53b1dc(0x28e),_0x53b1dc(0x1b9),_0x53b1dc(0x1c5),_0x53b1dc(0x252),'--',_0x38f57a]);}function safeGitWorkspacePath(_0x3d67b8){const _0x5a77d5=_0x58ce9e;if(_0x3d67b8[_0x5a77d5(0x212)]===0x3*-0x605+0x1b6e+0x1*-0x95f||_0x3d67b8[_0x5a77d5(0x198)]('\x00')||_0x3d67b8[_0x5a77d5(0x174)]('/')||_0x3d67b8[_0x5a77d5(0x174)]('\x5c'))throw new Error(_0x5a77d5(0x182));const _0x36dbcc=_0x3d67b8[_0x5a77d5(0x27b)]('\x5c','/');if(_0x36dbcc[_0x5a77d5(0x283)]('/')[_0x5a77d5(0x1a1)](_0x244b99=>_0x244b99===''||_0x244b99==='..'||_0x244b99===_0x5a77d5(0x1d0)))throw new Error(_0x5a77d5(0x182));return _0x36dbcc;}function gitChange(_0x4b6e03){const _0x50f6ea=_0x58ce9e;if(_0x4b6e03==='A')return _0x50f6ea(0x1a3);if(_0x4b6e03==='D')return _0x50f6ea(0x1ce);if(_0x4b6e03==='R')return _0x50f6ea(0x1f2);if(_0x4b6e03==='C')return _0x50f6ea(0x22d);if(_0x4b6e03==='T')return _0x50f6ea(0x1aa);return _0x50f6ea(0x19a);}export class GitCommandError extends Error{[_0x58ce9e(0x286)];[_0x58ce9e(0x22c)];constructor(_0x355b7d,_0x4191f9){const _0x1f9dac=_0x58ce9e;super(_0x1f9dac(0x1ae)),this[_0x1f9dac(0x286)]=_0x355b7d,this[_0x1f9dac(0x22c)]=_0x4191f9;}}async function runReadOnlyGit(_0x3d14c6,_0x3aa785,_0x268c97={}){return runGit(_0x3d14c6,_0x3aa785,{..._0x268c97,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0x1deb66,_0x88bc18,_0x510b79={}){return runGitAllowFailure(_0x1deb66,_0x88bc18,{..._0x510b79,'readOnly':!![]});}async function runGit(_0x3e8768,_0x4d628f,_0x1dcff5={}){const _0x29384e=_0x58ce9e,_0x5602ae=await runGitAllowFailure(_0x3e8768,_0x4d628f,_0x1dcff5);if(_0x5602ae[_0x29384e(0x286)]!==-0x6b*-0x8+0x9*-0xc9+0x3b9)throw new GitCommandError(_0x5602ae[_0x29384e(0x286)],_0x5602ae[_0x29384e(0x22c)]);return _0x5602ae;}async function runGitAllowFailure(_0x1004ce,_0x2b3d7e,_0x9acaaf={}){return new Promise((_0x56d30a,_0x1b1368)=>{const _0x159366=_0x4dec,_0x3a8723=_0x9acaaf[_0x159366(0x1c4)]??GIT_OUTPUT_LIMIT,_0xaa751b=spawn(_0x159366(0x1c2),[..._0x2b3d7e],{'cwd':_0x1004ce,'shell':![],'windowsHide':!![],'stdio':[_0x159366(0x248),_0x159366(0x201),_0x159366(0x201)],..._0x9acaaf[_0x159366(0x18f)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x478e3c=[],_0x1df6ef=[];let _0x4d6bfd=-0xed3+-0x14b*-0x13+0x9be*-0x1,_0x46b968=-0x7*0x254+-0x1*0x2431+0x347d,_0x403ee0=![];const _0x321d39=setTimeout(()=>{const _0xbd457b=_0x159366;if(process[_0xbd457b(0x183)]===_0xbd457b(0x16b)){const _0x17ca48=_0xaa751b[_0xbd457b(0x222)];if(_0x17ca48===undefined){_0xaa751b[_0xbd457b(0x1ff)](_0xbd457b(0x206));return;}void terminateProcessTree({'pid':_0x17ca48,'kill':_0x51a9d6=>_0xaa751b[_0xbd457b(0x1ff)](_0x51a9d6)},_0xbd457b(0x16b))[_0xbd457b(0x195)](()=>{const _0x5c94c0=_0xbd457b;try{_0xaa751b[_0x5c94c0(0x1ff)](_0x5c94c0(0x206));}catch{}});return;}_0xaa751b[_0xbd457b(0x1ff)](_0xbd457b(0x206));},_0x9acaaf[_0x159366(0x16c)]??GIT_TIMEOUT_MS);_0xaa751b[_0x159366(0x191)]['on'](_0x159366(0x1b6),_0x4a8fe3=>{const _0x921dd4=_0x159366,_0x5559fb=Math[_0x921dd4(0x288)](0x1db0+0xb05+-0x28b5,_0x3a8723-_0x4d6bfd);if(_0x5559fb>0x13e7*0x1+-0x12f*0x1+-0x12b8){const _0x3c0e3a=_0x4a8fe3[_0x921dd4(0x27d)](-0x2a1*0x6+0x1939+-0x29*0x3b,_0x5559fb);_0x478e3c[_0x921dd4(0x28a)](_0x3c0e3a),_0x4d6bfd+=_0x3c0e3a[_0x921dd4(0x212)];}_0x403ee0||=_0x4a8fe3[_0x921dd4(0x212)]>_0x5559fb;}),_0xaa751b[_0x159366(0x22c)]['on'](_0x159366(0x1b6),_0x5e650e=>{const _0x451509=_0x159366,_0x3f546d=Math[_0x451509(0x288)](0x26da+-0x4*-0x5c6+-0x3df2,-0xad5+-0x8f*-0x35+-0x2c6-_0x46b968);if(_0x3f546d===-0xf3d+-0x147c+0x23b9)return;const _0x421e8f=_0x5e650e[_0x451509(0x27d)](0x1*0x43f+-0x5*0x385+0xd5a,_0x3f546d);_0x1df6ef[_0x451509(0x28a)](_0x421e8f),_0x46b968+=_0x421e8f[_0x451509(0x212)];}),_0xaa751b[_0x159366(0x1d5)](_0x159366(0x1ea),_0x27fcfd=>{clearTimeout(_0x321d39),_0x1b1368(_0x27fcfd);}),_0xaa751b[_0x159366(0x1d5)](_0x159366(0x1a0),_0x113378=>{const _0x347084=_0x159366;clearTimeout(_0x321d39);const _0x27bcc3=Buffer[_0x347084(0x255)](_0x478e3c);_0x56d30a({'code':_0x113378??0x1*0x263c+-0x4be+-0x1*0x217d,'output':_0x27bcc3,'text':_0x27bcc3[_0x347084(0x275)](_0x347084(0x16e)),'stderr':Buffer[_0x347084(0x255)](_0x1df6ef)[_0x347084(0x275)](_0x347084(0x16e)),'truncated':_0x403ee0});});});}function canRetryGitWorktreeListWithoutNullOutput(_0x35faa2){const _0x3bbc8a=_0x58ce9e;return _0x35faa2[_0x3bbc8a(0x286)]===0x1d16+0x2115+-0x3daa||/(?:unknown|unrecognized|invalid)\s+(?:option|switch).*['"`]?-?z\b/iu[_0x3bbc8a(0x272)](_0x35faa2[_0x3bbc8a(0x22c)]);}function isGitUnavailable(_0x139980){const _0x275452=_0x58ce9e;return _0x139980 instanceof Error&&_0x275452(0x286)in _0x139980&&_0x139980[_0x275452(0x286)]===_0x275452(0x177);}function summarizeText(_0x5d1ea7){const _0x1daa39=_0x58ce9e;return JSON[_0x1daa39(0x1e7)]({'sha256':createHash(_0x1daa39(0x231))[_0x1daa39(0x17b)](_0x5d1ea7)[_0x1daa39(0x22e)](_0x1daa39(0x1bc)),'bytes':Buffer[_0x1daa39(0x178)](_0x5d1ea7)});}
2
+ const _0x5af3e3=_0xd6ca;(function(_0x11fe99,_0x34ca8a){const _0x4b3518=_0xd6ca,_0x5a1d10=_0x11fe99();while(!![]){try{const _0x38eb22=parseInt(_0x4b3518(0x213))/(0x2*0x12f8+0x5*0x73d+0x2510*-0x2)+parseInt(_0x4b3518(0x19a))/(0x1a95*-0x1+0x1858+-0x23f*-0x1)*(-parseInt(_0x4b3518(0x20c))/(0x111b+0xa*-0x2bf+0x52f*0x2))+-parseInt(_0x4b3518(0x27a))/(0x1*-0x6c9+0x12b5+-0xbe8)+parseInt(_0x4b3518(0x1f9))/(0x371*-0x1+0x2*-0x259+0x828)+-parseInt(_0x4b3518(0x24b))/(-0x13*0x97+-0x26a8+0x31e3)+-parseInt(_0x4b3518(0x260))/(0x29*-0x41+-0x21d8+0x2c48)*(parseInt(_0x4b3518(0x21a))/(-0x1b6c+0xb51*0x1+0x1023))+parseInt(_0x4b3518(0x2a2))/(0x16d5+-0x1879+0x3*0x8f);if(_0x38eb22===_0x34ca8a)break;else _0x5a1d10['push'](_0x5a1d10['shift']());}catch(_0x2d17ee){_0x5a1d10['push'](_0x5a1d10['shift']());}}}(_0x585a,0x275ec+-0xdd5f*-0x15+-0x6ac6b));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 _0x315274}from'node:os';import{basename,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=-0x89f*-0x2+-0x21e*0x5+-0xce0*-0x1,GIT_STATUS_TIMEOUT_MS=0x8452+-0xe68e+-0x4*-0x35db,GIT_HISTORY_TIMEOUT_MS=0x4cb*0x6+-0x145f*0x5+0x1*0x83b1,GIT_OUTPUT_LIMIT=(0x1bdf+-0x1c*0x53+-0x10cb)*(-0x20d+0x580+0x1*0x8d),GIT_LARGE_OUTPUT_LIMIT=(-0x845*0x3+-0x24aa*-0x1+-0xbd3)*(-0x1057+0x53f+-0x18*-0xa1)*(-0x264f+0x209+0x2*0x1423),FILE_READ_LIMIT=(0x1fda+-0x14*-0x9d+-0x2a1e)*(-0x2*-0xc7+0x65*-0x37+0x1825),DIRECTORY_PAGE_LIMIT=0xfb8+-0x5f*0xf+-0x95f*0x1,DIRECTORY_PICKER_LIMIT=-0x2f*-0xa9+-0x25cd+0x78e,SEARCH_RESULT_LIMIT=-0x67+-0x12*-0x49+0x3f3*-0x1,GIT_WORKTREE_LIST_LIMIT=0xdcb+0x21c2+-0x2f0d,FILE_INDEX_IDLE_TTL_MS=(0x1*0x9b5+0x23f5+-0x2d6e*0x1)*(-0x202d+-0x2d4*-0x8+0x9c9*0x1)*(-0x1*0x79d+-0x1d50*0x1+0x28d5),FILE_INDEX_FRESHNESS_TTL_MS=-0xd531+-0x23*0x25+0x14f70,FILE_INDEX_ENTRY_LIMIT=0x53*0x2f+-0x3*-0x98ec+0x58f*-0xf,FILE_INDEX_METADATA_CONCURRENCY=-0x945*0x3+-0x1*-0x104b+0xba4,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x5af3e3(0x1b6),_0x5af3e3(0x25f),_0x5af3e3(0x23e),_0x5af3e3(0x28f),_0x5af3e3(0x2b7),_0x5af3e3(0x27b),_0x5af3e3(0x194),_0x5af3e3(0x229),_0x5af3e3(0x25a),_0x5af3e3(0x277),_0x5af3e3(0x22a),_0x5af3e3(0x1db),_0x5af3e3(0x25c),_0x5af3e3(0x287),_0x5af3e3(0x19d),_0x5af3e3(0x224),_0x5af3e3(0x21d),_0x5af3e3(0x238),_0x5af3e3(0x1ae),_0x5af3e3(0x203),_0x5af3e3(0x1aa),_0x5af3e3(0x19f),_0x5af3e3(0x243),_0x5af3e3(0x2ac),_0x5af3e3(0x1c0)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x2422fd,_0x530c13,_0x82e710){const _0x4819d1=_0x5af3e3,_0x3ec3a5=_0x530c13[_0x4819d1(0x28d)]();if(_0x3ec3a5[_0x4819d1(0x1c9)]===0x1c4d+0x1*0x7e+-0x5b*0x51||_0x3ec3a5[_0x4819d1(0x1c9)]>-0x26ea+-0x17*-0xa9+0x18ba||_0x3ec3a5==='.'||_0x3ec3a5==='..'||_0x3ec3a5[_0x4819d1(0x201)]('/')||_0x3ec3a5[_0x4819d1(0x201)]('\x5c')||_0x3ec3a5[_0x4819d1(0x201)]('\x00'))throw new Error(_0x4819d1(0x283));const _0x57e833=await Promise[_0x4819d1(0x2b2)](_0x82e710[_0x4819d1(0x1cc)](_0x187cca=>realpath(_0x187cca))),_0x181099=await realpath(_0x2422fd)[_0x4819d1(0x263)](()=>{const _0x109e80=_0x4819d1;throw new Error(_0x109e80(0x299));}),_0x126702=await stat(_0x181099)[_0x4819d1(0x263)](()=>undefined);if(_0x126702?.[_0x4819d1(0x29d)]()!==!![]||!isWithinAllowedRoot(_0x181099,_0x57e833))throw new Error(_0x4819d1(0x299));const _0x1fe366=resolve(_0x181099,_0x3ec3a5);if(dirname(_0x1fe366)!==_0x181099||!isWithinAllowedRoot(_0x1fe366,_0x57e833))throw new Error(_0x4819d1(0x283));try{await mkdir(_0x1fe366);}catch(_0x19a99e){if(_0x19a99e[_0x4819d1(0x1e1)]===_0x4819d1(0x1ac))throw new Error(_0x4819d1(0x233));throw _0x19a99e;}return _0x1fe366;}export class WorkspaceFileIndex{[_0x5af3e3(0x252)];[_0x5af3e3(0x199)];[_0x5af3e3(0x1d2)]=[];[_0x5af3e3(0x1c2)]=![];[_0x5af3e3(0x26b)];[_0x5af3e3(0x1c3)];[_0x5af3e3(0x1bd)]=!![];[_0x5af3e3(0x19e)];[_0x5af3e3(0x2af)]=0x1a*0x169+-0x13*-0x1b1+0x13*-0x39f;[_0x5af3e3(0x1be)]=0xcbb+-0xa29+-0x292;constructor(_0x53adf7,_0x45b137={}){const _0x3dc349=_0x5af3e3;this[_0x3dc349(0x252)]=_0x53adf7,this[_0x3dc349(0x199)]=_0x45b137;}async[_0x5af3e3(0x293)](){const _0x14442f=_0x5af3e3;return await this[_0x14442f(0x1d1)](),this[_0x14442f(0x27f)](),{'entries':this[_0x14442f(0x1d2)][_0x14442f(0x2a4)](_0x49bf30=>_0x49bf30[_0x14442f(0x1b1)]===_0x14442f(0x285)),'truncated':this[_0x14442f(0x1c2)]};}[_0x5af3e3(0x242)](){const _0x42ce99=_0x5af3e3;if(this[_0x42ce99(0x19e)]!==undefined)clearTimeout(this[_0x42ce99(0x19e)]);this[_0x42ce99(0x19e)]=undefined,this[_0x42ce99(0x1d2)]=[],this[_0x42ce99(0x1c2)]=![],this[_0x42ce99(0x1bd)]=!![],this[_0x42ce99(0x2af)]=0x1c47+0x1*-0x33+0x1*-0x1c14,this[_0x42ce99(0x1be)]=0x8*0x4cf+-0x5*0x1a1+0x1*-0x1e53;}async[_0x5af3e3(0x291)](_0x51f73e,_0x4300a9,_0x6fc7b=SEARCH_RESULT_LIMIT,_0x42a345=![]){const _0xa71be=_0x5af3e3;if(_0x51f73e[_0xa71be(0x28d)]()[_0xa71be(0x1c9)]===-0x4*-0x6d7+-0x1d8e+0x232||_0x51f73e[_0xa71be(0x1c9)]>-0x4bd*-0x5+-0x192d+0x27c||!Number[_0xa71be(0x20b)](_0x6fc7b)||_0x6fc7b<-0x1b*-0xf7+0x15b4+-0x5f8*0x8||_0x6fc7b>SEARCH_RESULT_LIMIT)throw new Error(_0xa71be(0x2ab));await this[_0xa71be(0x1d1)](),this[_0xa71be(0x27f)]();const _0x4ab745=decodeSearchCursor(_0x4300a9,_0x51f73e),_0x117b38=_0x4ab745===undefined?undefined:this[_0xa71be(0x1d2)][_0xa71be(0x1d4)](_0x46c1f2=>_0x46c1f2[_0xa71be(0x266)]===_0x4ab745&&(_0x42a345||_0x46c1f2[_0xa71be(0x1b1)]===_0xa71be(0x285))),_0x238cec=_0x117b38===undefined?-(0x18+-0x12e6+0xf*0x141):fuzzyPathScore(_0x117b38[_0xa71be(0x266)],_0x51f73e),_0x10981=_0x117b38===undefined||_0x238cec<0x1a0c+-0x484+0x2b1*-0x8?undefined:{'entry':_0x117b38,'score':_0x238cec},_0x50f27a=new RankedCandidateHeap(_0x6fc7b+(-0x5e8+0x18db+-0x12f2));for(const _0x6da541 of this[_0xa71be(0x1d2)]){if(!_0x42a345&&_0x6da541[_0xa71be(0x1b1)]!==_0xa71be(0x285))continue;const _0x512d5c=fuzzyPathScore(_0x6da541[_0xa71be(0x266)],_0x51f73e);if(_0x512d5c<0x531+-0x1*0x15b9+-0x844*-0x2)continue;const _0x577942={'entry':_0x6da541,'score':_0x512d5c};if(_0x10981!==undefined&&compareRankedCandidate(_0x577942,_0x10981)<=-0x6b*0xb+0xd3f+-0x8a6)continue;_0x50f27a[_0xa71be(0x1a8)](_0x577942);}const _0x5c1b54=_0x50f27a[_0xa71be(0x2b9)](),_0x6e79ae=_0x5c1b54[_0xa71be(0x288)](-0xcf9+-0x617+0x3d0*0x5,_0x6fc7b)[_0xa71be(0x1cc)](_0x46c5c4=>_0x46c5c4[_0xa71be(0x1d7)]),_0x627c8f=_0x5c1b54[_0x6fc7b]?.[_0xa71be(0x1d7)][_0xa71be(0x266)];return{'entries':_0x6e79ae,'nextCursor':_0x627c8f===undefined?null:encodeSearchCursor(_0x51f73e,_0x6e79ae['at'](-(0x8*-0xca+0xe*0x136+0xaa3*-0x1))?.[_0xa71be(0x266)]??_0x4ab745??''),'truncated':_0x627c8f!==undefined||this[_0xa71be(0x1c2)]};}async[_0x5af3e3(0x1d1)](){const _0x3f2b9a=_0x5af3e3;if(!this[_0x3f2b9a(0x1bd)]&&this[_0x3f2b9a(0x26b)]!==undefined){if(Date[_0x3f2b9a(0x1d0)]()-this[_0x3f2b9a(0x1be)]>=(this[_0x3f2b9a(0x199)][_0x3f2b9a(0x268)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x3f2b9a(0x1d3)]();return;}this[_0x3f2b9a(0x1c3)]===undefined&&(this[_0x3f2b9a(0x1c3)]=this[_0x3f2b9a(0x1c7)]()[_0x3f2b9a(0x19b)](()=>{const _0x24c1c8=_0x3f2b9a;this[_0x24c1c8(0x1c3)]=undefined;})),await this[_0x3f2b9a(0x1c3)];}[_0x5af3e3(0x27f)](){const _0x54b949=_0x5af3e3;if(this[_0x54b949(0x19e)]!==undefined)clearTimeout(this[_0x54b949(0x19e)]);this[_0x54b949(0x19e)]=setTimeout(()=>this[_0x54b949(0x242)](),this[_0x54b949(0x199)][_0x54b949(0x187)]??FILE_INDEX_IDLE_TTL_MS),this[_0x54b949(0x19e)][_0x54b949(0x221)]();}async[_0x5af3e3(0x1c7)](){const _0x5c20e8=_0x5af3e3,_0x26e1ac=await resolveRegisteredWorkspaceRoot(this[_0x5c20e8(0x252)]),_0x4a8874=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x26e1ac)],_0xbe329e=[],_0x2e0949=this[_0x5c20e8(0x199)][_0x5c20e8(0x271)]??FILE_INDEX_ENTRY_LIMIT;let _0x42cb84=![];const _0x20ba4d=['.'];let _0x362023=0x7*0x155+0xf4e*0x2+-0x27ef;while(_0x362023<_0x20ba4d[_0x5c20e8(0x1c9)]&&!_0x42cb84){const _0x589a8e=_0x20ba4d[_0x362023];_0x362023+=-0x266d+-0x202f+0x469d;const _0x3295a6=await resolveWorkspaceEntryFromCanonicalRoot(_0x26e1ac,_0x589a8e,!![])[_0x5c20e8(0x263)](()=>undefined);if(_0x3295a6===undefined)continue;const _0x1d495a=await opendir(_0x3295a6)[_0x5c20e8(0x263)](()=>undefined);if(_0x1d495a===undefined)continue;let _0x371299=[];const _0x5e1951=async()=>{const _0x304edb=_0x5c20e8,_0x1ff681=await Promise[_0x304edb(0x2b2)](_0x371299);_0x371299=[];for(const _0x5d5a68 of _0x1ff681){if(_0x5d5a68===undefined)continue;if(_0x5d5a68[_0x304edb(0x266)]===_0x304edb(0x255)||_0x5d5a68[_0x304edb(0x266)][_0x304edb(0x1bf)](_0x304edb(0x1de))||isExcluded(_0x5d5a68[_0x304edb(0x266)],_0x4a8874))continue;if(_0x5d5a68[_0x304edb(0x1b1)]===_0x304edb(0x26a))_0x20ba4d[_0x304edb(0x1bb)](_0x5d5a68[_0x304edb(0x266)]);_0xbe329e[_0x304edb(0x1bb)](_0x5d5a68);if(_0xbe329e[_0x304edb(0x1c9)]>=_0x2e0949){_0x42cb84=!![];break;}}};for await(const _0x1158b9 of _0x1d495a){const _0x31190a=_0x589a8e==='.'?_0x1158b9[_0x5c20e8(0x28e)]:posix[_0x5c20e8(0x1a1)](_0x589a8e[_0x5c20e8(0x231)]('\x5c','/'),_0x1158b9[_0x5c20e8(0x28e)]);if(_0x31190a===_0x5c20e8(0x255)||_0x31190a[_0x5c20e8(0x1bf)](_0x5c20e8(0x1de))||isExcluded(_0x31190a,_0x4a8874))continue;_0x371299[_0x5c20e8(0x1bb)](inspectWorkspaceIndexEntry(_0x26e1ac,_0x31190a,_0x1158b9[_0x5c20e8(0x28e)]));if(_0x371299[_0x5c20e8(0x1c9)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x5e1951();if(_0x42cb84)break;}if(!_0x42cb84&&_0x371299[_0x5c20e8(0x1c9)]>0x96e+-0x11b7*-0x1+-0x1b25)await _0x5e1951();}this[_0x5c20e8(0x26b)]=_0x26e1ac,this[_0x5c20e8(0x1d2)]=_0xbe329e,this[_0x5c20e8(0x1c2)]=_0x42cb84,this[_0x5c20e8(0x1bd)]=![],this[_0x5c20e8(0x2af)]=Date[_0x5c20e8(0x1d0)](),this[_0x5c20e8(0x1be)]=this[_0x5c20e8(0x2af)];}[_0x5af3e3(0x1d3)](){const _0x4f6128=_0x5af3e3;if(this[_0x4f6128(0x1c3)]!==undefined)return;this[_0x4f6128(0x1be)]=Date[_0x4f6128(0x1d0)](),this[_0x4f6128(0x1c3)]=this[_0x4f6128(0x1c7)]()[_0x4f6128(0x263)](()=>undefined)[_0x4f6128(0x19b)](()=>{const _0x35c0a8=_0x4f6128;this[_0x35c0a8(0x1c3)]=undefined;});}}async function workspaceExcludePatterns(_0x10ac28){const _0x56580f=_0x5af3e3,_0xf9a0b6=resolve(_0x10ac28,_0x56580f(0x2b4)),_0x5b87f1=await readFile(_0xf9a0b6,_0x56580f(0x250))[_0x56580f(0x1f2)](JSON[_0x56580f(0x182)])[_0x56580f(0x263)](()=>undefined);if(typeof _0x5b87f1!==_0x56580f(0x196)||_0x5b87f1===null)return[];return[_0x56580f(0x1e9),_0x56580f(0x1cb)][_0x56580f(0x25b)](_0x4f9f50=>{const _0x434c04=_0x56580f,_0xd8ad9f=_0x5b87f1[_0x4f9f50];return typeof _0xd8ad9f===_0x434c04(0x196)&&_0xd8ad9f!==null?Object[_0x434c04(0x1d2)](_0xd8ad9f)[_0x434c04(0x25b)](([_0x3982d2,_0x464de7])=>_0x464de7===!![]?[_0x3982d2]:[]):[];});}function isExcluded(_0x337f2a,_0x24c90b){const _0x31d007=_0x5af3e3;return _0x24c90b[_0x31d007(0x1f1)](_0x4b7c29=>minimatch(_0x337f2a,_0x4b7c29,{'dot':!![],'nocase':_0x315274()!==_0x31d007(0x2b5)})||minimatch(_0x337f2a+'/',_0x4b7c29,{'dot':!![],'nocase':_0x315274()!==_0x31d007(0x2b5)}));}function compareRankedCandidate(_0x347073,_0x269a2d){const _0x34cc17=_0x5af3e3;return _0x269a2d[_0x34cc17(0x251)]-_0x347073[_0x34cc17(0x251)]||_0x347073[_0x34cc17(0x1d7)][_0x34cc17(0x266)][_0x34cc17(0x24d)](_0x269a2d[_0x34cc17(0x1d7)][_0x34cc17(0x266)]);}class RankedCandidateHeap{[_0x5af3e3(0x192)];[_0x5af3e3(0x1af)]=[];constructor(_0x2fcc7d){const _0x42e772=_0x5af3e3;this[_0x42e772(0x192)]=_0x2fcc7d;}[_0x5af3e3(0x1a8)](_0x1a562c){const _0xed1b26=_0x5af3e3;if(this[_0xed1b26(0x1af)][_0xed1b26(0x1c9)]<this[_0xed1b26(0x192)]){this[_0xed1b26(0x1af)][_0xed1b26(0x1bb)](_0x1a562c),this[_0xed1b26(0x296)](this[_0xed1b26(0x1af)][_0xed1b26(0x1c9)]-(0xae8+-0x19d3*0x1+-0x4*-0x3bb));return;}if(compareRankedCandidate(_0x1a562c,this[_0xed1b26(0x1af)][-0x1b5f+-0x939*-0x1+-0x1226*-0x1])>=-0x8e9*0x2+0x2299*0x1+-0x10c7)return;this[_0xed1b26(0x1af)][-0x2156+-0x27*0x1d+0x25c1]=_0x1a562c,this[_0xed1b26(0x1b7)](0x4dc*0x1+0xe66+0x1342*-0x1);}[_0x5af3e3(0x2b9)](){const _0x225955=_0x5af3e3;return[...this[_0x225955(0x1af)]][_0x225955(0x272)](compareRankedCandidate);}[_0x5af3e3(0x296)](_0x17eb98){const _0x597969=_0x5af3e3;let _0x3c1baa=_0x17eb98;while(_0x3c1baa>-0x816*-0x2+0x10f+-0x113b){const _0x2426ee=Math[_0x597969(0x222)]((_0x3c1baa-(0x1eb6+0x1d98+-0x3c4d))/(0x23*0xfb+0x79*0x31+-0x6*0x994));if(compareRankedCandidate(this[_0x597969(0x1af)][_0x3c1baa],this[_0x597969(0x1af)][_0x2426ee])<=0xee9+0x13ed+0xd*-0x2ae)break;[this[_0x597969(0x1af)][_0x3c1baa],this[_0x597969(0x1af)][_0x2426ee]]=[this[_0x597969(0x1af)][_0x2426ee],this[_0x597969(0x1af)][_0x3c1baa]],_0x3c1baa=_0x2426ee;}}[_0x5af3e3(0x1b7)](_0xb85fbc){const _0xf99ce9=_0x5af3e3;let _0x17a274=_0xb85fbc;while(!![]){const _0x31ec46=_0x17a274*(-0x1ac5+0x1*-0x889+0x2350)+(0x1ddb+-0x1*0x732+-0x16a8);if(_0x31ec46>=this[_0xf99ce9(0x1af)][_0xf99ce9(0x1c9)])return;const _0x3bd68b=_0x31ec46+(-0xcd+-0x1*0x55b+0x629),_0x336b01=_0x3bd68b<this[_0xf99ce9(0x1af)][_0xf99ce9(0x1c9)]&&compareRankedCandidate(this[_0xf99ce9(0x1af)][_0x3bd68b],this[_0xf99ce9(0x1af)][_0x31ec46])>-0x2*0x1046+0x25e8+-0x55c?_0x3bd68b:_0x31ec46;if(compareRankedCandidate(this[_0xf99ce9(0x1af)][_0x336b01],this[_0xf99ce9(0x1af)][_0x17a274])<=0x26e6+0x1cfd+0x43e3*-0x1)return;[this[_0xf99ce9(0x1af)][_0x17a274],this[_0xf99ce9(0x1af)][_0x336b01]]=[this[_0xf99ce9(0x1af)][_0x336b01],this[_0xf99ce9(0x1af)][_0x17a274]],_0x17a274=_0x336b01;}}}function fuzzyPathScore(_0x34aec6,_0x417b6a){const _0x5e5b1d=_0x5af3e3,_0x37fddb=_0x34aec6[_0x5e5b1d(0x2a3)](),_0x1f145e=_0x417b6a[_0x5e5b1d(0x28d)]()[_0x5e5b1d(0x2a3)]();let _0x1d1620=0x982*-0x1+0x98*-0x23+-0x1*-0x1e4a,_0x38a47f=-0x78b+-0xebf+0x76e*0x3,_0x3d02c7=-(-0x1*-0xd69+-0x1b*0x17+0x1*-0xafa);for(const _0x27a57f of _0x1f145e){const _0x3a42b9=_0x37fddb[_0x5e5b1d(0x215)](_0x27a57f,_0x1d1620);if(_0x3a42b9===-(0xb27*0x2+-0x1d2+-0x147b))return-(0xc33+-0x25a8+0x1976);_0x38a47f+=_0x3a42b9===_0x3d02c7+(0xfe7+-0x661*0x6+-0x2cc*-0x8)?-0xb1*-0x37+-0x4d*-0x45+-0x54*0xb3:-0xc1*0x1+0x19b2+0x26*-0xa8;if(_0x3a42b9===-0x1248+-0x1*0xaf6+-0x18a*-0x13||_0x5e5b1d(0x228)[_0x5e5b1d(0x201)](_0x37fddb[_0x3a42b9-(0xf8b*0x2+-0x19f*0xd+-0x15*0x7a)]??''))_0x38a47f+=0x14b6+-0x68*-0x52+0x1aff*-0x2;_0x3d02c7=_0x3a42b9,_0x1d1620=_0x3a42b9+(0xee+-0x6ce+0x5*0x12d);}const _0x2a1dc4=_0x34aec6[_0x5e5b1d(0x288)](_0x34aec6[_0x5e5b1d(0x1c5)]('/')+(-0x1*-0xdcd+-0x6b*0x5b+0x1*0x183d))[_0x5e5b1d(0x2a3)]();if(_0x2a1dc4[_0x5e5b1d(0x201)](_0x1f145e))_0x38a47f+=-0x2*0x83e+0x744*-0x2+0x1f2c;else{if(_0x37fddb[_0x5e5b1d(0x201)](_0x1f145e))_0x38a47f+=-0x3e*0x89+0x187*0x2+-0x30*-0xa1;}return _0x38a47f-_0x34aec6[_0x5e5b1d(0x1c9)]/(0x15*-0x169+-0x1*0x1b09+0x3c8e);}export async function listWorkspaceDirectories(_0x428c14,_0x114008,_0xb2c869=homedir()){const _0x136e61=_0x5af3e3,_0x13cda6=await realpath(_0xb2c869),_0x2e9f22=await Promise[_0x136e61(0x2b2)](_0x114008[_0x136e61(0x1cc)](_0x5011a2=>realpath(_0x5011a2))),_0x55e557=[...new Set([_0x13cda6,..._0x2e9f22])],_0x273838=_0x428c14===undefined?_0x2e9f22[-0x7*0x13d+0x11a3+-0x8f8]??_0x13cda6:await realpath(_0x428c14),_0x267944=await stat(_0x273838);if(!_0x267944[_0x136e61(0x29d)]()||!isWithinAllowedRoot(_0x273838,_0x55e557))throw new Error(_0x136e61(0x299));const _0xf9b4d1=await readdir(_0x273838,{'withFileTypes':!![]}),_0x13c1c4=[];for(const _0x1d1668 of _0xf9b4d1[_0x136e61(0x272)]((_0x472058,_0x1944be)=>_0x472058[_0x136e61(0x28e)][_0x136e61(0x24d)](_0x1944be[_0x136e61(0x28e)]))){if(!_0x1d1668[_0x136e61(0x29d)]()&&!_0x1d1668[_0x136e61(0x1b2)]())continue;const _0x14079b=await realpath(resolve(_0x273838,_0x1d1668[_0x136e61(0x28e)]))[_0x136e61(0x263)](()=>undefined);if(_0x14079b===undefined||!isWithinAllowedRoot(_0x14079b,_0x55e557))continue;const _0x34c031=await stat(_0x14079b)[_0x136e61(0x263)](()=>undefined);if(_0x34c031===undefined||!_0x34c031[_0x136e61(0x29d)]())continue;_0x13c1c4[_0x136e61(0x1bb)]({'path':_0x14079b,'name':_0x1d1668[_0x136e61(0x28e)],'selectable':isWithinAllowedRoot(_0x14079b,_0x2e9f22)});if(_0x13c1c4[_0x136e61(0x1c9)]>DIRECTORY_PICKER_LIMIT)break;}const _0x4b74f0=dirname(_0x273838);return{'homePath':_0x13cda6,'currentPath':_0x273838,'parentPath':_0x4b74f0===_0x273838||!isWithinAllowedRoot(_0x4b74f0,_0x55e557)?null:_0x4b74f0,'browseRoots':_0x2e9f22,'selectable':isWithinAllowedRoot(_0x273838,_0x2e9f22),'entries':_0x13c1c4[_0x136e61(0x288)](-0x510+-0x2413+0x2923*0x1,DIRECTORY_PICKER_LIMIT),'truncated':_0x13c1c4[_0x136e61(0x1c9)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x163c08,_0x4a5cf1='.',_0x3ac3d7,_0x3d3d7d=DIRECTORY_PAGE_LIMIT){const _0xaed95c=_0x5af3e3;if(!Number[_0xaed95c(0x20b)](_0x3d3d7d)||_0x3d3d7d<-0x8*0x3fa+0x20*0x10f+-0x20f||_0x3d3d7d>DIRECTORY_PAGE_LIMIT)throw new Error(_0xaed95c(0x1c1));const _0x275fd6=await resolveRegisteredWorkspaceRoot(_0x163c08),_0x3b2bb4=await resolveWorkspaceEntryFromCanonicalRoot(_0x275fd6,_0x4a5cf1,!![]),_0x3d3b7d=await readdir(_0x3b2bb4,{'withFileTypes':!![]}),_0x1f0b45=decodeDirectoryCursor(_0x3ac3d7,_0x4a5cf1),_0x394548=_0x3d3b7d[_0xaed95c(0x2a4)](_0x3af06d=>_0x3af06d[_0xaed95c(0x28e)]!==_0xaed95c(0x255)&&!isWorkspaceUploadTemporaryName(_0x3af06d[_0xaed95c(0x28e)]))[_0xaed95c(0x1cc)](_0x445eb8=>_0x445eb8[_0xaed95c(0x28e)])[_0xaed95c(0x272)]((_0x4e28a7,_0x11a676)=>_0x4e28a7[_0xaed95c(0x24d)](_0x11a676)),_0x305d1d=_0x1f0b45===undefined?-0x1ad7*-0x1+0xf8c+0xe21*-0x3:_0x394548[_0xaed95c(0x22d)](_0x4358ed=>_0x4358ed>_0x1f0b45);if(_0x1f0b45!==undefined&&_0x305d1d===-(0x63*0x29+0x3f2+-0x13cc))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x2a61bd=_0x394548[_0xaed95c(0x288)](_0x305d1d,_0x305d1d+_0x3d3d7d),_0x4bb36b=[];for(const _0x17497e of _0x2a61bd){const _0x94465a=await resolveWorkspaceEntry(_0x275fd6,relative(_0x275fd6,resolve(_0x3b2bb4,_0x17497e)),![])[_0xaed95c(0x263)](_0x3163de=>{if(isSkippableWorkspaceEntryError(_0x3163de))return undefined;throw _0x3163de;});if(_0x94465a===undefined)continue;const _0x5abaac=await lstat(_0x94465a)[_0xaed95c(0x263)](_0x1017f7=>{const _0x52cfbb=_0xaed95c;if(_0x1017f7[_0x52cfbb(0x1e1)]===_0x52cfbb(0x281))return undefined;throw _0x1017f7;});if(_0x5abaac===undefined||!_0x5abaac[_0xaed95c(0x1d9)]()&&!_0x5abaac[_0xaed95c(0x29d)]())continue;_0x4bb36b[_0xaed95c(0x1bb)]({'path':relative(_0x275fd6,_0x94465a)[_0xaed95c(0x23b)](sep)[_0xaed95c(0x1a1)]('/'),'name':_0x17497e,'kind':_0x5abaac[_0xaed95c(0x29d)]()?_0xaed95c(0x26a):_0xaed95c(0x285),'size':_0x5abaac[_0xaed95c(0x1d9)]()?_0x5abaac[_0xaed95c(0x2ae)]:null,'modifiedAt':_0x5abaac[_0xaed95c(0x1cd)]});}const _0x5631a2=_0x394548[_0x305d1d+_0x2a61bd[_0xaed95c(0x1c9)]];return{'entries':_0x4bb36b,'nextCursor':_0x5631a2===undefined||_0x2a61bd[_0xaed95c(0x1c9)]===-0x1*-0x23ad+-0x9*0xf6+0x11*-0x197?null:encodeDirectoryCursor(_0x4a5cf1,_0x2a61bd[_0x2a61bd[_0xaed95c(0x1c9)]-(0x1785+-0x2301+0xb7d)]),'truncated':_0x5631a2!==undefined};}export async function mutateWorkspaceFile(_0x3c650f,_0x2c3e78){const _0x420cdc=_0x5af3e3,_0x19e211=await resolveRegisteredWorkspaceRoot(_0x3c650f);if(_0x2c3e78[_0x420cdc(0x1ba)]===_0x420cdc(0x1fb)||_0x2c3e78[_0x420cdc(0x1ba)]===_0x420cdc(0x1e4)){const _0x198045=await resolveNewWorkspaceEntry(_0x19e211,_0x2c3e78[_0x420cdc(0x266)]);if(_0x2c3e78[_0x420cdc(0x1ba)]===_0x420cdc(0x1fb))await writeFile(_0x198045,'',{'flag':'wx'});else await mkdir(_0x198045);return{'path':workspaceRelativePath(_0x19e211,_0x198045)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x19e211,_0x2c3e78[_0x420cdc(0x266)]);const _0x4304ce=await resolveWorkspaceEntryMetadata(_0x19e211,_0x2c3e78[_0x420cdc(0x266)]);if(workspaceRelativePath(_0x19e211,_0x4304ce[_0x420cdc(0x266)])==='.')throw new Error(_0x420cdc(0x27e));if(_0x2c3e78[_0x420cdc(0x1ba)]===_0x420cdc(0x28c))return await rm(_0x4304ce[_0x420cdc(0x266)],{'recursive':_0x4304ce[_0x420cdc(0x1f0)][_0x420cdc(0x29d)](),'force':![]}),{'deleted':!![]};const _0x526b2b=await resolveNewWorkspaceEntry(_0x19e211,_0x2c3e78[_0x420cdc(0x1e7)]);if(_0x4304ce[_0x420cdc(0x1f0)][_0x420cdc(0x29d)]()){const _0x1ebfea=relative(_0x4304ce[_0x420cdc(0x266)],_0x526b2b);if(_0x1ebfea===''||!isAbsolute(_0x1ebfea)&&_0x1ebfea!=='..'&&!_0x1ebfea[_0x420cdc(0x1bf)]('..'+sep))throw new Error(_0x420cdc(0x183));}return await rename(_0x4304ce[_0x420cdc(0x266)],_0x526b2b),{'path':workspaceRelativePath(_0x19e211,_0x526b2b)};}async function resolveNewWorkspaceEntry(_0x235e76,_0x1b5752){const _0x4ef1f8=_0x5af3e3,_0x426665=_0x1b5752[_0x4ef1f8(0x231)]('\x5c','/'),_0xbc9c7a=_0x426665[_0x4ef1f8(0x23b)]('/'),_0x545a47=_0xbc9c7a['at'](-(0x5*0x54c+0x1744+-0x587*0x9));if(_0x1b5752[_0x4ef1f8(0x201)]('\x00')||_0x426665[_0x4ef1f8(0x1bf)]('/')||isAbsolute(_0x1b5752)||win32[_0x4ef1f8(0x29f)](_0x426665)||_0x545a47===undefined||_0x545a47[_0x4ef1f8(0x1c9)]===0x2*-0x305+-0x1f58+0x2562||_0xbc9c7a[_0x4ef1f8(0x1f1)](invalidWorkspaceMutationSegment))throw new Error(_0x4ef1f8(0x1ad));const _0x1fcd0c=_0xbc9c7a[_0x4ef1f8(0x1c9)]===0x24f5+0xb1b+-0x300f?'.':_0xbc9c7a[_0x4ef1f8(0x288)](0x677*-0x1+0xe4+0x593*0x1,-(-0x1419+0x2cd+0x114d))[_0x4ef1f8(0x1a1)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x235e76,_0x1fcd0c);const _0x2e4ca7=await resolveWorkspaceEntryFromCanonicalRoot(_0x235e76,_0x1fcd0c,!![]),_0x3b9790=resolve(_0x2e4ca7,_0x545a47);try{await lstat(_0x3b9790);throw new Error(_0x4ef1f8(0x202));}catch(_0x2f7ce6){if(_0x2f7ce6[_0x4ef1f8(0x1e1)]!==_0x4ef1f8(0x281))throw _0x2f7ce6;}return _0x3b9790;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x51a321,_0x5ac14d){const _0x26323d=_0x5af3e3,_0x1ce2d0=_0x5ac14d[_0x26323d(0x231)]('\x5c','/');if(_0x1ce2d0==='.')return;const _0x218f4e=_0x1ce2d0[_0x26323d(0x23b)]('/');if(_0x5ac14d[_0x26323d(0x201)]('\x00')||_0x1ce2d0[_0x26323d(0x1bf)]('/')||isAbsolute(_0x5ac14d)||win32[_0x26323d(0x29f)](_0x1ce2d0)||_0x218f4e[_0x26323d(0x1f1)](invalidWorkspaceMutationSegment))throw new Error(_0x26323d(0x1ad));let _0x5b78f4=_0x51a321;for(const _0x2ddc2c of _0x218f4e){_0x5b78f4=resolve(_0x5b78f4,_0x2ddc2c);const _0x23fbfe=await lstat(_0x5b78f4)[_0x26323d(0x263)](_0x5a0e2e=>{const _0x2367f1=_0x26323d;if(_0x5a0e2e[_0x2367f1(0x1e1)]===_0x2367f1(0x281))throw new Error(_0x2367f1(0x1c4));throw _0x5a0e2e;});if(_0x23fbfe[_0x26323d(0x1b2)]())throw new Error(_0x26323d(0x1ad));}}function invalidWorkspaceMutationSegment(_0x3e25bd){const _0x352fb5=_0x5af3e3;if(_0x3e25bd[_0x352fb5(0x1c9)]===-0x1e8+-0x2*-0x442+-0x69c||_0x3e25bd==='.'||_0x3e25bd==='..'||_0x3e25bd===_0x352fb5(0x255))return!![];if(_0x315274()!==_0x352fb5(0x227))return![];const _0x78a4e2=_0x3e25bd[_0x352fb5(0x18c)](/[. ]+$/u,'')[_0x352fb5(0x20a)]();return/[<>:"|?*]/u[_0x352fb5(0x1e6)](_0x3e25bd)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x352fb5(0x1e6)](_0x78a4e2);}function workspaceRelativePath(_0x1e1ce7,_0x355f61){const _0x25d30e=_0x5af3e3,_0x100953=relative(_0x1e1ce7,_0x355f61)[_0x25d30e(0x23b)](sep)[_0x25d30e(0x1a1)]('/');return _0x100953[_0x25d30e(0x1c9)]===0x3*-0xa5d+0x1063+0xeb4?'.':_0x100953;}function isSkippableWorkspaceEntryError(_0x2b6cd9){const _0x50e4c0=_0x5af3e3;return _0x2b6cd9 instanceof Error&&(_0x2b6cd9[_0x50e4c0(0x214)]===_0x50e4c0(0x1ad)||_0x2b6cd9[_0x50e4c0(0x214)]===_0x50e4c0(0x1c4)||_0x2b6cd9[_0x50e4c0(0x214)]===_0x50e4c0(0x1e3));}export async function preflightWorkspaceUpload(_0x149384,_0x3b4517,_0x4413bd){const _0x15dcd8=_0x5af3e3;if(_0x4413bd[_0x15dcd8(0x1c9)]===0x24*0x24+0x1*-0x138a+0x6d*0x22||_0x4413bd==='.'||_0x4413bd==='..'||_0x4413bd[_0x15dcd8(0x201)]('\x00')||_0x4413bd[_0x15dcd8(0x201)]('/')||_0x4413bd[_0x15dcd8(0x201)]('\x5c')||isWorkspaceUploadTemporaryName(_0x4413bd))return{'path':'','absolutePath':'','status':_0x15dcd8(0x2b6)};const _0x1e8550=await resolveRegisteredWorkspaceRoot(_0x149384),_0x8ab5de=await resolveWorkspaceEntry(_0x1e8550,_0x3b4517,!![]),_0x500102=resolve(_0x8ab5de,_0x4413bd);if(dirname(_0x500102)!==_0x8ab5de)throw new Error(_0x15dcd8(0x1ad));const _0xeb01d4=relative(_0x1e8550,_0x500102)[_0x15dcd8(0x23b)](sep)[_0x15dcd8(0x1a1)]('/'),_0x483ddf=await lstat(_0x500102)[_0x15dcd8(0x263)](_0x41a43a=>{const _0x73eff4=_0x15dcd8;if(_0x41a43a[_0x73eff4(0x1e1)]===_0x73eff4(0x281))return undefined;throw _0x41a43a;});if(_0x483ddf===undefined)return{'path':_0xeb01d4,'absolutePath':_0x500102,'status':_0x15dcd8(0x1fe)};if(_0x483ddf[_0x15dcd8(0x1b2)]())throw new Error(_0x15dcd8(0x1ad));if(_0x483ddf[_0x15dcd8(0x1d9)]())return{'path':_0xeb01d4,'absolutePath':_0x500102,'status':_0x15dcd8(0x1fa)};return{'path':_0xeb01d4,'absolutePath':_0x500102,'status':_0x15dcd8(0x1ee)};}export function workspaceUploadTemporaryName(_0x9dcb1c){const _0x5a63ee=_0x5af3e3;return _0x5a63ee(0x278)+_0x9dcb1c+_0x5a63ee(0x26f);}function isWorkspaceUploadTemporaryName(_0x3e0b2f){const _0x49272b=_0x5af3e3;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x49272b(0x1e6)](_0x3e0b2f)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x49272b(0x1e6)](_0x3e0b2f);}export async function readWorkspaceTextFile(_0x16f5e0,_0x2cc02f,_0x5e9b38=0xb*-0x2a8+-0x1720+0x3458,_0x3c7214=FILE_READ_LIMIT){const _0x13e5ba=_0x5af3e3;if(!Number[_0x13e5ba(0x20b)](_0x5e9b38)||_0x5e9b38<0x69b+0x276+0xd3*-0xb||!Number[_0x13e5ba(0x20b)](_0x3c7214)||_0x3c7214<0xa25*-0x1+-0xb0f+0x1535||_0x3c7214>FILE_READ_LIMIT)throw new Error(_0x13e5ba(0x1b9));const _0x1e29f9=await resolveRegisteredWorkspaceRoot(_0x16f5e0),_0x22fe72=await resolveWorkspaceEntry(_0x1e29f9,_0x2cc02f,![]),_0x5bd931=await lstat(_0x22fe72);if(!_0x5bd931[_0x13e5ba(0x1d9)]())throw new Error(_0x13e5ba(0x1e3));if(_0x5bd931[_0x13e5ba(0x2ae)]>FILE_READ_LIMIT*(0x101a+0xca+-0x10d4))throw new Error(_0x13e5ba(0x188));const _0x39a44c=await readFile(_0x22fe72),_0x184099=createHash(_0x13e5ba(0x29e))[_0x13e5ba(0x253)](_0x39a44c)[_0x13e5ba(0x27c)](_0x13e5ba(0x284)),_0x4878fe=_0x39a44c[_0x13e5ba(0x201)](-0x22aa+-0x826*-0x4+0x212)||!isValidUtf8(_0x39a44c);if(_0x4878fe){const _0x3e8f74=Math[_0x13e5ba(0x25d)](_0x39a44c[_0x13e5ba(0x1c9)],_0x5e9b38+_0x3c7214),_0x279b1e=_0x39a44c[_0x13e5ba(0x273)](_0x5e9b38,_0x3e8f74);return{'path':relative(_0x1e29f9,_0x22fe72)[_0x13e5ba(0x23b)](sep)[_0x13e5ba(0x1a1)]('/'),'encoding':_0x13e5ba(0x24e),'size':_0x39a44c[_0x13e5ba(0x1c9)],'content':_0x279b1e[_0x13e5ba(0x230)](_0x13e5ba(0x24e)),'truncated':_0x3e8f74<_0x39a44c[_0x13e5ba(0x1c9)],'nextOffset':_0x3e8f74<_0x39a44c[_0x13e5ba(0x1c9)]?_0x3e8f74:null,'revision':_0x184099};}if(_0x5e9b38>-0x1935*0x1+-0xe*-0x1e7+-0x16d&&_0x5e9b38<_0x39a44c[_0x13e5ba(0x1c9)]&&isUtf8ContinuationByte(_0x39a44c[_0x5e9b38]))throw new Error(_0x13e5ba(0x1b9));let _0x18792e=Math[_0x13e5ba(0x25d)](_0x39a44c[_0x13e5ba(0x1c9)],_0x5e9b38+_0x3c7214);if(_0x18792e<_0x39a44c[_0x13e5ba(0x1c9)]&&isUtf8ContinuationByte(_0x39a44c[_0x18792e])){while(_0x18792e>_0x5e9b38&&isUtf8ContinuationByte(_0x39a44c[_0x18792e]))_0x18792e-=-0x181e+0x18c1+0x1*-0xa2;if(_0x18792e===_0x5e9b38){_0x18792e+=0xf7f+0xf1e+-0x4*0x7a7;while(_0x18792e<_0x39a44c[_0x13e5ba(0x1c9)]&&isUtf8ContinuationByte(_0x39a44c[_0x18792e]))_0x18792e+=0x250c+-0x658+-0x1d*0x10f;}}const _0x1f7e7f=_0x39a44c[_0x13e5ba(0x273)](_0x5e9b38,_0x18792e),_0x32e0ca=new TextDecoder(_0x13e5ba(0x1d5),{'fatal':!![]})[_0x13e5ba(0x217)](_0x1f7e7f),_0x39d381=_0x18792e<_0x39a44c[_0x13e5ba(0x1c9)]?_0x18792e:null;return{'path':relative(_0x1e29f9,_0x22fe72)[_0x13e5ba(0x23b)](sep)[_0x13e5ba(0x1a1)]('/'),'encoding':_0x13e5ba(0x1d5),'size':_0x39a44c[_0x13e5ba(0x1c9)],'content':_0x32e0ca,'truncated':_0x39d381!==null,'nextOffset':_0x39d381,'revision':_0x184099};}export async function writeWorkspaceTextFile(_0x1a7a9c,_0x331fcd,_0x57f277,_0x1a9523){const _0x5b161e=_0x5af3e3;if(!/^[0-9a-f]{64}$/u[_0x5b161e(0x1e6)](_0x1a9523))throw new Error(_0x5b161e(0x244));const _0x22b615=Buffer[_0x5b161e(0x27d)](_0x57f277,_0x5b161e(0x250));if(_0x22b615[_0x5b161e(0x1c9)]>FILE_READ_LIMIT*(0x18fe+0x1*-0x18d+-0x299*0x9))throw new Error(_0x5b161e(0x188));if(_0x22b615[_0x5b161e(0x201)](0x24cb+-0x1e26+-0x6a5))throw new Error(_0x5b161e(0x23d));const _0x87a9f=await resolveRegisteredWorkspaceRoot(_0x1a7a9c);await assertWorkspaceMutationPathHasNoSymlinks(_0x87a9f,_0x331fcd);const _0x5145fa=await resolveWorkspaceEntry(_0x87a9f,_0x331fcd,![]),_0x3fd370=await lstat(_0x5145fa);if(!_0x3fd370[_0x5b161e(0x1d9)]())throw new Error(_0x5b161e(0x1e3));const _0x4a7887=await readFile(_0x5145fa);if(_0x4a7887[_0x5b161e(0x201)](-0x25a8+0x1*-0x22ca+0xb*0x696)||!isValidUtf8(_0x4a7887))throw new Error(_0x5b161e(0x23d));const _0x35ed0d=createHash(_0x5b161e(0x29e))[_0x5b161e(0x253)](_0x4a7887)[_0x5b161e(0x27c)](_0x5b161e(0x284));if(_0x35ed0d!==_0x1a9523)throw new Error(_0x5b161e(0x286));const _0x19365d=createHash(_0x5b161e(0x29e))[_0x5b161e(0x253)](_0x22b615)[_0x5b161e(0x27c)](_0x5b161e(0x284)),_0x114d76=resolve(dirname(_0x5145fa),_0x5b161e(0x200)+randomUUID()+_0x5b161e(0x26f));try{await writeFile(_0x114d76,_0x22b615,{'flag':'wx','mode':_0x3fd370[_0x5b161e(0x29c)]}),await rename(_0x114d76,_0x5145fa);}finally{await rm(_0x114d76,{'force':!![]})[_0x5b161e(0x263)](()=>undefined);}return{'path':workspaceRelativePath(_0x87a9f,_0x5145fa),'revision':_0x19365d,'size':_0x22b615[_0x5b161e(0x1c9)]};}export async function readWorkspaceFileContentRange(_0x2a6551,_0x56c925,_0x29e24f=0xb9e*0x2+0x11*0x5e+-0x1d7a,_0x246980=FILE_READ_LIMIT){const _0x1e3f92=_0x5af3e3;if(!Number[_0x1e3f92(0x20b)](_0x29e24f)||_0x29e24f<0x577*0x4+-0x2034+0xa58||!Number[_0x1e3f92(0x20b)](_0x246980)||_0x246980<-0x1*0x1cf2+-0x171*-0x17+-0x434||_0x246980>FILE_READ_LIMIT)throw new Error(_0x1e3f92(0x1b9));const _0x4e5984=await resolveRegisteredWorkspaceRoot(_0x2a6551),_0x506fc1=await resolveWorkspaceEntry(_0x4e5984,_0x56c925,![]),_0xa6673a=await lstat(_0x506fc1);if(!_0xa6673a[_0x1e3f92(0x1d9)]())throw new Error(_0x1e3f92(0x1e3));if(_0x29e24f>_0xa6673a[_0x1e3f92(0x2ae)])throw new Error(_0x1e3f92(0x1b9));const _0x27fa52=Math[_0x1e3f92(0x25d)](_0x246980,_0xa6673a[_0x1e3f92(0x2ae)]-_0x29e24f),_0x149e09=Buffer[_0x1e3f92(0x211)](_0x27fa52),_0x26ff06=await open(_0x506fc1,'r');try{const {bytesRead:_0x4c65f3}=await _0x26ff06[_0x1e3f92(0x20f)](_0x149e09,-0x1*0x871+0xd2+0x1*0x79f,_0x27fa52,_0x29e24f),_0x3c6cbc=_0x29e24f+_0x4c65f3;return{'path':relative(_0x4e5984,_0x506fc1)[_0x1e3f92(0x23b)](sep)[_0x1e3f92(0x1a1)]('/'),'size':_0xa6673a[_0x1e3f92(0x2ae)],'offset':_0x29e24f,'contentBase64':_0x149e09[_0x1e3f92(0x273)](-0x2479+-0x1912+-0xc4f*-0x5,_0x4c65f3)[_0x1e3f92(0x230)](_0x1e3f92(0x24e)),'nextOffset':_0x3c6cbc<_0xa6673a[_0x1e3f92(0x2ae)]?_0x3c6cbc:null};}finally{await _0x26ff06[_0x1e3f92(0x28b)]();}}function _0x585a(){const _0x13ceab=['Chj1BMfIBguG','ls1UBY1LEhqTzgLMzG','AwDUB3jL','BgLZDa','BwvYz2uTyMfZzq','nda2ody5mhH4weftCW','Bg9JA2vKia','Bg9JywXLq29TCgfYzq','yMfZzty0','y2f0lwzPBgu','DxrMoa','C2nVCMu','D29YA3nWywnLuM9VDa','DxbKyxrL','A2LSBa','lMDPDa','AgfZvxjS','BgLTAxq','ls1WB3jJzwXHAw4','revmrvrfra','kIOVzgLZDc8QkG','zMXHDe1HCa','kIOVDgvZDc9YDw5ZlYOQ','BwLU','ls11BNrYywnRzwqTzMLSzxm9ywXS','kIOVBM9Kzv9TB2r1BgvZlYOQ','n1zUq3LuAq','r0Lux1jfrL9jtLzbteLe','B3v0Chv0','y2f0y2G','ls1UBY10zxH0y29UDG','tufqueve','Cgf0Aa','ls10B3bVlw9YzgvY','zNjLC2HUzxnZvhrStxm','r0Lux1DpuKTtuefdrq','reLsrunut1jz','CM9VDa','Bwf4','zxzLCNK','CMvMCW','lNbHCNq','CMv2lxbHCNnL','zw50CNLmAw1PDa','C29YDa','C3vIyxjYyxK','ls1ICMfUy2G','ls1MB3jTyxq9','ls1ZAg93lxrVCgXLDMvS','kIOVyNvPBgqVkIO','lM1HCI11CgXVywqT','ls1PCY1HBMnLC3rVCG','nZeWntyWmgfjzhfJCG','kIOVlMnHy2HLlYOQ','zgLNzxn0','zNjVBq','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','Dg91y2G','lMDPDg1VzhvSzxm','ru5pru5u','ls1UDwXS','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','Agv4','rKLmrq','rKLmrv9xuKLurv9dt05gteLdva','kIOVlM5LEhqVkIO','C2XPy2u','ls1TyxGTy291BNq9','xNn1yM1VzhvSzvWUlIPClIHWyxrOFhvYBcKK','y2XVC2u','revmrvrf','DhjPBq','BMfTzq','kIOVlNbUCg0VkIO','r0Lux1nvqK1prfvmrv9esvndt1zfuLLFvfjvtKnbveve','C2vHCMnO','zxHLyW','y29UDgvUDenHBMrPzgf0zxm','qureruq','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','yNvIyMXLvxa','ls1VDgHLCNm','C3LTyM9SAwmTCMvM','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','C3rHDhvZ','C3rKzxjY','Bw9Kzq','AxneAxjLy3rVCNK','C2HHmJu2','AxnbyNnVBhv0zq','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','AgfZAa','mJiYodiWodnts0vZque','Dg9mB2nHBgvmB3DLCKnHC2u','zMLSDgvY','C3rYAw5NAwz5','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','iYmG','CMvZDg9Yzq','D29YA3rYzwuG','vfLqrv9dsefor0ve','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','kIOVlNzLBNyVkIO','oIHSAxrLCMfSkq','C2L6zq','CMvMCMvZAgvKqxq','D29YA3rYzwu','ls1Uyw1Llxn0yxr1CW','ywXS','uKvnt1rf','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','BgLUDxG','su5wquXjrf9oqu1f','kIOVlNLHCM4VkIO','l2rLDI9UDwXS','C29YDgvK','y3vYC29Y','CMvMCY9OzwfKCW','zgLMzG','CxvLCNK','CgfYC2u','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','q09qsuve','C2HPzNq','z2v0','AwrSzvr0Be1Z','rKLmrv9ut09Ftefsr0u','te9dquW','y29Uy2f0','ls1YB290','CMvWBgfJzq','v09ss1nqqunfx05pvf9bteXpv0ve','tuLtu0LorW','CMvMCY9Yzw1VDgvZ','CgXHDgzVCM0','ls1Yzw1VDgvZ','y2fWywnPDhK','sevbra','kIOVlNbHCMnLBc1JywnOzs8QkG','C3rYAw5N','B2jQzwn0','pZ8G','yMLUyxj5','BgLTAxrZ','ndi3mdeYwKHQu3zR','zMLUywXSEq','C2HVDW','kIOVlM51EhqVkIO','zxHWAxj5vgLTzxi','kIOVDMvUzg9YlYOQ','ls1KyxrLlw9YzgvY','AM9PBG','ls12zxjPzNK','ls1ICMfUy2HLCW','Bg9N','zgLMzI10CMvL','r0Lux1jfue9tsvrpuLLFsu5wquXjra','ls1UBY1JB21TAxqTAwq','ywrK','C3rKB3v0','kIOVB2jQlYOQ','yNjHBMnOia','ruvysvnu','rKLmrv9qqvrix0vtq0fqrq','kIOVlMDYywrSzs8QkG','DMfSDwvZ','ls1NAxqTy29TBw9UlwrPCG','A2LUza','AxntEw1IB2XPy0XPBMS','C2v0','yMfYzq','CgLK','kIOVlMDPDc8QkG','C2LUA0rVD24','z2L0','rKLmrv9squ5hrv9jtLzbteLe','ywn0Aw9U','ChvZAa','uKvoqu1fra','C3rHBgu','CMvMCMvZAef0DgvTChrLzef0','C3rHCNrZv2L0Aa','kIOVDMvUDI8QkG','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','Dhj1BMnHDgvK','Bg9HzgLUzW','rKLmrv9ot1rFrK9vtKq','BgfZDeLUzgv4t2y','CgLWzq','CMvIDwLSza','Bg9JA2vK','BgvUz3rO','u1rbr0ve','C2vHCMnOlMv4y2X1zgu','BwfW','BxrPBwvnCW','qMLUyxj5igzPBgvZia','B3v0Chv0tgLTAxq','BM93','zw5ZDxjLtg9HzgvK','zw50CMLLCW','CMvMCMvZAeLUqMfJA2DYB3vUza','zMLUza','DxrMltG','vu5uuKfds0ve','zw50CNK','ls1NzxqTCMvNzxHW','AxngAwXL','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','kIOVy292zxjHz2uVkIO','B25Jzq','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','lMDPDc8','yNL0zuXLBMD0Aa','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','y29Kzq','CMvMCY9Yzw1VDgvZlW','rKLmrv9ot1rFuKvhvuXbuG','q1jfqvrfx0rjuKvdve9swq','tu9esuzjruq','DgvZDa','zgvZDgLUyxrPB24','zgLZCgXHEu5HBwu','zMLSzxmUzxHJBhvKzq','CMvMCY9OzwfKCY8','su5wquXjra','ls1MAwXL','AgfZ','rvHju1rtx0rjuKvdve9swq','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','Bwv0ywrHDge','C29Tzq','DgHLBG','zM9YlwvHy2GTCMvM','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','r0Lux1DpuKTuuKvfx0Xju1rFsu5wquXjra','igj5DgvZpq','v09ss1nqqunfx1bbveHFsu5wquXjra','ls1ZB3vYy2u9sevbra','mZy3mtuYnxnOEMf1tG','rvHju1rtx0zjteu','q1jfqvrfx0zjteu','zMLUz2vYChjPBNq','zgf0yq','uKvbrfK','BM9YBwfSAxPL','lM1HCI1LzgL0lq','Aw5JBhvKzxm','rKLmrv9btfjfqurzx0vysvnuuW','kIOVyMLUlYOQ','lI4U','CMvHze9UBhK','yMfZzty0DxjS','ls1UBY1PBMrLEa','ls1MAxjZDc1WyxjLBNq','ls1ZDgfNzq','Dg9vChbLCKnHC2u','AxntywzLsw50zwDLCG','m2PzrwXLBa','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','ls1Pz25VCMuTC3vIBw9KDwXLCZ1KAxj0Eq','CMvHza','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','ywXSB2nvBNnHzMu','B2zMC2v0','mte5mZq4nfncug9gsa','BwvZC2fNzq','Aw5KzxHpzG','y29UzMLN','zgvJB2rL','CMvSyxrPDMu','ls1ZAg9YDa','nJu3mJq3mKv2vK5kuW','ls1LEgnSDwrLlxn0yw5KyxjK','BhmTzMLSzxm','kIOVlMfUz3vSyxiVkIO','ls1XDwLLDa','zxjYB3i','zgv0ywnOzwq','Dw5Yzwy','zMXVB3i','sevbrca','kIOVlNn2zwX0zs1RAxqVkIO','rKLmrv9ot1rFreLsrunut1jz','Dg9mB3DLCKnHC2u','D2LUmZi','lY5Flq','kIOVlNr1CMjVlYOQ','kIOVB3v0lYOQ','AxnjBNrLz2vY','ls13B3jRDhjLzq','zMLUzeLUzgv4','u0Lhs0Lmta','Chj1BMfIBgu','Dg9tDhjPBMC','CMvWBgfJzufSBa','yMXVyG','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','ls1ZDgfNzwq','vu5tvefhruq','Dgv4Da','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','kIOVDgfYz2v0lYOQ','ls1ZA2LWpq','r0Lux0nptu1btKrFrKfjteve','C3bSAxq','ls1WB3jJzwXHAw49DJe','rKLmrv9ot1rFvevyva','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','DgLTzw91De1Z','yMLUyxj5igrPzMyGC2HHmJu2pq','y2HHBMDLCW','zgLZCg9Zzq','kIOVx19WEwnHy2HLx18VkIO','rKLmrv9srvzju0LptL9jtLzbteLe','Aw52ywXPza'];_0x585a=function(){return _0x13ceab;};return _0x585a();}export async function readAllowedFileContentRange(_0x344d4f,_0x4a4388,_0x4e1346=0x65f*-0x5+0x2*-0x371+-0x2f*-0xd3,_0x34ddf9=FILE_READ_LIMIT){const _0x13aacd=_0x5af3e3;if(!Number[_0x13aacd(0x20b)](_0x4e1346)||_0x4e1346<-0x199*0x16+0x47*-0x6b+-0xcf7*-0x5||!Number[_0x13aacd(0x20b)](_0x34ddf9)||_0x34ddf9<0x629+0x2400+-0x1514*0x2||_0x34ddf9>FILE_READ_LIMIT)throw new Error(_0x13aacd(0x1b9));const {file:_0xa9d9a9,metadata:_0x5bb4f1}=await resolveAllowedFile(_0x344d4f,_0x4a4388);if(_0x4e1346>_0x5bb4f1[_0x13aacd(0x2ae)])throw new Error(_0x13aacd(0x1b9));const _0x41d19d=Math[_0x13aacd(0x25d)](_0x34ddf9,_0x5bb4f1[_0x13aacd(0x2ae)]-_0x4e1346),_0x4e8051=Buffer[_0x13aacd(0x211)](_0x41d19d),_0x53c47b=await open(_0xa9d9a9,'r');try{const {bytesRead:_0xfb04bc}=await _0x53c47b[_0x13aacd(0x20f)](_0x4e8051,-0x16da+0x826+0xeb4,_0x41d19d,_0x4e1346),_0x290d1b=_0x4e1346+_0xfb04bc;return{'path':_0xa9d9a9,'size':_0x5bb4f1[_0x13aacd(0x2ae)],'offset':_0x4e1346,'contentBase64':_0x4e8051[_0x13aacd(0x273)](0xdd*-0x7+-0xb*-0x21a+-0x1113,_0xfb04bc)[_0x13aacd(0x230)](_0x13aacd(0x24e)),'nextOffset':_0x290d1b<_0x5bb4f1[_0x13aacd(0x2ae)]?_0x290d1b:null};}finally{await _0x53c47b[_0x13aacd(0x28b)]();}}export async function readAllowedTextFile(_0x14cd9d,_0x316b10,_0xb63005=0x1*-0x2537+0x211a*0x1+0x9*0x75,_0x2a1602=FILE_READ_LIMIT){const _0x4e994f=_0x5af3e3,{file:_0x53d353,metadata:_0x11174}=await resolveAllowedFile(_0x14cd9d,_0x316b10);if(_0x11174[_0x4e994f(0x2ae)]>FILE_READ_LIMIT*(0x2*-0x767+-0x1b05+0x29e3))throw new Error(_0x4e994f(0x188));if(!Number[_0x4e994f(0x20b)](_0xb63005)||_0xb63005<0xad2+0x185*-0x17+0x1821*0x1||!Number[_0x4e994f(0x20b)](_0x2a1602)||_0x2a1602<0xdfd+0x1*0x1fc2+-0x2*0x16df||_0x2a1602>FILE_READ_LIMIT)throw new Error(_0x4e994f(0x1b9));const _0x4c4ca2=await readFile(_0x53d353),_0x488fd0=_0x4c4ca2[_0x4e994f(0x201)](-0x757+-0x6f8+0x4c5*0x3)||!isValidUtf8(_0x4c4ca2),_0x5a3761=Math[_0x4e994f(0x25d)](_0x4c4ca2[_0x4e994f(0x1c9)],_0xb63005+_0x2a1602);if(_0x488fd0){const _0x19c90a=_0x4c4ca2[_0x4e994f(0x273)](_0xb63005,_0x5a3761);return{'path':_0x53d353,'encoding':_0x4e994f(0x24e),'size':_0x4c4ca2[_0x4e994f(0x1c9)],'content':_0x19c90a[_0x4e994f(0x230)](_0x4e994f(0x24e)),'truncated':_0x5a3761<_0x4c4ca2[_0x4e994f(0x1c9)],'nextOffset':_0x5a3761<_0x4c4ca2[_0x4e994f(0x1c9)]?_0x5a3761:null};}if(_0xb63005>0x40*0x7f+-0x4b7+-0x1b09&&_0xb63005<_0x4c4ca2[_0x4e994f(0x1c9)]&&isUtf8ContinuationByte(_0x4c4ca2[_0xb63005]))throw new Error(_0x4e994f(0x1b9));let _0x35bc47=_0x5a3761;if(_0x35bc47<_0x4c4ca2[_0x4e994f(0x1c9)]&&isUtf8ContinuationByte(_0x4c4ca2[_0x35bc47])){while(_0x35bc47>_0xb63005&&isUtf8ContinuationByte(_0x4c4ca2[_0x35bc47]))_0x35bc47-=0x160e+-0x13e*0x17+0x685;if(_0x35bc47===_0xb63005){_0x35bc47+=0x1633*0x1+0x25c4+-0x2*0x1dfb;while(_0x35bc47<_0x4c4ca2[_0x4e994f(0x1c9)]&&isUtf8ContinuationByte(_0x4c4ca2[_0x35bc47]))_0x35bc47+=-0x134e+0xd6*-0xd+-0x135*-0x19;}}const _0x48fcea=_0x35bc47<_0x4c4ca2[_0x4e994f(0x1c9)]?_0x35bc47:null;return{'path':_0x53d353,'encoding':_0x4e994f(0x1d5),'size':_0x4c4ca2[_0x4e994f(0x1c9)],'content':new TextDecoder(_0x4e994f(0x1d5),{'fatal':!![]})[_0x4e994f(0x217)](_0x4c4ca2[_0x4e994f(0x273)](_0xb63005,_0x35bc47)),'truncated':_0x48fcea!==null,'nextOffset':_0x48fcea};}export function normalizeFilePreviewPath(_0x119f51){const _0x4677de=_0x5af3e3;if(!/^sandbox:/iu[_0x4677de(0x1e6)](_0x119f51))return _0x119f51;let _0x532987;try{_0x532987=decodeURIComponent(_0x119f51[_0x4677de(0x288)](_0x119f51[_0x4677de(0x215)](':')+(-0x1ca*0x1+0x1bf+0xc)));}catch{throw new Error(_0x4677de(0x1ad));}const _0xec6ae4=_0x532987[_0x4677de(0x18c)](/^\/([a-z]:[\\/])/iu,'$1');if(_0xec6ae4[_0x4677de(0x1c9)]===-0x1823+-0x5*0x3f3+0x2be2||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x4677de(0x1e6)](_0x532987)||!isAbsolute(_0xec6ae4)&&!win32[_0x4677de(0x29f)](_0xec6ae4)||_0xec6ae4[_0x4677de(0x201)]('\x00')||_0xec6ae4[_0x4677de(0x201)]('?')||_0xec6ae4[_0x4677de(0x201)]('#'))throw new Error(_0x4677de(0x1ad));return _0xec6ae4;}async function resolveAllowedFile(_0x59877a,_0x4eb388){const _0x36f51e=_0x5af3e3;if(!isAbsolute(_0x59877a))throw new Error(_0x36f51e(0x1ad));const _0x3cf380=await realpath(_0x59877a)[_0x36f51e(0x263)](_0xdb8135=>{const _0x50be98=_0x36f51e;if(_0xdb8135[_0x50be98(0x1e1)]===_0x50be98(0x281))throw new Error(_0x50be98(0x1c4));throw _0xdb8135;}),_0x4e9c0d=await Promise[_0x36f51e(0x2b2)](_0x4eb388[_0x36f51e(0x1cc)](_0x4d45da=>realpath(_0x4d45da)));if(!isWithinAllowedRoot(_0x3cf380,_0x4e9c0d))throw new Error(_0x36f51e(0x1ad));const _0x3bd523=await lstat(_0x3cf380);if(!_0x3bd523[_0x36f51e(0x1d9)]())throw new Error(_0x36f51e(0x1e3));return{'file':_0x3cf380,'metadata':_0x3bd523};}function isValidUtf8(_0x4b5f6e){const _0x105768=_0x5af3e3;try{return new TextDecoder(_0x105768(0x1d5),{'fatal':!![]})[_0x105768(0x217)](_0x4b5f6e),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x424417){return(_0x424417&0x68e+0x93*0x13+-0xb*0x185)===0x16*-0x1af+0x12b3+0x12d7;}export async function searchWorkspaceFiles(_0x407aac,_0x3e70d6,_0x1dcfa3,_0x3effd9=SEARCH_RESULT_LIMIT,_0x2a16a4=![]){const _0x2ec0ac=_0x5af3e3,_0x239887=new WorkspaceFileIndex(_0x407aac);try{return await _0x239887[_0x2ec0ac(0x291)](_0x3e70d6,_0x1dcfa3,_0x3effd9,_0x2a16a4);}finally{_0x239887[_0x2ec0ac(0x242)]();}}async function resolveRegisteredWorkspaceRoot(_0x23c8df){const _0x499feb=_0x5af3e3,_0x507bee=await realpath(_0x23c8df);if(normalizeWorkspacePath(_0x507bee)!==normalizeWorkspacePath(_0x23c8df))throw new Error(_0x499feb(0x18d));return _0x507bee;}async function resolveWorkspaceEntry(_0x40bd4b,_0x88860a,_0x5b6c27){const _0x365b2d=await resolveRegisteredWorkspaceRoot(_0x40bd4b);return resolveWorkspaceEntryFromCanonicalRoot(_0x365b2d,_0x88860a,_0x5b6c27);}async function resolveWorkspaceEntryFromCanonicalRoot(_0xaaa625,_0x23eaa4,_0x12ee32){const _0x4da135=_0x5af3e3,_0x12a97c=await resolveWorkspaceEntryMetadata(_0xaaa625,_0x23eaa4);if(_0x12ee32?!_0x12a97c[_0x4da135(0x1f0)][_0x4da135(0x29d)]():!_0x12a97c[_0x4da135(0x1f0)][_0x4da135(0x1d9)]()&&!_0x12a97c[_0x4da135(0x1f0)][_0x4da135(0x29d)]())throw new Error(_0x12ee32?_0x4da135(0x225):_0x4da135(0x1e3));return _0x12a97c[_0x4da135(0x266)];}async function resolveWorkspaceEntryMetadata(_0x2d583b,_0x57cdff){const _0xcbb02e=_0x5af3e3;if(_0x57cdff[_0xcbb02e(0x201)]('\x00')||_0x57cdff[_0xcbb02e(0x1c9)]===-0x1d7a+0x35*-0xac+-0x1*-0x4116||_0x57cdff[_0xcbb02e(0x1bf)]('/')||_0x57cdff[_0xcbb02e(0x1bf)]('\x5c'))throw new Error(_0xcbb02e(0x1ad));const _0x150bbf=_0x57cdff[_0xcbb02e(0x231)]('\x5c','/');if(_0x150bbf[_0xcbb02e(0x23b)]('/')[_0xcbb02e(0x1f1)](_0x534686=>_0x534686==='..'||_0x534686===_0xcbb02e(0x255)))throw new Error(_0xcbb02e(0x1ad));let _0x439970;try{_0x439970=await realpath(resolve(_0x2d583b,_0x150bbf));}catch(_0x5ed097){if(_0x5ed097[_0xcbb02e(0x1e1)]===_0xcbb02e(0x281))throw new Error(_0xcbb02e(0x1c4));throw _0x5ed097;}const _0x57c66c=relative(_0x2d583b,_0x439970);if(isAbsolute(_0x57c66c)||_0x57c66c[_0xcbb02e(0x1bf)]('..')||_0x57c66c==='..'||_0x57c66c[_0xcbb02e(0x1bf)]('..'+sep))throw new Error(_0xcbb02e(0x1ad));const _0x1e96a1=await lstat(_0x439970);return{'path':_0x439970,'metadata':_0x1e96a1};}async function inspectWorkspaceIndexEntry(_0x126e34,_0x130b96,_0xcbedf5){const _0x3cefbe=_0x5af3e3;try{const _0x56a606=await resolveWorkspaceEntryMetadata(_0x126e34,_0x130b96);if(!_0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x1d9)]()&&!_0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x29d)]())return undefined;const _0x439b81=relative(_0x126e34,_0x56a606[_0x3cefbe(0x266)])[_0x3cefbe(0x23b)](sep)[_0x3cefbe(0x1a1)]('/');return _0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x29d)]()?{'path':_0x439b81,'name':_0xcbedf5,'kind':_0x3cefbe(0x26a),'size':null,'modifiedAt':_0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x1cd)]}:{'path':_0x439b81,'name':_0xcbedf5,'kind':_0x3cefbe(0x285),'size':_0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x2ae)],'modifiedAt':_0x56a606[_0x3cefbe(0x1f0)][_0x3cefbe(0x1cd)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x1cb2f5,_0x3b73bc){const _0x468bf7=_0x5af3e3;return Buffer[_0x468bf7(0x27d)](JSON[_0x468bf7(0x2a5)]({'path':_0x1cb2f5,'name':_0x3b73bc}))[_0x468bf7(0x230)](_0x468bf7(0x206));}function decodeDirectoryCursor(_0x2cc5d2,_0x85dcdb){const _0x565ff7=_0x5af3e3;if(_0x2cc5d2===undefined)return undefined;try{const _0x367699=JSON[_0x565ff7(0x182)](Buffer[_0x565ff7(0x27d)](_0x2cc5d2,_0x565ff7(0x206))[_0x565ff7(0x230)](_0x565ff7(0x250)));if(typeof _0x367699!==_0x565ff7(0x196)||_0x367699===null||_0x367699[_0x565ff7(0x266)]!==_0x85dcdb||typeof _0x367699[_0x565ff7(0x28e)]!==_0x565ff7(0x195))throw new Error();return _0x367699[_0x565ff7(0x28e)];}catch{throw new Error(_0x565ff7(0x1c1));}}function encodeSearchCursor(_0x4a3796,_0x3f5ed1){const _0x2a202c=_0x5af3e3;return Buffer[_0x2a202c(0x27d)](JSON[_0x2a202c(0x2a5)]({'query':_0x4a3796,'path':_0x3f5ed1}))[_0x2a202c(0x230)](_0x2a202c(0x206));}function decodeSearchCursor(_0x3c8efa,_0x3696b5){const _0x4a828a=_0x5af3e3;if(_0x3c8efa===undefined)return undefined;try{const _0x2113a8=JSON[_0x4a828a(0x182)](Buffer[_0x4a828a(0x27d)](_0x3c8efa,_0x4a828a(0x206))[_0x4a828a(0x230)](_0x4a828a(0x250)));if(typeof _0x2113a8!==_0x4a828a(0x196)||_0x2113a8===null||_0x2113a8[_0x4a828a(0x181)]!==_0x3696b5||typeof _0x2113a8[_0x4a828a(0x266)]!==_0x4a828a(0x195))throw new Error();return _0x2113a8[_0x4a828a(0x266)];}catch{throw new Error(_0x4a828a(0x1c1));}}export function normalizeWorkspacePath(_0x27d57f,_0x20d07a=_0x315274()){const _0x5da579=_0x5af3e3;if(_0x27d57f[_0x5da579(0x1c9)]===-0x538*-0x4+0x1862+-0x2d42||_0x27d57f[_0x5da579(0x201)]('\u0000'))throw new Error(_0x5da579(0x1f7));if(_0x20d07a===_0x5da579(0x227)){if(/^\\\\[?.]/[_0x5da579(0x1e6)](_0x27d57f))throw new Error(_0x5da579(0x295));const _0x5c4114=win32[_0x5da579(0x1ff)](_0x27d57f[_0x5da579(0x231)]('/','\x5c'));if(!win32[_0x5da579(0x29f)](_0x5c4114))throw new Error(_0x5da579(0x20d));return _0x5c4114[_0x5da579(0x18c)](/\\+$/,'')[_0x5da579(0x226)]();}if(_0x20d07a!==_0x5da579(0x2b5))throw new Error(_0x5da579(0x1dd));const _0x1c3bb6=posix[_0x5da579(0x1ff)](_0x27d57f);if(!posix[_0x5da579(0x29f)](_0x1c3bb6))throw new Error(_0x5da579(0x20d));return _0x1c3bb6==='/'?_0x1c3bb6:_0x1c3bb6[_0x5da579(0x18c)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1f0e69,_0x41db36,_0x1acda1=_0x315274()){const _0x5e32f3=_0x5af3e3,_0x3daf1b=normalizeWorkspacePath(_0x1f0e69,_0x1acda1),_0x1c4c8c=_0x1acda1===_0x5e32f3(0x227)?win32:posix;return _0x41db36[_0x5e32f3(0x1f1)](_0x341f3f=>{const _0x1c06cd=_0x5e32f3,_0x1a7560=normalizeWorkspacePath(_0x341f3f,_0x1acda1),_0x1ff454=_0x1c4c8c[_0x1c06cd(0x218)](_0x1a7560,_0x3daf1b);return _0x1ff454===''||!_0x1ff454[_0x1c06cd(0x1bf)]('..')&&!_0x1c4c8c[_0x1c06cd(0x29f)](_0x1ff454);});}export async function inspectWorkspace(_0x4d459b,_0x3c90bc){const _0x421985=_0x5af3e3,_0x3e616c=await realpath(_0x4d459b),_0x1242fe=await Promise[_0x421985(0x2b2)](_0x3c90bc[_0x421985(0x1cc)](_0xc1e79a=>realpath(_0xc1e79a))),_0x18caa1=await stat(_0x3e616c);if(!_0x18caa1[_0x421985(0x29d)]()||!isWithinAllowedRoot(_0x3e616c,_0x1242fe))throw new Error(_0x421985(0x18d));try{const _0x2fcda3=await readGitSummary(_0x3e616c);return{'path':_0x3e616c,'kind':_0x421985(0x269),'gitSummary':_0x2fcda3};}catch(_0x2bc041){if(_0x2bc041 instanceof GitCommandError&&_0x2bc041[_0x421985(0x1e1)]===-0x17*-0x1af+-0x8b+0x6a*-0x5b||isGitUnavailable(_0x2bc041))return{'path':_0x3e616c,'kind':_0x421985(0x26a)};throw _0x2bc041;}}export async function readGitSummary(_0x4ea886){const _0x19a48=_0x5af3e3,_0x35cfc4=(await runReadOnlyGit(_0x4ea886,[_0x19a48(0x270),_0x19a48(0x1b0)]))[_0x19a48(0x236)][_0x19a48(0x28d)](),_0x2e78e5=await runReadOnlyGitAllowFailure(_0x4ea886,[_0x19a48(0x270),_0x19a48(0x1a2),_0x19a48(0x193)]),_0x3baee8=await runReadOnlyGitAllowFailure(_0x4ea886,[_0x19a48(0x298),_0x19a48(0x21e),_0x19a48(0x219),_0x19a48(0x193)]),_0x337321={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x15dd98=await runReadOnlyGit(_0x4ea886,[_0x19a48(0x29a),_0x19a48(0x23c)],_0x337321);return{'commonDir':_0x35cfc4,'head':_0x2e78e5[_0x19a48(0x1e1)]===0x106*-0x18+0x278+-0x8*-0x2c3?_0x2e78e5[_0x19a48(0x236)][_0x19a48(0x28d)]():'','branch':_0x3baee8[_0x19a48(0x1e1)]===0x322+-0x100*0x8+-0x2*-0x26f?_0x3baee8[_0x19a48(0x236)][_0x19a48(0x28d)]():null,'dirty':_0x15dd98[_0x19a48(0x262)][_0x19a48(0x1c9)]>0x176d*0x1+0x3*-0x1ac+-0x1269,'snapshot':summarizeText(_0x15dd98[_0x19a48(0x236)])};}export function assertSafeGitRef(_0x47090d){const _0x372f95=_0x5af3e3;if(!REF_PATTERN[_0x372f95(0x1e6)](_0x47090d))throw new Error(_0x372f95(0x261));}export async function readRestrictedDiff(_0xd1f871,_0x2a0c9d,_0x376f4b){const _0x42fbb1=_0x5af3e3;assertSafeGitRef(_0x2a0c9d),assertSafeGitRef(_0x376f4b);const _0x127521=await runReadOnlyGit(_0xd1f871,[_0x42fbb1(0x2bc),_0x42fbb1(0x247),_0x42fbb1(0x264),_0x2a0c9d,_0x376f4b]),_0x1c19cf=_0x127521[_0x42fbb1(0x262)][_0x42fbb1(0x201)](0x31b+0x24fc+0x21*-0x137)||_0x127521[_0x42fbb1(0x236)][_0x42fbb1(0x201)](_0x42fbb1(0x1ce));if(_0x1c19cf)return{'binary':!![],'summary':_0x42fbb1(0x240)+createHash(_0x42fbb1(0x29e))[_0x42fbb1(0x253)](_0x127521[_0x42fbb1(0x262)])[_0x42fbb1(0x27c)](_0x42fbb1(0x284))+_0x42fbb1(0x1f6)+_0x127521[_0x42fbb1(0x262)][_0x42fbb1(0x1c9)],'truncated':_0x127521[_0x42fbb1(0x1c2)]};return{'binary':![],'text':_0x127521[_0x42fbb1(0x236)],'truncated':_0x127521[_0x42fbb1(0x1c2)]};}function currentBranchFromStatusHeader(_0x4ce75e){const _0x3605b9=_0x5af3e3,_0x19bb65=_0x4ce75e[_0x3605b9(0x288)](-0x1fa4+0x1a*0x15+0x1d85);if(_0x19bb65[_0x3605b9(0x1bf)](_0x3605b9(0x223)))return null;const _0x43e765=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x3605b9(0x292)](_0x19bb65);if(_0x43e765!==null)return _0x43e765[0x3e*-0x79+0x1278+0xad7]??null;return _0x19bb65[_0x3605b9(0x23b)](_0x3605b9(0x204))[0x2213+-0x1f*0xcc+-0x1*0x95f]?.[_0x3605b9(0x23b)]('\x20')[0x570+-0x12*-0x31+-0x8e2]??null;}export async function listGitWorktrees(_0x94645b){const _0x135862=_0x5af3e3,_0x6f7ba4={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x2dabbb=await runReadOnlyGitAllowFailure(_0x94645b,[_0x135862(0x2b0),_0x135862(0x249),_0x135862(0x258),'-z'],_0x6f7ba4);if(_0x2dabbb[_0x135862(0x1e1)]===-0x122a*-0x1+-0x19c2+0x798)return parseGitWorktreeList(_0x94645b,_0x2dabbb,!![]);if(!canRetryGitWorktreeListWithoutNullOutput(_0x2dabbb))throw new GitCommandError(_0x2dabbb[_0x135862(0x1e1)],_0x2dabbb[_0x135862(0x29b)]);const _0x3512df=await runReadOnlyGit(_0x94645b,[_0x135862(0x2b0),_0x135862(0x249),_0x135862(0x258)],_0x6f7ba4);return parseGitWorktreeList(_0x94645b,_0x3512df,![]);}async function parseGitWorktreeList(_0x5af1c2,_0x26f165,_0x3c2e6a){const _0x4249a9=_0x5af3e3,_0xe68d5f=normalizeWorkspacePath(await realpath(_0x5af1c2)),_0x50c9dc=[];let _0x1ba5dd=_0x26f165[_0x4249a9(0x1c2)];const _0x20dcbd=_0x3c2e6a?_0x26f165[_0x4249a9(0x236)][_0x4249a9(0x23b)]('\x00\x00'):_0x26f165[_0x4249a9(0x236)][_0x4249a9(0x23b)](/\r?\n\r?\n/);for(const _0x44be55 of _0x20dcbd){if(_0x44be55[_0x4249a9(0x1c9)]===-0xa04*0x1+0x459*0x5+-0xbb9*0x1)continue;if(_0x50c9dc[_0x4249a9(0x1c9)]>=GIT_WORKTREE_LIST_LIMIT){_0x1ba5dd=!![];break;}const _0x32a80e=(_0x3c2e6a?_0x44be55[_0x4249a9(0x23b)]('\x00'):_0x44be55[_0x4249a9(0x23b)](/\r?\n/))[_0x4249a9(0x2a4)](_0x4a1a46=>_0x4a1a46[_0x4249a9(0x1c9)]>-0x21ad+-0x254e+0x2a1*0x1b);if(!_0x3c2e6a&&_0x32a80e[_0x4249a9(0x1f1)](_0x28b6af=>!(_0x28b6af[_0x4249a9(0x1bf)](_0x4249a9(0x2a9))||_0x28b6af[_0x4249a9(0x1bf)](_0x4249a9(0x223))||_0x28b6af[_0x4249a9(0x1bf)](_0x4249a9(0x1ab))||_0x28b6af===_0x4249a9(0x1b4)||_0x28b6af===_0x4249a9(0x220)||_0x28b6af===_0x4249a9(0x1c8)||_0x28b6af[_0x4249a9(0x1bf)](_0x4249a9(0x24c))||_0x28b6af===_0x4249a9(0x22f)||_0x28b6af[_0x4249a9(0x1bf)](_0x4249a9(0x246)))))throw new Error(_0x4249a9(0x1f5));if(_0x32a80e[_0x4249a9(0x1f1)](_0x4b27b5=>_0x4b27b5===_0x4249a9(0x1b4)))continue;const _0x1d9b36=_0x32a80e[_0x4249a9(0x1d4)](_0x4c1ce8=>_0x4c1ce8[_0x4249a9(0x1bf)](_0x4249a9(0x2a9))),_0x2a27b0=_0x32a80e[_0x4249a9(0x1d4)](_0x5d833f=>_0x5d833f[_0x4249a9(0x1bf)](_0x4249a9(0x223))),_0x3e38d9=_0x1d9b36?.[_0x4249a9(0x288)](_0x4249a9(0x2a9)[_0x4249a9(0x1c9)]),_0x51189b=_0x2a27b0?.[_0x4249a9(0x288)](_0x4249a9(0x223)[_0x4249a9(0x1c9)]);if(_0x3e38d9===undefined||_0x3e38d9[_0x4249a9(0x1c9)]===0x538+0x886+-0xdbe||_0x51189b===undefined||!/^[0-9a-f]{40,64}$/u[_0x4249a9(0x1e6)](_0x51189b)){if(_0x26f165[_0x4249a9(0x1c2)]){_0x1ba5dd=!![];continue;}throw new Error(_0x4249a9(0x1f5));}const _0x786002=_0x32a80e[_0x4249a9(0x1d4)](_0x48c057=>_0x48c057[_0x4249a9(0x1bf)](_0x4249a9(0x1ab))),_0x24c939=_0x786002?.[_0x4249a9(0x288)](_0x4249a9(0x1ab)[_0x4249a9(0x1c9)]),_0x36cf73=_0x24c939===undefined?null:_0x24c939[_0x4249a9(0x1bf)](_0x4249a9(0x1ea))?_0x24c939[_0x4249a9(0x288)](_0x4249a9(0x1ea)[_0x4249a9(0x1c9)]):_0x24c939,_0x5eb14d=(basename(_0x3e38d9)[_0x4249a9(0x28d)]()||_0x36cf73||_0x51189b[_0x4249a9(0x288)](0x1079*-0x1+-0x8fd+0x1976,-0x2*0x7a5+0x24cd*-0x1+0x9*0x5cb))[_0x4249a9(0x288)](-0x20f5+0x102*0x8+0x18e5,-0x1699+-0x1*-0x93d+0x1*0xf5c);_0x50c9dc[_0x4249a9(0x1bb)]({'path':_0x3e38d9,'directoryName':_0x5eb14d,'branch':_0x36cf73,'head':_0x51189b,'current':normalizeWorkspacePath(_0x3e38d9)===_0xe68d5f,'locked':_0x32a80e[_0x4249a9(0x1f1)](_0x42be78=>_0x42be78===_0x4249a9(0x1c8)||_0x42be78[_0x4249a9(0x1bf)](_0x4249a9(0x24c))),'prunable':_0x32a80e[_0x4249a9(0x1f1)](_0x3ab707=>_0x3ab707===_0x4249a9(0x22f)||_0x3ab707[_0x4249a9(0x1bf)](_0x4249a9(0x246)))});}return{'entries':_0x50c9dc,'truncated':_0x1ba5dd};}export async function readCurrentChangesSummary(_0x5d4d57,_0x36e9ef=![]){const _0xb59366=_0x5af3e3,_0x1126d6=[_0xb59366(0x29a),_0xb59366(0x23c),'-z',_0xb59366(0x274),_0xb59366(0x25e)],_0x501760={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x1c7859=await runReadOnlyGit(_0x5d4d57,_0x1126d6,_0x501760)[_0xb59366(0x263)](_0x5b71b5=>{const _0x1a7264=_0xb59366;if(!_0x36e9ef||!(_0x5b71b5 instanceof GitCommandError))throw _0x5b71b5;return runReadOnlyGit(_0x5d4d57,[..._0x1126d6,_0x1a7264(0x20e)],_0x501760);}),_0x482e1e=_0x1c7859[_0xb59366(0x236)][_0xb59366(0x23b)]('\x00'),_0x44d713=_0x482e1e[_0xb59366(0x185)]()??'',_0x6481c7=[];for(let _0x181737=0x1b*0x18+0x223*-0x1+-0x65*0x1;_0x181737<_0x482e1e[_0xb59366(0x1c9)];_0x181737+=-0xc7a+-0x43*0x49+0x1f96){const _0x12dc14=_0x482e1e[_0x181737];if(_0x12dc14[_0xb59366(0x1c9)]<0xecd+-0xddc*-0x1+-0x1ca5)continue;const _0x5dc45a=_0x12dc14[-0x17ee+0x1540+0x2ae],_0x4eb3b6=_0x12dc14[0x2188+-0x29*0x7f+0x698*-0x2],_0x157182=_0x12dc14[_0xb59366(0x288)](-0x1*0x19ff+-0x116a+0x2b6c*0x1);if(_0x5dc45a==='?'&&_0x4eb3b6==='?'){_0x6481c7[_0xb59366(0x1bb)]({'path':_0x157182,'state':_0xb59366(0x1d6),'change':_0xb59366(0x294)});continue;}_0x5dc45a!=='\x20'&&_0x6481c7[_0xb59366(0x1bb)]({'path':_0x157182,'state':_0xb59366(0x1ca),'change':gitChange(_0x5dc45a)});_0x4eb3b6!=='\x20'&&_0x6481c7[_0xb59366(0x1bb)]({'path':_0x157182,'state':_0xb59366(0x235),'change':gitChange(_0x4eb3b6)});if(_0x5dc45a==='R'||_0x5dc45a==='C'||_0x4eb3b6==='R'||_0x4eb3b6==='C')_0x181737+=0x8b4+0x17*-0x1c+-0x62f;}return{'branch':_0x44d713[_0xb59366(0x1bf)](_0xb59366(0x2a7))?currentBranchFromStatusHeader(_0x44d713):null,'changes':_0x6481c7};}export async function listGitSubmodules(_0x40e2f0){const _0x4e1265=_0x5af3e3,_0x52ea3f=await runReadOnlyGit(_0x40e2f0,[_0x4e1265(0x21c),_0x4e1265(0x209),'-z'],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});if(_0x52ea3f[_0x4e1265(0x1c2)])throw new Error(_0x4e1265(0x290));const _0x41b3d2=[...new Set(_0x52ea3f[_0x4e1265(0x236)][_0x4e1265(0x23b)]('\x00')[_0x4e1265(0x25b)](_0x1253b5=>{const _0x4fc82d=_0x4e1265,_0x41b476=/^160000 [0-9a-f]+ [0-3]\t([\s\S]+)$/[_0x4fc82d(0x292)](_0x1253b5);return _0x41b476?.[-0x2e+0x5*-0x6da+-0x3*-0xb7b]===undefined?[]:[_0x41b476[-0x65b*0x4+-0x1422+-0x2d8f*-0x1]];}))][_0x4e1265(0x272)]((_0x130671,_0x1ef2e8)=>_0x130671[_0x4e1265(0x24d)](_0x1ef2e8));if(_0x41b3d2[_0x4e1265(0x1c9)]===0x6*-0xb7+0xe*-0xa9+0xd88)return[];const _0x27d9ce=(_0x439698,_0x98187f)=>_0x41b3d2[_0x4e1265(0x1cc)](_0x504e00=>({'path':_0x504e00,'mapping':_0x439698,..._0x98187f===undefined?{}:{'gitExitCode':_0x98187f}}));try{const _0x5d078b=await lstat(resolve(_0x40e2f0,_0x4e1265(0x280)));if(!_0x5d078b[_0x4e1265(0x1d9)]()||_0x5d078b[_0x4e1265(0x1b2)]())return _0x27d9ce(_0x4e1265(0x1eb));}catch(_0x5d45bf){return _0x27d9ce(_0x5d45bf[_0x4e1265(0x1e1)]===_0x4e1265(0x281)?_0x4e1265(0x18e):_0x4e1265(0x1eb));}const _0x222a8b=await runReadOnlyGitAllowFailure(_0x40e2f0,[_0x4e1265(0x216),_0x4e1265(0x282),_0x4e1265(0x1ec),_0x4e1265(0x280),_0x4e1265(0x1d8),_0x4e1265(0x28a)],{'outputLimit':GIT_LARGE_OUTPUT_LIMIT});if(_0x222a8b[_0x4e1265(0x1c2)]||_0x222a8b[_0x4e1265(0x1e1)]!==-0x21c6+-0x2*-0x61+-0x1082*-0x2&&_0x222a8b[_0x4e1265(0x1e1)]!==0x1*-0x7f7+0x2419*0x1+0x1*-0x1c21)return _0x27d9ce(_0x4e1265(0x1eb),_0x222a8b[_0x4e1265(0x1e1)]);const _0x3727d3=new Map();for(const _0x3b6502 of _0x222a8b[_0x4e1265(0x236)][_0x4e1265(0x23b)]('\x00')){const _0x2ea48b=_0x3b6502[_0x4e1265(0x215)]('\x0a');if(_0x2ea48b<0xcfb*-0x1+0x778+0x11*0x53)continue;const _0x537656=_0x3b6502[_0x4e1265(0x288)](-0x4f+-0x719*-0x3+-0x14fc,_0x2ea48b),_0x302a5d=_0x3b6502[_0x4e1265(0x288)](_0x2ea48b+(-0xaa4+0x46f+0x636)),_0x3fa89c=/^submodule\.(.*)\.(path|url)$/[_0x4e1265(0x292)](_0x537656);if(_0x3fa89c?.[-0x591+-0x61*0x4+-0x2*-0x38b]===undefined)continue;const _0x5817c2=_0x3727d3[_0x4e1265(0x186)](_0x3fa89c[-0x3c1+0xd90+-0xa*0xfb])??{};if(_0x3fa89c[0x108*-0x25+0x1712+0xf18]===_0x4e1265(0x266))_0x5817c2[_0x4e1265(0x266)]=_0x302a5d;else _0x5817c2[_0x4e1265(0x256)]=_0x302a5d[_0x4e1265(0x28d)]()[_0x4e1265(0x1c9)]>-0x1d2+0xff0+-0xd*0x116;_0x3727d3[_0x4e1265(0x1b3)](_0x3fa89c[0x772+-0xa*0x36e+-0x19*-0x113],_0x5817c2);}const _0x38c32e=new Set([..._0x3727d3[_0x4e1265(0x1af)]()][_0x4e1265(0x25b)](_0x5e8e8e=>_0x5e8e8e[_0x4e1265(0x266)]!==undefined&&_0x5e8e8e[_0x4e1265(0x256)]?[_0x5e8e8e[_0x4e1265(0x266)]]:[]));return _0x41b3d2[_0x4e1265(0x1cc)](_0x396acd=>({'path':_0x396acd,'mapping':_0x38c32e[_0x4e1265(0x1ed)](_0x396acd)?_0x4e1265(0x265):_0x4e1265(0x18e)}));}export async function resolveGitRepository(_0x5e4cb3,_0x52aa22,_0x479e59){const _0x2c8313=_0x5af3e3,_0x1e37f1=await realpath(_0x5e4cb3);if(_0x52aa22[_0x2c8313(0x1c9)]===-0xf9*-0x17+0x1421*0x1+-0x2a80)return _0x1e37f1;if(_0x52aa22[_0x2c8313(0x201)]('\x00')||_0x52aa22[_0x2c8313(0x1bf)]('/')||_0x52aa22[_0x2c8313(0x1bf)]('\x5c')||_0x52aa22[_0x2c8313(0x23b)]('/')[_0x2c8313(0x1f1)](_0x28f245=>_0x28f245[_0x2c8313(0x1c9)]===0x15f+0x1*-0xde5+-0x7*-0x1ca||_0x28f245==='.'||_0x28f245==='..'))throw new Error(_0x2c8313(0x1a6));try{const _0x707ece=resolve(_0x1e37f1,_0x52aa22),_0x1dab39=await realpath(_0x707ece);if(normalizeWorkspacePath(_0x707ece)!==normalizeWorkspacePath(_0x1dab39)||!isWithinAllowedRoot(_0x1dab39,[_0x1e37f1]))throw new Error(_0x2c8313(0x245));if(_0x479e59!==undefined){if(!_0x479e59[_0x2c8313(0x201)](_0x52aa22))throw new Error(_0x2c8313(0x245));return _0x1dab39;}return await assertGitSuperprojectChain(_0x1e37f1,_0x1dab39),_0x1dab39;}catch{throw new Error(_0x2c8313(0x1a6));}}export async function resolveGitRepositoryTarget(_0x2ac78e,_0x34d4f1,_0x19a82b,_0x506a2b){const _0x2a5a4b=_0x5af3e3;if(_0x19a82b===undefined)return resolveGitRepository(_0x2ac78e,_0x34d4f1,_0x506a2b);if(_0x34d4f1[_0x2a5a4b(0x1c9)]!==-0x22a0+-0x1*0x21d3+-0x213*-0x21||_0x19a82b[_0x2a5a4b(0x1c9)]===-0x1*-0x25cf+-0x1ce*-0xf+-0x11*0x3d1||_0x19a82b[_0x2a5a4b(0x1c9)]>0x1*-0x254e+-0x1d0e+0x525c||_0x19a82b[_0x2a5a4b(0x201)]('\x00'))throw new Error(_0x2a5a4b(0x1a6));const _0x4c1777=normalizeWorkspacePath(_0x19a82b),_0x49c11c=await listGitWorktrees(_0x2ac78e),_0x38af2b=_0x49c11c[_0x2a5a4b(0x1d2)][_0x2a5a4b(0x1d4)](_0x199d35=>normalizeWorkspacePath(_0x199d35[_0x2a5a4b(0x266)])===_0x4c1777);if(_0x38af2b===undefined||_0x38af2b[_0x2a5a4b(0x22f)])throw new Error(_0x2a5a4b(0x1a6));try{return await realpath(_0x38af2b[_0x2a5a4b(0x266)]);}catch{throw new Error(_0x2a5a4b(0x1a6));}}function _0xd6ca(_0x408586,_0x58e472){_0x408586=_0x408586-(-0xb3*-0x1f+0x12*-0x49+-0xf0a);const _0x258d3a=_0x585a();let _0x29116e=_0x258d3a[_0x408586];if(_0xd6ca['UKmHDG']===undefined){var _0x137ed5=function(_0x365991){const _0x3417bf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x267b3a='',_0x38e532='';for(let _0x52b492=0x2*-0xc11+0xab8+-0xca*-0x11,_0x86aabf,_0x4b4d4d,_0x1078bd=-0x936*-0x1+-0x1c78*0x1+0x1342;_0x4b4d4d=_0x365991['charAt'](_0x1078bd++);~_0x4b4d4d&&(_0x86aabf=_0x52b492%(-0x1d75+-0x51d*-0x7+0x329*-0x2)?_0x86aabf*(0x4*0x79f+-0x5*0x691+0x299)+_0x4b4d4d:_0x4b4d4d,_0x52b492++%(0x2048+-0x114a+-0x4fe*0x3))?_0x267b3a+=String['fromCharCode'](-0x93*0x24+0x1c1*0x5+0xce6&_0x86aabf>>(-(0x9a7+-0x240e+-0x1a69*-0x1)*_0x52b492&-0x21ee+0x1947+-0x8ad*-0x1)):0x109*-0x4+-0x67*-0x43+-0x3b*0x63){_0x4b4d4d=_0x3417bf['indexOf'](_0x4b4d4d);}for(let _0x43d5ff=-0x1445+-0x2*-0xc7+0x63d*0x3,_0xf32c6b=_0x267b3a['length'];_0x43d5ff<_0xf32c6b;_0x43d5ff++){_0x38e532+='%'+('00'+_0x267b3a['charCodeAt'](_0x43d5ff)['toString'](-0xbbc+0xfb8+-0x1f6*0x2))['slice'](-(-0xa67*-0x1+-0x19*0x10c+0xfc7));}return decodeURIComponent(_0x38e532);};_0xd6ca['RdYmne']=_0x137ed5,_0xd6ca['uYchDQ']={},_0xd6ca['UKmHDG']=!![];}const _0x3b88cd=_0x258d3a[-0x6*0x70+-0x1*0x67+0x9b*0x5];_0xd6ca['lhohpv']!==_0x3b88cd&&(_0xd6ca['uYchDQ']={},_0xd6ca['lhohpv']=_0x3b88cd);const _0x5b932c=_0xd6ca['uYchDQ'][_0x408586];return _0x5b932c===undefined?(_0x29116e=_0xd6ca['RdYmne'](_0x29116e),_0xd6ca['uYchDQ'][_0x408586]=_0x29116e):_0x29116e=_0x5b932c,_0x29116e;}async function assertGitSuperprojectChain(_0x21eaec,_0x19b852){const _0x23bd92=_0x5af3e3,_0x497a2b=normalizeWorkspacePath(_0x21eaec);let _0x42c8d5=_0x19b852;const _0x1d07ca=new Set();for(let _0x2d77a5=-0x25f0+-0x2*0xc7a+0x3ee4;_0x2d77a5<0x18eb+0x13a5+-0x1628*0x2;_0x2d77a5+=-0x1*-0x8ef+-0xcd7*0x1+-0x4d*-0xd){const _0x18a842=normalizeWorkspacePath(_0x42c8d5);if(_0x18a842===_0x497a2b)return;if(_0x1d07ca[_0x23bd92(0x1ed)](_0x18a842))throw new Error(_0x23bd92(0x245));_0x1d07ca[_0x23bd92(0x1a8)](_0x18a842);const _0x509bd5=await runReadOnlyGit(_0x42c8d5,[_0x23bd92(0x270),_0x23bd92(0x276),_0x23bd92(0x2a6)]),[_0x363eaf,_0x2954bc]=_0x509bd5[_0x23bd92(0x236)][_0x23bd92(0x23b)](/\r?\n/);if(_0x363eaf===undefined||_0x2954bc===undefined||_0x2954bc[_0x23bd92(0x1c9)]===-0x1efe+0x919*0x1+0x15e5)throw new Error(_0x23bd92(0x245));const _0x188d19=await realpath(_0x363eaf),_0x530e0e=await realpath(_0x2954bc);if(normalizeWorkspacePath(_0x188d19)!==_0x18a842||normalizeWorkspacePath(_0x530e0e)===_0x18a842||!isWithinAllowedRoot(_0x530e0e,[_0x21eaec])||!isWithinAllowedRoot(_0x42c8d5,[_0x530e0e]))throw new Error(_0x23bd92(0x245));_0x42c8d5=_0x530e0e;}throw new Error(_0x23bd92(0x245));}export async function listGitHistoryRefs(_0x4d03ff){const _0x360fb2=_0x5af3e3,_0x1020f6=await runReadOnlyGit(_0x4d03ff,[_0x360fb2(0x1f3),_0x360fb2(0x210),_0x360fb2(0x2bb),_0x360fb2(0x18f)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x1020f6[_0x360fb2(0x236)][_0x360fb2(0x23b)](/\r?\n/)[_0x360fb2(0x25b)](_0x20470f=>{const _0x182315=_0x360fb2,[_0x3b3030,_0x1fcec7,_0x3256db,_0x190a9c,_0x471c60]=_0x20470f[_0x182315(0x23b)]('\x09');if(_0x3b3030===undefined||_0x1fcec7===undefined||_0x3256db===undefined||_0x471c60===undefined||_0x471c60[_0x182315(0x1c9)]>0xa4a+-0xe62+-0x83*-0x8||!/^[0-9a-f]{40,64}$/[_0x182315(0x1e6)](_0x3256db))return[];const _0x5ef375=_0x3b3030[_0x182315(0x1bf)](_0x182315(0x1ea))?_0x182315(0x189):_0x3b3030[_0x182315(0x1bf)](_0x182315(0x1e2))?_0x182315(0x2b3):undefined;return _0x5ef375===undefined?[]:[{'name':_0x3b3030,'displayName':_0x1fcec7,'kind':_0x5ef375,'hash':_0x3256db,'current':_0x190a9c==='*'}];})[_0x360fb2(0x272)]((_0x41e51b,_0x157ddd)=>_0x41e51b[_0x360fb2(0x1b1)][_0x360fb2(0x24d)](_0x157ddd[_0x360fb2(0x1b1)])||_0x41e51b[_0x360fb2(0x1e8)][_0x360fb2(0x24d)](_0x157ddd[_0x360fb2(0x1e8)]));}function selectedHistoryRefs(_0xd48114,_0x50d870){const _0x486467=_0x5af3e3;if(_0x50d870===undefined||_0x50d870[_0x486467(0x1c9)]===0x1a*0x2f+0x2*-0x802+-0x2*-0x59f)return _0xd48114;const _0x689489=[...new Set(_0x50d870)],_0x207910=_0x689489[_0x486467(0x1cc)](_0x16c5d2=>_0xd48114[_0x486467(0x1d4)](_0x1c450b=>_0x1c450b[_0x486467(0x28e)]===_0x16c5d2));if(_0x207910[_0x486467(0x1f1)](_0x246367=>_0x246367===undefined))throw new Error(_0x486467(0x2a0));return _0x207910;}function historyCursor(_0x29f639,_0x2a89d3){const _0x343b09=_0x5af3e3;return Buffer[_0x343b09(0x27d)](JSON[_0x343b09(0x2a5)]({'offset':_0x29f639,'fingerprint':_0x2a89d3}))[_0x343b09(0x230)](_0x343b09(0x206));}function parseHistoryCursor(_0x41aa9d,_0x3f6a51){const _0x14eeda=_0x5af3e3;if(_0x41aa9d===undefined)return-0x26*0xb3+0x1*-0x1582+0x1*0x3014;try{const _0x329288=JSON[_0x14eeda(0x182)](Buffer[_0x14eeda(0x27d)](_0x41aa9d,_0x14eeda(0x206))[_0x14eeda(0x230)](_0x14eeda(0x250)));if(!Number[_0x14eeda(0x22b)](_0x329288[_0x14eeda(0x212)])||_0x329288[_0x14eeda(0x212)]<-0x61d*0x3+-0x129e+0x24f5||_0x329288[_0x14eeda(0x1fc)]!==_0x3f6a51)throw new Error(_0x14eeda(0x245));return _0x329288[_0x14eeda(0x212)];}catch{throw new Error(_0x14eeda(0x1ef));}}export async function readGitHistory(_0x5603be,_0x845efa){const _0x182b0e=_0x5af3e3,_0x5c09d6=await listGitHistoryRefs(_0x5603be),_0x42c9e7=selectedHistoryRefs(_0x5c09d6,_0x845efa[_0x182b0e(0x26e)]);if(_0x42c9e7[_0x182b0e(0x1c9)]===0xcd6+-0x9f*-0x25+-0x23d1*0x1)return{'commits':[],'nextCursor':null};const _0x16fca0=_0x845efa[_0x182b0e(0x257)]??-0x3c9*-0x3+0x3*-0x845+0x6d3*0x2;if(!Number[_0x182b0e(0x22b)](_0x16fca0)||_0x16fca0<0x10d*-0x15+-0x351+0x1963||_0x16fca0>0x133a*-0x2+0xf9*0x10+0x1748*0x1)throw new Error(_0x182b0e(0x1e0));const _0x1a4a8e=_0x42c9e7[_0x182b0e(0x1cc)](_0x20258c=>_0x20258c[_0x182b0e(0x28e)])[_0x182b0e(0x272)](),_0x34886e=_0x845efa[_0x182b0e(0x26e)]===undefined||_0x845efa[_0x182b0e(0x26e)][_0x182b0e(0x1c9)]===-0x1762+-0x150f+0x2c71||_0x42c9e7[_0x182b0e(0x1c9)]===_0x5c09d6[_0x182b0e(0x1c9)]&&_0x42c9e7[_0x182b0e(0x26d)](_0x5a0a0e=>_0x5c09d6[_0x182b0e(0x1f1)](_0x309e91=>_0x309e91[_0x182b0e(0x28e)]===_0x5a0a0e[_0x182b0e(0x28e)])),_0x21c7d3=_0x34886e?[_0x182b0e(0x1a3),_0x182b0e(0x191)]:_0x1a4a8e,_0x122c5c=createHash(_0x182b0e(0x29e))[_0x182b0e(0x253)](_0x42c9e7[_0x182b0e(0x1cc)](_0x2fdf55=>_0x2fdf55[_0x182b0e(0x28e)]+'\x00'+_0x2fdf55[_0x182b0e(0x2a1)])[_0x182b0e(0x272)]()[_0x182b0e(0x1a1)]('\x00'))[_0x182b0e(0x27c)](_0x182b0e(0x284)),_0x42062b=parseHistoryCursor(_0x845efa[_0x182b0e(0x2ba)],_0x122c5c),_0x46332d=await runReadOnlyGit(_0x5603be,[_0x182b0e(0x1a4),_0x182b0e(0x267),_0x182b0e(0x1a0),_0x182b0e(0x239)+_0x42062b,_0x182b0e(0x289)+(_0x16fca0+(0xea3*0x1+-0x3*-0x884+0x8b*-0x4a)),'-z',_0x182b0e(0x1da),..._0x21c7d3,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x4643ba=new Map();for(const _0x4b2916 of _0x5c09d6){const _0x3aae0c=_0x4643ba[_0x182b0e(0x186)](_0x4b2916[_0x182b0e(0x2a1)])??[];_0x3aae0c[_0x182b0e(0x1bb)](_0x4b2916[_0x182b0e(0x1e8)]),_0x4643ba[_0x182b0e(0x1b3)](_0x4b2916[_0x182b0e(0x2a1)],_0x3aae0c);}const _0x3cd7d8=_0x46332d[_0x182b0e(0x236)][_0x182b0e(0x23b)]('\x00'),_0x1fa0da=[];for(let _0x55ed7b=-0x11f0+-0x184*0xb+0x229c;_0x55ed7b+(0x2c2*0x1+-0x6*0xa3+0x1*0x115)<_0x3cd7d8[_0x182b0e(0x1c9)];_0x55ed7b+=0x5da+-0x23e2+0x1e0e){const [_0x44cf85,_0x42229a='',_0xaa2e3b='',_0x2c4f72='',_0x1e3dd4='0',_0x37ac4a='']=_0x3cd7d8[_0x182b0e(0x288)](_0x55ed7b,_0x55ed7b+(0x39*0x90+-0x2f*0xcb+0x53b*0x1));if(_0x44cf85===undefined||!/^[0-9a-f]{40,64}$/[_0x182b0e(0x1e6)](_0x44cf85))continue;_0x1fa0da[_0x182b0e(0x1bb)]({'hash':_0x44cf85,'parents':_0x42229a[_0x182b0e(0x1c9)]===0x9*0x293+-0xee1+-0x84a?[]:_0x42229a[_0x182b0e(0x23b)]('\x20'),'authorName':_0xaa2e3b,'authorEmail':_0x2c4f72,'committedAt':Number(_0x1e3dd4)*(0x2*0x734+-0x89c+-0x1e4),'subject':_0x37ac4a,'refs':_0x4643ba[_0x182b0e(0x186)](_0x44cf85)??[]});}const _0x555b14=_0x1fa0da[_0x182b0e(0x1c9)]>_0x16fca0;return{'commits':_0x1fa0da[_0x182b0e(0x288)](0xa57+0x2661+-0x30b8*0x1,_0x16fca0),'nextCursor':_0x555b14?historyCursor(_0x42062b+_0x16fca0,_0x122c5c):null};}async function assertHistoryCommitReachable(_0x38abd0,_0x320b40,_0xa197f9){const _0x895450=_0x5af3e3;if(!/^[0-9a-f]{40,64}$/[_0x895450(0x1e6)](_0x320b40))throw new Error(_0x895450(0x1f4));const _0x1fa89c=selectedHistoryRefs(await listGitHistoryRefs(_0x38abd0),_0xa197f9);for(const _0x1d3d8e of _0x1fa89c){const _0x2b38a2=await runReadOnlyGitAllowFailure(_0x38abd0,[_0x895450(0x24a),_0x895450(0x279),_0x320b40,_0x1d3d8e[_0x895450(0x28e)]]);if(_0x2b38a2[_0x895450(0x1e1)]===-0x416*0x1+0x2281+-0x1e6b)return;}throw new Error(_0x895450(0x1f4));}export async function readGitHistoryFiles(_0x26258b,_0xe6c67c,_0x53ae3c){const _0x3f67e5=_0x5af3e3;await assertHistoryCommitReachable(_0x26258b,_0xe6c67c,_0x53ae3c);const _0x4c0bdc=await runReadOnlyGit(_0x26258b,[_0x3f67e5(0x1a5),_0x3f67e5(0x18b),_0x3f67e5(0x208),_0x3f67e5(0x1a7),'-r','-z','-M','-C',_0x3f67e5(0x2b1),_0xe6c67c],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x55386c=_0x4c0bdc[_0x3f67e5(0x236)][_0x3f67e5(0x23b)]('\x00'),_0x3484da=[];for(let _0x1a09c0=0x28c*0x4+-0x7*0x15d+0x1*-0xa5;_0x1a09c0<_0x55386c[_0x3f67e5(0x1c9)];_0x1a09c0+=-0x1801*0x1+0x1*-0x2605+0x3e07){const _0x24ab1b=_0x55386c[_0x1a09c0];if(_0x24ab1b===undefined||_0x24ab1b[_0x3f67e5(0x1c9)]===-0x11f*-0xd+-0x8*0x137+-0x4db)continue;const _0x586b1b=_0x24ab1b[-0x4a*0x26+-0x606+0x1102]??'M';if(_0x586b1b==='R'||_0x586b1b==='C'){const _0x55e0af=_0x55386c[_0x1a09c0+(-0x80f*0x2+-0xd00+0x1d1f)],_0x635658=_0x55386c[_0x1a09c0+(0x55e+-0x738+-0x11*-0x1c)];if(_0x55e0af!==undefined&&_0x635658!==undefined)_0x3484da[_0x3f67e5(0x1bb)]({'path':_0x635658,'previousPath':_0x55e0af,'change':gitChange(_0x586b1b)});_0x1a09c0+=-0x1b67*-0x1+0x257b*-0x1+0xa16;}else{const _0x551e88=_0x55386c[_0x1a09c0+(0xcf9+-0x4*0x4ca+0x630)];if(_0x551e88!==undefined)_0x3484da[_0x3f67e5(0x1bb)]({'path':_0x551e88,'change':gitChange(_0x586b1b)});_0x1a09c0+=0x1c6d+-0x7*-0x1c6+0x146b*-0x2;}}return _0x3484da;}export async function readGitHistoryFileDiff(_0xa68a3a,_0x93eca8,_0x89398f,_0x411f14,_0x278686){const _0x335360=_0x5af3e3;await assertHistoryCommitReachable(_0xa68a3a,_0x93eca8,_0x411f14);const _0x286722=safeGitWorkspacePath(_0x89398f),_0x3347f8=_0x278686===undefined?undefined:safeGitWorkspacePath(_0x278686),_0x4588a0=await runReadOnlyGit(_0xa68a3a,[_0x335360(0x19c),_0x335360(0x275),_0x335360(0x208),_0x335360(0x247),_0x335360(0x264),_0x93eca8,'--',_0x335360(0x2ad)+_0x286722,..._0x3347f8===undefined||_0x3347f8===_0x286722?[]:[_0x335360(0x2ad)+_0x3347f8]]),_0x66c3f6=_0x4588a0[_0x335360(0x262)][_0x335360(0x201)](-0x1d3f*0x1+0x2*-0xddb+0x38f5)||_0x4588a0[_0x335360(0x236)][_0x335360(0x201)](_0x335360(0x1ce));if(_0x66c3f6)return{'binary':!![],'summary':_0x335360(0x240)+createHash(_0x335360(0x29e))[_0x335360(0x253)](_0x4588a0[_0x335360(0x262)])[_0x335360(0x27c)](_0x335360(0x284))+_0x335360(0x1f6)+_0x4588a0[_0x335360(0x262)][_0x335360(0x1c9)],'truncated':_0x4588a0[_0x335360(0x1c2)]};return{'binary':![],'text':_0x4588a0[_0x335360(0x236)],'truncated':_0x4588a0[_0x335360(0x1c2)]};}export async function readGitHistoryFileContentRange(_0x5b1fcd,_0x4ea9bc,_0x13335b,_0x32aa0b,_0x3960ce,_0x537daf){const _0x152b51=_0x5af3e3;if(!Number[_0x152b51(0x20b)](_0x32aa0b)||_0x32aa0b<-0x3e3*0x9+0x649*0x5+0xd*0x46||!Number[_0x152b51(0x20b)](_0x3960ce)||_0x3960ce<-0x5*0x35f+0xb94+0x548||_0x3960ce>(0x8b6+-0x4*0x6ec+0x130e)*(-0x1d*-0xf6+-0x3d2*-0x1+-0x1bb0)*(-0x805+-0x1ae9+0x26ee)||_0x32aa0b+_0x3960ce>(-0x2*-0x776+0x1f91*0x1+-0x2e69)*(0x9*0x407+0xb9b+-0x2bda)*(0x863+-0xba0+-0x11*-0x6d))throw new Error(_0x152b51(0x1b9));await assertHistoryCommitReachable(_0x5b1fcd,_0x4ea9bc,_0x537daf);const _0x4859da=safeGitWorkspacePath(_0x13335b),_0x42c3fc=_0x4ea9bc+':'+_0x4859da,_0x29e68f=await runReadOnlyGit(_0x5b1fcd,[_0x152b51(0x24f),'-s',_0x42c3fc]),_0x5399fe=Number(_0x29e68f[_0x152b51(0x236)][_0x152b51(0x28d)]());if(!Number[_0x152b51(0x20b)](_0x5399fe)||_0x5399fe<0x1*-0x161+-0x18c2+0x1a23||_0x32aa0b>_0x5399fe)throw new Error(_0x152b51(0x1b9));if(_0x32aa0b===_0x5399fe)return{'path':_0x4859da,'size':_0x5399fe,'offset':_0x32aa0b,'contentBase64':'','nextOffset':null};const _0x5a6017=await runReadOnlyGitAllowFailure(_0x5b1fcd,[_0x152b51(0x24f),_0x152b51(0x232),_0x42c3fc],{'outputLimit':_0x32aa0b+_0x3960ce,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0x5a6017[_0x152b51(0x1e1)]!==-0xf4*-0x4+0x1*0x557+0x3*-0x30d)throw new GitCommandError(_0x5a6017[_0x152b51(0x1e1)],_0x5a6017[_0x152b51(0x29b)]);const _0x463c1b=_0x5a6017[_0x152b51(0x262)][_0x152b51(0x273)](_0x32aa0b,Math[_0x152b51(0x25d)](_0x5399fe,_0x32aa0b+_0x3960ce)),_0x3b0547=_0x32aa0b+_0x463c1b[_0x152b51(0x1c9)];return{'path':_0x4859da,'size':_0x5399fe,'offset':_0x32aa0b,'contentBase64':_0x463c1b[_0x152b51(0x230)](_0x152b51(0x24e)),'nextOffset':_0x3b0547<_0x5399fe?_0x3b0547:null};}export async function readCurrentChanges(_0x16a457){const _0x478bc9=_0x5af3e3;return(await readCurrentChangesSummary(_0x16a457))[_0x478bc9(0x241)];}export async function readCurrentChangeDiff(_0x413ea3,_0xb4a14f){const _0x4566cd=_0x5af3e3,_0x2d3b88=safeGitWorkspacePath(_0xb4a14f);await assertCurrentChangePathAccessible(_0x413ea3,_0x2d3b88);const _0x199a4f=await readCurrentChangeGitDiff(_0x413ea3,_0x2d3b88),_0x3bb5e3=await readWorkingTreeText(_0x413ea3,_0x2d3b88),_0x146328=_0x199a4f[_0x4566cd(0x262)][_0x4566cd(0x201)](-0x58d*0x7+-0x249a+-0x8d*-0x89)||_0x199a4f[_0x4566cd(0x236)][_0x4566cd(0x201)](_0x4566cd(0x1ce))||_0x3bb5e3?.[_0x4566cd(0x198)]===!![];if(_0x146328)return{'binary':!![],'summary':_0x4566cd(0x240)+createHash(_0x4566cd(0x29e))[_0x4566cd(0x253)](_0x199a4f[_0x4566cd(0x262)])[_0x4566cd(0x27c)](_0x4566cd(0x284))+_0x4566cd(0x1f6)+_0x199a4f[_0x4566cd(0x262)][_0x4566cd(0x1c9)],'truncated':_0x199a4f[_0x4566cd(0x1c2)]||_0x3bb5e3?.[_0x4566cd(0x1c2)]===!![]};return{'binary':![],'text':_0x199a4f[_0x4566cd(0x236)],'truncated':_0x199a4f[_0x4566cd(0x1c2)]||_0x3bb5e3?.[_0x4566cd(0x1c2)]===!![],'afterText':_0x3bb5e3?.[_0x4566cd(0x236)]??'',..._0x3bb5e3===undefined?{}:{'afterTruncated':_0x3bb5e3[_0x4566cd(0x1c2)]}};}async function readCurrentChangeGitDiff(_0x35a631,_0x376649){const _0x2d618b=_0x5af3e3,_0x40adbf=await runReadOnlyGit(_0x35a631,[_0x2d618b(0x21c),_0x2d618b(0x297),_0x2d618b(0x21b),'-z','--',_0x2d618b(0x2ad)+_0x376649]);if(_0x40adbf[_0x2d618b(0x236)][_0x2d618b(0x23b)]('\x00')[_0x2d618b(0x201)](_0x376649)){const _0x334e66=await runReadOnlyGitAllowFailure(_0x35a631,[_0x2d618b(0x2bc),_0x2d618b(0x207),_0x2d618b(0x247),_0x2d618b(0x264),'--',_0x2d618b(0x2b8),_0x376649]);if(_0x334e66[_0x2d618b(0x1e1)]!==0x2070+0xe*0x14d+-0x32a6&&_0x334e66[_0x2d618b(0x1e1)]!==0x7*0x2fb+0x20e5+0x1a1*-0x21)throw new GitCommandError(_0x334e66[_0x2d618b(0x1e1)],_0x334e66[_0x2d618b(0x29b)]);return _0x334e66;}return runReadOnlyGit(_0x35a631,[_0x2d618b(0x2bc),_0x2d618b(0x247),_0x2d618b(0x264),_0x2d618b(0x193),'--',_0x2d618b(0x2ad)+_0x376649]);}export async function isWorkspaceChangeVisible(_0x10b441,_0x4cd85f){const _0x1cc875=_0x5af3e3;try{return await assertCurrentChangePathAccessible(_0x10b441,safeGitWorkspacePath(_0x4cd85f)),!![];}catch(_0x1c852e){if(_0x1c852e instanceof Error&&(_0x1c852e[_0x1cc875(0x214)]===_0x1cc875(0x1ad)||_0x1c852e[_0x1cc875(0x214)]===_0x1cc875(0x1c4)||_0x1c852e[_0x1cc875(0x214)]===_0x1cc875(0x1e3)))return![];throw _0x1c852e;}}async function assertCurrentChangePathAccessible(_0x3221db,_0x12895b){const _0x19be52=_0x5af3e3,_0x48df83=await realpath(_0x3221db),_0x3b232c=resolve(_0x48df83,_0x12895b),_0x346505=await lstat(_0x3b232c)[_0x19be52(0x263)](_0x5bb14c=>{const _0x22442c=_0x19be52;if(_0x5bb14c[_0x22442c(0x1e1)]===_0x22442c(0x281))return undefined;throw _0x5bb14c;});if(_0x346505===undefined)return;await resolveWorkspaceEntry(_0x48df83,_0x12895b,![]);}async function readWorkingTreeText(_0x4e8068,_0xd9e00b){const _0x5b545c=_0x5af3e3,_0x308664=await realpath(_0x4e8068);let _0x48060d;try{_0x48060d=await resolveWorkspaceEntry(_0x308664,_0xd9e00b,![]);}catch(_0x252471){if(_0x252471 instanceof Error&&_0x252471[_0x5b545c(0x214)]===_0x5b545c(0x1c4))return undefined;throw _0x252471;}const _0x3230d7=await lstat(_0x48060d);if(!_0x3230d7[_0x5b545c(0x1d9)]())return undefined;const _0x56dc48=await readFile(_0x48060d);return diffTextFromBuffer(_0x56dc48,_0x56dc48[_0x5b545c(0x1c9)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0xbfa1a3,_0x4c51df){const _0x479ac3=_0x5af3e3;if(_0xbfa1a3[_0x479ac3(0x201)](0x121*0x13+0xfe1+0x1*-0x2554)||!isValidUtf8(_0xbfa1a3))return{'binary':!![],'truncated':_0x4c51df};let _0x86a4fd=Math[_0x479ac3(0x25d)](_0xbfa1a3[_0x479ac3(0x1c9)],GIT_OUTPUT_LIMIT);while(_0x86a4fd>-0x1*-0xc2f+0x1b2e+-0x275d*0x1&&_0x86a4fd<_0xbfa1a3[_0x479ac3(0x1c9)]&&isUtf8ContinuationByte(_0xbfa1a3[_0x86a4fd]))_0x86a4fd-=-0x1969+0x774+0x11f6;return{'binary':![],'text':_0xbfa1a3[_0x479ac3(0x273)](-0x1*0x23c9+-0x5*0x5f9+0x41a6,_0x86a4fd)[_0x479ac3(0x230)](_0x479ac3(0x250)),'truncated':_0x4c51df};}export async function restoreCurrentChange(_0x372a5e,_0x5b6b34,_0x462751){const _0xef657=_0x5af3e3,_0x347d7d=safeGitWorkspacePath(_0x5b6b34),_0x29be26=_0xef657(0x2ad)+_0x347d7d;if(_0x462751===_0xef657(0x1d6)){const _0x396a4f=await runReadOnlyGit(_0x372a5e,[_0xef657(0x29a),_0xef657(0x23c),'-z',_0xef657(0x25e),'--',_0x29be26]);if(!_0x396a4f[_0xef657(0x236)][_0xef657(0x23b)]('\x00')[_0xef657(0x1f1)](_0x8e9f7b=>_0x8e9f7b[_0xef657(0x1bf)](_0xef657(0x197))&&_0x8e9f7b[_0xef657(0x288)](-0x266+0x2238+-0x1fcf*0x1)===_0x347d7d))throw new Error(_0xef657(0x237));const _0x288215=await realpath(_0x372a5e),_0x1b7c1b=resolve(_0x288215,_0x347d7d),_0x3f8cc7=await lstat(_0x1b7c1b);if(!_0x3f8cc7[_0xef657(0x1d9)]()||_0x3f8cc7[_0xef657(0x1b2)]())throw new Error(_0xef657(0x237));await unlink(_0x1b7c1b);return;}if(_0x462751===_0xef657(0x235)){await runGit(_0x372a5e,[_0xef657(0x2a8),_0xef657(0x22c),'--',_0x29be26]);return;}await runGit(_0x372a5e,[_0xef657(0x2a8),_0xef657(0x1f8),_0xef657(0x234),_0xef657(0x22c),'--',_0x29be26]);}function safeGitWorkspacePath(_0x51837f){const _0x3b22e2=_0x5af3e3;if(_0x51837f[_0x3b22e2(0x1c9)]===-0x361*-0x2+0x729*0x1+-0xdeb||_0x51837f[_0x3b22e2(0x201)]('\x00')||_0x51837f[_0x3b22e2(0x1bf)]('/')||_0x51837f[_0x3b22e2(0x1bf)]('\x5c'))throw new Error(_0x3b22e2(0x1ad));const _0x372a27=_0x51837f[_0x3b22e2(0x231)]('\x5c','/');if(_0x372a27[_0x3b22e2(0x23b)]('/')[_0x3b22e2(0x1f1)](_0x563363=>_0x563363===''||_0x563363==='..'||_0x563363===_0x3b22e2(0x255)))throw new Error(_0x3b22e2(0x1ad));return _0x372a27;}function gitChange(_0x79b508){const _0x5ab68c=_0x5af3e3;if(_0x79b508==='A')return _0x5ab68c(0x294);if(_0x79b508==='D')return _0x5ab68c(0x259);if(_0x79b508==='R')return _0x5ab68c(0x1bc);if(_0x79b508==='C')return _0x5ab68c(0x184);if(_0x79b508==='T')return _0x5ab68c(0x2aa);return _0x5ab68c(0x1e5);}export class GitCommandError extends Error{[_0x5af3e3(0x1e1)];[_0x5af3e3(0x29b)];constructor(_0x3522c0,_0x38dcec){const _0x27ac5e=_0x5af3e3;super(_0x27ac5e(0x23a)),this[_0x27ac5e(0x1e1)]=_0x3522c0,this[_0x27ac5e(0x29b)]=_0x38dcec;}}async function runReadOnlyGit(_0x3d8727,_0x3d6e6a,_0x5b81fb={}){return runGit(_0x3d8727,_0x3d6e6a,{..._0x5b81fb,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0xc6efa3,_0xe6f52c,_0x53b734={}){return runGitAllowFailure(_0xc6efa3,_0xe6f52c,{..._0x53b734,'readOnly':!![]});}async function runGit(_0x3b7ec6,_0xb71a37,_0x770783={}){const _0x542693=_0x5af3e3,_0x400445=await runGitAllowFailure(_0x3b7ec6,_0xb71a37,_0x770783);if(_0x400445[_0x542693(0x1e1)]!==0x3e+-0x210a+0x20cc)throw new GitCommandError(_0x400445[_0x542693(0x1e1)],_0x400445[_0x542693(0x29b)]);return _0x400445;}async function runGitAllowFailure(_0x102faf,_0x50fcc5,_0x123a86={}){return new Promise((_0x3fdd21,_0x4778b9)=>{const _0x2fba73=_0xd6ca,_0x2b35f3=_0x123a86[_0x2fba73(0x1cf)]??GIT_OUTPUT_LIMIT,_0x587cf3=spawn(_0x2fba73(0x1b8),[..._0x50fcc5],{'cwd':_0x102faf,'shell':![],'windowsHide':!![],'stdio':[_0x2fba73(0x248),_0x2fba73(0x1c6),_0x2fba73(0x1c6)],..._0x123a86[_0x2fba73(0x205)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x24549e=[],_0x5d45c2=[];let _0x2f7623=-0xf42+0x1c1e+-0xcdc*0x1,_0x4820b0=-0x2c0*0xa+0x197*0x2+0x1852,_0x18bf33=![];const _0x119f81=setTimeout(()=>{const _0x80ceda=_0x2fba73;if(process[_0x80ceda(0x190)]===_0x80ceda(0x227)){const _0x1be62a=_0x587cf3[_0x80ceda(0x1b5)];if(_0x1be62a===undefined){_0x587cf3[_0x80ceda(0x254)](_0x80ceda(0x22e));return;}void terminateProcessTree({'pid':_0x1be62a,'kill':_0x17ecd9=>_0x587cf3[_0x80ceda(0x254)](_0x17ecd9)},_0x80ceda(0x227))[_0x80ceda(0x263)](()=>{const _0x52127d=_0x80ceda;try{_0x587cf3[_0x52127d(0x254)](_0x52127d(0x22e));}catch{}});return;}_0x587cf3[_0x80ceda(0x254)](_0x80ceda(0x22e));},_0x123a86[_0x2fba73(0x23f)]??GIT_TIMEOUT_MS);_0x587cf3[_0x2fba73(0x1a9)]['on'](_0x2fba73(0x1fd),_0x538b26=>{const _0x3db38f=_0x2fba73,_0x5d73c3=Math[_0x3db38f(0x26c)](0x1*-0x1517+-0x7c*0x47+0x377b,_0x2b35f3-_0x2f7623);if(_0x5d73c3>-0x2c*-0x74+-0x250+-0xbc*0x18){const _0x49743d=_0x538b26[_0x3db38f(0x273)](0x133*-0x5+0x1ed0+-0x1*0x18d1,_0x5d73c3);_0x24549e[_0x3db38f(0x1bb)](_0x49743d),_0x2f7623+=_0x49743d[_0x3db38f(0x1c9)];}_0x18bf33||=_0x538b26[_0x3db38f(0x1c9)]>_0x5d73c3;}),_0x587cf3[_0x2fba73(0x29b)]['on'](_0x2fba73(0x1fd),_0x1fb534=>{const _0x38cc76=_0x2fba73,_0x2f2f02=Math[_0x38cc76(0x26c)](0x6*-0x1+-0x173*-0x4+-0x5c6,-0x22a3+0x1*0x1e79+0x2*0xa15-_0x4820b0);if(_0x2f2f02===0x547+-0x39*0x45+0x2*0x50b)return;const _0x4116e8=_0x1fb534[_0x38cc76(0x273)](-0x1591+-0x49c+0x1a2d,_0x2f2f02);_0x5d45c2[_0x38cc76(0x1bb)](_0x4116e8),_0x4820b0+=_0x4116e8[_0x38cc76(0x1c9)];}),_0x587cf3[_0x2fba73(0x1dc)](_0x2fba73(0x21f),_0x38e4fd=>{clearTimeout(_0x119f81),_0x4778b9(_0x38e4fd);}),_0x587cf3[_0x2fba73(0x1dc)](_0x2fba73(0x28b),_0x59a282=>{const _0x1afb97=_0x2fba73;clearTimeout(_0x119f81);const _0x370fa5=Buffer[_0x1afb97(0x18a)](_0x24549e);_0x3fdd21({'code':_0x59a282??-0x199e+-0x3*0xb82+0x3c25*0x1,'output':_0x370fa5,'text':_0x370fa5[_0x1afb97(0x230)](_0x1afb97(0x250)),'stderr':Buffer[_0x1afb97(0x18a)](_0x5d45c2)[_0x1afb97(0x230)](_0x1afb97(0x250)),'truncated':_0x18bf33});});});}function canRetryGitWorktreeListWithoutNullOutput(_0x49f355){const _0x4eec36=_0x5af3e3;return _0x49f355[_0x4eec36(0x1e1)]===-0x111b+-0x2*0x1294+0x36c4||/(?:unknown|unrecognized|invalid)\s+(?:option|switch).*['"`]?-?z\b/iu[_0x4eec36(0x1e6)](_0x49f355[_0x4eec36(0x29b)]);}function isGitUnavailable(_0x23d554){const _0x19b84b=_0x5af3e3;return _0x23d554 instanceof Error&&_0x19b84b(0x1e1)in _0x23d554&&_0x23d554[_0x19b84b(0x1e1)]===_0x19b84b(0x281);}function summarizeText(_0x25401c){const _0x3bb275=_0x5af3e3;return JSON[_0x3bb275(0x2a5)]({'sha256':createHash(_0x3bb275(0x29e))[_0x3bb275(0x253)](_0x25401c)[_0x3bb275(0x27c)](_0x3bb275(0x284)),'bytes':Buffer[_0x3bb275(0x1df)](_0x25401c)});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.57",
3
+ "version": "0.9.59",
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.57",
29
- "@myagentroam/protocol": "^0.9.57"
28
+ "@myagentroam/agent": "^0.9.59",
29
+ "@myagentroam/protocol": "^0.9.59"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ws": "^8.18.1"