@vibelet/cli 1.2.168 → 1.2.170

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.
@@ -1 +1 @@
1
- 'use strict';const _0x4cad58=_0xa410;(function(_0x36e8ff,_0x2067e4){const _0x4a00cc=_0xa410,_0x3c0390=_0x36e8ff();while(!![]){try{const _0x325f81=parseInt(_0x4a00cc(0x2da))/0x1+parseInt(_0x4a00cc(0x29a))/0x2+-parseInt(_0x4a00cc(0x1d6))/0x3*(parseInt(_0x4a00cc(0x2bc))/0x4)+-parseInt(_0x4a00cc(0x1dd))/0x5+-parseInt(_0x4a00cc(0x23f))/0x6+parseInt(_0x4a00cc(0x234))/0x7+parseInt(_0x4a00cc(0x214))/0x8*(parseInt(_0x4a00cc(0x224))/0x9);if(_0x325f81===_0x2067e4)break;else _0x3c0390['push'](_0x3c0390['shift']());}catch(_0x21aa15){_0x3c0390['push'](_0x3c0390['shift']());}}}(_0x5455,0x46c8e));var It=require('node:worker_threads'),Hn=require('node:fs/promises'),jn=require('node:os'),zn=require(_0x4cad58(0x287)),R=require(_0x4cad58(0x2a9)),ee=require('node:os'),b=require(_0x4cad58(0x287)),Et=require(_0x4cad58(0x31c)),U=require('node:path'),ur=new Set(['.c','.cc','.cpp','.cs','.css','.dart',_0x4cad58(0x31d),'.ex','.exs',_0x4cad58(0x298),_0x4cad58(0x1eb),'.h','.hpp','.hrl','.java','.js',_0x4cad58(0x316),_0x4cad58(0x1ed),'.kts',_0x4cad58(0x295),'.lua','.m',_0x4cad58(0x1d0),_0x4cad58(0x2d6),'.php','.pl',_0x4cad58(0x29b),_0x4cad58(0x2fa),'.r',_0x4cad58(0x2b3),'.rs','.sass',_0x4cad58(0x2b4),_0x4cad58(0x28e),'.sh',_0x4cad58(0x1c7),'.swift','.ts',_0x4cad58(0x20f),'.vue',_0x4cad58(0x26e),'.yaml','.yml','.zsh']),Mt=_0x4cad58(0x23a),Rt=_0x4cad58(0x291);function Q(_0x2fa71a){const _0x187846=_0x4cad58;return typeof _0x2fa71a==_0x187846(0x201)&&_0x2fa71a['trim']()[_0x187846(0x284)]>0x0?_0x2fa71a['trim']():null;}function te(_0xaabb91){const _0x3c2303=_0x4cad58;return!_0xaabb91||typeof _0xaabb91!='object'||Array[_0x3c2303(0x245)](_0xaabb91)?null:_0xaabb91;}function Oe(_0x293e5a){const _0xd6386b=_0x4cad58;let _0x22f412=_0x293e5a['trim']()['replace'](/[.,!?;:,。!?;:、]+$/u,''),_0x5421bf=_0x22f412[_0xd6386b(0x239)]('#');_0x5421bf>0x0&&(_0x22f412=_0x22f412[_0xd6386b(0x31b)](0x0,_0x5421bf));let _0x211b07=_0x22f412[_0xd6386b(0x2e2)](/^(.*?)(:\d+(?::\d+)?)$/);return _0x211b07?.[0x1]&&(_0x22f412=_0x211b07[0x1]),_0x22f412;}function Ce(_0xef5122,_0x3e2bb2){const _0x910b97=_0x4cad58;let _0x4d8803=Oe(_0xef5122);return _0x4d8803?_0x4d8803['startsWith']('~/')?(0x0,U['resolve'])((0x0,Et['homedir'])(),_0x4d8803[_0x910b97(0x31b)](0x2)):(0x0,U[_0x910b97(0x1b4)])(_0x4d8803)?_0x4d8803:_0x3e2bb2?(0x0,U['resolve'])(_0x3e2bb2,_0x4d8803):_0x4d8803:'';}function fr(_0x5ec7a4){const _0x58154a=_0x4cad58;return ur['has']((0x0,U[_0x58154a(0x254)])(Oe(_0x5ec7a4))[_0x58154a(0x206)]());}function $e(_0x57c978){let _0x11a244=Oe(_0x57c978);return _0x11a244?!fr(_0x11a244):!0x1;}function We(_0x39b09b){const _0x3232fe=_0x4cad58;let _0x2f4076=[...new Set(_0x39b09b['map'](_0x2546e8=>Ce(_0x2546e8))[_0x3232fe(0x1f2)](Boolean))];return _0x2f4076['length']===0x0?'':_0x2f4076['length']===0x1?''+Mt+_0x2f4076[0x0]:''+Rt+_0x2f4076['join']('\x0a');}function Pt(_0x88f327){const _0x20c99e=_0x4cad58;return typeof _0x88f327!=_0x20c99e(0x201)?!0x1:_0x88f327[_0x20c99e(0x25a)](Mt)||_0x88f327[_0x20c99e(0x25a)](Rt);}function pr(_0x55ca2c,_0x4d9b82){let _0x1fd229=_0x55ca2c['matchAll'](/^\*\*\* Add File: (.+)$/gm),_0x30aff9=new Set();for(let _0x37cdb3 of _0x1fd229){let _0x280263=Q(_0x37cdb3[0x1]);if(!_0x280263)continue;let _0x1bff27=Ce(_0x280263,_0x4d9b82);!_0x1bff27||!$e(_0x1bff27)||_0x30aff9['add'](_0x1bff27);}return[..._0x30aff9];}function mr(_0xd23089){const _0x231627=_0x4cad58;let _0x770a24=Q(_0xd23089);return _0x770a24?_0x770a24[_0x231627(0x206)]():'';}function gr(_0x15b934,_0x866514){let _0x551555=Q(_0x15b934?.['file_path'])??Q(_0x15b934?.['path']);if(!_0x551555)return null;let _0x31f9b0=Ce(_0x551555,_0x866514);return _0x31f9b0&&$e(_0x31f9b0)?_0x31f9b0:null;}function _t(_0x2cc265,_0x5627d0,_0x58c9ca){const _0x22aa60=_0x4cad58;return mr(_0x2cc265)!==_0x22aa60(0x246)?null:gr(_0x5627d0,_0x58c9ca);}function hr(_0x197727){const _0x3d7f0f=_0x4cad58;let _0x171774=_0x197727['toLowerCase']();return _0x171774[_0x3d7f0f(0x1df)](_0x3d7f0f(0x312))||_0x171774[_0x3d7f0f(0x1df)](_0x3d7f0f(0x2be))||_0x171774[_0x3d7f0f(0x1df)]('all\x20occurrences\x20were\x20successfully\x20replaced')||_0x171774['includes'](_0x3d7f0f(0x265));}function Sr(_0x395de9){const _0x4d3de0=_0x4cad58;return/^\d+\t/m[_0x4d3de0(0x211)](_0x395de9);}function Ft(_0x3f2419,_0x3958a3){const _0xc1e753=_0x4cad58;let _0x5752ec=typeof _0x3958a3==_0xc1e753(0x201)?_0x3958a3['trim']():'';if(_0x5752ec&&hr(_0x5752ec))return!0x1;let _0x11e591=te(_0x3f2419);if(_0x11e591?.[_0xc1e753(0x1b5)]===_0xc1e753(0x2ca)||_0x11e591?.[_0xc1e753(0x1b5)]===_0xc1e753(0x2f1)||_0x11e591&&(Object[_0xc1e753(0x258)](_0x11e591,'oldString')||Object['hasOwn'](_0x11e591,'structuredPatch')||Object['hasOwn'](_0x11e591,_0xc1e753(0x212))||Object[_0xc1e753(0x258)](_0x11e591,_0xc1e753(0x2ea))))return!0x1;if(typeof te(_0x11e591?.['file'])?.['filePath']==_0xc1e753(0x201)||typeof _0x11e591?.[_0xc1e753(0x1e6)]==_0xc1e753(0x201))return!0x0;if(_0x5752ec){let _0x475f0a=_0x5752ec['toLowerCase']();if(_0x475f0a[_0xc1e753(0x1df)](_0xc1e753(0x301))||_0x475f0a[_0xc1e753(0x1df)]('has\x20been\x20created')||Sr(_0x5752ec))return!0x0;}return!0x1;}function kt(_0x271518,_0x1630be){const _0x4fda0a=_0x4cad58;let _0x3e415f=te(_0x271518);if(!_0x3e415f)return[];let _0x4410ec=new Set();if(_0x3e415f[_0x4fda0a(0x1b5)]==='event_msg'){let _0x43d5ac=te(_0x3e415f['payload']);if(_0x43d5ac?.['type']==='image_generation_end'){let _0x2d15ad=Q(_0x43d5ac[_0x4fda0a(0x1bc)]);if(_0x2d15ad){let _0x1eff62=Ce(_0x2d15ad,_0x1630be?.['cwd']);_0x1eff62&&$e(_0x1eff62)&&_0x4410ec['add'](_0x1eff62);}}}if(_0x1630be?.['includePatchCalls']&&_0x3e415f['type']==='response_item'){let _0x32c2ee=te(_0x3e415f[_0x4fda0a(0x218)]);if(_0x32c2ee?.['type']===_0x4fda0a(0x200)&&_0x32c2ee['name']==='apply_patch'){let _0x23614c=Q(_0x32c2ee[_0x4fda0a(0x247)]);if(_0x23614c){for(let _0x359979 of pr(_0x23614c,_0x1630be?.['cwd']))_0x4410ec['add'](_0x359979);}}}return[..._0x4410ec];}var we=require('node:fs'),Lt=require(_0x4cad58(0x31c)),h=require('node:path'),O=(0x0,h[_0x4cad58(0x25f)])((0x0,Lt['homedir'])(),'.vibelet'),Te=(0x0,h[_0x4cad58(0x25f)])(O,'logs'),ne=(0x0,h['join'])(O,_0x4cad58(0x1d8)),Nt=(0x0,h['join'])(O,'runtime'),Io=(0x0,h['join'])(Nt,'current'),Eo=(0x0,h['join'])(Nt,_0x4cad58(0x31e)),Mo=(0x0,h['join'])(O,'identity.json'),Ro=(0x0,h['join'])(O,_0x4cad58(0x1dc)),Po=(0x0,h['join'])(ne,_0x4cad58(0x29d)),_o=(0x0,h['join'])(ne,'push-subscriptions.json'),Fo=(0x0,h['join'])(ne,'sessions.json'),ko=(0x0,h['join'])(ne,'audit.jsonl'),Lo=(0x0,h['join'])(ne,_0x4cad58(0x1bd)),Dt=(0x0,h[_0x4cad58(0x25f)])(Te,_0x4cad58(0x2ad)),Ut=(0x0,h['join'])(Te,'daemon.stderr.log'),No=(0x0,h[_0x4cad58(0x25f)])(O,'update-check.json'),Do=(0x0,h[_0x4cad58(0x25f)])(O,_0x4cad58(0x223)),Ae={'stdout':!0x1,'stderr':!0x1};function Ot(_0x32614d){const _0x5d0e6c=_0x4cad58;if(!_0x32614d||typeof _0x32614d!=_0x5d0e6c(0x27b))return!0x1;let _0x2b49ca=typeof _0x32614d['code']==_0x5d0e6c(0x201)?_0x32614d['code']:'';return _0x2b49ca===_0x5d0e6c(0x1cd)||_0x2b49ca===_0x5d0e6c(0x2f8);}function yr(_0x4ced2e){const _0x47ddfa=_0x4cad58;return!_0x4ced2e[_0x47ddfa(0x2b9)]&&_0x4ced2e['writable']!==!0x1;}function $t(_0x1edf38,_0x499d23){const _0x564ca8=_0x4cad58;if(Ae[_0x1edf38])return!0x1;let _0x24483c=_0x1edf38===_0x564ca8(0x2c9)?process[_0x564ca8(0x2c9)]:process[_0x564ca8(0x24e)];if(!yr(_0x24483c))return Ae[_0x1edf38]=!0x0,!0x1;try{return _0x24483c[_0x564ca8(0x246)](_0x499d23,_0x77f281=>{Ot(_0x77f281)&&(Ae[_0x1edf38]=!0x0);}),!0x0;}catch(_0x29d287){return Ot(_0x29d287)&&(Ae[_0x1edf38]=!0x0),!0x1;}}function Wt(_0x2d86b2){return $t('stdout',_0x2d86b2);}function Bt(_0x12e89a){const _0x5751ab=_0x4cad58;return $t(_0x5751ab(0x2c9),_0x12e89a);}var Ht={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},xr=process.env.VIBE_LOG_LEVEL||'info';function Cr(){const _0x48f7ec=_0x4cad58;return process.env.VIBE_TEST==='1'||process['argv'][_0x48f7ec(0x1df)](_0x48f7ec(0x20b));}function Tr(){const _0x12ae63=_0x4cad58;try{let {fstatSync:_0x10a2ef}=require(_0x12ae63(0x235));return _0x10a2ef(0x1)['isFile']();}catch{return!0x1;}}var zt=!Cr()&&!Tr();if(zt)try{(0x0,we['mkdirSync'])(Te,{'recursive':!0x0});}catch{}function jt(_0xe3046b,_0xc7ba49,_0x55a7b2){const _0x19d993=_0x4cad58;if(Ht[_0xe3046b]<Ht[xr])return;let _0x322c84={'level':_0xe3046b,'ts':new Date()['toISOString'](),'msg':_0x55a7b2,..._0xc7ba49},_0x3eef58=JSON[_0x19d993(0x2dc)](_0x322c84);if(_0xe3046b===_0x19d993(0x2e1)||_0xe3046b===_0x19d993(0x1c3)?Bt(_0x3eef58+'\x0a'):Wt(_0x3eef58+'\x0a'),zt){let _0x2f0d12=_0xe3046b===_0x19d993(0x2e1)||_0xe3046b===_0x19d993(0x1c3)?Ut:Dt;try{(0x0,we['appendFileSync'])(_0x2f0d12,_0x3eef58+'\x0a');}catch{}}}function qt(_0x37dabf={}){const _0x1eb9aa=_0x4cad58;function _0x2a994f(_0x420b52,_0x35d691,_0x4a75d7){const _0x2699a2=_0xa410;typeof _0x35d691==_0x2699a2(0x201)?jt(_0x420b52,_0x37dabf,_0x35d691):jt(_0x420b52,{..._0x37dabf,..._0x35d691},_0x4a75d7);}return{'debug':(_0x132c9b,_0x429a47)=>_0x2a994f('debug',_0x132c9b,_0x429a47),'info':(_0x5b323a,_0x182602)=>_0x2a994f(_0x1eb9aa(0x1b8),_0x5b323a,_0x182602),'warn':(_0x368042,_0x64ee02)=>_0x2a994f('warn',_0x368042,_0x64ee02),'error':(_0x225543,_0x574084)=>_0x2a994f(_0x1eb9aa(0x2e1),_0x225543,_0x574084),'child':_0x20312b=>qt({..._0x37dabf,..._0x20312b})};}var S=qt({'module':'daemon'});function re(_0x4990cf){let _0x672c5c=new Map();return{'get'(_0x81e8cb){const _0x1f5f29=_0xa410;let _0x5849c2=_0x672c5c['get'](_0x81e8cb);if(_0x5849c2){if(Date[_0x1f5f29(0x285)]()>_0x5849c2[_0x1f5f29(0x202)]){_0x672c5c[_0x1f5f29(0x307)](_0x81e8cb);return;}return _0x5849c2[_0x1f5f29(0x22a)];}},'set'(_0x353228,_0x255f62){_0x672c5c['set'](_0x353228,{'value':_0x255f62,'expiresAt':Date['now']()+_0x4990cf});},'clear'(){_0x672c5c['clear']();}};}var un=require(_0x4cad58(0x2a9)),w=require(_0x4cad58(0x2a9)),se=require('node:os'),C=require('node:path'),v=0x18;async function P(_0x54414e,_0x474eaf,_0x339102){const _0x42d063=_0x4cad58;if(_0x54414e[_0x42d063(0x284)]===0x0)return[];let _0x440ac4=Math[_0x42d063(0x28a)](0x1,Math['min'](_0x474eaf,_0x54414e[_0x42d063(0x284)])),_0x3d5c1d=new Array(_0x54414e[_0x42d063(0x284)]),_0x260b22=0x0;return await Promise[_0x42d063(0x229)](Array[_0x42d063(0x1c9)]({'length':_0x440ac4},async()=>{for(;;){let _0x22e203=_0x260b22;if(_0x260b22+=0x1,_0x22e203>=_0x54414e['length'])return;_0x3d5c1d[_0x22e203]=await _0x339102(_0x54414e[_0x22e203],_0x22e203);}})),_0x3d5c1d;}async function J(_0x3c600e){const _0x333746=_0x4cad58;let _0x423458=(await P(_0x3c600e,v,async _0x4f5f8a=>{const _0x14cfb6=_0xa410;let _0x4ee1f8=await(0x0,w['stat'])(_0x4f5f8a)[_0x14cfb6(0x2ce)](()=>null);return _0x4ee1f8?.[_0x14cfb6(0x2fe)]()?{'path':_0x4f5f8a,'mtimeMs':_0x4ee1f8[_0x14cfb6(0x1de)],'birthtimeMs':_0x4ee1f8[_0x14cfb6(0x1ea)],'size':_0x4ee1f8[_0x14cfb6(0x2f9)]}:null;}))[_0x333746(0x1f2)](_0x3acfcc=>_0x3acfcc!==null);return _0x423458[_0x333746(0x22f)]((_0x4d0787,_0x362ca0)=>_0x362ca0[_0x333746(0x1de)]-_0x4d0787['mtimeMs']),_0x423458;}async function Be(){const _0x427ad5=_0x4cad58;let _0x1978ca=(0x0,C[_0x427ad5(0x25f)])((0x0,se[_0x427ad5(0x28c)])(),'.claude','projects'),_0xfc1ac3=[],_0x369c0e=await(0x0,w['readdir'])(_0x1978ca,{'withFileTypes':!0x0})['catch'](()=>[]);for(let _0x121f70 of _0x369c0e){if(!_0x121f70[_0x427ad5(0x233)]())continue;let _0x3c6ed=(0x0,C['join'])(_0x1978ca,_0x121f70['name']),_0x13e9ed=await(0x0,w['readdir'])(_0x3c6ed)[_0x427ad5(0x2ce)](()=>[]);for(let _0x37cf9e of _0x13e9ed)_0x37cf9e['endsWith'](_0x427ad5(0x23b))&&_0xfc1ac3[_0x427ad5(0x2bd)]((0x0,C['join'])(_0x3c6ed,_0x37cf9e));}return _0xfc1ac3;}async function oe(_0x53d7f5=(0x0,C['join'])((0x0,se['homedir'])(),_0x4cad58(0x21e),'Application\x20Support','Claude',_0x4cad58(0x1e3)),_0x4e072d=0x0){const _0x334804=_0x4cad58;if(_0x4e072d>0x4)return[];let _0x2ededa=await(0x0,w['readdir'])(_0x53d7f5,{'withFileTypes':!0x0})['catch'](()=>[]),_0x451f49=[];for(let _0xb5d182 of _0x2ededa){let _0x3c1d9a=(0x0,C['join'])(_0x53d7f5,_0xb5d182[_0x334804(0x288)]);_0xb5d182['isDirectory']()?_0x451f49['push'](...await oe(_0x3c1d9a,_0x4e072d+0x1)):_0xb5d182[_0x334804(0x2fe)]()&&_0xb5d182['name'][_0x334804(0x21c)]('.json')&&_0x451f49[_0x334804(0x2bd)](_0x3c1d9a);}return _0x451f49;}async function Ar(){const _0x48671d=_0x4cad58;let _0x38d9dc=(0x0,C[_0x48671d(0x25f)])((0x0,se['homedir'])(),'.codex',_0x48671d(0x2f3)),_0x48c50e=(0x0,C[_0x48671d(0x25f)])((0x0,se['homedir'])(),_0x48671d(0x1ce),_0x48671d(0x2f4)),_0x303db1=[],_0x3db77c=await(0x0,w[_0x48671d(0x2ed)])(_0x38d9dc)['catch'](()=>[]);for(let _0x31a4ca of _0x3db77c){let _0x1d2342=(0x0,C['join'])(_0x38d9dc,_0x31a4ca),_0x3f0462=await(0x0,w[_0x48671d(0x2ed)])(_0x1d2342)[_0x48671d(0x2ce)](()=>[]);for(let _0x3f452b of _0x3f0462){let _0x5862aa=(0x0,C['join'])(_0x1d2342,_0x3f452b),_0x2db1f0=await(0x0,w['readdir'])(_0x5862aa)['catch'](()=>[]);for(let _0x1abb94 of _0x2db1f0){let _0x3e7401=(0x0,C[_0x48671d(0x25f)])(_0x5862aa,_0x1abb94),_0x5df3e2=await(0x0,w['readdir'])(_0x3e7401)['catch'](()=>[]);for(let _0x251523 of _0x5df3e2)_0x251523[_0x48671d(0x21c)](_0x48671d(0x23b))&&_0x303db1['push']((0x0,C['join'])(_0x3e7401,_0x251523));}}}let _0x501b98=await(0x0,w[_0x48671d(0x2ed)])(_0x48c50e)['catch'](()=>[]);for(let _0x3201da of _0x501b98)_0x3201da['endsWith'](_0x48671d(0x23b))&&_0x303db1['push']((0x0,C['join'])(_0x48c50e,_0x3201da));return _0x303db1;}async function ie(){let _0x76ad87=await Ar();return J(_0x76ad87);}var k=require(_0x4cad58(0x2a7)),I=require('node:fs'),W=require(_0x4cad58(0x31c)),u=require('node:path'),wr=[_0x4cad58(0x1ac)],vr=0xea60,$=process['platform']==='win32';function F(_0x39274c){const _0x5ddad7=_0x4cad58;return wr['some'](_0x5ace4a=>_0x39274c[_0x5ddad7(0x1df)](_0x5ace4a));}function br(_0x2f8594){const _0x29e753=_0x4cad58;if(!_0x2f8594||!F(_0x2f8594))return _0x2f8594;try{let _0x5403ea=(0x0,u['join'])((0x0,I[_0x29e753(0x2b0)])((0x0,u[_0x29e753(0x2b6)])(_0x2f8594)),(0x0,u[_0x29e753(0x2aa)])(_0x2f8594));if((0x0,I[_0x29e753(0x319)])(_0x5403ea)&&!F(_0x5403ea))return _0x5403ea;}catch{}return _0x2f8594;}function Ir(_0x1a054b){if(!_0x1a054b||!F(_0x1a054b))return _0x1a054b;try{let _0x31e038=(0x0,I['realpathSync'])(_0x1a054b);if(_0x31e038&&!F(_0x31e038))return _0x31e038;}catch{}return _0x1a054b;}function Gt(){const _0x342025=_0x4cad58;return $?[]:[process.env.SHELL,_0x342025(0x29c),_0x342025(0x26a),'/bin/sh']['filter'](_0x4b5f19=>!!_0x4b5f19)[_0x342025(0x1f2)]((_0x50aacd,_0x290f77,_0x1103a3)=>_0x1103a3[_0x342025(0x239)](_0x50aacd)===_0x290f77)[_0x342025(0x1f2)](_0x40e8eb=>(0x0,I['existsSync'])(_0x40e8eb));}function Vt(_0x972cea,_0x20c098){const _0x1c5e30=_0x4cad58;let _0x530892=_0x14c794=>{let _0x528ba2=/^v?(\d+)\.(\d+)\.(\d+)/['exec'](_0x14c794);return _0x528ba2?[Number(_0x528ba2[0x1]),Number(_0x528ba2[0x2]),Number(_0x528ba2[0x3])]:null;},_0x473c7a=_0x530892(_0x972cea),_0x1ee9f9=_0x530892(_0x20c098);if(!_0x473c7a&&!_0x1ee9f9)return _0x20c098[_0x1c5e30(0x248)](_0x972cea);if(!_0x473c7a)return 0x1;if(!_0x1ee9f9)return-0x1;for(let _0x2ef6f2=0x0;_0x2ef6f2<_0x473c7a[_0x1c5e30(0x284)];_0x2ef6f2+=0x1)if(_0x473c7a[_0x2ef6f2]!==_0x1ee9f9[_0x2ef6f2])return _0x1ee9f9[_0x2ef6f2]-_0x473c7a[_0x2ef6f2];return 0x0;}function Qt(){const _0x4b7b14=_0x4cad58;let _0x498784=(0x0,W['homedir'])(),_0x1d8567=(0x0,u[_0x4b7b14(0x25f)])(_0x498784,'.nvm','versions',_0x4b7b14(0x1ff)),_0xef7542=[(0x0,u[_0x4b7b14(0x25f)])(_0x498784,'.nvm','current',_0x4b7b14(0x2bb))];try{let _0x49f000=(0x0,I['readdirSync'])(_0x1d8567,{'withFileTypes':!0x0})[_0x4b7b14(0x1f2)](_0x2e8e2c=>_0x2e8e2c['isDirectory']())['map'](_0x54ab43=>_0x54ab43['name'])[_0x4b7b14(0x22f)](Vt);for(let _0x3b030d of _0x49f000)_0xef7542['push']((0x0,u['join'])(_0x1d8567,_0x3b030d,'bin'));}catch{}return _0xef7542;}function Jt(){const _0x378716=_0x4cad58;let _0x11faa5=(0x0,W[_0x378716(0x28c)])(),_0x3d8185=[process.env.FNM_DIR,(0x0,u['join'])(_0x11faa5,_0x378716(0x2c3),_0x378716(0x1b9),'fnm'),(0x0,u['join'])(_0x11faa5,'Library','Application\x20Support','fnm'),(0x0,u[_0x378716(0x25f)])(_0x11faa5,_0x378716(0x2d4))][_0x378716(0x1f2)](_0x2795f1=>!!_0x2795f1),_0x1fd18e=[],_0x4bac26=new Set();for(let _0x55818e of _0x3d8185){if(_0x4bac26['has'](_0x55818e))continue;_0x4bac26[_0x378716(0x251)](_0x55818e);let _0x262ad0=(0x0,u[_0x378716(0x25f)])(_0x55818e,'node-versions');try{let _0xd7f004=(0x0,I[_0x378716(0x2db)])(_0x262ad0,{'withFileTypes':!0x0})['filter'](_0x481b79=>_0x481b79[_0x378716(0x233)]())['map'](_0x396644=>_0x396644[_0x378716(0x288)])[_0x378716(0x22f)](Vt);for(let _0x5ce93e of _0xd7f004)_0x1fd18e['push']((0x0,u[_0x378716(0x25f)])(_0x262ad0,_0x5ce93e,'installation','bin')),_0x1fd18e[_0x378716(0x2bd)]((0x0,u['join'])(_0x262ad0,_0x5ce93e,'bin'));}catch{}}return _0x1fd18e;}var K=null,He=!0x1,Er=null;function Mr(_0x2bff3f){const _0x14a43a=_0x4cad58;let _0xfd2185={};for(let _0x522335 of _0x2bff3f['split']('\x0a')){let _0x5055fa=_0x522335[_0x14a43a(0x239)]('=');_0x5055fa>0x0&&(_0xfd2185[_0x522335['slice'](0x0,_0x5055fa)]=_0x522335['slice'](_0x5055fa+0x1));}return _0xfd2185;}function Kt(){const _0x5da6e6=_0x4cad58;if(He)return K??{};if(Er)return{};let _0x2d6df5=Gt()[0x0];if(!_0x2d6df5)return He=!0x0,K={},K;try{K=Mr((0x0,k[_0x5da6e6(0x2ab)])(_0x2d6df5,[_0x5da6e6(0x1fa),'env'],{'timeout':0x1388,'encoding':_0x5da6e6(0x2ac),'stdio':['pipe','pipe','pipe']}));}catch{K={};}return He=!0x0,K;}function Rr(_0x1ca9fb=Kt()){const _0xf076f2=_0x4cad58;let _0x2b1074=(0x0,W['homedir'])(),_0x47e9e1=_0x1ca9fb[_0xf076f2(0x303)]||process.env.PNPM_HOME||($?(0x0,u['join'])(_0x2b1074,_0xf076f2(0x1e7)):(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,_0xf076f2(0x21e),_0xf076f2(0x1e7))),_0xbac440=_0x1ca9fb[_0xf076f2(0x2d3)]||process.env.PATH||'',_0x3d2c14=$?[(0x0,u['join'])(_0x2b1074,_0xf076f2(0x30f),'bin'),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,'.local','bin'),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,_0xf076f2(0x1f9),'bin'),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,'.codex',_0xf076f2(0x305),'standalone',_0xf076f2(0x2cf),_0xf076f2(0x2bb)),_0x47e9e1,(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,'AppData','Roaming',_0xf076f2(0x244)),(0x0,u['join'])(_0x2b1074,'AppData',_0xf076f2(0x30d),'Programs',_0xf076f2(0x1ff))]:[_0xf076f2(0x314),_0xf076f2(0x2e0),'/usr/bin',_0xf076f2(0x241),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,_0xf076f2(0x30f),'bin'),(0x0,u['join'])(_0x2b1074,'.local',_0xf076f2(0x2bb)),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,'.claude',_0xf076f2(0x2bb)),(0x0,u[_0xf076f2(0x25f)])(_0x2b1074,'.codex',_0xf076f2(0x305),_0xf076f2(0x1ae),_0xf076f2(0x2cf),'bin'),_0x47e9e1,...Qt(),...Jt()],_0x551e68=_0xbac440['split'](u['delimiter'])['filter'](Boolean)['map'](Ir),_0x38f15a=new Set(_0x551e68);for(let _0x495538 of _0x3d2c14)_0x38f15a['has'](_0x495538)||(_0x551e68[_0xf076f2(0x2bd)](_0x495538),_0x38f15a[_0xf076f2(0x251)](_0x495538));return _0x551e68['join'](u[_0xf076f2(0x222)]);}function je(){const _0x3f1712=_0x4cad58;let _0x3fe1c4=Kt(),_0x173c1a={};for(let [_0x38b8c3,_0x2d44b3]of Object['entries'](process.env))typeof _0x2d44b3==_0x3f1712(0x201)&&(_0x173c1a[_0x38b8c3]=_0x2d44b3);for(let [_0x241c09,_0x3da8bb]of Object[_0x3f1712(0x203)](_0x3fe1c4))typeof _0x3da8bb=='string'&&(_0x173c1a[_0x241c09]=_0x3da8bb);return _0x173c1a[_0x3f1712(0x2d3)]=Rr(_0x3fe1c4),_0x173c1a['HOME']||(_0x173c1a['HOME']=(0x0,W[_0x3f1712(0x28c)])()),delete _0x173c1a['CLAUDE_CODE_ENTRYPOINT'],delete _0x173c1a[_0x3f1712(0x1c6)],_0x173c1a;}function Xt(_0x4fa878){const _0x2911f4=_0x4cad58;if($)try{let _0x1f70ec=(0x0,k[_0x2911f4(0x2ab)])(_0x2911f4(0x25b),[_0x4fa878],{'timeout':0xbb8,'stdio':_0x2911f4(0x2b5),'encoding':'utf-8'})[_0x2911f4(0x1ef)]()['split'](/\r?\n/)['filter'](Boolean);return _0x1f70ec['find'](_0x11b444=>_0x11b444[_0x2911f4(0x21c)]('.exe'))??_0x1f70ec[0x0];}catch{return;}}function ae(_0x50ef0e,_0x9986d4=0xbb8){const _0x2e15f1=_0x4cad58;try{return(0x0,k[_0x2e15f1(0x2ab)])(_0x50ef0e,[_0x2e15f1(0x2d9)],{'timeout':_0x9986d4,'stdio':_0x2e15f1(0x2b5),'encoding':_0x2e15f1(0x2ac),'env':je(),...$?{'shell':!0x0}:{}})['trim']()||null;}catch{return null;}}function Pr(_0x1212ce){const _0x333d55=_0x4cad58;for(let _0x1dafdc of Gt())try{let _0x28ada3=(0x0,k['execFileSync'])(_0x1dafdc,[_0x333d55(0x1fa),'command\x20-v\x20'+_0x1212ce],{'timeout':0x1388,'stdio':['pipe',_0x333d55(0x2b5),'pipe'],'encoding':'utf-8'})['trim']();if(_0x28ada3)return _0x28ada3;}catch{}}function _r(){const _0x3e1527=_0x4cad58;let _0x4e54e5=(0x0,W['homedir'])();return[(0x0,u['join'])(_0x4e54e5,'.local','bin','claude'),(0x0,u['join'])(_0x4e54e5,_0x3e1527(0x1f9),_0x3e1527(0x2bb),'claude'),_0x3e1527(0x2fc),'/opt/homebrew/bin/claude',(0x0,u[_0x3e1527(0x25f)])(_0x4e54e5,'.npm-global','bin','claude')];}function Fr(){const _0x9b200f=_0x4cad58;if($){let _0x16e4c4=Xt(_0x9b200f(0x26c));return _0x16e4c4&&ae(_0x16e4c4)?_0x16e4c4:void 0x0;}for(let _0x41bec6 of _r())if(ae(_0x41bec6))return _0x41bec6;try{let _0x32f88=(0x0,k[_0x9b200f(0x2ab)])('/usr/bin/which',['claude'],{'timeout':0xbb8,'stdio':'pipe','encoding':'utf-8','env':je()})['trim']();if(_0x32f88&&!_0x32f88[_0x9b200f(0x1df)]('cmux')&&ae(_0x32f88))return _0x32f88;}catch{}}function kr(){const _0x3e2a25=_0x4cad58;let _0x2b356f=(0x0,W[_0x3e2a25(0x28c)])(),_0x4dfad7=[process.env.PNPM_HOME,(0x0,u[_0x3e2a25(0x25f)])(_0x2b356f,'Library','pnpm')]['filter'](_0x199611=>!!_0x199611);return[_0x3e2a25(0x1f0),'/opt/homebrew/bin/codex',(0x0,u[_0x3e2a25(0x25f)])(_0x2b356f,'.npm-global','bin',_0x3e2a25(0x21b)),(0x0,u['join'])(_0x2b356f,_0x3e2a25(0x2c3),_0x3e2a25(0x2bb),'codex'),(0x0,u['join'])(_0x2b356f,'.codex','packages',_0x3e2a25(0x1ae),_0x3e2a25(0x2cf),_0x3e2a25(0x2bb),'codex'),...Qt()[_0x3e2a25(0x277)](_0x2d26db=>(0x0,u[_0x3e2a25(0x25f)])(_0x2d26db,'codex')),...Jt()[_0x3e2a25(0x277)](_0x2206d1=>(0x0,u['join'])(_0x2206d1,_0x3e2a25(0x21b))),..._0x4dfad7['map'](_0x5e667e=>(0x0,u[_0x3e2a25(0x25f)])(_0x5e667e,'codex'))];}function Lr(){const _0x28fe7f=_0x4cad58;if($){let _0x1599f8=Xt('codex');return _0x1599f8&&ae(_0x1599f8)?_0x1599f8:void 0x0;}let _0x49ef06=_0x17f9e5=>{let _0x2384cd=br(_0x17f9e5);return ae(_0x2384cd)?_0x2384cd:void 0x0;},_0x12af5d;for(let _0x1271cc of kr()){let _0x12a0d6=_0x49ef06(_0x1271cc);if(_0x12a0d6){if(!F(_0x12a0d6))return _0x12a0d6;_0x12af5d=_0x12a0d6;}}try{let _0x3da902=(0x0,k['execFileSync'])('/usr/bin/which',[_0x28fe7f(0x21b)],{'timeout':0xbb8,'stdio':_0x28fe7f(0x2b5),'encoding':'utf-8','env':je()})['trim'](),_0x1cc475=_0x3da902?_0x49ef06(_0x3da902):void 0x0;if(_0x1cc475){if(!F(_0x1cc475))return _0x1cc475;_0x12af5d=_0x12af5d??_0x1cc475;}}catch{}let _0x3ef220=Pr('codex'),_0x59cb90=_0x3ef220?_0x49ef06(_0x3ef220):void 0x0;if(_0x59cb90){if(!F(_0x59cb90))return _0x59cb90;_0x12af5d=_0x12af5d??_0x59cb90;}return _0x12af5d;}function Yt(_0x2b87e0){const _0x16c436=_0x4cad58;return _0x2b87e0==='claude'?_0x16c436(0x2c4):'CODEX_PATH';}function Nr(_0x1f0da3){const _0x442e3b=_0x4cad58;let _0x56b22f=process.env[Yt(_0x1f0da3)];return _0x56b22f||(_0x1f0da3===_0x442e3b(0x26c)?Fr()??null:Lr()??null);}function Zt(_0xdc7219){let _0x128017=null,_0x18233e=0x0;return()=>{let _0x26bd19=process.env[Yt(_0xdc7219)];if(_0x26bd19)return _0x26bd19;let _0x645b68=Date['now']();return(!_0x128017||_0x645b68-_0x18233e>vr||!(0x0,I['existsSync'])(_0x128017)||F(_0x128017))&&(_0x128017=Nr(_0xdc7219)??_0xdc7219,_0x18233e=_0x645b68),_0x128017;};}var zo=Zt(_0x4cad58(0x26c)),qo=Zt('codex');function E(_0x2d4159){return!_0x2d4159||typeof _0x2d4159!='object'||Array['isArray'](_0x2d4159)?null:_0x2d4159;}function le(_0x150de6){let _0x4e89f3=Number(_0x150de6);return Number['isFinite'](_0x4e89f3)?_0x4e89f3:null;}function Dr(_0x34b793){const _0x5741ff=_0x4cad58;let _0x5521e9=le(_0x34b793);return _0x5521e9===null||_0x5521e9<=0x0?null:Math[_0x5741ff(0x243)](_0x5521e9);}function ce(_0x23124d){const _0x149eac=_0x4cad58;let _0x13e539=E(_0x23124d);if(!_0x13e539)return;let _0x238e05=le(_0x13e539[_0x149eac(0x237)]??_0x13e539[_0x149eac(0x221)]),_0xab8d2c=le(_0x13e539[_0x149eac(0x315)]??_0x13e539['outputTokens']);if(_0x238e05===null||_0xab8d2c===null)return;let _0x129c10=le(_0x13e539[_0x149eac(0x1ec)]??_0x13e539[_0x149eac(0x2b2)]),_0xedde5b=le(_0x13e539['cache_read_input_tokens']??_0x13e539['cacheReadInputTokens']),_0xc68b4=Dr(_0x13e539['modelContextWindow']??_0x13e539[_0x149eac(0x1e4)]??_0x13e539['contextWindowTokens']);return{'inputTokens':_0x238e05,'outputTokens':_0xab8d2c,..._0x129c10!==null?{'cacheCreationInputTokens':_0x129c10}:{},..._0xedde5b!==null?{'cacheReadInputTokens':_0xedde5b}:{},..._0xc68b4?{'contextWindowTokens':_0xc68b4}:{}};}function en(_0x3dd943){let _0x8dcc59=ce(_0x3dd943);if(_0x8dcc59&&!(_0x8dcc59['inputTokens']<=0x0&&_0x8dcc59['outputTokens']<=0x0&&(_0x8dcc59['cacheCreationInputTokens']??0x0)<=0x0&&(_0x8dcc59['cacheReadInputTokens']??0x0)<=0x0&&!_0x8dcc59['contextWindowTokens']))return _0x8dcc59;}function ve(_0x39f38a){const _0x598f61=_0x4cad58;return _0x39f38a[_0x598f61(0x221)]===0x0&&_0x39f38a['outputTokens']===0x0&&(_0x39f38a[_0x598f61(0x2b2)]??0x0)===0x0&&(_0x39f38a[_0x598f61(0x1bf)]??0x0)===0x0&&!_0x39f38a['contextWindowTokens'];}function tn(_0x5c2288){const _0x11a2cf=_0x4cad58;let _0x45ed53=E(_0x5c2288);if(!_0x45ed53)return;if(_0x45ed53[_0x11a2cf(0x1b5)]===_0x11a2cf(0x21a)){let _0x18724d=E(_0x45ed53['message']);if(_0x18724d?.['model']==='<synthetic>')return;let _0x57ddef=ce(_0x18724d?.['usage']??_0x45ed53['usage']);return _0x57ddef&&!ve(_0x57ddef)?_0x57ddef:void 0x0;}let _0xf787cf=E(_0x45ed53[_0x11a2cf(0x263)]),_0x41b060=ce(_0xf787cf?.[_0x11a2cf(0x2ee)]);return _0x41b060&&!ve(_0x41b060)?_0x41b060:void 0x0;}function nn(_0x590e59){const _0x2c25ba=_0x4cad58;let _0x1bf726=E(_0x590e59);if(_0x1bf726?.['type']!=='event_msg')return;let _0x671a01=E(_0x1bf726[_0x2c25ba(0x218)]);if(_0x671a01?.[_0x2c25ba(0x1b5)]!==_0x2c25ba(0x1ba))return;let _0x14e5df=E(_0x671a01['info']),_0x253faf=E(_0x14e5df?.['last_token_usage']);if(_0x253faf)return en({..._0x253faf,'modelContextWindow':_0x14e5df?.['model_context_window']});}function be(_0x1c35e4){const _0x2a4ab9=_0x4cad58;switch(_0x1c35e4){case _0x2a4ab9(0x2b7):return _0x2a4ab9(0x2b7);case'acceptEdits':return'acceptEdits';case'bypassPermissions':return'autoApprove';case'default':return'normal';default:return;}}function T(_0x2147a2){const _0xb51638=_0x4cad58;return typeof _0x2147a2!='string'?void 0x0:_0x2147a2[_0xb51638(0x2f1)](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')[_0xb51638(0x1ef)]()||void 0x0;}function rn(_0x3826ba){const _0x1f9899=_0x4cad58;let _0x3e3a5f=T(_0x3826ba);switch(_0x3e3a5f){case _0x1f9899(0x2e6):case'low':case'medium':case'high':case _0x1f9899(0x279):case _0x1f9899(0x28a):case'ultra':return _0x3e3a5f;default:return;}}function Kr(_0x3b9250){const _0x26e469=_0x4cad58;let _0x849bed=typeof _0x3b9250?.['approval_policy']=='string'?_0x3b9250['approval_policy']:'',_0x438208=_0x3b9250?.[_0x26e469(0x2af)],_0x462c3e=typeof _0x438208?.[_0x26e469(0x1b5)]==_0x26e469(0x201)?_0x438208['type']:'',_0x5e6817=Array['isArray'](_0x438208?.['writable_roots'])?_0x438208['writable_roots']:null;if(_0x849bed===_0x26e469(0x27e)&&_0x462c3e==='danger-full-access')return _0x26e469(0x1aa);if(_0x849bed===_0x26e469(0x1d9)&&_0x462c3e===_0x26e469(0x217))return _0x5e6817?.['length']?'normal':'plan';}function sn(_0x49e1f3){const _0x9ee108=_0x4cad58;return _0x49e1f3?.[_0x9ee108(0x1b5)]===_0x9ee108(0x2f5)?be(_0x49e1f3['permissionMode']):be(_0x49e1f3?.['permissionMode']);}function on(_0x21b06f){const _0xc677f9=_0x4cad58;if(_0x21b06f?.['type']===_0xc677f9(0x253))return Kr(_0x21b06f[_0xc677f9(0x218)]);}function an(_0x1a95fc){return nn(_0x1a95fc);}function ln(_0x45fb1d){return tn(_0x45fb1d);}var Xr=new Set([_0x4cad58(0x250),'Resumed\x20session','Untitled\x20session']),Yr=['<environment_context>','<local-command-caveat>',_0x4cad58(0x1ee),_0x4cad58(0x1fd),_0x4cad58(0x1c8),'<command-message>',_0x4cad58(0x2df),'#\x20AGENTS.md\x20instructions\x20for\x20'];function Zr(_0x970bc9){const _0x992f73=_0x4cad58;return _0x970bc9[_0x992f73(0x2f1)](/\s+/g,'\x20')['trim']();}function _(_0x13774a){const _0x241c59=_0x4cad58;return typeof _0x13774a!=_0x241c59(0x201)?void 0x0:Zr(_0x13774a)||void 0x0;}function ze(_0x1b015b){const _0x40c000=_0x4cad58;let _0x393e16=_(_0x1b015b);return _0x393e16?/^[0-9a-f]{8,}$/i['test'](_0x393e16)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x40c000(0x211)](_0x393e16)||/^agent-[a-z0-9_-]{6,}$/i['test'](_0x393e16):!0x1;}function qe(_0x13e8c4){let _0x1cd8e0=_(_0x13e8c4);return!_0x1cd8e0||Xr['has'](_0x1cd8e0)||ze(_0x1cd8e0);}function es(_0x4e6a72){const _0x502d48=_0x4cad58;for(let _0x4915fa of _0x4e6a72[_0x502d48(0x2f1)](/\r/g,'')[_0x502d48(0x20d)]('\x0a')){let _0x3e4132=_(_0x4915fa);if(_0x3e4132&&!ts(_0x3e4132)&&!ns(_0x3e4132))return _0x3e4132;}}function ts(_0x571282){const _0x47cdc3=_0x4cad58;return Yr[_0x47cdc3(0x268)](_0x570615=>_0x571282['startsWith'](_0x570615));}function ns(_0x299b11){const _0x8f7d24=_0x4cad58;let _0x3687a0=_0x299b11['replace'](/^['"`]+/,'')['replace'](/['"`\\]+$/,'')['trim']();return!!(!_0x3687a0||/^(\/|~\/|\.\/|\.\.\/)/['test'](_0x3687a0)||/^[A-Za-z]:\\/[_0x8f7d24(0x211)](_0x3687a0));}function rs(_0x35f1b3){const _0x35d3de=_0x4cad58;for(let _0x12009f=0x0;_0x12009f<_0x35f1b3['length'];_0x12009f+=0x1){let _0x346c82=_0x35f1b3[_0x12009f];if(_0x346c82==='。'||_0x346c82==='!'||_0x346c82==='?'||_0x346c82===';')return _0x12009f+0x1;if(_0x346c82==='.'||_0x346c82==='!'||_0x346c82==='?'||_0x346c82===';'){let _0x5809b6=_0x35f1b3[_0x12009f+0x1];if(!_0x5809b6||/\s/[_0x35d3de(0x211)](_0x5809b6))return _0x12009f+0x1;}}return-0x1;}function cn(_0x4ffb32,_0x6a416a=0x50){const _0x18850c=_0x4cad58;if(typeof _0x4ffb32!='string')return;let _0x15d48e=es(_0x4ffb32);if(!_0x15d48e)return;let _0x5b325b=rs(_0x15d48e),_0x5be426=(_0x5b325b>0x0?_0x15d48e['slice'](0x0,_0x5b325b):_0x15d48e)[_0x18850c(0x2f1)](/[。!?;.!?;]+$/gu,'')['trim']();if(!(!_0x5be426||ze(_0x5be426)))return _0x5be426[_0x18850c(0x284)]<=_0x6a416a?_0x5be426:_0x5be426[_0x18850c(0x31b)](0x0,Math['max'](0x1,_0x6a416a-0x3))['trimEnd']()+'...';}function L(_0x4d7025,_0x4549fd){for(let _0x36033e of _0x4d7025){let _0x514f21=_(_0x36033e);if(!(!_0x514f21||qe(_0x514f21)))return _0x514f21;}return cn(_0x4549fd);}function _0xa410(_0x33b89d,_0x2d1ec0){_0x33b89d=_0x33b89d-0x1a9;const _0x545503=_0x5455();let _0xa41045=_0x545503[_0x33b89d];if(_0xa410['iYFkfj']===undefined){var _0x2761d2=function(_0x33ed9d){const _0x482267='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2fa71a='',_0xaabb91='';for(let _0x293e5a=0x0,_0x22f412,_0x5421bf,_0x211b07=0x0;_0x5421bf=_0x33ed9d['charAt'](_0x211b07++);~_0x5421bf&&(_0x22f412=_0x293e5a%0x4?_0x22f412*0x40+_0x5421bf:_0x5421bf,_0x293e5a++%0x4)?_0x2fa71a+=String['fromCharCode'](0xff&_0x22f412>>(-0x2*_0x293e5a&0x6)):0x0){_0x5421bf=_0x482267['indexOf'](_0x5421bf);}for(let _0xef5122=0x0,_0x3e2bb2=_0x2fa71a['length'];_0xef5122<_0x3e2bb2;_0xef5122++){_0xaabb91+='%'+('00'+_0x2fa71a['charCodeAt'](_0xef5122)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xaabb91);};_0xa410['sroUpC']=_0x2761d2,_0xa410['Hewmkm']={},_0xa410['iYFkfj']=!![];}const _0xeb437f=_0x545503[0x0],_0x51fdb3=_0x33b89d+_0xeb437f,_0x4774b5=_0xa410['Hewmkm'][_0x51fdb3];return!_0x4774b5?(_0xa41045=_0xa410['sroUpC'](_0xa41045),_0xa410['Hewmkm'][_0x51fdb3]=_0xa41045):_0xa41045=_0x4774b5,_0xa41045;}var dn='<vibelet-resume-after-approval>';function fn(_0x4bd39a){return _0x4bd39a['replace'](/[^a-zA-Z0-9]/g,'-');}async function Ge(){let _0x2d918a=await oe(),_0x16ae00=await P(_0x2d918a,v,async _0x502ffc=>{const _0x4a8628=_0xa410;try{let _0x367804=JSON[_0x4a8628(0x2e9)](await(0x0,un['readFile'])(_0x502ffc,'utf-8')),_0x462609=T(_0x367804[_0x4a8628(0x321)]);if(!_0x462609)return null;let _0x45771b=_(T(_0x367804[_0x4a8628(0x24b)])),_0x413016={'cliSessionId':_0x462609},_0x29800=T(_0x367804['sessionId']),_0x3a6345=T(_0x367804[_0x4a8628(0x1e1)]),_0x2f992b=T(_0x367804[_0x4a8628(0x309)]),_0x43fc85=T(_0x367804[_0x4a8628(0x2c2)]),_0x45c8e6=rn(_0x367804['effort']),_0x62f7c1=be(T(_0x367804['permissionMode']));return _0x29800&&(_0x413016[_0x4a8628(0x1f3)]=_0x29800),_0x3a6345&&(_0x413016[_0x4a8628(0x1e1)]=_0x3a6345),_0x2f992b&&(_0x413016['originCwd']=_0x2f992b),_0x45771b&&(_0x413016[_0x4a8628(0x24b)]=_0x45771b),_0x43fc85&&(_0x413016[_0x4a8628(0x2c2)]=_0x43fc85),_0x45c8e6&&(_0x413016[_0x4a8628(0x21f)]=_0x45c8e6),_0x62f7c1&&(_0x413016[_0x4a8628(0x226)]=_0x62f7c1),typeof _0x367804['isArchived']=='boolean'&&(_0x413016['externalArchived']=_0x367804[_0x4a8628(0x281)]),_0x413016;}catch{return null;}}),_0x311126=new Map();for(let _0x86b5e9 of _0x16ae00)_0x86b5e9&&_0x311126['set'](_0x86b5e9['cliSessionId'],_0x86b5e9);return{'byCliSessionId':_0x311126};}function Ve(_0x735b4e,_0x1854eb){const _0x257a34=_0x4cad58;if(!_0x1854eb)return _0x735b4e;let _0x347dc8=[..._0x735b4e[_0x257a34(0x1db)]??[],..._0x735b4e['title']&&_0x1854eb['title']&&_0x735b4e['title']!==_0x1854eb[_0x257a34(0x24b)]?[_0x735b4e['title']]:[]];return{..._0x735b4e,..._0x1854eb[_0x257a34(0x1e1)]?{'cwd':_0x1854eb[_0x257a34(0x1e1)]}:{},..._0x1854eb[_0x257a34(0x309)]?{'originCwd':_0x1854eb['originCwd']}:{},..._0x1854eb[_0x257a34(0x2c2)]?{'model':_0x1854eb[_0x257a34(0x2c2)]}:{},..._0x1854eb[_0x257a34(0x21f)]?{'effort':_0x1854eb['effort']}:{},..._0x1854eb['title']?{'title':_0x1854eb[_0x257a34(0x24b)]}:{},..._0x347dc8['length']?{'titleAliases':_0x347dc8}:{},..._0x1854eb[_0x257a34(0x226)]?{'approvalMode':_0x1854eb['approvalMode']}:{},'originator':'Claude\x20Desktop',...typeof _0x1854eb['externalArchived']=='boolean'?{'externalArchived':_0x1854eb['externalArchived']}:{}};}var mn=require(_0x4cad58(0x2a7)),gn=require('node:fs/promises'),Ke=require(_0x4cad58(0x31c)),Xe=require('node:path'),hn=require(_0x4cad58(0x2f2)),ss=S['child']({'module':'scanner'}),pn=(0x0,hn['promisify'])(mn[_0x4cad58(0x2f6)]),os=0x7530,X=null,de=null,Qe='';function Je(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function is(_0x5dc946){return _0x5dc946['startsWith']('~/')?(0x0,Xe['join'])((0x0,Ke['homedir'])(),_0x5dc946['slice'](0x2)):_0x5dc946;}function Sn(_0x2f77b7,_0x3d2fbe,_0x483884){const _0x2db2f9=_0x4cad58;if(_0x2f77b7)return _0x2f77b7[_0x2db2f9(0x1fc)][_0x2db2f9(0x1b1)](_0x3d2fbe)??_0x2f77b7['byRolloutPath'][_0x2db2f9(0x1b1)](_0x483884);}function yn(_0x3019b7,_0x1ce296,_0x1c9f63){const _0x4706aa=_0x4cad58;if(_0x3019b7)return _0x3019b7['archivedById'][_0x4706aa(0x1b1)](_0x1ce296)??_0x3019b7['archivedByRolloutPath']['get'](_0x1c9f63);}function Ye(){X=null;}async function Ie(){const _0x599925=_0x4cad58;let _0x1873f1=Date[_0x599925(0x285)](),_0xdafa0f=(0x0,Ke['homedir'])();if(X&&X[_0x599925(0x2a5)]===_0xdafa0f&&_0x1873f1<=X[_0x599925(0x202)])return X['value'];if(de&&Qe===_0xdafa0f)return de;Qe=_0xdafa0f,de=((async()=>{const _0x9676aa=_0x599925;let _0x4e93c3=(0x0,Xe[_0x9676aa(0x25f)])(_0xdafa0f,_0x9676aa(0x1ce),_0x9676aa(0x317));if(!(await(0x0,gn['stat'])(_0x4e93c3)[_0x9676aa(0x2ce)](()=>null))?.['isFile']())return Je();try{let _0x4ec4ab='';try{({stdout:_0x4ec4ab}=await pn('sqlite3',[_0x9676aa(0x1f5),_0x4e93c3,_0x9676aa(0x2d8)],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x4ec4ab}=await pn(_0x9676aa(0x27a),[_0x9676aa(0x1f5),_0x4e93c3,'select\x20id,\x20title,\x20rollout_path\x20from\x20threads\x20where\x20coalesce(title,\x20\x27\x27)\x20<>\x20\x27\x27'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x4acd67=JSON['parse'](_0x4ec4ab||'[]'),_0x35d106=Je();for(let _0x547d2d of _0x4acd67){if(typeof _0x547d2d['id']!='string')continue;let _0x5f37b2=_(typeof _0x547d2d[_0x9676aa(0x24b)]==_0x9676aa(0x201)?_0x547d2d['title']:void 0x0);_0x5f37b2&&_0x35d106[_0x9676aa(0x1fc)]['set'](_0x547d2d['id'],_0x5f37b2);let _0x5c8f9c=typeof _0x547d2d[_0x9676aa(0x213)]=='string'&&_0x547d2d['rollout_path']['trim']()?is(_0x547d2d[_0x9676aa(0x213)]):'';if(_0x5c8f9c&&_0x5f37b2&&_0x35d106['byRolloutPath']['set'](_0x5c8f9c,_0x5f37b2),typeof _0x547d2d[_0x9676aa(0x28b)]=='number'||typeof _0x547d2d['archived']=='boolean'){let _0x3c8055=_0x547d2d[_0x9676aa(0x28b)]===!0x0||_0x547d2d[_0x9676aa(0x28b)]===0x1;_0x35d106['archivedById']['set'](_0x547d2d['id'],_0x3c8055),_0x5c8f9c&&_0x35d106[_0x9676aa(0x306)]['set'](_0x5c8f9c,_0x3c8055);}}return _0x35d106;}catch(_0x500974){return ss[_0x9676aa(0x2d5)]({'error':String(_0x500974)},_0x9676aa(0x1ad)),Je();}})());try{let _0x52b783=await de;return X={'value':_0x52b783,'expiresAt':Date['now']()+os,'home':_0xdafa0f},_0x52b783;}finally{de=null,Qe='';}}var Cn=require(_0x4cad58(0x235)),Y=require(_0x4cad58(0x2a9)),Tn=require(_0x4cad58(0x242));function*ue(_0x3086af,_0xb83782){const _0x3336b6=_0x4cad58;let _0x5c5f30=0x0,_0xf2d2b3=0x0;for(;_0x5c5f30<_0x3086af[_0x3336b6(0x284)]&&_0xf2d2b3<_0xb83782;){let _0x3f91fd=_0x3086af['indexOf']('\x0a',_0x5c5f30);_0x3f91fd===-0x1&&(_0x3f91fd=_0x3086af['length']);let _0x2137ac=_0x3086af['substring'](_0x5c5f30,_0x3f91fd);_0x5c5f30=_0x3f91fd+0x1,!(_0x2137ac['length']===0x0||_0x2137ac['trim']()[_0x3336b6(0x284)]===0x0)&&(yield _0x2137ac,_0xf2d2b3+=0x1);}}var Ze=0x200*0x400,xn=0x100*0x400;async function Ee(_0x131145,_0x1a6d2e){const _0x400771=_0x4cad58;if(_0x1a6d2e<=Ze)return(0x0,Y['readFile'])(_0x131145,'utf-8');let _0x5bd612=await(0x0,Y[_0x400771(0x311)])(_0x131145,'r');try{let _0x1b71a5=Buffer['alloc'](Ze),{bytesRead:_0x1998ad}=await _0x5bd612['read'](_0x1b71a5,0x0,Ze,0x0);return _0x1b71a5['toString'](_0x400771(0x2ac),0x0,_0x1998ad);}finally{await _0x5bd612['close']();}}async function et(_0x1383da,_0x2f690d){const _0x4e55d4=_0x4cad58;if(_0x2f690d<=xn)return(0x0,Y[_0x4e55d4(0x310)])(_0x1383da,'utf-8');let _0x2addf1=await(0x0,Y['open'])(_0x1383da,'r');try{let _0x20c580=Math['max'](0x0,_0x2f690d-xn),_0x4a1f10=Buffer[_0x4e55d4(0x2c1)](_0x2f690d-_0x20c580),{bytesRead:_0x462b4f}=await _0x2addf1['read'](_0x4a1f10,0x0,_0x4a1f10[_0x4e55d4(0x284)],_0x20c580);return _0x4a1f10['toString'](_0x4e55d4(0x2ac),0x0,_0x462b4f);}finally{await _0x2addf1['close']();}}async function B(_0x246238,_0xf923c4){const _0x2af8d6=_0x4cad58;let _0x28ae89=(0x0,Cn['createReadStream'])(_0x246238,{'encoding':_0x2af8d6(0x2ac)}),_0x3d2333=(0x0,Tn['createInterface'])({'input':_0x28ae89,'crlfDelay':0x1/0x0});try{for await(let _0x1c7620 of _0x3d2333){if(!_0x1c7620['trim']())continue;let _0x460296;try{_0x460296=JSON['parse'](_0x1c7620);}catch{continue;}if(_0xf923c4(_0x460296))break;}}finally{_0x3d2333[_0x2af8d6(0x20e)](),_0x28ae89['destroy']();}}function N(_0x19acf7){const _0x4ec54d=_0x4cad58;return typeof _0x19acf7==_0x4ec54d(0x201)?_0x19acf7:Array[_0x4ec54d(0x245)](_0x19acf7)?_0x19acf7[_0x4ec54d(0x277)](_0x5f45cc=>!_0x5f45cc||typeof _0x5f45cc!=_0x4ec54d(0x27b)?'':typeof _0x5f45cc['text']==_0x4ec54d(0x201)?_0x5f45cc['text']:typeof _0x5f45cc[_0x4ec54d(0x1d7)]=='string'?_0x5f45cc['content']:'')['join'](''):'';}function fe(_0x2aa556){const _0x371f8b=_0x4cad58;return _0x2aa556?.['type']==='response_item'&&_0x2aa556['payload']?.[_0x371f8b(0x1b5)]==='message'&&_0x2aa556[_0x371f8b(0x218)]['role']==='user'?N(_0x2aa556[_0x371f8b(0x218)]['content']):_0x2aa556?.['type']==='event_msg'&&_0x2aa556['payload']?.[_0x371f8b(0x1b5)]===_0x371f8b(0x1f7)&&typeof _0x2aa556[_0x371f8b(0x218)][_0x371f8b(0x1d5)]==_0x371f8b(0x201)?_0x2aa556[_0x371f8b(0x218)][_0x371f8b(0x1d5)]:'';}function H(_0x560456){const _0x5e05a0=_0x4cad58;return typeof _0x560456=='string'?_0x560456:Array['isArray'](_0x560456)?_0x560456[_0x5e05a0(0x277)](_0x53a4d1=>!_0x53a4d1||typeof _0x53a4d1!='object'||_0x53a4d1[_0x5e05a0(0x1b5)]!==_0x5e05a0(0x23e)?'':typeof _0x53a4d1[_0x5e05a0(0x23e)]=='string'?_0x53a4d1[_0x5e05a0(0x23e)]:'')[_0x5e05a0(0x25f)](''):'';}var as=/^\[Attached image: ([^\n]+)\]$/gm;function ls(_0x35c4d6){const _0x151564=_0x4cad58;let _0x39c285=[],_0x25c17d=new Set();for(let _0x5216b0 of _0x35c4d6[_0x151564(0x2cc)](as)){let _0x2e5e82=_0x5216b0[0x1];!_0x2e5e82||_0x2e5e82[_0x151564(0x1ef)]()[_0x151564(0x284)]===0x0||_0x25c17d[_0x151564(0x2d7)](_0x2e5e82)||(_0x25c17d[_0x151564(0x251)](_0x2e5e82),_0x39c285[_0x151564(0x2bd)](_0x2e5e82));}return _0x39c285;}function An(_0x23b294){const _0x2b2646=_0x4cad58;if(_0x23b294[_0x2b2646(0x23c)]!==_0x2b2646(0x261))return _0x23b294;let _0x4b8266=[..._0x23b294[_0x2b2646(0x1f6)]??[],...ls(_0x23b294['content'])]['filter']((_0x5a6cf8,_0x525635,_0x406d4c)=>_0x5a6cf8&&_0x406d4c['indexOf'](_0x5a6cf8)===_0x525635);return _0x4b8266['length']?{..._0x23b294,'images':_0x4b8266}:_0x23b294;}var cs=['<task-notification>',_0x4cad58(0x1c0),'<local-command-stdout>',_0x4cad58(0x1fd),'<command-name>','<command-message>','<command-args>',_0x4cad58(0x25e),_0x4cad58(0x300),dn],wn=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ds=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,us=/<environment_context>[\s\S]*<\/environment_context>/,fs=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function ps(_0x4772e0,_0x337bb3){const _0x3909b8=_0x4cad58;if(_0x4772e0?.['isMeta']===!0x0)return!0x0;let _0x59fea1=_0x337bb3['trim']();return _0x59fea1?wn['test'](_0x59fea1)||cs[_0x3909b8(0x268)](_0x2cca52=>_0x59fea1[_0x3909b8(0x25a)](_0x2cca52)):!0x1;}function j(_0x1e5135){const _0x184266=_0x4cad58;if(_0x1e5135?.['type']!=='user'||_0x1e5135[_0x184266(0x1d5)]?.['role']!==_0x184266(0x261))return'';let _0x54a7e9=H(_0x1e5135[_0x184266(0x1d5)]['content']);return ps(_0x1e5135,_0x54a7e9)?'':_0x54a7e9;}function vn(_0x2137c2){const _0x15fd2c=_0x4cad58;return Array['isArray'](_0x2137c2)&&_0x2137c2[_0x15fd2c(0x268)](_0x158693=>_0x158693&&typeof _0x158693==_0x15fd2c(0x27b)&&_0x158693['type']==='tool_result');}function ms(_0x201bb4){const _0x628a80=_0x4cad58;return Array[_0x628a80(0x245)](_0x201bb4)?_0x201bb4['map'](_0x271b87=>{const _0x5cdb88=_0x628a80;if(!_0x271b87||typeof _0x271b87!=_0x5cdb88(0x27b)||_0x271b87['type']!=='tool_result')return'';let _0x508999=_0x271b87['content'];return typeof _0x508999==_0x5cdb88(0x201)?_0x508999:Array['isArray'](_0x508999)?_0x508999[_0x5cdb88(0x277)](_0x2d1b6f=>!_0x2d1b6f||typeof _0x2d1b6f!=_0x5cdb88(0x27b)?'':typeof _0x2d1b6f[_0x5cdb88(0x23e)]=='string'?_0x2d1b6f[_0x5cdb88(0x23e)]:typeof _0x2d1b6f['content']=='string'?_0x2d1b6f['content']:'')['filter'](Boolean)['join']('\x0a'):'';})[_0x628a80(0x1f2)](Boolean)['join']('\x0a'):'';}function gs(_0x1bafc9){const _0x49e236=_0x4cad58;return Array['isArray'](_0x1bafc9)?_0x1bafc9[_0x49e236(0x277)](_0xc7533d=>!_0xc7533d||typeof _0xc7533d!='object'?'':typeof _0xc7533d[_0x49e236(0x23e)]=='string'?_0xc7533d[_0x49e236(0x23e)]:typeof _0xc7533d['content']==_0x49e236(0x201)?_0xc7533d[_0x49e236(0x1d7)]:'')[_0x49e236(0x1f2)](Boolean)[_0x49e236(0x25f)]('\x0a'):'';}function tt(_0x42d42a){const _0x24c680=_0x4cad58;if(typeof _0x42d42a=='string')return _0x42d42a;let _0x34c130=gs(_0x42d42a);return _0x34c130||(Array['isArray'](_0x42d42a)&&_0x42d42a['length']>0x0&&_0x42d42a[_0x24c680(0x27f)](_0x5ca805=>_0x5ca805&&typeof _0x5ca805==_0x24c680(0x27b)&&_0x5ca805[_0x24c680(0x1b5)]===_0x24c680(0x1af))?'':JSON[_0x24c680(0x2dc)](_0x42d42a));}var hs=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function bn(_0x3bdd2e){const _0x213c3a=_0x4cad58;let _0x2d6e0d=_0x3bdd2e['match'](hs)?.[0x1];return _0x2d6e0d&&_0x2d6e0d[_0x213c3a(0x1ef)]()[_0x213c3a(0x284)]>0x0?_0x2d6e0d:null;}function In(_0x14f7b7,_0x2f7825){const _0x557b07=_0x4cad58;return{'role':'assistant','type':_0x557b07(0x1b8),'historyKey':_0x557b07(0x1e2)+_0x14f7b7,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0x14f7b7+_0x557b07(0x20c),..._0x2f7825?{'timestamp':_0x2f7825}:{}};}function En(_0x102381){const _0x112638=_0x4cad58;let _0x2d7fd9=ms(_0x102381?.[_0x112638(0x1d5)]?.[_0x112638(0x1d7)]);if(/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x2d7fd9))return!0x0;let _0x482e3d=_0x102381?.[_0x112638(0x263)];return!!(_0x482e3d&&typeof _0x482e3d==_0x112638(0x27b)&&_0x482e3d['interrupted']===!0x0||typeof _0x482e3d==_0x112638(0x201)&&/\[Request interrupted by user(?: for tool use)?\]/i[_0x112638(0x211)](_0x482e3d));}function z(_0x194da6){const _0x50ef92=_0x4cad58;let _0x37396c=_0x194da6[_0x50ef92(0x1ef)]();return _0x37396c?_0x37396c[_0x50ef92(0x25a)]('<environment_context>')||wn[_0x50ef92(0x211)](_0x37396c)?!0x0:us['test'](_0x37396c)&&(fs['test'](_0x37396c)||ds[_0x50ef92(0x211)](_0x37396c)):!0x1;}function Mn(_0x23309b){const _0x234c46=_0x4cad58;if(typeof _0x23309b?.['timestamp']!=_0x234c46(0x201))return null;let _0xdf2507=Date[_0x234c46(0x2e9)](_0x23309b['timestamp']);return Number['isFinite'](_0xdf2507)?_0xdf2507:null;}function nt(_0x5a0d62){const _0x5d0030=_0x4cad58;let _0x250c0c=Mn(_0x5a0d62);return _0x250c0c==null?void 0x0:new Date(_0x250c0c)[_0x5d0030(0x24d)]();}function q(_0x42961d,_0x57de71){let _0x411066=nt(_0x57de71);return _0x411066?{..._0x42961d,'timestamp':_0x411066}:_0x42961d;}var Rn=S['child']({'module':_0x4cad58(0x318)});function Ss(_0x4b5149){const _0x2eea26=_0x4cad58;if(_0x4b5149?.['type']==='user'&&_0x4b5149['message']?.['role']===_0x2eea26(0x261)){if(_0x4b5149['isMeta']===!0x0)return null;if(vn(_0x4b5149['message']['content']))return{'kind':'toolResult',...En(_0x4b5149)?{'interrupted':!0x0}:{}};let _0xaecaeb=j(_0x4b5149);return ys(_0xaecaeb)?null:_0xaecaeb?{'kind':_0x2eea26(0x22e)}:null;}if(_0x4b5149?.[_0x2eea26(0x1b5)]==='assistant'&&_0x4b5149[_0x2eea26(0x1d5)]?.['role']==='assistant'){let _0x43205e=H(_0x4b5149['message'][_0x2eea26(0x1d7)]),_0x46d6fa=_0x4b5149[_0x2eea26(0x1d5)]?.[_0x2eea26(0x323)];return{'kind':'assistant','stopReason':typeof _0x46d6fa=='string'?_0x46d6fa:_0x46d6fa??null,..._0x43205e?{'text':_0x43205e}:{}};}return _0x4b5149?.['type']==='system'&&_0x4b5149[_0x2eea26(0x24a)]==='stop_hook_summary'?{'kind':_0x2eea26(0x2e4)}:null;}function ys(_0x56ddfb){const _0x58f62d=_0x4cad58;return _0x56ddfb?_0x56ddfb['includes'](_0x58f62d(0x1c0))||_0x56ddfb[_0x58f62d(0x1df)]('<command-name>'):!0x1;}function xs(_0x4ec981){const _0x44c853=_0x4cad58;if(!_0x4ec981)return{};if(_0x4ec981[_0x44c853(0x27c)]===_0x44c853(0x2e4))return{};if(_0x4ec981[_0x44c853(0x27c)]==='assistant'){let _0x4a658f=_0x4ec981['stopReason']==null||_0x4ec981['stopReason']===_0x44c853(0x302);return{..._0x4a658f?{'isResponding':!0x0}:{},..._0x4a658f&&_0x4ec981['text']?{'partialReplyText':_0x4ec981['text']}:{}};}return _0x4ec981['kind']==='toolResult'&&_0x4ec981['interrupted']?{}:{'isResponding':!0x0};}function Cs(_0x2cc469){const _0x3bbb2c=_0x4cad58;let _0x225f03=_0x2cc469?.[_0x3bbb2c(0x1d5)]??_0x2cc469?.[_0x3bbb2c(0x23e)]??_0x2cc469?.['delta']??_0x2cc469?.['content'];return typeof _0x225f03==_0x3bbb2c(0x201)&&_0x225f03['trim']()?_0x225f03:void 0x0;}function Ts(_0x26f7bb){const _0x36ef34=_0x4cad58;if(_0x26f7bb?.['type']===_0x36ef34(0x1e5)){let _0x824a91=_0x26f7bb['payload'];switch(_0x824a91?.['type']){case _0x36ef34(0x273):return{'kind':'turnStarted'};case _0x36ef34(0x227):case'turn_aborted':case'thread_rolled_back':return{'kind':_0x36ef34(0x1e8)};case'user_message':{let _0x2ffd0c=fe(_0x26f7bb);return _0x2ffd0c&&!z(_0x2ffd0c)?{'kind':'userPrompt'}:null;}case'agent_message':case _0x36ef34(0x292):{let _0x69fd9=Cs(_0x824a91);return _0x69fd9?{'kind':'assistant','text':_0x69fd9}:{'kind':'assistant'};}case _0x36ef34(0x2b1):case'patch_apply_end':case _0x36ef34(0x272):return{'kind':_0x36ef34(0x1e9)};default:return null;}}if(_0x26f7bb?.[_0x36ef34(0x1b5)]!=='response_item')return null;let _0x50b314=_0x26f7bb['payload'];switch(_0x50b314?.['type']){case _0x36ef34(0x1d5):{if(_0x50b314['role']===_0x36ef34(0x261)){let _0xb8685c=N(_0x50b314['content']);return _0xb8685c&&!z(_0xb8685c)?{'kind':'userPrompt'}:null;}if(_0x50b314['role']==='assistant'){let _0x4a039a=N(_0x50b314[_0x36ef34(0x1d7)]);return _0x4a039a?{'kind':_0x36ef34(0x21a),'text':_0x4a039a}:{'kind':_0x36ef34(0x21a)};}return null;}case'reasoning':case'function_call':case _0x36ef34(0x2c8):case _0x36ef34(0x259):case _0x36ef34(0x270):case _0x36ef34(0x308):case'tool_search_call':case'tool_search_output':return{'kind':_0x36ef34(0x1e9)};default:return null;}}async function Pn(_0x244dca){const _0x323068=_0x4cad58;let _0x1e3814=null;try{await B(_0x244dca,_0x2f0cb4=>{let _0x369454=Ss(_0x2f0cb4);_0x369454&&(_0x1e3814=_0x369454);});}catch(_0x3eb73a){return _0x3eb73a[_0x323068(0x264)]!==_0x323068(0x271)&&Rn[_0x323068(0x1c3)]({'filePath':_0x244dca,'error':String(_0x3eb73a)},_0x323068(0x231)),{};}return xs(_0x1e3814);}async function _n(_0x1e98e9){const _0x39f64e=_0x4cad58;let _0x136c62=!0x1,_0x1127b1=!0x1,_0x33cf26;try{await B(_0x1e98e9,_0x2d0d03=>{const _0xee226d=_0xa410;let _0x3f4e85=Ts(_0x2d0d03);if(_0x3f4e85){if(_0x3f4e85[_0xee226d(0x27c)]==='turnStarted'){_0x136c62=!0x0,_0x1127b1=!0x0,_0x33cf26=void 0x0;return;}if(_0x3f4e85[_0xee226d(0x27c)]===_0xee226d(0x1e8)){_0x136c62=!0x1,_0x1127b1=!0x1,_0x33cf26=void 0x0;return;}_0x136c62&&(_0x1127b1=!0x0,_0x3f4e85[_0xee226d(0x27c)]===_0xee226d(0x21a)&&_0x3f4e85['text']&&(_0x33cf26=_0x3f4e85[_0xee226d(0x23e)]));}});}catch(_0x77ef8d){return _0x77ef8d[_0x39f64e(0x264)]!==_0x39f64e(0x271)&&Rn[_0x39f64e(0x1c3)]({'filePath':_0x1e98e9,'error':String(_0x77ef8d)},'failed\x20to\x20read\x20codex\x20session\x20runtime\x20hints'),{};}return!_0x136c62||!_0x1127b1?{}:{'isResponding':!0x0,..._0x33cf26?{'partialReplyText':_0x33cf26}:{}};}var rt=require('node:path');function st(_0x280b35){const _0x17533b=_0x4cad58;return(0x0,rt[_0x17533b(0x2aa)])(_0x280b35,'.jsonl')||null;}function ot(_0x292d4f){const _0x4db68e=_0x4cad58;return(0x0,rt[_0x4db68e(0x2aa)])(_0x292d4f,'.jsonl')['match'](/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[0x1]??null;}function M(_0x27eb50,_0xc7d63b){return _0x27eb50==='claude'?st(_0xc7d63b):ot(_0xc7d63b);}var _a=S['child']({'module':_0x4cad58(0x318)}),G=new Map(),Fn=0x2710;function Me(_0x359115,_0x584643){return _0x359115+':'+_0x584643;}function As(_0x14468e,_0x4147e7){const _0x2cedcb=_0x4cad58;return _0x14468e['size']===_0x4147e7['size']&&_0x14468e['mtimeMs']===_0x4147e7[_0x2cedcb(0x1de)]&&_0x14468e['birthtimeMs']===_0x4147e7[_0x2cedcb(0x1ea)];}function it(_0x127dc3,_0x54190c,_0x3fb428){const _0x428a82=_0x4cad58;let _0x23689f=Me(_0x54190c,_0x127dc3),_0x4a1ac6=G[_0x428a82(0x1b1)](_0x23689f);if(_0x4a1ac6){if(!As(_0x4a1ac6,_0x3fb428)){G[_0x428a82(0x307)](_0x23689f);return;}return _0x4a1ac6['lastUsedAt']=Date['now'](),_0x4a1ac6[_0x428a82(0x22a)];}}function ws(){const _0x18871b=_0x4cad58;if(G['size']<=Fn)return;let _0x3613a6=[...G['entries']()][_0x18871b(0x22f)]((_0x46fdc2,_0x9a677a)=>_0x46fdc2[0x1]['lastUsedAt']-_0x9a677a[0x1][_0x18871b(0x2e3)]),_0x5b3e8e=G['size']-Fn;for(let _0x25594d=0x0;_0x25594d<_0x5b3e8e;_0x25594d+=0x1){let _0x4ad546=_0x3613a6[_0x25594d]?.[0x0];_0x4ad546&&G['delete'](_0x4ad546);}}function at(_0x366280,_0x143c40,_0x2834c8,_0x34071f){const _0x214e52=_0x4cad58;G[_0x214e52(0x228)](Me(_0x143c40,_0x366280),{'size':_0x2834c8[_0x214e52(0x2f9)],'mtimeMs':_0x2834c8['mtimeMs'],'birthtimeMs':_0x2834c8['birthtimeMs'],'value':_0x34071f,'lastUsedAt':Date[_0x214e52(0x285)]()}),ws();}async function lt(_0x29a393,_0x5a1fc3){const _0x3a42af=_0x4cad58;let _0x30797a,_0x441824,_0x4d0310=await et(_0x29a393,_0x5a1fc3);for(let _0x7ebc68 of _0x4d0310[_0x3a42af(0x20d)]('\x0a')){if(!_0x7ebc68[_0x3a42af(0x1ef)]())continue;let _0x36c26d;try{_0x36c26d=JSON[_0x3a42af(0x2e9)](_0x7ebc68);}catch{continue;}let _0x4706f3=on(_0x36c26d);_0x4706f3&&(_0x30797a=_0x4706f3);let _0x5e4e7a=an(_0x36c26d);_0x5e4e7a&&(_0x441824=_0x5e4e7a);}return{'approvalMode':_0x30797a,'lastUsage':_0x441824};}async function ct(_0x337e77,_0x2dd26f){let _0x3c5319,_0xea4777,_0xd36913=await et(_0x337e77,_0x2dd26f);for(let _0x3e5e38 of _0xd36913['split']('\x0a')){if(!_0x3e5e38['trim']())continue;let _0x4198d9;try{_0x4198d9=JSON['parse'](_0x3e5e38);}catch{continue;}let _0x5aa367=sn(_0x4198d9);_0x5aa367&&(_0x3c5319=_0x5aa367);let _0x66c37e=ln(_0x4198d9);_0x66c37e&&(_0xea4777=_0x66c37e);}return{'approvalMode':_0x3c5319,'lastUsage':_0xea4777};}var $a=S['child']({'module':'inventory'});function kn(_0x4288b8='high',_0x261a62='resumeSession'){return{'state':'idle','confidence':_0x4288b8,'resumeMode':_0x261a62};}var ft=S['child']({'module':'scanner'}),Pe=0x7530,sl=re(Pe),ol=re(Pe),il=re(Pe),Re=re(Pe),dt=new Map(),ut=new Map();function Dn(_0x1fa111){const _0x53badb=_0x4cad58;let _0x1ddfc4='codex-latest:'+(0x0,ee['homedir'])(),_0x4c3379=new Map();for(let _0x953efd of _0x1fa111)_0x4c3379[_0x53badb(0x2d7)](_0x953efd['cwd'])||_0x4c3379['set'](_0x953efd[_0x53badb(0x1e1)],_0x953efd['match']);Re[_0x53badb(0x228)](_0x1ddfc4,_0x4c3379);}function vs(_0x40a16e){const _0x3dcdbe=_0x4cad58;let _0x29b7b3=(0x0,b[_0x3dcdbe(0x2aa)])(_0x40a16e['path'])[_0x3dcdbe(0x2e2)](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x29b7b3){let _0x27dec3=Date['parse'](_0x29b7b3[0x1]+':'+_0x29b7b3[0x2]+':'+_0x29b7b3[0x3]);if(Number[_0x3dcdbe(0x2cb)](_0x27dec3))return _0x27dec3;}return _0x40a16e[_0x3dcdbe(0x1ea)];}function Ln(_0x445a98){return _0x445a98?.['trim']()||void 0x0;}function bs(_0x23dbed){const _0x385cfe=_0x4cad58;if(_0x23dbed[_0x385cfe(0x1b5)]!==_0x385cfe(0x240))return null;let _0x457d02=_0x23dbed['payload']?.['source'],_0x11475b=typeof _0x457d02=='object'&&_0x457d02!==null&&Object['hasOwn'](_0x457d02,'subagent'),_0x4ce08a=Ln(_0x23dbed[_0x385cfe(0x218)]?.[_0x385cfe(0x1ca)])||(_0x11475b?Ln(_0x457d02['subagent']?.[_0x385cfe(0x2e7)]?.[_0x385cfe(0x1ca)]):void 0x0);return!_0x4ce08a&&!_0x11475b?null:_0x4ce08a?{'parentSessionId':_0x4ce08a}:{};}function Un(_0x4b6c29){const _0x28a674=_0x4cad58;for(let _0x217c03 of ue(_0x4b6c29,0x60)){let _0x5efd06;try{_0x5efd06=JSON[_0x28a674(0x2e9)](_0x217c03);}catch{continue;}if(_0x5efd06['type']===_0x28a674(0x240))return bs(_0x5efd06);}return null;}async function Is(_0x4f6bf8,_0x3d61cb){const _0x278526=_0x4cad58;if(_0x3d61cb){let _0xe09565=it(_0x4f6bf8,_0x278526(0x21b),_0x3d61cb);if(_0xe09565!==void 0x0)return _0xe09565?{'cwd':_0xe09565['cwd'],'sessionId':_0xe09565[_0x278526(0x216)]}:null;}let _0x2c4833=_0x3d61cb??await(0x0,R['stat'])(_0x4f6bf8)[_0x278526(0x2ce)](()=>null);if(!_0x2c4833)return null;try{let _0x43426a=await Ee(_0x4f6bf8,_0x2c4833['size']);if(Un(_0x43426a))return null;let _0x1ebd4f='',_0x2ca9dd='';for(let _0x223fd2 of ue(_0x43426a,0x60)){let _0x285a44;try{_0x285a44=JSON['parse'](_0x223fd2);}catch{continue;}if(_0x1ebd4f||(_0x1ebd4f=_0x285a44['payload']?.['cwd']??_0x285a44[_0x278526(0x1e1)]??''),_0x2ca9dd||(_0x2ca9dd=_0x285a44['payload']?.['id']??_0x285a44['id']??''),_0x1ebd4f&&_0x2ca9dd)break;}return _0x1ebd4f?{'cwd':_0x1ebd4f,'sessionId':_0x2ca9dd||M('codex',_0x4f6bf8)||(0x0,b[_0x278526(0x2aa)])(_0x4f6bf8,_0x278526(0x23b))}:null;}catch{return null;}}function On(_0x4a1fde,_0x1b3f51='scanner'){const _0x10d7b5=_0x4cad58;return{'sessionId':_0x4a1fde['sessionId'],'agent':_0x4a1fde[_0x10d7b5(0x20a)],'cwd':_0x4a1fde[_0x10d7b5(0x1e1)],..._0x4a1fde[_0x10d7b5(0x309)]?{'originCwd':_0x4a1fde[_0x10d7b5(0x309)]}:{},..._0x4a1fde['model']?{'model':_0x4a1fde['model']}:{},..._0x4a1fde['effort']?{'effort':_0x4a1fde[_0x10d7b5(0x21f)]}:{},'title':_0x4a1fde[_0x10d7b5(0x24b)],..._0x4a1fde['titleAliases']?.['length']?{'titleAliases':_0x4a1fde['titleAliases']}:{},..._0x4a1fde['customTitle']?{'customTitle':_0x4a1fde[_0x10d7b5(0x1b7)]}:{},..._0x4a1fde[_0x10d7b5(0x252)]?{'originator':_0x4a1fde['originator']}:{},...typeof _0x4a1fde['externalArchived']=='boolean'?{'externalArchived':_0x4a1fde['externalArchived']}:{},'observedApprovalMode':_0x4a1fde['approvalMode'],'lastUsage':_0x4a1fde['lastUsage'],'createdAt':_0x4a1fde['createdAt'],'lastActivityAt':_0x4a1fde[_0x10d7b5(0x313)],'sources':[_0x1b3f51],'runtime':kn()};}async function Nn(_0x2ad067,_0xec97f2){const _0x359d9=_0x4cad58;let _0x5a77a2=await Ee(_0x2ad067,_0xec97f2),_0x18e597=ue(_0x5a77a2,0x40),_0x8093e='',_0x45fa80='',_0x3afa2d,_0x31c6ee,_0x39f916;for(let _0x4ebd8c of _0x18e597){let _0x24f036;try{_0x24f036=JSON['parse'](_0x4ebd8c);}catch{continue;}if(!_0x8093e&&typeof _0x24f036[_0x359d9(0x1e1)]==_0x359d9(0x201)&&(_0x8093e=_0x24f036[_0x359d9(0x1e1)]),!_0x45fa80&&typeof _0x24f036['sessionId']==_0x359d9(0x201)&&(_0x45fa80=_0x24f036['sessionId']),_0x3afa2d||(_0x3afa2d=L([_0x24f036['customTitle'],_0x24f036['summary']])),!_0x39f916){let _0x306a0c=j(_0x24f036),_0x25b99a=L([],_0x306a0c);_0x25b99a&&(_0x31c6ee=_0x306a0c,_0x39f916=_0x25b99a);}if(_0x8093e&&(_0x3afa2d||_0x39f916))break;}if(!_0x8093e)return null;let _0x27cede=await ct(_0x2ad067,_0xec97f2);return{'sessionId':_0x45fa80||M(_0x359d9(0x26c),_0x2ad067)||(0x0,b['basename'])(_0x2ad067,_0x359d9(0x23b)),'cwd':_0x8093e,'title':_0x3afa2d??_0x39f916??L([],_0x31c6ee),'approvalMode':_0x27cede['approvalMode'],'lastUsage':_0x27cede['lastUsage']};}async function Es(_0x4d7d9c,_0x5b2802){const _0x28799d=_0x4cad58;let _0x1341a1=await Ee(_0x4d7d9c,_0x5b2802);if(Un(_0x1341a1))return null;let _0x54a72f=ue(_0x1341a1,0x60),_0x1b16f8='',_0x30c79a='',_0x301b38,_0x2c889f,_0x202994,_0xe8b21d;for(let _0x434126 of _0x54a72f){let _0x56ff6b;try{_0x56ff6b=JSON['parse'](_0x434126);}catch{continue;}if(_0x1b16f8||(_0x1b16f8=_0x56ff6b[_0x28799d(0x218)]?.[_0x28799d(0x1e1)]??_0x56ff6b['cwd']??''),_0x30c79a||(_0x30c79a=_0x56ff6b['payload']?.['id']??_0x56ff6b['id']??''),!_0xe8b21d&&typeof _0x56ff6b['payload']?.[_0x28799d(0x252)]==_0x28799d(0x201)&&(_0xe8b21d=_0x56ff6b['payload'][_0x28799d(0x252)]),_0x301b38||(_0x301b38=L([_0x56ff6b['payload']?.[_0x28799d(0x24b)],_0x56ff6b['title']])),!_0x202994){let _0x585e2a=fe(_0x56ff6b),_0x1387bc=_0x585e2a&&!z(_0x585e2a)?L([],_0x585e2a):void 0x0;_0x1387bc&&(_0x2c889f=_0x585e2a,_0x202994=_0x1387bc);}if(_0x1b16f8&&(_0x301b38||_0x202994))break;}if(!_0x1b16f8)return null;let _0x276974=await lt(_0x4d7d9c,_0x5b2802),_0x191806=_0x30c79a||M('codex',_0x4d7d9c)||(0x0,b['basename'])(_0x4d7d9c,_0x28799d(0x23b)),_0x2f1fef=_0x301b38??_0x202994??L([],_0x2c889f);return{'sessionId':_0x191806,'cwd':_0x1b16f8,'title':_0x2f1fef,'approvalMode':_0x276974['approvalMode'],'lastUsage':_0x276974['lastUsage'],'originator':_0xe8b21d};}async function Ms(_0x48f600,_0x3e8ff5,_0x521216){const _0x12e56a=_0x4cad58;return _e(_0x3e8ff5)[_0x12e56a(0x208)](_0x48f600,_0x521216[_0x12e56a(0x2f9)]);}async function Rs(_0x336877,_0x2bde0d,_0x265742){const _0x1c32e8=_0x4cad58;let _0x2dde0b=it(_0x336877,_0x2bde0d,_0x265742);if(_0x2dde0b!==void 0x0)return _0x2dde0b;let _0x20625d=Me(_0x2bde0d,_0x336877)+':'+_0x265742['size']+':'+_0x265742['mtimeMs']+':'+_0x265742[_0x1c32e8(0x1ea)],_0x2268f1=ut[_0x1c32e8(0x1b1)](_0x20625d);return _0x2268f1||(_0x2268f1=(async()=>{try{let _0x3c4af4=await Ms(_0x336877,_0x2bde0d,_0x265742);return at(_0x336877,_0x2bde0d,_0x265742,_0x3c4af4),_0x3c4af4;}catch{return at(_0x336877,_0x2bde0d,_0x265742,null),null;}})()[_0x1c32e8(0x293)](()=>{ut['delete'](_0x20625d);}),ut[_0x1c32e8(0x228)](_0x20625d,_0x2268f1)),_0x2268f1;}function Ps(_0x5df6f5,_0x4c2887,_0x584603,_0x268faa){const _0x44474e=_0x4cad58;let _0x410548={'sessionId':_0x5df6f5[_0x44474e(0x216)],'agent':_0x5df6f5['agent'],'cwd':_0x5df6f5['cwd'],'title':_0x5df6f5[_0x44474e(0x24b)],'approvalMode':_0x5df6f5[_0x44474e(0x226)],'lastUsage':_0x5df6f5['lastUsage'],'originator':_0x5df6f5['originator'],'createdAt':new Date(_0x584603['birthtimeMs'])['toISOString'](),'lastActivityAt':new Date(_0x584603[_0x44474e(0x1de)])['toISOString'](),'filePath':_0x4c2887};if(_0x5df6f5[_0x44474e(0x20a)]!=='codex')return _0x410548;let _0x110185=Sn(_0x268faa,_0x5df6f5['sessionId'],_0x4c2887),_0x29a98d=yn(_0x268faa,_0x5df6f5[_0x44474e(0x216)],_0x4c2887),_0xc03ba0=_0x110185&&_0x5df6f5['title']&&_0x110185!==_0x5df6f5['title']?[_0x5df6f5[_0x44474e(0x24b)]]:void 0x0;return{..._0x410548,'title':_0x110185??_0x5df6f5[_0x44474e(0x24b)],..._0xc03ba0?{'titleAliases':_0xc03ba0}:{},...typeof _0x29a98d=='boolean'?{'externalArchived':_0x29a98d}:{}};}async function pt(_0x4e4d08,_0x46ae0f,_0x2bb45e,_0x5bd380){const _0x290505=_0x4cad58;let _0x140363=await Rs(_0x4e4d08,_0x46ae0f,_0x2bb45e);if(!_0x140363)return null;let _0x458613=_0x46ae0f===_0x290505(0x21b)?_0x5bd380??await Ie():void 0x0;return Ps(_0x140363,_0x4e4d08,_0x2bb45e,_0x458613);}async function $n(_0x1d9bdf,_0x3764c7){const _0x4a1c9e=_0x4cad58;let _0x4a1804=await(0x0,R['stat'])(_0x1d9bdf)[_0x4a1c9e(0x2ce)](()=>null);return _0x4a1804?.['isFile']()?pt(_0x1d9bdf,_0x3764c7,{'size':_0x4a1804[_0x4a1c9e(0x2f9)],'mtimeMs':_0x4a1804[_0x4a1c9e(0x1de)],'birthtimeMs':_0x4a1804['birthtimeMs']}):null;}async function Wn(_0x52543f,_0x384aa9={}){const _0x12be3b=_0x4cad58;if(!_0x52543f)return null;let _0x41b6f=typeof _0x384aa9[_0x12be3b(0x2a4)]=='number'?_0x384aa9[_0x12be3b(0x2a4)]:null,_0x183450='codex-latest:'+(0x0,ee['homedir'])(),_0x34ed3c=_0x41b6f===null?Re[_0x12be3b(0x1b1)](_0x183450):null;if(_0x34ed3c&&_0x41b6f===null){let _0x470d15=_0x34ed3c[_0x12be3b(0x1b1)](_0x52543f);if(_0x34ed3c[_0x12be3b(0x2d7)](_0x52543f))return _0x470d15?{'sessionId':_0x470d15[_0x12be3b(0x216)],'filePath':_0x470d15['path']}:null;}let _0x5c0464=_0x41b6f===null?_0x52543f:_0x52543f+':'+_0x41b6f,_0x3918a1=dt[_0x12be3b(0x1b1)](_0x5c0464);_0x3918a1||(_0x3918a1=(async()=>{const _0x34e6f2=_0x12be3b;let _0x5d0b02=(await ie())['filter'](_0x586cf4=>_0x41b6f===null||vs(_0x586cf4)>=_0x41b6f),_0x1efc87=_e('codex');for(let _0x2b66a9=0x0;_0x2b66a9<_0x5d0b02['length'];_0x2b66a9+=v){let _0x313620=_0x5d0b02['slice'](_0x2b66a9,_0x2b66a9+v),_0x1c044f=(await Promise[_0x34e6f2(0x229)](_0x313620['map'](async _0x4b3849=>{const _0x3008cb=_0x34e6f2;let _0x53ed90=await _0x1efc87['readSessionCwdAndId'](_0x4b3849[_0x3008cb(0x299)],_0x4b3849);return _0x53ed90?{'entry':_0x4b3849,'meta':_0x53ed90}:null;})))[_0x34e6f2(0x290)](_0x402113=>_0x402113?.[_0x34e6f2(0x219)][_0x34e6f2(0x1e1)]===_0x52543f);if(_0x1c044f)return{'path':_0x1c044f['entry']['path'],'mtimeMs':_0x1c044f['entry'][_0x34e6f2(0x1de)],'sessionId':_0x1c044f[_0x34e6f2(0x219)][_0x34e6f2(0x216)]};}return null;})()[_0x12be3b(0x293)](()=>{dt['delete'](_0x5c0464);}),dt['set'](_0x5c0464,_0x3918a1));let _0x713264=await _0x3918a1;if(_0x41b6f!==null)return _0x713264?{'sessionId':_0x713264[_0x12be3b(0x216)],'filePath':_0x713264['path']}:null;let _0x1afcf6=Re[_0x12be3b(0x1b1)](_0x183450)??_0x34ed3c??new Map();return _0x1afcf6[_0x12be3b(0x228)](_0x52543f,_0x713264),Re[_0x12be3b(0x228)](_0x183450,_0x1afcf6),_0x713264?{'sessionId':_0x713264['sessionId'],'filePath':_0x713264[_0x12be3b(0x299)]}:null;}async function mt(_0x54a546,_0x309034){const _0x1a4692=_0x4cad58;let _0x4799b8=(0x0,b[_0x1a4692(0x25f)])((0x0,ee['homedir'])(),'.claude','projects'),_0x4864d9=_0x309034?fn(_0x309034):null,_0x250bfb=await(0x0,R[_0x1a4692(0x2ed)])(_0x4799b8)[_0x1a4692(0x2ce)](()=>[]),_0x3a2bf8=_0x4864d9?[_0x4864d9,..._0x250bfb['filter'](_0xf59372=>_0xf59372!==_0x4864d9)]:_0x250bfb;for(let _0x3ddc97 of _0x3a2bf8){let _0x2610c6=(0x0,b[_0x1a4692(0x25f)])(_0x4799b8,_0x3ddc97,_0x54a546+'.jsonl');if((await(0x0,R['stat'])(_0x2610c6)[_0x1a4692(0x2ce)](()=>null))?.[_0x1a4692(0x2fe)]())return _0x2610c6;}return null;}async function _s(_0x48d61f,_0x36c16a){const _0x419801=_0x4cad58;let _0x41f83e=await mt(_0x48d61f,_0x36c16a);if(!_0x41f83e)return;let _0x52542e=await(0x0,R[_0x419801(0x2e5)])(_0x41f83e)['catch'](()=>null);return _0x52542e?.[_0x419801(0x2fe)]()?(await ct(_0x41f83e,_0x52542e['size']))[_0x419801(0x1fe)]:void 0x0;}async function Fs(_0xef2b95){const _0x321d22=_0x4cad58;let _0x4fae65=(0x0,b['join'])((0x0,ee[_0x321d22(0x28c)])(),'.codex',_0x321d22(0x2f3)),_0x3e4b94=await gt(_0x4fae65,_0xef2b95);if(!_0x3e4b94)return;let _0x56ac78=await(0x0,R['stat'])(_0x3e4b94)['catch'](()=>null);return _0x56ac78?.[_0x321d22(0x2fe)]()?(await lt(_0x3e4b94,_0x56ac78[_0x321d22(0x2f9)]))['lastUsage']:void 0x0;}async function ks(_0x51f6ef,_0x56db7e,_0x45a2aa){const _0x35b59b=_0x4cad58;return _e(_0x56db7e)[_0x35b59b(0x2dd)](_0x51f6ef,_0x45a2aa);}async function Bn(_0x43acb6,_0x573acc){return _e(_0x573acc)['readRuntimeHintsFromFile'](_0x43acb6);}function Z(_0x20f2d6,_0x445757,_0x4b66e6){const _0x4d31b2=_0x4cad58;let _0x2a05bc=An(_0x445757);if(_0x4b66e6?.['coalesceConsecutiveAssistant']&&_0x2a05bc[_0x4d31b2(0x23c)]==='assistant'){let _0x1265fd=_0x20f2d6[_0x20f2d6[_0x4d31b2(0x284)]-0x1];if(_0x1265fd?.[_0x4d31b2(0x23c)]===_0x4d31b2(0x21a)&&_0x1265fd['type']!==_0x4d31b2(0x1b8)&&_0x2a05bc[_0x4d31b2(0x1b5)]!==_0x4d31b2(0x1b8)&&!Pt(_0x1265fd[_0x4d31b2(0x1d7)])&&(_0x2a05bc['content']===_0x1265fd['content']||_0x2a05bc[_0x4d31b2(0x1d7)]['startsWith'](_0x1265fd[_0x4d31b2(0x1d7)]))){_0x20f2d6[_0x20f2d6['length']-0x1]=_0x2a05bc;return;}}_0x20f2d6['push'](_0x2a05bc);}async function Ls(_0x18c148,_0x2a6fad){const _0x456c69=_0x4cad58;let _0x50038f=[];try{let _0x2c3ca2=await mt(_0x18c148,_0x2a6fad);if(_0x2c3ca2){let _0x3ccf44=new Map();await B(_0x2c3ca2,_0x2d4cdb=>{const _0x16c517=_0xa410;if(_0x2d4cdb['type']==='assistant'&&_0x2d4cdb['message']?.[_0x16c517(0x23c)]===_0x16c517(0x21a)&&Array[_0x16c517(0x245)](_0x2d4cdb[_0x16c517(0x1d5)]['content']))for(let _0x501264 of _0x2d4cdb[_0x16c517(0x1d5)]['content']){if(!_0x501264||typeof _0x501264!='object'||_0x501264[_0x16c517(0x1b5)]!==_0x16c517(0x302)||typeof _0x501264['id']!=_0x16c517(0x201))continue;let _0x17c6fe=typeof _0x501264['name']=='string'?_0x501264[_0x16c517(0x288)]:null,_0x135ad7=_0x501264[_0x16c517(0x286)]&&typeof _0x501264['input']=='object'?_0x501264['input']:null,_0x1d0d9e=_t(_0x17c6fe,_0x135ad7,_0x2a6fad);_0x1d0d9e&&_0x3ccf44[_0x16c517(0x228)](_0x501264['id'],_0x1d0d9e);}if(_0x2d4cdb[_0x16c517(0x1b5)]===_0x16c517(0x261)&&_0x2d4cdb['message']?.[_0x16c517(0x23c)]===_0x16c517(0x261)){if(Array['isArray'](_0x2d4cdb['message'][_0x16c517(0x1d7)]))for(let _0x4f2012 of _0x2d4cdb['message'][_0x16c517(0x1d7)]){if(!_0x4f2012||typeof _0x4f2012!=_0x16c517(0x27b)||_0x4f2012[_0x16c517(0x1b5)]!==_0x16c517(0x2b8))continue;if(_0x4f2012[_0x16c517(0x2f7)]===!0x0){let _0x1c84e5=tt(_0x4f2012[_0x16c517(0x1d7)]),_0x4953d6=bn(_0x1c84e5);_0x4953d6&&Z(_0x50038f,In(_0x4953d6,nt(_0x2d4cdb)));continue;}let _0x4675b7=typeof _0x4f2012[_0x16c517(0x269)]=='string'?_0x4f2012[_0x16c517(0x269)]:'',_0x1a50cf=_0x4675b7?_0x3ccf44['get'](_0x4675b7):void 0x0;if(!_0x1a50cf)continue;let _0x4bc365=tt(_0x4f2012['content']);if(!Ft(_0x2d4cdb['toolUseResult'],_0x4bc365))continue;let _0x4a1bbf=We([_0x1a50cf]);_0x4a1bbf&&Z(_0x50038f,q({'role':_0x16c517(0x21a),'content':_0x4a1bbf},_0x2d4cdb));}let _0x47870c=j(_0x2d4cdb);if(_0x47870c){let _0x1bf483=typeof _0x2d4cdb[_0x16c517(0x257)]==_0x16c517(0x201)&&_0x2d4cdb['parentUuid']?_0x2d4cdb['parentUuid']:null;Z(_0x50038f,q({'role':'user','content':_0x47870c,...typeof _0x2d4cdb[_0x16c517(0x1d2)]=='string'&&_0x2d4cdb[_0x16c517(0x1d2)]?{'rewindPoint':{'provider':'claude','messageId':_0x1bf483}}:{}},_0x2d4cdb));}}else{if(_0x2d4cdb['type']==='assistant'&&_0x2d4cdb[_0x16c517(0x1d5)]?.[_0x16c517(0x23c)]==='assistant'){let _0x9a023=H(_0x2d4cdb['message'][_0x16c517(0x1d7)]);_0x9a023&&Z(_0x50038f,q({'role':_0x16c517(0x21a),'content':_0x9a023},_0x2d4cdb));}}});}}catch(_0x21b3c1){ft['warn']({'error':String(_0x21b3c1)},_0x456c69(0x24f));}return _0x50038f;}async function Ns(_0x7ed87d,_0x342c81){const _0x1fe888=_0x4cad58;let _0x1998c2=[];try{let _0x5aa130=await ks(_0x7ed87d,'codex',_0x342c81);if(_0x5aa130){let _0x4ac310;await B(_0x5aa130,_0x19d31a=>{const _0x21afd8=_0xa410;_0x19d31a[_0x21afd8(0x1b5)]===_0x21afd8(0x1e5)&&_0x19d31a['payload']?.['type']===_0x21afd8(0x273)&&(_0x4ac310=typeof _0x19d31a['payload']['turn_id']==_0x21afd8(0x201)&&_0x19d31a['payload']['turn_id']?_0x19d31a[_0x21afd8(0x218)]['turn_id']:void 0x0);let _0x542b5f=kt(_0x19d31a,{'cwd':_0x342c81,'includePatchCalls':!0x0}),_0x52d4bd=We(_0x542b5f);if(_0x52d4bd&&Z(_0x1998c2,q({'role':'assistant','content':_0x52d4bd},_0x19d31a)),_0x19d31a['type']!==_0x21afd8(0x236)||_0x19d31a[_0x21afd8(0x218)]?.['type']!=='message')return;let _0x21f1fb=_0x19d31a['payload']['role'];if(_0x21f1fb!==_0x21afd8(0x261)&&_0x21f1fb!==_0x21afd8(0x21a))return;let _0x25ad09=N(_0x19d31a['payload']['content']);_0x25ad09&&(_0x21f1fb==='user'&&z(_0x25ad09)||Z(_0x1998c2,q({'role':_0x21f1fb,'content':_0x25ad09,..._0x21f1fb===_0x21afd8(0x261)&&_0x4ac310?{'rewindPoint':{'provider':_0x21afd8(0x21b),'turnId':_0x4ac310}}:{}},_0x19d31a),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0x321f57){ft['warn']({'error':String(_0x321f57)},_0x1fe888(0x2a2));}return _0x1998c2;}var Ds={'claude':{'agent':'claude','extractSessionIdFromFile':st,async 'readFileMeta'(_0x4185a8,_0x4a0caa){const _0x543035=_0x4cad58;let _0x2155c0=await Nn(_0x4185a8,_0x4a0caa);return _0x2155c0?{..._0x2155c0,'agent':_0x543035(0x26c)}:null;},async 'readSessionCwdAndId'(_0x5e154e,_0x18e261){const _0x2d40de=_0x4cad58;let _0x46546f=_0x18e261??await(0x0,R[_0x2d40de(0x2e5)])(_0x5e154e)[_0x2d40de(0x2ce)](()=>null);if(!_0x46546f)return null;let _0x3a2413=await Nn(_0x5e154e,_0x46546f['size']);return _0x3a2413?{'cwd':_0x3a2413[_0x2d40de(0x1e1)],'sessionId':_0x3a2413[_0x2d40de(0x216)]}:null;},'resolveSessionFilePath':mt,'readLastUsage':_s,'readRuntimeHintsFromFile':Pn,'readHistory':Ls},'codex':{'agent':_0x4cad58(0x21b),'extractSessionIdFromFile':ot,async 'readFileMeta'(_0x2c1535,_0x1e3967){let _0x109e7f=await Es(_0x2c1535,_0x1e3967);return _0x109e7f?{..._0x109e7f,'agent':'codex'}:null;},'readSessionCwdAndId':Is,async 'resolveSessionFilePath'(_0x5f1eb1){const _0x1931d7=_0x4cad58;let _0x522f51=(0x0,b[_0x1931d7(0x25f)])((0x0,ee['homedir'])(),'.codex',_0x1931d7(0x2f3));return gt(_0x522f51,_0x5f1eb1);},'readLastUsage':Fs,'readRuntimeHintsFromFile':_n,'readHistory':Ns}};function _e(_0xd02d6d){return Ds[_0xd02d6d];}async function gt(_0x3308b0,_0x53c5bd){const _0x621ee8=_0x4cad58;try{let _0x4ad33c=await(0x0,R['readdir'])(_0x3308b0,{'withFileTypes':!0x0});for(let _0xf29c66 of _0x4ad33c){let _0x4da2f0=(0x0,b['join'])(_0x3308b0,_0xf29c66[_0x621ee8(0x288)]);if(_0xf29c66[_0x621ee8(0x233)]()){let _0xe03300=await gt(_0x4da2f0,_0x53c5bd);if(_0xe03300)return _0xe03300;}else{if(_0xf29c66['name']['includes'](_0x53c5bd)&&_0xf29c66[_0x621ee8(0x288)][_0x621ee8(0x21c)](_0x621ee8(0x23b)))return _0x4da2f0;}}}catch(_0x18d3a9){ft['warn']({'error':String(_0x18d3a9)},_0x621ee8(0x1e0));}return null;}var Us=0x40;function ht(_0x45f576){const _0x11a454=_0x4cad58;return _0x45f576[_0x11a454(0x2f9)]+':'+_0x45f576[_0x11a454(0x1de)]+':'+_0x45f576['birthtimeMs'];}function Os(_0x2d99c3){const _0x54b127=_0x4cad58;return _0x2d99c3[_0x54b127(0x277)](_0xc65bae=>_0xc65bae['path']+'\x00'+ht(_0xc65bae))['sort']()['join']('\x0a');}async function $s(){const _0x46297a=_0x4cad58;let [_0x5da656,_0x3bbdec,_0x2b9ecd,_0x2e585c]=await Promise['all']([Be(),ie(),oe(),(0x0,Hn[_0x46297a(0x2e5)])((0x0,zn[_0x46297a(0x25f)])((0x0,jn[_0x46297a(0x28c)])(),'.codex',_0x46297a(0x317)))[_0x46297a(0x2ce)](()=>null)]),[_0x97535c,_0x26db50]=await Promise['all']([J(_0x5da656),J(_0x2b9ecd)]);return{'claudeFiles':_0x97535c,'codexFiles':_0x3bbdec,'claudeMetadataFingerprint':Os(_0x26db50),'codexMetadataFingerprint':_0x2e585c?.[_0x46297a(0x2fe)]()?_0x2e585c[_0x46297a(0x2f9)]+':'+_0x2e585c['mtimeMs']+':'+_0x2e585c[_0x46297a(0x1ea)]:''};}async function Ws(_0x2a96e2,_0x466767,_0x2027bd){const _0x3294c5=_0x4cad58;let _0x20b6fb=await pt(_0x2a96e2['path'],_0x466767,_0x2a96e2,_0x466767==='codex'?_0x2027bd[_0x3294c5(0x21b)]:void 0x0);if(!_0x20b6fb)return null;let _0x188423=_0x466767===_0x3294c5(0x26c)?Ve(_0x20b6fb,_0x2027bd[_0x3294c5(0x26c)]['byCliSessionId']['get'](_0x20b6fb['sessionId'])):_0x20b6fb;return On(_0x188423);}var Bs={'collectContext':$s,'loadClaudeLookup':Ge,'loadCodexLookup':async _0x3b77bd=>(_0x3b77bd&&Ye(),Ie()),'readSession':Ws,'updateLatestCodexCache':Dn},Fe=class{constructor(_0x6d45da=Bs,_0x16f899=Us){this['dependencies']=_0x6d45da,this['batchSize']=_0x16f899;}[_0x4cad58(0x203)]=new Map();[_0x4cad58(0x27d)]=null;[_0x4cad58(0x1b3)]=null;['claudeLookup']=null;['codexLookup']=null;async['scan'](_0x31d2b6){const _0x584609=_0x4cad58;let _0x1850c0=await this['dependencies']['collectContext'](),_0x1ffc13=this[_0x584609(0x27d)]===null||this['claudeMetadataFingerprint']!==_0x1850c0[_0x584609(0x27d)],_0x37db47=this[_0x584609(0x1b3)]===null||this['codexMetadataFingerprint']!==_0x1850c0[_0x584609(0x1b3)],[_0x528804,_0x18d6ee]=await Promise[_0x584609(0x229)]([_0x1ffc13||!this['claudeLookup']?this[_0x584609(0x29e)][_0x584609(0x1be)]():Promise[_0x584609(0x267)](this[_0x584609(0x1f1)]),_0x37db47||!this[_0x584609(0x320)]?this['dependencies'][_0x584609(0x22d)](this['codexMetadataFingerprint']!==null):Promise['resolve'](this[_0x584609(0x320)])]),_0xe7cd70={'claude':_0x528804,'codex':_0x18d6ee},_0x56dbe6=[..._0x1850c0['claudeFiles'][_0x584609(0x277)](_0x4e9617=>({'agent':_0x584609(0x26c),'entry':_0x4e9617})),..._0x1850c0['codexFiles'][_0x584609(0x277)](_0x4ae278=>({'agent':'codex','entry':_0x4ae278}))]['sort']((_0x55b62a,_0x1d9f40)=>_0x1d9f40['entry']['mtimeMs']-_0x55b62a[_0x584609(0x30e)][_0x584609(0x1de)]),_0x4f2596=new Set(_0x56dbe6['map'](({entry:_0x3f9c85})=>_0x3f9c85['path'])),_0xf13f01=[...this['entries'][_0x584609(0x304)]()][_0x584609(0x1f2)](_0x54a1d9=>!_0x4f2596[_0x584609(0x2d7)](_0x54a1d9))['length'],_0x29ef61=new Map(),_0xbe19b4=_0x56dbe6['filter'](({agent:_0x5c3e74,entry:_0x2bdfd8})=>{const _0x86f193=_0x584609;let _0x58d35d=this[_0x86f193(0x203)][_0x86f193(0x1b1)](_0x2bdfd8['path']);return!(_0x5c3e74==='claude'?_0x1ffc13:_0x37db47)&&_0x58d35d?.['fingerprint']===ht(_0x2bdfd8)?(_0x29ef61['set'](_0x2bdfd8[_0x86f193(0x299)],_0x58d35d),!0x1):!0x0;}),_0x4596f2=0x0,_0x2c5e16=Math[_0x584609(0x28a)](0x1,this['batchSize']);for(let _0x58b4f6=0x0;_0x58b4f6<_0xbe19b4[_0x584609(0x284)];_0x58b4f6+=_0x2c5e16){let _0x239622=_0xbe19b4[_0x584609(0x31b)](_0x58b4f6,_0x58b4f6+_0x2c5e16),_0x50c314=await P(_0x239622,v,({agent:_0x40619c,entry:_0x44e337})=>this[_0x584609(0x29e)][_0x584609(0x30b)](_0x44e337,_0x40619c,_0xe7cd70));for(let _0x477b35=0x0;_0x477b35<_0x239622['length'];_0x477b35+=0x1){let _0x1477c7=_0x239622[_0x477b35];_0x29ef61[_0x584609(0x228)](_0x1477c7['entry']['path'],{'fingerprint':ht(_0x1477c7['entry']),'session':_0x50c314[_0x477b35]});}_0x4596f2+=_0x239622['length'],_0x31d2b6?.({'processedFiles':_0x4596f2,'changedFiles':_0xbe19b4[_0x584609(0x284)],'totalFiles':_0x56dbe6[_0x584609(0x284)],'removedFiles':_0xf13f01});}let _0x54e680=[..._0x29ef61['values']()]['map'](_0x2cd482=>_0x2cd482['session'])[_0x584609(0x1f2)](_0x31b3aa=>_0x31b3aa!==null)['sort']((_0x3ccb5e,_0x46c091)=>_0x46c091[_0x584609(0x313)][_0x584609(0x248)](_0x3ccb5e['lastActivityAt']));return this['dependencies'][_0x584609(0x205)](_0x56dbe6['filter'](({agent:_0x5689cc})=>_0x5689cc==='codex')[_0x584609(0x277)](({entry:_0x23094c})=>{const _0xc48862=_0x584609;let _0x50f8ef=_0x29ef61['get'](_0x23094c[_0xc48862(0x299)])?.['session'];return _0x50f8ef?{'cwd':_0x50f8ef[_0xc48862(0x1e1)],'match':{'path':_0x23094c['path'],'mtimeMs':_0x23094c[_0xc48862(0x1de)],'sessionId':_0x50f8ef[_0xc48862(0x216)]}}:null;})['filter'](_0x3369ed=>_0x3369ed!==null)),this['entries']=_0x29ef61,this['claudeLookup']=_0x528804,this['codexLookup']=_0x18d6ee,this['claudeMetadataFingerprint']=_0x1850c0['claudeMetadataFingerprint'],this['codexMetadataFingerprint']=_0x1850c0[_0x584609(0x1b3)],{'sessions':_0x54e680,'changedFiles':_0xbe19b4['length'],'reusedFiles':_0x56dbe6['length']-_0xbe19b4['length'],'removedFiles':_0xf13f01,'totalFiles':_0x56dbe6['length']};}},nr=require('node:child_process'),Se=require('node:fs/promises'),bt=require('node:os'),ge=require(_0x4cad58(0x287)),rr=require('node:util'),St=class{[_0x4cad58(0x1d3)]=new Map();['timers']=new Map();['gauges']=new Map();[_0x4cad58(0x25d)]=Date[_0x4cad58(0x285)]();[_0x4cad58(0x1cb)]=null;[_0x4cad58(0x21d)](_0x32f79b,_0x460d39={}){const _0x19ac76=_0x4cad58;this['counters']['has'](_0x32f79b)||this[_0x19ac76(0x1d3)]['set'](_0x32f79b,[]);let _0x278cfe=this[_0x19ac76(0x1d3)][_0x19ac76(0x1b1)](_0x32f79b),_0x4b2d38=JSON['stringify'](_0x460d39),_0x5e8889=_0x278cfe['find'](_0x1c0979=>JSON[_0x19ac76(0x2dc)](_0x1c0979['labels'])===_0x4b2d38);_0x5e8889?_0x5e8889['value']++:_0x278cfe['push']({'value':0x1,'labels':_0x460d39});}[_0x4cad58(0x230)](_0x174364,_0x1fdfb1){this['gauges']['set'](_0x174364,_0x1fdfb1);}[_0x4cad58(0x294)](_0x535850){let _0x408f4c=performance['now']();return()=>{const _0xf9796a=_0xa410;let _0xcc1b5a=Math[_0xf9796a(0x2c7)](performance[_0xf9796a(0x285)]()-_0x408f4c),_0x25be65=this['timers'][_0xf9796a(0x1b1)](_0x535850)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0x25be65['count']++,_0x25be65['totalMs']+=_0xcc1b5a,_0x25be65[_0xf9796a(0x22b)]=Math[_0xf9796a(0x2fd)](_0x25be65['minMs'],_0xcc1b5a),_0x25be65['maxMs']=Math['max'](_0x25be65['maxMs'],_0xcc1b5a),_0x25be65['lastMs']=_0xcc1b5a,this[_0xf9796a(0x31a)]['set'](_0x535850,_0x25be65),_0xcc1b5a;};}[_0x4cad58(0x23d)](){const _0xa30763=_0x4cad58;let _0x22084c={};for(let [_0xa67091,_0x4a3e89]of this['counters'])_0x22084c[_0xa67091]=_0x4a3e89['map'](_0x594cd2=>({..._0x594cd2}));let _0x472859={};for(let [_0x4a2611,_0x436c72]of this[_0xa30763(0x31a)])_0x472859[_0x4a2611]={..._0x436c72,'minMs':_0x436c72[_0xa30763(0x22b)]===0x1/0x0?0x0:_0x436c72['minMs']};let _0x7e39c8={};for(let [_0x3b64d0,_0x26a9a0]of this[_0xa30763(0x1bb)])_0x7e39c8[_0x3b64d0]=_0x26a9a0;return{'uptimeMs':Date[_0xa30763(0x285)]()-this[_0xa30763(0x25d)],'counters':_0x22084c,'timers':_0x472859,'gauges':_0x7e39c8};}[_0x4cad58(0x22c)](_0x4d2ff4=0xea60){const _0x454017=_0x4cad58;this['logInterval']||(this[_0x454017(0x1cb)]=setInterval(()=>{let _0xb36e43=this['snapshot']();S['info']({'metrics':_0xb36e43},'periodic\x20metrics\x20snapshot');},_0x4d2ff4),this['logInterval']['unref']());}[_0x4cad58(0x2bf)](){const _0x3b1a43=_0x4cad58;this['logInterval']&&(clearInterval(this['logInterval']),this[_0x3b1a43(0x1cb)]=null);}},V=new St(),xl=S['child']({'module':_0x4cad58(0x322)}),yt=require('node:path'),Hs=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,js=new Set(['sh',_0x4cad58(0x276),'zsh',_0x4cad58(0x249)]),zs=new Set(['env','nohup','timeout',_0x4cad58(0x2d0)]),qs=new Set(['node',_0x4cad58(0x1f8),'bun','tsx']),Gs=new Set(['-e',_0x4cad58(0x2ba),'-p','--print']),Vs=new Set(['-r','--require','--import',_0x4cad58(0x1b6),'--experimental-loader',_0x4cad58(0x255),'--input-type']);function Qs(_0x28ccd1){return _0x28ccd1['replace'](/^['"]|['"]$/g,'');}function Gn(_0x1b89d3){const _0xf5bf4d=_0x4cad58;return(_0x1b89d3['match'](/"[^"]*"|'[^']*'|\S+/g)??[])[_0xf5bf4d(0x277)](Qs);}function qn(_0x3ea85d){let _0x28fcbc=(0x0,yt['basename'])(_0x3ea85d);return _0x28fcbc==='claude'||_0x28fcbc==='codex'?_0x28fcbc:null;}function Js(_0x383449){const _0x2b06e7=_0x4cad58;for(let _0x4f4aa0 of _0x383449[_0x2b06e7(0x20d)](/&&|\|\||;|\n/)){let _0x2bf557=Vn(Gn(_0x4f4aa0['trim']()),!0x0);if(_0x2bf557)return _0x2bf557;}return null;}function Vn(_0x2baf56,_0xbf0b64=!0x1){const _0x1c44f7=_0x4cad58;let _0x28f180=0x0;for(;_0x28f180<_0x2baf56[_0x1c44f7(0x284)];){let _0x14b845=_0x2baf56[_0x28f180],_0x455a02=(0x0,yt['basename'])(_0x14b845);if(zs['has'](_0x455a02)){if(_0x28f180+=0x1,_0x455a02==='env'){for(;_0x28f180<_0x2baf56[_0x1c44f7(0x284)]&&/^[A-Za-z_][A-Za-z0-9_]*=/['test'](_0x2baf56[_0x28f180]);)_0x28f180+=0x1;}else{if(_0x455a02===_0x1c44f7(0x225)||_0x455a02==='gtimeout'){for(;_0x28f180<_0x2baf56['length']&&_0x2baf56[_0x28f180]['startsWith']('-');){let _0x5a5a79=_0x2baf56[_0x28f180];_0x28f180+=0x1,_0x5a5a79==='-k'&&_0x28f180<_0x2baf56['length']&&(_0x28f180+=0x1);}_0x28f180<_0x2baf56['length']&&(_0x28f180+=0x1);}}continue;}if(js['has'](_0x455a02)){for(let _0x17837c=_0x28f180+0x1;_0x17837c<_0x2baf56['length'];_0x17837c+=0x1){let _0x3c5409=_0x2baf56[_0x17837c];if(['-c',_0x1c44f7(0x31f),'-ic',_0x1c44f7(0x1c2),'-ec','-xec'][_0x1c44f7(0x1df)](_0x3c5409)){let _0x1410be=_0x2baf56[_0x17837c+0x1];return _0x1410be?Js(_0x1410be):null;}}return null;}if(qs[_0x1c44f7(0x2d7)](_0x455a02)){let _0x5ba0c5=_0x28f180+0x1;for(;_0x5ba0c5<_0x2baf56[_0x1c44f7(0x284)];){let _0xa961a1=_0x2baf56[_0x5ba0c5];if(Gs['has'](_0xa961a1))return null;if(_0xa961a1==='--'){_0x5ba0c5+=0x1;break;}if(!_0xa961a1['startsWith']('-'))break;_0x5ba0c5+=0x1,Vs[_0x1c44f7(0x2d7)](_0xa961a1)&&_0x5ba0c5<_0x2baf56[_0x1c44f7(0x284)]&&(_0x5ba0c5+=0x1);}if(_0x5ba0c5>=_0x2baf56['length'])return null;let _0x51d3a0=qn(_0x2baf56[_0x5ba0c5]);return _0x51d3a0?{'agent':_0x51d3a0,'args':_0x2baf56[_0x1c44f7(0x31b)](_0x5ba0c5+0x1),'viaWrapper':!0x0}:null;}let _0x13373c=qn(_0x14b845);return _0x13373c?{'agent':_0x13373c,'args':_0x2baf56[_0x1c44f7(0x31b)](_0x28f180+0x1),'viaWrapper':_0xbf0b64}:null;}return null;}function xt(_0x2e6b69,_0x4a8e6e=!0x1){return Vn(Gn(_0x2e6b69),_0x4a8e6e);}function pe(_0x21a96e){const _0x11ed4a=_0x4cad58;let _0x559d1c=xt(_0x21a96e);return _0x559d1c?{'agent':_0x559d1c[_0x11ed4a(0x20a)],'args':_0x559d1c[_0x11ed4a(0x2a6)]}:null;}function Le(_0x4707b3){return Hs['test'](_0x4707b3)&&xt(_0x4707b3)!==null;}function Qn(_0x312c63,_0x205a28){const _0x8f0322=_0x4cad58;let _0x250440=pe(_0x205a28);if(!_0x250440||_0x250440['agent']!==_0x312c63)return null;let {args:_0x1e60c9}=_0x250440;if(_0x312c63==='claude'){for(let _0x100f4a=0x0;_0x100f4a<_0x1e60c9['length'];_0x100f4a+=0x1){let _0x5b86c0=_0x1e60c9[_0x100f4a];if((_0x5b86c0===_0x8f0322(0x2a0)||_0x5b86c0==='--session-id')&&_0x1e60c9[_0x100f4a+0x1]&&!_0x1e60c9[_0x100f4a+0x1][_0x8f0322(0x25a)]('-'))return _0x1e60c9[_0x100f4a+0x1];if(_0x5b86c0['startsWith'](_0x8f0322(0x1a9)))return _0x5b86c0['slice'](0x9);if(_0x5b86c0['startsWith'](_0x8f0322(0x2e8)))return _0x5b86c0['slice'](0xd);}return null;}return _0x1e60c9[0x0]!==_0x8f0322(0x1d4)?null:_0x1e60c9['slice'](0x1)['find'](_0x1a326a=>!_0x1a326a['startsWith']('-'))??null;}function Ks(_0x68ec99,_0x490f1a){const _0x25c47d=_0x4cad58;let _0x2cc4ea=pe(_0x490f1a);if(!(!_0x2cc4ea||_0x2cc4ea[_0x25c47d(0x20a)]!==_0x68ec99)){if(_0x68ec99===_0x25c47d(0x21b))return _0x2cc4ea[_0x25c47d(0x2a6)]['includes'](_0x25c47d(0x28f))?'autoApprove':void 0x0;if(_0x2cc4ea['args']['includes']('--dangerously-skip-permissions'))return'autoApprove';for(let _0x17614f=0x0;_0x17614f<_0x2cc4ea['args']['length'];_0x17614f+=0x1){let _0x589c71=_0x2cc4ea['args'][_0x17614f],_0x189c34=_0x589c71===_0x25c47d(0x1da)?_0x2cc4ea[_0x25c47d(0x2a6)][_0x17614f+0x1]:_0x589c71[_0x25c47d(0x25a)]('--permission-mode=')?_0x589c71[_0x25c47d(0x31b)](0x12):void 0x0;if(_0x189c34==='plan')return _0x25c47d(0x2b7);if(_0x189c34===_0x25c47d(0x1d1))return _0x25c47d(0x1d1);if(_0x189c34==='default')return _0x25c47d(0x25c);}}}function Ct(_0x384d05,_0xec2eb4){const _0x212a33=_0x4cad58;let _0x318412=xt(_0xec2eb4);return!_0x318412||_0x318412['agent']!==_0x384d05||_0x318412[_0x212a33(0x260)]?!0x1:_0x384d05==='claude'?!_0x318412[_0x212a33(0x2a6)][_0x212a33(0x1df)](_0x212a33(0x266))&&!_0x318412[_0x212a33(0x2a6)]['includes']('-c'):!(_0x318412[_0x212a33(0x2a6)][0x0]==='app-server'&&!_0x318412['args']['includes']('--listen')&&!_0x318412[_0x212a33(0x2a6)][_0x212a33(0x268)](_0x57af68=>_0x57af68['startsWith'](_0x212a33(0x29f))));}function ke(_0x37146c){const _0x8f4a05=_0x4cad58;return _0x37146c===_0x8f4a05(0x297)?0x3:_0x37146c===_0x8f4a05(0x278)?0x2:0x1;}function Xs(_0x37afdc,_0x149a0b){const _0x5e6ec0=_0x4cad58;return _0x37afdc==='claude'?_0x149a0b['includes'](_0x5e6ec0(0x1c5))&&!_0x149a0b['includes']('/subagents/'):_0x149a0b[_0x5e6ec0(0x1df)](_0x5e6ec0(0x24c));}function Tt(_0x3be963){const _0x3a38c2=_0x4cad58;let _0x1b16d1=[...new Set(_0x3be963['sessionFiles'])][_0x3a38c2(0x1f2)](_0x327998=>Xs(_0x3be963['agent'],_0x327998)),_0x52a916=Qn(_0x3be963['agent'],_0x3be963['command']),_0x22279f=Ks(_0x3be963['agent'],_0x3be963['command']);if(_0x52a916)return{'agent':_0x3be963['agent'],'pid':_0x3be963['pid'],'cwd':_0x3be963['cwd'],'command':_0x3be963[_0x3a38c2(0x220)],'sessionId':_0x52a916,'confidence':_0x3a38c2(0x297),..._0x22279f?{'approvalMode':_0x22279f}:{},..._0x1b16d1[_0x3a38c2(0x284)]===0x1?{'sessionFilePath':_0x1b16d1[0x0]}:{}};if(_0x1b16d1['length']!==0x1)return null;let _0x4ba32e=M(_0x3be963[_0x3a38c2(0x20a)],_0x1b16d1[0x0]);return _0x4ba32e?{'agent':_0x3be963['agent'],'pid':_0x3be963['pid'],'cwd':_0x3be963['cwd'],'command':_0x3be963[_0x3a38c2(0x220)],'sessionId':_0x4ba32e,'confidence':_0x3a38c2(0x278),..._0x22279f?{'approvalMode':_0x22279f}:{},'sessionFilePath':_0x1b16d1[0x0]}:null;}function Ys(_0x197b5c,_0x5da629){const _0x1c6174=_0x4cad58;let _0x501e1e=_0x197b5c,_0x238038=_0x5da629;(ke(_0x5da629[_0x1c6174(0x280)])>ke(_0x197b5c['confidence'])||ke(_0x5da629['confidence'])===ke(_0x197b5c[_0x1c6174(0x280)])&&(!!_0x5da629['sessionFilePath']!=!!_0x197b5c[_0x1c6174(0x2eb)]&&_0x5da629['sessionFilePath']||!!_0x5da629[_0x1c6174(0x2eb)]==!!_0x197b5c['sessionFilePath']&&_0x5da629[_0x1c6174(0x274)]!==void 0x0&&_0x197b5c[_0x1c6174(0x274)]!==void 0x0&&_0x5da629['pid']<_0x197b5c[_0x1c6174(0x274)]))&&(_0x501e1e=_0x5da629,_0x238038=_0x197b5c);let _0x39c35c=_0x501e1e['approvalMode']??_0x238038['approvalMode'],_0x2c8a0e=_0x501e1e['title']??_0x238038['title'],_0x23f35b=_0x501e1e['sessionFilePath']??_0x238038['sessionFilePath'],_0x98bf8d=_0x501e1e[_0x1c6174(0x2c6)]??_0x238038[_0x1c6174(0x2c6)],_0xa18173=_0x501e1e['terminal']??_0x238038['terminal'],_0x363e86={..._0x501e1e,'cwd':_0x501e1e[_0x1c6174(0x1e1)]||_0x238038['cwd'],..._0x39c35c?{'approvalMode':_0x39c35c}:{}};return _0x2c8a0e!==void 0x0&&(_0x363e86['title']=_0x2c8a0e),_0x23f35b!==void 0x0&&(_0x363e86['sessionFilePath']=_0x23f35b),_0x98bf8d!==void 0x0&&(_0x363e86['isResponding']=_0x98bf8d),_0xa18173!==void 0x0&&(_0x363e86[_0x1c6174(0x2ae)]=_0xa18173),_0x363e86;}function At(_0x4ce4d0){const _0xcfcd78=_0x4cad58;let _0x180dc7=new Map();for(let _0x154bdf of _0x4ce4d0){let _0x2f0d00=_0x154bdf['agent']+':'+_0x154bdf[_0xcfcd78(0x216)],_0x248d4e=_0x180dc7[_0xcfcd78(0x1b1)](_0x2f0d00);_0x180dc7[_0xcfcd78(0x228)](_0x2f0d00,_0x248d4e?Ys(_0x248d4e,_0x154bdf):_0x154bdf);}return[..._0x180dc7[_0xcfcd78(0x232)]()];}function _0x5455(){const _0x2255ac=['lMPZEa','C3rHDgvFns5ZCwXPDgu','C2nHBM5LCG','zxHPC3rZu3LUyW','DgLTzxjZ','C2XPy2u','BM9KztPVCW','lMvSBq','DgvYBwLUywWTy29UDhjVBc10B2TLBG','lwXJ','y29KzxHmB29RDxa','y2XPu2vZC2LVBKLK','ChjVy2vZCY1Zy2fUBMvY','C3rVCf9YzwfZB24','ls1Yzxn1Bwu9','yxv0B0fWChjVDMu','luzU','zM5Tx211BhrPC2HLBgXZ','zMfPBgvKihrVihjLywqGy29KzxGGDgHYzwfKihrPDgXLCYbMCM9TihnXBgL0zq','C3rHBMrHBg9Uzq','Dg9VBf9YzwzLCMvUy2u','ChjVy2vZCY5Zy2fUlMH5zhjHDgvFBxm','z2v0','C2vZC2LVBIbPBNzLBNrVCNKGAw5JCMvTzw50ywXSEsbZy2fUBMvK','y29KzxHnzxrHzgf0yuzPBMDLCNbYAw50','AxnbyNnVBhv0zq','DhLWzq','ls1SB2fKzxi','y3vZDg9TvgL0Bgu','Aw5MBW','C2HHCMu','Dg9Rzw5Fy291BNq','z2f1z2vZ','C2f2zwrFCgf0Aa','DxbSB2fKCW','Bg9HzenSyxvKzuXVB2T1Ca','y2fJAgvszwfKsw5WDxruB2TLBNm','pgXVy2fSlwnVBw1HBMqTy2f2zwf0pG','AwrSzq','lxHJ','D2fYBG','CMvZCg9UzgLUzW','lY5JBgf1zguVChjVAMvJDhmV','q0Xbvurfq09erq','lNnXBa','pgnVBw1HBMqTBMfTzt4','zNjVBq','CgfYzw50x3rOCMvHzf9Pza','Bg9Nsw50zxj2ywW','u0Lhs0Lmta','ruLp','lMnVzgv4','ywXPDMvqCM9JzxnZzxm','lM1T','ywnJzxb0rwrPDhm','DxvPza','y291BNrLCNm','CMvZDw1L','BwvZC2fNzq','m2neBwrLyG','y29UDgvUDa','zgf0yq','B24TCMvXDwvZDa','ls1WzxjTAxnZAw9Ulw1Vzgu','DgL0BgvbBgLHC2vZ','CgfPCMLUz3mUANnVBG','ndKYmZi1B25Uz2Lv','BxrPBwvnCW','Aw5JBhvKzxm','zMfPBgvKihrVihDHBgSGy29KzxGGC2vZC2LVBNmGzgLY','y3DK','y2XHDwrLlxnLBNnPDgL2zs1MAwXLoG','y2XHDwrLlwnVzguTC2vZC2LVBNm','Bw9KzwXFy29UDgv4Df93Aw5KB3C','zxzLBNrFBxnN','zMLSzvbHDgG','Cg5WBq','DhvYBKzPBMLZAgvK','ywn0AxzPDhK','yMLYDgH0Aw1Ltxm','lMDV','y2fJAgvFy3jLyxrPB25FAw5WDxrFDg9Rzw5Z','lMT0','pgXVy2fSlwnVBw1HBMqTC3rKB3v0pG','DhjPBq','l3vZCI9SB2nHBc9IAw4Vy29KzxG','y2XHDwrLtg9VA3vW','zMLSDgvY','Bg9JywXtzxnZAw9Uswq','DxbKyxrLzef0','lwPZB24','Aw1Hz2vZ','DxnLCL9TzxnZywDL','BM9KzwPZ','lMnSyxvKzq','lwLSyW','Cg9ZDe1LC3nHz2u','yNLjza','pgXVy2fSlwnVBw1HBMqTC3rKzxjYpG','BgfZDfvZywDL','BM9Kzq','zNvUy3rPB25Fy2fSBa','C3rYAw5N','zxHWAxjLC0f0','zw50CMLLCW','vKLcrv9urvnux0LovKvove9swv9xt1jlrvjFrevmqvLFtvm','DxbKyxrLtgf0zxn0q29KzxHdywnOzq','Dg9mB3DLCKnHC2u','Bwf0y2HLzfbYB2nLC3nLCW','CMvHzezPBgvnzxrH','zgLYzwn0q2fUzgLKyxrLCW','ywDLBNq','ls10zxn0','ioINHUs4UUAvJ+AeN+I3R+w+HooaGUI/MEEXU+AjUEwhHUAxOoAZLEs7JUw3SUACIEs8MUIVNEIUSow9LEMhJoIHPEwBNUwiScbwAwjLBgv044cc6k+36yEn5PAW5OMN6kgm6l+z5QYH5l+U5Ps55BM25zYOienSyxvKzsdKUk3MMi7NOA7MIBNLH4BVVjVLPOlMNPZLUiZMNjVLNkGGvMLIzwXLDcdPH4ZNNiVLIldLRQhMIBNLVlNNQPFVViZOR7FKU44GvMLIzwXLDcdLKk/LIQJMIjBNU6FNU63OV5NKUkRKVjROR53JGii','C3bSAxq','y2XVC2u','lNrZEa','C2TPChbLzfbYB2nLC3nezxrHAwXZ','DgvZDa','B3jPz2LUywXgAwXL','CM9SBg91Df9WyxrO','ntiWB292uxbp','AhLKCMf0zu1Z','C2vZC2LVBKLK','D29YA3nWywnLlxDYAxrL','Cgf5Bg9Hza','Bwv0yq','yxnZAxn0yw50','y29KzxG','zw5KC1DPDgG','Aw5JCMvTzw50','tgLICMfYEq','zwzMB3j0','y29TBwfUza','Aw5WDxruB2TLBNm','zgvSAw1PDgvY','CgfPCMLUzY1XCI5WBMC','mtKZnZDLugDfDwC','DgLTzw91Da','yxbWCM92ywXnB2rL','DgfZA19JB21WBgv0zq','C2v0','ywXS','DMfSDwu','BwLUtxm','C3rHCNrqzxjPB2rPy0XVzW','Bg9HzenVzgv4tg9VA3vW','DxnLCLbYB21WDa','C29YDa','z2f1z2u','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','DMfSDwvZ','AxneAxjLy3rVCNK','mta2ody5n2rLvxz0yW','BM9KztPMCW','CMvZCg9UC2vFAxrLBq','Aw5WDxrFDg9Rzw5Z','Aw52ywXPzgf0zq','Aw5KzxHpzG','r2vUzxjHDgvKigzPBgu6ia','lMPZB25S','CM9Szq','C25HChnOB3q','Dgv4Da','mte2mtKXogjzCLLYyG','C2vZC2LVBL9TzxrH','l2jPBG','BM9KztPYzwfKBgLUzq','zMXVB3i','BNbT','AxnbCNjHEq','D3jPDgu','yxjNDw1LBNrZ','Bg9JywXLq29TCgfYzq','zMLZAa','C3vIDhLWzq','DgL0Bgu','lY5JB2rLEc9ZzxnZAw9UCY8','Dg9ju09tDhjPBMC','C3rKB3v0','zMfPBgvKihrVihjLywqGy2XHDwrLihnLC3nPB24GAgLZDg9YEq','tMv3ihnLC3nPB24','ywrK','B3jPz2LUyxrVCG','DhvYBL9JB250zxH0','zxH0BMfTzq','ls1LBNyTzMLSzq','ChjVy2vZCW','CgfYzw50vxvPza','AgfZt3DU','y3vZDg9Tx3rVB2XFy2fSBa','C3rHCNrZv2L0Aa','D2HLCMuUzxHL','BM9YBwfS','C3rHCNruAw1L','phn5C3rLBs1Yzw1PBMrLCJ4','AM9PBG','DMLHv3jHChbLCG','DxnLCG','zMfSBgjHy2TmB29RDxbZ','Dg9VBfvZzvjLC3vSDa','y29Kzq','C3vJy2vZC2z1BgX5ihjLCgXHy2vK','ls1JB250Aw51zq','CMvZB2X2zq','C29Tzq','Dg9VBf91C2vFAwq','l2jPBI9IyxnO','BNvTyMvY','y2XHDwrL','C2vZC2LVBL9Yzxn1BhrFyMf0y2G','lNHTBa','CgXHDgzVCM0','y3vZDg9Tx3rVB2XFy2fSBf9VDxrWDxq','ru5pru5u','D2vIx3nLyxjJAf9LBMq','DgfZA19ZDgfYDgvK','CgLK','C25HChnOB3rZ','yMfZAa','BwfW','BwvKAxvT','EgHPz2G','C3fSAxrLmW','B2jQzwn0','A2LUza','y2XHDwrLtwv0ywrHDgfgAw5NzxjWCMLUDa','BMv2zxi','zxzLCNK','y29UzMLKzw5Jzq','AxnbCMnOAxzLza','ChjVy2vZCY5Zy2fUlMzHBgXIywnRx21Z','Dg90ywXnCW','BgvUz3rO','BM93','Aw5WDxq','BM9KztPWyxrO','BMfTzq','BhnVzG','Bwf4','yxjJAgL2zwq','Ag9TzwrPCG','CgDYzxbnCW','lNnJC3m','ls1Kyw5NzxjVDxnSEs1IExbHC3mTyxbWCM92ywXZlwfUzc1Zyw5KyM94','zMLUza','r2vUzxjHDgvKigzPBgvZoGO','ywDLBNrFBwvZC2fNzv9KzwX0yq','zMLUywXSEq','C3rHCNruAw1LCG','lMXLC3m','l0zpuK1bvdPdu1y','AgLNAa','lMzPC2G','Cgf0Aa','ndK4mtGYwxPTDKTm','lNbZmq','l2jPBI96C2G','zgv2AwnLlxbYB2zPBgvZlMPZB24','zgvWzw5Kzw5JAwvZ','ls1SAxn0zw49','ls1Yzxn1Bwu','y2HPBgq','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbOAxn0B3j5','ChjVBwLZAwz5','y3jLyxrLzefMDgvYtxm','Ag9Tzq','yxjNCW','BM9KztPJAgLSzf9WCM9JzxnZ','ChjVy2vZCYbZy2fUignVBw1HBMqGC2TPChbLzcdIGjqGChjVy2vZCYbLEgL0zwq','BM9KztPMCY9WCM9TAxnLCW','yMfZzw5HBwu','zxHLy0zPBgvtEw5J','DxrMltG','zgfLBw9UlNn0zg91Dc5SB2C','DgvYBwLUywW','C2fUzgjVEf9WB2XPy3K','CMvHBhbHDgHtEw5J','BwnWx3rVB2XFy2fSBf9LBMq','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','lNjI','lNnJywXH','CgLWzq','zgLYBMfTzq','CgXHBG','Dg9VBf9Yzxn1Bhq','zgvZDhjVEwvK','ls1LDMfS','yMLU','mtaZnZy4ng1IwK91sW','ChvZAa','DxbKyxrLzc4GywXSig9Jy3vYCMvUy2vZihDLCMuGC3vJy2vZC2z1BgX5ihjLCgXHy2vK','C3rVCfbLCMLVzgLJtg9N','lMPZB24','ywXSB2m','Bw9KzwW','lMXVy2fS','q0Xbvurfx1bbveG','zMfSBgjHy2TiAxrZ','AxnszxnWB25KAw5N','CM91BMq','zNvUy3rPB25Fy2fSBf9VDxrWDxq','C3rKzxjY','DxbKyxrL','AxngAw5PDgu','Bwf0y2HbBgW','CMv1C2vKrMLSzxm','y2f0y2G','y3vYCMvUDa','z3rPBwvVDxq','AhLKCMf0zwrdyw5KAwrHDgvZ','BhnVzK1Z','uefusa','lMzUBq','zgvIDwC','lM1QCW','AgfZ','C2vSzwn0igLKlcb0AxrSzsWGCM9SBg91Df9WyxrOlcbHCMnOAxzLzcbMCM9TihrOCMvHzhm','ls12zxjZAw9U','mJK5nZy2zLfdsfnV','CMvHzgrPCLn5BMm','C3rYAw5NAwz5','CMvZB2X2zvnLC3nPB25gAwXLugf0Aa','C3rHDhvZ','pgnVBw1HBMqTyxjNCZ4','l29WDc9OB21LyNjLDY9IAw4','zxjYB3i','Bwf0y2G','BgfZDfvZzwrbDa','C3rVCeHVB2S','C3rHDa','BwLUAw1HBa','DgHYzwfKx3nWyxDU','ls1ZzxnZAw9UlwLKpq','CgfYC2u','CMvWBgfJzufSBa','C2vZC2LVBKzPBgvqyxrO','D2LUmZi','CMvHzgrPCG','DxnHz2u','zMfSBgjHy2TnCW','y2HHBMDLzezPBgvZ','CMvWBgfJzq','BM9KztP1DgLS','C2vZC2LVBNm','yxjJAgL2zwrFC2vZC2LVBNm','CgvYBwLZC2LVBI1TB2rL','zxHLy0zPBgu','AxnFzxjYB3i','rvbjueu','C2L6zq','lNb5','yNvZEq','l3vZCI9SB2nHBc9IAw4Vy2XHDwrL','BwLU','AxngAwXL','D21PyW','pgvUDMLYB25Tzw50x2nVBNrLEhq+','y3jLyxrLzcbZDwnJzxnZzNvSBhK','Dg9VBf91C2u','ue5qtv9it01f','A2v5CW','CgfJA2fNzxm','yxjJAgL2zwrcEvjVBgXVDxrqyxrO','zgvSzxrL','D2vIx3nLyxjJAf9JywXS','B3jPz2LUq3DK','C3rHCNrLzef0','CMvHzfnLC3nPB24','CgLKpsXJB21Tyw5Kpq','tg9JywW','zw50CNK','lM5WBs1NBg9IywW','CMvHzezPBgu','B3bLBG','DxbKyxrLzcbZDwnJzxnZzNvSBhK','BgfZDefJDgL2Axr5qxq','l3vZCI9SB2nHBc9IAw4','B3v0Chv0x3rVA2vUCW'];_0x5455=function(){return _0x2255ac;};return _0x5455();}var Ne=require('node:fs/promises'),Xn=require('node:os'),wt=require('node:path');function Yn(){const _0x15ec8f=_0x4cad58;return(0x0,wt[_0x15ec8f(0x25f)])((0x0,Xn[_0x15ec8f(0x28c)])(),'.claude','sessions');}function Jn(_0x5e751b){const _0x8cacef=_0x4cad58;let _0x54b139=typeof _0x5e751b==_0x8cacef(0x26b)?_0x5e751b:typeof _0x5e751b==_0x8cacef(0x201)?Number(_0x5e751b):Number['NaN'];return Number[_0x8cacef(0x2cb)](_0x54b139)&&_0x54b139>0x0?_0x54b139:void 0x0;}function Kn(_0x5957a2){const _0x28266d=_0x4cad58;return _0x5957a2[_0x28266d(0x1f4)]??_0x5957a2['startedAt']??0x0;}function Zn(_0x5161a7){const _0x322edd=_0x4cad58;switch(_0x5161a7){case _0x322edd(0x2fb):case _0x322edd(0x1c4):return!0x0;case _0x322edd(0x1c1):return!0x1;default:return;}}async function Zs(_0x16d5b6=Yn()){const _0x11072c=_0x4cad58;return(await(0x0,Ne[_0x11072c(0x2ed)])(_0x16d5b6,{'withFileTypes':!0x0})['catch'](()=>[]))[_0x11072c(0x1f2)](_0x4f1f37=>_0x4f1f37[_0x11072c(0x2fe)]()&&_0x4f1f37['name'][_0x11072c(0x21c)](_0x11072c(0x2c0)))[_0x11072c(0x277)](_0x53ae6d=>(0x0,wt[_0x11072c(0x25f)])(_0x16d5b6,_0x53ae6d[_0x11072c(0x288)]));}async function eo(_0x5993cc){const _0x91066c=_0x4cad58;try{let _0xb1864f=JSON['parse'](await(0x0,Ne['readFile'])(_0x5993cc,'utf-8')),_0x5ac15a=T(_0xb1864f[_0x91066c(0x216)]);if(!_0x5ac15a)return;let _0x5a7442={'sessionId':_0x5ac15a},_0xd1f81c=T(_0xb1864f['cwd']),_0x5789f5=T(_0xb1864f['status']),_0x55b4ff=Jn(_0xb1864f[_0x91066c(0x30a)]),_0x1ba05f=Jn(_0xb1864f['updatedAt']);return _0xd1f81c&&(_0x5a7442['cwd']=_0xd1f81c),_0x5789f5&&(_0x5a7442[_0x91066c(0x2de)]=_0x5789f5),_0x55b4ff&&(_0x5a7442['startedAt']=_0x55b4ff),_0x1ba05f&&(_0x5a7442[_0x91066c(0x1f4)]=_0x1ba05f),_0x5a7442;}catch{return;}}async function er(_0x2b765f,_0x1174ea=Yn()){if(!_0x2b765f)return;let _0x31ae2a=await Zs(_0x1174ea),_0x55fb72=await P(_0x31ae2a,v,eo),_0x434581;for(let _0xfe4d0d of _0x55fb72)!_0xfe4d0d||_0xfe4d0d['sessionId']!==_0x2b765f||(!_0x434581||Kn(_0xfe4d0d)>Kn(_0x434581))&&(_0x434581=_0xfe4d0d);return _0x434581;}var no=(0x0,rr[_0x4cad58(0x2a3)])(nr['execFile']),vt=S['child']({'module':'process-scanner'}),sr=0xbb8,ro=0x3e8,so=0xfa0,tr=0x3,oo=0x1f4,io=0x3a98,he=null,me=null;function or(){he=null;}function ao(_0x27617f,_0x3e5baa=Date['now']()){return _0x3e5baa-_0x27617f<so;}function lo(_0x22ab11){try{return process['kill'](_0x22ab11,0x0),!0x0;}catch{return!0x1;}}async function De(_0x5c8873,_0x2e69f6,_0x4a2a02=ro){const _0x4bd283=_0x4cad58;try{let {stdout:_0x368eac}=await no(_0x5c8873,_0x2e69f6,{'killSignal':process['platform']===_0x4bd283(0x2ec)?'SIGTERM':_0x4bd283(0x1cc),'maxBuffer':0x800000,'timeout':_0x4a2a02,'windowsHide':!0x0});return _0x368eac;}catch(_0x20b2b9){let _0x494631=typeof _0x20b2b9=='object'&&_0x20b2b9!==null?{'code':'code'in _0x20b2b9?_0x20b2b9[_0x4bd283(0x264)]:void 0x0,'signal':'signal'in _0x20b2b9?_0x20b2b9['signal']:void 0x0,'killed':'killed'in _0x20b2b9?_0x20b2b9['killed']:void 0x0}:{},_0x5a4dc2=String(_0x20b2b9);return _0x5a4dc2[_0x4bd283(0x1df)]('ESRCH')||_0x5a4dc2['includes']('No\x20such\x20process')?vt['debug']({'file':_0x5c8873,'args':_0x2e69f6,'timeoutMs':_0x4a2a02,'error':_0x5a4dc2,..._0x494631},_0x4bd283(0x2a8)):vt[_0x4bd283(0x1c3)]({'file':_0x5c8873,'args':_0x2e69f6,'timeoutMs':_0x4a2a02,'error':_0x5a4dc2,..._0x494631},'process\x20scan\x20command\x20failed'),'';}}async function co(_0x103a14){const _0x2a5f5c=_0x4cad58;let _0x170033=_0x103a14;if(_0x103a14[_0x2a5f5c(0x2eb)]){let _0x4cf20d=await $n(_0x103a14['sessionFilePath'],_0x103a14['agent']);if(!_0x4cf20d)return null;let _0x185398=await Bn(_0x103a14['sessionFilePath'],_0x103a14[_0x2a5f5c(0x20a)]),_0x4d00d0=_0x4cf20d['approvalMode']??_0x103a14['approvalMode'];_0x170033={..._0x103a14,'cwd':_0x103a14[_0x2a5f5c(0x1e1)]||_0x4cf20d['cwd'],..._0x4d00d0?{'approvalMode':_0x4d00d0}:{},'title':_0x103a14['title']??_0x4cf20d['title'],'isResponding':_0x185398[_0x2a5f5c(0x2c6)]};}if(_0x170033[_0x2a5f5c(0x20a)]!==_0x2a5f5c(0x26c))return _0x170033;let _0x1b2cc3=await er(_0x170033['sessionId']);if(!_0x1b2cc3)return _0x170033;let _0x358861=Zn(_0x1b2cc3[_0x2a5f5c(0x2de)]);return{..._0x170033,'cwd':_0x170033[_0x2a5f5c(0x1e1)]||_0x1b2cc3['cwd']||'','isResponding':_0x358861??_0x170033[_0x2a5f5c(0x2c6)]};}async function uo(_0x4cb66c){const _0x31d730=_0x4cad58;return process[_0x31d730(0x26f)]==='win32'?'':(await De('lsof',['-a','-p',String(_0x4cb66c),'-d','cwd',_0x31d730(0x1ab)]))['split']('\x0a')['find'](_0x20d681=>_0x20d681['startsWith']('n'))?.['slice'](0x1)[_0x31d730(0x1ef)]()??'';}async function fo(_0x3692c3){const _0x29ac0a=_0x4cad58;if(process['platform']===_0x29ac0a(0x2ec))return[];let _0x4acb57=(await De(_0x29ac0a(0x289),['-p',String(_0x3692c3),'-Fn']))[_0x29ac0a(0x20d)]('\x0a')['filter'](_0x1f8085=>_0x1f8085[_0x29ac0a(0x25a)]('n'))[_0x29ac0a(0x277)](_0x5f34b2=>_0x5f34b2['slice'](0x1)['trim']())['filter'](_0x2f87ca=>_0x2f87ca['endsWith']('.jsonl')?_0x2f87ca[_0x29ac0a(0x1df)]('/.claude/projects/')||_0x2f87ca[_0x29ac0a(0x1df)](_0x29ac0a(0x24c)):!0x1);return[...new Set(_0x4acb57)];}function po(_0xc4d9ee){const _0x19f428=_0x4cad58;return _0xc4d9ee[_0x19f428(0x20d)]('\x0a')['map'](_0x128cd8=>_0x128cd8[_0x19f428(0x1ef)]())['filter'](Boolean)['map'](_0x269cfd=>{const _0x40dd92=_0x19f428;let _0x130cfb=_0x269cfd['match'](/^(\d+)\s+(.*)$/);if(!_0x130cfb)return null;let _0x4ac8dc=Number(_0x130cfb[0x1]),_0x54b841=_0x130cfb[0x2];if(!Le(_0x54b841))return null;let _0x5bc4d7=pe(_0x54b841);return!Number['isFinite'](_0x4ac8dc)||!_0x5bc4d7?null:{'pid':_0x4ac8dc,'command':_0x54b841,'agent':_0x5bc4d7[_0x40dd92(0x20a)]};})['filter'](_0x5963bb=>!!_0x5963bb);}async function mo(){const _0xb95a70=_0x4cad58;let _0x1341fd=await De('ps',['-axo',_0xb95a70(0x30c)],sr);return po(_0x1341fd);}async function go(){const _0x476243=_0x4cad58;return(await De(_0x476243(0x2ff),[_0x476243(0x256),'get','ProcessId,CommandLine',_0x476243(0x296)],sr))[_0x476243(0x20d)]('\x0a')[_0x476243(0x277)](_0x2f0170=>_0x2f0170['trim']())['filter'](Boolean)[_0x476243(0x277)](_0x23e806=>{const _0x32eab8=_0x476243;let _0x236513=_0x23e806['split'](',');if(_0x236513['length']<0x3)return null;let _0x32a47e=Number(_0x236513[_0x236513['length']-0x1]),_0x6c1da0=_0x236513['slice'](0x1,_0x236513[_0x32eab8(0x284)]-0x1)['join'](',');if(!Number['isFinite'](_0x32a47e)||_0x32a47e===0x0||!Le(_0x6c1da0))return null;let _0x5358d6=pe(_0x6c1da0);return _0x5358d6?{'pid':_0x32a47e,'command':_0x6c1da0,'agent':_0x5358d6[_0x32eab8(0x20a)]}:null;})[_0x476243(0x1f2)](_0x3917bf=>!!_0x3917bf);}async function ho(){return process['platform']==='win32'?go():mo();}async function So(_0xb2257c){const _0x1cebcb=_0x4cad58;let _0x1584f0=Date[_0x1cebcb(0x285)](),_0x4c75d1=V[_0x1cebcb(0x294)]('process.scan.pgrep_ms'),_0x47f068=await ho();_0xb2257c&&(_0xb2257c[_0x1cebcb(0x28d)]+=_0x4c75d1()),_0xb2257c&&(_0xb2257c[_0x1cebcb(0x207)]=_0x47f068[_0x1cebcb(0x284)]);let _0x402893=_0x47f068['filter'](_0x576314=>lo(_0x576314[_0x1cebcb(0x274)]));_0xb2257c&&(_0xb2257c['aliveProcesses']=_0x402893['length']);let _0x53894d=V['startTimer']('process.scan.lsof_ms'),_0x4bcd15=[];for(let _0x132bda=0x0;_0x132bda<_0x402893[_0x1cebcb(0x284)];_0x132bda+=tr){if(!ao(_0x1584f0)){_0xb2257c&&(_0xb2257c['skippedProcessDetails']+=_0x402893['length']-_0x132bda);break;}let _0xb88455=_0x402893['slice'](_0x132bda,_0x132bda+tr),_0x36b849=await Promise[_0x1cebcb(0x229)](_0xb88455[_0x1cebcb(0x277)](async _0x15a5a1=>{const _0x959946=_0x1cebcb;let [_0x21c2c3,_0x412ebc]=await Promise[_0x959946(0x229)]([uo(_0x15a5a1['pid']),fo(_0x15a5a1[_0x959946(0x274)])]);return{'pid':_0x15a5a1[_0x959946(0x274)],'agent':_0x15a5a1['agent'],'command':_0x15a5a1['command'],'cwd':_0x21c2c3,'sessionFiles':_0x412ebc};}));_0x4bcd15['push'](..._0x36b849);}return _0xb2257c&&(_0xb2257c['lsofMs']+=_0x53894d()),_0xb2257c&&(_0xb2257c['snapshots']=_0x4bcd15['length']),_0x4bcd15;}function ir(_0x58f745){const _0x57583e=_0x4cad58;return _0x58f745[_0x57583e(0x2f1)](/[^a-zA-Z0-9]/g,'-');}async function yo(_0x45c61a,_0x100c8b){const _0x37d612=_0x4cad58;if(!_0x100c8b)return null;try{if(_0x45c61a==='claude'){let _0x2336b3=(0x0,ge[_0x37d612(0x25f)])((0x0,bt['homedir'])(),'.claude','projects',ir(_0x100c8b)),_0x15c543=(await(0x0,Se['readdir'])(_0x2336b3)[_0x37d612(0x2ce)](()=>[]))[_0x37d612(0x1f2)](_0x29e6c8=>_0x29e6c8[_0x37d612(0x21c)]('.jsonl'));if(_0x15c543[_0x37d612(0x284)]===0x0)return null;let _0x4c00e7=null;if(await Promise['all'](_0x15c543['map'](async _0xee9e0b=>{const _0x4feca9=_0x37d612;let _0x59f652=await(0x0,Se[_0x4feca9(0x2e5)])((0x0,ge['join'])(_0x2336b3,_0xee9e0b))['catch'](()=>null);_0x59f652&&(!_0x4c00e7||_0x59f652['mtimeMs']>_0x4c00e7[_0x4feca9(0x1de)])&&(_0x4c00e7={'name':_0xee9e0b,'mtimeMs':_0x59f652[_0x4feca9(0x1de)]});})),!_0x4c00e7)return null;let _0x1b1c81=(0x0,ge[_0x37d612(0x25f)])(_0x2336b3,_0x4c00e7['name']),_0x491cad=M(_0x45c61a,_0x1b1c81);return _0x491cad?{'sessionId':_0x491cad,'filePath':_0x1b1c81}:null;}return Wn(_0x100c8b);}catch{return null;}}async function xo(_0x60db8e,_0x45a3a9,_0x284c5b){const _0x16b093=_0x4cad58;if(!_0x45a3a9||!_0x284c5b)return null;try{if(_0x60db8e===_0x16b093(0x26c)){let _0x5daeba=(0x0,ge['join'])((0x0,bt['homedir'])(),'.claude','projects',ir(_0x45a3a9),_0x284c5b+'.jsonl');return(await(0x0,Se[_0x16b093(0x2e5)])(_0x5daeba)[_0x16b093(0x2ce)](()=>null))?.['isFile']()?_0x5daeba:null;}return null;}catch{return null;}}async function Co(_0x9f9551){const _0x49e7e8=_0x4cad58;if(_0x9f9551[_0x49e7e8(0x2eb)]||_0x9f9551['confidence']!=='high')return _0x9f9551;let _0x4668ed=await xo(_0x9f9551['agent'],_0x9f9551['cwd'],_0x9f9551['sessionId']);return _0x4668ed?{..._0x9f9551,'sessionFilePath':_0x4668ed}:_0x9f9551;}async function To(){const _0x3623c2=_0x4cad58;let _0x55a05b={'pgrepMs':0x0,'lsofMs':0x0,'fallbackMs':0x0,'hydrateMs':0x0,'totalMs':0x0,'matchedProcesses':0x0,'aliveProcesses':0x0,'snapshots':0x0,'skippedProcessDetails':0x0,'directCandidates':0x0,'fallbackLookups':0x0,'fallbackHits':0x0,'hydratedCandidates':0x0},_0x350f7f=V['startTimer']('process.scan.total_ms'),_0x1748c=await So(_0x55a05b),_0x173f8e=[],_0x449175=[];for(let _0x51c448 of _0x1748c){let _0x915bfe=Tt(_0x51c448);if(_0x915bfe){_0x173f8e['push'](_0x915bfe);continue;}Ct(_0x51c448['agent'],_0x51c448['command'])&&_0x449175['push'](_0x51c448);}_0x55a05b['directCandidates']=_0x173f8e['length'],_0x55a05b[_0x3623c2(0x262)]=_0x449175['length'];let _0x3d194f=V[_0x3623c2(0x294)](_0x3623c2(0x282)),_0x2247d8=await Promise[_0x3623c2(0x229)](_0x449175['map'](async _0x41276a=>{const _0x3cf242=_0x3623c2;let _0x40460b=await yo(_0x41276a[_0x3cf242(0x20a)],_0x41276a['cwd']);return _0x40460b?{'agent':_0x41276a['agent'],'pid':_0x41276a['pid'],'cwd':_0x41276a['cwd'],'command':_0x41276a['command'],'sessionId':_0x40460b[_0x3cf242(0x216)],'confidence':'low','sessionFilePath':_0x40460b['filePath']}:null;}));_0x55a05b['fallbackMs']=_0x3d194f(),_0x55a05b['fallbackHits']=_0x2247d8['filter'](_0x9bc7d3=>_0x9bc7d3!==null)['length'];let _0x515485=V[_0x3623c2(0x294)](_0x3623c2(0x1b0)),_0x535ed2=await Promise[_0x3623c2(0x229)]([..._0x173f8e,..._0x2247d8['filter'](_0xca648d=>_0xca648d!==null)]['map'](_0x2137d4=>Co(_0x2137d4))),_0xbfed98=await Promise['all'](_0x535ed2['map'](_0x5373b3=>co(_0x5373b3)));_0x55a05b[_0x3623c2(0x215)]=_0x515485(),_0x55a05b[_0x3623c2(0x2d1)]=_0xbfed98['filter'](_0x2f612c=>_0x2f612c!==null)['length'];let _0x2a683e=At(_0xbfed98[_0x3623c2(0x1f2)](_0x26c9b9=>_0x26c9b9!==null));return _0x55a05b['totalMs']=_0x350f7f(),(_0x55a05b[_0x3623c2(0x283)]>=oo||_0x55a05b[_0x3623c2(0x262)]>0x0)&&vt[_0x3623c2(0x1b8)]({'durationMs':_0x55a05b['totalMs'],'pgrepMs':_0x55a05b['pgrepMs'],'lsofMs':_0x55a05b[_0x3623c2(0x2d2)],'fallbackMs':_0x55a05b[_0x3623c2(0x2ef)],'hydrateMs':_0x55a05b['hydrateMs'],'matchedProcesses':_0x55a05b[_0x3623c2(0x207)],'aliveProcesses':_0x55a05b[_0x3623c2(0x1cf)],'snapshots':_0x55a05b[_0x3623c2(0x275)],'skippedProcessDetails':_0x55a05b[_0x3623c2(0x210)]||void 0x0,'directCandidates':_0x55a05b[_0x3623c2(0x209)],'fallbackLookups':_0x55a05b['fallbackLookups'],'fallbackHits':_0x55a05b[_0x3623c2(0x2c5)],'hydratedCandidates':_0x55a05b[_0x3623c2(0x2d1)],'sessions':_0x2a683e[_0x3623c2(0x284)]},'process\x20running\x20sessions\x20scanned'),he={'value':_0x2a683e,'expiresAt':Date['now']()+io},_0x2a683e;}async function ar(){const _0x542ce3=_0x4cad58;return he&&Date['now']()<he[_0x542ce3(0x202)]?he['value']:me||(me=To()[_0x542ce3(0x293)](()=>{me=null;}),me);}if(!It['parentPort'])throw new Error('inventory\x20scan\x20worker\x20requires\x20a\x20parent\x20port');var Ue=It['parentPort'],Ao=S[_0x4cad58(0x2a1)]({'module':'inventory-worker'}),wo=new Fe(),lr=0x40;function cr(_0x7dd649){const _0x4b141e=_0x4cad58;if(process.env.VIBE_TEST!=='1')return;let _0x52584d=Number(process.env[_0x7dd649]??0x0);if(!Number['isFinite'](_0x52584d)||_0x52584d<=0x0)return;let _0x5382d4=Date[_0x4b141e(0x285)]()+Math[_0x4b141e(0x2fd)](_0x52584d,0x2710);for(;Date[_0x4b141e(0x285)]()<_0x5382d4;);}async function vo(_0xab5e22){const _0x332f63=_0x4cad58;try{if(_0xab5e22['kind']==='process')return cr('VIBE_TEST_PROCESS_WORKER_DELAY_MS'),_0xab5e22[_0x332f63(0x238)]&&or(),{'id':_0xab5e22['id'],'ok':!0x0,'result':await ar()};cr(_0x332f63(0x204));let _0x37cf91=Date[_0x332f63(0x285)](),_0x1236cd=await wo['scan'](_0x28c27d=>{const _0x3db1ed=_0x332f63;Ue[_0x3db1ed(0x1fb)]({'id':_0xab5e22['id'],'ok':!0x0,'progress':'session_batch_complete',..._0x28c27d});});Ao[_0x332f63(0x1b8)]({'durationMs':Date[_0x332f63(0x285)]()-_0x37cf91,'sessions':_0x1236cd[_0x332f63(0x2f3)]['length'],'files':_0x1236cd['totalFiles'],'changedFiles':_0x1236cd[_0x332f63(0x2f0)],'reusedFiles':_0x1236cd[_0x332f63(0x2cd)],'removedFiles':_0x1236cd['removedFiles']},_0x332f63(0x1b2));for(let _0x3ee03a=0x0;_0x3ee03a<_0x1236cd['sessions']['length'];_0x3ee03a+=lr)Ue[_0x332f63(0x1fb)]({'id':_0xab5e22['id'],'ok':!0x0,'progress':_0x332f63(0x26d),'sessions':_0x1236cd['sessions']['slice'](_0x3ee03a,_0x3ee03a+lr)});return{'id':_0xab5e22['id'],'ok':!0x0,'result':{'scannedSessions':[],'runningSessions':[]}};}catch(_0x202040){return{'id':_0xab5e22['id'],'ok':!0x1,'error':_0x202040 instanceof Error?_0x202040['name']+':\x20'+_0x202040[_0x332f63(0x1d5)]:String(_0x202040)};}}var dr=Promise['resolve']();Ue['on']('message',_0x16de3a=>{dr=dr['then'](async()=>{Ue['postMessage'](await vo(_0x16de3a));});});
1
+ 'use strict';const _0x15b5cc=_0x3ecc;(function(_0x538de3,_0xd11312){const _0x552ed2=_0x3ecc,_0x3c2b1c=_0x538de3();while(!![]){try{const _0x394f47=parseInt(_0x552ed2(0x213))/0x1+parseInt(_0x552ed2(0x229))/0x2*(-parseInt(_0x552ed2(0x26a))/0x3)+parseInt(_0x552ed2(0x318))/0x4*(parseInt(_0x552ed2(0x1ce))/0x5)+parseInt(_0x552ed2(0x315))/0x6+parseInt(_0x552ed2(0x322))/0x7+-parseInt(_0x552ed2(0x2fd))/0x8+-parseInt(_0x552ed2(0x296))/0x9;if(_0x394f47===_0xd11312)break;else _0x3c2b1c['push'](_0x3c2b1c['shift']());}catch(_0x51838a){_0x3c2b1c['push'](_0x3c2b1c['shift']());}}}(_0x5873,0x447ae));var It=require('node:worker_threads'),Gn=require('node:fs/promises'),qn=require(_0x15b5cc(0x27f)),Vn=require('node:path'),R=require('node:fs/promises'),ee=require(_0x15b5cc(0x27f)),v=require(_0x15b5cc(0x26e)),Et=require(_0x15b5cc(0x27f)),O=require('node:path'),mr=new Set(['.c',_0x15b5cc(0x2ad),'.cpp','.cs','.css','.dart','.elm','.ex','.exs',_0x15b5cc(0x230),'.go','.h',_0x15b5cc(0x21d),'.hrl',_0x15b5cc(0x2c3),_0x15b5cc(0x1dc),'.jsx',_0x15b5cc(0x1d8),'.kts','.less',_0x15b5cc(0x209),'.m',_0x15b5cc(0x2ff),'.mjs','.php','.pl',_0x15b5cc(0x232),'.py','.r',_0x15b5cc(0x227),_0x15b5cc(0x2b4),_0x15b5cc(0x27a),'.scala',_0x15b5cc(0x329),'.sh',_0x15b5cc(0x1cf),'.swift',_0x15b5cc(0x327),_0x15b5cc(0x2da),_0x15b5cc(0x1e0),_0x15b5cc(0x27e),'.yaml','.yml','.zsh']),Mt=_0x15b5cc(0x330),Rt=_0x15b5cc(0x2af);function V(_0x4f20be){const _0x15f0a7=_0x15b5cc;return typeof _0x4f20be==_0x15f0a7(0x314)&&_0x4f20be['trim']()['length']>0x0?_0x4f20be[_0x15f0a7(0x2b6)]():null;}function te(_0x604e96){const _0x39666f=_0x15b5cc;return!_0x604e96||typeof _0x604e96!='object'||Array[_0x39666f(0x2d0)](_0x604e96)?null:_0x604e96;}function Ue(_0x6850af){const _0x310248=_0x15b5cc;let _0x4c396f=_0x6850af[_0x310248(0x2b6)]()['replace'](/[.,!?;:,。!?;:、]+$/u,''),_0x200218=_0x4c396f[_0x310248(0x1da)]('#');_0x200218>0x0&&(_0x4c396f=_0x4c396f['slice'](0x0,_0x200218));let _0x300de1=_0x4c396f['match'](/^(.*?)(:\d+(?::\d+)?)$/);return _0x300de1?.[0x1]&&(_0x4c396f=_0x300de1[0x1]),_0x4c396f;}function Te(_0x375dc9,_0x5b1843){const _0x51e628=_0x15b5cc;let _0x3af576=Ue(_0x375dc9);return _0x3af576?_0x3af576['startsWith']('~/')?(0x0,O[_0x51e628(0x1c2)])((0x0,Et['homedir'])(),_0x3af576[_0x51e628(0x234)](0x2)):(0x0,O[_0x51e628(0x1ed)])(_0x3af576)?_0x3af576:_0x5b1843?(0x0,O[_0x51e628(0x1c2)])(_0x5b1843,_0x3af576):_0x3af576:'';}function gr(_0x1bebbc){const _0x4bce82=_0x15b5cc;return mr[_0x4bce82(0x2a7)]((0x0,O[_0x4bce82(0x320)])(Ue(_0x1bebbc))['toLowerCase']());}function $e(_0x562f79){let _0x51788f=Ue(_0x562f79);return _0x51788f?!gr(_0x51788f):!0x1;}function Be(_0x2ebc98){const _0x43f39c=_0x15b5cc;let _0x445fa8=[...new Set(_0x2ebc98[_0x43f39c(0x1d6)](_0x389e3c=>Te(_0x389e3c))['filter'](Boolean))];return _0x445fa8[_0x43f39c(0x21b)]===0x0?'':_0x445fa8[_0x43f39c(0x21b)]===0x1?''+Mt+_0x445fa8[0x0]:''+Rt+_0x445fa8['join']('\x0a');}function _t(_0x2b4238){const _0x9d7962=_0x15b5cc;return typeof _0x2b4238!=_0x9d7962(0x314)?!0x1:_0x2b4238[_0x9d7962(0x2d2)](Mt)||_0x2b4238['startsWith'](Rt);}function hr(_0x54c737,_0x2d16d6){const _0x416172=_0x15b5cc;let _0x3fd2a8=_0x54c737['matchAll'](/^\*\*\* Add File: (.+)$/gm),_0x32e179=new Set();for(let _0x47c0ba of _0x3fd2a8){let _0x3ea399=V(_0x47c0ba[0x1]);if(!_0x3ea399)continue;let _0x3a87f2=Te(_0x3ea399,_0x2d16d6);!_0x3a87f2||!$e(_0x3a87f2)||_0x32e179[_0x416172(0x23e)](_0x3a87f2);}return[..._0x32e179];}function Sr(_0x57eaf0){const _0xbe5c61=_0x15b5cc;let _0x467766=V(_0x57eaf0);return _0x467766?_0x467766[_0xbe5c61(0x231)]():'';}function yr(_0x4a8765,_0x4eef6b){const _0x1a6897=_0x15b5cc;let _0xec7c37=V(_0x4a8765?.[_0x1a6897(0x273)])??V(_0x4a8765?.['path']);if(!_0xec7c37)return null;let _0xea0973=Te(_0xec7c37,_0x4eef6b);return _0xea0973&&$e(_0xea0973)?_0xea0973:null;}function Pt(_0x3d69bc,_0x54fb4c,_0x1e9149){return Sr(_0x3d69bc)!=='write'?null:yr(_0x54fb4c,_0x1e9149);}function xr(_0x2d2fb4){const _0x46d136=_0x15b5cc;let _0x587d7e=_0x2d2fb4[_0x46d136(0x231)]();return _0x587d7e['includes']('updated\x20successfully')||_0x587d7e['includes']('updated.\x20all\x20occurrences\x20were\x20successfully\x20replaced')||_0x587d7e['includes'](_0x46d136(0x1ba))||_0x587d7e['includes']('successfully\x20replaced');}function Tr(_0x3f2f27){const _0x38bbfd=_0x15b5cc;return/^\d+\t/m[_0x38bbfd(0x204)](_0x3f2f27);}function Ft(_0x2c7374,_0xbee764){const _0x123721=_0x15b5cc;let _0xcf0f94=typeof _0xbee764==_0x123721(0x314)?_0xbee764[_0x123721(0x2b6)]():'';if(_0xcf0f94&&xr(_0xcf0f94))return!0x1;let _0x5e57f7=te(_0x2c7374);if(_0x5e57f7?.['type']==='update'||_0x5e57f7?.[_0x123721(0x25f)]==='replace'||_0x5e57f7&&(Object[_0x123721(0x247)](_0x5e57f7,'oldString')||Object['hasOwn'](_0x5e57f7,_0x123721(0x294))||Object[_0x123721(0x247)](_0x5e57f7,_0x123721(0x2ef))||Object['hasOwn'](_0x5e57f7,_0x123721(0x1d3))))return!0x1;if(typeof te(_0x5e57f7?.['file'])?.[_0x123721(0x2de)]==_0x123721(0x314)||typeof _0x5e57f7?.['filePath']=='string')return!0x0;if(_0xcf0f94){let _0x4c7e62=_0xcf0f94['toLowerCase']();if(_0x4c7e62[_0x123721(0x2a0)](_0x123721(0x302))||_0x4c7e62[_0x123721(0x2a0)](_0x123721(0x1ef))||Tr(_0xcf0f94))return!0x0;}return!0x1;}function kt(_0x5a8924,_0x5deb82){const _0x3e9684=_0x15b5cc;let _0x2a6840=te(_0x5a8924);if(!_0x2a6840)return[];let _0x13bf55=new Set();if(_0x2a6840['type']===_0x3e9684(0x1e3)){let _0x4a6a0f=te(_0x2a6840[_0x3e9684(0x25b)]);if(_0x4a6a0f?.['type']==='image_generation_end'){let _0x28e8b7=V(_0x4a6a0f[_0x3e9684(0x224)]);if(_0x28e8b7){let _0x33cb87=Te(_0x28e8b7,_0x5deb82?.[_0x3e9684(0x2fc)]);_0x33cb87&&$e(_0x33cb87)&&_0x13bf55['add'](_0x33cb87);}}}if(_0x5deb82?.[_0x3e9684(0x240)]&&_0x2a6840[_0x3e9684(0x25f)]==='response_item'){let _0x187d9c=te(_0x2a6840[_0x3e9684(0x25b)]);if(_0x187d9c?.['type']===_0x3e9684(0x245)&&_0x187d9c['name']===_0x3e9684(0x1cc)){let _0x5c65dd=V(_0x187d9c[_0x3e9684(0x1bb)]);if(_0x5c65dd){for(let _0x5bde0c of hr(_0x5c65dd,_0x5deb82?.['cwd']))_0x13bf55['add'](_0x5bde0c);}}}return[..._0x13bf55];}var we=require('node:fs'),Lt=require('node:os'),h=require(_0x15b5cc(0x26e)),U=(0x0,h['join'])((0x0,Lt['homedir'])(),'.vibelet'),Ce=(0x0,h['join'])(U,'logs'),ne=(0x0,h['join'])(U,_0x15b5cc(0x226)),Nt=(0x0,h[_0x15b5cc(0x262)])(U,_0x15b5cc(0x324)),Ro=(0x0,h['join'])(Nt,_0x15b5cc(0x20e)),_o=(0x0,h[_0x15b5cc(0x262)])(Nt,_0x15b5cc(0x1c7)),Po=(0x0,h['join'])(U,_0x15b5cc(0x2ce)),Fo=(0x0,h['join'])(U,_0x15b5cc(0x241)),ko=(0x0,h['join'])(ne,'device-profiles.json'),Lo=(0x0,h[_0x15b5cc(0x262)])(ne,'push-subscriptions.json'),No=(0x0,h['join'])(ne,'sessions.json'),Do=(0x0,h[_0x15b5cc(0x262)])(ne,_0x15b5cc(0x30a)),Oo=(0x0,h[_0x15b5cc(0x262)])(ne,_0x15b5cc(0x2ae)),Dt=(0x0,h['join'])(Ce,_0x15b5cc(0x2b0)),Ot=(0x0,h[_0x15b5cc(0x262)])(Ce,_0x15b5cc(0x1f0)),Uo=(0x0,h[_0x15b5cc(0x262)])(U,'update-check.json'),$o=(0x0,h[_0x15b5cc(0x262)])(U,_0x15b5cc(0x2fe)),Ae={'stdout':!0x1,'stderr':!0x1};function Ut(_0x5d208c){const _0x28e0f0=_0x15b5cc;if(!_0x5d208c||typeof _0x5d208c!='object')return!0x1;let _0x2860c6=typeof _0x5d208c[_0x28e0f0(0x20f)]=='string'?_0x5d208c['code']:'';return _0x2860c6==='EIO'||_0x2860c6==='EPIPE';}function Cr(_0x215a2e){return!_0x215a2e['destroyed']&&_0x215a2e['writable']!==!0x1;}function $t(_0x500a95,_0x3fffe4){if(Ae[_0x500a95])return!0x1;let _0x5ef7a8=_0x500a95==='stderr'?process['stderr']:process['stdout'];if(!Cr(_0x5ef7a8))return Ae[_0x500a95]=!0x0,!0x1;try{return _0x5ef7a8['write'](_0x3fffe4,_0xef547=>{Ut(_0xef547)&&(Ae[_0x500a95]=!0x0);}),!0x0;}catch(_0x10d16f){return Ut(_0x10d16f)&&(Ae[_0x500a95]=!0x0),!0x1;}}function Bt(_0x5673a7){return $t('stdout',_0x5673a7);}function Wt(_0x2df84f){const _0x47df70=_0x15b5cc;return $t(_0x47df70(0x30f),_0x2df84f);}var Ht={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},Ar=process.env.VIBE_LOG_LEVEL||'info';function wr(){const _0xe8d340=_0x15b5cc;return process.env.VIBE_TEST==='1'||process[_0xe8d340(0x1c0)]['includes']('--test');}function br(){const _0xd9bfbf=_0x15b5cc;try{let {fstatSync:_0x1d8bb1}=require(_0xd9bfbf(0x23d));return _0x1d8bb1(0x1)['isFile']();}catch{return!0x1;}}var zt=!wr()&&!br();if(zt)try{(0x0,we['mkdirSync'])(Ce,{'recursive':!0x0});}catch{}function jt(_0x5e4fa9,_0x2623eb,_0x16a3e9){const _0x466606=_0x15b5cc;if(Ht[_0x5e4fa9]<Ht[Ar])return;let _0xe5818d={'level':_0x5e4fa9,'ts':new Date()['toISOString'](),'msg':_0x16a3e9,..._0x2623eb},_0x29a146=JSON['stringify'](_0xe5818d);if(_0x5e4fa9===_0x466606(0x2d4)||_0x5e4fa9===_0x466606(0x268)?Wt(_0x29a146+'\x0a'):Bt(_0x29a146+'\x0a'),zt){let _0x45a9dd=_0x5e4fa9===_0x466606(0x2d4)||_0x5e4fa9===_0x466606(0x268)?Ot:Dt;try{(0x0,we[_0x466606(0x275)])(_0x45a9dd,_0x29a146+'\x0a');}catch{}}}function Gt(_0x4782db={}){const _0x335155=_0x15b5cc;function _0x28523a(_0x477340,_0x43199e,_0x4c0f04){typeof _0x43199e=='string'?jt(_0x477340,_0x4782db,_0x43199e):jt(_0x477340,{..._0x4782db,..._0x43199e},_0x4c0f04);}return{'debug':(_0x4d8a39,_0x209ff9)=>_0x28523a('debug',_0x4d8a39,_0x209ff9),'info':(_0x21ce6f,_0x16e069)=>_0x28523a('info',_0x21ce6f,_0x16e069),'warn':(_0x2d9b98,_0x2e4507)=>_0x28523a(_0x335155(0x268),_0x2d9b98,_0x2e4507),'error':(_0x8407a4,_0x3e05fd)=>_0x28523a('error',_0x8407a4,_0x3e05fd),'child':_0x3f97c0=>Gt({..._0x4782db,..._0x3f97c0})};}var S=Gt({'module':_0x15b5cc(0x203)});function re(_0x9bbd1c){let _0x445b58=new Map();return{'get'(_0x5619ad){const _0x7d67f8=_0x3ecc;let _0x4bf645=_0x445b58['get'](_0x5619ad);if(_0x4bf645){if(Date[_0x7d67f8(0x31c)]()>_0x4bf645[_0x7d67f8(0x246)]){_0x445b58['delete'](_0x5619ad);return;}return _0x4bf645[_0x7d67f8(0x1ee)];}},'set'(_0x2757f9,_0x4611a6){const _0x1e9b68=_0x3ecc;_0x445b58[_0x1e9b68(0x21c)](_0x2757f9,{'value':_0x4611a6,'expiresAt':Date['now']()+_0x9bbd1c});},'clear'(){_0x445b58['clear']();}};}var fn=require('node:fs/promises'),w=require('node:fs/promises'),se=require('node:os'),T=require('node:path'),b=0x18;async function _(_0x685cde,_0x44997c,_0x46849e){const _0xf2ada6=_0x15b5cc;if(_0x685cde[_0xf2ada6(0x21b)]===0x0)return[];let _0x35ec15=Math['max'](0x1,Math[_0xf2ada6(0x313)](_0x44997c,_0x685cde[_0xf2ada6(0x21b)])),_0x1a330f=new Array(_0x685cde['length']),_0x3e9451=0x0;return await Promise[_0xf2ada6(0x32d)](Array[_0xf2ada6(0x1eb)]({'length':_0x35ec15},async()=>{const _0xcca1f9=_0xf2ada6;for(;;){let _0x478096=_0x3e9451;if(_0x3e9451+=0x1,_0x478096>=_0x685cde[_0xcca1f9(0x21b)])return;_0x1a330f[_0x478096]=await _0x46849e(_0x685cde[_0x478096],_0x478096);}})),_0x1a330f;}async function Q(_0x1c1cbe){const _0x36313c=_0x15b5cc;let _0x2dcf99=(await _(_0x1c1cbe,b,async _0x4223c4=>{const _0x5d2213=_0x3ecc;let _0x46f5a4=await(0x0,w[_0x5d2213(0x2e3)])(_0x4223c4)['catch'](()=>null);return _0x46f5a4?.[_0x5d2213(0x1ea)]()?{'path':_0x4223c4,'mtimeMs':_0x46f5a4[_0x5d2213(0x1f6)],'birthtimeMs':_0x46f5a4[_0x5d2213(0x20b)],'size':_0x46f5a4[_0x5d2213(0x30d)]}:null;}))[_0x36313c(0x276)](_0x400f53=>_0x400f53!==null);return _0x2dcf99['sort']((_0x3d5cae,_0x1e278f)=>_0x1e278f[_0x36313c(0x1f6)]-_0x3d5cae['mtimeMs']),_0x2dcf99;}async function We(){const _0xcb0216=_0x15b5cc;let _0x11c593=(0x0,T[_0xcb0216(0x262)])((0x0,se[_0xcb0216(0x30e)])(),_0xcb0216(0x267),'projects'),_0xa64ec6=[],_0x2ec2e5=await(0x0,w['readdir'])(_0x11c593,{'withFileTypes':!0x0})['catch'](()=>[]);for(let _0x1c7101 of _0x2ec2e5){if(!_0x1c7101['isDirectory']())continue;let _0x474eba=(0x0,T[_0xcb0216(0x262)])(_0x11c593,_0x1c7101[_0xcb0216(0x22a)]),_0x1ea00b=await(0x0,w['readdir'])(_0x474eba)[_0xcb0216(0x2ac)](()=>[]);for(let _0x377ea1 of _0x1ea00b)_0x377ea1[_0xcb0216(0x214)](_0xcb0216(0x23f))&&_0xa64ec6[_0xcb0216(0x22f)]((0x0,T['join'])(_0x474eba,_0x377ea1));}return _0xa64ec6;}async function oe(_0x14bb8c=(0x0,T['join'])((0x0,se['homedir'])(),'Library','Application\x20Support','Claude',_0x15b5cc(0x2a2)),_0x52fb40=0x0){const _0x418cd6=_0x15b5cc;if(_0x52fb40>0x4)return[];let _0xf7ec3f=await(0x0,w['readdir'])(_0x14bb8c,{'withFileTypes':!0x0})['catch'](()=>[]),_0x3c1724=[];for(let _0x48adf5 of _0xf7ec3f){let _0x3f658e=(0x0,T['join'])(_0x14bb8c,_0x48adf5[_0x418cd6(0x22a)]);_0x48adf5['isDirectory']()?_0x3c1724[_0x418cd6(0x22f)](...await oe(_0x3f658e,_0x52fb40+0x1)):_0x48adf5['isFile']()&&_0x48adf5[_0x418cd6(0x22a)]['endsWith']('.json')&&_0x3c1724['push'](_0x3f658e);}return _0x3c1724;}async function vr(){const _0x40b934=_0x15b5cc;let _0x52b481=(0x0,T[_0x40b934(0x262)])((0x0,se['homedir'])(),'.codex','sessions'),_0x50ff1c=(0x0,T[_0x40b934(0x262)])((0x0,se['homedir'])(),_0x40b934(0x2b2),'archived_sessions'),_0x43d43e=[],_0x27e2e4=await(0x0,w[_0x40b934(0x280)])(_0x52b481)['catch'](()=>[]);for(let _0x181152 of _0x27e2e4){let _0x59ca36=(0x0,T['join'])(_0x52b481,_0x181152),_0x56afb9=await(0x0,w['readdir'])(_0x59ca36)['catch'](()=>[]);for(let _0x2db3c1 of _0x56afb9){let _0x15156f=(0x0,T['join'])(_0x59ca36,_0x2db3c1),_0x1dce35=await(0x0,w['readdir'])(_0x15156f)[_0x40b934(0x2ac)](()=>[]);for(let _0x420150 of _0x1dce35){let _0x1f483a=(0x0,T['join'])(_0x15156f,_0x420150),_0x53ca98=await(0x0,w['readdir'])(_0x1f483a)['catch'](()=>[]);for(let _0x30590d of _0x53ca98)_0x30590d[_0x40b934(0x214)](_0x40b934(0x23f))&&_0x43d43e['push']((0x0,T['join'])(_0x1f483a,_0x30590d));}}}let _0x117768=await(0x0,w['readdir'])(_0x50ff1c)[_0x40b934(0x2ac)](()=>[]);for(let _0x57628f of _0x117768)_0x57628f[_0x40b934(0x214)](_0x40b934(0x23f))&&_0x43d43e[_0x40b934(0x22f)]((0x0,T[_0x40b934(0x262)])(_0x50ff1c,_0x57628f));return _0x43d43e;}async function ie(){let _0x3ee8d7=await vr();return Q(_0x3ee8d7);}var k=require(_0x15b5cc(0x1e4)),I=require('node:fs'),qt=require(_0x15b5cc(0x27f)),d=require(_0x15b5cc(0x26e)),Ir=[_0x15b5cc(0x2c9)],Er=0xea60,$=process[_0x15b5cc(0x2ca)]===_0x15b5cc(0x2e2);function K(){return process.env.HOME||(0x0,qt['homedir'])();}function F(_0x57c197){const _0x5b3e54=_0x15b5cc;return Ir[_0x5b3e54(0x255)](_0x1db1d3=>_0x57c197['includes'](_0x1db1d3));}function Mr(_0x158b9a){const _0x2a7aba=_0x15b5cc;if(!_0x158b9a||!F(_0x158b9a))return _0x158b9a;try{let _0x446b89=(0x0,d[_0x2a7aba(0x262)])((0x0,I['realpathSync'])((0x0,d['dirname'])(_0x158b9a)),(0x0,d['basename'])(_0x158b9a));if((0x0,I['existsSync'])(_0x446b89)&&!F(_0x446b89))return _0x446b89;}catch{}return _0x158b9a;}function Rr(_0x2ea554){const _0x591a6f=_0x15b5cc;if(!_0x2ea554||!F(_0x2ea554))return _0x2ea554;try{let _0x22ef1c=(0x0,I[_0x591a6f(0x328)])(_0x2ea554);if(_0x22ef1c&&!F(_0x22ef1c))return _0x22ef1c;}catch{}return _0x2ea554;}function Vt(){const _0x4fdebc=_0x15b5cc;return $?[]:[process.env.SHELL,_0x4fdebc(0x1ec),_0x4fdebc(0x1d2),'/bin/sh']['filter'](_0x3dacc3=>!!_0x3dacc3)[_0x4fdebc(0x276)]((_0x481fa0,_0x42daa9,_0x1eb615)=>_0x1eb615['indexOf'](_0x481fa0)===_0x42daa9)['filter'](_0x234d2b=>(0x0,I['existsSync'])(_0x234d2b));}function Qt(_0x82a55e,_0x35c5b7){let _0x56b18f=_0x366db0=>{const _0x16f8b9=_0x3ecc;let _0x3aae74=/^v?(\d+)\.(\d+)\.(\d+)/[_0x16f8b9(0x2b7)](_0x366db0);return _0x3aae74?[Number(_0x3aae74[0x1]),Number(_0x3aae74[0x2]),Number(_0x3aae74[0x3])]:null;},_0x39e973=_0x56b18f(_0x82a55e),_0x545746=_0x56b18f(_0x35c5b7);if(!_0x39e973&&!_0x545746)return _0x35c5b7['localeCompare'](_0x82a55e);if(!_0x39e973)return 0x1;if(!_0x545746)return-0x1;for(let _0x4f796c=0x0;_0x4f796c<_0x39e973['length'];_0x4f796c+=0x1)if(_0x39e973[_0x4f796c]!==_0x545746[_0x4f796c])return _0x545746[_0x4f796c]-_0x39e973[_0x4f796c];return 0x0;}function Jt(){const _0x530382=_0x15b5cc;let _0x2190a2=K(),_0x3a5979=(0x0,d['join'])(_0x2190a2,_0x530382(0x265),'versions','node'),_0x401338=[(0x0,d[_0x530382(0x262)])(_0x2190a2,_0x530382(0x265),'current','bin')];try{let _0x338928=(0x0,I[_0x530382(0x290)])(_0x3a5979,{'withFileTypes':!0x0})['filter'](_0x4e537a=>_0x4e537a[_0x530382(0x25d)]())[_0x530382(0x1d6)](_0x66f98f=>_0x66f98f['name'])['sort'](Qt);for(let _0x1927d8 of _0x338928)_0x401338[_0x530382(0x22f)]((0x0,d['join'])(_0x3a5979,_0x1927d8,'bin'));}catch{}return _0x401338;}function Kt(){const _0x42dda6=_0x15b5cc;let _0x4d1114=K(),_0x3e4afc=[process.env.FNM_DIR,(0x0,d['join'])(_0x4d1114,_0x42dda6(0x29c),'share','fnm'),(0x0,d[_0x42dda6(0x262)])(_0x4d1114,_0x42dda6(0x1dd),'Application\x20Support','fnm'),(0x0,d['join'])(_0x4d1114,_0x42dda6(0x252))][_0x42dda6(0x276)](_0xea904e=>!!_0xea904e),_0x368cd9=[],_0x3492f3=new Set();for(let _0x583f98 of _0x3e4afc){if(_0x3492f3['has'](_0x583f98))continue;_0x3492f3['add'](_0x583f98);let _0x4c29c1=(0x0,d['join'])(_0x583f98,_0x42dda6(0x1ff));try{let _0x5bb668=(0x0,I['readdirSync'])(_0x4c29c1,{'withFileTypes':!0x0})['filter'](_0x510c6a=>_0x510c6a['isDirectory']())['map'](_0x44e316=>_0x44e316['name'])[_0x42dda6(0x304)](Qt);for(let _0x1b7bb3 of _0x5bb668)_0x368cd9['push']((0x0,d[_0x42dda6(0x262)])(_0x4c29c1,_0x1b7bb3,'installation',_0x42dda6(0x2a8))),_0x368cd9[_0x42dda6(0x22f)]((0x0,d[_0x42dda6(0x262)])(_0x4c29c1,_0x1b7bb3,_0x42dda6(0x2a8)));}catch{}}return _0x368cd9;}var J=null,He=!0x1,_r=null;function Pr(_0x1f1f65){const _0x3cb84d=_0x15b5cc;let _0x4f67d8={};for(let _0x44bdd9 of _0x1f1f65[_0x3cb84d(0x2c2)]('\x0a')){let _0x4c649a=_0x44bdd9['indexOf']('=');_0x4c649a>0x0&&(_0x4f67d8[_0x44bdd9[_0x3cb84d(0x234)](0x0,_0x4c649a)]=_0x44bdd9[_0x3cb84d(0x234)](_0x4c649a+0x1));}return _0x4f67d8;}function Xt(){if(He)return J??{};if(_r)return{};let _0x50ccc1=Vt()[0x0];if(!_0x50ccc1)return He=!0x0,J={},J;try{J=Pr((0x0,k['execFileSync'])(_0x50ccc1,['-ilc','env'],{'timeout':0x1388,'encoding':'utf-8','stdio':['pipe','pipe','pipe']}));}catch{J={};}return He=!0x0,J;}function Fr(_0x4f398f=Xt()){const _0x28acab=_0x15b5cc;let _0x381cc3=K(),_0x55f374=_0x4f398f[_0x28acab(0x256)]||process.env.PNPM_HOME||($?(0x0,d[_0x28acab(0x262)])(_0x381cc3,'pnpm'):(0x0,d['join'])(_0x381cc3,'Library',_0x28acab(0x271))),_0x50eb84=_0x4f398f[_0x28acab(0x215)]||process.env.PATH||'',_0x412213=$?[(0x0,d[_0x28acab(0x262)])(_0x381cc3,'.npm-global','bin'),(0x0,d['join'])(_0x381cc3,'.local',_0x28acab(0x2a8)),(0x0,d[_0x28acab(0x262)])(_0x381cc3,'.claude',_0x28acab(0x2a8)),(0x0,d['join'])(_0x381cc3,_0x28acab(0x2b2),'packages','standalone',_0x28acab(0x20e),_0x28acab(0x2a8)),_0x55f374,(0x0,d['join'])(_0x381cc3,'AppData',_0x28acab(0x24c),'npm'),(0x0,d['join'])(_0x381cc3,_0x28acab(0x1f9),'Local',_0x28acab(0x32c),_0x28acab(0x2e7))]:['/usr/local/bin','/opt/homebrew/bin',_0x28acab(0x30b),'/bin',(0x0,d['join'])(_0x381cc3,_0x28acab(0x22d),'bin'),(0x0,d['join'])(_0x381cc3,'.local','bin'),(0x0,d[_0x28acab(0x262)])(_0x381cc3,'.claude','bin'),(0x0,d[_0x28acab(0x262)])(_0x381cc3,'.codex','packages','standalone','current',_0x28acab(0x2a8)),_0x55f374,...Jt(),...Kt()],_0x3ff1f5=_0x50eb84['split'](d[_0x28acab(0x2e6)])[_0x28acab(0x276)](Boolean)['map'](Rr),_0x372a48=new Set(_0x3ff1f5);for(let _0x55afd7 of _0x412213)_0x372a48['has'](_0x55afd7)||(_0x3ff1f5['push'](_0x55afd7),_0x372a48['add'](_0x55afd7));return _0x3ff1f5['join'](d[_0x28acab(0x2e6)]);}function je(){const _0x5e8ee4=_0x15b5cc;let _0x5951ea=Xt(),_0x4cc677={};for(let [_0x4d7f0d,_0x4984a7]of Object[_0x5e8ee4(0x2a4)](process.env))typeof _0x4984a7=='string'&&(_0x4cc677[_0x4d7f0d]=_0x4984a7);for(let [_0x4a86e3,_0x3b150a]of Object[_0x5e8ee4(0x2a4)](_0x5951ea))typeof _0x3b150a=='string'&&(_0x4cc677[_0x4a86e3]=_0x3b150a);return _0x4cc677['PATH']=Fr(_0x5951ea),_0x4cc677['HOME']||(_0x4cc677[_0x5e8ee4(0x1fc)]=K()),delete _0x4cc677['CLAUDE_CODE_ENTRYPOINT'],delete _0x4cc677['CLAUDECODE'],_0x4cc677;}function Yt(_0x41f1f0){const _0x4dad75=_0x15b5cc;if($)try{let _0x4aa485=(0x0,k[_0x4dad75(0x287)])(_0x4dad75(0x28a),[_0x41f1f0],{'timeout':0xbb8,'stdio':_0x4dad75(0x1c6),'encoding':_0x4dad75(0x2aa)})['trim']()['split'](/\r?\n/)['filter'](Boolean);return _0x4aa485['find'](_0x5f02b7=>_0x5f02b7[_0x4dad75(0x214)](_0x4dad75(0x219)))??_0x4aa485[0x0];}catch{return;}}function ae(_0xa3a081,_0x3ee75f=0xbb8){const _0xc02d31=_0x15b5cc;try{return(0x0,k['execFileSync'])(_0xa3a081,['--version'],{'timeout':_0x3ee75f,'stdio':'pipe','encoding':'utf-8','env':je(),...$?{'shell':!0x0}:{}})[_0xc02d31(0x2b6)]()||null;}catch{return null;}}function kr(_0x15cf91){const _0x5b0327=_0x15b5cc;for(let _0x3ac9d6 of Vt())try{let _0x1657cd=(0x0,k['execFileSync'])(_0x3ac9d6,[_0x5b0327(0x1d7),'command\x20-v\x20'+_0x15cf91],{'timeout':0x1388,'stdio':['pipe','pipe','pipe'],'encoding':_0x5b0327(0x2aa)})['trim']();if(_0x1657cd)return _0x1657cd;}catch{}}function Lr(){const _0x5627ec=_0x15b5cc;let _0x57092e=K();return[(0x0,d['join'])(_0x57092e,_0x5627ec(0x29c),'bin',_0x5627ec(0x325)),(0x0,d['join'])(_0x57092e,_0x5627ec(0x267),_0x5627ec(0x2a8),_0x5627ec(0x325)),_0x5627ec(0x222),_0x5627ec(0x1df),(0x0,d['join'])(_0x57092e,'.npm-global',_0x5627ec(0x2a8),'claude')];}function Nr(){const _0x5562b3=_0x15b5cc;if($){let _0x2d610d=Yt('claude');return _0x2d610d&&ae(_0x2d610d)?_0x2d610d:void 0x0;}for(let _0x1d8834 of Lr())if(ae(_0x1d8834))return _0x1d8834;try{let _0x41c675=(0x0,k[_0x5562b3(0x287)])(_0x5562b3(0x2bd),[_0x5562b3(0x325)],{'timeout':0xbb8,'stdio':'pipe','encoding':'utf-8','env':je()})['trim']();if(_0x41c675&&!_0x41c675['includes']('cmux')&&ae(_0x41c675))return _0x41c675;}catch{}}function Dr(){const _0x453198=_0x15b5cc;let _0x4a3005=K(),_0x2daf85=[process.env.PNPM_HOME,(0x0,d[_0x453198(0x262)])(_0x4a3005,'Library',_0x453198(0x271))]['filter'](_0x4129b4=>!!_0x4129b4);return['/usr/local/bin/codex','/opt/homebrew/bin/codex',(0x0,d['join'])(_0x4a3005,_0x453198(0x22d),'bin',_0x453198(0x251)),(0x0,d['join'])(_0x4a3005,'.local',_0x453198(0x2a8),'codex'),(0x0,d['join'])(_0x4a3005,'.codex','packages','standalone','current','bin',_0x453198(0x251)),...Jt()['map'](_0x58dfad=>(0x0,d['join'])(_0x58dfad,'codex')),...Kt()[_0x453198(0x1d6)](_0x38f17f=>(0x0,d['join'])(_0x38f17f,_0x453198(0x251))),..._0x2daf85['map'](_0xcc1fac=>(0x0,d[_0x453198(0x262)])(_0xcc1fac,'codex'))];}function Or(){const _0x2dcddd=_0x15b5cc;if($){let _0x328fea=Yt('codex');return _0x328fea&&ae(_0x328fea)?_0x328fea:void 0x0;}let _0x4e94dc=_0x1eeebc=>{let _0x4fa1ad=Mr(_0x1eeebc);return ae(_0x4fa1ad)?_0x4fa1ad:void 0x0;},_0x30d2b5;for(let _0xb80338 of Dr()){let _0x2678dd=_0x4e94dc(_0xb80338);if(_0x2678dd){if(!F(_0x2678dd))return _0x2678dd;_0x30d2b5=_0x2678dd;}}try{let _0x2a46d9=(0x0,k['execFileSync'])('/usr/bin/which',['codex'],{'timeout':0xbb8,'stdio':'pipe','encoding':_0x2dcddd(0x2aa),'env':je()})['trim'](),_0x4e4365=_0x2a46d9?_0x4e94dc(_0x2a46d9):void 0x0;if(_0x4e4365){if(!F(_0x4e4365))return _0x4e4365;_0x30d2b5=_0x30d2b5??_0x4e4365;}}catch{}let _0x192975=kr('codex'),_0x503df3=_0x192975?_0x4e94dc(_0x192975):void 0x0;if(_0x503df3){if(!F(_0x503df3))return _0x503df3;_0x30d2b5=_0x30d2b5??_0x503df3;}return _0x30d2b5;}function Zt(_0x290ee3){const _0x2620ae=_0x15b5cc;return _0x290ee3==='claude'?_0x2620ae(0x25c):'CODEX_PATH';}function Ur(_0x561419){const _0x3fa13d=_0x15b5cc;let _0x2f017f=process.env[Zt(_0x561419)];return _0x2f017f||(_0x561419===_0x3fa13d(0x325)?Nr()??null:Or()??null);}function en(_0x406c80){let _0x37e9b0=null,_0x10adc2=0x0;return()=>{const _0x4803ac=_0x3ecc;let _0x5b894f=process.env[Zt(_0x406c80)];if(_0x5b894f)return _0x5b894f;let _0x4c2068=Date['now']();return(!_0x37e9b0||_0x4c2068-_0x10adc2>Er||!(0x0,I[_0x4803ac(0x312)])(_0x37e9b0)||F(_0x37e9b0))&&(_0x37e9b0=Ur(_0x406c80)??_0x406c80,_0x10adc2=_0x4c2068),_0x37e9b0;};}var Vo=en('claude'),Qo=en('codex');function E(_0x237c7a){const _0x2f5b30=_0x15b5cc;return!_0x237c7a||typeof _0x237c7a!=_0x2f5b30(0x2d5)||Array['isArray'](_0x237c7a)?null:_0x237c7a;}function le(_0x2c5586){const _0x3764cb=_0x15b5cc;let _0x3e2c8b=Number(_0x2c5586);return Number[_0x3764cb(0x2a3)](_0x3e2c8b)?_0x3e2c8b:null;}function $r(_0x424c85){let _0x57912b=le(_0x424c85);return _0x57912b===null||_0x57912b<=0x0?null:Math['floor'](_0x57912b);}function ce(_0x42c4eb){const _0x824946=_0x15b5cc;let _0x4e972c=E(_0x42c4eb);if(!_0x4e972c)return;let _0x57eb20=le(_0x4e972c['input_tokens']??_0x4e972c[_0x824946(0x2e8)]),_0x344623=le(_0x4e972c[_0x824946(0x1de)]??_0x4e972c['outputTokens']);if(_0x57eb20===null||_0x344623===null)return;let _0x4af69f=le(_0x4e972c[_0x824946(0x298)]??_0x4e972c['cacheCreationInputTokens']),_0x288d60=le(_0x4e972c['cache_read_input_tokens']??_0x4e972c[_0x824946(0x323)]),_0x4fec8a=$r(_0x4e972c[_0x824946(0x2cc)]??_0x4e972c['model_context_window']??_0x4e972c[_0x824946(0x2bb)]);return{'inputTokens':_0x57eb20,'outputTokens':_0x344623,..._0x4af69f!==null?{'cacheCreationInputTokens':_0x4af69f}:{},..._0x288d60!==null?{'cacheReadInputTokens':_0x288d60}:{},..._0x4fec8a?{'contextWindowTokens':_0x4fec8a}:{}};}function tn(_0x3b1f40){const _0x1400af=_0x15b5cc;let _0x299769=ce(_0x3b1f40);if(_0x299769&&!(_0x299769['inputTokens']<=0x0&&_0x299769[_0x1400af(0x1bf)]<=0x0&&(_0x299769[_0x1400af(0x30c)]??0x0)<=0x0&&(_0x299769[_0x1400af(0x323)]??0x0)<=0x0&&!_0x299769['contextWindowTokens']))return _0x299769;}function be(_0x3516c4){const _0x5dda50=_0x15b5cc;return _0x3516c4[_0x5dda50(0x2e8)]===0x0&&_0x3516c4['outputTokens']===0x0&&(_0x3516c4['cacheCreationInputTokens']??0x0)===0x0&&(_0x3516c4[_0x5dda50(0x323)]??0x0)===0x0&&!_0x3516c4['contextWindowTokens'];}function nn(_0x5b4950){const _0x112c34=_0x15b5cc;let _0x12e1cf=E(_0x5b4950);if(!_0x12e1cf)return;if(_0x12e1cf['type']===_0x112c34(0x260)){let _0x19caa3=E(_0x12e1cf[_0x112c34(0x1d0)]);if(_0x19caa3?.[_0x112c34(0x24e)]==='<synthetic>')return;let _0x25d773=ce(_0x19caa3?.['usage']??_0x12e1cf[_0x112c34(0x295)]);return _0x25d773&&!be(_0x25d773)?_0x25d773:void 0x0;}let _0x3c9a65=E(_0x12e1cf['toolUseResult']),_0xef5ab4=ce(_0x3c9a65?.['usage']);return _0xef5ab4&&!be(_0xef5ab4)?_0xef5ab4:void 0x0;}function rn(_0x195dd4){const _0x2d766a=_0x15b5cc;let _0x4b0bcd=E(_0x195dd4);if(_0x4b0bcd?.[_0x2d766a(0x25f)]!=='event_msg')return;let _0x50d102=E(_0x4b0bcd[_0x2d766a(0x25b)]);if(_0x50d102?.[_0x2d766a(0x25f)]!=='token_count')return;let _0x15cbe8=E(_0x50d102['info']),_0xcea076=E(_0x15cbe8?.[_0x2d766a(0x2d1)]);if(_0xcea076)return tn({..._0xcea076,'modelContextWindow':_0x15cbe8?.['model_context_window']});}function ve(_0xcc18c2){const _0x33d001=_0x15b5cc;switch(_0xcc18c2){case'plan':return _0x33d001(0x253);case'acceptEdits':return'acceptEdits';case'bypassPermissions':return _0x33d001(0x2b9);case _0x33d001(0x2f9):return _0x33d001(0x1cb);default:return;}}function C(_0x5d8a5e){const _0xbdb679=_0x15b5cc;return typeof _0x5d8a5e!=_0xbdb679(0x314)?void 0x0:_0x5d8a5e[_0xbdb679(0x1b8)](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')['trim']()||void 0x0;}function sn(_0x40a884){const _0x5f1eb3=_0x15b5cc;let _0x2d79ed=C(_0x40a884);switch(_0x2d79ed){case _0x5f1eb3(0x292):case _0x5f1eb3(0x1e9):case _0x5f1eb3(0x2c7):case _0x5f1eb3(0x2a9):case'xhigh':case'max':case _0x5f1eb3(0x1f2):return _0x2d79ed;default:return;}}function Zr(_0x5e0ef2){const _0x1f0ac6=_0x15b5cc;let _0xf3503a=typeof _0x5e0ef2?.[_0x1f0ac6(0x249)]==_0x1f0ac6(0x314)?_0x5e0ef2['approval_policy']:'',_0x43eb50=_0x5e0ef2?.['sandbox_policy'],_0x1e8670=typeof _0x43eb50?.[_0x1f0ac6(0x25f)]==_0x1f0ac6(0x314)?_0x43eb50['type']:'',_0x32a6a8=Array['isArray'](_0x43eb50?.['writable_roots'])?_0x43eb50['writable_roots']:null;if(_0xf3503a===_0x1f0ac6(0x2e9)&&_0x1e8670===_0x1f0ac6(0x2b5))return'autoApprove';if(_0xf3503a===_0x1f0ac6(0x2f2)&&_0x1e8670===_0x1f0ac6(0x1f7))return _0x32a6a8?.[_0x1f0ac6(0x21b)]?_0x1f0ac6(0x1cb):'plan';}function on(_0x5d79c7){return _0x5d79c7?.['type']==='permission-mode'?ve(_0x5d79c7['permissionMode']):ve(_0x5d79c7?.['permissionMode']);}function an(_0x5d4932){const _0x3cdffc=_0x15b5cc;if(_0x5d4932?.[_0x3cdffc(0x25f)]===_0x3cdffc(0x1e6))return Zr(_0x5d4932['payload']);}function ln(_0x201f92){return rn(_0x201f92);}function cn(_0x3a2539){return nn(_0x3a2539);}var es=new Set([_0x15b5cc(0x1d4),_0x15b5cc(0x2a6),_0x15b5cc(0x270)]),ts=['<environment_context>','<local-command-caveat>','<local-command-stdout>','<local-command-stderr>',_0x15b5cc(0x212),'<command-message>','<command-args>','#\x20AGENTS.md\x20instructions\x20for\x20'];function ns(_0x4f092d){const _0x3aaaba=_0x15b5cc;return _0x4f092d[_0x3aaaba(0x1b8)](/\s+/g,'\x20')['trim']();}function P(_0x4fcc5d){return typeof _0x4fcc5d!='string'?void 0x0:ns(_0x4fcc5d)||void 0x0;}function ze(_0x48fcb7){const _0x375c8d=_0x15b5cc;let _0x3e99f9=P(_0x48fcb7);return _0x3e99f9?/^[0-9a-f]{8,}$/i['test'](_0x3e99f9)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x3e99f9)||/^agent-[a-z0-9_-]{6,}$/i[_0x375c8d(0x204)](_0x3e99f9):!0x1;}function Ge(_0x47f7c7){const _0x5617f1=_0x15b5cc;let _0xf7c57c=P(_0x47f7c7);return!_0xf7c57c||es[_0x5617f1(0x2a7)](_0xf7c57c)||ze(_0xf7c57c);}function rs(_0x2f1b29){const _0x105a47=_0x15b5cc;for(let _0x2bf10a of _0x2f1b29[_0x105a47(0x1b8)](/\r/g,'')['split']('\x0a')){let _0x4d4c51=P(_0x2bf10a);if(_0x4d4c51&&!ss(_0x4d4c51)&&!os(_0x4d4c51))return _0x4d4c51;}}function ss(_0x4f0883){const _0x4cdb86=_0x15b5cc;return ts[_0x4cdb86(0x255)](_0x221846=>_0x4f0883[_0x4cdb86(0x2d2)](_0x221846));}function os(_0x6f572d){const _0x32e06e=_0x15b5cc;let _0x54f834=_0x6f572d['replace'](/^['"`]+/,'')['replace'](/['"`\\]+$/,'')[_0x32e06e(0x2b6)]();return!!(!_0x54f834||/^(\/|~\/|\.\/|\.\.\/)/['test'](_0x54f834)||/^[A-Za-z]:\\/['test'](_0x54f834));}function is(_0x46f143){const _0x4486f1=_0x15b5cc;for(let _0x42a501=0x0;_0x42a501<_0x46f143[_0x4486f1(0x21b)];_0x42a501+=0x1){let _0x5a595a=_0x46f143[_0x42a501];if(_0x5a595a==='。'||_0x5a595a==='!'||_0x5a595a==='?'||_0x5a595a===';')return _0x42a501+0x1;if(_0x5a595a==='.'||_0x5a595a==='!'||_0x5a595a==='?'||_0x5a595a===';'){let _0x5c353a=_0x46f143[_0x42a501+0x1];if(!_0x5c353a||/\s/['test'](_0x5c353a))return _0x42a501+0x1;}}return-0x1;}function un(_0x59483c,_0xc6c57d=0x50){const _0x4f730f=_0x15b5cc;if(typeof _0x59483c!='string')return;let _0x34a730=rs(_0x59483c);if(!_0x34a730)return;let _0x126794=is(_0x34a730),_0x5673ce=(_0x126794>0x0?_0x34a730['slice'](0x0,_0x126794):_0x34a730)['replace'](/[。!?;.!?;]+$/gu,'')['trim']();if(!(!_0x5673ce||ze(_0x5673ce)))return _0x5673ce['length']<=_0xc6c57d?_0x5673ce:_0x5673ce['slice'](0x0,Math[_0x4f730f(0x307)](0x1,_0xc6c57d-0x3))['trimEnd']()+'...';}function L(_0xc2e702,_0x4f4580){for(let _0x237137 of _0xc2e702){let _0x5d7d6e=P(_0x237137);if(!(!_0x5d7d6e||Ge(_0x5d7d6e)))return _0x5d7d6e;}return un(_0x4f4580);}var dn='<vibelet-resume-after-approval>';function pn(_0x2e03f4){return _0x2e03f4['replace'](/[^a-zA-Z0-9]/g,'-');}async function qe(){let _0x54d4b8=await oe(),_0x3b9975=await _(_0x54d4b8,b,async _0x47ae48=>{const _0xdf7012=_0x3ecc;try{let _0x1b38c8=JSON[_0xdf7012(0x2e1)](await(0x0,fn['readFile'])(_0x47ae48,'utf-8')),_0x31dfd5=C(_0x1b38c8['cliSessionId']);if(!_0x31dfd5)return null;let _0x585fd5=P(C(_0x1b38c8['title'])),_0x179b45={'cliSessionId':_0x31dfd5},_0x2e9bb5=C(_0x1b38c8['sessionId']),_0x21dc93=C(_0x1b38c8['cwd']),_0x1d9543=C(_0x1b38c8['originCwd']),_0xe8324=C(_0x1b38c8['model']),_0x52cbf6=sn(_0x1b38c8['effort']),_0xd3fce9=ve(C(_0x1b38c8['permissionMode']));return _0x2e9bb5&&(_0x179b45[_0xdf7012(0x2d3)]=_0x2e9bb5),_0x21dc93&&(_0x179b45['cwd']=_0x21dc93),_0x1d9543&&(_0x179b45[_0xdf7012(0x306)]=_0x1d9543),_0x585fd5&&(_0x179b45['title']=_0x585fd5),_0xe8324&&(_0x179b45['model']=_0xe8324),_0x52cbf6&&(_0x179b45[_0xdf7012(0x1d5)]=_0x52cbf6),_0xd3fce9&&(_0x179b45[_0xdf7012(0x2fb)]=_0xd3fce9),typeof _0x1b38c8['isArchived']=='boolean'&&(_0x179b45[_0xdf7012(0x311)]=_0x1b38c8['isArchived']),_0x179b45;}catch{return null;}}),_0x197afe=new Map();for(let _0x38d964 of _0x3b9975)_0x38d964&&_0x197afe['set'](_0x38d964['cliSessionId'],_0x38d964);return{'byCliSessionId':_0x197afe};}function Ve(_0x338b98,_0x58a25a){const _0x20da2a=_0x15b5cc;if(!_0x58a25a)return _0x338b98;let _0x154d12=[..._0x338b98['titleAliases']??[],..._0x338b98['title']&&_0x58a25a['title']&&_0x338b98['title']!==_0x58a25a['title']?[_0x338b98[_0x20da2a(0x269)]]:[]];return{..._0x338b98,..._0x58a25a[_0x20da2a(0x2fc)]?{'cwd':_0x58a25a[_0x20da2a(0x2fc)]}:{},..._0x58a25a['originCwd']?{'originCwd':_0x58a25a['originCwd']}:{},..._0x58a25a[_0x20da2a(0x24e)]?{'model':_0x58a25a['model']}:{},..._0x58a25a['effort']?{'effort':_0x58a25a['effort']}:{},..._0x58a25a['title']?{'title':_0x58a25a['title']}:{},..._0x154d12[_0x20da2a(0x21b)]?{'titleAliases':_0x154d12}:{},..._0x58a25a['approvalMode']?{'approvalMode':_0x58a25a[_0x20da2a(0x2fb)]}:{},'originator':'Claude\x20Desktop',...typeof _0x58a25a[_0x20da2a(0x311)]=='boolean'?{'externalArchived':_0x58a25a['externalArchived']}:{}};}var gn=require(_0x15b5cc(0x1e4)),hn=require(_0x15b5cc(0x23a)),Ke=require(_0x15b5cc(0x27f)),Xe=require('node:path'),Sn=require(_0x15b5cc(0x31f)),as=S[_0x15b5cc(0x1c8)]({'module':_0x15b5cc(0x1c1)}),mn=(0x0,Sn['promisify'])(gn['execFile']),ls=0x7530,X=null,ue=null,Qe='';function Je(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function cs(_0x3919ac){const _0x48a1ca=_0x15b5cc;return _0x3919ac['startsWith']('~/')?(0x0,Xe[_0x48a1ca(0x262)])((0x0,Ke['homedir'])(),_0x3919ac['slice'](0x2)):_0x3919ac;}function yn(_0x46c961,_0x1babaf,_0x27e844){const _0x1ea7c1=_0x15b5cc;if(_0x46c961)return _0x46c961[_0x1ea7c1(0x326)][_0x1ea7c1(0x21f)](_0x1babaf)??_0x46c961[_0x1ea7c1(0x2c8)]['get'](_0x27e844);}function xn(_0xb0eaba,_0x29bde0,_0x4b1231){const _0x243deb=_0x15b5cc;if(_0xb0eaba)return _0xb0eaba['archivedById'][_0x243deb(0x21f)](_0x29bde0)??_0xb0eaba['archivedByRolloutPath'][_0x243deb(0x21f)](_0x4b1231);}function Ye(){X=null;}async function Ie(){const _0x4436c5=_0x15b5cc;let _0x1ad1a6=Date['now'](),_0x383d44=(0x0,Ke[_0x4436c5(0x30e)])();if(X&&X[_0x4436c5(0x2b3)]===_0x383d44&&_0x1ad1a6<=X[_0x4436c5(0x246)])return X['value'];if(ue&&Qe===_0x383d44)return ue;Qe=_0x383d44,ue=((async()=>{const _0x5d2799=_0x4436c5;let _0x424dbe=(0x0,Xe['join'])(_0x383d44,'.codex','state_5.sqlite');if(!(await(0x0,hn[_0x5d2799(0x2e3)])(_0x424dbe)['catch'](()=>null))?.[_0x5d2799(0x1ea)]())return Je();try{let _0x105346='';try{({stdout:_0x105346}=await mn('sqlite3',[_0x5d2799(0x23c),_0x424dbe,'select\x20id,\x20title,\x20rollout_path,\x20archived\x20from\x20threads'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x105346}=await mn(_0x5d2799(0x1f4),['-json',_0x424dbe,'select\x20id,\x20title,\x20rollout_path\x20from\x20threads\x20where\x20coalesce(title,\x20\x27\x27)\x20<>\x20\x27\x27'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x230d8a=JSON['parse'](_0x105346||'[]'),_0x3207be=Je();for(let _0x18e67a of _0x230d8a){if(typeof _0x18e67a['id']!='string')continue;let _0x14b57c=P(typeof _0x18e67a[_0x5d2799(0x269)]=='string'?_0x18e67a[_0x5d2799(0x269)]:void 0x0);_0x14b57c&&_0x3207be['byId']['set'](_0x18e67a['id'],_0x14b57c);let _0x42fbf3=typeof _0x18e67a['rollout_path']==_0x5d2799(0x314)&&_0x18e67a['rollout_path'][_0x5d2799(0x2b6)]()?cs(_0x18e67a[_0x5d2799(0x308)]):'';if(_0x42fbf3&&_0x14b57c&&_0x3207be[_0x5d2799(0x2c8)]['set'](_0x42fbf3,_0x14b57c),typeof _0x18e67a[_0x5d2799(0x31d)]=='number'||typeof _0x18e67a[_0x5d2799(0x31d)]=='boolean'){let _0x1499be=_0x18e67a['archived']===!0x0||_0x18e67a['archived']===0x1;_0x3207be[_0x5d2799(0x239)]['set'](_0x18e67a['id'],_0x1499be),_0x42fbf3&&_0x3207be['archivedByRolloutPath']['set'](_0x42fbf3,_0x1499be);}}return _0x3207be;}catch(_0x1ace5c){return as['debug']({'error':String(_0x1ace5c)},'failed\x20to\x20read\x20codex\x20thread\x20titles\x20from\x20sqlite'),Je();}})());try{let _0x3f5e0=await ue;return X={'value':_0x3f5e0,'expiresAt':Date['now']()+ls,'home':_0x383d44},_0x3f5e0;}finally{ue=null,Qe='';}}var Cn=require(_0x15b5cc(0x23d)),Y=require('node:fs/promises'),An=require(_0x15b5cc(0x244));function*de(_0x57df4a,_0x43a57b){const _0x26f0c4=_0x15b5cc;let _0x393fc8=0x0,_0x47a761=0x0;for(;_0x393fc8<_0x57df4a[_0x26f0c4(0x21b)]&&_0x47a761<_0x43a57b;){let _0x1e58c0=_0x57df4a[_0x26f0c4(0x1da)]('\x0a',_0x393fc8);_0x1e58c0===-0x1&&(_0x1e58c0=_0x57df4a[_0x26f0c4(0x21b)]);let _0x3713a7=_0x57df4a['substring'](_0x393fc8,_0x1e58c0);_0x393fc8=_0x1e58c0+0x1,!(_0x3713a7['length']===0x0||_0x3713a7['trim']()['length']===0x0)&&(yield _0x3713a7,_0x47a761+=0x1);}}var Ze=0x200*0x400,Tn=0x100*0x400;async function Ee(_0x4b3cec,_0x3e3d85){const _0x19fb8f=_0x15b5cc;if(_0x3e3d85<=Ze)return(0x0,Y[_0x19fb8f(0x284)])(_0x4b3cec,_0x19fb8f(0x2aa));let _0xafa356=await(0x0,Y['open'])(_0x4b3cec,'r');try{let _0x4e1dc4=Buffer[_0x19fb8f(0x2d7)](Ze),{bytesRead:_0x2afaff}=await _0xafa356[_0x19fb8f(0x2c5)](_0x4e1dc4,0x0,Ze,0x0);return _0x4e1dc4[_0x19fb8f(0x1ca)]('utf-8',0x0,_0x2afaff);}finally{await _0xafa356[_0x19fb8f(0x297)]();}}async function et(_0x3714b3,_0x219490){const _0x210e19=_0x15b5cc;if(_0x219490<=Tn)return(0x0,Y['readFile'])(_0x3714b3,'utf-8');let _0x5890f7=await(0x0,Y[_0x210e19(0x1c9)])(_0x3714b3,'r');try{let _0x1d97a6=Math['max'](0x0,_0x219490-Tn),_0x37ff54=Buffer['alloc'](_0x219490-_0x1d97a6),{bytesRead:_0x44f1cb}=await _0x5890f7['read'](_0x37ff54,0x0,_0x37ff54['length'],_0x1d97a6);return _0x37ff54['toString']('utf-8',0x0,_0x44f1cb);}finally{await _0x5890f7[_0x210e19(0x297)]();}}async function B(_0x398b16,_0x5abbe3){const _0x100a4c=_0x15b5cc;let _0x4aca5c=(0x0,Cn[_0x100a4c(0x20a)])(_0x398b16,{'encoding':'utf-8'}),_0x2f5818=(0x0,An['createInterface'])({'input':_0x4aca5c,'crlfDelay':0x1/0x0});try{for await(let _0x157477 of _0x2f5818){if(!_0x157477[_0x100a4c(0x2b6)]())continue;let _0x5051d7;try{_0x5051d7=JSON[_0x100a4c(0x2e1)](_0x157477);}catch{continue;}if(_0x5abbe3(_0x5051d7))break;}}finally{_0x2f5818[_0x100a4c(0x297)](),_0x4aca5c['destroy']();}}function N(_0x3179cd){const _0x16acc7=_0x15b5cc;return typeof _0x3179cd=='string'?_0x3179cd:Array['isArray'](_0x3179cd)?_0x3179cd['map'](_0x585738=>!_0x585738||typeof _0x585738!=_0x16acc7(0x2d5)?'':typeof _0x585738['text']==_0x16acc7(0x314)?_0x585738['text']:typeof _0x585738[_0x16acc7(0x299)]==_0x16acc7(0x314)?_0x585738['content']:'')['join'](''):'';}function fe(_0x24c83){const _0x57fcc1=_0x15b5cc;return _0x24c83?.['type']==='response_item'&&_0x24c83['payload']?.[_0x57fcc1(0x25f)]==='message'&&_0x24c83[_0x57fcc1(0x25b)]['role']==='user'?N(_0x24c83['payload'][_0x57fcc1(0x299)]):_0x24c83?.[_0x57fcc1(0x25f)]===_0x57fcc1(0x1e3)&&_0x24c83[_0x57fcc1(0x25b)]?.['type']===_0x57fcc1(0x24a)&&typeof _0x24c83['payload']['message']==_0x57fcc1(0x314)?_0x24c83['payload']['message']:'';}function W(_0x2a04a4){const _0x2187c7=_0x15b5cc;return typeof _0x2a04a4=='string'?_0x2a04a4:Array[_0x2187c7(0x2d0)](_0x2a04a4)?_0x2a04a4[_0x2187c7(0x1d6)](_0x3b9134=>!_0x3b9134||typeof _0x3b9134!=_0x2187c7(0x2d5)||_0x3b9134['type']!=='text'?'':typeof _0x3b9134[_0x2187c7(0x2f1)]==_0x2187c7(0x314)?_0x3b9134[_0x2187c7(0x2f1)]:'')[_0x2187c7(0x262)](''):'';}var us=/^\[Attached image: ([^\n]+)\]$/gm;function ds(_0x140108){const _0x116a4c=_0x15b5cc;let _0x5e5c83=[],_0x2d1277=new Set();for(let _0x3b5d09 of _0x140108['matchAll'](us)){let _0x3c515f=_0x3b5d09[0x1];!_0x3c515f||_0x3c515f[_0x116a4c(0x2b6)]()[_0x116a4c(0x21b)]===0x0||_0x2d1277[_0x116a4c(0x2a7)](_0x3c515f)||(_0x2d1277['add'](_0x3c515f),_0x5e5c83[_0x116a4c(0x22f)](_0x3c515f));}return _0x5e5c83;}function wn(_0x46591){const _0x15f036=_0x15b5cc;if(_0x46591[_0x15f036(0x29a)]!=='user')return _0x46591;let _0x30b41c=[..._0x46591[_0x15f036(0x31a)]??[],...ds(_0x46591['content'])][_0x15f036(0x276)]((_0x4b7858,_0x3828c5,_0x33564d)=>_0x4b7858&&_0x33564d[_0x15f036(0x1da)](_0x4b7858)===_0x3828c5);return _0x30b41c['length']?{..._0x46591,'images':_0x30b41c}:_0x46591;}var fs=[_0x15b5cc(0x2d8),_0x15b5cc(0x2e0),_0x15b5cc(0x1cd),_0x15b5cc(0x22b),'<command-name>',_0x15b5cc(0x207),'<command-args>',_0x15b5cc(0x248),_0x15b5cc(0x2bc),dn],bn=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ps=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ms=/<environment_context>[\s\S]*<\/environment_context>/,gs=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function hs(_0x2e71db,_0x4b6ea0){const _0x360bf6=_0x15b5cc;if(_0x2e71db?.[_0x360bf6(0x1c4)]===!0x0)return!0x0;let _0x1aeeb3=_0x4b6ea0['trim']();return _0x1aeeb3?bn[_0x360bf6(0x204)](_0x1aeeb3)||fs[_0x360bf6(0x255)](_0x7adc3=>_0x1aeeb3['startsWith'](_0x7adc3)):!0x1;}function H(_0x38f0a3){const _0x303fc6=_0x15b5cc;if(_0x38f0a3?.['type']!=='user'||_0x38f0a3['message']?.[_0x303fc6(0x29a)]!=='user')return'';let _0x1676a5=W(_0x38f0a3[_0x303fc6(0x1d0)]['content']);return hs(_0x38f0a3,_0x1676a5)?'':_0x1676a5;}function vn(_0x1232e0){const _0xbb8682=_0x15b5cc;return Array['isArray'](_0x1232e0)&&_0x1232e0['some'](_0x2f5b8e=>_0x2f5b8e&&typeof _0x2f5b8e=='object'&&_0x2f5b8e[_0xbb8682(0x25f)]==='tool_result');}function Ss(_0x235675){const _0x440670=_0x15b5cc;return Array['isArray'](_0x235675)?_0x235675[_0x440670(0x1d6)](_0x1efbb4=>{const _0x11902b=_0x440670;if(!_0x1efbb4||typeof _0x1efbb4!=_0x11902b(0x2d5)||_0x1efbb4[_0x11902b(0x25f)]!==_0x11902b(0x2a5))return'';let _0x126c41=_0x1efbb4['content'];return typeof _0x126c41=='string'?_0x126c41:Array['isArray'](_0x126c41)?_0x126c41['map'](_0x47aa6d=>!_0x47aa6d||typeof _0x47aa6d!=_0x11902b(0x2d5)?'':typeof _0x47aa6d[_0x11902b(0x2f1)]=='string'?_0x47aa6d[_0x11902b(0x2f1)]:typeof _0x47aa6d['content']==_0x11902b(0x314)?_0x47aa6d['content']:'')['filter'](Boolean)['join']('\x0a'):'';})[_0x440670(0x276)](Boolean)['join']('\x0a'):'';}function ys(_0x4c3c3f){const _0x30389d=_0x15b5cc;return Array['isArray'](_0x4c3c3f)?_0x4c3c3f['map'](_0x2f2f75=>!_0x2f2f75||typeof _0x2f2f75!=_0x30389d(0x2d5)?'':typeof _0x2f2f75[_0x30389d(0x2f1)]=='string'?_0x2f2f75['text']:typeof _0x2f2f75[_0x30389d(0x299)]=='string'?_0x2f2f75['content']:'')[_0x30389d(0x276)](Boolean)['join']('\x0a'):'';}function tt(_0xfb536b){const _0x41f85c=_0x15b5cc;if(typeof _0xfb536b=='string')return _0xfb536b;let _0x5026af=ys(_0xfb536b);return _0x5026af||(Array['isArray'](_0xfb536b)&&_0xfb536b['length']>0x0&&_0xfb536b['every'](_0x504ced=>_0x504ced&&typeof _0x504ced==_0x41f85c(0x2d5)&&_0x504ced[_0x41f85c(0x25f)]==='tool_reference')?'':JSON['stringify'](_0xfb536b));}var xs=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function In(_0x1b6f55){const _0x14fbae=_0x15b5cc;let _0x3da815=_0x1b6f55['match'](xs)?.[0x1];return _0x3da815&&_0x3da815['trim']()[_0x14fbae(0x21b)]>0x0?_0x3da815:null;}function En(_0x5d5f7d,_0xf22bf7){const _0x13b00d=_0x15b5cc;return{'role':'assistant','type':'info','historyKey':_0x13b00d(0x277)+_0x5d5f7d,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0x5d5f7d+'\x20视为敏感路径。这类批准无法从已有会话记录里补回到\x20Vibelet。请重新执行这次修改并在\x20Claude\x20中明确批准;如果希望在\x20Vibelet\x20里看到审批弹窗,请从\x20Vibelet\x20启动或继续这个会话。',..._0xf22bf7?{'timestamp':_0xf22bf7}:{}};}function Mn(_0x3323a2){const _0x41929f=_0x15b5cc;let _0x5ecadb=Ss(_0x3323a2?.['message']?.['content']);if(/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x5ecadb))return!0x0;let _0x2a9214=_0x3323a2?.[_0x41929f(0x28f)];return!!(_0x2a9214&&typeof _0x2a9214=='object'&&_0x2a9214[_0x41929f(0x225)]===!0x0||typeof _0x2a9214=='string'&&/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x2a9214));}function j(_0x479827){const _0x23de27=_0x15b5cc;let _0xe26887=_0x479827['trim']();return _0xe26887?_0xe26887['startsWith']('<environment_context>')||bn[_0x23de27(0x204)](_0xe26887)?!0x0:ms['test'](_0xe26887)&&(gs[_0x23de27(0x204)](_0xe26887)||ps['test'](_0xe26887)):!0x1;}function Rn(_0x570102){const _0x5d2646=_0x15b5cc;if(typeof _0x570102?.['timestamp']!=_0x5d2646(0x314))return null;let _0x2bf521=Date['parse'](_0x570102[_0x5d2646(0x208)]);return Number['isFinite'](_0x2bf521)?_0x2bf521:null;}function nt(_0x92334b){const _0x4efb82=_0x15b5cc;let _0x343aa6=Rn(_0x92334b);return _0x343aa6==null?void 0x0:new Date(_0x343aa6)[_0x4efb82(0x1f8)]();}function z(_0x17e2ac,_0xea5f57){let _0x3a7c19=nt(_0xea5f57);return _0x3a7c19?{..._0x17e2ac,'timestamp':_0x3a7c19}:_0x17e2ac;}function _n(){return{'openTurn':!0x1,'sawTurnActivity':!0x1,'hasLifecycleMarker':!0x1};}function Ts(_0x59df0c){const _0x1d8931=_0x15b5cc;let _0x538b83=_0x59df0c?.[_0x1d8931(0x1d0)]??_0x59df0c?.[_0x1d8931(0x2f1)]??_0x59df0c?.[_0x1d8931(0x31b)]??_0x59df0c?.['content'];return typeof _0x538b83=='string'&&_0x538b83['trim']()?_0x538b83:void 0x0;}function _0x5873(){const _0x545e7c=['y2f0y2G','lMnJ','DxbSB2fKCW','r2vUzxjHDgvKigzPBgvZoGO','zgfLBw9UlNn0zg91Dc5SB2C','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','lMnVzgv4','Ag9Tzq','lNjZ','zgfUz2vYlwz1BgWTywnJzxnZ','DhjPBq','zxHLyW','yNvZEq','yxv0B0fWChjVDMu','y29SBgvJDenVBNrLEhq','y29UDgv4DfDPBMrVD1rVA2vUCW','pgvUDMLYB25Tzw50x2nVBNrLEhq+','l3vZCI9IAw4VD2HPy2G','yMfZAa','ChjVBwLZAwz5','Bg9Nsw50zxj2ywW','DgLTzw91Da','C3bSAxq','lMPHDMe','ls1JB250Aw51zq','CMvHza','yMfZzw5HBwu','BwvKAxvT','yNLsB2XSB3v0ugf0Aa','zM5Tx211BhrPC2HLBgXZ','CgXHDgzVCM0','zxHLy0zPBgu','Bw9KzwXdB250zxH0v2LUzg93','u0Lhs0Lmta','AwrLBNrPDhKUANnVBG','ls1WCMLUDa','AxnbCNjHEq','BgfZDf90B2TLBL91C2fNzq','C3rHCNrZv2L0Aa','Bg9JywXtzxnZAw9Uswq','zxjYB3i','B2jQzwn0','C3rHDgvFns5ZCwXPDgu','ywXSB2m','phrHC2STBM90AwzPy2f0Aw9UpG','A2LUza','lNrZEa','CgvYAw9KAwmGBwv0CMLJCYbZBMfWC2HVDa','Bwf0y2G','zMfSBgjHy2TiAxrZ','zMLSzvbHDgG','C2f3vhvYBKfJDgL2Axr5','pgXVy2fSlwnVBw1HBMqTy2f2zwf0pG','CgfYC2u','D2LUmZi','C3rHDa','DxbKyxrLzef0','Dg90ywXnCW','zgvSAw1PDgvY','BM9Kzq','Aw5WDxruB2TLBNm','BMv2zxi','C3rHCNruAw1LCG','y3vZDg9TvgL0Bgu','CMvHzezPBgvnzxrH','C3rVCfjLyxnVBG','CMvZCg9UC2vFAxrLBq','B3jPz2LUywXgAwXL','zMLUywXSEq','Dgv4Da','B24TCMvXDwvZDa','AhLKCMf0zu1Z','C2nHBG','lY5JBgf1zguVChjVAMvJDhmV','BhnVzK1Z','BwLUtxm','y29KzxHnzxrHzgf0yuzPBMDLCNbYAw50','zgvMyxvSDa','BgfZDefJDgL2Axr5qxq','yxbWCM92ywXnB2rL','y3DK','mJC1nJCZnLjxt2HbCG','CgfPCMLUzY1XCI5WBMC','lM1T','Dg9VBf91C2vFAwq','y3vZDg9Tx3rVB2XFy2fSBa','y3jLyxrLzcbZDwnJzxnZzNvSBhK','y29UzMLKzw5Jzq','C29YDa','tMfo','B3jPz2LUq3DK','Bwf4','CM9SBg91Df9WyxrO','CMvHzfnLC3nPB25dD2rbBMrjza','yxvKAxqUANnVBMW','l3vZCI9IAw4','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','C2L6zq','Ag9TzwrPCG','C3rKzxjY','AxnszxnWB25KAw5N','zxH0zxjUywXbCMnOAxzLza','zxHPC3rZu3LUyW','BwLU','C3rYAw5N','mJeWmdy0ofPUsgHwsG','y3jLyxrLzefMDgvYtxm','zMfSBgjHy2TmB29RDxbZ','mtCWodGXnMDeA0HYCa','yNvU','Aw1Hz2vZ','zgvSDge','BM93','yxjJAgL2zwq','BM9KzwPZ','BM9KztP1DgLS','zxH0BMfTzq','Aw5JCMvTzw50','mJm4otm3m0f0rvLSvW','y2fJAgvszwfKsw5WDxruB2TLBNm','CNvUDgLTzq','y2XHDwrL','yNLjza','lNrZ','CMvHBhbHDgHtEw5J','lNnJC3m','tM8GC3vJAcbWCM9JzxnZ','zw50CNK','uhjVz3jHBxm','ywXS','y2XHDwrLtg9VA3vW','ls1Kyw5NzxjVDxnSEs1ZA2LWlxbLCM1PC3nPB25Z','r2vUzxjHDgvKigzPBgu6ia','ls1Yzxn1Bwu9','CMvWBgfJzq','C3rHCNrqzxjPB2rPy0XVzW','ywXSig9Jy3vYCMvUy2vZihDLCMuGC3vJy2vZC2z1BgX5ihjLCgXHy2vK','yxjNDw1LBNrZ','AwrSzq','vKLcrv9urvnux0LovKvove9swv9xt1jlrvjFrevmqvLFtvm','DxnLCLbYB21WDa','B3v0Chv0vg9Rzw5Z','yxjNDG','C2nHBM5LCG','CMvZB2X2zq','CgLK','AxnnzxrH','y29TBwfUza','CgLWzq','DgvYBwLUywWTy29UDhjVBc10B2TLBG','y2HPBgq','B3bLBG','Dg9tDhjPBMC','BM9YBwfS','yxbWBhLFCgf0y2G','pgXVy2fSlwnVBw1HBMqTC3rKB3v0pG','nxLptwrvCq','lNnXBa','BwvZC2fNzq','zgvWzw5Kzw5JAwvZ','l2jPBI9IyxnO','CMvWBgfJzufSBa','tMv3ihnLC3nPB24','zwzMB3j0','BwfW','lwLSyW','lMT0','C2vZC2LVBL9IyxrJAf9JB21WBgv0zq','Aw5KzxHpzG','zMLZAa','lMPZ','tgLICMfYEq','B3v0Chv0x3rVA2vUCW','l29WDc9OB21LyNjLDY9IAw4Vy2XHDwrL','lNz1zq','ChjVAMvJDhm','CM91BMq','zxzLBNrFBxnN','BM9KztPJAgLSzf9WCM9JzxnZ','C2vZC2LVBKzPBgvqyxrO','DhvYBL9JB250zxH0','DhvYBLn0yxj0zwq','ChjVy2vZCY1Zy2fUBMvY','Bg93','AxngAwXL','zNjVBq','l2jPBI96C2G','AxnbyNnVBhv0zq','DMfSDwu','AgfZigjLzw4Gy3jLyxrLza','zgfLBw9UlNn0zgvYCI5SB2C','Cg9ZDe1LC3nHz2u','DwX0CMe','Cgf0Aa','C3fSAxrLmW','Aw5MBW','BxrPBwvnCW','D29YA3nWywnLlxDYAxrL','Dg9ju09tDhjPBMC','qxbWrgf0yq','u0Lhvevstq','DgLTzxjZ','se9nrq','C3rYAw5NAwz5','ChjVy2vZCW','BM9Kzs12zxjZAw9UCW','yxbWlxnLCNzLCG','Dg9VBf9ZzwfYy2HFy2fSBa','CMvZB2X2zvnLC3nPB25gAwXLugf0Aa','zgfLBw9U','DgvZDa','ywn0AxzPDhK','C25HChnOB3rZ','pgnVBw1HBMqTBwvZC2fNzt4','DgLTzxn0yw1W','lMX1yq','y3jLyxrLuMvHzfn0CMvHBq','yMLYDgH0Aw1Ltxm','ywDLBNrFBwvZC2fNzq','C3rHCNrLzef0','y3vYCMvUDa','y29Kzq','C2vZC2LVBKLK','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbOAxn0B3j5','pgnVBw1HBMqTBMfTzt4','mZqWodCWAe10txPh','zw5KC1DPDgG','uefusa','CgfYzw50vxvPza','DgfZA19JB21WBgv0zq','zMfPBgvKihrVihjLywqGy2XHDwrLihnLC3nPB24GAgLZDg9YEq','lMv4zq','DgvYBwLUywW','BgvUz3rO','C2v0','lMHWCa','yxjNCW','z2v0','ls1SAxn0zw4','ywnJzxb0rwrPDhm','l3vZCI9SB2nHBc9IAw4Vy2XHDwrL','Bwf4txm','C2f2zwrFCgf0Aa','Aw50zxjYDxb0zwq','zgf0yq','lNjI','BNvTyMvY','nfLzsxDRBG','BMfTzq','pgXVy2fSlwnVBw1HBMqTC3rKzxjYpG','Bg9JywXLq29TCgfYzq','lM5WBs1NBg9IywW','BM9ODxa','ChvZAa','lMzPC2G','Dg9mB3DLCKnHC2u','lNbZmq','AhLKCMf0zwrdyw5KAwrHDgvZ','C2XPy2u','Aw5WDxq','y2XHDwrLrMLSzxm','zgvIDwC','DMfSDwvZ','yxjJAgL2zwrcEuLK','BM9KztPMCY9WCM9TAxnLCW','C2LNBMfS','lwPZB24','BM9KztPMCW','ywrK','lMPZB25S','Aw5JBhvKzvbHDgnOq2fSBhm','CgfPCMLUz3mUANnVBG','ChjVy2vZCYbYDw5UAw5NihnLC3nPB25ZihnJyw5Uzwq','C3LZDgvT','BM9KztPYzwfKBgLUzq','zNvUy3rPB25Fy2fSBa','zxHWAxjLC0f0','AgfZt3DU','phn5C3rLBs1Yzw1PBMrLCJ4','yxbWCM92ywXFCg9SAwn5','DxnLCL9TzxnZywDL','C3rHCNruAw1L','uM9HBwLUzW','C25HChnOB3q','Bw9KzwW','ls1Yzxf1AxjL','y3vZDg9Tx3rVB2XFy2fSBf9VDxrWDxq','y29KzxG','lMzUBq','CgXHBG','AgfZtgLMzwn5y2XLtwfYA2vY','C29Tzq','ue5qtv9it01f','BgfZDfvZywDL','CgLKpsXJB21Tyw5Kpq','y2XHDwrLtwv0ywrHDgfgAw5NzxjWCMLUDa','CgfYzw50x3rOCMvHzf9Pza','Cgf5Bg9Hza','q0Xbvurfx1bbveG','AxneAxjLy3rVCNK','zMLUza','DhLWzq','yxnZAxn0yw50','Aw52ywXPzgf0zq','AM9PBG','C3rHDhvZ','CMv1C2vKrMLSzxm','lM52Bq','AxnFzxjYB3i','lMnSyxvKzq','D2fYBG','DgL0Bgu','mtaXotrpwMnctLa','zgLYzwn0q2fUzgLKyxrLCW','ls1SAxn0zw49','Bg9HzenSyxvKzuXVB2T1Ca','BM9KztPWyxrO','l0zpuK1bvdPdu1y','vw50AxrSzwqGC2vZC2LVBG','Cg5WBq','DxnLCG','zMLSzv9WyxrO','ls1Kyw5NzxjVDxnSEs1IExbHC3mTyxbWCM92ywXZlwfUzc1Zyw5KyM94','yxbWzw5KrMLSzvn5BMm','zMLSDgvY','y2XHDwrLlxnLBNnPDgL2zs1MAwXLoG','y29KzxGTBgf0zxn0oG','l3n1yMfNzw50CY8','lNnHC3m','C3vIywDLBNq','Cgf0y2HFyxbWBhLFzw5K','ywDLBNq','lNHTBa','BM9KztPVCW','CMvHzgrPCG','C2vZC2LVBG','DgHYzwfKx3jVBgXLzf9IywnR','BhnVzG','CMvHzezPBgu','y291BNrLCNm','BgfZDfvZzwrbDa','zxHLy0zPBgvtEw5J','ywXPDMvqCM9JzxnZzxm','DhvYBKzPBMLZAgvK','D2HLCMuUzxHL','ls1LDMfS','yM9VBgvHBG','y29KzxHmB29RDxa','DMLHv3jHChbLCG','Dg9VBfvZzvjLC3vSDa','CMvHzgrPCLn5BMm','C2vZC2LVBNm','BwLUAw1HBa','A2LSBa','C3rYDwn0DxjLzfbHDgnO','DxnHz2u','nZq0odC1mxP0ALHxCa','y2XVC2u','y2fJAgvFy3jLyxrPB25FAw5WDxrFDg9Rzw5Z','y29UDgvUDa','CM9Szq','ls1PBxbVCNq','lMXVy2fS','B3bLBLr1CM4','B3jPz2LUyxrVCG','ChjVy2vZCY5Zy2fUlNbNCMvWx21Z','Aw5JBhvKzxm','lwLJ','y2XHDwrLlwnVzguTC2vZC2LVBNm','AxngAw5PDgu','zw50CMLLCW','Dg9VBf9Yzxn1Bhq','uMvZDw1LzcbZzxnZAw9U','AgfZ','yMLU','AgLNAa','DxrMltG','C2vZC2LVBIbPBNzLBNrVCNKGAw5JCMvTzw50ywXSEsbZy2fUBMvK'];_0x5873=function(){return _0x545e7c;};return _0x5873();}function Cs(_0x2a0450){const _0x181bbe=_0x15b5cc;if(_0x2a0450?.[_0x181bbe(0x25f)]==='event_msg'){let _0x4e8ae6=_0x2a0450[_0x181bbe(0x25b)];switch(_0x4e8ae6?.['type']){case'task_started':return{'kind':_0x181bbe(0x1e7)};case _0x181bbe(0x217):case'turn_aborted':case _0x181bbe(0x282):return{'kind':_0x181bbe(0x289)};case _0x181bbe(0x24a):{let _0x441567=fe(_0x2a0450);return _0x441567&&!j(_0x441567)?{'kind':_0x181bbe(0x1be)}:null;}case _0x181bbe(0x20c):case'agent_message_delta':{let _0x339b79=Ts(_0x4e8ae6);return _0x339b79?{'kind':_0x181bbe(0x260),'text':_0x339b79}:{'kind':_0x181bbe(0x260)};}case'mcp_tool_call_end':case _0x181bbe(0x27c):case'web_search_end':return{'kind':_0x181bbe(0x205)};default:return null;}}if(_0x2a0450?.['type']!==_0x181bbe(0x2ee))return null;let _0x4f4803=_0x2a0450['payload'];switch(_0x4f4803?.['type']){case'message':{if(_0x4f4803['role']==='user'){let _0x114409=N(_0x4f4803['content']);return _0x114409&&!j(_0x114409)?{'kind':_0x181bbe(0x1be)}:null;}if(_0x4f4803['role']==='assistant'){let _0x3eeb47=N(_0x4f4803['content']);return _0x3eeb47?{'kind':'assistant','text':_0x3eeb47}:{'kind':'assistant'};}return null;}case'reasoning':case _0x181bbe(0x245):case'function_call_output':case _0x181bbe(0x301):case _0x181bbe(0x250):case'web_search_call':case _0x181bbe(0x201):case'tool_search_output':return{'kind':'activity'};default:return null;}}function Pn(_0x194ef6,_0x24485a){const _0x4af0cf=_0x15b5cc;let _0x2850ce=_0x194ef6[_0x4af0cf(0x254)]?_0x194ef6[_0x4af0cf(0x29d)]:void 0x0,_0x442d54=Cs(_0x24485a);if(!_0x442d54)return!0x1;_0x442d54['kind']===_0x4af0cf(0x1e7)?(_0x194ef6['hasLifecycleMarker']=!0x0,_0x194ef6[_0x4af0cf(0x29d)]=!0x0,_0x194ef6[_0x4af0cf(0x2df)]=!0x0,_0x194ef6['partialReplyText']=void 0x0):_0x442d54['kind']==='turnFinished'?(_0x194ef6[_0x4af0cf(0x254)]=!0x0,_0x194ef6[_0x4af0cf(0x29d)]=!0x1,_0x194ef6['sawTurnActivity']=!0x1,_0x194ef6['partialReplyText']=void 0x0):_0x194ef6['openTurn']&&(_0x194ef6[_0x4af0cf(0x2df)]=!0x0,_0x442d54[_0x4af0cf(0x2d9)]==='assistant'&&_0x442d54[_0x4af0cf(0x2f1)]&&(_0x194ef6['partialReplyText']=_0x442d54[_0x4af0cf(0x2f1)]));let _0x462b45=_0x194ef6['hasLifecycleMarker']?_0x194ef6['openTurn']:void 0x0;return _0x2850ce!==_0x462b45;}var va=0x400*0x400,Ia=0x80*0x400*0x400,Fn=S['child']({'module':'scanner'});function As(_0x37c7b2){const _0x59ad66=_0x15b5cc;if(_0x37c7b2?.[_0x59ad66(0x25f)]==='user'&&_0x37c7b2['message']?.['role']==='user'){if(_0x37c7b2[_0x59ad66(0x1c4)]===!0x0)return null;if(vn(_0x37c7b2[_0x59ad66(0x1d0)]['content']))return{'kind':'toolResult',...Mn(_0x37c7b2)?{'interrupted':!0x0}:{}};let _0x1b225e=H(_0x37c7b2);return ws(_0x1b225e)?null:_0x1b225e?{'kind':_0x59ad66(0x1be)}:null;}if(_0x37c7b2?.[_0x59ad66(0x25f)]===_0x59ad66(0x260)&&_0x37c7b2[_0x59ad66(0x1d0)]?.[_0x59ad66(0x29a)]===_0x59ad66(0x260)){let _0x4f0050=W(_0x37c7b2[_0x59ad66(0x1d0)][_0x59ad66(0x299)]),_0x26fbd3=_0x37c7b2[_0x59ad66(0x1d0)]?.['stop_reason'];return{'kind':'assistant','stopReason':typeof _0x26fbd3=='string'?_0x26fbd3:_0x26fbd3??null,..._0x4f0050?{'text':_0x4f0050}:{}};}return _0x37c7b2?.[_0x59ad66(0x25f)]===_0x59ad66(0x243)&&_0x37c7b2['subtype']==='stop_hook_summary'?{'kind':'stopHook'}:null;}function ws(_0x9c2c38){const _0x46e678=_0x15b5cc;return _0x9c2c38?_0x9c2c38[_0x46e678(0x2a0)]('<local-command-caveat>')||_0x9c2c38['includes']('<command-name>'):!0x1;}function bs(_0x4433c2){const _0x220cb4=_0x15b5cc;if(!_0x4433c2)return{};if(_0x4433c2[_0x220cb4(0x2d9)]==='stopHook')return{};if(_0x4433c2['kind']===_0x220cb4(0x260)){let _0x28048d=_0x4433c2['stopReason']==null||_0x4433c2[_0x220cb4(0x2ed)]==='tool_use';return{..._0x28048d?{'isResponding':!0x0}:{},..._0x28048d&&_0x4433c2[_0x220cb4(0x2f1)]?{'partialReplyText':_0x4433c2[_0x220cb4(0x2f1)]}:{}};}return _0x4433c2[_0x220cb4(0x2d9)]==='toolResult'&&_0x4433c2[_0x220cb4(0x225)]?{}:{'isResponding':!0x0};}async function kn(_0x1700fb){const _0x5cf326=_0x15b5cc;let _0x194320=null;try{await B(_0x1700fb,_0x2bd426=>{let _0x335ec5=As(_0x2bd426);_0x335ec5&&(_0x194320=_0x335ec5);});}catch(_0x7d3c60){return _0x7d3c60[_0x5cf326(0x20f)]!=='ENOENT'&&Fn[_0x5cf326(0x268)]({'filePath':_0x1700fb,'error':String(_0x7d3c60)},_0x5cf326(0x2b1)),{};}return bs(_0x194320);}async function Ln(_0xe7565){const _0x595398=_0x15b5cc;let _0x1f8384=_n();try{await B(_0xe7565,_0x161ff6=>{Pn(_0x1f8384,_0x161ff6);});}catch(_0x47e6a8){return _0x47e6a8['code']!=='ENOENT'&&Fn[_0x595398(0x268)]({'filePath':_0xe7565,'error':String(_0x47e6a8)},'failed\x20to\x20read\x20codex\x20session\x20runtime\x20hints'),{};}return!_0x1f8384['openTurn']||!_0x1f8384[_0x595398(0x2df)]?{}:{'isResponding':!0x0,..._0x1f8384['partialReplyText']?{'partialReplyText':_0x1f8384['partialReplyText']}:{}};}var rt=require(_0x15b5cc(0x26e));function st(_0x11f019){return(0x0,rt['basename'])(_0x11f019,'.jsonl')||null;}function ot(_0x220dfe){const _0x5a95d8=_0x15b5cc;return(0x0,rt[_0x5a95d8(0x2c6)])(_0x220dfe,_0x5a95d8(0x23f))[_0x5a95d8(0x2dc)](/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[0x1]??null;}function M(_0x3cca2a,_0x17462b){const _0x5c5760=_0x15b5cc;return _0x3cca2a===_0x5c5760(0x325)?st(_0x17462b):ot(_0x17462b);}var $a=S['child']({'module':'scanner'}),G=new Map(),Nn=0x2710;function Me(_0x58fef0,_0x13d3bd){return _0x58fef0+':'+_0x13d3bd;}function vs(_0x4724d1,_0x565d8d){const _0x1c9e9b=_0x15b5cc;return _0x4724d1['size']===_0x565d8d[_0x1c9e9b(0x30d)]&&_0x4724d1[_0x1c9e9b(0x1f6)]===_0x565d8d[_0x1c9e9b(0x1f6)]&&_0x4724d1['birthtimeMs']===_0x565d8d[_0x1c9e9b(0x20b)];}function it(_0x2b7b50,_0x79d970,_0x48534e){const _0x191b70=_0x15b5cc;let _0x7ac1dc=Me(_0x79d970,_0x2b7b50),_0x77e531=G['get'](_0x7ac1dc);if(_0x77e531){if(!vs(_0x77e531,_0x48534e)){G['delete'](_0x7ac1dc);return;}return _0x77e531[_0x191b70(0x286)]=Date[_0x191b70(0x31c)](),_0x77e531['value'];}}function Is(){const _0x3bc9f2=_0x15b5cc;if(G[_0x3bc9f2(0x30d)]<=Nn)return;let _0x343682=[...G['entries']()]['sort']((_0x3a0c1a,_0x33e2f7)=>_0x3a0c1a[0x1]['lastUsedAt']-_0x33e2f7[0x1][_0x3bc9f2(0x286)]),_0x198585=G[_0x3bc9f2(0x30d)]-Nn;for(let _0x157d01=0x0;_0x157d01<_0x198585;_0x157d01+=0x1){let _0x1db7aa=_0x343682[_0x157d01]?.[0x0];_0x1db7aa&&G['delete'](_0x1db7aa);}}function at(_0x531bbe,_0x236d56,_0x37061c,_0x285ce8){const _0xe25156=_0x15b5cc;G['set'](Me(_0x236d56,_0x531bbe),{'size':_0x37061c[_0xe25156(0x30d)],'mtimeMs':_0x37061c[_0xe25156(0x1f6)],'birthtimeMs':_0x37061c['birthtimeMs'],'value':_0x285ce8,'lastUsedAt':Date[_0xe25156(0x31c)]()}),Is();}async function lt(_0x462734,_0x430786){let _0x39f4a2,_0x3fbb11,_0x1b50a2=await et(_0x462734,_0x430786);for(let _0x16a4d6 of _0x1b50a2['split']('\x0a')){if(!_0x16a4d6['trim']())continue;let _0x5bfba1;try{_0x5bfba1=JSON['parse'](_0x16a4d6);}catch{continue;}let _0x233f65=an(_0x5bfba1);_0x233f65&&(_0x39f4a2=_0x233f65);let _0xc49f9f=ln(_0x5bfba1);_0xc49f9f&&(_0x3fbb11=_0xc49f9f);}return{'approvalMode':_0x39f4a2,'lastUsage':_0x3fbb11};}async function ct(_0x32b30a,_0x38a775){const _0x4b7bb6=_0x15b5cc;let _0x1d2e83,_0x160f0f,_0x24f09b=await et(_0x32b30a,_0x38a775);for(let _0x3a58cb of _0x24f09b[_0x4b7bb6(0x2c2)]('\x0a')){if(!_0x3a58cb['trim']())continue;let _0x3b746e;try{_0x3b746e=JSON['parse'](_0x3a58cb);}catch{continue;}let _0x282fce=on(_0x3b746e);_0x282fce&&(_0x1d2e83=_0x282fce);let _0x28e7cd=cn(_0x3b746e);_0x28e7cd&&(_0x160f0f=_0x28e7cd);}return{'approvalMode':_0x1d2e83,'lastUsage':_0x160f0f};}var Va=S['child']({'module':'inventory'});function Dn(_0x1418ed=_0x15b5cc(0x2a9),_0x3f5469='resumeSession'){const _0xc96d89=_0x15b5cc;return{'state':_0xc96d89(0x1bc),'confidence':_0x1418ed,'resumeMode':_0x3f5469};}var ft=S[_0x15b5cc(0x1c8)]({'module':'scanner'}),_e=0x7530,fl=re(_e),pl=re(_e),ml=re(_e),Re=re(_e),ut=new Map(),dt=new Map();function $n(_0x578063){const _0x31130f=_0x15b5cc;let _0xb71a73=_0x31130f(0x278)+(0x0,ee[_0x31130f(0x30e)])(),_0x1f8199=new Map();for(let _0x379507 of _0x578063)_0x1f8199['has'](_0x379507[_0x31130f(0x2fc)])||_0x1f8199['set'](_0x379507['cwd'],_0x379507[_0x31130f(0x2dc)]);Re['set'](_0xb71a73,_0x1f8199);}function Es(_0x27fb03){const _0x2ba750=_0x15b5cc;let _0x48176f=(0x0,v['basename'])(_0x27fb03[_0x2ba750(0x1f3)])[_0x2ba750(0x2dc)](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x48176f){let _0x3d64b6=Date['parse'](_0x48176f[0x1]+':'+_0x48176f[0x2]+':'+_0x48176f[0x3]);if(Number[_0x2ba750(0x2a3)](_0x3d64b6))return _0x3d64b6;}return _0x27fb03['birthtimeMs'];}function On(_0x4a1c40){return _0x4a1c40?.['trim']()||void 0x0;}function Ms(_0x3fd482){const _0x3390e9=_0x15b5cc;if(_0x3fd482['type']!=='session_meta')return null;let _0x5117b1=_0x3fd482[_0x3390e9(0x25b)]?.['source'],_0x4c4193=typeof _0x5117b1=='object'&&_0x5117b1!==null&&Object['hasOwn'](_0x5117b1,_0x3390e9(0x27b)),_0x2cc797=On(_0x3fd482['payload']?.['parent_thread_id'])||(_0x4c4193?On(_0x5117b1[_0x3390e9(0x27b)]?.['thread_spawn']?.[_0x3390e9(0x25a)]):void 0x0);return!_0x2cc797&&!_0x4c4193?null:_0x2cc797?{'parentSessionId':_0x2cc797}:{};}function Bn(_0x262a25){for(let _0x1a5723 of de(_0x262a25,0x60)){let _0x2d2a9a;try{_0x2d2a9a=JSON['parse'](_0x1a5723);}catch{continue;}if(_0x2d2a9a['type']==='session_meta')return Ms(_0x2d2a9a);}return null;}async function Rs(_0x5c922f,_0x2b36de){const _0x150507=_0x15b5cc;if(_0x2b36de){let _0x30d0c7=it(_0x5c922f,'codex',_0x2b36de);if(_0x30d0c7!==void 0x0)return _0x30d0c7?{'cwd':_0x30d0c7['cwd'],'sessionId':_0x30d0c7['sessionId']}:null;}let _0x2218d6=_0x2b36de??await(0x0,R[_0x150507(0x2e3)])(_0x5c922f)['catch'](()=>null);if(!_0x2218d6)return null;try{let _0x4c4bfc=await Ee(_0x5c922f,_0x2218d6['size']);if(Bn(_0x4c4bfc))return null;let _0x595303='',_0x3c85d4='';for(let _0x34505b of de(_0x4c4bfc,0x60)){let _0x549cca;try{_0x549cca=JSON[_0x150507(0x2e1)](_0x34505b);}catch{continue;}if(_0x595303||(_0x595303=_0x549cca['payload']?.['cwd']??_0x549cca['cwd']??''),_0x3c85d4||(_0x3c85d4=_0x549cca['payload']?.['id']??_0x549cca['id']??''),_0x595303&&_0x3c85d4)break;}return _0x595303?{'cwd':_0x595303,'sessionId':_0x3c85d4||M(_0x150507(0x251),_0x5c922f)||(0x0,v[_0x150507(0x2c6)])(_0x5c922f,_0x150507(0x23f))}:null;}catch{return null;}}function Wn(_0x1ab6e3,_0x3704ae='scanner'){const _0x5a1aff=_0x15b5cc;return{'sessionId':_0x1ab6e3['sessionId'],'agent':_0x1ab6e3[_0x5a1aff(0x27d)],'cwd':_0x1ab6e3['cwd'],..._0x1ab6e3[_0x5a1aff(0x306)]?{'originCwd':_0x1ab6e3[_0x5a1aff(0x306)]}:{},..._0x1ab6e3['model']?{'model':_0x1ab6e3[_0x5a1aff(0x24e)]}:{},..._0x1ab6e3[_0x5a1aff(0x1d5)]?{'effort':_0x1ab6e3['effort']}:{},'title':_0x1ab6e3['title'],..._0x1ab6e3['titleAliases']?.['length']?{'titleAliases':_0x1ab6e3['titleAliases']}:{},..._0x1ab6e3[_0x5a1aff(0x2eb)]?{'customTitle':_0x1ab6e3['customTitle']}:{},..._0x1ab6e3['originator']?{'originator':_0x1ab6e3[_0x5a1aff(0x29e)]}:{},...typeof _0x1ab6e3[_0x5a1aff(0x311)]==_0x5a1aff(0x28c)?{'externalArchived':_0x1ab6e3[_0x5a1aff(0x311)]}:{},'observedApprovalMode':_0x1ab6e3[_0x5a1aff(0x2fb)],'lastUsage':_0x1ab6e3['lastUsage'],'createdAt':_0x1ab6e3['createdAt'],'lastActivityAt':_0x1ab6e3['lastActivityAt'],'sources':[_0x3704ae],'runtime':Dn()};}async function Un(_0x59ab54,_0x5efaad){const _0x56f2b9=_0x15b5cc;let _0x57515d=await Ee(_0x59ab54,_0x5efaad),_0x4abedb=de(_0x57515d,0x40),_0x10feaa='',_0x697cae='',_0x19cead,_0x2fbda9,_0x416c6f;for(let _0x3b5bc6 of _0x4abedb){let _0xf52602;try{_0xf52602=JSON['parse'](_0x3b5bc6);}catch{continue;}if(!_0x10feaa&&typeof _0xf52602['cwd']==_0x56f2b9(0x314)&&(_0x10feaa=_0xf52602['cwd']),!_0x697cae&&typeof _0xf52602['sessionId']=='string'&&(_0x697cae=_0xf52602[_0x56f2b9(0x210)]),_0x19cead||(_0x19cead=L([_0xf52602['customTitle'],_0xf52602['summary']])),!_0x416c6f){let _0x12a21c=H(_0xf52602),_0x51d1c4=L([],_0x12a21c);_0x51d1c4&&(_0x2fbda9=_0x12a21c,_0x416c6f=_0x51d1c4);}if(_0x10feaa&&(_0x19cead||_0x416c6f))break;}if(!_0x10feaa)return null;let _0x33c84a=await ct(_0x59ab54,_0x5efaad);return{'sessionId':_0x697cae||M(_0x56f2b9(0x325),_0x59ab54)||(0x0,v[_0x56f2b9(0x2c6)])(_0x59ab54,'.jsonl'),'cwd':_0x10feaa,'title':_0x19cead??_0x416c6f??L([],_0x2fbda9),'approvalMode':_0x33c84a['approvalMode'],'lastUsage':_0x33c84a['lastUsage']};}async function _s(_0x5b3839,_0x2bfa41){const _0x239a95=_0x15b5cc;let _0x27a31c=await Ee(_0x5b3839,_0x2bfa41);if(Bn(_0x27a31c))return null;let _0x4341de=de(_0x27a31c,0x60),_0x1e578b='',_0x2088c8='',_0x2826dc,_0x59b8fd,_0xca69d1,_0x18a3bd;for(let _0x4aa548 of _0x4341de){let _0x3fb2e8;try{_0x3fb2e8=JSON['parse'](_0x4aa548);}catch{continue;}if(_0x1e578b||(_0x1e578b=_0x3fb2e8['payload']?.['cwd']??_0x3fb2e8['cwd']??''),_0x2088c8||(_0x2088c8=_0x3fb2e8[_0x239a95(0x25b)]?.['id']??_0x3fb2e8['id']??''),!_0x18a3bd&&typeof _0x3fb2e8['payload']?.[_0x239a95(0x29e)]==_0x239a95(0x314)&&(_0x18a3bd=_0x3fb2e8[_0x239a95(0x25b)][_0x239a95(0x29e)]),_0x2826dc||(_0x2826dc=L([_0x3fb2e8[_0x239a95(0x25b)]?.['title'],_0x3fb2e8['title']])),!_0xca69d1){let _0x46a7df=fe(_0x3fb2e8),_0x5b9d38=_0x46a7df&&!j(_0x46a7df)?L([],_0x46a7df):void 0x0;_0x5b9d38&&(_0x59b8fd=_0x46a7df,_0xca69d1=_0x5b9d38);}if(_0x1e578b&&(_0x2826dc||_0xca69d1))break;}if(!_0x1e578b)return null;let _0x121558=await lt(_0x5b3839,_0x2bfa41),_0x5eb4c9=_0x2088c8||M('codex',_0x5b3839)||(0x0,v[_0x239a95(0x2c6)])(_0x5b3839,_0x239a95(0x23f)),_0x3ae897=_0x2826dc??_0xca69d1??L([],_0x59b8fd);return{'sessionId':_0x5eb4c9,'cwd':_0x1e578b,'title':_0x3ae897,'approvalMode':_0x121558['approvalMode'],'lastUsage':_0x121558['lastUsage'],'originator':_0x18a3bd};}async function Ps(_0x5251c3,_0xd2c712,_0x2889cd){const _0x2b215a=_0x15b5cc;return Pe(_0xd2c712)[_0x2b215a(0x2ec)](_0x5251c3,_0x2889cd[_0x2b215a(0x30d)]);}async function Fs(_0x13c4e7,_0x1d5a2b,_0x5ec411){const _0xb3d07a=_0x15b5cc;let _0x146e39=it(_0x13c4e7,_0x1d5a2b,_0x5ec411);if(_0x146e39!==void 0x0)return _0x146e39;let _0x122b14=Me(_0x1d5a2b,_0x13c4e7)+':'+_0x5ec411['size']+':'+_0x5ec411[_0xb3d07a(0x1f6)]+':'+_0x5ec411[_0xb3d07a(0x20b)],_0x42c1c3=dt['get'](_0x122b14);return _0x42c1c3||(_0x42c1c3=(async()=>{try{let _0x589e38=await Ps(_0x13c4e7,_0x1d5a2b,_0x5ec411);return at(_0x13c4e7,_0x1d5a2b,_0x5ec411,_0x589e38),_0x589e38;}catch{return at(_0x13c4e7,_0x1d5a2b,_0x5ec411,null),null;}})()['finally'](()=>{dt['delete'](_0x122b14);}),dt['set'](_0x122b14,_0x42c1c3)),_0x42c1c3;}function ks(_0xfee0f7,_0x1ec1f8,_0x1f9c05,_0x54fbf6){const _0x4312bb=_0x15b5cc;let _0x5dd828={'sessionId':_0xfee0f7['sessionId'],'agent':_0xfee0f7[_0x4312bb(0x27d)],'cwd':_0xfee0f7['cwd'],'title':_0xfee0f7[_0x4312bb(0x269)],'approvalMode':_0xfee0f7[_0x4312bb(0x2fb)],'lastUsage':_0xfee0f7['lastUsage'],'originator':_0xfee0f7['originator'],'createdAt':new Date(_0x1f9c05['birthtimeMs'])[_0x4312bb(0x1f8)](),'lastActivityAt':new Date(_0x1f9c05['mtimeMs'])['toISOString'](),'filePath':_0x1ec1f8};if(_0xfee0f7[_0x4312bb(0x27d)]!==_0x4312bb(0x251))return _0x5dd828;let _0x11b3ec=yn(_0x54fbf6,_0xfee0f7['sessionId'],_0x1ec1f8),_0x477799=xn(_0x54fbf6,_0xfee0f7['sessionId'],_0x1ec1f8),_0x2334cf=_0x11b3ec&&_0xfee0f7[_0x4312bb(0x269)]&&_0x11b3ec!==_0xfee0f7['title']?[_0xfee0f7[_0x4312bb(0x269)]]:void 0x0;return{..._0x5dd828,'title':_0x11b3ec??_0xfee0f7['title'],..._0x2334cf?{'titleAliases':_0x2334cf}:{},...typeof _0x477799=='boolean'?{'externalArchived':_0x477799}:{}};}async function pt(_0xe7ebab,_0x409c8d,_0x13661e,_0x193dfa){let _0x58a865=await Fs(_0xe7ebab,_0x409c8d,_0x13661e);if(!_0x58a865)return null;let _0x3aaab9=_0x409c8d==='codex'?_0x193dfa??await Ie():void 0x0;return ks(_0x58a865,_0xe7ebab,_0x13661e,_0x3aaab9);}async function Hn(_0x567f4b,_0x5d2e7a){const _0x21a1c8=_0x15b5cc;let _0x2cb8d7=await(0x0,R['stat'])(_0x567f4b)['catch'](()=>null);return _0x2cb8d7?.[_0x21a1c8(0x1ea)]()?pt(_0x567f4b,_0x5d2e7a,{'size':_0x2cb8d7['size'],'mtimeMs':_0x2cb8d7['mtimeMs'],'birthtimeMs':_0x2cb8d7['birthtimeMs']}):null;}async function jn(_0x2cb1e3,_0x4dd125={}){const _0x2ea840=_0x15b5cc;if(!_0x2cb1e3)return null;let _0x138a16=typeof _0x4dd125[_0x2ea840(0x316)]==_0x2ea840(0x228)?_0x4dd125[_0x2ea840(0x316)]:null,_0x3785a2=_0x2ea840(0x278)+(0x0,ee['homedir'])(),_0x29b8d9=_0x138a16===null?Re['get'](_0x3785a2):null;if(_0x29b8d9&&_0x138a16===null){let _0x3fe4af=_0x29b8d9['get'](_0x2cb1e3);if(_0x29b8d9['has'](_0x2cb1e3))return _0x3fe4af?{'sessionId':_0x3fe4af[_0x2ea840(0x210)],'filePath':_0x3fe4af[_0x2ea840(0x1f3)]}:null;}let _0x73ea3c=_0x138a16===null?_0x2cb1e3:_0x2cb1e3+':'+_0x138a16,_0x1aebe8=ut['get'](_0x73ea3c);_0x1aebe8||(_0x1aebe8=(async()=>{const _0x23ff1f=_0x2ea840;let _0x39b459=(await ie())['filter'](_0x4f0145=>_0x138a16===null||Es(_0x4f0145)>=_0x138a16),_0x245766=Pe(_0x23ff1f(0x251));for(let _0x138056=0x0;_0x138056<_0x39b459[_0x23ff1f(0x21b)];_0x138056+=b){let _0xd454ae=_0x39b459['slice'](_0x138056,_0x138056+b),_0x451fa6=(await Promise['all'](_0xd454ae['map'](async _0x598d05=>{const _0x34e5d7=_0x23ff1f;let _0x39a1f7=await _0x245766[_0x34e5d7(0x309)](_0x598d05['path'],_0x598d05);return _0x39a1f7?{'entry':_0x598d05,'meta':_0x39a1f7}:null;})))[_0x23ff1f(0x25e)](_0x1354d7=>_0x1354d7?.['meta']['cwd']===_0x2cb1e3);if(_0x451fa6)return{'path':_0x451fa6['entry'][_0x23ff1f(0x1f3)],'mtimeMs':_0x451fa6[_0x23ff1f(0x32b)]['mtimeMs'],'sessionId':_0x451fa6['meta']['sessionId']};}return null;})()[_0x2ea840(0x2f0)](()=>{ut['delete'](_0x73ea3c);}),ut['set'](_0x73ea3c,_0x1aebe8));let _0x555fb5=await _0x1aebe8;if(_0x138a16!==null)return _0x555fb5?{'sessionId':_0x555fb5[_0x2ea840(0x210)],'filePath':_0x555fb5['path']}:null;let _0x3808eb=Re['get'](_0x3785a2)??_0x29b8d9??new Map();return _0x3808eb['set'](_0x2cb1e3,_0x555fb5),Re['set'](_0x3785a2,_0x3808eb),_0x555fb5?{'sessionId':_0x555fb5[_0x2ea840(0x210)],'filePath':_0x555fb5[_0x2ea840(0x1f3)]}:null;}async function mt(_0x3487ba,_0x570af7){const _0x47c34b=_0x15b5cc;let _0x930e48=(0x0,v['join'])((0x0,ee[_0x47c34b(0x30e)])(),'.claude','projects'),_0x419110=_0x570af7?pn(_0x570af7):null,_0x3bbe31=await(0x0,R[_0x47c34b(0x280)])(_0x930e48)[_0x47c34b(0x2ac)](()=>[]),_0x30b3e8=_0x419110?[_0x419110,..._0x3bbe31[_0x47c34b(0x276)](_0x38f1c7=>_0x38f1c7!==_0x419110)]:_0x3bbe31;for(let _0x2f344b of _0x30b3e8){let _0x36f0ae=(0x0,v[_0x47c34b(0x262)])(_0x930e48,_0x2f344b,_0x3487ba+'.jsonl');if((await(0x0,R[_0x47c34b(0x2e3)])(_0x36f0ae)['catch'](()=>null))?.[_0x47c34b(0x1ea)]())return _0x36f0ae;}return null;}async function Ls(_0x2b1734,_0x33c808){const _0x343fdf=_0x15b5cc;let _0x217be4=await mt(_0x2b1734,_0x33c808);if(!_0x217be4)return;let _0xf0a26f=await(0x0,R['stat'])(_0x217be4)[_0x343fdf(0x2ac)](()=>null);return _0xf0a26f?.['isFile']()?(await ct(_0x217be4,_0xf0a26f['size']))[_0x343fdf(0x257)]:void 0x0;}async function Ns(_0x11ccc7){const _0x35f0a6=_0x15b5cc;let _0x139895=(0x0,v['join'])((0x0,ee['homedir'])(),'.codex','sessions'),_0x4e8fc8=await gt(_0x139895,_0x11ccc7);if(!_0x4e8fc8)return;let _0x289a8c=await(0x0,R['stat'])(_0x4e8fc8)[_0x35f0a6(0x2ac)](()=>null);return _0x289a8c?.['isFile']()?(await lt(_0x4e8fc8,_0x289a8c['size']))['lastUsage']:void 0x0;}async function Ds(_0x23a5c9,_0x51e75a,_0xb9444f){const _0x4d97ff=_0x15b5cc;return Pe(_0x51e75a)[_0x4d97ff(0x202)](_0x23a5c9,_0xb9444f);}async function zn(_0x556673,_0xadef7f){return Pe(_0xadef7f)['readRuntimeHintsFromFile'](_0x556673);}function Z(_0x1f8a8c,_0x27c16e,_0x3bc9fa){const _0x9368bf=_0x15b5cc;let _0x36361b=wn(_0x27c16e);if(_0x3bc9fa?.['coalesceConsecutiveAssistant']&&_0x36361b['role']==='assistant'){let _0x50265f=_0x1f8a8c[_0x1f8a8c[_0x9368bf(0x21b)]-0x1];if(_0x50265f?.['role']===_0x9368bf(0x260)&&_0x50265f[_0x9368bf(0x25f)]!=='info'&&_0x36361b[_0x9368bf(0x25f)]!==_0x9368bf(0x1f5)&&!_t(_0x50265f[_0x9368bf(0x299)])&&(_0x36361b['content']===_0x50265f[_0x9368bf(0x299)]||_0x36361b['content']['startsWith'](_0x50265f['content']))){_0x1f8a8c[_0x1f8a8c['length']-0x1]=_0x36361b;return;}}_0x1f8a8c['push'](_0x36361b);}async function Os(_0x2af184,_0x1894bb){const _0x418847=_0x15b5cc;let _0x1e5224=[];try{let _0x139512=await mt(_0x2af184,_0x1894bb);if(_0x139512){let _0xa6ce1f=new Map();await B(_0x139512,_0x15e631=>{const _0x343f02=_0x3ecc;if(_0x15e631['type']===_0x343f02(0x260)&&_0x15e631[_0x343f02(0x1d0)]?.['role']==='assistant'&&Array['isArray'](_0x15e631['message']['content']))for(let _0x4c44ef of _0x15e631['message']['content']){if(!_0x4c44ef||typeof _0x4c44ef!='object'||_0x4c44ef[_0x343f02(0x25f)]!=='tool_use'||typeof _0x4c44ef['id']!='string')continue;let _0x4feae8=typeof _0x4c44ef[_0x343f02(0x22a)]==_0x343f02(0x314)?_0x4c44ef['name']:null,_0x8b5378=_0x4c44ef[_0x343f02(0x235)]&&typeof _0x4c44ef['input']=='object'?_0x4c44ef['input']:null,_0x3080e7=Pt(_0x4feae8,_0x8b5378,_0x1894bb);_0x3080e7&&_0xa6ce1f['set'](_0x4c44ef['id'],_0x3080e7);}if(_0x15e631['type']==='user'&&_0x15e631[_0x343f02(0x1d0)]?.['role']==='user'){if(Array[_0x343f02(0x2d0)](_0x15e631[_0x343f02(0x1d0)]['content']))for(let _0x383191 of _0x15e631['message']['content']){if(!_0x383191||typeof _0x383191!=_0x343f02(0x2d5)||_0x383191[_0x343f02(0x25f)]!=='tool_result')continue;if(_0x383191[_0x343f02(0x266)]===!0x0){let _0x24a3c7=tt(_0x383191['content']),_0x4ca166=In(_0x24a3c7);_0x4ca166&&Z(_0x1e5224,En(_0x4ca166,nt(_0x15e631)));continue;}let _0x4b14f2=typeof _0x383191[_0x343f02(0x300)]=='string'?_0x383191[_0x343f02(0x300)]:'',_0x1ce5b9=_0x4b14f2?_0xa6ce1f[_0x343f02(0x21f)](_0x4b14f2):void 0x0;if(!_0x1ce5b9)continue;let _0x559b89=tt(_0x383191[_0x343f02(0x299)]);if(!Ft(_0x15e631['toolUseResult'],_0x559b89))continue;let _0x1e1533=Be([_0x1ce5b9]);_0x1e1533&&Z(_0x1e5224,z({'role':'assistant','content':_0x1e1533},_0x15e631));}let _0x5e8c55=H(_0x15e631);if(_0x5e8c55){let _0x18140a=typeof _0x15e631[_0x343f02(0x216)]=='string'&&_0x15e631['parentUuid']?_0x15e631[_0x343f02(0x216)]:null;Z(_0x1e5224,z({'role':_0x343f02(0x272),'content':_0x5e8c55,...typeof _0x15e631['uuid']=='string'&&_0x15e631['uuid']?{'rewindPoint':{'provider':'claude','messageId':_0x18140a}}:{}},_0x15e631));}}else{if(_0x15e631['type']===_0x343f02(0x260)&&_0x15e631['message']?.['role']==='assistant'){let _0x2a8ac6=W(_0x15e631['message']['content']);_0x2a8ac6&&Z(_0x1e5224,z({'role':_0x343f02(0x260),'content':_0x2a8ac6},_0x15e631));}}});}}catch(_0x2b77d0){ft['warn']({'error':String(_0x2b77d0)},_0x418847(0x218));}return _0x1e5224;}async function Us(_0x224957,_0x1e5b79){const _0x1c13b4=_0x15b5cc;let _0x27be82=[];try{let _0x516e23=await Ds(_0x224957,_0x1c13b4(0x251),_0x1e5b79);if(_0x516e23){let _0x33686a;await B(_0x516e23,_0x4f126c=>{const _0x9c4749=_0x1c13b4;_0x4f126c['type']===_0x9c4749(0x1e3)&&_0x4f126c['payload']?.[_0x9c4749(0x25f)]==='task_started'&&(_0x33686a=typeof _0x4f126c[_0x9c4749(0x25b)]['turn_id']==_0x9c4749(0x314)&&_0x4f126c[_0x9c4749(0x25b)]['turn_id']?_0x4f126c[_0x9c4749(0x25b)]['turn_id']:void 0x0);let _0xb2c79=kt(_0x4f126c,{'cwd':_0x1e5b79,'includePatchCalls':!0x0}),_0x42519d=Be(_0xb2c79);if(_0x42519d&&Z(_0x27be82,z({'role':'assistant','content':_0x42519d},_0x4f126c)),_0x4f126c[_0x9c4749(0x25f)]!==_0x9c4749(0x2ee)||_0x4f126c[_0x9c4749(0x25b)]?.['type']!=='message')return;let _0x2f7343=_0x4f126c['payload']['role'];if(_0x2f7343!==_0x9c4749(0x272)&&_0x2f7343!=='assistant')return;let _0x467ed0=N(_0x4f126c[_0x9c4749(0x25b)][_0x9c4749(0x299)]);_0x467ed0&&(_0x2f7343==='user'&&j(_0x467ed0)||Z(_0x27be82,z({'role':_0x2f7343,'content':_0x467ed0,..._0x2f7343===_0x9c4749(0x272)&&_0x33686a?{'rewindPoint':{'provider':'codex','turnId':_0x33686a}}:{}},_0x4f126c),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0x138cbc){ft[_0x1c13b4(0x268)]({'error':String(_0x138cbc)},_0x1c13b4(0x211));}return _0x27be82;}var $s={'claude':{'agent':'claude','extractSessionIdFromFile':st,async 'readFileMeta'(_0x478334,_0x2c7143){let _0x1bc943=await Un(_0x478334,_0x2c7143);return _0x1bc943?{..._0x1bc943,'agent':'claude'}:null;},async 'readSessionCwdAndId'(_0x2934c7,_0x121680){const _0x425b4a=_0x15b5cc;let _0x36321e=_0x121680??await(0x0,R['stat'])(_0x2934c7)['catch'](()=>null);if(!_0x36321e)return null;let _0x39a3db=await Un(_0x2934c7,_0x36321e[_0x425b4a(0x30d)]);return _0x39a3db?{'cwd':_0x39a3db[_0x425b4a(0x2fc)],'sessionId':_0x39a3db[_0x425b4a(0x210)]}:null;},'resolveSessionFilePath':mt,'readLastUsage':Ls,'readRuntimeHintsFromFile':kn,'readHistory':Os},'codex':{'agent':_0x15b5cc(0x251),'extractSessionIdFromFile':ot,async 'readFileMeta'(_0x23fc81,_0x312d0c){const _0x4ce754=_0x15b5cc;let _0x34802b=await _s(_0x23fc81,_0x312d0c);return _0x34802b?{..._0x34802b,'agent':_0x4ce754(0x251)}:null;},'readSessionCwdAndId':Rs,async 'resolveSessionFilePath'(_0x334d66){let _0x5e3cb7=(0x0,v['join'])((0x0,ee['homedir'])(),'.codex','sessions');return gt(_0x5e3cb7,_0x334d66);},'readLastUsage':Ns,'readRuntimeHintsFromFile':Ln,'readHistory':Us}};function Pe(_0x22b252){return $s[_0x22b252];}async function gt(_0x11308b,_0x15f781){const _0x4d04c9=_0x15b5cc;try{let _0x34d319=await(0x0,R[_0x4d04c9(0x280)])(_0x11308b,{'withFileTypes':!0x0});for(let _0x2caf84 of _0x34d319){let _0x1a8706=(0x0,v[_0x4d04c9(0x262)])(_0x11308b,_0x2caf84['name']);if(_0x2caf84[_0x4d04c9(0x25d)]()){let _0x69b43a=await gt(_0x1a8706,_0x15f781);if(_0x69b43a)return _0x69b43a;}else{if(_0x2caf84['name'][_0x4d04c9(0x2a0)](_0x15f781)&&_0x2caf84['name']['endsWith']('.jsonl'))return _0x1a8706;}}}catch(_0x552bff){ft['warn']({'error':String(_0x552bff)},'failed\x20to\x20walk\x20codex\x20sessions\x20dir');}return null;}var Bs=0x40;function ht(_0x34b40d){const _0x2bf14c=_0x15b5cc;return _0x34b40d[_0x2bf14c(0x30d)]+':'+_0x34b40d[_0x2bf14c(0x1f6)]+':'+_0x34b40d['birthtimeMs'];}function Ws(_0x4591f6){const _0x4382b3=_0x15b5cc;return _0x4591f6['map'](_0x212753=>_0x212753[_0x4382b3(0x1f3)]+'\x00'+ht(_0x212753))[_0x4382b3(0x304)]()[_0x4382b3(0x262)]('\x0a');}async function Hs(){const _0x405fb7=_0x15b5cc;let [_0x35f128,_0x908ed7,_0x292f66,_0x343184]=await Promise[_0x405fb7(0x32d)]([We(),ie(),oe(),(0x0,Gn['stat'])((0x0,Vn['join'])((0x0,qn['homedir'])(),_0x405fb7(0x2b2),_0x405fb7(0x2d6)))['catch'](()=>null)]),[_0x4b909a,_0xe7c4c0]=await Promise[_0x405fb7(0x32d)]([Q(_0x35f128),Q(_0x292f66)]);return{'claudeFiles':_0x4b909a,'codexFiles':_0x908ed7,'claudeMetadataFingerprint':Ws(_0xe7c4c0),'codexMetadataFingerprint':_0x343184?.['isFile']()?_0x343184['size']+':'+_0x343184['mtimeMs']+':'+_0x343184['birthtimeMs']:''};}async function js(_0x2480d5,_0x877dcb,_0x288e08){const _0x469a14=_0x15b5cc;let _0x25cc75=await pt(_0x2480d5[_0x469a14(0x1f3)],_0x877dcb,_0x2480d5,_0x877dcb==='codex'?_0x288e08['codex']:void 0x0);if(!_0x25cc75)return null;let _0x721832=_0x877dcb===_0x469a14(0x325)?Ve(_0x25cc75,_0x288e08['claude']['byCliSessionId']['get'](_0x25cc75['sessionId'])):_0x25cc75;return Wn(_0x721832);}var zs={'collectContext':Hs,'loadClaudeLookup':qe,'loadCodexLookup':async _0x4ce006=>(_0x4ce006&&Ye(),Ie()),'readSession':js,'updateLatestCodexCache':$n},Fe=class{constructor(_0x8860a1=zs,_0x5ec6e2=Bs){const _0x419df9=_0x15b5cc;this[_0x419df9(0x1d1)]=_0x8860a1,this['batchSize']=_0x5ec6e2;}[_0x15b5cc(0x2a4)]=new Map();[_0x15b5cc(0x259)]=null;['codexMetadataFingerprint']=null;['claudeLookup']=null;['codexLookup']=null;async['scan'](_0x1462c9){const _0x3b76e1=_0x15b5cc;let _0x5244d7=await this['dependencies'][_0x3b76e1(0x2ba)](),_0x1741ef=this['claudeMetadataFingerprint']===null||this['claudeMetadataFingerprint']!==_0x5244d7[_0x3b76e1(0x259)],_0x3125ce=this[_0x3b76e1(0x2f8)]===null||this['codexMetadataFingerprint']!==_0x5244d7[_0x3b76e1(0x2f8)],[_0x481f41,_0x492ded]=await Promise['all']([_0x1741ef||!this[_0x3b76e1(0x32e)]?this[_0x3b76e1(0x1d1)][_0x3b76e1(0x26d)]():Promise['resolve'](this['claudeLookup']),_0x3125ce||!this[_0x3b76e1(0x28d)]?this['dependencies']['loadCodexLookup'](this['codexMetadataFingerprint']!==null):Promise['resolve'](this[_0x3b76e1(0x28d)])]),_0x262050={'claude':_0x481f41,'codex':_0x492ded},_0x51fee1=[..._0x5244d7[_0x3b76e1(0x236)][_0x3b76e1(0x1d6)](_0x47d044=>({'agent':'claude','entry':_0x47d044})),..._0x5244d7['codexFiles']['map'](_0x548c11=>({'agent':'codex','entry':_0x548c11}))]['sort']((_0xe96b1,_0x7dbc01)=>_0x7dbc01[_0x3b76e1(0x32b)]['mtimeMs']-_0xe96b1[_0x3b76e1(0x32b)][_0x3b76e1(0x1f6)]),_0x544912=new Set(_0x51fee1[_0x3b76e1(0x1d6)](({entry:_0x423128})=>_0x423128[_0x3b76e1(0x1f3)])),_0x12ce2a=[...this[_0x3b76e1(0x2a4)]['keys']()][_0x3b76e1(0x276)](_0x1ee782=>!_0x544912[_0x3b76e1(0x2a7)](_0x1ee782))[_0x3b76e1(0x21b)],_0x1d5ad3=new Map(),_0x42d580=_0x51fee1['filter'](({agent:_0x42f1ea,entry:_0x47e907})=>{const _0xe22136=_0x3b76e1;let _0x395dff=this[_0xe22136(0x2a4)]['get'](_0x47e907[_0xe22136(0x1f3)]);return!(_0x42f1ea==='claude'?_0x1741ef:_0x3125ce)&&_0x395dff?.['fingerprint']===ht(_0x47e907)?(_0x1d5ad3[_0xe22136(0x21c)](_0x47e907[_0xe22136(0x1f3)],_0x395dff),!0x1):!0x0;}),_0x1c833c=0x0,_0x287d90=Math[_0x3b76e1(0x307)](0x1,this['batchSize']);for(let _0x4797ee=0x0;_0x4797ee<_0x42d580[_0x3b76e1(0x21b)];_0x4797ee+=_0x287d90){let _0x285cb0=_0x42d580['slice'](_0x4797ee,_0x4797ee+_0x287d90),_0xc2a077=await _(_0x285cb0,b,({agent:_0x24ec5d,entry:_0x4ca511})=>this['dependencies']['readSession'](_0x4ca511,_0x24ec5d,_0x262050));for(let _0x416631=0x0;_0x416631<_0x285cb0['length'];_0x416631+=0x1){let _0x4c5029=_0x285cb0[_0x416631];_0x1d5ad3[_0x3b76e1(0x21c)](_0x4c5029['entry'][_0x3b76e1(0x1f3)],{'fingerprint':ht(_0x4c5029['entry']),'session':_0xc2a077[_0x416631]});}_0x1c833c+=_0x285cb0[_0x3b76e1(0x21b)],_0x1462c9?.({'processedFiles':_0x1c833c,'changedFiles':_0x42d580[_0x3b76e1(0x21b)],'totalFiles':_0x51fee1[_0x3b76e1(0x21b)],'removedFiles':_0x12ce2a});}let _0x1d7157=[..._0x1d5ad3[_0x3b76e1(0x238)]()][_0x3b76e1(0x1d6)](_0x44eea4=>_0x44eea4[_0x3b76e1(0x281)])[_0x3b76e1(0x276)](_0x2c8018=>_0x2c8018!==null)[_0x3b76e1(0x304)]((_0x44a130,_0x4e8e8c)=>_0x4e8e8c[_0x3b76e1(0x2fa)][_0x3b76e1(0x22c)](_0x44a130[_0x3b76e1(0x2fa)]));return this[_0x3b76e1(0x1d1)]['updateLatestCodexCache'](_0x51fee1['filter'](({agent:_0x81b021})=>_0x81b021===_0x3b76e1(0x251))[_0x3b76e1(0x1d6)](({entry:_0x57b920})=>{const _0x8cc3c2=_0x3b76e1;let _0x30cf1f=_0x1d5ad3['get'](_0x57b920['path'])?.['session'];return _0x30cf1f?{'cwd':_0x30cf1f[_0x8cc3c2(0x2fc)],'match':{'path':_0x57b920[_0x8cc3c2(0x1f3)],'mtimeMs':_0x57b920[_0x8cc3c2(0x1f6)],'sessionId':_0x30cf1f['sessionId']}}:null;})['filter'](_0x1edea8=>_0x1edea8!==null)),this['entries']=_0x1d5ad3,this[_0x3b76e1(0x32e)]=_0x481f41,this['codexLookup']=_0x492ded,this[_0x3b76e1(0x259)]=_0x5244d7['claudeMetadataFingerprint'],this['codexMetadataFingerprint']=_0x5244d7['codexMetadataFingerprint'],{'sessions':_0x1d7157,'changedFiles':_0x42d580[_0x3b76e1(0x21b)],'reusedFiles':_0x51fee1['length']-_0x42d580[_0x3b76e1(0x21b)],'removedFiles':_0x12ce2a,'totalFiles':_0x51fee1['length']};}},or=require(_0x15b5cc(0x1e4)),Se=require('node:fs/promises'),vt=require('node:os'),ge=require('node:path'),ir=require(_0x15b5cc(0x31f)),St=class{[_0x15b5cc(0x285)]=new Map();[_0x15b5cc(0x1fb)]=new Map();['gauges']=new Map();['startTime']=Date[_0x15b5cc(0x31c)]();['logInterval']=null;[_0x15b5cc(0x321)](_0x4f951d,_0x346b8e={}){const _0x138a56=_0x15b5cc;this['counters']['has'](_0x4f951d)||this['counters'][_0x138a56(0x21c)](_0x4f951d,[]);let _0x4befd7=this[_0x138a56(0x285)][_0x138a56(0x21f)](_0x4f951d),_0x3f97b3=JSON[_0x138a56(0x1fd)](_0x346b8e),_0x390c44=_0x4befd7[_0x138a56(0x25e)](_0x3d0230=>JSON[_0x138a56(0x1fd)](_0x3d0230['labels'])===_0x3f97b3);_0x390c44?_0x390c44['value']++:_0x4befd7[_0x138a56(0x22f)]({'value':0x1,'labels':_0x346b8e});}['gauge'](_0xa7e95c,_0x363f21){this['gauges']['set'](_0xa7e95c,_0x363f21);}['startTimer'](_0x112803){let _0x2b2113=performance['now']();return()=>{const _0x2c35ba=_0x3ecc;let _0x4425d9=Math[_0x2c35ba(0x1e2)](performance[_0x2c35ba(0x31c)]()-_0x2b2113),_0x43b2f2=this['timers'][_0x2c35ba(0x21f)](_0x112803)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0x43b2f2['count']++,_0x43b2f2[_0x2c35ba(0x2e5)]+=_0x4425d9,_0x43b2f2[_0x2c35ba(0x2f7)]=Math[_0x2c35ba(0x313)](_0x43b2f2['minMs'],_0x4425d9),_0x43b2f2['maxMs']=Math[_0x2c35ba(0x307)](_0x43b2f2[_0x2c35ba(0x223)],_0x4425d9),_0x43b2f2['lastMs']=_0x4425d9,this[_0x2c35ba(0x1fb)][_0x2c35ba(0x21c)](_0x112803,_0x43b2f2),_0x4425d9;};}['snapshot'](){const _0x5c8692=_0x15b5cc;let _0x539ae6={};for(let [_0x7d3d83,_0x1c124a]of this['counters'])_0x539ae6[_0x7d3d83]=_0x1c124a['map'](_0x5183fa=>({..._0x5183fa}));let _0x4a7b47={};for(let [_0x2bc696,_0x46d827]of this[_0x5c8692(0x1fb)])_0x4a7b47[_0x2bc696]={..._0x46d827,'minMs':_0x46d827[_0x5c8692(0x2f7)]===0x1/0x0?0x0:_0x46d827[_0x5c8692(0x2f7)]};let _0x49a8db={};for(let [_0x115f68,_0x471619]of this['gauges'])_0x49a8db[_0x115f68]=_0x471619;return{'uptimeMs':Date['now']()-this[_0x5c8692(0x24b)],'counters':_0x539ae6,'timers':_0x4a7b47,'gauges':_0x49a8db};}[_0x15b5cc(0x1b9)](_0xf3e059=0xea60){const _0x19768c=_0x15b5cc;this['logInterval']||(this[_0x19768c(0x2c0)]=setInterval(()=>{const _0x47165c=_0x19768c;let _0x311621=this[_0x47165c(0x24d)]();S[_0x47165c(0x1f5)]({'metrics':_0x311621},_0x47165c(0x2db));},_0xf3e059),this['logInterval']['unref']());}['stopPeriodicLog'](){const _0x35cb4a=_0x15b5cc;this[_0x35cb4a(0x2c0)]&&(clearInterval(this[_0x35cb4a(0x2c0)]),this['logInterval']=null);}},q=new St(),El=S['child']({'module':_0x15b5cc(0x1e8)}),yt=require('node:path'),Gs=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,qs=new Set(['sh',_0x15b5cc(0x2be),'zsh',_0x15b5cc(0x1db)]),Vs=new Set(['env',_0x15b5cc(0x22e),'timeout','gtimeout']),Qs=new Set(['node',_0x15b5cc(0x31e),_0x15b5cc(0x319),'tsx']),Js=new Set(['-e',_0x15b5cc(0x28b),'-p',_0x15b5cc(0x2cf)]),Ks=new Set(['-r',_0x15b5cc(0x24f),_0x15b5cc(0x29b),'--loader','--experimental-loader','--env-file','--input-type']);function Xs(_0x2b25ef){return _0x2b25ef['replace'](/^['"]|['"]$/g,'');}function Jn(_0x512aa6){return(_0x512aa6['match'](/"[^"]*"|'[^']*'|\S+/g)??[])['map'](Xs);}function Qn(_0xa347fe){const _0x4993d8=_0x15b5cc;let _0x3e1c64=(0x0,yt[_0x4993d8(0x2c6)])(_0xa347fe);return _0x3e1c64==='claude'||_0x3e1c64==='codex'?_0x3e1c64:null;}function Ys(_0xc69126){for(let _0xb6e16c of _0xc69126['split'](/&&|\|\||;|\n/)){let _0x42f311=Kn(Jn(_0xb6e16c['trim']()),!0x0);if(_0x42f311)return _0x42f311;}return null;}function Kn(_0x3c833b,_0x142c65=!0x1){const _0x2c43c8=_0x15b5cc;let _0x4a42e7=0x0;for(;_0x4a42e7<_0x3c833b[_0x2c43c8(0x21b)];){let _0x50b036=_0x3c833b[_0x4a42e7],_0xdbf7e2=(0x0,yt['basename'])(_0x50b036);if(Vs[_0x2c43c8(0x2a7)](_0xdbf7e2)){if(_0x4a42e7+=0x1,_0xdbf7e2==='env'){for(;_0x4a42e7<_0x3c833b['length']&&/^[A-Za-z_][A-Za-z0-9_]*=/[_0x2c43c8(0x204)](_0x3c833b[_0x4a42e7]);)_0x4a42e7+=0x1;}else{if(_0xdbf7e2===_0x2c43c8(0x2c1)||_0xdbf7e2==='gtimeout'){for(;_0x4a42e7<_0x3c833b['length']&&_0x3c833b[_0x4a42e7][_0x2c43c8(0x2d2)]('-');){let _0x4e7e32=_0x3c833b[_0x4a42e7];_0x4a42e7+=0x1,_0x4e7e32==='-k'&&_0x4a42e7<_0x3c833b['length']&&(_0x4a42e7+=0x1);}_0x4a42e7<_0x3c833b['length']&&(_0x4a42e7+=0x1);}}continue;}if(qs[_0x2c43c8(0x2a7)](_0xdbf7e2)){for(let _0x2773c8=_0x4a42e7+0x1;_0x2773c8<_0x3c833b[_0x2c43c8(0x21b)];_0x2773c8+=0x1){let _0x24cd40=_0x3c833b[_0x2773c8];if(['-c','-lc',_0x2c43c8(0x2a1),'-xc','-ec','-xec'][_0x2c43c8(0x2a0)](_0x24cd40)){let _0x428b41=_0x3c833b[_0x2773c8+0x1];return _0x428b41?Ys(_0x428b41):null;}}return null;}if(Qs['has'](_0xdbf7e2)){let _0x4a1a05=_0x4a42e7+0x1;for(;_0x4a1a05<_0x3c833b[_0x2c43c8(0x21b)];){let _0x1a4fdf=_0x3c833b[_0x4a1a05];if(Js[_0x2c43c8(0x2a7)](_0x1a4fdf))return null;if(_0x1a4fdf==='--'){_0x4a1a05+=0x1;break;}if(!_0x1a4fdf[_0x2c43c8(0x2d2)]('-'))break;_0x4a1a05+=0x1,Ks[_0x2c43c8(0x2a7)](_0x1a4fdf)&&_0x4a1a05<_0x3c833b['length']&&(_0x4a1a05+=0x1);}if(_0x4a1a05>=_0x3c833b[_0x2c43c8(0x21b)])return null;let _0x24f9f7=Qn(_0x3c833b[_0x4a1a05]);return _0x24f9f7?{'agent':_0x24f9f7,'args':_0x3c833b['slice'](_0x4a1a05+0x1),'viaWrapper':!0x0}:null;}let _0x3eed0f=Qn(_0x50b036);return _0x3eed0f?{'agent':_0x3eed0f,'args':_0x3c833b[_0x2c43c8(0x234)](_0x4a42e7+0x1),'viaWrapper':_0x142c65}:null;}return null;}function xt(_0x2f27d6,_0x27658c=!0x1){return Kn(Jn(_0x2f27d6),_0x27658c);}function pe(_0x1d1d2e){const _0x4cf408=_0x15b5cc;let _0x1cc9d9=xt(_0x1d1d2e);return _0x1cc9d9?{'agent':_0x1cc9d9[_0x4cf408(0x27d)],'args':_0x1cc9d9['args']}:null;}function Le(_0x5c6d2e){return Gs['test'](_0x5c6d2e)&&xt(_0x5c6d2e)!==null;}function Xn(_0x4fb266,_0x5d4949){const _0x1ba8bd=_0x15b5cc;let _0x4ca763=pe(_0x5d4949);if(!_0x4ca763||_0x4ca763[_0x1ba8bd(0x27d)]!==_0x4fb266)return null;let {args:_0x307142}=_0x4ca763;if(_0x4fb266===_0x1ba8bd(0x325)){for(let _0x1b385f=0x0;_0x1b385f<_0x307142['length'];_0x1b385f+=0x1){let _0x25e463=_0x307142[_0x1b385f];if((_0x25e463==='--resume'||_0x25e463==='--session-id')&&_0x307142[_0x1b385f+0x1]&&!_0x307142[_0x1b385f+0x1][_0x1ba8bd(0x2d2)]('-'))return _0x307142[_0x1b385f+0x1];if(_0x25e463[_0x1ba8bd(0x2d2)](_0x1ba8bd(0x1b7)))return _0x25e463['slice'](0x9);if(_0x25e463['startsWith']('--session-id='))return _0x25e463['slice'](0xd);}return null;}return _0x307142[0x0]!=='resume'?null:_0x307142[_0x1ba8bd(0x234)](0x1)[_0x1ba8bd(0x25e)](_0x36226e=>!_0x36226e['startsWith']('-'))??null;}function Zs(_0x481f7e,_0x486535){const _0x15039f=_0x15b5cc;let _0x4ce154=pe(_0x486535);if(!(!_0x4ce154||_0x4ce154['agent']!==_0x481f7e)){if(_0x481f7e===_0x15039f(0x251))return _0x4ce154[_0x15039f(0x21e)][_0x15039f(0x2a0)](_0x15039f(0x274))?_0x15039f(0x2b9):void 0x0;if(_0x4ce154[_0x15039f(0x21e)]['includes'](_0x15039f(0x32f)))return'autoApprove';for(let _0x43cda5=0x0;_0x43cda5<_0x4ce154['args']['length'];_0x43cda5+=0x1){let _0x319fc8=_0x4ce154[_0x15039f(0x21e)][_0x43cda5],_0x268c96=_0x319fc8==='--permission-mode'?_0x4ce154[_0x15039f(0x21e)][_0x43cda5+0x1]:_0x319fc8['startsWith']('--permission-mode=')?_0x319fc8[_0x15039f(0x234)](0x12):void 0x0;if(_0x268c96==='plan')return'plan';if(_0x268c96==='acceptEdits')return _0x15039f(0x221);if(_0x268c96===_0x15039f(0x2f9))return'normal';}}}function Tt(_0x203514,_0x4204c0){const _0x1b8d14=_0x15b5cc;let _0x23f571=xt(_0x4204c0);return!_0x23f571||_0x23f571[_0x1b8d14(0x27d)]!==_0x203514||_0x23f571[_0x1b8d14(0x28e)]?!0x1:_0x203514===_0x1b8d14(0x325)?!_0x23f571['args'][_0x1b8d14(0x2a0)](_0x1b8d14(0x2c4))&&!_0x23f571['args']['includes']('-c'):!(_0x23f571['args'][0x0]===_0x1b8d14(0x200)&&!_0x23f571['args'][_0x1b8d14(0x2a0)](_0x1b8d14(0x220))&&!_0x23f571[_0x1b8d14(0x21e)]['some'](_0x56d40a=>_0x56d40a['startsWith'](_0x1b8d14(0x26c))));}function ke(_0x11ae54){const _0x32fe33=_0x15b5cc;return _0x11ae54===_0x32fe33(0x2a9)?0x3:_0x11ae54==='medium'?0x2:0x1;}function eo(_0x15687f,_0x4d4aaa){const _0x5a99ba=_0x15b5cc;return _0x15687f===_0x5a99ba(0x325)?_0x4d4aaa['includes'](_0x5a99ba(0x2f5))&&!_0x4d4aaa['includes'](_0x5a99ba(0x279)):_0x4d4aaa[_0x5a99ba(0x2a0)]('/.codex/sessions/');}function Ct(_0x3e0567){const _0x5dcba8=_0x15b5cc;let _0x124755=[...new Set(_0x3e0567['sessionFiles'])]['filter'](_0xc1a790=>eo(_0x3e0567['agent'],_0xc1a790)),_0x127c9e=Xn(_0x3e0567['agent'],_0x3e0567['command']),_0x30481c=Zs(_0x3e0567[_0x5dcba8(0x27d)],_0x3e0567[_0x5dcba8(0x1c5)]);if(_0x127c9e)return{'agent':_0x3e0567[_0x5dcba8(0x27d)],'pid':_0x3e0567[_0x5dcba8(0x1c3)],'cwd':_0x3e0567[_0x5dcba8(0x2fc)],'command':_0x3e0567['command'],'sessionId':_0x127c9e,'confidence':'high',..._0x30481c?{'approvalMode':_0x30481c}:{},..._0x124755['length']===0x1?{'sessionFilePath':_0x124755[0x0]}:{}};if(_0x124755[_0x5dcba8(0x21b)]!==0x1)return null;let _0x5c8d0e=M(_0x3e0567['agent'],_0x124755[0x0]);return _0x5c8d0e?{'agent':_0x3e0567[_0x5dcba8(0x27d)],'pid':_0x3e0567['pid'],'cwd':_0x3e0567['cwd'],'command':_0x3e0567[_0x5dcba8(0x1c5)],'sessionId':_0x5c8d0e,'confidence':'medium',..._0x30481c?{'approvalMode':_0x30481c}:{},'sessionFilePath':_0x124755[0x0]}:null;}function to(_0x3c2a0f,_0x178c7c){const _0xee669e=_0x15b5cc;let _0x39bd6c=_0x3c2a0f,_0x4c8a05=_0x178c7c;(ke(_0x178c7c['confidence'])>ke(_0x3c2a0f['confidence'])||ke(_0x178c7c[_0xee669e(0x303)])===ke(_0x3c2a0f['confidence'])&&(!!_0x178c7c[_0xee669e(0x1e5)]!=!!_0x3c2a0f['sessionFilePath']&&_0x178c7c['sessionFilePath']||!!_0x178c7c['sessionFilePath']==!!_0x3c2a0f[_0xee669e(0x1e5)]&&_0x178c7c['pid']!==void 0x0&&_0x3c2a0f['pid']!==void 0x0&&_0x178c7c[_0xee669e(0x1c3)]<_0x3c2a0f['pid']))&&(_0x39bd6c=_0x178c7c,_0x4c8a05=_0x3c2a0f);let _0x50ce7f=_0x39bd6c[_0xee669e(0x2fb)]??_0x4c8a05['approvalMode'],_0x2bc492=_0x39bd6c['title']??_0x4c8a05['title'],_0x8b72c0=_0x39bd6c[_0xee669e(0x1e5)]??_0x4c8a05[_0xee669e(0x1e5)],_0x36618d=_0x39bd6c[_0xee669e(0x310)]??_0x4c8a05['isResponding'],_0x59a4e8=_0x39bd6c['terminal']??_0x4c8a05[_0xee669e(0x21a)],_0x17038c={..._0x39bd6c,'cwd':_0x39bd6c[_0xee669e(0x2fc)]||_0x4c8a05['cwd'],..._0x50ce7f?{'approvalMode':_0x50ce7f}:{}};return _0x2bc492!==void 0x0&&(_0x17038c[_0xee669e(0x269)]=_0x2bc492),_0x8b72c0!==void 0x0&&(_0x17038c[_0xee669e(0x1e5)]=_0x8b72c0),_0x36618d!==void 0x0&&(_0x17038c['isResponding']=_0x36618d),_0x59a4e8!==void 0x0&&(_0x17038c[_0xee669e(0x21a)]=_0x59a4e8),_0x17038c;}function At(_0x28db5a){const _0x13ef3d=_0x15b5cc;let _0x547dc6=new Map();for(let _0x3a774e of _0x28db5a){let _0x1e84a1=_0x3a774e['agent']+':'+_0x3a774e[_0x13ef3d(0x210)],_0xb3e3b4=_0x547dc6[_0x13ef3d(0x21f)](_0x1e84a1);_0x547dc6[_0x13ef3d(0x21c)](_0x1e84a1,_0xb3e3b4?to(_0xb3e3b4,_0x3a774e):_0x3a774e);}return[..._0x547dc6[_0x13ef3d(0x238)]()];}var Ne=require(_0x15b5cc(0x23a)),er=require('node:os'),wt=require('node:path');function tr(){const _0x4c86ac=_0x15b5cc;return(0x0,wt['join'])((0x0,er[_0x4c86ac(0x30e)])(),_0x4c86ac(0x267),'sessions');}function Yn(_0x1c6131){const _0x9acad4=_0x15b5cc;let _0x3a12b0=typeof _0x1c6131=='number'?_0x1c6131:typeof _0x1c6131==_0x9acad4(0x314)?Number(_0x1c6131):Number[_0x9acad4(0x305)];return Number[_0x9acad4(0x2a3)](_0x3a12b0)&&_0x3a12b0>0x0?_0x3a12b0:void 0x0;}function Zn(_0x4ed7d2){return _0x4ed7d2['updatedAt']??_0x4ed7d2['startedAt']??0x0;}function nr(_0x4e9082){const _0x4b5cd4=_0x15b5cc;switch(_0x4e9082){case _0x4b5cd4(0x2b8):case'responding':return!0x0;case _0x4b5cd4(0x1bc):return!0x1;default:return;}}async function no(_0x531cf5=tr()){const _0x90c71a=_0x15b5cc;return(await(0x0,Ne[_0x90c71a(0x280)])(_0x531cf5,{'withFileTypes':!0x0})['catch'](()=>[]))['filter'](_0x43d2af=>_0x43d2af[_0x90c71a(0x1ea)]()&&_0x43d2af[_0x90c71a(0x22a)]['endsWith']('.json'))['map'](_0x31a0b1=>(0x0,wt['join'])(_0x531cf5,_0x31a0b1['name']));}async function ro(_0x4171c3){const _0x270c07=_0x15b5cc;try{let _0x18f0a1=JSON[_0x270c07(0x2e1)](await(0x0,Ne['readFile'])(_0x4171c3,'utf-8')),_0x4b0d6a=C(_0x18f0a1[_0x270c07(0x210)]);if(!_0x4b0d6a)return;let _0x350719={'sessionId':_0x4b0d6a},_0x3ef5be=C(_0x18f0a1['cwd']),_0x4fb546=C(_0x18f0a1[_0x270c07(0x263)]),_0x19a841=Yn(_0x18f0a1['startedAt']),_0x2a20f0=Yn(_0x18f0a1['updatedAt']);return _0x3ef5be&&(_0x350719[_0x270c07(0x2fc)]=_0x3ef5be),_0x4fb546&&(_0x350719['status']=_0x4fb546),_0x19a841&&(_0x350719[_0x270c07(0x20d)]=_0x19a841),_0x2a20f0&&(_0x350719[_0x270c07(0x2e4)]=_0x2a20f0),_0x350719;}catch{return;}}async function rr(_0x30091f,_0x164bfc=tr()){const _0x3742be=_0x15b5cc;if(!_0x30091f)return;let _0xc1afa8=await no(_0x164bfc),_0x44b6ff=await _(_0xc1afa8,b,ro),_0x263d1b;for(let _0x28e1ce of _0x44b6ff)!_0x28e1ce||_0x28e1ce[_0x3742be(0x210)]!==_0x30091f||(!_0x263d1b||Zn(_0x28e1ce)>Zn(_0x263d1b))&&(_0x263d1b=_0x28e1ce);return _0x263d1b;}var oo=(0x0,ir[_0x15b5cc(0x2bf)])(or[_0x15b5cc(0x2cb)]),bt=S['child']({'module':_0x15b5cc(0x1e8)}),ar=0xbb8,io=0x3e8,ao=0xfa0,sr=0x3,lo=0x1f4,co=0x3a98,he=null,me=null;function lr(){he=null;}function uo(_0x30fe4e,_0x8c754d=Date[_0x15b5cc(0x31c)]()){return _0x8c754d-_0x30fe4e<ao;}function fo(_0x3e1d1d){const _0x1294ff=_0x15b5cc;try{return process[_0x1294ff(0x293)](_0x3e1d1d,0x0),!0x0;}catch{return!0x1;}}async function De(_0x453e54,_0x3cc221,_0x322b6f=io){const _0x176b64=_0x15b5cc;try{let {stdout:_0x268b62}=await oo(_0x453e54,_0x3cc221,{'killSignal':process['platform']===_0x176b64(0x2e2)?_0x176b64(0x1fa):_0x176b64(0x2cd),'maxBuffer':0x800000,'timeout':_0x322b6f,'windowsHide':!0x0});return _0x268b62;}catch(_0x4f6606){let _0x470910=typeof _0x4f6606==_0x176b64(0x2d5)&&_0x4f6606!==null?{'code':_0x176b64(0x20f)in _0x4f6606?_0x4f6606[_0x176b64(0x20f)]:void 0x0,'signal':_0x176b64(0x23b)in _0x4f6606?_0x4f6606[_0x176b64(0x23b)]:void 0x0,'killed':'killed'in _0x4f6606?_0x4f6606['killed']:void 0x0}:{},_0x3efa17=String(_0x4f6606);return _0x3efa17['includes']('ESRCH')||_0x3efa17['includes'](_0x176b64(0x32a))?bt[_0x176b64(0x237)]({'file':_0x453e54,'args':_0x3cc221,'timeoutMs':_0x322b6f,'error':_0x3efa17,..._0x470910},'process\x20scan\x20command\x20skipped\x20—\x20process\x20exited'):bt['warn']({'file':_0x453e54,'args':_0x3cc221,'timeoutMs':_0x322b6f,'error':_0x3efa17,..._0x470910},'process\x20scan\x20command\x20failed'),'';}}async function po(_0x1bf462){const _0x1151a7=_0x15b5cc;let _0x9a7d4b=_0x1bf462;if(_0x1bf462['sessionFilePath']){let _0x109de8=await Hn(_0x1bf462[_0x1151a7(0x1e5)],_0x1bf462['agent']);if(!_0x109de8)return null;let _0x5d2087=await zn(_0x1bf462['sessionFilePath'],_0x1bf462[_0x1151a7(0x27d)]),_0x47b2c5=_0x109de8['approvalMode']??_0x1bf462[_0x1151a7(0x2fb)];_0x9a7d4b={..._0x1bf462,'cwd':_0x1bf462['cwd']||_0x109de8[_0x1151a7(0x2fc)],..._0x47b2c5?{'approvalMode':_0x47b2c5}:{},'title':_0x1bf462['title']??_0x109de8['title'],'isResponding':_0x5d2087[_0x1151a7(0x310)]};}if(_0x9a7d4b['agent']!=='claude')return _0x9a7d4b;let _0x2f47c1=await rr(_0x9a7d4b[_0x1151a7(0x210)]);if(!_0x2f47c1)return _0x9a7d4b;let _0x4948bc=nr(_0x2f47c1['status']);return{..._0x9a7d4b,'cwd':_0x9a7d4b[_0x1151a7(0x2fc)]||_0x2f47c1[_0x1151a7(0x2fc)]||'','isResponding':_0x4948bc??_0x9a7d4b[_0x1151a7(0x310)]};}async function mo(_0x576d2a){const _0x3ffc2f=_0x15b5cc;return process['platform']===_0x3ffc2f(0x2e2)?'':(await De(_0x3ffc2f(0x283),['-a','-p',String(_0x576d2a),'-d','cwd','-Fn']))[_0x3ffc2f(0x2c2)]('\x0a')[_0x3ffc2f(0x25e)](_0x5abb4b=>_0x5abb4b['startsWith']('n'))?.['slice'](0x1)[_0x3ffc2f(0x2b6)]()??'';}async function go(_0x5c9840){const _0x131c5d=_0x15b5cc;if(process[_0x131c5d(0x2ca)]==='win32')return[];let _0x13a3a9=(await De('lsof',['-p',String(_0x5c9840),'-Fn']))['split']('\x0a')[_0x131c5d(0x276)](_0x2d5612=>_0x2d5612['startsWith']('n'))['map'](_0x3bdd4d=>_0x3bdd4d[_0x131c5d(0x234)](0x1)[_0x131c5d(0x2b6)]())['filter'](_0xa6d07=>_0xa6d07[_0x131c5d(0x214)]('.jsonl')?_0xa6d07[_0x131c5d(0x2a0)](_0x131c5d(0x2f5))||_0xa6d07[_0x131c5d(0x2a0)]('/.codex/sessions/'):!0x1);return[...new Set(_0x13a3a9)];}function ho(_0x45b56e){const _0x778be5=_0x15b5cc;return _0x45b56e['split']('\x0a')[_0x778be5(0x1d6)](_0x463d68=>_0x463d68[_0x778be5(0x2b6)]())[_0x778be5(0x276)](Boolean)['map'](_0x9c1267=>{const _0x4ed248=_0x778be5;let _0x5765d0=_0x9c1267[_0x4ed248(0x2dc)](/^(\d+)\s+(.*)$/);if(!_0x5765d0)return null;let _0x3ba41f=Number(_0x5765d0[0x1]),_0x3f76d8=_0x5765d0[0x2];if(!Le(_0x3f76d8))return null;let _0x17b9ea=pe(_0x3f76d8);return!Number['isFinite'](_0x3ba41f)||!_0x17b9ea?null:{'pid':_0x3ba41f,'command':_0x3f76d8,'agent':_0x17b9ea['agent']};})['filter'](_0x15fb63=>!!_0x15fb63);}async function So(){const _0x180ede=_0x15b5cc;let _0x2e9bbe=await De('ps',['-axo',_0x180ede(0x258)],ar);return ho(_0x2e9bbe);}async function yo(){const _0x3ced44=_0x15b5cc;return(await De('wmic',[_0x3ced44(0x1fe),'get','ProcessId,CommandLine',_0x3ced44(0x26f)],ar))['split']('\x0a')[_0x3ced44(0x1d6)](_0x3f4ad1=>_0x3f4ad1['trim']())['filter'](Boolean)[_0x3ced44(0x1d6)](_0x149a60=>{const _0x37bf02=_0x3ced44;let _0x2241e1=_0x149a60['split'](',');if(_0x2241e1[_0x37bf02(0x21b)]<0x3)return null;let _0x504a08=Number(_0x2241e1[_0x2241e1['length']-0x1]),_0x1fdb40=_0x2241e1['slice'](0x1,_0x2241e1['length']-0x1)['join'](',');if(!Number[_0x37bf02(0x2a3)](_0x504a08)||_0x504a08===0x0||!Le(_0x1fdb40))return null;let _0x2e0e06=pe(_0x1fdb40);return _0x2e0e06?{'pid':_0x504a08,'command':_0x1fdb40,'agent':_0x2e0e06[_0x37bf02(0x27d)]}:null;})[_0x3ced44(0x276)](_0x56ecb8=>!!_0x56ecb8);}async function xo(){const _0x423023=_0x15b5cc;return process['platform']===_0x423023(0x2e2)?yo():So();}async function To(_0x20b5e1){const _0x1056c6=_0x15b5cc;let _0x5ae503=Date[_0x1056c6(0x31c)](),_0xf0971f=q[_0x1056c6(0x2ea)](_0x1056c6(0x29f)),_0x494bc5=await xo();_0x20b5e1&&(_0x20b5e1['pgrepMs']+=_0xf0971f()),_0x20b5e1&&(_0x20b5e1['matchedProcesses']=_0x494bc5[_0x1056c6(0x21b)]);let _0x4d4c29=_0x494bc5['filter'](_0x4a43c8=>fo(_0x4a43c8[_0x1056c6(0x1c3)]));_0x20b5e1&&(_0x20b5e1[_0x1056c6(0x288)]=_0x4d4c29[_0x1056c6(0x21b)]);let _0x3fe77c=q[_0x1056c6(0x2ea)]('process.scan.lsof_ms'),_0x7966cf=[];for(let _0x2c5582=0x0;_0x2c5582<_0x4d4c29['length'];_0x2c5582+=sr){if(!uo(_0x5ae503)){_0x20b5e1&&(_0x20b5e1['skippedProcessDetails']+=_0x4d4c29[_0x1056c6(0x21b)]-_0x2c5582);break;}let _0x5c0de5=_0x4d4c29['slice'](_0x2c5582,_0x2c5582+sr),_0x15b23d=await Promise[_0x1056c6(0x32d)](_0x5c0de5[_0x1056c6(0x1d6)](async _0x1b02e1=>{const _0x4cccb0=_0x1056c6;let [_0x2217f9,_0x207285]=await Promise['all']([mo(_0x1b02e1[_0x4cccb0(0x1c3)]),go(_0x1b02e1['pid'])]);return{'pid':_0x1b02e1['pid'],'agent':_0x1b02e1['agent'],'command':_0x1b02e1[_0x4cccb0(0x1c5)],'cwd':_0x2217f9,'sessionFiles':_0x207285};}));_0x7966cf[_0x1056c6(0x22f)](..._0x15b23d);}return _0x20b5e1&&(_0x20b5e1['lsofMs']+=_0x3fe77c()),_0x20b5e1&&(_0x20b5e1['snapshots']=_0x7966cf[_0x1056c6(0x21b)]),_0x7966cf;}function cr(_0x3bfc3c){const _0x5e8b4a=_0x15b5cc;return _0x3bfc3c[_0x5e8b4a(0x1b8)](/[^a-zA-Z0-9]/g,'-');}async function Co(_0xc7cb39,_0x3c3c4b){const _0x15f350=_0x15b5cc;if(!_0x3c3c4b)return null;try{if(_0xc7cb39==='claude'){let _0x57d32d=(0x0,ge['join'])((0x0,vt['homedir'])(),'.claude','projects',cr(_0x3c3c4b)),_0x4b1204=(await(0x0,Se[_0x15f350(0x280)])(_0x57d32d)[_0x15f350(0x2ac)](()=>[]))['filter'](_0x20ad23=>_0x20ad23[_0x15f350(0x214)](_0x15f350(0x23f)));if(_0x4b1204[_0x15f350(0x21b)]===0x0)return null;let _0x2a51f3=null;if(await Promise[_0x15f350(0x32d)](_0x4b1204['map'](async _0x4cd930=>{const _0x4dd261=_0x15f350;let _0x32c8ac=await(0x0,Se[_0x4dd261(0x2e3)])((0x0,ge['join'])(_0x57d32d,_0x4cd930))['catch'](()=>null);_0x32c8ac&&(!_0x2a51f3||_0x32c8ac['mtimeMs']>_0x2a51f3[_0x4dd261(0x1f6)])&&(_0x2a51f3={'name':_0x4cd930,'mtimeMs':_0x32c8ac['mtimeMs']});})),!_0x2a51f3)return null;let _0x3caad0=(0x0,ge['join'])(_0x57d32d,_0x2a51f3['name']),_0x25bbcd=M(_0xc7cb39,_0x3caad0);return _0x25bbcd?{'sessionId':_0x25bbcd,'filePath':_0x3caad0}:null;}return jn(_0x3c3c4b);}catch{return null;}}async function Ao(_0x52f7f8,_0x22c4fb,_0x3a46d7){const _0x47f793=_0x15b5cc;if(!_0x22c4fb||!_0x3a46d7)return null;try{if(_0x52f7f8==='claude'){let _0x1d3a1c=(0x0,ge[_0x47f793(0x262)])((0x0,vt[_0x47f793(0x30e)])(),'.claude',_0x47f793(0x1e1),cr(_0x22c4fb),_0x3a46d7+'.jsonl');return(await(0x0,Se[_0x47f793(0x2e3)])(_0x1d3a1c)['catch'](()=>null))?.[_0x47f793(0x1ea)]()?_0x1d3a1c:null;}return null;}catch{return null;}}async function wo(_0x153331){const _0x4c73a7=_0x15b5cc;if(_0x153331['sessionFilePath']||_0x153331[_0x4c73a7(0x303)]!=='high')return _0x153331;let _0x38af33=await Ao(_0x153331[_0x4c73a7(0x27d)],_0x153331[_0x4c73a7(0x2fc)],_0x153331['sessionId']);return _0x38af33?{..._0x153331,'sessionFilePath':_0x38af33}:_0x153331;}async function bo(){const _0x4598f8=_0x15b5cc;let _0x378b5={'pgrepMs':0x0,'lsofMs':0x0,'fallbackMs':0x0,'hydrateMs':0x0,'totalMs':0x0,'matchedProcesses':0x0,'aliveProcesses':0x0,'snapshots':0x0,'skippedProcessDetails':0x0,'directCandidates':0x0,'fallbackLookups':0x0,'fallbackHits':0x0,'hydratedCandidates':0x0},_0x596772=q['startTimer']('process.scan.total_ms'),_0x18d2b2=await To(_0x378b5),_0x1ab992=[],_0x13e3ec=[];for(let _0x5d145a of _0x18d2b2){let _0x12c67a=Ct(_0x5d145a);if(_0x12c67a){_0x1ab992['push'](_0x12c67a);continue;}Tt(_0x5d145a['agent'],_0x5d145a['command'])&&_0x13e3ec['push'](_0x5d145a);}_0x378b5[_0x4598f8(0x26b)]=_0x1ab992[_0x4598f8(0x21b)],_0x378b5['fallbackLookups']=_0x13e3ec['length'];let _0x5a5ab1=q['startTimer']('process.scan.fallback_ms'),_0x3c0177=await Promise['all'](_0x13e3ec[_0x4598f8(0x1d6)](async _0x4acaab=>{const _0x3cadea=_0x4598f8;let _0x29b6f7=await Co(_0x4acaab[_0x3cadea(0x27d)],_0x4acaab['cwd']);return _0x29b6f7?{'agent':_0x4acaab[_0x3cadea(0x27d)],'pid':_0x4acaab['pid'],'cwd':_0x4acaab[_0x3cadea(0x2fc)],'command':_0x4acaab[_0x3cadea(0x1c5)],'sessionId':_0x29b6f7[_0x3cadea(0x210)],'confidence':'low','sessionFilePath':_0x29b6f7['filePath']}:null;}));_0x378b5['fallbackMs']=_0x5a5ab1(),_0x378b5['fallbackHits']=_0x3c0177[_0x4598f8(0x276)](_0xcb6e2c=>_0xcb6e2c!==null)[_0x4598f8(0x21b)];let _0x3d4e7d=q['startTimer']('process.scan.hydrate_ms'),_0x50fd1c=await Promise['all']([..._0x1ab992,..._0x3c0177[_0x4598f8(0x276)](_0x242030=>_0x242030!==null)][_0x4598f8(0x1d6)](_0x1028a0=>wo(_0x1028a0))),_0x22b5ff=await Promise['all'](_0x50fd1c['map'](_0x37812b=>po(_0x37812b)));_0x378b5[_0x4598f8(0x2f3)]=_0x3d4e7d(),_0x378b5[_0x4598f8(0x233)]=_0x22b5ff['filter'](_0x87635c=>_0x87635c!==null)[_0x4598f8(0x21b)];let _0x28b446=At(_0x22b5ff[_0x4598f8(0x276)](_0xcca9d6=>_0xcca9d6!==null));return _0x378b5[_0x4598f8(0x2e5)]=_0x596772(),(_0x378b5['totalMs']>=lo||_0x378b5[_0x4598f8(0x317)]>0x0)&&bt['info']({'durationMs':_0x378b5['totalMs'],'pgrepMs':_0x378b5['pgrepMs'],'lsofMs':_0x378b5[_0x4598f8(0x2f6)],'fallbackMs':_0x378b5['fallbackMs'],'hydrateMs':_0x378b5['hydrateMs'],'matchedProcesses':_0x378b5['matchedProcesses'],'aliveProcesses':_0x378b5[_0x4598f8(0x288)],'snapshots':_0x378b5[_0x4598f8(0x206)],'skippedProcessDetails':_0x378b5['skippedProcessDetails']||void 0x0,'directCandidates':_0x378b5[_0x4598f8(0x26b)],'fallbackLookups':_0x378b5[_0x4598f8(0x317)],'fallbackHits':_0x378b5[_0x4598f8(0x2dd)],'hydratedCandidates':_0x378b5['hydratedCandidates'],'sessions':_0x28b446[_0x4598f8(0x21b)]},_0x4598f8(0x242)),he={'value':_0x28b446,'expiresAt':Date['now']()+co},_0x28b446;}async function ur(){const _0xb02ca8=_0x15b5cc;return he&&Date['now']()<he[_0xb02ca8(0x246)]?he[_0xb02ca8(0x1ee)]:me||(me=bo()[_0xb02ca8(0x2f0)](()=>{me=null;}),me);}if(!It['parentPort'])throw new Error('inventory\x20scan\x20worker\x20requires\x20a\x20parent\x20port');var Oe=It['parentPort'],vo=S['child']({'module':'inventory-worker'}),Io=new Fe(),dr=0x40;function fr(_0x2d2332){const _0x3d1e3a=_0x15b5cc;if(process.env.VIBE_TEST!=='1')return;let _0x1fcf3c=Number(process.env[_0x2d2332]??0x0);if(!Number['isFinite'](_0x1fcf3c)||_0x1fcf3c<=0x0)return;let _0x3b9c1f=Date[_0x3d1e3a(0x31c)]()+Math[_0x3d1e3a(0x313)](_0x1fcf3c,0x2710);for(;Date['now']()<_0x3b9c1f;);}function _0x3ecc(_0x29199d,_0x82283b){_0x29199d=_0x29199d-0x1b7;const _0x58736b=_0x5873();let _0x3ecc65=_0x58736b[_0x29199d];if(_0x3ecc['DFcULO']===undefined){var _0x5d6a85=function(_0x2e9d8b){const _0x13bacc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4f20be='',_0x604e96='';for(let _0x6850af=0x0,_0x4c396f,_0x200218,_0x300de1=0x0;_0x200218=_0x2e9d8b['charAt'](_0x300de1++);~_0x200218&&(_0x4c396f=_0x6850af%0x4?_0x4c396f*0x40+_0x200218:_0x200218,_0x6850af++%0x4)?_0x4f20be+=String['fromCharCode'](0xff&_0x4c396f>>(-0x2*_0x6850af&0x6)):0x0){_0x200218=_0x13bacc['indexOf'](_0x200218);}for(let _0x375dc9=0x0,_0x5b1843=_0x4f20be['length'];_0x375dc9<_0x5b1843;_0x375dc9++){_0x604e96+='%'+('00'+_0x4f20be['charCodeAt'](_0x375dc9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x604e96);};_0x3ecc['QotGfL']=_0x5d6a85,_0x3ecc['RjcWZk']={},_0x3ecc['DFcULO']=!![];}const _0x11a30f=_0x58736b[0x0],_0xe62c32=_0x29199d+_0x11a30f,_0x19d12e=_0x3ecc['RjcWZk'][_0xe62c32];return!_0x19d12e?(_0x3ecc65=_0x3ecc['QotGfL'](_0x3ecc65),_0x3ecc['RjcWZk'][_0xe62c32]=_0x3ecc65):_0x3ecc65=_0x19d12e,_0x3ecc65;}async function Eo(_0x3b7937){const _0x4b4937=_0x15b5cc;try{if(_0x3b7937['kind']==='process')return fr('VIBE_TEST_PROCESS_WORKER_DELAY_MS'),process.env.VIBE_TEST==='1'&&process.env.VIBE_TEST_PROCESS_WORKER_EMPTY_RESULT==='1'?{'id':_0x3b7937['id'],'ok':!0x0,'result':[]}:(_0x3b7937[_0x4b4937(0x261)]&&lr(),{'id':_0x3b7937['id'],'ok':!0x0,'result':await ur()});fr(_0x4b4937(0x1bd));let _0x6574de=Date[_0x4b4937(0x31c)](),_0x55ab40=await Io[_0x4b4937(0x2f4)](_0x326d87=>{const _0x2cccfd=_0x4b4937;Oe[_0x2cccfd(0x1f1)]({'id':_0x3b7937['id'],'ok':!0x0,'progress':_0x2cccfd(0x1d9),..._0x326d87});});vo['info']({'durationMs':Date['now']()-_0x6574de,'sessions':_0x55ab40[_0x4b4937(0x291)][_0x4b4937(0x21b)],'files':_0x55ab40['totalFiles'],'changedFiles':_0x55ab40['changedFiles'],'reusedFiles':_0x55ab40[_0x4b4937(0x264)],'removedFiles':_0x55ab40['removedFiles']},_0x4b4937(0x2ab));for(let _0x2c6290=0x0;_0x2c6290<_0x55ab40['sessions']['length'];_0x2c6290+=dr)Oe[_0x4b4937(0x1f1)]({'id':_0x3b7937['id'],'ok':!0x0,'progress':'session_result_batch','sessions':_0x55ab40[_0x4b4937(0x291)][_0x4b4937(0x234)](_0x2c6290,_0x2c6290+dr)});return{'id':_0x3b7937['id'],'ok':!0x0,'result':{'scannedSessions':[],'runningSessions':[]}};}catch(_0x5a7824){return{'id':_0x3b7937['id'],'ok':!0x1,'error':_0x5a7824 instanceof Error?_0x5a7824['name']+':\x20'+_0x5a7824['message']:String(_0x5a7824)};}}var pr=Promise[_0x15b5cc(0x1c2)]();Oe['on'](_0x15b5cc(0x1d0),_0x47783e=>{pr=pr['then'](async()=>{Oe['postMessage'](await Eo(_0x47783e));});});