@myagentroam/node 0.9.26 → 0.9.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/workspace.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* mar-release-protected */
2
- const _0x3dca6f=_0x11df;(function(_0x462f9f,_0x467bce){const _0x3d3bbc=_0x11df,_0x53b700=_0x462f9f();while(!![]){try{const _0xf00e22=parseInt(_0x3d3bbc(0x273))/(-0x17*0x4d+-0x1a*0x121+-0x1223*-0x2)+-parseInt(_0x3d3bbc(0x1cc))/(0x1e37+-0x1be9*-0x1+-0x3a1e)*(-parseInt(_0x3d3bbc(0x1c5))/(0x15d7*0x1+-0x2525+-0x3*-0x51b))+parseInt(_0x3d3bbc(0x1e6))/(-0x1d*0x14f+-0x29*0x61+0x1ac*0x20)+-parseInt(_0x3d3bbc(0x249))/(0xfd6*0x1+0x12*-0x26+-0xd25)+parseInt(_0x3d3bbc(0x1aa))/(-0x160b+-0x4*0x661+-0x3a9*-0xd)+-parseInt(_0x3d3bbc(0x21d))/(-0x847*0x2+0x215*0xd+-0xa7c)*(parseInt(_0x3d3bbc(0x1d1))/(0x1e8d+0x1507+-0x338c))+parseInt(_0x3d3bbc(0x191))/(0x1dcc+0x1133+-0x1*0x2ef6);if(_0xf00e22===_0x467bce)break;else _0x53b700['push'](_0x53b700['shift']());}catch(_0x22cbdf){_0x53b700['push'](_0x53b700['shift']());}}}(_0x58c1,0x110268*0x1+0x1*-0x53c12+-0x165df*0x1));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 _0x2765bd}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';const GIT_TIMEOUT_MS=0x1f15+0xeed+0x2*-0xd3d,GIT_OUTPUT_LIMIT=(-0x1645+-0x15*-0xa5+-0x1*-0xabc)*(-0xed2+0x2311+0x103f*-0x1),FILE_READ_LIMIT=(0x59*-0x4a+-0x2010+-0x3bca*-0x1)*(-0x25eb+0x17b6+-0x1*-0x1235),DIRECTORY_PAGE_LIMIT=-0x2231*-0x1+0x346+-0x24af,DIRECTORY_PICKER_LIMIT=-0x236b*-0x1+0xfd5+-0x154*0x26,SEARCH_RESULT_LIMIT=0x20*0x31+-0x1de6+0x188e,FILE_INDEX_IDLE_TTL_MS=(-0x101*-0x16+-0xabe+-0xb1c)*(-0x174f+-0x2bd+0x1d*0xe8)*(-0x205f+-0x22bc+0x4703),FILE_INDEX_FRESHNESS_TTL_MS=-0x2*-0x1bbc+-0x1*0xc04d+-0x1*-0xfe05,FILE_INDEX_ENTRY_LIMIT=-0x6b6*0x55+0x2b401*-0x1+-0x3*-0x22705,FILE_INDEX_METADATA_CONCURRENCY=0x19*0x115+-0x1e81+0xe5*0x4,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x3dca6f(0x1db),_0x3dca6f(0x222),_0x3dca6f(0x19d),_0x3dca6f(0x27b),_0x3dca6f(0x22e),_0x3dca6f(0x245),_0x3dca6f(0x1a4),_0x3dca6f(0x1df),_0x3dca6f(0x19e),_0x3dca6f(0x258),_0x3dca6f(0x1af),_0x3dca6f(0x1f8),_0x3dca6f(0x183),_0x3dca6f(0x298),_0x3dca6f(0x216),_0x3dca6f(0x1d5),_0x3dca6f(0x22b),_0x3dca6f(0x1c4),_0x3dca6f(0x270),_0x3dca6f(0x254),_0x3dca6f(0x24f),_0x3dca6f(0x27f),_0x3dca6f(0x1e7),_0x3dca6f(0x25c),_0x3dca6f(0x1a6)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x493c3,_0x511b73,_0x58b264){const _0x517d9f=_0x3dca6f,_0xac639b=_0x511b73[_0x517d9f(0x250)]();if(_0xac639b[_0x517d9f(0x1ef)]===-0x1bb1+-0x4*0x80c+0x3be1||_0xac639b[_0x517d9f(0x1ef)]>0x2092+0x2635+0x58*-0xcb||_0xac639b==='.'||_0xac639b==='..'||_0xac639b[_0x517d9f(0x22f)]('/')||_0xac639b[_0x517d9f(0x22f)]('\x5c')||_0xac639b[_0x517d9f(0x22f)]('\x00'))throw new Error(_0x517d9f(0x237));const _0x59323c=await Promise[_0x517d9f(0x269)](_0x58b264[_0x517d9f(0x287)](_0x100e1e=>realpath(_0x100e1e))),_0x32b03d=await realpath(_0x493c3)[_0x517d9f(0x28f)](()=>{const _0xd2ff02=_0x517d9f;throw new Error(_0xd2ff02(0x25b));}),_0x58db30=await stat(_0x32b03d)[_0x517d9f(0x28f)](()=>undefined);if(_0x58db30?.[_0x517d9f(0x221)]()!==!![]||!isWithinAllowedRoot(_0x32b03d,_0x59323c))throw new Error(_0x517d9f(0x25b));const _0x592b82=resolve(_0x32b03d,_0xac639b);if(dirname(_0x592b82)!==_0x32b03d||!isWithinAllowedRoot(_0x592b82,_0x59323c))throw new Error(_0x517d9f(0x237));try{await mkdir(_0x592b82);}catch(_0x2516cb){if(_0x2516cb[_0x517d9f(0x203)]===_0x517d9f(0x18e))throw new Error(_0x517d9f(0x1e0));throw _0x2516cb;}return _0x592b82;}export class WorkspaceFileIndex{[_0x3dca6f(0x1ab)];[_0x3dca6f(0x182)];[_0x3dca6f(0x1b9)]=[];[_0x3dca6f(0x1dd)]=![];[_0x3dca6f(0x21e)];[_0x3dca6f(0x248)];[_0x3dca6f(0x252)]=!![];[_0x3dca6f(0x26f)];[_0x3dca6f(0x199)]=-0x2de*0x2+0x1*-0x2358+0x1de*0x16;[_0x3dca6f(0x1b0)]=-0x130f+-0x1428+-0x2737*-0x1;constructor(_0x4a0521,_0x19771d={}){const _0x54e115=_0x3dca6f;this[_0x54e115(0x1ab)]=_0x4a0521,this[_0x54e115(0x182)]=_0x19771d;}async[_0x3dca6f(0x1e3)](){const _0x87ad66=_0x3dca6f;return await this[_0x87ad66(0x220)](),this[_0x87ad66(0x247)](),{'entries':this[_0x87ad66(0x1b9)][_0x87ad66(0x256)](_0x261b54=>_0x261b54[_0x87ad66(0x196)]===_0x87ad66(0x21a)),'truncated':this[_0x87ad66(0x1dd)]};}[_0x3dca6f(0x26a)](){const _0x2b9ed1=_0x3dca6f;if(this[_0x2b9ed1(0x26f)]!==undefined)clearTimeout(this[_0x2b9ed1(0x26f)]);this[_0x2b9ed1(0x26f)]=undefined,this[_0x2b9ed1(0x1b9)]=[],this[_0x2b9ed1(0x1dd)]=![],this[_0x2b9ed1(0x252)]=!![],this[_0x2b9ed1(0x199)]=-0x6eb+0x1493+0x13*-0xb8,this[_0x2b9ed1(0x1b0)]=0xf23+-0x243e*0x1+-0x709*-0x3;}async[_0x3dca6f(0x19b)](_0x97a128,_0x1efbb2,_0x356a76=SEARCH_RESULT_LIMIT,_0x3cb6c8=![]){const _0x245901=_0x3dca6f;if(_0x97a128[_0x245901(0x250)]()[_0x245901(0x1ef)]===-0x2120+0x159c*0x1+0xb84||_0x97a128[_0x245901(0x1ef)]>-0xa3+0x14f7+-0x1354||!Number[_0x245901(0x181)](_0x356a76)||_0x356a76<-0xafa+-0x2245+-0x2d40*-0x1||_0x356a76>SEARCH_RESULT_LIMIT)throw new Error(_0x245901(0x292));await this[_0x245901(0x220)](),this[_0x245901(0x247)]();const _0x5c539f=decodeSearchCursor(_0x1efbb2,_0x97a128),_0x5dcd1d=_0x5c539f===undefined?undefined:this[_0x245901(0x1b9)][_0x245901(0x1b6)](_0x98a7ad=>_0x98a7ad[_0x245901(0x20a)]===_0x5c539f&&(_0x3cb6c8||_0x98a7ad[_0x245901(0x196)]===_0x245901(0x21a))),_0x78f29=_0x5dcd1d===undefined?-(0x1678+0x1f*0x10d+-0x581*0xa):fuzzyPathScore(_0x5dcd1d[_0x245901(0x20a)],_0x97a128),_0x2f19f0=_0x5dcd1d===undefined||_0x78f29<0x15b8+0xc6+-0x167e?undefined:{'entry':_0x5dcd1d,'score':_0x78f29},_0x14f491=new RankedCandidateHeap(_0x356a76+(-0xecd+0xaf1*0x2+0x714*-0x1));for(const _0x268dd1 of this[_0x245901(0x1b9)]){if(!_0x3cb6c8&&_0x268dd1[_0x245901(0x196)]!==_0x245901(0x21a))continue;const _0x5aa225=fuzzyPathScore(_0x268dd1[_0x245901(0x20a)],_0x97a128);if(_0x5aa225<-0x2456+0xc0e*-0x1+-0x3064*-0x1)continue;const _0x1d38bf={'entry':_0x268dd1,'score':_0x5aa225};if(_0x2f19f0!==undefined&&compareRankedCandidate(_0x1d38bf,_0x2f19f0)<=-0xd*0x2a6+0x696*0x1+0x1bd8)continue;_0x14f491[_0x245901(0x1b7)](_0x1d38bf);}const _0x6937cb=_0x14f491[_0x245901(0x232)](),_0x11af5d=_0x6937cb[_0x245901(0x194)](0x1*0xbbf+0x346+-0xf05,_0x356a76)[_0x245901(0x287)](_0x436831=>_0x436831[_0x245901(0x204)]),_0x4ad95b=_0x6937cb[_0x356a76]?.[_0x245901(0x204)][_0x245901(0x20a)];return{'entries':_0x11af5d,'nextCursor':_0x4ad95b===undefined?null:encodeSearchCursor(_0x97a128,_0x11af5d['at'](-(0xb5*0x1d+0xf7f*0x1+-0x23ff))?.[_0x245901(0x20a)]??_0x5c539f??''),'truncated':_0x4ad95b!==undefined||this[_0x245901(0x1dd)]};}async[_0x3dca6f(0x220)](){const _0x1c595e=_0x3dca6f;if(!this[_0x1c595e(0x252)]&&this[_0x1c595e(0x21e)]!==undefined){if(Date[_0x1c595e(0x23e)]()-this[_0x1c595e(0x1b0)]>=(this[_0x1c595e(0x182)][_0x1c595e(0x26e)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x1c595e(0x206)]();return;}this[_0x1c595e(0x248)]===undefined&&(this[_0x1c595e(0x248)]=this[_0x1c595e(0x201)]()[_0x1c595e(0x19a)](()=>{const _0x3ef906=_0x1c595e;this[_0x3ef906(0x248)]=undefined;})),await this[_0x1c595e(0x248)];}[_0x3dca6f(0x247)](){const _0x5c9527=_0x3dca6f;if(this[_0x5c9527(0x26f)]!==undefined)clearTimeout(this[_0x5c9527(0x26f)]);this[_0x5c9527(0x26f)]=setTimeout(()=>this[_0x5c9527(0x26a)](),this[_0x5c9527(0x182)][_0x5c9527(0x1f9)]??FILE_INDEX_IDLE_TTL_MS),this[_0x5c9527(0x26f)][_0x5c9527(0x1eb)]();}async[_0x3dca6f(0x201)](){const _0x5914a2=_0x3dca6f,_0x3f6415=await resolveRegisteredWorkspaceRoot(this[_0x5914a2(0x1ab)]),_0x2609da=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x3f6415)],_0x4d010a=[],_0x1e5f4a=this[_0x5914a2(0x182)][_0x5914a2(0x217)]??FILE_INDEX_ENTRY_LIMIT;let _0x34f661=![];const _0x1deded=['.'];let _0x124f06=-0x12a6+0xcf*0x29+-0xe81;while(_0x124f06<_0x1deded[_0x5914a2(0x1ef)]&&!_0x34f661){const _0x5ef8eb=_0x1deded[_0x124f06];_0x124f06+=-0xb33+0x1*-0x8a9+0x13dd;const _0x437286=await resolveWorkspaceEntryFromCanonicalRoot(_0x3f6415,_0x5ef8eb,!![])[_0x5914a2(0x28f)](()=>undefined);if(_0x437286===undefined)continue;const _0xd0b1ee=await opendir(_0x437286)[_0x5914a2(0x28f)](()=>undefined);if(_0xd0b1ee===undefined)continue;let _0x5d2392=[];const _0x127874=async()=>{const _0x45c84b=_0x5914a2,_0x426060=await Promise[_0x45c84b(0x269)](_0x5d2392);_0x5d2392=[];for(const _0x3432da of _0x426060){if(_0x3432da===undefined)continue;if(_0x3432da[_0x45c84b(0x20a)]===_0x45c84b(0x1c8)||_0x3432da[_0x45c84b(0x20a)][_0x45c84b(0x233)](_0x45c84b(0x27e))||isExcluded(_0x3432da[_0x45c84b(0x20a)],_0x2609da))continue;if(_0x3432da[_0x45c84b(0x196)]===_0x45c84b(0x1e8))_0x1deded[_0x45c84b(0x260)](_0x3432da[_0x45c84b(0x20a)]);_0x4d010a[_0x45c84b(0x260)](_0x3432da);if(_0x4d010a[_0x45c84b(0x1ef)]>=_0x1e5f4a){_0x34f661=!![];break;}}};for await(const _0x526405 of _0xd0b1ee){const _0x198de3=_0x5ef8eb==='.'?_0x526405[_0x5914a2(0x294)]:posix[_0x5914a2(0x1b3)](_0x5ef8eb[_0x5914a2(0x190)]('\x5c','/'),_0x526405[_0x5914a2(0x294)]);if(_0x198de3===_0x5914a2(0x1c8)||_0x198de3[_0x5914a2(0x233)](_0x5914a2(0x27e))||isExcluded(_0x198de3,_0x2609da))continue;_0x5d2392[_0x5914a2(0x260)](inspectWorkspaceIndexEntry(_0x3f6415,_0x198de3,_0x526405[_0x5914a2(0x294)]));if(_0x5d2392[_0x5914a2(0x1ef)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x127874();if(_0x34f661)break;}if(!_0x34f661&&_0x5d2392[_0x5914a2(0x1ef)]>-0x1c4f+0x132b*0x2+-0xa07)await _0x127874();}this[_0x5914a2(0x21e)]=_0x3f6415,this[_0x5914a2(0x1b9)]=_0x4d010a,this[_0x5914a2(0x1dd)]=_0x34f661,this[_0x5914a2(0x252)]=![],this[_0x5914a2(0x199)]=Date[_0x5914a2(0x23e)](),this[_0x5914a2(0x1b0)]=this[_0x5914a2(0x199)];}[_0x3dca6f(0x206)](){const _0x3df3eb=_0x3dca6f;if(this[_0x3df3eb(0x248)]!==undefined)return;this[_0x3df3eb(0x1b0)]=Date[_0x3df3eb(0x23e)](),this[_0x3df3eb(0x248)]=this[_0x3df3eb(0x201)]()[_0x3df3eb(0x28f)](()=>undefined)[_0x3df3eb(0x19a)](()=>{const _0x4b4e6d=_0x3df3eb;this[_0x4b4e6d(0x248)]=undefined;});}}async function workspaceExcludePatterns(_0x5bf9b8){const _0x551b19=_0x3dca6f,_0x31b635=resolve(_0x5bf9b8,_0x551b19(0x262)),_0x4d7c78=await readFile(_0x31b635,_0x551b19(0x210))[_0x551b19(0x23a)](JSON[_0x551b19(0x24e)])[_0x551b19(0x28f)](()=>undefined);if(typeof _0x4d7c78!==_0x551b19(0x1e2)||_0x4d7c78===null)return[];return[_0x551b19(0x226),_0x551b19(0x23d)][_0x551b19(0x208)](_0xc6a751=>{const _0x5e18b1=_0x551b19,_0x528e31=_0x4d7c78[_0xc6a751];return typeof _0x528e31===_0x5e18b1(0x1e2)&&_0x528e31!==null?Object[_0x5e18b1(0x1b9)](_0x528e31)[_0x5e18b1(0x208)](([_0x2e1b56,_0x58d754])=>_0x58d754===!![]?[_0x2e1b56]:[]):[];});}function isExcluded(_0x43efda,_0x45cbe9){const _0x4d94ab=_0x3dca6f;return _0x45cbe9[_0x4d94ab(0x1ba)](_0x4dae38=>minimatch(_0x43efda,_0x4dae38,{'dot':!![],'nocase':_0x2765bd()!==_0x4d94ab(0x1c9)})||minimatch(_0x43efda+'/',_0x4dae38,{'dot':!![],'nocase':_0x2765bd()!==_0x4d94ab(0x1c9)}));}function compareRankedCandidate(_0x569c1b,_0x73e50f){const _0x1b888f=_0x3dca6f;return _0x73e50f[_0x1b888f(0x229)]-_0x569c1b[_0x1b888f(0x229)]||_0x569c1b[_0x1b888f(0x204)][_0x1b888f(0x20a)][_0x1b888f(0x1c1)](_0x73e50f[_0x1b888f(0x204)][_0x1b888f(0x20a)]);}class RankedCandidateHeap{[_0x3dca6f(0x1de)];[_0x3dca6f(0x1fe)]=[];constructor(_0x106f32){const _0x5c1c85=_0x3dca6f;this[_0x5c1c85(0x1de)]=_0x106f32;}[_0x3dca6f(0x1b7)](_0x41581c){const _0x356dc5=_0x3dca6f;if(this[_0x356dc5(0x1fe)][_0x356dc5(0x1ef)]<this[_0x356dc5(0x1de)]){this[_0x356dc5(0x1fe)][_0x356dc5(0x260)](_0x41581c),this[_0x356dc5(0x1ac)](this[_0x356dc5(0x1fe)][_0x356dc5(0x1ef)]-(0x24*0x67+-0x12*0x1b7+0x347*0x5));return;}if(compareRankedCandidate(_0x41581c,this[_0x356dc5(0x1fe)][0x1417*0x1+0x24f8+-0x390f])>=0x16a0+-0x1793+0x3*0x51)return;this[_0x356dc5(0x1fe)][-0x1*-0x53+0x1*0x2311+-0x1*0x2364]=_0x41581c,this[_0x356dc5(0x219)](-0x45*-0x27+-0x1c54+0x11d1);}[_0x3dca6f(0x232)](){const _0x5ee155=_0x3dca6f;return[...this[_0x5ee155(0x1fe)]][_0x5ee155(0x278)](compareRankedCandidate);}[_0x3dca6f(0x1ac)](_0x593a10){const _0x340a9b=_0x3dca6f;let _0x60e4ed=_0x593a10;while(_0x60e4ed>0xb04+0xdbd+-0x1*0x18c1){const _0x164952=Math[_0x340a9b(0x1fc)]((_0x60e4ed-(0x12*-0x16e+-0x3b7*0x4+0x223*0x13))/(-0x17cc+-0x1811+0x5f*0x81));if(compareRankedCandidate(this[_0x340a9b(0x1fe)][_0x60e4ed],this[_0x340a9b(0x1fe)][_0x164952])<=-0x281*-0x3+-0x4e7+-0x29c)break;[this[_0x340a9b(0x1fe)][_0x60e4ed],this[_0x340a9b(0x1fe)][_0x164952]]=[this[_0x340a9b(0x1fe)][_0x164952],this[_0x340a9b(0x1fe)][_0x60e4ed]],_0x60e4ed=_0x164952;}}[_0x3dca6f(0x219)](_0x30ce71){const _0x1b1cea=_0x3dca6f;let _0x7aad6b=_0x30ce71;while(!![]){const _0x171262=_0x7aad6b*(-0x1ecb*-0x1+-0x10*-0x40+-0x22c9)+(-0x1b+-0x54*0x75+0x2680);if(_0x171262>=this[_0x1b1cea(0x1fe)][_0x1b1cea(0x1ef)])return;const _0xcf4784=_0x171262+(0x22c*0xd+-0x23d2+0x1*0x797),_0x5a5779=_0xcf4784<this[_0x1b1cea(0x1fe)][_0x1b1cea(0x1ef)]&&compareRankedCandidate(this[_0x1b1cea(0x1fe)][_0xcf4784],this[_0x1b1cea(0x1fe)][_0x171262])>-0x59+0x392*0x3+-0xa5d?_0xcf4784:_0x171262;if(compareRankedCandidate(this[_0x1b1cea(0x1fe)][_0x5a5779],this[_0x1b1cea(0x1fe)][_0x7aad6b])<=0xb32+0x1749+0x2a7*-0xd)return;[this[_0x1b1cea(0x1fe)][_0x7aad6b],this[_0x1b1cea(0x1fe)][_0x5a5779]]=[this[_0x1b1cea(0x1fe)][_0x5a5779],this[_0x1b1cea(0x1fe)][_0x7aad6b]],_0x7aad6b=_0x5a5779;}}}function fuzzyPathScore(_0x1889fc,_0x59930e){const _0x591a85=_0x3dca6f,_0x365f7e=_0x1889fc[_0x591a85(0x185)](),_0x3f7e69=_0x59930e[_0x591a85(0x250)]()[_0x591a85(0x185)]();let _0xbef70e=0x154+-0x2304+-0x10*-0x21b,_0x2a2d64=-0x2bb+-0x25a0+0x285b*0x1,_0x30b4c8=-(-0x1b60+-0x1d*-0xa+-0x4*-0x690);for(const _0x4279bc of _0x3f7e69){const _0xacf228=_0x365f7e[_0x591a85(0x1b8)](_0x4279bc,_0xbef70e);if(_0xacf228===-(0x2181+0x187*0x11+0xd*-0x493))return-(0x943*0x1+0xdde+-0x5*0x4a0);_0x2a2d64+=_0xacf228===_0x30b4c8+(-0xca*0x1+-0x326*-0x6+-0x29*0x71)?0x1*0xbe7+-0x147*-0x9+-0x7a*0x31:0x8a6+-0x1*-0x7ba+-0x105f;if(_0xacf228===-0xbe8+-0x55b+0x3*0x5c1||_0x591a85(0x189)[_0x591a85(0x22f)](_0x365f7e[_0xacf228-(-0x953+0x1f5+-0x3*-0x275)]??''))_0x2a2d64+=-0x17f7+-0x1500+-0x1*-0x2cff;_0x30b4c8=_0xacf228,_0xbef70e=_0xacf228+(-0x22c1+-0x2079+0x433b);}const _0x30af54=_0x1889fc[_0x591a85(0x194)](_0x1889fc[_0x591a85(0x242)]('/')+(-0x2*0xfb6+0x41*-0x3e+0x2f2b))[_0x591a85(0x185)]();if(_0x30af54[_0x591a85(0x22f)](_0x3f7e69))_0x2a2d64+=0x5*-0x11f+0x2a3+-0xa0*-0x5;else{if(_0x365f7e[_0x591a85(0x22f)](_0x3f7e69))_0x2a2d64+=0x951+0x4*-0x66a+0x1067;}return _0x2a2d64-_0x1889fc[_0x591a85(0x1ef)]/(-0x1b4f*0x1+-0x1*0x1d5a+0x3c91);}export async function listWorkspaceDirectories(_0x549ae7,_0x37a11a,_0x5462d3=homedir()){const _0x2643aa=_0x3dca6f,_0x401c31=await realpath(_0x5462d3),_0x449524=await Promise[_0x2643aa(0x269)](_0x37a11a[_0x2643aa(0x287)](_0x5cf671=>realpath(_0x5cf671))),_0x384def=[...new Set([_0x401c31,..._0x449524])],_0x5743c5=_0x549ae7===undefined?_0x449524[-0x11fb*0x1+0x1*-0x249b+0x3696]??_0x401c31:await realpath(_0x549ae7),_0x8474c2=await stat(_0x5743c5);if(!_0x8474c2[_0x2643aa(0x221)]()||!isWithinAllowedRoot(_0x5743c5,_0x384def))throw new Error(_0x2643aa(0x25b));const _0x47b2d3=await readdir(_0x5743c5,{'withFileTypes':!![]}),_0x3f44b6=[];for(const _0x317b7a of _0x47b2d3[_0x2643aa(0x278)]((_0x2b7d21,_0x3de23c)=>_0x2b7d21[_0x2643aa(0x294)][_0x2643aa(0x1c1)](_0x3de23c[_0x2643aa(0x294)]))){if(!_0x317b7a[_0x2643aa(0x221)]()&&!_0x317b7a[_0x2643aa(0x1f3)]())continue;const _0x1774b3=await realpath(resolve(_0x5743c5,_0x317b7a[_0x2643aa(0x294)]))[_0x2643aa(0x28f)](()=>undefined);if(_0x1774b3===undefined||!isWithinAllowedRoot(_0x1774b3,_0x384def))continue;const _0x585b3e=await stat(_0x1774b3)[_0x2643aa(0x28f)](()=>undefined);if(_0x585b3e===undefined||!_0x585b3e[_0x2643aa(0x221)]())continue;_0x3f44b6[_0x2643aa(0x260)]({'path':_0x1774b3,'name':_0x317b7a[_0x2643aa(0x294)],'selectable':isWithinAllowedRoot(_0x1774b3,_0x449524)});if(_0x3f44b6[_0x2643aa(0x1ef)]>DIRECTORY_PICKER_LIMIT)break;}const _0x3b75ee=dirname(_0x5743c5);return{'homePath':_0x401c31,'currentPath':_0x5743c5,'parentPath':_0x3b75ee===_0x5743c5||!isWithinAllowedRoot(_0x3b75ee,_0x384def)?null:_0x3b75ee,'browseRoots':_0x449524,'selectable':isWithinAllowedRoot(_0x5743c5,_0x449524),'entries':_0x3f44b6[_0x2643aa(0x194)](-0xb2f+0x5a0+0x58f,DIRECTORY_PICKER_LIMIT),'truncated':_0x3f44b6[_0x2643aa(0x1ef)]>DIRECTORY_PICKER_LIMIT};}function _0x58c1(){const _0x3e3b17=['yMfZzty0DxjS','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','y3vYC29Y','y2f0y2G','ls1KyxrLlw9YzgvY','zMLUz2vYChjPBNq','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','zgf0yq','BMfTzq','C3rKB3v0','te9dquW','ls1YB290','kIOVlM5LEhqVkIO','C3rYAw5N','sevbrca','AxntywzLsw50zwDLCG','BgLTAxrZ','kIOVDgvZDc9YDw5ZlYOQ','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','Dg9mB2nHBgvmB3DLCKnHC2u','revmrvrfra','DxrMltG','lM1HCI1LzgL0lq','lY5Flq','BhmTzMLSzxm','y2HHBMDLCW','C3vIBw9KDwXL','B2zMC2v0','ruvysvnu','rKLmrv9ot1rFreLsrunut1jz','CMvWBgfJzufSBa','mte1nta4nJfWueHhEfu','rKLmrv9squ5hrv9jtLzbteLe','AgfZAa','C2XPy2u','ls1NAxqTy29TBw9UlwrPCG','A2LUza','Bw9Kzq','Bwv0ywrHDge','CMvMCMvZAgvKqxq','zMLUywXSEq','C2vHCMnO','rKLmrv9qqvrix0vtq0fqrq','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','kIOVzgLZDc8QkG','ls12zxjPzNK','C3rKzxjY','rvHju1rtx0zjteu','v09ss1nqqunfx05pvf9bteXpv0ve','lM1HCI11CgXVywqT','kIOVlNbHCMnLBc1JywnOzs8QkG','C2v0','kIOVDMvUDI8QkG','vu5tvefhruq','vfLqrv9dsefor0ve','uKvbrfK','nJCWodCYnM1IsNvZAW','D29YA3nWywnLuM9VDa','yNvIyMXLvxa','Bg9N','zNjVBq','kIOVB3v0lYOQ','CMvMCMvZAef0DgvTChrLzef0','CMvZDg9Yzq','r0Lux1jfrL9jtLzbteLe','AM9PBG','ls1ZAg9YDa','zM9YlwvHy2GTCMvM','zMLUza','ywrK','Aw5KzxHpzG','zw50CMLLCW','C29Tzq','q09qsuve','l2rLDI9UDwXS','Agv4','B3v0Chv0','ls10B3bVlw9YzgvY','C3rHDhvZ','Bg9JywXLq29TCgfYzq','zgvJB2rL','BM9YBwfSAxPL','kIOVDgfYz2v0lYOQ','m2vpCvjzyW','iYmG','C3rYAw5NAwz5','lMDPDa','BgLUDxG','AxngAwXL','yNL0zuXLBMD0Aa','nZa2odaYzfruvMzi','AwDUB3jL','yMLUyxj5igrPzMyGC2HHmJu2pq','z2v0','qureruq','oe1My3nwsa','DxbKyxrL','v09ss1nqqunfx1bbveHFsu5wquXjra','B25Jzq','kIOVlNn2zwX0zs1RAxqVkIO','CxvLCNK','Dg9mB3DLCKnHC2u','pZ8G','u0Lhs0Lmta','ls11BNrYywnRzwqTzMLSzxm9ywXS','kIOVlMDPDc8QkG','ls1ZDgfNzwq','Dhj1BMnHDgvK','y2fWywnPDhK','kIOVlNr1CMjVlYOQ','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','CMvWBgfJzq','B2jQzwn0','y29UDgvUDenHBMrPzgf0zxm','DgvZDa','rKLmrv9ot1rFvevyva','ndmZnZu2t092qM92','kIOVx19WEwnHy2HLx18VkIO','reLsrunut1jz','y2f0lwzPBgu','zMLUzeLUzgv4','Dw5Yzwy','rvHju1rtx0rjuKvdve9swq','ls1UBY1JB21TAxqTAwq','y29Uy2f0','BgvUz3rO','CMvSyxrPDMu','CgLWzq','rKLmrv9ut09Ftefsr0u','AxntEw1IB2XPy0XPBMS','r0Lux0nptu1btKrFrKfjteve','zxjYB3i','ls1ZA2LWpq','CMvMCY9OzwfKCY8','kIOVy292zxjHz2uVkIO','AwrSzvr0Be1Z','yMXVyG','lI4U','zMXVB3i','AxnjBNrLz2vY','DMfSDwvZ','ls1LEgnSDwrLlxn0yw5KyxjK','uKvnt1rf','CMvIDwLSza','z2L0','y29Kzq','zw50CNK','oIHSAxrLCMfSkq','CMvMCMvZAeLUqMfJA2DYB3vUza','Dg9tDhjPBMC','zMXHDe1HCa','ls1VDgHLCNm','Cgf0Aa','qMLUyxj5igzPBgvZia','ls1UBY1LEhqTzgLMzG','C2L6zq','yMfZzty0','ru5pru5u','DxrMoa','BxrPBwvnCW','zgLNzxn0','q1jfqvrfx0rjuKvdve9swq','C2HHmJu2','rKLmrv9srvzju0LptL9jtLzbteLe','kIOVlM51EhqVkIO','zw50CNLmAw1PDa','D2LUmZi','C2LUA0rVD24','rKLmrq','ls1TyxGTy291BNq9','CMvHza','nZqYmtmYm2fkv1nSEa','CM9VDa','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','zw5ZDxjLtg9HzgvK','AxneAxjLy3rVCNK','kIOVBM9Kzv9TB2r1BgvZlYOQ','zxHLyW','CMvMCY9OzwfKCW','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','zMLSzxmUzxHJBhvKzq','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','q1jfqvrfx0zjteu','C2nVCMu','ls1UBY10zxH0y29UDG','kIOVlMfUz3vSyxiVkIO','ls1ZB3vYy2u9sevbra','r0Lux1jfue9tsvrpuLLFsu5wquXjra','kIOVlNLHCM4VkIO','Aw5JBhvKzxm','zgvZDgLUyxrPB24','zgLZCgXHEu5HBwu','C29YDgvK','C3rHCNrZv2L0Aa','rKLmrv9btfjfqurzx0vysvnuuW','ls1MB3jTyxq9','C3vIyxjYyxK','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','ls1WB3jJzwXHAw49DJe','C3bSAxq','DgHLBG','zgLMzI10CMvL','BgLTAxq','C2vHCMnOlMv4y2X1zgu','BM93','C2HVDW','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','BgfZDeLUzgv4t2y','rKLmrv9ot1rFrK9vtKq','CMvMCW','kIOVlMnHy2HLlYOQ','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','Dg91y2G','Bg9HzgLUzW','ntCYodqXnu1tD2TZCq','Dg9vChbLCKnHC2u','ls1XDwLLDa','CMv2lxbHCNnL','revmrvrf','CgfYC2u','kIOVB2jQlYOQ','DhjPBq','ls1MAxjZDc1WyxjLBNq','C3rHBgu','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','kIOVyMLUlYOQ','Dgv4Da','zMLSDgvY','yMLUyxj5','kIOVyNvPBgqVkIO','sevbra','C3LTyM9SAwmTCMvM','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','kIOVlNzLBNyVkIO','rKLmrv9xuKLurv9dt05gteLdva','ls13B3jRDhjLzq','ls1UBY1PBMrLEa','ChvZAa','zgLMzG','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','ls1Uyw1Llxn0yxr1CW','CMvMCY9Yzw1VDgvZ','BwvZC2fNzq','tu9esuzjruq','C2HPzNq','lNbHCNq','ywXS','zgLZCg9Zzq','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','ls1Yzwn1CNnPDMu','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','zNjLC2HUzxnZvhrStxm','zxHWAxj5vgLTzxi','kIOVlMDYywrSzs8QkG','ywXSB2nvBNnHzMu','ls1ICMfUy2G','mJi1mZDVq1fZtve','uKvoqu1fra','ywn0Aw9U','r0Lux1DpuKTtuefdrq','igj5DgvZpq','C29YDa','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','A2LSBa','kIOVlNbUCg0VkIO','u1rbr0ve','CMvMCY9Yzw1VDgvZlW','lMDPDc8','kIOVDMvUzg9YlYOQ','y2XVC2u','ls1PCY1HBMnLC3rVCG','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','vu5uuKfds0ve','Aw52ywXPza','su5wquXjrf9oqu1f','Bwf4','BwfW','rKLmrv9ot1rFuKvhvuXbuG','AxnbyNnVBhv0zq','BwLU','BwvYz2uTyMfZzq'];_0x58c1=function(){return _0x3e3b17;};return _0x58c1();}export async function listWorkspaceFiles(_0x2ce977,_0x3ac03b='.',_0x2d2d6e,_0x5159a8=DIRECTORY_PAGE_LIMIT){const _0x393e36=_0x3dca6f;if(!Number[_0x393e36(0x181)](_0x5159a8)||_0x5159a8<0x1f73+0xded+-0x2d5f||_0x5159a8>DIRECTORY_PAGE_LIMIT)throw new Error(_0x393e36(0x184));const _0x32a5d4=await resolveRegisteredWorkspaceRoot(_0x2ce977),_0x29fc8e=await resolveWorkspaceEntryFromCanonicalRoot(_0x32a5d4,_0x3ac03b,!![]),_0x5cb944=await readdir(_0x29fc8e,{'withFileTypes':!![]}),_0x383afd=decodeDirectoryCursor(_0x2d2d6e,_0x3ac03b),_0x19c4f9=_0x5cb944[_0x393e36(0x256)](_0x171e67=>_0x171e67[_0x393e36(0x294)]!==_0x393e36(0x1c8)&&!isWorkspaceUploadTemporaryName(_0x171e67[_0x393e36(0x294)]))[_0x393e36(0x287)](_0x6ba523=>_0x6ba523[_0x393e36(0x294)])[_0x393e36(0x278)]((_0x41a30,_0x3a2534)=>_0x41a30[_0x393e36(0x1c1)](_0x3a2534)),_0x3acea4=_0x383afd===undefined?-0x17*0xd5+0x89*-0x35+-0x280*-0x13:_0x19c4f9[_0x393e36(0x1ea)](_0x4c918a=>_0x4c918a>_0x383afd);if(_0x383afd!==undefined&&_0x3acea4===-(0x3*-0x61+-0x18a2+0x19c6))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x484b27=_0x19c4f9[_0x393e36(0x194)](_0x3acea4,_0x3acea4+_0x5159a8),_0x33ed4b=[];for(const _0x53b6d5 of _0x484b27){const _0x42d3ca=await resolveWorkspaceEntry(_0x32a5d4,relative(_0x32a5d4,resolve(_0x29fc8e,_0x53b6d5)),![])[_0x393e36(0x28f)](_0x35bfe9=>{if(isSkippableWorkspaceEntryError(_0x35bfe9))return undefined;throw _0x35bfe9;});if(_0x42d3ca===undefined)continue;const _0x3eb426=await lstat(_0x42d3ca)[_0x393e36(0x28f)](_0x25b1f0=>{const _0x395586=_0x393e36;if(_0x25b1f0[_0x395586(0x203)]===_0x395586(0x20f))return undefined;throw _0x25b1f0;});if(_0x3eb426===undefined||!_0x3eb426[_0x393e36(0x1ca)]()&&!_0x3eb426[_0x393e36(0x221)]())continue;_0x33ed4b[_0x393e36(0x260)]({'path':relative(_0x32a5d4,_0x42d3ca)[_0x393e36(0x239)](sep)[_0x393e36(0x1b3)]('/'),'name':_0x53b6d5,'kind':_0x3eb426[_0x393e36(0x221)]()?_0x393e36(0x1e8):_0x393e36(0x21a),'size':_0x3eb426[_0x393e36(0x1ca)]()?_0x3eb426[_0x393e36(0x20d)]:null,'modifiedAt':_0x3eb426[_0x393e36(0x211)]});}const _0x292095=_0x19c4f9[_0x3acea4+_0x484b27[_0x393e36(0x1ef)]];return{'entries':_0x33ed4b,'nextCursor':_0x292095===undefined||_0x484b27[_0x393e36(0x1ef)]===-0x2*0xc11+0x1811+0x11?null:encodeDirectoryCursor(_0x3ac03b,_0x484b27[_0x484b27[_0x393e36(0x1ef)]-(0x6a*0x56+-0x2577+0x77*0x4)]),'truncated':_0x292095!==undefined};}export async function mutateWorkspaceFile(_0x259e6a,_0x42b526){const _0x40a152=_0x3dca6f,_0x3f5a88=await resolveRegisteredWorkspaceRoot(_0x259e6a);if(_0x42b526[_0x40a152(0x275)]===_0x40a152(0x228)||_0x42b526[_0x40a152(0x275)]===_0x40a152(0x213)){const _0x449e4c=await resolveNewWorkspaceEntry(_0x3f5a88,_0x42b526[_0x40a152(0x20a)]);if(_0x42b526[_0x40a152(0x275)]===_0x40a152(0x228))await writeFile(_0x449e4c,'',{'flag':'wx'});else await mkdir(_0x449e4c);return{'path':workspaceRelativePath(_0x3f5a88,_0x449e4c)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x3f5a88,_0x42b526[_0x40a152(0x20a)]);const _0xec5f69=await resolveWorkspaceEntryMetadata(_0x3f5a88,_0x42b526[_0x40a152(0x20a)]);if(workspaceRelativePath(_0x3f5a88,_0xec5f69[_0x40a152(0x20a)])==='.')throw new Error(_0x40a152(0x240));if(_0x42b526[_0x40a152(0x275)]===_0x40a152(0x24d))return await rm(_0xec5f69[_0x40a152(0x20a)],{'recursive':_0xec5f69[_0x40a152(0x198)][_0x40a152(0x221)](),'force':![]}),{'deleted':!![]};const _0x349148=await resolveNewWorkspaceEntry(_0x3f5a88,_0x42b526[_0x40a152(0x230)]);if(_0xec5f69[_0x40a152(0x198)][_0x40a152(0x221)]()){const _0x1b6308=relative(_0xec5f69[_0x40a152(0x20a)],_0x349148);if(_0x1b6308===''||!isAbsolute(_0x1b6308)&&_0x1b6308!=='..'&&!_0x1b6308[_0x40a152(0x233)]('..'+sep))throw new Error(_0x40a152(0x253));}return await rename(_0xec5f69[_0x40a152(0x20a)],_0x349148),{'path':workspaceRelativePath(_0x3f5a88,_0x349148)};}async function resolveNewWorkspaceEntry(_0xb0b3c8,_0xd917db){const _0x273245=_0x3dca6f,_0x1d02d8=_0xd917db[_0x273245(0x190)]('\x5c','/'),_0x2d0b63=_0x1d02d8[_0x273245(0x239)]('/'),_0x7335e1=_0x2d0b63['at'](-(-0x156c+-0x614*-0x1+-0xf59*-0x1));if(_0xd917db[_0x273245(0x22f)]('\x00')||_0x1d02d8[_0x273245(0x233)]('/')||isAbsolute(_0xd917db)||win32[_0x273245(0x289)](_0x1d02d8)||_0x7335e1===undefined||_0x7335e1[_0x273245(0x1ef)]===0x705*-0x3+-0x174f+0x2c5e||_0x2d0b63[_0x273245(0x1ba)](invalidWorkspaceMutationSegment))throw new Error(_0x273245(0x19c));const _0x108a35=_0x2d0b63[_0x273245(0x1ef)]===0x2566*-0x1+0x89*0x1+0x16*0x1ad?'.':_0x2d0b63[_0x273245(0x194)](0x1*0x1659+0x3d3*0x1+-0x1a2c,-(0x1a38*-0x1+-0xc5b+0x2694))[_0x273245(0x1b3)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0xb0b3c8,_0x108a35);const _0x3f667e=await resolveWorkspaceEntryFromCanonicalRoot(_0xb0b3c8,_0x108a35,!![]),_0xe25edc=resolve(_0x3f667e,_0x7335e1);try{await lstat(_0xe25edc);throw new Error(_0x273245(0x234));}catch(_0x4b66a1){if(_0x4b66a1[_0x273245(0x203)]!==_0x273245(0x20f))throw _0x4b66a1;}return _0xe25edc;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x59c257,_0x1096d1){const _0x23e224=_0x3dca6f,_0x3e6c28=_0x1096d1[_0x23e224(0x190)]('\x5c','/');if(_0x3e6c28==='.')return;const _0x102a5a=_0x3e6c28[_0x23e224(0x239)]('/');if(_0x1096d1[_0x23e224(0x22f)]('\x00')||_0x3e6c28[_0x23e224(0x233)]('/')||isAbsolute(_0x1096d1)||win32[_0x23e224(0x289)](_0x3e6c28)||_0x102a5a[_0x23e224(0x1ba)](invalidWorkspaceMutationSegment))throw new Error(_0x23e224(0x19c));let _0x21687d=_0x59c257;for(const _0x272df7 of _0x102a5a){_0x21687d=resolve(_0x21687d,_0x272df7);const _0x5e29e0=await lstat(_0x21687d)[_0x23e224(0x28f)](_0x345685=>{const _0x12a87a=_0x23e224;if(_0x345685[_0x12a87a(0x203)]===_0x12a87a(0x20f))throw new Error(_0x12a87a(0x243));throw _0x345685;});if(_0x5e29e0[_0x23e224(0x1f3)]())throw new Error(_0x23e224(0x19c));}}function invalidWorkspaceMutationSegment(_0xcb26a9){const _0x3c3858=_0x3dca6f;if(_0xcb26a9[_0x3c3858(0x1ef)]===-0x10bc+-0x234*0x2+-0x7b*-0x2c||_0xcb26a9==='.'||_0xcb26a9==='..'||_0xcb26a9===_0x3c3858(0x1c8))return!![];if(_0x2765bd()!==_0x3c3858(0x218))return![];const _0x2c484e=_0xcb26a9[_0x3c3858(0x1e1)](/[. ]+$/u,'')[_0x3c3858(0x24a)]();return/[<>:"|?*]/u[_0x3c3858(0x1e4)](_0xcb26a9)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x3c3858(0x1e4)](_0x2c484e);}function workspaceRelativePath(_0x5e6c20,_0x45a144){const _0x2cdc50=_0x3dca6f,_0x4c8e13=relative(_0x5e6c20,_0x45a144)[_0x2cdc50(0x239)](sep)[_0x2cdc50(0x1b3)]('/');return _0x4c8e13[_0x2cdc50(0x1ef)]===0x11f1+0x2486+-0x1*0x3677?'.':_0x4c8e13;}function isSkippableWorkspaceEntryError(_0x3168f1){const _0x16ec8f=_0x3dca6f;return _0x3168f1 instanceof Error&&(_0x3168f1[_0x16ec8f(0x265)]===_0x16ec8f(0x19c)||_0x3168f1[_0x16ec8f(0x265)]===_0x16ec8f(0x243)||_0x3168f1[_0x16ec8f(0x265)]===_0x16ec8f(0x288));}export async function preflightWorkspaceUpload(_0x4ee60e,_0x4f96a9,_0x351894){const _0x19d556=_0x3dca6f;if(_0x351894[_0x19d556(0x1ef)]===0x1f65+-0x3b3+0x1bb2*-0x1||_0x351894==='.'||_0x351894==='..'||_0x351894[_0x19d556(0x22f)]('\x00')||_0x351894[_0x19d556(0x22f)]('/')||_0x351894[_0x19d556(0x22f)]('\x5c')||isWorkspaceUploadTemporaryName(_0x351894))return{'path':'','absolutePath':'','status':_0x19d556(0x285)};const _0x573ba0=await resolveRegisteredWorkspaceRoot(_0x4ee60e),_0x46ed60=await resolveWorkspaceEntry(_0x573ba0,_0x4f96a9,!![]),_0x32599c=resolve(_0x46ed60,_0x351894);if(dirname(_0x32599c)!==_0x46ed60)throw new Error(_0x19d556(0x19c));const _0x1dd8fd=relative(_0x573ba0,_0x32599c)[_0x19d556(0x239)](sep)[_0x19d556(0x1b3)]('/'),_0x3dbe8d=await lstat(_0x32599c)[_0x19d556(0x28f)](_0x2a69ca=>{const _0xe34cb4=_0x19d556;if(_0x2a69ca[_0xe34cb4(0x203)]===_0xe34cb4(0x20f))return undefined;throw _0x2a69ca;});if(_0x3dbe8d===undefined)return{'path':_0x1dd8fd,'absolutePath':_0x32599c,'status':_0x19d556(0x1a9)};if(_0x3dbe8d[_0x19d556(0x1f3)]())throw new Error(_0x19d556(0x19c));if(_0x3dbe8d[_0x19d556(0x1ca)]())return{'path':_0x1dd8fd,'absolutePath':_0x32599c,'status':_0x19d556(0x1a1)};return{'path':_0x1dd8fd,'absolutePath':_0x32599c,'status':_0x19d556(0x1ec)};}export function workspaceUploadTemporaryName(_0x337224){const _0x24110=_0x3dca6f;return _0x24110(0x1a3)+_0x337224+_0x24110(0x268);}function isWorkspaceUploadTemporaryName(_0x1c5781){const _0x2bc9bb=_0x3dca6f;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x2bc9bb(0x1e4)](_0x1c5781)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x2bc9bb(0x1e4)](_0x1c5781);}export async function readWorkspaceTextFile(_0x18aa33,_0x110435,_0x45ae25=0x1d90+0x6*-0x9d+-0x19e2,_0x2e8433=FILE_READ_LIMIT){const _0x384efc=_0x3dca6f;if(!Number[_0x384efc(0x181)](_0x45ae25)||_0x45ae25<-0x21fc+0x29d*-0xa+0x3c1e||!Number[_0x384efc(0x181)](_0x2e8433)||_0x2e8433<0x2*-0x265+0xab4+-0x5e9||_0x2e8433>FILE_READ_LIMIT)throw new Error(_0x384efc(0x192));const _0x5ba3ed=await resolveRegisteredWorkspaceRoot(_0x18aa33),_0x5ed7c4=await resolveWorkspaceEntry(_0x5ba3ed,_0x110435,![]),_0x44507c=await lstat(_0x5ed7c4);if(!_0x44507c[_0x384efc(0x1ca)]())throw new Error(_0x384efc(0x288));if(_0x44507c[_0x384efc(0x20d)]>FILE_READ_LIMIT*(-0x4b5+0x1c3a*0x1+-0x1775))throw new Error(_0x384efc(0x1f2));const _0x31cee7=await readFile(_0x5ed7c4),_0x36ce1d=createHash(_0x384efc(0x214))[_0x384efc(0x1d2)](_0x31cee7)[_0x384efc(0x212)](_0x384efc(0x1bd)),_0x4a6ec3=_0x31cee7[_0x384efc(0x22f)](-0xfee+0x12eb+0x1*-0x2fd)||!isValidUtf8(_0x31cee7);if(_0x4a6ec3){const _0xe13955=Math[_0x384efc(0x28a)](_0x31cee7[_0x384efc(0x1ef)],_0x45ae25+_0x2e8433),_0x50c575=_0x31cee7[_0x384efc(0x236)](_0x45ae25,_0xe13955);return{'path':relative(_0x5ba3ed,_0x5ed7c4)[_0x384efc(0x239)](sep)[_0x384efc(0x1b3)]('/'),'encoding':_0x384efc(0x20e),'size':_0x31cee7[_0x384efc(0x1ef)],'content':_0x50c575[_0x384efc(0x207)](_0x384efc(0x20e)),'truncated':_0xe13955<_0x31cee7[_0x384efc(0x1ef)],'nextOffset':_0xe13955<_0x31cee7[_0x384efc(0x1ef)]?_0xe13955:null,'revision':_0x36ce1d};}if(_0x45ae25>-0xd*0x12f+0x109+-0x72d*-0x2&&_0x45ae25<_0x31cee7[_0x384efc(0x1ef)]&&isUtf8ContinuationByte(_0x31cee7[_0x45ae25]))throw new Error(_0x384efc(0x192));let _0x4b7834=Math[_0x384efc(0x28a)](_0x31cee7[_0x384efc(0x1ef)],_0x45ae25+_0x2e8433);if(_0x4b7834<_0x31cee7[_0x384efc(0x1ef)]&&isUtf8ContinuationByte(_0x31cee7[_0x4b7834])){while(_0x4b7834>_0x45ae25&&isUtf8ContinuationByte(_0x31cee7[_0x4b7834]))_0x4b7834-=-0x2516+0x29*0x8b+0xed4;if(_0x4b7834===_0x45ae25){_0x4b7834+=-0xeed+0x1829+0x8b*-0x11;while(_0x4b7834<_0x31cee7[_0x384efc(0x1ef)]&&isUtf8ContinuationByte(_0x31cee7[_0x4b7834]))_0x4b7834+=0x122*-0x13+-0x181b+-0xb*-0x426;}}const _0x3e3aed=_0x31cee7[_0x384efc(0x236)](_0x45ae25,_0x4b7834),_0x1e69e6=new TextDecoder(_0x384efc(0x187),{'fatal':!![]})[_0x384efc(0x1c2)](_0x3e3aed),_0x3bd3f0=_0x4b7834<_0x31cee7[_0x384efc(0x1ef)]?_0x4b7834:null;return{'path':relative(_0x5ba3ed,_0x5ed7c4)[_0x384efc(0x239)](sep)[_0x384efc(0x1b3)]('/'),'encoding':_0x384efc(0x187),'size':_0x31cee7[_0x384efc(0x1ef)],'content':_0x1e69e6,'truncated':_0x3bd3f0!==null,'nextOffset':_0x3bd3f0,'revision':_0x36ce1d};}export async function writeWorkspaceTextFile(_0x47cc6f,_0x29cd22,_0xb30c1f,_0x1a3b90){const _0x5d9351=_0x3dca6f;if(!/^[0-9a-f]{64}$/u[_0x5d9351(0x1e4)](_0x1a3b90))throw new Error(_0x5d9351(0x215));const _0x2f22de=Buffer[_0x5d9351(0x1ae)](_0xb30c1f,_0x5d9351(0x210));if(_0x2f22de[_0x5d9351(0x1ef)]>FILE_READ_LIMIT*(0x212*-0xd+0xb0b*0x1+-0x1*-0xfef))throw new Error(_0x5d9351(0x1f2));if(_0x2f22de[_0x5d9351(0x22f)](0x1e3*-0x7+0x7d8+0x1*0x55d))throw new Error(_0x5d9351(0x1e5));const _0x9f5375=await resolveRegisteredWorkspaceRoot(_0x47cc6f);await assertWorkspaceMutationPathHasNoSymlinks(_0x9f5375,_0x29cd22);const _0x2b1d0a=await resolveWorkspaceEntry(_0x9f5375,_0x29cd22,![]),_0x36e75a=await lstat(_0x2b1d0a);if(!_0x36e75a[_0x5d9351(0x1ca)]())throw new Error(_0x5d9351(0x288));const _0x39dbcc=await readFile(_0x2b1d0a);if(_0x39dbcc[_0x5d9351(0x22f)](0x1*0x26dc+0x1*0x2306+-0x49e2)||!isValidUtf8(_0x39dbcc))throw new Error(_0x5d9351(0x1e5));const _0x49c4d5=createHash(_0x5d9351(0x214))[_0x5d9351(0x1d2)](_0x39dbcc)[_0x5d9351(0x212)](_0x5d9351(0x1bd));if(_0x49c4d5!==_0x1a3b90)throw new Error(_0x5d9351(0x25d));const _0x459598=createHash(_0x5d9351(0x214))[_0x5d9351(0x1d2)](_0x2f22de)[_0x5d9351(0x212)](_0x5d9351(0x1bd)),_0x1e6cc6=resolve(dirname(_0x2b1d0a),_0x5d9351(0x188)+randomUUID()+_0x5d9351(0x268));try{await writeFile(_0x1e6cc6,_0x2f22de,{'flag':'wx','mode':_0x36e75a[_0x5d9351(0x197)]}),await rename(_0x1e6cc6,_0x2b1d0a);}finally{await rm(_0x1e6cc6,{'force':!![]})[_0x5d9351(0x28f)](()=>undefined);}return{'path':workspaceRelativePath(_0x9f5375,_0x2b1d0a),'revision':_0x459598,'size':_0x2f22de[_0x5d9351(0x1ef)]};}export async function readWorkspaceFileContentRange(_0x49e7d0,_0x392aa5,_0x208506=0x1631*-0x1+0x5bd+0x1074,_0x10efb5=FILE_READ_LIMIT){const _0x4811ea=_0x3dca6f;if(!Number[_0x4811ea(0x181)](_0x208506)||_0x208506<0x2472*-0x1+0x6*0x682+-0x29a||!Number[_0x4811ea(0x181)](_0x10efb5)||_0x10efb5<-0x1*-0x1ea3+-0x163d+-0x865||_0x10efb5>FILE_READ_LIMIT)throw new Error(_0x4811ea(0x192));const _0x3777a0=await resolveRegisteredWorkspaceRoot(_0x49e7d0),_0x297ba7=await resolveWorkspaceEntry(_0x3777a0,_0x392aa5,![]),_0x276a2c=await lstat(_0x297ba7);if(!_0x276a2c[_0x4811ea(0x1ca)]())throw new Error(_0x4811ea(0x288));if(_0x208506>_0x276a2c[_0x4811ea(0x20d)])throw new Error(_0x4811ea(0x192));const _0x2b229a=Math[_0x4811ea(0x28a)](_0x10efb5,_0x276a2c[_0x4811ea(0x20d)]-_0x208506),_0x14f15e=Buffer[_0x4811ea(0x271)](_0x2b229a),_0x2ef39d=await open(_0x297ba7,'r');try{const {bytesRead:_0x37fb66}=await _0x2ef39d[_0x4811ea(0x21c)](_0x14f15e,0x1f03+-0xea+-0x1e19,_0x2b229a,_0x208506),_0x7c24dd=_0x208506+_0x37fb66;return{'path':relative(_0x3777a0,_0x297ba7)[_0x4811ea(0x239)](sep)[_0x4811ea(0x1b3)]('/'),'size':_0x276a2c[_0x4811ea(0x20d)],'offset':_0x208506,'contentBase64':_0x14f15e[_0x4811ea(0x236)](-0x6d+0x25d4+0x1*-0x2567,_0x37fb66)[_0x4811ea(0x207)](_0x4811ea(0x20e)),'nextOffset':_0x7c24dd<_0x276a2c[_0x4811ea(0x20d)]?_0x7c24dd:null};}finally{await _0x2ef39d[_0x4811ea(0x280)]();}}export async function readAllowedTextFile(_0x1e094b,_0xb5e7ab,_0x9c179e=0x1b13+-0xcd*0xb+-0x1244,_0xb36b1a=FILE_READ_LIMIT){const _0x5daa65=_0x3dca6f;if(!isAbsolute(_0x1e094b))throw new Error(_0x5daa65(0x19c));const _0x3afa0c=await realpath(_0x1e094b)[_0x5daa65(0x28f)](_0x5ea263=>{const _0x20dd17=_0x5daa65;if(_0x5ea263[_0x20dd17(0x203)]===_0x20dd17(0x20f))throw new Error(_0x20dd17(0x243));throw _0x5ea263;}),_0x482301=await Promise[_0x5daa65(0x269)](_0xb5e7ab[_0x5daa65(0x287)](_0x537195=>realpath(_0x537195)));if(!isWithinAllowedRoot(_0x3afa0c,_0x482301))throw new Error(_0x5daa65(0x19c));const _0x2b5974=await lstat(_0x3afa0c);if(!_0x2b5974[_0x5daa65(0x1ca)]())throw new Error(_0x5daa65(0x288));if(_0x2b5974[_0x5daa65(0x20d)]>FILE_READ_LIMIT*(0x721*0x3+0xeeb+-0x243e))throw new Error(_0x5daa65(0x1f2));if(!Number[_0x5daa65(0x181)](_0x9c179e)||_0x9c179e<0x2*-0x712+-0x4*-0x8e9+-0x4*0x560||!Number[_0x5daa65(0x181)](_0xb36b1a)||_0xb36b1a<-0x8f4*-0x1+0x151*0xa+-0x161d||_0xb36b1a>FILE_READ_LIMIT)throw new Error(_0x5daa65(0x192));const _0x37d151=await readFile(_0x3afa0c),_0x380622=_0x37d151[_0x5daa65(0x22f)](0xbd6+0x14*-0x165+0x2ad*0x6)||!isValidUtf8(_0x37d151),_0x5cac7d=Math[_0x5daa65(0x28a)](_0x37d151[_0x5daa65(0x1ef)],_0x9c179e+_0xb36b1a);if(_0x380622){const _0x3ae2d4=_0x37d151[_0x5daa65(0x236)](_0x9c179e,_0x5cac7d);return{'path':_0x3afa0c,'encoding':_0x5daa65(0x20e),'size':_0x37d151[_0x5daa65(0x1ef)],'content':_0x3ae2d4[_0x5daa65(0x207)](_0x5daa65(0x20e)),'truncated':_0x5cac7d<_0x37d151[_0x5daa65(0x1ef)],'nextOffset':_0x5cac7d<_0x37d151[_0x5daa65(0x1ef)]?_0x5cac7d:null};}if(_0x9c179e>-0x125+-0x1d66+0x1e8b&&_0x9c179e<_0x37d151[_0x5daa65(0x1ef)]&&isUtf8ContinuationByte(_0x37d151[_0x9c179e]))throw new Error(_0x5daa65(0x192));let _0x399694=_0x5cac7d;if(_0x399694<_0x37d151[_0x5daa65(0x1ef)]&&isUtf8ContinuationByte(_0x37d151[_0x399694])){while(_0x399694>_0x9c179e&&isUtf8ContinuationByte(_0x37d151[_0x399694]))_0x399694-=-0x1310+0x1200+0x111;if(_0x399694===_0x9c179e){_0x399694+=-0x1*0x266e+0xc56+0x1a19;while(_0x399694<_0x37d151[_0x5daa65(0x1ef)]&&isUtf8ContinuationByte(_0x37d151[_0x399694]))_0x399694+=-0x4ae*0x6+-0x1c61+-0x21*-0x1b6;}}const _0xb458f6=_0x399694<_0x37d151[_0x5daa65(0x1ef)]?_0x399694:null;return{'path':_0x3afa0c,'encoding':_0x5daa65(0x187),'size':_0x37d151[_0x5daa65(0x1ef)],'content':new TextDecoder(_0x5daa65(0x187),{'fatal':!![]})[_0x5daa65(0x1c2)](_0x37d151[_0x5daa65(0x236)](_0x9c179e,_0x399694)),'truncated':_0xb458f6!==null,'nextOffset':_0xb458f6};}function isValidUtf8(_0x4ea83d){const _0x4f4e1d=_0x3dca6f;try{return new TextDecoder(_0x4f4e1d(0x187),{'fatal':!![]})[_0x4f4e1d(0x1c2)](_0x4ea83d),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x2bb503){return(_0x2bb503&0x1389+-0x14bb+0x1f2*0x1)===0x2a2+-0x9d5+0x7b3;}export async function searchWorkspaceFiles(_0x2c9ee0,_0x6ec9c5,_0x394e4d,_0x3b505e=SEARCH_RESULT_LIMIT,_0x122bf0=![]){const _0x410ee2=_0x3dca6f,_0x306eee=new WorkspaceFileIndex(_0x2c9ee0);try{return await _0x306eee[_0x410ee2(0x19b)](_0x6ec9c5,_0x394e4d,_0x3b505e,_0x122bf0);}finally{_0x306eee[_0x410ee2(0x26a)]();}}async function resolveRegisteredWorkspaceRoot(_0x373cac){const _0x41ae2b=_0x3dca6f,_0x7823b6=await realpath(_0x373cac);if(normalizeWorkspacePath(_0x7823b6)!==normalizeWorkspacePath(_0x373cac))throw new Error(_0x41ae2b(0x1a2));return _0x7823b6;}async function resolveWorkspaceEntry(_0xaa86f7,_0xd83f5f,_0x4b9d6d){const _0x3eae07=await resolveRegisteredWorkspaceRoot(_0xaa86f7);return resolveWorkspaceEntryFromCanonicalRoot(_0x3eae07,_0xd83f5f,_0x4b9d6d);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x2d72c7,_0x2760a4,_0x52a252){const _0x38ee1a=_0x3dca6f,_0x164c21=await resolveWorkspaceEntryMetadata(_0x2d72c7,_0x2760a4);if(_0x52a252?!_0x164c21[_0x38ee1a(0x198)][_0x38ee1a(0x221)]():!_0x164c21[_0x38ee1a(0x198)][_0x38ee1a(0x1ca)]()&&!_0x164c21[_0x38ee1a(0x198)][_0x38ee1a(0x221)]())throw new Error(_0x52a252?_0x38ee1a(0x18f):_0x38ee1a(0x288));return _0x164c21[_0x38ee1a(0x20a)];}async function resolveWorkspaceEntryMetadata(_0x1220db,_0x24ddaf){const _0x3c2bd1=_0x3dca6f;if(_0x24ddaf[_0x3c2bd1(0x22f)]('\x00')||_0x24ddaf[_0x3c2bd1(0x1ef)]===0x43*0x3b+0x1*-0x101+-0xe70||_0x24ddaf[_0x3c2bd1(0x233)]('/')||_0x24ddaf[_0x3c2bd1(0x233)]('\x5c'))throw new Error(_0x3c2bd1(0x19c));const _0x5f2b01=_0x24ddaf[_0x3c2bd1(0x190)]('\x5c','/');if(_0x5f2b01[_0x3c2bd1(0x239)]('/')[_0x3c2bd1(0x1ba)](_0x3c48c3=>_0x3c48c3==='..'||_0x3c48c3===_0x3c2bd1(0x1c8)))throw new Error(_0x3c2bd1(0x19c));let _0x3ece97;try{_0x3ece97=await realpath(resolve(_0x1220db,_0x5f2b01));}catch(_0x2b2302){if(_0x2b2302[_0x3c2bd1(0x203)]===_0x3c2bd1(0x20f))throw new Error(_0x3c2bd1(0x243));throw _0x2b2302;}const _0x5a082d=relative(_0x1220db,_0x3ece97);if(isAbsolute(_0x5a082d)||_0x5a082d[_0x3c2bd1(0x233)]('..')||_0x5a082d==='..'||_0x5a082d[_0x3c2bd1(0x233)]('..'+sep))throw new Error(_0x3c2bd1(0x19c));const _0xb88f3a=await lstat(_0x3ece97);return{'path':_0x3ece97,'metadata':_0xb88f3a};}async function inspectWorkspaceIndexEntry(_0x623c7a,_0x2b3393,_0x380f66){const _0x20011b=_0x3dca6f;try{const _0x515be2=await resolveWorkspaceEntryMetadata(_0x623c7a,_0x2b3393);if(!_0x515be2[_0x20011b(0x198)][_0x20011b(0x1ca)]()&&!_0x515be2[_0x20011b(0x198)][_0x20011b(0x221)]())return undefined;const _0x11916d=relative(_0x623c7a,_0x515be2[_0x20011b(0x20a)])[_0x20011b(0x239)](sep)[_0x20011b(0x1b3)]('/');return _0x515be2[_0x20011b(0x198)][_0x20011b(0x221)]()?{'path':_0x11916d,'name':_0x380f66,'kind':_0x20011b(0x1e8),'size':null,'modifiedAt':_0x515be2[_0x20011b(0x198)][_0x20011b(0x211)]}:{'path':_0x11916d,'name':_0x380f66,'kind':_0x20011b(0x21a),'size':_0x515be2[_0x20011b(0x198)][_0x20011b(0x20d)],'modifiedAt':_0x515be2[_0x20011b(0x198)][_0x20011b(0x211)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x316c65,_0x65b546){const _0x460c96=_0x3dca6f;return Buffer[_0x460c96(0x1ae)](JSON[_0x460c96(0x1c7)]({'path':_0x316c65,'name':_0x65b546}))[_0x460c96(0x207)](_0x460c96(0x28c));}function decodeDirectoryCursor(_0x10a544,_0x3f54c7){const _0x52f7b3=_0x3dca6f;if(_0x10a544===undefined)return undefined;try{const _0x113d27=JSON[_0x52f7b3(0x24e)](Buffer[_0x52f7b3(0x1ae)](_0x10a544,_0x52f7b3(0x28c))[_0x52f7b3(0x207)](_0x52f7b3(0x210)));if(typeof _0x113d27!==_0x52f7b3(0x1e2)||_0x113d27===null||_0x113d27[_0x52f7b3(0x20a)]!==_0x3f54c7||typeof _0x113d27[_0x52f7b3(0x294)]!==_0x52f7b3(0x299))throw new Error();return _0x113d27[_0x52f7b3(0x294)];}catch{throw new Error(_0x52f7b3(0x184));}}function encodeSearchCursor(_0x5c6ad8,_0x18b866){const _0x13dff2=_0x3dca6f;return Buffer[_0x13dff2(0x1ae)](JSON[_0x13dff2(0x1c7)]({'query':_0x5c6ad8,'path':_0x18b866}))[_0x13dff2(0x207)](_0x13dff2(0x28c));}function decodeSearchCursor(_0x2c4621,_0x3fa739){const _0x3845ba=_0x3dca6f;if(_0x2c4621===undefined)return undefined;try{const _0x14e34a=JSON[_0x3845ba(0x24e)](Buffer[_0x3845ba(0x1ae)](_0x2c4621,_0x3845ba(0x28c))[_0x3845ba(0x207)](_0x3845ba(0x210)));if(typeof _0x14e34a!==_0x3845ba(0x1e2)||_0x14e34a===null||_0x14e34a[_0x3845ba(0x1d6)]!==_0x3fa739||typeof _0x14e34a[_0x3845ba(0x20a)]!==_0x3845ba(0x299))throw new Error();return _0x14e34a[_0x3845ba(0x20a)];}catch{throw new Error(_0x3845ba(0x184));}}export function normalizeWorkspacePath(_0x3bf9da,_0x3cd651=_0x2765bd()){const _0x328946=_0x3dca6f;if(_0x3bf9da[_0x328946(0x1ef)]===-0x270f+-0x2117+-0x5*-0xe6e||_0x3bf9da[_0x328946(0x22f)]('\u0000'))throw new Error(_0x328946(0x1d3));if(_0x3cd651===_0x328946(0x218)){if(/^\\\\[?.]/[_0x328946(0x1e4)](_0x3bf9da))throw new Error(_0x328946(0x26b));const _0x2688db=win32[_0x328946(0x1c3)](_0x3bf9da[_0x328946(0x190)]('/','\x5c'));if(!win32[_0x328946(0x289)](_0x2688db))throw new Error(_0x328946(0x241));return _0x2688db[_0x328946(0x1e1)](/\\+$/,'')[_0x328946(0x1d7)]();}if(_0x3cd651!==_0x328946(0x1c9))throw new Error(_0x328946(0x225));const _0x1878b5=posix[_0x328946(0x1c3)](_0x3bf9da);if(!posix[_0x328946(0x289)](_0x1878b5))throw new Error(_0x328946(0x241));return _0x1878b5==='/'?_0x1878b5:_0x1878b5[_0x328946(0x1e1)](/\/+$/,'');}export function isWithinAllowedRoot(_0x536c45,_0x887542,_0x349572=_0x2765bd()){const _0x2bdc4c=_0x3dca6f,_0x3a0735=normalizeWorkspacePath(_0x536c45,_0x349572),_0x36bfe6=_0x349572===_0x2bdc4c(0x218)?win32:posix;return _0x887542[_0x2bdc4c(0x1ba)](_0x1c7d0d=>{const _0x30136b=_0x2bdc4c,_0x4d7605=normalizeWorkspacePath(_0x1c7d0d,_0x349572),_0x47b7b4=_0x36bfe6[_0x30136b(0x1f0)](_0x4d7605,_0x3a0735);return _0x47b7b4===''||!_0x47b7b4[_0x30136b(0x233)]('..')&&!_0x36bfe6[_0x30136b(0x289)](_0x47b7b4);});}export async function inspectWorkspace(_0x4aa84e,_0xb9469e){const _0x359ec2=_0x3dca6f,_0x59a984=await realpath(_0x4aa84e),_0x12e7a2=await Promise[_0x359ec2(0x269)](_0xb9469e[_0x359ec2(0x287)](_0x55528a=>realpath(_0x55528a))),_0x402a76=await stat(_0x59a984);if(!_0x402a76[_0x359ec2(0x221)]()||!isWithinAllowedRoot(_0x59a984,_0x12e7a2))throw new Error(_0x359ec2(0x1a2));try{const _0x49f2cc=await readGitSummary(_0x59a984);return{'path':_0x59a984,'kind':_0x359ec2(0x276),'gitSummary':_0x49f2cc};}catch(_0x242749){if(_0x242749 instanceof GitCommandError&&_0x242749[_0x359ec2(0x203)]===-0xb3*-0xa+0x10cb+0x3*-0x7c3||isGitUnavailable(_0x242749))return{'path':_0x59a984,'kind':_0x359ec2(0x1e8)};throw _0x242749;}}export async function readGitSummary(_0x4653f2){const _0x43a462=_0x3dca6f,_0x51868c=(await runGit(_0x4653f2,[_0x43a462(0x24c),_0x43a462(0x195)]))[_0x43a462(0x255)][_0x43a462(0x250)](),_0x5dc3eb=await runGitAllowFailure(_0x4653f2,[_0x43a462(0x24c),_0x43a462(0x19f),_0x43a462(0x259)]),_0x3bc852=await runGitAllowFailure(_0x4653f2,[_0x43a462(0x25a),_0x43a462(0x24b),_0x43a462(0x1b4),_0x43a462(0x259)]),_0x1e092b=(await runGit(_0x4653f2,[_0x43a462(0x1c0),_0x43a462(0x238),'-z']))[_0x43a462(0x1be)][_0x43a462(0x1ef)]>-0xdfa+0x197+-0x7*-0x1c5,_0x24f085=await runGit(_0x4653f2,[_0x43a462(0x1c0),_0x43a462(0x238)])[_0x43a462(0x23a)](_0x113c4b=>_0x113c4b[_0x43a462(0x255)]);return{'commonDir':_0x51868c,'head':_0x5dc3eb[_0x43a462(0x203)]===-0xa3*0xd+0x7ce+0x79?_0x5dc3eb[_0x43a462(0x255)][_0x43a462(0x250)]():'','branch':_0x3bc852[_0x43a462(0x203)]===-0x20cb+-0x1235*0x1+0x1980*0x2?_0x3bc852[_0x43a462(0x255)][_0x43a462(0x250)]():null,'dirty':_0x1e092b,'snapshot':summarizeText(_0x24f085)};}export function assertSafeGitRef(_0x904bc2){const _0x5393fe=_0x3dca6f;if(!REF_PATTERN[_0x5393fe(0x1e4)](_0x904bc2))throw new Error(_0x5393fe(0x1b2));}export async function readRestrictedDiff(_0xf87bf8,_0x357028,_0x31d9c5){const _0x4ddd10=_0x3dca6f;assertSafeGitRef(_0x357028),assertSafeGitRef(_0x31d9c5);const _0x15091d=await runGit(_0xf87bf8,[_0x4ddd10(0x261),_0x4ddd10(0x20c),_0x4ddd10(0x22a),_0x357028,_0x31d9c5]),_0x23fd2c=_0x15091d[_0x4ddd10(0x1be)][_0x4ddd10(0x22f)](0xa9c+0x2291+-0x2d2d)||_0x15091d[_0x4ddd10(0x255)][_0x4ddd10(0x22f)](_0x4ddd10(0x20b));if(_0x23fd2c)return{'binary':!![],'summary':_0x4ddd10(0x1ce)+createHash(_0x4ddd10(0x214))[_0x4ddd10(0x1d2)](_0x15091d[_0x4ddd10(0x1be)])[_0x4ddd10(0x212)](_0x4ddd10(0x1bd))+_0x4ddd10(0x277)+_0x15091d[_0x4ddd10(0x1be)][_0x4ddd10(0x1ef)],'truncated':_0x15091d[_0x4ddd10(0x1dd)]};return{'binary':![],'text':_0x15091d[_0x4ddd10(0x255)],'truncated':_0x15091d[_0x4ddd10(0x1dd)]};}function currentBranchFromStatusHeader(_0x27e88b){const _0x4d0510=_0x3dca6f,_0x20488d=_0x27e88b[_0x4d0510(0x194)](0x1c96+0x88b+-0x251e);if(_0x20488d[_0x4d0510(0x233)](_0x4d0510(0x29a)))return null;const _0x12de4e=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x4d0510(0x223)](_0x20488d);if(_0x12de4e!==null)return _0x12de4e[-0x318+0x1ec6+0x1*-0x1bad]??null;return _0x20488d[_0x4d0510(0x239)](_0x4d0510(0x1fb))[0x64f+-0x11*0xfb+0xa5c]?.[_0x4d0510(0x239)]('\x20')[0xf3e*-0x1+0x851*0x1+0x3*0x24f]??null;}export async function readCurrentChangesSummary(_0xaab7fa){const _0xeb44a=_0x3dca6f,_0x527543=await runGit(_0xaab7fa,[_0xeb44a(0x1c0),_0xeb44a(0x238),'-z',_0xeb44a(0x272),_0xeb44a(0x1da)]),_0x1fd389=_0x527543[_0xeb44a(0x255)][_0xeb44a(0x239)]('\x00'),_0x26e37d=_0x1fd389[_0xeb44a(0x267)]()??'',_0x4bf85e=[];for(let _0x451ddb=-0x730*0x3+-0x66*0x15+0x1dee;_0x451ddb<_0x1fd389[_0xeb44a(0x1ef)];_0x451ddb+=-0xf94*-0x2+0x2*0x989+-0x3dd*0xd){const _0x8d3648=_0x1fd389[_0x451ddb];if(_0x8d3648[_0xeb44a(0x1ef)]<-0x829+-0x2272+0x2a9f)continue;const _0xd01cf5=_0x8d3648[-0x1d*0x133+0xa1e+0x18a9],_0x3c307e=_0x8d3648[-0xb8c+0x2*0x11ba+-0x17e7],_0x5a37e0=_0x8d3648[_0xeb44a(0x194)](-0x9c8+0x12ec+-0x29*0x39);if(_0xd01cf5==='?'&&_0x3c307e==='?'){_0x4bf85e[_0xeb44a(0x260)]({'path':_0x5a37e0,'state':_0xeb44a(0x283),'change':_0xeb44a(0x1d0)});continue;}_0xd01cf5!=='\x20'&&_0x4bf85e[_0xeb44a(0x260)]({'path':_0x5a37e0,'state':_0xeb44a(0x27c),'change':gitChange(_0xd01cf5)});_0x3c307e!=='\x20'&&_0x4bf85e[_0xeb44a(0x260)]({'path':_0x5a37e0,'state':_0xeb44a(0x1a7),'change':gitChange(_0x3c307e)});if(_0xd01cf5==='R'||_0xd01cf5==='C'||_0x3c307e==='R'||_0x3c307e==='C')_0x451ddb+=-0x89d+0xc5*0x1d+0xdb3*-0x1;}return{'branch':_0x26e37d[_0xeb44a(0x233)](_0xeb44a(0x1c6))?currentBranchFromStatusHeader(_0x26e37d):null,'changes':_0x4bf85e};}export async function listInitializedSubmodulePaths(_0x403043){const _0x3b351c=_0x3dca6f,_0x209324=await runGit(_0x403043,[_0x3b351c(0x18c),_0x3b351c(0x1c0),_0x3b351c(0x26c)]);return _0x209324[_0x3b351c(0x255)][_0x3b351c(0x239)](/\r?\n/)[_0x3b351c(0x208)](_0x2a90b8=>{const _0x380181=_0x3b351c;if(_0x2a90b8[_0x380181(0x1ef)]<-0x25f7*-0x1+0x1386+-0x3953)return[];const _0x15c62c=_0x2a90b8[0x38*0x87+0xa3f*-0x3+0x135];if(_0x15c62c==='-')return[];const _0x3bff0a=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x380181(0x223)](_0x2a90b8),_0x3f0ba8=_0x3bff0a?.[0x1*-0x1d20+0x10a5+-0x44*-0x2f]?.[_0x380181(0x190)]('\x5c','/');return _0x3f0ba8===undefined||_0x3f0ba8[_0x380181(0x1ef)]===-0x9b7+0x3*0x5b3+0x3b1*-0x2?[]:[_0x3f0ba8];})[_0x3b351c(0x278)]((_0x53c079,_0x59b22c)=>_0x53c079[_0x3b351c(0x1c1)](_0x59b22c));}export async function resolveGitRepository(_0x270e2a,_0x131c70){const _0xb2281e=_0x3dca6f;if(_0x131c70[_0xb2281e(0x1ef)]===0x24ff+0x1ab7*-0x1+-0xa48)return realpath(_0x270e2a);if(_0x131c70[_0xb2281e(0x22f)]('\x00')||_0x131c70[_0xb2281e(0x233)]('/')||_0x131c70[_0xb2281e(0x233)]('\x5c')||_0x131c70[_0xb2281e(0x239)]('/')[_0xb2281e(0x1ba)](_0x4b0e5f=>_0x4b0e5f[_0xb2281e(0x1ef)]===0xa01+-0x1528+0xb27||_0x4b0e5f==='.'||_0x4b0e5f==='..'))throw new Error(_0xb2281e(0x22d));const _0xc82135=await listInitializedSubmodulePaths(_0x270e2a);if(!_0xc82135[_0xb2281e(0x22f)](_0x131c70))throw new Error(_0xb2281e(0x22d));const _0x2d276e=resolve(await realpath(_0x270e2a),_0x131c70);try{await readGitSummary(_0x2d276e);}catch{throw new Error(_0xb2281e(0x22d));}return _0x2d276e;}function _0x11df(_0x428ce1,_0x5409ac){_0x428ce1=_0x428ce1-(-0x527*0x7+-0x2240+0x47d2);const _0x3da4b2=_0x58c1();let _0x20821f=_0x3da4b2[_0x428ce1];if(_0x11df['vAhaMt']===undefined){var _0x50b472=function(_0x418751){const _0x233a3a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x44839f='',_0x4d72d1='';for(let _0xde4740=0x5a5+0x6e5*0x1+-0x6b*0x1e,_0x8674a4,_0xac8bee,_0x462c1a=-0x32*0xf+-0xf*-0x7a+-0xc*0x5a;_0xac8bee=_0x418751['charAt'](_0x462c1a++);~_0xac8bee&&(_0x8674a4=_0xde4740%(0x1854+-0x25*0x11+-0x15db)?_0x8674a4*(0x16b2+0x2331+0xe3*-0x41)+_0xac8bee:_0xac8bee,_0xde4740++%(-0x21fb+0xaf8+-0xf*-0x189))?_0x44839f+=String['fromCharCode'](-0xdc6+0x1*0xd1c+-0x55*-0x5&_0x8674a4>>(-(0x39*-0xad+-0xd46*0x1+0x33cd)*_0xde4740&-0xe7*-0x9+0x2e*-0x8f+0x1199)):-0xfe0+-0x101*-0x16+-0x636){_0xac8bee=_0x233a3a['indexOf'](_0xac8bee);}for(let _0x291b7d=-0x94b+-0x174f+0x209a,_0x2de086=_0x44839f['length'];_0x291b7d<_0x2de086;_0x291b7d++){_0x4d72d1+='%'+('00'+_0x44839f['charCodeAt'](_0x291b7d)['toString'](0x144e+0x101a+-0x2458))['slice'](-(-0xd76*0x1+-0x1*0x239e+-0x1*-0x3116));}return decodeURIComponent(_0x4d72d1);};_0x11df['uoeIMQ']=_0x50b472,_0x11df['JlVDqr']={},_0x11df['vAhaMt']=!![];}const _0xa75642=_0x3da4b2[0x7cb+-0xeb8+-0xc5*-0x9];_0x11df['dgoWBD']!==_0xa75642&&(_0x11df['JlVDqr']={},_0x11df['dgoWBD']=_0xa75642);const _0x343413=_0x11df['JlVDqr'][_0x428ce1];return _0x343413===undefined?(_0x20821f=_0x11df['uoeIMQ'](_0x20821f),_0x11df['JlVDqr'][_0x428ce1]=_0x20821f):_0x20821f=_0x343413,_0x20821f;}export async function listGitHistoryRefs(_0x480872){const _0x1aefef=_0x3dca6f,_0x3d2464=await runGit(_0x480872,[_0x1aefef(0x1b5),_0x1aefef(0x282),_0x1aefef(0x224),_0x1aefef(0x264)]);return _0x3d2464[_0x1aefef(0x255)][_0x1aefef(0x239)](/\r?\n/)[_0x1aefef(0x208)](_0x592feb=>{const _0x54ffed=_0x1aefef,[_0x26f5c5,_0x213c4e,_0x251f0a,_0x55498d,_0x1db161]=_0x592feb[_0x54ffed(0x239)]('\x09');if(_0x26f5c5===undefined||_0x213c4e===undefined||_0x251f0a===undefined||_0x1db161===undefined||_0x1db161[_0x54ffed(0x1ef)]>-0x199+-0x22a6+0x3*0xc15||!/^[0-9a-f]{40,64}$/[_0x54ffed(0x1e4)](_0x251f0a))return[];const _0x3bac2b=_0x26f5c5[_0x54ffed(0x233)](_0x54ffed(0x1f7))?_0x54ffed(0x296):_0x26f5c5[_0x54ffed(0x233)](_0x54ffed(0x27d))?_0x54ffed(0x200):undefined;return _0x3bac2b===undefined?[]:[{'name':_0x26f5c5,'displayName':_0x213c4e,'kind':_0x3bac2b,'hash':_0x251f0a,'current':_0x55498d==='*'}];})[_0x1aefef(0x278)]((_0x39096f,_0x413431)=>_0x39096f[_0x1aefef(0x196)][_0x1aefef(0x1c1)](_0x413431[_0x1aefef(0x196)])||_0x39096f[_0x1aefef(0x231)][_0x1aefef(0x1c1)](_0x413431[_0x1aefef(0x231)]));}function selectedHistoryRefs(_0x5c86c7,_0x280ce8){const _0x5d3fc5=_0x3dca6f;if(_0x280ce8===undefined||_0x280ce8[_0x5d3fc5(0x1ef)]===-0xae2+0x3*0x103+0x31*0x29)return _0x5c86c7;const _0x29eadc=[...new Set(_0x280ce8)],_0xd8deb2=_0x29eadc[_0x5d3fc5(0x287)](_0x1c3116=>_0x5c86c7[_0x5d3fc5(0x1b6)](_0x11c1c7=>_0x11c1c7[_0x5d3fc5(0x294)]===_0x1c3116));if(_0xd8deb2[_0x5d3fc5(0x1ba)](_0x5d726c=>_0x5d726c===undefined))throw new Error(_0x5d3fc5(0x26d));return _0xd8deb2;}function historyCursor(_0x3dc9f3,_0x244201){const _0x43adfc=_0x3dca6f;return Buffer[_0x43adfc(0x1ae)](JSON[_0x43adfc(0x1c7)]({'offset':_0x3dc9f3,'fingerprint':_0x244201}))[_0x43adfc(0x207)](_0x43adfc(0x28c));}function parseHistoryCursor(_0x46763e,_0x2a6d97){const _0x2db746=_0x3dca6f;if(_0x46763e===undefined)return 0x2400+-0x2356*0x1+-0xaa;try{const _0x3845ec=JSON[_0x2db746(0x24e)](Buffer[_0x2db746(0x1ae)](_0x46763e,_0x2db746(0x28c))[_0x2db746(0x207)](_0x2db746(0x210)));if(!Number[_0x2db746(0x1fd)](_0x3845ec[_0x2db746(0x18d)])||_0x3845ec[_0x2db746(0x18d)]<-0x75*0x17+0xa*-0x146+0x21d*0xb||_0x3845ec[_0x2db746(0x291)]!==_0x2a6d97)throw new Error(_0x2db746(0x284));return _0x3845ec[_0x2db746(0x18d)];}catch{throw new Error(_0x2db746(0x21f));}}export async function readGitHistory(_0x136b2a,_0x59d82d){const _0x4e5a12=_0x3dca6f,_0x46c8ab=await listGitHistoryRefs(_0x136b2a),_0xeb02ce=selectedHistoryRefs(_0x46c8ab,_0x59d82d[_0x4e5a12(0x244)]);if(_0xeb02ce[_0x4e5a12(0x1ef)]===-0x97*-0x3c+-0x35*-0x63+-0x1*0x37e3)return{'commits':[],'nextCursor':null};const _0x146702=_0x59d82d[_0x4e5a12(0x23c)]??-0x10dc+0x6c+0x1*0x10a2;if(!Number[_0x4e5a12(0x1fd)](_0x146702)||_0x146702<-0x31b*-0x5+-0x1*0x13b5+0x42f||_0x146702>-0x1703*-0x1+-0x43*0xb+-0x85*0x26)throw new Error(_0x4e5a12(0x227));const _0x2a8c4b=_0xeb02ce[_0x4e5a12(0x287)](_0x86f852=>_0x86f852[_0x4e5a12(0x294)])[_0x4e5a12(0x278)](),_0x2646fe=createHash(_0x4e5a12(0x214))[_0x4e5a12(0x1d2)](_0xeb02ce[_0x4e5a12(0x287)](_0x557c63=>_0x557c63[_0x4e5a12(0x294)]+'\x00'+_0x557c63[_0x4e5a12(0x193)])[_0x4e5a12(0x278)]()[_0x4e5a12(0x1b3)]('\x00'))[_0x4e5a12(0x212)](_0x4e5a12(0x1bd)),_0x1d199a=parseHistoryCursor(_0x59d82d[_0x4e5a12(0x28e)],_0x2646fe),_0x317dce=await runGit(_0x136b2a,[_0x4e5a12(0x1ad),_0x4e5a12(0x1bf),_0x4e5a12(0x290),_0x4e5a12(0x1f6)+_0x1d199a,_0x4e5a12(0x21b)+(_0x146702+(-0x464+0x47*-0x67+-0x20f6*-0x1)),'-z',_0x4e5a12(0x28d),..._0x2a8c4b,'--']),_0x58b319=new Map();for(const _0x195c7d of _0x46c8ab){const _0x1f9185=_0x58b319[_0x4e5a12(0x1cf)](_0x195c7d[_0x4e5a12(0x193)])??[];_0x1f9185[_0x4e5a12(0x260)](_0x195c7d[_0x4e5a12(0x231)]),_0x58b319[_0x4e5a12(0x1a5)](_0x195c7d[_0x4e5a12(0x193)],_0x1f9185);}const _0x3b569a=_0x317dce[_0x4e5a12(0x255)][_0x4e5a12(0x239)]('\x00'),_0x2d7458=[];for(let _0x20ac71=0x1741+0xf01+-0x2642;_0x20ac71+(-0x6b*0x47+0x23a5+-0x5f3)<_0x3b569a[_0x4e5a12(0x1ef)];_0x20ac71+=-0x22a*-0x6+-0x2*-0x38b+-0x503*0x4){const [_0x312211,_0x2c826f='',_0x13d89d='',_0x245e07='',_0x59fd37='0',_0x6e0216='']=_0x3b569a[_0x4e5a12(0x194)](_0x20ac71,_0x20ac71+(0x3*-0xb02+-0x1*0x559+0x2665));if(_0x312211===undefined||!/^[0-9a-f]{40,64}$/[_0x4e5a12(0x1e4)](_0x312211))continue;_0x2d7458[_0x4e5a12(0x260)]({'hash':_0x312211,'parents':_0x2c826f[_0x4e5a12(0x1ef)]===0x1aff+0x3a*0x30+-0x25df?[]:_0x2c826f[_0x4e5a12(0x239)]('\x20'),'authorName':_0x13d89d,'authorEmail':_0x245e07,'committedAt':Number(_0x59fd37)*(-0x427*-0x7+0x141c+-0x2d45*0x1),'subject':_0x6e0216,'refs':_0x58b319[_0x4e5a12(0x1cf)](_0x312211)??[]});}const _0x204684=_0x2d7458[_0x4e5a12(0x1ef)]>_0x146702;return{'commits':_0x2d7458[_0x4e5a12(0x194)](-0x2*0x30c+-0x4f9+0xb11,_0x146702),'nextCursor':_0x204684?historyCursor(_0x1d199a+_0x146702,_0x2646fe):null};}async function assertHistoryCommitReachable(_0x5ef3a8,_0x191e34,_0x15f3bc){const _0x766354=_0x3dca6f;if(!/^[0-9a-f]{40,64}$/[_0x766354(0x1e4)](_0x191e34))throw new Error(_0x766354(0x279));const _0x4cab28=selectedHistoryRefs(await listGitHistoryRefs(_0x5ef3a8),_0x15f3bc);for(const _0x5621bf of _0x4cab28){const _0x1bbd59=await runGitAllowFailure(_0x5ef3a8,[_0x766354(0x28b),_0x766354(0x281),_0x191e34,_0x5621bf[_0x766354(0x294)]]);if(_0x1bbd59[_0x766354(0x203)]===0x83f*-0x4+-0x2*0xabe+0x3678)return;}throw new Error(_0x766354(0x279));}export async function readGitHistoryFiles(_0x56e744,_0x10f445,_0x1c7ae){const _0x2661ff=_0x3dca6f;await assertHistoryCommitReachable(_0x56e744,_0x10f445,_0x1c7ae);const _0x21acea=await runGit(_0x56e744,[_0x2661ff(0x23b),_0x2661ff(0x297),_0x2661ff(0x251),_0x2661ff(0x1ed),'-r','-z','-M','-C',_0x2661ff(0x263),_0x10f445]),_0xffca8b=_0x21acea[_0x2661ff(0x255)][_0x2661ff(0x239)]('\x00'),_0x546d53=[];for(let _0x1dd361=-0xaeb*0x2+-0x3ed*-0x4+0x622;_0x1dd361<_0xffca8b[_0x2661ff(0x1ef)];_0x1dd361+=0x235d+-0xb4f+0x2f*-0x83){const _0x57f2b4=_0xffca8b[_0x1dd361];if(_0x57f2b4===undefined||_0x57f2b4[_0x2661ff(0x1ef)]===0x62e*-0x1+-0x1b0e*0x1+0x58a*0x6)continue;const _0x359147=_0x57f2b4[0x62*-0x1a+-0x1*0x576+0xf6a]??'M';if(_0x359147==='R'||_0x359147==='C'){const _0x27c918=_0xffca8b[_0x1dd361+(-0x8bf*-0x1+-0x1b95+0x12d7)],_0x5d29ac=_0xffca8b[_0x1dd361+(0x1b6*-0x12+-0x24a8+0x4376)];if(_0x27c918!==undefined&&_0x5d29ac!==undefined)_0x546d53[_0x2661ff(0x260)]({'path':_0x5d29ac,'previousPath':_0x27c918,'change':gitChange(_0x359147)});_0x1dd361+=-0xdb0+0x1*-0x7f7+0x455*0x5;}else{const _0xf935a3=_0xffca8b[_0x1dd361+(0x1*0xddb+0x26b6+-0x1*0x3490)];if(_0xf935a3!==undefined)_0x546d53[_0x2661ff(0x260)]({'path':_0xf935a3,'change':gitChange(_0x359147)});_0x1dd361+=-0x89*0x45+0x26*0x59+0x1*0x17b8;}}return _0x546d53;}export async function readGitHistoryFileDiff(_0x57feb2,_0x26b02d,_0x30852e,_0x5d6001,_0x12c065){const _0x476c01=_0x3dca6f;await assertHistoryCommitReachable(_0x57feb2,_0x26b02d,_0x5d6001);const _0x28d3c5=safeGitWorkspacePath(_0x30852e),_0x3ea026=_0x12c065===undefined?undefined:safeGitWorkspacePath(_0x12c065),_0x84a8c8=await runGit(_0x57feb2,[_0x476c01(0x23f),_0x476c01(0x235),_0x476c01(0x251),_0x476c01(0x20c),_0x476c01(0x22a),_0x26b02d,'--',_0x476c01(0x205)+_0x28d3c5,..._0x3ea026===undefined||_0x3ea026===_0x28d3c5?[]:[_0x476c01(0x205)+_0x3ea026]]),_0x5f089e=_0x84a8c8[_0x476c01(0x1be)][_0x476c01(0x22f)](0xe82+-0xd96+-0xec)||_0x84a8c8[_0x476c01(0x255)][_0x476c01(0x22f)](_0x476c01(0x20b));if(_0x5f089e)return{'binary':!![],'summary':_0x476c01(0x1ce)+createHash(_0x476c01(0x214))[_0x476c01(0x1d2)](_0x84a8c8[_0x476c01(0x1be)])[_0x476c01(0x212)](_0x476c01(0x1bd))+_0x476c01(0x277)+_0x84a8c8[_0x476c01(0x1be)][_0x476c01(0x1ef)],'truncated':_0x84a8c8[_0x476c01(0x1dd)]};return{'binary':![],'text':_0x84a8c8[_0x476c01(0x255)],'truncated':_0x84a8c8[_0x476c01(0x1dd)]};}export async function readGitHistoryFileContentRange(_0x48ddd2,_0x4babd5,_0x2ad645,_0x3a1006,_0x2993f1,_0x18c8da){const _0x132825=_0x3dca6f;if(!Number[_0x132825(0x181)](_0x3a1006)||_0x3a1006<0x4*-0x74+0x207a+0x311*-0xa||!Number[_0x132825(0x181)](_0x2993f1)||_0x2993f1<0x2*-0x3f2+0x2f*-0x39+0x125c||_0x2993f1>(-0x151e+-0xf67+0x2499)*(0x151*0x7+-0x25da+0x20a3)*(-0x26b9+0x467+-0x7aa*-0x5)||_0x3a1006+_0x2993f1>(-0xd*0x24d+0x165+0x1c98)*(0x1d7f+0x1*-0xfd7+-0xce*0xc)*(-0xbc1+0x239*-0x5+-0x16a*-0x13))throw new Error(_0x132825(0x192));await assertHistoryCommitReachable(_0x48ddd2,_0x4babd5,_0x18c8da);const _0x41f727=safeGitWorkspacePath(_0x2ad645),_0x47d1ac=_0x4babd5+':'+_0x41f727,_0x51fb28=await runGit(_0x48ddd2,[_0x132825(0x1e9),'-s',_0x47d1ac]),_0x63eec5=Number(_0x51fb28[_0x132825(0x255)][_0x132825(0x250)]());if(!Number[_0x132825(0x181)](_0x63eec5)||_0x63eec5<-0x11*0x17+0xfa0+-0xe19||_0x3a1006>_0x63eec5)throw new Error(_0x132825(0x192));if(_0x3a1006===_0x63eec5)return{'path':_0x41f727,'size':_0x63eec5,'offset':_0x3a1006,'contentBase64':'','nextOffset':null};const _0x5d1bcd=await runGitAllowFailure(_0x48ddd2,[_0x132825(0x1e9),_0x132825(0x1fa),_0x47d1ac],_0x3a1006+_0x2993f1);if(_0x5d1bcd[_0x132825(0x203)]!==0x256c+0x579*0x2+-0x305e)throw new GitCommandError(_0x5d1bcd[_0x132825(0x203)],_0x5d1bcd[_0x132825(0x1a0)]);const _0x25172b=_0x5d1bcd[_0x132825(0x1be)][_0x132825(0x236)](_0x3a1006,Math[_0x132825(0x28a)](_0x63eec5,_0x3a1006+_0x2993f1)),_0x1f3f8f=_0x3a1006+_0x25172b[_0x132825(0x1ef)];return{'path':_0x41f727,'size':_0x63eec5,'offset':_0x3a1006,'contentBase64':_0x25172b[_0x132825(0x207)](_0x132825(0x20e)),'nextOffset':_0x1f3f8f<_0x63eec5?_0x1f3f8f:null};}export async function readCurrentChanges(_0x487a4f){const _0x5c2112=_0x3dca6f;return(await readCurrentChangesSummary(_0x487a4f))[_0x5c2112(0x18b)];}export async function readCurrentChangeDiff(_0x3b2568,_0x2a00e9){const _0x459897=_0x3dca6f,_0x30d316=safeGitWorkspacePath(_0x2a00e9);await assertCurrentChangePathAccessible(_0x3b2568,_0x30d316);const _0x14a1fc=await readCurrentChangeGitDiff(_0x3b2568,_0x30d316),_0x2d8f63=await readWorkingTreeText(_0x3b2568,_0x30d316),_0x136cf6=_0x14a1fc[_0x459897(0x1be)][_0x459897(0x22f)](-0x6*0x5d1+-0x187c+-0x16*-0x2b3)||_0x14a1fc[_0x459897(0x255)][_0x459897(0x22f)](_0x459897(0x20b))||_0x2d8f63?.[_0x459897(0x257)]===!![];if(_0x136cf6)return{'binary':!![],'summary':_0x459897(0x1ce)+createHash(_0x459897(0x214))[_0x459897(0x1d2)](_0x14a1fc[_0x459897(0x1be)])[_0x459897(0x212)](_0x459897(0x1bd))+_0x459897(0x277)+_0x14a1fc[_0x459897(0x1be)][_0x459897(0x1ef)],'truncated':_0x14a1fc[_0x459897(0x1dd)]||_0x2d8f63?.[_0x459897(0x1dd)]===!![]};return{'binary':![],'text':_0x14a1fc[_0x459897(0x255)],'truncated':_0x14a1fc[_0x459897(0x1dd)]||_0x2d8f63?.[_0x459897(0x1dd)]===!![],'afterText':_0x2d8f63?.[_0x459897(0x255)]??'',..._0x2d8f63===undefined?{}:{'afterTruncated':_0x2d8f63[_0x459897(0x1dd)]}};}async function readCurrentChangeGitDiff(_0x59c30f,_0x4c8dbd){const _0x316b1b=_0x3dca6f,_0x5f0371=await runGit(_0x59c30f,[_0x316b1b(0x18a),_0x316b1b(0x209),_0x316b1b(0x1ff),'-z','--',_0x316b1b(0x205)+_0x4c8dbd]);if(_0x5f0371[_0x316b1b(0x255)][_0x316b1b(0x239)]('\x00')[_0x316b1b(0x22f)](_0x4c8dbd)){const _0x44c31a=await runGitAllowFailure(_0x59c30f,[_0x316b1b(0x261),_0x316b1b(0x25f),_0x316b1b(0x20c),_0x316b1b(0x22a),'--',_0x316b1b(0x1bc),_0x4c8dbd]);if(_0x44c31a[_0x316b1b(0x203)]!==-0x977+-0x1*-0x1411+-0xa9a&&_0x44c31a[_0x316b1b(0x203)]!==-0x115*0x20+0xb9a+-0xf*-0x189)throw new GitCommandError(_0x44c31a[_0x316b1b(0x203)],_0x44c31a[_0x316b1b(0x1a0)]);return _0x44c31a;}return runGit(_0x59c30f,[_0x316b1b(0x261),_0x316b1b(0x20c),_0x316b1b(0x22a),_0x316b1b(0x259),'--',_0x316b1b(0x205)+_0x4c8dbd]);}export async function isWorkspaceChangeVisible(_0x50ae62,_0x471133){const _0x51e520=_0x3dca6f;try{return await assertCurrentChangePathAccessible(_0x50ae62,safeGitWorkspacePath(_0x471133)),!![];}catch(_0x3dfdb2){if(_0x3dfdb2 instanceof Error&&(_0x3dfdb2[_0x51e520(0x265)]===_0x51e520(0x19c)||_0x3dfdb2[_0x51e520(0x265)]===_0x51e520(0x243)||_0x3dfdb2[_0x51e520(0x265)]===_0x51e520(0x288)))return![];throw _0x3dfdb2;}}async function assertCurrentChangePathAccessible(_0x4eedff,_0x18ad71){const _0x43fb74=_0x3dca6f,_0x2b3c8f=await realpath(_0x4eedff),_0x2d4f46=resolve(_0x2b3c8f,_0x18ad71),_0x63cff9=await lstat(_0x2d4f46)[_0x43fb74(0x28f)](_0x530d50=>{const _0xeb6e80=_0x43fb74;if(_0x530d50[_0xeb6e80(0x203)]===_0xeb6e80(0x20f))return undefined;throw _0x530d50;});if(_0x63cff9===undefined)return;await resolveWorkspaceEntry(_0x2b3c8f,_0x18ad71,![]);}async function readWorkingTreeText(_0x22f7fd,_0x422f94){const _0x1cf891=_0x3dca6f,_0x2fcfec=await realpath(_0x22f7fd);let _0x137cdb;try{_0x137cdb=await resolveWorkspaceEntry(_0x2fcfec,_0x422f94,![]);}catch(_0x1e93be){if(_0x1e93be instanceof Error&&_0x1e93be[_0x1cf891(0x265)]===_0x1cf891(0x243))return undefined;throw _0x1e93be;}const _0x451e78=await lstat(_0x137cdb);if(!_0x451e78[_0x1cf891(0x1ca)]())return undefined;const _0x2ef94b=await readFile(_0x137cdb);return diffTextFromBuffer(_0x2ef94b,_0x2ef94b[_0x1cf891(0x1ef)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x3da3c4,_0x2233b7){const _0x51c305=_0x3dca6f;if(_0x3da3c4[_0x51c305(0x22f)](0x19+-0x20ff+0x20e6)||!isValidUtf8(_0x3da3c4))return{'binary':!![],'truncated':_0x2233b7};let _0x36c1f9=Math[_0x51c305(0x28a)](_0x3da3c4[_0x51c305(0x1ef)],GIT_OUTPUT_LIMIT);while(_0x36c1f9>0x2377+-0x1d6a+-0x60d&&_0x36c1f9<_0x3da3c4[_0x51c305(0x1ef)]&&isUtf8ContinuationByte(_0x3da3c4[_0x36c1f9]))_0x36c1f9-=-0x1035+0x1069+-0x33;return{'binary':![],'text':_0x3da3c4[_0x51c305(0x236)](0x23c2+-0x140c*0x1+-0x1*0xfb6,_0x36c1f9)[_0x51c305(0x207)](_0x51c305(0x210)),'truncated':_0x2233b7};}export async function restoreCurrentChange(_0x349e28,_0x3fdf5a,_0x4ebba9){const _0x1dd4d9=_0x3dca6f,_0x24a357=safeGitWorkspacePath(_0x3fdf5a),_0x50baff=_0x1dd4d9(0x205)+_0x24a357;if(_0x4ebba9===_0x1dd4d9(0x283)){const _0x4d7cb8=await runGit(_0x349e28,[_0x1dd4d9(0x1c0),_0x1dd4d9(0x238),'-z',_0x1dd4d9(0x1da),'--',_0x50baff]);if(!_0x4d7cb8[_0x1dd4d9(0x255)][_0x1dd4d9(0x239)]('\x00')[_0x1dd4d9(0x1ba)](_0x2690be=>_0x2690be[_0x1dd4d9(0x233)](_0x1dd4d9(0x1d8))&&_0x2690be[_0x1dd4d9(0x194)](0x22cf+-0x10*-0x11b+-0x347c)===_0x24a357))throw new Error(_0x1dd4d9(0x246));const _0x25b083=await realpath(_0x349e28),_0x3020ea=resolve(_0x25b083,_0x24a357),_0x55212f=await lstat(_0x3020ea);if(!_0x55212f[_0x1dd4d9(0x1ca)]()||_0x55212f[_0x1dd4d9(0x1f3)]())throw new Error(_0x1dd4d9(0x246));await unlink(_0x3020ea);return;}if(_0x4ebba9===_0x1dd4d9(0x1a7)){await runGit(_0x349e28,[_0x1dd4d9(0x1b1),_0x1dd4d9(0x25e),'--',_0x50baff]);return;}await runGit(_0x349e28,[_0x1dd4d9(0x1b1),_0x1dd4d9(0x22c),_0x1dd4d9(0x1dc),_0x1dd4d9(0x25e),'--',_0x50baff]);}function safeGitWorkspacePath(_0x594402){const _0x379ff0=_0x3dca6f;if(_0x594402[_0x379ff0(0x1ef)]===-0x12d3+0x1017+0x2bc||_0x594402[_0x379ff0(0x22f)]('\x00')||_0x594402[_0x379ff0(0x233)]('/')||_0x594402[_0x379ff0(0x233)]('\x5c'))throw new Error(_0x379ff0(0x19c));const _0x166d62=_0x594402[_0x379ff0(0x190)]('\x5c','/');if(_0x166d62[_0x379ff0(0x239)]('/')[_0x379ff0(0x1ba)](_0x2a5856=>_0x2a5856===''||_0x2a5856==='..'||_0x2a5856===_0x379ff0(0x1c8)))throw new Error(_0x379ff0(0x19c));return _0x166d62;}function gitChange(_0x599e3d){const _0x5ac5f7=_0x3dca6f;if(_0x599e3d==='A')return _0x5ac5f7(0x1d0);if(_0x599e3d==='D')return _0x5ac5f7(0x186);if(_0x599e3d==='R')return _0x5ac5f7(0x274);if(_0x599e3d==='C')return _0x5ac5f7(0x1bb);if(_0x599e3d==='T')return _0x5ac5f7(0x1a8);return _0x5ac5f7(0x266);}export class GitCommandError extends Error{[_0x3dca6f(0x203)];[_0x3dca6f(0x1a0)];constructor(_0x5ed307,_0x5206d3){const _0x29f4f7=_0x3dca6f;super(_0x29f4f7(0x1f4)),this[_0x29f4f7(0x203)]=_0x5ed307,this[_0x29f4f7(0x1a0)]=_0x5206d3;}}async function runGit(_0x1a53ba,_0xf92fc8){const _0x2bbaba=_0x3dca6f,_0x3bf7fc=await runGitAllowFailure(_0x1a53ba,_0xf92fc8);if(_0x3bf7fc[_0x2bbaba(0x203)]!==0x1756*0x1+-0x1f*0xa5+-0x35b)throw new GitCommandError(_0x3bf7fc[_0x2bbaba(0x203)],_0x3bf7fc[_0x2bbaba(0x1a0)]);return _0x3bf7fc;}async function runGitAllowFailure(_0x3a22a4,_0x499c34,_0x3fbddf=GIT_OUTPUT_LIMIT){return new Promise((_0x301d9b,_0xf9dd04)=>{const _0x5178af=_0x11df,_0x4ec1f5=spawn(_0x5178af(0x202),[..._0x499c34],{'cwd':_0x3a22a4,'shell':![],'windowsHide':!![],'stdio':[_0x5178af(0x1cd),_0x5178af(0x1f1),_0x5178af(0x1f1)]}),_0x648343=[],_0x2ccff7=[];let _0x2b5f9e=-0x71d*-0x1+0xed*-0x1f+0x1596,_0x423e30=![];const _0x193600=setTimeout(()=>_0x4ec1f5[_0x5178af(0x27a)](_0x5178af(0x1d9)),GIT_TIMEOUT_MS);_0x4ec1f5[_0x5178af(0x295)]['on'](_0x5178af(0x293),_0x368e53=>{const _0x6c7534=_0x5178af,_0x1e1713=Math[_0x6c7534(0x286)](-0x119b*-0x1+0x2687+-0x3822,_0x3fbddf-_0x2b5f9e);if(_0x1e1713>-0x1e1a+-0x1*0x1dad+-0x3*-0x13ed){const _0x14a198=_0x368e53[_0x6c7534(0x236)](-0x264b+0x139*-0xf+0x1c51*0x2,_0x1e1713);_0x648343[_0x6c7534(0x260)](_0x14a198),_0x2b5f9e+=_0x14a198[_0x6c7534(0x1ef)];}_0x423e30||=_0x368e53[_0x6c7534(0x1ef)]>_0x1e1713;}),_0x4ec1f5[_0x5178af(0x1a0)]['on'](_0x5178af(0x293),_0x2b15f5=>_0x2ccff7[_0x5178af(0x260)](_0x2b15f5[_0x5178af(0x236)](0x20f*0x1+-0x2469+0x225a,-0x1*-0x1c13+-0x1*-0x114d+-0x3ac*0x8))),_0x4ec1f5[_0x5178af(0x1d4)](_0x5178af(0x1f5),_0x554dbe=>{clearTimeout(_0x193600),_0xf9dd04(_0x554dbe);}),_0x4ec1f5[_0x5178af(0x1d4)](_0x5178af(0x280),_0x1e065f=>{const _0xa0eef0=_0x5178af;clearTimeout(_0x193600);const _0x364a9b=Buffer[_0xa0eef0(0x1ee)](_0x648343);_0x301d9b({'code':_0x1e065f??0x120c+0x1d37+-0x20e*0x17,'output':_0x364a9b,'text':_0x364a9b[_0xa0eef0(0x207)](_0xa0eef0(0x210)),'stderr':Buffer[_0xa0eef0(0x1ee)](_0x2ccff7)[_0xa0eef0(0x207)](_0xa0eef0(0x210)),'truncated':_0x423e30});});});}function isGitUnavailable(_0x2296ba){const _0xea4e32=_0x3dca6f;return _0x2296ba instanceof Error&&_0xea4e32(0x203)in _0x2296ba&&_0x2296ba[_0xea4e32(0x203)]===_0xea4e32(0x20f);}function summarizeText(_0x5a324d){const _0x5e9e0e=_0x3dca6f;return JSON[_0x5e9e0e(0x1c7)]({'sha256':createHash(_0x5e9e0e(0x214))[_0x5e9e0e(0x1d2)](_0x5a324d)[_0x5e9e0e(0x212)](_0x5e9e0e(0x1bd)),'bytes':Buffer[_0x5e9e0e(0x1cb)](_0x5a324d)});}
2
+ const _0x4be827=_0x598f;(function(_0xcee718,_0x3e1561){const _0x1fe898=_0x598f,_0x5661ec=_0xcee718();while(!![]){try{const _0x5c1e53=-parseInt(_0x1fe898(0xf1))/(-0x1c57+-0x33*-0x56+0xb36)*(parseInt(_0x1fe898(0x15a))/(0x4*0x43c+-0xd86+-0x368))+-parseInt(_0x1fe898(0xbd))/(0x2056*0x1+0x1941+-0x3994)+parseInt(_0x1fe898(0x120))/(-0x1328*0x2+0x98a+-0x6e*-0x43)+parseInt(_0x1fe898(0x183))/(0x1bca+0x78c+0x2351*-0x1)+parseInt(_0x1fe898(0x199))/(-0x4dc*0x4+-0x7c8+0x13d*0x16)*(-parseInt(_0x1fe898(0x15d))/(-0x1e14+0x474+0x19a7))+parseInt(_0x1fe898(0x9c))/(-0x10c0+0x21e+0x2*0x755)+-parseInt(_0x1fe898(0x1a6))/(-0x133+-0x2622+0x275e)*(-parseInt(_0x1fe898(0x115))/(0x1810+-0x2fa*-0x1+-0x360*0x8));if(_0x5c1e53===_0x3e1561)break;else _0x5661ec['push'](_0x5661ec['shift']());}catch(_0x156246){_0x5661ec['push'](_0x5661ec['shift']());}}}(_0x5585,-0x13e*-0xcae+-0x49*0x557+-0x2e3*0x187));import{createHash,randomUUID}from'node:crypto';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x204681}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';const GIT_TIMEOUT_MS=-0x855+-0x1027+0x2c04,GIT_OUTPUT_LIMIT=(0x19c3+0x1*0x2ad+-0x9*0x2f0)*(0x1*0x2015+-0x1*0x1977+-0x29e),FILE_READ_LIMIT=(-0x23eb+-0x1e5b+0x2*0x2223)*(0x1*0x413+-0x1f92+0x2dd*0xb),DIRECTORY_PAGE_LIMIT=-0x27*0x3a+-0x21c2+0x2b60,DIRECTORY_PICKER_LIMIT=-0x52*0x71+0x21*-0xc9+0x3ee3,SEARCH_RESULT_LIMIT=0xb19+-0xe46+0x1*0x3f5,FILE_INDEX_IDLE_TTL_MS=(-0x16cb+0x1e6c+-0x765)*(-0x1bd1+0x214+-0x1*-0x19f9)*(-0x42c+-0x40b+-0x1d*-0x6b),FILE_INDEX_FRESHNESS_TTL_MS=-0xb08b*-0x1+-0xb208+0x30b*0x27,FILE_INDEX_ENTRY_LIMIT=0x2cda4+-0x19cb7+0x47*0x135,FILE_INDEX_METADATA_CONCURRENCY=-0x475+-0xa57+0xeec,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x4be827(0x16e),_0x4be827(0x187),_0x4be827(0xac),_0x4be827(0x194),_0x4be827(0xb2),_0x4be827(0x9e),_0x4be827(0xaf),_0x4be827(0x9d),_0x4be827(0x174),_0x4be827(0xe1),_0x4be827(0x1ae),_0x4be827(0xdd),_0x4be827(0x138),_0x4be827(0xd8),_0x4be827(0x161),_0x4be827(0x17c),_0x4be827(0xe7),_0x4be827(0x105),_0x4be827(0x18f),_0x4be827(0x195),_0x4be827(0x130),_0x4be827(0x134),_0x4be827(0xca),_0x4be827(0x116),_0x4be827(0x179)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x548d70,_0x5350ab,_0x1a0e5d){const _0x154cd6=_0x4be827,_0x4cc7ce=_0x5350ab[_0x154cd6(0x190)]();if(_0x4cc7ce[_0x154cd6(0xa0)]===0x16c*-0x1b+0x4a6+-0xe*-0x269||_0x4cc7ce[_0x154cd6(0xa0)]>0x2056+-0x21a3*-0x1+-0x40fa||_0x4cc7ce==='.'||_0x4cc7ce==='..'||_0x4cc7ce[_0x154cd6(0x108)]('/')||_0x4cc7ce[_0x154cd6(0x108)]('\x5c')||_0x4cc7ce[_0x154cd6(0x108)]('\x00'))throw new Error(_0x154cd6(0xcb));const _0x5587ba=await Promise[_0x154cd6(0xd2)](_0x1a0e5d[_0x154cd6(0x19c)](_0x14945f=>realpath(_0x14945f))),_0x270fe5=await realpath(_0x548d70)[_0x154cd6(0x19a)](()=>{const _0x2876f3=_0x154cd6;throw new Error(_0x2876f3(0x173));}),_0x2bbad5=await stat(_0x270fe5)[_0x154cd6(0x19a)](()=>undefined);if(_0x2bbad5?.[_0x154cd6(0xeb)]()!==!![]||!isWithinAllowedRoot(_0x270fe5,_0x5587ba))throw new Error(_0x154cd6(0x173));const _0x17ee6e=resolve(_0x270fe5,_0x4cc7ce);if(dirname(_0x17ee6e)!==_0x270fe5||!isWithinAllowedRoot(_0x17ee6e,_0x5587ba))throw new Error(_0x154cd6(0xcb));try{await mkdir(_0x17ee6e);}catch(_0x40f91a){if(_0x40f91a[_0x154cd6(0x1ac)]===_0x154cd6(0x193))throw new Error(_0x154cd6(0x18e));throw _0x40f91a;}return _0x17ee6e;}export class WorkspaceFileIndex{[_0x4be827(0xb4)];[_0x4be827(0x149)];[_0x4be827(0x197)]=[];[_0x4be827(0x18b)]=![];[_0x4be827(0x12a)];[_0x4be827(0x145)];[_0x4be827(0x1ab)]=!![];[_0x4be827(0xf9)];[_0x4be827(0x17b)]=0x141a+-0x1dc*0x11+-0xb82*-0x1;[_0x4be827(0x10b)]=-0x6e6+-0x1fe7*0x1+0x26cd;constructor(_0x3373ae,_0x2fdfd3={}){const _0x504d0c=_0x4be827;this[_0x504d0c(0xb4)]=_0x3373ae,this[_0x504d0c(0x149)]=_0x2fdfd3;}async[_0x4be827(0xc1)](){const _0x2f7473=_0x4be827;return await this[_0x2f7473(0x1aa)](),this[_0x2f7473(0xb7)](),{'entries':this[_0x2f7473(0x197)][_0x2f7473(0x177)](_0x794d1c=>_0x794d1c[_0x2f7473(0x17e)]===_0x2f7473(0x10a)),'truncated':this[_0x2f7473(0x18b)]};}[_0x4be827(0x123)](){const _0x1d2648=_0x4be827;if(this[_0x1d2648(0xf9)]!==undefined)clearTimeout(this[_0x1d2648(0xf9)]);this[_0x1d2648(0xf9)]=undefined,this[_0x1d2648(0x197)]=[],this[_0x1d2648(0x18b)]=![],this[_0x1d2648(0x1ab)]=!![],this[_0x1d2648(0x17b)]=0x1*0x246f+0x2*0x10e4+-0x19*0x2cf,this[_0x1d2648(0x10b)]=-0x4d9+-0x1*0x146f+-0x652*-0x4;}async[_0x4be827(0xa8)](_0x33b1bf,_0x32d6c2,_0x557b22=SEARCH_RESULT_LIMIT,_0x51a0a4=![]){const _0x594f3e=_0x4be827;if(_0x33b1bf[_0x594f3e(0x190)]()[_0x594f3e(0xa0)]===0x21a4+0x1643+0x37e7*-0x1||_0x33b1bf[_0x594f3e(0xa0)]>0x257+-0xbcb*0x3+-0x220a*-0x1||!Number[_0x594f3e(0xc0)](_0x557b22)||_0x557b22<0x4d2+0x2010+-0x3*0xc4b||_0x557b22>SEARCH_RESULT_LIMIT)throw new Error(_0x594f3e(0xf6));await this[_0x594f3e(0x1aa)](),this[_0x594f3e(0xb7)]();const _0x21db55=decodeSearchCursor(_0x32d6c2,_0x33b1bf),_0x575646=_0x21db55===undefined?undefined:this[_0x594f3e(0x197)][_0x594f3e(0x19e)](_0x414ffe=>_0x414ffe[_0x594f3e(0x118)]===_0x21db55&&(_0x51a0a4||_0x414ffe[_0x594f3e(0x17e)]===_0x594f3e(0x10a))),_0x563362=_0x575646===undefined?-(0x19e9+-0x5fa*0x1+-0x13ee):fuzzyPathScore(_0x575646[_0x594f3e(0x118)],_0x33b1bf),_0x24bbb7=_0x575646===undefined||_0x563362<-0x1*0x110a+-0x2*-0x59+0x1058?undefined:{'entry':_0x575646,'score':_0x563362},_0x5d8113=new RankedCandidateHeap(_0x557b22+(0x1d3a+0x287*-0x1+-0x1ab2));for(const _0x122951 of this[_0x594f3e(0x197)]){if(!_0x51a0a4&&_0x122951[_0x594f3e(0x17e)]!==_0x594f3e(0x10a))continue;const _0x21cbbf=fuzzyPathScore(_0x122951[_0x594f3e(0x118)],_0x33b1bf);if(_0x21cbbf<-0x1c+-0x1*0x1369+-0x107*-0x13)continue;const _0x5d717c={'entry':_0x122951,'score':_0x21cbbf};if(_0x24bbb7!==undefined&&compareRankedCandidate(_0x5d717c,_0x24bbb7)<=0xd8c+-0xbac+-0x1e0)continue;_0x5d8113[_0x594f3e(0x100)](_0x5d717c);}const _0x58b7de=_0x5d8113[_0x594f3e(0x15b)](),_0xc23ed6=_0x58b7de[_0x594f3e(0x17d)](-0x1*0x153+0xe95*0x1+0x6a1*-0x2,_0x557b22)[_0x594f3e(0x19c)](_0xe69e54=>_0xe69e54[_0x594f3e(0xad)]),_0x51666f=_0x58b7de[_0x557b22]?.[_0x594f3e(0xad)][_0x594f3e(0x118)];return{'entries':_0xc23ed6,'nextCursor':_0x51666f===undefined?null:encodeSearchCursor(_0x33b1bf,_0xc23ed6['at'](-(-0x92*-0x2e+0x13e3*-0x1+-0x658))?.[_0x594f3e(0x118)]??_0x21db55??''),'truncated':_0x51666f!==undefined||this[_0x594f3e(0x18b)]};}async[_0x4be827(0x1aa)](){const _0x456a86=_0x4be827;if(!this[_0x456a86(0x1ab)]&&this[_0x456a86(0x12a)]!==undefined){if(Date[_0x456a86(0x19b)]()-this[_0x456a86(0x10b)]>=(this[_0x456a86(0x149)][_0x456a86(0xb8)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x456a86(0x16f)]();return;}this[_0x456a86(0x145)]===undefined&&(this[_0x456a86(0x145)]=this[_0x456a86(0x15e)]()[_0x456a86(0x9b)](()=>{const _0x59533f=_0x456a86;this[_0x59533f(0x145)]=undefined;})),await this[_0x456a86(0x145)];}[_0x4be827(0xb7)](){const _0x5ad16e=_0x4be827;if(this[_0x5ad16e(0xf9)]!==undefined)clearTimeout(this[_0x5ad16e(0xf9)]);this[_0x5ad16e(0xf9)]=setTimeout(()=>this[_0x5ad16e(0x123)](),this[_0x5ad16e(0x149)][_0x5ad16e(0x167)]??FILE_INDEX_IDLE_TTL_MS),this[_0x5ad16e(0xf9)][_0x5ad16e(0x101)]();}async[_0x4be827(0x15e)](){const _0x56cb50=_0x4be827,_0x21e030=await resolveRegisteredWorkspaceRoot(this[_0x56cb50(0xb4)]),_0x1aa6ec=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x21e030)],_0x544963=[],_0x43ce59=this[_0x56cb50(0x149)][_0x56cb50(0x14d)]??FILE_INDEX_ENTRY_LIMIT;let _0x5b7efa=![];const _0x5060ff=['.'];let _0xe612b8=-0x24d1+-0x110+-0x25e1*-0x1;while(_0xe612b8<_0x5060ff[_0x56cb50(0xa0)]&&!_0x5b7efa){const _0x4a9aec=_0x5060ff[_0xe612b8];_0xe612b8+=0xd8*-0x22+0x416+-0x1*-0x189b;const _0x1aee94=await resolveWorkspaceEntryFromCanonicalRoot(_0x21e030,_0x4a9aec,!![])[_0x56cb50(0x19a)](()=>undefined);if(_0x1aee94===undefined)continue;const _0x3ae108=await opendir(_0x1aee94)[_0x56cb50(0x19a)](()=>undefined);if(_0x3ae108===undefined)continue;let _0x56b14d=[];const _0x1418bf=async()=>{const _0x40d3a8=_0x56cb50,_0x400520=await Promise[_0x40d3a8(0xd2)](_0x56b14d);_0x56b14d=[];for(const _0x53076f of _0x400520){if(_0x53076f===undefined)continue;if(_0x53076f[_0x40d3a8(0x118)]===_0x40d3a8(0x10f)||_0x53076f[_0x40d3a8(0x118)][_0x40d3a8(0x184)](_0x40d3a8(0x180))||isExcluded(_0x53076f[_0x40d3a8(0x118)],_0x1aa6ec))continue;if(_0x53076f[_0x40d3a8(0x17e)]===_0x40d3a8(0xfb))_0x5060ff[_0x40d3a8(0x1a3)](_0x53076f[_0x40d3a8(0x118)]);_0x544963[_0x40d3a8(0x1a3)](_0x53076f);if(_0x544963[_0x40d3a8(0xa0)]>=_0x43ce59){_0x5b7efa=!![];break;}}};for await(const _0x197e3b of _0x3ae108){const _0x490edb=_0x4a9aec==='.'?_0x197e3b[_0x56cb50(0xf0)]:posix[_0x56cb50(0x135)](_0x4a9aec[_0x56cb50(0xff)]('\x5c','/'),_0x197e3b[_0x56cb50(0xf0)]);if(_0x490edb===_0x56cb50(0x10f)||_0x490edb[_0x56cb50(0x184)](_0x56cb50(0x180))||isExcluded(_0x490edb,_0x1aa6ec))continue;_0x56b14d[_0x56cb50(0x1a3)](inspectWorkspaceIndexEntry(_0x21e030,_0x490edb,_0x197e3b[_0x56cb50(0xf0)]));if(_0x56b14d[_0x56cb50(0xa0)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x1418bf();if(_0x5b7efa)break;}if(!_0x5b7efa&&_0x56b14d[_0x56cb50(0xa0)]>-0x783+0x1998+-0x1*0x1215)await _0x1418bf();}this[_0x56cb50(0x12a)]=_0x21e030,this[_0x56cb50(0x197)]=_0x544963,this[_0x56cb50(0x18b)]=_0x5b7efa,this[_0x56cb50(0x1ab)]=![],this[_0x56cb50(0x17b)]=Date[_0x56cb50(0x19b)](),this[_0x56cb50(0x10b)]=this[_0x56cb50(0x17b)];}[_0x4be827(0x16f)](){const _0x566201=_0x4be827;if(this[_0x566201(0x145)]!==undefined)return;this[_0x566201(0x10b)]=Date[_0x566201(0x19b)](),this[_0x566201(0x145)]=this[_0x566201(0x15e)]()[_0x566201(0x19a)](()=>undefined)[_0x566201(0x9b)](()=>{const _0x230a93=_0x566201;this[_0x230a93(0x145)]=undefined;});}}async function workspaceExcludePatterns(_0xade4d){const _0x27621d=_0x4be827,_0x31a802=resolve(_0xade4d,_0x27621d(0x11c)),_0x554c32=await readFile(_0x31a802,_0x27621d(0x152))[_0x27621d(0x12f)](JSON[_0x27621d(0x191)])[_0x27621d(0x19a)](()=>undefined);if(typeof _0x554c32!==_0x27621d(0xae)||_0x554c32===null)return[];return[_0x27621d(0x122),_0x27621d(0x147)][_0x27621d(0x14e)](_0x54c241=>{const _0x521cd6=_0x27621d,_0x242775=_0x554c32[_0x54c241];return typeof _0x242775===_0x521cd6(0xae)&&_0x242775!==null?Object[_0x521cd6(0x197)](_0x242775)[_0x521cd6(0x14e)](([_0x274527,_0x3e0a5e])=>_0x3e0a5e===!![]?[_0x274527]:[]):[];});}function isExcluded(_0x22417b,_0x3babcb){const _0x56fb48=_0x4be827;return _0x3babcb[_0x56fb48(0xa1)](_0x25ca64=>minimatch(_0x22417b,_0x25ca64,{'dot':!![],'nocase':_0x204681()!==_0x56fb48(0xe2)})||minimatch(_0x22417b+'/',_0x25ca64,{'dot':!![],'nocase':_0x204681()!==_0x56fb48(0xe2)}));}function compareRankedCandidate(_0x474129,_0x5ea1f6){const _0x1b7751=_0x4be827;return _0x5ea1f6[_0x1b7751(0xba)]-_0x474129[_0x1b7751(0xba)]||_0x474129[_0x1b7751(0xad)][_0x1b7751(0x118)][_0x1b7751(0x124)](_0x5ea1f6[_0x1b7751(0xad)][_0x1b7751(0x118)]);}class RankedCandidateHeap{[_0x4be827(0xce)];[_0x4be827(0xa2)]=[];constructor(_0x19978b){const _0x49293b=_0x4be827;this[_0x49293b(0xce)]=_0x19978b;}[_0x4be827(0x100)](_0x4581dc){const _0x5c82e2=_0x4be827;if(this[_0x5c82e2(0xa2)][_0x5c82e2(0xa0)]<this[_0x5c82e2(0xce)]){this[_0x5c82e2(0xa2)][_0x5c82e2(0x1a3)](_0x4581dc),this[_0x5c82e2(0xbb)](this[_0x5c82e2(0xa2)][_0x5c82e2(0xa0)]-(0x29*-0x18+-0x32b*0xb+0x26b2));return;}if(compareRankedCandidate(_0x4581dc,this[_0x5c82e2(0xa2)][-0x5ef*-0x5+0x1*0x2117+-0x3ec2])>=0x81*0x43+-0x21d2+0x3*0x5)return;this[_0x5c82e2(0xa2)][0xd1f*-0x2+0x18fc+0x142]=_0x4581dc,this[_0x5c82e2(0xf3)](-0x1902+-0x1a*-0x45+0x1200);}[_0x4be827(0x15b)](){const _0x2ab388=_0x4be827;return[...this[_0x2ab388(0xa2)]][_0x2ab388(0xdc)](compareRankedCandidate);}[_0x4be827(0xbb)](_0x27f797){const _0x263ed7=_0x4be827;let _0x189118=_0x27f797;while(_0x189118>-0x1*0xb3f+-0x25d9+0xc46*0x4){const _0x396b8d=Math[_0x263ed7(0x16b)]((_0x189118-(-0x1a09+-0x2364+0x3d6e))/(0x464*-0x5+0x1*-0xdca+0x160*0x1a));if(compareRankedCandidate(this[_0x263ed7(0xa2)][_0x189118],this[_0x263ed7(0xa2)][_0x396b8d])<=-0x8*0x110+-0x1db1+0x3*0xcbb)break;[this[_0x263ed7(0xa2)][_0x189118],this[_0x263ed7(0xa2)][_0x396b8d]]=[this[_0x263ed7(0xa2)][_0x396b8d],this[_0x263ed7(0xa2)][_0x189118]],_0x189118=_0x396b8d;}}[_0x4be827(0xf3)](_0x40b0d2){const _0x22c915=_0x4be827;let _0x110940=_0x40b0d2;while(!![]){const _0x545793=_0x110940*(0x14de+0x14d2+-0x29ae)+(0x708+-0x4*-0x4d+-0x83b);if(_0x545793>=this[_0x22c915(0xa2)][_0x22c915(0xa0)])return;const _0x40e066=_0x545793+(0x10*-0x251+-0x1690+0x47*0xd7),_0x102542=_0x40e066<this[_0x22c915(0xa2)][_0x22c915(0xa0)]&&compareRankedCandidate(this[_0x22c915(0xa2)][_0x40e066],this[_0x22c915(0xa2)][_0x545793])>-0x17de+-0x6d*0x37+0x327*0xf?_0x40e066:_0x545793;if(compareRankedCandidate(this[_0x22c915(0xa2)][_0x102542],this[_0x22c915(0xa2)][_0x110940])<=0x71b*0x1+-0xc6c*-0x3+-0x2c5f)return;[this[_0x22c915(0xa2)][_0x110940],this[_0x22c915(0xa2)][_0x102542]]=[this[_0x22c915(0xa2)][_0x102542],this[_0x22c915(0xa2)][_0x110940]],_0x110940=_0x102542;}}}function fuzzyPathScore(_0x516828,_0x2d8799){const _0x285c36=_0x4be827,_0x2947b3=_0x516828[_0x285c36(0x137)](),_0x2622bf=_0x2d8799[_0x285c36(0x190)]()[_0x285c36(0x137)]();let _0x849f07=-0x65*0x5+-0xe2*0x1f+-0xcb*-0x25,_0x38ca3e=-0x3*-0x380+0x36d*0x8+-0x25e8,_0x43ecfd=-(0x1317*-0x1+0x2*-0x985+0x2623);for(const _0x45fa6b of _0x2622bf){const _0x13350d=_0x2947b3[_0x285c36(0xe9)](_0x45fa6b,_0x849f07);if(_0x13350d===-(-0x11b2*0x1+-0xad7*0x1+0x1c8a))return-(-0x35*0x43+-0x12b+-0x1*-0xf0b);_0x38ca3e+=_0x13350d===_0x43ecfd+(0x1720+-0x2635+0x1*0xf16)?-0x51*0x23+0x1*-0x1552+0xb*0x2f3:-0xcd+-0x1505+0x15d3*0x1;if(_0x13350d===0x2078+-0x1def+-0x3b*0xb||_0x285c36(0xb3)[_0x285c36(0x108)](_0x2947b3[_0x13350d-(0x4*0x7db+0x2*-0xa44+-0x3*0x3a1)]??''))_0x38ca3e+=0x2130+-0x5c4+-0x1b64;_0x43ecfd=_0x13350d,_0x849f07=_0x13350d+(-0xdfd+-0xff8+0x1df6);}const _0x4f2e10=_0x516828[_0x285c36(0x17d)](_0x516828[_0x285c36(0x14c)]('/')+(0x227*0x3+0x1e47+0x1*-0x24bb))[_0x285c36(0x137)]();if(_0x4f2e10[_0x285c36(0x108)](_0x2622bf))_0x38ca3e+=0x4a4*-0x2+0x7*-0x501+-0x1*-0x2c77;else{if(_0x2947b3[_0x285c36(0x108)](_0x2622bf))_0x38ca3e+=-0x1912+-0x800+0x2122;}return _0x38ca3e-_0x516828[_0x285c36(0xa0)]/(0x181d*-0x1+0x1733*0x1+0x4d2);}export async function listWorkspaceDirectories(_0x2789c3,_0x43173a,_0x11fa51=homedir()){const _0x128883=_0x4be827,_0xa20e49=await realpath(_0x11fa51),_0x150a72=await Promise[_0x128883(0xd2)](_0x43173a[_0x128883(0x19c)](_0x235d0b=>realpath(_0x235d0b))),_0x1d9737=[...new Set([_0xa20e49,..._0x150a72])],_0x3d9f78=_0x2789c3===undefined?_0x150a72[-0x31*0x6+-0x1d*0xbd+0x168f]??_0xa20e49:await realpath(_0x2789c3),_0x3c151c=await stat(_0x3d9f78);if(!_0x3c151c[_0x128883(0xeb)]()||!isWithinAllowedRoot(_0x3d9f78,_0x1d9737))throw new Error(_0x128883(0x173));const _0x551700=await readdir(_0x3d9f78,{'withFileTypes':!![]}),_0x44b763=[];for(const _0x229246 of _0x551700[_0x128883(0xdc)]((_0x3cc9ea,_0x405596)=>_0x3cc9ea[_0x128883(0xf0)][_0x128883(0x124)](_0x405596[_0x128883(0xf0)]))){if(!_0x229246[_0x128883(0xeb)]()&&!_0x229246[_0x128883(0x186)]())continue;const _0x407558=await realpath(resolve(_0x3d9f78,_0x229246[_0x128883(0xf0)]))[_0x128883(0x19a)](()=>undefined);if(_0x407558===undefined||!isWithinAllowedRoot(_0x407558,_0x1d9737))continue;const _0x4f7c33=await stat(_0x407558)[_0x128883(0x19a)](()=>undefined);if(_0x4f7c33===undefined||!_0x4f7c33[_0x128883(0xeb)]())continue;_0x44b763[_0x128883(0x1a3)]({'path':_0x407558,'name':_0x229246[_0x128883(0xf0)],'selectable':isWithinAllowedRoot(_0x407558,_0x150a72)});if(_0x44b763[_0x128883(0xa0)]>DIRECTORY_PICKER_LIMIT)break;}const _0x314ef4=dirname(_0x3d9f78);return{'homePath':_0xa20e49,'currentPath':_0x3d9f78,'parentPath':_0x314ef4===_0x3d9f78||!isWithinAllowedRoot(_0x314ef4,_0x1d9737)?null:_0x314ef4,'browseRoots':_0x150a72,'selectable':isWithinAllowedRoot(_0x3d9f78,_0x150a72),'entries':_0x44b763[_0x128883(0x17d)](-0x527+0x121c+-0xcf5,DIRECTORY_PICKER_LIMIT),'truncated':_0x44b763[_0x128883(0xa0)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x58e2ce,_0x2b9933='.',_0x5e31f0,_0x36c92f=DIRECTORY_PAGE_LIMIT){const _0x5d6d1d=_0x4be827;if(!Number[_0x5d6d1d(0xc0)](_0x36c92f)||_0x36c92f<0x2374+0xa8b+-0x2dfe||_0x36c92f>DIRECTORY_PAGE_LIMIT)throw new Error(_0x5d6d1d(0x14f));const _0x58f79a=await resolveRegisteredWorkspaceRoot(_0x58e2ce),_0x4befc7=await resolveWorkspaceEntryFromCanonicalRoot(_0x58f79a,_0x2b9933,!![]),_0x3399fd=await readdir(_0x4befc7,{'withFileTypes':!![]}),_0x34b66b=decodeDirectoryCursor(_0x5e31f0,_0x2b9933),_0x254acb=_0x3399fd[_0x5d6d1d(0x177)](_0x36cf01=>_0x36cf01[_0x5d6d1d(0xf0)]!==_0x5d6d1d(0x10f)&&!isWorkspaceUploadTemporaryName(_0x36cf01[_0x5d6d1d(0xf0)]))[_0x5d6d1d(0x19c)](_0x5a9f10=>_0x5a9f10[_0x5d6d1d(0xf0)])[_0x5d6d1d(0xdc)]((_0x43a251,_0x56f01a)=>_0x43a251[_0x5d6d1d(0x124)](_0x56f01a)),_0x47723a=_0x34b66b===undefined?0x1be4+-0x1d18+-0x9a*-0x2:_0x254acb[_0x5d6d1d(0x129)](_0xb156a4=>_0xb156a4>_0x34b66b);if(_0x34b66b!==undefined&&_0x47723a===-(-0x2*-0xe8f+-0x19a0+-0x37d))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x18018b=_0x254acb[_0x5d6d1d(0x17d)](_0x47723a,_0x47723a+_0x36c92f),_0x23f58d=[];for(const _0x184af9 of _0x18018b){const _0x18ad20=await resolveWorkspaceEntry(_0x58f79a,relative(_0x58f79a,resolve(_0x4befc7,_0x184af9)),![])[_0x5d6d1d(0x19a)](_0x183a8d=>{if(isSkippableWorkspaceEntryError(_0x183a8d))return undefined;throw _0x183a8d;});if(_0x18ad20===undefined)continue;const _0xa5bcab=await lstat(_0x18ad20)[_0x5d6d1d(0x19a)](_0x116c2b=>{const _0x235622=_0x5d6d1d;if(_0x116c2b[_0x235622(0x1ac)]===_0x235622(0x133))return undefined;throw _0x116c2b;});if(_0xa5bcab===undefined||!_0xa5bcab[_0x5d6d1d(0x18a)]()&&!_0xa5bcab[_0x5d6d1d(0xeb)]())continue;_0x23f58d[_0x5d6d1d(0x1a3)]({'path':relative(_0x58f79a,_0x18ad20)[_0x5d6d1d(0x9a)](sep)[_0x5d6d1d(0x135)]('/'),'name':_0x184af9,'kind':_0xa5bcab[_0x5d6d1d(0xeb)]()?_0x5d6d1d(0xfb):_0x5d6d1d(0x10a),'size':_0xa5bcab[_0x5d6d1d(0x18a)]()?_0xa5bcab[_0x5d6d1d(0xa5)]:null,'modifiedAt':_0xa5bcab[_0x5d6d1d(0xbf)]});}const _0x2a2d69=_0x254acb[_0x47723a+_0x18018b[_0x5d6d1d(0xa0)]];return{'entries':_0x23f58d,'nextCursor':_0x2a2d69===undefined||_0x18018b[_0x5d6d1d(0xa0)]===0xa4d*-0x1+0x820+0x22d?null:encodeDirectoryCursor(_0x2b9933,_0x18018b[_0x18018b[_0x5d6d1d(0xa0)]-(-0x7ff*0x1+0x1376+0x6*-0x1e9)]),'truncated':_0x2a2d69!==undefined};}export async function mutateWorkspaceFile(_0x3bba56,_0x358674){const _0x127883=_0x4be827,_0x1f6ef5=await resolveRegisteredWorkspaceRoot(_0x3bba56);if(_0x358674[_0x127883(0x1a5)]===_0x127883(0xa7)||_0x358674[_0x127883(0x1a5)]===_0x127883(0xd7)){const _0x22d02d=await resolveNewWorkspaceEntry(_0x1f6ef5,_0x358674[_0x127883(0x118)]);if(_0x358674[_0x127883(0x1a5)]===_0x127883(0xa7))await writeFile(_0x22d02d,'',{'flag':'wx'});else await mkdir(_0x22d02d);return{'path':workspaceRelativePath(_0x1f6ef5,_0x22d02d)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x1f6ef5,_0x358674[_0x127883(0x118)]);const _0x296403=await resolveWorkspaceEntryMetadata(_0x1f6ef5,_0x358674[_0x127883(0x118)]);if(workspaceRelativePath(_0x1f6ef5,_0x296403[_0x127883(0x118)])==='.')throw new Error(_0x127883(0x1ad));if(_0x358674[_0x127883(0x1a5)]===_0x127883(0x1a1))return await rm(_0x296403[_0x127883(0x118)],{'recursive':_0x296403[_0x127883(0x192)][_0x127883(0xeb)](),'force':![]}),{'deleted':!![]};const _0x560853=await resolveNewWorkspaceEntry(_0x1f6ef5,_0x358674[_0x127883(0x11f)]);if(_0x296403[_0x127883(0x192)][_0x127883(0xeb)]()){const _0x21e686=relative(_0x296403[_0x127883(0x118)],_0x560853);if(_0x21e686===''||!isAbsolute(_0x21e686)&&_0x21e686!=='..'&&!_0x21e686[_0x127883(0x184)]('..'+sep))throw new Error(_0x127883(0xdb));}return await rename(_0x296403[_0x127883(0x118)],_0x560853),{'path':workspaceRelativePath(_0x1f6ef5,_0x560853)};}async function resolveNewWorkspaceEntry(_0x5c045c,_0x536d5b){const _0x42a8cc=_0x4be827,_0x284da3=_0x536d5b[_0x42a8cc(0xff)]('\x5c','/'),_0xcf1acb=_0x284da3[_0x42a8cc(0x9a)]('/'),_0x48c77a=_0xcf1acb['at'](-(-0x1d7+0x1*-0x1a7d+0x1c55));if(_0x536d5b[_0x42a8cc(0x108)]('\x00')||_0x284da3[_0x42a8cc(0x184)]('/')||isAbsolute(_0x536d5b)||win32[_0x42a8cc(0x153)](_0x284da3)||_0x48c77a===undefined||_0x48c77a[_0x42a8cc(0xa0)]===0xeae+-0x1f8d+0x10df||_0xcf1acb[_0x42a8cc(0xa1)](invalidWorkspaceMutationSegment))throw new Error(_0x42a8cc(0xed));const _0x1f88b2=_0xcf1acb[_0x42a8cc(0xa0)]===0xbc6*0x1+-0x334*-0x1+-0xef9?'.':_0xcf1acb[_0x42a8cc(0x17d)](0x721*-0x2+0x1479+-0x637,-(0x1*0x26f6+0xbb2+-0x1*0x32a7))[_0x42a8cc(0x135)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x5c045c,_0x1f88b2);const _0x4d8566=await resolveWorkspaceEntryFromCanonicalRoot(_0x5c045c,_0x1f88b2,!![]),_0x145f93=resolve(_0x4d8566,_0x48c77a);try{await lstat(_0x145f93);throw new Error(_0x42a8cc(0x156));}catch(_0x245678){if(_0x245678[_0x42a8cc(0x1ac)]!==_0x42a8cc(0x133))throw _0x245678;}return _0x145f93;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x42a2e3,_0x9aa2a2){const _0x48fa74=_0x4be827,_0x10a87c=_0x9aa2a2[_0x48fa74(0xff)]('\x5c','/');if(_0x10a87c==='.')return;const _0x3576b8=_0x10a87c[_0x48fa74(0x9a)]('/');if(_0x9aa2a2[_0x48fa74(0x108)]('\x00')||_0x10a87c[_0x48fa74(0x184)]('/')||isAbsolute(_0x9aa2a2)||win32[_0x48fa74(0x153)](_0x10a87c)||_0x3576b8[_0x48fa74(0xa1)](invalidWorkspaceMutationSegment))throw new Error(_0x48fa74(0xed));let _0x235cec=_0x42a2e3;for(const _0x48ed05 of _0x3576b8){_0x235cec=resolve(_0x235cec,_0x48ed05);const _0x294355=await lstat(_0x235cec)[_0x48fa74(0x19a)](_0x3336c0=>{const _0x398e86=_0x48fa74;if(_0x3336c0[_0x398e86(0x1ac)]===_0x398e86(0x133))throw new Error(_0x398e86(0x159));throw _0x3336c0;});if(_0x294355[_0x48fa74(0x186)]())throw new Error(_0x48fa74(0xed));}}function invalidWorkspaceMutationSegment(_0x13b8f9){const _0x21e450=_0x4be827;if(_0x13b8f9[_0x21e450(0xa0)]===0x20bb+-0x1*-0x12dc+0x119*-0x2f||_0x13b8f9==='.'||_0x13b8f9==='..'||_0x13b8f9===_0x21e450(0x10f))return!![];if(_0x204681()!==_0x21e450(0x16c))return![];const _0x5a94da=_0x13b8f9[_0x21e450(0xd1)](/[. ]+$/u,'')[_0x21e450(0x198)]();return/[<>:"|?*]/u[_0x21e450(0xec)](_0x13b8f9)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x21e450(0xec)](_0x5a94da);}function workspaceRelativePath(_0x5ae657,_0x5f0f7b){const _0x392260=_0x4be827,_0x543fa2=relative(_0x5ae657,_0x5f0f7b)[_0x392260(0x9a)](sep)[_0x392260(0x135)]('/');return _0x543fa2[_0x392260(0xa0)]===0x1bcb*0x1+-0x22*-0x7c+-0x2c43?'.':_0x543fa2;}function isSkippableWorkspaceEntryError(_0x58c2cb){const _0x47e109=_0x4be827;return _0x58c2cb instanceof Error&&(_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0xed)||_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0x159)||_0x58c2cb[_0x47e109(0x1a7)]===_0x47e109(0x188));}export async function preflightWorkspaceUpload(_0x37f79a,_0x1d3b14,_0x407b3b){const _0x430d7e=_0x4be827;if(_0x407b3b[_0x430d7e(0xa0)]===-0x1*-0x1f7f+0x37a+-0x22f9*0x1||_0x407b3b==='.'||_0x407b3b==='..'||_0x407b3b[_0x430d7e(0x108)]('\x00')||_0x407b3b[_0x430d7e(0x108)]('/')||_0x407b3b[_0x430d7e(0x108)]('\x5c')||isWorkspaceUploadTemporaryName(_0x407b3b))return{'path':'','absolutePath':'','status':_0x430d7e(0x182)};const _0x5e2fd5=await resolveRegisteredWorkspaceRoot(_0x37f79a),_0x15cbd3=await resolveWorkspaceEntry(_0x5e2fd5,_0x1d3b14,!![]),_0x5656c9=resolve(_0x15cbd3,_0x407b3b);if(dirname(_0x5656c9)!==_0x15cbd3)throw new Error(_0x430d7e(0xed));const _0x55a5a9=relative(_0x5e2fd5,_0x5656c9)[_0x430d7e(0x9a)](sep)[_0x430d7e(0x135)]('/'),_0x28209e=await lstat(_0x5656c9)[_0x430d7e(0x19a)](_0x58425a=>{const _0x2766bb=_0x430d7e;if(_0x58425a[_0x2766bb(0x1ac)]===_0x2766bb(0x133))return undefined;throw _0x58425a;});if(_0x28209e===undefined)return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x10c)};if(_0x28209e[_0x430d7e(0x186)]())throw new Error(_0x430d7e(0xed));if(_0x28209e[_0x430d7e(0x18a)]())return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x169)};return{'path':_0x55a5a9,'absolutePath':_0x5656c9,'status':_0x430d7e(0x144)};}export function workspaceUploadTemporaryName(_0x365031){const _0x36ad46=_0x4be827;return _0x36ad46(0xcd)+_0x365031+_0x36ad46(0x146);}function isWorkspaceUploadTemporaryName(_0x28f220){const _0x14e3a2=_0x4be827;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x14e3a2(0xec)](_0x28f220)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x14e3a2(0xec)](_0x28f220);}export async function readWorkspaceTextFile(_0x138268,_0xf8a686,_0x5ddb3e=-0xd3a+-0x14bc+0x21f6,_0xd27610=FILE_READ_LIMIT){const _0x27f4cf=_0x4be827;if(!Number[_0x27f4cf(0xc0)](_0x5ddb3e)||_0x5ddb3e<0x19cc+0x59*0x59+0x7*-0x81b||!Number[_0x27f4cf(0xc0)](_0xd27610)||_0xd27610<-0x22cd+-0x9ef*0x1+0x2cbd||_0xd27610>FILE_READ_LIMIT)throw new Error(_0x27f4cf(0x185));const _0x501b09=await resolveRegisteredWorkspaceRoot(_0x138268),_0x34bb8c=await resolveWorkspaceEntry(_0x501b09,_0xf8a686,![]),_0x42e9cf=await lstat(_0x34bb8c);if(!_0x42e9cf[_0x27f4cf(0x18a)]())throw new Error(_0x27f4cf(0x188));if(_0x42e9cf[_0x27f4cf(0xa5)]>FILE_READ_LIMIT*(-0x19e7+-0x2501+0x3ef8))throw new Error(_0x27f4cf(0x15c));const _0x36258e=await readFile(_0x34bb8c),_0xfd5faf=createHash(_0x27f4cf(0x150))[_0x27f4cf(0x10e)](_0x36258e)[_0x27f4cf(0x17a)](_0x27f4cf(0xf8)),_0x3ea6b1=_0x36258e[_0x27f4cf(0x108)](-0x3d7+0x4*0x655+0x1*-0x157d)||!isValidUtf8(_0x36258e);if(_0x3ea6b1){const _0x343a6c=Math[_0x27f4cf(0x176)](_0x36258e[_0x27f4cf(0xa0)],_0x5ddb3e+_0xd27610),_0x55e044=_0x36258e[_0x27f4cf(0x171)](_0x5ddb3e,_0x343a6c);return{'path':relative(_0x501b09,_0x34bb8c)[_0x27f4cf(0x9a)](sep)[_0x27f4cf(0x135)]('/'),'encoding':_0x27f4cf(0xf2),'size':_0x36258e[_0x27f4cf(0xa0)],'content':_0x55e044[_0x27f4cf(0x19d)](_0x27f4cf(0xf2)),'truncated':_0x343a6c<_0x36258e[_0x27f4cf(0xa0)],'nextOffset':_0x343a6c<_0x36258e[_0x27f4cf(0xa0)]?_0x343a6c:null,'revision':_0xfd5faf};}if(_0x5ddb3e>-0x11*-0xda+0xc21+-0x1a9b&&_0x5ddb3e<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x5ddb3e]))throw new Error(_0x27f4cf(0x185));let _0x2adea6=Math[_0x27f4cf(0x176)](_0x36258e[_0x27f4cf(0xa0)],_0x5ddb3e+_0xd27610);if(_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x2adea6])){while(_0x2adea6>_0x5ddb3e&&isUtf8ContinuationByte(_0x36258e[_0x2adea6]))_0x2adea6-=-0xb*-0x11a+0x164b+0xc*-0x2de;if(_0x2adea6===_0x5ddb3e){_0x2adea6+=-0x21ad+-0x557*0x4+-0xa*-0x581;while(_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]&&isUtf8ContinuationByte(_0x36258e[_0x2adea6]))_0x2adea6+=-0x22*-0x7c+0x58d+-0x4*0x581;}}const _0x1818ff=_0x36258e[_0x27f4cf(0x171)](_0x5ddb3e,_0x2adea6),_0x3da6e7=new TextDecoder(_0x27f4cf(0xfa),{'fatal':!![]})[_0x27f4cf(0xbc)](_0x1818ff),_0x58e874=_0x2adea6<_0x36258e[_0x27f4cf(0xa0)]?_0x2adea6:null;return{'path':relative(_0x501b09,_0x34bb8c)[_0x27f4cf(0x9a)](sep)[_0x27f4cf(0x135)]('/'),'encoding':_0x27f4cf(0xfa),'size':_0x36258e[_0x27f4cf(0xa0)],'content':_0x3da6e7,'truncated':_0x58e874!==null,'nextOffset':_0x58e874,'revision':_0xfd5faf};}export async function writeWorkspaceTextFile(_0x1f73da,_0x5ea1b8,_0x463479,_0xb6a935){const _0x48643a=_0x4be827;if(!/^[0-9a-f]{64}$/u[_0x48643a(0xec)](_0xb6a935))throw new Error(_0x48643a(0xc3));const _0x53653f=Buffer[_0x48643a(0x13e)](_0x463479,_0x48643a(0x152));if(_0x53653f[_0x48643a(0xa0)]>FILE_READ_LIMIT*(0x1f7c+-0x6*-0x582+-0x4078))throw new Error(_0x48643a(0x15c));if(_0x53653f[_0x48643a(0x108)](-0x1d53+0x1*-0x17d2+-0x3525*-0x1))throw new Error(_0x48643a(0x164));const _0x377aab=await resolveRegisteredWorkspaceRoot(_0x1f73da);await assertWorkspaceMutationPathHasNoSymlinks(_0x377aab,_0x5ea1b8);const _0x2b1a97=await resolveWorkspaceEntry(_0x377aab,_0x5ea1b8,![]),_0x55a9c9=await lstat(_0x2b1a97);if(!_0x55a9c9[_0x48643a(0x18a)]())throw new Error(_0x48643a(0x188));const _0x5782dd=await readFile(_0x2b1a97);if(_0x5782dd[_0x48643a(0x108)](-0x201f+0x136c+0xcb3)||!isValidUtf8(_0x5782dd))throw new Error(_0x48643a(0x164));const _0x66c41=createHash(_0x48643a(0x150))[_0x48643a(0x10e)](_0x5782dd)[_0x48643a(0x17a)](_0x48643a(0xf8));if(_0x66c41!==_0xb6a935)throw new Error(_0x48643a(0x14a));const _0x3a2756=createHash(_0x48643a(0x150))[_0x48643a(0x10e)](_0x53653f)[_0x48643a(0x17a)](_0x48643a(0xf8)),_0x3b6091=resolve(dirname(_0x2b1a97),_0x48643a(0x143)+randomUUID()+_0x48643a(0x146));try{await writeFile(_0x3b6091,_0x53653f,{'flag':'wx','mode':_0x55a9c9[_0x48643a(0xa4)]}),await rename(_0x3b6091,_0x2b1a97);}finally{await rm(_0x3b6091,{'force':!![]})[_0x48643a(0x19a)](()=>undefined);}return{'path':workspaceRelativePath(_0x377aab,_0x2b1a97),'revision':_0x3a2756,'size':_0x53653f[_0x48643a(0xa0)]};}export async function readWorkspaceFileContentRange(_0x5856b2,_0x2769d7,_0x2d4bdc=-0x193+-0x1*-0x89+0x10a,_0x5cf880=FILE_READ_LIMIT){const _0x36bf36=_0x4be827;if(!Number[_0x36bf36(0xc0)](_0x2d4bdc)||_0x2d4bdc<0x1*-0x14e5+-0x2200+0x263*0x17||!Number[_0x36bf36(0xc0)](_0x5cf880)||_0x5cf880<-0x2432+-0x2078+0x44ab*0x1||_0x5cf880>FILE_READ_LIMIT)throw new Error(_0x36bf36(0x185));const _0x297929=await resolveRegisteredWorkspaceRoot(_0x5856b2),_0x330bfa=await resolveWorkspaceEntry(_0x297929,_0x2769d7,![]),_0x2b4f5b=await lstat(_0x330bfa);if(!_0x2b4f5b[_0x36bf36(0x18a)]())throw new Error(_0x36bf36(0x188));if(_0x2d4bdc>_0x2b4f5b[_0x36bf36(0xa5)])throw new Error(_0x36bf36(0x185));const _0x3aaee6=Math[_0x36bf36(0x176)](_0x5cf880,_0x2b4f5b[_0x36bf36(0xa5)]-_0x2d4bdc),_0xf10140=Buffer[_0x36bf36(0x107)](_0x3aaee6),_0x41c3d4=await open(_0x330bfa,'r');try{const {bytesRead:_0x568726}=await _0x41c3d4[_0x36bf36(0x139)](_0xf10140,-0x1*0x37e+0x2047*0x1+-0x1cc9,_0x3aaee6,_0x2d4bdc),_0x1b85f3=_0x2d4bdc+_0x568726;return{'path':relative(_0x297929,_0x330bfa)[_0x36bf36(0x9a)](sep)[_0x36bf36(0x135)]('/'),'size':_0x2b4f5b[_0x36bf36(0xa5)],'offset':_0x2d4bdc,'contentBase64':_0xf10140[_0x36bf36(0x171)](-0x2112+0xe*-0x28d+-0x2*-0x2264,_0x568726)[_0x36bf36(0x19d)](_0x36bf36(0xf2)),'nextOffset':_0x1b85f3<_0x2b4f5b[_0x36bf36(0xa5)]?_0x1b85f3:null};}finally{await _0x41c3d4[_0x36bf36(0xc4)]();}}function _0x598f(_0x2a3f54,_0x231158){_0x2a3f54=_0x2a3f54-(0x1e76*0x1+-0x8bf*-0x2+-0x1*0x2f5f);const _0xc3f520=_0x5585();let _0x22c635=_0xc3f520[_0x2a3f54];if(_0x598f['zEOXBJ']===undefined){var _0xff301d=function(_0x5b1cc6){const _0x527055='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1beb0f='',_0x4670da='';for(let _0x1d040a=0x2693+0xf7a+-0x360d,_0x572791,_0x58be81,_0x2a08af=0x1*-0xf6e+-0x1f13+0x1*0x2e81;_0x58be81=_0x5b1cc6['charAt'](_0x2a08af++);~_0x58be81&&(_0x572791=_0x1d040a%(-0x259*-0x4+0x4*-0x20f+-0x1*0x124)?_0x572791*(-0xfb0+-0x23eb+0x33db)+_0x58be81:_0x58be81,_0x1d040a++%(-0x1be5*-0x1+0x1*0x371+-0x1f52))?_0x1beb0f+=String['fromCharCode'](0x260a+0x15c9+-0x3c*0xfb&_0x572791>>(-(-0x648+-0x1c67+-0x53*-0x6b)*_0x1d040a&0x1b0f+-0x3*-0x472+-0x285f)):-0xdc7*0x2+-0x1f39*-0x1+-0x3ab){_0x58be81=_0x527055['indexOf'](_0x58be81);}for(let _0x428f79=-0x674*0x1+-0x1bd1+-0x1*-0x2245,_0x6b99c=_0x1beb0f['length'];_0x428f79<_0x6b99c;_0x428f79++){_0x4670da+='%'+('00'+_0x1beb0f['charCodeAt'](_0x428f79)['toString'](-0x42c+-0x40b+-0xd*-0xa3))['slice'](-(-0x1d6d*-0x1+-0x1dac+0xd*0x5));}return decodeURIComponent(_0x4670da);};_0x598f['FyybKm']=_0xff301d,_0x598f['TRGXKW']={},_0x598f['zEOXBJ']=!![];}const _0xd5884=_0xc3f520[0x23e2+-0x14a3+0x3*-0x515];_0x598f['spctPb']!==_0xd5884&&(_0x598f['TRGXKW']={},_0x598f['spctPb']=_0xd5884);const _0x355c1a=_0x598f['TRGXKW'][_0x2a3f54];return _0x355c1a===undefined?(_0x22c635=_0x598f['FyybKm'](_0x22c635),_0x598f['TRGXKW'][_0x2a3f54]=_0x22c635):_0x22c635=_0x355c1a,_0x22c635;}export async function readAllowedFileContentRange(_0x155a0c,_0x20e1ed,_0x1cb1d5=0x412*-0x7+0x2203+-0x585,_0x33165d=FILE_READ_LIMIT){const _0x2294f3=_0x4be827;if(!Number[_0x2294f3(0xc0)](_0x1cb1d5)||_0x1cb1d5<-0x105a+-0x1d63*0x1+-0x3*-0xf3f||!Number[_0x2294f3(0xc0)](_0x33165d)||_0x33165d<0x1253+-0x17d9+0x587||_0x33165d>FILE_READ_LIMIT)throw new Error(_0x2294f3(0x185));const {file:_0x31ff1a,metadata:_0x2f9048}=await resolveAllowedFile(_0x155a0c,_0x20e1ed);if(_0x1cb1d5>_0x2f9048[_0x2294f3(0xa5)])throw new Error(_0x2294f3(0x185));const _0x49134f=Math[_0x2294f3(0x176)](_0x33165d,_0x2f9048[_0x2294f3(0xa5)]-_0x1cb1d5),_0x2100e8=Buffer[_0x2294f3(0x107)](_0x49134f),_0x5c1019=await open(_0x31ff1a,'r');try{const {bytesRead:_0x365e4a}=await _0x5c1019[_0x2294f3(0x139)](_0x2100e8,0x4b*-0x27+-0x6c3+0x1230,_0x49134f,_0x1cb1d5),_0x3bc5f6=_0x1cb1d5+_0x365e4a;return{'path':_0x31ff1a,'size':_0x2f9048[_0x2294f3(0xa5)],'offset':_0x1cb1d5,'contentBase64':_0x2100e8[_0x2294f3(0x171)](0x260c*0x1+-0x153d+0xd*-0x14b,_0x365e4a)[_0x2294f3(0x19d)](_0x2294f3(0xf2)),'nextOffset':_0x3bc5f6<_0x2f9048[_0x2294f3(0xa5)]?_0x3bc5f6:null};}finally{await _0x5c1019[_0x2294f3(0xc4)]();}}export async function readAllowedTextFile(_0x393125,_0x20e7eb,_0x3cdbfb=-0x1*-0x14e3+-0x1a*0xbf+0x17d*-0x1,_0xc83050=FILE_READ_LIMIT){const _0x5ba350=_0x4be827,{file:_0x3a68a,metadata:_0x697c87}=await resolveAllowedFile(_0x393125,_0x20e7eb);if(_0x697c87[_0x5ba350(0xa5)]>FILE_READ_LIMIT*(0x44f*-0x1+0x1748+-0x12e9*0x1))throw new Error(_0x5ba350(0x15c));if(!Number[_0x5ba350(0xc0)](_0x3cdbfb)||_0x3cdbfb<0x1f8d+-0x1*0x10b1+0x13d*-0xc||!Number[_0x5ba350(0xc0)](_0xc83050)||_0xc83050<0x487*0x5+-0x2*0x29d+-0x1168||_0xc83050>FILE_READ_LIMIT)throw new Error(_0x5ba350(0x185));const _0x5616c5=await readFile(_0x3a68a),_0x2924e8=_0x5616c5[_0x5ba350(0x108)](0x86*0x42+0x1e8c+-0x1*0x4118)||!isValidUtf8(_0x5616c5),_0x4e5caa=Math[_0x5ba350(0x176)](_0x5616c5[_0x5ba350(0xa0)],_0x3cdbfb+_0xc83050);if(_0x2924e8){const _0x932881=_0x5616c5[_0x5ba350(0x171)](_0x3cdbfb,_0x4e5caa);return{'path':_0x3a68a,'encoding':_0x5ba350(0xf2),'size':_0x5616c5[_0x5ba350(0xa0)],'content':_0x932881[_0x5ba350(0x19d)](_0x5ba350(0xf2)),'truncated':_0x4e5caa<_0x5616c5[_0x5ba350(0xa0)],'nextOffset':_0x4e5caa<_0x5616c5[_0x5ba350(0xa0)]?_0x4e5caa:null};}if(_0x3cdbfb>-0x209*0x7+-0x3*0xde+0x10d9&&_0x3cdbfb<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x3cdbfb]))throw new Error(_0x5ba350(0x185));let _0x4e9a47=_0x4e5caa;if(_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47])){while(_0x4e9a47>_0x3cdbfb&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47]))_0x4e9a47-=0x1a8+-0x1*0xbe3+0xa3c;if(_0x4e9a47===_0x3cdbfb){_0x4e9a47+=0x8f3+-0x23ab+0x1*0x1ab9;while(_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]&&isUtf8ContinuationByte(_0x5616c5[_0x4e9a47]))_0x4e9a47+=-0x251+0xdac*-0x1+0x2*0x7ff;}}const _0x3163c5=_0x4e9a47<_0x5616c5[_0x5ba350(0xa0)]?_0x4e9a47:null;return{'path':_0x3a68a,'encoding':_0x5ba350(0xfa),'size':_0x5616c5[_0x5ba350(0xa0)],'content':new TextDecoder(_0x5ba350(0xfa),{'fatal':!![]})[_0x5ba350(0xbc)](_0x5616c5[_0x5ba350(0x171)](_0x3cdbfb,_0x4e9a47)),'truncated':_0x3163c5!==null,'nextOffset':_0x3163c5};}export function normalizeFilePreviewPath(_0x36db69){const _0x2c49a4=_0x4be827;if(!/^sandbox:/iu[_0x2c49a4(0xec)](_0x36db69))return _0x36db69;let _0x16c7c3;try{_0x16c7c3=decodeURIComponent(_0x36db69[_0x2c49a4(0x17d)](_0x36db69[_0x2c49a4(0xe9)](':')+(-0x140b+-0x1443+0x25f*0x11)));}catch{throw new Error(_0x2c49a4(0xed));}const _0x2092cc=_0x16c7c3[_0x2c49a4(0xd1)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x2092cc[_0x2c49a4(0xa0)]===0x1f97+-0x18d1+-0x6c6*0x1||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x2c49a4(0xec)](_0x16c7c3)||!isAbsolute(_0x2092cc)&&!win32[_0x2c49a4(0x153)](_0x2092cc)||_0x2092cc[_0x2c49a4(0x108)]('\x00')||_0x2092cc[_0x2c49a4(0x108)]('?')||_0x2092cc[_0x2c49a4(0x108)]('#'))throw new Error(_0x2c49a4(0xed));return _0x2092cc;}async function resolveAllowedFile(_0x33e511,_0x505d80){const _0x5da709=_0x4be827;if(!isAbsolute(_0x33e511))throw new Error(_0x5da709(0xed));const _0x2c5119=await realpath(_0x33e511)[_0x5da709(0x19a)](_0x109ec8=>{const _0x4ef949=_0x5da709;if(_0x109ec8[_0x4ef949(0x1ac)]===_0x4ef949(0x133))throw new Error(_0x4ef949(0x159));throw _0x109ec8;}),_0x16a8b6=await Promise[_0x5da709(0xd2)](_0x505d80[_0x5da709(0x19c)](_0x41f372=>realpath(_0x41f372)));if(!isWithinAllowedRoot(_0x2c5119,_0x16a8b6))throw new Error(_0x5da709(0xed));const _0x4bd3dc=await lstat(_0x2c5119);if(!_0x4bd3dc[_0x5da709(0x18a)]())throw new Error(_0x5da709(0x188));return{'file':_0x2c5119,'metadata':_0x4bd3dc};}function isValidUtf8(_0x39c8b8){const _0x299366=_0x4be827;try{return new TextDecoder(_0x299366(0xfa),{'fatal':!![]})[_0x299366(0xbc)](_0x39c8b8),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x56664b){return(_0x56664b&0xe44+-0xac3+-0x2f*0xf)===-0xcf0*-0x2+-0x3*0x21f+-0x1303;}export async function searchWorkspaceFiles(_0xcd556b,_0x41f0f6,_0x2a5399,_0x105f22=SEARCH_RESULT_LIMIT,_0x40eb56=![]){const _0x4e08bc=_0x4be827,_0x5f35b1=new WorkspaceFileIndex(_0xcd556b);try{return await _0x5f35b1[_0x4e08bc(0xa8)](_0x41f0f6,_0x2a5399,_0x105f22,_0x40eb56);}finally{_0x5f35b1[_0x4e08bc(0x123)]();}}async function resolveRegisteredWorkspaceRoot(_0x3c2a6a){const _0x3cda33=_0x4be827,_0x4de69e=await realpath(_0x3c2a6a);if(normalizeWorkspacePath(_0x4de69e)!==normalizeWorkspacePath(_0x3c2a6a))throw new Error(_0x3cda33(0x98));return _0x4de69e;}async function resolveWorkspaceEntry(_0x4143d3,_0x50bfcb,_0x2c1e7b){const _0x169be3=await resolveRegisteredWorkspaceRoot(_0x4143d3);return resolveWorkspaceEntryFromCanonicalRoot(_0x169be3,_0x50bfcb,_0x2c1e7b);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x47e87b,_0x5b4f13,_0x10a828){const _0x29a51f=_0x4be827,_0x420d4d=await resolveWorkspaceEntryMetadata(_0x47e87b,_0x5b4f13);if(_0x10a828?!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0xeb)]():!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0x18a)]()&&!_0x420d4d[_0x29a51f(0x192)][_0x29a51f(0xeb)]())throw new Error(_0x10a828?_0x29a51f(0x9f):_0x29a51f(0x188));return _0x420d4d[_0x29a51f(0x118)];}async function resolveWorkspaceEntryMetadata(_0x56dc68,_0x5a1048){const _0x319bbc=_0x4be827;if(_0x5a1048[_0x319bbc(0x108)]('\x00')||_0x5a1048[_0x319bbc(0xa0)]===-0x3*0x595+0x1*-0x157d+0x263c||_0x5a1048[_0x319bbc(0x184)]('/')||_0x5a1048[_0x319bbc(0x184)]('\x5c'))throw new Error(_0x319bbc(0xed));const _0x2bfa77=_0x5a1048[_0x319bbc(0xff)]('\x5c','/');if(_0x2bfa77[_0x319bbc(0x9a)]('/')[_0x319bbc(0xa1)](_0xb3ca74=>_0xb3ca74==='..'||_0xb3ca74===_0x319bbc(0x10f)))throw new Error(_0x319bbc(0xed));let _0x302f64;try{_0x302f64=await realpath(resolve(_0x56dc68,_0x2bfa77));}catch(_0x4e498a){if(_0x4e498a[_0x319bbc(0x1ac)]===_0x319bbc(0x133))throw new Error(_0x319bbc(0x159));throw _0x4e498a;}const _0xc5300f=relative(_0x56dc68,_0x302f64);if(isAbsolute(_0xc5300f)||_0xc5300f[_0x319bbc(0x184)]('..')||_0xc5300f==='..'||_0xc5300f[_0x319bbc(0x184)]('..'+sep))throw new Error(_0x319bbc(0xed));const _0x407b5d=await lstat(_0x302f64);return{'path':_0x302f64,'metadata':_0x407b5d};}async function inspectWorkspaceIndexEntry(_0x3cb9c9,_0x138fda,_0x28332c){const _0x421017=_0x4be827;try{const _0x57a9da=await resolveWorkspaceEntryMetadata(_0x3cb9c9,_0x138fda);if(!_0x57a9da[_0x421017(0x192)][_0x421017(0x18a)]()&&!_0x57a9da[_0x421017(0x192)][_0x421017(0xeb)]())return undefined;const _0x368128=relative(_0x3cb9c9,_0x57a9da[_0x421017(0x118)])[_0x421017(0x9a)](sep)[_0x421017(0x135)]('/');return _0x57a9da[_0x421017(0x192)][_0x421017(0xeb)]()?{'path':_0x368128,'name':_0x28332c,'kind':_0x421017(0xfb),'size':null,'modifiedAt':_0x57a9da[_0x421017(0x192)][_0x421017(0xbf)]}:{'path':_0x368128,'name':_0x28332c,'kind':_0x421017(0x10a),'size':_0x57a9da[_0x421017(0x192)][_0x421017(0xa5)],'modifiedAt':_0x57a9da[_0x421017(0x192)][_0x421017(0xbf)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x5cbf5f,_0x1fe2ac){const _0x147760=_0x4be827;return Buffer[_0x147760(0x13e)](JSON[_0x147760(0x166)]({'path':_0x5cbf5f,'name':_0x1fe2ac}))[_0x147760(0x19d)](_0x147760(0x148));}function _0x5585(){const _0x56ecb1=['C3vIBw9KDwXL','kIOVyNvPBgqVkIO','BgLUDxG','vfLqrv9dsefor0ve','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','B2zMC2v0','vu5tvefhruq','kIOVlMfUz3vSyxiVkIO','CxvLCNK','Aw5KzxHpzG','CMvMCW','AxneAxjLy3rVCNK','DgvZDa','rKLmrv9qqvrix0vtq0fqrq','ls13B3jRDhjLzq','iYmG','BMfTzq','mvLmvNfIwq','yMfZzty0','C2LUA0rVD24','ls1Uyw1Llxn0yxr1CW','r0Lux0nptu1btKrFrKfjteve','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','ls1UBY1JB21TAxqTAwq','Agv4','zxHWAxj5vgLTzxi','DxrMltG','reLsrunut1jz','z2L0','CMvSyxrPDMu','C2HVDW','CMvWBgfJzufSBa','ywrK','Dw5Yzwy','C3rYAw5N','ls1UBY1PBMrLEa','te9dquW','kIOVDgfYz2v0lYOQ','r0Lux1jfrL9jtLzbteLe','ywXSB2nvBNnHzMu','Aw5JBhvKzxm','B25Jzq','rKLmrq','CMvMCMvZAef0DgvTChrLzef0','uKvbrfK','y2HHBMDLCW','DxbKyxrL','lMDPDa','CMvMCY9OzwfKCW','q09qsuve','yMLUyxj5igrPzMyGC2HHmJu2pq','uKvoqu1fra','ls1TyxGTy291BNq9','nJy4nJbNte12BhO','kIOVlNzLBNyVkIO','AxnjBNrLz2vY','Cgf0Aa','zxHLyW','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','B3v0Chv0','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','u0Lhs0Lmta','ls1MB3jTyxq9','zgvZDgLUyxrPB24','ndG1odu1mKrSzNLJvG','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','zMLSzxmUzxHJBhvKzq','zgLZCg9Zzq','Bg9JywXLq29TCgfYzq','CMv2lxbHCNnL','Dgv4Da','ls10B3bVlw9YzgvY','u1rbr0ve','zMLUzeLUzgv4','CM9VDa','zxjYB3i','zgLMzG','ls1ZAg9YDa','ls1UBY1LEhqTzgLMzG','DgHLBG','kIOVB2jQlYOQ','Bwf4','BgLTAxq','ru5pru5u','kIOVDMvUzg9YlYOQ','AM9PBG','ls1MAxjZDc1WyxjLBNq','Dg9mB2nHBgvmB3DLCKnHC2u','kIOVDgvZDc9YDw5ZlYOQ','CMvHza','BwvYz2uTyMfZzq','zgf0yq','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','zNjVBq','ls1KyxrLlw9YzgvY','v09ss1nqqunfx1bbveHFsu5wquXjra','l2rLDI9UDwXS','ls1YB290','lM1HCI1LzgL0lq','rvHju1rtx0rjuKvdve9swq','Bg9HzgLUzW','lNbHCNq','C2vHCMnOlMv4y2X1zgu','yMfZzty0DxjS','BgLTAxrZ','rKLmrv9xuKLurv9dt05gteLdva','ls1Yzwn1CNnPDMu','BgfZDeLUzgv4t2y','zw50CNLmAw1PDa','zMXHDe1HCa','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','C2HHmJu2','ls1LEgnSDwrLlxn0yw5KyxjK','DxrMoa','AxnbyNnVBhv0zq','r0Lux1DpuKTtuefdrq','ls1UBY10zxH0y29UDG','rKLmrv9btfjfqurzx0vysvnuuW','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','zMLUz2vYChjPBNq','rKLmrv9ot1rFrK9vtKq','mtKXmdyXmLfVAeLSqW','C29YDgvK','rKLmrv9ut09Ftefsr0u','mtC5mdK4nuTTAwTQtW','CMvIDwLSza','y3vYC29Y','ls1NAxqTy29TBw9UlwrPCG','kIOVlM51EhqVkIO','Dg9mB3DLCKnHC2u','C3rKzxjY','rKLmrv9ot1rFvevyva','Aw52ywXPza','C3rYAw5NAwz5','AwrSzvr0Be1Z','y2f0lwzPBgu','rvHju1rtx0zjteu','zM9YlwvHy2GTCMvM','zMXVB3i','D2LUmZi','A2LSBa','kIOVlMDPDc8QkG','CMvMCMvZAeLUqMfJA2DYB3vUza','ls12zxjPzNK','C3vIyxjYyxK','CgLWzq','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','kIOVzgLZDc8QkG','zgLZCgXHEu5HBwu','BwLU','zMLSDgvY','ls1VDgHLCNm','kIOVDMvUDI8QkG','zgLNzxn0','CMvMCMvZAgvKqxq','kIOVlNn2zwX0zs1RAxqVkIO','C2XPy2u','A2LUza','AgfZAa','lMDPDc8','uKvnt1rf','su5wquXjrf9oqu1f','mJC3mtG0nw9VyNLqsG','C3rHCNrZv2L0Aa','rKLmrv9squ5hrv9jtLzbteLe','AxntEw1IB2XPy0XPBMS','kIOVBM9Kzv9TB2r1BgvZlYOQ','rKLmrv9ot1rFuKvhvuXbuG','CMvMCY9Yzw1VDgvZ','AxngAwXL','Dhj1BMnHDgvK','BM9YBwfSAxPL','r0Lux1jfue9tsvrpuLLFsu5wquXjra','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','kIOVlMDYywrSzs8QkG','DhjPBq','CgfYC2u','Bwv0ywrHDge','ruvysvnu','kIOVlNbUCg0VkIO','kIOVyMLUlYOQ','sevbra','zw50CMLLCW','Dg9vChbLCKnHC2u','nMXXEvLxDG','y2f0y2G','BM93','BwfW','Dg9tDhjPBMC','zMLUza','C3rHDhvZ','ls1PCY1HBMnLC3rVCG','revmrvrf','yMLUyxj5','ChvZAa','C2v0','ywn0Aw9U','odCZD3Dgu2DS','BwvZC2fNzq','zgLMzI10CMvL','BhmTzMLSzxm','zw5ZDxjLtg9HzgvK','C3rHBgu','y29Kzq','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','kIOVB3v0lYOQ','ls1ZA2LWpq','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','oIHSAxrLCMfSkq','Bg9N','v09ss1nqqunfx05pvf9bteXpv0ve','C2HPzNq','C3bSAxq','zMLUywXSEq','ndm2mJa0mgLArM5yqq','kIOVlNr1CMjVlYOQ','kIOVlMnHy2HLlYOQ','rKLmrv9ot1rFreLsrunut1jz','BgvUz3rO','C29Tzq','DMfSDwvZ','ls1WB3jJzwXHAw49DJe','Bw9Kzq','C2L6zq','ls1ICMfUy2G','q1jfqvrfx0zjteu','C2vHCMnO','z2v0','yNL0zuXLBMD0Aa','tu9esuzjruq','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','zw50CNK','B2jQzwn0','kIOVlNbHCMnLBc1JywnOzs8QkG','CMvMCY9Yzw1VDgvZlW','ls1ZDgfNzwq','kIOVlNLHCM4VkIO','lY5Flq','D29YA3nWywnLuM9VDa','vu5uuKfds0ve','C3rKB3v0','Dg91y2G','zNjLC2HUzxnZvhrStxm','igj5DgvZpq','C2nVCMu','yNvIyMXLvxa','zgvJB2rL','mZmYndq2nuDNzvvOAW','C3LTyM9SAwmTCMvM','BxrPBwvnCW','AxntywzLsw50zwDLCG','y29UDgvUDenHBMrPzgf0zxm','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','rKLmrv9srvzju0LptL9jtLzbteLe','y2XVC2u','AwDUB3jL','sevbrca','qureruq','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','ls1ZB3vYy2u9sevbra','kIOVx19WEwnHy2HLx18VkIO','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','lM1HCI11CgXVywqT','y2fWywnPDhK','pZ8G','y29Uy2f0','CMvWBgfJzq','ywXS','CMvZDg9Yzq','lI4U','CMvMCY9OzwfKCY8','qMLUyxj5igzPBgvZia','q1jfqvrfx0rjuKvdve9swq','kIOVlM5LEhqVkIO','ls1XDwLLDa','yMXVyG','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','C29YDa','kIOVy292zxjHz2uVkIO','ls11BNrYywnRzwqTzMLSzxm9ywXS','revmrvrfra'];_0x5585=function(){return _0x56ecb1;};return _0x5585();}function decodeDirectoryCursor(_0x43b2e8,_0x271fad){const _0x5822f2=_0x4be827;if(_0x43b2e8===undefined)return undefined;try{const _0x4d7472=JSON[_0x5822f2(0x191)](Buffer[_0x5822f2(0x13e)](_0x43b2e8,_0x5822f2(0x148))[_0x5822f2(0x19d)](_0x5822f2(0x152)));if(typeof _0x4d7472!==_0x5822f2(0xae)||_0x4d7472===null||_0x4d7472[_0x5822f2(0x118)]!==_0x271fad||typeof _0x4d7472[_0x5822f2(0xf0)]!==_0x5822f2(0x102))throw new Error();return _0x4d7472[_0x5822f2(0xf0)];}catch{throw new Error(_0x5822f2(0x14f));}}function encodeSearchCursor(_0x467b92,_0x3836b8){const _0x3ba3ca=_0x4be827;return Buffer[_0x3ba3ca(0x13e)](JSON[_0x3ba3ca(0x166)]({'query':_0x467b92,'path':_0x3836b8}))[_0x3ba3ca(0x19d)](_0x3ba3ca(0x148));}function decodeSearchCursor(_0x59d12e,_0x512299){const _0xba3aa6=_0x4be827;if(_0x59d12e===undefined)return undefined;try{const _0x5d3984=JSON[_0xba3aa6(0x191)](Buffer[_0xba3aa6(0x13e)](_0x59d12e,_0xba3aa6(0x148))[_0xba3aa6(0x19d)](_0xba3aa6(0x152)));if(typeof _0x5d3984!==_0xba3aa6(0xae)||_0x5d3984===null||_0x5d3984[_0xba3aa6(0xe8)]!==_0x512299||typeof _0x5d3984[_0xba3aa6(0x118)]!==_0xba3aa6(0x102))throw new Error();return _0x5d3984[_0xba3aa6(0x118)];}catch{throw new Error(_0xba3aa6(0x14f));}}export function normalizeWorkspacePath(_0x16d852,_0x416d1b=_0x204681()){const _0x35d3f6=_0x4be827;if(_0x16d852[_0x35d3f6(0xa0)]===-0x21aa+0x184b+0x95f*0x1||_0x16d852[_0x35d3f6(0x108)]('\u0000'))throw new Error(_0x35d3f6(0x140));if(_0x416d1b===_0x35d3f6(0x16c)){if(/^\\\\[?.]/[_0x35d3f6(0xec)](_0x16d852))throw new Error(_0x35d3f6(0x11a));const _0x3bd312=win32[_0x35d3f6(0x18c)](_0x16d852[_0x35d3f6(0xff)]('/','\x5c'));if(!win32[_0x35d3f6(0x153)](_0x3bd312))throw new Error(_0x35d3f6(0xc8));return _0x3bd312[_0x35d3f6(0xd1)](/\\+$/,'')[_0x35d3f6(0x162)]();}if(_0x416d1b!==_0x35d3f6(0xe2))throw new Error(_0x35d3f6(0x13c));const _0x33d7ff=posix[_0x35d3f6(0x18c)](_0x16d852);if(!posix[_0x35d3f6(0x153)](_0x33d7ff))throw new Error(_0x35d3f6(0xc8));return _0x33d7ff==='/'?_0x33d7ff:_0x33d7ff[_0x35d3f6(0xd1)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1b23f3,_0x53bb42,_0xfdf4e1=_0x204681()){const _0x17e8cd=_0x4be827,_0xeb0e4a=normalizeWorkspacePath(_0x1b23f3,_0xfdf4e1),_0x227584=_0xfdf4e1===_0x17e8cd(0x16c)?win32:posix;return _0x53bb42[_0x17e8cd(0xa1)](_0x4372d7=>{const _0x5d99d3=_0x17e8cd,_0x16a510=normalizeWorkspacePath(_0x4372d7,_0xfdf4e1),_0x33b18e=_0x227584[_0x5d99d3(0xfd)](_0x16a510,_0xeb0e4a);return _0x33b18e===''||!_0x33b18e[_0x5d99d3(0x184)]('..')&&!_0x227584[_0x5d99d3(0x153)](_0x33b18e);});}export async function inspectWorkspace(_0xa0590f,_0x2fa410){const _0x4b653=_0x4be827,_0x2f3ed1=await realpath(_0xa0590f),_0x53bd4e=await Promise[_0x4b653(0xd2)](_0x2fa410[_0x4b653(0x19c)](_0x166b2f=>realpath(_0x166b2f))),_0x549730=await stat(_0x2f3ed1);if(!_0x549730[_0x4b653(0xeb)]()||!isWithinAllowedRoot(_0x2f3ed1,_0x53bd4e))throw new Error(_0x4b653(0x98));try{const _0x4a4a2b=await readGitSummary(_0x2f3ed1);return{'path':_0x2f3ed1,'kind':_0x4b653(0x154),'gitSummary':_0x4a4a2b};}catch(_0x27b6cd){if(_0x27b6cd instanceof GitCommandError&&_0x27b6cd[_0x4b653(0x1ac)]===-0x31d*-0x7+0x127*0x3+-0x18c0||isGitUnavailable(_0x27b6cd))return{'path':_0x2f3ed1,'kind':_0x4b653(0xfb)};throw _0x27b6cd;}}export async function readGitSummary(_0x51861f){const _0x547974=_0x4be827,_0x37af15=(await runGit(_0x51861f,[_0x547974(0x125),_0x547974(0x160)]))[_0x547974(0x126)][_0x547974(0x190)](),_0x80cc70=await runGitAllowFailure(_0x51861f,[_0x547974(0x125),_0x547974(0x170),_0x547974(0x196)]),_0x40c328=await runGitAllowFailure(_0x51861f,[_0x547974(0xbe),_0x547974(0xd9),_0x547974(0x12d),_0x547974(0x196)]),_0x2e8c4a=(await runGit(_0x51861f,[_0x547974(0x19f),_0x547974(0xa3),'-z']))[_0x547974(0x11b)][_0x547974(0xa0)]>0x13f7+0xa*-0x29d+0x62b*0x1,_0x2faa53=await runGit(_0x51861f,[_0x547974(0x19f),_0x547974(0xa3)])[_0x547974(0x12f)](_0x216421=>_0x216421[_0x547974(0x126)]);return{'commonDir':_0x37af15,'head':_0x80cc70[_0x547974(0x1ac)]===-0x1859*0x1+-0x916+0x216f?_0x80cc70[_0x547974(0x126)][_0x547974(0x190)]():'','branch':_0x40c328[_0x547974(0x1ac)]===0x1be2+0x373*-0x7+-0x3bd*0x1?_0x40c328[_0x547974(0x126)][_0x547974(0x190)]():null,'dirty':_0x2e8c4a,'snapshot':summarizeText(_0x2faa53)};}export function assertSafeGitRef(_0x4a043c){const _0x24ddc8=_0x4be827;if(!REF_PATTERN[_0x24ddc8(0xec)](_0x4a043c))throw new Error(_0x24ddc8(0x106));}export async function readRestrictedDiff(_0x2c064c,_0x4a36e1,_0x24f7c6){const _0x1342e3=_0x4be827;assertSafeGitRef(_0x4a36e1),assertSafeGitRef(_0x24f7c6);const _0x37fd58=await runGit(_0x2c064c,[_0x1342e3(0x12c),_0x1342e3(0x12e),_0x1342e3(0x155),_0x4a36e1,_0x24f7c6]),_0x376502=_0x37fd58[_0x1342e3(0x11b)][_0x1342e3(0x108)](0xaef*0x3+0x1c*-0x73+-0x1439)||_0x37fd58[_0x1342e3(0x126)][_0x1342e3(0x108)](_0x1342e3(0xd6));if(_0x376502)return{'binary':!![],'summary':_0x1342e3(0x112)+createHash(_0x1342e3(0x150))[_0x1342e3(0x10e)](_0x37fd58[_0x1342e3(0x11b)])[_0x1342e3(0x17a)](_0x1342e3(0xf8))+_0x1342e3(0xb9)+_0x37fd58[_0x1342e3(0x11b)][_0x1342e3(0xa0)],'truncated':_0x37fd58[_0x1342e3(0x18b)]};return{'binary':![],'text':_0x37fd58[_0x1342e3(0x126)],'truncated':_0x37fd58[_0x1342e3(0x18b)]};}function currentBranchFromStatusHeader(_0x1fc35f){const _0x70d885=_0x4be827,_0x12a32c=_0x1fc35f[_0x70d885(0x17d)](0x22d*-0xa+-0x1*-0x1407+0x1be);if(_0x12a32c[_0x70d885(0x184)](_0x70d885(0xc6)))return null;const _0x2aab9e=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x70d885(0x119)](_0x12a32c);if(_0x2aab9e!==null)return _0x2aab9e[0x7ff+0x2634+-0x2e32]??null;return _0x12a32c[_0x70d885(0x9a)](_0x70d885(0xd4))[0x1973*0x1+-0x5e*0x49+-0x1*-0x15b]?.[_0x70d885(0x9a)]('\x20')[0x955*-0x3+0x4*0x1e8+0x145f]??null;}export async function readCurrentChangesSummary(_0xfde547){const _0x4911ef=_0x4be827,_0x2e8513=await runGit(_0xfde547,[_0x4911ef(0x19f),_0x4911ef(0xa3),'-z',_0x4911ef(0xa6),_0x4911ef(0xde)]),_0x3cb97f=_0x2e8513[_0x4911ef(0x126)][_0x4911ef(0x9a)]('\x00'),_0x5aa51a=_0x3cb97f[_0x4911ef(0x99)]()??'',_0x506e0a=[];for(let _0x7ea429=-0xff3+0x2128+-0x1135;_0x7ea429<_0x3cb97f[_0x4911ef(0xa0)];_0x7ea429+=0x1dc8+-0x1a4f+-0x4*0xde){const _0x73550e=_0x3cb97f[_0x7ea429];if(_0x73550e[_0x4911ef(0xa0)]<0x8*-0x41c+-0x2*0xe95+0x5e*0xa9)continue;const _0x57ea9a=_0x73550e[0x18b8*0x1+0x226e+-0x3b26],_0x259080=_0x73550e[0x44*-0x43+-0x168a+-0x1c1*-0x17],_0x40a17e=_0x73550e[_0x4911ef(0x17d)](-0x59a+0x1ea5+0xc84*-0x2);if(_0x57ea9a==='?'&&_0x259080==='?'){_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0xb5),'change':_0x4911ef(0xc7)});continue;}_0x57ea9a!=='\x20'&&_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0x128),'change':gitChange(_0x57ea9a)});_0x259080!=='\x20'&&_0x506e0a[_0x4911ef(0x1a3)]({'path':_0x40a17e,'state':_0x4911ef(0xe6),'change':gitChange(_0x259080)});if(_0x57ea9a==='R'||_0x57ea9a==='C'||_0x259080==='R'||_0x259080==='C')_0x7ea429+=0x21ec*0x1+0x61b+-0x2806;}return{'branch':_0x5aa51a[_0x4911ef(0x184)](_0x4911ef(0xef))?currentBranchFromStatusHeader(_0x5aa51a):null,'changes':_0x506e0a};}export async function listInitializedSubmodulePaths(_0x51df79){const _0x3ac9da=_0x4be827,_0x40f997=await runGit(_0x51df79,[_0x3ac9da(0xe0),_0x3ac9da(0x19f),_0x3ac9da(0x14b)]);return _0x40f997[_0x3ac9da(0x126)][_0x3ac9da(0x9a)](/\r?\n/)[_0x3ac9da(0x14e)](_0x43d3c7=>{const _0x34ca40=_0x3ac9da;if(_0x43d3c7[_0x34ca40(0xa0)]<-0x13d0+-0xf44*0x2+0x3282)return[];const _0x2e2583=_0x43d3c7[-0xe*0x133+-0x1d09+0x2dd3];if(_0x2e2583==='-')return[];const _0x5a9968=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x34ca40(0x119)](_0x43d3c7),_0x57ddcc=_0x5a9968?.[0x1456+-0x1*-0x1a61+-0x175b*0x2]?.[_0x34ca40(0xff)]('\x5c','/');return _0x57ddcc===undefined||_0x57ddcc[_0x34ca40(0xa0)]===-0x4b2*0x3+-0x1*-0xf3e+-0x128?[]:[_0x57ddcc];})[_0x3ac9da(0xdc)]((_0x42e62a,_0x51f3f4)=>_0x42e62a[_0x3ac9da(0x124)](_0x51f3f4));}export async function resolveGitRepository(_0x36dcbd,_0x396d52){const _0x1f9e66=_0x4be827;if(_0x396d52[_0x1f9e66(0xa0)]===0x3*-0x93c+0x1ed+0x19c7)return realpath(_0x36dcbd);if(_0x396d52[_0x1f9e66(0x108)]('\x00')||_0x396d52[_0x1f9e66(0x184)]('/')||_0x396d52[_0x1f9e66(0x184)]('\x5c')||_0x396d52[_0x1f9e66(0x9a)]('/')[_0x1f9e66(0xa1)](_0x4a10c7=>_0x4a10c7[_0x1f9e66(0xa0)]===-0x1*-0x1ae9+-0x57*-0x1+-0x1b40||_0x4a10c7==='.'||_0x4a10c7==='..'))throw new Error(_0x1f9e66(0x18d));const _0x3c9355=await listInitializedSubmodulePaths(_0x36dcbd);if(!_0x3c9355[_0x1f9e66(0x108)](_0x396d52))throw new Error(_0x1f9e66(0x18d));const _0x25d3b9=resolve(await realpath(_0x36dcbd),_0x396d52);try{await readGitSummary(_0x25d3b9);}catch{throw new Error(_0x1f9e66(0x18d));}return _0x25d3b9;}export async function listGitHistoryRefs(_0x394593){const _0x82a988=_0x4be827,_0xfd932=await runGit(_0x394593,[_0x82a988(0x16a),_0x82a988(0xc2),_0x82a988(0x110),_0x82a988(0x189)]);return _0xfd932[_0x82a988(0x126)][_0x82a988(0x9a)](/\r?\n/)[_0x82a988(0x14e)](_0x213af1=>{const _0x4ed2d8=_0x82a988,[_0x3220c1,_0x2f618a,_0x49a112,_0x4646e9,_0x10fa07]=_0x213af1[_0x4ed2d8(0x9a)]('\x09');if(_0x3220c1===undefined||_0x2f618a===undefined||_0x49a112===undefined||_0x10fa07===undefined||_0x10fa07[_0x4ed2d8(0xa0)]>-0x1197+0x1c*0x95+0x14b||!/^[0-9a-f]{40,64}$/[_0x4ed2d8(0xec)](_0x49a112))return[];const _0x136ba1=_0x3220c1[_0x4ed2d8(0x184)](_0x4ed2d8(0xd5))?_0x4ed2d8(0x104):_0x3220c1[_0x4ed2d8(0x184)](_0x4ed2d8(0xb0))?_0x4ed2d8(0x181):undefined;return _0x136ba1===undefined?[]:[{'name':_0x3220c1,'displayName':_0x2f618a,'kind':_0x136ba1,'hash':_0x49a112,'current':_0x4646e9==='*'}];})[_0x82a988(0xdc)]((_0x1f6628,_0x5a54c4)=>_0x1f6628[_0x82a988(0x17e)][_0x82a988(0x124)](_0x5a54c4[_0x82a988(0x17e)])||_0x1f6628[_0x82a988(0x175)][_0x82a988(0x124)](_0x5a54c4[_0x82a988(0x175)]));}function selectedHistoryRefs(_0x279fb2,_0x165c23){const _0x510b35=_0x4be827;if(_0x165c23===undefined||_0x165c23[_0x510b35(0xa0)]===0x2*-0x6cf+-0x6b0*0x2+-0x1afe*-0x1)return _0x279fb2;const _0x1aa79a=[...new Set(_0x165c23)],_0x5bd85d=_0x1aa79a[_0x510b35(0x19c)](_0x4350c3=>_0x279fb2[_0x510b35(0x19e)](_0x231c5f=>_0x231c5f[_0x510b35(0xf0)]===_0x4350c3));if(_0x5bd85d[_0x510b35(0xa1)](_0x419947=>_0x419947===undefined))throw new Error(_0x510b35(0x13d));return _0x5bd85d;}function historyCursor(_0x3d2fbf,_0xb3f629){const _0x478337=_0x4be827;return Buffer[_0x478337(0x13e)](JSON[_0x478337(0x166)]({'offset':_0x3d2fbf,'fingerprint':_0xb3f629}))[_0x478337(0x19d)](_0x478337(0x148));}function parseHistoryCursor(_0x571246,_0x7a2d35){const _0x3b6f0a=_0x4be827;if(_0x571246===undefined)return-0x4b8+0x261f+-0x1*0x2167;try{const _0x16003d=JSON[_0x3b6f0a(0x191)](Buffer[_0x3b6f0a(0x13e)](_0x571246,_0x3b6f0a(0x148))[_0x3b6f0a(0x19d)](_0x3b6f0a(0x152)));if(!Number[_0x3b6f0a(0x117)](_0x16003d[_0x3b6f0a(0xe5)])||_0x16003d[_0x3b6f0a(0xe5)]<-0x1f*-0x122+0x3e1+-0x26ff*0x1||_0x16003d[_0x3b6f0a(0x158)]!==_0x7a2d35)throw new Error(_0x3b6f0a(0x165));return _0x16003d[_0x3b6f0a(0xe5)];}catch{throw new Error(_0x3b6f0a(0x95));}}export async function readGitHistory(_0x3ef13b,_0x248ae2){const _0x545094=_0x4be827,_0x297425=await listGitHistoryRefs(_0x3ef13b),_0x201eee=selectedHistoryRefs(_0x297425,_0x248ae2[_0x545094(0xea)]);if(_0x201eee[_0x545094(0xa0)]===0xe1*0x13+-0xca+-0x1*0xfe9)return{'commits':[],'nextCursor':null};const _0x30f4d7=_0x248ae2[_0x545094(0x132)]??-0x3cb*-0x2+-0x1cc6+0x1562;if(!Number[_0x545094(0x117)](_0x30f4d7)||_0x30f4d7<-0x2645+0x8*-0x12e+0x2fb6||_0x30f4d7>0x8a5*-0x2+0xfe*0x15+-0x328)throw new Error(_0x545094(0xe4));const _0x2a9c99=_0x201eee[_0x545094(0x19c)](_0x5ca7a0=>_0x5ca7a0[_0x545094(0xf0)])[_0x545094(0xdc)](),_0x45e680=createHash(_0x545094(0x150))[_0x545094(0x10e)](_0x201eee[_0x545094(0x19c)](_0x295bac=>_0x295bac[_0x545094(0xf0)]+'\x00'+_0x295bac[_0x545094(0x17f)])[_0x545094(0xdc)]()[_0x545094(0x135)]('\x00'))[_0x545094(0x17a)](_0x545094(0xf8)),_0x22f80d=parseHistoryCursor(_0x248ae2[_0x545094(0x15f)],_0x45e680),_0x46ff9c=await runGit(_0x3ef13b,[_0x545094(0x97),_0x545094(0x127),_0x545094(0x13f),_0x545094(0x1af)+_0x22f80d,_0x545094(0x114)+(_0x30f4d7+(-0x17*-0x3a+-0x199f+-0x6*-0x367)),'-z',_0x545094(0x157),..._0x2a9c99,'--']),_0x112653=new Map();for(const _0x37b8d0 of _0x297425){const _0x3b45ab=_0x112653[_0x545094(0xa9)](_0x37b8d0[_0x545094(0x17f)])??[];_0x3b45ab[_0x545094(0x1a3)](_0x37b8d0[_0x545094(0x175)]),_0x112653[_0x545094(0x1a4)](_0x37b8d0[_0x545094(0x17f)],_0x3b45ab);}const _0x2d1894=_0x46ff9c[_0x545094(0x126)][_0x545094(0x9a)]('\x00'),_0x2fc2f6=[];for(let _0x41721c=0x24*0x3f+-0x156a+0xc8e;_0x41721c+(0x1bdf+-0xd64+-0xe76)<_0x2d1894[_0x545094(0xa0)];_0x41721c+=0x2*-0x32b+0x254*-0x10+0x2*0x15ce){const [_0x259c75,_0x2686a6='',_0x3e6c3c='',_0x131d72='',_0x4b8da3='0',_0x69b45c='']=_0x2d1894[_0x545094(0x17d)](_0x41721c,_0x41721c+(0x437*-0x1+0x4d*-0x63+0x881*0x4));if(_0x259c75===undefined||!/^[0-9a-f]{40,64}$/[_0x545094(0xec)](_0x259c75))continue;_0x2fc2f6[_0x545094(0x1a3)]({'hash':_0x259c75,'parents':_0x2686a6[_0x545094(0xa0)]===-0xacc*-0x3+0x2030+-0x1025*0x4?[]:_0x2686a6[_0x545094(0x9a)]('\x20'),'authorName':_0x3e6c3c,'authorEmail':_0x131d72,'committedAt':Number(_0x4b8da3)*(-0x533*0x7+-0x1b66+0x43b3),'subject':_0x69b45c,'refs':_0x112653[_0x545094(0xa9)](_0x259c75)??[]});}const _0x546b63=_0x2fc2f6[_0x545094(0xa0)]>_0x30f4d7;return{'commits':_0x2fc2f6[_0x545094(0x17d)](-0x160a+0x1*0x1ff3+-0x1*0x9e9,_0x30f4d7),'nextCursor':_0x546b63?historyCursor(_0x22f80d+_0x30f4d7,_0x45e680):null};}async function assertHistoryCommitReachable(_0x8fdf32,_0x544560,_0x33fbbe){const _0x3d3725=_0x4be827;if(!/^[0-9a-f]{40,64}$/[_0x3d3725(0xec)](_0x544560))throw new Error(_0x3d3725(0xcc));const _0x2f932a=selectedHistoryRefs(await listGitHistoryRefs(_0x8fdf32),_0x33fbbe);for(const _0x3e1c11 of _0x2f932a){const _0x3de07a=await runGitAllowFailure(_0x8fdf32,[_0x3d3725(0x13a),_0x3d3725(0x1a0),_0x544560,_0x3e1c11[_0x3d3725(0xf0)]]);if(_0x3de07a[_0x3d3725(0x1ac)]===0xe0*0x1+0x589+-0x669)return;}throw new Error(_0x3d3725(0xcc));}export async function readGitHistoryFiles(_0x2756ce,_0x36ad1f,_0x14454b){const _0x4b44cc=_0x4be827;await assertHistoryCommitReachable(_0x2756ce,_0x36ad1f,_0x14454b);const _0x46f5a1=await runGit(_0x2756ce,[_0x4b44cc(0x1a8),_0x4b44cc(0x142),_0x4b44cc(0x136),_0x4b44cc(0xf7),'-r','-z','-M','-C',_0x4b44cc(0xf4),_0x36ad1f]),_0x2553a5=_0x46f5a1[_0x4b44cc(0x126)][_0x4b44cc(0x9a)]('\x00'),_0x30bc9f=[];for(let _0x2dc34c=-0x9e3*-0x1+-0x2d1+-0x712;_0x2dc34c<_0x2553a5[_0x4b44cc(0xa0)];_0x2dc34c+=0x1c*0x12b+0x24f3+-0x1*0x45a6){const _0x460670=_0x2553a5[_0x2dc34c];if(_0x460670===undefined||_0x460670[_0x4b44cc(0xa0)]===0x14d6+-0x8b7+-0xc1f)continue;const _0x29b6cc=_0x460670[0x8d0+0x16ca+-0x1f9a]??'M';if(_0x29b6cc==='R'||_0x29b6cc==='C'){const _0x1f5475=_0x2553a5[_0x2dc34c+(0x1*-0x224e+-0x1*0x128b+-0xf*-0x386)],_0x3949f8=_0x2553a5[_0x2dc34c+(-0xbb0+-0x1*-0x18bd+-0x9f*0x15)];if(_0x1f5475!==undefined&&_0x3949f8!==undefined)_0x30bc9f[_0x4b44cc(0x1a3)]({'path':_0x3949f8,'previousPath':_0x1f5475,'change':gitChange(_0x29b6cc)});_0x2dc34c+=-0xe*-0x21e+-0x12c4+-0x1*0xade;}else{const _0x5982cc=_0x2553a5[_0x2dc34c+(-0x143b+0xbc0+0x87c)];if(_0x5982cc!==undefined)_0x30bc9f[_0x4b44cc(0x1a3)]({'path':_0x5982cc,'change':gitChange(_0x29b6cc)});_0x2dc34c+=0x24f0+0x5*0x3d1+-0x3804;}}return _0x30bc9f;}export async function readGitHistoryFileDiff(_0x1552af,_0x3de5a2,_0x86d585,_0x2274b1,_0x3b47d7){const _0x2d0895=_0x4be827;await assertHistoryCommitReachable(_0x1552af,_0x3de5a2,_0x2274b1);const _0xb8c711=safeGitWorkspacePath(_0x86d585),_0x33b57f=_0x3b47d7===undefined?undefined:safeGitWorkspacePath(_0x3b47d7),_0x55be65=await runGit(_0x1552af,[_0x2d0895(0xfe),_0x2d0895(0x11e),_0x2d0895(0x136),_0x2d0895(0x12e),_0x2d0895(0x155),_0x3de5a2,'--',_0x2d0895(0x96)+_0xb8c711,..._0x33b57f===undefined||_0x33b57f===_0xb8c711?[]:[_0x2d0895(0x96)+_0x33b57f]]),_0x165293=_0x55be65[_0x2d0895(0x11b)][_0x2d0895(0x108)](-0xdd5*0x1+-0x109*0xd+0x1b4a)||_0x55be65[_0x2d0895(0x126)][_0x2d0895(0x108)](_0x2d0895(0xd6));if(_0x165293)return{'binary':!![],'summary':_0x2d0895(0x112)+createHash(_0x2d0895(0x150))[_0x2d0895(0x10e)](_0x55be65[_0x2d0895(0x11b)])[_0x2d0895(0x17a)](_0x2d0895(0xf8))+_0x2d0895(0xb9)+_0x55be65[_0x2d0895(0x11b)][_0x2d0895(0xa0)],'truncated':_0x55be65[_0x2d0895(0x18b)]};return{'binary':![],'text':_0x55be65[_0x2d0895(0x126)],'truncated':_0x55be65[_0x2d0895(0x18b)]};}export async function readGitHistoryFileContentRange(_0x43db79,_0x1fdb2c,_0x16b519,_0x5afc18,_0x3da79d,_0x374300){const _0x202752=_0x4be827;if(!Number[_0x202752(0xc0)](_0x5afc18)||_0x5afc18<0x20da+0x11*-0x19f+-0x54b||!Number[_0x202752(0xc0)](_0x3da79d)||_0x3da79d<-0x1ee2*0x1+0xd6c+0x1177||_0x3da79d>(0xdfc+0x35f+-0x1147)*(-0xd6+0x1cc6+-0x5fc*0x4)*(-0x117*0x4+0x972+0x2*-0x8b)||_0x5afc18+_0x3da79d>(-0x872*0x4+0x71*-0x3b+0x3be7)*(0x1908+-0x5c*-0x29+-0x23c4)*(0x1*0x130e+0xd*0x5e+-0x13d4))throw new Error(_0x202752(0x185));await assertHistoryCommitReachable(_0x43db79,_0x1fdb2c,_0x374300);const _0x4d9db3=safeGitWorkspacePath(_0x16b519),_0x61bcd4=_0x1fdb2c+':'+_0x4d9db3,_0x42b434=await runGit(_0x43db79,[_0x202752(0x168),'-s',_0x61bcd4]),_0x2ec9b8=Number(_0x42b434[_0x202752(0x126)][_0x202752(0x190)]());if(!Number[_0x202752(0xc0)](_0x2ec9b8)||_0x2ec9b8<0x1071+-0x15fc+0x58b||_0x5afc18>_0x2ec9b8)throw new Error(_0x202752(0x185));if(_0x5afc18===_0x2ec9b8)return{'path':_0x4d9db3,'size':_0x2ec9b8,'offset':_0x5afc18,'contentBase64':'','nextOffset':null};const _0x5e15d0=await runGitAllowFailure(_0x43db79,[_0x202752(0x168),_0x202752(0xda),_0x61bcd4],_0x5afc18+_0x3da79d);if(_0x5e15d0[_0x202752(0x1ac)]!==0x1adc+-0x1689+-0x453)throw new GitCommandError(_0x5e15d0[_0x202752(0x1ac)],_0x5e15d0[_0x202752(0x163)]);const _0x243b8b=_0x5e15d0[_0x202752(0x11b)][_0x202752(0x171)](_0x5afc18,Math[_0x202752(0x176)](_0x2ec9b8,_0x5afc18+_0x3da79d)),_0x349e40=_0x5afc18+_0x243b8b[_0x202752(0xa0)];return{'path':_0x4d9db3,'size':_0x2ec9b8,'offset':_0x5afc18,'contentBase64':_0x243b8b[_0x202752(0x19d)](_0x202752(0xf2)),'nextOffset':_0x349e40<_0x2ec9b8?_0x349e40:null};}export async function readCurrentChanges(_0x385fca){const _0x174ee7=_0x4be827;return(await readCurrentChangesSummary(_0x385fca))[_0x174ee7(0x10d)];}export async function readCurrentChangeDiff(_0x4aca14,_0x1a4bac){const _0x54b80e=_0x4be827,_0xeb6262=safeGitWorkspacePath(_0x1a4bac);await assertCurrentChangePathAccessible(_0x4aca14,_0xeb6262);const _0x5dc0fd=await readCurrentChangeGitDiff(_0x4aca14,_0xeb6262),_0x3973dc=await readWorkingTreeText(_0x4aca14,_0xeb6262),_0x8e700d=_0x5dc0fd[_0x54b80e(0x11b)][_0x54b80e(0x108)](0x80e*0x4+0x4*0x77+-0x2214)||_0x5dc0fd[_0x54b80e(0x126)][_0x54b80e(0x108)](_0x54b80e(0xd6))||_0x3973dc?.[_0x54b80e(0x1a2)]===!![];if(_0x8e700d)return{'binary':!![],'summary':_0x54b80e(0x112)+createHash(_0x54b80e(0x150))[_0x54b80e(0x10e)](_0x5dc0fd[_0x54b80e(0x11b)])[_0x54b80e(0x17a)](_0x54b80e(0xf8))+_0x54b80e(0xb9)+_0x5dc0fd[_0x54b80e(0x11b)][_0x54b80e(0xa0)],'truncated':_0x5dc0fd[_0x54b80e(0x18b)]||_0x3973dc?.[_0x54b80e(0x18b)]===!![]};return{'binary':![],'text':_0x5dc0fd[_0x54b80e(0x126)],'truncated':_0x5dc0fd[_0x54b80e(0x18b)]||_0x3973dc?.[_0x54b80e(0x18b)]===!![],'afterText':_0x3973dc?.[_0x54b80e(0x126)]??'',..._0x3973dc===undefined?{}:{'afterTruncated':_0x3973dc[_0x54b80e(0x18b)]}};}async function readCurrentChangeGitDiff(_0x2161d4,_0x3ff970){const _0x4783f7=_0x4be827,_0x568720=await runGit(_0x2161d4,[_0x4783f7(0x1a9),_0x4783f7(0x178),_0x4783f7(0x151),'-z','--',_0x4783f7(0x96)+_0x3ff970]);if(_0x568720[_0x4783f7(0x126)][_0x4783f7(0x9a)]('\x00')[_0x4783f7(0x108)](_0x3ff970)){const _0x5bf110=await runGitAllowFailure(_0x2161d4,[_0x4783f7(0x12c),_0x4783f7(0x103),_0x4783f7(0x12e),_0x4783f7(0x155),'--',_0x4783f7(0x141),_0x3ff970]);if(_0x5bf110[_0x4783f7(0x1ac)]!==0x5*-0x61c+-0x2412+0x429e&&_0x5bf110[_0x4783f7(0x1ac)]!==0x1152+0x2043*0x1+-0x14e*0x26)throw new GitCommandError(_0x5bf110[_0x4783f7(0x1ac)],_0x5bf110[_0x4783f7(0x163)]);return _0x5bf110;}return runGit(_0x2161d4,[_0x4783f7(0x12c),_0x4783f7(0x12e),_0x4783f7(0x155),_0x4783f7(0x196),'--',_0x4783f7(0x96)+_0x3ff970]);}export async function isWorkspaceChangeVisible(_0x24a257,_0x510b76){const _0x319d85=_0x4be827;try{return await assertCurrentChangePathAccessible(_0x24a257,safeGitWorkspacePath(_0x510b76)),!![];}catch(_0x24af79){if(_0x24af79 instanceof Error&&(_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0xed)||_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0x159)||_0x24af79[_0x319d85(0x1a7)]===_0x319d85(0x188)))return![];throw _0x24af79;}}async function assertCurrentChangePathAccessible(_0x1d39da,_0x2c3add){const _0x21630e=_0x4be827,_0x8811ff=await realpath(_0x1d39da),_0x21f2cd=resolve(_0x8811ff,_0x2c3add),_0x428539=await lstat(_0x21f2cd)[_0x21630e(0x19a)](_0x9233b2=>{const _0x53cc36=_0x21630e;if(_0x9233b2[_0x53cc36(0x1ac)]===_0x53cc36(0x133))return undefined;throw _0x9233b2;});if(_0x428539===undefined)return;await resolveWorkspaceEntry(_0x8811ff,_0x2c3add,![]);}async function readWorkingTreeText(_0x2a0784,_0x2c6e9a){const _0x1faeb5=_0x4be827,_0x445f4f=await realpath(_0x2a0784);let _0x13b0af;try{_0x13b0af=await resolveWorkspaceEntry(_0x445f4f,_0x2c6e9a,![]);}catch(_0x7ef684){if(_0x7ef684 instanceof Error&&_0x7ef684[_0x1faeb5(0x1a7)]===_0x1faeb5(0x159))return undefined;throw _0x7ef684;}const _0x529420=await lstat(_0x13b0af);if(!_0x529420[_0x1faeb5(0x18a)]())return undefined;const _0x1092ec=await readFile(_0x13b0af);return diffTextFromBuffer(_0x1092ec,_0x1092ec[_0x1faeb5(0xa0)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0xcaece3,_0x21d2e2){const _0x127fb0=_0x4be827;if(_0xcaece3[_0x127fb0(0x108)](0x18a1+0x201e+-0x38bf)||!isValidUtf8(_0xcaece3))return{'binary':!![],'truncated':_0x21d2e2};let _0x392894=Math[_0x127fb0(0x176)](_0xcaece3[_0x127fb0(0xa0)],GIT_OUTPUT_LIMIT);while(_0x392894>0x1*0xeb7+0x3ad+-0x1264&&_0x392894<_0xcaece3[_0x127fb0(0xa0)]&&isUtf8ContinuationByte(_0xcaece3[_0x392894]))_0x392894-=-0x886+0x207a*-0x1+-0x3*-0xdab;return{'binary':![],'text':_0xcaece3[_0x127fb0(0x171)](-0x133*-0x8+-0xbcb+0x233*0x1,_0x392894)[_0x127fb0(0x19d)](_0x127fb0(0x152)),'truncated':_0x21d2e2};}export async function restoreCurrentChange(_0x3b00bd,_0x4fba95,_0x56485e){const _0x507041=_0x4be827,_0x28d0bd=safeGitWorkspacePath(_0x4fba95),_0x27d3f8=_0x507041(0x96)+_0x28d0bd;if(_0x56485e===_0x507041(0xb5)){const _0x5ed739=await runGit(_0x3b00bd,[_0x507041(0x19f),_0x507041(0xa3),'-z',_0x507041(0xde),'--',_0x27d3f8]);if(!_0x5ed739[_0x507041(0x126)][_0x507041(0x9a)]('\x00')[_0x507041(0xa1)](_0x59757a=>_0x59757a[_0x507041(0x184)](_0x507041(0xcf))&&_0x59757a[_0x507041(0x17d)](0xfa3+0x1344+0x3a*-0x9a)===_0x28d0bd))throw new Error(_0x507041(0x121));const _0x4bb2c3=await realpath(_0x3b00bd),_0x410fe5=resolve(_0x4bb2c3,_0x28d0bd),_0x3e4c35=await lstat(_0x410fe5);if(!_0x3e4c35[_0x507041(0x18a)]()||_0x3e4c35[_0x507041(0x186)]())throw new Error(_0x507041(0x121));await unlink(_0x410fe5);return;}if(_0x56485e===_0x507041(0xe6)){await runGit(_0x3b00bd,[_0x507041(0xd3),_0x507041(0xee),'--',_0x27d3f8]);return;}await runGit(_0x3b00bd,[_0x507041(0xd3),_0x507041(0xc9),_0x507041(0xb1),_0x507041(0xee),'--',_0x27d3f8]);}function safeGitWorkspacePath(_0x52cd3e){const _0x160138=_0x4be827;if(_0x52cd3e[_0x160138(0xa0)]===-0x7f3+0x7*-0xdc+0x37*0x41||_0x52cd3e[_0x160138(0x108)]('\x00')||_0x52cd3e[_0x160138(0x184)]('/')||_0x52cd3e[_0x160138(0x184)]('\x5c'))throw new Error(_0x160138(0xed));const _0x573a52=_0x52cd3e[_0x160138(0xff)]('\x5c','/');if(_0x573a52[_0x160138(0x9a)]('/')[_0x160138(0xa1)](_0x5b7c37=>_0x5b7c37===''||_0x5b7c37==='..'||_0x5b7c37===_0x160138(0x10f)))throw new Error(_0x160138(0xed));return _0x573a52;}function gitChange(_0x437617){const _0x460ca6=_0x4be827;if(_0x437617==='A')return _0x460ca6(0xc7);if(_0x437617==='D')return _0x460ca6(0xdf);if(_0x437617==='R')return _0x460ca6(0x113);if(_0x437617==='C')return _0x460ca6(0x111);if(_0x437617==='T')return _0x460ca6(0xe3);return _0x460ca6(0xab);}export class GitCommandError extends Error{[_0x4be827(0x1ac)];[_0x4be827(0x163)];constructor(_0x267a3c,_0x2452a8){const _0x5a4a98=_0x4be827;super(_0x5a4a98(0xf5)),this[_0x5a4a98(0x1ac)]=_0x267a3c,this[_0x5a4a98(0x163)]=_0x2452a8;}}async function runGit(_0x3f9bc1,_0x157c39){const _0x2e4582=_0x4be827,_0x487877=await runGitAllowFailure(_0x3f9bc1,_0x157c39);if(_0x487877[_0x2e4582(0x1ac)]!==0x1445+-0x1780+0x33b*0x1)throw new GitCommandError(_0x487877[_0x2e4582(0x1ac)],_0x487877[_0x2e4582(0x163)]);return _0x487877;}async function runGitAllowFailure(_0x4ec8c1,_0x1b6cb6,_0x28b6c9=GIT_OUTPUT_LIMIT){return new Promise((_0x9aee12,_0x20526a)=>{const _0x27eb91=_0x598f,_0x209ee0=spawn(_0x27eb91(0xfc),[..._0x1b6cb6],{'cwd':_0x4ec8c1,'shell':![],'windowsHide':!![],'stdio':[_0x27eb91(0xc5),_0x27eb91(0x172),_0x27eb91(0x172)]}),_0x5c52de=[],_0x4b3914=[];let _0x245164=-0x1dc8+-0x1bed+0x39b5,_0x49e18d=![];const _0x4d25bc=setTimeout(()=>_0x209ee0[_0x27eb91(0x16d)](_0x27eb91(0x11d)),GIT_TIMEOUT_MS);_0x209ee0[_0x27eb91(0xb6)]['on'](_0x27eb91(0x13b),_0x2ea7c6=>{const _0x25239c=_0x27eb91,_0x1a7ad0=Math[_0x25239c(0x131)](-0x5f2*-0x2+0x13c7+0x1*-0x1fab,_0x28b6c9-_0x245164);if(_0x1a7ad0>0xc25+-0x2171*-0x1+-0xf*0x30a){const _0x469a2f=_0x2ea7c6[_0x25239c(0x171)](0xc65*-0x3+-0x20bb+-0x9d*-0x72,_0x1a7ad0);_0x5c52de[_0x25239c(0x1a3)](_0x469a2f),_0x245164+=_0x469a2f[_0x25239c(0xa0)];}_0x49e18d||=_0x2ea7c6[_0x25239c(0xa0)]>_0x1a7ad0;}),_0x209ee0[_0x27eb91(0x163)]['on'](_0x27eb91(0x13b),_0x5244d4=>_0x4b3914[_0x27eb91(0x1a3)](_0x5244d4[_0x27eb91(0x171)](-0x157d+-0x2*0x781+0x1*0x247f,0x1517+-0x955*0x2+0xd93))),_0x209ee0[_0x27eb91(0x109)](_0x27eb91(0x12b),_0x14d587=>{clearTimeout(_0x4d25bc),_0x20526a(_0x14d587);}),_0x209ee0[_0x27eb91(0x109)](_0x27eb91(0xc4),_0x1a1d9d=>{const _0x43a68a=_0x27eb91;clearTimeout(_0x4d25bc);const _0x11d481=Buffer[_0x43a68a(0xd0)](_0x5c52de);_0x9aee12({'code':_0x1a1d9d??-0x410+0xec*0x5+-0x8b*0x1,'output':_0x11d481,'text':_0x11d481[_0x43a68a(0x19d)](_0x43a68a(0x152)),'stderr':Buffer[_0x43a68a(0xd0)](_0x4b3914)[_0x43a68a(0x19d)](_0x43a68a(0x152)),'truncated':_0x49e18d});});});}function isGitUnavailable(_0x341820){const _0x2227d5=_0x4be827;return _0x341820 instanceof Error&&_0x2227d5(0x1ac)in _0x341820&&_0x341820[_0x2227d5(0x1ac)]===_0x2227d5(0x133);}function summarizeText(_0x32a92d){const _0x2c1703=_0x4be827;return JSON[_0x2c1703(0x166)]({'sha256':createHash(_0x2c1703(0x150))[_0x2c1703(0x10e)](_0x32a92d)[_0x2c1703(0x17a)](_0x2c1703(0xf8)),'bytes':Buffer[_0x2c1703(0xaa)](_0x32a92d)});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.26",
3
+ "version": "0.9.27",
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.26",
29
- "@myagentroam/protocol": "^0.9.26"
28
+ "@myagentroam/agent": "^0.9.27",
29
+ "@myagentroam/protocol": "^0.9.27"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ws": "^8.18.1"