@myagentroam/node 0.9.41 → 0.9.43
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/runner/mar-agent/hosted-conversation-runtime.js +1 -1
- package/dist/service/conversation-template-node-service.js +1 -1
- package/dist/service/hosted-conversation-node-service.js +1 -1
- package/dist/service/hosted-conversation-store.js +1 -1
- package/dist/workspace.js +1 -1
- package/package.json +3 -3
package/dist/workspace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* mar-release-protected */
|
|
2
|
-
const _0x4148b8=_0x2b8d;(function(_0x37738c,_0x924051){const _0x261eab=_0x2b8d,_0xb4e37c=_0x37738c();while(!![]){try{const _0x23094b=parseInt(_0x261eab(0x213))/(0x641*-0x1+-0x52d+-0x1*-0xb6f)+-parseInt(_0x261eab(0x20f))/(-0x88*0x16+-0x1d43+0xf*0x2bb)+parseInt(_0x261eab(0x14a))/(-0xfc1+-0xd5*-0x18+-0x1*0x434)+parseInt(_0x261eab(0x1e9))/(-0x26d1+-0x271*0x5+0x330a)*(parseInt(_0x261eab(0x185))/(0xb21+0x1c6d*-0x1+0x1151))+parseInt(_0x261eab(0x25c))/(-0x632*0x1+-0xc6*0x4+-0x95*-0x10)+-parseInt(_0x261eab(0x13f))/(0x1acd*0x1+-0x25f9+0x1*0xb33)*(-parseInt(_0x261eab(0x235))/(-0x2a*0x81+0x2604+-0x10d2))+-parseInt(_0x261eab(0x1b1))/(-0x2*-0xd86+-0xa1*0x30+0x32d);if(_0x23094b===_0x924051)break;else _0xb4e37c['push'](_0xb4e37c['shift']());}catch(_0x499a25){_0xb4e37c['push'](_0xb4e37c['shift']());}}}(_0x5465,-0xca9f*-0xa+-0x5*-0x14338+-0x459e3));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 _0x223f26}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=0x89c*-0x1+0x22d6+-0x2*0x359,GIT_STATUS_TIMEOUT_MS=-0x3b80+0x4eb0*0x2+0x1350,GIT_HISTORY_TIMEOUT_MS=-0x7bb*-0x2+-0xc2*0x74+0x830a,GIT_OUTPUT_LIMIT=(0x25a8+-0x10d7*-0x1+-0x347f*0x1)*(-0x1*0x2c5+0x1*-0x14c2+0x1b87),GIT_LARGE_OUTPUT_LIMIT=(0x224e+-0x248c+-0x2*-0x123)*(-0x233+0x10f*0x4+0x1f7)*(-0x521+-0x2*0xcec+0x22f9),FILE_READ_LIMIT=(0x3*0x547+-0x1d24+0xf4f*0x1)*(-0x199+0x1*-0x21a1+-0x1*-0x273a),DIRECTORY_PAGE_LIMIT=0x5*0x4e7+-0x1*-0x19a8+0x10d*-0x2f,DIRECTORY_PICKER_LIMIT=-0x5e6+-0x67b+-0xd29*-0x1,SEARCH_RESULT_LIMIT=0xaf9*0x2+-0xb2*0x1+-0x1478,GIT_WORKTREE_LIST_LIMIT=0xe5*0x16+-0x1272+-0xbc,FILE_INDEX_IDLE_TTL_MS=(0x10e9+-0x242e+0x1*0x1381)*(0x101b+-0xdf5*0x2+0xc0b*0x1)*(-0x27*0xf7+-0x19*0x4b+0x30dc),FILE_INDEX_FRESHNESS_TTL_MS=-0x26f*0xb+-0xcf70+-0xb5*-0x1f1,FILE_INDEX_ENTRY_LIMIT=0x29ae3+-0xca8a*-0x2+-0x2a957,FILE_INDEX_METADATA_CONCURRENCY=0x48*-0x2f+0x11d0+-0x478,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x4148b8(0x16d),_0x4148b8(0x13e),_0x4148b8(0x245),_0x4148b8(0x16f),_0x4148b8(0x189),_0x4148b8(0x1ee),_0x4148b8(0x232),_0x4148b8(0x14e),_0x4148b8(0x15c),_0x4148b8(0x1ef),_0x4148b8(0x175),_0x4148b8(0x190),_0x4148b8(0x236),_0x4148b8(0x228),_0x4148b8(0x1f0),_0x4148b8(0x227),_0x4148b8(0x22c),_0x4148b8(0x241),_0x4148b8(0x1ad),_0x4148b8(0x147),_0x4148b8(0x1e6),_0x4148b8(0x246),_0x4148b8(0x1bb),_0x4148b8(0x1a5),_0x4148b8(0x222)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x468a75,_0xc0f836,_0x2391d0){const _0x5afb93=_0x4148b8,_0x52ee5f=_0xc0f836[_0x5afb93(0x23b)]();if(_0x52ee5f[_0x5afb93(0x25d)]===-0xb*-0x200+0x15c6+-0x2bc6||_0x52ee5f[_0x5afb93(0x25d)]>-0x1a62+-0x116b+0x2ccc||_0x52ee5f==='.'||_0x52ee5f==='..'||_0x52ee5f[_0x5afb93(0x215)]('/')||_0x52ee5f[_0x5afb93(0x215)]('\x5c')||_0x52ee5f[_0x5afb93(0x215)]('\x00'))throw new Error(_0x5afb93(0x162));const _0x473c57=await Promise[_0x5afb93(0x1fc)](_0x2391d0[_0x5afb93(0x1ca)](_0x3653e7=>realpath(_0x3653e7))),_0x6e8bfc=await realpath(_0x468a75)[_0x5afb93(0x18a)](()=>{const _0x21044a=_0x5afb93;throw new Error(_0x21044a(0x1a8));}),_0x2c726e=await stat(_0x6e8bfc)[_0x5afb93(0x18a)](()=>undefined);if(_0x2c726e?.[_0x5afb93(0x1c1)]()!==!![]||!isWithinAllowedRoot(_0x6e8bfc,_0x473c57))throw new Error(_0x5afb93(0x1a8));const _0x454a8f=resolve(_0x6e8bfc,_0x52ee5f);if(dirname(_0x454a8f)!==_0x6e8bfc||!isWithinAllowedRoot(_0x454a8f,_0x473c57))throw new Error(_0x5afb93(0x162));try{await mkdir(_0x454a8f);}catch(_0x39b145){if(_0x39b145[_0x5afb93(0x14d)]===_0x5afb93(0x21f))throw new Error(_0x5afb93(0x149));throw _0x39b145;}return _0x454a8f;}export class WorkspaceFileIndex{[_0x4148b8(0x24f)];[_0x4148b8(0x13a)];[_0x4148b8(0x195)]=[];[_0x4148b8(0x1ae)]=![];[_0x4148b8(0x1ec)];[_0x4148b8(0x192)];[_0x4148b8(0x1be)]=!![];[_0x4148b8(0x199)];[_0x4148b8(0x17a)]=-0xf23*0x1+-0x37d*-0x2+0x829;[_0x4148b8(0x1a0)]=-0x2075*0x1+-0x1*-0x5d1+-0x5*-0x554;constructor(_0x2d45ae,_0x54dc36={}){const _0x536c65=_0x4148b8;this[_0x536c65(0x24f)]=_0x2d45ae,this[_0x536c65(0x13a)]=_0x54dc36;}async[_0x4148b8(0x218)](){const _0x2867b7=_0x4148b8;return await this[_0x2867b7(0x25f)](),this[_0x2867b7(0x1cb)](),{'entries':this[_0x2867b7(0x195)][_0x2867b7(0x186)](_0x52bbae=>_0x52bbae[_0x2867b7(0x16c)]===_0x2867b7(0x21c)),'truncated':this[_0x2867b7(0x1ae)]};}[_0x4148b8(0x180)](){const _0x375824=_0x4148b8;if(this[_0x375824(0x199)]!==undefined)clearTimeout(this[_0x375824(0x199)]);this[_0x375824(0x199)]=undefined,this[_0x375824(0x195)]=[],this[_0x375824(0x1ae)]=![],this[_0x375824(0x1be)]=!![],this[_0x375824(0x17a)]=0xcc+-0x14b8+0x13ec,this[_0x375824(0x1a0)]=-0x291*-0x1+0x8*0x2b7+-0x1849*0x1;}async[_0x4148b8(0x1e0)](_0x4d3d4d,_0x14e83e,_0x5163b3=SEARCH_RESULT_LIMIT,_0x263c57=![]){const _0x4f3a65=_0x4148b8;if(_0x4d3d4d[_0x4f3a65(0x23b)]()[_0x4f3a65(0x25d)]===-0x259b+0x4*-0x7bd+0x448f*0x1||_0x4d3d4d[_0x4f3a65(0x25d)]>-0x15b6+0x3d*0x7b+-0x699||!Number[_0x4f3a65(0x1bc)](_0x5163b3)||_0x5163b3<0x15c*0x7+0x281+-0xc04||_0x5163b3>SEARCH_RESULT_LIMIT)throw new Error(_0x4f3a65(0x1e5));await this[_0x4f3a65(0x25f)](),this[_0x4f3a65(0x1cb)]();const _0xde32f4=decodeSearchCursor(_0x14e83e,_0x4d3d4d),_0x15e5d5=_0xde32f4===undefined?undefined:this[_0x4f3a65(0x195)][_0x4f3a65(0x22e)](_0x5be700=>_0x5be700[_0x4f3a65(0x250)]===_0xde32f4&&(_0x263c57||_0x5be700[_0x4f3a65(0x16c)]===_0x4f3a65(0x21c))),_0x212ee2=_0x15e5d5===undefined?-(0x14b3+-0x1612+0x160):fuzzyPathScore(_0x15e5d5[_0x4f3a65(0x250)],_0x4d3d4d),_0xcc82c8=_0x15e5d5===undefined||_0x212ee2<-0x106a+-0x656*0x6+0x366e?undefined:{'entry':_0x15e5d5,'score':_0x212ee2},_0x5a32ff=new RankedCandidateHeap(_0x5163b3+(-0x9*0x1+0x1b2a+-0x1b20));for(const _0x32db64 of this[_0x4f3a65(0x195)]){if(!_0x263c57&&_0x32db64[_0x4f3a65(0x16c)]!==_0x4f3a65(0x21c))continue;const _0x3da148=fuzzyPathScore(_0x32db64[_0x4f3a65(0x250)],_0x4d3d4d);if(_0x3da148<0x4*-0x4eb+0x1d20+-0x974)continue;const _0x38aade={'entry':_0x32db64,'score':_0x3da148};if(_0xcc82c8!==undefined&&compareRankedCandidate(_0x38aade,_0xcc82c8)<=0x7*-0x51b+0x7ac+0x1c11)continue;_0x5a32ff[_0x4f3a65(0x164)](_0x38aade);}const _0x363bb9=_0x5a32ff[_0x4f3a65(0x230)](),_0x4cc99e=_0x363bb9[_0x4f3a65(0x20c)](-0x16a2*0x1+0x97d+0x2a1*0x5,_0x5163b3)[_0x4f3a65(0x1ca)](_0x49c17c=>_0x49c17c[_0x4f3a65(0x1f8)]),_0x20f9d0=_0x363bb9[_0x5163b3]?.[_0x4f3a65(0x1f8)][_0x4f3a65(0x250)];return{'entries':_0x4cc99e,'nextCursor':_0x20f9d0===undefined?null:encodeSearchCursor(_0x4d3d4d,_0x4cc99e['at'](-(0x1a6*-0x9+-0x1b5f+0x2a36))?.[_0x4f3a65(0x250)]??_0xde32f4??''),'truncated':_0x20f9d0!==undefined||this[_0x4f3a65(0x1ae)]};}async[_0x4148b8(0x25f)](){const _0x2ef192=_0x4148b8;if(!this[_0x2ef192(0x1be)]&&this[_0x2ef192(0x1ec)]!==undefined){if(Date[_0x2ef192(0x1ab)]()-this[_0x2ef192(0x1a0)]>=(this[_0x2ef192(0x13a)][_0x2ef192(0x1a1)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x2ef192(0x1f9)]();return;}this[_0x2ef192(0x192)]===undefined&&(this[_0x2ef192(0x192)]=this[_0x2ef192(0x1d5)]()[_0x2ef192(0x143)](()=>{const _0x55cdec=_0x2ef192;this[_0x55cdec(0x192)]=undefined;})),await this[_0x2ef192(0x192)];}[_0x4148b8(0x1cb)](){const _0x17a2b7=_0x4148b8;if(this[_0x17a2b7(0x199)]!==undefined)clearTimeout(this[_0x17a2b7(0x199)]);this[_0x17a2b7(0x199)]=setTimeout(()=>this[_0x17a2b7(0x180)](),this[_0x17a2b7(0x13a)][_0x17a2b7(0x1bd)]??FILE_INDEX_IDLE_TTL_MS),this[_0x17a2b7(0x199)][_0x17a2b7(0x1e1)]();}async[_0x4148b8(0x1d5)](){const _0x5e6b10=_0x4148b8,_0x238382=await resolveRegisteredWorkspaceRoot(this[_0x5e6b10(0x24f)]),_0x12f739=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x238382)],_0x3797cb=[],_0x4a7742=this[_0x5e6b10(0x13a)][_0x5e6b10(0x1a4)]??FILE_INDEX_ENTRY_LIMIT;let _0x211a5c=![];const _0x1a87a9=['.'];let _0x2c18a3=0x1*0x1b33+0x17ee+-0x3321;while(_0x2c18a3<_0x1a87a9[_0x5e6b10(0x25d)]&&!_0x211a5c){const _0x45df06=_0x1a87a9[_0x2c18a3];_0x2c18a3+=-0x1*0x2025+-0x2535+0x455b*0x1;const _0x3b870b=await resolveWorkspaceEntryFromCanonicalRoot(_0x238382,_0x45df06,!![])[_0x5e6b10(0x18a)](()=>undefined);if(_0x3b870b===undefined)continue;const _0x43997c=await opendir(_0x3b870b)[_0x5e6b10(0x18a)](()=>undefined);if(_0x43997c===undefined)continue;let _0xe7de0f=[];const _0xbdff20=async()=>{const _0x233a8d=_0x5e6b10,_0x119f38=await Promise[_0x233a8d(0x1fc)](_0xe7de0f);_0xe7de0f=[];for(const _0x1907d2 of _0x119f38){if(_0x1907d2===undefined)continue;if(_0x1907d2[_0x233a8d(0x250)]===_0x233a8d(0x216)||_0x1907d2[_0x233a8d(0x250)][_0x233a8d(0x1af)](_0x233a8d(0x240))||isExcluded(_0x1907d2[_0x233a8d(0x250)],_0x12f739))continue;if(_0x1907d2[_0x233a8d(0x16c)]===_0x233a8d(0x1e7))_0x1a87a9[_0x233a8d(0x17f)](_0x1907d2[_0x233a8d(0x250)]);_0x3797cb[_0x233a8d(0x17f)](_0x1907d2);if(_0x3797cb[_0x233a8d(0x25d)]>=_0x4a7742){_0x211a5c=!![];break;}}};for await(const _0x46ada4 of _0x43997c){const _0x588bbf=_0x45df06==='.'?_0x46ada4[_0x5e6b10(0x151)]:posix[_0x5e6b10(0x188)](_0x45df06[_0x5e6b10(0x191)]('\x5c','/'),_0x46ada4[_0x5e6b10(0x151)]);if(_0x588bbf===_0x5e6b10(0x216)||_0x588bbf[_0x5e6b10(0x1af)](_0x5e6b10(0x240))||isExcluded(_0x588bbf,_0x12f739))continue;_0xe7de0f[_0x5e6b10(0x17f)](inspectWorkspaceIndexEntry(_0x238382,_0x588bbf,_0x46ada4[_0x5e6b10(0x151)]));if(_0xe7de0f[_0x5e6b10(0x25d)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0xbdff20();if(_0x211a5c)break;}if(!_0x211a5c&&_0xe7de0f[_0x5e6b10(0x25d)]>-0xe3*-0x5+0x741+-0xbb0)await _0xbdff20();}this[_0x5e6b10(0x1ec)]=_0x238382,this[_0x5e6b10(0x195)]=_0x3797cb,this[_0x5e6b10(0x1ae)]=_0x211a5c,this[_0x5e6b10(0x1be)]=![],this[_0x5e6b10(0x17a)]=Date[_0x5e6b10(0x1ab)](),this[_0x5e6b10(0x1a0)]=this[_0x5e6b10(0x17a)];}[_0x4148b8(0x1f9)](){const _0x185c16=_0x4148b8;if(this[_0x185c16(0x192)]!==undefined)return;this[_0x185c16(0x1a0)]=Date[_0x185c16(0x1ab)](),this[_0x185c16(0x192)]=this[_0x185c16(0x1d5)]()[_0x185c16(0x18a)](()=>undefined)[_0x185c16(0x143)](()=>{const _0x149991=_0x185c16;this[_0x149991(0x192)]=undefined;});}}async function workspaceExcludePatterns(_0x12b71e){const _0xa1941c=_0x4148b8,_0x2514f1=resolve(_0x12b71e,_0xa1941c(0x19e)),_0x3e566f=await readFile(_0x2514f1,_0xa1941c(0x19b))[_0xa1941c(0x207)](JSON[_0xa1941c(0x144)])[_0xa1941c(0x18a)](()=>undefined);if(typeof _0x3e566f!==_0xa1941c(0x1db)||_0x3e566f===null)return[];return[_0xa1941c(0x226),_0xa1941c(0x18b)][_0xa1941c(0x24a)](_0x544fd1=>{const _0x27478a=_0xa1941c,_0x159478=_0x3e566f[_0x544fd1];return typeof _0x159478===_0x27478a(0x1db)&&_0x159478!==null?Object[_0x27478a(0x195)](_0x159478)[_0x27478a(0x24a)](([_0x589468,_0x33225f])=>_0x33225f===!![]?[_0x589468]:[]):[];});}function isExcluded(_0x5ed799,_0x683e96){const _0x2db8f3=_0x4148b8;return _0x683e96[_0x2db8f3(0x140)](_0x5ea217=>minimatch(_0x5ed799,_0x5ea217,{'dot':!![],'nocase':_0x223f26()!==_0x2db8f3(0x1c3)})||minimatch(_0x5ed799+'/',_0x5ea217,{'dot':!![],'nocase':_0x223f26()!==_0x2db8f3(0x1c3)}));}function compareRankedCandidate(_0x39ebed,_0x1888ff){const _0x5a7935=_0x4148b8;return _0x1888ff[_0x5a7935(0x231)]-_0x39ebed[_0x5a7935(0x231)]||_0x39ebed[_0x5a7935(0x1f8)][_0x5a7935(0x250)][_0x5a7935(0x198)](_0x1888ff[_0x5a7935(0x1f8)][_0x5a7935(0x250)]);}class RankedCandidateHeap{[_0x4148b8(0x21b)];[_0x4148b8(0x1d4)]=[];constructor(_0x594921){const _0x1bfb77=_0x4148b8;this[_0x1bfb77(0x21b)]=_0x594921;}[_0x4148b8(0x164)](_0x3ceed7){const _0x61679e=_0x4148b8;if(this[_0x61679e(0x1d4)][_0x61679e(0x25d)]<this[_0x61679e(0x21b)]){this[_0x61679e(0x1d4)][_0x61679e(0x17f)](_0x3ceed7),this[_0x61679e(0x23c)](this[_0x61679e(0x1d4)][_0x61679e(0x25d)]-(0x972+0x2b7*-0xe+-0x67*-0x47));return;}if(compareRankedCandidate(_0x3ceed7,this[_0x61679e(0x1d4)][-0xe3+-0x130f+0x13f2])>=0x6*-0x5c6+0x789*0x5+-0x1*0x309)return;this[_0x61679e(0x1d4)][-0x2377*0x1+0xb7+-0x1160*-0x2]=_0x3ceed7,this[_0x61679e(0x187)](-0x12a*-0x11+0xc8c+0x102b*-0x2);}[_0x4148b8(0x230)](){const _0x5b6bc7=_0x4148b8;return[...this[_0x5b6bc7(0x1d4)]][_0x5b6bc7(0x1fd)](compareRankedCandidate);}[_0x4148b8(0x23c)](_0x167a85){const _0x40509b=_0x4148b8;let _0x300ab7=_0x167a85;while(_0x300ab7>-0x1*0xa47+-0x1*-0x198d+0x2*-0x7a3){const _0x3c4012=Math[_0x40509b(0x212)]((_0x300ab7-(-0x2*0x6e5+-0x20ce+0x2e99))/(-0x1*0x1fbd+0xbed+0x13d2));if(compareRankedCandidate(this[_0x40509b(0x1d4)][_0x300ab7],this[_0x40509b(0x1d4)][_0x3c4012])<=0x3f2*0x1+0xc0a+-0xffc)break;[this[_0x40509b(0x1d4)][_0x300ab7],this[_0x40509b(0x1d4)][_0x3c4012]]=[this[_0x40509b(0x1d4)][_0x3c4012],this[_0x40509b(0x1d4)][_0x300ab7]],_0x300ab7=_0x3c4012;}}[_0x4148b8(0x187)](_0x7a22fb){const _0x4c771c=_0x4148b8;let _0x45b21e=_0x7a22fb;while(!![]){const _0x4303d3=_0x45b21e*(0x185*-0xb+-0x1235+0x22ee*0x1)+(-0x135f+0xc3+0x3b9*0x5);if(_0x4303d3>=this[_0x4c771c(0x1d4)][_0x4c771c(0x25d)])return;const _0x256843=_0x4303d3+(0x235+0x16cc*-0x1+0x1498),_0x5a0841=_0x256843<this[_0x4c771c(0x1d4)][_0x4c771c(0x25d)]&&compareRankedCandidate(this[_0x4c771c(0x1d4)][_0x256843],this[_0x4c771c(0x1d4)][_0x4303d3])>-0x16f8+-0x2*0xfa1+-0x16*-0x277?_0x256843:_0x4303d3;if(compareRankedCandidate(this[_0x4c771c(0x1d4)][_0x5a0841],this[_0x4c771c(0x1d4)][_0x45b21e])<=0xfe0+0x2193+-0x3173)return;[this[_0x4c771c(0x1d4)][_0x45b21e],this[_0x4c771c(0x1d4)][_0x5a0841]]=[this[_0x4c771c(0x1d4)][_0x5a0841],this[_0x4c771c(0x1d4)][_0x45b21e]],_0x45b21e=_0x5a0841;}}}function fuzzyPathScore(_0x2d5680,_0x52c66c){const _0x4ea035=_0x4148b8,_0x57a0bb=_0x2d5680[_0x4ea035(0x1cc)](),_0x59920b=_0x52c66c[_0x4ea035(0x23b)]()[_0x4ea035(0x1cc)]();let _0x4fbb34=0xef3+0x216d+-0x3060,_0x4b7be6=0xd29+-0xa7c+-0x89*0x5,_0x360450=-(-0x253e+-0x258+0x2798*0x1);for(const _0x307dd6 of _0x59920b){const _0x1ec9a8=_0x57a0bb[_0x4ea035(0x14f)](_0x307dd6,_0x4fbb34);if(_0x1ec9a8===-(0x91e+0x2*0x1314+-0x1*0x2f45))return-(-0x139*-0x3+-0x2*0x427+0x4a4);_0x4b7be6+=_0x1ec9a8===_0x360450+(-0x3*-0x4ba+-0x1336*-0x1+-0x1*0x2163)?-0xf35+0x1319+-0x3d8:-0x154a+-0x7*0x47e+0x1*0x34bd;if(_0x1ec9a8===0x6e*-0x29+0x1*0x162+0x1*0x103c||_0x4ea035(0x1fb)[_0x4ea035(0x215)](_0x57a0bb[_0x1ec9a8-(0x225f+-0x222b+-0x33)]??''))_0x4b7be6+=-0x7a7*0x5+0x1*0x1a65+0xbe6;_0x360450=_0x1ec9a8,_0x4fbb34=_0x1ec9a8+(-0x2*-0xb3+-0xde5*0x1+0xc80);}const _0x2e4fa4=_0x2d5680[_0x4ea035(0x20c)](_0x2d5680[_0x4ea035(0x1b2)]('/')+(-0x9b3*0x3+-0x3*-0x922+-0x1b4*-0x1))[_0x4ea035(0x1cc)]();if(_0x2e4fa4[_0x4ea035(0x215)](_0x59920b))_0x4b7be6+=0x1*0x249b+0x395*0x8+-0x411b;else{if(_0x57a0bb[_0x4ea035(0x215)](_0x59920b))_0x4b7be6+=-0xf71+-0x17c0+-0x2741*-0x1;}return _0x4b7be6-_0x2d5680[_0x4ea035(0x25d)]/(0x17ee*-0x1+0xdf3*-0x1+-0x13*-0x233);}export async function listWorkspaceDirectories(_0x39292b,_0x17b71c,_0x10ec0e=homedir()){const _0x1f0655=_0x4148b8,_0x55f1d6=await realpath(_0x10ec0e),_0x1cb5d4=await Promise[_0x1f0655(0x1fc)](_0x17b71c[_0x1f0655(0x1ca)](_0xf833fb=>realpath(_0xf833fb))),_0x3b7200=[...new Set([_0x55f1d6,..._0x1cb5d4])],_0xfe9a1d=_0x39292b===undefined?_0x1cb5d4[0x9a0+-0x1*0x241d+-0x1*-0x1a7d]??_0x55f1d6:await realpath(_0x39292b),_0x220e30=await stat(_0xfe9a1d);if(!_0x220e30[_0x1f0655(0x1c1)]()||!isWithinAllowedRoot(_0xfe9a1d,_0x3b7200))throw new Error(_0x1f0655(0x1a8));const _0x3479cf=await readdir(_0xfe9a1d,{'withFileTypes':!![]}),_0xaf9558=[];for(const _0xb85af4 of _0x3479cf[_0x1f0655(0x1fd)]((_0x2d220f,_0x3f477c)=>_0x2d220f[_0x1f0655(0x151)][_0x1f0655(0x198)](_0x3f477c[_0x1f0655(0x151)]))){if(!_0xb85af4[_0x1f0655(0x1c1)]()&&!_0xb85af4[_0x1f0655(0x19a)]())continue;const _0xb9ddee=await realpath(resolve(_0xfe9a1d,_0xb85af4[_0x1f0655(0x151)]))[_0x1f0655(0x18a)](()=>undefined);if(_0xb9ddee===undefined||!isWithinAllowedRoot(_0xb9ddee,_0x3b7200))continue;const _0x1c22c9=await stat(_0xb9ddee)[_0x1f0655(0x18a)](()=>undefined);if(_0x1c22c9===undefined||!_0x1c22c9[_0x1f0655(0x1c1)]())continue;_0xaf9558[_0x1f0655(0x17f)]({'path':_0xb9ddee,'name':_0xb85af4[_0x1f0655(0x151)],'selectable':isWithinAllowedRoot(_0xb9ddee,_0x1cb5d4)});if(_0xaf9558[_0x1f0655(0x25d)]>DIRECTORY_PICKER_LIMIT)break;}const _0x1cb0cb=dirname(_0xfe9a1d);return{'homePath':_0x55f1d6,'currentPath':_0xfe9a1d,'parentPath':_0x1cb0cb===_0xfe9a1d||!isWithinAllowedRoot(_0x1cb0cb,_0x3b7200)?null:_0x1cb0cb,'browseRoots':_0x1cb5d4,'selectable':isWithinAllowedRoot(_0xfe9a1d,_0x1cb5d4),'entries':_0xaf9558[_0x1f0655(0x20c)](0x1dfe+-0x3*-0x1c7+-0x2353,DIRECTORY_PICKER_LIMIT),'truncated':_0xaf9558[_0x1f0655(0x25d)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x3ec6ae,_0x1967e9='.',_0x342052,_0x3c2dd4=DIRECTORY_PAGE_LIMIT){const _0x338c65=_0x4148b8;if(!Number[_0x338c65(0x1bc)](_0x3c2dd4)||_0x3c2dd4<-0x1*-0x25e1+-0x24bd+0x123*-0x1||_0x3c2dd4>DIRECTORY_PAGE_LIMIT)throw new Error(_0x338c65(0x1b8));const _0x157520=await resolveRegisteredWorkspaceRoot(_0x3ec6ae),_0x43c05b=await resolveWorkspaceEntryFromCanonicalRoot(_0x157520,_0x1967e9,!![]),_0x343e17=await readdir(_0x43c05b,{'withFileTypes':!![]}),_0x51e328=decodeDirectoryCursor(_0x342052,_0x1967e9),_0x4194bb=_0x343e17[_0x338c65(0x186)](_0x4ccac2=>_0x4ccac2[_0x338c65(0x151)]!==_0x338c65(0x216)&&!isWorkspaceUploadTemporaryName(_0x4ccac2[_0x338c65(0x151)]))[_0x338c65(0x1ca)](_0x36941e=>_0x36941e[_0x338c65(0x151)])[_0x338c65(0x1fd)]((_0x1ac65b,_0x45c272)=>_0x1ac65b[_0x338c65(0x198)](_0x45c272)),_0x4b2d06=_0x51e328===undefined?0x3*0x4eb+-0x2360+-0x1*-0x149f:_0x4194bb[_0x338c65(0x1ff)](_0x55deae=>_0x55deae>_0x51e328);if(_0x51e328!==undefined&&_0x4b2d06===-(-0x116e+0x157+-0x2*-0x80c))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x3f4e38=_0x4194bb[_0x338c65(0x20c)](_0x4b2d06,_0x4b2d06+_0x3c2dd4),_0x54b52c=[];for(const _0x18ecab of _0x3f4e38){const _0x23a952=await resolveWorkspaceEntry(_0x157520,relative(_0x157520,resolve(_0x43c05b,_0x18ecab)),![])[_0x338c65(0x18a)](_0x83c482=>{if(isSkippableWorkspaceEntryError(_0x83c482))return undefined;throw _0x83c482;});if(_0x23a952===undefined)continue;const _0x4fdedd=await lstat(_0x23a952)[_0x338c65(0x18a)](_0x5301b7=>{const _0x11e584=_0x338c65;if(_0x5301b7[_0x11e584(0x14d)]===_0x11e584(0x172))return undefined;throw _0x5301b7;});if(_0x4fdedd===undefined||!_0x4fdedd[_0x338c65(0x251)]()&&!_0x4fdedd[_0x338c65(0x1c1)]())continue;_0x54b52c[_0x338c65(0x17f)]({'path':relative(_0x157520,_0x23a952)[_0x338c65(0x1c6)](sep)[_0x338c65(0x188)]('/'),'name':_0x18ecab,'kind':_0x4fdedd[_0x338c65(0x1c1)]()?_0x338c65(0x1e7):_0x338c65(0x21c),'size':_0x4fdedd[_0x338c65(0x251)]()?_0x4fdedd[_0x338c65(0x176)]:null,'modifiedAt':_0x4fdedd[_0x338c65(0x24d)]});}const _0x2c9a45=_0x4194bb[_0x4b2d06+_0x3f4e38[_0x338c65(0x25d)]];return{'entries':_0x54b52c,'nextCursor':_0x2c9a45===undefined||_0x3f4e38[_0x338c65(0x25d)]===0x2045+0x1338+-0x31*0x10d?null:encodeDirectoryCursor(_0x1967e9,_0x3f4e38[_0x3f4e38[_0x338c65(0x25d)]-(0x265d+0x1d8+-0x2834)]),'truncated':_0x2c9a45!==undefined};}export async function mutateWorkspaceFile(_0x146615,_0x3d7848){const _0x31e726=_0x4148b8,_0x4cb2e=await resolveRegisteredWorkspaceRoot(_0x146615);if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x1f3)||_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x148)){const _0x287478=await resolveNewWorkspaceEntry(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x1f3))await writeFile(_0x287478,'',{'flag':'wx'});else await mkdir(_0x287478);return{'path':workspaceRelativePath(_0x4cb2e,_0x287478)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);const _0x12be10=await resolveWorkspaceEntryMetadata(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);if(workspaceRelativePath(_0x4cb2e,_0x12be10[_0x31e726(0x250)])==='.')throw new Error(_0x31e726(0x179));if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x15d))return await rm(_0x12be10[_0x31e726(0x250)],{'recursive':_0x12be10[_0x31e726(0x1f2)][_0x31e726(0x1c1)](),'force':![]}),{'deleted':!![]};const _0x4b0750=await resolveNewWorkspaceEntry(_0x4cb2e,_0x3d7848[_0x31e726(0x1f5)]);if(_0x12be10[_0x31e726(0x1f2)][_0x31e726(0x1c1)]()){const _0xdc8ad4=relative(_0x12be10[_0x31e726(0x250)],_0x4b0750);if(_0xdc8ad4===''||!isAbsolute(_0xdc8ad4)&&_0xdc8ad4!=='..'&&!_0xdc8ad4[_0x31e726(0x1af)]('..'+sep))throw new Error(_0x31e726(0x261));}return await rename(_0x12be10[_0x31e726(0x250)],_0x4b0750),{'path':workspaceRelativePath(_0x4cb2e,_0x4b0750)};}async function resolveNewWorkspaceEntry(_0x124e6f,_0xc7457b){const _0x8a68e7=_0x4148b8,_0x4fd088=_0xc7457b[_0x8a68e7(0x191)]('\x5c','/'),_0x2d5435=_0x4fd088[_0x8a68e7(0x1c6)]('/'),_0xcf091d=_0x2d5435['at'](-(0x10d0+-0x1*0x7ef+-0x10*0x8e));if(_0xc7457b[_0x8a68e7(0x215)]('\x00')||_0x4fd088[_0x8a68e7(0x1af)]('/')||isAbsolute(_0xc7457b)||win32[_0x8a68e7(0x163)](_0x4fd088)||_0xcf091d===undefined||_0xcf091d[_0x8a68e7(0x25d)]===-0x758+0x6da+0x7e*0x1||_0x2d5435[_0x8a68e7(0x140)](invalidWorkspaceMutationSegment))throw new Error(_0x8a68e7(0x13c));const _0x4d3d5b=_0x2d5435[_0x8a68e7(0x25d)]===0x204d+0x9bc+0x434*-0xa?'.':_0x2d5435[_0x8a68e7(0x20c)](-0x1282+-0x1bbf*0x1+0x2e41,-(0x2395+-0xc*-0x1e2+-0x3a2c))[_0x8a68e7(0x188)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x124e6f,_0x4d3d5b);const _0x3ac750=await resolveWorkspaceEntryFromCanonicalRoot(_0x124e6f,_0x4d3d5b,!![]),_0xdfb148=resolve(_0x3ac750,_0xcf091d);try{await lstat(_0xdfb148);throw new Error(_0x8a68e7(0x20a));}catch(_0x1bb006){if(_0x1bb006[_0x8a68e7(0x14d)]!==_0x8a68e7(0x172))throw _0x1bb006;}return _0xdfb148;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x365d48,_0x8aa691){const _0x3e759d=_0x4148b8,_0x1f24ff=_0x8aa691[_0x3e759d(0x191)]('\x5c','/');if(_0x1f24ff==='.')return;const _0x4ee21b=_0x1f24ff[_0x3e759d(0x1c6)]('/');if(_0x8aa691[_0x3e759d(0x215)]('\x00')||_0x1f24ff[_0x3e759d(0x1af)]('/')||isAbsolute(_0x8aa691)||win32[_0x3e759d(0x163)](_0x1f24ff)||_0x4ee21b[_0x3e759d(0x140)](invalidWorkspaceMutationSegment))throw new Error(_0x3e759d(0x13c));let _0x556ffe=_0x365d48;for(const _0x142cb2 of _0x4ee21b){_0x556ffe=resolve(_0x556ffe,_0x142cb2);const _0x342ad6=await lstat(_0x556ffe)[_0x3e759d(0x18a)](_0x77af46=>{const _0x315bcb=_0x3e759d;if(_0x77af46[_0x315bcb(0x14d)]===_0x315bcb(0x172))throw new Error(_0x315bcb(0x1f6));throw _0x77af46;});if(_0x342ad6[_0x3e759d(0x19a)]())throw new Error(_0x3e759d(0x13c));}}function invalidWorkspaceMutationSegment(_0x169aa3){const _0x2b04c2=_0x4148b8;if(_0x169aa3[_0x2b04c2(0x25d)]===0x3d2+0x1*-0x1813+-0x5*-0x40d||_0x169aa3==='.'||_0x169aa3==='..'||_0x169aa3===_0x2b04c2(0x216))return!![];if(_0x223f26()!==_0x2b04c2(0x1f1))return![];const _0x10a881=_0x169aa3[_0x2b04c2(0x1dc)](/[. ]+$/u,'')[_0x2b04c2(0x24e)]();return/[<>:"|?*]/u[_0x2b04c2(0x194)](_0x169aa3)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x2b04c2(0x194)](_0x10a881);}function workspaceRelativePath(_0x3e0f21,_0x118259){const _0x5753bc=_0x4148b8,_0x18f58f=relative(_0x3e0f21,_0x118259)[_0x5753bc(0x1c6)](sep)[_0x5753bc(0x188)]('/');return _0x18f58f[_0x5753bc(0x25d)]===-0x231d+-0x17*-0x53+-0x6*-0x49c?'.':_0x18f58f;}function isSkippableWorkspaceEntryError(_0x54ba39){const _0x43c68c=_0x4148b8;return _0x54ba39 instanceof Error&&(_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x13c)||_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x1f6)||_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x1ba));}export async function preflightWorkspaceUpload(_0x3b4afa,_0x5b3a8a,_0x217b8f){const _0x5a6ac0=_0x4148b8;if(_0x217b8f[_0x5a6ac0(0x25d)]===-0x25*-0x7f+0x1d*-0x124+0xeb9||_0x217b8f==='.'||_0x217b8f==='..'||_0x217b8f[_0x5a6ac0(0x215)]('\x00')||_0x217b8f[_0x5a6ac0(0x215)]('/')||_0x217b8f[_0x5a6ac0(0x215)]('\x5c')||isWorkspaceUploadTemporaryName(_0x217b8f))return{'path':'','absolutePath':'','status':_0x5a6ac0(0x17b)};const _0x1ca257=await resolveRegisteredWorkspaceRoot(_0x3b4afa),_0x2817e4=await resolveWorkspaceEntry(_0x1ca257,_0x5b3a8a,!![]),_0x4491b8=resolve(_0x2817e4,_0x217b8f);if(dirname(_0x4491b8)!==_0x2817e4)throw new Error(_0x5a6ac0(0x13c));const _0x86db82=relative(_0x1ca257,_0x4491b8)[_0x5a6ac0(0x1c6)](sep)[_0x5a6ac0(0x188)]('/'),_0x3e0bf2=await lstat(_0x4491b8)[_0x5a6ac0(0x18a)](_0x1a5e21=>{const _0x245483=_0x5a6ac0;if(_0x1a5e21[_0x245483(0x14d)]===_0x245483(0x172))return undefined;throw _0x1a5e21;});if(_0x3e0bf2===undefined)return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x259)};if(_0x3e0bf2[_0x5a6ac0(0x19a)]())throw new Error(_0x5a6ac0(0x13c));if(_0x3e0bf2[_0x5a6ac0(0x251)]())return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x211)};return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x210)};}export function workspaceUploadTemporaryName(_0x41c4d9){const _0x5a5d61=_0x4148b8;return _0x5a5d61(0x1b0)+_0x41c4d9+_0x5a5d61(0x20e);}function isWorkspaceUploadTemporaryName(_0x4709af){const _0x9e9842=_0x4148b8;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x9e9842(0x194)](_0x4709af)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x9e9842(0x194)](_0x4709af);}export async function readWorkspaceTextFile(_0x5234b6,_0x42cc15,_0x2c57b0=0x8f*-0x1e+-0xdc0+0x163*0x16,_0xf9ef2e=FILE_READ_LIMIT){const _0x48c7ed=_0x4148b8;if(!Number[_0x48c7ed(0x1bc)](_0x2c57b0)||_0x2c57b0<0xd*-0x22f+0x7f9+0xc9*0x1a||!Number[_0x48c7ed(0x1bc)](_0xf9ef2e)||_0xf9ef2e<0x16a8+-0x13*0x6b+-0xeb6||_0xf9ef2e>FILE_READ_LIMIT)throw new Error(_0x48c7ed(0x157));const _0x30986a=await resolveRegisteredWorkspaceRoot(_0x5234b6),_0x5e7e4a=await resolveWorkspaceEntry(_0x30986a,_0x42cc15,![]),_0x2cb089=await lstat(_0x5e7e4a);if(!_0x2cb089[_0x48c7ed(0x251)]())throw new Error(_0x48c7ed(0x1ba));if(_0x2cb089[_0x48c7ed(0x176)]>FILE_READ_LIMIT*(-0x3b*0x47+-0xf04+0x3*0xa7b))throw new Error(_0x48c7ed(0x21d));const _0x1ea2c8=await readFile(_0x5e7e4a),_0x4ba988=createHash(_0x48c7ed(0x23a))[_0x48c7ed(0x219)](_0x1ea2c8)[_0x48c7ed(0x1a2)](_0x48c7ed(0x1cf)),_0x296740=_0x1ea2c8[_0x48c7ed(0x215)](0x51a*0x4+-0xd77+-0x6f1)||!isValidUtf8(_0x1ea2c8);if(_0x296740){const _0x30c09b=Math[_0x48c7ed(0x145)](_0x1ea2c8[_0x48c7ed(0x25d)],_0x2c57b0+_0xf9ef2e),_0xbcab78=_0x1ea2c8[_0x48c7ed(0x182)](_0x2c57b0,_0x30c09b);return{'path':relative(_0x30986a,_0x5e7e4a)[_0x48c7ed(0x1c6)](sep)[_0x48c7ed(0x188)]('/'),'encoding':_0x48c7ed(0x24b),'size':_0x1ea2c8[_0x48c7ed(0x25d)],'content':_0xbcab78[_0x48c7ed(0x1b9)](_0x48c7ed(0x24b)),'truncated':_0x30c09b<_0x1ea2c8[_0x48c7ed(0x25d)],'nextOffset':_0x30c09b<_0x1ea2c8[_0x48c7ed(0x25d)]?_0x30c09b:null,'revision':_0x4ba988};}if(_0x2c57b0>-0xd4a+0x1b3+0xb97&&_0x2c57b0<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x2c57b0]))throw new Error(_0x48c7ed(0x157));let _0x416f13=Math[_0x48c7ed(0x145)](_0x1ea2c8[_0x48c7ed(0x25d)],_0x2c57b0+_0xf9ef2e);if(_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13])){while(_0x416f13>_0x2c57b0&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13]))_0x416f13-=-0x5*0x51e+-0x189*0x3+-0xf19*-0x2;if(_0x416f13===_0x2c57b0){_0x416f13+=-0x63f+0xaed+-0x7*0xab;while(_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13]))_0x416f13+=-0x1a2*-0x15+0x27*0xc7+-0x409a;}}const _0x8bcac3=_0x1ea2c8[_0x48c7ed(0x182)](_0x2c57b0,_0x416f13),_0x49f0fb=new TextDecoder(_0x48c7ed(0x153),{'fatal':!![]})[_0x48c7ed(0x203)](_0x8bcac3),_0x43c12c=_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]?_0x416f13:null;return{'path':relative(_0x30986a,_0x5e7e4a)[_0x48c7ed(0x1c6)](sep)[_0x48c7ed(0x188)]('/'),'encoding':_0x48c7ed(0x153),'size':_0x1ea2c8[_0x48c7ed(0x25d)],'content':_0x49f0fb,'truncated':_0x43c12c!==null,'nextOffset':_0x43c12c,'revision':_0x4ba988};}export async function writeWorkspaceTextFile(_0x53ee4c,_0x1b34de,_0x32e1a0,_0x399f83){const _0x5f5a73=_0x4148b8;if(!/^[0-9a-f]{64}$/u[_0x5f5a73(0x194)](_0x399f83))throw new Error(_0x5f5a73(0x1c5));const _0x74f2a3=Buffer[_0x5f5a73(0x158)](_0x32e1a0,_0x5f5a73(0x19b));if(_0x74f2a3[_0x5f5a73(0x25d)]>FILE_READ_LIMIT*(0x269b+-0x137d+-0x12*0x10f))throw new Error(_0x5f5a73(0x21d));if(_0x74f2a3[_0x5f5a73(0x215)](-0x1*0x19cf+0x2552+-0xb83*0x1))throw new Error(_0x5f5a73(0x13d));const _0x536eca=await resolveRegisteredWorkspaceRoot(_0x53ee4c);await assertWorkspaceMutationPathHasNoSymlinks(_0x536eca,_0x1b34de);const _0x2a070=await resolveWorkspaceEntry(_0x536eca,_0x1b34de,![]),_0x25680a=await lstat(_0x2a070);if(!_0x25680a[_0x5f5a73(0x251)]())throw new Error(_0x5f5a73(0x1ba));const _0x441d90=await readFile(_0x2a070);if(_0x441d90[_0x5f5a73(0x215)](0x113f+-0x1e53*-0x1+-0x2f92)||!isValidUtf8(_0x441d90))throw new Error(_0x5f5a73(0x13d));const _0x323a8f=createHash(_0x5f5a73(0x23a))[_0x5f5a73(0x219)](_0x441d90)[_0x5f5a73(0x1a2)](_0x5f5a73(0x1cf));if(_0x323a8f!==_0x399f83)throw new Error(_0x5f5a73(0x258));const _0x271a5f=createHash(_0x5f5a73(0x23a))[_0x5f5a73(0x219)](_0x74f2a3)[_0x5f5a73(0x1a2)](_0x5f5a73(0x1cf)),_0x79a2a9=resolve(dirname(_0x2a070),_0x5f5a73(0x1e3)+randomUUID()+_0x5f5a73(0x20e));try{await writeFile(_0x79a2a9,_0x74f2a3,{'flag':'wx','mode':_0x25680a[_0x5f5a73(0x15f)]}),await rename(_0x79a2a9,_0x2a070);}finally{await rm(_0x79a2a9,{'force':!![]})[_0x5f5a73(0x18a)](()=>undefined);}return{'path':workspaceRelativePath(_0x536eca,_0x2a070),'revision':_0x271a5f,'size':_0x74f2a3[_0x5f5a73(0x25d)]};}function _0x5465(){const _0x1f8f5c=['rKLmrv9ot1rFvevyva','kIOVBM9Kzv9TB2r1BgvZlYOQ','mJyZmJa0ou1xDK5PzW','C29Tzq','CMvMCY9Yzw1VDgvZ','ls1NAxqTy29TBw9UlwrPCG','zMLUywXSEq','CgfYC2u','BwLU','CMvMCW','kIOVyMLUlYOQ','q1jfqvrfx0rjuKvdve9swq','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','mZiYotCZmxvdvfzKsW','yMfZzty0DxjS','vu5uuKfds0ve','y29Kzq','kIOVlNr1CMjVlYOQ','Aw5KzxHpzG','yNL0zuXLBMD0Aa','BMfTzq','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','DxrMltG','AgfZAa','qureruq','D29YA3rYzwu','rKLmrv9squ5hrv9jtLzbteLe','zNjVBq','B3v0Chv0','y2XVC2u','ls1ZB3vYy2u9sevbra','kIOVzgLZDc8QkG','revmrvrf','ls1WB3jJzwXHAw4','Bw9Kzq','CxvLCNK','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','AxnbyNnVBhv0zq','ywrK','Chj1BMfIBguG','ls10B3bVlw9YzgvY','Dg9mB3DLCKnHC2u','v09ss1nqqunfx05pvf9bteXpv0ve','r0Lux1jfrL9jtLzbteLe','C3rYAw5N','lI4U','A2LUza','kIOVlMDPDc8QkG','ls1TyxGTy291BNq9','kIOVlNbUCg0VkIO','iYmG','ls1VDgHLCNm','ru5pru5u','CMvMCY9OzwfKCW','Chj1BMfIBgu','kIOVB3v0lYOQ','C2L6zq','C2v0','zgLMzI10CMvL','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','CMvMCMvZAgvKqxq','su5wquXjrf9oqu1f','CMvHza','AgfZ','BM9YBwfSAxPL','ChvZAa','zgLZCg9Zzq','C3rKzxjY','C3vIyxjYyxK','ls1UBY1PBMrLEa','ls1PCY1HBMnLC3rVCG','mZa0mJC5nu5iAMPHsa','zMLSDgvY','C2LUA0rVD24','AM9PBG','kIOVlNLHCM4VkIO','y2f0y2G','C2vHCMnOlMv4y2X1zgu','CMvZDg9Yzq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','CMvHze9UBhK','ls1LEgnSDwrLlxn0yw5KyxjK','kIOVy292zxjHz2uVkIO','CMvWBgfJzufSBa','Bg9HzgLUzW','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','DgvZDa','zw50CMLLCW','rKLmrv9ot1rFreLsrunut1jz','ls1XDwLLDa','Bg9JywXLq29TCgfYzq','zxHWAxj5vgLTzxi','AxntEw1IB2XPy0XPBMS','DxrMoa','z2L0','Bg9JA2vK','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','l2rLDI9UDwXS','CMvMCMvZAef0DgvTChrLzef0','zNjLC2HUzxnZvhrStxm','zgLNzxn0','CMvMCY9Yzw1VDgvZlW','zw50CNLmAw1PDa','kIOVlNzLBNyVkIO','AxnjBNrLz2vY','A2LSBa','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','CgLK','Aw52ywXPza','BM93','BwvZC2fNzq','kIOVlMDYywrSzs8QkG','Dhj1BMnHDgvK','C3rHCNrZv2L0Aa','lM1HCI11CgXVywqT','mJqWmZq1nZjdtfHvqw0','BgfZDeLUzgv4t2y','yMLUyxj5igrPzMyGC2HHmJu2pq','BgLTAxq','B3v0Chv0tgLTAxq','zMLUz2vYChjPBNq','CMv2lxbHCNnL','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','Dg9tDhjPBMC','rKLmrv9ot1rFuKvhvuXbuG','kIOVx19WEwnHy2HLx18VkIO','AxntywzLsw50zwDLCG','AwrSzvr0Be1Z','C3rHBgu','ls1YB290','ls1UBY10zxH0y29UDG','AxneAxjLy3rVCNK','vfLqrv9dsefor0ve','BgLUDxG','zgLMzG','rKLmrv9srvzju0LptL9jtLzbteLe','C3bSAxq','BhmTzMLSzxm','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','oIHSAxrLCMfSkq','BwfW','Dg91y2G','Dg9mB2nHBgvmB3DLCKnHC2u','ls1MB3jTyxq9','yMfYzq','Agv4','sevbra','yMXVyG','B25Jzq','y3vYC29Y','DMfSDwvZ','CMvIDwLSza','ls1UBY1JB21TAxqTAwq','q09qsuve','ls1ZA2LWpq','r0Lux0nptu1btKrFrKfjteve','zxzLCNK','B2jQzwn0','CMvWBgfJzq','C2HVDW','BwvYz2uTyMfZzq','B2zMC2v0','C2vHCMnO','Dw5Yzwy','C3vIBw9KDwXL','lM1HCI1LzgL0lq','r0Lux1DpuKTtuefdrq','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','kIOVB2jQlYOQ','reLsrunut1jz','yMLUyxj5','oefnBun6CG','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','CM9VDa','ls1MAxjZDc1WyxjLBNq','kIOVlMnHy2HLlYOQ','kIOVyNvPBgqVkIO','kIOVlM51EhqVkIO','D2LUmZi','Bwv0ywrHDge','q1jfqvrfx0zjteu','CMvSyxrPDMu','zgvZDgLUyxrPB24','rKLmrv9ot1rFrK9vtKq','ywXSB2nvBNnHzMu','zw50CNK','CMvMCMvZAeLUqMfJA2DYB3vUza','y2f0lwzPBgu','lY5Flq','ywXS','C29YDa','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','zMLUzeLUzgv4','ls1ICMfUy2HLCW','y29Uy2f0','revmrvrfra','zgvJB2rL','Bwf4','D29YA3rYzwuG','CgXHDgzVCM0','DgHLBG','ls1Yzw1VDgvZ','CgLWzq','rKLmrv9btfjfqurzx0vysvnuuW','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','C2XPy2u','C3rKB3v0','lNbHCNq','mtiYmti5mePzqK5AAq','rvHju1rtx0rjuKvdve9swq','rvHju1rtx0zjteu','zMXVB3i','nZyXnZmXvffmBeDA','CMvMCY9OzwfKCY8','Aw5JBhvKzxm','lMDPDa','ls11BNrYywnRzwqTzMLSzxm9ywXS','y29UDgvUDenHBMrPzgf0zxm','DxbKyxrL','pZ8G','y2fWywnPDhK','rKLmrq','rKLmrv9ut09Ftefsr0u','ls1KyxrLlw9YzgvY','ruvysvnu','ls1ZDgfNzwq','Dgv4Da','kIOVDMvUDI8QkG','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','zgf0yq','sevbrca','zMLSzxmUzxHJBhvKzq','kIOVlNn2zwX0zs1RAxqVkIO','kIOVlM5LEhqVkIO','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','r0Lux1DpuKTuuKvfx0Xju1rFsu5wquXjra','C2HPzNq','kIOVlMfUz3vSyxiVkIO','Bg9N','zMLUza','DgLTzw91De1Z','C29YDgvK','C2nVCMu','kIOVlNbHCMnLBc1JywnOzs8QkG','uKvnt1rf','C3LTyM9SAwmTCMvM','mtzRqKrzq3i','kIOVDgvZDc9YDw5ZlYOQ','ls1ZAg9YDa','C3rYAw5NAwz5','ls1ICMfUy2G','C2HHmJu2','DhjPBq','yNvIyMXLvxa','zM9YlwvHy2GTCMvM','y2HHBMDLCW','z2v0','lMDPDc8','kIOVDgfYz2v0lYOQ','BgLZDa','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','ls12zxjPzNK','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','kIOVDMvUzg9YlYOQ','te9dquW','ls13B3jRDhjLzq','v09ss1nqqunfx1bbveHFsu5wquXjra','zMXHDe1HCa','yMfZzty0','C3rHDhvZ','BxrPBwvnCW','Dg9vChbLCKnHC2u','D29YA3nWywnLuM9VDa','Cgf0Aa','AxngAwXL','ywn0Aw9U','zxHLyW','ls1ZAg93lxrVCgXLDMvS','qMLUyxj5igzPBgvZia','vu5tvefhruq','AwDUB3jL','rKLmrv9xuKLurv9dt05gteLdva','uKvbrfK','zgLZCgXHEu5HBwu','igj5DgvZpq','nZi1oti4tLDivvvd','BgvUz3rO','yNjHBMnOia','zw5ZDxjLtg9HzgvK','ls1WB3jJzwXHAw49DJe','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','Bg9JA2vKia','zxjYB3i','ls1Uyw1Llxn0yxr1CW','u0Lhs0Lmta','tu9esuzjruq','ls1UBY1LEhqTzgLMzG','ls1Yzwn1CNnPDMu','uKvoqu1fra','BgLTAxrZ','u1rbr0ve','rKLmrv9qqvrix0vtq0fqrq'];_0x5465=function(){return _0x1f8f5c;};return _0x5465();}export async function readWorkspaceFileContentRange(_0x56384d,_0x5b5304,_0x26e652=0x9*0x1fd+-0x1740+0x55b,_0x14beb6=FILE_READ_LIMIT){const _0x1e5dc2=_0x4148b8;if(!Number[_0x1e5dc2(0x1bc)](_0x26e652)||_0x26e652<0x1*-0xc31+0xd49*0x1+-0x118||!Number[_0x1e5dc2(0x1bc)](_0x14beb6)||_0x14beb6<0x1*0x13ee+0xa21+-0x1e0e||_0x14beb6>FILE_READ_LIMIT)throw new Error(_0x1e5dc2(0x157));const _0x43842c=await resolveRegisteredWorkspaceRoot(_0x56384d),_0x5747bd=await resolveWorkspaceEntry(_0x43842c,_0x5b5304,![]),_0x40af39=await lstat(_0x5747bd);if(!_0x40af39[_0x1e5dc2(0x251)]())throw new Error(_0x1e5dc2(0x1ba));if(_0x26e652>_0x40af39[_0x1e5dc2(0x176)])throw new Error(_0x1e5dc2(0x157));const _0x525da6=Math[_0x1e5dc2(0x145)](_0x14beb6,_0x40af39[_0x1e5dc2(0x176)]-_0x26e652),_0xcc19f4=Buffer[_0x1e5dc2(0x1f7)](_0x525da6),_0x307a82=await open(_0x5747bd,'r');try{const {bytesRead:_0x1e716d}=await _0x307a82[_0x1e5dc2(0x17c)](_0xcc19f4,0xb*-0x1df+-0xc2*0x12+0x2239,_0x525da6,_0x26e652),_0x2d2999=_0x26e652+_0x1e716d;return{'path':relative(_0x43842c,_0x5747bd)[_0x1e5dc2(0x1c6)](sep)[_0x1e5dc2(0x188)]('/'),'size':_0x40af39[_0x1e5dc2(0x176)],'offset':_0x26e652,'contentBase64':_0xcc19f4[_0x1e5dc2(0x182)](-0x23e7+-0x403+-0x6*-0x6a7,_0x1e716d)[_0x1e5dc2(0x1b9)](_0x1e5dc2(0x24b)),'nextOffset':_0x2d2999<_0x40af39[_0x1e5dc2(0x176)]?_0x2d2999:null};}finally{await _0x307a82[_0x1e5dc2(0x15a)]();}}export async function readAllowedFileContentRange(_0xa6771c,_0x418f5d,_0x27d9a7=0x6*-0xd+-0x1056+0x10a4,_0x19e720=FILE_READ_LIMIT){const _0x4cdae2=_0x4148b8;if(!Number[_0x4cdae2(0x1bc)](_0x27d9a7)||_0x27d9a7<-0x22d5*0x1+-0x117b+0x30*0x117||!Number[_0x4cdae2(0x1bc)](_0x19e720)||_0x19e720<0x5d9+-0x1f9b+0x19c3||_0x19e720>FILE_READ_LIMIT)throw new Error(_0x4cdae2(0x157));const {file:_0x311743,metadata:_0x232bba}=await resolveAllowedFile(_0xa6771c,_0x418f5d);if(_0x27d9a7>_0x232bba[_0x4cdae2(0x176)])throw new Error(_0x4cdae2(0x157));const _0xc66c39=Math[_0x4cdae2(0x145)](_0x19e720,_0x232bba[_0x4cdae2(0x176)]-_0x27d9a7),_0x545a5a=Buffer[_0x4cdae2(0x1f7)](_0xc66c39),_0x5db71d=await open(_0x311743,'r');try{const {bytesRead:_0x1be58b}=await _0x5db71d[_0x4cdae2(0x17c)](_0x545a5a,-0x5b*-0x65+-0x2250+-0x197,_0xc66c39,_0x27d9a7),_0x44a437=_0x27d9a7+_0x1be58b;return{'path':_0x311743,'size':_0x232bba[_0x4cdae2(0x176)],'offset':_0x27d9a7,'contentBase64':_0x545a5a[_0x4cdae2(0x182)](0x2a9*-0x8+0xfd3*0x2+-0x2*0x52f,_0x1be58b)[_0x4cdae2(0x1b9)](_0x4cdae2(0x24b)),'nextOffset':_0x44a437<_0x232bba[_0x4cdae2(0x176)]?_0x44a437:null};}finally{await _0x5db71d[_0x4cdae2(0x15a)]();}}export async function readAllowedTextFile(_0x5ce9e2,_0x5d9ff3,_0x362428=-0x2659+-0x5*-0x67d+0x5e8,_0x5c898f=FILE_READ_LIMIT){const _0x592610=_0x4148b8,{file:_0x571a08,metadata:_0x3806d6}=await resolveAllowedFile(_0x5ce9e2,_0x5d9ff3);if(_0x3806d6[_0x592610(0x176)]>FILE_READ_LIMIT*(-0x1106+0x23*0x7f+-0x47))throw new Error(_0x592610(0x21d));if(!Number[_0x592610(0x1bc)](_0x362428)||_0x362428<0x1*0x463+0xa0d+0x1ce*-0x8||!Number[_0x592610(0x1bc)](_0x5c898f)||_0x5c898f<-0x705+-0x3*-0x90b+-0x141b||_0x5c898f>FILE_READ_LIMIT)throw new Error(_0x592610(0x157));const _0x3f4e2c=await readFile(_0x571a08),_0x4cc1b2=_0x3f4e2c[_0x592610(0x215)](0x78a+-0xe4d+-0x3*-0x241)||!isValidUtf8(_0x3f4e2c),_0x446447=Math[_0x592610(0x145)](_0x3f4e2c[_0x592610(0x25d)],_0x362428+_0x5c898f);if(_0x4cc1b2){const _0xc8d750=_0x3f4e2c[_0x592610(0x182)](_0x362428,_0x446447);return{'path':_0x571a08,'encoding':_0x592610(0x24b),'size':_0x3f4e2c[_0x592610(0x25d)],'content':_0xc8d750[_0x592610(0x1b9)](_0x592610(0x24b)),'truncated':_0x446447<_0x3f4e2c[_0x592610(0x25d)],'nextOffset':_0x446447<_0x3f4e2c[_0x592610(0x25d)]?_0x446447:null};}if(_0x362428>0x2050+-0x11bb+-0x1*0xe95&&_0x362428<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x362428]))throw new Error(_0x592610(0x157));let _0x1960d2=_0x446447;if(_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2])){while(_0x1960d2>_0x362428&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2]))_0x1960d2-=-0xe*0x39+0x69*0x3d+-0x15e6;if(_0x1960d2===_0x362428){_0x1960d2+=0x2ef*-0x2+-0x54e+0xb2d;while(_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2]))_0x1960d2+=-0x152d+0x62*-0x49+0x312*0x10;}}const _0x1607c4=_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]?_0x1960d2:null;return{'path':_0x571a08,'encoding':_0x592610(0x153),'size':_0x3f4e2c[_0x592610(0x25d)],'content':new TextDecoder(_0x592610(0x153),{'fatal':!![]})[_0x592610(0x203)](_0x3f4e2c[_0x592610(0x182)](_0x362428,_0x1960d2)),'truncated':_0x1607c4!==null,'nextOffset':_0x1607c4};}export function normalizeFilePreviewPath(_0x45aed3){const _0x504b29=_0x4148b8;if(!/^sandbox:/iu[_0x504b29(0x194)](_0x45aed3))return _0x45aed3;let _0x201080;try{_0x201080=decodeURIComponent(_0x45aed3[_0x504b29(0x20c)](_0x45aed3[_0x504b29(0x14f)](':')+(-0xce+0x35*-0x53+0x2*0x8ff)));}catch{throw new Error(_0x504b29(0x13c));}const _0x2aa922=_0x201080[_0x504b29(0x1dc)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x2aa922[_0x504b29(0x25d)]===-0x2635+0x5cf*0x1+-0x8f*-0x3a||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x504b29(0x194)](_0x201080)||!isAbsolute(_0x2aa922)&&!win32[_0x504b29(0x163)](_0x2aa922)||_0x2aa922[_0x504b29(0x215)]('\x00')||_0x2aa922[_0x504b29(0x215)]('?')||_0x2aa922[_0x504b29(0x215)]('#'))throw new Error(_0x504b29(0x13c));return _0x2aa922;}async function resolveAllowedFile(_0x43795e,_0x57b14d){const _0x25754d=_0x4148b8;if(!isAbsolute(_0x43795e))throw new Error(_0x25754d(0x13c));const _0x349e12=await realpath(_0x43795e)[_0x25754d(0x18a)](_0x29916c=>{const _0xc30927=_0x25754d;if(_0x29916c[_0xc30927(0x14d)]===_0xc30927(0x172))throw new Error(_0xc30927(0x1f6));throw _0x29916c;}),_0x3b1303=await Promise[_0x25754d(0x1fc)](_0x57b14d[_0x25754d(0x1ca)](_0x5c561f=>realpath(_0x5c561f)));if(!isWithinAllowedRoot(_0x349e12,_0x3b1303))throw new Error(_0x25754d(0x13c));const _0x533a0c=await lstat(_0x349e12);if(!_0x533a0c[_0x25754d(0x251)]())throw new Error(_0x25754d(0x1ba));return{'file':_0x349e12,'metadata':_0x533a0c};}function isValidUtf8(_0x484eec){const _0x1b7b89=_0x4148b8;try{return new TextDecoder(_0x1b7b89(0x153),{'fatal':!![]})[_0x1b7b89(0x203)](_0x484eec),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x20a796){return(_0x20a796&-0x648+-0xa*-0x27a+-0x11bc)===0x13d0+-0x69*0x38+-0x1d4*-0x2;}export async function searchWorkspaceFiles(_0x267254,_0xa60e55,_0x42ec01,_0x1567da=SEARCH_RESULT_LIMIT,_0x36765a=![]){const _0x41af18=_0x4148b8,_0x3ac9d5=new WorkspaceFileIndex(_0x267254);try{return await _0x3ac9d5[_0x41af18(0x1e0)](_0xa60e55,_0x42ec01,_0x1567da,_0x36765a);}finally{_0x3ac9d5[_0x41af18(0x180)]();}}async function resolveRegisteredWorkspaceRoot(_0x11b2d1){const _0x35849d=_0x4148b8,_0x537595=await realpath(_0x11b2d1);if(normalizeWorkspacePath(_0x537595)!==normalizeWorkspacePath(_0x11b2d1))throw new Error(_0x35849d(0x168));return _0x537595;}async function resolveWorkspaceEntry(_0x42075c,_0x4f882f,_0x5334f1){const _0x56a0a5=await resolveRegisteredWorkspaceRoot(_0x42075c);return resolveWorkspaceEntryFromCanonicalRoot(_0x56a0a5,_0x4f882f,_0x5334f1);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x3eda1f,_0x440c31,_0x5ac7cf){const _0x48c65f=_0x4148b8,_0x401ebc=await resolveWorkspaceEntryMetadata(_0x3eda1f,_0x440c31);if(_0x5ac7cf?!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x1c1)]():!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x251)]()&&!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x1c1)]())throw new Error(_0x5ac7cf?_0x48c65f(0x196):_0x48c65f(0x1ba));return _0x401ebc[_0x48c65f(0x250)];}async function resolveWorkspaceEntryMetadata(_0x3844b2,_0x3cbf88){const _0x26578b=_0x4148b8;if(_0x3cbf88[_0x26578b(0x215)]('\x00')||_0x3cbf88[_0x26578b(0x25d)]===-0x14dc+0x20ad+0x113*-0xb||_0x3cbf88[_0x26578b(0x1af)]('/')||_0x3cbf88[_0x26578b(0x1af)]('\x5c'))throw new Error(_0x26578b(0x13c));const _0x4b5b83=_0x3cbf88[_0x26578b(0x191)]('\x5c','/');if(_0x4b5b83[_0x26578b(0x1c6)]('/')[_0x26578b(0x140)](_0x379b81=>_0x379b81==='..'||_0x379b81===_0x26578b(0x216)))throw new Error(_0x26578b(0x13c));let _0x3861f0;try{_0x3861f0=await realpath(resolve(_0x3844b2,_0x4b5b83));}catch(_0x133dca){if(_0x133dca[_0x26578b(0x14d)]===_0x26578b(0x172))throw new Error(_0x26578b(0x1f6));throw _0x133dca;}const _0x434f4b=relative(_0x3844b2,_0x3861f0);if(isAbsolute(_0x434f4b)||_0x434f4b[_0x26578b(0x1af)]('..')||_0x434f4b==='..'||_0x434f4b[_0x26578b(0x1af)]('..'+sep))throw new Error(_0x26578b(0x13c));const _0x34d771=await lstat(_0x3861f0);return{'path':_0x3861f0,'metadata':_0x34d771};}async function inspectWorkspaceIndexEntry(_0x516aed,_0x5287ce,_0x5efabc){const _0x4d0e5a=_0x4148b8;try{const _0x426d8e=await resolveWorkspaceEntryMetadata(_0x516aed,_0x5287ce);if(!_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x251)]()&&!_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x1c1)]())return undefined;const _0x42216b=relative(_0x516aed,_0x426d8e[_0x4d0e5a(0x250)])[_0x4d0e5a(0x1c6)](sep)[_0x4d0e5a(0x188)]('/');return _0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x1c1)]()?{'path':_0x42216b,'name':_0x5efabc,'kind':_0x4d0e5a(0x1e7),'size':null,'modifiedAt':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x24d)]}:{'path':_0x42216b,'name':_0x5efabc,'kind':_0x4d0e5a(0x21c),'size':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x176)],'modifiedAt':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x24d)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x173e45,_0x157935){const _0x3f0bba=_0x4148b8;return Buffer[_0x3f0bba(0x158)](JSON[_0x3f0bba(0x238)]({'path':_0x173e45,'name':_0x157935}))[_0x3f0bba(0x1b9)](_0x3f0bba(0x14b));}function decodeDirectoryCursor(_0x3d9bbb,_0x3ecd14){const _0x951493=_0x4148b8;if(_0x3d9bbb===undefined)return undefined;try{const _0x1b268c=JSON[_0x951493(0x144)](Buffer[_0x951493(0x158)](_0x3d9bbb,_0x951493(0x14b))[_0x951493(0x1b9)](_0x951493(0x19b)));if(typeof _0x1b268c!==_0x951493(0x1db)||_0x1b268c===null||_0x1b268c[_0x951493(0x250)]!==_0x3ecd14||typeof _0x1b268c[_0x951493(0x151)]!==_0x951493(0x16a))throw new Error();return _0x1b268c[_0x951493(0x151)];}catch{throw new Error(_0x951493(0x1b8));}}function encodeSearchCursor(_0x5ede44,_0x5cd9fd){const _0x6a0b6b=_0x4148b8;return Buffer[_0x6a0b6b(0x158)](JSON[_0x6a0b6b(0x238)]({'query':_0x5ede44,'path':_0x5cd9fd}))[_0x6a0b6b(0x1b9)](_0x6a0b6b(0x14b));}function decodeSearchCursor(_0x6cc4f0,_0x5e09e0){const _0x4eb959=_0x4148b8;if(_0x6cc4f0===undefined)return undefined;try{const _0x48abf6=JSON[_0x4eb959(0x144)](Buffer[_0x4eb959(0x158)](_0x6cc4f0,_0x4eb959(0x14b))[_0x4eb959(0x1b9)](_0x4eb959(0x19b)));if(typeof _0x48abf6!==_0x4eb959(0x1db)||_0x48abf6===null||_0x48abf6[_0x4eb959(0x160)]!==_0x5e09e0||typeof _0x48abf6[_0x4eb959(0x250)]!==_0x4eb959(0x16a))throw new Error();return _0x48abf6[_0x4eb959(0x250)];}catch{throw new Error(_0x4eb959(0x1b8));}}export function normalizeWorkspacePath(_0x39091b,_0x2eac98=_0x223f26()){const _0x2444f6=_0x4148b8;if(_0x39091b[_0x2444f6(0x25d)]===0x2c*0xca+0x552+-0x19*0x19a||_0x39091b[_0x2444f6(0x215)]('\u0000'))throw new Error(_0x2444f6(0x249));if(_0x2eac98===_0x2444f6(0x1f1)){if(/^\\\\[?.]/[_0x2444f6(0x194)](_0x39091b))throw new Error(_0x2444f6(0x152));const _0x2aa814=win32[_0x2444f6(0x17e)](_0x39091b[_0x2444f6(0x191)]('/','\x5c'));if(!win32[_0x2444f6(0x163)](_0x2aa814))throw new Error(_0x2444f6(0x1ea));return _0x2aa814[_0x2444f6(0x1dc)](/\\+$/,'')[_0x2444f6(0x167)]();}if(_0x2eac98!==_0x2444f6(0x1c3))throw new Error(_0x2444f6(0x193));const _0x34cbf2=posix[_0x2444f6(0x17e)](_0x39091b);if(!posix[_0x2444f6(0x163)](_0x34cbf2))throw new Error(_0x2444f6(0x1ea));return _0x34cbf2==='/'?_0x34cbf2:_0x34cbf2[_0x2444f6(0x1dc)](/\/+$/,'');}export function isWithinAllowedRoot(_0xc73fb2,_0x5e4e62,_0x3dd851=_0x223f26()){const _0x43e2ef=_0x4148b8,_0x389ea2=normalizeWorkspacePath(_0xc73fb2,_0x3dd851),_0x1f0c5c=_0x3dd851===_0x43e2ef(0x1f1)?win32:posix;return _0x5e4e62[_0x43e2ef(0x140)](_0x4ec562=>{const _0x1c626d=_0x43e2ef,_0x1e02b4=normalizeWorkspacePath(_0x4ec562,_0x3dd851),_0xbedb8f=_0x1f0c5c[_0x1c626d(0x1f4)](_0x1e02b4,_0x389ea2);return _0xbedb8f===''||!_0xbedb8f[_0x1c626d(0x1af)]('..')&&!_0x1f0c5c[_0x1c626d(0x163)](_0xbedb8f);});}export async function inspectWorkspace(_0x1c6601,_0x536907){const _0x78749e=_0x4148b8,_0x28f435=await realpath(_0x1c6601),_0x5883dc=await Promise[_0x78749e(0x1fc)](_0x536907[_0x78749e(0x1ca)](_0x3ccd60=>realpath(_0x3ccd60))),_0x2f1610=await stat(_0x28f435);if(!_0x2f1610[_0x78749e(0x1c1)]()||!isWithinAllowedRoot(_0x28f435,_0x5883dc))throw new Error(_0x78749e(0x168));try{const _0x2b8f2c=await readGitSummary(_0x28f435);return{'path':_0x28f435,'kind':_0x78749e(0x1e4),'gitSummary':_0x2b8f2c};}catch(_0x4ea86e){if(_0x4ea86e instanceof GitCommandError&&_0x4ea86e[_0x78749e(0x14d)]===-0x1a4e+-0x5c*0x2b+0x2a42||isGitUnavailable(_0x4ea86e))return{'path':_0x28f435,'kind':_0x78749e(0x1e7)};throw _0x4ea86e;}}export async function readGitSummary(_0x408953){const _0x558f21=_0x4148b8,_0x165dca=(await runReadOnlyGit(_0x408953,[_0x558f21(0x1b7),_0x558f21(0x142)]))[_0x558f21(0x221)][_0x558f21(0x23b)](),_0xd221e7=await runReadOnlyGitAllowFailure(_0x408953,[_0x558f21(0x1b7),_0x558f21(0x244),_0x558f21(0x1d0)]),_0x546db6=await runReadOnlyGitAllowFailure(_0x408953,[_0x558f21(0x234),_0x558f21(0x197),_0x558f21(0x237),_0x558f21(0x1d0)]),_0x303390={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x413e83=await runReadOnlyGit(_0x408953,[_0x558f21(0x24c),_0x558f21(0x260)],_0x303390);return{'commonDir':_0x165dca,'head':_0xd221e7[_0x558f21(0x14d)]===-0x59*-0x33+-0x3ce*-0x8+-0x302b?_0xd221e7[_0x558f21(0x221)][_0x558f21(0x23b)]():'','branch':_0x546db6[_0x558f21(0x14d)]===-0x3*0xcc7+0x21d6+0x47f?_0x546db6[_0x558f21(0x221)][_0x558f21(0x23b)]():null,'dirty':_0x413e83[_0x558f21(0x159)][_0x558f21(0x25d)]>-0x3*-0x5ca+0x66b*0x5+-0x3175*0x1,'snapshot':summarizeText(_0x413e83[_0x558f21(0x221)])};}export function assertSafeGitRef(_0x51fb4b){const _0x195151=_0x4148b8;if(!REF_PATTERN[_0x195151(0x194)](_0x51fb4b))throw new Error(_0x195151(0x169));}export async function readRestrictedDiff(_0x89d501,_0x512ab2,_0x3602c0){const _0x436f1c=_0x4148b8;assertSafeGitRef(_0x512ab2),assertSafeGitRef(_0x3602c0);const _0x3c276e=await runReadOnlyGit(_0x89d501,[_0x436f1c(0x1c4),_0x436f1c(0x137),_0x436f1c(0x1c0),_0x512ab2,_0x3602c0]),_0x1eb697=_0x3c276e[_0x436f1c(0x159)][_0x436f1c(0x215)](0x1e53*-0x1+0x67c+-0x11*-0x167)||_0x3c276e[_0x436f1c(0x221)][_0x436f1c(0x215)](_0x436f1c(0x255));if(_0x1eb697)return{'binary':!![],'summary':_0x436f1c(0x1b3)+createHash(_0x436f1c(0x23a))[_0x436f1c(0x219)](_0x3c276e[_0x436f1c(0x159)])[_0x436f1c(0x1a2)](_0x436f1c(0x1cf))+_0x436f1c(0x25b)+_0x3c276e[_0x436f1c(0x159)][_0x436f1c(0x25d)],'truncated':_0x3c276e[_0x436f1c(0x1ae)]};return{'binary':![],'text':_0x3c276e[_0x436f1c(0x221)],'truncated':_0x3c276e[_0x436f1c(0x1ae)]};}function currentBranchFromStatusHeader(_0x4c3b5a){const _0x50b4cc=_0x4148b8,_0x257de5=_0x4c3b5a[_0x50b4cc(0x20c)](0x2*0x47d+0x2275+-0x2b6c*0x1);if(_0x257de5[_0x50b4cc(0x1af)](_0x50b4cc(0x225)))return null;const _0x6db9d4=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x50b4cc(0x253)](_0x257de5);if(_0x6db9d4!==null)return _0x6db9d4[-0x1*-0xe28+-0x22bf+0x1498]??null;return _0x257de5[_0x50b4cc(0x1c6)](_0x50b4cc(0x16b))[0x1*-0x259d+0x56e+0x202f]?.[_0x50b4cc(0x1c6)]('\x20')[-0xfd+0x260d+-0x2510]??null;}export async function listGitWorktrees(_0x52a59e){const _0x5f3cf0=_0x4148b8,_0x58606e=await runReadOnlyGit(_0x52a59e,[_0x5f3cf0(0x156),_0x5f3cf0(0x242),_0x5f3cf0(0x15e),'-z'],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x12dedd=normalizeWorkspacePath(await realpath(_0x52a59e)),_0x1191b0=[];let _0x5dc18c=_0x58606e[_0x5f3cf0(0x1ae)];for(const _0x117693 of _0x58606e[_0x5f3cf0(0x221)][_0x5f3cf0(0x1c6)]('\x00\x00')){if(_0x117693[_0x5f3cf0(0x25d)]===-0x1562+-0x2057*-0x1+0x21*-0x55)continue;if(_0x1191b0[_0x5f3cf0(0x25d)]>=GIT_WORKTREE_LIST_LIMIT){_0x5dc18c=!![];break;}const _0x5558d5=_0x117693[_0x5f3cf0(0x1c6)]('\x00')[_0x5f3cf0(0x186)](_0x253479=>_0x253479[_0x5f3cf0(0x25d)]>0x6bb*0x5+0x1409+0x4*-0xd6c);if(_0x5558d5[_0x5f3cf0(0x140)](_0x18e961=>_0x18e961===_0x5f3cf0(0x1ce)))continue;const _0x5a58ed=_0x5558d5[_0x5f3cf0(0x22e)](_0x4aaff9=>_0x4aaff9[_0x5f3cf0(0x1af)](_0x5f3cf0(0x205))),_0xa72e66=_0x5558d5[_0x5f3cf0(0x22e)](_0xd9394=>_0xd9394[_0x5f3cf0(0x1af)](_0x5f3cf0(0x225))),_0x4b3632=_0x5a58ed?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x205)[_0x5f3cf0(0x25d)]),_0x1fdf1a=_0xa72e66?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x225)[_0x5f3cf0(0x25d)]);if(_0x4b3632===undefined||_0x4b3632[_0x5f3cf0(0x25d)]===-0x8e2+0x7fa*0x2+-0x712||_0x1fdf1a===undefined||!/^[0-9a-f]{40,64}$/u[_0x5f3cf0(0x194)](_0x1fdf1a)){if(_0x58606e[_0x5f3cf0(0x1ae)]){_0x5dc18c=!![];continue;}throw new Error(_0x5f3cf0(0x22a));}const _0x37442f=_0x5558d5[_0x5f3cf0(0x22e)](_0x1e43cd=>_0x1e43cd[_0x5f3cf0(0x1af)](_0x5f3cf0(0x25e))),_0x48a037=_0x37442f?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x25e)[_0x5f3cf0(0x25d)]),_0x54d144=_0x48a037===undefined?null:_0x48a037[_0x5f3cf0(0x1af)](_0x5f3cf0(0x214))?_0x48a037[_0x5f3cf0(0x20c)](_0x5f3cf0(0x214)[_0x5f3cf0(0x25d)]):_0x48a037,_0x1a28e7=(basename(_0x4b3632)[_0x5f3cf0(0x23b)]()||_0x54d144||_0x1fdf1a[_0x5f3cf0(0x20c)](-0xc85*-0x2+0x1aaf+-0x33b9,-0x1354+0x4f*0x79+0x3f*-0x49))[_0x5f3cf0(0x20c)](0x4f*0x53+0x1*0xb76+-0x2513,-0x5*-0x5b3+-0x16f3+-0x38c);_0x1191b0[_0x5f3cf0(0x17f)]({'path':_0x4b3632,'directoryName':_0x1a28e7,'branch':_0x54d144,'head':_0x1fdf1a,'current':normalizeWorkspacePath(_0x4b3632)===_0x12dedd,'locked':_0x5558d5[_0x5f3cf0(0x140)](_0x15d63e=>_0x15d63e===_0x5f3cf0(0x19d)||_0x15d63e[_0x5f3cf0(0x1af)](_0x5f3cf0(0x132))),'prunable':_0x5558d5[_0x5f3cf0(0x140)](_0x3fb7ae=>_0x3fb7ae===_0x5f3cf0(0x174)||_0x3fb7ae[_0x5f3cf0(0x1af)](_0x5f3cf0(0x165)))});}return{'entries':_0x1191b0,'truncated':_0x5dc18c};}export async function readCurrentChangesSummary(_0x216e77){const _0x47f00f=_0x4148b8,_0x445ebf=await runReadOnlyGit(_0x216e77,[_0x47f00f(0x24c),_0x47f00f(0x260),'-z',_0x47f00f(0x239),_0x47f00f(0x217)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x45c109=_0x445ebf[_0x47f00f(0x221)][_0x47f00f(0x1c6)]('\x00'),_0x5cf6a3=_0x45c109[_0x47f00f(0x22b)]()??'',_0x1f2efa=[];for(let _0x131ed5=-0xa*-0x1d5+0x904+-0x1*0x1b56;_0x131ed5<_0x45c109[_0x47f00f(0x25d)];_0x131ed5+=0x126f+0x1ade*-0x1+0x870*0x1){const _0x14344e=_0x45c109[_0x131ed5];if(_0x14344e[_0x47f00f(0x25d)]<0x244a+0x36a+0x10*-0x27b)continue;const _0x12e542=_0x14344e[-0x13da+-0x1*-0x26f9+0x1bd*-0xb],_0x3f2234=_0x14344e[0x142*-0x16+0x1b18+0x95*0x1],_0x3c4ed4=_0x14344e[_0x47f00f(0x20c)](-0xaee+-0x9ca+0x14bb);if(_0x12e542==='?'&&_0x3f2234==='?'){_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x14c),'change':_0x47f00f(0x155)});continue;}_0x12e542!=='\x20'&&_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x13b),'change':gitChange(_0x12e542)});_0x3f2234!=='\x20'&&_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x256),'change':gitChange(_0x3f2234)});if(_0x12e542==='R'||_0x12e542==='C'||_0x3f2234==='R'||_0x3f2234==='C')_0x131ed5+=-0xb2*-0x31+-0x1*-0x227e+-0x448f;}return{'branch':_0x5cf6a3[_0x47f00f(0x1af)](_0x47f00f(0x170))?currentBranchFromStatusHeader(_0x5cf6a3):null,'changes':_0x1f2efa};}export async function listInitializedSubmodulePaths(_0x1a3374){const _0x4100ee=_0x4148b8,_0x4849f2=await runReadOnlyGit(_0x1a3374,[_0x4100ee(0x1e2),_0x4100ee(0x24c),_0x4100ee(0x138)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x4849f2[_0x4100ee(0x221)][_0x4100ee(0x1c6)](/\r?\n/)[_0x4100ee(0x24a)](_0x5ce08b=>{const _0x1f6be1=_0x4100ee;if(_0x5ce08b[_0x1f6be1(0x25d)]<-0x1820+-0x2358+0x3ba2)return[];const _0x34d6ae=_0x5ce08b[-0x2179+-0x1*-0x89+-0x2*-0x1078];if(_0x34d6ae==='-')return[];const _0x186f66=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x1f6be1(0x253)](_0x5ce08b),_0x985689=_0x186f66?.[0x14e0+0x373+-0x1852*0x1]?.[_0x1f6be1(0x191)]('\x5c','/');return _0x985689===undefined||_0x985689[_0x1f6be1(0x25d)]===-0x1175+-0x1*-0x1983+-0x1*0x80e?[]:[_0x985689];})[_0x4100ee(0x1fd)]((_0x1ebcc4,_0x783164)=>_0x1ebcc4[_0x4100ee(0x198)](_0x783164));}export async function resolveGitRepository(_0x33bb1f,_0x31b397,_0x2ead68){const _0x26e1e9=_0x4148b8,_0x5d5ec3=await realpath(_0x33bb1f);if(_0x31b397[_0x26e1e9(0x25d)]===-0x2d*0xcc+-0x1966+0x3d42)return _0x5d5ec3;if(_0x31b397[_0x26e1e9(0x215)]('\x00')||_0x31b397[_0x26e1e9(0x1af)]('/')||_0x31b397[_0x26e1e9(0x1af)]('\x5c')||_0x31b397[_0x26e1e9(0x1c6)]('/')[_0x26e1e9(0x140)](_0x50b55c=>_0x50b55c[_0x26e1e9(0x25d)]===0x1f9a+-0x18a7+-0x3*0x251||_0x50b55c==='.'||_0x50b55c==='..'))throw new Error(_0x26e1e9(0x18d));try{const _0x5e946b=resolve(_0x5d5ec3,_0x31b397),_0x545c3a=await realpath(_0x5e946b);if(normalizeWorkspacePath(_0x5e946b)!==normalizeWorkspacePath(_0x545c3a)||!isWithinAllowedRoot(_0x545c3a,[_0x5d5ec3]))throw new Error(_0x26e1e9(0x1aa));if(_0x2ead68!==undefined){if(!_0x2ead68[_0x26e1e9(0x215)](_0x31b397))throw new Error(_0x26e1e9(0x1aa));return _0x545c3a;}return await assertGitSuperprojectChain(_0x5d5ec3,_0x545c3a),_0x545c3a;}catch{throw new Error(_0x26e1e9(0x18d));}}export async function resolveGitRepositoryTarget(_0x167aab,_0x203ce9,_0xb5f2a0,_0x2b1135){const _0x9cfda2=_0x4148b8;if(_0xb5f2a0===undefined)return resolveGitRepository(_0x167aab,_0x203ce9,_0x2b1135);if(_0x203ce9[_0x9cfda2(0x25d)]!==0x1*-0x955+0x1219+-0x2*0x462||_0xb5f2a0[_0x9cfda2(0x25d)]===0x159e+-0x1*-0x1639+-0x2bd7||_0xb5f2a0[_0x9cfda2(0x25d)]>-0x311+-0x3*-0x262+0x9*0x153||_0xb5f2a0[_0x9cfda2(0x215)]('\x00'))throw new Error(_0x9cfda2(0x18d));const _0x505fb0=normalizeWorkspacePath(_0xb5f2a0),_0x2fc3ac=await listGitWorktrees(_0x167aab),_0x3388ec=_0x2fc3ac[_0x9cfda2(0x195)][_0x9cfda2(0x22e)](_0x1bf836=>normalizeWorkspacePath(_0x1bf836[_0x9cfda2(0x250)])===_0x505fb0);if(_0x3388ec===undefined||_0x3388ec[_0x9cfda2(0x174)])throw new Error(_0x9cfda2(0x18d));try{return await realpath(_0x3388ec[_0x9cfda2(0x250)]);}catch{throw new Error(_0x9cfda2(0x18d));}}async function assertGitSuperprojectChain(_0x1451a3,_0xcf3a87){const _0x44c58a=_0x4148b8,_0x13e20f=normalizeWorkspacePath(_0x1451a3);let _0x3871aa=_0xcf3a87;const _0x28c5d7=new Set();for(let _0x41f19e=-0x714+-0x1e7b+0x258f;_0x41f19e<0x818*0x1+-0x1568+0xd90;_0x41f19e+=-0x1*0x2498+-0xad3+-0x5*-0x97c){const _0x760531=normalizeWorkspacePath(_0x3871aa);if(_0x760531===_0x13e20f)return;if(_0x28c5d7[_0x44c58a(0x17d)](_0x760531))throw new Error(_0x44c58a(0x1aa));_0x28c5d7[_0x44c58a(0x164)](_0x760531);const _0x18808e=await runReadOnlyGit(_0x3871aa,[_0x44c58a(0x1b7),_0x44c58a(0x254),_0x44c58a(0x161)]),[_0x1e337f,_0x3a3ae1]=_0x18808e[_0x44c58a(0x221)][_0x44c58a(0x1c6)](/\r?\n/);if(_0x1e337f===undefined||_0x3a3ae1===undefined||_0x3a3ae1[_0x44c58a(0x25d)]===-0x2383+0x14f7+0x2*0x746)throw new Error(_0x44c58a(0x1aa));const _0x2740f0=await realpath(_0x1e337f),_0x1db666=await realpath(_0x3a3ae1);if(normalizeWorkspacePath(_0x2740f0)!==_0x760531||normalizeWorkspacePath(_0x1db666)===_0x760531||!isWithinAllowedRoot(_0x1db666,[_0x1451a3])||!isWithinAllowedRoot(_0x3871aa,[_0x1db666]))throw new Error(_0x44c58a(0x1aa));_0x3871aa=_0x1db666;}throw new Error(_0x44c58a(0x1aa));}export async function listGitHistoryRefs(_0x5da424){const _0x4d4e55=_0x4148b8,_0x56551e=await runReadOnlyGit(_0x5da424,[_0x4d4e55(0x23d),_0x4d4e55(0x243),_0x4d4e55(0x173),_0x4d4e55(0x141)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x56551e[_0x4d4e55(0x221)][_0x4d4e55(0x1c6)](/\r?\n/)[_0x4d4e55(0x24a)](_0x2a105c=>{const _0x2ab5bc=_0x4d4e55,[_0x204363,_0x28f866,_0x443aee,_0x5c2a5d,_0x23b029]=_0x2a105c[_0x2ab5bc(0x1c6)]('\x09');if(_0x204363===undefined||_0x28f866===undefined||_0x443aee===undefined||_0x23b029===undefined||_0x23b029[_0x2ab5bc(0x25d)]>0x3c3*0x1+-0xbeb+0x20a*0x4||!/^[0-9a-f]{40,64}$/[_0x2ab5bc(0x194)](_0x443aee))return[];const _0x5d0301=_0x204363[_0x2ab5bc(0x1af)](_0x2ab5bc(0x214))?_0x2ab5bc(0x247):_0x204363[_0x2ab5bc(0x1af)](_0x2ab5bc(0x1a3))?_0x2ab5bc(0x233):undefined;return _0x5d0301===undefined?[]:[{'name':_0x204363,'displayName':_0x28f866,'kind':_0x5d0301,'hash':_0x443aee,'current':_0x5c2a5d==='*'}];})[_0x4d4e55(0x1fd)]((_0x240d24,_0x335bf8)=>_0x240d24[_0x4d4e55(0x16c)][_0x4d4e55(0x198)](_0x335bf8[_0x4d4e55(0x16c)])||_0x240d24[_0x4d4e55(0x25a)][_0x4d4e55(0x198)](_0x335bf8[_0x4d4e55(0x25a)]));}function selectedHistoryRefs(_0x264e8f,_0x4eb7af){const _0x5ec09c=_0x4148b8;if(_0x4eb7af===undefined||_0x4eb7af[_0x5ec09c(0x25d)]===0x217d*-0x1+0x11*-0x1eb+0x2f*0x168)return _0x264e8f;const _0x1abca0=[...new Set(_0x4eb7af)],_0x369a96=_0x1abca0[_0x5ec09c(0x1ca)](_0x492f2f=>_0x264e8f[_0x5ec09c(0x22e)](_0x3aabad=>_0x3aabad[_0x5ec09c(0x151)]===_0x492f2f));if(_0x369a96[_0x5ec09c(0x140)](_0x14f74a=>_0x14f74a===undefined))throw new Error(_0x5ec09c(0x229));return _0x369a96;}function historyCursor(_0x40188b,_0x430928){const _0x20c431=_0x4148b8;return Buffer[_0x20c431(0x158)](JSON[_0x20c431(0x238)]({'offset':_0x40188b,'fingerprint':_0x430928}))[_0x20c431(0x1b9)](_0x20c431(0x14b));}function parseHistoryCursor(_0x3ac63a,_0x4c3022){const _0x45bf88=_0x4148b8;if(_0x3ac63a===undefined)return-0x19*0x59+-0x1bd*0x9+0x1856;try{const _0x1ffdbf=JSON[_0x45bf88(0x144)](Buffer[_0x45bf88(0x158)](_0x3ac63a,_0x45bf88(0x14b))[_0x45bf88(0x1b9)](_0x45bf88(0x19b)));if(!Number[_0x45bf88(0x1a6)](_0x1ffdbf[_0x45bf88(0x1df)])||_0x1ffdbf[_0x45bf88(0x1df)]<0x1bde+-0x1*0x16d3+-0x1*0x50b||_0x1ffdbf[_0x45bf88(0x1b6)]!==_0x4c3022)throw new Error(_0x45bf88(0x1aa));return _0x1ffdbf[_0x45bf88(0x1df)];}catch{throw new Error(_0x45bf88(0x1eb));}}export async function readGitHistory(_0x15e332,_0x24eea9){const _0x2aee87=_0x4148b8,_0x3cdce2=await listGitHistoryRefs(_0x15e332),_0x5e7fa2=selectedHistoryRefs(_0x3cdce2,_0x24eea9[_0x2aee87(0x146)]);if(_0x5e7fa2[_0x2aee87(0x25d)]===0x5*-0x6eb+0x16*-0x16b+-0x1*-0x41c9)return{'commits':[],'nextCursor':null};const _0x477e4c=_0x24eea9[_0x2aee87(0x1b4)]??-0xa92+-0x979+0x21*0x9d;if(!Number[_0x2aee87(0x1a6)](_0x477e4c)||_0x477e4c<0x4*-0x7df+-0x1*-0x25a6+0x53*-0x13||_0x477e4c>-0x1c0+-0xcfb+-0x4f*-0x31)throw new Error(_0x2aee87(0x20b));const _0xb79488=_0x5e7fa2[_0x2aee87(0x1ca)](_0x5ca677=>_0x5ca677[_0x2aee87(0x151)])[_0x2aee87(0x1fd)](),_0x8b59e2=_0x24eea9[_0x2aee87(0x146)]===undefined||_0x24eea9[_0x2aee87(0x146)][_0x2aee87(0x25d)]===0xb*-0x1cd+0x8f1+0xade||_0x5e7fa2[_0x2aee87(0x25d)]===_0x3cdce2[_0x2aee87(0x25d)]&&_0x5e7fa2[_0x2aee87(0x1da)](_0x45abd5=>_0x3cdce2[_0x2aee87(0x140)](_0x1c3d19=>_0x1c3d19[_0x2aee87(0x151)]===_0x45abd5[_0x2aee87(0x151)])),_0x503b21=_0x8b59e2?[_0x2aee87(0x200),_0x2aee87(0x208)]:_0xb79488,_0x2121da=createHash(_0x2aee87(0x23a))[_0x2aee87(0x219)](_0x5e7fa2[_0x2aee87(0x1ca)](_0x387efc=>_0x387efc[_0x2aee87(0x151)]+'\x00'+_0x387efc[_0x2aee87(0x154)])[_0x2aee87(0x1fd)]()[_0x2aee87(0x188)]('\x00'))[_0x2aee87(0x1a2)](_0x2aee87(0x1cf)),_0xc311f5=parseHistoryCursor(_0x24eea9[_0x2aee87(0x1d3)],_0x2121da),_0x4722a3=await runReadOnlyGit(_0x15e332,[_0x2aee87(0x22d),_0x2aee87(0x166),_0x2aee87(0x21e),_0x2aee87(0x1d8)+_0xc311f5,_0x2aee87(0x16e)+(_0x477e4c+(-0x20f0+-0x69c+-0x1*-0x278d)),'-z',_0x2aee87(0x1c8),..._0x503b21,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x5795d5=new Map();for(const _0x23f582 of _0x3cdce2){const _0x11d369=_0x5795d5[_0x2aee87(0x23f)](_0x23f582[_0x2aee87(0x154)])??[];_0x11d369[_0x2aee87(0x17f)](_0x23f582[_0x2aee87(0x25a)]),_0x5795d5[_0x2aee87(0x177)](_0x23f582[_0x2aee87(0x154)],_0x11d369);}const _0x36d517=_0x4722a3[_0x2aee87(0x221)][_0x2aee87(0x1c6)]('\x00'),_0x411f1b=[];for(let _0x2d177c=0x12d*0x21+0x1dc8+-0x4495;_0x2d177c+(-0x2434+0x17bb+0x63f*0x2)<_0x36d517[_0x2aee87(0x25d)];_0x2d177c+=0x4*-0x92+-0x16*-0x37+-0xa*0x3e){const [_0x5a6fa2,_0x4df1cd='',_0x2cd99e='',_0x26a53c='',_0x466776='0',_0x40b35f='']=_0x36d517[_0x2aee87(0x20c)](_0x2d177c,_0x2d177c+(-0x1a3*0x5+-0x210e+0x2943));if(_0x5a6fa2===undefined||!/^[0-9a-f]{40,64}$/[_0x2aee87(0x194)](_0x5a6fa2))continue;_0x411f1b[_0x2aee87(0x17f)]({'hash':_0x5a6fa2,'parents':_0x4df1cd[_0x2aee87(0x25d)]===0xd9*0x13+-0x682*-0x1+-0x169d?[]:_0x4df1cd[_0x2aee87(0x1c6)]('\x20'),'authorName':_0x2cd99e,'authorEmail':_0x26a53c,'committedAt':Number(_0x466776)*(-0x559*-0x7+-0x20f6*-0x1+-0x427d*0x1),'subject':_0x40b35f,'refs':_0x5795d5[_0x2aee87(0x23f)](_0x5a6fa2)??[]});}const _0xe4656b=_0x411f1b[_0x2aee87(0x25d)]>_0x477e4c;return{'commits':_0x411f1b[_0x2aee87(0x20c)](-0x43*0x61+-0x8*-0x2f9+0x19b,_0x477e4c),'nextCursor':_0xe4656b?historyCursor(_0xc311f5+_0x477e4c,_0x2121da):null};}async function assertHistoryCommitReachable(_0x1252bd,_0x529bd3,_0x148922){const _0x4ee98f=_0x4148b8;if(!/^[0-9a-f]{40,64}$/[_0x4ee98f(0x194)](_0x529bd3))throw new Error(_0x4ee98f(0x223));const _0x39b95a=selectedHistoryRefs(await listGitHistoryRefs(_0x1252bd),_0x148922);for(const _0xab1389 of _0x39b95a){const _0x218216=await runReadOnlyGitAllowFailure(_0x1252bd,[_0x4ee98f(0x1de),_0x4ee98f(0x184),_0x529bd3,_0xab1389[_0x4ee98f(0x151)]]);if(_0x218216[_0x4ee98f(0x14d)]===-0x1eef+-0x1382+-0x3271*-0x1)return;}throw new Error(_0x4ee98f(0x223));}export async function readGitHistoryFiles(_0x2b5fc3,_0x4da142,_0x56e744){const _0x24a969=_0x4148b8;await assertHistoryCommitReachable(_0x2b5fc3,_0x4da142,_0x56e744);const _0x382037=await runReadOnlyGit(_0x2b5fc3,[_0x24a969(0x178),_0x24a969(0x1bf),_0x24a969(0x1ed),_0x24a969(0x1d6),'-r','-z','-M','-C',_0x24a969(0x134),_0x4da142],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x5fa00e=_0x382037[_0x24a969(0x221)][_0x24a969(0x1c6)]('\x00'),_0x24315c=[];for(let _0x539b96=-0xa5c+0x24f4+0x353*-0x8;_0x539b96<_0x5fa00e[_0x24a969(0x25d)];_0x539b96+=0x351+-0x2086*-0x1+-0xbf2*0x3){const _0x534317=_0x5fa00e[_0x539b96];if(_0x534317===undefined||_0x534317[_0x24a969(0x25d)]===0x129f+0x9a9+-0x1c48)continue;const _0x16edb8=_0x534317[0x403*-0x5+-0x16f+0x157e]??'M';if(_0x16edb8==='R'||_0x16edb8==='C'){const _0x44c352=_0x5fa00e[_0x539b96+(0x23*-0x43+0x1*0x178+0x3d9*0x2)],_0x3b7616=_0x5fa00e[_0x539b96+(-0x4*0x3af+0x1dfa+0x41*-0x3c)];if(_0x44c352!==undefined&&_0x3b7616!==undefined)_0x24315c[_0x24a969(0x17f)]({'path':_0x3b7616,'previousPath':_0x44c352,'change':gitChange(_0x16edb8)});_0x539b96+=-0x54*0x52+0x1341+0x7a9;}else{const _0x2d13cb=_0x5fa00e[_0x539b96+(-0x13*-0xe1+0x1b25*0x1+0xe9d*-0x3)];if(_0x2d13cb!==undefined)_0x24315c[_0x24a969(0x17f)]({'path':_0x2d13cb,'change':gitChange(_0x16edb8)});_0x539b96+=-0x20bd+0x2d7*-0xb+0x1*0x3ffb;}}return _0x24315c;}export async function readGitHistoryFileDiff(_0x40c4a3,_0x4a4f4c,_0x306f8d,_0x2babf7,_0x400131){const _0x33ac6d=_0x4148b8;await assertHistoryCommitReachable(_0x40c4a3,_0x4a4f4c,_0x2babf7);const _0x13591f=safeGitWorkspacePath(_0x306f8d),_0x1255bc=_0x400131===undefined?undefined:safeGitWorkspacePath(_0x400131),_0x27a38f=await runReadOnlyGit(_0x40c4a3,[_0x33ac6d(0x1dd),_0x33ac6d(0x1cd),_0x33ac6d(0x1ed),_0x33ac6d(0x137),_0x33ac6d(0x1c0),_0x4a4f4c,'--',_0x33ac6d(0x1c9)+_0x13591f,..._0x1255bc===undefined||_0x1255bc===_0x13591f?[]:[_0x33ac6d(0x1c9)+_0x1255bc]]),_0x162c07=_0x27a38f[_0x33ac6d(0x159)][_0x33ac6d(0x215)](0x1775+0x1*-0x1b05+0x390)||_0x27a38f[_0x33ac6d(0x221)][_0x33ac6d(0x215)](_0x33ac6d(0x255));if(_0x162c07)return{'binary':!![],'summary':_0x33ac6d(0x1b3)+createHash(_0x33ac6d(0x23a))[_0x33ac6d(0x219)](_0x27a38f[_0x33ac6d(0x159)])[_0x33ac6d(0x1a2)](_0x33ac6d(0x1cf))+_0x33ac6d(0x25b)+_0x27a38f[_0x33ac6d(0x159)][_0x33ac6d(0x25d)],'truncated':_0x27a38f[_0x33ac6d(0x1ae)]};return{'binary':![],'text':_0x27a38f[_0x33ac6d(0x221)],'truncated':_0x27a38f[_0x33ac6d(0x1ae)]};}export async function readGitHistoryFileContentRange(_0x49d072,_0x55af28,_0x4c413b,_0x1ccad8,_0x42c03a,_0x1daed9){const _0x449d38=_0x4148b8;if(!Number[_0x449d38(0x1bc)](_0x1ccad8)||_0x1ccad8<-0x1*0x108+0x273*-0x7+0x122d||!Number[_0x449d38(0x1bc)](_0x42c03a)||_0x42c03a<-0x2*0x3c4+0xa6*-0xf+-0x9*-0x1eb||_0x42c03a>(-0x268a+-0x11*-0x21d+0x35*0xd)*(-0x1a54+0x368*-0x4+-0x15fa*-0x2)*(0x1*0x13b+0x5db*-0x3+0x1456)||_0x1ccad8+_0x42c03a>(0x1631+0x28f*0xc+-0x34d1)*(-0xf1d*0x1+0x8e*0x41+0x1*-0x10f1)*(-0x1*0xc16+0x1d7e+0x2*-0x6b4))throw new Error(_0x449d38(0x157));await assertHistoryCommitReachable(_0x49d072,_0x55af28,_0x1daed9);const _0x16f681=safeGitWorkspacePath(_0x4c413b),_0xe0ffb5=_0x55af28+':'+_0x16f681,_0xdf2324=await runReadOnlyGit(_0x49d072,[_0x449d38(0x1fa),'-s',_0xe0ffb5]),_0x565b7e=Number(_0xdf2324[_0x449d38(0x221)][_0x449d38(0x23b)]());if(!Number[_0x449d38(0x1bc)](_0x565b7e)||_0x565b7e<-0x21e8+0xc6c+0x157c||_0x1ccad8>_0x565b7e)throw new Error(_0x449d38(0x157));if(_0x1ccad8===_0x565b7e)return{'path':_0x16f681,'size':_0x565b7e,'offset':_0x1ccad8,'contentBase64':'','nextOffset':null};const _0xfc2bc7=await runReadOnlyGitAllowFailure(_0x49d072,[_0x449d38(0x1fa),_0x449d38(0x1d1),_0xe0ffb5],{'outputLimit':_0x1ccad8+_0x42c03a,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0xfc2bc7[_0x449d38(0x14d)]!==0x62*-0x3e+-0x1d7d+0x19*0x221)throw new GitCommandError(_0xfc2bc7[_0x449d38(0x14d)],_0xfc2bc7[_0x449d38(0x181)]);const _0x4e332c=_0xfc2bc7[_0x449d38(0x159)][_0x449d38(0x182)](_0x1ccad8,Math[_0x449d38(0x145)](_0x565b7e,_0x1ccad8+_0x42c03a)),_0x41a328=_0x1ccad8+_0x4e332c[_0x449d38(0x25d)];return{'path':_0x16f681,'size':_0x565b7e,'offset':_0x1ccad8,'contentBase64':_0x4e332c[_0x449d38(0x1b9)](_0x449d38(0x24b)),'nextOffset':_0x41a328<_0x565b7e?_0x41a328:null};}function _0x2b8d(_0x47b59d,_0x192d18){_0x47b59d=_0x47b59d-(-0x3*0x9ed+0x1*-0x813+0x270c);const _0x359c05=_0x5465();let _0x4b0ad2=_0x359c05[_0x47b59d];if(_0x2b8d['ImfTyr']===undefined){var _0xfaab6e=function(_0x387462){const _0x2d8968='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11e626='',_0x4ab76b='';for(let _0x3ce76a=-0x2*0x8f3+0x67*0x4f+-0xf*0xed,_0x435886,_0xd9ea81,_0x173bf7=0x51c+-0x601*0x2+0x6e6*0x1;_0xd9ea81=_0x387462['charAt'](_0x173bf7++);~_0xd9ea81&&(_0x435886=_0x3ce76a%(-0x3c1+-0x527*-0x1+-0x3b*0x6)?_0x435886*(-0xe*0x291+-0x25a8*-0x1+-0x7e*0x3)+_0xd9ea81:_0xd9ea81,_0x3ce76a++%(-0x1*0x2c5+0x1*-0x14c2+0x178b))?_0x11e626+=String['fromCharCode'](0x224e+-0x248c+-0x1*-0x33d&_0x435886>>(-(-0x233+0x10f*0x4+-0x207)*_0x3ce76a&-0x521+-0x2*0xcec+0x1eff)):0x3*0x547+-0x1d24+0xd4f*0x1){_0xd9ea81=_0x2d8968['indexOf'](_0xd9ea81);}for(let _0x51368b=-0x199+0x1*-0x21a1+-0x3*-0xbbe,_0x72e5fd=_0x11e626['length'];_0x51368b<_0x72e5fd;_0x51368b++){_0x4ab76b+='%'+('00'+_0x11e626['charCodeAt'](_0x51368b)['toString'](0x5*0x4e7+-0x1*-0x19a8+0x7f*-0x65))['slice'](-(-0x5e6+-0x67b+-0xc63*-0x1));}return decodeURIComponent(_0x4ab76b);};_0x2b8d['VsaDso']=_0xfaab6e,_0x2b8d['UoyNfn']={},_0x2b8d['ImfTyr']=!![];}const _0x834a3e=_0x359c05[0xaf9*0x2+-0xb2*0x1+-0x1540];_0x2b8d['SlKgwT']!==_0x834a3e&&(_0x2b8d['UoyNfn']={},_0x2b8d['SlKgwT']=_0x834a3e);const _0x44541b=_0x2b8d['UoyNfn'][_0x47b59d];return _0x44541b===undefined?(_0x4b0ad2=_0x2b8d['VsaDso'](_0x4b0ad2),_0x2b8d['UoyNfn'][_0x47b59d]=_0x4b0ad2):_0x4b0ad2=_0x44541b,_0x4b0ad2;}export async function readCurrentChanges(_0x165bc0){const _0x10862b=_0x4148b8;return(await readCurrentChangesSummary(_0x165bc0))[_0x10862b(0x23e)];}export async function readCurrentChangeDiff(_0x649931,_0x200987){const _0x4bacca=_0x4148b8,_0x467692=safeGitWorkspacePath(_0x200987);await assertCurrentChangePathAccessible(_0x649931,_0x467692);const _0x3489b1=await readCurrentChangeGitDiff(_0x649931,_0x467692),_0x1759ff=await readWorkingTreeText(_0x649931,_0x467692),_0x2227f4=_0x3489b1[_0x4bacca(0x159)][_0x4bacca(0x215)](0x101f*0x1+-0x475+0x1*-0xbaa)||_0x3489b1[_0x4bacca(0x221)][_0x4bacca(0x215)](_0x4bacca(0x255))||_0x1759ff?.[_0x4bacca(0x1e8)]===!![];if(_0x2227f4)return{'binary':!![],'summary':_0x4bacca(0x1b3)+createHash(_0x4bacca(0x23a))[_0x4bacca(0x219)](_0x3489b1[_0x4bacca(0x159)])[_0x4bacca(0x1a2)](_0x4bacca(0x1cf))+_0x4bacca(0x25b)+_0x3489b1[_0x4bacca(0x159)][_0x4bacca(0x25d)],'truncated':_0x3489b1[_0x4bacca(0x1ae)]||_0x1759ff?.[_0x4bacca(0x1ae)]===!![]};return{'binary':![],'text':_0x3489b1[_0x4bacca(0x221)],'truncated':_0x3489b1[_0x4bacca(0x1ae)]||_0x1759ff?.[_0x4bacca(0x1ae)]===!![],'afterText':_0x1759ff?.[_0x4bacca(0x221)]??'',..._0x1759ff===undefined?{}:{'afterTruncated':_0x1759ff[_0x4bacca(0x1ae)]}};}async function readCurrentChangeGitDiff(_0x2b5df2,_0x1490f3){const _0x4d98af=_0x4148b8,_0x28369d=await runReadOnlyGit(_0x2b5df2,[_0x4d98af(0x1c7),_0x4d98af(0x171),_0x4d98af(0x18f),'-z','--',_0x4d98af(0x1c9)+_0x1490f3]);if(_0x28369d[_0x4d98af(0x221)][_0x4d98af(0x1c6)]('\x00')[_0x4d98af(0x215)](_0x1490f3)){const _0xe79fba=await runReadOnlyGitAllowFailure(_0x2b5df2,[_0x4d98af(0x1c4),_0x4d98af(0x183),_0x4d98af(0x137),_0x4d98af(0x1c0),'--',_0x4d98af(0x19f),_0x1490f3]);if(_0xe79fba[_0x4d98af(0x14d)]!==0xcb*0x5+-0xe9f+0xaa8&&_0xe79fba[_0x4d98af(0x14d)]!==-0xc5*0x25+-0x941+0x25bb)throw new GitCommandError(_0xe79fba[_0x4d98af(0x14d)],_0xe79fba[_0x4d98af(0x181)]);return _0xe79fba;}return runReadOnlyGit(_0x2b5df2,[_0x4d98af(0x1c4),_0x4d98af(0x137),_0x4d98af(0x1c0),_0x4d98af(0x1d0),'--',_0x4d98af(0x1c9)+_0x1490f3]);}export async function isWorkspaceChangeVisible(_0x21afb9,_0x5edf2e){const _0x4682a3=_0x4148b8;try{return await assertCurrentChangePathAccessible(_0x21afb9,safeGitWorkspacePath(_0x5edf2e)),!![];}catch(_0x2cc0ba){if(_0x2cc0ba instanceof Error&&(_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x13c)||_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x1f6)||_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x1ba)))return![];throw _0x2cc0ba;}}async function assertCurrentChangePathAccessible(_0x504016,_0x6df596){const _0x30544d=_0x4148b8,_0x20bd19=await realpath(_0x504016),_0x5469f4=resolve(_0x20bd19,_0x6df596),_0x260644=await lstat(_0x5469f4)[_0x30544d(0x18a)](_0x160ce1=>{const _0x4a2096=_0x30544d;if(_0x160ce1[_0x4a2096(0x14d)]===_0x4a2096(0x172))return undefined;throw _0x160ce1;});if(_0x260644===undefined)return;await resolveWorkspaceEntry(_0x20bd19,_0x6df596,![]);}async function readWorkingTreeText(_0x4fb43b,_0x53b82e){const _0x3c1b03=_0x4148b8,_0x437351=await realpath(_0x4fb43b);let _0x493074;try{_0x493074=await resolveWorkspaceEntry(_0x437351,_0x53b82e,![]);}catch(_0x53220b){if(_0x53220b instanceof Error&&_0x53220b[_0x3c1b03(0x1ac)]===_0x3c1b03(0x1f6))return undefined;throw _0x53220b;}const _0x24cdc4=await lstat(_0x493074);if(!_0x24cdc4[_0x3c1b03(0x251)]())return undefined;const _0x43d191=await readFile(_0x493074);return diffTextFromBuffer(_0x43d191,_0x43d191[_0x3c1b03(0x25d)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x2752c7,_0x2e8d4f){const _0x393971=_0x4148b8;if(_0x2752c7[_0x393971(0x215)](0x1e68+-0x2366+0x4fe)||!isValidUtf8(_0x2752c7))return{'binary':!![],'truncated':_0x2e8d4f};let _0x1d5c6c=Math[_0x393971(0x145)](_0x2752c7[_0x393971(0x25d)],GIT_OUTPUT_LIMIT);while(_0x1d5c6c>0x44*0xc+-0x1875+0x9*0x25d&&_0x1d5c6c<_0x2752c7[_0x393971(0x25d)]&&isUtf8ContinuationByte(_0x2752c7[_0x1d5c6c]))_0x1d5c6c-=0x28*-0x36+-0xc*0x12d+0x168d;return{'binary':![],'text':_0x2752c7[_0x393971(0x182)](0x1c01+-0x689+-0x728*0x3,_0x1d5c6c)[_0x393971(0x1b9)](_0x393971(0x19b)),'truncated':_0x2e8d4f};}export async function restoreCurrentChange(_0x20f976,_0x4e6ac5,_0x1778d6){const _0x59f18e=_0x4148b8,_0x123890=safeGitWorkspacePath(_0x4e6ac5),_0x154619=_0x59f18e(0x1c9)+_0x123890;if(_0x1778d6===_0x59f18e(0x14c)){const _0x32ca8b=await runReadOnlyGit(_0x20f976,[_0x59f18e(0x24c),_0x59f18e(0x260),'-z',_0x59f18e(0x217),'--',_0x154619]);if(!_0x32ca8b[_0x59f18e(0x221)][_0x59f18e(0x1c6)]('\x00')[_0x59f18e(0x140)](_0x23f016=>_0x23f016[_0x59f18e(0x1af)](_0x59f18e(0x21a))&&_0x23f016[_0x59f18e(0x20c)](-0x11e7+0x1d11+-0xb27)===_0x123890))throw new Error(_0x59f18e(0x1fe));const _0x168d26=await realpath(_0x20f976),_0x5ac0fc=resolve(_0x168d26,_0x123890),_0x5c9b63=await lstat(_0x5ac0fc);if(!_0x5c9b63[_0x59f18e(0x251)]()||_0x5c9b63[_0x59f18e(0x19a)]())throw new Error(_0x59f18e(0x1fe));await unlink(_0x5ac0fc);return;}if(_0x1778d6===_0x59f18e(0x256)){await runGit(_0x20f976,[_0x59f18e(0x18c),_0x59f18e(0x248),'--',_0x154619]);return;}await runGit(_0x20f976,[_0x59f18e(0x18c),_0x59f18e(0x15b),_0x59f18e(0x220),_0x59f18e(0x248),'--',_0x154619]);}function safeGitWorkspacePath(_0xc9ecba){const _0x5d1d5b=_0x4148b8;if(_0xc9ecba[_0x5d1d5b(0x25d)]===-0xf35+-0x102*-0x3+0x1*0xc2f||_0xc9ecba[_0x5d1d5b(0x215)]('\x00')||_0xc9ecba[_0x5d1d5b(0x1af)]('/')||_0xc9ecba[_0x5d1d5b(0x1af)]('\x5c'))throw new Error(_0x5d1d5b(0x13c));const _0x1fe078=_0xc9ecba[_0x5d1d5b(0x191)]('\x5c','/');if(_0x1fe078[_0x5d1d5b(0x1c6)]('/')[_0x5d1d5b(0x140)](_0x2fbb17=>_0x2fbb17===''||_0x2fbb17==='..'||_0x2fbb17===_0x5d1d5b(0x216)))throw new Error(_0x5d1d5b(0x13c));return _0x1fe078;}function gitChange(_0x6195b0){const _0x39c5f0=_0x4148b8;if(_0x6195b0==='A')return _0x39c5f0(0x155);if(_0x6195b0==='D')return _0x39c5f0(0x202);if(_0x6195b0==='R')return _0x39c5f0(0x139);if(_0x6195b0==='C')return _0x39c5f0(0x1d7);if(_0x6195b0==='T')return _0x39c5f0(0x1c2);return _0x39c5f0(0x136);}export class GitCommandError extends Error{[_0x4148b8(0x14d)];[_0x4148b8(0x181)];constructor(_0xe8430f,_0x1cac9a){const _0x5d4968=_0x4148b8;super(_0x5d4968(0x1d9)),this[_0x5d4968(0x14d)]=_0xe8430f,this[_0x5d4968(0x181)]=_0x1cac9a;}}async function runReadOnlyGit(_0x1fe885,_0x256762,_0xdde95={}){return runGit(_0x1fe885,_0x256762,{..._0xdde95,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0x29b8c2,_0x361b1f,_0x5effda={}){return runGitAllowFailure(_0x29b8c2,_0x361b1f,{..._0x5effda,'readOnly':!![]});}async function runGit(_0x1012ca,_0x35bf07,_0x4dc9d4={}){const _0x30f38b=_0x4148b8,_0x138835=await runGitAllowFailure(_0x1012ca,_0x35bf07,_0x4dc9d4);if(_0x138835[_0x30f38b(0x14d)]!==0x1*-0xeff+0x2357+-0x1458)throw new GitCommandError(_0x138835[_0x30f38b(0x14d)],_0x138835[_0x30f38b(0x181)]);return _0x138835;}async function runGitAllowFailure(_0x11fd55,_0x1ba742,_0x152b56={}){return new Promise((_0x193a5b,_0x13726d)=>{const _0x264750=_0x2b8d,_0x5984a9=_0x152b56[_0x264750(0x1b5)]??GIT_OUTPUT_LIMIT,_0x5b8d1e=spawn(_0x264750(0x19c),[..._0x1ba742],{'cwd':_0x11fd55,'shell':![],'windowsHide':!![],'stdio':[_0x264750(0x257),_0x264750(0x209),_0x264750(0x209)],..._0x152b56[_0x264750(0x18e)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x5baae1=[],_0x1a5aa3=[];let _0x203cc9=-0x1*-0x122c+0xbd4*-0x1+0x658*-0x1,_0x1ceeb5=-0x66e+-0x16a*-0x1a+-0x1e56,_0xe2fd4a=![];const _0x45b87f=setTimeout(()=>{const _0x48893d=_0x264750;if(process[_0x48893d(0x206)]===_0x48893d(0x1f1)){const _0x449eda=_0x5b8d1e[_0x48893d(0x1a9)];if(_0x449eda===undefined){_0x5b8d1e[_0x48893d(0x1a7)](_0x48893d(0x135));return;}void terminateProcessTree({'pid':_0x449eda,'kill':_0x4d49f4=>_0x5b8d1e[_0x48893d(0x1a7)](_0x4d49f4)},_0x48893d(0x1f1))[_0x48893d(0x18a)](()=>{const _0x22176c=_0x48893d;try{_0x5b8d1e[_0x22176c(0x1a7)](_0x22176c(0x135));}catch{}});return;}_0x5b8d1e[_0x48893d(0x1a7)](_0x48893d(0x135));},_0x152b56[_0x264750(0x22f)]??GIT_TIMEOUT_MS);_0x5b8d1e[_0x264750(0x20d)]['on'](_0x264750(0x224),_0x155270=>{const _0x1eee6d=_0x264750,_0x250b82=Math[_0x1eee6d(0x204)](0x668+-0x475*-0x3+-0x13c7,_0x5984a9-_0x203cc9);if(_0x250b82>0x1*0xd5a+-0x453*0x9+0x253*0xb){const _0x139e00=_0x155270[_0x1eee6d(0x182)](0xa3e+0xcf5*0x1+-0x1*0x1733,_0x250b82);_0x5baae1[_0x1eee6d(0x17f)](_0x139e00),_0x203cc9+=_0x139e00[_0x1eee6d(0x25d)];}_0xe2fd4a||=_0x155270[_0x1eee6d(0x25d)]>_0x250b82;}),_0x5b8d1e[_0x264750(0x181)]['on'](_0x264750(0x224),_0x32a541=>{const _0x9306a8=_0x264750,_0x2cc178=Math[_0x9306a8(0x204)](-0x239e+-0x1462+0x3800,-0x1a66*0x1+0x790+0x22d6-_0x1ceeb5);if(_0x2cc178===-0xa8a+0x1f86+-0x14fc)return;const _0x4fe351=_0x32a541[_0x9306a8(0x182)](0x35e+-0x4*0xa3+-0xf*0xe,_0x2cc178);_0x1a5aa3[_0x9306a8(0x17f)](_0x4fe351),_0x1ceeb5+=_0x4fe351[_0x9306a8(0x25d)];}),_0x5b8d1e[_0x264750(0x1d2)](_0x264750(0x133),_0x1b6ae1=>{clearTimeout(_0x45b87f),_0x13726d(_0x1b6ae1);}),_0x5b8d1e[_0x264750(0x1d2)](_0x264750(0x15a),_0x502394=>{const _0x38d8a3=_0x264750;clearTimeout(_0x45b87f);const _0x443bd7=Buffer[_0x38d8a3(0x201)](_0x5baae1);_0x193a5b({'code':_0x502394??-0x54d*-0x5+0xffd+0x1*-0x2a7d,'output':_0x443bd7,'text':_0x443bd7[_0x38d8a3(0x1b9)](_0x38d8a3(0x19b)),'stderr':Buffer[_0x38d8a3(0x201)](_0x1a5aa3)[_0x38d8a3(0x1b9)](_0x38d8a3(0x19b)),'truncated':_0xe2fd4a});});});}function isGitUnavailable(_0x3f80df){const _0x56375c=_0x4148b8;return _0x3f80df instanceof Error&&_0x56375c(0x14d)in _0x3f80df&&_0x3f80df[_0x56375c(0x14d)]===_0x56375c(0x172);}function summarizeText(_0x6c4408){const _0x1ed1a2=_0x4148b8;return JSON[_0x1ed1a2(0x238)]({'sha256':createHash(_0x1ed1a2(0x23a))[_0x1ed1a2(0x219)](_0x6c4408)[_0x1ed1a2(0x1a2)](_0x1ed1a2(0x1cf)),'bytes':Buffer[_0x1ed1a2(0x150)](_0x6c4408)});}
|
|
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)});}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.43",
|
|
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.
|
|
29
|
-
"@myagentroam/protocol": "^0.9.
|
|
28
|
+
"@myagentroam/agent": "^0.9.43",
|
|
29
|
+
"@myagentroam/protocol": "^0.9.43"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/ws": "^8.18.1"
|