@myagentroam/node 0.9.37 → 0.9.39

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 _0x67518d=_0x4bb8;(function(_0x1ddb7f,_0x301f4f){const _0xc2fb41=_0x4bb8,_0x56e49c=_0x1ddb7f();while(!![]){try{const _0x3217c0=-parseInt(_0xc2fb41(0x2b7))/(-0x158*0x7+0x13*-0x41+0xe3c)+parseInt(_0xc2fb41(0x201))/(-0xe*-0xb+0x26b7+0x274f*-0x1)*(-parseInt(_0xc2fb41(0x24f))/(0x812*0x2+0x18b9*-0x1+0x898))+-parseInt(_0xc2fb41(0x246))/(0x15*0x12a+-0x72e*0x4+0x44a)+-parseInt(_0xc2fb41(0x1b6))/(0x2*-0x959+0x1785+0xf*-0x52)*(parseInt(_0xc2fb41(0x233))/(0x3*0xa2a+-0xc89*0x3+0x3*0x261))+-parseInt(_0xc2fb41(0x1f3))/(0x53b+0x1*-0x20de+0x1baa)+-parseInt(_0xc2fb41(0x20f))/(0xafd+-0x10*-0x7e+-0x1*0x12d5)+parseInt(_0xc2fb41(0x1c5))/(0x1a4d*0x1+-0x66+0xe*-0x1d9);if(_0x3217c0===_0x301f4f)break;else _0x56e49c['push'](_0x56e49c['shift']());}catch(_0x10781f){_0x56e49c['push'](_0x56e49c['shift']());}}}(_0x537c,-0x25*0x297f+-0x9a6ba+-0x1*-0x15dc8b));import{createHash,randomUUID}from'node:crypto';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x498f63}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';import{terminateProcessTree}from'./process-tree.js';const GIT_TIMEOUT_MS=0x1*0x281+0x4be*-0x1+-0x1*-0x15c5,GIT_STATUS_TIMEOUT_MS=0x1*-0x76d8+0x947f+0x5789,GIT_HISTORY_TIMEOUT_MS=0xb3*-0x5f+-0x729e+-0xd*-0x126f,GIT_OUTPUT_LIMIT=(0x1588+0x3*0x95b+-0x2f99)*(0x573*-0x5+0x1595+0x9aa),GIT_LARGE_OUTPUT_LIMIT=(0x202+-0x243f+-0x1f*-0x11b)*(0xfa+-0x11*0x183+0x1cb9)*(-0x859*0x3+0x1bc7+0x36*0x6),FILE_READ_LIMIT=(-0x97*0x1+0x12cf+-0x1038)*(-0x31*-0x6e+-0x3*0x2ea+-0x1*0x850),DIRECTORY_PAGE_LIMIT=0x685*-0x3+0x7f4+0x1*0xc63,DIRECTORY_PICKER_LIMIT=-0x1904*0x1+-0x2*0x1161+0x3c8e,SEARCH_RESULT_LIMIT=0x21e9*0x1+0x99*-0x15+0x36e*-0x6,FILE_INDEX_IDLE_TTL_MS=(-0xc62+-0x1606+-0x6*-0x5c6)*(0x99d+0x154d*-0x1+0xbec)*(0x1937*0x1+0x9be+-0x1*0x1f0d),FILE_INDEX_FRESHNESS_TTL_MS=-0x50bc+0xd32c+0x2*-0x6a0,FILE_INDEX_ENTRY_LIMIT=0xaa86+0xfc7+0x1*0xcc53,FILE_INDEX_METADATA_CONCURRENCY=-0x502*0x5+-0x1181+0x2aab,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x67518d(0x216),_0x67518d(0x28c),_0x67518d(0x236),_0x67518d(0x1c3),_0x67518d(0x2ab),_0x67518d(0x2a3),_0x67518d(0x211),_0x67518d(0x24d),_0x67518d(0x28d),_0x67518d(0x23b),_0x67518d(0x1c9),_0x67518d(0x1b1),_0x67518d(0x29e),_0x67518d(0x1df),_0x67518d(0x276),_0x67518d(0x2b3),_0x67518d(0x1d3),_0x67518d(0x208),_0x67518d(0x1db),_0x67518d(0x2b1),_0x67518d(0x228),_0x67518d(0x2b4),_0x67518d(0x2c2),_0x67518d(0x27a),_0x67518d(0x1e5)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x30c560,_0x5b52c7,_0x44db62){const _0x5292ea=_0x67518d,_0xccd06c=_0x5b52c7[_0x5292ea(0x25d)]();if(_0xccd06c[_0x5292ea(0x1c6)]===0xb5*0xd+0x1f8c+-0x28bd||_0xccd06c[_0x5292ea(0x1c6)]>-0x4be+0x1*0x272+0x34b||_0xccd06c==='.'||_0xccd06c==='..'||_0xccd06c[_0x5292ea(0x1ef)]('/')||_0xccd06c[_0x5292ea(0x1ef)]('\x5c')||_0xccd06c[_0x5292ea(0x1ef)]('\x00'))throw new Error(_0x5292ea(0x274));const _0x490e29=await Promise[_0x5292ea(0x269)](_0x44db62[_0x5292ea(0x275)](_0x4a12aa=>realpath(_0x4a12aa))),_0x11c93d=await realpath(_0x30c560)[_0x5292ea(0x221)](()=>{const _0x11eb1b=_0x5292ea;throw new Error(_0x11eb1b(0x2b8));}),_0x223779=await stat(_0x11c93d)[_0x5292ea(0x221)](()=>undefined);if(_0x223779?.[_0x5292ea(0x1cd)]()!==!![]||!isWithinAllowedRoot(_0x11c93d,_0x490e29))throw new Error(_0x5292ea(0x2b8));const _0xd47d1=resolve(_0x11c93d,_0xccd06c);if(dirname(_0xd47d1)!==_0x11c93d||!isWithinAllowedRoot(_0xd47d1,_0x490e29))throw new Error(_0x5292ea(0x274));try{await mkdir(_0xd47d1);}catch(_0x15dfc3){if(_0x15dfc3[_0x5292ea(0x1e3)]===_0x5292ea(0x249))throw new Error(_0x5292ea(0x264));throw _0x15dfc3;}return _0xd47d1;}export class WorkspaceFileIndex{[_0x67518d(0x2c0)];[_0x67518d(0x2a5)];[_0x67518d(0x1bd)]=[];[_0x67518d(0x23e)]=![];[_0x67518d(0x241)];[_0x67518d(0x1fe)];[_0x67518d(0x22f)]=!![];[_0x67518d(0x238)];[_0x67518d(0x1d8)]=0x1867*-0x1+-0xb39*0x3+0x1*0x3a12;[_0x67518d(0x229)]=-0x4*0x34d+-0xe3+-0x1*-0xe17;constructor(_0x112096,_0x1398ec={}){const _0x4aa397=_0x67518d;this[_0x4aa397(0x2c0)]=_0x112096,this[_0x4aa397(0x2a5)]=_0x1398ec;}async[_0x67518d(0x2a2)](){const _0x18e222=_0x67518d;return await this[_0x18e222(0x207)](),this[_0x18e222(0x2c4)](),{'entries':this[_0x18e222(0x1bd)][_0x18e222(0x20b)](_0x4dd1ac=>_0x4dd1ac[_0x18e222(0x1f8)]===_0x18e222(0x1ac)),'truncated':this[_0x18e222(0x23e)]};}[_0x67518d(0x1c0)](){const _0x1cd88b=_0x67518d;if(this[_0x1cd88b(0x238)]!==undefined)clearTimeout(this[_0x1cd88b(0x238)]);this[_0x1cd88b(0x238)]=undefined,this[_0x1cd88b(0x1bd)]=[],this[_0x1cd88b(0x23e)]=![],this[_0x1cd88b(0x22f)]=!![],this[_0x1cd88b(0x1d8)]=-0x1a75+-0x13*-0x13+0x190c,this[_0x1cd88b(0x229)]=0x1a01+0x8f9*-0x1+0x1108*-0x1;}async[_0x67518d(0x278)](_0x459957,_0x12389c,_0x360533=SEARCH_RESULT_LIMIT,_0x192904=![]){const _0x49d1fd=_0x67518d;if(_0x459957[_0x49d1fd(0x25d)]()[_0x49d1fd(0x1c6)]===0x856+-0x1ac9+0x1273||_0x459957[_0x49d1fd(0x1c6)]>-0x4*-0x873+0x23ea*-0x1+0x31e||!Number[_0x49d1fd(0x24c)](_0x360533)||_0x360533<0x1378+0xb*-0x1d9+0xdc||_0x360533>SEARCH_RESULT_LIMIT)throw new Error(_0x49d1fd(0x2bb));await this[_0x49d1fd(0x207)](),this[_0x49d1fd(0x2c4)]();const _0x3990a8=decodeSearchCursor(_0x12389c,_0x459957),_0x113ea9=_0x3990a8===undefined?undefined:this[_0x49d1fd(0x1bd)][_0x49d1fd(0x1ea)](_0x3c5e4d=>_0x3c5e4d[_0x49d1fd(0x21a)]===_0x3990a8&&(_0x192904||_0x3c5e4d[_0x49d1fd(0x1f8)]===_0x49d1fd(0x1ac))),_0x10e3be=_0x113ea9===undefined?-(-0x7*0x2a5+-0x6*0x37f+-0x2a2*-0xf):fuzzyPathScore(_0x113ea9[_0x49d1fd(0x21a)],_0x459957),_0x5e1e5=_0x113ea9===undefined||_0x10e3be<0xe49+-0x14+-0xe35?undefined:{'entry':_0x113ea9,'score':_0x10e3be},_0x4bd712=new RankedCandidateHeap(_0x360533+(-0x108+-0x166c+0x1775));for(const _0x1dcfa1 of this[_0x49d1fd(0x1bd)]){if(!_0x192904&&_0x1dcfa1[_0x49d1fd(0x1f8)]!==_0x49d1fd(0x1ac))continue;const _0x4d708f=fuzzyPathScore(_0x1dcfa1[_0x49d1fd(0x21a)],_0x459957);if(_0x4d708f<0x1*0xce2+0x22b1+-0x2f93)continue;const _0x5e6f75={'entry':_0x1dcfa1,'score':_0x4d708f};if(_0x5e1e5!==undefined&&compareRankedCandidate(_0x5e6f75,_0x5e1e5)<=0x21e5+-0x26ef+0x56*0xf)continue;_0x4bd712[_0x49d1fd(0x261)](_0x5e6f75);}const _0x1e44ad=_0x4bd712[_0x49d1fd(0x20a)](),_0xe7b211=_0x1e44ad[_0x49d1fd(0x23f)](-0x40*-0x3e+0x2*0x11ba+-0x32f4,_0x360533)[_0x49d1fd(0x275)](_0x34b376=>_0x34b376[_0x49d1fd(0x1f7)]),_0x5a27ee=_0x1e44ad[_0x360533]?.[_0x49d1fd(0x1f7)][_0x49d1fd(0x21a)];return{'entries':_0xe7b211,'nextCursor':_0x5a27ee===undefined?null:encodeSearchCursor(_0x459957,_0xe7b211['at'](-(0x2597*-0x1+0x1c2*0xd+0xebe))?.[_0x49d1fd(0x21a)]??_0x3990a8??''),'truncated':_0x5a27ee!==undefined||this[_0x49d1fd(0x23e)]};}async[_0x67518d(0x207)](){const _0x975cc8=_0x67518d;if(!this[_0x975cc8(0x22f)]&&this[_0x975cc8(0x241)]!==undefined){if(Date[_0x975cc8(0x27b)]()-this[_0x975cc8(0x229)]>=(this[_0x975cc8(0x2a5)][_0x975cc8(0x242)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x975cc8(0x28a)]();return;}this[_0x975cc8(0x1fe)]===undefined&&(this[_0x975cc8(0x1fe)]=this[_0x975cc8(0x2c5)]()[_0x975cc8(0x224)](()=>{const _0x5bda84=_0x975cc8;this[_0x5bda84(0x1fe)]=undefined;})),await this[_0x975cc8(0x1fe)];}[_0x67518d(0x2c4)](){const _0x7f2a38=_0x67518d;if(this[_0x7f2a38(0x238)]!==undefined)clearTimeout(this[_0x7f2a38(0x238)]);this[_0x7f2a38(0x238)]=setTimeout(()=>this[_0x7f2a38(0x1c0)](),this[_0x7f2a38(0x2a5)][_0x7f2a38(0x1f5)]??FILE_INDEX_IDLE_TTL_MS),this[_0x7f2a38(0x238)][_0x7f2a38(0x28b)]();}async[_0x67518d(0x2c5)](){const _0x294607=_0x67518d,_0x1679f=await resolveRegisteredWorkspaceRoot(this[_0x294607(0x2c0)]),_0x37c960=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x1679f)],_0x4df07a=[],_0x1da8ed=this[_0x294607(0x2a5)][_0x294607(0x266)]??FILE_INDEX_ENTRY_LIMIT;let _0x27a798=![];const _0x577654=['.'];let _0x3327a8=-0x57*-0x6d+-0x2*-0xec+-0x26e3;while(_0x3327a8<_0x577654[_0x294607(0x1c6)]&&!_0x27a798){const _0x511c59=_0x577654[_0x3327a8];_0x3327a8+=0x5ab*0x4+-0x1fad+-0x2*-0x481;const _0x58026f=await resolveWorkspaceEntryFromCanonicalRoot(_0x1679f,_0x511c59,!![])[_0x294607(0x221)](()=>undefined);if(_0x58026f===undefined)continue;const _0x31d457=await opendir(_0x58026f)[_0x294607(0x221)](()=>undefined);if(_0x31d457===undefined)continue;let _0x39f9bb=[];const _0x873d3e=async()=>{const _0x357fba=_0x294607,_0x18bc93=await Promise[_0x357fba(0x269)](_0x39f9bb);_0x39f9bb=[];for(const _0x510ffa of _0x18bc93){if(_0x510ffa===undefined)continue;if(_0x510ffa[_0x357fba(0x21a)]===_0x357fba(0x2a6)||_0x510ffa[_0x357fba(0x21a)][_0x357fba(0x1b9)](_0x357fba(0x234))||isExcluded(_0x510ffa[_0x357fba(0x21a)],_0x37c960))continue;if(_0x510ffa[_0x357fba(0x1f8)]===_0x357fba(0x298))_0x577654[_0x357fba(0x1f6)](_0x510ffa[_0x357fba(0x21a)]);_0x4df07a[_0x357fba(0x1f6)](_0x510ffa);if(_0x4df07a[_0x357fba(0x1c6)]>=_0x1da8ed){_0x27a798=!![];break;}}};for await(const _0x36e336 of _0x31d457){const _0x2f53fc=_0x511c59==='.'?_0x36e336[_0x294607(0x209)]:posix[_0x294607(0x223)](_0x511c59[_0x294607(0x254)]('\x5c','/'),_0x36e336[_0x294607(0x209)]);if(_0x2f53fc===_0x294607(0x2a6)||_0x2f53fc[_0x294607(0x1b9)](_0x294607(0x234))||isExcluded(_0x2f53fc,_0x37c960))continue;_0x39f9bb[_0x294607(0x1f6)](inspectWorkspaceIndexEntry(_0x1679f,_0x2f53fc,_0x36e336[_0x294607(0x209)]));if(_0x39f9bb[_0x294607(0x1c6)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x873d3e();if(_0x27a798)break;}if(!_0x27a798&&_0x39f9bb[_0x294607(0x1c6)]>-0x2034+0x20a1*0x1+-0x6d)await _0x873d3e();}this[_0x294607(0x241)]=_0x1679f,this[_0x294607(0x1bd)]=_0x4df07a,this[_0x294607(0x23e)]=_0x27a798,this[_0x294607(0x22f)]=![],this[_0x294607(0x1d8)]=Date[_0x294607(0x27b)](),this[_0x294607(0x229)]=this[_0x294607(0x1d8)];}[_0x67518d(0x28a)](){const _0x2bbf79=_0x67518d;if(this[_0x2bbf79(0x1fe)]!==undefined)return;this[_0x2bbf79(0x229)]=Date[_0x2bbf79(0x27b)](),this[_0x2bbf79(0x1fe)]=this[_0x2bbf79(0x2c5)]()[_0x2bbf79(0x221)](()=>undefined)[_0x2bbf79(0x224)](()=>{const _0x8e0365=_0x2bbf79;this[_0x8e0365(0x1fe)]=undefined;});}}async function workspaceExcludePatterns(_0x5a31e3){const _0x5b06f3=_0x67518d,_0x1bb543=resolve(_0x5a31e3,_0x5b06f3(0x22c)),_0x136748=await readFile(_0x1bb543,_0x5b06f3(0x2be))[_0x5b06f3(0x24a)](JSON[_0x5b06f3(0x283)])[_0x5b06f3(0x221)](()=>undefined);if(typeof _0x136748!==_0x5b06f3(0x1ec)||_0x136748===null)return[];return[_0x5b06f3(0x1cf),_0x5b06f3(0x1de)][_0x5b06f3(0x2b0)](_0x2fda09=>{const _0x5d683a=_0x5b06f3,_0x4427b2=_0x136748[_0x2fda09];return typeof _0x4427b2===_0x5d683a(0x1ec)&&_0x4427b2!==null?Object[_0x5d683a(0x1bd)](_0x4427b2)[_0x5d683a(0x2b0)](([_0x4b5119,_0x19100c])=>_0x19100c===!![]?[_0x4b5119]:[]):[];});}function isExcluded(_0x20c9e6,_0x595e94){const _0x14c423=_0x67518d;return _0x595e94[_0x14c423(0x252)](_0x449799=>minimatch(_0x20c9e6,_0x449799,{'dot':!![],'nocase':_0x498f63()!==_0x14c423(0x2a7)})||minimatch(_0x20c9e6+'/',_0x449799,{'dot':!![],'nocase':_0x498f63()!==_0x14c423(0x2a7)}));}function compareRankedCandidate(_0x1a7848,_0x11d25d){const _0x331ebc=_0x67518d;return _0x11d25d[_0x331ebc(0x231)]-_0x1a7848[_0x331ebc(0x231)]||_0x1a7848[_0x331ebc(0x1f7)][_0x331ebc(0x21a)][_0x331ebc(0x1f9)](_0x11d25d[_0x331ebc(0x1f7)][_0x331ebc(0x21a)]);}class RankedCandidateHeap{[_0x67518d(0x1af)];[_0x67518d(0x1a8)]=[];constructor(_0x9d114d){const _0x183283=_0x67518d;this[_0x183283(0x1af)]=_0x9d114d;}[_0x67518d(0x261)](_0x2da816){const _0x8528a0=_0x67518d;if(this[_0x8528a0(0x1a8)][_0x8528a0(0x1c6)]<this[_0x8528a0(0x1af)]){this[_0x8528a0(0x1a8)][_0x8528a0(0x1f6)](_0x2da816),this[_0x8528a0(0x268)](this[_0x8528a0(0x1a8)][_0x8528a0(0x1c6)]-(-0x687*0x2+0xfc5+-0x2b6));return;}if(compareRankedCandidate(_0x2da816,this[_0x8528a0(0x1a8)][0x1*-0x36a+0x1*-0x35b+0x6c5])>=-0x9*-0x3d1+0x74f+-0x29a8)return;this[_0x8528a0(0x1a8)][-0x10d*-0x5+-0xeba+-0x979*-0x1]=_0x2da816,this[_0x8528a0(0x277)](-0xd9*-0x7+-0x756+0x167);}[_0x67518d(0x20a)](){const _0x5c59c9=_0x67518d;return[...this[_0x5c59c9(0x1a8)]][_0x5c59c9(0x2c8)](compareRankedCandidate);}[_0x67518d(0x268)](_0x4deaff){const _0x5a46ef=_0x67518d;let _0x571be2=_0x4deaff;while(_0x571be2>-0x16cf+-0x1*-0x713+0xfbc){const _0x1e8bb3=Math[_0x5a46ef(0x267)]((_0x571be2-(-0x1488+-0xc6a*0x1+0x20f3))/(0x1*0x1aa+0x25*-0x13+0x117));if(compareRankedCandidate(this[_0x5a46ef(0x1a8)][_0x571be2],this[_0x5a46ef(0x1a8)][_0x1e8bb3])<=0x1dee+0x1*-0x329+-0x1ac5)break;[this[_0x5a46ef(0x1a8)][_0x571be2],this[_0x5a46ef(0x1a8)][_0x1e8bb3]]=[this[_0x5a46ef(0x1a8)][_0x1e8bb3],this[_0x5a46ef(0x1a8)][_0x571be2]],_0x571be2=_0x1e8bb3;}}[_0x67518d(0x277)](_0xc7cd36){const _0x580a29=_0x67518d;let _0x425a69=_0xc7cd36;while(!![]){const _0x5a4fb7=_0x425a69*(-0x1c4c+0x595+0x7*0x33f)+(-0x1c56+-0x1eda+-0x13bb*-0x3);if(_0x5a4fb7>=this[_0x580a29(0x1a8)][_0x580a29(0x1c6)])return;const _0x272a16=_0x5a4fb7+(-0x101*0x16+-0x25ba*0x1+0x3bd1),_0x5ea4e4=_0x272a16<this[_0x580a29(0x1a8)][_0x580a29(0x1c6)]&&compareRankedCandidate(this[_0x580a29(0x1a8)][_0x272a16],this[_0x580a29(0x1a8)][_0x5a4fb7])>-0x16e*0x11+-0x24c3+0x3*0x145b?_0x272a16:_0x5a4fb7;if(compareRankedCandidate(this[_0x580a29(0x1a8)][_0x5ea4e4],this[_0x580a29(0x1a8)][_0x425a69])<=-0x1fc0+-0x2b6*-0x1+-0x3f*-0x76)return;[this[_0x580a29(0x1a8)][_0x425a69],this[_0x580a29(0x1a8)][_0x5ea4e4]]=[this[_0x580a29(0x1a8)][_0x5ea4e4],this[_0x580a29(0x1a8)][_0x425a69]],_0x425a69=_0x5ea4e4;}}}function fuzzyPathScore(_0x32efd0,_0x4b52d9){const _0x53c4fb=_0x67518d,_0x4a54ec=_0x32efd0[_0x53c4fb(0x284)](),_0x425073=_0x4b52d9[_0x53c4fb(0x25d)]()[_0x53c4fb(0x284)]();let _0x220202=-0xc1*0x23+-0x1e7e*-0x1+-0x41b*0x1,_0x2da85e=0x832+0x138b+-0x9*0x315,_0x2024e0=-(0x6b8+0x1*-0x1f61+-0x5*-0x4ef);for(const _0x5c66b3 of _0x425073){const _0x4e819f=_0x4a54ec[_0x53c4fb(0x292)](_0x5c66b3,_0x220202);if(_0x4e819f===-(0x25*0x1c+0x5*-0x389+-0xda2*-0x1))return-(-0xf37*0x2+-0x7d8+0x2647);_0x2da85e+=_0x4e819f===_0x2024e0+(-0x851+0x1*-0x1483+-0x79*-0x3d)?0x1fa2+0x1be*0xa+-0x3102:0xb61+-0x24*-0x7e+-0x1d18;if(_0x4e819f===-0x133f+-0x3f3+0xb99*0x2||_0x53c4fb(0x25e)[_0x53c4fb(0x1ef)](_0x4a54ec[_0x4e819f-(0x8*-0x2bf+0x2663+-0x16*0xbf)]??''))_0x2da85e+=0x18a0+0x1707+-0x2f9f;_0x2024e0=_0x4e819f,_0x220202=_0x4e819f+(0x1c55+0x1e*-0x9c+0x283*-0x4);}const _0x595d14=_0x32efd0[_0x53c4fb(0x23f)](_0x32efd0[_0x53c4fb(0x271)]('/')+(-0x3*0x696+0xa*0x291+-0x5e7))[_0x53c4fb(0x284)]();if(_0x595d14[_0x53c4fb(0x1ef)](_0x425073))_0x2da85e+=0xc5f*0x1+0x1115+-0x753*0x4;else{if(_0x4a54ec[_0x53c4fb(0x1ef)](_0x425073))_0x2da85e+=-0x25*0x101+-0x1e36+0x436b;}return _0x2da85e-_0x32efd0[_0x53c4fb(0x1c6)]/(0x3c7+-0x1*-0x188f+-0x186e);}export async function listWorkspaceDirectories(_0x48992c,_0x3e1b9e,_0x4043f0=homedir()){const _0x1bb0c2=_0x67518d,_0x5595dd=await realpath(_0x4043f0),_0x5ddd4d=await Promise[_0x1bb0c2(0x269)](_0x3e1b9e[_0x1bb0c2(0x275)](_0x553e88=>realpath(_0x553e88))),_0x1caff8=[...new Set([_0x5595dd,..._0x5ddd4d])],_0x3d7d10=_0x48992c===undefined?_0x5ddd4d[-0x109b*0x1+-0x11fb*0x2+0x3491*0x1]??_0x5595dd:await realpath(_0x48992c),_0x50fcab=await stat(_0x3d7d10);if(!_0x50fcab[_0x1bb0c2(0x1cd)]()||!isWithinAllowedRoot(_0x3d7d10,_0x1caff8))throw new Error(_0x1bb0c2(0x2b8));const _0xb8127c=await readdir(_0x3d7d10,{'withFileTypes':!![]}),_0x4c7457=[];for(const _0x33b62c of _0xb8127c[_0x1bb0c2(0x2c8)]((_0x45a279,_0x526ff8)=>_0x45a279[_0x1bb0c2(0x209)][_0x1bb0c2(0x1f9)](_0x526ff8[_0x1bb0c2(0x209)]))){if(!_0x33b62c[_0x1bb0c2(0x1cd)]()&&!_0x33b62c[_0x1bb0c2(0x1f0)]())continue;const _0x388008=await realpath(resolve(_0x3d7d10,_0x33b62c[_0x1bb0c2(0x209)]))[_0x1bb0c2(0x221)](()=>undefined);if(_0x388008===undefined||!isWithinAllowedRoot(_0x388008,_0x1caff8))continue;const _0x37edf5=await stat(_0x388008)[_0x1bb0c2(0x221)](()=>undefined);if(_0x37edf5===undefined||!_0x37edf5[_0x1bb0c2(0x1cd)]())continue;_0x4c7457[_0x1bb0c2(0x1f6)]({'path':_0x388008,'name':_0x33b62c[_0x1bb0c2(0x209)],'selectable':isWithinAllowedRoot(_0x388008,_0x5ddd4d)});if(_0x4c7457[_0x1bb0c2(0x1c6)]>DIRECTORY_PICKER_LIMIT)break;}const _0x1e80bf=dirname(_0x3d7d10);return{'homePath':_0x5595dd,'currentPath':_0x3d7d10,'parentPath':_0x1e80bf===_0x3d7d10||!isWithinAllowedRoot(_0x1e80bf,_0x1caff8)?null:_0x1e80bf,'browseRoots':_0x5ddd4d,'selectable':isWithinAllowedRoot(_0x3d7d10,_0x5ddd4d),'entries':_0x4c7457[_0x1bb0c2(0x23f)](-0x1549+0x1*-0x25bf+0x8*0x761,DIRECTORY_PICKER_LIMIT),'truncated':_0x4c7457[_0x1bb0c2(0x1c6)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x26bfd1,_0x201467='.',_0x4f27b1,_0x3b0da6=DIRECTORY_PAGE_LIMIT){const _0x3b0306=_0x67518d;if(!Number[_0x3b0306(0x24c)](_0x3b0da6)||_0x3b0da6<-0x1be7+0x8*-0x4a8+-0x18*-0x2b7||_0x3b0da6>DIRECTORY_PAGE_LIMIT)throw new Error(_0x3b0306(0x1bc));const _0x4bc497=await resolveRegisteredWorkspaceRoot(_0x26bfd1),_0x3ac98e=await resolveWorkspaceEntryFromCanonicalRoot(_0x4bc497,_0x201467,!![]),_0x11e037=await readdir(_0x3ac98e,{'withFileTypes':!![]}),_0x55562c=decodeDirectoryCursor(_0x4f27b1,_0x201467),_0x343356=_0x11e037[_0x3b0306(0x20b)](_0x2744da=>_0x2744da[_0x3b0306(0x209)]!==_0x3b0306(0x2a6)&&!isWorkspaceUploadTemporaryName(_0x2744da[_0x3b0306(0x209)]))[_0x3b0306(0x275)](_0x43fba7=>_0x43fba7[_0x3b0306(0x209)])[_0x3b0306(0x2c8)]((_0x45d2f6,_0x12849d)=>_0x45d2f6[_0x3b0306(0x1f9)](_0x12849d)),_0x3ea5c7=_0x55562c===undefined?-0x2*-0x1074+0x819+0x2901*-0x1:_0x343356[_0x3b0306(0x280)](_0xab3ccb=>_0xab3ccb>_0x55562c);if(_0x55562c!==undefined&&_0x3ea5c7===-(0x1*0xa36+0x2078+-0x2aad))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x5b00e3=_0x343356[_0x3b0306(0x23f)](_0x3ea5c7,_0x3ea5c7+_0x3b0da6),_0x23480c=[];for(const _0x326faa of _0x5b00e3){const _0x4ee114=await resolveWorkspaceEntry(_0x4bc497,relative(_0x4bc497,resolve(_0x3ac98e,_0x326faa)),![])[_0x3b0306(0x221)](_0x1e9b3b=>{if(isSkippableWorkspaceEntryError(_0x1e9b3b))return undefined;throw _0x1e9b3b;});if(_0x4ee114===undefined)continue;const _0x18f6dd=await lstat(_0x4ee114)[_0x3b0306(0x221)](_0x167620=>{const _0x3b1040=_0x3b0306;if(_0x167620[_0x3b1040(0x1e3)]===_0x3b1040(0x260))return undefined;throw _0x167620;});if(_0x18f6dd===undefined||!_0x18f6dd[_0x3b0306(0x1bf)]()&&!_0x18f6dd[_0x3b0306(0x1cd)]())continue;_0x23480c[_0x3b0306(0x1f6)]({'path':relative(_0x4bc497,_0x4ee114)[_0x3b0306(0x1eb)](sep)[_0x3b0306(0x223)]('/'),'name':_0x326faa,'kind':_0x18f6dd[_0x3b0306(0x1cd)]()?_0x3b0306(0x298):_0x3b0306(0x1ac),'size':_0x18f6dd[_0x3b0306(0x1bf)]()?_0x18f6dd[_0x3b0306(0x21c)]:null,'modifiedAt':_0x18f6dd[_0x3b0306(0x1e2)]});}const _0x6abd05=_0x343356[_0x3ea5c7+_0x5b00e3[_0x3b0306(0x1c6)]];return{'entries':_0x23480c,'nextCursor':_0x6abd05===undefined||_0x5b00e3[_0x3b0306(0x1c6)]===0x1*-0x1cce+0x1a95+0x239*0x1?null:encodeDirectoryCursor(_0x201467,_0x5b00e3[_0x5b00e3[_0x3b0306(0x1c6)]-(-0x1980+-0x1*0x419+-0x6*-0x4ef)]),'truncated':_0x6abd05!==undefined};}export async function mutateWorkspaceFile(_0x2a2263,_0x3cc229){const _0x33a474=_0x67518d,_0x4823f4=await resolveRegisteredWorkspaceRoot(_0x2a2263);if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1e6)||_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1b8)){const _0x42cddb=await resolveNewWorkspaceEntry(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x1e6))await writeFile(_0x42cddb,'',{'flag':'wx'});else await mkdir(_0x42cddb);return{'path':workspaceRelativePath(_0x4823f4,_0x42cddb)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);const _0x51a2c6=await resolveWorkspaceEntryMetadata(_0x4823f4,_0x3cc229[_0x33a474(0x21a)]);if(workspaceRelativePath(_0x4823f4,_0x51a2c6[_0x33a474(0x21a)])==='.')throw new Error(_0x33a474(0x27e));if(_0x3cc229[_0x33a474(0x1ca)]===_0x33a474(0x253))return await rm(_0x51a2c6[_0x33a474(0x21a)],{'recursive':_0x51a2c6[_0x33a474(0x2b5)][_0x33a474(0x1cd)](),'force':![]}),{'deleted':!![]};const _0x5d5dc4=await resolveNewWorkspaceEntry(_0x4823f4,_0x3cc229[_0x33a474(0x29f)]);if(_0x51a2c6[_0x33a474(0x2b5)][_0x33a474(0x1cd)]()){const _0x1cfc40=relative(_0x51a2c6[_0x33a474(0x21a)],_0x5d5dc4);if(_0x1cfc40===''||!isAbsolute(_0x1cfc40)&&_0x1cfc40!=='..'&&!_0x1cfc40[_0x33a474(0x1b9)]('..'+sep))throw new Error(_0x33a474(0x1ad));}return await rename(_0x51a2c6[_0x33a474(0x21a)],_0x5d5dc4),{'path':workspaceRelativePath(_0x4823f4,_0x5d5dc4)};}async function resolveNewWorkspaceEntry(_0xcf16d7,_0x165934){const _0x459e4c=_0x67518d,_0x546c4c=_0x165934[_0x459e4c(0x254)]('\x5c','/'),_0x3998d7=_0x546c4c[_0x459e4c(0x1eb)]('/'),_0x525525=_0x3998d7['at'](-(0xfaa+-0xc2+-0xee7));if(_0x165934[_0x459e4c(0x1ef)]('\x00')||_0x546c4c[_0x459e4c(0x1b9)]('/')||isAbsolute(_0x165934)||win32[_0x459e4c(0x25c)](_0x546c4c)||_0x525525===undefined||_0x525525[_0x459e4c(0x1c6)]===-0x805+-0x1*0x1325+0x487*0x6||_0x3998d7[_0x459e4c(0x252)](invalidWorkspaceMutationSegment))throw new Error(_0x459e4c(0x1cb));const _0x5531a7=_0x3998d7[_0x459e4c(0x1c6)]===-0x98d+0x1a49+0x10bb*-0x1?'.':_0x3998d7[_0x459e4c(0x23f)](0x20b*0xf+0xae+-0x1f53,-(-0x878*0x1+0x115a*0x2+0x11*-0x18b))[_0x459e4c(0x223)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0xcf16d7,_0x5531a7);const _0x347530=await resolveWorkspaceEntryFromCanonicalRoot(_0xcf16d7,_0x5531a7,!![]),_0x798d86=resolve(_0x347530,_0x525525);try{await lstat(_0x798d86);throw new Error(_0x459e4c(0x1d1));}catch(_0x4cf743){if(_0x4cf743[_0x459e4c(0x1e3)]!==_0x459e4c(0x260))throw _0x4cf743;}return _0x798d86;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x2b9123,_0x31994b){const _0x24859a=_0x67518d,_0x2e64e0=_0x31994b[_0x24859a(0x254)]('\x5c','/');if(_0x2e64e0==='.')return;const _0x2e9871=_0x2e64e0[_0x24859a(0x1eb)]('/');if(_0x31994b[_0x24859a(0x1ef)]('\x00')||_0x2e64e0[_0x24859a(0x1b9)]('/')||isAbsolute(_0x31994b)||win32[_0x24859a(0x25c)](_0x2e64e0)||_0x2e9871[_0x24859a(0x252)](invalidWorkspaceMutationSegment))throw new Error(_0x24859a(0x1cb));let _0x5831dc=_0x2b9123;for(const _0x1a2d5c of _0x2e9871){_0x5831dc=resolve(_0x5831dc,_0x1a2d5c);const _0x387d2b=await lstat(_0x5831dc)[_0x24859a(0x221)](_0x5b3f53=>{const _0x3dff96=_0x24859a;if(_0x5b3f53[_0x3dff96(0x1e3)]===_0x3dff96(0x260))throw new Error(_0x3dff96(0x29d));throw _0x5b3f53;});if(_0x387d2b[_0x24859a(0x1f0)]())throw new Error(_0x24859a(0x1cb));}}function invalidWorkspaceMutationSegment(_0x272ce4){const _0x2c35af=_0x67518d;if(_0x272ce4[_0x2c35af(0x1c6)]===-0x353*-0x6+-0xb9*-0x13+-0x1*0x21ad||_0x272ce4==='.'||_0x272ce4==='..'||_0x272ce4===_0x2c35af(0x2a6))return!![];if(_0x498f63()!==_0x2c35af(0x2c6))return![];const _0x466a6a=_0x272ce4[_0x2c35af(0x1d2)](/[. ]+$/u,'')[_0x2c35af(0x290)]();return/[<>:"|?*]/u[_0x2c35af(0x27d)](_0x272ce4)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x2c35af(0x27d)](_0x466a6a);}function workspaceRelativePath(_0x4d536d,_0x1ad92a){const _0x350e38=_0x67518d,_0x236d80=relative(_0x4d536d,_0x1ad92a)[_0x350e38(0x1eb)](sep)[_0x350e38(0x223)]('/');return _0x236d80[_0x350e38(0x1c6)]===0x49f*0x3+0x2347+-0x2e4*0x11?'.':_0x236d80;}function isSkippableWorkspaceEntryError(_0x48f114){const _0x536a37=_0x67518d;return _0x48f114 instanceof Error&&(_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x1cb)||_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x29d)||_0x48f114[_0x536a37(0x26a)]===_0x536a37(0x1aa));}export async function preflightWorkspaceUpload(_0xcb574f,_0x42d575,_0x59fca6){const _0x41218b=_0x67518d;if(_0x59fca6[_0x41218b(0x1c6)]===-0x1*0x1834+-0x673+0x1ea7||_0x59fca6==='.'||_0x59fca6==='..'||_0x59fca6[_0x41218b(0x1ef)]('\x00')||_0x59fca6[_0x41218b(0x1ef)]('/')||_0x59fca6[_0x41218b(0x1ef)]('\x5c')||isWorkspaceUploadTemporaryName(_0x59fca6))return{'path':'','absolutePath':'','status':_0x41218b(0x1b4)};const _0x2ec258=await resolveRegisteredWorkspaceRoot(_0xcb574f),_0x5bcfad=await resolveWorkspaceEntry(_0x2ec258,_0x42d575,!![]),_0x3db892=resolve(_0x5bcfad,_0x59fca6);if(dirname(_0x3db892)!==_0x5bcfad)throw new Error(_0x41218b(0x1cb));const _0x43c713=relative(_0x2ec258,_0x3db892)[_0x41218b(0x1eb)](sep)[_0x41218b(0x223)]('/'),_0x519e98=await lstat(_0x3db892)[_0x41218b(0x221)](_0x5bf436=>{const _0x30ee25=_0x41218b;if(_0x5bf436[_0x30ee25(0x1e3)]===_0x30ee25(0x260))return undefined;throw _0x5bf436;});if(_0x519e98===undefined)return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x1fd)};if(_0x519e98[_0x41218b(0x1f0)]())throw new Error(_0x41218b(0x1cb));if(_0x519e98[_0x41218b(0x1bf)]())return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x25a)};return{'path':_0x43c713,'absolutePath':_0x3db892,'status':_0x41218b(0x1f1)};}export function workspaceUploadTemporaryName(_0x310fc1){const _0x376011=_0x67518d;return _0x376011(0x25f)+_0x310fc1+_0x376011(0x1b5);}function isWorkspaceUploadTemporaryName(_0x1b5a44){const _0x14f497=_0x67518d;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x14f497(0x27d)](_0x1b5a44)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x14f497(0x27d)](_0x1b5a44);}export async function readWorkspaceTextFile(_0x79817a,_0x539ea8,_0x2ecfc9=-0x15b0+-0x1*-0xc51+0x95f,_0x4be821=FILE_READ_LIMIT){const _0x24c90a=_0x67518d;if(!Number[_0x24c90a(0x24c)](_0x2ecfc9)||_0x2ecfc9<-0x5e6+-0x456+0x2*0x51e||!Number[_0x24c90a(0x24c)](_0x4be821)||_0x4be821<0x1f80+0x1cab+-0x1*0x3c2a||_0x4be821>FILE_READ_LIMIT)throw new Error(_0x24c90a(0x1a4));const _0x420df1=await resolveRegisteredWorkspaceRoot(_0x79817a),_0x1502ce=await resolveWorkspaceEntry(_0x420df1,_0x539ea8,![]),_0x3aa644=await lstat(_0x1502ce);if(!_0x3aa644[_0x24c90a(0x1bf)]())throw new Error(_0x24c90a(0x1aa));if(_0x3aa644[_0x24c90a(0x21c)]>FILE_READ_LIMIT*(0x1683+0x2531+-0x2b6*0x16))throw new Error(_0x24c90a(0x273));const _0x55018d=await readFile(_0x1502ce),_0x39c391=createHash(_0x24c90a(0x2a9))[_0x24c90a(0x200)](_0x55018d)[_0x24c90a(0x214)](_0x24c90a(0x26f)),_0x10389b=_0x55018d[_0x24c90a(0x1ef)](0xb9*-0x6+-0x42*0x89+-0x11a*-0x24)||!isValidUtf8(_0x55018d);if(_0x10389b){const _0x27ac7b=Math[_0x24c90a(0x1d6)](_0x55018d[_0x24c90a(0x1c6)],_0x2ecfc9+_0x4be821),_0x4787f3=_0x55018d[_0x24c90a(0x227)](_0x2ecfc9,_0x27ac7b);return{'path':relative(_0x420df1,_0x1502ce)[_0x24c90a(0x1eb)](sep)[_0x24c90a(0x223)]('/'),'encoding':_0x24c90a(0x287),'size':_0x55018d[_0x24c90a(0x1c6)],'content':_0x4787f3[_0x24c90a(0x1dd)](_0x24c90a(0x287)),'truncated':_0x27ac7b<_0x55018d[_0x24c90a(0x1c6)],'nextOffset':_0x27ac7b<_0x55018d[_0x24c90a(0x1c6)]?_0x27ac7b:null,'revision':_0x39c391};}if(_0x2ecfc9>0x1*-0x674+0x255d*0x1+0x1ee9*-0x1&&_0x2ecfc9<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x2ecfc9]))throw new Error(_0x24c90a(0x1a4));let _0x4add7a=Math[_0x24c90a(0x1d6)](_0x55018d[_0x24c90a(0x1c6)],_0x2ecfc9+_0x4be821);if(_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x4add7a])){while(_0x4add7a>_0x2ecfc9&&isUtf8ContinuationByte(_0x55018d[_0x4add7a]))_0x4add7a-=-0x1208+0x10*-0x6a+-0x3b*-0x6b;if(_0x4add7a===_0x2ecfc9){_0x4add7a+=0x1269+0x140c+-0x2674;while(_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]&&isUtf8ContinuationByte(_0x55018d[_0x4add7a]))_0x4add7a+=-0x2*0xaa2+0xfe5+0x560;}}const _0x10fa50=_0x55018d[_0x24c90a(0x227)](_0x2ecfc9,_0x4add7a),_0x586828=new TextDecoder(_0x24c90a(0x203),{'fatal':!![]})[_0x24c90a(0x230)](_0x10fa50),_0x272911=_0x4add7a<_0x55018d[_0x24c90a(0x1c6)]?_0x4add7a:null;return{'path':relative(_0x420df1,_0x1502ce)[_0x24c90a(0x1eb)](sep)[_0x24c90a(0x223)]('/'),'encoding':_0x24c90a(0x203),'size':_0x55018d[_0x24c90a(0x1c6)],'content':_0x586828,'truncated':_0x272911!==null,'nextOffset':_0x272911,'revision':_0x39c391};}export async function writeWorkspaceTextFile(_0x1c541a,_0x56c6ca,_0x373234,_0x383287){const _0x51bb5f=_0x67518d;if(!/^[0-9a-f]{64}$/u[_0x51bb5f(0x27d)](_0x383287))throw new Error(_0x51bb5f(0x23d));const _0x3062f0=Buffer[_0x51bb5f(0x29a)](_0x373234,_0x51bb5f(0x2be));if(_0x3062f0[_0x51bb5f(0x1c6)]>FILE_READ_LIMIT*(0x10*0x7f+-0x1fb1+-0x43*-0x5b))throw new Error(_0x51bb5f(0x273));if(_0x3062f0[_0x51bb5f(0x1ef)](-0x1*-0x1949+0x2f*-0xd2+0x1*0xd45))throw new Error(_0x51bb5f(0x294));const _0x536faa=await resolveRegisteredWorkspaceRoot(_0x1c541a);await assertWorkspaceMutationPathHasNoSymlinks(_0x536faa,_0x56c6ca);const _0x3fc3c6=await resolveWorkspaceEntry(_0x536faa,_0x56c6ca,![]),_0xbb0bd6=await lstat(_0x3fc3c6);if(!_0xbb0bd6[_0x51bb5f(0x1bf)]())throw new Error(_0x51bb5f(0x1aa));const _0x116f80=await readFile(_0x3fc3c6);if(_0x116f80[_0x51bb5f(0x1ef)](-0x1487+0x1*0x1cc3+-0x83c)||!isValidUtf8(_0x116f80))throw new Error(_0x51bb5f(0x294));const _0x3b5526=createHash(_0x51bb5f(0x2a9))[_0x51bb5f(0x200)](_0x116f80)[_0x51bb5f(0x214)](_0x51bb5f(0x26f));if(_0x3b5526!==_0x383287)throw new Error(_0x51bb5f(0x1b3));const _0x597df4=createHash(_0x51bb5f(0x2a9))[_0x51bb5f(0x200)](_0x3062f0)[_0x51bb5f(0x214)](_0x51bb5f(0x26f)),_0x5ee790=resolve(dirname(_0x3fc3c6),_0x51bb5f(0x26d)+randomUUID()+_0x51bb5f(0x1b5));try{await writeFile(_0x5ee790,_0x3062f0,{'flag':'wx','mode':_0xbb0bd6[_0x51bb5f(0x212)]}),await rename(_0x5ee790,_0x3fc3c6);}finally{await rm(_0x5ee790,{'force':!![]})[_0x51bb5f(0x221)](()=>undefined);}return{'path':workspaceRelativePath(_0x536faa,_0x3fc3c6),'revision':_0x597df4,'size':_0x3062f0[_0x51bb5f(0x1c6)]};}export async function readWorkspaceFileContentRange(_0x4136fd,_0x3953b7,_0xc31e8b=0x98b*0x1+-0x9*-0x89+0x72e*-0x2,_0x4369e9=FILE_READ_LIMIT){const _0x2770f4=_0x67518d;if(!Number[_0x2770f4(0x24c)](_0xc31e8b)||_0xc31e8b<0x949*-0x3+-0x1*-0x121f+0x4de*0x2||!Number[_0x2770f4(0x24c)](_0x4369e9)||_0x4369e9<0xa9b*-0x1+-0x8d*-0x1e+-0x2f5*0x2||_0x4369e9>FILE_READ_LIMIT)throw new Error(_0x2770f4(0x1a4));const _0x39d4f1=await resolveRegisteredWorkspaceRoot(_0x4136fd),_0x544f61=await resolveWorkspaceEntry(_0x39d4f1,_0x3953b7,![]),_0x12448d=await lstat(_0x544f61);if(!_0x12448d[_0x2770f4(0x1bf)]())throw new Error(_0x2770f4(0x1aa));if(_0xc31e8b>_0x12448d[_0x2770f4(0x21c)])throw new Error(_0x2770f4(0x1a4));const _0x3fcf3a=Math[_0x2770f4(0x1d6)](_0x4369e9,_0x12448d[_0x2770f4(0x21c)]-_0xc31e8b),_0x544575=Buffer[_0x2770f4(0x213)](_0x3fcf3a),_0x2df91c=await open(_0x544f61,'r');try{const {bytesRead:_0x285875}=await _0x2df91c[_0x2770f4(0x1ff)](_0x544575,0x4f5*-0x6+-0x1*0x1075+0x2e33,_0x3fcf3a,_0xc31e8b),_0x48f266=_0xc31e8b+_0x285875;return{'path':relative(_0x39d4f1,_0x544f61)[_0x2770f4(0x1eb)](sep)[_0x2770f4(0x223)]('/'),'size':_0x12448d[_0x2770f4(0x21c)],'offset':_0xc31e8b,'contentBase64':_0x544575[_0x2770f4(0x227)](0x8*-0x2dd+0xe3a+0x16*0x65,_0x285875)[_0x2770f4(0x1dd)](_0x2770f4(0x287)),'nextOffset':_0x48f266<_0x12448d[_0x2770f4(0x21c)]?_0x48f266:null};}finally{await _0x2df91c[_0x2770f4(0x232)]();}}export async function readAllowedFileContentRange(_0x4b091c,_0x4a7853,_0x5267e5=0x3*-0xc4c+0x258a+-0xa6*0x1,_0x1b8f6a=FILE_READ_LIMIT){const _0x3a6028=_0x67518d;if(!Number[_0x3a6028(0x24c)](_0x5267e5)||_0x5267e5<0x1*-0xe5a+-0x9b+0xef5||!Number[_0x3a6028(0x24c)](_0x1b8f6a)||_0x1b8f6a<0x158b+-0x85b+0x2d*-0x4b||_0x1b8f6a>FILE_READ_LIMIT)throw new Error(_0x3a6028(0x1a4));const {file:_0x194e7a,metadata:_0x102b50}=await resolveAllowedFile(_0x4b091c,_0x4a7853);if(_0x5267e5>_0x102b50[_0x3a6028(0x21c)])throw new Error(_0x3a6028(0x1a4));const _0xd36e40=Math[_0x3a6028(0x1d6)](_0x1b8f6a,_0x102b50[_0x3a6028(0x21c)]-_0x5267e5),_0x48777e=Buffer[_0x3a6028(0x213)](_0xd36e40),_0x5f51ae=await open(_0x194e7a,'r');try{const {bytesRead:_0x25ba6c}=await _0x5f51ae[_0x3a6028(0x1ff)](_0x48777e,0x1521*0x1+-0x3a*0xa9+-0x1129*-0x1,_0xd36e40,_0x5267e5),_0x20ad36=_0x5267e5+_0x25ba6c;return{'path':_0x194e7a,'size':_0x102b50[_0x3a6028(0x21c)],'offset':_0x5267e5,'contentBase64':_0x48777e[_0x3a6028(0x227)](0x1fe5+-0x21e0+0x1fb,_0x25ba6c)[_0x3a6028(0x1dd)](_0x3a6028(0x287)),'nextOffset':_0x20ad36<_0x102b50[_0x3a6028(0x21c)]?_0x20ad36:null};}finally{await _0x5f51ae[_0x3a6028(0x232)]();}}export async function readAllowedTextFile(_0x192c99,_0x7f4193,_0x514492=-0x17f*-0x2+0x517*0x3+-0x5*0x3a7,_0x253a58=FILE_READ_LIMIT){const _0x3ebecf=_0x67518d,{file:_0x1466ae,metadata:_0x2f096f}=await resolveAllowedFile(_0x192c99,_0x7f4193);if(_0x2f096f[_0x3ebecf(0x21c)]>FILE_READ_LIMIT*(0x49*0x4f+-0x722+-0xf55))throw new Error(_0x3ebecf(0x273));if(!Number[_0x3ebecf(0x24c)](_0x514492)||_0x514492<0x1f2*0x5+0x1a54+-0x163*0x1a||!Number[_0x3ebecf(0x24c)](_0x253a58)||_0x253a58<-0x6c*-0x7+-0x134d+-0x2e*-0x5b||_0x253a58>FILE_READ_LIMIT)throw new Error(_0x3ebecf(0x1a4));const _0x35ed75=await readFile(_0x1466ae),_0x42d51c=_0x35ed75[_0x3ebecf(0x1ef)](-0x2*0x11f+0x5ae*0x2+-0x91e)||!isValidUtf8(_0x35ed75),_0x9552a4=Math[_0x3ebecf(0x1d6)](_0x35ed75[_0x3ebecf(0x1c6)],_0x514492+_0x253a58);if(_0x42d51c){const _0x5af87f=_0x35ed75[_0x3ebecf(0x227)](_0x514492,_0x9552a4);return{'path':_0x1466ae,'encoding':_0x3ebecf(0x287),'size':_0x35ed75[_0x3ebecf(0x1c6)],'content':_0x5af87f[_0x3ebecf(0x1dd)](_0x3ebecf(0x287)),'truncated':_0x9552a4<_0x35ed75[_0x3ebecf(0x1c6)],'nextOffset':_0x9552a4<_0x35ed75[_0x3ebecf(0x1c6)]?_0x9552a4:null};}if(_0x514492>-0xaf1+-0xce*-0x16+0x241*-0x3&&_0x514492<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x514492]))throw new Error(_0x3ebecf(0x1a4));let _0x506567=_0x9552a4;if(_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x506567])){while(_0x506567>_0x514492&&isUtf8ContinuationByte(_0x35ed75[_0x506567]))_0x506567-=0x1a1*0x9+-0x788+-0x4*0x1c8;if(_0x506567===_0x514492){_0x506567+=-0x1fed+0x1*-0xa22+-0x542*-0x8;while(_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]&&isUtf8ContinuationByte(_0x35ed75[_0x506567]))_0x506567+=0x1*0xf21+0x1*0x12b9+0x21d9*-0x1;}}const _0x334627=_0x506567<_0x35ed75[_0x3ebecf(0x1c6)]?_0x506567:null;return{'path':_0x1466ae,'encoding':_0x3ebecf(0x203),'size':_0x35ed75[_0x3ebecf(0x1c6)],'content':new TextDecoder(_0x3ebecf(0x203),{'fatal':!![]})[_0x3ebecf(0x230)](_0x35ed75[_0x3ebecf(0x227)](_0x514492,_0x506567)),'truncated':_0x334627!==null,'nextOffset':_0x334627};}export function normalizeFilePreviewPath(_0x293246){const _0x18eb8d=_0x67518d;if(!/^sandbox:/iu[_0x18eb8d(0x27d)](_0x293246))return _0x293246;let _0x218fd2;try{_0x218fd2=decodeURIComponent(_0x293246[_0x18eb8d(0x23f)](_0x293246[_0x18eb8d(0x292)](':')+(0x35e*0x7+-0xb63+-0xc2e)));}catch{throw new Error(_0x18eb8d(0x1cb));}const _0x4fb340=_0x218fd2[_0x18eb8d(0x1d2)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x4fb340[_0x18eb8d(0x1c6)]===0x1d*0xd7+-0x3*-0x1fd+-0x1e52||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x18eb8d(0x27d)](_0x218fd2)||!isAbsolute(_0x4fb340)&&!win32[_0x18eb8d(0x25c)](_0x4fb340)||_0x4fb340[_0x18eb8d(0x1ef)]('\x00')||_0x4fb340[_0x18eb8d(0x1ef)]('?')||_0x4fb340[_0x18eb8d(0x1ef)]('#'))throw new Error(_0x18eb8d(0x1cb));return _0x4fb340;}async function resolveAllowedFile(_0x757e5b,_0x5f58ea){const _0x3420f7=_0x67518d;if(!isAbsolute(_0x757e5b))throw new Error(_0x3420f7(0x1cb));const _0x2a15ec=await realpath(_0x757e5b)[_0x3420f7(0x221)](_0x183a69=>{const _0x43f0da=_0x3420f7;if(_0x183a69[_0x43f0da(0x1e3)]===_0x43f0da(0x260))throw new Error(_0x43f0da(0x29d));throw _0x183a69;}),_0x40455b=await Promise[_0x3420f7(0x269)](_0x5f58ea[_0x3420f7(0x275)](_0x419775=>realpath(_0x419775)));if(!isWithinAllowedRoot(_0x2a15ec,_0x40455b))throw new Error(_0x3420f7(0x1cb));const _0x2f07b0=await lstat(_0x2a15ec);if(!_0x2f07b0[_0x3420f7(0x1bf)]())throw new Error(_0x3420f7(0x1aa));return{'file':_0x2a15ec,'metadata':_0x2f07b0};}function isValidUtf8(_0x9a8fa9){const _0x1d2b6=_0x67518d;try{return new TextDecoder(_0x1d2b6(0x203),{'fatal':!![]})[_0x1d2b6(0x230)](_0x9a8fa9),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x4f6e58){return(_0x4f6e58&-0x10f1*-0x2+-0xb50+-0x26*0x93)===-0xb08+0x36+-0xa1*-0x12;}export async function searchWorkspaceFiles(_0x3bb75e,_0xeec753,_0x397e5e,_0x317d8b=SEARCH_RESULT_LIMIT,_0x2c41fa=![]){const _0xec686=_0x67518d,_0x194aaa=new WorkspaceFileIndex(_0x3bb75e);try{return await _0x194aaa[_0xec686(0x278)](_0xeec753,_0x397e5e,_0x317d8b,_0x2c41fa);}finally{_0x194aaa[_0xec686(0x1c0)]();}}async function resolveRegisteredWorkspaceRoot(_0x3e3c78){const _0x2a841e=_0x67518d,_0x1c7932=await realpath(_0x3e3c78);if(normalizeWorkspacePath(_0x1c7932)!==normalizeWorkspacePath(_0x3e3c78))throw new Error(_0x2a841e(0x1e9));return _0x1c7932;}async function resolveWorkspaceEntry(_0x2c3cbb,_0x7f59f0,_0x8c6669){const _0x4a00d4=await resolveRegisteredWorkspaceRoot(_0x2c3cbb);return resolveWorkspaceEntryFromCanonicalRoot(_0x4a00d4,_0x7f59f0,_0x8c6669);}function _0x4bb8(_0x4eb3cc,_0x4ed1f5){_0x4eb3cc=_0x4eb3cc-(-0xc5*-0x1+-0x223+0x4d*0xa);const _0x591490=_0x537c();let _0x4ec3b3=_0x591490[_0x4eb3cc];if(_0x4bb8['ecaKKI']===undefined){var _0x4d0195=function(_0x14ce7f){const _0xc7071a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1ae36c='',_0x389563='';for(let _0x1d2319=0x1*-0x21a7+0x963+0x2*0xc22,_0x3b6c41,_0x15b0ff,_0x29110d=-0x1*-0xd06+0x2423+0x347*-0xf;_0x15b0ff=_0x14ce7f['charAt'](_0x29110d++);~_0x15b0ff&&(_0x3b6c41=_0x1d2319%(0x12d+-0x1378+0x124f)?_0x3b6c41*(0x10be+-0x1*-0x1462+0x24e*-0x10)+_0x15b0ff:_0x15b0ff,_0x1d2319++%(-0x1*0x508+0x1416+0x785*-0x2))?_0x1ae36c+=String['fromCharCode'](0x2256+-0x1867*0x1+-0x8f0&_0x3b6c41>>(-(-0x398+-0x21d7*-0x1+-0x1e3d)*_0x1d2319&0x15ef+-0xc29+0x34*-0x30)):0x17f5*-0x1+-0x5bf+0x1*0x1db4){_0x15b0ff=_0xc7071a['indexOf'](_0x15b0ff);}for(let _0x4f75df=-0x1bc5+-0x2*0xcbf+-0x2d*-0x12f,_0x5a58b2=_0x1ae36c['length'];_0x4f75df<_0x5a58b2;_0x4f75df++){_0x389563+='%'+('00'+_0x1ae36c['charCodeAt'](_0x4f75df)['toString'](-0x1*-0x1841+-0xe2d+0x4*-0x281))['slice'](-(0x4*0x5b0+-0x1b95+0x4d7));}return decodeURIComponent(_0x389563);};_0x4bb8['YkgbPQ']=_0x4d0195,_0x4bb8['tvBYGw']={},_0x4bb8['ecaKKI']=!![];}const _0x4e769d=_0x591490[-0x3*-0xa1b+-0x25e5+-0x5*-0x184];_0x4bb8['EkcmCC']!==_0x4e769d&&(_0x4bb8['tvBYGw']={},_0x4bb8['EkcmCC']=_0x4e769d);const _0x20929a=_0x4bb8['tvBYGw'][_0x4eb3cc];return _0x20929a===undefined?(_0x4ec3b3=_0x4bb8['YkgbPQ'](_0x4ec3b3),_0x4bb8['tvBYGw'][_0x4eb3cc]=_0x4ec3b3):_0x4ec3b3=_0x20929a,_0x4ec3b3;}async function resolveWorkspaceEntryFromCanonicalRoot(_0x3c18d2,_0x36fbbf,_0xa992f7){const _0x490418=_0x67518d,_0x202efa=await resolveWorkspaceEntryMetadata(_0x3c18d2,_0x36fbbf);if(_0xa992f7?!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1cd)]():!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1bf)]()&&!_0x202efa[_0x490418(0x2b5)][_0x490418(0x1cd)]())throw new Error(_0xa992f7?_0x490418(0x1fa):_0x490418(0x1aa));return _0x202efa[_0x490418(0x21a)];}async function resolveWorkspaceEntryMetadata(_0x25b3bc,_0x55c0fd){const _0x42b9ff=_0x67518d;if(_0x55c0fd[_0x42b9ff(0x1ef)]('\x00')||_0x55c0fd[_0x42b9ff(0x1c6)]===-0x1a5*-0x7+-0x2f*-0xc7+-0x6*0x802||_0x55c0fd[_0x42b9ff(0x1b9)]('/')||_0x55c0fd[_0x42b9ff(0x1b9)]('\x5c'))throw new Error(_0x42b9ff(0x1cb));const _0xfbc209=_0x55c0fd[_0x42b9ff(0x254)]('\x5c','/');if(_0xfbc209[_0x42b9ff(0x1eb)]('/')[_0x42b9ff(0x252)](_0x3e3c54=>_0x3e3c54==='..'||_0x3e3c54===_0x42b9ff(0x2a6)))throw new Error(_0x42b9ff(0x1cb));let _0xcced74;try{_0xcced74=await realpath(resolve(_0x25b3bc,_0xfbc209));}catch(_0x485a92){if(_0x485a92[_0x42b9ff(0x1e3)]===_0x42b9ff(0x260))throw new Error(_0x42b9ff(0x29d));throw _0x485a92;}const _0x13c4e4=relative(_0x25b3bc,_0xcced74);if(isAbsolute(_0x13c4e4)||_0x13c4e4[_0x42b9ff(0x1b9)]('..')||_0x13c4e4==='..'||_0x13c4e4[_0x42b9ff(0x1b9)]('..'+sep))throw new Error(_0x42b9ff(0x1cb));const _0x2b40ef=await lstat(_0xcced74);return{'path':_0xcced74,'metadata':_0x2b40ef};}async function inspectWorkspaceIndexEntry(_0x2a1d96,_0x35f69e,_0xf958f5){const _0x42618a=_0x67518d;try{const _0x2a5743=await resolveWorkspaceEntryMetadata(_0x2a1d96,_0x35f69e);if(!_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1bf)]()&&!_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1cd)]())return undefined;const _0xd77873=relative(_0x2a1d96,_0x2a5743[_0x42618a(0x21a)])[_0x42618a(0x1eb)](sep)[_0x42618a(0x223)]('/');return _0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1cd)]()?{'path':_0xd77873,'name':_0xf958f5,'kind':_0x42618a(0x298),'size':null,'modifiedAt':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1e2)]}:{'path':_0xd77873,'name':_0xf958f5,'kind':_0x42618a(0x1ac),'size':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x21c)],'modifiedAt':_0x2a5743[_0x42618a(0x2b5)][_0x42618a(0x1e2)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x196062,_0x383f7d){const _0x36d621=_0x67518d;return Buffer[_0x36d621(0x29a)](JSON[_0x36d621(0x1a9)]({'path':_0x196062,'name':_0x383f7d}))[_0x36d621(0x1dd)](_0x36d621(0x288));}function decodeDirectoryCursor(_0x45371e,_0xa4e593){const _0x114a20=_0x67518d;if(_0x45371e===undefined)return undefined;try{const _0x123567=JSON[_0x114a20(0x283)](Buffer[_0x114a20(0x29a)](_0x45371e,_0x114a20(0x288))[_0x114a20(0x1dd)](_0x114a20(0x2be)));if(typeof _0x123567!==_0x114a20(0x1ec)||_0x123567===null||_0x123567[_0x114a20(0x21a)]!==_0xa4e593||typeof _0x123567[_0x114a20(0x209)]!==_0x114a20(0x1f4))throw new Error();return _0x123567[_0x114a20(0x209)];}catch{throw new Error(_0x114a20(0x1bc));}}function encodeSearchCursor(_0x4504ef,_0x4305b0){const _0x2c24f2=_0x67518d;return Buffer[_0x2c24f2(0x29a)](JSON[_0x2c24f2(0x1a9)]({'query':_0x4504ef,'path':_0x4305b0}))[_0x2c24f2(0x1dd)](_0x2c24f2(0x288));}function decodeSearchCursor(_0x24ce8f,_0x574477){const _0x8b4542=_0x67518d;if(_0x24ce8f===undefined)return undefined;try{const _0x1b8ea5=JSON[_0x8b4542(0x283)](Buffer[_0x8b4542(0x29a)](_0x24ce8f,_0x8b4542(0x288))[_0x8b4542(0x1dd)](_0x8b4542(0x2be)));if(typeof _0x1b8ea5!==_0x8b4542(0x1ec)||_0x1b8ea5===null||_0x1b8ea5[_0x8b4542(0x251)]!==_0x574477||typeof _0x1b8ea5[_0x8b4542(0x21a)]!==_0x8b4542(0x1f4))throw new Error();return _0x1b8ea5[_0x8b4542(0x21a)];}catch{throw new Error(_0x8b4542(0x1bc));}}export function normalizeWorkspacePath(_0x170cfd,_0x2d182b=_0x498f63()){const _0x237c64=_0x67518d;if(_0x170cfd[_0x237c64(0x1c6)]===-0x4ec+0xda*-0x1e+0x2*0xf3c||_0x170cfd[_0x237c64(0x1ef)]('\u0000'))throw new Error(_0x237c64(0x1a5));if(_0x2d182b===_0x237c64(0x2c6)){if(/^\\\\[?.]/[_0x237c64(0x27d)](_0x170cfd))throw new Error(_0x237c64(0x28f));const _0x40d8d6=win32[_0x237c64(0x285)](_0x170cfd[_0x237c64(0x254)]('/','\x5c'));if(!win32[_0x237c64(0x25c)](_0x40d8d6))throw new Error(_0x237c64(0x1ce));return _0x40d8d6[_0x237c64(0x1d2)](/\\+$/,'')[_0x237c64(0x1a7)]();}if(_0x2d182b!==_0x237c64(0x2a7))throw new Error(_0x237c64(0x27f));const _0x538449=posix[_0x237c64(0x285)](_0x170cfd);if(!posix[_0x237c64(0x25c)](_0x538449))throw new Error(_0x237c64(0x1ce));return _0x538449==='/'?_0x538449:_0x538449[_0x237c64(0x1d2)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1a29cd,_0x97f32b,_0x140ae2=_0x498f63()){const _0x2a8134=_0x67518d,_0x5405ea=normalizeWorkspacePath(_0x1a29cd,_0x140ae2),_0xdad8d3=_0x140ae2===_0x2a8134(0x2c6)?win32:posix;return _0x97f32b[_0x2a8134(0x252)](_0x375c02=>{const _0x368a0c=_0x2a8134,_0x2dc824=normalizeWorkspacePath(_0x375c02,_0x140ae2),_0x5835be=_0xdad8d3[_0x368a0c(0x2aa)](_0x2dc824,_0x5405ea);return _0x5835be===''||!_0x5835be[_0x368a0c(0x1b9)]('..')&&!_0xdad8d3[_0x368a0c(0x25c)](_0x5835be);});}export async function inspectWorkspace(_0x3a05cb,_0x8242ff){const _0x1c7358=_0x67518d,_0x361fb5=await realpath(_0x3a05cb),_0x18c5e5=await Promise[_0x1c7358(0x269)](_0x8242ff[_0x1c7358(0x275)](_0x51cb92=>realpath(_0x51cb92))),_0x4f75ae=await stat(_0x361fb5);if(!_0x4f75ae[_0x1c7358(0x1cd)]()||!isWithinAllowedRoot(_0x361fb5,_0x18c5e5))throw new Error(_0x1c7358(0x1e9));try{const _0x58168e=await readGitSummary(_0x361fb5);return{'path':_0x361fb5,'kind':_0x1c7358(0x215),'gitSummary':_0x58168e};}catch(_0xd1249a){if(_0xd1249a instanceof GitCommandError&&_0xd1249a[_0x1c7358(0x1e3)]===-0xe*0xef+-0xe5c+0x11e*0x19||isGitUnavailable(_0xd1249a))return{'path':_0x361fb5,'kind':_0x1c7358(0x298)};throw _0xd1249a;}}export async function readGitSummary(_0x5e4c72){const _0x402ee2=_0x67518d,_0x3e6882=(await runReadOnlyGit(_0x5e4c72,[_0x402ee2(0x240),_0x402ee2(0x1b2)]))[_0x402ee2(0x247)][_0x402ee2(0x25d)](),_0x3b76ed=await runReadOnlyGitAllowFailure(_0x5e4c72,[_0x402ee2(0x240),_0x402ee2(0x235),_0x402ee2(0x1c1)]),_0x11662d=await runReadOnlyGitAllowFailure(_0x5e4c72,[_0x402ee2(0x22d),_0x402ee2(0x22a),_0x402ee2(0x250),_0x402ee2(0x1c1)]),_0x4ee619={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x3b523a=await runReadOnlyGit(_0x5e4c72,[_0x402ee2(0x220),_0x402ee2(0x2a8)],_0x4ee619);return{'commonDir':_0x3e6882,'head':_0x3b76ed[_0x402ee2(0x1e3)]===-0x1e29*0x1+-0x98+0x1ec1?_0x3b76ed[_0x402ee2(0x247)][_0x402ee2(0x25d)]():'','branch':_0x11662d[_0x402ee2(0x1e3)]===-0xc61*0x1+0xa8*0x3b+0x1*-0x1a57?_0x11662d[_0x402ee2(0x247)][_0x402ee2(0x25d)]():null,'dirty':_0x3b523a[_0x402ee2(0x2a4)][_0x402ee2(0x1c6)]>-0x1*0x110b+0x507*-0x7+0x343c,'snapshot':summarizeText(_0x3b523a[_0x402ee2(0x247)])};}export function assertSafeGitRef(_0xd18e54){const _0x30ddb0=_0x67518d;if(!REF_PATTERN[_0x30ddb0(0x27d)](_0xd18e54))throw new Error(_0x30ddb0(0x1fb));}export async function readRestrictedDiff(_0x1f24fe,_0x5f0f24,_0x50c3b7){const _0x169b2e=_0x67518d;assertSafeGitRef(_0x5f0f24),assertSafeGitRef(_0x50c3b7);const _0x2d232e=await runReadOnlyGit(_0x1f24fe,[_0x169b2e(0x20c),_0x169b2e(0x1c8),_0x169b2e(0x20d),_0x5f0f24,_0x50c3b7]),_0x36a70f=_0x2d232e[_0x169b2e(0x2a4)][_0x169b2e(0x1ef)](0x1*0xa2b+-0x734*0x1+-0x2f7)||_0x2d232e[_0x169b2e(0x247)][_0x169b2e(0x1ef)](_0x169b2e(0x226));if(_0x36a70f)return{'binary':!![],'summary':_0x169b2e(0x1e4)+createHash(_0x169b2e(0x2a9))[_0x169b2e(0x200)](_0x2d232e[_0x169b2e(0x2a4)])[_0x169b2e(0x214)](_0x169b2e(0x26f))+_0x169b2e(0x282)+_0x2d232e[_0x169b2e(0x2a4)][_0x169b2e(0x1c6)],'truncated':_0x2d232e[_0x169b2e(0x23e)]};return{'binary':![],'text':_0x2d232e[_0x169b2e(0x247)],'truncated':_0x2d232e[_0x169b2e(0x23e)]};}function currentBranchFromStatusHeader(_0x11975b){const _0x5ab548=_0x67518d,_0x3fb951=_0x11975b[_0x5ab548(0x23f)](-0xb74+0x203c+-0x14c5);if(_0x3fb951[_0x5ab548(0x1b9)](_0x5ab548(0x1be)))return null;const _0x396f2c=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x5ab548(0x22e)](_0x3fb951);if(_0x396f2c!==null)return _0x396f2c[-0x2*0xc38+0x7*-0x18b+0x233e]??null;return _0x3fb951[_0x5ab548(0x1eb)](_0x5ab548(0x245))[-0x2d*0xbf+0x2*-0x83+0x2299]?.[_0x5ab548(0x1eb)]('\x20')[-0x1*-0x96d+0x1*0x2668+-0x4f*0x9b]??null;}export async function readCurrentChangesSummary(_0x2aa641){const _0x205e84=_0x67518d,_0x2a92a4=await runReadOnlyGit(_0x2aa641,[_0x205e84(0x220),_0x205e84(0x2a8),'-z',_0x205e84(0x26b),_0x205e84(0x248)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x2abd80=_0x2a92a4[_0x205e84(0x247)][_0x205e84(0x1eb)]('\x00'),_0x1ad2e7=_0x2abd80[_0x205e84(0x23c)]()??'',_0x2859c5=[];for(let _0xb96f22=0x30b*-0x3+-0x161e+-0x1f3f*-0x1;_0xb96f22<_0x2abd80[_0x205e84(0x1c6)];_0xb96f22+=-0x1947*-0x1+0x1*0x1982+-0x32c8){const _0x20391b=_0x2abd80[_0xb96f22];if(_0x20391b[_0x205e84(0x1c6)]<0x1dc5+0x1327+-0x30e8)continue;const _0x31ae38=_0x20391b[-0x1070+0x2c*0x3d+-0x7f*-0xc],_0x3993b0=_0x20391b[0x1e7d*0x1+-0x22d*-0x7+-0x2db7],_0x1759d3=_0x20391b[_0x205e84(0x23f)](-0x3d*-0x14+-0x7*-0x2fb+-0x199e);if(_0x31ae38==='?'&&_0x3993b0==='?'){_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x29b),'change':_0x205e84(0x297)});continue;}_0x31ae38!=='\x20'&&_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x20e),'change':gitChange(_0x31ae38)});_0x3993b0!=='\x20'&&_0x2859c5[_0x205e84(0x1f6)]({'path':_0x1759d3,'state':_0x205e84(0x26c),'change':gitChange(_0x3993b0)});if(_0x31ae38==='R'||_0x31ae38==='C'||_0x3993b0==='R'||_0x3993b0==='C')_0xb96f22+=-0x26a6+0x78e+0x1f19*0x1;}return{'branch':_0x1ad2e7[_0x205e84(0x1b9)](_0x205e84(0x2a0))?currentBranchFromStatusHeader(_0x1ad2e7):null,'changes':_0x2859c5};}export async function listInitializedSubmodulePaths(_0x24f712){const _0x441019=_0x67518d,_0x4de737=await runReadOnlyGit(_0x24f712,[_0x441019(0x1d0),_0x441019(0x220),_0x441019(0x219)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x4de737[_0x441019(0x247)][_0x441019(0x1eb)](/\r?\n/)[_0x441019(0x2b0)](_0x3dbf67=>{const _0xcdb049=_0x441019;if(_0x3dbf67[_0xcdb049(0x1c6)]<-0x3a*0x85+-0x1a48*0x1+0x354*0x11)return[];const _0x46c8f1=_0x3dbf67[0x114+-0x43*-0x43+-0x129d];if(_0x46c8f1==='-')return[];const _0x1b898c=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0xcdb049(0x22e)](_0x3dbf67),_0x474f07=_0x1b898c?.[0xd*0xf8+0x1540+-0x21d7]?.[_0xcdb049(0x254)]('\x5c','/');return _0x474f07===undefined||_0x474f07[_0xcdb049(0x1c6)]===0x3b*-0x9f+-0x22af+0x4754*0x1?[]:[_0x474f07];})[_0x441019(0x2c8)]((_0x3e70ba,_0x4a371b)=>_0x3e70ba[_0x441019(0x1f9)](_0x4a371b));}export async function resolveGitRepository(_0x4e5e23,_0x18d397,_0x3dce04){const _0x259fd1=_0x67518d,_0x55e69e=await realpath(_0x4e5e23);if(_0x18d397[_0x259fd1(0x1c6)]===0x1*0x1e19+-0x236c+0x553)return _0x55e69e;if(_0x18d397[_0x259fd1(0x1ef)]('\x00')||_0x18d397[_0x259fd1(0x1b9)]('/')||_0x18d397[_0x259fd1(0x1b9)]('\x5c')||_0x18d397[_0x259fd1(0x1eb)]('/')[_0x259fd1(0x252)](_0x1039e0=>_0x1039e0[_0x259fd1(0x1c6)]===-0x2*0x7ce+-0x4*0x243+0x18a8||_0x1039e0==='.'||_0x1039e0==='..'))throw new Error(_0x259fd1(0x218));try{const _0x3fe054=resolve(_0x55e69e,_0x18d397),_0x32541c=await realpath(_0x3fe054);if(normalizeWorkspacePath(_0x3fe054)!==normalizeWorkspacePath(_0x32541c)||!isWithinAllowedRoot(_0x32541c,[_0x55e69e]))throw new Error(_0x259fd1(0x2b6));if(_0x3dce04!==undefined){if(!_0x3dce04[_0x259fd1(0x1ef)](_0x18d397))throw new Error(_0x259fd1(0x2b6));return _0x32541c;}return await assertGitSuperprojectChain(_0x55e69e,_0x32541c),_0x32541c;}catch{throw new Error(_0x259fd1(0x218));}}async function assertGitSuperprojectChain(_0x649d3a,_0x49cc22){const _0xcbc349=_0x67518d,_0x5267a2=normalizeWorkspacePath(_0x649d3a);let _0x1ae0f5=_0x49cc22;const _0x274645=new Set();for(let _0x95888c=-0x20e8+-0x165a*0x1+0x3742;_0x95888c<-0xd92+-0xbf1*0x3+0x31a5;_0x95888c+=0x20e+0xe7c+0x33*-0x53){const _0x59b2a8=normalizeWorkspacePath(_0x1ae0f5);if(_0x59b2a8===_0x5267a2)return;if(_0x274645[_0xcbc349(0x205)](_0x59b2a8))throw new Error(_0xcbc349(0x2b6));_0x274645[_0xcbc349(0x261)](_0x59b2a8);const _0x5d5bf3=await runReadOnlyGit(_0x1ae0f5,[_0xcbc349(0x240),_0xcbc349(0x279),_0xcbc349(0x1da)]),[_0x293760,_0x10e9d9]=_0x5d5bf3[_0xcbc349(0x247)][_0xcbc349(0x1eb)](/\r?\n/);if(_0x293760===undefined||_0x10e9d9===undefined||_0x10e9d9[_0xcbc349(0x1c6)]===0x119*0xa+0x1c09*0x1+0x2703*-0x1)throw new Error(_0xcbc349(0x2b6));const _0x560888=await realpath(_0x293760),_0x480729=await realpath(_0x10e9d9);if(normalizeWorkspacePath(_0x560888)!==_0x59b2a8||normalizeWorkspacePath(_0x480729)===_0x59b2a8||!isWithinAllowedRoot(_0x480729,[_0x649d3a])||!isWithinAllowedRoot(_0x1ae0f5,[_0x480729]))throw new Error(_0xcbc349(0x2b6));_0x1ae0f5=_0x480729;}throw new Error(_0xcbc349(0x2b6));}export async function listGitHistoryRefs(_0x5768db){const _0x2c749f=_0x67518d,_0x41231b=await runReadOnlyGit(_0x5768db,[_0x2c749f(0x299),_0x2c749f(0x289),_0x2c749f(0x29c),_0x2c749f(0x222)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x41231b[_0x2c749f(0x247)][_0x2c749f(0x1eb)](/\r?\n/)[_0x2c749f(0x2b0)](_0x3c0c0f=>{const _0xd733eb=_0x2c749f,[_0x3389f6,_0x48aad8,_0x3d8a28,_0x129f9d,_0x5386d2]=_0x3c0c0f[_0xd733eb(0x1eb)]('\x09');if(_0x3389f6===undefined||_0x48aad8===undefined||_0x3d8a28===undefined||_0x5386d2===undefined||_0x5386d2[_0xd733eb(0x1c6)]>-0x8*-0x3f2+0x252+0x2*-0x10f1||!/^[0-9a-f]{40,64}$/[_0xd733eb(0x27d)](_0x3d8a28))return[];const _0x3ef399=_0x3389f6[_0xd733eb(0x1b9)](_0xd733eb(0x258))?_0xd733eb(0x204):_0x3389f6[_0xd733eb(0x1b9)](_0xd733eb(0x2ad))?_0xd733eb(0x24b):undefined;return _0x3ef399===undefined?[]:[{'name':_0x3389f6,'displayName':_0x48aad8,'kind':_0x3ef399,'hash':_0x3d8a28,'current':_0x129f9d==='*'}];})[_0x2c749f(0x2c8)]((_0x59e8a1,_0x412b1a)=>_0x59e8a1[_0x2c749f(0x1f8)][_0x2c749f(0x1f9)](_0x412b1a[_0x2c749f(0x1f8)])||_0x59e8a1[_0x2c749f(0x281)][_0x2c749f(0x1f9)](_0x412b1a[_0x2c749f(0x281)]));}function selectedHistoryRefs(_0xa0b927,_0x3f1e1b){const _0x377dbf=_0x67518d;if(_0x3f1e1b===undefined||_0x3f1e1b[_0x377dbf(0x1c6)]===-0x1*0x1199+-0x25a0+0x1*0x3739)return _0xa0b927;const _0xfff8a4=[...new Set(_0x3f1e1b)],_0x37b18a=_0xfff8a4[_0x377dbf(0x275)](_0xee1e93=>_0xa0b927[_0x377dbf(0x1ea)](_0x47e4cc=>_0x47e4cc[_0x377dbf(0x209)]===_0xee1e93));if(_0x37b18a[_0x377dbf(0x252)](_0x4adaf9=>_0x4adaf9===undefined))throw new Error(_0x377dbf(0x1d5));return _0x37b18a;}function historyCursor(_0xc20a4c,_0x182600){const _0x2d3026=_0x67518d;return Buffer[_0x2d3026(0x29a)](JSON[_0x2d3026(0x1a9)]({'offset':_0xc20a4c,'fingerprint':_0x182600}))[_0x2d3026(0x1dd)](_0x2d3026(0x288));}function parseHistoryCursor(_0xf99dc3,_0x39051f){const _0x250379=_0x67518d;if(_0xf99dc3===undefined)return-0x1872+0x7f7*-0x2+0x2860;try{const _0x51f751=JSON[_0x250379(0x283)](Buffer[_0x250379(0x29a)](_0xf99dc3,_0x250379(0x288))[_0x250379(0x1dd)](_0x250379(0x2be)));if(!Number[_0x250379(0x259)](_0x51f751[_0x250379(0x1f2)])||_0x51f751[_0x250379(0x1f2)]<-0xccf+-0x1d6b+0x2a3a||_0x51f751[_0x250379(0x2b2)]!==_0x39051f)throw new Error(_0x250379(0x2b6));return _0x51f751[_0x250379(0x1f2)];}catch{throw new Error(_0x250379(0x1c4));}}export async function readGitHistory(_0x2e217e,_0x503de7){const _0x509e6a=_0x67518d,_0x4248f9=await listGitHistoryRefs(_0x2e217e),_0x741b0e=selectedHistoryRefs(_0x4248f9,_0x503de7[_0x509e6a(0x239)]);if(_0x741b0e[_0x509e6a(0x1c6)]===-0x1*-0x1b9b+-0x1*0x17ef+-0x3ac)return{'commits':[],'nextCursor':null};const _0x4154c3=_0x503de7[_0x509e6a(0x1b7)]??-0x891+-0x177+0xa3a;if(!Number[_0x509e6a(0x259)](_0x4154c3)||_0x4154c3<-0x85+0x1ea2+-0x29*0xbc||_0x4154c3>0x1691*-0x1+-0x153*-0x5+0x1056)throw new Error(_0x509e6a(0x1dc));const _0xfbb0e9=_0x741b0e[_0x509e6a(0x275)](_0x5b1c41=>_0x5b1c41[_0x509e6a(0x209)])[_0x509e6a(0x2c8)](),_0x340274=_0x503de7[_0x509e6a(0x239)]===undefined||_0x503de7[_0x509e6a(0x239)][_0x509e6a(0x1c6)]===-0x1488+-0xd4d+0x21d5||_0x741b0e[_0x509e6a(0x1c6)]===_0x4248f9[_0x509e6a(0x1c6)]&&_0x741b0e[_0x509e6a(0x293)](_0x441fcd=>_0x4248f9[_0x509e6a(0x252)](_0x2def2f=>_0x2def2f[_0x509e6a(0x209)]===_0x441fcd[_0x509e6a(0x209)])),_0x501ef6=_0x340274?[_0x509e6a(0x2bc),_0x509e6a(0x210)]:_0xfbb0e9,_0x2be41e=createHash(_0x509e6a(0x2a9))[_0x509e6a(0x200)](_0x741b0e[_0x509e6a(0x275)](_0x2469cb=>_0x2469cb[_0x509e6a(0x209)]+'\x00'+_0x2469cb[_0x509e6a(0x1c2)])[_0x509e6a(0x2c8)]()[_0x509e6a(0x223)]('\x00'))[_0x509e6a(0x214)](_0x509e6a(0x26f)),_0x150331=parseHistoryCursor(_0x503de7[_0x509e6a(0x2c3)],_0x2be41e),_0x37967f=await runReadOnlyGit(_0x2e217e,[_0x509e6a(0x225),_0x509e6a(0x2ba),_0x509e6a(0x2ae),_0x509e6a(0x1bb)+_0x150331,_0x509e6a(0x1e0)+(_0x4154c3+(-0x19a0+0x29f+-0x1f*-0xbe)),'-z',_0x509e6a(0x2c1),..._0x501ef6,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x92751=new Map();for(const _0x19cc42 of _0x4248f9){const _0x1400ee=_0x92751[_0x509e6a(0x244)](_0x19cc42[_0x509e6a(0x1c2)])??[];_0x1400ee[_0x509e6a(0x1f6)](_0x19cc42[_0x509e6a(0x281)]),_0x92751[_0x509e6a(0x1b0)](_0x19cc42[_0x509e6a(0x1c2)],_0x1400ee);}const _0x452de7=_0x37967f[_0x509e6a(0x247)][_0x509e6a(0x1eb)]('\x00'),_0x5d6de6=[];for(let _0x1426a9=0x499*-0x7+-0x837*0x3+0x38d4;_0x1426a9+(-0x2*-0x73a+-0x1*-0x1312+-0x2181)<_0x452de7[_0x509e6a(0x1c6)];_0x1426a9+=0x4*0x8ea+-0x2681+0xf*0x31){const [_0x3b9f0a,_0x47e154='',_0x44e730='',_0x1bee6f='',_0xde271a='0',_0x2a53c1='']=_0x452de7[_0x509e6a(0x23f)](_0x1426a9,_0x1426a9+(0x2*-0x3e1+0x1810+-0x1048));if(_0x3b9f0a===undefined||!/^[0-9a-f]{40,64}$/[_0x509e6a(0x27d)](_0x3b9f0a))continue;_0x5d6de6[_0x509e6a(0x1f6)]({'hash':_0x3b9f0a,'parents':_0x47e154[_0x509e6a(0x1c6)]===-0x26b6+-0x19f8+0x22*0x1e7?[]:_0x47e154[_0x509e6a(0x1eb)]('\x20'),'authorName':_0x44e730,'authorEmail':_0x1bee6f,'committedAt':Number(_0xde271a)*(-0x25+0x1545+-0x1138),'subject':_0x2a53c1,'refs':_0x92751[_0x509e6a(0x244)](_0x3b9f0a)??[]});}const _0x5a3159=_0x5d6de6[_0x509e6a(0x1c6)]>_0x4154c3;return{'commits':_0x5d6de6[_0x509e6a(0x23f)](-0x1c9*0x7+0x3*0xb67+-0x15b6,_0x4154c3),'nextCursor':_0x5a3159?historyCursor(_0x150331+_0x4154c3,_0x2be41e):null};}async function assertHistoryCommitReachable(_0x206caf,_0x60b35c,_0x531174){const _0x662538=_0x67518d;if(!/^[0-9a-f]{40,64}$/[_0x662538(0x27d)](_0x60b35c))throw new Error(_0x662538(0x1e1));const _0x10c2d2=selectedHistoryRefs(await listGitHistoryRefs(_0x206caf),_0x531174);for(const _0x3cbd8f of _0x10c2d2){const _0x4b69b1=await runReadOnlyGitAllowFailure(_0x206caf,[_0x662538(0x270),_0x662538(0x21d),_0x60b35c,_0x3cbd8f[_0x662538(0x209)]]);if(_0x4b69b1[_0x662538(0x1e3)]===0x24ca+0x359+0x1*-0x2823)return;}throw new Error(_0x662538(0x1e1));}export async function readGitHistoryFiles(_0x18a4df,_0xe5d54a,_0x1765c3){const _0x22be58=_0x67518d;await assertHistoryCommitReachable(_0x18a4df,_0xe5d54a,_0x1765c3);const _0x548a20=await runReadOnlyGit(_0x18a4df,[_0x22be58(0x1ba),_0x22be58(0x1ee),_0x22be58(0x217),_0x22be58(0x255),'-r','-z','-M','-C',_0x22be58(0x243),_0xe5d54a],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x5035aa=_0x548a20[_0x22be58(0x247)][_0x22be58(0x1eb)]('\x00'),_0x282ec5=[];for(let _0x1abcb9=-0x291*0x9+-0x111d*-0x2+-0xb21*0x1;_0x1abcb9<_0x5035aa[_0x22be58(0x1c6)];_0x1abcb9+=-0x1*0x18ad+0x2d+0x11*0x171){const _0x309a67=_0x5035aa[_0x1abcb9];if(_0x309a67===undefined||_0x309a67[_0x22be58(0x1c6)]===-0xedb*0x2+0x1c1b*-0x1+0x39d1)continue;const _0x3a847e=_0x309a67[-0x1*-0x1d1d+0x6*-0x1e1+0x1*-0x11d7]??'M';if(_0x3a847e==='R'||_0x3a847e==='C'){const _0x26411c=_0x5035aa[_0x1abcb9+(-0x1*0x1897+0x2*0x90f+0x33d*0x2)],_0x4aba5a=_0x5035aa[_0x1abcb9+(0xf*-0x1+0x2701+-0x26f0)];if(_0x26411c!==undefined&&_0x4aba5a!==undefined)_0x282ec5[_0x22be58(0x1f6)]({'path':_0x4aba5a,'previousPath':_0x26411c,'change':gitChange(_0x3a847e)});_0x1abcb9+=0x13f6+0x10*-0xb4+-0x8b4;}else{const _0x57376f=_0x5035aa[_0x1abcb9+(0x1483+0x149*0x1c+-0x387e)];if(_0x57376f!==undefined)_0x282ec5[_0x22be58(0x1f6)]({'path':_0x57376f,'change':gitChange(_0x3a847e)});_0x1abcb9+=0x157*-0x4+-0x12e7+0x1844;}}return _0x282ec5;}export async function readGitHistoryFileDiff(_0x1a96fb,_0x2e289c,_0x2ebf56,_0x54dc6c,_0x2c6ab6){const _0x13cfd6=_0x67518d;await assertHistoryCommitReachable(_0x1a96fb,_0x2e289c,_0x54dc6c);const _0x30ef1a=safeGitWorkspacePath(_0x2ebf56),_0x342522=_0x2c6ab6===undefined?undefined:safeGitWorkspacePath(_0x2c6ab6),_0x6d9967=await runReadOnlyGit(_0x1a96fb,[_0x13cfd6(0x25b),_0x13cfd6(0x21f),_0x13cfd6(0x217),_0x13cfd6(0x1c8),_0x13cfd6(0x20d),_0x2e289c,'--',_0x13cfd6(0x262)+_0x30ef1a,..._0x342522===undefined||_0x342522===_0x30ef1a?[]:[_0x13cfd6(0x262)+_0x342522]]),_0x3c880d=_0x6d9967[_0x13cfd6(0x2a4)][_0x13cfd6(0x1ef)](0x1838+0x13*-0x3+-0x17ff)||_0x6d9967[_0x13cfd6(0x247)][_0x13cfd6(0x1ef)](_0x13cfd6(0x226));if(_0x3c880d)return{'binary':!![],'summary':_0x13cfd6(0x1e4)+createHash(_0x13cfd6(0x2a9))[_0x13cfd6(0x200)](_0x6d9967[_0x13cfd6(0x2a4)])[_0x13cfd6(0x214)](_0x13cfd6(0x26f))+_0x13cfd6(0x282)+_0x6d9967[_0x13cfd6(0x2a4)][_0x13cfd6(0x1c6)],'truncated':_0x6d9967[_0x13cfd6(0x23e)]};return{'binary':![],'text':_0x6d9967[_0x13cfd6(0x247)],'truncated':_0x6d9967[_0x13cfd6(0x23e)]};}export async function readGitHistoryFileContentRange(_0x17440e,_0x511951,_0x579a2a,_0x487d47,_0x3d61d5,_0x40320b){const _0x521e53=_0x67518d;if(!Number[_0x521e53(0x24c)](_0x487d47)||_0x487d47<-0x11b*-0x1f+0x20ea+-0x75*0x93||!Number[_0x521e53(0x24c)](_0x3d61d5)||_0x3d61d5<0x1b6e+-0x186f+-0x2fe||_0x3d61d5>(-0x1142*0x1+-0xc3*-0x2d+-0x10f1)*(0x3*-0xada+0x14*0x116+0x3*0x4f2)*(-0x1ae8+0x19b5+0x533)||_0x487d47+_0x3d61d5>(0xe57+0x1afd+-0x2940)*(-0x170c+-0x74a+0x2256)*(-0x1*-0xd91+-0x1fbd*0x1+0x2*0xb16))throw new Error(_0x521e53(0x1a4));await assertHistoryCommitReachable(_0x17440e,_0x511951,_0x40320b);const _0xb65682=safeGitWorkspacePath(_0x579a2a),_0x553234=_0x511951+':'+_0xb65682,_0x1d32a3=await runReadOnlyGit(_0x17440e,[_0x521e53(0x206),'-s',_0x553234]),_0x149243=Number(_0x1d32a3[_0x521e53(0x247)][_0x521e53(0x25d)]());if(!Number[_0x521e53(0x24c)](_0x149243)||_0x149243<0xc90*-0x1+-0x1b9c+0x6b2*0x6||_0x487d47>_0x149243)throw new Error(_0x521e53(0x1a4));if(_0x487d47===_0x149243)return{'path':_0xb65682,'size':_0x149243,'offset':_0x487d47,'contentBase64':'','nextOffset':null};const _0x29bbaa=await runReadOnlyGitAllowFailure(_0x17440e,[_0x521e53(0x206),_0x521e53(0x2a1),_0x553234],{'outputLimit':_0x487d47+_0x3d61d5,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0x29bbaa[_0x521e53(0x1e3)]!==-0x2*0x1072+0xfb6+0x112e)throw new GitCommandError(_0x29bbaa[_0x521e53(0x1e3)],_0x29bbaa[_0x521e53(0x1d7)]);const _0x4c2634=_0x29bbaa[_0x521e53(0x2a4)][_0x521e53(0x227)](_0x487d47,Math[_0x521e53(0x1d6)](_0x149243,_0x487d47+_0x3d61d5)),_0x2be114=_0x487d47+_0x4c2634[_0x521e53(0x1c6)];return{'path':_0xb65682,'size':_0x149243,'offset':_0x487d47,'contentBase64':_0x4c2634[_0x521e53(0x1dd)](_0x521e53(0x287)),'nextOffset':_0x2be114<_0x149243?_0x2be114:null};}export async function readCurrentChanges(_0x1fe211){const _0x1f1fec=_0x67518d;return(await readCurrentChangesSummary(_0x1fe211))[_0x1f1fec(0x1d4)];}export async function readCurrentChangeDiff(_0x1f0022,_0x4c9a57){const _0x124335=_0x67518d,_0x10f0d4=safeGitWorkspacePath(_0x4c9a57);await assertCurrentChangePathAccessible(_0x1f0022,_0x10f0d4);const _0x40b14f=await readCurrentChangeGitDiff(_0x1f0022,_0x10f0d4),_0x1cea65=await readWorkingTreeText(_0x1f0022,_0x10f0d4),_0x44f935=_0x40b14f[_0x124335(0x2a4)][_0x124335(0x1ef)](-0x103f+0x2263+-0x1224)||_0x40b14f[_0x124335(0x247)][_0x124335(0x1ef)](_0x124335(0x226))||_0x1cea65?.[_0x124335(0x265)]===!![];if(_0x44f935)return{'binary':!![],'summary':_0x124335(0x1e4)+createHash(_0x124335(0x2a9))[_0x124335(0x200)](_0x40b14f[_0x124335(0x2a4)])[_0x124335(0x214)](_0x124335(0x26f))+_0x124335(0x282)+_0x40b14f[_0x124335(0x2a4)][_0x124335(0x1c6)],'truncated':_0x40b14f[_0x124335(0x23e)]||_0x1cea65?.[_0x124335(0x23e)]===!![]};return{'binary':![],'text':_0x40b14f[_0x124335(0x247)],'truncated':_0x40b14f[_0x124335(0x23e)]||_0x1cea65?.[_0x124335(0x23e)]===!![],'afterText':_0x1cea65?.[_0x124335(0x247)]??'',..._0x1cea65===undefined?{}:{'afterTruncated':_0x1cea65[_0x124335(0x23e)]}};}async function readCurrentChangeGitDiff(_0xc2cae4,_0x46a47c){const _0x2d4950=_0x67518d,_0x41978b=await runReadOnlyGit(_0xc2cae4,[_0x2d4950(0x1d9),_0x2d4950(0x2ac),_0x2d4950(0x1cc),'-z','--',_0x2d4950(0x262)+_0x46a47c]);if(_0x41978b[_0x2d4950(0x247)][_0x2d4950(0x1eb)]('\x00')[_0x2d4950(0x1ef)](_0x46a47c)){const _0x12f8e4=await runReadOnlyGitAllowFailure(_0xc2cae4,[_0x2d4950(0x20c),_0x2d4950(0x296),_0x2d4950(0x1c8),_0x2d4950(0x20d),'--',_0x2d4950(0x1c7),_0x46a47c]);if(_0x12f8e4[_0x2d4950(0x1e3)]!==0x1657+-0x49*0x62+0x59b&&_0x12f8e4[_0x2d4950(0x1e3)]!==0x22d5+-0x21fc+-0xd8)throw new GitCommandError(_0x12f8e4[_0x2d4950(0x1e3)],_0x12f8e4[_0x2d4950(0x1d7)]);return _0x12f8e4;}return runReadOnlyGit(_0xc2cae4,[_0x2d4950(0x20c),_0x2d4950(0x1c8),_0x2d4950(0x20d),_0x2d4950(0x1c1),'--',_0x2d4950(0x262)+_0x46a47c]);}export async function isWorkspaceChangeVisible(_0x487893,_0x3676fd){const _0x11a7fa=_0x67518d;try{return await assertCurrentChangePathAccessible(_0x487893,safeGitWorkspacePath(_0x3676fd)),!![];}catch(_0x5e49d9){if(_0x5e49d9 instanceof Error&&(_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x1cb)||_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x29d)||_0x5e49d9[_0x11a7fa(0x26a)]===_0x11a7fa(0x1aa)))return![];throw _0x5e49d9;}}async function assertCurrentChangePathAccessible(_0x3e3b64,_0x13fe90){const _0x3500dc=_0x67518d,_0x209817=await realpath(_0x3e3b64),_0x26fb07=resolve(_0x209817,_0x13fe90),_0x52253a=await lstat(_0x26fb07)[_0x3500dc(0x221)](_0x1f114f=>{const _0x5c2cec=_0x3500dc;if(_0x1f114f[_0x5c2cec(0x1e3)]===_0x5c2cec(0x260))return undefined;throw _0x1f114f;});if(_0x52253a===undefined)return;await resolveWorkspaceEntry(_0x209817,_0x13fe90,![]);}async function readWorkingTreeText(_0x5564fe,_0x221146){const _0x12739f=_0x67518d,_0x194455=await realpath(_0x5564fe);let _0x2baab3;try{_0x2baab3=await resolveWorkspaceEntry(_0x194455,_0x221146,![]);}catch(_0x3b78e0){if(_0x3b78e0 instanceof Error&&_0x3b78e0[_0x12739f(0x26a)]===_0x12739f(0x29d))return undefined;throw _0x3b78e0;}const _0x27513a=await lstat(_0x2baab3);if(!_0x27513a[_0x12739f(0x1bf)]())return undefined;const _0x4d6b4f=await readFile(_0x2baab3);return diffTextFromBuffer(_0x4d6b4f,_0x4d6b4f[_0x12739f(0x1c6)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x36445e,_0x14eb25){const _0x263870=_0x67518d;if(_0x36445e[_0x263870(0x1ef)](0x2392+-0x2706+0x374)||!isValidUtf8(_0x36445e))return{'binary':!![],'truncated':_0x14eb25};let _0x3bf7b7=Math[_0x263870(0x1d6)](_0x36445e[_0x263870(0x1c6)],GIT_OUTPUT_LIMIT);while(_0x3bf7b7>0x3*-0x89b+0x708+0x2af*0x7&&_0x3bf7b7<_0x36445e[_0x263870(0x1c6)]&&isUtf8ContinuationByte(_0x36445e[_0x3bf7b7]))_0x3bf7b7-=-0x1dd2+0x662+0x1771;return{'binary':![],'text':_0x36445e[_0x263870(0x227)](-0xadc+-0x1*-0x5e9+0x4f3,_0x3bf7b7)[_0x263870(0x1dd)](_0x263870(0x2be)),'truncated':_0x14eb25};}function _0x537c(){const _0x359b6c=['lM1HCI1LzgL0lq','A2LSBa','Agv4','BwvYz2uTyMfZzq','BgfZDeLUzgv4t2y','uKvoqu1fra','rKLmrv9ut09Ftefsr0u','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','BwfW','kIOVlM51EhqVkIO','C2LUA0rVD24','C2vHCMnO','ls1ZAg93lxrVCgXLDMvS','kIOVlNzLBNyVkIO','BM93','r0Lux0nptu1btKrFrKfjteve','DgvZDa','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','zMLUzeLUzgv4','zgLZCgXHEu5HBwu','igj5DgvZpq','CgfYC2u','Dg9mB2nHBgvmB3DLCKnHC2u','BM9YBwfSAxPL','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','yMfZzty0','yMfZzty0DxjS','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','CMvMCMvZAeLUqMfJA2DYB3vUza','Dw5Yzwy','kIOVBM9Kzv9TB2r1BgvZlYOQ','kIOVzgLZDc8QkG','q09qsuve','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','Dg9vChbLCKnHC2u','Bwf4','Aw5KzxHpzG','zxzLCNK','rKLmrv9ot1rFvevyva','pZ8G','ls1UBY1PBMrLEa','qureruq','reLsrunut1jz','zM9YlwvHy2GTCMvM','zNjVBq','vu5uuKfds0ve','CMvMCY9OzwfKCW','rKLmrv9ot1rFrK9vtKq','kIOVDgvZDc9YDw5ZlYOQ','zgvZDgLUyxrPB24','iYmG','yMXVyG','y29UDgvUDenHBMrPzgf0zxm','kIOVlMnHy2HLlYOQ','B3v0Chv0','BgLTAxrZ','lMDPDa','BgLUDxG','ls1WB3jJzwXHAw49DJe','C2HHmJu2','CMvSyxrPDMu','kIOVlNLHCM4VkIO','ls1VDgHLCNm','CMvMCY9Yzw1VDgvZlW','ls1KyxrLlw9YzgvY','ls13B3jRDhjLzq','zMXHDe1HCa','kIOVyMLUlYOQ','zMLUz2vYChjPBNq','kIOVlNn2zwX0zs1RAxqVkIO','kIOVDMvUzg9YlYOQ','Bwv0ywrHDge','Aw52ywXPza','nJaXndKYzfzVyxDu','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','y29Uy2f0','ls10B3bVlw9YzgvY','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','ls1ICMfUy2HLCW','tu9esuzjruq','DxrMoa','zxjYB3i','D29YA3nWywnLuM9VDa','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','kIOVx19WEwnHy2HLx18VkIO','y3vYC29Y','Dg91y2G','CMvIDwLSza','D2LUmZi','yNL0zuXLBMD0Aa','C29YDa','rKLmrv9squ5hrv9jtLzbteLe','v09ss1nqqunfx1bbveHFsu5wquXjra','revmrvrfra','Dg9mB3DLCKnHC2u','DMfSDwvZ','C3rYAw5NAwz5','rKLmrv9ot1rFuKvhvuXbuG','B25Jzq','rKLmrq','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','C3rKB3v0','y2fWywnPDhK','C2v0','kIOVy292zxjHz2uVkIO','ls1NAxqTy29TBw9UlwrPCG','rKLmrv9xuKLurv9dt05gteLdva','su5wquXjrf9oqu1f','lNbHCNq','mti1ntyWEejWBxzN','BgLTAxq','q1jfqvrfx0rjuKvdve9swq','C3rHCNrZv2L0Aa','zgLMzI10CMvL','ls1ZA2LWpq','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','zw50CMLLCW','sevbrca','AxngAwXL','zgLZCg9Zzq','sevbra','AgfZAa','kIOVlNbUCg0VkIO','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','mtK2otyWodznrNLNv1O','BgvUz3rO','l2rLDI9UDwXS','ls1UBY1LEhqTzgLMzG','kIOVB3v0lYOQ','ywn0Aw9U','rKLmrv9qqvrix0vtq0fqrq','ls1LEgnSDwrLlxn0yw5KyxjK','AxneAxjLy3rVCNK','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','zMLSzxmUzxHJBhvKzq','C3vIBw9KDwXL','rKLmrv9btfjfqurzx0vysvnuuW','CMvWBgfJzq','kIOVlMfUz3vSyxiVkIO','y2HHBMDLCW','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','BwLU','C3rKzxjY','CMvMCMvZAgvKqxq','BhmTzMLSzxm','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','kIOVlMDYywrSzs8QkG','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','Dg9tDhjPBMC','C2vHCMnOlMv4y2X1zgu','kIOVlM5LEhqVkIO','ls1TyxGTy291BNq9','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','BxrPBwvnCW','y29Kzq','yMLUyxj5igrPzMyGC2HHmJu2pq','kIOVDMvUDI8QkG','q1jfqvrfx0zjteu','zgf0yq','AwDUB3jL','v09ss1nqqunfx05pvf9bteXpv0ve','zMLUza','C3bSAxq','B2jQzwn0','ls1ZDgfNzwq','ls1YB290','Aw5JBhvKzxm','AxntEw1IB2XPy0XPBMS','rvHju1rtx0rjuKvdve9swq','B2zMC2v0','mZyWmduZnfHAsxvJua','C3rYAw5N','AwrSzvr0Be1Z','ChvZAa','zw50CNK','A2LUza','Bg9JywXLq29TCgfYzq','rKLmrv9ot1rFreLsrunut1jz','r0Lux1jfrL9jtLzbteLe','CMvZDg9Yzq','uKvbrfK','Bg9HzgLUzW','CMvHza','DxbKyxrL','mJe4nMHmuLzzrq','CgLWzq','DxrMltG','te9dquW','AgfZ','y2f0lwzPBgu','zw5ZDxjLtg9HzgvK','kIOVDgfYz2v0lYOQ','BMfTzq','C29YDgvK','zMLSDgvY','zgLMzG','ls1UBY10zxH0y29UDG','u1rbr0ve','mtC4mZyWAK9fz0f5','ls1Yzw1VDgvZ','kIOVlNbHCMnLBc1JywnOzs8QkG','Bw9Kzq','ywXSB2nvBNnHzMu','zgLNzxn0','r0Lux1DpuKTtuefdrq','kIOVlMDPDc8QkG','ls1MAxjZDc1WyxjLBNq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','ls1Yzwn1CNnPDMu','Cgf0Aa','DgLTzw91De1Z','C2L6zq','ls1PCY1HBMnLC3rVCG','z2L0','ls1MB3jTyxq9','C3rHDhvZ','y2f0y2G','CMvMCY9Yzw1VDgvZ','AM9PBG','zMLUywXSEq','Bg9N','qMLUyxj5igzPBgvZia','C3vIyxjYyxK','kIOVB2jQlYOQ','CMvMCMvZAef0DgvTChrLzef0','ls1XDwLLDa','B3v0Chv0tgLTAxq','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','C3LTyM9SAwmTCMvM','zxHLyW','C3rHBgu','zgvJB2rL','C2nVCMu','y2XVC2u','mJrXtxrVCwe','lMDPDc8','ls12zxjPzNK','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','u0Lhs0Lmta','zxHWAxj5vgLTzxi','CMvMCW','CMvHze9UBhK','kIOVyNvPBgqVkIO','C2HPzNq','rKLmrv9srvzju0LptL9jtLzbteLe','Dhj1BMnHDgvK','C2XPy2u','CMv2lxbHCNnL','CM9VDa','zNjLC2HUzxnZvhrStxm','ls1Uyw1Llxn0yxr1CW','z2v0','lI4U','odaYmZyWBfHgteHg','Dgv4Da','ls11BNrYywnRzwqTzMLSzxm9ywXS','ruvysvnu','DgHLBG','uKvnt1rf','AxntywzLsw50zwDLCG','kIOVlNr1CMjVlYOQ','CgXHDgzVCM0','otm5sxHtCeXT','ls1ZAg9YDa','CxvLCNK','C29Tzq','revmrvrf','CMvWBgfJzufSBa','ls1UBY1JB21TAxqTAwq','ls1ZB3vYy2u9sevbra','vfLqrv9dsefor0ve','CMvMCY9OzwfKCY8','AxnjBNrLz2vY','rvHju1rtx0zjteu','C2HVDW','AxnbyNnVBhv0zq','DhjPBq','lY5Flq','lM1HCI11CgXVywqT','ru5pru5u','ywrK','oIHSAxrLCMfSkq','CgLK','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','yMLUyxj5','zw50CNLmAw1PDa','zMXVB3i','yNvIyMXLvxa','ywXS','BwvZC2fNzq','ls1ICMfUy2G','vu5tvefhruq'];_0x537c=function(){return _0x359b6c;};return _0x537c();}export async function restoreCurrentChange(_0x4354b7,_0x57224d,_0x15abd3){const _0x350950=_0x67518d,_0x16112e=safeGitWorkspacePath(_0x57224d),_0x2104fa=_0x350950(0x262)+_0x16112e;if(_0x15abd3===_0x350950(0x29b)){const _0x167d34=await runReadOnlyGit(_0x4354b7,[_0x350950(0x220),_0x350950(0x2a8),'-z',_0x350950(0x248),'--',_0x2104fa]);if(!_0x167d34[_0x350950(0x247)][_0x350950(0x1eb)]('\x00')[_0x350950(0x252)](_0x219642=>_0x219642[_0x350950(0x1b9)](_0x350950(0x295))&&_0x219642[_0x350950(0x23f)](0xa24+-0x5*-0x3c7+0x6*-0x4d6)===_0x16112e))throw new Error(_0x350950(0x286));const _0x5e6bd9=await realpath(_0x4354b7),_0x34b273=resolve(_0x5e6bd9,_0x16112e),_0xe3a551=await lstat(_0x34b273);if(!_0xe3a551[_0x350950(0x1bf)]()||_0xe3a551[_0x350950(0x1f0)]())throw new Error(_0x350950(0x286));await unlink(_0x34b273);return;}if(_0x15abd3===_0x350950(0x26c)){await runGit(_0x4354b7,[_0x350950(0x1fc),_0x350950(0x2af),'--',_0x2104fa]);return;}await runGit(_0x4354b7,[_0x350950(0x1fc),_0x350950(0x256),_0x350950(0x1ed),_0x350950(0x2af),'--',_0x2104fa]);}function safeGitWorkspacePath(_0x2cbbe6){const _0x3d4487=_0x67518d;if(_0x2cbbe6[_0x3d4487(0x1c6)]===0xd96+-0x2593+-0x17*-0x10b||_0x2cbbe6[_0x3d4487(0x1ef)]('\x00')||_0x2cbbe6[_0x3d4487(0x1b9)]('/')||_0x2cbbe6[_0x3d4487(0x1b9)]('\x5c'))throw new Error(_0x3d4487(0x1cb));const _0x1da11a=_0x2cbbe6[_0x3d4487(0x254)]('\x5c','/');if(_0x1da11a[_0x3d4487(0x1eb)]('/')[_0x3d4487(0x252)](_0x5d0034=>_0x5d0034===''||_0x5d0034==='..'||_0x5d0034===_0x3d4487(0x2a6)))throw new Error(_0x3d4487(0x1cb));return _0x1da11a;}function gitChange(_0xa3c581){const _0x1e0ea4=_0x67518d;if(_0xa3c581==='A')return _0x1e0ea4(0x297);if(_0xa3c581==='D')return _0x1e0ea4(0x1a6);if(_0xa3c581==='R')return _0x1e0ea4(0x272);if(_0xa3c581==='C')return _0x1e0ea4(0x28e);if(_0xa3c581==='T')return _0x1e0ea4(0x257);return _0x1e0ea4(0x2bd);}export class GitCommandError extends Error{[_0x67518d(0x1e3)];[_0x67518d(0x1d7)];constructor(_0x1b3f03,_0x3057a5){const _0x22d70a=_0x67518d;super(_0x22d70a(0x27c)),this[_0x22d70a(0x1e3)]=_0x1b3f03,this[_0x22d70a(0x1d7)]=_0x3057a5;}}async function runReadOnlyGit(_0x55852b,_0x544600,_0x7c20dc={}){return runGit(_0x55852b,_0x544600,{..._0x7c20dc,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0x246ee3,_0x1df834,_0x137c4d={}){return runGitAllowFailure(_0x246ee3,_0x1df834,{..._0x137c4d,'readOnly':!![]});}async function runGit(_0x2c357d,_0x349d66,_0x19c82f={}){const _0x25eb60=_0x67518d,_0xfa907a=await runGitAllowFailure(_0x2c357d,_0x349d66,_0x19c82f);if(_0xfa907a[_0x25eb60(0x1e3)]!==-0x20a3+-0x1c8+-0x10b*-0x21)throw new GitCommandError(_0xfa907a[_0x25eb60(0x1e3)],_0xfa907a[_0x25eb60(0x1d7)]);return _0xfa907a;}async function runGitAllowFailure(_0x51f12b,_0x4d60bb,_0x290819={}){return new Promise((_0x3df2aa,_0x1811c8)=>{const _0x167660=_0x4bb8,_0x823980=_0x290819[_0x167660(0x22b)]??GIT_OUTPUT_LIMIT,_0x567e4b=spawn(_0x167660(0x21e),[..._0x4d60bb],{'cwd':_0x51f12b,'shell':![],'windowsHide':!![],'stdio':[_0x167660(0x1e8),_0x167660(0x202),_0x167660(0x202)],..._0x290819[_0x167660(0x23a)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x5850ce=[],_0x4d1ded=[];let _0x1c2e36=-0x2667+0xaa+0x25bd,_0x35061c=0x2667+-0x5*0x2dd+-0x1816,_0x41a043=![];const _0x3307a3=setTimeout(()=>{const _0x1e649c=_0x167660;if(process[_0x1e649c(0x24e)]===_0x1e649c(0x2c6)){const _0x5a439a=_0x567e4b[_0x1e649c(0x263)];if(_0x5a439a===undefined){_0x567e4b[_0x1e649c(0x26e)](_0x1e649c(0x237));return;}void terminateProcessTree({'pid':_0x5a439a,'kill':_0x4d951f=>_0x567e4b[_0x1e649c(0x26e)](_0x4d951f)},_0x1e649c(0x2c6))[_0x1e649c(0x221)](()=>{const _0x12a71b=_0x1e649c;try{_0x567e4b[_0x12a71b(0x26e)](_0x12a71b(0x237));}catch{}});return;}_0x567e4b[_0x1e649c(0x26e)](_0x1e649c(0x237));},_0x290819[_0x167660(0x21b)]??GIT_TIMEOUT_MS);_0x567e4b[_0x167660(0x1ae)]['on'](_0x167660(0x1e7),_0x59a6f6=>{const _0xf82826=_0x167660,_0x106f1f=Math[_0xf82826(0x291)](-0x2f*-0xb5+-0xd10+-0x3*0x6b9,_0x823980-_0x1c2e36);if(_0x106f1f>0x249b*-0x1+0x204*0xc+0xc6b){const _0x3333f7=_0x59a6f6[_0xf82826(0x227)](-0xb*-0x251+-0x3*0x9cc+0x3e9,_0x106f1f);_0x5850ce[_0xf82826(0x1f6)](_0x3333f7),_0x1c2e36+=_0x3333f7[_0xf82826(0x1c6)];}_0x41a043||=_0x59a6f6[_0xf82826(0x1c6)]>_0x106f1f;}),_0x567e4b[_0x167660(0x1d7)]['on'](_0x167660(0x1e7),_0xac25cf=>{const _0x378788=_0x167660,_0x48635b=Math[_0x378788(0x291)](-0x5*-0xd4+0x6*-0x4b+0x3d*-0xa,0x890+-0x83a+0xfaa-_0x35061c);if(_0x48635b===-0x23db+-0x15d*-0x5+0x213*0xe)return;const _0x4b1ac2=_0xac25cf[_0x378788(0x227)](-0x59+-0x1693+0x7a4*0x3,_0x48635b);_0x4d1ded[_0x378788(0x1f6)](_0x4b1ac2),_0x35061c+=_0x4b1ac2[_0x378788(0x1c6)];}),_0x567e4b[_0x167660(0x1ab)](_0x167660(0x2bf),_0x4ed517=>{clearTimeout(_0x3307a3),_0x1811c8(_0x4ed517);}),_0x567e4b[_0x167660(0x1ab)](_0x167660(0x232),_0x59b83=>{const _0x3e1cd0=_0x167660;clearTimeout(_0x3307a3);const _0x5e5393=Buffer[_0x3e1cd0(0x2b9)](_0x5850ce);_0x3df2aa({'code':_0x59b83??-0x1d78+-0x18ac+-0x53*-0xa7,'output':_0x5e5393,'text':_0x5e5393[_0x3e1cd0(0x1dd)](_0x3e1cd0(0x2be)),'stderr':Buffer[_0x3e1cd0(0x2b9)](_0x4d1ded)[_0x3e1cd0(0x1dd)](_0x3e1cd0(0x2be)),'truncated':_0x41a043});});});}function isGitUnavailable(_0x2d31fc){const _0x499600=_0x67518d;return _0x2d31fc instanceof Error&&_0x499600(0x1e3)in _0x2d31fc&&_0x2d31fc[_0x499600(0x1e3)]===_0x499600(0x260);}function summarizeText(_0xf1ccf7){const _0x5cf2f6=_0x67518d;return JSON[_0x5cf2f6(0x1a9)]({'sha256':createHash(_0x5cf2f6(0x2a9))[_0x5cf2f6(0x200)](_0xf1ccf7)[_0x5cf2f6(0x214)](_0x5cf2f6(0x26f)),'bytes':Buffer[_0x5cf2f6(0x2c7)](_0xf1ccf7)});}
2
+ const _0x4148b8=_0x2b8d;(function(_0x37738c,_0x924051){const _0x261eab=_0x2b8d,_0xb4e37c=_0x37738c();while(!![]){try{const _0x23094b=parseInt(_0x261eab(0x213))/(0x641*-0x1+-0x52d+-0x1*-0xb6f)+-parseInt(_0x261eab(0x20f))/(-0x88*0x16+-0x1d43+0xf*0x2bb)+parseInt(_0x261eab(0x14a))/(-0xfc1+-0xd5*-0x18+-0x1*0x434)+parseInt(_0x261eab(0x1e9))/(-0x26d1+-0x271*0x5+0x330a)*(parseInt(_0x261eab(0x185))/(0xb21+0x1c6d*-0x1+0x1151))+parseInt(_0x261eab(0x25c))/(-0x632*0x1+-0xc6*0x4+-0x95*-0x10)+-parseInt(_0x261eab(0x13f))/(0x1acd*0x1+-0x25f9+0x1*0xb33)*(-parseInt(_0x261eab(0x235))/(-0x2a*0x81+0x2604+-0x10d2))+-parseInt(_0x261eab(0x1b1))/(-0x2*-0xd86+-0xa1*0x30+0x32d);if(_0x23094b===_0x924051)break;else _0xb4e37c['push'](_0xb4e37c['shift']());}catch(_0x499a25){_0xb4e37c['push'](_0xb4e37c['shift']());}}}(_0x5465,-0xca9f*-0xa+-0x5*-0x14338+-0x459e3));import{createHash,randomUUID}from'node:crypto';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x223f26}from'node:os';import{basename,dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';import{terminateProcessTree}from'./process-tree.js';const GIT_TIMEOUT_MS=0x89c*-0x1+0x22d6+-0x2*0x359,GIT_STATUS_TIMEOUT_MS=-0x3b80+0x4eb0*0x2+0x1350,GIT_HISTORY_TIMEOUT_MS=-0x7bb*-0x2+-0xc2*0x74+0x830a,GIT_OUTPUT_LIMIT=(0x25a8+-0x10d7*-0x1+-0x347f*0x1)*(-0x1*0x2c5+0x1*-0x14c2+0x1b87),GIT_LARGE_OUTPUT_LIMIT=(0x224e+-0x248c+-0x2*-0x123)*(-0x233+0x10f*0x4+0x1f7)*(-0x521+-0x2*0xcec+0x22f9),FILE_READ_LIMIT=(0x3*0x547+-0x1d24+0xf4f*0x1)*(-0x199+0x1*-0x21a1+-0x1*-0x273a),DIRECTORY_PAGE_LIMIT=0x5*0x4e7+-0x1*-0x19a8+0x10d*-0x2f,DIRECTORY_PICKER_LIMIT=-0x5e6+-0x67b+-0xd29*-0x1,SEARCH_RESULT_LIMIT=0xaf9*0x2+-0xb2*0x1+-0x1478,GIT_WORKTREE_LIST_LIMIT=0xe5*0x16+-0x1272+-0xbc,FILE_INDEX_IDLE_TTL_MS=(0x10e9+-0x242e+0x1*0x1381)*(0x101b+-0xdf5*0x2+0xc0b*0x1)*(-0x27*0xf7+-0x19*0x4b+0x30dc),FILE_INDEX_FRESHNESS_TTL_MS=-0x26f*0xb+-0xcf70+-0xb5*-0x1f1,FILE_INDEX_ENTRY_LIMIT=0x29ae3+-0xca8a*-0x2+-0x2a957,FILE_INDEX_METADATA_CONCURRENCY=0x48*-0x2f+0x11d0+-0x478,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x4148b8(0x16d),_0x4148b8(0x13e),_0x4148b8(0x245),_0x4148b8(0x16f),_0x4148b8(0x189),_0x4148b8(0x1ee),_0x4148b8(0x232),_0x4148b8(0x14e),_0x4148b8(0x15c),_0x4148b8(0x1ef),_0x4148b8(0x175),_0x4148b8(0x190),_0x4148b8(0x236),_0x4148b8(0x228),_0x4148b8(0x1f0),_0x4148b8(0x227),_0x4148b8(0x22c),_0x4148b8(0x241),_0x4148b8(0x1ad),_0x4148b8(0x147),_0x4148b8(0x1e6),_0x4148b8(0x246),_0x4148b8(0x1bb),_0x4148b8(0x1a5),_0x4148b8(0x222)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x468a75,_0xc0f836,_0x2391d0){const _0x5afb93=_0x4148b8,_0x52ee5f=_0xc0f836[_0x5afb93(0x23b)]();if(_0x52ee5f[_0x5afb93(0x25d)]===-0xb*-0x200+0x15c6+-0x2bc6||_0x52ee5f[_0x5afb93(0x25d)]>-0x1a62+-0x116b+0x2ccc||_0x52ee5f==='.'||_0x52ee5f==='..'||_0x52ee5f[_0x5afb93(0x215)]('/')||_0x52ee5f[_0x5afb93(0x215)]('\x5c')||_0x52ee5f[_0x5afb93(0x215)]('\x00'))throw new Error(_0x5afb93(0x162));const _0x473c57=await Promise[_0x5afb93(0x1fc)](_0x2391d0[_0x5afb93(0x1ca)](_0x3653e7=>realpath(_0x3653e7))),_0x6e8bfc=await realpath(_0x468a75)[_0x5afb93(0x18a)](()=>{const _0x21044a=_0x5afb93;throw new Error(_0x21044a(0x1a8));}),_0x2c726e=await stat(_0x6e8bfc)[_0x5afb93(0x18a)](()=>undefined);if(_0x2c726e?.[_0x5afb93(0x1c1)]()!==!![]||!isWithinAllowedRoot(_0x6e8bfc,_0x473c57))throw new Error(_0x5afb93(0x1a8));const _0x454a8f=resolve(_0x6e8bfc,_0x52ee5f);if(dirname(_0x454a8f)!==_0x6e8bfc||!isWithinAllowedRoot(_0x454a8f,_0x473c57))throw new Error(_0x5afb93(0x162));try{await mkdir(_0x454a8f);}catch(_0x39b145){if(_0x39b145[_0x5afb93(0x14d)]===_0x5afb93(0x21f))throw new Error(_0x5afb93(0x149));throw _0x39b145;}return _0x454a8f;}export class WorkspaceFileIndex{[_0x4148b8(0x24f)];[_0x4148b8(0x13a)];[_0x4148b8(0x195)]=[];[_0x4148b8(0x1ae)]=![];[_0x4148b8(0x1ec)];[_0x4148b8(0x192)];[_0x4148b8(0x1be)]=!![];[_0x4148b8(0x199)];[_0x4148b8(0x17a)]=-0xf23*0x1+-0x37d*-0x2+0x829;[_0x4148b8(0x1a0)]=-0x2075*0x1+-0x1*-0x5d1+-0x5*-0x554;constructor(_0x2d45ae,_0x54dc36={}){const _0x536c65=_0x4148b8;this[_0x536c65(0x24f)]=_0x2d45ae,this[_0x536c65(0x13a)]=_0x54dc36;}async[_0x4148b8(0x218)](){const _0x2867b7=_0x4148b8;return await this[_0x2867b7(0x25f)](),this[_0x2867b7(0x1cb)](),{'entries':this[_0x2867b7(0x195)][_0x2867b7(0x186)](_0x52bbae=>_0x52bbae[_0x2867b7(0x16c)]===_0x2867b7(0x21c)),'truncated':this[_0x2867b7(0x1ae)]};}[_0x4148b8(0x180)](){const _0x375824=_0x4148b8;if(this[_0x375824(0x199)]!==undefined)clearTimeout(this[_0x375824(0x199)]);this[_0x375824(0x199)]=undefined,this[_0x375824(0x195)]=[],this[_0x375824(0x1ae)]=![],this[_0x375824(0x1be)]=!![],this[_0x375824(0x17a)]=0xcc+-0x14b8+0x13ec,this[_0x375824(0x1a0)]=-0x291*-0x1+0x8*0x2b7+-0x1849*0x1;}async[_0x4148b8(0x1e0)](_0x4d3d4d,_0x14e83e,_0x5163b3=SEARCH_RESULT_LIMIT,_0x263c57=![]){const _0x4f3a65=_0x4148b8;if(_0x4d3d4d[_0x4f3a65(0x23b)]()[_0x4f3a65(0x25d)]===-0x259b+0x4*-0x7bd+0x448f*0x1||_0x4d3d4d[_0x4f3a65(0x25d)]>-0x15b6+0x3d*0x7b+-0x699||!Number[_0x4f3a65(0x1bc)](_0x5163b3)||_0x5163b3<0x15c*0x7+0x281+-0xc04||_0x5163b3>SEARCH_RESULT_LIMIT)throw new Error(_0x4f3a65(0x1e5));await this[_0x4f3a65(0x25f)](),this[_0x4f3a65(0x1cb)]();const _0xde32f4=decodeSearchCursor(_0x14e83e,_0x4d3d4d),_0x15e5d5=_0xde32f4===undefined?undefined:this[_0x4f3a65(0x195)][_0x4f3a65(0x22e)](_0x5be700=>_0x5be700[_0x4f3a65(0x250)]===_0xde32f4&&(_0x263c57||_0x5be700[_0x4f3a65(0x16c)]===_0x4f3a65(0x21c))),_0x212ee2=_0x15e5d5===undefined?-(0x14b3+-0x1612+0x160):fuzzyPathScore(_0x15e5d5[_0x4f3a65(0x250)],_0x4d3d4d),_0xcc82c8=_0x15e5d5===undefined||_0x212ee2<-0x106a+-0x656*0x6+0x366e?undefined:{'entry':_0x15e5d5,'score':_0x212ee2},_0x5a32ff=new RankedCandidateHeap(_0x5163b3+(-0x9*0x1+0x1b2a+-0x1b20));for(const _0x32db64 of this[_0x4f3a65(0x195)]){if(!_0x263c57&&_0x32db64[_0x4f3a65(0x16c)]!==_0x4f3a65(0x21c))continue;const _0x3da148=fuzzyPathScore(_0x32db64[_0x4f3a65(0x250)],_0x4d3d4d);if(_0x3da148<0x4*-0x4eb+0x1d20+-0x974)continue;const _0x38aade={'entry':_0x32db64,'score':_0x3da148};if(_0xcc82c8!==undefined&&compareRankedCandidate(_0x38aade,_0xcc82c8)<=0x7*-0x51b+0x7ac+0x1c11)continue;_0x5a32ff[_0x4f3a65(0x164)](_0x38aade);}const _0x363bb9=_0x5a32ff[_0x4f3a65(0x230)](),_0x4cc99e=_0x363bb9[_0x4f3a65(0x20c)](-0x16a2*0x1+0x97d+0x2a1*0x5,_0x5163b3)[_0x4f3a65(0x1ca)](_0x49c17c=>_0x49c17c[_0x4f3a65(0x1f8)]),_0x20f9d0=_0x363bb9[_0x5163b3]?.[_0x4f3a65(0x1f8)][_0x4f3a65(0x250)];return{'entries':_0x4cc99e,'nextCursor':_0x20f9d0===undefined?null:encodeSearchCursor(_0x4d3d4d,_0x4cc99e['at'](-(0x1a6*-0x9+-0x1b5f+0x2a36))?.[_0x4f3a65(0x250)]??_0xde32f4??''),'truncated':_0x20f9d0!==undefined||this[_0x4f3a65(0x1ae)]};}async[_0x4148b8(0x25f)](){const _0x2ef192=_0x4148b8;if(!this[_0x2ef192(0x1be)]&&this[_0x2ef192(0x1ec)]!==undefined){if(Date[_0x2ef192(0x1ab)]()-this[_0x2ef192(0x1a0)]>=(this[_0x2ef192(0x13a)][_0x2ef192(0x1a1)]??FILE_INDEX_FRESHNESS_TTL_MS))this[_0x2ef192(0x1f9)]();return;}this[_0x2ef192(0x192)]===undefined&&(this[_0x2ef192(0x192)]=this[_0x2ef192(0x1d5)]()[_0x2ef192(0x143)](()=>{const _0x55cdec=_0x2ef192;this[_0x55cdec(0x192)]=undefined;})),await this[_0x2ef192(0x192)];}[_0x4148b8(0x1cb)](){const _0x17a2b7=_0x4148b8;if(this[_0x17a2b7(0x199)]!==undefined)clearTimeout(this[_0x17a2b7(0x199)]);this[_0x17a2b7(0x199)]=setTimeout(()=>this[_0x17a2b7(0x180)](),this[_0x17a2b7(0x13a)][_0x17a2b7(0x1bd)]??FILE_INDEX_IDLE_TTL_MS),this[_0x17a2b7(0x199)][_0x17a2b7(0x1e1)]();}async[_0x4148b8(0x1d5)](){const _0x5e6b10=_0x4148b8,_0x238382=await resolveRegisteredWorkspaceRoot(this[_0x5e6b10(0x24f)]),_0x12f739=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x238382)],_0x3797cb=[],_0x4a7742=this[_0x5e6b10(0x13a)][_0x5e6b10(0x1a4)]??FILE_INDEX_ENTRY_LIMIT;let _0x211a5c=![];const _0x1a87a9=['.'];let _0x2c18a3=0x1*0x1b33+0x17ee+-0x3321;while(_0x2c18a3<_0x1a87a9[_0x5e6b10(0x25d)]&&!_0x211a5c){const _0x45df06=_0x1a87a9[_0x2c18a3];_0x2c18a3+=-0x1*0x2025+-0x2535+0x455b*0x1;const _0x3b870b=await resolveWorkspaceEntryFromCanonicalRoot(_0x238382,_0x45df06,!![])[_0x5e6b10(0x18a)](()=>undefined);if(_0x3b870b===undefined)continue;const _0x43997c=await opendir(_0x3b870b)[_0x5e6b10(0x18a)](()=>undefined);if(_0x43997c===undefined)continue;let _0xe7de0f=[];const _0xbdff20=async()=>{const _0x233a8d=_0x5e6b10,_0x119f38=await Promise[_0x233a8d(0x1fc)](_0xe7de0f);_0xe7de0f=[];for(const _0x1907d2 of _0x119f38){if(_0x1907d2===undefined)continue;if(_0x1907d2[_0x233a8d(0x250)]===_0x233a8d(0x216)||_0x1907d2[_0x233a8d(0x250)][_0x233a8d(0x1af)](_0x233a8d(0x240))||isExcluded(_0x1907d2[_0x233a8d(0x250)],_0x12f739))continue;if(_0x1907d2[_0x233a8d(0x16c)]===_0x233a8d(0x1e7))_0x1a87a9[_0x233a8d(0x17f)](_0x1907d2[_0x233a8d(0x250)]);_0x3797cb[_0x233a8d(0x17f)](_0x1907d2);if(_0x3797cb[_0x233a8d(0x25d)]>=_0x4a7742){_0x211a5c=!![];break;}}};for await(const _0x46ada4 of _0x43997c){const _0x588bbf=_0x45df06==='.'?_0x46ada4[_0x5e6b10(0x151)]:posix[_0x5e6b10(0x188)](_0x45df06[_0x5e6b10(0x191)]('\x5c','/'),_0x46ada4[_0x5e6b10(0x151)]);if(_0x588bbf===_0x5e6b10(0x216)||_0x588bbf[_0x5e6b10(0x1af)](_0x5e6b10(0x240))||isExcluded(_0x588bbf,_0x12f739))continue;_0xe7de0f[_0x5e6b10(0x17f)](inspectWorkspaceIndexEntry(_0x238382,_0x588bbf,_0x46ada4[_0x5e6b10(0x151)]));if(_0xe7de0f[_0x5e6b10(0x25d)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0xbdff20();if(_0x211a5c)break;}if(!_0x211a5c&&_0xe7de0f[_0x5e6b10(0x25d)]>-0xe3*-0x5+0x741+-0xbb0)await _0xbdff20();}this[_0x5e6b10(0x1ec)]=_0x238382,this[_0x5e6b10(0x195)]=_0x3797cb,this[_0x5e6b10(0x1ae)]=_0x211a5c,this[_0x5e6b10(0x1be)]=![],this[_0x5e6b10(0x17a)]=Date[_0x5e6b10(0x1ab)](),this[_0x5e6b10(0x1a0)]=this[_0x5e6b10(0x17a)];}[_0x4148b8(0x1f9)](){const _0x185c16=_0x4148b8;if(this[_0x185c16(0x192)]!==undefined)return;this[_0x185c16(0x1a0)]=Date[_0x185c16(0x1ab)](),this[_0x185c16(0x192)]=this[_0x185c16(0x1d5)]()[_0x185c16(0x18a)](()=>undefined)[_0x185c16(0x143)](()=>{const _0x149991=_0x185c16;this[_0x149991(0x192)]=undefined;});}}async function workspaceExcludePatterns(_0x12b71e){const _0xa1941c=_0x4148b8,_0x2514f1=resolve(_0x12b71e,_0xa1941c(0x19e)),_0x3e566f=await readFile(_0x2514f1,_0xa1941c(0x19b))[_0xa1941c(0x207)](JSON[_0xa1941c(0x144)])[_0xa1941c(0x18a)](()=>undefined);if(typeof _0x3e566f!==_0xa1941c(0x1db)||_0x3e566f===null)return[];return[_0xa1941c(0x226),_0xa1941c(0x18b)][_0xa1941c(0x24a)](_0x544fd1=>{const _0x27478a=_0xa1941c,_0x159478=_0x3e566f[_0x544fd1];return typeof _0x159478===_0x27478a(0x1db)&&_0x159478!==null?Object[_0x27478a(0x195)](_0x159478)[_0x27478a(0x24a)](([_0x589468,_0x33225f])=>_0x33225f===!![]?[_0x589468]:[]):[];});}function isExcluded(_0x5ed799,_0x683e96){const _0x2db8f3=_0x4148b8;return _0x683e96[_0x2db8f3(0x140)](_0x5ea217=>minimatch(_0x5ed799,_0x5ea217,{'dot':!![],'nocase':_0x223f26()!==_0x2db8f3(0x1c3)})||minimatch(_0x5ed799+'/',_0x5ea217,{'dot':!![],'nocase':_0x223f26()!==_0x2db8f3(0x1c3)}));}function compareRankedCandidate(_0x39ebed,_0x1888ff){const _0x5a7935=_0x4148b8;return _0x1888ff[_0x5a7935(0x231)]-_0x39ebed[_0x5a7935(0x231)]||_0x39ebed[_0x5a7935(0x1f8)][_0x5a7935(0x250)][_0x5a7935(0x198)](_0x1888ff[_0x5a7935(0x1f8)][_0x5a7935(0x250)]);}class RankedCandidateHeap{[_0x4148b8(0x21b)];[_0x4148b8(0x1d4)]=[];constructor(_0x594921){const _0x1bfb77=_0x4148b8;this[_0x1bfb77(0x21b)]=_0x594921;}[_0x4148b8(0x164)](_0x3ceed7){const _0x61679e=_0x4148b8;if(this[_0x61679e(0x1d4)][_0x61679e(0x25d)]<this[_0x61679e(0x21b)]){this[_0x61679e(0x1d4)][_0x61679e(0x17f)](_0x3ceed7),this[_0x61679e(0x23c)](this[_0x61679e(0x1d4)][_0x61679e(0x25d)]-(0x972+0x2b7*-0xe+-0x67*-0x47));return;}if(compareRankedCandidate(_0x3ceed7,this[_0x61679e(0x1d4)][-0xe3+-0x130f+0x13f2])>=0x6*-0x5c6+0x789*0x5+-0x1*0x309)return;this[_0x61679e(0x1d4)][-0x2377*0x1+0xb7+-0x1160*-0x2]=_0x3ceed7,this[_0x61679e(0x187)](-0x12a*-0x11+0xc8c+0x102b*-0x2);}[_0x4148b8(0x230)](){const _0x5b6bc7=_0x4148b8;return[...this[_0x5b6bc7(0x1d4)]][_0x5b6bc7(0x1fd)](compareRankedCandidate);}[_0x4148b8(0x23c)](_0x167a85){const _0x40509b=_0x4148b8;let _0x300ab7=_0x167a85;while(_0x300ab7>-0x1*0xa47+-0x1*-0x198d+0x2*-0x7a3){const _0x3c4012=Math[_0x40509b(0x212)]((_0x300ab7-(-0x2*0x6e5+-0x20ce+0x2e99))/(-0x1*0x1fbd+0xbed+0x13d2));if(compareRankedCandidate(this[_0x40509b(0x1d4)][_0x300ab7],this[_0x40509b(0x1d4)][_0x3c4012])<=0x3f2*0x1+0xc0a+-0xffc)break;[this[_0x40509b(0x1d4)][_0x300ab7],this[_0x40509b(0x1d4)][_0x3c4012]]=[this[_0x40509b(0x1d4)][_0x3c4012],this[_0x40509b(0x1d4)][_0x300ab7]],_0x300ab7=_0x3c4012;}}[_0x4148b8(0x187)](_0x7a22fb){const _0x4c771c=_0x4148b8;let _0x45b21e=_0x7a22fb;while(!![]){const _0x4303d3=_0x45b21e*(0x185*-0xb+-0x1235+0x22ee*0x1)+(-0x135f+0xc3+0x3b9*0x5);if(_0x4303d3>=this[_0x4c771c(0x1d4)][_0x4c771c(0x25d)])return;const _0x256843=_0x4303d3+(0x235+0x16cc*-0x1+0x1498),_0x5a0841=_0x256843<this[_0x4c771c(0x1d4)][_0x4c771c(0x25d)]&&compareRankedCandidate(this[_0x4c771c(0x1d4)][_0x256843],this[_0x4c771c(0x1d4)][_0x4303d3])>-0x16f8+-0x2*0xfa1+-0x16*-0x277?_0x256843:_0x4303d3;if(compareRankedCandidate(this[_0x4c771c(0x1d4)][_0x5a0841],this[_0x4c771c(0x1d4)][_0x45b21e])<=0xfe0+0x2193+-0x3173)return;[this[_0x4c771c(0x1d4)][_0x45b21e],this[_0x4c771c(0x1d4)][_0x5a0841]]=[this[_0x4c771c(0x1d4)][_0x5a0841],this[_0x4c771c(0x1d4)][_0x45b21e]],_0x45b21e=_0x5a0841;}}}function fuzzyPathScore(_0x2d5680,_0x52c66c){const _0x4ea035=_0x4148b8,_0x57a0bb=_0x2d5680[_0x4ea035(0x1cc)](),_0x59920b=_0x52c66c[_0x4ea035(0x23b)]()[_0x4ea035(0x1cc)]();let _0x4fbb34=0xef3+0x216d+-0x3060,_0x4b7be6=0xd29+-0xa7c+-0x89*0x5,_0x360450=-(-0x253e+-0x258+0x2798*0x1);for(const _0x307dd6 of _0x59920b){const _0x1ec9a8=_0x57a0bb[_0x4ea035(0x14f)](_0x307dd6,_0x4fbb34);if(_0x1ec9a8===-(0x91e+0x2*0x1314+-0x1*0x2f45))return-(-0x139*-0x3+-0x2*0x427+0x4a4);_0x4b7be6+=_0x1ec9a8===_0x360450+(-0x3*-0x4ba+-0x1336*-0x1+-0x1*0x2163)?-0xf35+0x1319+-0x3d8:-0x154a+-0x7*0x47e+0x1*0x34bd;if(_0x1ec9a8===0x6e*-0x29+0x1*0x162+0x1*0x103c||_0x4ea035(0x1fb)[_0x4ea035(0x215)](_0x57a0bb[_0x1ec9a8-(0x225f+-0x222b+-0x33)]??''))_0x4b7be6+=-0x7a7*0x5+0x1*0x1a65+0xbe6;_0x360450=_0x1ec9a8,_0x4fbb34=_0x1ec9a8+(-0x2*-0xb3+-0xde5*0x1+0xc80);}const _0x2e4fa4=_0x2d5680[_0x4ea035(0x20c)](_0x2d5680[_0x4ea035(0x1b2)]('/')+(-0x9b3*0x3+-0x3*-0x922+-0x1b4*-0x1))[_0x4ea035(0x1cc)]();if(_0x2e4fa4[_0x4ea035(0x215)](_0x59920b))_0x4b7be6+=0x1*0x249b+0x395*0x8+-0x411b;else{if(_0x57a0bb[_0x4ea035(0x215)](_0x59920b))_0x4b7be6+=-0xf71+-0x17c0+-0x2741*-0x1;}return _0x4b7be6-_0x2d5680[_0x4ea035(0x25d)]/(0x17ee*-0x1+0xdf3*-0x1+-0x13*-0x233);}export async function listWorkspaceDirectories(_0x39292b,_0x17b71c,_0x10ec0e=homedir()){const _0x1f0655=_0x4148b8,_0x55f1d6=await realpath(_0x10ec0e),_0x1cb5d4=await Promise[_0x1f0655(0x1fc)](_0x17b71c[_0x1f0655(0x1ca)](_0xf833fb=>realpath(_0xf833fb))),_0x3b7200=[...new Set([_0x55f1d6,..._0x1cb5d4])],_0xfe9a1d=_0x39292b===undefined?_0x1cb5d4[0x9a0+-0x1*0x241d+-0x1*-0x1a7d]??_0x55f1d6:await realpath(_0x39292b),_0x220e30=await stat(_0xfe9a1d);if(!_0x220e30[_0x1f0655(0x1c1)]()||!isWithinAllowedRoot(_0xfe9a1d,_0x3b7200))throw new Error(_0x1f0655(0x1a8));const _0x3479cf=await readdir(_0xfe9a1d,{'withFileTypes':!![]}),_0xaf9558=[];for(const _0xb85af4 of _0x3479cf[_0x1f0655(0x1fd)]((_0x2d220f,_0x3f477c)=>_0x2d220f[_0x1f0655(0x151)][_0x1f0655(0x198)](_0x3f477c[_0x1f0655(0x151)]))){if(!_0xb85af4[_0x1f0655(0x1c1)]()&&!_0xb85af4[_0x1f0655(0x19a)]())continue;const _0xb9ddee=await realpath(resolve(_0xfe9a1d,_0xb85af4[_0x1f0655(0x151)]))[_0x1f0655(0x18a)](()=>undefined);if(_0xb9ddee===undefined||!isWithinAllowedRoot(_0xb9ddee,_0x3b7200))continue;const _0x1c22c9=await stat(_0xb9ddee)[_0x1f0655(0x18a)](()=>undefined);if(_0x1c22c9===undefined||!_0x1c22c9[_0x1f0655(0x1c1)]())continue;_0xaf9558[_0x1f0655(0x17f)]({'path':_0xb9ddee,'name':_0xb85af4[_0x1f0655(0x151)],'selectable':isWithinAllowedRoot(_0xb9ddee,_0x1cb5d4)});if(_0xaf9558[_0x1f0655(0x25d)]>DIRECTORY_PICKER_LIMIT)break;}const _0x1cb0cb=dirname(_0xfe9a1d);return{'homePath':_0x55f1d6,'currentPath':_0xfe9a1d,'parentPath':_0x1cb0cb===_0xfe9a1d||!isWithinAllowedRoot(_0x1cb0cb,_0x3b7200)?null:_0x1cb0cb,'browseRoots':_0x1cb5d4,'selectable':isWithinAllowedRoot(_0xfe9a1d,_0x1cb5d4),'entries':_0xaf9558[_0x1f0655(0x20c)](0x1dfe+-0x3*-0x1c7+-0x2353,DIRECTORY_PICKER_LIMIT),'truncated':_0xaf9558[_0x1f0655(0x25d)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x3ec6ae,_0x1967e9='.',_0x342052,_0x3c2dd4=DIRECTORY_PAGE_LIMIT){const _0x338c65=_0x4148b8;if(!Number[_0x338c65(0x1bc)](_0x3c2dd4)||_0x3c2dd4<-0x1*-0x25e1+-0x24bd+0x123*-0x1||_0x3c2dd4>DIRECTORY_PAGE_LIMIT)throw new Error(_0x338c65(0x1b8));const _0x157520=await resolveRegisteredWorkspaceRoot(_0x3ec6ae),_0x43c05b=await resolveWorkspaceEntryFromCanonicalRoot(_0x157520,_0x1967e9,!![]),_0x343e17=await readdir(_0x43c05b,{'withFileTypes':!![]}),_0x51e328=decodeDirectoryCursor(_0x342052,_0x1967e9),_0x4194bb=_0x343e17[_0x338c65(0x186)](_0x4ccac2=>_0x4ccac2[_0x338c65(0x151)]!==_0x338c65(0x216)&&!isWorkspaceUploadTemporaryName(_0x4ccac2[_0x338c65(0x151)]))[_0x338c65(0x1ca)](_0x36941e=>_0x36941e[_0x338c65(0x151)])[_0x338c65(0x1fd)]((_0x1ac65b,_0x45c272)=>_0x1ac65b[_0x338c65(0x198)](_0x45c272)),_0x4b2d06=_0x51e328===undefined?0x3*0x4eb+-0x2360+-0x1*-0x149f:_0x4194bb[_0x338c65(0x1ff)](_0x55deae=>_0x55deae>_0x51e328);if(_0x51e328!==undefined&&_0x4b2d06===-(-0x116e+0x157+-0x2*-0x80c))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x3f4e38=_0x4194bb[_0x338c65(0x20c)](_0x4b2d06,_0x4b2d06+_0x3c2dd4),_0x54b52c=[];for(const _0x18ecab of _0x3f4e38){const _0x23a952=await resolveWorkspaceEntry(_0x157520,relative(_0x157520,resolve(_0x43c05b,_0x18ecab)),![])[_0x338c65(0x18a)](_0x83c482=>{if(isSkippableWorkspaceEntryError(_0x83c482))return undefined;throw _0x83c482;});if(_0x23a952===undefined)continue;const _0x4fdedd=await lstat(_0x23a952)[_0x338c65(0x18a)](_0x5301b7=>{const _0x11e584=_0x338c65;if(_0x5301b7[_0x11e584(0x14d)]===_0x11e584(0x172))return undefined;throw _0x5301b7;});if(_0x4fdedd===undefined||!_0x4fdedd[_0x338c65(0x251)]()&&!_0x4fdedd[_0x338c65(0x1c1)]())continue;_0x54b52c[_0x338c65(0x17f)]({'path':relative(_0x157520,_0x23a952)[_0x338c65(0x1c6)](sep)[_0x338c65(0x188)]('/'),'name':_0x18ecab,'kind':_0x4fdedd[_0x338c65(0x1c1)]()?_0x338c65(0x1e7):_0x338c65(0x21c),'size':_0x4fdedd[_0x338c65(0x251)]()?_0x4fdedd[_0x338c65(0x176)]:null,'modifiedAt':_0x4fdedd[_0x338c65(0x24d)]});}const _0x2c9a45=_0x4194bb[_0x4b2d06+_0x3f4e38[_0x338c65(0x25d)]];return{'entries':_0x54b52c,'nextCursor':_0x2c9a45===undefined||_0x3f4e38[_0x338c65(0x25d)]===0x2045+0x1338+-0x31*0x10d?null:encodeDirectoryCursor(_0x1967e9,_0x3f4e38[_0x3f4e38[_0x338c65(0x25d)]-(0x265d+0x1d8+-0x2834)]),'truncated':_0x2c9a45!==undefined};}export async function mutateWorkspaceFile(_0x146615,_0x3d7848){const _0x31e726=_0x4148b8,_0x4cb2e=await resolveRegisteredWorkspaceRoot(_0x146615);if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x1f3)||_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x148)){const _0x287478=await resolveNewWorkspaceEntry(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x1f3))await writeFile(_0x287478,'',{'flag':'wx'});else await mkdir(_0x287478);return{'path':workspaceRelativePath(_0x4cb2e,_0x287478)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);const _0x12be10=await resolveWorkspaceEntryMetadata(_0x4cb2e,_0x3d7848[_0x31e726(0x250)]);if(workspaceRelativePath(_0x4cb2e,_0x12be10[_0x31e726(0x250)])==='.')throw new Error(_0x31e726(0x179));if(_0x3d7848[_0x31e726(0x252)]===_0x31e726(0x15d))return await rm(_0x12be10[_0x31e726(0x250)],{'recursive':_0x12be10[_0x31e726(0x1f2)][_0x31e726(0x1c1)](),'force':![]}),{'deleted':!![]};const _0x4b0750=await resolveNewWorkspaceEntry(_0x4cb2e,_0x3d7848[_0x31e726(0x1f5)]);if(_0x12be10[_0x31e726(0x1f2)][_0x31e726(0x1c1)]()){const _0xdc8ad4=relative(_0x12be10[_0x31e726(0x250)],_0x4b0750);if(_0xdc8ad4===''||!isAbsolute(_0xdc8ad4)&&_0xdc8ad4!=='..'&&!_0xdc8ad4[_0x31e726(0x1af)]('..'+sep))throw new Error(_0x31e726(0x261));}return await rename(_0x12be10[_0x31e726(0x250)],_0x4b0750),{'path':workspaceRelativePath(_0x4cb2e,_0x4b0750)};}async function resolveNewWorkspaceEntry(_0x124e6f,_0xc7457b){const _0x8a68e7=_0x4148b8,_0x4fd088=_0xc7457b[_0x8a68e7(0x191)]('\x5c','/'),_0x2d5435=_0x4fd088[_0x8a68e7(0x1c6)]('/'),_0xcf091d=_0x2d5435['at'](-(0x10d0+-0x1*0x7ef+-0x10*0x8e));if(_0xc7457b[_0x8a68e7(0x215)]('\x00')||_0x4fd088[_0x8a68e7(0x1af)]('/')||isAbsolute(_0xc7457b)||win32[_0x8a68e7(0x163)](_0x4fd088)||_0xcf091d===undefined||_0xcf091d[_0x8a68e7(0x25d)]===-0x758+0x6da+0x7e*0x1||_0x2d5435[_0x8a68e7(0x140)](invalidWorkspaceMutationSegment))throw new Error(_0x8a68e7(0x13c));const _0x4d3d5b=_0x2d5435[_0x8a68e7(0x25d)]===0x204d+0x9bc+0x434*-0xa?'.':_0x2d5435[_0x8a68e7(0x20c)](-0x1282+-0x1bbf*0x1+0x2e41,-(0x2395+-0xc*-0x1e2+-0x3a2c))[_0x8a68e7(0x188)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x124e6f,_0x4d3d5b);const _0x3ac750=await resolveWorkspaceEntryFromCanonicalRoot(_0x124e6f,_0x4d3d5b,!![]),_0xdfb148=resolve(_0x3ac750,_0xcf091d);try{await lstat(_0xdfb148);throw new Error(_0x8a68e7(0x20a));}catch(_0x1bb006){if(_0x1bb006[_0x8a68e7(0x14d)]!==_0x8a68e7(0x172))throw _0x1bb006;}return _0xdfb148;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x365d48,_0x8aa691){const _0x3e759d=_0x4148b8,_0x1f24ff=_0x8aa691[_0x3e759d(0x191)]('\x5c','/');if(_0x1f24ff==='.')return;const _0x4ee21b=_0x1f24ff[_0x3e759d(0x1c6)]('/');if(_0x8aa691[_0x3e759d(0x215)]('\x00')||_0x1f24ff[_0x3e759d(0x1af)]('/')||isAbsolute(_0x8aa691)||win32[_0x3e759d(0x163)](_0x1f24ff)||_0x4ee21b[_0x3e759d(0x140)](invalidWorkspaceMutationSegment))throw new Error(_0x3e759d(0x13c));let _0x556ffe=_0x365d48;for(const _0x142cb2 of _0x4ee21b){_0x556ffe=resolve(_0x556ffe,_0x142cb2);const _0x342ad6=await lstat(_0x556ffe)[_0x3e759d(0x18a)](_0x77af46=>{const _0x315bcb=_0x3e759d;if(_0x77af46[_0x315bcb(0x14d)]===_0x315bcb(0x172))throw new Error(_0x315bcb(0x1f6));throw _0x77af46;});if(_0x342ad6[_0x3e759d(0x19a)]())throw new Error(_0x3e759d(0x13c));}}function invalidWorkspaceMutationSegment(_0x169aa3){const _0x2b04c2=_0x4148b8;if(_0x169aa3[_0x2b04c2(0x25d)]===0x3d2+0x1*-0x1813+-0x5*-0x40d||_0x169aa3==='.'||_0x169aa3==='..'||_0x169aa3===_0x2b04c2(0x216))return!![];if(_0x223f26()!==_0x2b04c2(0x1f1))return![];const _0x10a881=_0x169aa3[_0x2b04c2(0x1dc)](/[. ]+$/u,'')[_0x2b04c2(0x24e)]();return/[<>:"|?*]/u[_0x2b04c2(0x194)](_0x169aa3)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x2b04c2(0x194)](_0x10a881);}function workspaceRelativePath(_0x3e0f21,_0x118259){const _0x5753bc=_0x4148b8,_0x18f58f=relative(_0x3e0f21,_0x118259)[_0x5753bc(0x1c6)](sep)[_0x5753bc(0x188)]('/');return _0x18f58f[_0x5753bc(0x25d)]===-0x231d+-0x17*-0x53+-0x6*-0x49c?'.':_0x18f58f;}function isSkippableWorkspaceEntryError(_0x54ba39){const _0x43c68c=_0x4148b8;return _0x54ba39 instanceof Error&&(_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x13c)||_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x1f6)||_0x54ba39[_0x43c68c(0x1ac)]===_0x43c68c(0x1ba));}export async function preflightWorkspaceUpload(_0x3b4afa,_0x5b3a8a,_0x217b8f){const _0x5a6ac0=_0x4148b8;if(_0x217b8f[_0x5a6ac0(0x25d)]===-0x25*-0x7f+0x1d*-0x124+0xeb9||_0x217b8f==='.'||_0x217b8f==='..'||_0x217b8f[_0x5a6ac0(0x215)]('\x00')||_0x217b8f[_0x5a6ac0(0x215)]('/')||_0x217b8f[_0x5a6ac0(0x215)]('\x5c')||isWorkspaceUploadTemporaryName(_0x217b8f))return{'path':'','absolutePath':'','status':_0x5a6ac0(0x17b)};const _0x1ca257=await resolveRegisteredWorkspaceRoot(_0x3b4afa),_0x2817e4=await resolveWorkspaceEntry(_0x1ca257,_0x5b3a8a,!![]),_0x4491b8=resolve(_0x2817e4,_0x217b8f);if(dirname(_0x4491b8)!==_0x2817e4)throw new Error(_0x5a6ac0(0x13c));const _0x86db82=relative(_0x1ca257,_0x4491b8)[_0x5a6ac0(0x1c6)](sep)[_0x5a6ac0(0x188)]('/'),_0x3e0bf2=await lstat(_0x4491b8)[_0x5a6ac0(0x18a)](_0x1a5e21=>{const _0x245483=_0x5a6ac0;if(_0x1a5e21[_0x245483(0x14d)]===_0x245483(0x172))return undefined;throw _0x1a5e21;});if(_0x3e0bf2===undefined)return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x259)};if(_0x3e0bf2[_0x5a6ac0(0x19a)]())throw new Error(_0x5a6ac0(0x13c));if(_0x3e0bf2[_0x5a6ac0(0x251)]())return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x211)};return{'path':_0x86db82,'absolutePath':_0x4491b8,'status':_0x5a6ac0(0x210)};}export function workspaceUploadTemporaryName(_0x41c4d9){const _0x5a5d61=_0x4148b8;return _0x5a5d61(0x1b0)+_0x41c4d9+_0x5a5d61(0x20e);}function isWorkspaceUploadTemporaryName(_0x4709af){const _0x9e9842=_0x4148b8;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x9e9842(0x194)](_0x4709af)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x9e9842(0x194)](_0x4709af);}export async function readWorkspaceTextFile(_0x5234b6,_0x42cc15,_0x2c57b0=0x8f*-0x1e+-0xdc0+0x163*0x16,_0xf9ef2e=FILE_READ_LIMIT){const _0x48c7ed=_0x4148b8;if(!Number[_0x48c7ed(0x1bc)](_0x2c57b0)||_0x2c57b0<0xd*-0x22f+0x7f9+0xc9*0x1a||!Number[_0x48c7ed(0x1bc)](_0xf9ef2e)||_0xf9ef2e<0x16a8+-0x13*0x6b+-0xeb6||_0xf9ef2e>FILE_READ_LIMIT)throw new Error(_0x48c7ed(0x157));const _0x30986a=await resolveRegisteredWorkspaceRoot(_0x5234b6),_0x5e7e4a=await resolveWorkspaceEntry(_0x30986a,_0x42cc15,![]),_0x2cb089=await lstat(_0x5e7e4a);if(!_0x2cb089[_0x48c7ed(0x251)]())throw new Error(_0x48c7ed(0x1ba));if(_0x2cb089[_0x48c7ed(0x176)]>FILE_READ_LIMIT*(-0x3b*0x47+-0xf04+0x3*0xa7b))throw new Error(_0x48c7ed(0x21d));const _0x1ea2c8=await readFile(_0x5e7e4a),_0x4ba988=createHash(_0x48c7ed(0x23a))[_0x48c7ed(0x219)](_0x1ea2c8)[_0x48c7ed(0x1a2)](_0x48c7ed(0x1cf)),_0x296740=_0x1ea2c8[_0x48c7ed(0x215)](0x51a*0x4+-0xd77+-0x6f1)||!isValidUtf8(_0x1ea2c8);if(_0x296740){const _0x30c09b=Math[_0x48c7ed(0x145)](_0x1ea2c8[_0x48c7ed(0x25d)],_0x2c57b0+_0xf9ef2e),_0xbcab78=_0x1ea2c8[_0x48c7ed(0x182)](_0x2c57b0,_0x30c09b);return{'path':relative(_0x30986a,_0x5e7e4a)[_0x48c7ed(0x1c6)](sep)[_0x48c7ed(0x188)]('/'),'encoding':_0x48c7ed(0x24b),'size':_0x1ea2c8[_0x48c7ed(0x25d)],'content':_0xbcab78[_0x48c7ed(0x1b9)](_0x48c7ed(0x24b)),'truncated':_0x30c09b<_0x1ea2c8[_0x48c7ed(0x25d)],'nextOffset':_0x30c09b<_0x1ea2c8[_0x48c7ed(0x25d)]?_0x30c09b:null,'revision':_0x4ba988};}if(_0x2c57b0>-0xd4a+0x1b3+0xb97&&_0x2c57b0<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x2c57b0]))throw new Error(_0x48c7ed(0x157));let _0x416f13=Math[_0x48c7ed(0x145)](_0x1ea2c8[_0x48c7ed(0x25d)],_0x2c57b0+_0xf9ef2e);if(_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13])){while(_0x416f13>_0x2c57b0&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13]))_0x416f13-=-0x5*0x51e+-0x189*0x3+-0xf19*-0x2;if(_0x416f13===_0x2c57b0){_0x416f13+=-0x63f+0xaed+-0x7*0xab;while(_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]&&isUtf8ContinuationByte(_0x1ea2c8[_0x416f13]))_0x416f13+=-0x1a2*-0x15+0x27*0xc7+-0x409a;}}const _0x8bcac3=_0x1ea2c8[_0x48c7ed(0x182)](_0x2c57b0,_0x416f13),_0x49f0fb=new TextDecoder(_0x48c7ed(0x153),{'fatal':!![]})[_0x48c7ed(0x203)](_0x8bcac3),_0x43c12c=_0x416f13<_0x1ea2c8[_0x48c7ed(0x25d)]?_0x416f13:null;return{'path':relative(_0x30986a,_0x5e7e4a)[_0x48c7ed(0x1c6)](sep)[_0x48c7ed(0x188)]('/'),'encoding':_0x48c7ed(0x153),'size':_0x1ea2c8[_0x48c7ed(0x25d)],'content':_0x49f0fb,'truncated':_0x43c12c!==null,'nextOffset':_0x43c12c,'revision':_0x4ba988};}export async function writeWorkspaceTextFile(_0x53ee4c,_0x1b34de,_0x32e1a0,_0x399f83){const _0x5f5a73=_0x4148b8;if(!/^[0-9a-f]{64}$/u[_0x5f5a73(0x194)](_0x399f83))throw new Error(_0x5f5a73(0x1c5));const _0x74f2a3=Buffer[_0x5f5a73(0x158)](_0x32e1a0,_0x5f5a73(0x19b));if(_0x74f2a3[_0x5f5a73(0x25d)]>FILE_READ_LIMIT*(0x269b+-0x137d+-0x12*0x10f))throw new Error(_0x5f5a73(0x21d));if(_0x74f2a3[_0x5f5a73(0x215)](-0x1*0x19cf+0x2552+-0xb83*0x1))throw new Error(_0x5f5a73(0x13d));const _0x536eca=await resolveRegisteredWorkspaceRoot(_0x53ee4c);await assertWorkspaceMutationPathHasNoSymlinks(_0x536eca,_0x1b34de);const _0x2a070=await resolveWorkspaceEntry(_0x536eca,_0x1b34de,![]),_0x25680a=await lstat(_0x2a070);if(!_0x25680a[_0x5f5a73(0x251)]())throw new Error(_0x5f5a73(0x1ba));const _0x441d90=await readFile(_0x2a070);if(_0x441d90[_0x5f5a73(0x215)](0x113f+-0x1e53*-0x1+-0x2f92)||!isValidUtf8(_0x441d90))throw new Error(_0x5f5a73(0x13d));const _0x323a8f=createHash(_0x5f5a73(0x23a))[_0x5f5a73(0x219)](_0x441d90)[_0x5f5a73(0x1a2)](_0x5f5a73(0x1cf));if(_0x323a8f!==_0x399f83)throw new Error(_0x5f5a73(0x258));const _0x271a5f=createHash(_0x5f5a73(0x23a))[_0x5f5a73(0x219)](_0x74f2a3)[_0x5f5a73(0x1a2)](_0x5f5a73(0x1cf)),_0x79a2a9=resolve(dirname(_0x2a070),_0x5f5a73(0x1e3)+randomUUID()+_0x5f5a73(0x20e));try{await writeFile(_0x79a2a9,_0x74f2a3,{'flag':'wx','mode':_0x25680a[_0x5f5a73(0x15f)]}),await rename(_0x79a2a9,_0x2a070);}finally{await rm(_0x79a2a9,{'force':!![]})[_0x5f5a73(0x18a)](()=>undefined);}return{'path':workspaceRelativePath(_0x536eca,_0x2a070),'revision':_0x271a5f,'size':_0x74f2a3[_0x5f5a73(0x25d)]};}function _0x5465(){const _0x1f8f5c=['rKLmrv9ot1rFvevyva','kIOVBM9Kzv9TB2r1BgvZlYOQ','mJyZmJa0ou1xDK5PzW','C29Tzq','CMvMCY9Yzw1VDgvZ','ls1NAxqTy29TBw9UlwrPCG','zMLUywXSEq','CgfYC2u','BwLU','CMvMCW','kIOVyMLUlYOQ','q1jfqvrfx0rjuKvdve9swq','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','mZiYotCZmxvdvfzKsW','yMfZzty0DxjS','vu5uuKfds0ve','y29Kzq','kIOVlNr1CMjVlYOQ','Aw5KzxHpzG','yNL0zuXLBMD0Aa','BMfTzq','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','DxrMltG','AgfZAa','qureruq','D29YA3rYzwu','rKLmrv9squ5hrv9jtLzbteLe','zNjVBq','B3v0Chv0','y2XVC2u','ls1ZB3vYy2u9sevbra','kIOVzgLZDc8QkG','revmrvrf','ls1WB3jJzwXHAw4','Bw9Kzq','CxvLCNK','ls1ZAg93lxn1CgvYChjVAMvJDc13B3jRAw5NlxrYzwu','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','AxnbyNnVBhv0zq','ywrK','Chj1BMfIBguG','ls10B3bVlw9YzgvY','Dg9mB3DLCKnHC2u','v09ss1nqqunfx05pvf9bteXpv0ve','r0Lux1jfrL9jtLzbteLe','C3rYAw5N','lI4U','A2LUza','kIOVlMDPDc8QkG','ls1TyxGTy291BNq9','kIOVlNbUCg0VkIO','iYmG','ls1VDgHLCNm','ru5pru5u','CMvMCY9OzwfKCW','Chj1BMfIBgu','kIOVB3v0lYOQ','C2L6zq','C2v0','zgLMzI10CMvL','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','CMvMCMvZAgvKqxq','su5wquXjrf9oqu1f','CMvHza','AgfZ','BM9YBwfSAxPL','ChvZAa','zgLZCg9Zzq','C3rKzxjY','C3vIyxjYyxK','ls1UBY1PBMrLEa','ls1PCY1HBMnLC3rVCG','mZa0mJC5nu5iAMPHsa','zMLSDgvY','C2LUA0rVD24','AM9PBG','kIOVlNLHCM4VkIO','y2f0y2G','C2vHCMnOlMv4y2X1zgu','CMvZDg9Yzq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','CMvHze9UBhK','ls1LEgnSDwrLlxn0yw5KyxjK','kIOVy292zxjHz2uVkIO','CMvWBgfJzufSBa','Bg9HzgLUzW','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','DgvZDa','zw50CMLLCW','rKLmrv9ot1rFreLsrunut1jz','ls1XDwLLDa','Bg9JywXLq29TCgfYzq','zxHWAxj5vgLTzxi','AxntEw1IB2XPy0XPBMS','DxrMoa','z2L0','Bg9JA2vK','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','l2rLDI9UDwXS','CMvMCMvZAef0DgvTChrLzef0','zNjLC2HUzxnZvhrStxm','zgLNzxn0','CMvMCY9Yzw1VDgvZlW','zw50CNLmAw1PDa','kIOVlNzLBNyVkIO','AxnjBNrLz2vY','A2LSBa','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','CgLK','Aw52ywXPza','BM93','BwvZC2fNzq','kIOVlMDYywrSzs8QkG','Dhj1BMnHDgvK','C3rHCNrZv2L0Aa','lM1HCI11CgXVywqT','mJqWmZq1nZjdtfHvqw0','BgfZDeLUzgv4t2y','yMLUyxj5igrPzMyGC2HHmJu2pq','BgLTAxq','B3v0Chv0tgLTAxq','zMLUz2vYChjPBNq','CMv2lxbHCNnL','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','Dg9tDhjPBMC','rKLmrv9ot1rFuKvhvuXbuG','kIOVx19WEwnHy2HLx18VkIO','AxntywzLsw50zwDLCG','AwrSzvr0Be1Z','C3rHBgu','ls1YB290','ls1UBY10zxH0y29UDG','AxneAxjLy3rVCNK','vfLqrv9dsefor0ve','BgLUDxG','zgLMzG','rKLmrv9srvzju0LptL9jtLzbteLe','C3bSAxq','BhmTzMLSzxm','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','oIHSAxrLCMfSkq','BwfW','Dg91y2G','Dg9mB2nHBgvmB3DLCKnHC2u','ls1MB3jTyxq9','yMfYzq','Agv4','sevbra','yMXVyG','B25Jzq','y3vYC29Y','DMfSDwvZ','CMvIDwLSza','ls1UBY1JB21TAxqTAwq','q09qsuve','ls1ZA2LWpq','r0Lux0nptu1btKrFrKfjteve','zxzLCNK','B2jQzwn0','CMvWBgfJzq','C2HVDW','BwvYz2uTyMfZzq','B2zMC2v0','C2vHCMnO','Dw5Yzwy','C3vIBw9KDwXL','lM1HCI1LzgL0lq','r0Lux1DpuKTtuefdrq','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','kIOVB2jQlYOQ','reLsrunut1jz','yMLUyxj5','oefnBun6CG','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','CM9VDa','ls1MAxjZDc1WyxjLBNq','kIOVlMnHy2HLlYOQ','kIOVyNvPBgqVkIO','kIOVlM51EhqVkIO','D2LUmZi','Bwv0ywrHDge','q1jfqvrfx0zjteu','CMvSyxrPDMu','zgvZDgLUyxrPB24','rKLmrv9ot1rFrK9vtKq','ywXSB2nvBNnHzMu','zw50CNK','CMvMCMvZAeLUqMfJA2DYB3vUza','y2f0lwzPBgu','lY5Flq','ywXS','C29YDa','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','zMLUzeLUzgv4','ls1ICMfUy2HLCW','y29Uy2f0','revmrvrfra','zgvJB2rL','Bwf4','D29YA3rYzwuG','CgXHDgzVCM0','DgHLBG','ls1Yzw1VDgvZ','CgLWzq','rKLmrv9btfjfqurzx0vysvnuuW','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','C2XPy2u','C3rKB3v0','lNbHCNq','mtiYmti5mePzqK5AAq','rvHju1rtx0rjuKvdve9swq','rvHju1rtx0zjteu','zMXVB3i','nZyXnZmXvffmBeDA','CMvMCY9OzwfKCY8','Aw5JBhvKzxm','lMDPDa','ls11BNrYywnRzwqTzMLSzxm9ywXS','y29UDgvUDenHBMrPzgf0zxm','DxbKyxrL','pZ8G','y2fWywnPDhK','rKLmrq','rKLmrv9ut09Ftefsr0u','ls1KyxrLlw9YzgvY','ruvysvnu','ls1ZDgfNzwq','Dgv4Da','kIOVDMvUDI8QkG','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','zgf0yq','sevbrca','zMLSzxmUzxHJBhvKzq','kIOVlNn2zwX0zs1RAxqVkIO','kIOVlM5LEhqVkIO','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','r0Lux1DpuKTuuKvfx0Xju1rFsu5wquXjra','C2HPzNq','kIOVlMfUz3vSyxiVkIO','Bg9N','zMLUza','DgLTzw91De1Z','C29YDgvK','C2nVCMu','kIOVlNbHCMnLBc1JywnOzs8QkG','uKvnt1rf','C3LTyM9SAwmTCMvM','mtzRqKrzq3i','kIOVDgvZDc9YDw5ZlYOQ','ls1ZAg9YDa','C3rYAw5NAwz5','ls1ICMfUy2G','C2HHmJu2','DhjPBq','yNvIyMXLvxa','zM9YlwvHy2GTCMvM','y2HHBMDLCW','z2v0','lMDPDc8','kIOVDgfYz2v0lYOQ','BgLZDa','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','ls12zxjPzNK','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','kIOVDMvUzg9YlYOQ','te9dquW','ls13B3jRDhjLzq','v09ss1nqqunfx1bbveHFsu5wquXjra','zMXHDe1HCa','yMfZzty0','C3rHDhvZ','BxrPBwvnCW','Dg9vChbLCKnHC2u','D29YA3nWywnLuM9VDa','Cgf0Aa','AxngAwXL','ywn0Aw9U','zxHLyW','ls1ZAg93lxrVCgXLDMvS','qMLUyxj5igzPBgvZia','vu5tvefhruq','AwDUB3jL','rKLmrv9xuKLurv9dt05gteLdva','uKvbrfK','zgLZCgXHEu5HBwu','igj5DgvZpq','nZi1oti4tLDivvvd','BgvUz3rO','yNjHBMnOia','zw5ZDxjLtg9HzgvK','ls1WB3jJzwXHAw49DJe','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','Bg9JA2vKia','zxjYB3i','ls1Uyw1Llxn0yxr1CW','u0Lhs0Lmta','tu9esuzjruq','ls1UBY1LEhqTzgLMzG','ls1Yzwn1CNnPDMu','uKvoqu1fra','BgLTAxrZ','u1rbr0ve','rKLmrv9qqvrix0vtq0fqrq'];_0x5465=function(){return _0x1f8f5c;};return _0x5465();}export async function readWorkspaceFileContentRange(_0x56384d,_0x5b5304,_0x26e652=0x9*0x1fd+-0x1740+0x55b,_0x14beb6=FILE_READ_LIMIT){const _0x1e5dc2=_0x4148b8;if(!Number[_0x1e5dc2(0x1bc)](_0x26e652)||_0x26e652<0x1*-0xc31+0xd49*0x1+-0x118||!Number[_0x1e5dc2(0x1bc)](_0x14beb6)||_0x14beb6<0x1*0x13ee+0xa21+-0x1e0e||_0x14beb6>FILE_READ_LIMIT)throw new Error(_0x1e5dc2(0x157));const _0x43842c=await resolveRegisteredWorkspaceRoot(_0x56384d),_0x5747bd=await resolveWorkspaceEntry(_0x43842c,_0x5b5304,![]),_0x40af39=await lstat(_0x5747bd);if(!_0x40af39[_0x1e5dc2(0x251)]())throw new Error(_0x1e5dc2(0x1ba));if(_0x26e652>_0x40af39[_0x1e5dc2(0x176)])throw new Error(_0x1e5dc2(0x157));const _0x525da6=Math[_0x1e5dc2(0x145)](_0x14beb6,_0x40af39[_0x1e5dc2(0x176)]-_0x26e652),_0xcc19f4=Buffer[_0x1e5dc2(0x1f7)](_0x525da6),_0x307a82=await open(_0x5747bd,'r');try{const {bytesRead:_0x1e716d}=await _0x307a82[_0x1e5dc2(0x17c)](_0xcc19f4,0xb*-0x1df+-0xc2*0x12+0x2239,_0x525da6,_0x26e652),_0x2d2999=_0x26e652+_0x1e716d;return{'path':relative(_0x43842c,_0x5747bd)[_0x1e5dc2(0x1c6)](sep)[_0x1e5dc2(0x188)]('/'),'size':_0x40af39[_0x1e5dc2(0x176)],'offset':_0x26e652,'contentBase64':_0xcc19f4[_0x1e5dc2(0x182)](-0x23e7+-0x403+-0x6*-0x6a7,_0x1e716d)[_0x1e5dc2(0x1b9)](_0x1e5dc2(0x24b)),'nextOffset':_0x2d2999<_0x40af39[_0x1e5dc2(0x176)]?_0x2d2999:null};}finally{await _0x307a82[_0x1e5dc2(0x15a)]();}}export async function readAllowedFileContentRange(_0xa6771c,_0x418f5d,_0x27d9a7=0x6*-0xd+-0x1056+0x10a4,_0x19e720=FILE_READ_LIMIT){const _0x4cdae2=_0x4148b8;if(!Number[_0x4cdae2(0x1bc)](_0x27d9a7)||_0x27d9a7<-0x22d5*0x1+-0x117b+0x30*0x117||!Number[_0x4cdae2(0x1bc)](_0x19e720)||_0x19e720<0x5d9+-0x1f9b+0x19c3||_0x19e720>FILE_READ_LIMIT)throw new Error(_0x4cdae2(0x157));const {file:_0x311743,metadata:_0x232bba}=await resolveAllowedFile(_0xa6771c,_0x418f5d);if(_0x27d9a7>_0x232bba[_0x4cdae2(0x176)])throw new Error(_0x4cdae2(0x157));const _0xc66c39=Math[_0x4cdae2(0x145)](_0x19e720,_0x232bba[_0x4cdae2(0x176)]-_0x27d9a7),_0x545a5a=Buffer[_0x4cdae2(0x1f7)](_0xc66c39),_0x5db71d=await open(_0x311743,'r');try{const {bytesRead:_0x1be58b}=await _0x5db71d[_0x4cdae2(0x17c)](_0x545a5a,-0x5b*-0x65+-0x2250+-0x197,_0xc66c39,_0x27d9a7),_0x44a437=_0x27d9a7+_0x1be58b;return{'path':_0x311743,'size':_0x232bba[_0x4cdae2(0x176)],'offset':_0x27d9a7,'contentBase64':_0x545a5a[_0x4cdae2(0x182)](0x2a9*-0x8+0xfd3*0x2+-0x2*0x52f,_0x1be58b)[_0x4cdae2(0x1b9)](_0x4cdae2(0x24b)),'nextOffset':_0x44a437<_0x232bba[_0x4cdae2(0x176)]?_0x44a437:null};}finally{await _0x5db71d[_0x4cdae2(0x15a)]();}}export async function readAllowedTextFile(_0x5ce9e2,_0x5d9ff3,_0x362428=-0x2659+-0x5*-0x67d+0x5e8,_0x5c898f=FILE_READ_LIMIT){const _0x592610=_0x4148b8,{file:_0x571a08,metadata:_0x3806d6}=await resolveAllowedFile(_0x5ce9e2,_0x5d9ff3);if(_0x3806d6[_0x592610(0x176)]>FILE_READ_LIMIT*(-0x1106+0x23*0x7f+-0x47))throw new Error(_0x592610(0x21d));if(!Number[_0x592610(0x1bc)](_0x362428)||_0x362428<0x1*0x463+0xa0d+0x1ce*-0x8||!Number[_0x592610(0x1bc)](_0x5c898f)||_0x5c898f<-0x705+-0x3*-0x90b+-0x141b||_0x5c898f>FILE_READ_LIMIT)throw new Error(_0x592610(0x157));const _0x3f4e2c=await readFile(_0x571a08),_0x4cc1b2=_0x3f4e2c[_0x592610(0x215)](0x78a+-0xe4d+-0x3*-0x241)||!isValidUtf8(_0x3f4e2c),_0x446447=Math[_0x592610(0x145)](_0x3f4e2c[_0x592610(0x25d)],_0x362428+_0x5c898f);if(_0x4cc1b2){const _0xc8d750=_0x3f4e2c[_0x592610(0x182)](_0x362428,_0x446447);return{'path':_0x571a08,'encoding':_0x592610(0x24b),'size':_0x3f4e2c[_0x592610(0x25d)],'content':_0xc8d750[_0x592610(0x1b9)](_0x592610(0x24b)),'truncated':_0x446447<_0x3f4e2c[_0x592610(0x25d)],'nextOffset':_0x446447<_0x3f4e2c[_0x592610(0x25d)]?_0x446447:null};}if(_0x362428>0x2050+-0x11bb+-0x1*0xe95&&_0x362428<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x362428]))throw new Error(_0x592610(0x157));let _0x1960d2=_0x446447;if(_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2])){while(_0x1960d2>_0x362428&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2]))_0x1960d2-=-0xe*0x39+0x69*0x3d+-0x15e6;if(_0x1960d2===_0x362428){_0x1960d2+=0x2ef*-0x2+-0x54e+0xb2d;while(_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]&&isUtf8ContinuationByte(_0x3f4e2c[_0x1960d2]))_0x1960d2+=-0x152d+0x62*-0x49+0x312*0x10;}}const _0x1607c4=_0x1960d2<_0x3f4e2c[_0x592610(0x25d)]?_0x1960d2:null;return{'path':_0x571a08,'encoding':_0x592610(0x153),'size':_0x3f4e2c[_0x592610(0x25d)],'content':new TextDecoder(_0x592610(0x153),{'fatal':!![]})[_0x592610(0x203)](_0x3f4e2c[_0x592610(0x182)](_0x362428,_0x1960d2)),'truncated':_0x1607c4!==null,'nextOffset':_0x1607c4};}export function normalizeFilePreviewPath(_0x45aed3){const _0x504b29=_0x4148b8;if(!/^sandbox:/iu[_0x504b29(0x194)](_0x45aed3))return _0x45aed3;let _0x201080;try{_0x201080=decodeURIComponent(_0x45aed3[_0x504b29(0x20c)](_0x45aed3[_0x504b29(0x14f)](':')+(-0xce+0x35*-0x53+0x2*0x8ff)));}catch{throw new Error(_0x504b29(0x13c));}const _0x2aa922=_0x201080[_0x504b29(0x1dc)](/^\/([a-z]:[\\/])/iu,'$1');if(_0x2aa922[_0x504b29(0x25d)]===-0x2635+0x5cf*0x1+-0x8f*-0x3a||/^[\\/]{2,}[?.](?:[\\/]|$)/u[_0x504b29(0x194)](_0x201080)||!isAbsolute(_0x2aa922)&&!win32[_0x504b29(0x163)](_0x2aa922)||_0x2aa922[_0x504b29(0x215)]('\x00')||_0x2aa922[_0x504b29(0x215)]('?')||_0x2aa922[_0x504b29(0x215)]('#'))throw new Error(_0x504b29(0x13c));return _0x2aa922;}async function resolveAllowedFile(_0x43795e,_0x57b14d){const _0x25754d=_0x4148b8;if(!isAbsolute(_0x43795e))throw new Error(_0x25754d(0x13c));const _0x349e12=await realpath(_0x43795e)[_0x25754d(0x18a)](_0x29916c=>{const _0xc30927=_0x25754d;if(_0x29916c[_0xc30927(0x14d)]===_0xc30927(0x172))throw new Error(_0xc30927(0x1f6));throw _0x29916c;}),_0x3b1303=await Promise[_0x25754d(0x1fc)](_0x57b14d[_0x25754d(0x1ca)](_0x5c561f=>realpath(_0x5c561f)));if(!isWithinAllowedRoot(_0x349e12,_0x3b1303))throw new Error(_0x25754d(0x13c));const _0x533a0c=await lstat(_0x349e12);if(!_0x533a0c[_0x25754d(0x251)]())throw new Error(_0x25754d(0x1ba));return{'file':_0x349e12,'metadata':_0x533a0c};}function isValidUtf8(_0x484eec){const _0x1b7b89=_0x4148b8;try{return new TextDecoder(_0x1b7b89(0x153),{'fatal':!![]})[_0x1b7b89(0x203)](_0x484eec),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x20a796){return(_0x20a796&-0x648+-0xa*-0x27a+-0x11bc)===0x13d0+-0x69*0x38+-0x1d4*-0x2;}export async function searchWorkspaceFiles(_0x267254,_0xa60e55,_0x42ec01,_0x1567da=SEARCH_RESULT_LIMIT,_0x36765a=![]){const _0x41af18=_0x4148b8,_0x3ac9d5=new WorkspaceFileIndex(_0x267254);try{return await _0x3ac9d5[_0x41af18(0x1e0)](_0xa60e55,_0x42ec01,_0x1567da,_0x36765a);}finally{_0x3ac9d5[_0x41af18(0x180)]();}}async function resolveRegisteredWorkspaceRoot(_0x11b2d1){const _0x35849d=_0x4148b8,_0x537595=await realpath(_0x11b2d1);if(normalizeWorkspacePath(_0x537595)!==normalizeWorkspacePath(_0x11b2d1))throw new Error(_0x35849d(0x168));return _0x537595;}async function resolveWorkspaceEntry(_0x42075c,_0x4f882f,_0x5334f1){const _0x56a0a5=await resolveRegisteredWorkspaceRoot(_0x42075c);return resolveWorkspaceEntryFromCanonicalRoot(_0x56a0a5,_0x4f882f,_0x5334f1);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x3eda1f,_0x440c31,_0x5ac7cf){const _0x48c65f=_0x4148b8,_0x401ebc=await resolveWorkspaceEntryMetadata(_0x3eda1f,_0x440c31);if(_0x5ac7cf?!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x1c1)]():!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x251)]()&&!_0x401ebc[_0x48c65f(0x1f2)][_0x48c65f(0x1c1)]())throw new Error(_0x5ac7cf?_0x48c65f(0x196):_0x48c65f(0x1ba));return _0x401ebc[_0x48c65f(0x250)];}async function resolveWorkspaceEntryMetadata(_0x3844b2,_0x3cbf88){const _0x26578b=_0x4148b8;if(_0x3cbf88[_0x26578b(0x215)]('\x00')||_0x3cbf88[_0x26578b(0x25d)]===-0x14dc+0x20ad+0x113*-0xb||_0x3cbf88[_0x26578b(0x1af)]('/')||_0x3cbf88[_0x26578b(0x1af)]('\x5c'))throw new Error(_0x26578b(0x13c));const _0x4b5b83=_0x3cbf88[_0x26578b(0x191)]('\x5c','/');if(_0x4b5b83[_0x26578b(0x1c6)]('/')[_0x26578b(0x140)](_0x379b81=>_0x379b81==='..'||_0x379b81===_0x26578b(0x216)))throw new Error(_0x26578b(0x13c));let _0x3861f0;try{_0x3861f0=await realpath(resolve(_0x3844b2,_0x4b5b83));}catch(_0x133dca){if(_0x133dca[_0x26578b(0x14d)]===_0x26578b(0x172))throw new Error(_0x26578b(0x1f6));throw _0x133dca;}const _0x434f4b=relative(_0x3844b2,_0x3861f0);if(isAbsolute(_0x434f4b)||_0x434f4b[_0x26578b(0x1af)]('..')||_0x434f4b==='..'||_0x434f4b[_0x26578b(0x1af)]('..'+sep))throw new Error(_0x26578b(0x13c));const _0x34d771=await lstat(_0x3861f0);return{'path':_0x3861f0,'metadata':_0x34d771};}async function inspectWorkspaceIndexEntry(_0x516aed,_0x5287ce,_0x5efabc){const _0x4d0e5a=_0x4148b8;try{const _0x426d8e=await resolveWorkspaceEntryMetadata(_0x516aed,_0x5287ce);if(!_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x251)]()&&!_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x1c1)]())return undefined;const _0x42216b=relative(_0x516aed,_0x426d8e[_0x4d0e5a(0x250)])[_0x4d0e5a(0x1c6)](sep)[_0x4d0e5a(0x188)]('/');return _0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x1c1)]()?{'path':_0x42216b,'name':_0x5efabc,'kind':_0x4d0e5a(0x1e7),'size':null,'modifiedAt':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x24d)]}:{'path':_0x42216b,'name':_0x5efabc,'kind':_0x4d0e5a(0x21c),'size':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x176)],'modifiedAt':_0x426d8e[_0x4d0e5a(0x1f2)][_0x4d0e5a(0x24d)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x173e45,_0x157935){const _0x3f0bba=_0x4148b8;return Buffer[_0x3f0bba(0x158)](JSON[_0x3f0bba(0x238)]({'path':_0x173e45,'name':_0x157935}))[_0x3f0bba(0x1b9)](_0x3f0bba(0x14b));}function decodeDirectoryCursor(_0x3d9bbb,_0x3ecd14){const _0x951493=_0x4148b8;if(_0x3d9bbb===undefined)return undefined;try{const _0x1b268c=JSON[_0x951493(0x144)](Buffer[_0x951493(0x158)](_0x3d9bbb,_0x951493(0x14b))[_0x951493(0x1b9)](_0x951493(0x19b)));if(typeof _0x1b268c!==_0x951493(0x1db)||_0x1b268c===null||_0x1b268c[_0x951493(0x250)]!==_0x3ecd14||typeof _0x1b268c[_0x951493(0x151)]!==_0x951493(0x16a))throw new Error();return _0x1b268c[_0x951493(0x151)];}catch{throw new Error(_0x951493(0x1b8));}}function encodeSearchCursor(_0x5ede44,_0x5cd9fd){const _0x6a0b6b=_0x4148b8;return Buffer[_0x6a0b6b(0x158)](JSON[_0x6a0b6b(0x238)]({'query':_0x5ede44,'path':_0x5cd9fd}))[_0x6a0b6b(0x1b9)](_0x6a0b6b(0x14b));}function decodeSearchCursor(_0x6cc4f0,_0x5e09e0){const _0x4eb959=_0x4148b8;if(_0x6cc4f0===undefined)return undefined;try{const _0x48abf6=JSON[_0x4eb959(0x144)](Buffer[_0x4eb959(0x158)](_0x6cc4f0,_0x4eb959(0x14b))[_0x4eb959(0x1b9)](_0x4eb959(0x19b)));if(typeof _0x48abf6!==_0x4eb959(0x1db)||_0x48abf6===null||_0x48abf6[_0x4eb959(0x160)]!==_0x5e09e0||typeof _0x48abf6[_0x4eb959(0x250)]!==_0x4eb959(0x16a))throw new Error();return _0x48abf6[_0x4eb959(0x250)];}catch{throw new Error(_0x4eb959(0x1b8));}}export function normalizeWorkspacePath(_0x39091b,_0x2eac98=_0x223f26()){const _0x2444f6=_0x4148b8;if(_0x39091b[_0x2444f6(0x25d)]===0x2c*0xca+0x552+-0x19*0x19a||_0x39091b[_0x2444f6(0x215)]('\u0000'))throw new Error(_0x2444f6(0x249));if(_0x2eac98===_0x2444f6(0x1f1)){if(/^\\\\[?.]/[_0x2444f6(0x194)](_0x39091b))throw new Error(_0x2444f6(0x152));const _0x2aa814=win32[_0x2444f6(0x17e)](_0x39091b[_0x2444f6(0x191)]('/','\x5c'));if(!win32[_0x2444f6(0x163)](_0x2aa814))throw new Error(_0x2444f6(0x1ea));return _0x2aa814[_0x2444f6(0x1dc)](/\\+$/,'')[_0x2444f6(0x167)]();}if(_0x2eac98!==_0x2444f6(0x1c3))throw new Error(_0x2444f6(0x193));const _0x34cbf2=posix[_0x2444f6(0x17e)](_0x39091b);if(!posix[_0x2444f6(0x163)](_0x34cbf2))throw new Error(_0x2444f6(0x1ea));return _0x34cbf2==='/'?_0x34cbf2:_0x34cbf2[_0x2444f6(0x1dc)](/\/+$/,'');}export function isWithinAllowedRoot(_0xc73fb2,_0x5e4e62,_0x3dd851=_0x223f26()){const _0x43e2ef=_0x4148b8,_0x389ea2=normalizeWorkspacePath(_0xc73fb2,_0x3dd851),_0x1f0c5c=_0x3dd851===_0x43e2ef(0x1f1)?win32:posix;return _0x5e4e62[_0x43e2ef(0x140)](_0x4ec562=>{const _0x1c626d=_0x43e2ef,_0x1e02b4=normalizeWorkspacePath(_0x4ec562,_0x3dd851),_0xbedb8f=_0x1f0c5c[_0x1c626d(0x1f4)](_0x1e02b4,_0x389ea2);return _0xbedb8f===''||!_0xbedb8f[_0x1c626d(0x1af)]('..')&&!_0x1f0c5c[_0x1c626d(0x163)](_0xbedb8f);});}export async function inspectWorkspace(_0x1c6601,_0x536907){const _0x78749e=_0x4148b8,_0x28f435=await realpath(_0x1c6601),_0x5883dc=await Promise[_0x78749e(0x1fc)](_0x536907[_0x78749e(0x1ca)](_0x3ccd60=>realpath(_0x3ccd60))),_0x2f1610=await stat(_0x28f435);if(!_0x2f1610[_0x78749e(0x1c1)]()||!isWithinAllowedRoot(_0x28f435,_0x5883dc))throw new Error(_0x78749e(0x168));try{const _0x2b8f2c=await readGitSummary(_0x28f435);return{'path':_0x28f435,'kind':_0x78749e(0x1e4),'gitSummary':_0x2b8f2c};}catch(_0x4ea86e){if(_0x4ea86e instanceof GitCommandError&&_0x4ea86e[_0x78749e(0x14d)]===-0x1a4e+-0x5c*0x2b+0x2a42||isGitUnavailable(_0x4ea86e))return{'path':_0x28f435,'kind':_0x78749e(0x1e7)};throw _0x4ea86e;}}export async function readGitSummary(_0x408953){const _0x558f21=_0x4148b8,_0x165dca=(await runReadOnlyGit(_0x408953,[_0x558f21(0x1b7),_0x558f21(0x142)]))[_0x558f21(0x221)][_0x558f21(0x23b)](),_0xd221e7=await runReadOnlyGitAllowFailure(_0x408953,[_0x558f21(0x1b7),_0x558f21(0x244),_0x558f21(0x1d0)]),_0x546db6=await runReadOnlyGitAllowFailure(_0x408953,[_0x558f21(0x234),_0x558f21(0x197),_0x558f21(0x237),_0x558f21(0x1d0)]),_0x303390={'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT},_0x413e83=await runReadOnlyGit(_0x408953,[_0x558f21(0x24c),_0x558f21(0x260)],_0x303390);return{'commonDir':_0x165dca,'head':_0xd221e7[_0x558f21(0x14d)]===-0x59*-0x33+-0x3ce*-0x8+-0x302b?_0xd221e7[_0x558f21(0x221)][_0x558f21(0x23b)]():'','branch':_0x546db6[_0x558f21(0x14d)]===-0x3*0xcc7+0x21d6+0x47f?_0x546db6[_0x558f21(0x221)][_0x558f21(0x23b)]():null,'dirty':_0x413e83[_0x558f21(0x159)][_0x558f21(0x25d)]>-0x3*-0x5ca+0x66b*0x5+-0x3175*0x1,'snapshot':summarizeText(_0x413e83[_0x558f21(0x221)])};}export function assertSafeGitRef(_0x51fb4b){const _0x195151=_0x4148b8;if(!REF_PATTERN[_0x195151(0x194)](_0x51fb4b))throw new Error(_0x195151(0x169));}export async function readRestrictedDiff(_0x89d501,_0x512ab2,_0x3602c0){const _0x436f1c=_0x4148b8;assertSafeGitRef(_0x512ab2),assertSafeGitRef(_0x3602c0);const _0x3c276e=await runReadOnlyGit(_0x89d501,[_0x436f1c(0x1c4),_0x436f1c(0x137),_0x436f1c(0x1c0),_0x512ab2,_0x3602c0]),_0x1eb697=_0x3c276e[_0x436f1c(0x159)][_0x436f1c(0x215)](0x1e53*-0x1+0x67c+-0x11*-0x167)||_0x3c276e[_0x436f1c(0x221)][_0x436f1c(0x215)](_0x436f1c(0x255));if(_0x1eb697)return{'binary':!![],'summary':_0x436f1c(0x1b3)+createHash(_0x436f1c(0x23a))[_0x436f1c(0x219)](_0x3c276e[_0x436f1c(0x159)])[_0x436f1c(0x1a2)](_0x436f1c(0x1cf))+_0x436f1c(0x25b)+_0x3c276e[_0x436f1c(0x159)][_0x436f1c(0x25d)],'truncated':_0x3c276e[_0x436f1c(0x1ae)]};return{'binary':![],'text':_0x3c276e[_0x436f1c(0x221)],'truncated':_0x3c276e[_0x436f1c(0x1ae)]};}function currentBranchFromStatusHeader(_0x4c3b5a){const _0x50b4cc=_0x4148b8,_0x257de5=_0x4c3b5a[_0x50b4cc(0x20c)](0x2*0x47d+0x2275+-0x2b6c*0x1);if(_0x257de5[_0x50b4cc(0x1af)](_0x50b4cc(0x225)))return null;const _0x6db9d4=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x50b4cc(0x253)](_0x257de5);if(_0x6db9d4!==null)return _0x6db9d4[-0x1*-0xe28+-0x22bf+0x1498]??null;return _0x257de5[_0x50b4cc(0x1c6)](_0x50b4cc(0x16b))[0x1*-0x259d+0x56e+0x202f]?.[_0x50b4cc(0x1c6)]('\x20')[-0xfd+0x260d+-0x2510]??null;}export async function listGitWorktrees(_0x52a59e){const _0x5f3cf0=_0x4148b8,_0x58606e=await runReadOnlyGit(_0x52a59e,[_0x5f3cf0(0x156),_0x5f3cf0(0x242),_0x5f3cf0(0x15e),'-z'],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x12dedd=normalizeWorkspacePath(await realpath(_0x52a59e)),_0x1191b0=[];let _0x5dc18c=_0x58606e[_0x5f3cf0(0x1ae)];for(const _0x117693 of _0x58606e[_0x5f3cf0(0x221)][_0x5f3cf0(0x1c6)]('\x00\x00')){if(_0x117693[_0x5f3cf0(0x25d)]===-0x1562+-0x2057*-0x1+0x21*-0x55)continue;if(_0x1191b0[_0x5f3cf0(0x25d)]>=GIT_WORKTREE_LIST_LIMIT){_0x5dc18c=!![];break;}const _0x5558d5=_0x117693[_0x5f3cf0(0x1c6)]('\x00')[_0x5f3cf0(0x186)](_0x253479=>_0x253479[_0x5f3cf0(0x25d)]>0x6bb*0x5+0x1409+0x4*-0xd6c);if(_0x5558d5[_0x5f3cf0(0x140)](_0x18e961=>_0x18e961===_0x5f3cf0(0x1ce)))continue;const _0x5a58ed=_0x5558d5[_0x5f3cf0(0x22e)](_0x4aaff9=>_0x4aaff9[_0x5f3cf0(0x1af)](_0x5f3cf0(0x205))),_0xa72e66=_0x5558d5[_0x5f3cf0(0x22e)](_0xd9394=>_0xd9394[_0x5f3cf0(0x1af)](_0x5f3cf0(0x225))),_0x4b3632=_0x5a58ed?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x205)[_0x5f3cf0(0x25d)]),_0x1fdf1a=_0xa72e66?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x225)[_0x5f3cf0(0x25d)]);if(_0x4b3632===undefined||_0x4b3632[_0x5f3cf0(0x25d)]===-0x8e2+0x7fa*0x2+-0x712||_0x1fdf1a===undefined||!/^[0-9a-f]{40,64}$/u[_0x5f3cf0(0x194)](_0x1fdf1a)){if(_0x58606e[_0x5f3cf0(0x1ae)]){_0x5dc18c=!![];continue;}throw new Error(_0x5f3cf0(0x22a));}const _0x37442f=_0x5558d5[_0x5f3cf0(0x22e)](_0x1e43cd=>_0x1e43cd[_0x5f3cf0(0x1af)](_0x5f3cf0(0x25e))),_0x48a037=_0x37442f?.[_0x5f3cf0(0x20c)](_0x5f3cf0(0x25e)[_0x5f3cf0(0x25d)]),_0x54d144=_0x48a037===undefined?null:_0x48a037[_0x5f3cf0(0x1af)](_0x5f3cf0(0x214))?_0x48a037[_0x5f3cf0(0x20c)](_0x5f3cf0(0x214)[_0x5f3cf0(0x25d)]):_0x48a037,_0x1a28e7=(basename(_0x4b3632)[_0x5f3cf0(0x23b)]()||_0x54d144||_0x1fdf1a[_0x5f3cf0(0x20c)](-0xc85*-0x2+0x1aaf+-0x33b9,-0x1354+0x4f*0x79+0x3f*-0x49))[_0x5f3cf0(0x20c)](0x4f*0x53+0x1*0xb76+-0x2513,-0x5*-0x5b3+-0x16f3+-0x38c);_0x1191b0[_0x5f3cf0(0x17f)]({'path':_0x4b3632,'directoryName':_0x1a28e7,'branch':_0x54d144,'head':_0x1fdf1a,'current':normalizeWorkspacePath(_0x4b3632)===_0x12dedd,'locked':_0x5558d5[_0x5f3cf0(0x140)](_0x15d63e=>_0x15d63e===_0x5f3cf0(0x19d)||_0x15d63e[_0x5f3cf0(0x1af)](_0x5f3cf0(0x132))),'prunable':_0x5558d5[_0x5f3cf0(0x140)](_0x3fb7ae=>_0x3fb7ae===_0x5f3cf0(0x174)||_0x3fb7ae[_0x5f3cf0(0x1af)](_0x5f3cf0(0x165)))});}return{'entries':_0x1191b0,'truncated':_0x5dc18c};}export async function readCurrentChangesSummary(_0x216e77){const _0x47f00f=_0x4148b8,_0x445ebf=await runReadOnlyGit(_0x216e77,[_0x47f00f(0x24c),_0x47f00f(0x260),'-z',_0x47f00f(0x239),_0x47f00f(0x217)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x45c109=_0x445ebf[_0x47f00f(0x221)][_0x47f00f(0x1c6)]('\x00'),_0x5cf6a3=_0x45c109[_0x47f00f(0x22b)]()??'',_0x1f2efa=[];for(let _0x131ed5=-0xa*-0x1d5+0x904+-0x1*0x1b56;_0x131ed5<_0x45c109[_0x47f00f(0x25d)];_0x131ed5+=0x126f+0x1ade*-0x1+0x870*0x1){const _0x14344e=_0x45c109[_0x131ed5];if(_0x14344e[_0x47f00f(0x25d)]<0x244a+0x36a+0x10*-0x27b)continue;const _0x12e542=_0x14344e[-0x13da+-0x1*-0x26f9+0x1bd*-0xb],_0x3f2234=_0x14344e[0x142*-0x16+0x1b18+0x95*0x1],_0x3c4ed4=_0x14344e[_0x47f00f(0x20c)](-0xaee+-0x9ca+0x14bb);if(_0x12e542==='?'&&_0x3f2234==='?'){_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x14c),'change':_0x47f00f(0x155)});continue;}_0x12e542!=='\x20'&&_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x13b),'change':gitChange(_0x12e542)});_0x3f2234!=='\x20'&&_0x1f2efa[_0x47f00f(0x17f)]({'path':_0x3c4ed4,'state':_0x47f00f(0x256),'change':gitChange(_0x3f2234)});if(_0x12e542==='R'||_0x12e542==='C'||_0x3f2234==='R'||_0x3f2234==='C')_0x131ed5+=-0xb2*-0x31+-0x1*-0x227e+-0x448f;}return{'branch':_0x5cf6a3[_0x47f00f(0x1af)](_0x47f00f(0x170))?currentBranchFromStatusHeader(_0x5cf6a3):null,'changes':_0x1f2efa};}export async function listInitializedSubmodulePaths(_0x1a3374){const _0x4100ee=_0x4148b8,_0x4849f2=await runReadOnlyGit(_0x1a3374,[_0x4100ee(0x1e2),_0x4100ee(0x24c),_0x4100ee(0x138)],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x4849f2[_0x4100ee(0x221)][_0x4100ee(0x1c6)](/\r?\n/)[_0x4100ee(0x24a)](_0x5ce08b=>{const _0x1f6be1=_0x4100ee;if(_0x5ce08b[_0x1f6be1(0x25d)]<-0x1820+-0x2358+0x3ba2)return[];const _0x34d6ae=_0x5ce08b[-0x2179+-0x1*-0x89+-0x2*-0x1078];if(_0x34d6ae==='-')return[];const _0x186f66=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x1f6be1(0x253)](_0x5ce08b),_0x985689=_0x186f66?.[0x14e0+0x373+-0x1852*0x1]?.[_0x1f6be1(0x191)]('\x5c','/');return _0x985689===undefined||_0x985689[_0x1f6be1(0x25d)]===-0x1175+-0x1*-0x1983+-0x1*0x80e?[]:[_0x985689];})[_0x4100ee(0x1fd)]((_0x1ebcc4,_0x783164)=>_0x1ebcc4[_0x4100ee(0x198)](_0x783164));}export async function resolveGitRepository(_0x33bb1f,_0x31b397,_0x2ead68){const _0x26e1e9=_0x4148b8,_0x5d5ec3=await realpath(_0x33bb1f);if(_0x31b397[_0x26e1e9(0x25d)]===-0x2d*0xcc+-0x1966+0x3d42)return _0x5d5ec3;if(_0x31b397[_0x26e1e9(0x215)]('\x00')||_0x31b397[_0x26e1e9(0x1af)]('/')||_0x31b397[_0x26e1e9(0x1af)]('\x5c')||_0x31b397[_0x26e1e9(0x1c6)]('/')[_0x26e1e9(0x140)](_0x50b55c=>_0x50b55c[_0x26e1e9(0x25d)]===0x1f9a+-0x18a7+-0x3*0x251||_0x50b55c==='.'||_0x50b55c==='..'))throw new Error(_0x26e1e9(0x18d));try{const _0x5e946b=resolve(_0x5d5ec3,_0x31b397),_0x545c3a=await realpath(_0x5e946b);if(normalizeWorkspacePath(_0x5e946b)!==normalizeWorkspacePath(_0x545c3a)||!isWithinAllowedRoot(_0x545c3a,[_0x5d5ec3]))throw new Error(_0x26e1e9(0x1aa));if(_0x2ead68!==undefined){if(!_0x2ead68[_0x26e1e9(0x215)](_0x31b397))throw new Error(_0x26e1e9(0x1aa));return _0x545c3a;}return await assertGitSuperprojectChain(_0x5d5ec3,_0x545c3a),_0x545c3a;}catch{throw new Error(_0x26e1e9(0x18d));}}export async function resolveGitRepositoryTarget(_0x167aab,_0x203ce9,_0xb5f2a0,_0x2b1135){const _0x9cfda2=_0x4148b8;if(_0xb5f2a0===undefined)return resolveGitRepository(_0x167aab,_0x203ce9,_0x2b1135);if(_0x203ce9[_0x9cfda2(0x25d)]!==0x1*-0x955+0x1219+-0x2*0x462||_0xb5f2a0[_0x9cfda2(0x25d)]===0x159e+-0x1*-0x1639+-0x2bd7||_0xb5f2a0[_0x9cfda2(0x25d)]>-0x311+-0x3*-0x262+0x9*0x153||_0xb5f2a0[_0x9cfda2(0x215)]('\x00'))throw new Error(_0x9cfda2(0x18d));const _0x505fb0=normalizeWorkspacePath(_0xb5f2a0),_0x2fc3ac=await listGitWorktrees(_0x167aab),_0x3388ec=_0x2fc3ac[_0x9cfda2(0x195)][_0x9cfda2(0x22e)](_0x1bf836=>normalizeWorkspacePath(_0x1bf836[_0x9cfda2(0x250)])===_0x505fb0);if(_0x3388ec===undefined||_0x3388ec[_0x9cfda2(0x174)])throw new Error(_0x9cfda2(0x18d));try{return await realpath(_0x3388ec[_0x9cfda2(0x250)]);}catch{throw new Error(_0x9cfda2(0x18d));}}async function assertGitSuperprojectChain(_0x1451a3,_0xcf3a87){const _0x44c58a=_0x4148b8,_0x13e20f=normalizeWorkspacePath(_0x1451a3);let _0x3871aa=_0xcf3a87;const _0x28c5d7=new Set();for(let _0x41f19e=-0x714+-0x1e7b+0x258f;_0x41f19e<0x818*0x1+-0x1568+0xd90;_0x41f19e+=-0x1*0x2498+-0xad3+-0x5*-0x97c){const _0x760531=normalizeWorkspacePath(_0x3871aa);if(_0x760531===_0x13e20f)return;if(_0x28c5d7[_0x44c58a(0x17d)](_0x760531))throw new Error(_0x44c58a(0x1aa));_0x28c5d7[_0x44c58a(0x164)](_0x760531);const _0x18808e=await runReadOnlyGit(_0x3871aa,[_0x44c58a(0x1b7),_0x44c58a(0x254),_0x44c58a(0x161)]),[_0x1e337f,_0x3a3ae1]=_0x18808e[_0x44c58a(0x221)][_0x44c58a(0x1c6)](/\r?\n/);if(_0x1e337f===undefined||_0x3a3ae1===undefined||_0x3a3ae1[_0x44c58a(0x25d)]===-0x2383+0x14f7+0x2*0x746)throw new Error(_0x44c58a(0x1aa));const _0x2740f0=await realpath(_0x1e337f),_0x1db666=await realpath(_0x3a3ae1);if(normalizeWorkspacePath(_0x2740f0)!==_0x760531||normalizeWorkspacePath(_0x1db666)===_0x760531||!isWithinAllowedRoot(_0x1db666,[_0x1451a3])||!isWithinAllowedRoot(_0x3871aa,[_0x1db666]))throw new Error(_0x44c58a(0x1aa));_0x3871aa=_0x1db666;}throw new Error(_0x44c58a(0x1aa));}export async function listGitHistoryRefs(_0x5da424){const _0x4d4e55=_0x4148b8,_0x56551e=await runReadOnlyGit(_0x5da424,[_0x4d4e55(0x23d),_0x4d4e55(0x243),_0x4d4e55(0x173),_0x4d4e55(0x141)],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT});return _0x56551e[_0x4d4e55(0x221)][_0x4d4e55(0x1c6)](/\r?\n/)[_0x4d4e55(0x24a)](_0x2a105c=>{const _0x2ab5bc=_0x4d4e55,[_0x204363,_0x28f866,_0x443aee,_0x5c2a5d,_0x23b029]=_0x2a105c[_0x2ab5bc(0x1c6)]('\x09');if(_0x204363===undefined||_0x28f866===undefined||_0x443aee===undefined||_0x23b029===undefined||_0x23b029[_0x2ab5bc(0x25d)]>0x3c3*0x1+-0xbeb+0x20a*0x4||!/^[0-9a-f]{40,64}$/[_0x2ab5bc(0x194)](_0x443aee))return[];const _0x5d0301=_0x204363[_0x2ab5bc(0x1af)](_0x2ab5bc(0x214))?_0x2ab5bc(0x247):_0x204363[_0x2ab5bc(0x1af)](_0x2ab5bc(0x1a3))?_0x2ab5bc(0x233):undefined;return _0x5d0301===undefined?[]:[{'name':_0x204363,'displayName':_0x28f866,'kind':_0x5d0301,'hash':_0x443aee,'current':_0x5c2a5d==='*'}];})[_0x4d4e55(0x1fd)]((_0x240d24,_0x335bf8)=>_0x240d24[_0x4d4e55(0x16c)][_0x4d4e55(0x198)](_0x335bf8[_0x4d4e55(0x16c)])||_0x240d24[_0x4d4e55(0x25a)][_0x4d4e55(0x198)](_0x335bf8[_0x4d4e55(0x25a)]));}function selectedHistoryRefs(_0x264e8f,_0x4eb7af){const _0x5ec09c=_0x4148b8;if(_0x4eb7af===undefined||_0x4eb7af[_0x5ec09c(0x25d)]===0x217d*-0x1+0x11*-0x1eb+0x2f*0x168)return _0x264e8f;const _0x1abca0=[...new Set(_0x4eb7af)],_0x369a96=_0x1abca0[_0x5ec09c(0x1ca)](_0x492f2f=>_0x264e8f[_0x5ec09c(0x22e)](_0x3aabad=>_0x3aabad[_0x5ec09c(0x151)]===_0x492f2f));if(_0x369a96[_0x5ec09c(0x140)](_0x14f74a=>_0x14f74a===undefined))throw new Error(_0x5ec09c(0x229));return _0x369a96;}function historyCursor(_0x40188b,_0x430928){const _0x20c431=_0x4148b8;return Buffer[_0x20c431(0x158)](JSON[_0x20c431(0x238)]({'offset':_0x40188b,'fingerprint':_0x430928}))[_0x20c431(0x1b9)](_0x20c431(0x14b));}function parseHistoryCursor(_0x3ac63a,_0x4c3022){const _0x45bf88=_0x4148b8;if(_0x3ac63a===undefined)return-0x19*0x59+-0x1bd*0x9+0x1856;try{const _0x1ffdbf=JSON[_0x45bf88(0x144)](Buffer[_0x45bf88(0x158)](_0x3ac63a,_0x45bf88(0x14b))[_0x45bf88(0x1b9)](_0x45bf88(0x19b)));if(!Number[_0x45bf88(0x1a6)](_0x1ffdbf[_0x45bf88(0x1df)])||_0x1ffdbf[_0x45bf88(0x1df)]<0x1bde+-0x1*0x16d3+-0x1*0x50b||_0x1ffdbf[_0x45bf88(0x1b6)]!==_0x4c3022)throw new Error(_0x45bf88(0x1aa));return _0x1ffdbf[_0x45bf88(0x1df)];}catch{throw new Error(_0x45bf88(0x1eb));}}export async function readGitHistory(_0x15e332,_0x24eea9){const _0x2aee87=_0x4148b8,_0x3cdce2=await listGitHistoryRefs(_0x15e332),_0x5e7fa2=selectedHistoryRefs(_0x3cdce2,_0x24eea9[_0x2aee87(0x146)]);if(_0x5e7fa2[_0x2aee87(0x25d)]===0x5*-0x6eb+0x16*-0x16b+-0x1*-0x41c9)return{'commits':[],'nextCursor':null};const _0x477e4c=_0x24eea9[_0x2aee87(0x1b4)]??-0xa92+-0x979+0x21*0x9d;if(!Number[_0x2aee87(0x1a6)](_0x477e4c)||_0x477e4c<0x4*-0x7df+-0x1*-0x25a6+0x53*-0x13||_0x477e4c>-0x1c0+-0xcfb+-0x4f*-0x31)throw new Error(_0x2aee87(0x20b));const _0xb79488=_0x5e7fa2[_0x2aee87(0x1ca)](_0x5ca677=>_0x5ca677[_0x2aee87(0x151)])[_0x2aee87(0x1fd)](),_0x8b59e2=_0x24eea9[_0x2aee87(0x146)]===undefined||_0x24eea9[_0x2aee87(0x146)][_0x2aee87(0x25d)]===0xb*-0x1cd+0x8f1+0xade||_0x5e7fa2[_0x2aee87(0x25d)]===_0x3cdce2[_0x2aee87(0x25d)]&&_0x5e7fa2[_0x2aee87(0x1da)](_0x45abd5=>_0x3cdce2[_0x2aee87(0x140)](_0x1c3d19=>_0x1c3d19[_0x2aee87(0x151)]===_0x45abd5[_0x2aee87(0x151)])),_0x503b21=_0x8b59e2?[_0x2aee87(0x200),_0x2aee87(0x208)]:_0xb79488,_0x2121da=createHash(_0x2aee87(0x23a))[_0x2aee87(0x219)](_0x5e7fa2[_0x2aee87(0x1ca)](_0x387efc=>_0x387efc[_0x2aee87(0x151)]+'\x00'+_0x387efc[_0x2aee87(0x154)])[_0x2aee87(0x1fd)]()[_0x2aee87(0x188)]('\x00'))[_0x2aee87(0x1a2)](_0x2aee87(0x1cf)),_0xc311f5=parseHistoryCursor(_0x24eea9[_0x2aee87(0x1d3)],_0x2121da),_0x4722a3=await runReadOnlyGit(_0x15e332,[_0x2aee87(0x22d),_0x2aee87(0x166),_0x2aee87(0x21e),_0x2aee87(0x1d8)+_0xc311f5,_0x2aee87(0x16e)+(_0x477e4c+(-0x20f0+-0x69c+-0x1*-0x278d)),'-z',_0x2aee87(0x1c8),..._0x503b21,'--'],{'timeoutMs':GIT_HISTORY_TIMEOUT_MS}),_0x5795d5=new Map();for(const _0x23f582 of _0x3cdce2){const _0x11d369=_0x5795d5[_0x2aee87(0x23f)](_0x23f582[_0x2aee87(0x154)])??[];_0x11d369[_0x2aee87(0x17f)](_0x23f582[_0x2aee87(0x25a)]),_0x5795d5[_0x2aee87(0x177)](_0x23f582[_0x2aee87(0x154)],_0x11d369);}const _0x36d517=_0x4722a3[_0x2aee87(0x221)][_0x2aee87(0x1c6)]('\x00'),_0x411f1b=[];for(let _0x2d177c=0x12d*0x21+0x1dc8+-0x4495;_0x2d177c+(-0x2434+0x17bb+0x63f*0x2)<_0x36d517[_0x2aee87(0x25d)];_0x2d177c+=0x4*-0x92+-0x16*-0x37+-0xa*0x3e){const [_0x5a6fa2,_0x4df1cd='',_0x2cd99e='',_0x26a53c='',_0x466776='0',_0x40b35f='']=_0x36d517[_0x2aee87(0x20c)](_0x2d177c,_0x2d177c+(-0x1a3*0x5+-0x210e+0x2943));if(_0x5a6fa2===undefined||!/^[0-9a-f]{40,64}$/[_0x2aee87(0x194)](_0x5a6fa2))continue;_0x411f1b[_0x2aee87(0x17f)]({'hash':_0x5a6fa2,'parents':_0x4df1cd[_0x2aee87(0x25d)]===0xd9*0x13+-0x682*-0x1+-0x169d?[]:_0x4df1cd[_0x2aee87(0x1c6)]('\x20'),'authorName':_0x2cd99e,'authorEmail':_0x26a53c,'committedAt':Number(_0x466776)*(-0x559*-0x7+-0x20f6*-0x1+-0x427d*0x1),'subject':_0x40b35f,'refs':_0x5795d5[_0x2aee87(0x23f)](_0x5a6fa2)??[]});}const _0xe4656b=_0x411f1b[_0x2aee87(0x25d)]>_0x477e4c;return{'commits':_0x411f1b[_0x2aee87(0x20c)](-0x43*0x61+-0x8*-0x2f9+0x19b,_0x477e4c),'nextCursor':_0xe4656b?historyCursor(_0xc311f5+_0x477e4c,_0x2121da):null};}async function assertHistoryCommitReachable(_0x1252bd,_0x529bd3,_0x148922){const _0x4ee98f=_0x4148b8;if(!/^[0-9a-f]{40,64}$/[_0x4ee98f(0x194)](_0x529bd3))throw new Error(_0x4ee98f(0x223));const _0x39b95a=selectedHistoryRefs(await listGitHistoryRefs(_0x1252bd),_0x148922);for(const _0xab1389 of _0x39b95a){const _0x218216=await runReadOnlyGitAllowFailure(_0x1252bd,[_0x4ee98f(0x1de),_0x4ee98f(0x184),_0x529bd3,_0xab1389[_0x4ee98f(0x151)]]);if(_0x218216[_0x4ee98f(0x14d)]===-0x1eef+-0x1382+-0x3271*-0x1)return;}throw new Error(_0x4ee98f(0x223));}export async function readGitHistoryFiles(_0x2b5fc3,_0x4da142,_0x56e744){const _0x24a969=_0x4148b8;await assertHistoryCommitReachable(_0x2b5fc3,_0x4da142,_0x56e744);const _0x382037=await runReadOnlyGit(_0x2b5fc3,[_0x24a969(0x178),_0x24a969(0x1bf),_0x24a969(0x1ed),_0x24a969(0x1d6),'-r','-z','-M','-C',_0x24a969(0x134),_0x4da142],{'timeoutMs':GIT_STATUS_TIMEOUT_MS,'outputLimit':GIT_LARGE_OUTPUT_LIMIT}),_0x5fa00e=_0x382037[_0x24a969(0x221)][_0x24a969(0x1c6)]('\x00'),_0x24315c=[];for(let _0x539b96=-0xa5c+0x24f4+0x353*-0x8;_0x539b96<_0x5fa00e[_0x24a969(0x25d)];_0x539b96+=0x351+-0x2086*-0x1+-0xbf2*0x3){const _0x534317=_0x5fa00e[_0x539b96];if(_0x534317===undefined||_0x534317[_0x24a969(0x25d)]===0x129f+0x9a9+-0x1c48)continue;const _0x16edb8=_0x534317[0x403*-0x5+-0x16f+0x157e]??'M';if(_0x16edb8==='R'||_0x16edb8==='C'){const _0x44c352=_0x5fa00e[_0x539b96+(0x23*-0x43+0x1*0x178+0x3d9*0x2)],_0x3b7616=_0x5fa00e[_0x539b96+(-0x4*0x3af+0x1dfa+0x41*-0x3c)];if(_0x44c352!==undefined&&_0x3b7616!==undefined)_0x24315c[_0x24a969(0x17f)]({'path':_0x3b7616,'previousPath':_0x44c352,'change':gitChange(_0x16edb8)});_0x539b96+=-0x54*0x52+0x1341+0x7a9;}else{const _0x2d13cb=_0x5fa00e[_0x539b96+(-0x13*-0xe1+0x1b25*0x1+0xe9d*-0x3)];if(_0x2d13cb!==undefined)_0x24315c[_0x24a969(0x17f)]({'path':_0x2d13cb,'change':gitChange(_0x16edb8)});_0x539b96+=-0x20bd+0x2d7*-0xb+0x1*0x3ffb;}}return _0x24315c;}export async function readGitHistoryFileDiff(_0x40c4a3,_0x4a4f4c,_0x306f8d,_0x2babf7,_0x400131){const _0x33ac6d=_0x4148b8;await assertHistoryCommitReachable(_0x40c4a3,_0x4a4f4c,_0x2babf7);const _0x13591f=safeGitWorkspacePath(_0x306f8d),_0x1255bc=_0x400131===undefined?undefined:safeGitWorkspacePath(_0x400131),_0x27a38f=await runReadOnlyGit(_0x40c4a3,[_0x33ac6d(0x1dd),_0x33ac6d(0x1cd),_0x33ac6d(0x1ed),_0x33ac6d(0x137),_0x33ac6d(0x1c0),_0x4a4f4c,'--',_0x33ac6d(0x1c9)+_0x13591f,..._0x1255bc===undefined||_0x1255bc===_0x13591f?[]:[_0x33ac6d(0x1c9)+_0x1255bc]]),_0x162c07=_0x27a38f[_0x33ac6d(0x159)][_0x33ac6d(0x215)](0x1775+0x1*-0x1b05+0x390)||_0x27a38f[_0x33ac6d(0x221)][_0x33ac6d(0x215)](_0x33ac6d(0x255));if(_0x162c07)return{'binary':!![],'summary':_0x33ac6d(0x1b3)+createHash(_0x33ac6d(0x23a))[_0x33ac6d(0x219)](_0x27a38f[_0x33ac6d(0x159)])[_0x33ac6d(0x1a2)](_0x33ac6d(0x1cf))+_0x33ac6d(0x25b)+_0x27a38f[_0x33ac6d(0x159)][_0x33ac6d(0x25d)],'truncated':_0x27a38f[_0x33ac6d(0x1ae)]};return{'binary':![],'text':_0x27a38f[_0x33ac6d(0x221)],'truncated':_0x27a38f[_0x33ac6d(0x1ae)]};}export async function readGitHistoryFileContentRange(_0x49d072,_0x55af28,_0x4c413b,_0x1ccad8,_0x42c03a,_0x1daed9){const _0x449d38=_0x4148b8;if(!Number[_0x449d38(0x1bc)](_0x1ccad8)||_0x1ccad8<-0x1*0x108+0x273*-0x7+0x122d||!Number[_0x449d38(0x1bc)](_0x42c03a)||_0x42c03a<-0x2*0x3c4+0xa6*-0xf+-0x9*-0x1eb||_0x42c03a>(-0x268a+-0x11*-0x21d+0x35*0xd)*(-0x1a54+0x368*-0x4+-0x15fa*-0x2)*(0x1*0x13b+0x5db*-0x3+0x1456)||_0x1ccad8+_0x42c03a>(0x1631+0x28f*0xc+-0x34d1)*(-0xf1d*0x1+0x8e*0x41+0x1*-0x10f1)*(-0x1*0xc16+0x1d7e+0x2*-0x6b4))throw new Error(_0x449d38(0x157));await assertHistoryCommitReachable(_0x49d072,_0x55af28,_0x1daed9);const _0x16f681=safeGitWorkspacePath(_0x4c413b),_0xe0ffb5=_0x55af28+':'+_0x16f681,_0xdf2324=await runReadOnlyGit(_0x49d072,[_0x449d38(0x1fa),'-s',_0xe0ffb5]),_0x565b7e=Number(_0xdf2324[_0x449d38(0x221)][_0x449d38(0x23b)]());if(!Number[_0x449d38(0x1bc)](_0x565b7e)||_0x565b7e<-0x21e8+0xc6c+0x157c||_0x1ccad8>_0x565b7e)throw new Error(_0x449d38(0x157));if(_0x1ccad8===_0x565b7e)return{'path':_0x16f681,'size':_0x565b7e,'offset':_0x1ccad8,'contentBase64':'','nextOffset':null};const _0xfc2bc7=await runReadOnlyGitAllowFailure(_0x49d072,[_0x449d38(0x1fa),_0x449d38(0x1d1),_0xe0ffb5],{'outputLimit':_0x1ccad8+_0x42c03a,'timeoutMs':GIT_HISTORY_TIMEOUT_MS});if(_0xfc2bc7[_0x449d38(0x14d)]!==0x62*-0x3e+-0x1d7d+0x19*0x221)throw new GitCommandError(_0xfc2bc7[_0x449d38(0x14d)],_0xfc2bc7[_0x449d38(0x181)]);const _0x4e332c=_0xfc2bc7[_0x449d38(0x159)][_0x449d38(0x182)](_0x1ccad8,Math[_0x449d38(0x145)](_0x565b7e,_0x1ccad8+_0x42c03a)),_0x41a328=_0x1ccad8+_0x4e332c[_0x449d38(0x25d)];return{'path':_0x16f681,'size':_0x565b7e,'offset':_0x1ccad8,'contentBase64':_0x4e332c[_0x449d38(0x1b9)](_0x449d38(0x24b)),'nextOffset':_0x41a328<_0x565b7e?_0x41a328:null};}function _0x2b8d(_0x47b59d,_0x192d18){_0x47b59d=_0x47b59d-(-0x3*0x9ed+0x1*-0x813+0x270c);const _0x359c05=_0x5465();let _0x4b0ad2=_0x359c05[_0x47b59d];if(_0x2b8d['ImfTyr']===undefined){var _0xfaab6e=function(_0x387462){const _0x2d8968='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11e626='',_0x4ab76b='';for(let _0x3ce76a=-0x2*0x8f3+0x67*0x4f+-0xf*0xed,_0x435886,_0xd9ea81,_0x173bf7=0x51c+-0x601*0x2+0x6e6*0x1;_0xd9ea81=_0x387462['charAt'](_0x173bf7++);~_0xd9ea81&&(_0x435886=_0x3ce76a%(-0x3c1+-0x527*-0x1+-0x3b*0x6)?_0x435886*(-0xe*0x291+-0x25a8*-0x1+-0x7e*0x3)+_0xd9ea81:_0xd9ea81,_0x3ce76a++%(-0x1*0x2c5+0x1*-0x14c2+0x178b))?_0x11e626+=String['fromCharCode'](0x224e+-0x248c+-0x1*-0x33d&_0x435886>>(-(-0x233+0x10f*0x4+-0x207)*_0x3ce76a&-0x521+-0x2*0xcec+0x1eff)):0x3*0x547+-0x1d24+0xd4f*0x1){_0xd9ea81=_0x2d8968['indexOf'](_0xd9ea81);}for(let _0x51368b=-0x199+0x1*-0x21a1+-0x3*-0xbbe,_0x72e5fd=_0x11e626['length'];_0x51368b<_0x72e5fd;_0x51368b++){_0x4ab76b+='%'+('00'+_0x11e626['charCodeAt'](_0x51368b)['toString'](0x5*0x4e7+-0x1*-0x19a8+0x7f*-0x65))['slice'](-(-0x5e6+-0x67b+-0xc63*-0x1));}return decodeURIComponent(_0x4ab76b);};_0x2b8d['VsaDso']=_0xfaab6e,_0x2b8d['UoyNfn']={},_0x2b8d['ImfTyr']=!![];}const _0x834a3e=_0x359c05[0xaf9*0x2+-0xb2*0x1+-0x1540];_0x2b8d['SlKgwT']!==_0x834a3e&&(_0x2b8d['UoyNfn']={},_0x2b8d['SlKgwT']=_0x834a3e);const _0x44541b=_0x2b8d['UoyNfn'][_0x47b59d];return _0x44541b===undefined?(_0x4b0ad2=_0x2b8d['VsaDso'](_0x4b0ad2),_0x2b8d['UoyNfn'][_0x47b59d]=_0x4b0ad2):_0x4b0ad2=_0x44541b,_0x4b0ad2;}export async function readCurrentChanges(_0x165bc0){const _0x10862b=_0x4148b8;return(await readCurrentChangesSummary(_0x165bc0))[_0x10862b(0x23e)];}export async function readCurrentChangeDiff(_0x649931,_0x200987){const _0x4bacca=_0x4148b8,_0x467692=safeGitWorkspacePath(_0x200987);await assertCurrentChangePathAccessible(_0x649931,_0x467692);const _0x3489b1=await readCurrentChangeGitDiff(_0x649931,_0x467692),_0x1759ff=await readWorkingTreeText(_0x649931,_0x467692),_0x2227f4=_0x3489b1[_0x4bacca(0x159)][_0x4bacca(0x215)](0x101f*0x1+-0x475+0x1*-0xbaa)||_0x3489b1[_0x4bacca(0x221)][_0x4bacca(0x215)](_0x4bacca(0x255))||_0x1759ff?.[_0x4bacca(0x1e8)]===!![];if(_0x2227f4)return{'binary':!![],'summary':_0x4bacca(0x1b3)+createHash(_0x4bacca(0x23a))[_0x4bacca(0x219)](_0x3489b1[_0x4bacca(0x159)])[_0x4bacca(0x1a2)](_0x4bacca(0x1cf))+_0x4bacca(0x25b)+_0x3489b1[_0x4bacca(0x159)][_0x4bacca(0x25d)],'truncated':_0x3489b1[_0x4bacca(0x1ae)]||_0x1759ff?.[_0x4bacca(0x1ae)]===!![]};return{'binary':![],'text':_0x3489b1[_0x4bacca(0x221)],'truncated':_0x3489b1[_0x4bacca(0x1ae)]||_0x1759ff?.[_0x4bacca(0x1ae)]===!![],'afterText':_0x1759ff?.[_0x4bacca(0x221)]??'',..._0x1759ff===undefined?{}:{'afterTruncated':_0x1759ff[_0x4bacca(0x1ae)]}};}async function readCurrentChangeGitDiff(_0x2b5df2,_0x1490f3){const _0x4d98af=_0x4148b8,_0x28369d=await runReadOnlyGit(_0x2b5df2,[_0x4d98af(0x1c7),_0x4d98af(0x171),_0x4d98af(0x18f),'-z','--',_0x4d98af(0x1c9)+_0x1490f3]);if(_0x28369d[_0x4d98af(0x221)][_0x4d98af(0x1c6)]('\x00')[_0x4d98af(0x215)](_0x1490f3)){const _0xe79fba=await runReadOnlyGitAllowFailure(_0x2b5df2,[_0x4d98af(0x1c4),_0x4d98af(0x183),_0x4d98af(0x137),_0x4d98af(0x1c0),'--',_0x4d98af(0x19f),_0x1490f3]);if(_0xe79fba[_0x4d98af(0x14d)]!==0xcb*0x5+-0xe9f+0xaa8&&_0xe79fba[_0x4d98af(0x14d)]!==-0xc5*0x25+-0x941+0x25bb)throw new GitCommandError(_0xe79fba[_0x4d98af(0x14d)],_0xe79fba[_0x4d98af(0x181)]);return _0xe79fba;}return runReadOnlyGit(_0x2b5df2,[_0x4d98af(0x1c4),_0x4d98af(0x137),_0x4d98af(0x1c0),_0x4d98af(0x1d0),'--',_0x4d98af(0x1c9)+_0x1490f3]);}export async function isWorkspaceChangeVisible(_0x21afb9,_0x5edf2e){const _0x4682a3=_0x4148b8;try{return await assertCurrentChangePathAccessible(_0x21afb9,safeGitWorkspacePath(_0x5edf2e)),!![];}catch(_0x2cc0ba){if(_0x2cc0ba instanceof Error&&(_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x13c)||_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x1f6)||_0x2cc0ba[_0x4682a3(0x1ac)]===_0x4682a3(0x1ba)))return![];throw _0x2cc0ba;}}async function assertCurrentChangePathAccessible(_0x504016,_0x6df596){const _0x30544d=_0x4148b8,_0x20bd19=await realpath(_0x504016),_0x5469f4=resolve(_0x20bd19,_0x6df596),_0x260644=await lstat(_0x5469f4)[_0x30544d(0x18a)](_0x160ce1=>{const _0x4a2096=_0x30544d;if(_0x160ce1[_0x4a2096(0x14d)]===_0x4a2096(0x172))return undefined;throw _0x160ce1;});if(_0x260644===undefined)return;await resolveWorkspaceEntry(_0x20bd19,_0x6df596,![]);}async function readWorkingTreeText(_0x4fb43b,_0x53b82e){const _0x3c1b03=_0x4148b8,_0x437351=await realpath(_0x4fb43b);let _0x493074;try{_0x493074=await resolveWorkspaceEntry(_0x437351,_0x53b82e,![]);}catch(_0x53220b){if(_0x53220b instanceof Error&&_0x53220b[_0x3c1b03(0x1ac)]===_0x3c1b03(0x1f6))return undefined;throw _0x53220b;}const _0x24cdc4=await lstat(_0x493074);if(!_0x24cdc4[_0x3c1b03(0x251)]())return undefined;const _0x43d191=await readFile(_0x493074);return diffTextFromBuffer(_0x43d191,_0x43d191[_0x3c1b03(0x25d)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x2752c7,_0x2e8d4f){const _0x393971=_0x4148b8;if(_0x2752c7[_0x393971(0x215)](0x1e68+-0x2366+0x4fe)||!isValidUtf8(_0x2752c7))return{'binary':!![],'truncated':_0x2e8d4f};let _0x1d5c6c=Math[_0x393971(0x145)](_0x2752c7[_0x393971(0x25d)],GIT_OUTPUT_LIMIT);while(_0x1d5c6c>0x44*0xc+-0x1875+0x9*0x25d&&_0x1d5c6c<_0x2752c7[_0x393971(0x25d)]&&isUtf8ContinuationByte(_0x2752c7[_0x1d5c6c]))_0x1d5c6c-=0x28*-0x36+-0xc*0x12d+0x168d;return{'binary':![],'text':_0x2752c7[_0x393971(0x182)](0x1c01+-0x689+-0x728*0x3,_0x1d5c6c)[_0x393971(0x1b9)](_0x393971(0x19b)),'truncated':_0x2e8d4f};}export async function restoreCurrentChange(_0x20f976,_0x4e6ac5,_0x1778d6){const _0x59f18e=_0x4148b8,_0x123890=safeGitWorkspacePath(_0x4e6ac5),_0x154619=_0x59f18e(0x1c9)+_0x123890;if(_0x1778d6===_0x59f18e(0x14c)){const _0x32ca8b=await runReadOnlyGit(_0x20f976,[_0x59f18e(0x24c),_0x59f18e(0x260),'-z',_0x59f18e(0x217),'--',_0x154619]);if(!_0x32ca8b[_0x59f18e(0x221)][_0x59f18e(0x1c6)]('\x00')[_0x59f18e(0x140)](_0x23f016=>_0x23f016[_0x59f18e(0x1af)](_0x59f18e(0x21a))&&_0x23f016[_0x59f18e(0x20c)](-0x11e7+0x1d11+-0xb27)===_0x123890))throw new Error(_0x59f18e(0x1fe));const _0x168d26=await realpath(_0x20f976),_0x5ac0fc=resolve(_0x168d26,_0x123890),_0x5c9b63=await lstat(_0x5ac0fc);if(!_0x5c9b63[_0x59f18e(0x251)]()||_0x5c9b63[_0x59f18e(0x19a)]())throw new Error(_0x59f18e(0x1fe));await unlink(_0x5ac0fc);return;}if(_0x1778d6===_0x59f18e(0x256)){await runGit(_0x20f976,[_0x59f18e(0x18c),_0x59f18e(0x248),'--',_0x154619]);return;}await runGit(_0x20f976,[_0x59f18e(0x18c),_0x59f18e(0x15b),_0x59f18e(0x220),_0x59f18e(0x248),'--',_0x154619]);}function safeGitWorkspacePath(_0xc9ecba){const _0x5d1d5b=_0x4148b8;if(_0xc9ecba[_0x5d1d5b(0x25d)]===-0xf35+-0x102*-0x3+0x1*0xc2f||_0xc9ecba[_0x5d1d5b(0x215)]('\x00')||_0xc9ecba[_0x5d1d5b(0x1af)]('/')||_0xc9ecba[_0x5d1d5b(0x1af)]('\x5c'))throw new Error(_0x5d1d5b(0x13c));const _0x1fe078=_0xc9ecba[_0x5d1d5b(0x191)]('\x5c','/');if(_0x1fe078[_0x5d1d5b(0x1c6)]('/')[_0x5d1d5b(0x140)](_0x2fbb17=>_0x2fbb17===''||_0x2fbb17==='..'||_0x2fbb17===_0x5d1d5b(0x216)))throw new Error(_0x5d1d5b(0x13c));return _0x1fe078;}function gitChange(_0x6195b0){const _0x39c5f0=_0x4148b8;if(_0x6195b0==='A')return _0x39c5f0(0x155);if(_0x6195b0==='D')return _0x39c5f0(0x202);if(_0x6195b0==='R')return _0x39c5f0(0x139);if(_0x6195b0==='C')return _0x39c5f0(0x1d7);if(_0x6195b0==='T')return _0x39c5f0(0x1c2);return _0x39c5f0(0x136);}export class GitCommandError extends Error{[_0x4148b8(0x14d)];[_0x4148b8(0x181)];constructor(_0xe8430f,_0x1cac9a){const _0x5d4968=_0x4148b8;super(_0x5d4968(0x1d9)),this[_0x5d4968(0x14d)]=_0xe8430f,this[_0x5d4968(0x181)]=_0x1cac9a;}}async function runReadOnlyGit(_0x1fe885,_0x256762,_0xdde95={}){return runGit(_0x1fe885,_0x256762,{..._0xdde95,'readOnly':!![]});}async function runReadOnlyGitAllowFailure(_0x29b8c2,_0x361b1f,_0x5effda={}){return runGitAllowFailure(_0x29b8c2,_0x361b1f,{..._0x5effda,'readOnly':!![]});}async function runGit(_0x1012ca,_0x35bf07,_0x4dc9d4={}){const _0x30f38b=_0x4148b8,_0x138835=await runGitAllowFailure(_0x1012ca,_0x35bf07,_0x4dc9d4);if(_0x138835[_0x30f38b(0x14d)]!==0x1*-0xeff+0x2357+-0x1458)throw new GitCommandError(_0x138835[_0x30f38b(0x14d)],_0x138835[_0x30f38b(0x181)]);return _0x138835;}async function runGitAllowFailure(_0x11fd55,_0x1ba742,_0x152b56={}){return new Promise((_0x193a5b,_0x13726d)=>{const _0x264750=_0x2b8d,_0x5984a9=_0x152b56[_0x264750(0x1b5)]??GIT_OUTPUT_LIMIT,_0x5b8d1e=spawn(_0x264750(0x19c),[..._0x1ba742],{'cwd':_0x11fd55,'shell':![],'windowsHide':!![],'stdio':[_0x264750(0x257),_0x264750(0x209),_0x264750(0x209)],..._0x152b56[_0x264750(0x18e)]===!![]?{'env':{...process.env,'GIT_OPTIONAL_LOCKS':'0'}}:{}}),_0x5baae1=[],_0x1a5aa3=[];let _0x203cc9=-0x1*-0x122c+0xbd4*-0x1+0x658*-0x1,_0x1ceeb5=-0x66e+-0x16a*-0x1a+-0x1e56,_0xe2fd4a=![];const _0x45b87f=setTimeout(()=>{const _0x48893d=_0x264750;if(process[_0x48893d(0x206)]===_0x48893d(0x1f1)){const _0x449eda=_0x5b8d1e[_0x48893d(0x1a9)];if(_0x449eda===undefined){_0x5b8d1e[_0x48893d(0x1a7)](_0x48893d(0x135));return;}void terminateProcessTree({'pid':_0x449eda,'kill':_0x4d49f4=>_0x5b8d1e[_0x48893d(0x1a7)](_0x4d49f4)},_0x48893d(0x1f1))[_0x48893d(0x18a)](()=>{const _0x22176c=_0x48893d;try{_0x5b8d1e[_0x22176c(0x1a7)](_0x22176c(0x135));}catch{}});return;}_0x5b8d1e[_0x48893d(0x1a7)](_0x48893d(0x135));},_0x152b56[_0x264750(0x22f)]??GIT_TIMEOUT_MS);_0x5b8d1e[_0x264750(0x20d)]['on'](_0x264750(0x224),_0x155270=>{const _0x1eee6d=_0x264750,_0x250b82=Math[_0x1eee6d(0x204)](0x668+-0x475*-0x3+-0x13c7,_0x5984a9-_0x203cc9);if(_0x250b82>0x1*0xd5a+-0x453*0x9+0x253*0xb){const _0x139e00=_0x155270[_0x1eee6d(0x182)](0xa3e+0xcf5*0x1+-0x1*0x1733,_0x250b82);_0x5baae1[_0x1eee6d(0x17f)](_0x139e00),_0x203cc9+=_0x139e00[_0x1eee6d(0x25d)];}_0xe2fd4a||=_0x155270[_0x1eee6d(0x25d)]>_0x250b82;}),_0x5b8d1e[_0x264750(0x181)]['on'](_0x264750(0x224),_0x32a541=>{const _0x9306a8=_0x264750,_0x2cc178=Math[_0x9306a8(0x204)](-0x239e+-0x1462+0x3800,-0x1a66*0x1+0x790+0x22d6-_0x1ceeb5);if(_0x2cc178===-0xa8a+0x1f86+-0x14fc)return;const _0x4fe351=_0x32a541[_0x9306a8(0x182)](0x35e+-0x4*0xa3+-0xf*0xe,_0x2cc178);_0x1a5aa3[_0x9306a8(0x17f)](_0x4fe351),_0x1ceeb5+=_0x4fe351[_0x9306a8(0x25d)];}),_0x5b8d1e[_0x264750(0x1d2)](_0x264750(0x133),_0x1b6ae1=>{clearTimeout(_0x45b87f),_0x13726d(_0x1b6ae1);}),_0x5b8d1e[_0x264750(0x1d2)](_0x264750(0x15a),_0x502394=>{const _0x38d8a3=_0x264750;clearTimeout(_0x45b87f);const _0x443bd7=Buffer[_0x38d8a3(0x201)](_0x5baae1);_0x193a5b({'code':_0x502394??-0x54d*-0x5+0xffd+0x1*-0x2a7d,'output':_0x443bd7,'text':_0x443bd7[_0x38d8a3(0x1b9)](_0x38d8a3(0x19b)),'stderr':Buffer[_0x38d8a3(0x201)](_0x1a5aa3)[_0x38d8a3(0x1b9)](_0x38d8a3(0x19b)),'truncated':_0xe2fd4a});});});}function isGitUnavailable(_0x3f80df){const _0x56375c=_0x4148b8;return _0x3f80df instanceof Error&&_0x56375c(0x14d)in _0x3f80df&&_0x3f80df[_0x56375c(0x14d)]===_0x56375c(0x172);}function summarizeText(_0x6c4408){const _0x1ed1a2=_0x4148b8;return JSON[_0x1ed1a2(0x238)]({'sha256':createHash(_0x1ed1a2(0x23a))[_0x1ed1a2(0x219)](_0x6c4408)[_0x1ed1a2(0x1a2)](_0x1ed1a2(0x1cf)),'bytes':Buffer[_0x1ed1a2(0x150)](_0x6c4408)});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.37",
3
+ "version": "0.9.39",
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.37",
29
- "@myagentroam/protocol": "^0.9.37"
28
+ "@myagentroam/agent": "^0.9.39",
29
+ "@myagentroam/protocol": "^0.9.39"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ws": "^8.18.1"