@myagentroam/node 0.9.20 → 0.9.22

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 _0x28a6c6=_0x1cca;function _0x27de(){const _0xcd742=['B2jQzwn0','A2LSBa','vfLqrv9dsefor0ve','C3rHCNrZv2L0Aa','C2vHCMnOlMv4y2X1zgu','rKLmrv9qqvrix0vtq0fqrq','CMvWBgfJzufSBa','C2HVDW','A2LUza','z2v0','Bwf4','ls1ZA2LWpq','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','kIOVlNzLBNyVkIO','ls1TyxGTy291BNq9','Dhj1BMnHDgvK','CMvMCY9Yzw1VDgvZ','Aw5KzxHpzG','lNbHCNq','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','C3rYAw5NAwz5','B25jBNzHBgLKyxrLza','revmrvrf','rKLmrv9ot1rFrK9vtKq','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','zgLMzI10CMvL','rKLmrq','DgHLBG','AwrSzvr0Be1Z','kIOVx19WEwnHy2HLx18VkIO','te9dquW','C3rHDhvZ','CMvMCY9OzwfKCW','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','q1jfqvrfx0zjteu','BwLU','ls12zxjPzNK','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','lY5Flq','q09qsuve','BgLTAxrZ','zgvJB2rL','C29YDgvK','ls1UBY1LEhqTzgLMzG','yNL0zuXLBMD0Aa','y29Kzq','ntGWotaXv0z5EKXz','BhmTzMLSzxm','ls10B3bVlw9YzgvY','kIOVlNbUCg0VkIO','ChvZAa','BM9YBwfSAxPL','Dg91y2G','yNvIyMXLvxa','zw50CNLmAw1PDa','CM9VDa','kIOVlMnHy2HLlYOQ','kIOVlNLHCM4VkIO','lI4U','C3vIyxjYyxK','C3rKB3v0','C3bSAxq','r0Lux1jfue9tsvrpuLLFsu5wquXjra','CgfYC2u','lMDPDa','l2rLDI9UDwXS','u1rbr0ve','C2HHmJu2','CMvHza','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','rKLmrv9srvzju0LptL9jtLzbteLe','C3rKzxjY','kIOVlNr1CMjVlYOQ','AgfZAa','rKLmrv9xuKLurv9dt05gteLdva','kIOVBM9Kzv9TB2r1BgvZlYOQ','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','rKLmrv9ot1rFreLsrunut1jz','BgLUDxG','C2v0','kIOVlMDYywrSzs8QkG','zMLSzxmUzxHJBhvKzq','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','ls1MB3jTyxq9','D29YA3nWywnLuM9VDa','Aw5JBhvKzxm','C29Tzq','ls1LEgnSDwrLlxn0yw5KyxjK','mJC4mtiYnxvKEKD3CG','yMLUyxj5igrPzMyGC2HHmJu2pq','C2vHCMnO','ywXS','zMLUza','AxntEw1IB2XPy0XPBMS','BwvZC2fNzq','zMXHDe1HCa','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','oIHSAxrLCMfSkq','zxjYB3i','ywrK','ls13B3jRDhjLzq','CMvMCY9OzwfKCY8','zM9YlwvHy2GTCMvM','AxnjBNrLz2vY','Bg9JywXLq29TCgfYzq','CMvMCY9Yzw1VDgvZlW','CgLWzq','Dg9mB3DLCKnHC2u','mtq3mda1me5JBNfgDG','ls1ICMfUy2G','zxHWAxj5vgLTzxi','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','pZ8G','kIOVyMLUlYOQ','C2LUA0rVD24','ls1ZB3vYy2u9sevbra','rvHju1rtx0rjuKvdve9swq','zMLUz2vYChjPBNq','Dw5Yzwy','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','C29YDa','zMLSDgvY','sevbrca','C3rHBgu','C2LNBMf0DxjL','nJm3yNrWu0PV','sevbra','DgvZDa','Cgf0Aa','ls1UBY10zxH0y29UDG','ls1YB290','CMv2lxbHCNnL','lM1HCI11CgXVywqT','kIOVlNn2zwX0zs1RAxqVkIO','kIOVlNbHCMnLBc1JywnOzs8QkG','uKvnt1rf','kIOVB3v0lYOQ','v09ss1nqqunfx05pvf9bteXpv0ve','otq1otq0swveEerk','B2jZzxj2zq','kIOVlM5LEhqVkIO','B3v0Chv0','y29UDgvUDenHBMrPzgf0zxm','ls11BNrYywnRzwqTzMLSzxm9ywXS','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','zxHLyW','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','igj5DgvZpq','C3LTyM9SAwmTCMvM','y2f0y2G','Agv4','AxnbyNnVBhv0zq','AM9PBG','r0Lux1jfrL9jtLzbteLe','ls1Yzwn1CNnPDMu','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','C2nVCMu','D2LUmZi','ls1PCY1HBMnLC3rVCG','yMfZzty0DxjS','y2f0lwzPBgu','Bw9Kzq','BgvUz3rO','kIOVDMvUzg9YlYOQ','zgLMzG','ywXSB2nvBNnHzMu','qureruq','yMLUyxj5','zgLNzxn0','ls1Uyw1Llxn0yxr1CW','ru5pru5u','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','r0Lux0nptu1btKrFrKfjteve','ls1VDgHLCNm','AwDUB3jL','mta4nte2u2DOug9Y','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra','qMLUyxj5igzPBgvZia','Dgv4Da','kIOVDgvZDc9YDw5ZlYOQ','CMvSyxrPDMu','u0Lhs0Lmta','B2zMC2v0','Bwv0ywrHDge','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','C2L6zq','BwvYz2uTyMfZzq','revmrvrfra','zgvZDgLUyxrPB24','ls1ZAg9YDa','ls1KyxrLlw9YzgvY','kIOVDMvUDI8QkG','DhjPBq','BgLTAxq','ntjiAxnhEfO','zMXVB3i','kIOVlMDPDc8QkG','z2L0','Aw52ywXPza','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','y2XVC2u','kIOVlMfUz3vSyxiVkIO','DxrMoa','zw5ZDxjLtg9HzgvK','kIOVyNvPBgqVkIO','C3rHCNrgywXSyMfJA1bVBgXPBMC','tu9esuzjruq','ls1ZDgfNzwq','kIOVB2jQlYOQ','zgf0yq','C2HPzNq','vu5uuKfds0ve','mtuWmdzWBxHZvhi','v09ss1nqqunfx1bbveHFsu5wquXjra','DxbKyxrL','C2XPy2u','rKLmrv9ot1rFvevyva','ls1XDwLLDa','zMLUzeLUzgv4','C3vIBw9KDwXL','kIOVy292zxjHz2uVkIO','D2f0y2HLCG','ywn0Aw9U','ls1WB3jJzwXHAw49DJe','zgLZCg9Zzq','rKLmrv9ut09Ftefsr0u','yMfZzty0','Dg9mB2nHBgvmB3DLCKnHC2u','ls1NAxqTy29TBw9UlwrPCG','BMfTzq','kIOVDgfYz2v0lYOQ','Aw52ywXPzgf0zq','BwfW','y2fWywnPDhK','CMvWBgfJzq','rKLmrv9btfjfqurzx0vysvnuuW','lM1HCI1LzgL0lq','ls1UBY1JB21TAxqTAwq','q1jfqvrfx0rjuKvdve9swq','lMDPDc8','kIOVlM51EhqVkIO','mNLNwuzpsW','AxneAxjLy3rVCNK','CxvLCNK','ruvysvnu','uKvbrfK','ls1MAxjZDc1WyxjLBNq','CMvIDwLSza','CMvZDg9Yzq','r0Lux1DpuKTtuefdrq','uKvoqu1fra','Dg9tDhjPBMC','Cg9SBezHBgXIywnR','nJm0mtq3mhvrr2TUBW','rvHju1rtx0zjteu','zw50CNK','iYmG','reLsrunut1jz','zw50CMLLCW','vu5tvefhruq','Bw9KAwzPzwrbDa','AxngAwXL','zMfSBgjHy2TuAw1LCG','kIOVzgLZDc8QkG','su5wquXjrf9oqu1f','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','CMvMCW','DMfSDwvZ','DxrMltG','rKLmrv9squ5hrv9jtLzbteLe','Bg9N','C3rYAw5N','Dg9vChbLCKnHC2u','yMXVyG','BgfZDeLUzgv4t2y','y2HHBMDLCW','y3vYC29Y','BxrPBwvnCW','y29Uy2f0','zgLZCgXHEu5HBwu','zMLUywXSEq','B25Jzq','ls1UBY1PBMrLEa','Bg9HzgLUzW','rKLmrv9ot1rFuKvhvuXbuG','zNjVBq','AxntywzLsw50zwDLCG'];_0x27de=function(){return _0xcd742;};return _0x27de();}(function(_0x7927cb,_0x5a0507){const _0x4da918=_0x1cca,_0x4eb807=_0x7927cb();while(!![]){try{const _0x185b0e=parseInt(_0x4da918(0x123))/(0x1*-0x19d3+0x1fc1*-0x1+0x3995)*(parseInt(_0x4da918(0xc7))/(0x404+0xf5*0x2+-0x5ec))+parseInt(_0x4da918(0x1a4))/(-0x2ba*-0x4+0x2*-0x376+-0x3f9)*(parseInt(_0x4da918(0x1b7))/(-0x1*-0x1ea1+0x70f+-0x25ac))+parseInt(_0x4da918(0x161))/(0x1525+0xa6*-0xe+-0xc0c)+-parseInt(_0x4da918(0x1c9))/(-0x1c61+0x18*-0x5+0x1cdf)*(parseInt(_0x4da918(0x172))/(-0xa*-0x1e7+0x1a66+-0x2d65))+parseInt(_0x4da918(0x17f))/(0x1*0x1b55+0xca9*-0x2+0x27*-0xd)+-parseInt(_0x4da918(0x14d))/(-0x15b8+0x1303+-0xea*-0x3)+-parseInt(_0x4da918(0xd3))/(-0x14e0+0x1b80+-0x2*0x34b);if(_0x185b0e===_0x5a0507)break;else _0x4eb807['push'](_0x4eb807['shift']());}catch(_0x53f68d){_0x4eb807['push'](_0x4eb807['shift']());}}}(_0x27de,0x607f2+-0x5953e+0x4045f));import{createHash,randomUUID}from'node:crypto';import{watch}from'node:fs';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x1cf53c}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';const GIT_TIMEOUT_MS=0x47*0x32+-0x294+0x83e,GIT_OUTPUT_LIMIT=(-0x23f5*0x1+0x2*-0x252+0x2a99)*(-0xcdc+0x1781+-0x6a5),FILE_READ_LIMIT=(0x23c2+-0x1*-0x10cf+0x10db*-0x3)*(0x2*-0xbb9+-0xe71*0x2+-0xe*-0x406),DIRECTORY_PAGE_LIMIT=-0x198b+0x1235+-0x1*-0x81e,DIRECTORY_PICKER_LIMIT=-0x21ba+0xd*-0x1d7+0x1*0x3a6d,SEARCH_RESULT_LIMIT=0x1*-0x7c9+-0x767*-0x1+0x12a*0x1,FILE_INDEX_IDLE_TTL_MS=(-0x1*-0x260+0x1*-0x184f+0x162b)*(-0x2675+0x6cf*-0x1+-0x40*-0xb6)*(0x6f3*0x1+0x129d+-0x318*0x7),FILE_INDEX_ENTRY_LIMIT=-0x2f1*-0x43+-0xd810+-0x1999d*-0x1,FILE_INDEX_FALLBACK_POLL_MS=0x7001+-0x1*-0xc097+-0xbb68,FILE_INDEX_METADATA_CONCURRENCY=-0x1*-0x1760+-0x2*0x43b+-0xeca,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x28a6c6(0x1b9),_0x28a6c6(0x140),_0x28a6c6(0x13a),_0x28a6c6(0x126),_0x28a6c6(0x12e),_0x28a6c6(0x12d),_0x28a6c6(0x17b),_0x28a6c6(0x13d),_0x28a6c6(0xdd),_0x28a6c6(0x1c1),_0x28a6c6(0x17d),_0x28a6c6(0x1d1),_0x28a6c6(0x1a8),_0x28a6c6(0x181),_0x28a6c6(0xc6),_0x28a6c6(0x17a),_0x28a6c6(0x1be),_0x28a6c6(0x1db),_0x28a6c6(0x145),_0x28a6c6(0x166),_0x28a6c6(0x1c5),_0x28a6c6(0x198),_0x28a6c6(0x112),_0x28a6c6(0x102),_0x28a6c6(0x1b4)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x16e3d3,_0x49054e,_0x245b2c){const _0x2aea78=_0x28a6c6,_0x1935f8=_0x49054e[_0x2aea78(0x1b5)]();if(_0x1935f8[_0x2aea78(0x197)]===0x116c+-0x568*-0x2+-0x2*0xe1e||_0x1935f8[_0x2aea78(0x197)]>-0xf62+-0x10*0x112+0x2181||_0x1935f8==='.'||_0x1935f8==='..'||_0x1935f8[_0x2aea78(0x14a)]('/')||_0x1935f8[_0x2aea78(0x14a)]('\x5c')||_0x1935f8[_0x2aea78(0x14a)]('\x00'))throw new Error(_0x2aea78(0x164));const _0x59b551=await Promise[_0x2aea78(0x150)](_0x245b2c[_0x2aea78(0x1dd)](_0x1b8045=>realpath(_0x1b8045))),_0x2c78b4=await realpath(_0x16e3d3)[_0x2aea78(0x18a)](()=>{const _0x2c189b=_0x2aea78;throw new Error(_0x2c189b(0x101));}),_0x52a4c0=await stat(_0x2c78b4)[_0x2aea78(0x18a)](()=>undefined);if(_0x52a4c0?.[_0x2aea78(0xc8)]()!==!![]||!isWithinAllowedRoot(_0x2c78b4,_0x59b551))throw new Error(_0x2aea78(0x101));const _0x27b8ff=resolve(_0x2c78b4,_0x1935f8);if(dirname(_0x27b8ff)!==_0x2c78b4||!isWithinAllowedRoot(_0x27b8ff,_0x59b551))throw new Error(_0x2aea78(0x164));try{await mkdir(_0x27b8ff);}catch(_0x2274f0){if(_0x2274f0[_0x2aea78(0x122)]===_0x2aea78(0xca))throw new Error(_0x2aea78(0x1a0));throw _0x2274f0;}return _0x27b8ff;}export class WorkspaceFileIndex{[_0x28a6c6(0x149)];[_0x28a6c6(0x11d)];[_0x28a6c6(0xd8)]=[];[_0x28a6c6(0x104)]=![];[_0x28a6c6(0x12c)];[_0x28a6c6(0xf1)];[_0x28a6c6(0x170)]=!![];[_0x28a6c6(0x1d2)];[_0x28a6c6(0x163)];[_0x28a6c6(0xdc)];[_0x28a6c6(0x171)]='';constructor(_0x9b14ad,_0x2b1c7f={}){const _0x4adb2a=_0x28a6c6;this[_0x4adb2a(0x149)]=_0x9b14ad,this[_0x4adb2a(0x11d)]=_0x2b1c7f;}async[_0x28a6c6(0x180)](){const _0x1c908a=_0x28a6c6;await this[_0x1c908a(0x1c0)](),this[_0x1c908a(0x129)]();}async[_0x28a6c6(0x183)](){const _0x260828=_0x28a6c6;return await this[_0x260828(0x1c0)](),this[_0x260828(0x129)](),{'entries':this[_0x260828(0xd8)][_0x260828(0x16e)](_0x1658e1=>_0x1658e1[_0x260828(0xfd)]===_0x260828(0x10f)),'truncated':this[_0x260828(0x104)]};}[_0x28a6c6(0x1d5)](){const _0xbe7233=_0x28a6c6;if(this[_0xbe7233(0x163)]!==undefined)clearTimeout(this[_0xbe7233(0x163)]);this[_0xbe7233(0x163)]=undefined,this[_0xbe7233(0x1d2)]?.[_0xbe7233(0x1bd)](),this[_0xbe7233(0x1d2)]=undefined;if(this[_0xbe7233(0xdc)]!==undefined)clearInterval(this[_0xbe7233(0xdc)]);this[_0xbe7233(0xdc)]=undefined,this[_0xbe7233(0xd8)]=[],this[_0xbe7233(0x104)]=![],this[_0xbe7233(0x170)]=!![],this[_0xbe7233(0x171)]='';}async[_0x28a6c6(0x14f)](_0x3c13cc,_0x1bb259,_0x109c84=SEARCH_RESULT_LIMIT,_0x140057=![]){const _0xc11e21=_0x28a6c6;if(_0x3c13cc[_0xc11e21(0x1b5)]()[_0xc11e21(0x197)]===-0x2b2*0x1+-0x5e*-0x15+0x504*-0x1||_0x3c13cc[_0xc11e21(0x197)]>0x2286+-0x26f+-0x1f17||!Number[_0xc11e21(0xf4)](_0x109c84)||_0x109c84<0xc7c+0x1b5b+-0x27d6||_0x109c84>SEARCH_RESULT_LIMIT)throw new Error(_0xc11e21(0x141));await this[_0xc11e21(0x1c0)](),this[_0xc11e21(0x129)]();const _0x25d42b=decodeSearchCursor(_0x1bb259,_0x3c13cc),_0x55c7b6=_0x25d42b===undefined?undefined:this[_0xc11e21(0xd8)][_0xc11e21(0x151)](_0x2c990c=>_0x2c990c[_0xc11e21(0x175)]===_0x25d42b&&(_0x140057||_0x2c990c[_0xc11e21(0xfd)]===_0xc11e21(0x10f))),_0x289e33=_0x55c7b6===undefined?-(-0xa7e+0xc8a+0x1*-0x20b):fuzzyPathScore(_0x55c7b6[_0xc11e21(0x175)],_0x3c13cc),_0x3c16de=_0x55c7b6===undefined||_0x289e33<0x1ca+-0x1faf+0x1de5?undefined:{'entry':_0x55c7b6,'score':_0x289e33},_0x412015=new RankedCandidateHeap(_0x109c84+(0x1d54+-0x3*-0x1f8+0x233b*-0x1));for(const _0x24239d of this[_0xc11e21(0xd8)]){if(!_0x140057&&_0x24239d[_0xc11e21(0xfd)]!==_0xc11e21(0x10f))continue;const _0x474050=fuzzyPathScore(_0x24239d[_0xc11e21(0x175)],_0x3c13cc);if(_0x474050<0xa0f+-0x7*-0x25f+-0x1aa8*0x1)continue;const _0x4a3753={'entry':_0x24239d,'score':_0x474050};if(_0x3c16de!==undefined&&compareRankedCandidate(_0x4a3753,_0x3c16de)<=-0x9d*0x32+-0x882+0x17*0x1b4)continue;_0x412015[_0xc11e21(0x158)](_0x4a3753);}const _0x12d92a=_0x412015[_0xc11e21(0x11f)](),_0x275479=_0x12d92a[_0xc11e21(0x1cc)](-0x1eac+0x1124*0x2+-0x39c,_0x109c84)[_0xc11e21(0x1dd)](_0x1d6cf2=>_0x1d6cf2[_0xc11e21(0xd5)]),_0xe3cab1=_0x12d92a[_0x109c84]?.[_0xc11e21(0xd5)][_0xc11e21(0x175)];return{'entries':_0x275479,'nextCursor':_0xe3cab1===undefined?null:encodeSearchCursor(_0x3c13cc,_0x275479['at'](-(0x1481+0xc36*0x3+-0x3922))?.[_0xc11e21(0x175)]??_0x25d42b??''),'truncated':_0xe3cab1!==undefined||this[_0xc11e21(0x104)]};}async[_0x28a6c6(0x1c0)](){const _0x2e6d88=_0x28a6c6;if(!this[_0x2e6d88(0x170)]&&this[_0x2e6d88(0x12c)]!==undefined)return;this[_0x2e6d88(0xf1)]===undefined&&(this[_0x2e6d88(0xf1)]=this[_0x2e6d88(0xcd)]()[_0x2e6d88(0xee)](()=>{const _0x4c7040=_0x2e6d88;this[_0x4c7040(0xf1)]=undefined;})),await this[_0x2e6d88(0xf1)];}[_0x28a6c6(0x129)](){const _0x59f519=_0x28a6c6;if(this[_0x59f519(0x163)]!==undefined)clearTimeout(this[_0x59f519(0x163)]);this[_0x59f519(0x163)]=setTimeout(()=>this[_0x59f519(0x1d5)](),this[_0x59f519(0x11d)][_0x59f519(0x111)]??FILE_INDEX_IDLE_TTL_MS),this[_0x59f519(0x163)][_0x59f519(0x16b)]();}async[_0x28a6c6(0xcd)](){const _0x55973e=_0x28a6c6,_0x11676e=await realpath(this[_0x55973e(0x149)]),_0x3712b5=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x11676e)],_0x398637=[],_0x6f3e3=this[_0x55973e(0x11d)][_0x55973e(0x12b)]??FILE_INDEX_ENTRY_LIMIT;let _0x1873c2=![];const _0x517553=['.'];let _0x59f751=-0x1e0f+0x1b1d*-0x1+0x392c;while(_0x59f751<_0x517553[_0x55973e(0x197)]&&!_0x1873c2){const _0x441500=_0x517553[_0x59f751];_0x59f751+=0x3a0+0x8cf+-0x2b*0x4a;const _0x4f8ebb=await resolveWorkspaceEntryFromCanonicalRoot(_0x11676e,_0x441500,!![])[_0x55973e(0x18a)](()=>undefined);if(_0x4f8ebb===undefined)continue;const _0x5038ff=await opendir(_0x4f8ebb)[_0x55973e(0x18a)](()=>undefined);if(_0x5038ff===undefined)continue;let _0xba2329=[];const _0x10240a=async()=>{const _0x12665f=_0x55973e,_0x508fe4=await Promise[_0x12665f(0x150)](_0xba2329);_0xba2329=[];for(const _0xf5cb93 of _0x508fe4){if(_0xf5cb93===undefined)continue;if(_0xf5cb93[_0x12665f(0x175)]===_0x12665f(0x135)||_0xf5cb93[_0x12665f(0x175)][_0x12665f(0xf8)](_0x12665f(0xc5))||isExcluded(_0xf5cb93[_0x12665f(0x175)],_0x3712b5))continue;if(_0xf5cb93[_0x12665f(0xfd)]===_0x12665f(0xd7))_0x517553[_0x12665f(0x127)](_0xf5cb93[_0x12665f(0x175)]);_0x398637[_0x12665f(0x127)](_0xf5cb93);if(_0x398637[_0x12665f(0x197)]>=_0x6f3e3){_0x1873c2=!![];break;}}};for await(const _0x2ce870 of _0x5038ff){const _0x250934=_0x441500==='.'?_0x2ce870[_0x55973e(0x1da)]:posix[_0x55973e(0x18d)](_0x441500[_0x55973e(0xfb)]('\x5c','/'),_0x2ce870[_0x55973e(0x1da)]);if(_0x250934===_0x55973e(0x135)||_0x250934[_0x55973e(0xf8)](_0x55973e(0xc5))||isExcluded(_0x250934,_0x3712b5))continue;_0xba2329[_0x55973e(0x127)](inspectWorkspaceIndexEntry(_0x11676e,_0x250934,_0x2ce870[_0x55973e(0x1da)]));if(_0xba2329[_0x55973e(0x197)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x10240a();if(_0x1873c2)break;}if(!_0x1873c2&&_0xba2329[_0x55973e(0x197)]>0xd8b*-0x1+-0x1fae*-0x1+-0x1*0x1223)await _0x10240a();}this[_0x55973e(0x12c)]=_0x11676e,this[_0x55973e(0xd8)]=_0x398637,this[_0x55973e(0x104)]=_0x1873c2,this[_0x55973e(0x171)]=fileIndexSignature(_0x398637,_0x1873c2),this[_0x55973e(0x170)]=![],this[_0x55973e(0x1d2)]?.[_0x55973e(0x1bd)]();try{this[_0x55973e(0x1d2)]=watch(_0x11676e,{'persistent':![],'recursive':!![]},(_0x34c581,_0x1ac7c7)=>{const _0x606f0=_0x55973e;if(_0x1ac7c7!==null){const _0x55269f=_0x1ac7c7[_0x606f0(0xd1)]()[_0x606f0(0xfb)]('\x5c','/');if(_0x55269f===_0x606f0(0x135)||_0x55269f[_0x606f0(0xf8)](_0x606f0(0xc5))||isExcluded(_0x55269f,_0x3712b5))return;}this[_0x606f0(0x1dc)]();}),this[_0x55973e(0x1d2)]['on'](_0x55973e(0x157),()=>{const _0x22c752=_0x55973e;this[_0x22c752(0x1dc)](),this[_0x22c752(0x1d2)]?.[_0x22c752(0x1bd)](),this[_0x22c752(0x1d2)]=undefined,this[_0x22c752(0x1c2)]();});}catch{this[_0x55973e(0x1d2)]=undefined,this[_0x55973e(0x1c2)]();}}[_0x28a6c6(0x1c2)](){const _0x346544=_0x28a6c6;if(this[_0x346544(0xdc)]!==undefined)return;this[_0x346544(0xdc)]=setInterval(()=>void this[_0x346544(0xd2)](),FILE_INDEX_FALLBACK_POLL_MS),this[_0x346544(0xdc)][_0x346544(0x16b)]();}async[_0x28a6c6(0xd2)](){const _0x131ad4=_0x28a6c6;if(this[_0x131ad4(0xf1)]!==undefined)return;const _0x1fc6d0=this[_0x131ad4(0x171)];this[_0x131ad4(0x170)]=!![];try{await this[_0x131ad4(0x1c0)]();if(_0x1fc6d0!==this[_0x131ad4(0x171)])this[_0x131ad4(0x11d)][_0x131ad4(0x10a)]?.();}catch{this[_0x131ad4(0x170)]=![];}}[_0x28a6c6(0x1dc)](){const _0x35b043=_0x28a6c6;if(this[_0x35b043(0x170)])return;this[_0x35b043(0x170)]=!![],this[_0x35b043(0x11d)][_0x35b043(0x10a)]?.();}}function fileIndexSignature(_0x2f10ee,_0x29c478){const _0x76864d=_0x28a6c6,_0x21606b=createHash(_0x76864d(0x138));_0x21606b[_0x76864d(0x1cb)](_0x29c478?'1\x00':'0\x00');for(const _0x2b82b2 of _0x2f10ee)_0x21606b[_0x76864d(0x1cb)](_0x2b82b2[_0x76864d(0x175)]+'\x00'+String(_0x2b82b2[_0x76864d(0x1ae)])+'\x00'+String(_0x2b82b2[_0x76864d(0xda)])+'\x00');return _0x21606b[_0x76864d(0x19d)](_0x76864d(0x18b));}async function workspaceExcludePatterns(_0x60d01e){const _0x14d204=_0x28a6c6,_0x57c175=resolve(_0x60d01e,_0x14d204(0xdf)),_0xf7ee1d=await readFile(_0x57c175,_0x14d204(0x1bf))[_0x14d204(0x110)](JSON[_0x14d204(0x134)])[_0x14d204(0x18a)](()=>undefined);if(typeof _0xf7ee1d!==_0x14d204(0xf5)||_0xf7ee1d===null)return[];return[_0x14d204(0x146),_0x14d204(0xf9)][_0x14d204(0x154)](_0x5d92f1=>{const _0x242215=_0x14d204,_0x1f29f1=_0xf7ee1d[_0x5d92f1];return typeof _0x1f29f1===_0x242215(0xf5)&&_0x1f29f1!==null?Object[_0x242215(0xd8)](_0x1f29f1)[_0x242215(0x154)](([_0x227304,_0x4d77f2])=>_0x4d77f2===!![]?[_0x227304]:[]):[];});}function isExcluded(_0x305f91,_0x4225e5){const _0x2aeb76=_0x28a6c6;return _0x4225e5[_0x2aeb76(0x14b)](_0xd9c624=>minimatch(_0x305f91,_0xd9c624,{'dot':!![],'nocase':_0x1cf53c()!==_0x2aeb76(0x143)})||minimatch(_0x305f91+'/',_0xd9c624,{'dot':!![],'nocase':_0x1cf53c()!==_0x2aeb76(0x143)}));}function compareRankedCandidate(_0x1de76c,_0x459b74){const _0x2c2cba=_0x28a6c6;return _0x459b74[_0x2c2cba(0x191)]-_0x1de76c[_0x2c2cba(0x191)]||_0x1de76c[_0x2c2cba(0xd5)][_0x2c2cba(0x175)][_0x2c2cba(0x15d)](_0x459b74[_0x2c2cba(0xd5)][_0x2c2cba(0x175)]);}class RankedCandidateHeap{[_0x28a6c6(0x1de)];[_0x28a6c6(0xe1)]=[];constructor(_0x390662){const _0x10099a=_0x28a6c6;this[_0x10099a(0x1de)]=_0x390662;}[_0x28a6c6(0x158)](_0x310386){const _0x5292f3=_0x28a6c6;if(this[_0x5292f3(0xe1)][_0x5292f3(0x197)]<this[_0x5292f3(0x1de)]){this[_0x5292f3(0xe1)][_0x5292f3(0x127)](_0x310386),this[_0x5292f3(0x12a)](this[_0x5292f3(0xe1)][_0x5292f3(0x197)]-(0xe9e+0x24a4+0x3341*-0x1));return;}if(compareRankedCandidate(_0x310386,this[_0x5292f3(0xe1)][-0x1c56+0x25b8+-0x962])>=-0x1a73+-0x3a*-0x1b+0x1455)return;this[_0x5292f3(0xe1)][-0x16be+-0x2*0xc0a+-0xd*-0x39a]=_0x310386,this[_0x5292f3(0x167)](0x109*-0x8+0x1*0x1da7+0x155f*-0x1);}[_0x28a6c6(0x11f)](){const _0x1fb5ae=_0x28a6c6;return[...this[_0x1fb5ae(0xe1)]][_0x1fb5ae(0x16d)](compareRankedCandidate);}[_0x28a6c6(0x12a)](_0x57979b){const _0x2972a3=_0x28a6c6;let _0x1854f7=_0x57979b;while(_0x1854f7>0x37d+-0x1*0x1a+-0x363*0x1){const _0x13ea57=Math[_0x2972a3(0x1b8)]((_0x1854f7-(-0x1*0x8db+0x2b*0x1c+0x428))/(0x1*-0x45f+-0x215+-0x2*-0x33b));if(compareRankedCandidate(this[_0x2972a3(0xe1)][_0x1854f7],this[_0x2972a3(0xe1)][_0x13ea57])<=-0x1d6*0x2+-0xe*-0x3f+0x3a)break;[this[_0x2972a3(0xe1)][_0x1854f7],this[_0x2972a3(0xe1)][_0x13ea57]]=[this[_0x2972a3(0xe1)][_0x13ea57],this[_0x2972a3(0xe1)][_0x1854f7]],_0x1854f7=_0x13ea57;}}[_0x28a6c6(0x167)](_0x535262){const _0x701e3f=_0x28a6c6;let _0xcc80b4=_0x535262;while(!![]){const _0x394928=_0xcc80b4*(0x17c1+0x3f*0x54+0x1*-0x2c6b)+(0x1425+0x17b3+-0x4df*0x9);if(_0x394928>=this[_0x701e3f(0xe1)][_0x701e3f(0x197)])return;const _0x25177d=_0x394928+(0x1*0x1bb4+0x2*-0x9d6+-0xf*0x89),_0x2fb100=_0x25177d<this[_0x701e3f(0xe1)][_0x701e3f(0x197)]&&compareRankedCandidate(this[_0x701e3f(0xe1)][_0x25177d],this[_0x701e3f(0xe1)][_0x394928])>-0x15c6+-0x1a59+0x301f?_0x25177d:_0x394928;if(compareRankedCandidate(this[_0x701e3f(0xe1)][_0x2fb100],this[_0x701e3f(0xe1)][_0xcc80b4])<=-0x1*-0x1328+0x1*-0xc97+0x29*-0x29)return;[this[_0x701e3f(0xe1)][_0xcc80b4],this[_0x701e3f(0xe1)][_0x2fb100]]=[this[_0x701e3f(0xe1)][_0x2fb100],this[_0x701e3f(0xe1)][_0xcc80b4]],_0xcc80b4=_0x2fb100;}}}function fuzzyPathScore(_0x2d48b2,_0x3407ee){const _0x4b2178=_0x28a6c6,_0x1bdb7a=_0x2d48b2[_0x4b2178(0x1d8)](),_0x1886c2=_0x3407ee[_0x4b2178(0x1b5)]()[_0x4b2178(0x1d8)]();let _0x52644e=-0xba*-0x33+-0x1564+0x2*-0x7d5,_0x500de2=0xc4+-0xc24+0x68*0x1c,_0x44fd3f=-(-0x9*-0x3c2+-0x2b*0xdf+0x3a5);for(const _0x135410 of _0x1886c2){const _0x9fe47c=_0x1bdb7a[_0x4b2178(0x106)](_0x135410,_0x52644e);if(_0x9fe47c===-(-0x2*-0x5e7+-0x557+-0x676))return-(0x21cc+0x6ad*-0x1+-0x1b1e);_0x500de2+=_0x9fe47c===_0x44fd3f+(-0x1224+0x1*0x20fb+0x1*-0xed6)?0x1ce7+-0x9b5+-0x1326*0x1:-0x180c+0x2f9+0x1514;if(_0x9fe47c===-0x845*-0x3+-0x4*0x4d5+-0x57b||_0x4b2178(0x11b)[_0x4b2178(0x14a)](_0x1bdb7a[_0x9fe47c-(-0x1349+0x1*0x1b8e+-0x422*0x2)]??''))_0x500de2+=-0xb93+0x805*0x4+-0x1479;_0x44fd3f=_0x9fe47c,_0x52644e=_0x9fe47c+(-0x1c61*-0x1+-0x1cb*-0x6+0x1*-0x2722);}const _0x123f87=_0x2d48b2[_0x4b2178(0x1cc)](_0x2d48b2[_0x4b2178(0xe8)]('/')+(0xa3a+0x1ee2+0x291b*-0x1))[_0x4b2178(0x1d8)]();if(_0x123f87[_0x4b2178(0x14a)](_0x1886c2))_0x500de2+=0xe4*0x11+-0x29a+-0x631*0x2;else{if(_0x1bdb7a[_0x4b2178(0x14a)](_0x1886c2))_0x500de2+=-0x827*0x4+-0x30*0x29+0x285c;}return _0x500de2-_0x2d48b2[_0x4b2178(0x197)]/(-0x1b8b+-0x66b*-0x1+0x1908);}export async function listWorkspaceDirectories(_0x4f7a6c,_0x33c88c,_0x420882=homedir()){const _0x404c5d=_0x28a6c6,_0x27b921=await realpath(_0x420882),_0x1fb45a=await Promise[_0x404c5d(0x150)](_0x33c88c[_0x404c5d(0x1dd)](_0x86721d=>realpath(_0x86721d))),_0x51e5ab=[...new Set([_0x27b921,..._0x1fb45a])],_0x4ae166=_0x4f7a6c===undefined?_0x1fb45a[0x1*-0x53+-0x1a1+0x1f4]??_0x27b921:await realpath(_0x4f7a6c),_0x531b5e=await stat(_0x4ae166);if(!_0x531b5e[_0x404c5d(0xc8)]()||!isWithinAllowedRoot(_0x4ae166,_0x51e5ab))throw new Error(_0x404c5d(0x101));const _0x5e1195=await readdir(_0x4ae166,{'withFileTypes':!![]}),_0x303a68=[];for(const _0x27adb0 of _0x5e1195[_0x404c5d(0x16d)]((_0x3773ea,_0x2e0562)=>_0x3773ea[_0x404c5d(0x1da)][_0x404c5d(0x15d)](_0x2e0562[_0x404c5d(0x1da)]))){if(!_0x27adb0[_0x404c5d(0xc8)]()&&!_0x27adb0[_0x404c5d(0x152)]())continue;const _0x658633=await realpath(resolve(_0x4ae166,_0x27adb0[_0x404c5d(0x1da)]))[_0x404c5d(0x18a)](()=>undefined);if(_0x658633===undefined||!isWithinAllowedRoot(_0x658633,_0x51e5ab))continue;const _0x2ac499=await stat(_0x658633)[_0x404c5d(0x18a)](()=>undefined);if(_0x2ac499===undefined||!_0x2ac499[_0x404c5d(0xc8)]())continue;_0x303a68[_0x404c5d(0x127)]({'path':_0x658633,'name':_0x27adb0[_0x404c5d(0x1da)],'selectable':isWithinAllowedRoot(_0x658633,_0x1fb45a)});if(_0x303a68[_0x404c5d(0x197)]>DIRECTORY_PICKER_LIMIT)break;}const _0x474df5=dirname(_0x4ae166);return{'homePath':_0x27b921,'currentPath':_0x4ae166,'parentPath':_0x474df5===_0x4ae166||!isWithinAllowedRoot(_0x474df5,_0x51e5ab)?null:_0x474df5,'browseRoots':_0x1fb45a,'selectable':isWithinAllowedRoot(_0x4ae166,_0x1fb45a),'entries':_0x303a68[_0x404c5d(0x1cc)](-0x755+0x68a+0xcb,DIRECTORY_PICKER_LIMIT),'truncated':_0x303a68[_0x404c5d(0x197)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x1d56a0,_0x137658='.',_0x2d6880,_0x542824=DIRECTORY_PAGE_LIMIT){const _0x5b2155=_0x28a6c6;if(!Number[_0x5b2155(0xf4)](_0x542824)||_0x542824<0x1430+-0x2523*-0x1+-0x3952||_0x542824>DIRECTORY_PAGE_LIMIT)throw new Error(_0x5b2155(0x187));const _0xfb0e0a=await resolveWorkspaceEntry(_0x1d56a0,_0x137658,!![]),_0x459955=await readdir(_0xfb0e0a,{'withFileTypes':!![]}),_0x202ff7=await realpath(_0x1d56a0),_0x4a017d=decodeDirectoryCursor(_0x2d6880,_0x137658),_0x12db5a=_0x459955[_0x5b2155(0x16e)](_0x113f7d=>_0x113f7d[_0x5b2155(0x1da)]!==_0x5b2155(0x135)&&!isWorkspaceUploadTemporaryName(_0x113f7d[_0x5b2155(0x1da)]))[_0x5b2155(0x1dd)](_0x3c0f57=>_0x3c0f57[_0x5b2155(0x1da)])[_0x5b2155(0x16d)]((_0x5f5453,_0x5bfd01)=>_0x5f5453[_0x5b2155(0x15d)](_0x5bfd01)),_0x24760f=_0x4a017d===undefined?-0x36*0x71+0x9c4*-0x1+0x219a:_0x12db5a[_0x5b2155(0x1cf)](_0x41ddfd=>_0x41ddfd>_0x4a017d);if(_0x4a017d!==undefined&&_0x24760f===-(-0x11*-0xed+-0x1*-0x2225+-0x31e1))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x1955d8=_0x12db5a[_0x5b2155(0x1cc)](_0x24760f,_0x24760f+_0x542824),_0x16d4a8=[];for(const _0x4ffd07 of _0x1955d8){const _0x599ff2=await resolveWorkspaceEntry(_0x202ff7,relative(_0x202ff7,resolve(_0xfb0e0a,_0x4ffd07)),![])[_0x5b2155(0x18a)](_0x4bfa88=>{if(isSkippableWorkspaceEntryError(_0x4bfa88))return undefined;throw _0x4bfa88;});if(_0x599ff2===undefined)continue;const _0x2057f7=await lstat(_0x599ff2)[_0x5b2155(0x18a)](_0x1b6d11=>{const _0x29592b=_0x5b2155;if(_0x1b6d11[_0x29592b(0x122)]===_0x29592b(0x19f))return undefined;throw _0x1b6d11;});if(_0x2057f7===undefined||!_0x2057f7[_0x5b2155(0xdb)]()&&!_0x2057f7[_0x5b2155(0xc8)]())continue;_0x16d4a8[_0x5b2155(0x127)]({'path':relative(_0x202ff7,_0x599ff2)[_0x5b2155(0x132)](sep)[_0x5b2155(0x18d)]('/'),'name':_0x4ffd07,'kind':_0x2057f7[_0x5b2155(0xc8)]()?_0x5b2155(0xd7):_0x5b2155(0x10f),'size':_0x2057f7[_0x5b2155(0xdb)]()?_0x2057f7[_0x5b2155(0x1ae)]:null,'modifiedAt':_0x2057f7[_0x5b2155(0xeb)]});}const _0x3eaf76=_0x12db5a[_0x24760f+_0x1955d8[_0x5b2155(0x197)]];return{'entries':_0x16d4a8,'nextCursor':_0x3eaf76===undefined||_0x1955d8[_0x5b2155(0x197)]===0x1*0x210d+0x11*-0x21+-0x1edc?null:encodeDirectoryCursor(_0x137658,_0x1955d8[_0x1955d8[_0x5b2155(0x197)]-(-0x10ae+0x14d5+-0x426)]),'truncated':_0x3eaf76!==undefined};}export async function mutateWorkspaceFile(_0x164a91,_0x56e25d){const _0x292a59=_0x28a6c6,_0x14af8f=await realpath(_0x164a91);if(_0x56e25d[_0x292a59(0x1d3)]===_0x292a59(0x117)||_0x56e25d[_0x292a59(0x1d3)]===_0x292a59(0xc4)){const _0xc079a3=await resolveNewWorkspaceEntry(_0x14af8f,_0x56e25d[_0x292a59(0x175)]);if(_0x56e25d[_0x292a59(0x1d3)]===_0x292a59(0x117))await writeFile(_0xc079a3,'',{'flag':'wx'});else await mkdir(_0xc079a3);return{'path':workspaceRelativePath(_0x14af8f,_0xc079a3)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x14af8f,_0x56e25d[_0x292a59(0x175)]);const _0x4fef8f=await resolveWorkspaceEntryMetadata(_0x14af8f,_0x56e25d[_0x292a59(0x175)]);if(workspaceRelativePath(_0x14af8f,_0x4fef8f[_0x292a59(0x175)])==='.')throw new Error(_0x292a59(0x16c));if(_0x56e25d[_0x292a59(0x1d3)]===_0x292a59(0x10b))return await rm(_0x4fef8f[_0x292a59(0x175)],{'recursive':_0x4fef8f[_0x292a59(0x1ac)][_0x292a59(0xc8)](),'force':![]}),{'deleted':!![]};const _0x5a8593=await resolveNewWorkspaceEntry(_0x14af8f,_0x56e25d[_0x292a59(0x1b1)]);if(_0x4fef8f[_0x292a59(0x1ac)][_0x292a59(0xc8)]()){const _0x1cf3f3=relative(_0x4fef8f[_0x292a59(0x175)],_0x5a8593);if(_0x1cf3f3===''||!isAbsolute(_0x1cf3f3)&&_0x1cf3f3!=='..'&&!_0x1cf3f3[_0x292a59(0xf8)]('..'+sep))throw new Error(_0x292a59(0x1a5));}return await rename(_0x4fef8f[_0x292a59(0x175)],_0x5a8593),{'path':workspaceRelativePath(_0x14af8f,_0x5a8593)};}async function resolveNewWorkspaceEntry(_0x143282,_0x216b9d){const _0x5c84f9=_0x28a6c6,_0x32b2ed=_0x216b9d[_0x5c84f9(0xfb)]('\x5c','/'),_0x417328=_0x32b2ed[_0x5c84f9(0x132)]('/'),_0x2ce045=_0x417328['at'](-(-0x7a2*-0x3+0x20*-0xef+-0x1*-0x6fb));if(_0x216b9d[_0x5c84f9(0x14a)]('\x00')||_0x32b2ed[_0x5c84f9(0xf8)]('/')||isAbsolute(_0x216b9d)||win32[_0x5c84f9(0x18c)](_0x32b2ed)||_0x2ce045===undefined||_0x2ce045[_0x5c84f9(0x197)]===0x1841+0x9c6+-0x2207||_0x417328[_0x5c84f9(0x14b)](invalidWorkspaceMutationSegment))throw new Error(_0x5c84f9(0xfa));const _0x314c8b=_0x417328[_0x5c84f9(0x197)]===0xd1*0xb+0x19c3+0x1*-0x22bd?'.':_0x417328[_0x5c84f9(0x1cc)](0x1*-0x1b7d+-0x2487+0x4004,-(0x1215+0x6*-0x53a+0x19*0x88))[_0x5c84f9(0x18d)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x143282,_0x314c8b);const _0x10e8fb=await resolveWorkspaceEntryFromCanonicalRoot(_0x143282,_0x314c8b,!![]),_0x4c3060=resolve(_0x10e8fb,_0x2ce045);try{await lstat(_0x4c3060);throw new Error(_0x5c84f9(0x1e0));}catch(_0x3128e8){if(_0x3128e8[_0x5c84f9(0x122)]!==_0x5c84f9(0x19f))throw _0x3128e8;}return _0x4c3060;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x14a92b,_0x3b5f3){const _0x3c9c89=_0x28a6c6,_0x4dabbf=_0x3b5f3[_0x3c9c89(0xfb)]('\x5c','/');if(_0x4dabbf==='.')return;const _0x3215aa=_0x4dabbf[_0x3c9c89(0x132)]('/');if(_0x3b5f3[_0x3c9c89(0x14a)]('\x00')||_0x4dabbf[_0x3c9c89(0xf8)]('/')||isAbsolute(_0x3b5f3)||win32[_0x3c9c89(0x18c)](_0x4dabbf)||_0x3215aa[_0x3c9c89(0x14b)](invalidWorkspaceMutationSegment))throw new Error(_0x3c9c89(0xfa));let _0x1fac3d=_0x14a92b;for(const _0x4df5b3 of _0x3215aa){_0x1fac3d=resolve(_0x1fac3d,_0x4df5b3);const _0x17887d=await lstat(_0x1fac3d)[_0x3c9c89(0x18a)](_0x532396=>{const _0x1928e9=_0x3c9c89;if(_0x532396[_0x1928e9(0x122)]===_0x1928e9(0x19f))throw new Error(_0x1928e9(0x10c));throw _0x532396;});if(_0x17887d[_0x3c9c89(0x152)]())throw new Error(_0x3c9c89(0xfa));}}function invalidWorkspaceMutationSegment(_0x2a48b4){const _0x82d188=_0x28a6c6;if(_0x2a48b4[_0x82d188(0x197)]===-0x158d+0x28d*0x5+0x466*0x2||_0x2a48b4==='.'||_0x2a48b4==='..'||_0x2a48b4===_0x82d188(0x135))return!![];if(_0x1cf53c()!==_0x82d188(0x192))return![];const _0x40381f=_0x2a48b4[_0x82d188(0x1df)](/[. ]+$/u,'')[_0x82d188(0xe6)]();return/[<>:"|?*]/u[_0x82d188(0x174)](_0x2a48b4)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x82d188(0x174)](_0x40381f);}function workspaceRelativePath(_0x2da54d,_0x467761){const _0x4ebcd2=_0x28a6c6,_0x4d076a=relative(_0x2da54d,_0x467761)[_0x4ebcd2(0x132)](sep)[_0x4ebcd2(0x18d)]('/');return _0x4d076a[_0x4ebcd2(0x197)]===-0x2487+-0x12cf+-0x6*-0x939?'.':_0x4d076a;}function isSkippableWorkspaceEntryError(_0x5209bf){const _0x1e7789=_0x28a6c6;return _0x5209bf instanceof Error&&(_0x5209bf[_0x1e7789(0x153)]===_0x1e7789(0xfa)||_0x5209bf[_0x1e7789(0x153)]===_0x1e7789(0x10c)||_0x5209bf[_0x1e7789(0x153)]===_0x1e7789(0xf2));}export async function preflightWorkspaceUpload(_0x4759c0,_0x876ec9,_0x455920){const _0x4195c8=_0x28a6c6;if(_0x455920[_0x4195c8(0x197)]===0x1541+-0xd33+-0x80e*0x1||_0x455920==='.'||_0x455920==='..'||_0x455920[_0x4195c8(0x14a)]('\x00')||_0x455920[_0x4195c8(0x14a)]('/')||_0x455920[_0x4195c8(0x14a)]('\x5c')||isWorkspaceUploadTemporaryName(_0x455920))return{'path':'','absolutePath':'','status':_0x4195c8(0xde)};const _0x416f3c=await realpath(_0x4759c0),_0x113b79=await resolveWorkspaceEntry(_0x416f3c,_0x876ec9,!![]),_0x289064=resolve(_0x113b79,_0x455920);if(dirname(_0x289064)!==_0x113b79)throw new Error(_0x4195c8(0xfa));const _0x4e2c80=relative(_0x416f3c,_0x289064)[_0x4195c8(0x132)](sep)[_0x4195c8(0x18d)]('/'),_0x2f8354=await lstat(_0x289064)[_0x4195c8(0x18a)](_0x1a9fe2=>{const _0x30e65d=_0x4195c8;if(_0x1a9fe2[_0x30e65d(0x122)]===_0x30e65d(0x19f))return undefined;throw _0x1a9fe2;});if(_0x2f8354===undefined)return{'path':_0x4e2c80,'absolutePath':_0x289064,'status':_0x4195c8(0xcb)};if(_0x2f8354[_0x4195c8(0x152)]())throw new Error(_0x4195c8(0xfa));if(_0x2f8354[_0x4195c8(0xdb)]())return{'path':_0x4e2c80,'absolutePath':_0x289064,'status':_0x4195c8(0xd4)};return{'path':_0x4e2c80,'absolutePath':_0x289064,'status':_0x4195c8(0x169)};}export function workspaceUploadTemporaryName(_0xa7eb51){const _0x2cab83=_0x28a6c6;return _0x2cab83(0x179)+_0xa7eb51+_0x2cab83(0x107);}function isWorkspaceUploadTemporaryName(_0x4d11b7){const _0xb5452d=_0x28a6c6;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0xb5452d(0x174)](_0x4d11b7)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0xb5452d(0x174)](_0x4d11b7);}export async function readWorkspaceTextFile(_0x20baa3,_0x5b67d0,_0x3b24f5=-0x239+0x1*-0x12b6+0x14ef,_0x3caeb5=FILE_READ_LIMIT){const _0x1df4eb=_0x28a6c6;if(!Number[_0x1df4eb(0xf4)](_0x3b24f5)||_0x3b24f5<0x173c*-0x1+-0xe7f+-0x25bb*-0x1||!Number[_0x1df4eb(0xf4)](_0x3caeb5)||_0x3caeb5<0x18a8*-0x1+-0x37d+0x1c26||_0x3caeb5>FILE_READ_LIMIT)throw new Error(_0x1df4eb(0xe3));const _0x185e1a=await realpath(_0x20baa3),_0x1f8578=await resolveWorkspaceEntry(_0x185e1a,_0x5b67d0,![]),_0x251794=await lstat(_0x1f8578);if(!_0x251794[_0x1df4eb(0xdb)]())throw new Error(_0x1df4eb(0xf2));if(_0x251794[_0x1df4eb(0x1ae)]>FILE_READ_LIMIT*(0x3*-0x713+0x2*0x503+0x1*0xb43))throw new Error(_0x1df4eb(0x1d6));const _0x38b00d=await readFile(_0x1f8578),_0x47e3d5=createHash(_0x1df4eb(0x138))[_0x1df4eb(0x1cb)](_0x38b00d)[_0x1df4eb(0x19d)](_0x1df4eb(0x18b)),_0x3cd100=_0x38b00d[_0x1df4eb(0x14a)](-0xe8*-0x1c+-0x61f*-0x1+-0x1f7f)||!isValidUtf8(_0x38b00d);if(_0x3cd100){const _0x555135=Math[_0x1df4eb(0x118)](_0x38b00d[_0x1df4eb(0x197)],_0x3b24f5+_0x3caeb5),_0x1a353c=_0x38b00d[_0x1df4eb(0x130)](_0x3b24f5,_0x555135);return{'path':relative(_0x185e1a,_0x1f8578)[_0x1df4eb(0x132)](sep)[_0x1df4eb(0x18d)]('/'),'encoding':_0x1df4eb(0x1d7),'size':_0x38b00d[_0x1df4eb(0x197)],'content':_0x1a353c[_0x1df4eb(0xd1)](_0x1df4eb(0x1d7)),'truncated':_0x555135<_0x38b00d[_0x1df4eb(0x197)],'nextOffset':_0x555135<_0x38b00d[_0x1df4eb(0x197)]?_0x555135:null,'revision':_0x47e3d5};}if(_0x3b24f5>0x1*-0x20dd+0x179b+0x942&&_0x3b24f5<_0x38b00d[_0x1df4eb(0x197)]&&isUtf8ContinuationByte(_0x38b00d[_0x3b24f5]))throw new Error(_0x1df4eb(0xe3));let _0x2e0ba1=Math[_0x1df4eb(0x118)](_0x38b00d[_0x1df4eb(0x197)],_0x3b24f5+_0x3caeb5);if(_0x2e0ba1<_0x38b00d[_0x1df4eb(0x197)]&&isUtf8ContinuationByte(_0x38b00d[_0x2e0ba1])){while(_0x2e0ba1>_0x3b24f5&&isUtf8ContinuationByte(_0x38b00d[_0x2e0ba1]))_0x2e0ba1-=-0x2524+0x377+0x21ae;if(_0x2e0ba1===_0x3b24f5){_0x2e0ba1+=0x1*0x1048+-0x1*-0x1418+-0x245f;while(_0x2e0ba1<_0x38b00d[_0x1df4eb(0x197)]&&isUtf8ContinuationByte(_0x38b00d[_0x2e0ba1]))_0x2e0ba1+=0x2410+-0x5*0x2c+-0x1*0x2333;}}const _0x4e539d=_0x38b00d[_0x1df4eb(0x130)](_0x3b24f5,_0x2e0ba1),_0xcdceed=new TextDecoder(_0x1df4eb(0xe2),{'fatal':!![]})[_0x1df4eb(0x11e)](_0x4e539d),_0x33d884=_0x2e0ba1<_0x38b00d[_0x1df4eb(0x197)]?_0x2e0ba1:null;return{'path':relative(_0x185e1a,_0x1f8578)[_0x1df4eb(0x132)](sep)[_0x1df4eb(0x18d)]('/'),'encoding':_0x1df4eb(0xe2),'size':_0x38b00d[_0x1df4eb(0x197)],'content':_0xcdceed,'truncated':_0x33d884!==null,'nextOffset':_0x33d884,'revision':_0x47e3d5};}export async function writeWorkspaceTextFile(_0x2cb394,_0x575706,_0x2a4788,_0x1a8e43){const _0x5f08fc=_0x28a6c6;if(!/^[0-9a-f]{64}$/u[_0x5f08fc(0x174)](_0x1a8e43))throw new Error(_0x5f08fc(0x13b));const _0x5dfa27=Buffer[_0x5f08fc(0xf3)](_0x2a4788,_0x5f08fc(0x1bf));if(_0x5dfa27[_0x5f08fc(0x197)]>FILE_READ_LIMIT*(-0x25a7+0xb46+0x1a71))throw new Error(_0x5f08fc(0x1d6));if(_0x5dfa27[_0x5f08fc(0x14a)](0x176b*-0x1+0x2469+0x1*-0xcfe))throw new Error(_0x5f08fc(0x1cd));const _0x9bd393=await realpath(_0x2cb394);await assertWorkspaceMutationPathHasNoSymlinks(_0x9bd393,_0x575706);const _0x14f2fc=await resolveWorkspaceEntry(_0x9bd393,_0x575706,![]),_0x1641c8=await lstat(_0x14f2fc);if(!_0x1641c8[_0x5f08fc(0xdb)]())throw new Error(_0x5f08fc(0xf2));const _0x18d3bb=await readFile(_0x14f2fc);if(_0x18d3bb[_0x5f08fc(0x14a)](-0x9e8+-0x1*0x1537+-0x1f*-0x101)||!isValidUtf8(_0x18d3bb))throw new Error(_0x5f08fc(0x1cd));const _0x5ab51c=createHash(_0x5f08fc(0x138))[_0x5f08fc(0x1cb)](_0x18d3bb)[_0x5f08fc(0x19d)](_0x5f08fc(0x18b));if(_0x5ab51c!==_0x1a8e43)throw new Error(_0x5f08fc(0x13f));const _0x4d5752=createHash(_0x5f08fc(0x138))[_0x5f08fc(0x1cb)](_0x5dfa27)[_0x5f08fc(0x19d)](_0x5f08fc(0x18b)),_0x826aa5=resolve(dirname(_0x14f2fc),_0x5f08fc(0x1e1)+randomUUID()+_0x5f08fc(0x107));try{await writeFile(_0x826aa5,_0x5dfa27,{'flag':'wx','mode':_0x1641c8[_0x5f08fc(0x196)]}),await rename(_0x826aa5,_0x14f2fc);}finally{await rm(_0x826aa5,{'force':!![]})[_0x5f08fc(0x18a)](()=>undefined);}return{'path':workspaceRelativePath(_0x9bd393,_0x14f2fc),'revision':_0x4d5752,'size':_0x5dfa27[_0x5f08fc(0x197)]};}export async function readWorkspaceFileContentRange(_0x3f4f0c,_0x21c77f,_0x239e80=0x17a+0x3*-0x332+0x81c,_0x5bb52d=FILE_READ_LIMIT){const _0x4aba9d=_0x28a6c6;if(!Number[_0x4aba9d(0xf4)](_0x239e80)||_0x239e80<-0x25dc+0x817*-0x3+0x3e21||!Number[_0x4aba9d(0xf4)](_0x5bb52d)||_0x5bb52d<-0x1*0x33b+-0xb50+0xe8c||_0x5bb52d>FILE_READ_LIMIT)throw new Error(_0x4aba9d(0xe3));const _0x4c8aa8=await realpath(_0x3f4f0c),_0x528920=await resolveWorkspaceEntry(_0x4c8aa8,_0x21c77f,![]),_0x48ff8c=await lstat(_0x528920);if(!_0x48ff8c[_0x4aba9d(0xdb)]())throw new Error(_0x4aba9d(0xf2));if(_0x239e80>_0x48ff8c[_0x4aba9d(0x1ae)])throw new Error(_0x4aba9d(0xe3));const _0x1b6b83=Math[_0x4aba9d(0x118)](_0x5bb52d,_0x48ff8c[_0x4aba9d(0x1ae)]-_0x239e80),_0x199659=Buffer[_0x4aba9d(0x19a)](_0x1b6b83),_0x78c743=await open(_0x528920,'r');try{const {bytesRead:_0x53a956}=await _0x78c743[_0x4aba9d(0x139)](_0x199659,0x1*-0x18e5+0x1321*0x1+0x5c4,_0x1b6b83,_0x239e80),_0x6eb9f=_0x239e80+_0x53a956;return{'path':relative(_0x4c8aa8,_0x528920)[_0x4aba9d(0x132)](sep)[_0x4aba9d(0x18d)]('/'),'size':_0x48ff8c[_0x4aba9d(0x1ae)],'offset':_0x239e80,'contentBase64':_0x199659[_0x4aba9d(0x130)](0xc75*-0x1+-0x1*0xa45+0x16ba,_0x53a956)[_0x4aba9d(0xd1)](_0x4aba9d(0x1d7)),'nextOffset':_0x6eb9f<_0x48ff8c[_0x4aba9d(0x1ae)]?_0x6eb9f:null};}finally{await _0x78c743[_0x4aba9d(0x1bd)]();}}export async function readAllowedTextFile(_0x3d0be5,_0x4c57dd,_0x1b8a60=0x1825+-0x1a6c+0x247,_0x2e263d=FILE_READ_LIMIT){const _0x7bb795=_0x28a6c6;if(!isAbsolute(_0x3d0be5))throw new Error(_0x7bb795(0xfa));const _0x448d0a=await realpath(_0x3d0be5)[_0x7bb795(0x18a)](_0x277500=>{const _0x5587ad=_0x7bb795;if(_0x277500[_0x5587ad(0x122)]===_0x5587ad(0x19f))throw new Error(_0x5587ad(0x10c));throw _0x277500;}),_0x1407b5=await Promise[_0x7bb795(0x150)](_0x4c57dd[_0x7bb795(0x1dd)](_0x836f55=>realpath(_0x836f55)));if(!isWithinAllowedRoot(_0x448d0a,_0x1407b5))throw new Error(_0x7bb795(0xfa));const _0xea205=await lstat(_0x448d0a);if(!_0xea205[_0x7bb795(0xdb)]())throw new Error(_0x7bb795(0xf2));if(_0xea205[_0x7bb795(0x1ae)]>FILE_READ_LIMIT*(0xa*0x212+0x1222+-0x26c6))throw new Error(_0x7bb795(0x1d6));if(!Number[_0x7bb795(0xf4)](_0x1b8a60)||_0x1b8a60<0x727+0x226b+-0x2992||!Number[_0x7bb795(0xf4)](_0x2e263d)||_0x2e263d<0x2*-0xb22+-0xfb0+0x25f5||_0x2e263d>FILE_READ_LIMIT)throw new Error(_0x7bb795(0xe3));const _0x162a0f=await readFile(_0x448d0a),_0x4114e2=_0x162a0f[_0x7bb795(0x14a)](0x2*0xa06+0x751*0x1+-0x1b5d)||!isValidUtf8(_0x162a0f),_0x5ed175=Math[_0x7bb795(0x118)](_0x162a0f[_0x7bb795(0x197)],_0x1b8a60+_0x2e263d);if(_0x4114e2){const _0x4c7ffc=_0x162a0f[_0x7bb795(0x130)](_0x1b8a60,_0x5ed175);return{'path':_0x448d0a,'encoding':_0x7bb795(0x1d7),'size':_0x162a0f[_0x7bb795(0x197)],'content':_0x4c7ffc[_0x7bb795(0xd1)](_0x7bb795(0x1d7)),'truncated':_0x5ed175<_0x162a0f[_0x7bb795(0x197)],'nextOffset':_0x5ed175<_0x162a0f[_0x7bb795(0x197)]?_0x5ed175:null};}if(_0x1b8a60>0x1cbe+-0x18bc+0x36*-0x13&&_0x1b8a60<_0x162a0f[_0x7bb795(0x197)]&&isUtf8ContinuationByte(_0x162a0f[_0x1b8a60]))throw new Error(_0x7bb795(0xe3));let _0x5e02d7=_0x5ed175;if(_0x5e02d7<_0x162a0f[_0x7bb795(0x197)]&&isUtf8ContinuationByte(_0x162a0f[_0x5e02d7])){while(_0x5e02d7>_0x1b8a60&&isUtf8ContinuationByte(_0x162a0f[_0x5e02d7]))_0x5e02d7-=-0x259f+-0x7b5+-0xb*-0x41f;if(_0x5e02d7===_0x1b8a60){_0x5e02d7+=0x1361+-0x14+0x104*-0x13;while(_0x5e02d7<_0x162a0f[_0x7bb795(0x197)]&&isUtf8ContinuationByte(_0x162a0f[_0x5e02d7]))_0x5e02d7+=-0x98e+0x1*0x1393+-0xa04;}}const _0x257882=_0x5e02d7<_0x162a0f[_0x7bb795(0x197)]?_0x5e02d7:null;return{'path':_0x448d0a,'encoding':_0x7bb795(0xe2),'size':_0x162a0f[_0x7bb795(0x197)],'content':new TextDecoder(_0x7bb795(0xe2),{'fatal':!![]})[_0x7bb795(0x11e)](_0x162a0f[_0x7bb795(0x130)](_0x1b8a60,_0x5e02d7)),'truncated':_0x257882!==null,'nextOffset':_0x257882};}function isValidUtf8(_0x10ba2d){const _0x17a035=_0x28a6c6;try{return new TextDecoder(_0x17a035(0xe2),{'fatal':!![]})[_0x17a035(0x11e)](_0x10ba2d),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x237a5){return(_0x237a5&-0x26*0x12+0x6*-0x221+0x1032)===0x19ae+-0xb57+0x3*-0x49d;}export async function searchWorkspaceFiles(_0x2b1f16,_0x59b5f6,_0x506b14,_0x43fcfa=SEARCH_RESULT_LIMIT,_0x5ba12c=![]){const _0x3483ce=_0x28a6c6,_0x5b170b=new WorkspaceFileIndex(_0x2b1f16);try{return await _0x5b170b[_0x3483ce(0x14f)](_0x59b5f6,_0x506b14,_0x43fcfa,_0x5ba12c);}finally{_0x5b170b[_0x3483ce(0x1d5)]();}}async function resolveWorkspaceEntry(_0x178f9a,_0x1aab56,_0x12b8c3){const _0x11ec29=await realpath(_0x178f9a);return resolveWorkspaceEntryFromCanonicalRoot(_0x11ec29,_0x1aab56,_0x12b8c3);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x2df223,_0x521b58,_0x3e313a){const _0x2c6950=_0x28a6c6,_0x2a4be8=await resolveWorkspaceEntryMetadata(_0x2df223,_0x521b58);if(_0x3e313a?!_0x2a4be8[_0x2c6950(0x1ac)][_0x2c6950(0xc8)]():!_0x2a4be8[_0x2c6950(0x1ac)][_0x2c6950(0xdb)]()&&!_0x2a4be8[_0x2c6950(0x1ac)][_0x2c6950(0xc8)]())throw new Error(_0x3e313a?_0x2c6950(0x142):_0x2c6950(0xf2));return _0x2a4be8[_0x2c6950(0x175)];}async function resolveWorkspaceEntryMetadata(_0x31d7c8,_0x18ecb1){const _0x3b5a03=_0x28a6c6;if(_0x18ecb1[_0x3b5a03(0x14a)]('\x00')||_0x18ecb1[_0x3b5a03(0x197)]===-0x205c+0x17ba+-0x5*-0x1ba||_0x18ecb1[_0x3b5a03(0xf8)]('/')||_0x18ecb1[_0x3b5a03(0xf8)]('\x5c'))throw new Error(_0x3b5a03(0xfa));const _0x371cbc=_0x18ecb1[_0x3b5a03(0xfb)]('\x5c','/');if(_0x371cbc[_0x3b5a03(0x132)]('/')[_0x3b5a03(0x14b)](_0x507a4d=>_0x507a4d==='..'||_0x507a4d===_0x3b5a03(0x135)))throw new Error(_0x3b5a03(0xfa));let _0x3a1765;try{_0x3a1765=await realpath(resolve(_0x31d7c8,_0x371cbc));}catch(_0x57ac6d){if(_0x57ac6d[_0x3b5a03(0x122)]===_0x3b5a03(0x19f))throw new Error(_0x3b5a03(0x10c));throw _0x57ac6d;}const _0x11f190=relative(_0x31d7c8,_0x3a1765);if(isAbsolute(_0x11f190)||_0x11f190[_0x3b5a03(0xf8)]('..')||_0x11f190==='..'||_0x11f190[_0x3b5a03(0xf8)]('..'+sep))throw new Error(_0x3b5a03(0xfa));const _0x3e02b7=await lstat(_0x3a1765);return{'path':_0x3a1765,'metadata':_0x3e02b7};}async function inspectWorkspaceIndexEntry(_0x5bd37c,_0x441621,_0x58332e){const _0x3e3585=_0x28a6c6;try{const _0x259473=await resolveWorkspaceEntryMetadata(_0x5bd37c,_0x441621);if(!_0x259473[_0x3e3585(0x1ac)][_0x3e3585(0xdb)]()&&!_0x259473[_0x3e3585(0x1ac)][_0x3e3585(0xc8)]())return undefined;const _0x37a464=relative(_0x5bd37c,_0x259473[_0x3e3585(0x175)])[_0x3e3585(0x132)](sep)[_0x3e3585(0x18d)]('/');return _0x259473[_0x3e3585(0x1ac)][_0x3e3585(0xc8)]()?{'path':_0x37a464,'name':_0x58332e,'kind':_0x3e3585(0xd7),'size':null,'modifiedAt':_0x259473[_0x3e3585(0x1ac)][_0x3e3585(0xeb)]}:{'path':_0x37a464,'name':_0x58332e,'kind':_0x3e3585(0x10f),'size':_0x259473[_0x3e3585(0x1ac)][_0x3e3585(0x1ae)],'modifiedAt':_0x259473[_0x3e3585(0x1ac)][_0x3e3585(0xeb)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x177d90,_0x3e49ab){const _0x34d889=_0x28a6c6;return Buffer[_0x34d889(0xf3)](JSON[_0x34d889(0x109)]({'path':_0x177d90,'name':_0x3e49ab}))[_0x34d889(0xd1)](_0x34d889(0x194));}function decodeDirectoryCursor(_0xfa9286,_0xfbb202){const _0x23267f=_0x28a6c6;if(_0xfa9286===undefined)return undefined;try{const _0x15a91f=JSON[_0x23267f(0x134)](Buffer[_0x23267f(0xf3)](_0xfa9286,_0x23267f(0x194))[_0x23267f(0xd1)](_0x23267f(0x1bf)));if(typeof _0x15a91f!==_0x23267f(0xf5)||_0x15a91f===null||_0x15a91f[_0x23267f(0x175)]!==_0xfbb202||typeof _0x15a91f[_0x23267f(0x1da)]!==_0x23267f(0xe5))throw new Error();return _0x15a91f[_0x23267f(0x1da)];}catch{throw new Error(_0x23267f(0x187));}}function encodeSearchCursor(_0x165bf2,_0x41becd){const _0x3bd056=_0x28a6c6;return Buffer[_0x3bd056(0xf3)](JSON[_0x3bd056(0x109)]({'query':_0x165bf2,'path':_0x41becd}))[_0x3bd056(0xd1)](_0x3bd056(0x194));}function decodeSearchCursor(_0x52c693,_0x5029c7){const _0x153b3a=_0x28a6c6;if(_0x52c693===undefined)return undefined;try{const _0x49e770=JSON[_0x153b3a(0x134)](Buffer[_0x153b3a(0xf3)](_0x52c693,_0x153b3a(0x194))[_0x153b3a(0xd1)](_0x153b3a(0x1bf)));if(typeof _0x49e770!==_0x153b3a(0xf5)||_0x49e770===null||_0x49e770[_0x153b3a(0xc9)]!==_0x5029c7||typeof _0x49e770[_0x153b3a(0x175)]!==_0x153b3a(0xe5))throw new Error();return _0x49e770[_0x153b3a(0x175)];}catch{throw new Error(_0x153b3a(0x187));}}export function normalizeWorkspacePath(_0x5874fd,_0x20009e=_0x1cf53c()){const _0x516508=_0x28a6c6;if(_0x5874fd[_0x516508(0x197)]===0x20a2*-0x1+-0xcd9+-0x3*-0xf29||_0x5874fd[_0x516508(0x14a)]('\u0000'))throw new Error(_0x516508(0x1ca));if(_0x20009e===_0x516508(0x192)){if(/^\\\\[?.]/[_0x516508(0x174)](_0x5874fd))throw new Error(_0x516508(0x108));const _0x3d0e66=win32[_0x516508(0x128)](_0x5874fd[_0x516508(0xfb)]('/','\x5c'));if(!win32[_0x516508(0x18c)](_0x3d0e66))throw new Error(_0x516508(0x116));return _0x3d0e66[_0x516508(0x1df)](/\\+$/,'')[_0x516508(0x160)]();}if(_0x20009e!==_0x516508(0x143))throw new Error(_0x516508(0x1ad));const _0xc06e02=posix[_0x516508(0x128)](_0x5874fd);if(!posix[_0x516508(0x18c)](_0xc06e02))throw new Error(_0x516508(0x116));return _0xc06e02==='/'?_0xc06e02:_0xc06e02[_0x516508(0x1df)](/\/+$/,'');}export function isWithinAllowedRoot(_0x1f575a,_0xad3a1b,_0x2e0dff=_0x1cf53c()){const _0x48b9ed=_0x28a6c6,_0x232035=normalizeWorkspacePath(_0x1f575a,_0x2e0dff),_0x2b412e=_0x2e0dff===_0x48b9ed(0x192)?win32:posix;return _0xad3a1b[_0x48b9ed(0x14b)](_0x32e982=>{const _0xe64829=_0x48b9ed,_0x541574=normalizeWorkspacePath(_0x32e982,_0x2e0dff),_0xdfafcd=_0x2b412e[_0xe64829(0x1a9)](_0x541574,_0x232035);return _0xdfafcd===''||!_0xdfafcd[_0xe64829(0xf8)]('..')&&!_0x2b412e[_0xe64829(0x18c)](_0xdfafcd);});}export async function inspectWorkspace(_0x1bc931,_0x38e06c){const _0x4ea55f=_0x28a6c6,_0x966787=await realpath(_0x1bc931),_0x213f35=await Promise[_0x4ea55f(0x150)](_0x38e06c[_0x4ea55f(0x1dd)](_0x49942f=>realpath(_0x49942f))),_0x54e0c5=await stat(_0x966787);if(!_0x54e0c5[_0x4ea55f(0xc8)]()||!isWithinAllowedRoot(_0x966787,_0x213f35))throw new Error(_0x4ea55f(0x17e));try{const _0x47eaf6=await readGitSummary(_0x966787);return{'path':_0x966787,'kind':_0x4ea55f(0xcf),'gitSummary':_0x47eaf6};}catch(_0x37e041){if(_0x37e041 instanceof GitCommandError&&_0x37e041[_0x4ea55f(0x122)]===0x1*-0x1f05+-0x263*0xa+0x1*0x3763||isGitUnavailable(_0x37e041))return{'path':_0x966787,'kind':_0x4ea55f(0xd7)};throw _0x37e041;}}export async function readGitSummary(_0xe7ab8d){const _0x301967=_0x28a6c6,_0x432679=(await runGit(_0xe7ab8d,[_0x301967(0x178),_0x301967(0x1d9)]))[_0x301967(0x1a7)][_0x301967(0x1b5)](),_0x55b567=(await runGit(_0xe7ab8d,[_0x301967(0x178),_0x301967(0x119),_0x301967(0x173)]))[_0x301967(0x1a7)][_0x301967(0x1b5)](),_0x290867=await runGitAllowFailure(_0xe7ab8d,[_0x301967(0x189),_0x301967(0x1ce),_0x301967(0x1b2),_0x301967(0x173)]),_0x5ed9c6=(await runGit(_0xe7ab8d,[_0x301967(0x114),_0x301967(0x1d4),'-z']))[_0x301967(0x182)][_0x301967(0x197)]>0x6e8*0x1+-0x11*-0x23b+-0x11*0x2a3,_0x5d24bc=await runGit(_0xe7ab8d,[_0x301967(0x114),_0x301967(0x1d4)])[_0x301967(0x110)](_0x2c8d2a=>_0x2c8d2a[_0x301967(0x1a7)]);return{'commonDir':_0x432679,'head':_0x55b567,'branch':_0x290867[_0x301967(0x122)]===-0x11*0x1e2+0x10d*-0x13+-0x1*-0x33f9?_0x290867[_0x301967(0x1a7)][_0x301967(0x1b5)]():null,'dirty':_0x5ed9c6,'snapshot':summarizeText(_0x5d24bc)};}export function assertSafeGitRef(_0x4f8923){const _0x9bd2d5=_0x28a6c6;if(!REF_PATTERN[_0x9bd2d5(0x174)](_0x4f8923))throw new Error(_0x9bd2d5(0x18e));}export async function readRestrictedDiff(_0x283a87,_0x5809f4,_0xd67053){const _0x377af7=_0x28a6c6;assertSafeGitRef(_0x5809f4),assertSafeGitRef(_0xd67053);const _0x443c3e=await runGit(_0x283a87,[_0x377af7(0x199),_0x377af7(0x120),_0x377af7(0x176),_0x5809f4,_0xd67053]),_0x57f056=_0x443c3e[_0x377af7(0x182)][_0x377af7(0x14a)](-0x31+-0xcbd+0x296*0x5)||_0x443c3e[_0x377af7(0x1a7)][_0x377af7(0x14a)](_0x377af7(0x1a6));if(_0x57f056)return{'binary':!![],'summary':_0x377af7(0x14e)+createHash(_0x377af7(0x138))[_0x377af7(0x1cb)](_0x443c3e[_0x377af7(0x182)])[_0x377af7(0x19d)](_0x377af7(0x18b))+_0x377af7(0x188)+_0x443c3e[_0x377af7(0x182)][_0x377af7(0x197)],'truncated':_0x443c3e[_0x377af7(0x104)]};return{'binary':![],'text':_0x443c3e[_0x377af7(0x1a7)],'truncated':_0x443c3e[_0x377af7(0x104)]};}function currentBranchFromStatusHeader(_0x4b3ac1){const _0x2b4b4f=_0x28a6c6,_0x2d5300=_0x4b3ac1[_0x2b4b4f(0x1cc)](-0x85*-0x45+0x25e5+-0x2f3*0x19);if(_0x2d5300[_0x2b4b4f(0xf8)](_0x2b4b4f(0x16f)))return null;const _0x714eb=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x2b4b4f(0x186)](_0x2d5300);if(_0x714eb!==null)return _0x714eb[0x12e4+-0xa66*-0x2+0x1*-0x27af]??null;return _0x2d5300[_0x2b4b4f(0x132)](_0x2b4b4f(0x12f))[-0x13*-0x179+-0x1*-0x42d+0x55c*-0x6]?.[_0x2b4b4f(0x132)]('\x20')[0x21e0+0x73e+-0x1*0x291e]??null;}export async function readCurrentChangesSummary(_0x2d5738){const _0x3c6aff=_0x28a6c6,_0x5cc3b6=await runGit(_0x2d5738,[_0x3c6aff(0x114),_0x3c6aff(0x1d4),'-z',_0x3c6aff(0x162),_0x3c6aff(0x184)]),_0x5e1db5=_0x5cc3b6[_0x3c6aff(0x1a7)][_0x3c6aff(0x132)]('\x00'),_0x13ba22=_0x5e1db5[_0x3c6aff(0x1c7)]()??'',_0x37d94f=[];for(let _0x4784e0=-0x1e08+-0x104e+0x2e56;_0x4784e0<_0x5e1db5[_0x3c6aff(0x197)];_0x4784e0+=0x20c5+0x1f34+-0x2c8*0x17){const _0x1e2ffa=_0x5e1db5[_0x4784e0];if(_0x1e2ffa[_0x3c6aff(0x197)]<0x24ee+0x92*-0x21+0x243*-0x8)continue;const _0x5743a6=_0x1e2ffa[-0x7fe+-0x1da6+-0x36c*-0xb],_0x4bb9a1=_0x1e2ffa[0x1ce+-0x7*-0x15+-0x260],_0x44d915=_0x1e2ffa[_0x3c6aff(0x1cc)](-0x1*0x463+-0x16f2+0x1b58);if(_0x5743a6==='?'&&_0x4bb9a1==='?'){_0x37d94f[_0x3c6aff(0x127)]({'path':_0x44d915,'state':_0x3c6aff(0x1c8),'change':_0x3c6aff(0x19b)});continue;}_0x5743a6!=='\x20'&&_0x37d94f[_0x3c6aff(0x127)]({'path':_0x44d915,'state':_0x3c6aff(0x137),'change':gitChange(_0x5743a6)});_0x4bb9a1!=='\x20'&&_0x37d94f[_0x3c6aff(0x127)]({'path':_0x44d915,'state':_0x3c6aff(0xd9),'change':gitChange(_0x4bb9a1)});if(_0x5743a6==='R'||_0x5743a6==='C'||_0x4bb9a1==='R'||_0x4bb9a1==='C')_0x4784e0+=0x17d8+0x38f+-0x1b66;}return{'branch':_0x13ba22[_0x3c6aff(0xf8)](_0x3c6aff(0xd6))?currentBranchFromStatusHeader(_0x13ba22):null,'changes':_0x37d94f};}export async function listInitializedSubmodulePaths(_0x4765a7){const _0x34446e=_0x28a6c6,_0x51d5cb=await runGit(_0x4765a7,[_0x34446e(0x1d0),_0x34446e(0x114),_0x34446e(0x18f)]);return _0x51d5cb[_0x34446e(0x1a7)][_0x34446e(0x132)](/\r?\n/)[_0x34446e(0x154)](_0x3c9b2b=>{const _0x3b81ec=_0x34446e;if(_0x3c9b2b[_0x3b81ec(0x197)]<-0x22aa+0x6aa*-0x2+0x5c*0x86)return[];const _0x4dff75=_0x3c9b2b[-0x2260+0x1b7*-0x15+0x4663];if(_0x4dff75==='-')return[];const _0x1de1d4=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x3b81ec(0x186)](_0x3c9b2b),_0x4039ef=_0x1de1d4?.[0xa74+0xd*-0x2d1+-0x1a2a*-0x1]?.[_0x3b81ec(0xfb)]('\x5c','/');return _0x4039ef===undefined||_0x4039ef[_0x3b81ec(0x197)]===0xaa9*-0x3+0xad9*0x2+0xa49?[]:[_0x4039ef];})[_0x34446e(0x16d)]((_0x3f6a17,_0x576569)=>_0x3f6a17[_0x34446e(0x15d)](_0x576569));}export async function resolveGitRepository(_0x2ca7df,_0x39ea93){const _0x21c891=_0x28a6c6;if(_0x39ea93[_0x21c891(0x197)]===0x1*0xd+-0x1*-0x146+0x71*-0x3)return realpath(_0x2ca7df);if(_0x39ea93[_0x21c891(0x14a)]('\x00')||_0x39ea93[_0x21c891(0xf8)]('/')||_0x39ea93[_0x21c891(0xf8)]('\x5c')||_0x39ea93[_0x21c891(0x132)]('/')[_0x21c891(0x14b)](_0x83e413=>_0x83e413[_0x21c891(0x197)]===0x91*0x3b+-0x1*0x1c88+0x1a1*-0x3||_0x83e413==='.'||_0x83e413==='..'))throw new Error(_0x21c891(0x133));const _0x3ead23=await listInitializedSubmodulePaths(_0x2ca7df);if(!_0x3ead23[_0x21c891(0x14a)](_0x39ea93))throw new Error(_0x21c891(0x133));const _0x5947d0=resolve(await realpath(_0x2ca7df),_0x39ea93);try{await readGitSummary(_0x5947d0);}catch{throw new Error(_0x21c891(0x133));}return _0x5947d0;}export async function listGitHistoryRefs(_0x49516b){const _0xab06bf=_0x28a6c6,_0x1bf8fb=await runGit(_0x49516b,[_0xab06bf(0x15b),_0xab06bf(0x190),_0xab06bf(0x115),_0xab06bf(0x105)]);return _0x1bf8fb[_0xab06bf(0x1a7)][_0xab06bf(0x132)](/\r?\n/)[_0xab06bf(0x154)](_0x18ac4a=>{const _0x35d4be=_0xab06bf,[_0x34bad3,_0x207562,_0x47594f,_0x476821,_0xe74d6]=_0x18ac4a[_0x35d4be(0x132)]('\x09');if(_0x34bad3===undefined||_0x207562===undefined||_0x47594f===undefined||_0xe74d6===undefined||_0xe74d6[_0x35d4be(0x197)]>-0x1f8+-0xdf2+0x123*0xe||!/^[0-9a-f]{40,64}$/[_0x35d4be(0x174)](_0x47594f))return[];const _0x142db5=_0x34bad3[_0x35d4be(0xf8)](_0x35d4be(0x15a))?_0x35d4be(0x113):_0x34bad3[_0x35d4be(0xf8)](_0x35d4be(0x15e))?_0x35d4be(0x17c):undefined;return _0x142db5===undefined?[]:[{'name':_0x34bad3,'displayName':_0x207562,'kind':_0x142db5,'hash':_0x47594f,'current':_0x476821==='*'}];})[_0xab06bf(0x16d)]((_0x3f7730,_0xd5d879)=>_0x3f7730[_0xab06bf(0xfd)][_0xab06bf(0x15d)](_0xd5d879[_0xab06bf(0xfd)])||_0x3f7730[_0xab06bf(0xed)][_0xab06bf(0x15d)](_0xd5d879[_0xab06bf(0xed)]));}function selectedHistoryRefs(_0x1e0992,_0x4f8810){const _0x369ab8=_0x28a6c6;if(_0x4f8810===undefined||_0x4f8810[_0x369ab8(0x197)]===-0x14a9+-0x1*-0x12e5+0x1c4*0x1)return _0x1e0992;const _0x3224f8=[...new Set(_0x4f8810)],_0x2e6c8d=_0x3224f8[_0x369ab8(0x1dd)](_0x56268a=>_0x1e0992[_0x369ab8(0x151)](_0x361467=>_0x361467[_0x369ab8(0x1da)]===_0x56268a));if(_0x2e6c8d[_0x369ab8(0x14b)](_0x551d7f=>_0x551d7f===undefined))throw new Error(_0x369ab8(0x11a));return _0x2e6c8d;}function historyCursor(_0x3b698e,_0x224369){const _0x462953=_0x28a6c6;return Buffer[_0x462953(0xf3)](JSON[_0x462953(0x109)]({'offset':_0x3b698e,'fingerprint':_0x224369}))[_0x462953(0xd1)](_0x462953(0x194));}function parseHistoryCursor(_0x16d379,_0x4bcc35){const _0x1649dd=_0x28a6c6;if(_0x16d379===undefined)return 0x1*0x705+0x11be*-0x2+-0x97d*-0x3;try{const _0x4937b0=JSON[_0x1649dd(0x134)](Buffer[_0x1649dd(0xf3)](_0x16d379,_0x1649dd(0x194))[_0x1649dd(0xd1)](_0x1649dd(0x1bf)));if(!Number[_0x1649dd(0x15c)](_0x4937b0[_0x1649dd(0x1ab)])||_0x4937b0[_0x1649dd(0x1ab)]<-0x89e*0x2+-0xa6d+0x1ba9||_0x4937b0[_0x1649dd(0x16a)]!==_0x4bcc35)throw new Error(_0x1649dd(0x1bb));return _0x4937b0[_0x1649dd(0x1ab)];}catch{throw new Error(_0x1649dd(0x155));}}export async function readGitHistory(_0x2dab2e,_0x102fdb){const _0x13ccd7=_0x28a6c6,_0x9e7f65=await listGitHistoryRefs(_0x2dab2e),_0x356c4d=selectedHistoryRefs(_0x9e7f65,_0x102fdb[_0x13ccd7(0xe0)]);if(_0x356c4d[_0x13ccd7(0x197)]===-0x1*0xc46+0x1*-0x1b14+-0x1b6*-0x17)return{'commits':[],'nextCursor':null};const _0x424449=_0x102fdb[_0x13ccd7(0x1b6)]??-0x3*-0x4a9+-0x2*-0xdfd+0x1*-0x29c3;if(!Number[_0x13ccd7(0x15c)](_0x424449)||_0x424449<0x2*0x3b6+0xb*-0x7b+-0x222||_0x424449>0x7*-0x301+-0x1075*0x2+0x3655)throw new Error(_0x13ccd7(0x10d));const _0x4add65=_0x356c4d[_0x13ccd7(0x1dd)](_0x520522=>_0x520522[_0x13ccd7(0x1da)])[_0x13ccd7(0x16d)](),_0x18c387=createHash(_0x13ccd7(0x138))[_0x13ccd7(0x1cb)](_0x356c4d[_0x13ccd7(0x1dd)](_0x544c88=>_0x544c88[_0x13ccd7(0x1da)]+'\x00'+_0x544c88[_0x13ccd7(0x13e)])[_0x13ccd7(0x16d)]()[_0x13ccd7(0x18d)]('\x00'))[_0x13ccd7(0x19d)](_0x13ccd7(0x18b)),_0x58e8f4=parseHistoryCursor(_0x102fdb[_0x13ccd7(0xea)],_0x18c387),_0x324241=await runGit(_0x2dab2e,[_0x13ccd7(0xe4),_0x13ccd7(0x125),_0x13ccd7(0x1b3),_0x13ccd7(0x100)+_0x58e8f4,_0x13ccd7(0x103)+(_0x424449+(0x5*-0x1f9+-0x1832+0x2210)),'-z',_0x13ccd7(0x147),..._0x4add65,'--']),_0x4c5aed=new Map();for(const _0x52bf88 of _0x9e7f65){const _0x3cd2ad=_0x4c5aed[_0x13ccd7(0xfe)](_0x52bf88[_0x13ccd7(0x13e)])??[];_0x3cd2ad[_0x13ccd7(0x127)](_0x52bf88[_0x13ccd7(0xed)]),_0x4c5aed[_0x13ccd7(0x144)](_0x52bf88[_0x13ccd7(0x13e)],_0x3cd2ad);}const _0x4fad04=_0x324241[_0x13ccd7(0x1a7)][_0x13ccd7(0x132)]('\x00'),_0x22d06e=[];for(let _0x1ceeba=-0x1*0x1adf+0x1883+0x25c;_0x1ceeba+(0x18e4+-0xff9+-0x2*0x473)<_0x4fad04[_0x13ccd7(0x197)];_0x1ceeba+=0x2*-0x1032+0xdda+0x1290){const [_0x5ac380,_0x5516f1='',_0xfe590b='',_0x2db1c5='',_0xe3bd4a='0',_0xf8bf32='']=_0x4fad04[_0x13ccd7(0x1cc)](_0x1ceeba,_0x1ceeba+(0x1*0x1da5+0x2*0x62a+-0x29f3));if(_0x5ac380===undefined||!/^[0-9a-f]{40,64}$/[_0x13ccd7(0x174)](_0x5ac380))continue;_0x22d06e[_0x13ccd7(0x127)]({'hash':_0x5ac380,'parents':_0x5516f1[_0x13ccd7(0x197)]===-0x1418+0x2d1+-0x1147*-0x1?[]:_0x5516f1[_0x13ccd7(0x132)]('\x20'),'authorName':_0xfe590b,'authorEmail':_0x2db1c5,'committedAt':Number(_0xe3bd4a)*(0x6c8+-0xe38+0xb58),'subject':_0xf8bf32,'refs':_0x4c5aed[_0x13ccd7(0xfe)](_0x5ac380)??[]});}const _0x1c4f0c=_0x22d06e[_0x13ccd7(0x197)]>_0x424449;return{'commits':_0x22d06e[_0x13ccd7(0x1cc)](0xf5c*0x1+0x3*-0x43b+-0x2ab,_0x424449),'nextCursor':_0x1c4f0c?historyCursor(_0x58e8f4+_0x424449,_0x18c387):null};}async function assertHistoryCommitReachable(_0x1b04df,_0x606f30,_0x34503e){const _0x4be247=_0x28a6c6;if(!/^[0-9a-f]{40,64}$/[_0x4be247(0x174)](_0x606f30))throw new Error(_0x4be247(0x185));const _0x5dbd4d=selectedHistoryRefs(await listGitHistoryRefs(_0x1b04df),_0x34503e);for(const _0x2c793f of _0x5dbd4d){const _0x2fdd91=await runGitAllowFailure(_0x1b04df,[_0x4be247(0x1af),_0x4be247(0x193),_0x606f30,_0x2c793f[_0x4be247(0x1da)]]);if(_0x2fdd91[_0x4be247(0x122)]===0x21*0x67+-0xaaa+-0x29d)return;}throw new Error(_0x4be247(0x185));}export async function readGitHistoryFiles(_0x15c0c2,_0x2d3f06,_0x4cb36e){const _0x4803bd=_0x28a6c6;await assertHistoryCommitReachable(_0x15c0c2,_0x2d3f06,_0x4cb36e);const _0x29f647=await runGit(_0x15c0c2,[_0x4803bd(0x10e),_0x4803bd(0x177),_0x4803bd(0xcc),_0x4803bd(0x1e2),'-r','-z','-M','-C',_0x4803bd(0x19e),_0x2d3f06]),_0xfd91d3=_0x29f647[_0x4803bd(0x1a7)][_0x4803bd(0x132)]('\x00'),_0x591166=[];for(let _0x85df60=0x9*-0x197+-0x21a6+0x1*0x2ff5;_0x85df60<_0xfd91d3[_0x4803bd(0x197)];_0x85df60+=0x16ed+0x19f7+0x5*-0x9c7){const _0x492cfa=_0xfd91d3[_0x85df60];if(_0x492cfa===undefined||_0x492cfa[_0x4803bd(0x197)]===-0x1ec4+-0x13d5+-0x3299*-0x1)continue;const _0x3f78d4=_0x492cfa[0xeb9+0x11d1+0x5*-0x682]??'M';if(_0x3f78d4==='R'||_0x3f78d4==='C'){const _0x4fc34e=_0xfd91d3[_0x85df60+(-0x8db*-0x1+0x21*-0xcb+0x1151)],_0x3bed77=_0xfd91d3[_0x85df60+(-0x1871+-0x35e+0x1bd1)];if(_0x4fc34e!==undefined&&_0x3bed77!==undefined)_0x591166[_0x4803bd(0x127)]({'path':_0x3bed77,'previousPath':_0x4fc34e,'change':gitChange(_0x3f78d4)});_0x85df60+=0x1342+0x1e42+0x18c1*-0x2;}else{const _0x43fe15=_0xfd91d3[_0x85df60+(-0xc11*0x3+-0x19a6+-0x111*-0x3a)];if(_0x43fe15!==undefined)_0x591166[_0x4803bd(0x127)]({'path':_0x43fe15,'change':gitChange(_0x3f78d4)});_0x85df60+=-0x1*-0xb6a+-0x86*0x2f+0xd31;}}return _0x591166;}export async function readGitHistoryFileDiff(_0x5986d7,_0x5aca16,_0x4c4e1a,_0x419bac,_0x5d8eb4){const _0x30dcf0=_0x28a6c6;await assertHistoryCommitReachable(_0x5986d7,_0x5aca16,_0x419bac);const _0x1558e6=safeGitWorkspacePath(_0x4c4e1a),_0x4c5856=_0x5d8eb4===undefined?undefined:safeGitWorkspacePath(_0x5d8eb4),_0x5ba08b=await runGit(_0x5986d7,[_0x30dcf0(0xfc),_0x30dcf0(0x148),_0x30dcf0(0xcc),_0x30dcf0(0x120),_0x30dcf0(0x176),_0x5aca16,'--',_0x30dcf0(0x156)+_0x1558e6,..._0x4c5856===undefined||_0x4c5856===_0x1558e6?[]:[_0x30dcf0(0x156)+_0x4c5856]]),_0x452037=_0x5ba08b[_0x30dcf0(0x182)][_0x30dcf0(0x14a)](-0x23e7+0x2127+0x2c0)||_0x5ba08b[_0x30dcf0(0x1a7)][_0x30dcf0(0x14a)](_0x30dcf0(0x1a6));if(_0x452037)return{'binary':!![],'summary':_0x30dcf0(0x14e)+createHash(_0x30dcf0(0x138))[_0x30dcf0(0x1cb)](_0x5ba08b[_0x30dcf0(0x182)])[_0x30dcf0(0x19d)](_0x30dcf0(0x18b))+_0x30dcf0(0x188)+_0x5ba08b[_0x30dcf0(0x182)][_0x30dcf0(0x197)],'truncated':_0x5ba08b[_0x30dcf0(0x104)]};return{'binary':![],'text':_0x5ba08b[_0x30dcf0(0x1a7)],'truncated':_0x5ba08b[_0x30dcf0(0x104)]};}export async function readGitHistoryFileContentRange(_0x1610bf,_0x48bc80,_0x32e248,_0x28e7d5,_0x3f13b6,_0x28eed7){const _0x25964b=_0x28a6c6;if(!Number[_0x25964b(0xf4)](_0x28e7d5)||_0x28e7d5<-0x4*-0x378+0x1*0xf35+-0x5d1*0x5||!Number[_0x25964b(0xf4)](_0x3f13b6)||_0x3f13b6<-0x1136+-0xb*-0xc9+-0x7a*-0x12||_0x3f13b6>(-0x3*0x716+-0x19*-0x1e+0x1268)*(0x2*0x6d+0x1734+-0x140e)*(-0x355*-0x4+-0x793+0x1*-0x1c1)||_0x28e7d5+_0x3f13b6>(0x12df*0x1+0xe5*-0x28+-0x1*-0x10fd)*(0x1e*-0x6d+0x16e*0x9+0x3e8)*(-0x2441+-0xbc7+0x3408))throw new Error(_0x25964b(0xe3));await assertHistoryCommitReachable(_0x1610bf,_0x48bc80,_0x28eed7);const _0xf0e630=safeGitWorkspacePath(_0x32e248),_0x33f574=_0x48bc80+':'+_0xf0e630,_0x5d0fbd=await runGit(_0x1610bf,[_0x25964b(0x195),'-s',_0x33f574]),_0x214407=Number(_0x5d0fbd[_0x25964b(0x1a7)][_0x25964b(0x1b5)]());if(!Number[_0x25964b(0xf4)](_0x214407)||_0x214407<-0xd*0x5b+-0xd31+0x98*0x1e||_0x28e7d5>_0x214407)throw new Error(_0x25964b(0xe3));if(_0x28e7d5===_0x214407)return{'path':_0xf0e630,'size':_0x214407,'offset':_0x28e7d5,'contentBase64':'','nextOffset':null};const _0x2070e8=await runGitAllowFailure(_0x1610bf,[_0x25964b(0x195),_0x25964b(0xe7),_0x33f574],_0x28e7d5+_0x3f13b6);if(_0x2070e8[_0x25964b(0x122)]!==0x21da+-0x13*-0xdd+-0x19f*0x1f)throw new GitCommandError(_0x2070e8[_0x25964b(0x122)],_0x2070e8[_0x25964b(0x13c)]);const _0x255f80=_0x2070e8[_0x25964b(0x182)][_0x25964b(0x130)](_0x28e7d5,Math[_0x25964b(0x118)](_0x214407,_0x28e7d5+_0x3f13b6)),_0xf36f3d=_0x28e7d5+_0x255f80[_0x25964b(0x197)];return{'path':_0xf0e630,'size':_0x214407,'offset':_0x28e7d5,'contentBase64':_0x255f80[_0x25964b(0xd1)](_0x25964b(0x1d7)),'nextOffset':_0xf36f3d<_0x214407?_0xf36f3d:null};}export async function readCurrentChanges(_0x451903){const _0xb191e1=_0x28a6c6;return(await readCurrentChangesSummary(_0x451903))[_0xb191e1(0xe9)];}function _0x1cca(_0x46792f,_0x56ddd0){_0x46792f=_0x46792f-(0x233+-0x1547+0x8*0x27b);const _0x42bc20=_0x27de();let _0x2fd464=_0x42bc20[_0x46792f];if(_0x1cca['zYktmo']===undefined){var _0x293eb9=function(_0x255c3d){const _0x31038a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2db605='',_0x3713ba='';for(let _0x283800=0x1c2a+0x2e*-0x7a+-0x63e,_0x1d871e,_0x44f363,_0x3ce28a=0x1546+0x158e+-0x2ad4;_0x44f363=_0x255c3d['charAt'](_0x3ce28a++);~_0x44f363&&(_0x1d871e=_0x283800%(-0x4a4+0x1*0x117a+-0xcd2)?_0x1d871e*(-0xcdc+0x1781+-0xa65)+_0x44f363:_0x44f363,_0x283800++%(0x23c2+-0x1*-0x10cf+0x348d*-0x1))?_0x2db605+=String['fromCharCode'](0x2*-0xbb9+-0xe71*0x2+-0x11*-0x323&_0x1d871e>>(-(-0x198b+0x1235+-0x1*-0x758)*_0x283800&-0x21ba+0xd*-0x1d7+0x13*0x309)):0x1*-0x7c9+-0x767*-0x1+0x62*0x1){_0x44f363=_0x31038a['indexOf'](_0x44f363);}for(let _0x87e0cc=-0x1*-0x260+0x1*-0x184f+0x15ef,_0x5daf51=_0x2db605['length'];_0x87e0cc<_0x5daf51;_0x87e0cc++){_0x3713ba+='%'+('00'+_0x2db605['charCodeAt'](_0x87e0cc)['toString'](-0x2675+0x6cf*-0x1+-0xc*-0x3c7))['slice'](-(0x6f3*0x1+0x129d+-0x198e*0x1));}return decodeURIComponent(_0x3713ba);};_0x1cca['UEctOb']=_0x293eb9,_0x1cca['pdFkGP']={},_0x1cca['zYktmo']=!![];}const _0x1503e4=_0x42bc20[-0x349*-0x3+-0xace+-0xf3*-0x1];_0x1cca['nAMHRQ']!==_0x1503e4&&(_0x1cca['pdFkGP']={},_0x1cca['nAMHRQ']=_0x1503e4);const _0x4c3855=_0x1cca['pdFkGP'][_0x46792f];return _0x4c3855===undefined?(_0x2fd464=_0x1cca['UEctOb'](_0x2fd464),_0x1cca['pdFkGP'][_0x46792f]=_0x2fd464):_0x2fd464=_0x4c3855,_0x2fd464;}export async function readCurrentChangeDiff(_0x160b17,_0x485789){const _0x41b6a1=_0x28a6c6,_0x4fc81f=safeGitWorkspacePath(_0x485789);await assertCurrentChangePathAccessible(_0x160b17,_0x4fc81f);const _0x438c8d=await readCurrentChangeGitDiff(_0x160b17,_0x4fc81f),_0x1127fc=await readWorkingTreeText(_0x160b17,_0x4fc81f),_0x5eee04=_0x438c8d[_0x41b6a1(0x182)][_0x41b6a1(0x14a)](-0x1e80+-0x169*0xd+-0x1cf*-0x1b)||_0x438c8d[_0x41b6a1(0x1a7)][_0x41b6a1(0x14a)](_0x41b6a1(0x1a6))||_0x1127fc?.[_0x41b6a1(0x19c)]===!![];if(_0x5eee04)return{'binary':!![],'summary':_0x41b6a1(0x14e)+createHash(_0x41b6a1(0x138))[_0x41b6a1(0x1cb)](_0x438c8d[_0x41b6a1(0x182)])[_0x41b6a1(0x19d)](_0x41b6a1(0x18b))+_0x41b6a1(0x188)+_0x438c8d[_0x41b6a1(0x182)][_0x41b6a1(0x197)],'truncated':_0x438c8d[_0x41b6a1(0x104)]||_0x1127fc?.[_0x41b6a1(0x104)]===!![]};return{'binary':![],'text':_0x438c8d[_0x41b6a1(0x1a7)],'truncated':_0x438c8d[_0x41b6a1(0x104)]||_0x1127fc?.[_0x41b6a1(0x104)]===!![],'afterText':_0x1127fc?.[_0x41b6a1(0x1a7)]??'',..._0x1127fc===undefined?{}:{'afterTruncated':_0x1127fc[_0x41b6a1(0x104)]}};}async function readCurrentChangeGitDiff(_0x59abb7,_0x23afab){const _0x3b940d=_0x28a6c6,_0x216e0e=await runGit(_0x59abb7,[_0x3b940d(0x124),_0x3b940d(0x1a2),_0x3b940d(0x14c),'-z','--',_0x3b940d(0x156)+_0x23afab]);if(_0x216e0e[_0x3b940d(0x1a7)][_0x3b940d(0x132)]('\x00')[_0x3b940d(0x14a)](_0x23afab)){const _0x11e3cc=await runGitAllowFailure(_0x59abb7,[_0x3b940d(0x199),_0x3b940d(0xf0),_0x3b940d(0x120),_0x3b940d(0x176),'--',_0x3b940d(0x136),_0x23afab]);if(_0x11e3cc[_0x3b940d(0x122)]!==0x994+-0x95*-0x8+-0xe3c&&_0x11e3cc[_0x3b940d(0x122)]!==-0x1*-0xef6+0x1d9f+-0x2c94)throw new GitCommandError(_0x11e3cc[_0x3b940d(0x122)],_0x11e3cc[_0x3b940d(0x13c)]);return _0x11e3cc;}return runGit(_0x59abb7,[_0x3b940d(0x199),_0x3b940d(0x120),_0x3b940d(0x176),_0x3b940d(0x173),'--',_0x3b940d(0x156)+_0x23afab]);}export async function isWorkspaceChangeVisible(_0x5418cb,_0x1ab002){const _0x4b6c01=_0x28a6c6;try{return await assertCurrentChangePathAccessible(_0x5418cb,safeGitWorkspacePath(_0x1ab002)),!![];}catch(_0x4ffac8){if(_0x4ffac8 instanceof Error&&(_0x4ffac8[_0x4b6c01(0x153)]===_0x4b6c01(0xfa)||_0x4ffac8[_0x4b6c01(0x153)]===_0x4b6c01(0x10c)||_0x4ffac8[_0x4b6c01(0x153)]===_0x4b6c01(0xf2)))return![];throw _0x4ffac8;}}async function assertCurrentChangePathAccessible(_0x442c81,_0x5ef99c){const _0x302f4f=_0x28a6c6,_0x2b9c5c=await realpath(_0x442c81),_0x505fb8=resolve(_0x2b9c5c,_0x5ef99c),_0xf1fee1=await lstat(_0x505fb8)[_0x302f4f(0x18a)](_0x553409=>{const _0x59fe89=_0x302f4f;if(_0x553409[_0x59fe89(0x122)]===_0x59fe89(0x19f))return undefined;throw _0x553409;});if(_0xf1fee1===undefined)return;await resolveWorkspaceEntry(_0x2b9c5c,_0x5ef99c,![]);}async function readWorkingTreeText(_0x41c3c9,_0x183a44){const _0x5412d7=_0x28a6c6,_0x591197=await realpath(_0x41c3c9);let _0x559317;try{_0x559317=await resolveWorkspaceEntry(_0x591197,_0x183a44,![]);}catch(_0x5cb0e8){if(_0x5cb0e8 instanceof Error&&_0x5cb0e8[_0x5412d7(0x153)]===_0x5412d7(0x10c))return undefined;throw _0x5cb0e8;}const _0xe86cc4=await lstat(_0x559317);if(!_0xe86cc4[_0x5412d7(0xdb)]())return undefined;const _0x9a6907=await readFile(_0x559317);return diffTextFromBuffer(_0x9a6907,_0x9a6907[_0x5412d7(0x197)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x4fbb7e,_0x508e12){const _0x6d2f1b=_0x28a6c6;if(_0x4fbb7e[_0x6d2f1b(0x14a)](0xc88+-0x486+-0x1*0x802)||!isValidUtf8(_0x4fbb7e))return{'binary':!![],'truncated':_0x508e12};let _0x5d8378=Math[_0x6d2f1b(0x118)](_0x4fbb7e[_0x6d2f1b(0x197)],GIT_OUTPUT_LIMIT);while(_0x5d8378>-0x109*0xe+-0xe60+-0x1*-0x1cde&&_0x5d8378<_0x4fbb7e[_0x6d2f1b(0x197)]&&isUtf8ContinuationByte(_0x4fbb7e[_0x5d8378]))_0x5d8378-=0xbad+-0x24a9+0x1*0x18fd;return{'binary':![],'text':_0x4fbb7e[_0x6d2f1b(0x130)](-0x2*0x1337+0x18f9+0x35*0x41,_0x5d8378)[_0x6d2f1b(0xd1)](_0x6d2f1b(0x1bf)),'truncated':_0x508e12};}export async function restoreCurrentChange(_0x3ec004,_0x27dbb9,_0x8b7d15){const _0x2e0462=_0x28a6c6,_0x553732=safeGitWorkspacePath(_0x27dbb9),_0x356450=_0x2e0462(0x156)+_0x553732;if(_0x8b7d15===_0x2e0462(0x1c8)){const _0x2e9fa6=await runGit(_0x3ec004,[_0x2e0462(0x114),_0x2e0462(0x1d4),'-z',_0x2e0462(0x184),'--',_0x356450]);if(!_0x2e9fa6[_0x2e0462(0x1a7)][_0x2e0462(0x132)]('\x00')[_0x2e0462(0x14b)](_0x2a7353=>_0x2a7353[_0x2e0462(0xf8)](_0x2e0462(0x165))&&_0x2a7353[_0x2e0462(0x1cc)](0x1*-0x1c8f+-0x16d9+0x1*0x336b)===_0x553732))throw new Error(_0x2e0462(0x1bc));const _0x1f7aa3=await realpath(_0x3ec004),_0x31acc4=resolve(_0x1f7aa3,_0x553732),_0x5dc229=await lstat(_0x31acc4);if(!_0x5dc229[_0x2e0462(0xdb)]()||_0x5dc229[_0x2e0462(0x152)]())throw new Error(_0x2e0462(0x1bc));await unlink(_0x31acc4);return;}if(_0x8b7d15===_0x2e0462(0xd9)){await runGit(_0x3ec004,[_0x2e0462(0xce),_0x2e0462(0x159),'--',_0x356450]);return;}await runGit(_0x3ec004,[_0x2e0462(0xce),_0x2e0462(0x168),_0x2e0462(0x1c4),_0x2e0462(0x159),'--',_0x356450]);}function safeGitWorkspacePath(_0x585b88){const _0x5a5842=_0x28a6c6;if(_0x585b88[_0x5a5842(0x197)]===0x2185+-0x83*-0x45+0x371*-0x14||_0x585b88[_0x5a5842(0x14a)]('\x00')||_0x585b88[_0x5a5842(0xf8)]('/')||_0x585b88[_0x5a5842(0xf8)]('\x5c'))throw new Error(_0x5a5842(0xfa));const _0x3a0ea5=_0x585b88[_0x5a5842(0xfb)]('\x5c','/');if(_0x3a0ea5[_0x5a5842(0x132)]('/')[_0x5a5842(0x14b)](_0x4b28a4=>_0x4b28a4===''||_0x4b28a4==='..'||_0x4b28a4===_0x5a5842(0x135)))throw new Error(_0x5a5842(0xfa));return _0x3a0ea5;}function gitChange(_0x18af5f){const _0x4d1fbd=_0x28a6c6;if(_0x18af5f==='A')return _0x4d1fbd(0x19b);if(_0x18af5f==='D')return _0x4d1fbd(0x1b0);if(_0x18af5f==='R')return _0x4d1fbd(0xd0);if(_0x18af5f==='C')return _0x4d1fbd(0x11c);if(_0x18af5f==='T')return _0x4d1fbd(0xf7);return _0x4d1fbd(0x1c3);}export class GitCommandError extends Error{[_0x28a6c6(0x122)];[_0x28a6c6(0x13c)];constructor(_0x14c3aa,_0x431db8){const _0x81fe66=_0x28a6c6;super(_0x81fe66(0x1a1)),this[_0x81fe66(0x122)]=_0x14c3aa,this[_0x81fe66(0x13c)]=_0x431db8;}}async function runGit(_0x313784,_0x57885f){const _0x3de9cd=_0x28a6c6,_0x4d1ae5=await runGitAllowFailure(_0x313784,_0x57885f);if(_0x4d1ae5[_0x3de9cd(0x122)]!==0x43*-0x73+-0xcef+0x2b08)throw new GitCommandError(_0x4d1ae5[_0x3de9cd(0x122)],_0x4d1ae5[_0x3de9cd(0x13c)]);return _0x4d1ae5;}async function runGitAllowFailure(_0x237787,_0x362508,_0x45d6af=GIT_OUTPUT_LIMIT){return new Promise((_0x583a93,_0x5bbf57)=>{const _0x23b739=_0x1cca,_0x29705b=spawn(_0x23b739(0x1ba),[..._0x362508],{'cwd':_0x237787,'shell':![],'windowsHide':!![],'stdio':[_0x23b739(0x1a3),_0x23b739(0x15f),_0x23b739(0x15f)]}),_0x4918c1=[],_0x19c1f0=[];let _0x1c9ab4=0x4*-0xe8+0x9d*0x15+0x941*-0x1,_0x369efc=![];const _0x18559a=setTimeout(()=>_0x29705b[_0x23b739(0xf6)](_0x23b739(0x1aa)),GIT_TIMEOUT_MS);_0x29705b[_0x23b739(0x131)]['on'](_0x23b739(0x1c6),_0x5c99f5=>{const _0x240c4f=_0x23b739,_0xca488f=Math[_0x240c4f(0xff)](0x1c93+-0x1702+0x5*-0x11d,_0x45d6af-_0x1c9ab4);if(_0xca488f>-0x2f*0x79+-0x1*-0x25ab+0x7ba*-0x2){const _0x4b1f23=_0x5c99f5[_0x240c4f(0x130)](0x1*0x1e61+-0x1df7*-0x1+-0x4*0xf16,_0xca488f);_0x4918c1[_0x240c4f(0x127)](_0x4b1f23),_0x1c9ab4+=_0x4b1f23[_0x240c4f(0x197)];}_0x369efc||=_0x5c99f5[_0x240c4f(0x197)]>_0xca488f;}),_0x29705b[_0x23b739(0x13c)]['on'](_0x23b739(0x1c6),_0x5a4af5=>_0x19c1f0[_0x23b739(0x127)](_0x5a4af5[_0x23b739(0x130)](0x15f0+0x2450+-0x2*0x1d20,0x1da+-0x1489+-0xd*-0x2ab))),_0x29705b[_0x23b739(0xef)](_0x23b739(0x157),_0x1c2d33=>{clearTimeout(_0x18559a),_0x5bbf57(_0x1c2d33);}),_0x29705b[_0x23b739(0xef)](_0x23b739(0x1bd),_0x896854=>{const _0xa6ce6b=_0x23b739;clearTimeout(_0x18559a);const _0x34551f=Buffer[_0xa6ce6b(0xec)](_0x4918c1);_0x583a93({'code':_0x896854??0x2422+0x44+-0x4d*0x79,'output':_0x34551f,'text':_0x34551f[_0xa6ce6b(0xd1)](_0xa6ce6b(0x1bf)),'stderr':Buffer[_0xa6ce6b(0xec)](_0x19c1f0)[_0xa6ce6b(0xd1)](_0xa6ce6b(0x1bf)),'truncated':_0x369efc});});});}function isGitUnavailable(_0x57c722){const _0x48152b=_0x28a6c6;return _0x57c722 instanceof Error&&_0x48152b(0x122)in _0x57c722&&_0x57c722[_0x48152b(0x122)]===_0x48152b(0x19f);}function summarizeText(_0x3edcaa){const _0x4932f8=_0x28a6c6;return JSON[_0x4932f8(0x109)]({'sha256':createHash(_0x4932f8(0x138))[_0x4932f8(0x1cb)](_0x3edcaa)[_0x4932f8(0x19d)](_0x4932f8(0x18b)),'bytes':Buffer[_0x4932f8(0x121)](_0x3edcaa)});}
2
+ function _0xc207(_0x545965,_0x329d15){_0x545965=_0x545965-(-0xd2d+-0xcc8+0x1b10);const _0x3d4f34=_0xe7db();let _0x3d8d0d=_0x3d4f34[_0x545965];if(_0xc207['WoGBXx']===undefined){var _0xdde61a=function(_0x507266){const _0x226e3b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4912a8='',_0x5d8792='';for(let _0x15846a=0x1*0x1abd+0x48b*-0x5+-0xa*0x67,_0x5b912f,_0x4e07da,_0x5787a7=0x1*-0x487+0x228f+0x2*-0xf04;_0x4e07da=_0x507266['charAt'](_0x5787a7++);~_0x4e07da&&(_0x5b912f=_0x15846a%(-0x254f+0x14c4+0x108f)?_0x5b912f*(-0x2*-0x1e2+0x35*-0xa6+-0x2ce*-0xb)+_0x4e07da:_0x4e07da,_0x15846a++%(-0x24c4+0x15*-0x17e+0x220f*0x2))?_0x4912a8+=String['fromCharCode'](0x1*0x268f+-0x16*-0x8b+-0x3182&_0x5b912f>>(-(-0xa39*-0x3+0x1*0x2218+-0x40c1)*_0x15846a&0x26d*-0xd+0x1dda*0x1+0x1b5)):-0x2162+-0x17*0x5d+0x29bd*0x1){_0x4e07da=_0x226e3b['indexOf'](_0x4e07da);}for(let _0x1396c2=0x871+0x9e9*0x2+0x1c43*-0x1,_0x385cef=_0x4912a8['length'];_0x1396c2<_0x385cef;_0x1396c2++){_0x5d8792+='%'+('00'+_0x4912a8['charCodeAt'](_0x1396c2)['toString'](-0x1*0x17cf+-0x7*-0x341+0x118))['slice'](-(-0x4*0x2e0+0x3*0x33f+0x1c5));}return decodeURIComponent(_0x5d8792);};_0xc207['fiJxcF']=_0xdde61a,_0xc207['xqXkVT']={},_0xc207['WoGBXx']=!![];}const _0x261bed=_0x3d4f34[-0x2181+-0x10*-0x143+0xd51];_0xc207['ktTwgM']!==_0x261bed&&(_0xc207['xqXkVT']={},_0xc207['ktTwgM']=_0x261bed);const _0x16e96b=_0xc207['xqXkVT'][_0x545965];return _0x16e96b===undefined?(_0x3d8d0d=_0xc207['fiJxcF'](_0x3d8d0d),_0xc207['xqXkVT'][_0x545965]=_0x3d8d0d):_0x3d8d0d=_0x16e96b,_0x3d8d0d;}const _0x1a5b06=_0xc207;(function(_0x967d62,_0x493465){const _0x9ae782=_0xc207,_0x32080a=_0x967d62();while(!![]){try{const _0x34f5b0=-parseInt(_0x9ae782(0x22e))/(0xb74*-0x1+0x72*-0x42+0x1*0x28d9)*(parseInt(_0x9ae782(0x1de))/(0x21d5+-0x2397*0x1+0x1c4))+parseInt(_0x9ae782(0x143))/(-0x17af+0x1202+-0x5b*-0x10)+parseInt(_0x9ae782(0x1d9))/(-0x1*-0x153f+-0x1948+-0x1*-0x40d)*(parseInt(_0x9ae782(0x125))/(0xba9+-0x8eb+-0x11*0x29))+parseInt(_0x9ae782(0x218))/(0x16dc+0x1*0xc1a+-0x22f0)*(-parseInt(_0x9ae782(0x1b1))/(-0x137b*0x2+0x366*0x5+-0x3*-0x755))+parseInt(_0x9ae782(0x1fb))/(-0x1*-0xf2e+-0x1535+0x60f)+-parseInt(_0x9ae782(0x14b))/(0xd5e*0x1+0xb*-0x30+-0xb45)*(parseInt(_0x9ae782(0x20d))/(0x5b1+-0x1*0x1a5+-0x3*0x156))+parseInt(_0x9ae782(0x1cc))/(0x1*0x16bd+0x67f+-0x35*0x8d)*(parseInt(_0x9ae782(0x133))/(-0x1*0x120d+0x1630+-0x417));if(_0x34f5b0===_0x493465)break;else _0x32080a['push'](_0x32080a['shift']());}catch(_0x1a05c4){_0x32080a['push'](_0x32080a['shift']());}}}(_0xe7db,-0x79350+-0x1*-0x58d6+0x39a7*0x32));import{createHash,randomUUID}from'node:crypto';import{watch}from'node:fs';import{lstat,mkdir,opendir,open,readdir,readFile,realpath,rename,rm,stat,unlink,writeFile}from'node:fs/promises';import{homedir,platform as _0x4dde61}from'node:os';import{dirname,isAbsolute,posix,relative,resolve,sep,win32}from'node:path';import{spawn}from'node:child_process';import{minimatch}from'minimatch';const GIT_TIMEOUT_MS=0x1411+0x1438+0xa1*-0x21,GIT_OUTPUT_LIMIT=(0x6*0xd2+-0x2ec+0x0)*(-0x20df+-0x1577*0x1+-0x3*-0x1372),FILE_READ_LIMIT=(-0x493*-0x7+0xa89+-0x288e)*(0x4*-0x617+0x46d*0x1+0x17ef*0x1),DIRECTORY_PAGE_LIMIT=0x12c9+0xaa4+0x1ca5*-0x1,DIRECTORY_PICKER_LIMIT=0x1*0x260f+-0x1cd4+-0x873,SEARCH_RESULT_LIMIT=0x1*0x1dda+-0x2c*-0xa3+-0x3916,FILE_INDEX_IDLE_TTL_MS=(-0x17*0x5d+0x2377*-0x1+0x1607*0x2)*(0x1*-0x1964+-0xd5*-0xf+0xd25*0x1)*(-0x38b+0xda1+-0x62e),FILE_INDEX_ENTRY_LIMIT=0xc2c9+0xc*0x35d6+-0x1c231,FILE_INDEX_FALLBACK_POLL_MS=-0xc906+-0x4*-0x1e47+0xc51a,FILE_INDEX_METADATA_CONCURRENCY=0xb*0x2bb+0x266+-0x204f,DEFAULT_QUICK_OPEN_EXCLUDES=[_0x1a5b06(0x198),_0x1a5b06(0x201),_0x1a5b06(0x184),_0x1a5b06(0x204),_0x1a5b06(0x171),_0x1a5b06(0x1d7),_0x1a5b06(0x1c2),_0x1a5b06(0x1da),_0x1a5b06(0x1f0),_0x1a5b06(0x1ed),_0x1a5b06(0x13a),_0x1a5b06(0x1c0),_0x1a5b06(0x18a),_0x1a5b06(0x16e),_0x1a5b06(0x127),_0x1a5b06(0x20f),_0x1a5b06(0x1fd),_0x1a5b06(0x1fc),_0x1a5b06(0x1b2),_0x1a5b06(0x189),_0x1a5b06(0x20e),_0x1a5b06(0x1d0),_0x1a5b06(0x14c),_0x1a5b06(0x225),_0x1a5b06(0x1a6)],REF_PATTERN=/^(?!-)(?!.*\.\.)(?!.*@\{)[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/;export async function createWorkspaceDirectory(_0x156aa3,_0xdb8481,_0x2fbd55){const _0x3c39b3=_0x1a5b06,_0x2dc89e=_0xdb8481[_0x3c39b3(0x199)]();if(_0x2dc89e[_0x3c39b3(0x156)]===-0x144d+0x1ad7*0x1+-0x68a||_0x2dc89e[_0x3c39b3(0x156)]>-0x23f3*-0x1+0x4a*0x56+-0x3bd0||_0x2dc89e==='.'||_0x2dc89e==='..'||_0x2dc89e[_0x3c39b3(0x20c)]('/')||_0x2dc89e[_0x3c39b3(0x20c)]('\x5c')||_0x2dc89e[_0x3c39b3(0x20c)]('\x00'))throw new Error(_0x3c39b3(0x1a2));const _0x2951ac=await Promise[_0x3c39b3(0x12c)](_0x2fbd55[_0x3c39b3(0x231)](_0x68ea52=>realpath(_0x68ea52))),_0x155c6b=await realpath(_0x156aa3)[_0x3c39b3(0x1b3)](()=>{const _0xc41273=_0x3c39b3;throw new Error(_0xc41273(0x165));}),_0x4d815d=await stat(_0x155c6b)[_0x3c39b3(0x1b3)](()=>undefined);if(_0x4d815d?.[_0x3c39b3(0x1e4)]()!==!![]||!isWithinAllowedRoot(_0x155c6b,_0x2951ac))throw new Error(_0x3c39b3(0x165));const _0x2e6fc8=resolve(_0x155c6b,_0x2dc89e);if(dirname(_0x2e6fc8)!==_0x155c6b||!isWithinAllowedRoot(_0x2e6fc8,_0x2951ac))throw new Error(_0x3c39b3(0x1a2));try{await mkdir(_0x2e6fc8);}catch(_0x2540c6){if(_0x2540c6[_0x3c39b3(0x1e8)]===_0x3c39b3(0x1a3))throw new Error(_0x3c39b3(0x21b));throw _0x2540c6;}return _0x2e6fc8;}export class WorkspaceFileIndex{[_0x1a5b06(0x124)];[_0x1a5b06(0x182)];[_0x1a5b06(0x136)]=[];[_0x1a5b06(0x208)]=![];[_0x1a5b06(0x1a5)];[_0x1a5b06(0x1dd)];[_0x1a5b06(0x11c)]=!![];[_0x1a5b06(0x1fe)];[_0x1a5b06(0x1ac)];[_0x1a5b06(0x17f)];[_0x1a5b06(0x20a)]='';constructor(_0x5a9b41,_0x309941={}){const _0x47844e=_0x1a5b06;this[_0x47844e(0x124)]=_0x5a9b41,this[_0x47844e(0x182)]=_0x309941;}async[_0x1a5b06(0x19f)](){const _0x11dcfd=_0x1a5b06;await this[_0x11dcfd(0x19b)](),this[_0x11dcfd(0x1dc)]();}async[_0x1a5b06(0x1c4)](){const _0x328f92=_0x1a5b06;return await this[_0x328f92(0x19b)](),this[_0x328f92(0x1dc)](),{'entries':this[_0x328f92(0x136)][_0x328f92(0x1e9)](_0x28362d=>_0x28362d[_0x328f92(0x200)]===_0x328f92(0x17b)),'truncated':this[_0x328f92(0x208)]};}[_0x1a5b06(0x1e3)](){const _0x5ee903=_0x1a5b06;if(this[_0x5ee903(0x1ac)]!==undefined)clearTimeout(this[_0x5ee903(0x1ac)]);this[_0x5ee903(0x1ac)]=undefined,this[_0x5ee903(0x1fe)]?.[_0x5ee903(0x13d)](),this[_0x5ee903(0x1fe)]=undefined;if(this[_0x5ee903(0x17f)]!==undefined)clearInterval(this[_0x5ee903(0x17f)]);this[_0x5ee903(0x17f)]=undefined,this[_0x5ee903(0x136)]=[],this[_0x5ee903(0x208)]=![],this[_0x5ee903(0x11c)]=!![],this[_0x5ee903(0x20a)]='';}async[_0x1a5b06(0x1e7)](_0x13980c,_0x502703,_0xba5c0=SEARCH_RESULT_LIMIT,_0x4b9158=![]){const _0x18bdb9=_0x1a5b06;if(_0x13980c[_0x18bdb9(0x199)]()[_0x18bdb9(0x156)]===-0x43*0x53+-0x8c3+0x1e7c||_0x13980c[_0x18bdb9(0x156)]>-0x113f+0x1bd9+-0x99a||!Number[_0x18bdb9(0x16f)](_0xba5c0)||_0xba5c0<-0x1*0xc9d+0xf20+-0x6*0x6b||_0xba5c0>SEARCH_RESULT_LIMIT)throw new Error(_0x18bdb9(0x191));await this[_0x18bdb9(0x19b)](),this[_0x18bdb9(0x1dc)]();const _0x263173=decodeSearchCursor(_0x502703,_0x13980c),_0x272772=_0x263173===undefined?undefined:this[_0x18bdb9(0x136)][_0x18bdb9(0x196)](_0x467dbb=>_0x467dbb[_0x18bdb9(0x1c3)]===_0x263173&&(_0x4b9158||_0x467dbb[_0x18bdb9(0x200)]===_0x18bdb9(0x17b))),_0x29d49f=_0x272772===undefined?-(-0xa6a*0x2+-0x1*-0x1fee+-0xb19):fuzzyPathScore(_0x272772[_0x18bdb9(0x1c3)],_0x13980c),_0x5e8ef2=_0x272772===undefined||_0x29d49f<-0x1c0c+-0x10c5+-0x4d*-0x95?undefined:{'entry':_0x272772,'score':_0x29d49f},_0xd1a969=new RankedCandidateHeap(_0xba5c0+(-0xd01*0x3+0x1a17+0xced));for(const _0x3f16f8 of this[_0x18bdb9(0x136)]){if(!_0x4b9158&&_0x3f16f8[_0x18bdb9(0x200)]!==_0x18bdb9(0x17b))continue;const _0x4d990c=fuzzyPathScore(_0x3f16f8[_0x18bdb9(0x1c3)],_0x13980c);if(_0x4d990c<-0x408+0x2471+-0x2069)continue;const _0x4f7004={'entry':_0x3f16f8,'score':_0x4d990c};if(_0x5e8ef2!==undefined&&compareRankedCandidate(_0x4f7004,_0x5e8ef2)<=-0x2*-0xa99+0xd43+-0x2275*0x1)continue;_0xd1a969[_0x18bdb9(0x1c9)](_0x4f7004);}const _0x14978f=_0xd1a969[_0x18bdb9(0x154)](),_0x1e6a5e=_0x14978f[_0x18bdb9(0x1d2)](0x1a91+0x49f+0x3e6*-0x8,_0xba5c0)[_0x18bdb9(0x231)](_0x300d24=>_0x300d24[_0x18bdb9(0x236)]),_0x310952=_0x14978f[_0xba5c0]?.[_0x18bdb9(0x236)][_0x18bdb9(0x1c3)];return{'entries':_0x1e6a5e,'nextCursor':_0x310952===undefined?null:encodeSearchCursor(_0x13980c,_0x1e6a5e['at'](-(-0x1f84+-0x11f7+0x1*0x317c))?.[_0x18bdb9(0x1c3)]??_0x263173??''),'truncated':_0x310952!==undefined||this[_0x18bdb9(0x208)]};}async[_0x1a5b06(0x19b)](){const _0x529034=_0x1a5b06;if(!this[_0x529034(0x11c)]&&this[_0x529034(0x1a5)]!==undefined)return;this[_0x529034(0x1dd)]===undefined&&(this[_0x529034(0x1dd)]=this[_0x529034(0x1af)]()[_0x529034(0x194)](()=>{const _0x5bcd34=_0x529034;this[_0x5bcd34(0x1dd)]=undefined;})),await this[_0x529034(0x1dd)];}[_0x1a5b06(0x1dc)](){const _0x5e8a6b=_0x1a5b06;if(this[_0x5e8a6b(0x1ac)]!==undefined)clearTimeout(this[_0x5e8a6b(0x1ac)]);this[_0x5e8a6b(0x1ac)]=setTimeout(()=>this[_0x5e8a6b(0x1e3)](),this[_0x5e8a6b(0x182)][_0x5e8a6b(0x138)]??FILE_INDEX_IDLE_TTL_MS),this[_0x5e8a6b(0x1ac)][_0x5e8a6b(0x1f8)]();}async[_0x1a5b06(0x1af)](){const _0x8961c5=_0x1a5b06,_0x49d67e=await resolveRegisteredWorkspaceRoot(this[_0x8961c5(0x124)]),_0x3c0547=[...DEFAULT_QUICK_OPEN_EXCLUDES,...await workspaceExcludePatterns(_0x49d67e)],_0x4cb656=[],_0x553099=this[_0x8961c5(0x182)][_0x8961c5(0x1d6)]??FILE_INDEX_ENTRY_LIMIT;let _0x25e72e=![];const _0x26996c=['.'];let _0x2a1377=-0x1*0x48f+-0xf68+0x13f7;while(_0x2a1377<_0x26996c[_0x8961c5(0x156)]&&!_0x25e72e){const _0x3894c2=_0x26996c[_0x2a1377];_0x2a1377+=0x2*0xd9+0x4a*0x6d+-0x2133;const _0x104657=await resolveWorkspaceEntryFromCanonicalRoot(_0x49d67e,_0x3894c2,!![])[_0x8961c5(0x1b3)](()=>undefined);if(_0x104657===undefined)continue;const _0x285624=await opendir(_0x104657)[_0x8961c5(0x1b3)](()=>undefined);if(_0x285624===undefined)continue;let _0x344f47=[];const _0x19d03a=async()=>{const _0x59bdec=_0x8961c5,_0x2361f3=await Promise[_0x59bdec(0x12c)](_0x344f47);_0x344f47=[];for(const _0x2885c9 of _0x2361f3){if(_0x2885c9===undefined)continue;if(_0x2885c9[_0x59bdec(0x1c3)]===_0x59bdec(0x19e)||_0x2885c9[_0x59bdec(0x1c3)][_0x59bdec(0x220)](_0x59bdec(0x21e))||isExcluded(_0x2885c9[_0x59bdec(0x1c3)],_0x3c0547))continue;if(_0x2885c9[_0x59bdec(0x200)]===_0x59bdec(0x122))_0x26996c[_0x59bdec(0x1c5)](_0x2885c9[_0x59bdec(0x1c3)]);_0x4cb656[_0x59bdec(0x1c5)](_0x2885c9);if(_0x4cb656[_0x59bdec(0x156)]>=_0x553099){_0x25e72e=!![];break;}}};for await(const _0x5de84 of _0x285624){const _0x206229=_0x3894c2==='.'?_0x5de84[_0x8961c5(0x23b)]:posix[_0x8961c5(0x1cd)](_0x3894c2[_0x8961c5(0x141)]('\x5c','/'),_0x5de84[_0x8961c5(0x23b)]);if(_0x206229===_0x8961c5(0x19e)||_0x206229[_0x8961c5(0x220)](_0x8961c5(0x21e))||isExcluded(_0x206229,_0x3c0547))continue;_0x344f47[_0x8961c5(0x1c5)](inspectWorkspaceIndexEntry(_0x49d67e,_0x206229,_0x5de84[_0x8961c5(0x23b)]));if(_0x344f47[_0x8961c5(0x156)]>=FILE_INDEX_METADATA_CONCURRENCY)await _0x19d03a();if(_0x25e72e)break;}if(!_0x25e72e&&_0x344f47[_0x8961c5(0x156)]>-0x2ca+0x680+0xa*-0x5f)await _0x19d03a();}this[_0x8961c5(0x1a5)]=_0x49d67e,this[_0x8961c5(0x136)]=_0x4cb656,this[_0x8961c5(0x208)]=_0x25e72e,this[_0x8961c5(0x20a)]=fileIndexSignature(_0x4cb656,_0x25e72e),this[_0x8961c5(0x11c)]=![],this[_0x8961c5(0x1fe)]?.[_0x8961c5(0x13d)]();try{this[_0x8961c5(0x1fe)]=watch(_0x49d67e,{'persistent':![],'recursive':!![]},(_0x502259,_0xc7ce0e)=>{const _0x44780e=_0x8961c5;if(_0xc7ce0e!==null){const _0x2c0a8f=_0xc7ce0e[_0x44780e(0x1f4)]()[_0x44780e(0x141)]('\x5c','/');if(_0x2c0a8f===_0x44780e(0x19e)||_0x2c0a8f[_0x44780e(0x220)](_0x44780e(0x21e))||isExcluded(_0x2c0a8f,_0x3c0547))return;}this[_0x44780e(0x18d)]();}),this[_0x8961c5(0x1fe)]['on'](_0x8961c5(0x146),()=>{const _0x477ca3=_0x8961c5;this[_0x477ca3(0x18d)](),this[_0x477ca3(0x1fe)]?.[_0x477ca3(0x13d)](),this[_0x477ca3(0x1fe)]=undefined,this[_0x477ca3(0x13f)]();});}catch{this[_0x8961c5(0x1fe)]=undefined,this[_0x8961c5(0x13f)]();}}[_0x1a5b06(0x13f)](){const _0x1f5a41=_0x1a5b06;if(this[_0x1f5a41(0x17f)]!==undefined)return;this[_0x1f5a41(0x17f)]=setInterval(()=>void this[_0x1f5a41(0x1fa)](),FILE_INDEX_FALLBACK_POLL_MS),this[_0x1f5a41(0x17f)][_0x1f5a41(0x1f8)]();}async[_0x1a5b06(0x1fa)](){const _0x2828e0=_0x1a5b06;if(this[_0x2828e0(0x1dd)]!==undefined)return;const _0x183921=this[_0x2828e0(0x20a)];this[_0x2828e0(0x11c)]=!![];try{await this[_0x2828e0(0x19b)]();if(_0x183921!==this[_0x2828e0(0x20a)])this[_0x2828e0(0x182)][_0x2828e0(0x13e)]?.();}catch{this[_0x2828e0(0x11c)]=![];}}[_0x1a5b06(0x18d)](){const _0x11a829=_0x1a5b06;if(this[_0x11a829(0x11c)])return;this[_0x11a829(0x11c)]=!![],this[_0x11a829(0x182)][_0x11a829(0x13e)]?.();}}function fileIndexSignature(_0x1d7c12,_0x5646e9){const _0x96c8c2=_0x1a5b06,_0x51cdeb=createHash(_0x96c8c2(0x177));_0x51cdeb[_0x96c8c2(0x1a7)](_0x5646e9?'1\x00':'0\x00');for(const _0x3d67d2 of _0x1d7c12)_0x51cdeb[_0x96c8c2(0x1a7)](_0x3d67d2[_0x96c8c2(0x1c3)]+'\x00'+String(_0x3d67d2[_0x96c8c2(0x227)])+'\x00'+String(_0x3d67d2[_0x96c8c2(0x137)])+'\x00');return _0x51cdeb[_0x96c8c2(0x16b)](_0x96c8c2(0x175));}async function workspaceExcludePatterns(_0x4e1aed){const _0x197cd2=_0x1a5b06,_0x5bb8ee=resolve(_0x4e1aed,_0x197cd2(0x161)),_0x48d961=await readFile(_0x5bb8ee,_0x197cd2(0x1ea))[_0x197cd2(0x203)](JSON[_0x197cd2(0x147)])[_0x197cd2(0x1b3)](()=>undefined);if(typeof _0x48d961!==_0x197cd2(0x219)||_0x48d961===null)return[];return[_0x197cd2(0x167),_0x197cd2(0x195)][_0x197cd2(0x144)](_0x3ecc25=>{const _0x16df77=_0x197cd2,_0x3ed8e3=_0x48d961[_0x3ecc25];return typeof _0x3ed8e3===_0x16df77(0x219)&&_0x3ed8e3!==null?Object[_0x16df77(0x136)](_0x3ed8e3)[_0x16df77(0x144)](([_0x333c86,_0x247cd0])=>_0x247cd0===!![]?[_0x333c86]:[]):[];});}function isExcluded(_0xa753d4,_0x3975da){const _0x32dd1f=_0x1a5b06;return _0x3975da[_0x32dd1f(0x212)](_0x181e5f=>minimatch(_0xa753d4,_0x181e5f,{'dot':!![],'nocase':_0x4dde61()!==_0x32dd1f(0x14e)})||minimatch(_0xa753d4+'/',_0x181e5f,{'dot':!![],'nocase':_0x4dde61()!==_0x32dd1f(0x14e)}));}function compareRankedCandidate(_0x3adec6,_0x4caf90){const _0x1a8672=_0x1a5b06;return _0x4caf90[_0x1a8672(0x155)]-_0x3adec6[_0x1a8672(0x155)]||_0x3adec6[_0x1a8672(0x236)][_0x1a8672(0x1c3)][_0x1a8672(0x1ae)](_0x4caf90[_0x1a8672(0x236)][_0x1a8672(0x1c3)]);}class RankedCandidateHeap{[_0x1a5b06(0x172)];[_0x1a5b06(0x14f)]=[];constructor(_0x51d70c){const _0x159a57=_0x1a5b06;this[_0x159a57(0x172)]=_0x51d70c;}[_0x1a5b06(0x1c9)](_0x187362){const _0x4fd326=_0x1a5b06;if(this[_0x4fd326(0x14f)][_0x4fd326(0x156)]<this[_0x4fd326(0x172)]){this[_0x4fd326(0x14f)][_0x4fd326(0x1c5)](_0x187362),this[_0x4fd326(0x14d)](this[_0x4fd326(0x14f)][_0x4fd326(0x156)]-(-0x1559+0x908+0xc52));return;}if(compareRankedCandidate(_0x187362,this[_0x4fd326(0x14f)][0x20b5*0x1+-0x1f4e+-0x167])>=0x1c7a+-0x7c3*0x4+0x292)return;this[_0x4fd326(0x14f)][-0x1017+-0x1*-0xc06+0x411]=_0x187362,this[_0x4fd326(0x140)](-0x1bd3+0x1*0x230c+-0x739);}[_0x1a5b06(0x154)](){const _0x226e38=_0x1a5b06;return[...this[_0x226e38(0x14f)]][_0x226e38(0x1a1)](compareRankedCandidate);}[_0x1a5b06(0x14d)](_0x28de30){const _0xc7c7a=_0x1a5b06;let _0x32e599=_0x28de30;while(_0x32e599>-0x2*0xb61+-0xb27+-0x21e9*-0x1){const _0x435596=Math[_0xc7c7a(0x229)]((_0x32e599-(0x2*0x845+0x15*-0xab+0x141*-0x2))/(0x12a9+0x2*0xc1+-0x1429));if(compareRankedCandidate(this[_0xc7c7a(0x14f)][_0x32e599],this[_0xc7c7a(0x14f)][_0x435596])<=-0x244f+0xf08+0x1547)break;[this[_0xc7c7a(0x14f)][_0x32e599],this[_0xc7c7a(0x14f)][_0x435596]]=[this[_0xc7c7a(0x14f)][_0x435596],this[_0xc7c7a(0x14f)][_0x32e599]],_0x32e599=_0x435596;}}[_0x1a5b06(0x140)](_0x5256e2){const _0x106656=_0x1a5b06;let _0x1f45b9=_0x5256e2;while(!![]){const _0x65417c=_0x1f45b9*(0x1fa9*-0x1+0xc5*0x32+-0x6cf)+(-0x16ff+0x1845+-0x145);if(_0x65417c>=this[_0x106656(0x14f)][_0x106656(0x156)])return;const _0x102d8f=_0x65417c+(-0xb*-0x32+0x18*-0x4e+0x52b),_0x52222a=_0x102d8f<this[_0x106656(0x14f)][_0x106656(0x156)]&&compareRankedCandidate(this[_0x106656(0x14f)][_0x102d8f],this[_0x106656(0x14f)][_0x65417c])>0x119b+-0x3*0x97+-0xfd6?_0x102d8f:_0x65417c;if(compareRankedCandidate(this[_0x106656(0x14f)][_0x52222a],this[_0x106656(0x14f)][_0x1f45b9])<=-0x214c+0x1*0x4d7+0x1c75*0x1)return;[this[_0x106656(0x14f)][_0x1f45b9],this[_0x106656(0x14f)][_0x52222a]]=[this[_0x106656(0x14f)][_0x52222a],this[_0x106656(0x14f)][_0x1f45b9]],_0x1f45b9=_0x52222a;}}}function fuzzyPathScore(_0x4500d6,_0x5cec85){const _0x58e074=_0x1a5b06,_0x26b02d=_0x4500d6[_0x58e074(0x130)](),_0x5dcb06=_0x5cec85[_0x58e074(0x199)]()[_0x58e074(0x130)]();let _0x2b1522=0x145*-0x1+0x1d8b+-0x1c46,_0x3debcf=-0x39c+0xd*-0xa0+0x4*0x2ef,_0xaf82e3=-(0x26*-0xa3+0xf73+0x2eb*0x3);for(const _0x1b84a7 of _0x5dcb06){const _0x2dfc0b=_0x26b02d[_0x58e074(0x158)](_0x1b84a7,_0x2b1522);if(_0x2dfc0b===-(0x3*-0x133+0x8*-0x23b+0x1572))return-(-0xc38*0x3+-0x15f5+0x3a9e);_0x3debcf+=_0x2dfc0b===_0xaf82e3+(0x1a30+0x3e4+-0x1e13)?-0x1330+-0x4f*0x3b+0x9*0x429:0x2*0x1012+0x7c8+-0x1*0x27eb;if(_0x2dfc0b===-0x1769*-0x1+0x1c9a*-0x1+0x531||_0x58e074(0x164)[_0x58e074(0x20c)](_0x26b02d[_0x2dfc0b-(-0x1ebd*0x1+0x633*-0x5+0x5*0xc59)]??''))_0x3debcf+=0x1*-0x1631+-0x2*-0xa+-0x1*-0x1625;_0xaf82e3=_0x2dfc0b,_0x2b1522=_0x2dfc0b+(0x3e*-0x6d+0x2146+-0x6df*0x1);}const _0x1c5605=_0x4500d6[_0x58e074(0x1d2)](_0x4500d6[_0x58e074(0x228)]('/')+(0x60d+-0x1*0xef5+0x8e9))[_0x58e074(0x130)]();if(_0x1c5605[_0x58e074(0x20c)](_0x5dcb06))_0x3debcf+=0xfcc+-0xb*-0xcd+0x239*-0xb;else{if(_0x26b02d[_0x58e074(0x20c)](_0x5dcb06))_0x3debcf+=-0x2362+-0x2539*-0x1+-0x5*0x5b;}return _0x3debcf-_0x4500d6[_0x58e074(0x156)]/(-0x2*0xde6+-0x2*0xf6a+0x3e88);}function _0xe7db(){const _0x26c148=['rKLmrv9ot1rFrK9vtKq','BgLTAxrZ','ywn0Aw9U','kIOVyM93zxjFy29TCg9Uzw50CY8QkG','zxHLyW','uKvnt1rf','C3rYAw5NAwz5','ls1MB3jTyxq9jsHYzwzUyw1LksuWosuOCMvMBMfTztPZAg9YDcKLmdKLkg9IAMvJDg5HBwuPjta5jsHirufeksuWosuOC3LTCMvMkq','kIOVyMLUlYOQ','kIOVDgvZDc9YDw5ZlYOQ','CMvMCY9OzwfKCY8','ls11BNrYywnRzwqTzMLSzxm9ywXS','Aw52ywXPzgf0zq','qureruq','yMLUyxj5','ls1TyxGTy291BNq9','rKLmrv9trufsq0HFteLnsvrFrvHdruveruq','q1jfqvrfx0zjteu','uKvbrfK','zMLUywXSEq','C2vHCMnOlMv4y2X1zgu','zMLUza','zgf0yq','kIOVlMDPDc8QkG','DhjPBq','r0Lux0Hju1rpuLLFq1vsu09sx0LovKfmsuq','zw5ZDxjLtg9HzgvK','ywXSB2nvBNnHzMu','ls1YB290','lMDPDa','B2jZzxj2zq','CMvWBgfJzq','C29YDa','v09ss1nqqunfx0rjuKvdve9swv9oqu1fx0LovKfmsuq','ruvysvnu','yMfZzty0','CM9VDa','kIOVDMvUDI8QkG','DxbKyxrL','ls1ZAg9YDa','rKLmrv9srvzju0LptL9jtLzbteLe','Bwv0ywrHDge','vu5uuKfds0ve','zxHWAxj5vgLTzxi','z2L0','Bg9JywXLq29TCgfYzq','CMvIDwLSza','ls1ZA2LWpq','mJfTz1fpuwS','kIOVlMDYywrSzs8QkG','y2f0y2G','BhmTzMLSzxm','C3rHDhvZ','C3bSAxq','l2rLDI9UDwXS','pZ8G','AxntEw1IB2XPy0XPBMS','ls1ICMfUy2G','ls1LEgnSDwrLlxn0yw5KyxjK','C3rYAw5N','igj5DgvZpq','DxrMltG','sevbrca','kIOVy292zxjHz2uVkIO','u0Lhs0Lmta','kIOVlNbHCMnLBc1JywnOzs8QkG','Cgf0Aa','y29UDgvUDenHBMrPzgf0zxm','ChvZAa','iYmG','CMv2lxbHCNnL','ls1Yzwn1CNnPDMu','ywrK','rKLmrv9ut09Ftefsr0u','lM1HCI11CgXVywqT','mtmYrfPfthfb','AM9PBG','v09ss1nqqunfx0rfvKLdrv9qqvrix1jfsKvdveve','CMvMCY9Yzw1VDgvZ','kIOVDMvUzg9YlYOQ','D2LUmZi','C2XPy2u','ru5pru5u','tu9esuzjruq','yMXVyG','zw50CNLmAw1PDa','kIOVlMnHy2HLlYOQ','C2v0','ner2rNfiBq','kIOVlNr1CMjVlYOQ','zM9YlwvHy2GTCMvM','Dg91y2G','Bg9HzgLUzW','mJb6A3rjvMu','q09qsuve','ls1KyxrLlw9YzgvY','rKLmrv9qqvrix0vtq0fqrq','ls1ZDgfNzwq','zgLZCg9Zzq','AxneAxjLy3rVCNK','BwLU','ls1MB3jTyxq9juGLEdaWjvaLEdaWjwfUjxGWmcvHzsv4mdaLy3qLEdaWjxm','C2vHCMnO','y29Kzq','zMLSDgvY','DxrMoa','zgLMzI10CMvL','vfLqrv9dsefor0ve','kIOVyNvPBgqVkIO','r0Lux0niqu5hrv9srvnut1jfx1voqvzbsuXbqKXf','r0Lux1DpuKTtuefdrq','kIOVzgLZDc8QkG','revmrvrf','B25Jzq','r0Lux1jfrL9jtLzbteLe','Dg9tDhjPBMC','yMLUyxj5igrPzMyGC2HHmJu2pq','v09ss1nqqunfx1bbveHFsu5wquXjra','rKLmrv9ot1rFvevyva','Dw5Yzwy','zgLMzG','Cg9SBezHBgXIywnR','mta1odm4nefWrunUDq','kIOVDgfYz2v0lYOQ','kIOVlMfUz3vSyxiVkIO','D2f0y2HLCG','AxngAwXL','A2LUza','kIOVBM9Kzv9TB2r1BgvZlYOQ','ls1MB3jTyxq9','DgHLBG','kIOVlNbUCg0VkIO','ls10B3bVlw9YzgvY','ls1XDwLLDa','zNjVBq','Dhj1BMnHDgvK','y3vYC29Y','C2LNBMf0DxjL','zgvJB2rL','Aw5JBhvKzxm','mtbvB01pBg0','kIOVB2jQlYOQ','kIOVlNn2zwX0zs1RAxqVkIO','AwDUB3jL','C2HVDW','C29Tzq','AxnjBNrLz2vY','oIHSAxrLCMfSkq','ls1NAxqTy29TBw9UlwrPCG','yNL0zuXLBMD0Aa','Dg9vChbLCKnHC2u','mJe3mZaYv2XnD2Xg','B2jQzwn0','r0Lux0Hju1rpuLLFuKvgx0LovKfmsuq','v09ss1nqqunfx0rjuKvdve9swv9fweLtvfm','ls12zxjPzNK','sevbra','lMDPDc8','C3LTyM9SAwmTCMvM','C3rHCNrZv2L0Aa','lM1HCI1LzgL0lq','q1jfqvrfx0rjuKvdve9swq','C2HPzNq','ls1UBY1JB21TAxqTAwq','kIOVlNzLBNyVkIO','ls1Uyw1Llxn0yxr1CW','C2L6zq','BgfZDeLUzgv4t2y','zMXVB3i','CMvMCY9Yzw1VDgvZlW','ls1UBY10zxH0y29UDG','B3v0Chv0','Bg9N','nde1otf0EMjeqMW','CxvLCNK','qMLUyxj5igzPBgvZia','BwfW','ls1UBY1LEhqTzgLMzG','y2f0lwzPBgu','y29Uy2f0','ls1WB3jJzwXHAw49DJe','zw50CNK','yMfZzty0DxjS','ls13B3jRDhjLzq','Bwf4','ls1ZB3vYy2u9sevbra','BMfTzq','C3vIyxjYyxK','C3rHBgu','ls1MAxjZDc1WyxjLBNq','C3rKB3v0','lI4U','r0Lux0nptu1btKrFrKfjteve','r0Lux0Hju1rpuLLFq09ntuLux0LovKfmsuq','reLsrunut1jz','CMvSyxrPDMu','D29YA3nWywnLuM9VDa','mtm2mJe0nxDLv1nzyW','u1rbr0ve','kIOVlM51EhqVkIO','BwvZC2fNzq','BwvYz2uTyMfZzq','zgLZCgXHEu5HBwu','rvHju1rtx0zjteu','ywXS','BgLTAxq','rvHju1rtx0rjuKvdve9swq','ls1VDgHLCNm','Dg9mB2nHBgvmB3DLCKnHC2u','r0Lux1jfue9tsvrpuLLFsu5wquXjra','Aw52ywXPza','nZu0mZjeuhnKENO','CgLWzq','CMvMCW','zw50CMLLCW','Bw9KAwzPzwrbDa','AwrSzvr0Be1Z','BxrPBwvnCW','kIOVB3v0lYOQ','A2LSBa','AxnbyNnVBhv0zq','y2XVC2u','B25jBNzHBgLKyxrLza','C3rHCNrgywXSyMfJA1bVBgXPBMC','C2LUA0rVD24','CMvWBgfJzufSBa','su5wquXjrf9oqu1f','mteWmJy1m3HJqNbJDa','zMXHDe1HCa','uKvoqu1fra','zxjYB3i','CgfYC2u','v09ss1nqqunfx1bmqvrgt1jnx1vou1vque9sveve','te9dquW','CMvHza','ntmWmJG5y2Dgsfr0','kIOVx19WEwnHy2HLx18VkIO','yNvIyMXLvxa','BgLUDxG','DMfSDwvZ','BM9YBwfSAxPL','Bw9Kzq','ls1UBY1PBMrLEa','Dgv4Da','C29YDgvK','C2nVCMu','BgvUz3rO','rKLmrv9st09ux01vvefusu9ox0LovKfmsuq','Aw5KzxHpzG','Dg9mB3DLCKnHC2u','B2zMC2v0','v09ss1nqqunfx05pvf9bteXpv0ve','CMvZDg9Yzq','AgfZAa','ls1PCY1HBMnLC3rVCG','rKLmrv9xuKLurv9dt05gteLdva','rKLmrv9squ5hrv9jtLzbteLe','lNzZy29Kzs9Zzxr0Aw5NCY5QC29U','rKLmrv9ot1rFuKvhvuXbuG','zMLUz2vYChjPBNq','lY5Flq','v09ss1nqqunfx0rjuKvdve9swv9ot1rFquXmt1Dfra','v09ss1nqqunfx1bbveHFtK9ux0fcu09mvvrf','zMLSzxmUzxHJBhvKzq','rKLmrv9btfjfqurzx0vysvnuuW','C3rKzxjY','DgvZDa','zgLNzxn0','zMLUzeLUzgv4','lNbHCNq','kIOVlM5LEhqVkIO','AxntywzLsw50zwDLCG','CMvMCY9OzwfKCW','kIOVlNLHCM4VkIO','y2fWywnPDhK','vu5tvefhruq','revmrvrfra','Agv4','C3vIBw9KDwXL','C2HHmJu2','rKLmrv9ot1rFreLsrunut1jz','z2v0','zgvZDgLUyxrPB24','rKLmrq','y2HHBMDLCW','r0Lux0Hju1rpuLLFteLnsvrFsu5wquXjra','reLsrunut1jzx0nvuLnpuL9jtLzbteLe','zMfSBgjHy2TuAw1LCG','rKLmrv9nt1zfx0rfu0nftKrbtLrFsu5wquXjra'];_0xe7db=function(){return _0x26c148;};return _0xe7db();}export async function listWorkspaceDirectories(_0x1ff005,_0x24341f,_0x227102=homedir()){const _0x3b51e8=_0x1a5b06,_0x54fcb8=await realpath(_0x227102),_0x34ae2e=await Promise[_0x3b51e8(0x12c)](_0x24341f[_0x3b51e8(0x231)](_0x8c6ffb=>realpath(_0x8c6ffb))),_0x90c27e=[...new Set([_0x54fcb8,..._0x34ae2e])],_0x3960c2=_0x1ff005===undefined?_0x34ae2e[0x2da+-0x19e1+-0xf*-0x189]??_0x54fcb8:await realpath(_0x1ff005),_0x260461=await stat(_0x3960c2);if(!_0x260461[_0x3b51e8(0x1e4)]()||!isWithinAllowedRoot(_0x3960c2,_0x90c27e))throw new Error(_0x3b51e8(0x165));const _0x2dbaac=await readdir(_0x3960c2,{'withFileTypes':!![]}),_0x1ec569=[];for(const _0x48c4df of _0x2dbaac[_0x3b51e8(0x1a1)]((_0x4b48e4,_0x570e3c)=>_0x4b48e4[_0x3b51e8(0x23b)][_0x3b51e8(0x1ae)](_0x570e3c[_0x3b51e8(0x23b)]))){if(!_0x48c4df[_0x3b51e8(0x1e4)]()&&!_0x48c4df[_0x3b51e8(0x1b9)]())continue;const _0x1e7c0=await realpath(resolve(_0x3960c2,_0x48c4df[_0x3b51e8(0x23b)]))[_0x3b51e8(0x1b3)](()=>undefined);if(_0x1e7c0===undefined||!isWithinAllowedRoot(_0x1e7c0,_0x90c27e))continue;const _0x3e7b83=await stat(_0x1e7c0)[_0x3b51e8(0x1b3)](()=>undefined);if(_0x3e7b83===undefined||!_0x3e7b83[_0x3b51e8(0x1e4)]())continue;_0x1ec569[_0x3b51e8(0x1c5)]({'path':_0x1e7c0,'name':_0x48c4df[_0x3b51e8(0x23b)],'selectable':isWithinAllowedRoot(_0x1e7c0,_0x34ae2e)});if(_0x1ec569[_0x3b51e8(0x156)]>DIRECTORY_PICKER_LIMIT)break;}const _0x59a273=dirname(_0x3960c2);return{'homePath':_0x54fcb8,'currentPath':_0x3960c2,'parentPath':_0x59a273===_0x3960c2||!isWithinAllowedRoot(_0x59a273,_0x90c27e)?null:_0x59a273,'browseRoots':_0x34ae2e,'selectable':isWithinAllowedRoot(_0x3960c2,_0x34ae2e),'entries':_0x1ec569[_0x3b51e8(0x1d2)](-0x1c9*0x3+-0x147e+0x19d9,DIRECTORY_PICKER_LIMIT),'truncated':_0x1ec569[_0x3b51e8(0x156)]>DIRECTORY_PICKER_LIMIT};}export async function listWorkspaceFiles(_0x3dd5d9,_0x1f4472='.',_0x38d511,_0x3d998f=DIRECTORY_PAGE_LIMIT){const _0x5e4d94=_0x1a5b06;if(!Number[_0x5e4d94(0x16f)](_0x3d998f)||_0x3d998f<0xfef*0x1+-0x1800+0x812||_0x3d998f>DIRECTORY_PAGE_LIMIT)throw new Error(_0x5e4d94(0x17e));const _0x2e7298=await resolveRegisteredWorkspaceRoot(_0x3dd5d9),_0x55c03a=await resolveWorkspaceEntryFromCanonicalRoot(_0x2e7298,_0x1f4472,!![]),_0x36a13b=await readdir(_0x55c03a,{'withFileTypes':!![]}),_0x58673f=decodeDirectoryCursor(_0x38d511,_0x1f4472),_0x43fae2=_0x36a13b[_0x5e4d94(0x1e9)](_0x359a3b=>_0x359a3b[_0x5e4d94(0x23b)]!==_0x5e4d94(0x19e)&&!isWorkspaceUploadTemporaryName(_0x359a3b[_0x5e4d94(0x23b)]))[_0x5e4d94(0x231)](_0x3da14c=>_0x3da14c[_0x5e4d94(0x23b)])[_0x5e4d94(0x1a1)]((_0x4536fe,_0x25f336)=>_0x4536fe[_0x5e4d94(0x1ae)](_0x25f336)),_0x29aa17=_0x58673f===undefined?-0x904+-0x1465*-0x1+-0x3cb*0x3:_0x43fae2[_0x5e4d94(0x16c)](_0xcaa35a=>_0xcaa35a>_0x58673f);if(_0x58673f!==undefined&&_0x29aa17===-(-0x376+-0x6fa*0x2+0x116b))return{'entries':[],'nextCursor':null,'truncated':![]};const _0x4ebb70=_0x43fae2[_0x5e4d94(0x1d2)](_0x29aa17,_0x29aa17+_0x3d998f),_0x412a5b=[];for(const _0x1cb578 of _0x4ebb70){const _0x1c0a2d=await resolveWorkspaceEntry(_0x2e7298,relative(_0x2e7298,resolve(_0x55c03a,_0x1cb578)),![])[_0x5e4d94(0x1b3)](_0x4456f5=>{if(isSkippableWorkspaceEntryError(_0x4456f5))return undefined;throw _0x4456f5;});if(_0x1c0a2d===undefined)continue;const _0x5d0a39=await lstat(_0x1c0a2d)[_0x5e4d94(0x1b3)](_0x50a04c=>{const _0x336324=_0x5e4d94;if(_0x50a04c[_0x336324(0x1e8)]===_0x336324(0x1d3))return undefined;throw _0x50a04c;});if(_0x5d0a39===undefined||!_0x5d0a39[_0x5e4d94(0x1ff)]()&&!_0x5d0a39[_0x5e4d94(0x1e4)]())continue;_0x412a5b[_0x5e4d94(0x1c5)]({'path':relative(_0x2e7298,_0x1c0a2d)[_0x5e4d94(0x1b6)](sep)[_0x5e4d94(0x1cd)]('/'),'name':_0x1cb578,'kind':_0x5d0a39[_0x5e4d94(0x1e4)]()?_0x5e4d94(0x122):_0x5e4d94(0x17b),'size':_0x5d0a39[_0x5e4d94(0x1ff)]()?_0x5d0a39[_0x5e4d94(0x227)]:null,'modifiedAt':_0x5d0a39[_0x5e4d94(0x139)]});}const _0x46a7fd=_0x43fae2[_0x29aa17+_0x4ebb70[_0x5e4d94(0x156)]];return{'entries':_0x412a5b,'nextCursor':_0x46a7fd===undefined||_0x4ebb70[_0x5e4d94(0x156)]===0x1983+-0xe9*-0x7+-0x1fe2?null:encodeDirectoryCursor(_0x1f4472,_0x4ebb70[_0x4ebb70[_0x5e4d94(0x156)]-(-0x1950+-0x60*-0x21+0x1*0xcf1)]),'truncated':_0x46a7fd!==undefined};}export async function mutateWorkspaceFile(_0x596931,_0x47b947){const _0x213a70=_0x1a5b06,_0x396e4d=await resolveRegisteredWorkspaceRoot(_0x596931);if(_0x47b947[_0x213a70(0x183)]===_0x213a70(0x192)||_0x47b947[_0x213a70(0x183)]===_0x213a70(0x222)){const _0x3b4a95=await resolveNewWorkspaceEntry(_0x396e4d,_0x47b947[_0x213a70(0x1c3)]);if(_0x47b947[_0x213a70(0x183)]===_0x213a70(0x192))await writeFile(_0x3b4a95,'',{'flag':'wx'});else await mkdir(_0x3b4a95);return{'path':workspaceRelativePath(_0x396e4d,_0x3b4a95)};}await assertWorkspaceMutationPathHasNoSymlinks(_0x396e4d,_0x47b947[_0x213a70(0x1c3)]);const _0x490d7e=await resolveWorkspaceEntryMetadata(_0x396e4d,_0x47b947[_0x213a70(0x1c3)]);if(workspaceRelativePath(_0x396e4d,_0x490d7e[_0x213a70(0x1c3)])==='.')throw new Error(_0x213a70(0x157));if(_0x47b947[_0x213a70(0x183)]===_0x213a70(0x1f1))return await rm(_0x490d7e[_0x213a70(0x1c3)],{'recursive':_0x490d7e[_0x213a70(0x1aa)][_0x213a70(0x1e4)](),'force':![]}),{'deleted':!![]};const _0x575c2c=await resolveNewWorkspaceEntry(_0x396e4d,_0x47b947[_0x213a70(0x17a)]);if(_0x490d7e[_0x213a70(0x1aa)][_0x213a70(0x1e4)]()){const _0x264422=relative(_0x490d7e[_0x213a70(0x1c3)],_0x575c2c);if(_0x264422===''||!isAbsolute(_0x264422)&&_0x264422!=='..'&&!_0x264422[_0x213a70(0x220)]('..'+sep))throw new Error(_0x213a70(0x180));}return await rename(_0x490d7e[_0x213a70(0x1c3)],_0x575c2c),{'path':workspaceRelativePath(_0x396e4d,_0x575c2c)};}async function resolveNewWorkspaceEntry(_0x793728,_0x171388){const _0x18d0e3=_0x1a5b06,_0xedcfc9=_0x171388[_0x18d0e3(0x141)]('\x5c','/'),_0x53f1cf=_0xedcfc9[_0x18d0e3(0x1b6)]('/'),_0x1e064c=_0x53f1cf['at'](-(0x4*-0x143+-0x6a5*0x3+0x18fc));if(_0x171388[_0x18d0e3(0x20c)]('\x00')||_0xedcfc9[_0x18d0e3(0x220)]('/')||isAbsolute(_0x171388)||win32[_0x18d0e3(0x13c)](_0xedcfc9)||_0x1e064c===undefined||_0x1e064c[_0x18d0e3(0x156)]===0x100*-0x1c+-0xa08+0x2*0x1304||_0x53f1cf[_0x18d0e3(0x212)](invalidWorkspaceMutationSegment))throw new Error(_0x18d0e3(0x1e1));const _0x34df43=_0x53f1cf[_0x18d0e3(0x156)]===0x184c+-0x238c+0xb41?'.':_0x53f1cf[_0x18d0e3(0x1d2)](-0x1*0xc59+-0x38d+0xfe6,-(-0x3*-0x14b+0x2*-0x1216+-0x2*-0x1026))[_0x18d0e3(0x1cd)]('/');await assertWorkspaceMutationPathHasNoSymlinks(_0x793728,_0x34df43);const _0x54affb=await resolveWorkspaceEntryFromCanonicalRoot(_0x793728,_0x34df43,!![]),_0x232787=resolve(_0x54affb,_0x1e064c);try{await lstat(_0x232787);throw new Error(_0x18d0e3(0x168));}catch(_0x5c56b8){if(_0x5c56b8[_0x18d0e3(0x1e8)]!==_0x18d0e3(0x1d3))throw _0x5c56b8;}return _0x232787;}async function assertWorkspaceMutationPathHasNoSymlinks(_0x3870c1,_0x45b67b){const _0xad2258=_0x1a5b06,_0x39758f=_0x45b67b[_0xad2258(0x141)]('\x5c','/');if(_0x39758f==='.')return;const _0x5edfa7=_0x39758f[_0xad2258(0x1b6)]('/');if(_0x45b67b[_0xad2258(0x20c)]('\x00')||_0x39758f[_0xad2258(0x220)]('/')||isAbsolute(_0x45b67b)||win32[_0xad2258(0x13c)](_0x39758f)||_0x5edfa7[_0xad2258(0x212)](invalidWorkspaceMutationSegment))throw new Error(_0xad2258(0x1e1));let _0x33d4ed=_0x3870c1;for(const _0x49141f of _0x5edfa7){_0x33d4ed=resolve(_0x33d4ed,_0x49141f);const _0x4be11f=await lstat(_0x33d4ed)[_0xad2258(0x1b3)](_0x4c0dca=>{const _0x298825=_0xad2258;if(_0x4c0dca[_0x298825(0x1e8)]===_0x298825(0x1d3))throw new Error(_0x298825(0x181));throw _0x4c0dca;});if(_0x4be11f[_0xad2258(0x1b9)]())throw new Error(_0xad2258(0x1e1));}}function invalidWorkspaceMutationSegment(_0x31b780){const _0x48126c=_0x1a5b06;if(_0x31b780[_0x48126c(0x156)]===-0x176e+-0x50b+0x1c79||_0x31b780==='.'||_0x31b780==='..'||_0x31b780===_0x48126c(0x19e))return!![];if(_0x4dde61()!==_0x48126c(0x1d1))return![];const _0x1297f3=_0x31b780[_0x48126c(0x1a0)](/[. ]+$/u,'')[_0x48126c(0x217)]();return/[<>:"|?*]/u[_0x48126c(0x16a)](_0x31b780)||/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/u[_0x48126c(0x16a)](_0x1297f3);}function workspaceRelativePath(_0x3579d1,_0x1ae0ed){const _0x280b85=_0x1a5b06,_0x1b62fa=relative(_0x3579d1,_0x1ae0ed)[_0x280b85(0x1b6)](sep)[_0x280b85(0x1cd)]('/');return _0x1b62fa[_0x280b85(0x156)]===-0x1e*-0x11b+-0x10b*-0x23+-0x45ab?'.':_0x1b62fa;}function isSkippableWorkspaceEntryError(_0x27d888){const _0x4eb602=_0x1a5b06;return _0x27d888 instanceof Error&&(_0x27d888[_0x4eb602(0x128)]===_0x4eb602(0x1e1)||_0x27d888[_0x4eb602(0x128)]===_0x4eb602(0x181)||_0x27d888[_0x4eb602(0x128)]===_0x4eb602(0x162));}export async function preflightWorkspaceUpload(_0x459ed6,_0x3220b4,_0x12a7fa){const _0x166f1d=_0x1a5b06;if(_0x12a7fa[_0x166f1d(0x156)]===0x212a+0x230a+-0x4434||_0x12a7fa==='.'||_0x12a7fa==='..'||_0x12a7fa[_0x166f1d(0x20c)]('\x00')||_0x12a7fa[_0x166f1d(0x20c)]('/')||_0x12a7fa[_0x166f1d(0x20c)]('\x5c')||isWorkspaceUploadTemporaryName(_0x12a7fa))return{'path':'','absolutePath':'','status':_0x166f1d(0x142)};const _0x3bd230=await resolveRegisteredWorkspaceRoot(_0x459ed6),_0x10d58b=await resolveWorkspaceEntry(_0x3bd230,_0x3220b4,!![]),_0x55cc87=resolve(_0x10d58b,_0x12a7fa);if(dirname(_0x55cc87)!==_0x10d58b)throw new Error(_0x166f1d(0x1e1));const _0x1fda66=relative(_0x3bd230,_0x55cc87)[_0x166f1d(0x1b6)](sep)[_0x166f1d(0x1cd)]('/'),_0x171476=await lstat(_0x55cc87)[_0x166f1d(0x1b3)](_0x47faf6=>{const _0x585369=_0x166f1d;if(_0x47faf6[_0x585369(0x1e8)]===_0x585369(0x1d3))return undefined;throw _0x47faf6;});if(_0x171476===undefined)return{'path':_0x1fda66,'absolutePath':_0x55cc87,'status':_0x166f1d(0x193)};if(_0x171476[_0x166f1d(0x1b9)]())throw new Error(_0x166f1d(0x1e1));if(_0x171476[_0x166f1d(0x1ff)]())return{'path':_0x1fda66,'absolutePath':_0x55cc87,'status':_0x166f1d(0x12b)};return{'path':_0x1fda66,'absolutePath':_0x55cc87,'status':_0x166f1d(0x12e)};}export function workspaceUploadTemporaryName(_0x44277e){const _0x146a67=_0x1a5b06;return _0x146a67(0x1cb)+_0x44277e+_0x146a67(0x16d);}function isWorkspaceUploadTemporaryName(_0x2e1c6c){const _0x4a48be=_0x1a5b06;return/^\.mar-upload-[0-9a-f-]{36}\.part$/iu[_0x4a48be(0x16a)](_0x2e1c6c)||/^\.mar-edit-[0-9a-f-]{36}\.part$/iu[_0x4a48be(0x16a)](_0x2e1c6c);}export async function readWorkspaceTextFile(_0x5d4644,_0x54dca5,_0x3a6a60=-0x4db*-0x1+0xd01*-0x3+0x4*0x88a,_0x361f0e=FILE_READ_LIMIT){const _0xc3d518=_0x1a5b06;if(!Number[_0xc3d518(0x16f)](_0x3a6a60)||_0x3a6a60<0x1*0x211+0x258b+0x14*-0x1fb||!Number[_0xc3d518(0x16f)](_0x361f0e)||_0x361f0e<0x195f+-0x1e*-0xfd+-0x3704||_0x361f0e>FILE_READ_LIMIT)throw new Error(_0xc3d518(0x160));const _0x475522=await resolveRegisteredWorkspaceRoot(_0x5d4644),_0x2628ac=await resolveWorkspaceEntry(_0x475522,_0x54dca5,![]),_0x48fc02=await lstat(_0x2628ac);if(!_0x48fc02[_0xc3d518(0x1ff)]())throw new Error(_0xc3d518(0x162));if(_0x48fc02[_0xc3d518(0x227)]>FILE_READ_LIMIT*(-0xe3f+0x22f3+0x4*-0x529))throw new Error(_0xc3d518(0x1ca));const _0x2026a1=await readFile(_0x2628ac),_0x4bf683=createHash(_0xc3d518(0x177))[_0xc3d518(0x1a7)](_0x2026a1)[_0xc3d518(0x16b)](_0xc3d518(0x175)),_0x1e94c6=_0x2026a1[_0xc3d518(0x20c)](0x2*0x42d+-0x31*0x85+0x1d*0x97)||!isValidUtf8(_0x2026a1);if(_0x1e94c6){const _0x9c4c0b=Math[_0xc3d518(0x1e5)](_0x2026a1[_0xc3d518(0x156)],_0x3a6a60+_0x361f0e),_0x41fca7=_0x2026a1[_0xc3d518(0x11b)](_0x3a6a60,_0x9c4c0b);return{'path':relative(_0x475522,_0x2628ac)[_0xc3d518(0x1b6)](sep)[_0xc3d518(0x1cd)]('/'),'encoding':_0xc3d518(0x1a4),'size':_0x2026a1[_0xc3d518(0x156)],'content':_0x41fca7[_0xc3d518(0x1f4)](_0xc3d518(0x1a4)),'truncated':_0x9c4c0b<_0x2026a1[_0xc3d518(0x156)],'nextOffset':_0x9c4c0b<_0x2026a1[_0xc3d518(0x156)]?_0x9c4c0b:null,'revision':_0x4bf683};}if(_0x3a6a60>-0x31f+0xa43*0x1+0x1c9*-0x4&&_0x3a6a60<_0x2026a1[_0xc3d518(0x156)]&&isUtf8ContinuationByte(_0x2026a1[_0x3a6a60]))throw new Error(_0xc3d518(0x160));let _0x512fcd=Math[_0xc3d518(0x1e5)](_0x2026a1[_0xc3d518(0x156)],_0x3a6a60+_0x361f0e);if(_0x512fcd<_0x2026a1[_0xc3d518(0x156)]&&isUtf8ContinuationByte(_0x2026a1[_0x512fcd])){while(_0x512fcd>_0x3a6a60&&isUtf8ContinuationByte(_0x2026a1[_0x512fcd]))_0x512fcd-=-0x3f*0x5d+-0x1*0x16af+-0x3*-0xf31;if(_0x512fcd===_0x3a6a60){_0x512fcd+=-0x714*0x1+-0x2625+0x2d3a;while(_0x512fcd<_0x2026a1[_0xc3d518(0x156)]&&isUtf8ContinuationByte(_0x2026a1[_0x512fcd]))_0x512fcd+=-0xb9*0x11+-0x18ee*-0x1+-0x4*0x329;}}const _0xb546ea=_0x2026a1[_0xc3d518(0x11b)](_0x3a6a60,_0x512fcd),_0x683a70=new TextDecoder(_0xc3d518(0x1be),{'fatal':!![]})[_0xc3d518(0x20b)](_0xb546ea),_0x4d6230=_0x512fcd<_0x2026a1[_0xc3d518(0x156)]?_0x512fcd:null;return{'path':relative(_0x475522,_0x2628ac)[_0xc3d518(0x1b6)](sep)[_0xc3d518(0x1cd)]('/'),'encoding':_0xc3d518(0x1be),'size':_0x2026a1[_0xc3d518(0x156)],'content':_0x683a70,'truncated':_0x4d6230!==null,'nextOffset':_0x4d6230,'revision':_0x4bf683};}export async function writeWorkspaceTextFile(_0x4cb233,_0x4bd847,_0x98983a,_0x4440c9){const _0x5d0275=_0x1a5b06;if(!/^[0-9a-f]{64}$/u[_0x5d0275(0x16a)](_0x4440c9))throw new Error(_0x5d0275(0x1a9));const _0x2dd291=Buffer[_0x5d0275(0x207)](_0x98983a,_0x5d0275(0x1ea));if(_0x2dd291[_0x5d0275(0x156)]>FILE_READ_LIMIT*(-0x1*-0x1e55+-0x89a+-0x15ab))throw new Error(_0x5d0275(0x1ca));if(_0x2dd291[_0x5d0275(0x20c)](-0x24f*-0x4+-0x1*0x2677+0x42d*0x7))throw new Error(_0x5d0275(0x1f7));const _0x2c2ed5=await resolveRegisteredWorkspaceRoot(_0x4cb233);await assertWorkspaceMutationPathHasNoSymlinks(_0x2c2ed5,_0x4bd847);const _0x260f76=await resolveWorkspaceEntry(_0x2c2ed5,_0x4bd847,![]),_0xc8881c=await lstat(_0x260f76);if(!_0xc8881c[_0x5d0275(0x1ff)]())throw new Error(_0x5d0275(0x162));const _0xc79786=await readFile(_0x260f76);if(_0xc79786[_0x5d0275(0x20c)](-0x1f*0x6a+0x340+0x996)||!isValidUtf8(_0xc79786))throw new Error(_0x5d0275(0x1f7));const _0x2ac13a=createHash(_0x5d0275(0x177))[_0x5d0275(0x1a7)](_0xc79786)[_0x5d0275(0x16b)](_0x5d0275(0x175));if(_0x2ac13a!==_0x4440c9)throw new Error(_0x5d0275(0x15f));const _0x561a91=createHash(_0x5d0275(0x177))[_0x5d0275(0x1a7)](_0x2dd291)[_0x5d0275(0x16b)](_0x5d0275(0x175)),_0x2a3b2e=resolve(dirname(_0x260f76),_0x5d0275(0x221)+randomUUID()+_0x5d0275(0x16d));try{await writeFile(_0x2a3b2e,_0x2dd291,{'flag':'wx','mode':_0xc8881c[_0x5d0275(0x151)]}),await rename(_0x2a3b2e,_0x260f76);}finally{await rm(_0x2a3b2e,{'force':!![]})[_0x5d0275(0x1b3)](()=>undefined);}return{'path':workspaceRelativePath(_0x2c2ed5,_0x260f76),'revision':_0x561a91,'size':_0x2dd291[_0x5d0275(0x156)]};}export async function readWorkspaceFileContentRange(_0x9e6b1b,_0x126c38,_0x1a1c3c=0x1*0x1f19+0x262f+-0x4548,_0xebf717=FILE_READ_LIMIT){const _0x1b8efb=_0x1a5b06;if(!Number[_0x1b8efb(0x16f)](_0x1a1c3c)||_0x1a1c3c<0x5*-0x1d2+-0xf*0xf+-0x9fb*-0x1||!Number[_0x1b8efb(0x16f)](_0xebf717)||_0xebf717<-0xd1*-0xa+0x102d+-0x1856||_0xebf717>FILE_READ_LIMIT)throw new Error(_0x1b8efb(0x160));const _0x2ad46d=await resolveRegisteredWorkspaceRoot(_0x9e6b1b),_0x4cebd8=await resolveWorkspaceEntry(_0x2ad46d,_0x126c38,![]),_0x4a57bd=await lstat(_0x4cebd8);if(!_0x4a57bd[_0x1b8efb(0x1ff)]())throw new Error(_0x1b8efb(0x162));if(_0x1a1c3c>_0x4a57bd[_0x1b8efb(0x227)])throw new Error(_0x1b8efb(0x160));const _0x52c9da=Math[_0x1b8efb(0x1e5)](_0xebf717,_0x4a57bd[_0x1b8efb(0x227)]-_0x1a1c3c),_0x308c3a=Buffer[_0x1b8efb(0x19c)](_0x52c9da),_0x5cfc4c=await open(_0x4cebd8,'r');try{const {bytesRead:_0x4ae2f0}=await _0x5cfc4c[_0x1b8efb(0x14a)](_0x308c3a,0x75*0x43+-0xb55*-0x1+0x2cc*-0xf,_0x52c9da,_0x1a1c3c),_0x5c3e7c=_0x1a1c3c+_0x4ae2f0;return{'path':relative(_0x2ad46d,_0x4cebd8)[_0x1b8efb(0x1b6)](sep)[_0x1b8efb(0x1cd)]('/'),'size':_0x4a57bd[_0x1b8efb(0x227)],'offset':_0x1a1c3c,'contentBase64':_0x308c3a[_0x1b8efb(0x11b)](0x2195*-0x1+0x2f*0x13+0x2*0xf0c,_0x4ae2f0)[_0x1b8efb(0x1f4)](_0x1b8efb(0x1a4)),'nextOffset':_0x5c3e7c<_0x4a57bd[_0x1b8efb(0x227)]?_0x5c3e7c:null};}finally{await _0x5cfc4c[_0x1b8efb(0x13d)]();}}export async function readAllowedTextFile(_0x54d52b,_0x2453a8,_0x1193f7=-0x234d+-0x17*0x166+0x4377,_0x3687c3=FILE_READ_LIMIT){const _0x244c58=_0x1a5b06;if(!isAbsolute(_0x54d52b))throw new Error(_0x244c58(0x1e1));const _0xd4f715=await realpath(_0x54d52b)[_0x244c58(0x1b3)](_0x55eda5=>{const _0x38ea4f=_0x244c58;if(_0x55eda5[_0x38ea4f(0x1e8)]===_0x38ea4f(0x1d3))throw new Error(_0x38ea4f(0x181));throw _0x55eda5;}),_0x3f2703=await Promise[_0x244c58(0x12c)](_0x2453a8[_0x244c58(0x231)](_0x56affd=>realpath(_0x56affd)));if(!isWithinAllowedRoot(_0xd4f715,_0x3f2703))throw new Error(_0x244c58(0x1e1));const _0x88bd70=await lstat(_0xd4f715);if(!_0x88bd70[_0x244c58(0x1ff)]())throw new Error(_0x244c58(0x162));if(_0x88bd70[_0x244c58(0x227)]>FILE_READ_LIMIT*(-0x34f+-0x7*-0x3ee+-0x25*0xa7))throw new Error(_0x244c58(0x1ca));if(!Number[_0x244c58(0x16f)](_0x1193f7)||_0x1193f7<-0x7cd*0x4+-0x18d1+0x3805||!Number[_0x244c58(0x16f)](_0x3687c3)||_0x3687c3<-0x1690+-0x1588+0x2c19||_0x3687c3>FILE_READ_LIMIT)throw new Error(_0x244c58(0x160));const _0x1e4c4f=await readFile(_0xd4f715),_0x3d5f8a=_0x1e4c4f[_0x244c58(0x20c)](0xb*-0x383+0xb*-0x211+0xe*0x462)||!isValidUtf8(_0x1e4c4f),_0x3578e1=Math[_0x244c58(0x1e5)](_0x1e4c4f[_0x244c58(0x156)],_0x1193f7+_0x3687c3);if(_0x3d5f8a){const _0x1847f1=_0x1e4c4f[_0x244c58(0x11b)](_0x1193f7,_0x3578e1);return{'path':_0xd4f715,'encoding':_0x244c58(0x1a4),'size':_0x1e4c4f[_0x244c58(0x156)],'content':_0x1847f1[_0x244c58(0x1f4)](_0x244c58(0x1a4)),'truncated':_0x3578e1<_0x1e4c4f[_0x244c58(0x156)],'nextOffset':_0x3578e1<_0x1e4c4f[_0x244c58(0x156)]?_0x3578e1:null};}if(_0x1193f7>0xd51+0x14be+0x1*-0x220f&&_0x1193f7<_0x1e4c4f[_0x244c58(0x156)]&&isUtf8ContinuationByte(_0x1e4c4f[_0x1193f7]))throw new Error(_0x244c58(0x160));let _0xf13ddb=_0x3578e1;if(_0xf13ddb<_0x1e4c4f[_0x244c58(0x156)]&&isUtf8ContinuationByte(_0x1e4c4f[_0xf13ddb])){while(_0xf13ddb>_0x1193f7&&isUtf8ContinuationByte(_0x1e4c4f[_0xf13ddb]))_0xf13ddb-=-0x23d8+-0x1028+0x3401;if(_0xf13ddb===_0x1193f7){_0xf13ddb+=0x758+-0x1381*-0x1+-0x1ad8;while(_0xf13ddb<_0x1e4c4f[_0x244c58(0x156)]&&isUtf8ContinuationByte(_0x1e4c4f[_0xf13ddb]))_0xf13ddb+=-0x257*-0x2+0x5b*0x2b+-0x2da*0x7;}}const _0x118c56=_0xf13ddb<_0x1e4c4f[_0x244c58(0x156)]?_0xf13ddb:null;return{'path':_0xd4f715,'encoding':_0x244c58(0x1be),'size':_0x1e4c4f[_0x244c58(0x156)],'content':new TextDecoder(_0x244c58(0x1be),{'fatal':!![]})[_0x244c58(0x20b)](_0x1e4c4f[_0x244c58(0x11b)](_0x1193f7,_0xf13ddb)),'truncated':_0x118c56!==null,'nextOffset':_0x118c56};}function isValidUtf8(_0x286dbe){const _0xe3879f=_0x1a5b06;try{return new TextDecoder(_0xe3879f(0x1be),{'fatal':!![]})[_0xe3879f(0x20b)](_0x286dbe),!![];}catch{return![];}}function isUtf8ContinuationByte(_0x27b6b1){return(_0x27b6b1&-0x1b5*0x1+-0x2703+0x2978)===-0x18e2+-0x26b3+0x4015;}export async function searchWorkspaceFiles(_0x5da571,_0x2f7dc4,_0x4add33,_0x431470=SEARCH_RESULT_LIMIT,_0x47c171=![]){const _0xa87472=_0x1a5b06,_0x2c241d=new WorkspaceFileIndex(_0x5da571);try{return await _0x2c241d[_0xa87472(0x1e7)](_0x2f7dc4,_0x4add33,_0x431470,_0x47c171);}finally{_0x2c241d[_0xa87472(0x1e3)]();}}async function resolveRegisteredWorkspaceRoot(_0x9a03da){const _0x12d0f8=_0x1a5b06,_0x302769=await realpath(_0x9a03da);if(normalizeWorkspacePath(_0x302769)!==normalizeWorkspacePath(_0x9a03da))throw new Error(_0x12d0f8(0x15b));return _0x302769;}async function resolveWorkspaceEntry(_0x5cf3a1,_0x5339e5,_0x525645){const _0xf416fa=await resolveRegisteredWorkspaceRoot(_0x5cf3a1);return resolveWorkspaceEntryFromCanonicalRoot(_0xf416fa,_0x5339e5,_0x525645);}async function resolveWorkspaceEntryFromCanonicalRoot(_0x435459,_0x210ede,_0x18bc27){const _0x1af2fb=_0x1a5b06,_0x409dcd=await resolveWorkspaceEntryMetadata(_0x435459,_0x210ede);if(_0x18bc27?!_0x409dcd[_0x1af2fb(0x1aa)][_0x1af2fb(0x1e4)]():!_0x409dcd[_0x1af2fb(0x1aa)][_0x1af2fb(0x1ff)]()&&!_0x409dcd[_0x1af2fb(0x1aa)][_0x1af2fb(0x1e4)]())throw new Error(_0x18bc27?_0x1af2fb(0x178):_0x1af2fb(0x162));return _0x409dcd[_0x1af2fb(0x1c3)];}async function resolveWorkspaceEntryMetadata(_0x444737,_0x10c6a0){const _0x110d89=_0x1a5b06;if(_0x10c6a0[_0x110d89(0x20c)]('\x00')||_0x10c6a0[_0x110d89(0x156)]===-0x8d3+-0x1*0x149f+0x1d72||_0x10c6a0[_0x110d89(0x220)]('/')||_0x10c6a0[_0x110d89(0x220)]('\x5c'))throw new Error(_0x110d89(0x1e1));const _0x58830=_0x10c6a0[_0x110d89(0x141)]('\x5c','/');if(_0x58830[_0x110d89(0x1b6)]('/')[_0x110d89(0x212)](_0x4fddbc=>_0x4fddbc==='..'||_0x4fddbc===_0x110d89(0x19e)))throw new Error(_0x110d89(0x1e1));let _0x2b4f37;try{_0x2b4f37=await realpath(resolve(_0x444737,_0x58830));}catch(_0x53562d){if(_0x53562d[_0x110d89(0x1e8)]===_0x110d89(0x1d3))throw new Error(_0x110d89(0x181));throw _0x53562d;}const _0x4eefa6=relative(_0x444737,_0x2b4f37);if(isAbsolute(_0x4eefa6)||_0x4eefa6[_0x110d89(0x220)]('..')||_0x4eefa6==='..'||_0x4eefa6[_0x110d89(0x220)]('..'+sep))throw new Error(_0x110d89(0x1e1));const _0x312cbe=await lstat(_0x2b4f37);return{'path':_0x2b4f37,'metadata':_0x312cbe};}async function inspectWorkspaceIndexEntry(_0x7d7c0b,_0x4c18a3,_0x37b81d){const _0x11db73=_0x1a5b06;try{const _0x3e6f80=await resolveWorkspaceEntryMetadata(_0x7d7c0b,_0x4c18a3);if(!_0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x1ff)]()&&!_0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x1e4)]())return undefined;const _0x530006=relative(_0x7d7c0b,_0x3e6f80[_0x11db73(0x1c3)])[_0x11db73(0x1b6)](sep)[_0x11db73(0x1cd)]('/');return _0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x1e4)]()?{'path':_0x530006,'name':_0x37b81d,'kind':_0x11db73(0x122),'size':null,'modifiedAt':_0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x139)]}:{'path':_0x530006,'name':_0x37b81d,'kind':_0x11db73(0x17b),'size':_0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x227)],'modifiedAt':_0x3e6f80[_0x11db73(0x1aa)][_0x11db73(0x139)]};}catch{return undefined;}}function encodeDirectoryCursor(_0x5dace9,_0x35798a){const _0x5e7ff9=_0x1a5b06;return Buffer[_0x5e7ff9(0x207)](JSON[_0x5e7ff9(0x187)]({'path':_0x5dace9,'name':_0x35798a}))[_0x5e7ff9(0x1f4)](_0x5e7ff9(0x237));}function decodeDirectoryCursor(_0x2e612b,_0x283136){const _0x19f1a6=_0x1a5b06;if(_0x2e612b===undefined)return undefined;try{const _0x4f8d37=JSON[_0x19f1a6(0x147)](Buffer[_0x19f1a6(0x207)](_0x2e612b,_0x19f1a6(0x237))[_0x19f1a6(0x1f4)](_0x19f1a6(0x1ea)));if(typeof _0x4f8d37!==_0x19f1a6(0x219)||_0x4f8d37===null||_0x4f8d37[_0x19f1a6(0x1c3)]!==_0x283136||typeof _0x4f8d37[_0x19f1a6(0x23b)]!==_0x19f1a6(0x1bc))throw new Error();return _0x4f8d37[_0x19f1a6(0x23b)];}catch{throw new Error(_0x19f1a6(0x17e));}}function encodeSearchCursor(_0x3a4f77,_0x3d05e6){const _0x3c58eb=_0x1a5b06;return Buffer[_0x3c58eb(0x207)](JSON[_0x3c58eb(0x187)]({'query':_0x3a4f77,'path':_0x3d05e6}))[_0x3c58eb(0x1f4)](_0x3c58eb(0x237));}function decodeSearchCursor(_0x31fb95,_0x4847ef){const _0x231467=_0x1a5b06;if(_0x31fb95===undefined)return undefined;try{const _0x10146d=JSON[_0x231467(0x147)](Buffer[_0x231467(0x207)](_0x31fb95,_0x231467(0x237))[_0x231467(0x1f4)](_0x231467(0x1ea)));if(typeof _0x10146d!==_0x231467(0x219)||_0x10146d===null||_0x10146d[_0x231467(0x22f)]!==_0x4847ef||typeof _0x10146d[_0x231467(0x1c3)]!==_0x231467(0x1bc))throw new Error();return _0x10146d[_0x231467(0x1c3)];}catch{throw new Error(_0x231467(0x17e));}}export function normalizeWorkspacePath(_0x1fabf9,_0x2b199a=_0x4dde61()){const _0x3ed6e7=_0x1a5b06;if(_0x1fabf9[_0x3ed6e7(0x156)]===-0x13*-0x15d+0x2094+-0x1*0x3a7b||_0x1fabf9[_0x3ed6e7(0x20c)]('\u0000'))throw new Error(_0x3ed6e7(0x1f6));if(_0x2b199a===_0x3ed6e7(0x1d1)){if(/^\\\\[?.]/[_0x3ed6e7(0x16a)](_0x1fabf9))throw new Error(_0x3ed6e7(0x1ce));const _0xb1a338=win32[_0x3ed6e7(0x150)](_0x1fabf9[_0x3ed6e7(0x141)]('/','\x5c'));if(!win32[_0x3ed6e7(0x13c)](_0xb1a338))throw new Error(_0x3ed6e7(0x166));return _0xb1a338[_0x3ed6e7(0x1a0)](/\\+$/,'')[_0x3ed6e7(0x159)]();}if(_0x2b199a!==_0x3ed6e7(0x14e))throw new Error(_0x3ed6e7(0x148));const _0x59022f=posix[_0x3ed6e7(0x150)](_0x1fabf9);if(!posix[_0x3ed6e7(0x13c)](_0x59022f))throw new Error(_0x3ed6e7(0x166));return _0x59022f==='/'?_0x59022f:_0x59022f[_0x3ed6e7(0x1a0)](/\/+$/,'');}export function isWithinAllowedRoot(_0x5ed6f1,_0x233e89,_0x33fd1a=_0x4dde61()){const _0x1f79d5=_0x1a5b06,_0x2f3234=normalizeWorkspacePath(_0x5ed6f1,_0x33fd1a),_0x2181a3=_0x33fd1a===_0x1f79d5(0x1d1)?win32:posix;return _0x233e89[_0x1f79d5(0x212)](_0x4d4f9d=>{const _0x49a712=_0x1f79d5,_0x5ebd93=normalizeWorkspacePath(_0x4d4f9d,_0x33fd1a),_0x256d8b=_0x2181a3[_0x49a712(0x123)](_0x5ebd93,_0x2f3234);return _0x256d8b===''||!_0x256d8b[_0x49a712(0x220)]('..')&&!_0x2181a3[_0x49a712(0x13c)](_0x256d8b);});}export async function inspectWorkspace(_0x3f0f65,_0x26f006){const _0x29b9a9=_0x1a5b06,_0x13380a=await realpath(_0x3f0f65),_0x107341=await Promise[_0x29b9a9(0x12c)](_0x26f006[_0x29b9a9(0x231)](_0x28562c=>realpath(_0x28562c))),_0x49eee1=await stat(_0x13380a);if(!_0x49eee1[_0x29b9a9(0x1e4)]()||!isWithinAllowedRoot(_0x13380a,_0x107341))throw new Error(_0x29b9a9(0x15b));try{const _0x562239=await readGitSummary(_0x13380a);return{'path':_0x13380a,'kind':_0x29b9a9(0x1ef),'gitSummary':_0x562239};}catch(_0x5d3e1c){if(_0x5d3e1c instanceof GitCommandError&&_0x5d3e1c[_0x29b9a9(0x1e8)]===-0x93f*-0x1+0x2c7+-0xb86||isGitUnavailable(_0x5d3e1c))return{'path':_0x13380a,'kind':_0x29b9a9(0x122)};throw _0x5d3e1c;}}export async function readGitSummary(_0xfd0094){const _0x8c81fe=_0x1a5b06,_0x57c3df=(await runGit(_0xfd0094,[_0x8c81fe(0x1c7),_0x8c81fe(0x215)]))[_0x8c81fe(0x153)][_0x8c81fe(0x199)](),_0xf33d18=await runGitAllowFailure(_0xfd0094,[_0x8c81fe(0x1c7),_0x8c81fe(0x21c),_0x8c81fe(0x21d)]),_0x4a5434=await runGitAllowFailure(_0xfd0094,[_0x8c81fe(0x21f),_0x8c81fe(0x206),_0x8c81fe(0x1a8),_0x8c81fe(0x21d)]),_0x3d6b5d=(await runGit(_0xfd0094,[_0x8c81fe(0x1b5),_0x8c81fe(0x235),'-z']))[_0x8c81fe(0x22c)][_0x8c81fe(0x156)]>-0x7bf*-0x1+-0x1cd2+-0x53*-0x41,_0x2249f2=await runGit(_0xfd0094,[_0x8c81fe(0x1b5),_0x8c81fe(0x235)])[_0x8c81fe(0x203)](_0x40ba91=>_0x40ba91[_0x8c81fe(0x153)]);return{'commonDir':_0x57c3df,'head':_0xf33d18[_0x8c81fe(0x1e8)]===-0x1*-0x1ed6+-0x2f4*0x1+0x53*-0x56?_0xf33d18[_0x8c81fe(0x153)][_0x8c81fe(0x199)]():'','branch':_0x4a5434[_0x8c81fe(0x1e8)]===-0x1*0x16e8+0x493*-0x5+0x2dc7?_0x4a5434[_0x8c81fe(0x153)][_0x8c81fe(0x199)]():null,'dirty':_0x3d6b5d,'snapshot':summarizeText(_0x2249f2)};}export function assertSafeGitRef(_0x468433){const _0x437f13=_0x1a5b06;if(!REF_PATTERN[_0x437f13(0x16a)](_0x468433))throw new Error(_0x437f13(0x1f3));}export async function readRestrictedDiff(_0x215b2c,_0x1ff12e,_0x5b7f74){const _0x5cb225=_0x1a5b06;assertSafeGitRef(_0x1ff12e),assertSafeGitRef(_0x5b7f74);const _0x2c2b89=await runGit(_0x215b2c,[_0x5cb225(0x1f9),_0x5cb225(0x232),_0x5cb225(0x22b),_0x1ff12e,_0x5b7f74]),_0x2148c9=_0x2c2b89[_0x5cb225(0x22c)][_0x5cb225(0x20c)](0x10e8+-0xd9a*0x1+-0x34e)||_0x2c2b89[_0x5cb225(0x153)][_0x5cb225(0x20c)](_0x5cb225(0x230));if(_0x2148c9)return{'binary':!![],'summary':_0x5cb225(0x1f5)+createHash(_0x5cb225(0x177))[_0x5cb225(0x1a7)](_0x2c2b89[_0x5cb225(0x22c)])[_0x5cb225(0x16b)](_0x5cb225(0x175))+_0x5cb225(0x1bd)+_0x2c2b89[_0x5cb225(0x22c)][_0x5cb225(0x156)],'truncated':_0x2c2b89[_0x5cb225(0x208)]};return{'binary':![],'text':_0x2c2b89[_0x5cb225(0x153)],'truncated':_0x2c2b89[_0x5cb225(0x208)]};}function currentBranchFromStatusHeader(_0x1d4275){const _0x223cdb=_0x1a5b06,_0x1a8dde=_0x1d4275[_0x223cdb(0x1d2)](-0x3*-0xb42+-0x1a25+0x1*-0x79e);if(_0x1a8dde[_0x223cdb(0x220)](_0x223cdb(0x1bf)))return null;const _0x39690b=/^(?:No commits yet on|Initial commit on) (.+)$/[_0x223cdb(0x185)](_0x1a8dde);if(_0x39690b!==null)return _0x39690b[-0x1*-0x119+0x3cb*-0x2+0x67e]??null;return _0x1a8dde[_0x223cdb(0x1b6)](_0x223cdb(0x11f))[-0x11ab*-0x1+-0x224f*-0x1+-0x1*0x33fa]?.[_0x223cdb(0x1b6)]('\x20')[-0x1253*0x2+-0x1255+0x36fb]??null;}export async function readCurrentChangesSummary(_0x5e83d0){const _0x323028=_0x1a5b06,_0x3e06f4=await runGit(_0x5e83d0,[_0x323028(0x1b5),_0x323028(0x235),'-z',_0x323028(0x1ba),_0x323028(0x18c)]),_0x1a819b=_0x3e06f4[_0x323028(0x153)][_0x323028(0x1b6)]('\x00'),_0x336cc9=_0x1a819b[_0x323028(0x223)]()??'',_0x49b791=[];for(let _0x3ab96a=-0x1*-0x180f+-0xd16+-0xaf9;_0x3ab96a<_0x1a819b[_0x323028(0x156)];_0x3ab96a+=0x1d6e+-0x1*0x25af+0x421*0x2){const _0x1e3a70=_0x1a819b[_0x3ab96a];if(_0x1e3a70[_0x323028(0x156)]<-0x1f6*-0x8+-0x1dc0+0x4*0x385)continue;const _0x5c6f40=_0x1e3a70[0x208d+0x1*0x541+0x2*-0x12e7],_0x3ee4e9=_0x1e3a70[0x1774+0x77f*-0x1+-0x4*0x3fd],_0x243812=_0x1e3a70[_0x323028(0x1d2)](-0x1*-0x20e3+-0x2d1*0x6+-0x7fd*0x2);if(_0x5c6f40==='?'&&_0x3ee4e9==='?'){_0x49b791[_0x323028(0x1c5)]({'path':_0x243812,'state':_0x323028(0x1ab),'change':_0x323028(0x18e)});continue;}_0x5c6f40!=='\x20'&&_0x49b791[_0x323028(0x1c5)]({'path':_0x243812,'state':_0x323028(0x126),'change':gitChange(_0x5c6f40)});_0x3ee4e9!=='\x20'&&_0x49b791[_0x323028(0x1c5)]({'path':_0x243812,'state':_0x323028(0x173),'change':gitChange(_0x3ee4e9)});if(_0x5c6f40==='R'||_0x5c6f40==='C'||_0x3ee4e9==='R'||_0x3ee4e9==='C')_0x3ab96a+=0xad7+0x1*0x2295+0xb*-0x421;}return{'branch':_0x336cc9[_0x323028(0x220)](_0x323028(0x1c6))?currentBranchFromStatusHeader(_0x336cc9):null,'changes':_0x49b791};}export async function listInitializedSubmodulePaths(_0x24f584){const _0x2f0f28=_0x1a5b06,_0xaf9744=await runGit(_0x24f584,[_0x2f0f28(0x176),_0x2f0f28(0x1b5),_0x2f0f28(0x1c8)]);return _0xaf9744[_0x2f0f28(0x153)][_0x2f0f28(0x1b6)](/\r?\n/)[_0x2f0f28(0x144)](_0x3e70aa=>{const _0x304c58=_0x2f0f28;if(_0x3e70aa[_0x304c58(0x156)]<-0xb+0x2*0x1292+0x1f*-0x131)return[];const _0x5023eb=_0x3e70aa[-0x20ab+-0x773+0x9e*0x41];if(_0x5023eb==='-')return[];const _0x5b7002=/^.[0-9a-f]+\s+(.+?)(?:\s+\([^)]*\))?$/[_0x304c58(0x185)](_0x3e70aa),_0x32d799=_0x5b7002?.[-0x24d2+0x2510+-0x3d]?.[_0x304c58(0x141)]('\x5c','/');return _0x32d799===undefined||_0x32d799[_0x304c58(0x156)]===0x20a+0x2b*0x23+-0x7eb*0x1?[]:[_0x32d799];})[_0x2f0f28(0x1a1)]((_0x4cb771,_0x5f4b0d)=>_0x4cb771[_0x2f0f28(0x1ae)](_0x5f4b0d));}export async function resolveGitRepository(_0x1d08ad,_0x4953de){const _0x4c45cf=_0x1a5b06;if(_0x4953de[_0x4c45cf(0x156)]===-0x7a*0x50+-0x1307+0x3927)return realpath(_0x1d08ad);if(_0x4953de[_0x4c45cf(0x20c)]('\x00')||_0x4953de[_0x4c45cf(0x220)]('/')||_0x4953de[_0x4c45cf(0x220)]('\x5c')||_0x4953de[_0x4c45cf(0x1b6)]('/')[_0x4c45cf(0x212)](_0x5fc440=>_0x5fc440[_0x4c45cf(0x156)]===-0x5fc+0x1baa*0x1+-0x15ae*0x1||_0x5fc440==='.'||_0x5fc440==='..'))throw new Error(_0x4c45cf(0x131));const _0x1752e7=await listInitializedSubmodulePaths(_0x1d08ad);if(!_0x1752e7[_0x4c45cf(0x20c)](_0x4953de))throw new Error(_0x4c45cf(0x131));const _0x5ccc52=resolve(await realpath(_0x1d08ad),_0x4953de);try{await readGitSummary(_0x5ccc52);}catch{throw new Error(_0x4c45cf(0x131));}return _0x5ccc52;}export async function listGitHistoryRefs(_0x2ad65d){const _0xa6f070=_0x1a5b06,_0x16866d=await runGit(_0x2ad65d,[_0xa6f070(0x1db),_0xa6f070(0x188),_0xa6f070(0x170),_0xa6f070(0x1cf)]);return _0x16866d[_0xa6f070(0x153)][_0xa6f070(0x1b6)](/\r?\n/)[_0xa6f070(0x144)](_0x2b7402=>{const _0x2dd256=_0xa6f070,[_0x1425d6,_0x5ba4d8,_0x4edba3,_0x16914a,_0x24fb99]=_0x2b7402[_0x2dd256(0x1b6)]('\x09');if(_0x1425d6===undefined||_0x5ba4d8===undefined||_0x4edba3===undefined||_0x24fb99===undefined||_0x24fb99[_0x2dd256(0x156)]>-0x225*-0x11+0x219c+-0x4611||!/^[0-9a-f]{40,64}$/[_0x2dd256(0x16a)](_0x4edba3))return[];const _0x2eb616=_0x1425d6[_0x2dd256(0x220)](_0x2dd256(0x18b))?_0x2dd256(0x149):_0x1425d6[_0x2dd256(0x220)](_0x2dd256(0x22a))?_0x2dd256(0x186):undefined;return _0x2eb616===undefined?[]:[{'name':_0x1425d6,'displayName':_0x5ba4d8,'kind':_0x2eb616,'hash':_0x4edba3,'current':_0x16914a==='*'}];})[_0xa6f070(0x1a1)]((_0x530ad6,_0x478152)=>_0x530ad6[_0xa6f070(0x200)][_0xa6f070(0x1ae)](_0x478152[_0xa6f070(0x200)])||_0x530ad6[_0xa6f070(0x12a)][_0xa6f070(0x1ae)](_0x478152[_0xa6f070(0x12a)]));}function selectedHistoryRefs(_0x2f49da,_0x9ee13c){const _0x1d3322=_0x1a5b06;if(_0x9ee13c===undefined||_0x9ee13c[_0x1d3322(0x156)]===0x1*-0x977+-0x2*-0x67d+0x383*-0x1)return _0x2f49da;const _0x4d282b=[...new Set(_0x9ee13c)],_0x5fbb41=_0x4d282b[_0x1d3322(0x231)](_0xd76e82=>_0x2f49da[_0x1d3322(0x196)](_0x5c5bcd=>_0x5c5bcd[_0x1d3322(0x23b)]===_0xd76e82));if(_0x5fbb41[_0x1d3322(0x212)](_0x41e26f=>_0x41e26f===undefined))throw new Error(_0x1d3322(0x21a));return _0x5fbb41;}function historyCursor(_0x237c1f,_0x1d524b){const _0x5f39f4=_0x1a5b06;return Buffer[_0x5f39f4(0x207)](JSON[_0x5f39f4(0x187)]({'offset':_0x237c1f,'fingerprint':_0x1d524b}))[_0x5f39f4(0x1f4)](_0x5f39f4(0x237));}function parseHistoryCursor(_0x56baa7,_0x16773c){const _0x5720ea=_0x1a5b06;if(_0x56baa7===undefined)return-0x11e6+-0x1*-0x2376+-0x4*0x464;try{const _0xa0b551=JSON[_0x5720ea(0x147)](Buffer[_0x5720ea(0x207)](_0x56baa7,_0x5720ea(0x237))[_0x5720ea(0x1f4)](_0x5720ea(0x1ea)));if(!Number[_0x5720ea(0x213)](_0xa0b551[_0x5720ea(0x15a)])||_0xa0b551[_0x5720ea(0x15a)]<0xf03+0xc5b*-0x2+0x9b3||_0xa0b551[_0x5720ea(0x163)]!==_0x16773c)throw new Error(_0x5720ea(0x132));return _0xa0b551[_0x5720ea(0x15a)];}catch{throw new Error(_0x5720ea(0x19a));}}export async function readGitHistory(_0x3b0c4b,_0x3db192){const _0xb5ebbb=_0x1a5b06,_0x242ca=await listGitHistoryRefs(_0x3b0c4b),_0x47b802=selectedHistoryRefs(_0x242ca,_0x3db192[_0xb5ebbb(0x135)]);if(_0x47b802[_0xb5ebbb(0x156)]===0x2691+0xa1+-0x2732)return{'commits':[],'nextCursor':null};const _0x28ade8=_0x3db192[_0xb5ebbb(0x12d)]??0x33c+-0x501+0x1f7*0x1;if(!Number[_0xb5ebbb(0x213)](_0x28ade8)||_0x28ade8<-0x4*-0x63a+0x2c*-0x39+-0x509*0x3||_0x28ade8>-0xc3d+0x1*0x1+0xca0)throw new Error(_0xb5ebbb(0x17d));const _0x4806db=_0x47b802[_0xb5ebbb(0x231)](_0x27f59b=>_0x27f59b[_0xb5ebbb(0x23b)])[_0xb5ebbb(0x1a1)](),_0x5153fe=createHash(_0xb5ebbb(0x177))[_0xb5ebbb(0x1a7)](_0x47b802[_0xb5ebbb(0x231)](_0xec06ec=>_0xec06ec[_0xb5ebbb(0x23b)]+'\x00'+_0xec06ec[_0xb5ebbb(0x15d)])[_0xb5ebbb(0x1a1)]()[_0xb5ebbb(0x1cd)]('\x00'))[_0xb5ebbb(0x16b)](_0xb5ebbb(0x175)),_0x2caadd=parseHistoryCursor(_0x3db192[_0xb5ebbb(0x209)],_0x5153fe),_0x49f407=await runGit(_0x3b0c4b,[_0xb5ebbb(0x22d),_0xb5ebbb(0x205),_0xb5ebbb(0x1e0),_0xb5ebbb(0x1b0)+_0x2caadd,_0xb5ebbb(0x190)+(_0x28ade8+(0x6*0x261+-0x4e4+-0x961)),'-z',_0xb5ebbb(0x1e6),..._0x4806db,'--']),_0x3689df=new Map();for(const _0x516fd8 of _0x242ca){const _0x23b273=_0x3689df[_0xb5ebbb(0x179)](_0x516fd8[_0xb5ebbb(0x15d)])??[];_0x23b273[_0xb5ebbb(0x1c5)](_0x516fd8[_0xb5ebbb(0x12a)]),_0x3689df[_0xb5ebbb(0x1d8)](_0x516fd8[_0xb5ebbb(0x15d)],_0x23b273);}const _0x2efacc=_0x49f407[_0xb5ebbb(0x153)][_0xb5ebbb(0x1b6)]('\x00'),_0x309501=[];for(let _0x5af624=-0x47*-0x4a+-0x2*0xd72+0x65e;_0x5af624+(-0x132d+0x21fe+0x766*-0x2)<_0x2efacc[_0xb5ebbb(0x156)];_0x5af624+=-0x9d*-0x31+0x124d*0x2+-0x42a1){const [_0x56b939,_0x126f20='',_0x4b0d82='',_0x2860cc='',_0x5df0d7='0',_0x30456d='']=_0x2efacc[_0xb5ebbb(0x1d2)](_0x5af624,_0x5af624+(-0x83f*-0x1+-0x11c9+0x33*0x30));if(_0x56b939===undefined||!/^[0-9a-f]{40,64}$/[_0xb5ebbb(0x16a)](_0x56b939))continue;_0x309501[_0xb5ebbb(0x1c5)]({'hash':_0x56b939,'parents':_0x126f20[_0xb5ebbb(0x156)]===-0x1d3*0xd+0x6b4+0x1103?[]:_0x126f20[_0xb5ebbb(0x1b6)]('\x20'),'authorName':_0x4b0d82,'authorEmail':_0x2860cc,'committedAt':Number(_0x5df0d7)*(0xa*-0x2a6+0x1*0x601+0x1863),'subject':_0x30456d,'refs':_0x3689df[_0xb5ebbb(0x179)](_0x56b939)??[]});}const _0x1d9233=_0x309501[_0xb5ebbb(0x156)]>_0x28ade8;return{'commits':_0x309501[_0xb5ebbb(0x1d2)](0x26da+-0x971+0x1d69*-0x1,_0x28ade8),'nextCursor':_0x1d9233?historyCursor(_0x2caadd+_0x28ade8,_0x5153fe):null};}async function assertHistoryCommitReachable(_0xd7553b,_0x50549a,_0x5d899b){const _0x8b5d1=_0x1a5b06;if(!/^[0-9a-f]{40,64}$/[_0x8b5d1(0x16a)](_0x50549a))throw new Error(_0x8b5d1(0x121));const _0x3cb5c4=selectedHistoryRefs(await listGitHistoryRefs(_0xd7553b),_0x5d899b);for(const _0x505916 of _0x3cb5c4){const _0x1b8c03=await runGitAllowFailure(_0xd7553b,[_0x8b5d1(0x129),_0x8b5d1(0x15e),_0x50549a,_0x505916[_0x8b5d1(0x23b)]]);if(_0x1b8c03[_0x8b5d1(0x1e8)]===-0x2*-0x72a+-0x310+-0xe*0xce)return;}throw new Error(_0x8b5d1(0x121));}export async function readGitHistoryFiles(_0x288007,_0x59cff5,_0x3a24e4){const _0x4f6f02=_0x1a5b06;await assertHistoryCommitReachable(_0x288007,_0x59cff5,_0x3a24e4);const _0x1ee227=await runGit(_0x288007,[_0x4f6f02(0x1eb),_0x4f6f02(0x19d),_0x4f6f02(0x11d),_0x4f6f02(0x224),'-r','-z','-M','-C',_0x4f6f02(0x226),_0x59cff5]),_0x2d250f=_0x1ee227[_0x4f6f02(0x153)][_0x4f6f02(0x1b6)]('\x00'),_0x13dc64=[];for(let _0x598a1d=0xd85*-0x2+0x269e+-0x2*0x5ca;_0x598a1d<_0x2d250f[_0x4f6f02(0x156)];_0x598a1d+=0x1b81+0xb6e+0x97*-0x42){const _0x12fe0f=_0x2d250f[_0x598a1d];if(_0x12fe0f===undefined||_0x12fe0f[_0x4f6f02(0x156)]===0x2056+-0x8ab+-0x53*0x49)continue;const _0x18030f=_0x12fe0f[0xdd9*0x2+0x47*-0x29+-0xc7*0x15]??'M';if(_0x18030f==='R'||_0x18030f==='C'){const _0x1d6fe1=_0x2d250f[_0x598a1d+(0x1ccc+0x3b*0x67+0x4*-0xd22)],_0x5c6c40=_0x2d250f[_0x598a1d+(-0x9c3+0x24*-0x92+0x1e4d*0x1)];if(_0x1d6fe1!==undefined&&_0x5c6c40!==undefined)_0x13dc64[_0x4f6f02(0x1c5)]({'path':_0x5c6c40,'previousPath':_0x1d6fe1,'change':gitChange(_0x18030f)});_0x598a1d+=-0x1*-0x493+-0x329*0x5+-0x2*-0x59e;}else{const _0x563d56=_0x2d250f[_0x598a1d+(0xe*-0x137+0x9b3*0x1+0x750)];if(_0x563d56!==undefined)_0x13dc64[_0x4f6f02(0x1c5)]({'path':_0x563d56,'change':gitChange(_0x18030f)});_0x598a1d+=-0x1*-0x975+0x47f*0x3+-0x16f1;}}return _0x13dc64;}export async function readGitHistoryFileDiff(_0x5548ca,_0x73c0b7,_0x19b03d,_0x2a1965,_0x6c26c1){const _0x20072a=_0x1a5b06;await assertHistoryCommitReachable(_0x5548ca,_0x73c0b7,_0x2a1965);const _0x1c7048=safeGitWorkspacePath(_0x19b03d),_0x59d0aa=_0x6c26c1===undefined?undefined:safeGitWorkspacePath(_0x6c26c1),_0x4b366a=await runGit(_0x5548ca,[_0x20072a(0x211),_0x20072a(0x202),_0x20072a(0x11d),_0x20072a(0x232),_0x20072a(0x22b),_0x73c0b7,'--',_0x20072a(0x214)+_0x1c7048,..._0x59d0aa===undefined||_0x59d0aa===_0x1c7048?[]:[_0x20072a(0x214)+_0x59d0aa]]),_0x26d5da=_0x4b366a[_0x20072a(0x22c)][_0x20072a(0x20c)](-0x17a7+-0x14ea+0x2c91)||_0x4b366a[_0x20072a(0x153)][_0x20072a(0x20c)](_0x20072a(0x230));if(_0x26d5da)return{'binary':!![],'summary':_0x20072a(0x1f5)+createHash(_0x20072a(0x177))[_0x20072a(0x1a7)](_0x4b366a[_0x20072a(0x22c)])[_0x20072a(0x16b)](_0x20072a(0x175))+_0x20072a(0x1bd)+_0x4b366a[_0x20072a(0x22c)][_0x20072a(0x156)],'truncated':_0x4b366a[_0x20072a(0x208)]};return{'binary':![],'text':_0x4b366a[_0x20072a(0x153)],'truncated':_0x4b366a[_0x20072a(0x208)]};}export async function readGitHistoryFileContentRange(_0x2ed670,_0x27b084,_0x1cf026,_0x3aec00,_0x363316,_0x29fd0b){const _0x4bf207=_0x1a5b06;if(!Number[_0x4bf207(0x16f)](_0x3aec00)||_0x3aec00<-0x1448+-0x2040+0x3488||!Number[_0x4bf207(0x16f)](_0x363316)||_0x363316<0x3*-0xc41+0x4*0x799+0x660||_0x363316>(0x106e*0x1+-0x61b+-0xa3f)*(-0x257+0x1555+-0x1*0xefe)*(-0x1*0x643+-0x2242*0x1+-0x3*-0xed7)||_0x3aec00+_0x363316>(0x1cec*0x1+-0x24dd*0x1+-0x805*-0x1)*(-0xab5+-0x3*-0x73d+-0x702)*(0xb3f*0x3+0xa18*0x1+0x21*-0x135))throw new Error(_0x4bf207(0x160));await assertHistoryCommitReachable(_0x2ed670,_0x27b084,_0x29fd0b);const _0x28c5d1=safeGitWorkspacePath(_0x1cf026),_0x1c3e6b=_0x27b084+':'+_0x28c5d1,_0x11679f=await runGit(_0x2ed670,[_0x4bf207(0x233),'-s',_0x1c3e6b]),_0x47dca6=Number(_0x11679f[_0x4bf207(0x153)][_0x4bf207(0x199)]());if(!Number[_0x4bf207(0x16f)](_0x47dca6)||_0x47dca6<-0x253f+-0x1960+0x3e9f||_0x3aec00>_0x47dca6)throw new Error(_0x4bf207(0x160));if(_0x3aec00===_0x47dca6)return{'path':_0x28c5d1,'size':_0x47dca6,'offset':_0x3aec00,'contentBase64':'','nextOffset':null};const _0x44d1f9=await runGitAllowFailure(_0x2ed670,[_0x4bf207(0x233),_0x4bf207(0x1d5),_0x1c3e6b],_0x3aec00+_0x363316);if(_0x44d1f9[_0x4bf207(0x1e8)]!==-0x229a+-0x1d7c+0x277*0x1a)throw new GitCommandError(_0x44d1f9[_0x4bf207(0x1e8)],_0x44d1f9[_0x4bf207(0x169)]);const _0x5e52f3=_0x44d1f9[_0x4bf207(0x22c)][_0x4bf207(0x11b)](_0x3aec00,Math[_0x4bf207(0x1e5)](_0x47dca6,_0x3aec00+_0x363316)),_0x522258=_0x3aec00+_0x5e52f3[_0x4bf207(0x156)];return{'path':_0x28c5d1,'size':_0x47dca6,'offset':_0x3aec00,'contentBase64':_0x5e52f3[_0x4bf207(0x1f4)](_0x4bf207(0x1a4)),'nextOffset':_0x522258<_0x47dca6?_0x522258:null};}export async function readCurrentChanges(_0x51846c){const _0x24e6bd=_0x1a5b06;return(await readCurrentChangesSummary(_0x51846c))[_0x24e6bd(0x17c)];}export async function readCurrentChangeDiff(_0x5a4c0b,_0x19d541){const _0x30509d=_0x1a5b06,_0x597607=safeGitWorkspacePath(_0x19d541);await assertCurrentChangePathAccessible(_0x5a4c0b,_0x597607);const _0x53f8c9=await readCurrentChangeGitDiff(_0x5a4c0b,_0x597607),_0x162b2f=await readWorkingTreeText(_0x5a4c0b,_0x597607),_0x2e536c=_0x53f8c9[_0x30509d(0x22c)][_0x30509d(0x20c)](-0x3*-0xbc3+0x25a5*0x1+-0x48ee)||_0x53f8c9[_0x30509d(0x153)][_0x30509d(0x20c)](_0x30509d(0x230))||_0x162b2f?.[_0x30509d(0x18f)]===!![];if(_0x2e536c)return{'binary':!![],'summary':_0x30509d(0x1f5)+createHash(_0x30509d(0x177))[_0x30509d(0x1a7)](_0x53f8c9[_0x30509d(0x22c)])[_0x30509d(0x16b)](_0x30509d(0x175))+_0x30509d(0x1bd)+_0x53f8c9[_0x30509d(0x22c)][_0x30509d(0x156)],'truncated':_0x53f8c9[_0x30509d(0x208)]||_0x162b2f?.[_0x30509d(0x208)]===!![]};return{'binary':![],'text':_0x53f8c9[_0x30509d(0x153)],'truncated':_0x53f8c9[_0x30509d(0x208)]||_0x162b2f?.[_0x30509d(0x208)]===!![],'afterText':_0x162b2f?.[_0x30509d(0x153)]??'',..._0x162b2f===undefined?{}:{'afterTruncated':_0x162b2f[_0x30509d(0x208)]}};}async function readCurrentChangeGitDiff(_0x21bf4d,_0x4030a8){const _0x5bf950=_0x1a5b06,_0x462bc5=await runGit(_0x21bf4d,[_0x5bf950(0x1b4),_0x5bf950(0x12f),_0x5bf950(0x1bb),'-z','--',_0x5bf950(0x214)+_0x4030a8]);if(_0x462bc5[_0x5bf950(0x153)][_0x5bf950(0x1b6)]('\x00')[_0x5bf950(0x20c)](_0x4030a8)){const _0x2dfef9=await runGitAllowFailure(_0x21bf4d,[_0x5bf950(0x1f9),_0x5bf950(0x152),_0x5bf950(0x232),_0x5bf950(0x22b),'--',_0x5bf950(0x1b7),_0x4030a8]);if(_0x2dfef9[_0x5bf950(0x1e8)]!==0x1d09*-0x1+0x2330+0x1*-0x627&&_0x2dfef9[_0x5bf950(0x1e8)]!==0xd0d*0x1+-0xa*0x20+-0xbcc)throw new GitCommandError(_0x2dfef9[_0x5bf950(0x1e8)],_0x2dfef9[_0x5bf950(0x169)]);return _0x2dfef9;}return runGit(_0x21bf4d,[_0x5bf950(0x1f9),_0x5bf950(0x232),_0x5bf950(0x22b),_0x5bf950(0x21d),'--',_0x5bf950(0x214)+_0x4030a8]);}export async function isWorkspaceChangeVisible(_0x5af238,_0x3d8ec9){const _0x39d715=_0x1a5b06;try{return await assertCurrentChangePathAccessible(_0x5af238,safeGitWorkspacePath(_0x3d8ec9)),!![];}catch(_0xdf923f){if(_0xdf923f instanceof Error&&(_0xdf923f[_0x39d715(0x128)]===_0x39d715(0x1e1)||_0xdf923f[_0x39d715(0x128)]===_0x39d715(0x181)||_0xdf923f[_0x39d715(0x128)]===_0x39d715(0x162)))return![];throw _0xdf923f;}}async function assertCurrentChangePathAccessible(_0x1243a8,_0x49acaf){const _0x33bfbc=_0x1a5b06,_0x204fae=await realpath(_0x1243a8),_0x1d626c=resolve(_0x204fae,_0x49acaf),_0x12ccf9=await lstat(_0x1d626c)[_0x33bfbc(0x1b3)](_0x81ac2e=>{const _0x34c18d=_0x33bfbc;if(_0x81ac2e[_0x34c18d(0x1e8)]===_0x34c18d(0x1d3))return undefined;throw _0x81ac2e;});if(_0x12ccf9===undefined)return;await resolveWorkspaceEntry(_0x204fae,_0x49acaf,![]);}async function readWorkingTreeText(_0x40f1ad,_0x47005b){const _0xe92547=_0x1a5b06,_0x19fe50=await realpath(_0x40f1ad);let _0x1ef202;try{_0x1ef202=await resolveWorkspaceEntry(_0x19fe50,_0x47005b,![]);}catch(_0xc37c0b){if(_0xc37c0b instanceof Error&&_0xc37c0b[_0xe92547(0x128)]===_0xe92547(0x181))return undefined;throw _0xc37c0b;}const _0x14249b=await lstat(_0x1ef202);if(!_0x14249b[_0xe92547(0x1ff)]())return undefined;const _0x26d1f6=await readFile(_0x1ef202);return diffTextFromBuffer(_0x26d1f6,_0x26d1f6[_0xe92547(0x156)]>GIT_OUTPUT_LIMIT);}function diffTextFromBuffer(_0x2dafa9,_0x58f655){const _0x25187b=_0x1a5b06;if(_0x2dafa9[_0x25187b(0x20c)](-0x59*0x3b+-0xbb*-0x2f+-0xdd2)||!isValidUtf8(_0x2dafa9))return{'binary':!![],'truncated':_0x58f655};let _0xaf6d14=Math[_0x25187b(0x1e5)](_0x2dafa9[_0x25187b(0x156)],GIT_OUTPUT_LIMIT);while(_0xaf6d14>-0x45d*0x5+0x1cdf*0x1+0x2b*-0x2a&&_0xaf6d14<_0x2dafa9[_0x25187b(0x156)]&&isUtf8ContinuationByte(_0x2dafa9[_0xaf6d14]))_0xaf6d14-=-0x2176+0x7*0x4e7+-0x2*0x6d;return{'binary':![],'text':_0x2dafa9[_0x25187b(0x11b)](-0x4*-0x67e+0x197b+-0x1*0x3373,_0xaf6d14)[_0x25187b(0x1f4)](_0x25187b(0x1ea)),'truncated':_0x58f655};}export async function restoreCurrentChange(_0x174785,_0x4eb743,_0x445190){const _0x135a1a=_0x1a5b06,_0x1fd152=safeGitWorkspacePath(_0x4eb743),_0x2851a4=_0x135a1a(0x214)+_0x1fd152;if(_0x445190===_0x135a1a(0x1ab)){const _0x735f67=await runGit(_0x174785,[_0x135a1a(0x1b5),_0x135a1a(0x235),'-z',_0x135a1a(0x18c),'--',_0x2851a4]);if(!_0x735f67[_0x135a1a(0x153)][_0x135a1a(0x1b6)]('\x00')[_0x135a1a(0x212)](_0x27be32=>_0x27be32[_0x135a1a(0x220)](_0x135a1a(0x1b8))&&_0x27be32[_0x135a1a(0x1d2)](-0x178b+-0x17*-0x16f+-0x1*0x96b)===_0x1fd152))throw new Error(_0x135a1a(0x1ee));const _0x1b90e5=await realpath(_0x174785),_0x4b31ad=resolve(_0x1b90e5,_0x1fd152),_0x3d525f=await lstat(_0x4b31ad);if(!_0x3d525f[_0x135a1a(0x1ff)]()||_0x3d525f[_0x135a1a(0x1b9)]())throw new Error(_0x135a1a(0x1ee));await unlink(_0x4b31ad);return;}if(_0x445190===_0x135a1a(0x173)){await runGit(_0x174785,[_0x135a1a(0x15c),_0x135a1a(0x238),'--',_0x2851a4]);return;}await runGit(_0x174785,[_0x135a1a(0x15c),_0x135a1a(0x23a),_0x135a1a(0x1e2),_0x135a1a(0x238),'--',_0x2851a4]);}function safeGitWorkspacePath(_0x457165){const _0x40d95a=_0x1a5b06;if(_0x457165[_0x40d95a(0x156)]===-0xbc9+0x25*0x70+-0x467||_0x457165[_0x40d95a(0x20c)]('\x00')||_0x457165[_0x40d95a(0x220)]('/')||_0x457165[_0x40d95a(0x220)]('\x5c'))throw new Error(_0x40d95a(0x1e1));const _0x1b88e8=_0x457165[_0x40d95a(0x141)]('\x5c','/');if(_0x1b88e8[_0x40d95a(0x1b6)]('/')[_0x40d95a(0x212)](_0x213e84=>_0x213e84===''||_0x213e84==='..'||_0x213e84===_0x40d95a(0x19e)))throw new Error(_0x40d95a(0x1e1));return _0x1b88e8;}function gitChange(_0x169d87){const _0x51693e=_0x1a5b06;if(_0x169d87==='A')return _0x51693e(0x18e);if(_0x169d87==='D')return _0x51693e(0x174);if(_0x169d87==='R')return _0x51693e(0x145);if(_0x169d87==='C')return _0x51693e(0x1df);if(_0x169d87==='T')return _0x51693e(0x1ec);return _0x51693e(0x1d4);}export class GitCommandError extends Error{[_0x1a5b06(0x1e8)];[_0x1a5b06(0x169)];constructor(_0x15e383,_0x2fdbfe){const _0x111640=_0x1a5b06;super(_0x111640(0x120)),this[_0x111640(0x1e8)]=_0x15e383,this[_0x111640(0x169)]=_0x2fdbfe;}}async function runGit(_0x26b269,_0x33986d){const _0x573ac8=_0x1a5b06,_0x51b284=await runGitAllowFailure(_0x26b269,_0x33986d);if(_0x51b284[_0x573ac8(0x1e8)]!==-0xf13+0x4*-0x3fa+0x67*0x4d)throw new GitCommandError(_0x51b284[_0x573ac8(0x1e8)],_0x51b284[_0x573ac8(0x169)]);return _0x51b284;}async function runGitAllowFailure(_0x2d1bc9,_0x59991c,_0x204bdf=GIT_OUTPUT_LIMIT){return new Promise((_0x5d9ff6,_0x215bb7)=>{const _0x83538f=_0xc207,_0x313c87=spawn(_0x83538f(0x1ad),[..._0x59991c],{'cwd':_0x2d1bc9,'shell':![],'windowsHide':!![],'stdio':[_0x83538f(0x210),_0x83538f(0x134),_0x83538f(0x134)]}),_0x23f1f5=[],_0x35a3b0=[];let _0x1c1a67=-0x5*-0x556+-0x165e+-0x450,_0x4ba528=![];const _0x324bac=setTimeout(()=>_0x313c87[_0x83538f(0x13b)](_0x83538f(0x1c1)),GIT_TIMEOUT_MS);_0x313c87[_0x83538f(0x11e)]['on'](_0x83538f(0x197),_0x1e0695=>{const _0x191601=_0x83538f,_0x57d43f=Math[_0x191601(0x239)](0x7*0x35e+-0x1*-0x13e4+-0x2b76,_0x204bdf-_0x1c1a67);if(_0x57d43f>-0x978+-0x1dbf+0x2737){const _0x2c41d7=_0x1e0695[_0x191601(0x11b)](-0x1a13+-0x101e*-0x1+0x1*0x9f5,_0x57d43f);_0x23f1f5[_0x191601(0x1c5)](_0x2c41d7),_0x1c1a67+=_0x2c41d7[_0x191601(0x156)];}_0x4ba528||=_0x1e0695[_0x191601(0x156)]>_0x57d43f;}),_0x313c87[_0x83538f(0x169)]['on'](_0x83538f(0x197),_0x566806=>_0x35a3b0[_0x83538f(0x1c5)](_0x566806[_0x83538f(0x11b)](0x894+0x1791+-0x2025,-0x62*-0x3f+0x1ae5+-0x2303))),_0x313c87[_0x83538f(0x1f2)](_0x83538f(0x146),_0x5ff5d6=>{clearTimeout(_0x324bac),_0x215bb7(_0x5ff5d6);}),_0x313c87[_0x83538f(0x1f2)](_0x83538f(0x13d),_0x5d4d16=>{const _0x19176b=_0x83538f;clearTimeout(_0x324bac);const _0x5cd42f=Buffer[_0x19176b(0x234)](_0x23f1f5);_0x5d9ff6({'code':_0x5d4d16??-0x45f*-0x2+-0x120+-0x79d,'output':_0x5cd42f,'text':_0x5cd42f[_0x19176b(0x1f4)](_0x19176b(0x1ea)),'stderr':Buffer[_0x19176b(0x234)](_0x35a3b0)[_0x19176b(0x1f4)](_0x19176b(0x1ea)),'truncated':_0x4ba528});});});}function isGitUnavailable(_0x5e006e){const _0x24f412=_0x1a5b06;return _0x5e006e instanceof Error&&_0x24f412(0x1e8)in _0x5e006e&&_0x5e006e[_0x24f412(0x1e8)]===_0x24f412(0x1d3);}function summarizeText(_0x391440){const _0x49717b=_0x1a5b06;return JSON[_0x49717b(0x187)]({'sha256':createHash(_0x49717b(0x177))[_0x49717b(0x1a7)](_0x391440)[_0x49717b(0x16b)](_0x49717b(0x175)),'bytes':Buffer[_0x49717b(0x216)](_0x391440)});}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
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.20",
29
- "@myagentroam/protocol": "^0.9.20"
28
+ "@myagentroam/agent": "^0.9.22",
29
+ "@myagentroam/protocol": "^0.9.22"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/ws": "^8.18.1"