@vibelet/cli 1.2.164 → 1.2.166
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 _0x25f477=_0xfedb;(function(_0x53db82,_0x51ca3f){const _0x36bc43=_0xfedb,_0x265209=_0x53db82();while(!![]){try{const _0x20ddb4=parseInt(_0x36bc43(0x20e))/0x1*(-parseInt(_0x36bc43(0x280))/0x2)+-parseInt(_0x36bc43(0x2c2))/0x3*(parseInt(_0x36bc43(0x197))/0x4)+-parseInt(_0x36bc43(0x1a5))/0x5+-parseInt(_0x36bc43(0x296))/0x6+-parseInt(_0x36bc43(0x1da))/0x7*(parseInt(_0x36bc43(0x2ba))/0x8)+-parseInt(_0x36bc43(0x251))/0x9*(-parseInt(_0x36bc43(0x2f2))/0xa)+-parseInt(_0x36bc43(0x1e1))/0xb*(-parseInt(_0x36bc43(0x1d4))/0xc);if(_0x20ddb4===_0x51ca3f)break;else _0x265209['push'](_0x265209['shift']());}catch(_0x572784){_0x265209['push'](_0x265209['shift']());}}}(_0x5864,0xbcfb4));var Tt=require(_0x25f477(0x2a3)),Dn=require('node:fs/promises'),Un=require(_0x25f477(0x2f8)),On=require('node:path'),R=require(_0x25f477(0x294)),Z=require('node:os'),v=require(_0x25f477(0x270)),Ct=require(_0x25f477(0x2f8)),U=require('node:path'),ir=new Set(['.c',_0x25f477(0x21b),'.cpp',_0x25f477(0x1c4),'.css','.dart',_0x25f477(0x2aa),_0x25f477(0x230),_0x25f477(0x2d9),_0x25f477(0x23d),'.go','.h',_0x25f477(0x226),'.hrl',_0x25f477(0x2a0),_0x25f477(0x268),'.jsx','.kt','.kts',_0x25f477(0x214),'.lua','.m',_0x25f477(0x2f3),'.mjs','.php',_0x25f477(0x2e5),'.ps1',_0x25f477(0x1aa),'.r',_0x25f477(0x25b),'.rs',_0x25f477(0x249),_0x25f477(0x239),'.scss',_0x25f477(0x1e8),_0x25f477(0x2f6),'.swift',_0x25f477(0x305),_0x25f477(0x279),'.vue','.xml',_0x25f477(0x300),'.yml','.zsh']),At=_0x25f477(0x1c7),wt=_0x25f477(0x301);function Q(_0x585bd1){const _0x46f56a=_0x25f477;return typeof _0x585bd1==_0x46f56a(0x1c3)&&_0x585bd1['trim']()[_0x46f56a(0x233)]>0x0?_0x585bd1[_0x46f56a(0x308)]():null;}function te(_0x3253ba){return!_0x3253ba||typeof _0x3253ba!='object'||Array['isArray'](_0x3253ba)?null:_0x3253ba;}function Ue(_0x2e3e6d){const _0x486450=_0x25f477;let _0x4fc081=_0x2e3e6d[_0x486450(0x308)]()['replace'](/[.,!?;:,。!?;:、]+$/u,''),_0x47a019=_0x4fc081[_0x486450(0x2f1)]('#');_0x47a019>0x0&&(_0x4fc081=_0x4fc081['slice'](0x0,_0x47a019));let _0x5b0018=_0x4fc081['match'](/^(.*?)(:\d+(?::\d+)?)$/);return _0x5b0018?.[0x1]&&(_0x4fc081=_0x5b0018[0x1]),_0x4fc081;}function Se(_0x31e925,_0x29421a){const _0x1078a1=_0x25f477;let _0x23458e=Ue(_0x31e925);return _0x23458e?_0x23458e[_0x1078a1(0x302)]('~/')?(0x0,U[_0x1078a1(0x285)])((0x0,Ct[_0x1078a1(0x2b4)])(),_0x23458e['slice'](0x2)):(0x0,U[_0x1078a1(0x237)])(_0x23458e)?_0x23458e:_0x29421a?(0x0,U['resolve'])(_0x29421a,_0x23458e):_0x23458e:'';}function or(_0x4ba9e7){const _0x22a3d3=_0x25f477;return ir[_0x22a3d3(0x1ec)]((0x0,U[_0x22a3d3(0x1f7)])(Ue(_0x4ba9e7))[_0x22a3d3(0x2d2)]());}function Oe(_0x23ab69){let _0x6bf8a7=Ue(_0x23ab69);return _0x6bf8a7?!or(_0x6bf8a7):!0x1;}function $e(_0x38b961){const _0x471c05=_0x25f477;let _0x1391b5=[...new Set(_0x38b961[_0x471c05(0x2fb)](_0x3578d3=>Se(_0x3578d3))[_0x471c05(0x1a0)](Boolean))];return _0x1391b5['length']===0x0?'':_0x1391b5[_0x471c05(0x233)]===0x1?''+At+_0x1391b5[0x0]:''+wt+_0x1391b5['join']('\x0a');}function bt(_0x41f5c9){const _0x11e055=_0x25f477;return typeof _0x41f5c9!='string'?!0x1:_0x41f5c9[_0x11e055(0x302)](At)||_0x41f5c9[_0x11e055(0x302)](wt);}function ar(_0xb91ddf,_0x33d75a){const _0x222d1e=_0x25f477;let _0x22bd59=_0xb91ddf[_0x222d1e(0x1cb)](/^\*\*\* Add File: (.+)$/gm),_0x459056=new Set();for(let _0x2b2a00 of _0x22bd59){let _0x2d286a=Q(_0x2b2a00[0x1]);if(!_0x2d286a)continue;let _0x54d77e=Se(_0x2d286a,_0x33d75a);!_0x54d77e||!Oe(_0x54d77e)||_0x459056['add'](_0x54d77e);}return[..._0x459056];}function lr(_0x5cd4ee){let _0x2de62b=Q(_0x5cd4ee);return _0x2de62b?_0x2de62b['toLowerCase']():'';}function cr(_0x53991b,_0xbfb299){let _0x4563c3=Q(_0x53991b?.['file_path'])??Q(_0x53991b?.['path']);if(!_0x4563c3)return null;let _0x225a62=Se(_0x4563c3,_0xbfb299);return _0x225a62&&Oe(_0x225a62)?_0x225a62:null;}function vt(_0x5c843c,_0x830655,_0x2513e6){const _0x49c136=_0x25f477;return lr(_0x5c843c)!==_0x49c136(0x1b6)?null:cr(_0x830655,_0x2513e6);}function dr(_0x12166c){const _0xeb9728=_0x25f477;let _0x14f403=_0x12166c['toLowerCase']();return _0x14f403[_0xeb9728(0x20d)](_0xeb9728(0x2b1))||_0x14f403[_0xeb9728(0x20d)]('updated.\x20all\x20occurrences\x20were\x20successfully\x20replaced')||_0x14f403['includes']('all\x20occurrences\x20were\x20successfully\x20replaced')||_0x14f403['includes']('successfully\x20replaced');}function ur(_0x37c260){const _0x44e966=_0x25f477;return/^\d+\t/m[_0x44e966(0x1b7)](_0x37c260);}function It(_0x226231,_0x4c20aa){const _0x5c0df3=_0x25f477;let _0x118791=typeof _0x4c20aa=='string'?_0x4c20aa['trim']():'';if(_0x118791&&dr(_0x118791))return!0x1;let _0x422c0c=te(_0x226231);if(_0x422c0c?.[_0x5c0df3(0x209)]==='update'||_0x422c0c?.['type']==='replace'||_0x422c0c&&(Object['hasOwn'](_0x422c0c,_0x5c0df3(0x2c5))||Object['hasOwn'](_0x422c0c,'structuredPatch')||Object['hasOwn'](_0x422c0c,'originalFile')||Object['hasOwn'](_0x422c0c,'replaceAll')))return!0x1;if(typeof te(_0x422c0c?.[_0x5c0df3(0x28b)])?.['filePath']==_0x5c0df3(0x1c3)||typeof _0x422c0c?.[_0x5c0df3(0x299)]==_0x5c0df3(0x1c3))return!0x0;if(_0x118791){let _0x172739=_0x118791['toLowerCase']();if(_0x172739['includes']('created\x20successfully')||_0x172739[_0x5c0df3(0x20d)]('has\x20been\x20created')||ur(_0x118791))return!0x0;}return!0x1;}function Mt(_0x5b5314,_0x3b7a2f){const _0x5cc9e7=_0x25f477;let _0x5a7f42=te(_0x5b5314);if(!_0x5a7f42)return[];let _0x4f5167=new Set();if(_0x5a7f42[_0x5cc9e7(0x209)]==='event_msg'){let _0x3f1e73=te(_0x5a7f42[_0x5cc9e7(0x2d0)]);if(_0x3f1e73?.['type']===_0x5cc9e7(0x1eb)){let _0x23a8e2=Q(_0x3f1e73['saved_path']);if(_0x23a8e2){let _0x3e16e2=Se(_0x23a8e2,_0x3b7a2f?.[_0x5cc9e7(0x1d0)]);_0x3e16e2&&Oe(_0x3e16e2)&&_0x4f5167[_0x5cc9e7(0x2c4)](_0x3e16e2);}}}if(_0x3b7a2f?.[_0x5cc9e7(0x258)]&&_0x5a7f42[_0x5cc9e7(0x209)]==='response_item'){let _0x423f33=te(_0x5a7f42[_0x5cc9e7(0x2d0)]);if(_0x423f33?.[_0x5cc9e7(0x209)]==='function_call'&&_0x423f33[_0x5cc9e7(0x1fa)]===_0x5cc9e7(0x2ea)){let _0x19e375=Q(_0x423f33[_0x5cc9e7(0x263)]);if(_0x19e375){for(let _0x518c71 of ar(_0x19e375,_0x3b7a2f?.[_0x5cc9e7(0x1d0)]))_0x4f5167[_0x5cc9e7(0x2c4)](_0x518c71);}}}return[..._0x4f5167];}var Ce=require(_0x25f477(0x247)),Et=require('node:os'),h=require(_0x25f477(0x270)),O=(0x0,h['join'])((0x0,Et[_0x25f477(0x2b4)])(),'.vibelet'),xe=(0x0,h[_0x25f477(0x29b)])(O,'logs'),ne=(0x0,h[_0x25f477(0x29b)])(O,_0x25f477(0x1f6)),Rt=(0x0,h['join'])(O,'runtime'),wi=(0x0,h['join'])(Rt,_0x25f477(0x1af)),bi=(0x0,h[_0x25f477(0x29b)])(Rt,_0x25f477(0x253)),vi=(0x0,h[_0x25f477(0x29b)])(O,_0x25f477(0x2d3)),Ii=(0x0,h['join'])(O,_0x25f477(0x1de)),Mi=(0x0,h['join'])(ne,_0x25f477(0x2dc)),Ei=(0x0,h['join'])(ne,'push-subscriptions.json'),Ri=(0x0,h['join'])(ne,'sessions.json'),_i=(0x0,h[_0x25f477(0x29b)])(ne,'audit.jsonl'),Fi=(0x0,h[_0x25f477(0x29b)])(ne,'uploads'),_t=(0x0,h[_0x25f477(0x29b)])(xe,'daemon.stdout.log'),Ft=(0x0,h['join'])(xe,'daemon.stderr.log'),Pi=(0x0,h['join'])(O,'update-check.json'),ki=(0x0,h['join'])(O,_0x25f477(0x2fa)),Te={'stdout':!0x1,'stderr':!0x1};function Pt(_0x2f0ff4){const _0x3093bd=_0x25f477;if(!_0x2f0ff4||typeof _0x2f0ff4!=_0x3093bd(0x21a))return!0x1;let _0x573e32=typeof _0x2f0ff4[_0x3093bd(0x2c3)]=='string'?_0x2f0ff4['code']:'';return _0x573e32===_0x3093bd(0x1f8)||_0x573e32==='EPIPE';}function fr(_0x120748){return!_0x120748['destroyed']&&_0x120748['writable']!==!0x1;}function kt(_0x3fa727,_0x7c0c85){const _0x277f18=_0x25f477;if(Te[_0x3fa727])return!0x1;let _0x1c8bcb=_0x3fa727==='stderr'?process[_0x277f18(0x1fd)]:process['stdout'];if(!fr(_0x1c8bcb))return Te[_0x3fa727]=!0x0,!0x1;try{return _0x1c8bcb[_0x277f18(0x1b6)](_0x7c0c85,_0xebc573=>{Pt(_0xebc573)&&(Te[_0x3fa727]=!0x0);}),!0x0;}catch(_0x18e762){return Pt(_0x18e762)&&(Te[_0x3fa727]=!0x0),!0x1;}}function Lt(_0x4892ab){return kt('stdout',_0x4892ab);}function Nt(_0x3d1c31){const _0x495e0a=_0x25f477;return kt(_0x495e0a(0x1fd),_0x3d1c31);}var Dt={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},pr=process.env.VIBE_LOG_LEVEL||'info';function mr(){const _0x17a395=_0x25f477;return process.env.VIBE_TEST==='1'||process['argv'][_0x17a395(0x20d)]('--test');}function gr(){const _0x4b4df4=_0x25f477;try{let {fstatSync:_0x30b76c}=require(_0x4b4df4(0x247));return _0x30b76c(0x1)[_0x4b4df4(0x1e5)]();}catch{return!0x1;}}var Ot=!mr()&&!gr();if(Ot)try{(0x0,Ce['mkdirSync'])(xe,{'recursive':!0x0});}catch{}function Ut(_0x20111b,_0x428e99,_0x298f68){const _0x34954e=_0x25f477;if(Dt[_0x20111b]<Dt[pr])return;let _0x37619d={'level':_0x20111b,'ts':new Date()[_0x34954e(0x1ca)](),'msg':_0x298f68,..._0x428e99},_0x1403fd=JSON[_0x34954e(0x2cd)](_0x37619d);if(_0x20111b==='error'||_0x20111b==='warn'?Nt(_0x1403fd+'\x0a'):Lt(_0x1403fd+'\x0a'),Ot){let _0x37dbfe=_0x20111b===_0x34954e(0x29c)||_0x20111b==='warn'?Ft:_t;try{(0x0,Ce['appendFileSync'])(_0x37dbfe,_0x1403fd+'\x0a');}catch{}}}function $t(_0x4b1d31={}){function _0xfa75d2(_0x2a7bc5,_0x489231,_0x48ddd3){const _0x2b6efc=_0xfedb;typeof _0x489231==_0x2b6efc(0x1c3)?Ut(_0x2a7bc5,_0x4b1d31,_0x489231):Ut(_0x2a7bc5,{..._0x4b1d31,..._0x489231},_0x48ddd3);}return{'debug':(_0x21c70a,_0x2e053d)=>_0xfa75d2('debug',_0x21c70a,_0x2e053d),'info':(_0x90405e,_0x382e13)=>_0xfa75d2('info',_0x90405e,_0x382e13),'warn':(_0x20300a,_0x5b05cd)=>_0xfa75d2('warn',_0x20300a,_0x5b05cd),'error':(_0x213381,_0x14dffb)=>_0xfa75d2('error',_0x213381,_0x14dffb),'child':_0x1ae19f=>$t({..._0x4b1d31,..._0x1ae19f})};}var x=$t({'module':'daemon'});function re(_0x31ed39){let _0x1bca0a=new Map();return{'get'(_0x3ac9d5){const _0x2c6bbf=_0xfedb;let _0x2db6a6=_0x1bca0a['get'](_0x3ac9d5);if(_0x2db6a6){if(Date[_0x2c6bbf(0x2af)]()>_0x2db6a6['expiresAt']){_0x1bca0a['delete'](_0x3ac9d5);return;}return _0x2db6a6[_0x2c6bbf(0x25e)];}},'set'(_0x5ec05f,_0x2aec66){const _0x46ea03=_0xfedb;_0x1bca0a[_0x46ea03(0x228)](_0x5ec05f,{'value':_0x2aec66,'expiresAt':Date[_0x46ea03(0x2af)]()+_0x31ed39});},'clear'(){const _0x39a276=_0xfedb;_0x1bca0a[_0x39a276(0x2a8)]();}};}var sn=require(_0x25f477(0x294)),w=require('node:fs/promises'),se=require(_0x25f477(0x2f8)),T=require(_0x25f477(0x270)),b=0x18;async function _(_0x3d0553,_0x275dbe,_0x4d29df){const _0x5e61c5=_0x25f477;if(_0x3d0553['length']===0x0)return[];let _0x3cecc0=Math[_0x5e61c5(0x269)](0x1,Math['min'](_0x275dbe,_0x3d0553[_0x5e61c5(0x233)])),_0x3bfd4c=new Array(_0x3d0553['length']),_0x5ba229=0x0;return await Promise['all'](Array['from']({'length':_0x3cecc0},async()=>{for(;;){let _0x16d5f4=_0x5ba229;if(_0x5ba229+=0x1,_0x16d5f4>=_0x3d0553['length'])return;_0x3bfd4c[_0x16d5f4]=await _0x4d29df(_0x3d0553[_0x16d5f4],_0x16d5f4);}})),_0x3bfd4c;}async function J(_0x957635){const _0x358cc4=_0x25f477;let _0x3513a5=(await _(_0x957635,b,async _0x1009ad=>{const _0x4bd695=_0xfedb;let _0x2b6267=await(0x0,w['stat'])(_0x1009ad)[_0x4bd695(0x23f)](()=>null);return _0x2b6267?.['isFile']()?{'path':_0x1009ad,'mtimeMs':_0x2b6267[_0x4bd695(0x2b5)],'birthtimeMs':_0x2b6267['birthtimeMs'],'size':_0x2b6267[_0x4bd695(0x2ca)]}:null;}))[_0x358cc4(0x1a0)](_0x5e781e=>_0x5e781e!==null);return _0x3513a5['sort']((_0x50540f,_0x419cdc)=>_0x419cdc['mtimeMs']-_0x50540f['mtimeMs']),_0x3513a5;}async function He(){const _0x408c54=_0x25f477;let _0x465313=(0x0,T['join'])((0x0,se['homedir'])(),'.claude','projects'),_0x1700ec=[],_0x19fd46=await(0x0,w['readdir'])(_0x465313,{'withFileTypes':!0x0})['catch'](()=>[]);for(let _0x2487cc of _0x19fd46){if(!_0x2487cc[_0x408c54(0x1ff)]())continue;let _0x1de600=(0x0,T[_0x408c54(0x29b)])(_0x465313,_0x2487cc[_0x408c54(0x1fa)]),_0x4a11ee=await(0x0,w[_0x408c54(0x2f7)])(_0x1de600)[_0x408c54(0x23f)](()=>[]);for(let _0x2cf3e9 of _0x4a11ee)_0x2cf3e9[_0x408c54(0x1cd)]('.jsonl')&&_0x1700ec['push']((0x0,T['join'])(_0x1de600,_0x2cf3e9));}return _0x1700ec;}async function ie(_0x3860f4=(0x0,T['join'])((0x0,se['homedir'])(),_0x25f477(0x1a9),'Application\x20Support',_0x25f477(0x288),'claude-code-sessions'),_0x3356ea=0x0){const _0x1f5996=_0x25f477;if(_0x3356ea>0x4)return[];let _0x2c0069=await(0x0,w['readdir'])(_0x3860f4,{'withFileTypes':!0x0})[_0x1f5996(0x23f)](()=>[]),_0x438f8c=[];for(let _0x1d3fa8 of _0x2c0069){let _0x3486b2=(0x0,T['join'])(_0x3860f4,_0x1d3fa8['name']);_0x1d3fa8['isDirectory']()?_0x438f8c['push'](...await ie(_0x3486b2,_0x3356ea+0x1)):_0x1d3fa8['isFile']()&&_0x1d3fa8['name']['endsWith'](_0x1f5996(0x2c1))&&_0x438f8c['push'](_0x3486b2);}return _0x438f8c;}async function hr(){const _0x3e3c6b=_0x25f477;let _0x46c534=(0x0,T['join'])((0x0,se['homedir'])(),'.codex','sessions'),_0x23c597=(0x0,T['join'])((0x0,se[_0x3e3c6b(0x2b4)])(),'.codex',_0x3e3c6b(0x250)),_0x2a126d=[],_0x536c43=await(0x0,w['readdir'])(_0x46c534)['catch'](()=>[]);for(let _0x34b452 of _0x536c43){let _0x1d466e=(0x0,T[_0x3e3c6b(0x29b)])(_0x46c534,_0x34b452),_0x414768=await(0x0,w['readdir'])(_0x1d466e)['catch'](()=>[]);for(let _0x41025b of _0x414768){let _0x4733df=(0x0,T['join'])(_0x1d466e,_0x41025b),_0xa3883a=await(0x0,w['readdir'])(_0x4733df)[_0x3e3c6b(0x23f)](()=>[]);for(let _0x3ff1e9 of _0xa3883a){let _0x213193=(0x0,T[_0x3e3c6b(0x29b)])(_0x4733df,_0x3ff1e9),_0x4d2d0f=await(0x0,w[_0x3e3c6b(0x2f7)])(_0x213193)['catch'](()=>[]);for(let _0x4618b4 of _0x4d2d0f)_0x4618b4[_0x3e3c6b(0x1cd)]('.jsonl')&&_0x2a126d['push']((0x0,T[_0x3e3c6b(0x29b)])(_0x213193,_0x4618b4));}}}let _0x3d2921=await(0x0,w['readdir'])(_0x23c597)[_0x3e3c6b(0x23f)](()=>[]);for(let _0x4a9806 of _0x3d2921)_0x4a9806[_0x3e3c6b(0x1cd)]('.jsonl')&&_0x2a126d[_0x3e3c6b(0x27b)]((0x0,T[_0x3e3c6b(0x29b)])(_0x23c597,_0x4a9806));return _0x2a126d;}async function oe(){let _0x467514=await hr();return J(_0x467514);}var H=require('node:child_process'),M=require('node:fs'),B=require(_0x25f477(0x2f8)),u=require('node:path'),yr=['fnm_multishells'],Sr=0xea60,$=process[_0x25f477(0x281)]==='win32';function I(_0x4d364c){const _0x29f574=_0x25f477;return yr[_0x29f574(0x241)](_0x3bb853=>_0x4d364c[_0x29f574(0x20d)](_0x3bb853));}function xr(_0x4516e5){const _0x103702=_0x25f477;if(!_0x4516e5||!I(_0x4516e5))return _0x4516e5;try{let _0x571254=(0x0,u['join'])((0x0,M['realpathSync'])((0x0,u[_0x103702(0x2d8)])(_0x4516e5)),(0x0,u['basename'])(_0x4516e5));if((0x0,M[_0x103702(0x194)])(_0x571254)&&!I(_0x571254))return _0x571254;}catch{}return _0x4516e5;}function Tr(_0x190f98){if(!_0x190f98||!I(_0x190f98))return _0x190f98;try{let _0x1464a2=(0x0,M['realpathSync'])(_0x190f98);if(_0x1464a2&&!I(_0x1464a2))return _0x1464a2;}catch{}return _0x190f98;}function Ht(){const _0x1637a5=_0x25f477;return $?[]:[process.env.SHELL,_0x1637a5(0x199),_0x1637a5(0x2bf),_0x1637a5(0x2e2)][_0x1637a5(0x1a0)](_0x245791=>!!_0x245791)['filter']((_0x41c82a,_0x4f5307,_0x2df968)=>_0x2df968['indexOf'](_0x41c82a)===_0x4f5307)['filter'](_0x43ade5=>(0x0,M[_0x1637a5(0x194)])(_0x43ade5));}function Bt(_0x51400b,_0x335a7d){const _0x456609=_0x25f477;let _0x5009ef=_0x21441d=>{const _0x3c1781=_0xfedb;let _0x371f2b=/^v?(\d+)\.(\d+)\.(\d+)/[_0x3c1781(0x2b6)](_0x21441d);return _0x371f2b?[Number(_0x371f2b[0x1]),Number(_0x371f2b[0x2]),Number(_0x371f2b[0x3])]:null;},_0x172e12=_0x5009ef(_0x51400b),_0xfdac68=_0x5009ef(_0x335a7d);if(!_0x172e12&&!_0xfdac68)return _0x335a7d[_0x456609(0x2ed)](_0x51400b);if(!_0x172e12)return 0x1;if(!_0xfdac68)return-0x1;for(let _0x4ab57c=0x0;_0x4ab57c<_0x172e12[_0x456609(0x233)];_0x4ab57c+=0x1)if(_0x172e12[_0x4ab57c]!==_0xfdac68[_0x4ab57c])return _0xfdac68[_0x4ab57c]-_0x172e12[_0x4ab57c];return 0x0;}function jt(){const _0x525d15=_0x25f477;let _0x23d3a5=(0x0,B['homedir'])(),_0x5d6bf6=(0x0,u['join'])(_0x23d3a5,_0x525d15(0x26f),_0x525d15(0x27a),'node'),_0x25df28=[(0x0,u['join'])(_0x23d3a5,'.nvm',_0x525d15(0x1af),'bin')];try{let _0x259e02=(0x0,M[_0x525d15(0x2fe)])(_0x5d6bf6,{'withFileTypes':!0x0})['filter'](_0x34d9f5=>_0x34d9f5['isDirectory']())['map'](_0x5eeee4=>_0x5eeee4['name'])['sort'](Bt);for(let _0x5c27be of _0x259e02)_0x25df28['push']((0x0,u[_0x525d15(0x29b)])(_0x5d6bf6,_0x5c27be,'bin'));}catch{}return _0x25df28;}function Wt(){const _0x17265e=_0x25f477;let _0x25eb20=(0x0,B['homedir'])(),_0x19eaf0=[process.env.FNM_DIR,(0x0,u['join'])(_0x25eb20,_0x17265e(0x1d5),'share','fnm'),(0x0,u[_0x17265e(0x29b)])(_0x25eb20,_0x17265e(0x1a9),'Application\x20Support',_0x17265e(0x1ab)),(0x0,u[_0x17265e(0x29b)])(_0x25eb20,_0x17265e(0x2ff))]['filter'](_0x1155d3=>!!_0x1155d3),_0x13a801=[],_0x11e3f3=new Set();for(let _0x309281 of _0x19eaf0){if(_0x11e3f3[_0x17265e(0x1ec)](_0x309281))continue;_0x11e3f3[_0x17265e(0x2c4)](_0x309281);let _0x41a667=(0x0,u['join'])(_0x309281,'node-versions');try{let _0x33a0c3=(0x0,M[_0x17265e(0x2fe)])(_0x41a667,{'withFileTypes':!0x0})['filter'](_0x4afe30=>_0x4afe30['isDirectory']())['map'](_0x18d65d=>_0x18d65d['name'])['sort'](Bt);for(let _0x298bd0 of _0x33a0c3)_0x13a801['push']((0x0,u['join'])(_0x41a667,_0x298bd0,'installation','bin')),_0x13a801[_0x17265e(0x27b)]((0x0,u[_0x17265e(0x29b)])(_0x41a667,_0x298bd0,'bin'));}catch{}}return _0x13a801;}var Ae=null;function zt(){const _0xc4d8fa=_0x25f477;if(Ae?.['PATH']&&!I(Ae[_0xc4d8fa(0x236)]))return Ae;for(let _0x3be6da of Ht())try{let _0x423252=(0x0,H['execFileSync'])(_0x3be6da,['-ilc','env'],{'timeout':0x1388,'encoding':_0xc4d8fa(0x212),'stdio':[_0xc4d8fa(0x2e6),'pipe',_0xc4d8fa(0x2e6)]}),_0x2493bf={};for(let _0x4d9a7b of _0x423252[_0xc4d8fa(0x255)]('\x0a')){let _0x2222d2=_0x4d9a7b['indexOf']('=');_0x2222d2>0x0&&(_0x2493bf[_0x4d9a7b[_0xc4d8fa(0x1f4)](0x0,_0x2222d2)]=_0x4d9a7b['slice'](_0x2222d2+0x1));}return _0x2493bf['PATH']&&!I(_0x2493bf[_0xc4d8fa(0x236)])&&(Ae=_0x2493bf),_0x2493bf;}catch{}return{};}function Cr(_0x53fa1e=zt()){const _0x18e700=_0x25f477;let _0x3a84f7=(0x0,B[_0x18e700(0x2b4)])(),_0x525415=_0x53fa1e['PNPM_HOME']||process.env.PNPM_HOME||($?(0x0,u['join'])(_0x3a84f7,_0x18e700(0x219)):(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,'Library','pnpm')),_0x1b7ac4=_0x53fa1e['PATH']||process.env.PATH||'',_0x10ae43=$?[(0x0,u['join'])(_0x3a84f7,'.npm-global',_0x18e700(0x1c0)),(0x0,u['join'])(_0x3a84f7,_0x18e700(0x1d5),_0x18e700(0x1c0)),(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,_0x18e700(0x1e3),'bin'),(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,'.codex','packages',_0x18e700(0x2f9),'current','bin'),_0x525415,(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,_0x18e700(0x220),'Roaming',_0x18e700(0x19e)),(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,_0x18e700(0x220),_0x18e700(0x267),_0x18e700(0x261),_0x18e700(0x291))]:['/usr/local/bin','/opt/homebrew/bin','/usr/bin','/bin',(0x0,u['join'])(_0x3a84f7,_0x18e700(0x1d6),'bin'),(0x0,u['join'])(_0x3a84f7,_0x18e700(0x1d5),'bin'),(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,_0x18e700(0x1e3),_0x18e700(0x1c0)),(0x0,u[_0x18e700(0x29b)])(_0x3a84f7,'.codex','packages',_0x18e700(0x2f9),_0x18e700(0x1af),'bin'),_0x525415,...jt(),...Wt()],_0x990de5=_0x1b7ac4['split'](u[_0x18e700(0x1b8)])['filter'](Boolean)['map'](Tr),_0x2370e5=new Set(_0x990de5);for(let _0x2e84bd of _0x10ae43)_0x2370e5[_0x18e700(0x1ec)](_0x2e84bd)||(_0x990de5['push'](_0x2e84bd),_0x2370e5['add'](_0x2e84bd));return _0x990de5[_0x18e700(0x29b)](u['delimiter']);}function Be(){const _0x34890b=_0x25f477;let _0x44eb1b=zt(),_0x1a759a={};for(let [_0x128df0,_0x3cd826]of Object['entries'](process.env))typeof _0x3cd826==_0x34890b(0x1c3)&&(_0x1a759a[_0x128df0]=_0x3cd826);for(let [_0x4a7db9,_0x333740]of Object['entries'](_0x44eb1b))typeof _0x333740==_0x34890b(0x1c3)&&(_0x1a759a[_0x4a7db9]=_0x333740);return _0x1a759a['PATH']=Cr(_0x44eb1b),_0x1a759a['HOME']||(_0x1a759a[_0x34890b(0x2bc)]=(0x0,B['homedir'])()),delete _0x1a759a['CLAUDE_CODE_ENTRYPOINT'],delete _0x1a759a[_0x34890b(0x2b3)],_0x1a759a;}function qt(_0x553952){const _0xf401e3=_0x25f477;if($)try{let _0xc0b5f1=(0x0,H['execFileSync'])('where.exe',[_0x553952],{'timeout':0xbb8,'stdio':_0xf401e3(0x2e6),'encoding':'utf-8'})[_0xf401e3(0x308)]()['split'](/\r?\n/)['filter'](Boolean);return _0xc0b5f1[_0xf401e3(0x243)](_0x9052ec=>_0x9052ec['endsWith'](_0xf401e3(0x27d)))??_0xc0b5f1[0x0];}catch{return;}}function ae(_0x24afaf,_0xfcb62e=0xbb8){const _0x485d06=_0x25f477;try{return(0x0,H[_0x485d06(0x25f)])(_0x24afaf,[_0x485d06(0x198)],{'timeout':_0xfcb62e,'stdio':_0x485d06(0x2e6),'encoding':'utf-8','env':Be(),...$?{'shell':!0x0}:{}})[_0x485d06(0x308)]()||null;}catch{return null;}}function Ar(_0x2c51e2){const _0xc633d0=_0x25f477;for(let _0x24f2c3 of Ht())try{let _0x34afbb=(0x0,H['execFileSync'])(_0x24f2c3,[_0xc633d0(0x1d8),'command\x20-v\x20'+_0x2c51e2],{'timeout':0x1388,'stdio':['pipe',_0xc633d0(0x2e6),_0xc633d0(0x2e6)],'encoding':_0xc633d0(0x212)})[_0xc633d0(0x308)]();if(_0x34afbb)return _0x34afbb;}catch{}}function wr(){const _0x5f1dc3=_0x25f477;let _0x13b0b3=(0x0,B[_0x5f1dc3(0x2b4)])();return[(0x0,u['join'])(_0x13b0b3,_0x5f1dc3(0x1d5),'bin','claude'),(0x0,u[_0x5f1dc3(0x29b)])(_0x13b0b3,_0x5f1dc3(0x1e3),_0x5f1dc3(0x1c0),'claude'),_0x5f1dc3(0x21f),_0x5f1dc3(0x1dd),(0x0,u[_0x5f1dc3(0x29b)])(_0x13b0b3,'.npm-global',_0x5f1dc3(0x1c0),_0x5f1dc3(0x24f))];}function br(){const _0x1c7801=_0x25f477;if($){let _0x2f8996=qt('claude');return _0x2f8996&&ae(_0x2f8996)?_0x2f8996:void 0x0;}for(let _0x3370bb of wr())if(ae(_0x3370bb))return _0x3370bb;try{let _0x34779b=(0x0,H['execFileSync'])('/usr/bin/which',[_0x1c7801(0x24f)],{'timeout':0xbb8,'stdio':_0x1c7801(0x2e6),'encoding':_0x1c7801(0x212),'env':Be()})[_0x1c7801(0x308)]();if(_0x34779b&&!_0x34779b['includes']('cmux')&&ae(_0x34779b))return _0x34779b;}catch{}}function vr(){const _0x365a0f=_0x25f477;let _0x173b5d=(0x0,B['homedir'])(),_0x56966c=[process.env.PNPM_HOME,(0x0,u[_0x365a0f(0x29b)])(_0x173b5d,'Library','pnpm')][_0x365a0f(0x1a0)](_0x4cb22e=>!!_0x4cb22e);return['/usr/local/bin/codex','/opt/homebrew/bin/codex',(0x0,u['join'])(_0x173b5d,'.npm-global',_0x365a0f(0x1c0),_0x365a0f(0x28d)),(0x0,u[_0x365a0f(0x29b)])(_0x173b5d,'.local',_0x365a0f(0x1c0),_0x365a0f(0x28d)),(0x0,u[_0x365a0f(0x29b)])(_0x173b5d,_0x365a0f(0x1d9),_0x365a0f(0x1a7),_0x365a0f(0x2f9),'current',_0x365a0f(0x1c0),_0x365a0f(0x28d)),...jt()[_0x365a0f(0x2fb)](_0x3d1e90=>(0x0,u['join'])(_0x3d1e90,'codex')),...Wt()['map'](_0x51f5b1=>(0x0,u[_0x365a0f(0x29b)])(_0x51f5b1,'codex')),..._0x56966c[_0x365a0f(0x2fb)](_0x109e8b=>(0x0,u['join'])(_0x109e8b,_0x365a0f(0x28d)))];}function Ir(){const _0xa9d54b=_0x25f477;if($){let _0x1f3196=qt('codex');return _0x1f3196&&ae(_0x1f3196)?_0x1f3196:void 0x0;}let _0x3b3df3=_0x17dfad=>{let _0x2459e0=xr(_0x17dfad);return ae(_0x2459e0)?_0x2459e0:void 0x0;},_0x20495b;for(let _0x12f590 of vr()){let _0x127831=_0x3b3df3(_0x12f590);if(_0x127831){if(!I(_0x127831))return _0x127831;_0x20495b=_0x127831;}}try{let _0x520190=(0x0,H['execFileSync'])('/usr/bin/which',[_0xa9d54b(0x28d)],{'timeout':0xbb8,'stdio':_0xa9d54b(0x2e6),'encoding':'utf-8','env':Be()})[_0xa9d54b(0x308)](),_0x43d759=_0x520190?_0x3b3df3(_0x520190):void 0x0;if(_0x43d759){if(!I(_0x43d759))return _0x43d759;_0x20495b=_0x20495b??_0x43d759;}}catch{}let _0x5d2727=Ar(_0xa9d54b(0x28d)),_0x23e3ae=_0x5d2727?_0x3b3df3(_0x5d2727):void 0x0;if(_0x23e3ae){if(!I(_0x23e3ae))return _0x23e3ae;_0x20495b=_0x20495b??_0x23e3ae;}return _0x20495b;}function Gt(_0x414840){const _0x533a8d=_0x25f477;return _0x414840===_0x533a8d(0x24f)?_0x533a8d(0x201):_0x533a8d(0x1c9);}function Mr(_0x23781e){let _0x46e772=process.env[Gt(_0x23781e)];return _0x46e772||(_0x23781e==='claude'?br()??null:Ir()??null);}function Vt(_0x1a5554){let _0x1d7ef8=null,_0x36ba34=0x0;return()=>{const _0x4b287c=_0xfedb;let _0x3659a6=process.env[Gt(_0x1a5554)];if(_0x3659a6)return _0x3659a6;let _0x20b42e=Date['now']();return(!_0x1d7ef8||_0x20b42e-_0x36ba34>Sr||!(0x0,M[_0x4b287c(0x194)])(_0x1d7ef8)||I(_0x1d7ef8))&&(_0x1d7ef8=Mr(_0x1a5554)??_0x1a5554,_0x36ba34=_0x20b42e),_0x1d7ef8;};}var Bi=Vt(_0x25f477(0x24f)),ji=Vt('codex');function E(_0x1a81ce){const _0x2b3c20=_0x25f477;return!_0x1a81ce||typeof _0x1a81ce!=_0x2b3c20(0x21a)||Array['isArray'](_0x1a81ce)?null:_0x1a81ce;}function le(_0x599a68){let _0x40c604=Number(_0x599a68);return Number['isFinite'](_0x40c604)?_0x40c604:null;}function Er(_0x1b556b){const _0x2f74f8=_0x25f477;let _0x353a46=le(_0x1b556b);return _0x353a46===null||_0x353a46<=0x0?null:Math[_0x2f74f8(0x275)](_0x353a46);}function ce(_0x228d80){const _0x510620=_0x25f477;let _0x4a048f=E(_0x228d80);if(!_0x4a048f)return;let _0x37443a=le(_0x4a048f[_0x510620(0x217)]??_0x4a048f[_0x510620(0x2be)]),_0x59e58b=le(_0x4a048f['output_tokens']??_0x4a048f[_0x510620(0x303)]);if(_0x37443a===null||_0x59e58b===null)return;let _0x397cdc=le(_0x4a048f['cache_creation_input_tokens']??_0x4a048f[_0x510620(0x282)]),_0x1c8090=le(_0x4a048f[_0x510620(0x2ac)]??_0x4a048f[_0x510620(0x245)]),_0x54877b=Er(_0x4a048f['modelContextWindow']??_0x4a048f['model_context_window']??_0x4a048f['contextWindowTokens']);return{'inputTokens':_0x37443a,'outputTokens':_0x59e58b,..._0x397cdc!==null?{'cacheCreationInputTokens':_0x397cdc}:{},..._0x1c8090!==null?{'cacheReadInputTokens':_0x1c8090}:{},..._0x54877b?{'contextWindowTokens':_0x54877b}:{}};}function Qt(_0x51e6a0){const _0xcd66a2=_0x25f477;let _0x4057dc=ce(_0x51e6a0);if(_0x4057dc&&!(_0x4057dc['inputTokens']<=0x0&&_0x4057dc['outputTokens']<=0x0&&(_0x4057dc[_0xcd66a2(0x282)]??0x0)<=0x0&&(_0x4057dc['cacheReadInputTokens']??0x0)<=0x0&&!_0x4057dc['contextWindowTokens']))return _0x4057dc;}function we(_0x3ced92){const _0x7ad4c1=_0x25f477;return _0x3ced92[_0x7ad4c1(0x2be)]===0x0&&_0x3ced92[_0x7ad4c1(0x303)]===0x0&&(_0x3ced92['cacheCreationInputTokens']??0x0)===0x0&&(_0x3ced92[_0x7ad4c1(0x245)]??0x0)===0x0&&!_0x3ced92['contextWindowTokens'];}function Jt(_0x3610e7){const _0x1e6b8c=_0x25f477;let _0xc3e3a=E(_0x3610e7);if(!_0xc3e3a)return;if(_0xc3e3a[_0x1e6b8c(0x209)]==='assistant'){let _0x424154=E(_0xc3e3a[_0x1e6b8c(0x2fd)]);if(_0x424154?.['model']==='<synthetic>')return;let _0x276df0=ce(_0x424154?.[_0x1e6b8c(0x1f5)]??_0xc3e3a['usage']);return _0x276df0&&!we(_0x276df0)?_0x276df0:void 0x0;}let _0x4701a4=E(_0xc3e3a['toolUseResult']),_0x263258=ce(_0x4701a4?.[_0x1e6b8c(0x1f5)]);return _0x263258&&!we(_0x263258)?_0x263258:void 0x0;}function Kt(_0x4c6d6f){const _0x4a12a3=_0x25f477;let _0x2506b3=E(_0x4c6d6f);if(_0x2506b3?.['type']!=='event_msg')return;let _0x1fab7a=E(_0x2506b3[_0x4a12a3(0x2d0)]);if(_0x1fab7a?.[_0x4a12a3(0x209)]!=='token_count')return;let _0x24171d=E(_0x1fab7a['info']),_0x1e4a17=E(_0x24171d?.[_0x4a12a3(0x297)]);if(_0x1e4a17)return Qt({..._0x1e4a17,'modelContextWindow':_0x24171d?.[_0x4a12a3(0x260)]});}function be(_0x2a7ca7){const _0x2691ca=_0x25f477;switch(_0x2a7ca7){case'plan':return'plan';case'acceptEdits':return _0x2691ca(0x21c);case'bypassPermissions':return'autoApprove';case'default':return _0x2691ca(0x2e4);default:return;}}function C(_0x105f9a){const _0x207098=_0x25f477;return typeof _0x105f9a!=_0x207098(0x1c3)?void 0x0:_0x105f9a[_0x207098(0x1fe)](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')['trim']()||void 0x0;}function Xt(_0x402658){const _0x1bc61b=_0x25f477;let _0x54d882=C(_0x402658);switch(_0x54d882){case _0x1bc61b(0x216):case'low':case _0x1bc61b(0x2e0):case'high':case'xhigh':case'max':case'ultra':return _0x54d882;default:return;}}function jr(_0x8146cd){const _0x1be22a=_0x25f477;let _0x3028ee=typeof _0x8146cd?.[_0x1be22a(0x20a)]=='string'?_0x8146cd['approval_policy']:'',_0x144e62=_0x8146cd?.[_0x1be22a(0x26b)],_0x58f4e9=typeof _0x144e62?.['type']=='string'?_0x144e62['type']:'',_0x103cf=Array['isArray'](_0x144e62?.['writable_roots'])?_0x144e62['writable_roots']:null;if(_0x3028ee==='never'&&_0x58f4e9==='danger-full-access')return _0x1be22a(0x1db);if(_0x3028ee==='on-request'&&_0x58f4e9===_0x1be22a(0x1b9))return _0x103cf?.['length']?_0x1be22a(0x2e4):_0x1be22a(0x24b);}function Yt(_0x578f3b){const _0x11b3d9=_0x25f477;return _0x578f3b?.[_0x11b3d9(0x209)]==='permission-mode'?be(_0x578f3b[_0x11b3d9(0x2a5)]):be(_0x578f3b?.['permissionMode']);}function Zt(_0x44ea70){const _0x35897d=_0x25f477;if(_0x44ea70?.[_0x35897d(0x209)]===_0x35897d(0x1e9))return jr(_0x44ea70[_0x35897d(0x2d0)]);}function en(_0x152adc){return Kt(_0x152adc);}function tn(_0x4c5b3b){return Jt(_0x4c5b3b);}var Wr=new Set(['New\x20session',_0x25f477(0x1b4),_0x25f477(0x2bb)]),zr=[_0x25f477(0x264),'<local-command-caveat>','<local-command-stdout>',_0x25f477(0x1c6),'<command-name>','<command-message>',_0x25f477(0x2a1),'#\x20AGENTS.md\x20instructions\x20for\x20'];function qr(_0x3763e7){const _0x5afb71=_0x25f477;return _0x3763e7[_0x5afb71(0x1fe)](/\s+/g,'\x20')[_0x5afb71(0x308)]();}function F(_0xf03844){const _0x32ce1b=_0x25f477;return typeof _0xf03844!=_0x32ce1b(0x1c3)?void 0x0:qr(_0xf03844)||void 0x0;}function je(_0x3d15ca){const _0x5af891=_0x25f477;let _0x3b820b=F(_0x3d15ca);return _0x3b820b?/^[0-9a-f]{8,}$/i[_0x5af891(0x1b7)](_0x3b820b)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x5af891(0x1b7)](_0x3b820b)||/^agent-[a-z0-9_-]{6,}$/i['test'](_0x3b820b):!0x1;}function We(_0x528e93){const _0xeaa7e5=_0x25f477;let _0x29ed84=F(_0x528e93);return!_0x29ed84||Wr[_0xeaa7e5(0x1ec)](_0x29ed84)||je(_0x29ed84);}function Gr(_0x24e893){const _0x1e748d=_0x25f477;for(let _0x23d3c4 of _0x24e893['replace'](/\r/g,'')[_0x1e748d(0x255)]('\x0a')){let _0x5d82f2=F(_0x23d3c4);if(_0x5d82f2&&!Vr(_0x5d82f2)&&!Qr(_0x5d82f2))return _0x5d82f2;}}function Vr(_0x50e2cc){const _0xd95e4b=_0x25f477;return zr[_0xd95e4b(0x241)](_0x38cdff=>_0x50e2cc[_0xd95e4b(0x302)](_0x38cdff));}function Qr(_0x14ce0a){const _0x101ff0=_0x25f477;let _0x2373a0=_0x14ce0a['replace'](/^['"`]+/,'')['replace'](/['"`\\]+$/,'')['trim']();return!!(!_0x2373a0||/^(\/|~\/|\.\/|\.\.\/)/[_0x101ff0(0x1b7)](_0x2373a0)||/^[A-Za-z]:\\/['test'](_0x2373a0));}function Jr(_0x45262f){for(let _0x32947c=0x0;_0x32947c<_0x45262f['length'];_0x32947c+=0x1){let _0x280fa1=_0x45262f[_0x32947c];if(_0x280fa1==='。'||_0x280fa1==='!'||_0x280fa1==='?'||_0x280fa1===';')return _0x32947c+0x1;if(_0x280fa1==='.'||_0x280fa1==='!'||_0x280fa1==='?'||_0x280fa1===';'){let _0x39960d=_0x45262f[_0x32947c+0x1];if(!_0x39960d||/\s/['test'](_0x39960d))return _0x32947c+0x1;}}return-0x1;}function nn(_0xb5f7e4,_0x4c4485=0x50){const _0x147e34=_0x25f477;if(typeof _0xb5f7e4!='string')return;let _0x1583fe=Gr(_0xb5f7e4);if(!_0x1583fe)return;let _0x4ba9f9=Jr(_0x1583fe),_0x2488fe=(_0x4ba9f9>0x0?_0x1583fe[_0x147e34(0x1f4)](0x0,_0x4ba9f9):_0x1583fe)[_0x147e34(0x1fe)](/[。!?;.!?;]+$/gu,'')['trim']();if(!(!_0x2488fe||je(_0x2488fe)))return _0x2488fe['length']<=_0x4c4485?_0x2488fe:_0x2488fe['slice'](0x0,Math[_0x147e34(0x269)](0x1,_0x4c4485-0x3))[_0x147e34(0x229)]()+_0x147e34(0x2de);}function k(_0x4fc1cf,_0x297284){for(let _0x32821f of _0x4fc1cf){let _0x3fa035=F(_0x32821f);if(!(!_0x3fa035||We(_0x3fa035)))return _0x3fa035;}return nn(_0x297284);}var rn=_0x25f477(0x20f);function on(_0x13e0f8){const _0x463260=_0x25f477;return _0x13e0f8[_0x463260(0x1fe)](/[^a-zA-Z0-9]/g,'-');}async function ze(){const _0x325c0a=_0x25f477;let _0x3ef1a8=await ie(),_0x392028=await _(_0x3ef1a8,b,async _0x21d65b=>{const _0x3b6fef=_0xfedb;try{let _0x4d531f=JSON[_0x3b6fef(0x1b2)](await(0x0,sn[_0x3b6fef(0x2b0)])(_0x21d65b,'utf-8')),_0x201be3=C(_0x4d531f['cliSessionId']);if(!_0x201be3)return null;let _0x46891c=F(C(_0x4d531f['title'])),_0x2dda19={'cliSessionId':_0x201be3},_0x420eda=C(_0x4d531f[_0x3b6fef(0x2ef)]),_0x3518ba=C(_0x4d531f[_0x3b6fef(0x1d0)]),_0x2b970f=C(_0x4d531f['originCwd']),_0x506780=C(_0x4d531f[_0x3b6fef(0x1e4)]),_0x1fb313=Xt(_0x4d531f['effort']),_0x33c4d4=be(C(_0x4d531f['permissionMode']));return _0x420eda&&(_0x2dda19[_0x3b6fef(0x1ce)]=_0x420eda),_0x3518ba&&(_0x2dda19[_0x3b6fef(0x1d0)]=_0x3518ba),_0x2b970f&&(_0x2dda19['originCwd']=_0x2b970f),_0x46891c&&(_0x2dda19['title']=_0x46891c),_0x506780&&(_0x2dda19['model']=_0x506780),_0x1fb313&&(_0x2dda19[_0x3b6fef(0x286)]=_0x1fb313),_0x33c4d4&&(_0x2dda19[_0x3b6fef(0x2d5)]=_0x33c4d4),typeof _0x4d531f['isArchived']==_0x3b6fef(0x248)&&(_0x2dda19[_0x3b6fef(0x304)]=_0x4d531f['isArchived']),_0x2dda19;}catch{return null;}}),_0x40b45e=new Map();for(let _0x36cd18 of _0x392028)_0x36cd18&&_0x40b45e[_0x325c0a(0x228)](_0x36cd18['cliSessionId'],_0x36cd18);return{'byCliSessionId':_0x40b45e};}function qe(_0x2bc90a,_0x1f8676){const _0x3be69a=_0x25f477;if(!_0x1f8676)return _0x2bc90a;let _0x17e5e6=[..._0x2bc90a['titleAliases']??[],..._0x2bc90a[_0x3be69a(0x22f)]&&_0x1f8676[_0x3be69a(0x22f)]&&_0x2bc90a['title']!==_0x1f8676[_0x3be69a(0x22f)]?[_0x2bc90a[_0x3be69a(0x22f)]]:[]];return{..._0x2bc90a,..._0x1f8676[_0x3be69a(0x1d0)]?{'cwd':_0x1f8676[_0x3be69a(0x1d0)]}:{},..._0x1f8676['originCwd']?{'originCwd':_0x1f8676[_0x3be69a(0x276)]}:{},..._0x1f8676['model']?{'model':_0x1f8676[_0x3be69a(0x1e4)]}:{},..._0x1f8676[_0x3be69a(0x286)]?{'effort':_0x1f8676[_0x3be69a(0x286)]}:{},..._0x1f8676[_0x3be69a(0x22f)]?{'title':_0x1f8676[_0x3be69a(0x22f)]}:{},..._0x17e5e6[_0x3be69a(0x233)]?{'titleAliases':_0x17e5e6}:{},..._0x1f8676['approvalMode']?{'approvalMode':_0x1f8676[_0x3be69a(0x2d5)]}:{},'originator':'Claude\x20Desktop',...typeof _0x1f8676['externalArchived']==_0x3be69a(0x248)?{'externalArchived':_0x1f8676['externalArchived']}:{}};}var ln=require(_0x25f477(0x2e9)),cn=require(_0x25f477(0x294)),Qe=require(_0x25f477(0x2f8)),Je=require('node:path'),dn=require('node:util'),Kr=x['child']({'module':'scanner'}),an=(0x0,dn['promisify'])(ln[_0x25f477(0x1a8)]),Xr=0x7530,K=null,de=null,Ge='';function Ve(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function Yr(_0x2fca44){const _0xe8ca10=_0x25f477;return _0x2fca44['startsWith']('~/')?(0x0,Je[_0xe8ca10(0x29b)])((0x0,Qe[_0xe8ca10(0x2b4)])(),_0x2fca44[_0xe8ca10(0x1f4)](0x2)):_0x2fca44;}function un(_0x311301,_0x38fdde,_0x160546){const _0x36d72e=_0x25f477;if(_0x311301)return _0x311301[_0x36d72e(0x2cc)][_0x36d72e(0x290)](_0x38fdde)??_0x311301['byRolloutPath']['get'](_0x160546);}function fn(_0x1a74fe,_0x16227b,_0x28bcb9){const _0x110d18=_0x25f477;if(_0x1a74fe)return _0x1a74fe['archivedById']['get'](_0x16227b)??_0x1a74fe['archivedByRolloutPath'][_0x110d18(0x290)](_0x28bcb9);}function Ke(){K=null;}async function ve(){const _0x3f4bbd=_0x25f477;let _0xb4145=Date[_0x3f4bbd(0x2af)](),_0x58a1e2=(0x0,Qe[_0x3f4bbd(0x2b4)])();if(K&&K[_0x3f4bbd(0x284)]===_0x58a1e2&&_0xb4145<=K['expiresAt'])return K['value'];if(de&&Ge===_0x58a1e2)return de;Ge=_0x58a1e2,de=((async()=>{const _0xe9688=_0x3f4bbd;let _0x42016f=(0x0,Je[_0xe9688(0x29b)])(_0x58a1e2,_0xe9688(0x1d9),_0xe9688(0x2b9));if(!(await(0x0,cn['stat'])(_0x42016f)[_0xe9688(0x23f)](()=>null))?.[_0xe9688(0x1e5)]())return Ve();try{let _0x2cf5b3='';try{({stdout:_0x2cf5b3}=await an('sqlite3',['-json',_0x42016f,'select\x20id,\x20title,\x20rollout_path,\x20archived\x20from\x20threads'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x2cf5b3}=await an('sqlite3',['-json',_0x42016f,'select\x20id,\x20title,\x20rollout_path\x20from\x20threads\x20where\x20coalesce(title,\x20\x27\x27)\x20<>\x20\x27\x27'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x5ad600=JSON['parse'](_0x2cf5b3||'[]'),_0x262c86=Ve();for(let _0x515c07 of _0x5ad600){if(typeof _0x515c07['id']!=_0xe9688(0x1c3))continue;let _0x59cdca=F(typeof _0x515c07[_0xe9688(0x22f)]=='string'?_0x515c07['title']:void 0x0);_0x59cdca&&_0x262c86[_0xe9688(0x2cc)]['set'](_0x515c07['id'],_0x59cdca);let _0x3a0fa8=typeof _0x515c07['rollout_path']==_0xe9688(0x1c3)&&_0x515c07[_0xe9688(0x1cc)]['trim']()?Yr(_0x515c07['rollout_path']):'';if(_0x3a0fa8&&_0x59cdca&&_0x262c86[_0xe9688(0x203)]['set'](_0x3a0fa8,_0x59cdca),typeof _0x515c07[_0xe9688(0x202)]==_0xe9688(0x207)||typeof _0x515c07[_0xe9688(0x202)]=='boolean'){let _0x4bd655=_0x515c07[_0xe9688(0x202)]===!0x0||_0x515c07[_0xe9688(0x202)]===0x1;_0x262c86['archivedById'][_0xe9688(0x228)](_0x515c07['id'],_0x4bd655),_0x3a0fa8&&_0x262c86['archivedByRolloutPath'][_0xe9688(0x228)](_0x3a0fa8,_0x4bd655);}}return _0x262c86;}catch(_0x419635){return Kr['debug']({'error':String(_0x419635)},'failed\x20to\x20read\x20codex\x20thread\x20titles\x20from\x20sqlite'),Ve();}})());try{let _0x313a71=await de;return K={'value':_0x313a71,'expiresAt':Date['now']()+Xr,'home':_0x58a1e2},_0x313a71;}finally{de=null,Ge='';}}var mn=require(_0x25f477(0x247)),X=require('node:fs/promises'),gn=require('node:readline');function*ue(_0x20398b,_0x3ddec2){const _0x535aac=_0x25f477;let _0x190983=0x0,_0x5a991e=0x0;for(;_0x190983<_0x20398b[_0x535aac(0x233)]&&_0x5a991e<_0x3ddec2;){let _0xc861e1=_0x20398b[_0x535aac(0x2f1)]('\x0a',_0x190983);_0xc861e1===-0x1&&(_0xc861e1=_0x20398b[_0x535aac(0x233)]);let _0x24e803=_0x20398b['substring'](_0x190983,_0xc861e1);_0x190983=_0xc861e1+0x1,!(_0x24e803[_0x535aac(0x233)]===0x0||_0x24e803['trim']()['length']===0x0)&&(yield _0x24e803,_0x5a991e+=0x1);}}var Xe=0x200*0x400,pn=0x100*0x400;function _0x5864(){const _0x30cb51=['ywXSB2m','ls1ZzxnZAw9UlwLKpq','ru5pru5u','y2XHDwrL','yxjJAgL2zwrFC2vZC2LVBNm','mZmYmwDmyNvRyG','C3rHCNrLzef0','DgvYBwLUywWTy29UDhjVBc10B2TLBG','DgfZA19JB21WBgv0zq','C3bSAxq','C25HChnOB3rZ','ChjVy2vZCYbZy2fUignVBw1HBMqGzMfPBgvK','Aw5JBhvKzvbHDgnOq2fSBhm','ENnO','ls1PBxbVCNq','lNjI','BhnVzK1Z','C3rHCNruAw1L','DMfSDwu','zxHLy0zPBgvtEw5J','Bw9KzwXFy29UDgv4Df93Aw5KB3C','uhjVz3jHBxm','D2fYBG','yxjNDw1LBNrZ','pgvUDMLYB25Tzw50x2nVBNrLEhq+','C29YDa','zw50CMLLCW','tg9JywW','lMPZ','Bwf4','ChjVy2vZCYbZy2fUignVBw1HBMqGC2TPChbLzcdIGjqGChjVy2vZCYbLEgL0zwq','C2fUzgjVEf9WB2XPy3K','ls1Yzxn1Bwu9','luzU','ls1Yzxn1Bwu','lM52Bq','BM9KztPWyxrO','Bg9Nsw50zxj2ywW','C3rVCfjLyxnVBG','zNvUy3rPB25Fy2fSBa','DgvYBwLUywW','zMXVB3i','B3jPz2LUq3DK','Dgv4Da','zMLZAa','lNrZEa','DMvYC2LVBNm','ChvZAa','zMfPBgvKihrVihjLywqGy2XHDwrLihnLC3nPB24GAgLZDg9YEq','lMv4zq','tM8GC3vJAcbWCM9JzxnZ','yMfZzw5HBwu','mM1qrhDJAW','CgXHDgzVCM0','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','yNvU','Ag9Tzq','CMvZB2X2zq','zwzMB3j0','BgfZDfvZzwrbDa','q2XHDwrL','CM9Szq','pgXVy2fSlwnVBw1HBMqTy2f2zwf0pG','zMLSzq','DhvYBL9HyM9YDgvK','y29KzxG','A2LUza','yMfZAa','z2v0','BM9Kzq','C3rHCNruAw1LCG','ywXS','BM9KztPMCY9WCM9TAxnLCW','DMLHv3jHChbLCG','odm0mJi2mMDZuNj6Bq','BgfZDf90B2TLBL91C2fNzq','Aw52ywXPzgf0zq','zMLSzvbHDgG','zMLUz2vYChjPBNq','AM9PBG','zxjYB3i','AgLNAa','C3rHCNrqzxjPB2rPy0XVzW','Bwv0yq','lMPHDMe','pgnVBw1HBMqTyxjNCZ4','C2LNBMfS','BM9KztP3B3jRzxjFDgHYzwfKCW','AhLKCMf0zwrdyw5KAwrHDgvZ','CgvYBwLZC2LVBK1Vzgu','DxnLCG','ChjVy2vZCY5Zy2fUlMXZB2zFBxm','y2XLyxi','AxnszxnWB25KAw5N','lMvSBq','zMfPBgvKihrVihDHBgSGy29KzxGGC2vZC2LVBNmGzgLY','y2fJAgvFCMvHzf9PBNb1Df90B2TLBNm','ls1Kyw5NzxjVDxnSEs1ZA2LWlxbLCM1PC3nPB25Z','C291CMnL','BM93','CMvHzezPBgu','DxbKyxrLzcbZDwnJzxnZzNvSBhK','y29SBgvJDenVBNrLEhq','q0Xbvurfq09erq','Ag9TzwrPCG','BxrPBwvnCW','zxHLyW','ls1SAxn0zw49','y29KzxHmB29RDxa','C3rHDgvFns5ZCwXPDgu','oda0mZC2ywHZsvvl','vw50AxrSzwqGC2vZC2LVBG','se9nrq','CMv1C2vKrMLSzxm','Aw5WDxruB2TLBNm','l2jPBI9IyxnO','ChjVy2vZCY1Zy2fUBMvY','lMPZB24','m1HJyLfdBW','y29Kzq','ywrK','B2XKu3rYAw5N','BwLUtxm','y3jLyxrLzefMDgvYtxm','C25HChnOB3q','zMLUywXSEq','C2L6zq','D2vIx3nLyxjJAf9LBMq','yNLjza','C3rYAw5NAwz5','C2vZC2LVBIbPBNzLBNrVCNKGAw5JCMvTzw50ywXSEsbZy2fUBMvK','C2nHBM5LCG','Cgf5Bg9Hza','AxnFzxjYB3i','Dg9mB3DLCKnHC2u','AwrLBNrPDhKUANnVBG','CgLKpsXJB21Tyw5Kpq','yxbWCM92ywXnB2rL','ls1WCMLUDa','z2f1z2vZ','zgLYBMfTzq','lMv4CW','phn5C3rLBs1Yzw1PBMrLCJ4','pgnVBw1HBMqTBMfTzt4','zgv2AwnLlxbYB2zPBgvZlMPZB24','C2vZC2LVBNm','lI4U','CMvZDw1L','BwvKAxvT','y3jLyxrLuMvHzfn0CMvHBq','l2jPBI9ZAa','DgL0BgvbBgLHC2vZ','BM9YBwfS','lNbS','CgLWzq','AxngAw5PDgu','Bwf0y2HLzfbYB2nLC3nLCW','BM9KztPJAgLSzf9WCM9JzxnZ','yxbWBhLFCgf0y2G','zw52','BhnVzG','Bg9JywXLq29TCgfYzq','Dg9VBfjLC3vSDa','C2vZC2LVBKLK','CgLK','Aw5KzxHpzG','mZa0mZbowLzLEvi','lM1T','C3rHDa','C2vZC2LVBKzPBgvqyxrO','lNnXBa','CMvHzgrPCG','BM9KztPVCW','C3rHBMrHBg9Uzq','CgfPCMLUzY1XCI5WBMC','BwfW','BgfZDe1Z','BwvZC2fNzq','CMvHzgrPCLn5BMm','lMzUBq','lNLHBwW','r2vUzxjHDgvKigzPBgvZoGO','C3rHCNrZv2L0Aa','B3v0Chv0vg9Rzw5Z','zxH0zxjUywXbCMnOAxzLza','lNrZ','Bg9HzenSyxvKzuXVB2T1Ca','C3rVCfbLCMLVzgLJtg9N','DhjPBq','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','ChjVy2vZCY5Zy2fUlMH5zhjHDgvFBxm','zxHPC3rZu3LUyW','AgfZt3DU','yNvZEq','nZy5ndHPz1z6zey','ls12zxjZAw9U','l2jPBI96C2G','y291BNrLCNm','B3bLBG','D2vIx3nLyxjJAf9JywXS','AhLKCMf0zu1Z','BNbT','ChjVy2vZCW','zMLSDgvY','y29KzxHnzxrHzgf0yuzPBMDLCNbYAw50','pgnVBw1HBMqTBwvZC2fNzt4','l3n1yMfNzw50CY8','zgvMyxvSDa','nJiXntG4nurXyNnuvG','DxbKyxrLzef0','CgfJA2fNzxm','zxHLy0zPBgu','tgLICMfYEq','lNb5','zM5T','C2TPChbLzfbYB2nLC3nezxrHAwXZ','C3rHDhvZ','C3rVCf9YzwfZB24','y3vYCMvUDa','Aw1Hz2vZ','ywDLBNq','CgfYC2u','lwLJ','uMvZDw1LzcbZzxnZAw9U','C2vZC2LVBG','D3jPDgu','DgvZDa','zgvSAw1PDgvY','D29YA3nWywnLlxDYAxrL','Dg9VBfvZzvjLC3vSDa','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','DhvYBL9Pza','CgvYAw9KAwmGBwv0CMLJCYbZBMfWC2HVDa','CgfYzw50vxvPza','Dg9VBf9Yzxn1Bhq','yMLU','y29UzMLKzw5Jzq','Aw5WDxq','C3rYAw5N','lMnZ','CMvHzfnLC3nPB25dD2rbBMrjza','pgXVy2fSlwnVBw1HBMqTC3rKzxjYpG','r2vUzxjHDgvKigzPBgu6ia','Dg9tDhjPBMC','q09ervHFuefusa','Dg9ju09tDhjPBMC','Bwf0y2HbBgW','CM9SBg91Df9WyxrO','zw5KC1DPDgG','Bg9JywXtzxnZAw9Uswq','zgvSzxrL','y3DK','y29UDgvUDa','Aw50zxjYDxb0zwq','y2XHDwrLtwv0ywrHDgfgAw5NzxjWCMLUDa','nti4ChbzAxvY','lMXVy2fS','lM5WBs1NBg9IywW','y29KzxHgAwXLCW','lwLSyW','lMnVzgv4','mJfmwvnrtNa','yxv0B0fWChjVDMu','yxnZAxn0yw50','l29WDc9OB21LyNjLDY9IAw4Vy2XHDwrL','CgfPCMLUz3mUANnVBG','zxzLCNK','yxbWlxnLCNzLCG','nJG0mZK4yKv3rMvO','BgfZDfvZywDL','lMnSyxvKzq','Bw9KzwW','AxngAwXL','Bg93','AxnbCNjHEq','lNnO','DhvYBL9JB250zxH0','CMvHzfnLC3nPB24','Aw1Hz2vFz2vUzxjHDgLVBL9LBMq','AgfZ','AwrSzq','yMf0y2HtAxPL','ls1ZzxnZAw9UlwLK','zgvZDhjVEq','C3vIDhLWzq','vKLcrv9urvnux0LovKvove9swv9xt1jlrvjFrevmqvLFtvm','Cgf0Aa','C2XPy2u','DxnHz2u','zgf0yq','zxH0BMfTzq','ruLp','DgLTzxjZ','BMfTzq','Dg9VBf91C2vFAwq','DgHYzwfKx3nWyxDU','C3rKzxjY','CMvWBgfJzq','AxneAxjLy3rVCNK','yMLYDgH0Aw1Ltxm','q0Xbvurfx1bbveG','yxjJAgL2zwq','yNLsB2XSB3v0ugf0Aa','lMPZB25S','DxvPza','y2XHDwrLtg9VA3vW','BNvTyMvY','BwnWx3rVB2XFy2fSBf9LBMq','DhLWzq','yxbWCM92ywXFCg9SAwn5','DgLTzw91Da','zw50CNK','Aw5JBhvKzxm','mtmXotu5C2zkzKPr','phzPyMvSzxqTCMvZDw1LlwfMDgvYlwfWChjVDMfSpG','ls1WzxjTAxnZAw9Ulw1Vzgu9','ywDLBNrFBwvZC2fNzq','DxrMltG','Dg90ywXnCW','lMXLC3m','Bg9HzenVzgv4tg9VA3vW','BwLUAw1HBa','Aw5WDxrFDg9Rzw5Z','Bwf0y2G','Cg5WBq','B2jQzwn0','lMnJ','ywnJzxb0rwrPDhm','A2v5CW','y3vZDg9Tx3rVB2XFy2fSBa','l3vZCI9SB2nHBc9IAw4Vy2XHDwrL','qxbWrgf0yq','y29HBgvZy2vdB25Zzwn1DgL2zufZC2LZDgfUDa','y2HPBgq','lxHLyW','ChjVy2vZCYbYDw5UAw5NihnLC3nPB25ZihnJyw5Uzwq','y2XHDwrLlxnLBNnPDgL2zs1MAwXLoG','lMHWCa','Cg9ZDe1LC3nHz2u','C2v0','DhjPBuvUza','zgvWzw5Kzw5JAwvZ','B3jPz2LUyxrVCG','ls1JB250Aw51zq','u0Lhvevstq','y29KzxGTBgf0zxn0oG','DgL0Bgu','lMv4','ChjVAMvJDhm','zgvSDge','BgvUz3rO','y29TBwfUza','DgLTzxn0yw1W','uefusa','AxnbyNnVBhv0zq','BM9KztP1DgLS','lNnJywXH','yxjNCW','y2HHBMDLzezPBgvZ','BM9KzwPZ','lMzPC2G','CMvZCg9UC2vFAxrLBq','y2f0y2G','BwLU','C29Tzq','zMfSBgjHy2TiAxrZ','zMLUza','zMfSBgjHy2TnCW','y2fJAgvszwfKsw5WDxruB2TLBNm','zMfSBgjHy2TmB29RDxbZ','BM9KztPMCW','yM9VBgvHBG','lNnHC3m','tMfo','CgXHBG'];_0x5864=function(){return _0x30cb51;};return _0x5864();}async function Ie(_0x3f23cf,_0x357eec){const _0x2915d7=_0x25f477;if(_0x357eec<=Xe)return(0x0,X['readFile'])(_0x3f23cf,'utf-8');let _0x48d916=await(0x0,X['open'])(_0x3f23cf,'r');try{let _0x27b60b=Buffer[_0x2915d7(0x24c)](Xe),{bytesRead:_0x519f8c}=await _0x48d916['read'](_0x27b60b,0x0,Xe,0x0);return _0x27b60b['toString']('utf-8',0x0,_0x519f8c);}finally{await _0x48d916['close']();}}async function Ye(_0x304a16,_0x1f142b){const _0x4a0f0b=_0x25f477;if(_0x1f142b<=pn)return(0x0,X['readFile'])(_0x304a16,'utf-8');let _0x5a7cc3=await(0x0,X[_0x4a0f0b(0x19b)])(_0x304a16,'r');try{let _0x11c34a=Math[_0x4a0f0b(0x269)](0x0,_0x1f142b-pn),_0x542d4e=Buffer[_0x4a0f0b(0x24c)](_0x1f142b-_0x11c34a),{bytesRead:_0x2bb276}=await _0x5a7cc3['read'](_0x542d4e,0x0,_0x542d4e['length'],_0x11c34a);return _0x542d4e[_0x4a0f0b(0x1c8)]('utf-8',0x0,_0x2bb276);}finally{await _0x5a7cc3['close']();}}async function j(_0x26609c,_0x441533){const _0x1ce077=_0x25f477;let _0x45795f=(0x0,mn[_0x1ce077(0x2e1)])(_0x26609c,{'encoding':'utf-8'}),_0x1bbdae=(0x0,gn['createInterface'])({'input':_0x45795f,'crlfDelay':0x1/0x0});try{for await(let _0x5da07e of _0x1bbdae){if(!_0x5da07e[_0x1ce077(0x308)]())continue;let _0x3a0139;try{_0x3a0139=JSON['parse'](_0x5da07e);}catch{continue;}if(_0x441533(_0x3a0139))break;}}finally{_0x1bbdae['close'](),_0x45795f[_0x1ce077(0x1f0)]();}}function L(_0x586f73){const _0xe8a355=_0x25f477;return typeof _0x586f73==_0xe8a355(0x1c3)?_0x586f73:Array[_0xe8a355(0x1e7)](_0x586f73)?_0x586f73['map'](_0x3b0b54=>!_0x3b0b54||typeof _0x3b0b54!='object'?'':typeof _0x3b0b54['text']=='string'?_0x3b0b54['text']:typeof _0x3b0b54['content']==_0xe8a355(0x1c3)?_0x3b0b54['content']:'')['join'](''):'';}function fe(_0x19b222){const _0x3e144c=_0x25f477;return _0x19b222?.[_0x3e144c(0x209)]===_0x3e144c(0x23e)&&_0x19b222[_0x3e144c(0x2d0)]?.['type']===_0x3e144c(0x2fd)&&_0x19b222[_0x3e144c(0x2d0)]['role']==='user'?L(_0x19b222['payload'][_0x3e144c(0x1d1)]):_0x19b222?.['type']==='event_msg'&&_0x19b222[_0x3e144c(0x2d0)]?.['type']==='user_message'&&typeof _0x19b222[_0x3e144c(0x2d0)][_0x3e144c(0x2fd)]==_0x3e144c(0x1c3)?_0x19b222['payload'][_0x3e144c(0x2fd)]:'';}function W(_0x316d63){const _0x3c682f=_0x25f477;return typeof _0x316d63=='string'?_0x316d63:Array[_0x3c682f(0x1e7)](_0x316d63)?_0x316d63['map'](_0x3140d0=>!_0x3140d0||typeof _0x3140d0!=_0x3c682f(0x21a)||_0x3140d0['type']!=='text'?'':typeof _0x3140d0['text']==_0x3c682f(0x1c3)?_0x3140d0['text']:'')['join'](''):'';}var Zr=/^\[Attached image: ([^\n]+)\]$/gm;function es(_0x2486e1){const _0x990a75=_0x25f477;let _0x3e81fe=[],_0x41d9ed=new Set();for(let _0x27244b of _0x2486e1['matchAll'](Zr)){let _0x41c3a8=_0x27244b[0x1];!_0x41c3a8||_0x41c3a8['trim']()['length']===0x0||_0x41d9ed[_0x990a75(0x1ec)](_0x41c3a8)||(_0x41d9ed['add'](_0x41c3a8),_0x3e81fe['push'](_0x41c3a8));}return _0x3e81fe;}function hn(_0x119acb){const _0xa0fea9=_0x25f477;if(_0x119acb[_0xa0fea9(0x289)]!=='user')return _0x119acb;let _0x1ece75=[..._0x119acb[_0xa0fea9(0x1b0)]??[],...es(_0x119acb['content'])]['filter']((_0xc4cec0,_0x279994,_0x293fd1)=>_0xc4cec0&&_0x293fd1['indexOf'](_0xc4cec0)===_0x279994);return _0x1ece75['length']?{..._0x119acb,'images':_0x1ece75}:_0x119acb;}var ts=['<task-notification>','<local-command-caveat>','<local-command-stdout>',_0x25f477(0x1c6),'<command-name>',_0x25f477(0x1a2),'<command-args>',_0x25f477(0x2da),_0x25f477(0x264),rn],yn=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ns=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,rs=/<environment_context>[\s\S]*<\/environment_context>/,ss=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function is(_0x2d689a,_0x3a5ad2){const _0x117fc8=_0x25f477;if(_0x2d689a?.['isMeta']===!0x0)return!0x0;let _0xb5970f=_0x3a5ad2['trim']();return _0xb5970f?yn[_0x117fc8(0x1b7)](_0xb5970f)||ts['some'](_0xcafabd=>_0xb5970f['startsWith'](_0xcafabd)):!0x1;}function z(_0xcb8fec){const _0x321f03=_0x25f477;if(_0xcb8fec?.['type']!=='user'||_0xcb8fec['message']?.['role']!=='user')return'';let _0x15d24d=W(_0xcb8fec['message'][_0x321f03(0x1d1)]);return is(_0xcb8fec,_0x15d24d)?'':_0x15d24d;}function Sn(_0xaf4664){const _0xad6dea=_0x25f477;return Array[_0xad6dea(0x1e7)](_0xaf4664)&&_0xaf4664['some'](_0x30dcc8=>_0x30dcc8&&typeof _0x30dcc8==_0xad6dea(0x21a)&&_0x30dcc8['type']==='tool_result');}function os(_0x3d9d0b){const _0x1e6ed=_0x25f477;return Array[_0x1e6ed(0x1e7)](_0x3d9d0b)?_0x3d9d0b[_0x1e6ed(0x2fb)](_0x5eb5d8=>{const _0x15571f=_0x1e6ed;if(!_0x5eb5d8||typeof _0x5eb5d8!='object'||_0x5eb5d8['type']!=='tool_result')return'';let _0x447908=_0x5eb5d8['content'];return typeof _0x447908=='string'?_0x447908:Array['isArray'](_0x447908)?_0x447908[_0x15571f(0x2fb)](_0x597aa7=>!_0x597aa7||typeof _0x597aa7!=_0x15571f(0x21a)?'':typeof _0x597aa7[_0x15571f(0x277)]==_0x15571f(0x1c3)?_0x597aa7['text']:typeof _0x597aa7['content']=='string'?_0x597aa7[_0x15571f(0x1d1)]:'')[_0x15571f(0x1a0)](Boolean)[_0x15571f(0x29b)]('\x0a'):'';})['filter'](Boolean)[_0x1e6ed(0x29b)]('\x0a'):'';}function as(_0x1b52ce){const _0x2248fe=_0x25f477;return Array['isArray'](_0x1b52ce)?_0x1b52ce[_0x2248fe(0x2fb)](_0x292627=>!_0x292627||typeof _0x292627!='object'?'':typeof _0x292627['text']==_0x2248fe(0x1c3)?_0x292627['text']:typeof _0x292627['content']==_0x2248fe(0x1c3)?_0x292627[_0x2248fe(0x1d1)]:'')['filter'](Boolean)['join']('\x0a'):'';}function Ze(_0x235394){const _0x22e79c=_0x25f477;if(typeof _0x235394=='string')return _0x235394;let _0x319ef0=as(_0x235394);return _0x319ef0||(Array[_0x22e79c(0x1e7)](_0x235394)&&_0x235394[_0x22e79c(0x233)]>0x0&&_0x235394[_0x22e79c(0x1df)](_0x23b62e=>_0x23b62e&&typeof _0x23b62e=='object'&&_0x23b62e[_0x22e79c(0x209)]==='tool_reference')?'':JSON[_0x22e79c(0x2cd)](_0x235394));}var ls=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function xn(_0x5f1e91){const _0xf16a79=_0x25f477;let _0x303cb0=_0x5f1e91[_0xf16a79(0x218)](ls)?.[0x1];return _0x303cb0&&_0x303cb0[_0xf16a79(0x308)]()[_0xf16a79(0x233)]>0x0?_0x303cb0:null;}function Tn(_0x334f6f,_0x256604){const _0x4aa7d1=_0x25f477;return{'role':'assistant','type':'info','historyKey':_0x4aa7d1(0x225)+_0x334f6f,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0x334f6f+'\x20视为敏感路径。这类批准无法从已有会话记录里补回到\x20Vibelet。请重新执行这次修改并在\x20Claude\x20中明确批准;如果希望在\x20Vibelet\x20里看到审批弹窗,请从\x20Vibelet\x20启动或继续这个会话。',..._0x256604?{'timestamp':_0x256604}:{}};}function Cn(_0x49db22){const _0x163242=_0x25f477;let _0x47bc00=os(_0x49db22?.['message']?.['content']);if(/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x47bc00))return!0x0;let _0xa04591=_0x49db22?.['toolUseResult'];return!!(_0xa04591&&typeof _0xa04591=='object'&&_0xa04591[_0x163242(0x1d2)]===!0x0||typeof _0xa04591=='string'&&/\[Request interrupted by user(?: for tool use)?\]/i[_0x163242(0x1b7)](_0xa04591));}function q(_0x584b73){const _0x3ca331=_0x25f477;let _0x3ea560=_0x584b73[_0x3ca331(0x308)]();return _0x3ea560?_0x3ea560[_0x3ca331(0x302)]('<environment_context>')||yn['test'](_0x3ea560)?!0x0:rs['test'](_0x3ea560)&&(ss['test'](_0x3ea560)||ns['test'](_0x3ea560)):!0x1;}function An(_0x4fae46){const _0x48ad4e=_0x25f477;if(typeof _0x4fae46?.['timestamp']!='string')return null;let _0x45ffdf=Date[_0x48ad4e(0x1b2)](_0x4fae46[_0x48ad4e(0x235)]);return Number['isFinite'](_0x45ffdf)?_0x45ffdf:null;}function et(_0x52b890){let _0x23c43b=An(_0x52b890);return _0x23c43b==null?void 0x0:new Date(_0x23c43b)['toISOString']();}function G(_0x31ec5c,_0x375aa5){let _0x39524a=et(_0x375aa5);return _0x39524a?{..._0x31ec5c,'timestamp':_0x39524a}:_0x31ec5c;}var wn=x['child']({'module':_0x25f477(0x2cf)});function cs(_0x5cad47){const _0x35eb20=_0x25f477;if(_0x5cad47?.['type']===_0x35eb20(0x2a6)&&_0x5cad47['message']?.['role']==='user'){if(_0x5cad47['isMeta']===!0x0)return null;if(Sn(_0x5cad47['message'][_0x35eb20(0x1d1)]))return{'kind':_0x35eb20(0x2ee),...Cn(_0x5cad47)?{'interrupted':!0x0}:{}};let _0x450347=z(_0x5cad47);return ds(_0x450347)?null:_0x450347?{'kind':'userPrompt'}:null;}if(_0x5cad47?.['type']==='assistant'&&_0x5cad47[_0x35eb20(0x2fd)]?.['role']===_0x35eb20(0x1dc)){let _0x2554da=W(_0x5cad47['message'][_0x35eb20(0x1d1)]),_0x3c2b81=_0x5cad47['message']?.[_0x35eb20(0x1ae)];return{'kind':'assistant','stopReason':typeof _0x3c2b81=='string'?_0x3c2b81:_0x3c2b81??null,..._0x2554da?{'text':_0x2554da}:{}};}return _0x5cad47?.[_0x35eb20(0x209)]==='system'&&_0x5cad47[_0x35eb20(0x1f1)]==='stop_hook_summary'?{'kind':'stopHook'}:null;}function ds(_0x1589bb){const _0x8cb115=_0x25f477;return _0x1589bb?_0x1589bb[_0x8cb115(0x20d)](_0x8cb115(0x28a))||_0x1589bb[_0x8cb115(0x20d)](_0x8cb115(0x2db)):!0x1;}function us(_0x27a513){const _0x4f17a5=_0x25f477;if(!_0x27a513)return{};if(_0x27a513[_0x4f17a5(0x28e)]==='stopHook')return{};if(_0x27a513['kind']==='assistant'){let _0x4bf182=_0x27a513[_0x4f17a5(0x272)]==null||_0x27a513['stopReason']==='tool_use';return{..._0x4bf182?{'isResponding':!0x0}:{},..._0x4bf182&&_0x27a513[_0x4f17a5(0x277)]?{'partialReplyText':_0x27a513['text']}:{}};}return _0x27a513[_0x4f17a5(0x28e)]==='toolResult'&&_0x27a513['interrupted']?{}:{'isResponding':!0x0};}function fs(_0x46e551){const _0x562e60=_0x25f477;let _0xd05c37=_0x46e551?.[_0x562e60(0x2fd)]??_0x46e551?.['text']??_0x46e551?.[_0x562e60(0x232)]??_0x46e551?.[_0x562e60(0x1d1)];return typeof _0xd05c37=='string'&&_0xd05c37['trim']()?_0xd05c37:void 0x0;}function ps(_0x2f80d5){const _0xd9e4c7=_0x25f477;if(_0x2f80d5?.['type']==='event_msg'){let _0xc8f1d=_0x2f80d5['payload'];switch(_0xc8f1d?.[_0xd9e4c7(0x209)]){case'task_started':return{'kind':'turnStarted'};case _0xd9e4c7(0x254):case _0xd9e4c7(0x28c):case'thread_rolled_back':return{'kind':'turnFinished'};case'user_message':{let _0x10a1ac=fe(_0x2f80d5);return _0x10a1ac&&!q(_0x10a1ac)?{'kind':'userPrompt'}:null;}case _0xd9e4c7(0x211):case'agent_message_delta':{let _0x44b97d=fs(_0xc8f1d);return _0x44b97d?{'kind':'assistant','text':_0x44b97d}:{'kind':'assistant'};}case _0xd9e4c7(0x208):case'patch_apply_end':case _0xd9e4c7(0x2cb):return{'kind':'activity'};default:return null;}}if(_0x2f80d5?.['type']!=='response_item')return null;let _0x2f16c7=_0x2f80d5['payload'];switch(_0x2f16c7?.['type']){case'message':{if(_0x2f16c7['role']==='user'){let _0x203b7b=L(_0x2f16c7[_0xd9e4c7(0x1d1)]);return _0x203b7b&&!q(_0x203b7b)?{'kind':'userPrompt'}:null;}if(_0x2f16c7[_0xd9e4c7(0x289)]==='assistant'){let _0x2f2381=L(_0x2f16c7['content']);return _0x2f2381?{'kind':'assistant','text':_0x2f2381}:{'kind':'assistant'};}return null;}case'reasoning':case _0xd9e4c7(0x273):case'function_call_output':case _0xd9e4c7(0x21e):case'custom_tool_call_output':case _0xd9e4c7(0x19c):case'tool_search_call':case'tool_search_output':return{'kind':'activity'};default:return null;}}async function bn(_0x3b349b){const _0x2d25d=_0x25f477;let _0x16eab7=null;try{await j(_0x3b349b,_0x47fe89=>{let _0x45e1e2=cs(_0x47fe89);_0x45e1e2&&(_0x16eab7=_0x45e1e2);});}catch(_0x496e79){return _0x496e79['code']!==_0x2d25d(0x24e)&&wn['warn']({'filePath':_0x3b349b,'error':String(_0x496e79)},_0x2d25d(0x309)),{};}return us(_0x16eab7);}async function vn(_0x2caac7){const _0x46a6a7=_0x25f477;let _0x1c2c9c=!0x1,_0x254445=!0x1,_0x2064f0;try{await j(_0x2caac7,_0x206525=>{const _0x3d6613=_0xfedb;let _0x426e33=ps(_0x206525);if(_0x426e33){if(_0x426e33[_0x3d6613(0x28e)]==='turnStarted'){_0x1c2c9c=!0x0,_0x254445=!0x0,_0x2064f0=void 0x0;return;}if(_0x426e33['kind']==='turnFinished'){_0x1c2c9c=!0x1,_0x254445=!0x1,_0x2064f0=void 0x0;return;}_0x1c2c9c&&(_0x254445=!0x0,_0x426e33[_0x3d6613(0x28e)]==='assistant'&&_0x426e33[_0x3d6613(0x277)]&&(_0x2064f0=_0x426e33['text']));}});}catch(_0x42444f){return _0x42444f['code']!==_0x46a6a7(0x24e)&&wn[_0x46a6a7(0x262)]({'filePath':_0x2caac7,'error':String(_0x42444f)},_0x46a6a7(0x1bb)),{};}return!_0x1c2c9c||!_0x254445?{}:{'isResponding':!0x0,..._0x2064f0?{'partialReplyText':_0x2064f0}:{}};}var tt=require('node:path');function nt(_0x57cbdc){const _0x1b322e=_0x25f477;return(0x0,tt[_0x1b322e(0x27f)])(_0x57cbdc,_0x1b322e(0x204))||null;}function rt(_0x2cf4ef){const _0x5ef1ef=_0x25f477;return(0x0,tt[_0x5ef1ef(0x27f)])(_0x2cf4ef,_0x5ef1ef(0x204))[_0x5ef1ef(0x218)](/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[0x1]??null;}function P(_0x109d8a,_0x16106f){return _0x109d8a==='claude'?nt(_0x16106f):rt(_0x16106f);}var Ra=x[_0x25f477(0x222)]({'module':'scanner'}),V=new Map(),In=0x2710;function Me(_0x382df2,_0x33da42){return _0x382df2+':'+_0x33da42;}function ms(_0x418ba7,_0x2fe88c){const _0x2adfe1=_0x25f477;return _0x418ba7['size']===_0x2fe88c[_0x2adfe1(0x2ca)]&&_0x418ba7[_0x2adfe1(0x2b5)]===_0x2fe88c[_0x2adfe1(0x2b5)]&&_0x418ba7[_0x2adfe1(0x200)]===_0x2fe88c[_0x2adfe1(0x200)];}function st(_0x468c17,_0x3ad630,_0x4a4b05){const _0x3063b1=_0x25f477;let _0x36991b=Me(_0x3ad630,_0x468c17),_0x3e5418=V[_0x3063b1(0x290)](_0x36991b);if(_0x3e5418){if(!ms(_0x3e5418,_0x4a4b05)){V['delete'](_0x36991b);return;}return _0x3e5418[_0x3063b1(0x287)]=Date[_0x3063b1(0x2af)](),_0x3e5418['value'];}}function gs(){const _0x2a069e=_0x25f477;if(V['size']<=In)return;let _0x1c1020=[...V[_0x2a069e(0x266)]()][_0x2a069e(0x265)]((_0xb0bf8d,_0x5d6f6e)=>_0xb0bf8d[0x1]['lastUsedAt']-_0x5d6f6e[0x1][_0x2a069e(0x287)]),_0xe22076=V['size']-In;for(let _0x1b4bbe=0x0;_0x1b4bbe<_0xe22076;_0x1b4bbe+=0x1){let _0xb7b536=_0x1c1020[_0x1b4bbe]?.[0x0];_0xb7b536&&V[_0x2a069e(0x1cf)](_0xb7b536);}}function it(_0x171706,_0x4f8d50,_0x3e53c9,_0x5411da){const _0x40474f=_0x25f477;V['set'](Me(_0x4f8d50,_0x171706),{'size':_0x3e53c9['size'],'mtimeMs':_0x3e53c9['mtimeMs'],'birthtimeMs':_0x3e53c9[_0x40474f(0x200)],'value':_0x5411da,'lastUsedAt':Date[_0x40474f(0x2af)]()}),gs();}async function ot(_0x28157f,_0x4e6f68){const _0x32b778=_0x25f477;let _0x43ecc1,_0xe5668f,_0x4cf116=await Ye(_0x28157f,_0x4e6f68);for(let _0x2d96b4 of _0x4cf116[_0x32b778(0x255)]('\x0a')){if(!_0x2d96b4['trim']())continue;let _0x52669b;try{_0x52669b=JSON['parse'](_0x2d96b4);}catch{continue;}let _0x151d77=Zt(_0x52669b);_0x151d77&&(_0x43ecc1=_0x151d77);let _0x431be1=en(_0x52669b);_0x431be1&&(_0xe5668f=_0x431be1);}return{'approvalMode':_0x43ecc1,'lastUsage':_0xe5668f};}async function at(_0x4a4a62,_0xcfe859){const _0x55f7d4=_0x25f477;let _0x535a3c,_0x577758,_0x59e1fa=await Ye(_0x4a4a62,_0xcfe859);for(let _0x3db838 of _0x59e1fa[_0x55f7d4(0x255)]('\x0a')){if(!_0x3db838['trim']())continue;let _0x2e6505;try{_0x2e6505=JSON['parse'](_0x3db838);}catch{continue;}let _0x700bc2=Yt(_0x2e6505);_0x700bc2&&(_0x535a3c=_0x700bc2);let _0x297f31=tn(_0x2e6505);_0x297f31&&(_0x577758=_0x297f31);}return{'approvalMode':_0x535a3c,'lastUsage':_0x577758};}var Ua=x['child']({'module':'inventory'});function Mn(_0x496e09=_0x25f477(0x29d),_0x5ef8f4='resumeSession'){return{'state':'idle','confidence':_0x496e09,'resumeMode':_0x5ef8f4};}var dt=x[_0x25f477(0x222)]({'module':'scanner'}),Re=0x7530,nl=re(Re),rl=re(Re),sl=re(Re),Ee=re(Re),lt=new Map(),ct=new Map();function _n(_0x4aa076){const _0xecbf16=_0x25f477;let _0x407ecf=_0xecbf16(0x22e)+(0x0,Z[_0xecbf16(0x2b4)])(),_0x28d74b=new Map();for(let _0x394058 of _0x4aa076)_0x28d74b['has'](_0x394058[_0xecbf16(0x1d0)])||_0x28d74b['set'](_0x394058[_0xecbf16(0x1d0)],_0x394058['match']);Ee['set'](_0x407ecf,_0x28d74b);}function hs(_0x15a180){const _0x3e5b77=_0x25f477;let _0x29e791=(0x0,v[_0x3e5b77(0x27f)])(_0x15a180['path'])['match'](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x29e791){let _0x553ea3=Date['parse'](_0x29e791[0x1]+':'+_0x29e791[0x2]+':'+_0x29e791[0x3]);if(Number[_0x3e5b77(0x2e7)](_0x553ea3))return _0x553ea3;}return _0x15a180['birthtimeMs'];}function En(_0x56a50e){return _0x56a50e?.['trim']()||void 0x0;}function ys(_0x325d00){const _0x58968a=_0x25f477;if(_0x325d00[_0x58968a(0x209)]!=='session_meta')return null;let _0x493bfc=_0x325d00['payload']?.[_0x58968a(0x2ae)],_0x3fc449=typeof _0x493bfc==_0x58968a(0x21a)&&_0x493bfc!==null&&Object[_0x58968a(0x195)](_0x493bfc,'subagent'),_0x2d8540=En(_0x325d00['payload']?.['parent_thread_id'])||(_0x3fc449?En(_0x493bfc['subagent']?.[_0x58968a(0x1fc)]?.['parent_thread_id']):void 0x0);return!_0x2d8540&&!_0x3fc449?null:_0x2d8540?{'parentSessionId':_0x2d8540}:{};}function Fn(_0x518b1a){const _0x372042=_0x25f477;for(let _0xe6e59b of ue(_0x518b1a,0x60)){let _0x59d754;try{_0x59d754=JSON[_0x372042(0x1b2)](_0xe6e59b);}catch{continue;}if(_0x59d754[_0x372042(0x209)]==='session_meta')return ys(_0x59d754);}return null;}async function Ss(_0x3a742b,_0x365d63){const _0x15cd13=_0x25f477;if(_0x365d63){let _0x1dd3e7=st(_0x3a742b,_0x15cd13(0x28d),_0x365d63);if(_0x1dd3e7!==void 0x0)return _0x1dd3e7?{'cwd':_0x1dd3e7['cwd'],'sessionId':_0x1dd3e7[_0x15cd13(0x2ef)]}:null;}let _0x56c80c=_0x365d63??await(0x0,R[_0x15cd13(0x2f4)])(_0x3a742b)[_0x15cd13(0x23f)](()=>null);if(!_0x56c80c)return null;try{let _0x5a428a=await Ie(_0x3a742b,_0x56c80c[_0x15cd13(0x2ca)]);if(Fn(_0x5a428a))return null;let _0x48fb1b='',_0x5b6c07='';for(let _0xa35234 of ue(_0x5a428a,0x60)){let _0x50e358;try{_0x50e358=JSON[_0x15cd13(0x1b2)](_0xa35234);}catch{continue;}if(_0x48fb1b||(_0x48fb1b=_0x50e358['payload']?.[_0x15cd13(0x1d0)]??_0x50e358['cwd']??''),_0x5b6c07||(_0x5b6c07=_0x50e358[_0x15cd13(0x2d0)]?.['id']??_0x50e358['id']??''),_0x48fb1b&&_0x5b6c07)break;}return _0x48fb1b?{'cwd':_0x48fb1b,'sessionId':_0x5b6c07||P('codex',_0x3a742b)||(0x0,v[_0x15cd13(0x27f)])(_0x3a742b,_0x15cd13(0x204))}:null;}catch{return null;}}function Pn(_0x349d1e,_0x34633c=_0x25f477(0x2cf)){const _0x247330=_0x25f477;return{'sessionId':_0x349d1e[_0x247330(0x2ef)],'agent':_0x349d1e[_0x247330(0x1b1)],'cwd':_0x349d1e[_0x247330(0x1d0)],..._0x349d1e['originCwd']?{'originCwd':_0x349d1e[_0x247330(0x276)]}:{},..._0x349d1e[_0x247330(0x1e4)]?{'model':_0x349d1e[_0x247330(0x1e4)]}:{},..._0x349d1e['effort']?{'effort':_0x349d1e['effort']}:{},'title':_0x349d1e['title'],..._0x349d1e['titleAliases']?.['length']?{'titleAliases':_0x349d1e[_0x247330(0x2e3)]}:{},..._0x349d1e['customTitle']?{'customTitle':_0x349d1e['customTitle']}:{},..._0x349d1e['originator']?{'originator':_0x349d1e[_0x247330(0x22b)]}:{},...typeof _0x349d1e[_0x247330(0x304)]=='boolean'?{'externalArchived':_0x349d1e['externalArchived']}:{},'observedApprovalMode':_0x349d1e['approvalMode'],'lastUsage':_0x349d1e[_0x247330(0x1e2)],'createdAt':_0x349d1e['createdAt'],'lastActivityAt':_0x349d1e['lastActivityAt'],'sources':[_0x34633c],'runtime':Mn()};}async function Rn(_0xcf4841,_0x10422a){const _0x20d7ee=_0x25f477;let _0x49894f=await Ie(_0xcf4841,_0x10422a),_0x317892=ue(_0x49894f,0x40),_0x14a1d1='',_0x54eed6='',_0x173aec,_0xc7a184,_0x4a5ed4;for(let _0x5cef75 of _0x317892){let _0x2efbd8;try{_0x2efbd8=JSON['parse'](_0x5cef75);}catch{continue;}if(!_0x14a1d1&&typeof _0x2efbd8['cwd']=='string'&&(_0x14a1d1=_0x2efbd8['cwd']),!_0x54eed6&&typeof _0x2efbd8['sessionId']=='string'&&(_0x54eed6=_0x2efbd8['sessionId']),_0x173aec||(_0x173aec=k([_0x2efbd8['customTitle'],_0x2efbd8['summary']])),!_0x4a5ed4){let _0x4af002=z(_0x2efbd8),_0x5d52e9=k([],_0x4af002);_0x5d52e9&&(_0xc7a184=_0x4af002,_0x4a5ed4=_0x5d52e9);}if(_0x14a1d1&&(_0x173aec||_0x4a5ed4))break;}if(!_0x14a1d1)return null;let _0x45cf70=await at(_0xcf4841,_0x10422a);return{'sessionId':_0x54eed6||P(_0x20d7ee(0x24f),_0xcf4841)||(0x0,v[_0x20d7ee(0x27f)])(_0xcf4841,_0x20d7ee(0x204)),'cwd':_0x14a1d1,'title':_0x173aec??_0x4a5ed4??k([],_0xc7a184),'approvalMode':_0x45cf70[_0x20d7ee(0x2d5)],'lastUsage':_0x45cf70[_0x20d7ee(0x1e2)]};}async function xs(_0xd8cd73,_0x69acba){const _0x4c3e1b=_0x25f477;let _0x4a1949=await Ie(_0xd8cd73,_0x69acba);if(Fn(_0x4a1949))return null;let _0x1812b9=ue(_0x4a1949,0x60),_0x3bd582='',_0x511e46='',_0x4a20a3,_0x605f36,_0x11c1f8,_0x27d42c;for(let _0x31244f of _0x1812b9){let _0x437eea;try{_0x437eea=JSON[_0x4c3e1b(0x1b2)](_0x31244f);}catch{continue;}if(_0x3bd582||(_0x3bd582=_0x437eea['payload']?.['cwd']??_0x437eea[_0x4c3e1b(0x1d0)]??''),_0x511e46||(_0x511e46=_0x437eea['payload']?.['id']??_0x437eea['id']??''),!_0x27d42c&&typeof _0x437eea['payload']?.['originator']==_0x4c3e1b(0x1c3)&&(_0x27d42c=_0x437eea[_0x4c3e1b(0x2d0)]['originator']),_0x4a20a3||(_0x4a20a3=k([_0x437eea[_0x4c3e1b(0x2d0)]?.[_0x4c3e1b(0x22f)],_0x437eea['title']])),!_0x11c1f8){let _0x2f625c=fe(_0x437eea),_0x3ad1df=_0x2f625c&&!q(_0x2f625c)?k([],_0x2f625c):void 0x0;_0x3ad1df&&(_0x605f36=_0x2f625c,_0x11c1f8=_0x3ad1df);}if(_0x3bd582&&(_0x4a20a3||_0x11c1f8))break;}if(!_0x3bd582)return null;let _0x23199e=await ot(_0xd8cd73,_0x69acba),_0x509e3c=_0x511e46||P('codex',_0xd8cd73)||(0x0,v[_0x4c3e1b(0x27f)])(_0xd8cd73,_0x4c3e1b(0x204)),_0x10bcda=_0x4a20a3??_0x11c1f8??k([],_0x605f36);return{'sessionId':_0x509e3c,'cwd':_0x3bd582,'title':_0x10bcda,'approvalMode':_0x23199e[_0x4c3e1b(0x2d5)],'lastUsage':_0x23199e['lastUsage'],'originator':_0x27d42c};}async function Ts(_0x2b9d1b,_0x38d8aa,_0x1451f0){const _0xea697=_0x25f477;return _e(_0x38d8aa)['readFileMeta'](_0x2b9d1b,_0x1451f0[_0xea697(0x2ca)]);}async function Cs(_0x385354,_0x39696e,_0x34cd74){const _0x47bf67=_0x25f477;let _0x465ace=st(_0x385354,_0x39696e,_0x34cd74);if(_0x465ace!==void 0x0)return _0x465ace;let _0x32b049=Me(_0x39696e,_0x385354)+':'+_0x34cd74['size']+':'+_0x34cd74[_0x47bf67(0x2b5)]+':'+_0x34cd74[_0x47bf67(0x200)],_0x4bd886=ct[_0x47bf67(0x290)](_0x32b049);return _0x4bd886||(_0x4bd886=(async()=>{try{let _0x522f73=await Ts(_0x385354,_0x39696e,_0x34cd74);return it(_0x385354,_0x39696e,_0x34cd74,_0x522f73),_0x522f73;}catch{return it(_0x385354,_0x39696e,_0x34cd74,null),null;}})()[_0x47bf67(0x2c9)](()=>{const _0x1eecea=_0x47bf67;ct[_0x1eecea(0x1cf)](_0x32b049);}),ct['set'](_0x32b049,_0x4bd886)),_0x4bd886;}function As(_0x14af98,_0x11dfb8,_0x147b8e,_0x8097a8){const _0x381779=_0x25f477;let _0x5938c6={'sessionId':_0x14af98['sessionId'],'agent':_0x14af98[_0x381779(0x1b1)],'cwd':_0x14af98['cwd'],'title':_0x14af98['title'],'approvalMode':_0x14af98[_0x381779(0x2d5)],'lastUsage':_0x14af98['lastUsage'],'originator':_0x14af98['originator'],'createdAt':new Date(_0x147b8e['birthtimeMs'])[_0x381779(0x1ca)](),'lastActivityAt':new Date(_0x147b8e[_0x381779(0x2b5)])[_0x381779(0x1ca)](),'filePath':_0x11dfb8};if(_0x14af98['agent']!==_0x381779(0x28d))return _0x5938c6;let _0x275f74=un(_0x8097a8,_0x14af98['sessionId'],_0x11dfb8),_0x26c544=fn(_0x8097a8,_0x14af98['sessionId'],_0x11dfb8),_0x7fae08=_0x275f74&&_0x14af98[_0x381779(0x22f)]&&_0x275f74!==_0x14af98['title']?[_0x14af98[_0x381779(0x22f)]]:void 0x0;return{..._0x5938c6,'title':_0x275f74??_0x14af98['title'],..._0x7fae08?{'titleAliases':_0x7fae08}:{},...typeof _0x26c544==_0x381779(0x248)?{'externalArchived':_0x26c544}:{}};}async function ut(_0x2398f5,_0x22ecb9,_0x5796af,_0x3c3567){const _0x4a0dab=_0x25f477;let _0x487d0b=await Cs(_0x2398f5,_0x22ecb9,_0x5796af);if(!_0x487d0b)return null;let _0x175361=_0x22ecb9===_0x4a0dab(0x28d)?_0x3c3567??await ve():void 0x0;return As(_0x487d0b,_0x2398f5,_0x5796af,_0x175361);}async function kn(_0x24b177,_0x464091){const _0x3367fe=_0x25f477;let _0x8e17fa=await(0x0,R['stat'])(_0x24b177)['catch'](()=>null);return _0x8e17fa?.[_0x3367fe(0x1e5)]()?ut(_0x24b177,_0x464091,{'size':_0x8e17fa[_0x3367fe(0x2ca)],'mtimeMs':_0x8e17fa[_0x3367fe(0x2b5)],'birthtimeMs':_0x8e17fa['birthtimeMs']}):null;}async function Ln(_0x11e7d7,_0x17813e={}){const _0x2559a1=_0x25f477;if(!_0x11e7d7)return null;let _0x3ab960=typeof _0x17813e[_0x2559a1(0x2c7)]=='number'?_0x17813e['createdAfterMs']:null,_0x2c239b='codex-latest:'+(0x0,Z['homedir'])(),_0x3b0c74=_0x3ab960===null?Ee['get'](_0x2c239b):null;if(_0x3b0c74&&_0x3ab960===null){let _0x1a282a=_0x3b0c74[_0x2559a1(0x290)](_0x11e7d7);if(_0x3b0c74['has'](_0x11e7d7))return _0x1a282a?{'sessionId':_0x1a282a['sessionId'],'filePath':_0x1a282a['path']}:null;}let _0xd4bfd6=_0x3ab960===null?_0x11e7d7:_0x11e7d7+':'+_0x3ab960,_0x338763=lt[_0x2559a1(0x290)](_0xd4bfd6);_0x338763||(_0x338763=(async()=>{const _0x44a1f4=_0x2559a1;let _0x1bd367=(await oe())[_0x44a1f4(0x1a0)](_0x111f38=>_0x3ab960===null||hs(_0x111f38)>=_0x3ab960),_0x252515=_e('codex');for(let _0x538189=0x0;_0x538189<_0x1bd367['length'];_0x538189+=b){let _0x52f904=_0x1bd367[_0x44a1f4(0x1f4)](_0x538189,_0x538189+b),_0x2475c2=(await Promise['all'](_0x52f904[_0x44a1f4(0x2fb)](async _0x2fcb03=>{const _0xc420a3=_0x44a1f4;let _0x486139=await _0x252515[_0xc420a3(0x1c5)](_0x2fcb03['path'],_0x2fcb03);return _0x486139?{'entry':_0x2fcb03,'meta':_0x486139}:null;})))[_0x44a1f4(0x243)](_0x368a5e=>_0x368a5e?.[_0x44a1f4(0x29f)][_0x44a1f4(0x1d0)]===_0x11e7d7);if(_0x2475c2)return{'path':_0x2475c2['entry']['path'],'mtimeMs':_0x2475c2['entry']['mtimeMs'],'sessionId':_0x2475c2[_0x44a1f4(0x29f)]['sessionId']};}return null;})()[_0x2559a1(0x2c9)](()=>{lt['delete'](_0xd4bfd6);}),lt[_0x2559a1(0x228)](_0xd4bfd6,_0x338763));let _0x24803f=await _0x338763;if(_0x3ab960!==null)return _0x24803f?{'sessionId':_0x24803f[_0x2559a1(0x2ef)],'filePath':_0x24803f['path']}:null;let _0x2b5aaa=Ee['get'](_0x2c239b)??_0x3b0c74??new Map();return _0x2b5aaa[_0x2559a1(0x228)](_0x11e7d7,_0x24803f),Ee['set'](_0x2c239b,_0x2b5aaa),_0x24803f?{'sessionId':_0x24803f[_0x2559a1(0x2ef)],'filePath':_0x24803f['path']}:null;}async function ft(_0x245387,_0x2d1a32){const _0x39cadc=_0x25f477;let _0x2ca614=(0x0,v[_0x39cadc(0x29b)])((0x0,Z['homedir'])(),'.claude','projects'),_0xa77431=_0x2d1a32?on(_0x2d1a32):null,_0x32e7ab=await(0x0,R[_0x39cadc(0x2f7)])(_0x2ca614)['catch'](()=>[]),_0x1db643=_0xa77431?[_0xa77431,..._0x32e7ab['filter'](_0x5300e3=>_0x5300e3!==_0xa77431)]:_0x32e7ab;for(let _0xd5511b of _0x1db643){let _0x16e8b7=(0x0,v[_0x39cadc(0x29b)])(_0x2ca614,_0xd5511b,_0x245387+_0x39cadc(0x204));if((await(0x0,R[_0x39cadc(0x2f4)])(_0x16e8b7)[_0x39cadc(0x23f)](()=>null))?.['isFile']())return _0x16e8b7;}return null;}async function ws(_0x4d8b67,_0x33dfdb){const _0x2a7c5f=_0x25f477;let _0x35a28e=await ft(_0x4d8b67,_0x33dfdb);if(!_0x35a28e)return;let _0x242143=await(0x0,R[_0x2a7c5f(0x2f4)])(_0x35a28e)['catch'](()=>null);return _0x242143?.[_0x2a7c5f(0x1e5)]()?(await at(_0x35a28e,_0x242143['size']))[_0x2a7c5f(0x1e2)]:void 0x0;}async function bs(_0x49003d){const _0x1670a0=_0x25f477;let _0x440a72=(0x0,v[_0x1670a0(0x29b)])((0x0,Z[_0x1670a0(0x2b4)])(),_0x1670a0(0x1d9),_0x1670a0(0x2dd)),_0x35a0a7=await pt(_0x440a72,_0x49003d);if(!_0x35a0a7)return;let _0x4c65bf=await(0x0,R['stat'])(_0x35a0a7)[_0x1670a0(0x23f)](()=>null);return _0x4c65bf?.['isFile']()?(await ot(_0x35a0a7,_0x4c65bf['size']))[_0x1670a0(0x1e2)]:void 0x0;}async function vs(_0x5d9270,_0x57424b,_0x221bdd){return _e(_0x57424b)['resolveSessionFilePath'](_0x5d9270,_0x221bdd);}async function Nn(_0x419214,_0xf622c5){return _e(_0xf622c5)['readRuntimeHintsFromFile'](_0x419214);}function Y(_0xb52b14,_0x20fd8f,_0x3b9852){const _0x1fe316=_0x25f477;let _0x1fdf99=hn(_0x20fd8f);if(_0x3b9852?.[_0x1fe316(0x221)]&&_0x1fdf99['role']===_0x1fe316(0x1dc)){let _0x299941=_0xb52b14[_0xb52b14['length']-0x1];if(_0x299941?.[_0x1fe316(0x289)]==='assistant'&&_0x299941['type']!=='info'&&_0x1fdf99['type']!=='info'&&!bt(_0x299941['content'])&&(_0x1fdf99[_0x1fe316(0x1d1)]===_0x299941[_0x1fe316(0x1d1)]||_0x1fdf99[_0x1fe316(0x1d1)]['startsWith'](_0x299941['content']))){_0xb52b14[_0xb52b14[_0x1fe316(0x233)]-0x1]=_0x1fdf99;return;}}_0xb52b14['push'](_0x1fdf99);}async function Is(_0x4b9cd9,_0x4b91ca){const _0x53dfb5=_0x25f477;let _0x2bc1b1=[];try{let _0x3caacb=await ft(_0x4b9cd9,_0x4b91ca);if(_0x3caacb){let _0x39a7f8=new Map();await j(_0x3caacb,_0x426bf9=>{const _0x12cf46=_0xfedb;if(_0x426bf9['type']==='assistant'&&_0x426bf9[_0x12cf46(0x2fd)]?.['role']==='assistant'&&Array[_0x12cf46(0x1e7)](_0x426bf9[_0x12cf46(0x2fd)][_0x12cf46(0x1d1)]))for(let _0x5fb6b5 of _0x426bf9['message']['content']){if(!_0x5fb6b5||typeof _0x5fb6b5!='object'||_0x5fb6b5['type']!=='tool_use'||typeof _0x5fb6b5['id']!='string')continue;let _0x5267d6=typeof _0x5fb6b5['name']==_0x12cf46(0x1c3)?_0x5fb6b5[_0x12cf46(0x1fa)]:null,_0x3ebfbd=_0x5fb6b5[_0x12cf46(0x1c2)]&&typeof _0x5fb6b5['input']=='object'?_0x5fb6b5[_0x12cf46(0x1c2)]:null,_0x4413cf=vt(_0x5267d6,_0x3ebfbd,_0x4b91ca);_0x4413cf&&_0x39a7f8[_0x12cf46(0x228)](_0x5fb6b5['id'],_0x4413cf);}if(_0x426bf9['type']==='user'&&_0x426bf9['message']?.[_0x12cf46(0x289)]==='user'){if(Array['isArray'](_0x426bf9['message']['content']))for(let _0x3cfed2 of _0x426bf9[_0x12cf46(0x2fd)][_0x12cf46(0x1d1)]){if(!_0x3cfed2||typeof _0x3cfed2!='object'||_0x3cfed2[_0x12cf46(0x209)]!==_0x12cf46(0x1bf))continue;if(_0x3cfed2[_0x12cf46(0x2d1)]===!0x0){let _0x55eda2=Ze(_0x3cfed2[_0x12cf46(0x1d1)]),_0x16f3dd=xn(_0x55eda2);_0x16f3dd&&Y(_0x2bc1b1,Tn(_0x16f3dd,et(_0x426bf9)));continue;}let _0x17e203=typeof _0x3cfed2['tool_use_id']=='string'?_0x3cfed2[_0x12cf46(0x1fb)]:'',_0xdb2b2f=_0x17e203?_0x39a7f8[_0x12cf46(0x290)](_0x17e203):void 0x0;if(!_0xdb2b2f)continue;let _0x54c508=Ze(_0x3cfed2['content']);if(!It(_0x426bf9[_0x12cf46(0x1ba)],_0x54c508))continue;let _0x44236c=$e([_0xdb2b2f]);_0x44236c&&Y(_0x2bc1b1,G({'role':_0x12cf46(0x1dc),'content':_0x44236c},_0x426bf9));}let _0x424c70=z(_0x426bf9);if(_0x424c70){let _0x4fb4f5=typeof _0x426bf9[_0x12cf46(0x1be)]=='string'&&_0x426bf9[_0x12cf46(0x1be)]?_0x426bf9[_0x12cf46(0x1be)]:null;Y(_0x2bc1b1,G({'role':'user','content':_0x424c70,...typeof _0x426bf9[_0x12cf46(0x205)]=='string'&&_0x426bf9[_0x12cf46(0x205)]?{'rewindPoint':{'provider':'claude','messageId':_0x4fb4f5}}:{}},_0x426bf9));}}else{if(_0x426bf9['type']==='assistant'&&_0x426bf9['message']?.['role']==='assistant'){let _0x12fa94=W(_0x426bf9[_0x12cf46(0x2fd)][_0x12cf46(0x1d1)]);_0x12fa94&&Y(_0x2bc1b1,G({'role':_0x12cf46(0x1dc),'content':_0x12fa94},_0x426bf9));}}});}}catch(_0x19fc64){dt['warn']({'error':String(_0x19fc64)},_0x53dfb5(0x27c));}return _0x2bc1b1;}async function Ms(_0x5eb211,_0x47979c){const _0x3d0a40=_0x25f477;let _0x313e75=[];try{let _0x4b7b19=await vs(_0x5eb211,'codex',_0x47979c);if(_0x4b7b19){let _0x41fd0c;await j(_0x4b7b19,_0x51c212=>{const _0x41f7d8=_0xfedb;_0x51c212[_0x41f7d8(0x209)]==='event_msg'&&_0x51c212[_0x41f7d8(0x2d0)]?.['type']==='task_started'&&(_0x41fd0c=typeof _0x51c212['payload']['turn_id']=='string'&&_0x51c212[_0x41f7d8(0x2d0)][_0x41f7d8(0x1bc)]?_0x51c212['payload'][_0x41f7d8(0x1bc)]:void 0x0);let _0x412d73=Mt(_0x51c212,{'cwd':_0x47979c,'includePatchCalls':!0x0}),_0x27c045=$e(_0x412d73);if(_0x27c045&&Y(_0x313e75,G({'role':_0x41f7d8(0x1dc),'content':_0x27c045},_0x51c212)),_0x51c212[_0x41f7d8(0x209)]!==_0x41f7d8(0x23e)||_0x51c212['payload']?.[_0x41f7d8(0x209)]!=='message')return;let _0x5e595b=_0x51c212[_0x41f7d8(0x2d0)][_0x41f7d8(0x289)];if(_0x5e595b!=='user'&&_0x5e595b!==_0x41f7d8(0x1dc))return;let _0x660602=L(_0x51c212[_0x41f7d8(0x2d0)]['content']);_0x660602&&(_0x5e595b==='user'&&q(_0x660602)||Y(_0x313e75,G({'role':_0x5e595b,'content':_0x660602,..._0x5e595b===_0x41f7d8(0x2a6)&&_0x41fd0c?{'rewindPoint':{'provider':_0x41f7d8(0x28d),'turnId':_0x41fd0c}}:{}},_0x51c212),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0x4b43df){dt[_0x3d0a40(0x262)]({'error':String(_0x4b43df)},'failed\x20to\x20read\x20codex\x20session\x20history');}return _0x313e75;}var Es={'claude':{'agent':'claude','extractSessionIdFromFile':nt,async 'readFileMeta'(_0x46d444,_0x1ee8b9){let _0x4ba6ce=await Rn(_0x46d444,_0x1ee8b9);return _0x4ba6ce?{..._0x4ba6ce,'agent':'claude'}:null;},async 'readSessionCwdAndId'(_0x502000,_0x3d2546){const _0x46084a=_0x25f477;let _0x3ae59c=_0x3d2546??await(0x0,R[_0x46084a(0x2f4)])(_0x502000)['catch'](()=>null);if(!_0x3ae59c)return null;let _0x2f3243=await Rn(_0x502000,_0x3ae59c['size']);return _0x2f3243?{'cwd':_0x2f3243['cwd'],'sessionId':_0x2f3243['sessionId']}:null;},'resolveSessionFilePath':ft,'readLastUsage':ws,'readRuntimeHintsFromFile':bn,'readHistory':Is},'codex':{'agent':_0x25f477(0x28d),'extractSessionIdFromFile':rt,async 'readFileMeta'(_0x3c814b,_0x10556d){let _0xabe1e2=await xs(_0x3c814b,_0x10556d);return _0xabe1e2?{..._0xabe1e2,'agent':'codex'}:null;},'readSessionCwdAndId':Ss,async 'resolveSessionFilePath'(_0x11928f){const _0x2ef146=_0x25f477;let _0x5948da=(0x0,v['join'])((0x0,Z[_0x2ef146(0x2b4)])(),'.codex','sessions');return pt(_0x5948da,_0x11928f);},'readLastUsage':bs,'readRuntimeHintsFromFile':vn,'readHistory':Ms}};function _e(_0x2e861b){return Es[_0x2e861b];}async function pt(_0x5b5836,_0x58d19d){const _0x138cbe=_0x25f477;try{let _0x4a6531=await(0x0,R['readdir'])(_0x5b5836,{'withFileTypes':!0x0});for(let _0x54cfe5 of _0x4a6531){let _0x43515a=(0x0,v[_0x138cbe(0x29b)])(_0x5b5836,_0x54cfe5['name']);if(_0x54cfe5[_0x138cbe(0x1ff)]()){let _0x20ef91=await pt(_0x43515a,_0x58d19d);if(_0x20ef91)return _0x20ef91;}else{if(_0x54cfe5['name'][_0x138cbe(0x20d)](_0x58d19d)&&_0x54cfe5[_0x138cbe(0x1fa)]['endsWith']('.jsonl'))return _0x43515a;}}}catch(_0x3911e1){dt['warn']({'error':String(_0x3911e1)},_0x138cbe(0x2ab));}return null;}function _0xfedb(_0x5e5335,_0x506309){_0x5e5335=_0x5e5335-0x194;const _0x58646e=_0x5864();let _0xfedb44=_0x58646e[_0x5e5335];if(_0xfedb['drVeYW']===undefined){var _0x266a82=function(_0x595801){const _0x4cdb9a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x585bd1='',_0x3253ba='';for(let _0x2e3e6d=0x0,_0x4fc081,_0x47a019,_0x5b0018=0x0;_0x47a019=_0x595801['charAt'](_0x5b0018++);~_0x47a019&&(_0x4fc081=_0x2e3e6d%0x4?_0x4fc081*0x40+_0x47a019:_0x47a019,_0x2e3e6d++%0x4)?_0x585bd1+=String['fromCharCode'](0xff&_0x4fc081>>(-0x2*_0x2e3e6d&0x6)):0x0){_0x47a019=_0x4cdb9a['indexOf'](_0x47a019);}for(let _0x31e925=0x0,_0x29421a=_0x585bd1['length'];_0x31e925<_0x29421a;_0x31e925++){_0x3253ba+='%'+('00'+_0x585bd1['charCodeAt'](_0x31e925)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3253ba);};_0xfedb['CgFnUt']=_0x266a82,_0xfedb['RHzgjW']={},_0xfedb['drVeYW']=!![];}const _0x337db8=_0x58646e[0x0],_0x51b9fd=_0x5e5335+_0x337db8,_0x1a39d5=_0xfedb['RHzgjW'][_0x51b9fd];return!_0x1a39d5?(_0xfedb44=_0xfedb['CgFnUt'](_0xfedb44),_0xfedb['RHzgjW'][_0x51b9fd]=_0xfedb44):_0xfedb44=_0x1a39d5,_0xfedb44;}var Rs=0x40;function mt(_0x264548){return _0x264548['size']+':'+_0x264548['mtimeMs']+':'+_0x264548['birthtimeMs'];}function _s(_0xe4f89b){const _0x5e7b6c=_0x25f477;return _0xe4f89b[_0x5e7b6c(0x2fb)](_0x2b6b8e=>_0x2b6b8e['path']+'\x00'+mt(_0x2b6b8e))[_0x5e7b6c(0x265)]()[_0x5e7b6c(0x29b)]('\x0a');}async function Fs(){const _0x9e6845=_0x25f477;let [_0x44cc0d,_0x3d67a0,_0x4b774c,_0xc45470]=await Promise[_0x9e6845(0x293)]([He(),oe(),ie(),(0x0,Dn['stat'])((0x0,On[_0x9e6845(0x29b)])((0x0,Un[_0x9e6845(0x2b4)])(),'.codex',_0x9e6845(0x2b9)))[_0x9e6845(0x23f)](()=>null)]),[_0x834044,_0x19d47a]=await Promise['all']([J(_0x44cc0d),J(_0x4b774c)]);return{'claudeFiles':_0x834044,'codexFiles':_0x3d67a0,'claudeMetadataFingerprint':_s(_0x19d47a),'codexMetadataFingerprint':_0xc45470?.['isFile']()?_0xc45470['size']+':'+_0xc45470[_0x9e6845(0x2b5)]+':'+_0xc45470['birthtimeMs']:''};}async function Ps(_0x17259a,_0x232e66,_0x4a6157){const _0x4e94c7=_0x25f477;let _0x1cd173=await ut(_0x17259a[_0x4e94c7(0x1f3)],_0x232e66,_0x17259a,_0x232e66==='codex'?_0x4a6157['codex']:void 0x0);if(!_0x1cd173)return null;let _0x4992b8=_0x232e66==='claude'?qe(_0x1cd173,_0x4a6157['claude']['byCliSessionId'][_0x4e94c7(0x290)](_0x1cd173[_0x4e94c7(0x2ef)])):_0x1cd173;return Pn(_0x4992b8);}var ks={'collectContext':Fs,'loadClaudeLookup':ze,'loadCodexLookup':async _0x3424e0=>(_0x3424e0&&Ke(),ve()),'readSession':Ps,'updateLatestCodexCache':_n},Fe=class{constructor(_0x98b0b4=ks,_0x154281=Rs){this['dependencies']=_0x98b0b4,this['batchSize']=_0x154281;}['entries']=new Map();[_0x25f477(0x1d3)]=null;['codexMetadataFingerprint']=null;['claudeLookup']=null;['codexLookup']=null;async['scan'](_0x53cbbb){const _0x3c3970=_0x25f477;let _0x3e48cd=await this['dependencies'][_0x3c3970(0x2b2)](),_0x24fdaa=this[_0x3c3970(0x1d3)]===null||this['claudeMetadataFingerprint']!==_0x3e48cd['claudeMetadataFingerprint'],_0x20f520=this['codexMetadataFingerprint']===null||this['codexMetadataFingerprint']!==_0x3e48cd['codexMetadataFingerprint'],[_0x39f45e,_0x9c5b82]=await Promise['all']([_0x24fdaa||!this[_0x3c3970(0x206)]?this['dependencies'][_0x3c3970(0x306)]():Promise['resolve'](this[_0x3c3970(0x206)]),_0x20f520||!this[_0x3c3970(0x2b8)]?this['dependencies'][_0x3c3970(0x215)](this['codexMetadataFingerprint']!==null):Promise['resolve'](this['codexLookup'])]),_0x1564eb={'claude':_0x39f45e,'codex':_0x9c5b82},_0x313ed0=[..._0x3e48cd['claudeFiles']['map'](_0x3ee706=>({'agent':'claude','entry':_0x3ee706})),..._0x3e48cd[_0x3c3970(0x1d7)][_0x3c3970(0x2fb)](_0x151def=>({'agent':'codex','entry':_0x151def}))][_0x3c3970(0x265)]((_0x4cdcfe,_0x5211c5)=>_0x5211c5['entry']['mtimeMs']-_0x4cdcfe['entry']['mtimeMs']),_0x2c7576=new Set(_0x313ed0[_0x3c3970(0x2fb)](({entry:_0x1c4b25})=>_0x1c4b25['path'])),_0x37f193=[...this[_0x3c3970(0x266)][_0x3c3970(0x21d)]()]['filter'](_0x5628b5=>!_0x2c7576[_0x3c3970(0x1ec)](_0x5628b5))['length'],_0x14bfb0=new Map(),_0x21e394=_0x313ed0[_0x3c3970(0x1a0)](({agent:_0x4bf5ff,entry:_0x3a0cb8})=>{const _0x22983f=_0x3c3970;let _0x53ccd7=this['entries']['get'](_0x3a0cb8[_0x22983f(0x1f3)]);return!(_0x4bf5ff==='claude'?_0x24fdaa:_0x20f520)&&_0x53ccd7?.[_0x22983f(0x29a)]===mt(_0x3a0cb8)?(_0x14bfb0[_0x22983f(0x228)](_0x3a0cb8['path'],_0x53ccd7),!0x1):!0x0;}),_0x141960=0x0,_0x5eb504=Math['max'](0x1,this[_0x3c3970(0x1ee)]);for(let _0x45e2dc=0x0;_0x45e2dc<_0x21e394['length'];_0x45e2dc+=_0x5eb504){let _0x1d5cd7=_0x21e394['slice'](_0x45e2dc,_0x45e2dc+_0x5eb504),_0x13d65b=await _(_0x1d5cd7,b,({agent:_0x459fec,entry:_0x365aa5})=>this[_0x3c3970(0x22a)][_0x3c3970(0x1ea)](_0x365aa5,_0x459fec,_0x1564eb));for(let _0xdddd89=0x0;_0xdddd89<_0x1d5cd7['length'];_0xdddd89+=0x1){let _0x2ced73=_0x1d5cd7[_0xdddd89];_0x14bfb0['set'](_0x2ced73[_0x3c3970(0x20c)]['path'],{'fingerprint':mt(_0x2ced73[_0x3c3970(0x20c)]),'session':_0x13d65b[_0xdddd89]});}_0x141960+=_0x1d5cd7[_0x3c3970(0x233)],_0x53cbbb?.({'processedFiles':_0x141960,'changedFiles':_0x21e394[_0x3c3970(0x233)],'totalFiles':_0x313ed0['length'],'removedFiles':_0x37f193});}let _0x5c3ff2=[..._0x14bfb0['values']()]['map'](_0x42f8e0=>_0x42f8e0['session'])['filter'](_0x162d9e=>_0x162d9e!==null)[_0x3c3970(0x265)]((_0x467448,_0x500180)=>_0x500180['lastActivityAt']['localeCompare'](_0x467448['lastActivityAt']));return this['dependencies']['updateLatestCodexCache'](_0x313ed0['filter'](({agent:_0x6d07d8})=>_0x6d07d8===_0x3c3970(0x28d))[_0x3c3970(0x2fb)](({entry:_0x14b39a})=>{const _0x1b59ff=_0x3c3970;let _0x59abe8=_0x14bfb0['get'](_0x14b39a['path'])?.[_0x1b59ff(0x1b5)];return _0x59abe8?{'cwd':_0x59abe8['cwd'],'match':{'path':_0x14b39a['path'],'mtimeMs':_0x14b39a[_0x1b59ff(0x2b5)],'sessionId':_0x59abe8['sessionId']}}:null;})[_0x3c3970(0x1a0)](_0x23f299=>_0x23f299!==null)),this[_0x3c3970(0x266)]=_0x14bfb0,this[_0x3c3970(0x206)]=_0x39f45e,this['codexLookup']=_0x9c5b82,this['claudeMetadataFingerprint']=_0x3e48cd['claudeMetadataFingerprint'],this[_0x3c3970(0x1a1)]=_0x3e48cd['codexMetadataFingerprint'],{'sessions':_0x5c3ff2,'changedFiles':_0x21e394[_0x3c3970(0x233)],'reusedFiles':_0x313ed0['length']-_0x21e394[_0x3c3970(0x233)],'removedFiles':_0x37f193,'totalFiles':_0x313ed0['length']};}},Vn=require(_0x25f477(0x2e9)),ge=require('node:fs/promises'),St=require(_0x25f477(0x2f8)),N=require(_0x25f477(0x270)),Qn=require(_0x25f477(0x238)),gt=class{[_0x25f477(0x19a)]=new Map();['timers']=new Map();['gauges']=new Map();[_0x25f477(0x25d)]=Date['now']();['logInterval']=null;['increment'](_0x4efe5e,_0x30c20e={}){const _0x24d02e=_0x25f477;this['counters']['has'](_0x4efe5e)||this[_0x24d02e(0x19a)][_0x24d02e(0x228)](_0x4efe5e,[]);let _0x15acb8=this['counters'][_0x24d02e(0x290)](_0x4efe5e),_0x3d073=JSON['stringify'](_0x30c20e),_0x3ab5ae=_0x15acb8[_0x24d02e(0x243)](_0x8251a3=>JSON[_0x24d02e(0x2cd)](_0x8251a3['labels'])===_0x3d073);_0x3ab5ae?_0x3ab5ae['value']++:_0x15acb8[_0x24d02e(0x27b)]({'value':0x1,'labels':_0x30c20e});}['gauge'](_0x240a72,_0x38c354){const _0x549c8a=_0x25f477;this[_0x549c8a(0x2d7)][_0x549c8a(0x228)](_0x240a72,_0x38c354);}[_0x25f477(0x292)](_0xbfd822){let _0x4bdcec=performance['now']();return()=>{const _0x488a10=_0xfedb;let _0x35ba3c=Math['round'](performance[_0x488a10(0x2af)]()-_0x4bdcec),_0x190f1d=this[_0x488a10(0x1f9)][_0x488a10(0x290)](_0xbfd822)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0x190f1d['count']++,_0x190f1d['totalMs']+=_0x35ba3c,_0x190f1d[_0x488a10(0x2c6)]=Math[_0x488a10(0x240)](_0x190f1d['minMs'],_0x35ba3c),_0x190f1d['maxMs']=Math[_0x488a10(0x269)](_0x190f1d['maxMs'],_0x35ba3c),_0x190f1d[_0x488a10(0x2fc)]=_0x35ba3c,this[_0x488a10(0x1f9)][_0x488a10(0x228)](_0xbfd822,_0x190f1d),_0x35ba3c;};}[_0x25f477(0x2c8)](){const _0x3d432d=_0x25f477;let _0x5dae26={};for(let [_0x1df222,_0x3e41b4]of this['counters'])_0x5dae26[_0x1df222]=_0x3e41b4[_0x3d432d(0x2fb)](_0x4b1406=>({..._0x4b1406}));let _0x55f091={};for(let [_0x2d8462,_0x148229]of this['timers'])_0x55f091[_0x2d8462]={..._0x148229,'minMs':_0x148229['minMs']===0x1/0x0?0x0:_0x148229[_0x3d432d(0x2c6)]};let _0x5aeb1f={};for(let [_0x78fb27,_0x421d33]of this['gauges'])_0x5aeb1f[_0x78fb27]=_0x421d33;return{'uptimeMs':Date['now']()-this[_0x3d432d(0x25d)],'counters':_0x5dae26,'timers':_0x55f091,'gauges':_0x5aeb1f};}[_0x25f477(0x29e)](_0x2fcc48=0xea60){const _0x5393cd=_0x25f477;this['logInterval']||(this[_0x5393cd(0x271)]=setInterval(()=>{const _0x34b1f4=_0x5393cd;let _0x181a0c=this[_0x34b1f4(0x2c8)]();x['info']({'metrics':_0x181a0c},_0x34b1f4(0x1bd));},_0x2fcc48),this[_0x5393cd(0x271)]['unref']());}[_0x25f477(0x307)](){const _0x5e7bab=_0x25f477;this[_0x5e7bab(0x271)]&&(clearInterval(this['logInterval']),this[_0x5e7bab(0x271)]=null);}},ee=new gt(),Pe=require(_0x25f477(0x294)),Bn=require(_0x25f477(0x2f8)),ht=require('node:path');function jn(){const _0x19d295=_0x25f477;return(0x0,ht[_0x19d295(0x29b)])((0x0,Bn['homedir'])(),'.claude','sessions');}function $n(_0x4b84df){const _0x33e738=_0x25f477;let _0x5bab74=typeof _0x4b84df==_0x33e738(0x207)?_0x4b84df:typeof _0x4b84df==_0x33e738(0x1c3)?Number(_0x4b84df):Number[_0x33e738(0x24a)];return Number['isFinite'](_0x5bab74)&&_0x5bab74>0x0?_0x5bab74:void 0x0;}function Hn(_0xac82e){const _0x139d45=_0x25f477;return _0xac82e[_0x139d45(0x1a6)]??_0xac82e['startedAt']??0x0;}function Wn(_0x314a29){const _0x9e51e8=_0x25f477;switch(_0x314a29){case _0x9e51e8(0x196):case'responding':return!0x0;case _0x9e51e8(0x1ed):return!0x1;default:return;}}async function Ls(_0xea698=jn()){const _0x5ec088=_0x25f477;return(await(0x0,Pe[_0x5ec088(0x2f7)])(_0xea698,{'withFileTypes':!0x0})[_0x5ec088(0x23f)](()=>[]))[_0x5ec088(0x1a0)](_0x13b52a=>_0x13b52a['isFile']()&&_0x13b52a[_0x5ec088(0x1fa)][_0x5ec088(0x1cd)](_0x5ec088(0x2c1)))[_0x5ec088(0x2fb)](_0x3b1cc3=>(0x0,ht['join'])(_0xea698,_0x3b1cc3['name']));}async function Ns(_0x520bc8){const _0x573a34=_0x25f477;try{let _0x593bbf=JSON['parse'](await(0x0,Pe[_0x573a34(0x2b0)])(_0x520bc8,_0x573a34(0x212))),_0x51145b=C(_0x593bbf['sessionId']);if(!_0x51145b)return;let _0x5a28ed={'sessionId':_0x51145b},_0x40d371=C(_0x593bbf[_0x573a34(0x1d0)]),_0x5b7f50=C(_0x593bbf[_0x573a34(0x1ad)]),_0x556682=$n(_0x593bbf['startedAt']),_0x2855f3=$n(_0x593bbf['updatedAt']);return _0x40d371&&(_0x5a28ed['cwd']=_0x40d371),_0x5b7f50&&(_0x5a28ed['status']=_0x5b7f50),_0x556682&&(_0x5a28ed[_0x573a34(0x252)]=_0x556682),_0x2855f3&&(_0x5a28ed['updatedAt']=_0x2855f3),_0x5a28ed;}catch{return;}}async function zn(_0x136afa,_0x1f8a2f=jn()){const _0x131087=_0x25f477;if(!_0x136afa)return;let _0x3d123f=await Ls(_0x1f8a2f),_0x1353aa=await _(_0x3d123f,b,Ns),_0x538620;for(let _0x43e7a6 of _0x1353aa)!_0x43e7a6||_0x43e7a6[_0x131087(0x2ef)]!==_0x136afa||(!_0x538620||Hn(_0x43e7a6)>Hn(_0x538620))&&(_0x538620=_0x43e7a6);return _0x538620;}var Ds=(0x0,Qn['promisify'])(Vn['execFile']),yt=x[_0x25f477(0x222)]({'module':_0x25f477(0x2c0)}),Jn=0xbb8,Us=0x3e8,Os=0xfa0,qn=0x3,$s=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,Hs=0x1f4,Bs=0x3a98,me=null,js=[],pe=null;function Kn(){me=null;}function Ws(_0x39b1fa,_0x24a86a=Date['now']()){return _0x24a86a-_0x39b1fa<Os;}var zs=new Set(['sh',_0x25f477(0x28f),_0x25f477(0x259),_0x25f477(0x278)]),qs=new Set(['env','nohup','timeout','gtimeout']),Gs=new Set(['node',_0x25f477(0x23c),_0x25f477(0x283),'tsx']),Vs=new Set(['-e','--eval','-p',_0x25f477(0x2d6)]),Qs=new Set(['-r','--require',_0x25f477(0x25a),'--loader','--experimental-loader','--env-file','--input-type']);function Js(_0x50956d){return _0x50956d['replace'](/^['"]|['"]$/g,'');}function Xn(_0x4d6d83){const _0x5de18f=_0x25f477;return(_0x4d6d83[_0x5de18f(0x218)](/"[^"]*"|'[^']*'|\S+/g)??[])[_0x5de18f(0x2fb)](Js);}function Gn(_0x4f7e56){let _0x28caf5=(0x0,N['basename'])(_0x4f7e56);return _0x28caf5==='claude'||_0x28caf5==='codex'?_0x28caf5:null;}function Ks(_0xeda61c){const _0x1b4dd1=_0x25f477;for(let _0x57b2c4 of _0xeda61c['split'](/&&|\|\||;|\n/)){let _0x45c934=Yn(Xn(_0x57b2c4[_0x1b4dd1(0x308)]()),!0x0);if(_0x45c934)return _0x45c934;}return null;}function Yn(_0x546c7c,_0x125de9=!0x1){const _0x310585=_0x25f477;let _0x469301=0x0;for(;_0x469301<_0x546c7c['length'];){let _0x4dbcd8=_0x546c7c[_0x469301],_0x5678e0=(0x0,N['basename'])(_0x4dbcd8);if(qs['has'](_0x5678e0)){if(_0x469301+=0x1,_0x5678e0===_0x310585(0x2eb)){for(;_0x469301<_0x546c7c[_0x310585(0x233)]&&/^[A-Za-z_][A-Za-z0-9_]*=/['test'](_0x546c7c[_0x469301]);)_0x469301+=0x1;}else{if(_0x5678e0===_0x310585(0x20b)||_0x5678e0==='gtimeout'){for(;_0x469301<_0x546c7c[_0x310585(0x233)]&&_0x546c7c[_0x469301][_0x310585(0x302)]('-');){let _0x10dd19=_0x546c7c[_0x469301];_0x469301+=0x1,_0x10dd19==='-k'&&_0x469301<_0x546c7c['length']&&(_0x469301+=0x1);}_0x469301<_0x546c7c['length']&&(_0x469301+=0x1);}}continue;}if(zs['has'](_0x5678e0)){for(let _0xbcd56f=_0x469301+0x1;_0xbcd56f<_0x546c7c[_0x310585(0x233)];_0xbcd56f+=0x1){let _0x26c3ab=_0x546c7c[_0xbcd56f];if(_0x26c3ab==='-c'||_0x26c3ab==='-lc'||_0x26c3ab===_0x310585(0x1b3)||_0x26c3ab==='-xc'||_0x26c3ab==='-ec'||_0x26c3ab===_0x310585(0x223)){let _0x7d23e1=_0x546c7c[_0xbcd56f+0x1];return _0x7d23e1?Ks(_0x7d23e1):null;}}return null;}if(Gs['has'](_0x5678e0)){let _0x1ab882=_0x469301+0x1;for(;_0x1ab882<_0x546c7c[_0x310585(0x233)];){let _0x297b50=_0x546c7c[_0x1ab882];if(Vs[_0x310585(0x1ec)](_0x297b50))return null;if(_0x297b50==='--'){_0x1ab882+=0x1;break;}if(!_0x297b50[_0x310585(0x302)]('-'))break;_0x1ab882+=0x1,Qs['has'](_0x297b50)&&_0x1ab882<_0x546c7c['length']&&(_0x1ab882+=0x1);}if(_0x1ab882>=_0x546c7c['length'])return null;let _0x26c050=Gn(_0x546c7c[_0x1ab882]);return _0x26c050?{'agent':_0x26c050,'args':_0x546c7c['slice'](_0x1ab882+0x1),'viaWrapper':!0x0}:null;}let _0xf6512e=Gn(_0x4dbcd8);return _0xf6512e?{'agent':_0xf6512e,'args':_0x546c7c['slice'](_0x469301+0x1),'viaWrapper':_0x125de9}:null;}return null;}function xt(_0x2bf467,_0x4f85fd=!0x1){return Yn(Xn(_0x2bf467),_0x4f85fd);}function Le(_0x180695){const _0x40cae7=_0x25f477;let _0x4d4484=xt(_0x180695);return _0x4d4484?{'agent':_0x4d4484[_0x40cae7(0x1b1)],'args':_0x4d4484['args']}:null;}function Zn(_0x452002){return $s['test'](_0x452002)&&xt(_0x452002)!==null;}function Xs(_0x467378,_0x592318){const _0x159d46=_0x25f477;let _0x261b94=Le(_0x592318);if(!_0x261b94||_0x261b94[_0x159d46(0x1b1)]!==_0x467378)return null;let {args:_0x358293}=_0x261b94;if(_0x467378===_0x159d46(0x24f)){for(let _0x5ca7e5=0x0;_0x5ca7e5<_0x358293['length'];_0x5ca7e5+=0x1){let _0x327e96=_0x358293[_0x5ca7e5];if((_0x327e96===_0x159d46(0x26e)||_0x327e96===_0x159d46(0x1ef))&&_0x358293[_0x5ca7e5+0x1]&&!_0x358293[_0x5ca7e5+0x1]['startsWith']('-'))return _0x358293[_0x5ca7e5+0x1];if(_0x327e96[_0x159d46(0x302)](_0x159d46(0x26c)))return _0x327e96['slice'](0x9);if(_0x327e96['startsWith'](_0x159d46(0x24d)))return _0x327e96['slice'](0xd);}return null;}if(_0x358293[0x0]!==_0x159d46(0x2df))return null;for(let _0x5e2ab7=0x1;_0x5e2ab7<_0x358293['length'];_0x5e2ab7+=0x1){let _0x5749b1=_0x358293[_0x5e2ab7];if(!_0x5749b1[_0x159d46(0x302)]('-'))return _0x5749b1;}return null;}function Ys(_0x5163d1){const _0x15353b=_0x25f477;if(_0x5163d1[_0x15353b(0x20d)](_0x15353b(0x2ad)))return _0x15353b(0x1db);for(let _0x569f01=0x0;_0x569f01<_0x5163d1['length'];_0x569f01+=0x1){let _0x154973=_0x5163d1[_0x569f01],_0x5b6e46=_0x5163d1[_0x569f01+0x1],_0xe2c803=_0x154973==='--permission-mode'?_0x5b6e46:_0x154973['startsWith'](_0x15353b(0x210))?_0x154973['slice'](0x12):void 0x0;if(_0xe2c803==='plan')return'plan';if(_0xe2c803===_0x15353b(0x21c))return'acceptEdits';if(_0xe2c803===_0x15353b(0x1a4))return'normal';}}function Zs(_0xec1c1c){const _0x56afb0=_0x25f477;if(_0xec1c1c['includes']('--dangerously-bypass-approvals-and-sandbox'))return _0x56afb0(0x1db);}function ei(_0x267899,_0x3cf304){const _0x1b4f09=_0x25f477;let _0xe6b404=Le(_0x3cf304);if(!(!_0xe6b404||_0xe6b404['agent']!==_0x267899))return _0x267899===_0x1b4f09(0x24f)?Ys(_0xe6b404['args']):Zs(_0xe6b404['args']);}function ke(_0x40e739){const _0x35cf92=_0x25f477;switch(_0x40e739){case'high':return 0x3;case _0x35cf92(0x2e0):return 0x2;default:return 0x1;}}function ti(_0x2577ac,_0x11323d){const _0x571ebf=_0x25f477;return _0x2577ac==='claude'?_0x11323d[_0x571ebf(0x20d)]('/.claude/projects/')&&!_0x11323d['includes'](_0x571ebf(0x1a3)):_0x11323d['includes']('/.codex/sessions/');}function ni(_0x1771e6,_0x177025){const _0x22291b=_0x25f477;let _0x30fd30=xt(_0x177025);return!_0x30fd30||_0x30fd30['agent']!==_0x1771e6||_0x30fd30[_0x22291b(0x295)]?!0x1:_0x1771e6===_0x22291b(0x24f)?!_0x30fd30['args'][_0x22291b(0x20d)](_0x22291b(0x22c))&&!_0x30fd30[_0x22291b(0x23a)]['includes']('-c'):!(_0x30fd30['args'][0x0]===_0x22291b(0x1e0)&&!_0x30fd30['args'][_0x22291b(0x20d)]('--listen')&&!_0x30fd30['args']['some'](_0x571772=>_0x571772[_0x22291b(0x302)](_0x22291b(0x2b7))));}function ri(_0x39aaa9){const _0x56f1b9=_0x25f477;let _0x5a09ea=[...new Set(_0x39aaa9['sessionFiles'])]['filter'](_0x56b0de=>ti(_0x39aaa9[_0x56f1b9(0x1b1)],_0x56b0de)),_0xde2f89=Xs(_0x39aaa9['agent'],_0x39aaa9[_0x56f1b9(0x234)]),_0x4c4e26=ei(_0x39aaa9[_0x56f1b9(0x1b1)],_0x39aaa9[_0x56f1b9(0x234)]);if(_0xde2f89)return{'agent':_0x39aaa9['agent'],'pid':_0x39aaa9['pid'],'cwd':_0x39aaa9[_0x56f1b9(0x1d0)],'command':_0x39aaa9[_0x56f1b9(0x234)],'sessionId':_0xde2f89,'confidence':'high',..._0x4c4e26?{'approvalMode':_0x4c4e26}:{},..._0x5a09ea['length']===0x1?{'sessionFilePath':_0x5a09ea[0x0]}:{}};if(_0x5a09ea['length']!==0x1)return null;let _0x396573=P(_0x39aaa9[_0x56f1b9(0x1b1)],_0x5a09ea[0x0]);return _0x396573?{'agent':_0x39aaa9[_0x56f1b9(0x1b1)],'pid':_0x39aaa9[_0x56f1b9(0x2f0)],'cwd':_0x39aaa9[_0x56f1b9(0x1d0)],'command':_0x39aaa9[_0x56f1b9(0x234)],'sessionId':_0x396573,'confidence':_0x56f1b9(0x2e0),..._0x4c4e26?{'approvalMode':_0x4c4e26}:{},'sessionFilePath':_0x5a09ea[0x0]}:null;}function si(_0x3c65f8,_0x2c0547){const _0x12ca27=_0x25f477;let _0x4d1a51=_0x3c65f8,_0x39083a=_0x2c0547;(ke(_0x2c0547[_0x12ca27(0x1c1)])>ke(_0x3c65f8[_0x12ca27(0x1c1)])||ke(_0x2c0547[_0x12ca27(0x1c1)])===ke(_0x3c65f8['confidence'])&&_0x2c0547['pid']!==void 0x0&&_0x3c65f8['pid']!==void 0x0&&_0x2c0547[_0x12ca27(0x2f0)]<_0x3c65f8[_0x12ca27(0x2f0)])&&(_0x4d1a51=_0x2c0547,_0x39083a=_0x3c65f8);let _0x2f9eb7=_0x4d1a51[_0x12ca27(0x2d5)]??_0x39083a['approvalMode'],_0x2f9d89=_0x4d1a51['title']??_0x39083a[_0x12ca27(0x22f)],_0x425557=_0x4d1a51['sessionFilePath']??_0x39083a[_0x12ca27(0x2f5)],_0x97ffdf=_0x4d1a51[_0x12ca27(0x2a9)]??_0x39083a[_0x12ca27(0x2a9)],_0x4a392a=_0x4d1a51[_0x12ca27(0x274)]??_0x39083a['terminal'],_0x2cbb68={..._0x4d1a51,'cwd':_0x4d1a51['cwd']||_0x39083a[_0x12ca27(0x1d0)],..._0x2f9eb7?{'approvalMode':_0x2f9eb7}:{}};return _0x2f9d89!==void 0x0&&(_0x2cbb68[_0x12ca27(0x22f)]=_0x2f9d89),_0x425557!==void 0x0&&(_0x2cbb68['sessionFilePath']=_0x425557),_0x97ffdf!==void 0x0&&(_0x2cbb68['isResponding']=_0x97ffdf),_0x4a392a!==void 0x0&&(_0x2cbb68[_0x12ca27(0x274)]=_0x4a392a),_0x2cbb68;}function ii(_0x220aaa){const _0x533520=_0x25f477;let _0x3265fa=new Map();for(let _0xf2b485 of _0x220aaa){let _0x57892d=_0xf2b485['agent']+':'+_0xf2b485['sessionId'],_0x5ba3f2=_0x3265fa['get'](_0x57892d);_0x3265fa[_0x533520(0x228)](_0x57892d,_0x5ba3f2?si(_0x5ba3f2,_0xf2b485):_0xf2b485);}return[..._0x3265fa['values']()];}function oi(_0x32af8f){try{return process['kill'](_0x32af8f,0x0),!0x0;}catch{return!0x1;}}async function Ne(_0x3f7a84,_0x4fd559,_0x55b123=Us){const _0x579be9=_0x25f477;try{let {stdout:_0x207ec4}=await Ds(_0x3f7a84,_0x4fd559,{'killSignal':process['platform']==='win32'?_0x579be9(0x22d):'SIGKILL','maxBuffer':0x800000,'timeout':_0x55b123,'windowsHide':!0x0});return _0x207ec4;}catch(_0x31f47c){let _0x2a0d2a=typeof _0x31f47c=='object'&&_0x31f47c!==null?{'code':'code'in _0x31f47c?_0x31f47c['code']:void 0x0,'signal':_0x579be9(0x2a2)in _0x31f47c?_0x31f47c['signal']:void 0x0,'killed':'killed'in _0x31f47c?_0x31f47c['killed']:void 0x0}:{},_0x76b1e5=String(_0x31f47c);return _0x76b1e5[_0x579be9(0x20d)]('ESRCH')||_0x76b1e5['includes'](_0x579be9(0x27e))?yt['debug']({'file':_0x3f7a84,'args':_0x4fd559,'timeoutMs':_0x55b123,'error':_0x76b1e5,..._0x2a0d2a},_0x579be9(0x26a)):yt[_0x579be9(0x262)]({'file':_0x3f7a84,'args':_0x4fd559,'timeoutMs':_0x55b123,'error':_0x76b1e5,..._0x2a0d2a},_0x579be9(0x257)),'';}}async function ai(_0x14a65a){const _0x2d265c=_0x25f477;let _0x4c5b45=_0x14a65a;if(_0x14a65a['sessionFilePath']){let _0xed70a6=await kn(_0x14a65a['sessionFilePath'],_0x14a65a[_0x2d265c(0x1b1)]);if(!_0xed70a6)return null;let _0x4cd262=await Nn(_0x14a65a['sessionFilePath'],_0x14a65a[_0x2d265c(0x1b1)]),_0x16529a=_0xed70a6['approvalMode']??_0x14a65a['approvalMode'];_0x4c5b45={..._0x14a65a,'cwd':_0x14a65a[_0x2d265c(0x1d0)]||_0xed70a6['cwd'],..._0x16529a?{'approvalMode':_0x16529a}:{},'title':_0x14a65a[_0x2d265c(0x22f)]??_0xed70a6['title'],'isResponding':_0x4cd262['isResponding']};}if(_0x4c5b45['agent']!=='claude')return _0x4c5b45;let _0x1da0c6=await zn(_0x4c5b45[_0x2d265c(0x2ef)]);if(!_0x1da0c6)return _0x4c5b45;let _0x1d3389=Wn(_0x1da0c6[_0x2d265c(0x1ad)]);return{..._0x4c5b45,'cwd':_0x4c5b45['cwd']||_0x1da0c6['cwd']||'','isResponding':_0x1d3389??_0x4c5b45[_0x2d265c(0x2a9)]};}async function li(_0x497f54){const _0x314839=_0x25f477;return process['platform']==='win32'?'':(await Ne(_0x314839(0x2ec),['-a','-p',String(_0x497f54),'-d',_0x314839(0x1d0),_0x314839(0x26d)]))[_0x314839(0x255)]('\x0a')['find'](_0x593572=>_0x593572['startsWith']('n'))?.[_0x314839(0x1f4)](0x1)[_0x314839(0x308)]()??'';}async function ci(_0x26d41a){const _0x5c376a=_0x25f477;if(process[_0x5c376a(0x281)]==='win32')return[];let _0x1107af=(await Ne('lsof',['-p',String(_0x26d41a),'-Fn']))[_0x5c376a(0x255)]('\x0a')['filter'](_0x372ac0=>_0x372ac0['startsWith']('n'))[_0x5c376a(0x2fb)](_0x160e81=>_0x160e81['slice'](0x1)['trim']())[_0x5c376a(0x1a0)](_0xd017b3=>_0xd017b3['endsWith']('.jsonl')?_0xd017b3[_0x5c376a(0x20d)]('/.claude/projects/')||_0xd017b3['includes']('/.codex/sessions/'):!0x1);return[...new Set(_0x1107af)];}function di(_0x2f891f){const _0x595ce5=_0x25f477;return _0x2f891f[_0x595ce5(0x255)]('\x0a')['map'](_0x49596a=>_0x49596a['trim']())['filter'](Boolean)['map'](_0x375086=>{const _0x3988df=_0x595ce5;let _0xeba11b=_0x375086['match'](/^(\d+)\s+(.*)$/);if(!_0xeba11b)return null;let _0x2cbc9c=Number(_0xeba11b[0x1]),_0xab76c6=_0xeba11b[0x2];if(!Zn(_0xab76c6))return null;let _0x18a675=Le(_0xab76c6);return!Number[_0x3988df(0x2e7)](_0x2cbc9c)||!_0x18a675?null:{'pid':_0x2cbc9c,'command':_0xab76c6,'agent':_0x18a675['agent']};})[_0x595ce5(0x1a0)](_0x3d3cfd=>!!_0x3d3cfd);}async function ui(){const _0x19ef4e=_0x25f477;let _0x4b601b=await Ne('ps',['-axo',_0x19ef4e(0x2d4)],Jn);return di(_0x4b601b);}async function fi(){const _0x3316a0=_0x25f477;return(await Ne('wmic',[_0x3316a0(0x19f),_0x3316a0(0x290),'ProcessId,CommandLine','/FORMAT:CSV'],Jn))[_0x3316a0(0x255)]('\x0a')[_0x3316a0(0x2fb)](_0x521219=>_0x521219['trim']())[_0x3316a0(0x1a0)](Boolean)['map'](_0x89d0fa=>{const _0xbdec8a=_0x3316a0;let _0x3b4d0e=_0x89d0fa['split'](',');if(_0x3b4d0e['length']<0x3)return null;let _0xbf0759=Number(_0x3b4d0e[_0x3b4d0e['length']-0x1]),_0x555523=_0x3b4d0e['slice'](0x1,_0x3b4d0e['length']-0x1)[_0xbdec8a(0x29b)](',');if(!Number['isFinite'](_0xbf0759)||_0xbf0759===0x0||!Zn(_0x555523))return null;let _0x376cce=Le(_0x555523);return _0x376cce?{'pid':_0xbf0759,'command':_0x555523,'agent':_0x376cce['agent']}:null;})['filter'](_0x33e8d4=>!!_0x33e8d4);}async function pi(){return process['platform']==='win32'?fi():ui();}async function mi(_0x2a19c9){const _0x2448a2=_0x25f477;let _0x27afe9=Date['now'](),_0x5795e7=ee['startTimer']('process.scan.pgrep_ms'),_0x12f7f5=await pi();_0x2a19c9&&(_0x2a19c9['pgrepMs']+=_0x5795e7()),_0x2a19c9&&(_0x2a19c9[_0x2448a2(0x2e8)]=_0x12f7f5['length']);let _0x2d5503=_0x12f7f5[_0x2448a2(0x1a0)](_0x5b2f65=>oi(_0x5b2f65[_0x2448a2(0x2f0)]));_0x2a19c9&&(_0x2a19c9['aliveProcesses']=_0x2d5503[_0x2448a2(0x233)]);let _0x546ba5=ee[_0x2448a2(0x292)](_0x2448a2(0x2a7)),_0x255aa5=[];for(let _0x14e9eb=0x0;_0x14e9eb<_0x2d5503[_0x2448a2(0x233)];_0x14e9eb+=qn){if(!Ws(_0x27afe9)){_0x2a19c9&&(_0x2a19c9['skippedProcessDetails']+=_0x2d5503[_0x2448a2(0x233)]-_0x14e9eb);break;}let _0x3da248=_0x2d5503[_0x2448a2(0x1f4)](_0x14e9eb,_0x14e9eb+qn),_0x2ac5d0=await Promise[_0x2448a2(0x293)](_0x3da248[_0x2448a2(0x2fb)](async _0x3e4adb=>{const _0x255be8=_0x2448a2;let [_0x1d4caa,_0x49eca3]=await Promise[_0x255be8(0x293)]([li(_0x3e4adb[_0x255be8(0x2f0)]),ci(_0x3e4adb['pid'])]);return{'pid':_0x3e4adb['pid'],'agent':_0x3e4adb[_0x255be8(0x1b1)],'command':_0x3e4adb['command'],'cwd':_0x1d4caa,'sessionFiles':_0x49eca3};}));_0x255aa5[_0x2448a2(0x27b)](..._0x2ac5d0);}return _0x2a19c9&&(_0x2a19c9[_0x2448a2(0x25c)]+=_0x546ba5()),_0x2a19c9&&(_0x2a19c9[_0x2448a2(0x256)]=_0x255aa5[_0x2448a2(0x233)]),_0x255aa5;}function er(_0x3e40db){return _0x3e40db['replace'](/[^a-zA-Z0-9]/g,'-');}async function gi(_0x31b4a8,_0x61e4ff){const _0x584f1d=_0x25f477;if(!_0x61e4ff)return null;try{if(_0x31b4a8===_0x584f1d(0x24f)){let _0x3f3f97=(0x0,N[_0x584f1d(0x29b)])((0x0,St[_0x584f1d(0x2b4)])(),_0x584f1d(0x1e3),_0x584f1d(0x231),er(_0x61e4ff)),_0x3871f3=(await(0x0,ge['readdir'])(_0x3f3f97)[_0x584f1d(0x23f)](()=>[]))['filter'](_0x362794=>_0x362794['endsWith']('.jsonl'));if(_0x3871f3['length']===0x0)return null;let _0x5eff27=null;if(await Promise['all'](_0x3871f3[_0x584f1d(0x2fb)](async _0x5a66fd=>{const _0x3de780=_0x584f1d;let _0x164419=await(0x0,ge[_0x3de780(0x2f4)])((0x0,N['join'])(_0x3f3f97,_0x5a66fd))['catch'](()=>null);_0x164419&&(!_0x5eff27||_0x164419['mtimeMs']>_0x5eff27[_0x3de780(0x2b5)])&&(_0x5eff27={'name':_0x5a66fd,'mtimeMs':_0x164419[_0x3de780(0x2b5)]});})),!_0x5eff27)return null;let _0x579d84=(0x0,N['join'])(_0x3f3f97,_0x5eff27[_0x584f1d(0x1fa)]),_0x44f5b3=P(_0x31b4a8,_0x579d84);return _0x44f5b3?{'sessionId':_0x44f5b3,'filePath':_0x579d84}:null;}return Ln(_0x61e4ff);}catch{return null;}}async function hi(_0x4d2c2a,_0x4b8f68,_0x42166b){const _0x21b615=_0x25f477;if(!_0x4b8f68||!_0x42166b)return null;try{if(_0x4d2c2a===_0x21b615(0x24f)){let _0x4f8e45=(0x0,N[_0x21b615(0x29b)])((0x0,St['homedir'])(),_0x21b615(0x1e3),_0x21b615(0x231),er(_0x4b8f68),_0x42166b+'.jsonl');return(await(0x0,ge['stat'])(_0x4f8e45)[_0x21b615(0x23f)](()=>null))?.['isFile']()?_0x4f8e45:null;}return null;}catch{return null;}}async function yi(_0x4f49b6){const _0x328792=_0x25f477;if(_0x4f49b6['sessionFilePath']||_0x4f49b6['confidence']!=='high')return _0x4f49b6;let _0x32a0fe=await hi(_0x4f49b6['agent'],_0x4f49b6[_0x328792(0x1d0)],_0x4f49b6[_0x328792(0x2ef)]);return _0x32a0fe?{..._0x4f49b6,'sessionFilePath':_0x32a0fe}:_0x4f49b6;}async function Si(){const _0x4da5c3=_0x25f477;let _0x3c243d={'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},_0x1fd8f6=ee['startTimer']('process.scan.total_ms'),_0x274e02=await mi(_0x3c243d),_0x1947ae=[],_0x3b1d6c=[];for(let _0x130915 of _0x274e02){let _0x422bf0=ri(_0x130915);if(_0x422bf0){_0x1947ae[_0x4da5c3(0x27b)](_0x422bf0);continue;}ni(_0x130915['agent'],_0x130915[_0x4da5c3(0x234)])&&_0x3b1d6c['push'](_0x130915);}_0x3c243d['directCandidates']=_0x1947ae[_0x4da5c3(0x233)],_0x3c243d[_0x4da5c3(0x246)]=_0x3b1d6c[_0x4da5c3(0x233)];let _0x4f8a8d=ee[_0x4da5c3(0x292)]('process.scan.fallback_ms'),_0x222141=await Promise['all'](_0x3b1d6c['map'](async _0x3de0b9=>{const _0x5d89a8=_0x4da5c3;let _0x28e29d=await gi(_0x3de0b9['agent'],_0x3de0b9['cwd']);return _0x28e29d?{'agent':_0x3de0b9['agent'],'pid':_0x3de0b9[_0x5d89a8(0x2f0)],'cwd':_0x3de0b9[_0x5d89a8(0x1d0)],'command':_0x3de0b9['command'],'sessionId':_0x28e29d['sessionId'],'confidence':_0x5d89a8(0x1e6),'sessionFilePath':_0x28e29d[_0x5d89a8(0x299)]}:null;}));_0x3c243d[_0x4da5c3(0x244)]=_0x4f8a8d(),_0x3c243d[_0x4da5c3(0x242)]=_0x222141['filter'](_0x58a6e8=>_0x58a6e8!==null)[_0x4da5c3(0x233)];let _0xf8fefd=ee['startTimer'](_0x4da5c3(0x30a)),_0x597558=await Promise['all']([..._0x1947ae,..._0x222141['filter'](_0xd3f17b=>_0xd3f17b!==null)]['map'](_0x232f32=>yi(_0x232f32))),_0x16d391=await Promise[_0x4da5c3(0x293)](_0x597558['map'](_0x85a5d0=>ai(_0x85a5d0)));_0x3c243d[_0x4da5c3(0x19d)]=_0xf8fefd(),_0x3c243d[_0x4da5c3(0x2a4)]=_0x16d391['filter'](_0x574edf=>_0x574edf!==null)[_0x4da5c3(0x233)];let _0xcb32d2=ii(_0x16d391['filter'](_0x56d9d3=>_0x56d9d3!==null));return _0x3c243d['totalMs']=_0x1fd8f6(),(_0x3c243d[_0x4da5c3(0x213)]>=Hs||_0x3c243d['fallbackLookups']>0x0)&&yt['info']({'durationMs':_0x3c243d[_0x4da5c3(0x213)],'pgrepMs':_0x3c243d['pgrepMs'],'lsofMs':_0x3c243d[_0x4da5c3(0x25c)],'fallbackMs':_0x3c243d[_0x4da5c3(0x244)],'hydrateMs':_0x3c243d['hydrateMs'],'matchedProcesses':_0x3c243d['matchedProcesses'],'aliveProcesses':_0x3c243d['aliveProcesses'],'snapshots':_0x3c243d['snapshots'],'skippedProcessDetails':_0x3c243d[_0x4da5c3(0x1ac)]||void 0x0,'directCandidates':_0x3c243d['directCandidates'],'fallbackLookups':_0x3c243d['fallbackLookups'],'fallbackHits':_0x3c243d['fallbackHits'],'hydratedCandidates':_0x3c243d[_0x4da5c3(0x2a4)],'sessions':_0xcb32d2[_0x4da5c3(0x233)]},_0x4da5c3(0x224)),me={'value':_0xcb32d2,'expiresAt':Date[_0x4da5c3(0x2af)]()+Bs},js=_0xcb32d2,_0xcb32d2;}async function tr(){return me&&Date['now']()<me['expiresAt']?me['value']:pe||(pe=Si()['finally'](()=>{pe=null;}),pe);}if(!Tt['parentPort'])throw new Error('inventory\x20scan\x20worker\x20requires\x20a\x20parent\x20port');var De=Tt['parentPort'],xi=x['child']({'module':'inventory-worker'}),Ti=new Fe(),nr=0x40;function rr(_0x5d2169){const _0x1b6e49=_0x25f477;if(process.env.VIBE_TEST!=='1')return;let _0x7891af=Number(process.env[_0x5d2169]??0x0);if(!Number['isFinite'](_0x7891af)||_0x7891af<=0x0)return;let _0x1559e6=Date[_0x1b6e49(0x2af)]()+Math['min'](_0x7891af,0x2710);for(;Date['now']()<_0x1559e6;);}async function Ci(_0x5b26cd){const _0x3cde70=_0x25f477;try{if(_0x5b26cd['kind']==='process')return rr('VIBE_TEST_PROCESS_WORKER_DELAY_MS'),_0x5b26cd[_0x3cde70(0x298)]&&Kn(),{'id':_0x5b26cd['id'],'ok':!0x0,'result':await tr()};rr(_0x3cde70(0x1f2));let _0x1a4c06=Date[_0x3cde70(0x2af)](),_0x54d7c5=await Ti['scan'](_0x57b345=>{const _0x3e22bb=_0x3cde70;De[_0x3e22bb(0x227)]({'id':_0x5b26cd['id'],'ok':!0x0,'progress':'session_batch_complete',..._0x57b345});});xi['info']({'durationMs':Date['now']()-_0x1a4c06,'sessions':_0x54d7c5[_0x3cde70(0x2dd)]['length'],'files':_0x54d7c5['totalFiles'],'changedFiles':_0x54d7c5[_0x3cde70(0x23b)],'reusedFiles':_0x54d7c5[_0x3cde70(0x2bd)],'removedFiles':_0x54d7c5['removedFiles']},_0x3cde70(0x2ce));for(let _0x159bf3=0x0;_0x159bf3<_0x54d7c5['sessions']['length'];_0x159bf3+=nr)De[_0x3cde70(0x227)]({'id':_0x5b26cd['id'],'ok':!0x0,'progress':'session_result_batch','sessions':_0x54d7c5[_0x3cde70(0x2dd)][_0x3cde70(0x1f4)](_0x159bf3,_0x159bf3+nr)});return{'id':_0x5b26cd['id'],'ok':!0x0,'result':{'scannedSessions':[],'runningSessions':[]}};}catch(_0xae834f){return{'id':_0x5b26cd['id'],'ok':!0x1,'error':_0xae834f instanceof Error?_0xae834f['name']+':\x20'+_0xae834f['message']:String(_0xae834f)};}}var sr=Promise['resolve']();De['on'](_0x25f477(0x2fd),_0x1cb627=>{sr=sr['then'](async()=>{De['postMessage'](await Ci(_0x1cb627));});});
|
|
1
|
+
'use strict';const _0x1ffb41=_0x1bf4;(function(_0xfea4a7,_0x8924df){const _0x4bbfe3=_0x1bf4,_0x77bc66=_0xfea4a7();while(!![]){try{const _0x217874=parseInt(_0x4bbfe3(0xe0))/0x1+parseInt(_0x4bbfe3(0x1bb))/0x2*(parseInt(_0x4bbfe3(0x124))/0x3)+-parseInt(_0x4bbfe3(0x117))/0x4+parseInt(_0x4bbfe3(0x11e))/0x5+-parseInt(_0x4bbfe3(0x180))/0x6*(-parseInt(_0x4bbfe3(0xb7))/0x7)+-parseInt(_0x4bbfe3(0x147))/0x8*(parseInt(_0x4bbfe3(0xca))/0x9)+-parseInt(_0x4bbfe3(0x13a))/0xa*(-parseInt(_0x4bbfe3(0x178))/0xb);if(_0x217874===_0x8924df)break;else _0x77bc66['push'](_0x77bc66['shift']());}catch(_0x19154c){_0x77bc66['push'](_0x77bc66['shift']());}}}(_0x4404,0x38502));var It=require('node:worker_threads'),Hn=require('node:fs/promises'),jn=require(_0x1ffb41(0x1ca)),zn=require(_0x1ffb41(0xb9)),R=require(_0x1ffb41(0x19e)),ee=require(_0x1ffb41(0x1ca)),v=require('node:path'),Et=require(_0x1ffb41(0x1ca)),U=require('node:path'),dr=new Set(['.c','.cc','.cpp','.cs','.css','.dart','.elm','.ex',_0x1ffb41(0xe7),_0x1ffb41(0xd1),'.go','.h','.hpp','.hrl','.java','.js',_0x1ffb41(0x170),'.kt','.kts','.less','.lua','.m',_0x1ffb41(0x14f),'.mjs','.php','.pl','.ps1','.py','.r',_0x1ffb41(0x1a7),_0x1ffb41(0x155),'.sass',_0x1ffb41(0xa2),'.scss','.sh',_0x1ffb41(0x9b),'.swift',_0x1ffb41(0x143),'.tsx','.vue','.xml','.yaml','.yml','.zsh']),Mt=_0x1ffb41(0x1b2),Rt='Generated\x20files:\x0a';function Q(_0x11bca6){const _0x17cb97=_0x1ffb41;return typeof _0x11bca6==_0x17cb97(0x11f)&&_0x11bca6[_0x17cb97(0x1d9)]()['length']>0x0?_0x11bca6['trim']():null;}function te(_0x2df85c){return!_0x2df85c||typeof _0x2df85c!='object'||Array['isArray'](_0x2df85c)?null:_0x2df85c;}function Oe(_0xcd0902){const _0x582a3a=_0x1ffb41;let _0x175f0d=_0xcd0902['trim']()[_0x582a3a(0xcf)](/[.,!?;:,。!?;:、]+$/u,''),_0x567b5f=_0x175f0d['indexOf']('#');_0x567b5f>0x0&&(_0x175f0d=_0x175f0d[_0x582a3a(0x135)](0x0,_0x567b5f));let _0x4150bd=_0x175f0d[_0x582a3a(0xa6)](/^(.*?)(:\d+(?::\d+)?)$/);return _0x4150bd?.[0x1]&&(_0x175f0d=_0x4150bd[0x1]),_0x175f0d;}function Ce(_0x4f7b28,_0x4a5a26){const _0x375c5=_0x1ffb41;let _0x364194=Oe(_0x4f7b28);return _0x364194?_0x364194[_0x375c5(0x11b)]('~/')?(0x0,U[_0x375c5(0x14e)])((0x0,Et['homedir'])(),_0x364194['slice'](0x2)):(0x0,U[_0x375c5(0x9c)])(_0x364194)?_0x364194:_0x4a5a26?(0x0,U['resolve'])(_0x4a5a26,_0x364194):_0x364194:'';}function fr(_0x1b05fa){const _0x4d2bfe=_0x1ffb41;return dr[_0x4d2bfe(0x121)]((0x0,U[_0x4d2bfe(0x1d1)])(Oe(_0x1b05fa))['toLowerCase']());}function $e(_0x14eb7c){let _0x1cff5c=Oe(_0x14eb7c);return _0x1cff5c?!fr(_0x1cff5c):!0x1;}function We(_0x39c9ce){const _0x96f291=_0x1ffb41;let _0x32167d=[...new Set(_0x39c9ce[_0x96f291(0x17c)](_0x38647f=>Ce(_0x38647f))['filter'](Boolean))];return _0x32167d[_0x96f291(0x194)]===0x0?'':_0x32167d[_0x96f291(0x194)]===0x1?''+Mt+_0x32167d[0x0]:''+Rt+_0x32167d[_0x96f291(0x96)]('\x0a');}function _t(_0x24d457){const _0x5bda2b=_0x1ffb41;return typeof _0x24d457!='string'?!0x1:_0x24d457[_0x5bda2b(0x11b)](Mt)||_0x24d457[_0x5bda2b(0x11b)](Rt);}function pr(_0x342212,_0x5b3f3f){let _0x259a2a=_0x342212['matchAll'](/^\*\*\* Add File: (.+)$/gm),_0x28ca21=new Set();for(let _0xfe3414 of _0x259a2a){let _0x535bbd=Q(_0xfe3414[0x1]);if(!_0x535bbd)continue;let _0x445cf5=Ce(_0x535bbd,_0x5b3f3f);!_0x445cf5||!$e(_0x445cf5)||_0x28ca21['add'](_0x445cf5);}return[..._0x28ca21];}function mr(_0x165d33){let _0xe6b0b9=Q(_0x165d33);return _0xe6b0b9?_0xe6b0b9['toLowerCase']():'';}function gr(_0x57b109,_0x843c1e){let _0x27e5e9=Q(_0x57b109?.['file_path'])??Q(_0x57b109?.['path']);if(!_0x27e5e9)return null;let _0x2dcc55=Ce(_0x27e5e9,_0x843c1e);return _0x2dcc55&&$e(_0x2dcc55)?_0x2dcc55:null;}function Pt(_0x18ad78,_0x518ad1,_0x594c1d){return mr(_0x18ad78)!=='write'?null:gr(_0x518ad1,_0x594c1d);}function hr(_0x50ee29){const _0x4002d4=_0x1ffb41;let _0x3d91b6=_0x50ee29['toLowerCase']();return _0x3d91b6['includes'](_0x4002d4(0x1e0))||_0x3d91b6['includes']('updated.\x20all\x20occurrences\x20were\x20successfully\x20replaced')||_0x3d91b6[_0x4002d4(0x9f)]('all\x20occurrences\x20were\x20successfully\x20replaced')||_0x3d91b6[_0x4002d4(0x9f)]('successfully\x20replaced');}function Sr(_0x337fed){const _0x2fbb5c=_0x1ffb41;return/^\d+\t/m[_0x2fbb5c(0x150)](_0x337fed);}function Ft(_0x41f353,_0x17aa71){const _0x93b551=_0x1ffb41;let _0x5ee2d7=typeof _0x17aa71=='string'?_0x17aa71[_0x93b551(0x1d9)]():'';if(_0x5ee2d7&&hr(_0x5ee2d7))return!0x1;let _0x440dd6=te(_0x41f353);if(_0x440dd6?.[_0x93b551(0x10d)]===_0x93b551(0x9d)||_0x440dd6?.[_0x93b551(0x10d)]===_0x93b551(0xcf)||_0x440dd6&&(Object[_0x93b551(0xa3)](_0x440dd6,'oldString')||Object['hasOwn'](_0x440dd6,'structuredPatch')||Object['hasOwn'](_0x440dd6,_0x93b551(0xff))||Object[_0x93b551(0xa3)](_0x440dd6,'replaceAll')))return!0x1;if(typeof te(_0x440dd6?.['file'])?.['filePath']==_0x93b551(0x11f)||typeof _0x440dd6?.['filePath']=='string')return!0x0;if(_0x5ee2d7){let _0x89afd9=_0x5ee2d7[_0x93b551(0x1e4)]();if(_0x89afd9['includes'](_0x93b551(0xc5))||_0x89afd9['includes']('has\x20been\x20created')||Sr(_0x5ee2d7))return!0x0;}return!0x1;}function kt(_0x406367,_0x184209){const _0x35fd71=_0x1ffb41;let _0x1e91fd=te(_0x406367);if(!_0x1e91fd)return[];let _0xdee0ed=new Set();if(_0x1e91fd[_0x35fd71(0x10d)]===_0x35fd71(0xe9)){let _0x409db2=te(_0x1e91fd['payload']);if(_0x409db2?.['type']===_0x35fd71(0x110)){let _0x2355ec=Q(_0x409db2['saved_path']);if(_0x2355ec){let _0x3177cc=Ce(_0x2355ec,_0x184209?.[_0x35fd71(0x17a)]);_0x3177cc&&$e(_0x3177cc)&&_0xdee0ed['add'](_0x3177cc);}}}if(_0x184209?.['includePatchCalls']&&_0x1e91fd[_0x35fd71(0x10d)]===_0x35fd71(0x1c3)){let _0x4f7e66=te(_0x1e91fd['payload']);if(_0x4f7e66?.[_0x35fd71(0x10d)]===_0x35fd71(0x197)&&_0x4f7e66[_0x35fd71(0x1e3)]==='apply_patch'){let _0x2097e7=Q(_0x4f7e66['arguments']);if(_0x2097e7){for(let _0x174ba1 of pr(_0x2097e7,_0x184209?.['cwd']))_0xdee0ed[_0x35fd71(0x173)](_0x174ba1);}}}return[..._0xdee0ed];}var we=require('node:fs'),Lt=require('node:os'),h=require('node:path'),O=(0x0,h['join'])((0x0,Lt[_0x1ffb41(0xb2)])(),'.vibelet'),Te=(0x0,h[_0x1ffb41(0x96)])(O,'logs'),ne=(0x0,h['join'])(O,'data'),Nt=(0x0,h[_0x1ffb41(0x96)])(O,_0x1ffb41(0xd0)),Io=(0x0,h[_0x1ffb41(0x96)])(Nt,_0x1ffb41(0x1a6)),Eo=(0x0,h['join'])(Nt,_0x1ffb41(0x177)),Mo=(0x0,h['join'])(O,'identity.json'),Ro=(0x0,h[_0x1ffb41(0x96)])(O,'pairings.json'),_o=(0x0,h[_0x1ffb41(0x96)])(ne,'device-profiles.json'),Po=(0x0,h['join'])(ne,'push-subscriptions.json'),Fo=(0x0,h['join'])(ne,_0x1ffb41(0x182)),ko=(0x0,h['join'])(ne,'audit.jsonl'),Lo=(0x0,h['join'])(ne,_0x1ffb41(0x1a1)),Dt=(0x0,h[_0x1ffb41(0x96)])(Te,'daemon.stdout.log'),Ut=(0x0,h['join'])(Te,'daemon.stderr.log'),No=(0x0,h['join'])(O,'update-check.json'),Do=(0x0,h[_0x1ffb41(0x96)])(O,'pairing-qr.png'),Ae={'stdout':!0x1,'stderr':!0x1};function Ot(_0x4ee03d){const _0x860906=_0x1ffb41;if(!_0x4ee03d||typeof _0x4ee03d!='object')return!0x1;let _0x125727=typeof _0x4ee03d[_0x860906(0x1c5)]=='string'?_0x4ee03d[_0x860906(0x1c5)]:'';return _0x125727==='EIO'||_0x125727===_0x860906(0x12d);}function yr(_0x3825ec){return!_0x3825ec['destroyed']&&_0x3825ec['writable']!==!0x1;}function $t(_0x408cbe,_0x26b8da){const _0x397386=_0x1ffb41;if(Ae[_0x408cbe])return!0x1;let _0x407550=_0x408cbe===_0x397386(0x98)?process['stderr']:process['stdout'];if(!yr(_0x407550))return Ae[_0x408cbe]=!0x0,!0x1;try{return _0x407550['write'](_0x26b8da,_0x3a2e0f=>{Ot(_0x3a2e0f)&&(Ae[_0x408cbe]=!0x0);}),!0x0;}catch(_0x3e3a6f){return Ot(_0x3e3a6f)&&(Ae[_0x408cbe]=!0x0),!0x1;}}function Wt(_0x2606e9){const _0x4beb77=_0x1ffb41;return $t(_0x4beb77(0x18c),_0x2606e9);}function Bt(_0x1e79e3){const _0x3ff265=_0x1ffb41;return $t(_0x3ff265(0x98),_0x1e79e3);}var Ht={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},xr=process.env.VIBE_LOG_LEVEL||'info';function Cr(){const _0x40d95d=_0x1ffb41;return process.env.VIBE_TEST==='1'||process['argv']['includes'](_0x40d95d(0x1d7));}function Tr(){try{let {fstatSync:_0x280c89}=require('node:fs');return _0x280c89(0x1)['isFile']();}catch{return!0x1;}}var zt=!Cr()&&!Tr();if(zt)try{(0x0,we['mkdirSync'])(Te,{'recursive':!0x0});}catch{}function jt(_0x4362cd,_0x5b6364,_0x7ef428){const _0x56d2f3=_0x1ffb41;if(Ht[_0x4362cd]<Ht[xr])return;let _0x32b305={'level':_0x4362cd,'ts':new Date()['toISOString'](),'msg':_0x7ef428,..._0x5b6364},_0x4f6a65=JSON['stringify'](_0x32b305);if(_0x4362cd===_0x56d2f3(0xfb)||_0x4362cd===_0x56d2f3(0x12a)?Bt(_0x4f6a65+'\x0a'):Wt(_0x4f6a65+'\x0a'),zt){let _0x19c592=_0x4362cd==='error'||_0x4362cd===_0x56d2f3(0x12a)?Ut:Dt;try{(0x0,we['appendFileSync'])(_0x19c592,_0x4f6a65+'\x0a');}catch{}}}function qt(_0x3e9b07={}){const _0x49e20d=_0x1ffb41;function _0x38db36(_0x3fba5a,_0x2c99c8,_0x4c42a6){typeof _0x2c99c8=='string'?jt(_0x3fba5a,_0x3e9b07,_0x2c99c8):jt(_0x3fba5a,{..._0x3e9b07,..._0x2c99c8},_0x4c42a6);}return{'debug':(_0x4d0db1,_0x2a9c77)=>_0x38db36(_0x49e20d(0x17b),_0x4d0db1,_0x2a9c77),'info':(_0x120505,_0x485ec8)=>_0x38db36('info',_0x120505,_0x485ec8),'warn':(_0x3bf4fe,_0x2249d8)=>_0x38db36(_0x49e20d(0x12a),_0x3bf4fe,_0x2249d8),'error':(_0x2acb5c,_0x28ce02)=>_0x38db36(_0x49e20d(0xfb),_0x2acb5c,_0x28ce02),'child':_0x192ff6=>qt({..._0x3e9b07,..._0x192ff6})};}var S=qt({'module':'daemon'});function re(_0x4bd473){let _0xbb71e9=new Map();return{'get'(_0x1c3bac){const _0x134237=_0x1bf4;let _0x4e3049=_0xbb71e9['get'](_0x1c3bac);if(_0x4e3049){if(Date['now']()>_0x4e3049[_0x134237(0x17f)]){_0xbb71e9[_0x134237(0x12c)](_0x1c3bac);return;}return _0x4e3049['value'];}},'set'(_0x16921c,_0x53b0b2){const _0xdc2028=_0x1bf4;_0xbb71e9[_0xdc2028(0x151)](_0x16921c,{'value':_0x53b0b2,'expiresAt':Date[_0xdc2028(0x138)]()+_0x4bd473});},'clear'(){const _0x17c8eb=_0x1bf4;_0xbb71e9[_0x17c8eb(0xab)]();}};}var dn=require(_0x1ffb41(0x19e)),w=require('node:fs/promises'),se=require(_0x1ffb41(0x1ca)),C=require('node:path'),b=0x18;async function _(_0x170ed7,_0x4183b3,_0x222cba){const _0x3681b1=_0x1ffb41;if(_0x170ed7['length']===0x0)return[];let _0x36168d=Math['max'](0x1,Math[_0x3681b1(0x137)](_0x4183b3,_0x170ed7['length'])),_0x3fd44c=new Array(_0x170ed7['length']),_0x108c7d=0x0;return await Promise[_0x3681b1(0x1a8)](Array[_0x3681b1(0x188)]({'length':_0x36168d},async()=>{for(;;){let _0x2afabd=_0x108c7d;if(_0x108c7d+=0x1,_0x2afabd>=_0x170ed7['length'])return;_0x3fd44c[_0x2afabd]=await _0x222cba(_0x170ed7[_0x2afabd],_0x2afabd);}})),_0x3fd44c;}async function J(_0x494787){const _0x2d493d=_0x1ffb41;let _0x28e880=(await _(_0x494787,b,async _0x481392=>{const _0x42a887=_0x1bf4;let _0x14897a=await(0x0,w['stat'])(_0x481392)[_0x42a887(0xb5)](()=>null);return _0x14897a?.['isFile']()?{'path':_0x481392,'mtimeMs':_0x14897a[_0x42a887(0x122)],'birthtimeMs':_0x14897a[_0x42a887(0x1d2)],'size':_0x14897a['size']}:null;}))['filter'](_0xfbf367=>_0xfbf367!==null);return _0x28e880['sort']((_0xe39e8b,_0x4906e0)=>_0x4906e0[_0x2d493d(0x122)]-_0xe39e8b[_0x2d493d(0x122)]),_0x28e880;}async function Be(){const _0x41c28c=_0x1ffb41;let _0x2a99d9=(0x0,C['join'])((0x0,se['homedir'])(),_0x41c28c(0x112),_0x41c28c(0xcc)),_0x333e67=[],_0x203645=await(0x0,w[_0x41c28c(0x8c)])(_0x2a99d9,{'withFileTypes':!0x0})['catch'](()=>[]);for(let _0x458a68 of _0x203645){if(!_0x458a68['isDirectory']())continue;let _0x2d22c1=(0x0,C['join'])(_0x2a99d9,_0x458a68[_0x41c28c(0x1e3)]),_0x5263e8=await(0x0,w[_0x41c28c(0x8c)])(_0x2d22c1)['catch'](()=>[]);for(let _0x19e360 of _0x5263e8)_0x19e360[_0x41c28c(0x1b6)]('.jsonl')&&_0x333e67['push']((0x0,C['join'])(_0x2d22c1,_0x19e360));}return _0x333e67;}async function oe(_0x95ed2=(0x0,C['join'])((0x0,se[_0x1ffb41(0xb2)])(),'Library',_0x1ffb41(0xdc),'Claude',_0x1ffb41(0x165)),_0x45371e=0x0){const _0x4f8f8f=_0x1ffb41;if(_0x45371e>0x4)return[];let _0x498585=await(0x0,w[_0x4f8f8f(0x8c)])(_0x95ed2,{'withFileTypes':!0x0})['catch'](()=>[]),_0x57ade3=[];for(let _0xe19f96 of _0x498585){let _0x51de45=(0x0,C['join'])(_0x95ed2,_0xe19f96['name']);_0xe19f96[_0x4f8f8f(0x168)]()?_0x57ade3[_0x4f8f8f(0x15c)](...await oe(_0x51de45,_0x45371e+0x1)):_0xe19f96[_0x4f8f8f(0x11a)]()&&_0xe19f96['name'][_0x4f8f8f(0x1b6)](_0x4f8f8f(0xfe))&&_0x57ade3[_0x4f8f8f(0x15c)](_0x51de45);}return _0x57ade3;}async function Ar(){const _0x35fd56=_0x1ffb41;let _0x5216c2=(0x0,C['join'])((0x0,se[_0x35fd56(0xb2)])(),'.codex','sessions'),_0x13eacd=(0x0,C['join'])((0x0,se[_0x35fd56(0xb2)])(),'.codex','archived_sessions'),_0x146290=[],_0x116ab6=await(0x0,w[_0x35fd56(0x8c)])(_0x5216c2)['catch'](()=>[]);for(let _0x512d84 of _0x116ab6){let _0x962dcd=(0x0,C['join'])(_0x5216c2,_0x512d84),_0x482835=await(0x0,w[_0x35fd56(0x8c)])(_0x962dcd)[_0x35fd56(0xb5)](()=>[]);for(let _0x499c7b of _0x482835){let _0x55ad4b=(0x0,C['join'])(_0x962dcd,_0x499c7b),_0x5a6cb9=await(0x0,w['readdir'])(_0x55ad4b)[_0x35fd56(0xb5)](()=>[]);for(let _0x16ef6c of _0x5a6cb9){let _0x39ed3e=(0x0,C[_0x35fd56(0x96)])(_0x55ad4b,_0x16ef6c),_0x3c8844=await(0x0,w['readdir'])(_0x39ed3e)['catch'](()=>[]);for(let _0x949ab7 of _0x3c8844)_0x949ab7[_0x35fd56(0x1b6)](_0x35fd56(0x1b5))&&_0x146290['push']((0x0,C[_0x35fd56(0x96)])(_0x39ed3e,_0x949ab7));}}}let _0x3e338e=await(0x0,w['readdir'])(_0x13eacd)['catch'](()=>[]);for(let _0x13d712 of _0x3e338e)_0x13d712[_0x35fd56(0x1b6)]('.jsonl')&&_0x146290['push']((0x0,C['join'])(_0x13eacd,_0x13d712));return _0x146290;}async function ie(){let _0x5062e0=await Ar();return J(_0x5062e0);}var k=require('node:child_process'),I=require('node:fs'),W=require('node:os'),d=require(_0x1ffb41(0xb9)),wr=[_0x1ffb41(0x103)],br=0xea60,$=process[_0x1ffb41(0xe1)]===_0x1ffb41(0x153);function F(_0x41b3d9){const _0xee950b=_0x1ffb41;return wr['some'](_0x4c8b03=>_0x41b3d9[_0xee950b(0x9f)](_0x4c8b03));}function vr(_0x1e0064){const _0x9080d=_0x1ffb41;if(!_0x1e0064||!F(_0x1e0064))return _0x1e0064;try{let _0x33e022=(0x0,d['join'])((0x0,I[_0x9080d(0x9e)])((0x0,d[_0x9080d(0xd2)])(_0x1e0064)),(0x0,d['basename'])(_0x1e0064));if((0x0,I[_0x9080d(0x99)])(_0x33e022)&&!F(_0x33e022))return _0x33e022;}catch{}return _0x1e0064;}function Ir(_0x1fde5a){if(!_0x1fde5a||!F(_0x1fde5a))return _0x1fde5a;try{let _0x3c436a=(0x0,I['realpathSync'])(_0x1fde5a);if(_0x3c436a&&!F(_0x3c436a))return _0x3c436a;}catch{}return _0x1fde5a;}function Gt(){const _0x384a1c=_0x1ffb41;return $?[]:[process.env.SHELL,_0x384a1c(0x146),_0x384a1c(0x17d),'/bin/sh']['filter'](_0xe9e2df=>!!_0xe9e2df)['filter']((_0x4ed5f6,_0x231f6e,_0x3152e5)=>_0x3152e5['indexOf'](_0x4ed5f6)===_0x231f6e)[_0x384a1c(0xbc)](_0x3e839f=>(0x0,I['existsSync'])(_0x3e839f));}function Vt(_0xd35065,_0x4674d9){const _0x2c1760=_0x1ffb41;let _0x57fa1a=_0x40c5d0=>{let _0x376615=/^v?(\d+)\.(\d+)\.(\d+)/['exec'](_0x40c5d0);return _0x376615?[Number(_0x376615[0x1]),Number(_0x376615[0x2]),Number(_0x376615[0x3])]:null;},_0x5f5514=_0x57fa1a(_0xd35065),_0x1b5589=_0x57fa1a(_0x4674d9);if(!_0x5f5514&&!_0x1b5589)return _0x4674d9['localeCompare'](_0xd35065);if(!_0x5f5514)return 0x1;if(!_0x1b5589)return-0x1;for(let _0x17dcc0=0x0;_0x17dcc0<_0x5f5514[_0x2c1760(0x194)];_0x17dcc0+=0x1)if(_0x5f5514[_0x17dcc0]!==_0x1b5589[_0x17dcc0])return _0x1b5589[_0x17dcc0]-_0x5f5514[_0x17dcc0];return 0x0;}function Qt(){const _0x320c62=_0x1ffb41;let _0x90bbaa=(0x0,W['homedir'])(),_0x474585=(0x0,d['join'])(_0x90bbaa,'.nvm','versions','node'),_0x31e6c2=[(0x0,d['join'])(_0x90bbaa,'.nvm','current',_0x320c62(0x133))];try{let _0x45ca55=(0x0,I['readdirSync'])(_0x474585,{'withFileTypes':!0x0})[_0x320c62(0xbc)](_0x59ef8a=>_0x59ef8a[_0x320c62(0x168)]())['map'](_0x4ba6d0=>_0x4ba6d0[_0x320c62(0x1e3)])['sort'](Vt);for(let _0x24497d of _0x45ca55)_0x31e6c2['push']((0x0,d['join'])(_0x474585,_0x24497d,'bin'));}catch{}return _0x31e6c2;}function Jt(){const _0x1bab3c=_0x1ffb41;let _0x8d4eba=(0x0,W[_0x1bab3c(0xb2)])(),_0x4a20f0=[process.env.FNM_DIR,(0x0,d['join'])(_0x8d4eba,'.local',_0x1bab3c(0x89),_0x1bab3c(0x167)),(0x0,d['join'])(_0x8d4eba,'Library','Application\x20Support',_0x1bab3c(0x167)),(0x0,d['join'])(_0x8d4eba,_0x1bab3c(0x85))][_0x1bab3c(0xbc)](_0x5f52c2=>!!_0x5f52c2),_0x49afc7=[],_0x1a0c21=new Set();for(let _0x4e7682 of _0x4a20f0){if(_0x1a0c21['has'](_0x4e7682))continue;_0x1a0c21[_0x1bab3c(0x173)](_0x4e7682);let _0x3437e4=(0x0,d['join'])(_0x4e7682,_0x1bab3c(0x1ad));try{let _0x5721d8=(0x0,I['readdirSync'])(_0x3437e4,{'withFileTypes':!0x0})[_0x1bab3c(0xbc)](_0xc68f5e=>_0xc68f5e['isDirectory']())[_0x1bab3c(0x17c)](_0x543767=>_0x543767['name'])['sort'](Vt);for(let _0x69075a of _0x5721d8)_0x49afc7['push']((0x0,d['join'])(_0x3437e4,_0x69075a,_0x1bab3c(0x16d),_0x1bab3c(0x133))),_0x49afc7[_0x1bab3c(0x15c)]((0x0,d[_0x1bab3c(0x96)])(_0x3437e4,_0x69075a,'bin'));}catch{}}return _0x49afc7;}var K=null,He=!0x1,Er=null;function Mr(_0x107db5){const _0x20a983=_0x1ffb41;let _0x4bc631={};for(let _0x4b4eec of _0x107db5[_0x20a983(0x12f)]('\x0a')){let _0x3709ea=_0x4b4eec['indexOf']('=');_0x3709ea>0x0&&(_0x4bc631[_0x4b4eec['slice'](0x0,_0x3709ea)]=_0x4b4eec['slice'](_0x3709ea+0x1));}return _0x4bc631;}function Kt(){const _0x2fb931=_0x1ffb41;if(He)return K??{};if(Er)return{};let _0x532d45=Gt()[0x0];if(!_0x532d45)return He=!0x0,K={},K;try{K=Mr((0x0,k['execFileSync'])(_0x532d45,[_0x2fb931(0x184),_0x2fb931(0x126)],{'timeout':0x1388,'encoding':'utf-8','stdio':[_0x2fb931(0x169),_0x2fb931(0x169),_0x2fb931(0x169)]}));}catch{K={};}return He=!0x0,K;}function Rr(_0x159446=Kt()){const _0x3cb9b9=_0x1ffb41;let _0x3f4a18=(0x0,W[_0x3cb9b9(0xb2)])(),_0x4835a3=_0x159446['PNPM_HOME']||process.env.PNPM_HOME||($?(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,_0x3cb9b9(0xda)):(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,'Library',_0x3cb9b9(0xda))),_0x20732c=_0x159446[_0x3cb9b9(0x176)]||process.env.PATH||'',_0x1cf46d=$?[(0x0,d['join'])(_0x3f4a18,_0x3cb9b9(0xe5),'bin'),(0x0,d['join'])(_0x3f4a18,_0x3cb9b9(0xb3),_0x3cb9b9(0x133)),(0x0,d['join'])(_0x3f4a18,'.claude','bin'),(0x0,d['join'])(_0x3f4a18,_0x3cb9b9(0x195),_0x3cb9b9(0x1c2),'standalone','current','bin'),_0x4835a3,(0x0,d['join'])(_0x3f4a18,'AppData',_0x3cb9b9(0xa8),'npm'),(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,_0x3cb9b9(0x116),'Local',_0x3cb9b9(0x114),_0x3cb9b9(0x19f))]:[_0x3cb9b9(0x187),_0x3cb9b9(0xf9),_0x3cb9b9(0xa9),'/bin',(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,_0x3cb9b9(0xe5),_0x3cb9b9(0x133)),(0x0,d['join'])(_0x3f4a18,_0x3cb9b9(0xb3),'bin'),(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,_0x3cb9b9(0x112),_0x3cb9b9(0x133)),(0x0,d[_0x3cb9b9(0x96)])(_0x3f4a18,_0x3cb9b9(0x195),'packages',_0x3cb9b9(0x1a9),_0x3cb9b9(0x1a6),'bin'),_0x4835a3,...Qt(),...Jt()],_0x1abe55=_0x20732c[_0x3cb9b9(0x12f)](d['delimiter'])[_0x3cb9b9(0xbc)](Boolean)['map'](Ir),_0x4a3659=new Set(_0x1abe55);for(let _0x17621e of _0x1cf46d)_0x4a3659['has'](_0x17621e)||(_0x1abe55['push'](_0x17621e),_0x4a3659['add'](_0x17621e));return _0x1abe55['join'](d['delimiter']);}function je(){const _0xdad90d=_0x1ffb41;let _0x48cdce=Kt(),_0x9dd8ac={};for(let [_0x4347ca,_0xa45130]of Object['entries'](process.env))typeof _0xa45130==_0xdad90d(0x11f)&&(_0x9dd8ac[_0x4347ca]=_0xa45130);for(let [_0x536a02,_0xfd4931]of Object[_0xdad90d(0x166)](_0x48cdce))typeof _0xfd4931=='string'&&(_0x9dd8ac[_0x536a02]=_0xfd4931);return _0x9dd8ac[_0xdad90d(0x176)]=Rr(_0x48cdce),_0x9dd8ac[_0xdad90d(0x8a)]||(_0x9dd8ac['HOME']=(0x0,W['homedir'])()),delete _0x9dd8ac[_0xdad90d(0x198)],delete _0x9dd8ac[_0xdad90d(0x1d4)],_0x9dd8ac;}function Xt(_0x82db51){const _0x140851=_0x1ffb41;if($)try{let _0x335708=(0x0,k['execFileSync'])('where.exe',[_0x82db51],{'timeout':0xbb8,'stdio':_0x140851(0x169),'encoding':'utf-8'})[_0x140851(0x1d9)]()[_0x140851(0x12f)](/\r?\n/)[_0x140851(0xbc)](Boolean);return _0x335708['find'](_0x5626ef=>_0x5626ef['endsWith']('.exe'))??_0x335708[0x0];}catch{return;}}function ae(_0x35e91f,_0x1f77f4=0xbb8){const _0x38ba63=_0x1ffb41;try{return(0x0,k['execFileSync'])(_0x35e91f,[_0x38ba63(0x105)],{'timeout':_0x1f77f4,'stdio':'pipe','encoding':'utf-8','env':je(),...$?{'shell':!0x0}:{}})[_0x38ba63(0x1d9)]()||null;}catch{return null;}}function _r(_0x23abb4){const _0x582d82=_0x1ffb41;for(let _0x3c1df5 of Gt())try{let _0xa09fe9=(0x0,k[_0x582d82(0xa4)])(_0x3c1df5,['-ilc','command\x20-v\x20'+_0x23abb4],{'timeout':0x1388,'stdio':['pipe','pipe','pipe'],'encoding':'utf-8'})['trim']();if(_0xa09fe9)return _0xa09fe9;}catch{}}function Pr(){const _0x2b1086=_0x1ffb41;let _0x587ffb=(0x0,W[_0x2b1086(0xb2)])();return[(0x0,d['join'])(_0x587ffb,'.local','bin',_0x2b1086(0x127)),(0x0,d[_0x2b1086(0x96)])(_0x587ffb,'.claude','bin','claude'),_0x2b1086(0x15b),_0x2b1086(0xc8),(0x0,d['join'])(_0x587ffb,_0x2b1086(0xe5),_0x2b1086(0x133),'claude')];}function Fr(){const _0x48b84e=_0x1ffb41;if($){let _0x55632a=Xt(_0x48b84e(0x127));return _0x55632a&&ae(_0x55632a)?_0x55632a:void 0x0;}for(let _0x497d98 of Pr())if(ae(_0x497d98))return _0x497d98;try{let _0x43db4a=(0x0,k[_0x48b84e(0xa4)])('/usr/bin/which',['claude'],{'timeout':0xbb8,'stdio':'pipe','encoding':'utf-8','env':je()})[_0x48b84e(0x1d9)]();if(_0x43db4a&&!_0x43db4a['includes'](_0x48b84e(0x8f))&&ae(_0x43db4a))return _0x43db4a;}catch{}}function kr(){const _0x2b4cf8=_0x1ffb41;let _0x4f3264=(0x0,W['homedir'])(),_0x3cb9d7=[process.env.PNPM_HOME,(0x0,d[_0x2b4cf8(0x96)])(_0x4f3264,'Library',_0x2b4cf8(0xda))]['filter'](_0x30b2a2=>!!_0x30b2a2);return['/usr/local/bin/codex','/opt/homebrew/bin/codex',(0x0,d[_0x2b4cf8(0x96)])(_0x4f3264,'.npm-global',_0x2b4cf8(0x133),'codex'),(0x0,d[_0x2b4cf8(0x96)])(_0x4f3264,_0x2b4cf8(0xb3),'bin','codex'),(0x0,d[_0x2b4cf8(0x96)])(_0x4f3264,_0x2b4cf8(0x195),'packages',_0x2b4cf8(0x1a9),_0x2b4cf8(0x1a6),'bin','codex'),...Qt()['map'](_0x9b03e6=>(0x0,d['join'])(_0x9b03e6,_0x2b4cf8(0x154))),...Jt()['map'](_0x5866b9=>(0x0,d[_0x2b4cf8(0x96)])(_0x5866b9,_0x2b4cf8(0x154))),..._0x3cb9d7['map'](_0xd056d8=>(0x0,d[_0x2b4cf8(0x96)])(_0xd056d8,'codex'))];}function Lr(){const _0x1bc3e6=_0x1ffb41;if($){let _0x102f48=Xt('codex');return _0x102f48&&ae(_0x102f48)?_0x102f48:void 0x0;}let _0x51ebf1=_0x25e900=>{let _0x4be7ea=vr(_0x25e900);return ae(_0x4be7ea)?_0x4be7ea:void 0x0;},_0x35a9af;for(let _0x491ee9 of kr()){let _0x11901a=_0x51ebf1(_0x491ee9);if(_0x11901a){if(!F(_0x11901a))return _0x11901a;_0x35a9af=_0x11901a;}}try{let _0x52f8f3=(0x0,k['execFileSync'])('/usr/bin/which',['codex'],{'timeout':0xbb8,'stdio':'pipe','encoding':_0x1bc3e6(0xe6),'env':je()})['trim'](),_0x2f2040=_0x52f8f3?_0x51ebf1(_0x52f8f3):void 0x0;if(_0x2f2040){if(!F(_0x2f2040))return _0x2f2040;_0x35a9af=_0x35a9af??_0x2f2040;}}catch{}let _0x11eb68=_r('codex'),_0x34e1e4=_0x11eb68?_0x51ebf1(_0x11eb68):void 0x0;if(_0x34e1e4){if(!F(_0x34e1e4))return _0x34e1e4;_0x35a9af=_0x35a9af??_0x34e1e4;}return _0x35a9af;}function Yt(_0x5dd788){const _0x2bf9b3=_0x1ffb41;return _0x5dd788==='claude'?'CLAUDE_PATH':_0x2bf9b3(0x149);}function Nr(_0x37752c){let _0x4f96f6=process.env[Yt(_0x37752c)];return _0x4f96f6||(_0x37752c==='claude'?Fr()??null:Lr()??null);}function Zt(_0x51eeb7){let _0x2df9b9=null,_0x57ea58=0x0;return()=>{const _0x5ca3d5=_0x1bf4;let _0x3275f8=process.env[Yt(_0x51eeb7)];if(_0x3275f8)return _0x3275f8;let _0x4b17e4=Date['now']();return(!_0x2df9b9||_0x4b17e4-_0x57ea58>br||!(0x0,I[_0x5ca3d5(0x99)])(_0x2df9b9)||F(_0x2df9b9))&&(_0x2df9b9=Nr(_0x51eeb7)??_0x51eeb7,_0x57ea58=_0x4b17e4),_0x2df9b9;};}var zo=Zt('claude'),qo=Zt(_0x1ffb41(0x154));function E(_0x57cf1d){const _0x33656e=_0x1ffb41;return!_0x57cf1d||typeof _0x57cf1d!=_0x33656e(0xdd)||Array['isArray'](_0x57cf1d)?null:_0x57cf1d;}function _0x1bf4(_0x3449d0,_0x56a648){_0x3449d0=_0x3449d0-0x84;const _0x4404a4=_0x4404();let _0x1bf4ba=_0x4404a4[_0x3449d0];if(_0x1bf4['ykSjaQ']===undefined){var _0x573749=function(_0x521cc8){const _0x157c1a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11bca6='',_0x2df85c='';for(let _0xcd0902=0x0,_0x175f0d,_0x567b5f,_0x4150bd=0x0;_0x567b5f=_0x521cc8['charAt'](_0x4150bd++);~_0x567b5f&&(_0x175f0d=_0xcd0902%0x4?_0x175f0d*0x40+_0x567b5f:_0x567b5f,_0xcd0902++%0x4)?_0x11bca6+=String['fromCharCode'](0xff&_0x175f0d>>(-0x2*_0xcd0902&0x6)):0x0){_0x567b5f=_0x157c1a['indexOf'](_0x567b5f);}for(let _0x4f7b28=0x0,_0x4a5a26=_0x11bca6['length'];_0x4f7b28<_0x4a5a26;_0x4f7b28++){_0x2df85c+='%'+('00'+_0x11bca6['charCodeAt'](_0x4f7b28)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2df85c);};_0x1bf4['lDaFYe']=_0x573749,_0x1bf4['GLKJen']={},_0x1bf4['ykSjaQ']=!![];}const _0x339581=_0x4404a4[0x0],_0x502ef3=_0x3449d0+_0x339581,_0x1b5ac5=_0x1bf4['GLKJen'][_0x502ef3];return!_0x1b5ac5?(_0x1bf4ba=_0x1bf4['lDaFYe'](_0x1bf4ba),_0x1bf4['GLKJen'][_0x502ef3]=_0x1bf4ba):_0x1bf4ba=_0x1b5ac5,_0x1bf4ba;}function le(_0x18bced){let _0xde3c89=Number(_0x18bced);return Number['isFinite'](_0xde3c89)?_0xde3c89:null;}function Dr(_0x236c1b){let _0xe9fd45=le(_0x236c1b);return _0xe9fd45===null||_0xe9fd45<=0x0?null:Math['floor'](_0xe9fd45);}function ce(_0xb20a3b){const _0x27a479=_0x1ffb41;let _0x45bff4=E(_0xb20a3b);if(!_0x45bff4)return;let _0x5c6d73=le(_0x45bff4['input_tokens']??_0x45bff4[_0x27a479(0x1a0)]),_0x19f2b8=le(_0x45bff4[_0x27a479(0xb4)]??_0x45bff4[_0x27a479(0x1a2)]);if(_0x5c6d73===null||_0x19f2b8===null)return;let _0x5afe8c=le(_0x45bff4['cache_creation_input_tokens']??_0x45bff4[_0x27a479(0x86)]),_0x1d1db7=le(_0x45bff4[_0x27a479(0x1b8)]??_0x45bff4['cacheReadInputTokens']),_0x4839a6=Dr(_0x45bff4['modelContextWindow']??_0x45bff4['model_context_window']??_0x45bff4[_0x27a479(0x129)]);return{'inputTokens':_0x5c6d73,'outputTokens':_0x19f2b8,..._0x5afe8c!==null?{'cacheCreationInputTokens':_0x5afe8c}:{},..._0x1d1db7!==null?{'cacheReadInputTokens':_0x1d1db7}:{},..._0x4839a6?{'contextWindowTokens':_0x4839a6}:{}};}function en(_0x13022f){const _0x35ce86=_0x1ffb41;let _0x504597=ce(_0x13022f);if(_0x504597&&!(_0x504597[_0x35ce86(0x1a0)]<=0x0&&_0x504597[_0x35ce86(0x1a2)]<=0x0&&(_0x504597[_0x35ce86(0x86)]??0x0)<=0x0&&(_0x504597['cacheReadInputTokens']??0x0)<=0x0&&!_0x504597[_0x35ce86(0x129)]))return _0x504597;}function be(_0xb6a224){return _0xb6a224['inputTokens']===0x0&&_0xb6a224['outputTokens']===0x0&&(_0xb6a224['cacheCreationInputTokens']??0x0)===0x0&&(_0xb6a224['cacheReadInputTokens']??0x0)===0x0&&!_0xb6a224['contextWindowTokens'];}function tn(_0x3b6989){const _0x3e1a51=_0x1ffb41;let _0x3c5a7b=E(_0x3b6989);if(!_0x3c5a7b)return;if(_0x3c5a7b[_0x3e1a51(0x10d)]==='assistant'){let _0x2c5bd6=E(_0x3c5a7b['message']);if(_0x2c5bd6?.[_0x3e1a51(0x199)]==='<synthetic>')return;let _0x135f91=ce(_0x2c5bd6?.['usage']??_0x3c5a7b[_0x3e1a51(0xbd)]);return _0x135f91&&!be(_0x135f91)?_0x135f91:void 0x0;}let _0x4fc114=E(_0x3c5a7b[_0x3e1a51(0x84)]),_0x468e99=ce(_0x4fc114?.['usage']);return _0x468e99&&!be(_0x468e99)?_0x468e99:void 0x0;}function nn(_0x5552fa){const _0x3ceca4=_0x1ffb41;let _0x5dc381=E(_0x5552fa);if(_0x5dc381?.[_0x3ceca4(0x10d)]!=='event_msg')return;let _0x5b5ca8=E(_0x5dc381['payload']);if(_0x5b5ca8?.['type']!=='token_count')return;let _0x581721=E(_0x5b5ca8[_0x3ceca4(0x15a)]),_0x4b30b3=E(_0x581721?.[_0x3ceca4(0xae)]);if(_0x4b30b3)return en({..._0x4b30b3,'modelContextWindow':_0x581721?.[_0x3ceca4(0x142)]});}function ve(_0x3c9c3e){const _0x54e20c=_0x1ffb41;switch(_0x3c9c3e){case _0x54e20c(0x18b):return'plan';case'acceptEdits':return _0x54e20c(0xf0);case'bypassPermissions':return _0x54e20c(0x1c1);case'default':return _0x54e20c(0xf8);default:return;}}function T(_0x18c0e0){const _0x1ef891=_0x1ffb41;return typeof _0x18c0e0!=_0x1ef891(0x11f)?void 0x0:_0x18c0e0['replace'](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')['trim']()||void 0x0;}function rn(_0x1b8f20){const _0x5e9773=_0x1ffb41;let _0x38a4d6=T(_0x1b8f20);switch(_0x38a4d6){case _0x5e9773(0x1d5):case'low':case'medium':case'high':case'xhigh':case _0x5e9773(0x1cd):case _0x5e9773(0x87):return _0x38a4d6;default:return;}}function Kr(_0x1562c3){const _0x551916=_0x1ffb41;let _0x43ed0b=typeof _0x1562c3?.[_0x551916(0x18e)]=='string'?_0x1562c3[_0x551916(0x18e)]:'',_0x4a398f=_0x1562c3?.['sandbox_policy'],_0x1a2721=typeof _0x4a398f?.[_0x551916(0x10d)]=='string'?_0x4a398f['type']:'',_0x10db6c=Array['isArray'](_0x4a398f?.[_0x551916(0x1ac)])?_0x4a398f[_0x551916(0x1ac)]:null;if(_0x43ed0b===_0x551916(0x19c)&&_0x1a2721==='danger-full-access')return'autoApprove';if(_0x43ed0b==='on-request'&&_0x1a2721==='workspace-write')return _0x10db6c?.[_0x551916(0x194)]?_0x551916(0xf8):_0x551916(0x18b);}function sn(_0x3a7f7a){return _0x3a7f7a?.['type']==='permission-mode'?ve(_0x3a7f7a['permissionMode']):ve(_0x3a7f7a?.['permissionMode']);}function on(_0x5c6c6d){const _0x189ca2=_0x1ffb41;if(_0x5c6c6d?.[_0x189ca2(0x10d)]==='turn_context')return Kr(_0x5c6c6d['payload']);}function an(_0x5c5c22){return nn(_0x5c5c22);}function ln(_0x4533ff){return tn(_0x4533ff);}var Xr=new Set([_0x1ffb41(0x10c),_0x1ffb41(0x13c),_0x1ffb41(0x8b)]),Yr=['<environment_context>','<local-command-caveat>','<local-command-stdout>','<local-command-stderr>',_0x1ffb41(0xf5),_0x1ffb41(0x1c7),_0x1ffb41(0x185),'#\x20AGENTS.md\x20instructions\x20for\x20'];function Zr(_0x838fef){const _0x147f30=_0x1ffb41;return _0x838fef['replace'](/\s+/g,'\x20')[_0x147f30(0x1d9)]();}function P(_0x4f4ef6){return typeof _0x4f4ef6!='string'?void 0x0:Zr(_0x4f4ef6)||void 0x0;}function ze(_0xf27a3a){const _0x3cfdf8=_0x1ffb41;let _0x192f7c=P(_0xf27a3a);return _0x192f7c?/^[0-9a-f]{8,}$/i[_0x3cfdf8(0x150)](_0x192f7c)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x3cfdf8(0x150)](_0x192f7c)||/^agent-[a-z0-9_-]{6,}$/i['test'](_0x192f7c):!0x1;}function qe(_0x26d2be){let _0x59a941=P(_0x26d2be);return!_0x59a941||Xr['has'](_0x59a941)||ze(_0x59a941);}function es(_0x119cf8){const _0xee7f=_0x1ffb41;for(let _0x181d18 of _0x119cf8[_0xee7f(0xcf)](/\r/g,'')[_0xee7f(0x12f)]('\x0a')){let _0x37fe76=P(_0x181d18);if(_0x37fe76&&!ts(_0x37fe76)&&!ns(_0x37fe76))return _0x37fe76;}}function ts(_0x3ec258){const _0xc49e82=_0x1ffb41;return Yr[_0xc49e82(0xe2)](_0x49b693=>_0x3ec258['startsWith'](_0x49b693));}function ns(_0x109d90){const _0x5d50cf=_0x1ffb41;let _0x3c6814=_0x109d90['replace'](/^['"`]+/,'')[_0x5d50cf(0xcf)](/['"`\\]+$/,'')[_0x5d50cf(0x1d9)]();return!!(!_0x3c6814||/^(\/|~\/|\.\/|\.\.\/)/[_0x5d50cf(0x150)](_0x3c6814)||/^[A-Za-z]:\\/[_0x5d50cf(0x150)](_0x3c6814));}function rs(_0x4ee929){for(let _0x23fc3d=0x0;_0x23fc3d<_0x4ee929['length'];_0x23fc3d+=0x1){let _0x3b2d27=_0x4ee929[_0x23fc3d];if(_0x3b2d27==='。'||_0x3b2d27==='!'||_0x3b2d27==='?'||_0x3b2d27===';')return _0x23fc3d+0x1;if(_0x3b2d27==='.'||_0x3b2d27==='!'||_0x3b2d27==='?'||_0x3b2d27===';'){let _0x53183f=_0x4ee929[_0x23fc3d+0x1];if(!_0x53183f||/\s/['test'](_0x53183f))return _0x23fc3d+0x1;}}return-0x1;}function cn(_0x2f88c7,_0x560ae1=0x50){const _0x414517=_0x1ffb41;if(typeof _0x2f88c7!='string')return;let _0x5277f3=es(_0x2f88c7);if(!_0x5277f3)return;let _0x4deca3=rs(_0x5277f3),_0x3f6f7f=(_0x4deca3>0x0?_0x5277f3['slice'](0x0,_0x4deca3):_0x5277f3)['replace'](/[。!?;.!?;]+$/gu,'')[_0x414517(0x1d9)]();if(!(!_0x3f6f7f||ze(_0x3f6f7f)))return _0x3f6f7f['length']<=_0x560ae1?_0x3f6f7f:_0x3f6f7f[_0x414517(0x135)](0x0,Math['max'](0x1,_0x560ae1-0x3))[_0x414517(0xd4)]()+'...';}function L(_0x22ffb8,_0x191027){for(let _0x4867b5 of _0x22ffb8){let _0x3e942f=P(_0x4867b5);if(!(!_0x3e942f||qe(_0x3e942f)))return _0x3e942f;}return cn(_0x191027);}var un='<vibelet-resume-after-approval>';function fn(_0x67b4cb){return _0x67b4cb['replace'](/[^a-zA-Z0-9]/g,'-');}async function Ge(){const _0x4cc460=_0x1ffb41;let _0x3f2a2c=await oe(),_0x68db6e=await _(_0x3f2a2c,b,async _0x47c2a2=>{const _0x1ba1ea=_0x1bf4;try{let _0x1163ca=JSON[_0x1ba1ea(0x1c6)](await(0x0,dn[_0x1ba1ea(0x175)])(_0x47c2a2,_0x1ba1ea(0xe6))),_0x3ac6ef=T(_0x1163ca[_0x1ba1ea(0x13d)]);if(!_0x3ac6ef)return null;let _0x46e109=P(T(_0x1163ca['title'])),_0x3634ea={'cliSessionId':_0x3ac6ef},_0x1c8e16=T(_0x1163ca['sessionId']),_0x580a53=T(_0x1163ca[_0x1ba1ea(0x17a)]),_0x4233bf=T(_0x1163ca[_0x1ba1ea(0xc4)]),_0x494573=T(_0x1163ca[_0x1ba1ea(0x199)]),_0x1d1064=rn(_0x1163ca['effort']),_0xdcad52=ve(T(_0x1163ca['permissionMode']));return _0x1c8e16&&(_0x3634ea['localSessionId']=_0x1c8e16),_0x580a53&&(_0x3634ea['cwd']=_0x580a53),_0x4233bf&&(_0x3634ea[_0x1ba1ea(0xc4)]=_0x4233bf),_0x46e109&&(_0x3634ea['title']=_0x46e109),_0x494573&&(_0x3634ea['model']=_0x494573),_0x1d1064&&(_0x3634ea[_0x1ba1ea(0x119)]=_0x1d1064),_0xdcad52&&(_0x3634ea[_0x1ba1ea(0x16f)]=_0xdcad52),typeof _0x1163ca['isArchived']=='boolean'&&(_0x3634ea['externalArchived']=_0x1163ca[_0x1ba1ea(0xc3)]),_0x3634ea;}catch{return null;}}),_0x53a3a9=new Map();for(let _0x3b0af5 of _0x68db6e)_0x3b0af5&&_0x53a3a9[_0x4cc460(0x151)](_0x3b0af5[_0x4cc460(0x13d)],_0x3b0af5);return{'byCliSessionId':_0x53a3a9};}function Ve(_0x5564f0,_0x301a76){const _0x5e1ef7=_0x1ffb41;if(!_0x301a76)return _0x5564f0;let _0x1568dc=[..._0x5564f0['titleAliases']??[],..._0x5564f0['title']&&_0x301a76['title']&&_0x5564f0['title']!==_0x301a76['title']?[_0x5564f0[_0x5e1ef7(0x11c)]]:[]];return{..._0x5564f0,..._0x301a76['cwd']?{'cwd':_0x301a76[_0x5e1ef7(0x17a)]}:{},..._0x301a76['originCwd']?{'originCwd':_0x301a76['originCwd']}:{},..._0x301a76['model']?{'model':_0x301a76[_0x5e1ef7(0x199)]}:{},..._0x301a76['effort']?{'effort':_0x301a76[_0x5e1ef7(0x119)]}:{},..._0x301a76['title']?{'title':_0x301a76['title']}:{},..._0x1568dc[_0x5e1ef7(0x194)]?{'titleAliases':_0x1568dc}:{},..._0x301a76['approvalMode']?{'approvalMode':_0x301a76['approvalMode']}:{},'originator':_0x5e1ef7(0x18d),...typeof _0x301a76['externalArchived']=='boolean'?{'externalArchived':_0x301a76['externalArchived']}:{}};}var mn=require(_0x1ffb41(0x16a)),gn=require('node:fs/promises'),Ke=require(_0x1ffb41(0x1ca)),Xe=require(_0x1ffb41(0xb9)),hn=require('node:util'),ss=S[_0x1ffb41(0x13b)]({'module':'scanner'}),pn=(0x0,hn[_0x1ffb41(0x131)])(mn['execFile']),os=0x7530,X=null,ue=null,Qe='';function Je(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function is(_0x7c7e0d){const _0x51db3b=_0x1ffb41;return _0x7c7e0d['startsWith']('~/')?(0x0,Xe['join'])((0x0,Ke['homedir'])(),_0x7c7e0d[_0x51db3b(0x135)](0x2)):_0x7c7e0d;}function Sn(_0x2eb251,_0x10e2d2,_0x1f0051){const _0x345d25=_0x1ffb41;if(_0x2eb251)return _0x2eb251[_0x345d25(0x189)]['get'](_0x10e2d2)??_0x2eb251['byRolloutPath'][_0x345d25(0xa5)](_0x1f0051);}function yn(_0x549862,_0x285d09,_0x22d447){const _0x4ef235=_0x1ffb41;if(_0x549862)return _0x549862[_0x4ef235(0x12e)][_0x4ef235(0xa5)](_0x285d09)??_0x549862['archivedByRolloutPath'][_0x4ef235(0xa5)](_0x22d447);}function Ye(){X=null;}async function Ie(){const _0x57ccc2=_0x1ffb41;let _0x2cf2b2=Date[_0x57ccc2(0x138)](),_0x3deae1=(0x0,Ke[_0x57ccc2(0xb2)])();if(X&&X[_0x57ccc2(0xbf)]===_0x3deae1&&_0x2cf2b2<=X['expiresAt'])return X['value'];if(ue&&Qe===_0x3deae1)return ue;Qe=_0x3deae1,ue=((async()=>{const _0x1ac0db=_0x57ccc2;let _0x55a6d5=(0x0,Xe['join'])(_0x3deae1,'.codex',_0x1ac0db(0xef));if(!(await(0x0,gn['stat'])(_0x55a6d5)['catch'](()=>null))?.['isFile']())return Je();try{let _0x4a14e4='';try{({stdout:_0x4a14e4}=await pn('sqlite3',[_0x1ac0db(0xf6),_0x55a6d5,_0x1ac0db(0x14c)],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x4a14e4}=await pn('sqlite3',['-json',_0x55a6d5,_0x1ac0db(0x183)],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x136d8a=JSON[_0x1ac0db(0x1c6)](_0x4a14e4||'[]'),_0x518002=Je();for(let _0x134494 of _0x136d8a){if(typeof _0x134494['id']!='string')continue;let _0x5dffba=P(typeof _0x134494['title']=='string'?_0x134494['title']:void 0x0);_0x5dffba&&_0x518002['byId'][_0x1ac0db(0x151)](_0x134494['id'],_0x5dffba);let _0x53d41c=typeof _0x134494['rollout_path']=='string'&&_0x134494['rollout_path']['trim']()?is(_0x134494['rollout_path']):'';if(_0x53d41c&&_0x5dffba&&_0x518002[_0x1ac0db(0x95)][_0x1ac0db(0x151)](_0x53d41c,_0x5dffba),typeof _0x134494['archived']==_0x1ac0db(0x107)||typeof _0x134494['archived']=='boolean'){let _0x1e96e6=_0x134494['archived']===!0x0||_0x134494['archived']===0x1;_0x518002['archivedById']['set'](_0x134494['id'],_0x1e96e6),_0x53d41c&&_0x518002[_0x1ac0db(0xdb)][_0x1ac0db(0x151)](_0x53d41c,_0x1e96e6);}}return _0x518002;}catch(_0x147bc8){return ss[_0x1ac0db(0x17b)]({'error':String(_0x147bc8)},'failed\x20to\x20read\x20codex\x20thread\x20titles\x20from\x20sqlite'),Je();}})());try{let _0x6be6ff=await ue;return X={'value':_0x6be6ff,'expiresAt':Date[_0x57ccc2(0x138)]()+os,'home':_0x3deae1},_0x6be6ff;}finally{ue=null,Qe='';}}var Cn=require(_0x1ffb41(0xce)),Y=require(_0x1ffb41(0x19e)),Tn=require('node:readline');function*de(_0x1cc635,_0x9f3f6a){const _0x391e61=_0x1ffb41;let _0x780909=0x0,_0x17d094=0x0;for(;_0x780909<_0x1cc635[_0x391e61(0x194)]&&_0x17d094<_0x9f3f6a;){let _0x2c8ac0=_0x1cc635['indexOf']('\x0a',_0x780909);_0x2c8ac0===-0x1&&(_0x2c8ac0=_0x1cc635['length']);let _0x33ef14=_0x1cc635[_0x391e61(0x1e5)](_0x780909,_0x2c8ac0);_0x780909=_0x2c8ac0+0x1,!(_0x33ef14['length']===0x0||_0x33ef14[_0x391e61(0x1d9)]()['length']===0x0)&&(yield _0x33ef14,_0x17d094+=0x1);}}var Ze=0x200*0x400,xn=0x100*0x400;async function Ee(_0x5eec08,_0x2430fd){if(_0x2430fd<=Ze)return(0x0,Y['readFile'])(_0x5eec08,'utf-8');let _0x1777d2=await(0x0,Y['open'])(_0x5eec08,'r');try{let _0x434783=Buffer['alloc'](Ze),{bytesRead:_0x26d600}=await _0x1777d2['read'](_0x434783,0x0,Ze,0x0);return _0x434783['toString']('utf-8',0x0,_0x26d600);}finally{await _0x1777d2['close']();}}async function et(_0x4d2e00,_0x34a9af){const _0x74568f=_0x1ffb41;if(_0x34a9af<=xn)return(0x0,Y[_0x74568f(0x175)])(_0x4d2e00,_0x74568f(0xe6));let _0x5e822a=await(0x0,Y[_0x74568f(0x123)])(_0x4d2e00,'r');try{let _0xca5ad=Math[_0x74568f(0x1cd)](0x0,_0x34a9af-xn),_0x4baddf=Buffer['alloc'](_0x34a9af-_0xca5ad),{bytesRead:_0x23f7c2}=await _0x5e822a[_0x74568f(0x1e1)](_0x4baddf,0x0,_0x4baddf['length'],_0xca5ad);return _0x4baddf[_0x74568f(0x93)]('utf-8',0x0,_0x23f7c2);}finally{await _0x5e822a['close']();}}async function B(_0xa12e34,_0x4c9080){const _0x265200=_0x1ffb41;let _0xd97699=(0x0,Cn[_0x265200(0x186)])(_0xa12e34,{'encoding':_0x265200(0xe6)}),_0x20905e=(0x0,Tn[_0x265200(0x1b9)])({'input':_0xd97699,'crlfDelay':0x1/0x0});try{for await(let _0x3af1dd of _0x20905e){if(!_0x3af1dd[_0x265200(0x1d9)]())continue;let _0x2a8a81;try{_0x2a8a81=JSON['parse'](_0x3af1dd);}catch{continue;}if(_0x4c9080(_0x2a8a81))break;}}finally{_0x20905e[_0x265200(0x134)](),_0xd97699['destroy']();}}function N(_0x31c8de){const _0x232a89=_0x1ffb41;return typeof _0x31c8de=='string'?_0x31c8de:Array['isArray'](_0x31c8de)?_0x31c8de[_0x232a89(0x17c)](_0x275fc2=>!_0x275fc2||typeof _0x275fc2!='object'?'':typeof _0x275fc2['text']=='string'?_0x275fc2[_0x232a89(0x1b1)]:typeof _0x275fc2['content']=='string'?_0x275fc2['content']:'')['join'](''):'';}function fe(_0x42c5e5){const _0x5b378e=_0x1ffb41;return _0x42c5e5?.[_0x5b378e(0x10d)]==='response_item'&&_0x42c5e5['payload']?.['type']==='message'&&_0x42c5e5[_0x5b378e(0xfc)][_0x5b378e(0x92)]==='user'?N(_0x42c5e5['payload']['content']):_0x42c5e5?.['type']==='event_msg'&&_0x42c5e5[_0x5b378e(0xfc)]?.[_0x5b378e(0x10d)]==='user_message'&&typeof _0x42c5e5['payload']['message']==_0x5b378e(0x11f)?_0x42c5e5[_0x5b378e(0xfc)]['message']:'';}function H(_0x1ddf76){const _0x41af44=_0x1ffb41;return typeof _0x1ddf76=='string'?_0x1ddf76:Array['isArray'](_0x1ddf76)?_0x1ddf76[_0x41af44(0x17c)](_0x16891f=>!_0x16891f||typeof _0x16891f!='object'||_0x16891f['type']!==_0x41af44(0x1b1)?'':typeof _0x16891f['text']==_0x41af44(0x11f)?_0x16891f[_0x41af44(0x1b1)]:'')['join'](''):'';}var as=/^\[Attached image: ([^\n]+)\]$/gm;function ls(_0x23e7b3){const _0x41c334=_0x1ffb41;let _0x1f9bdc=[],_0x56ca45=new Set();for(let _0x329022 of _0x23e7b3['matchAll'](as)){let _0x1a4692=_0x329022[0x1];!_0x1a4692||_0x1a4692[_0x41c334(0x1d9)]()['length']===0x0||_0x56ca45['has'](_0x1a4692)||(_0x56ca45['add'](_0x1a4692),_0x1f9bdc[_0x41c334(0x15c)](_0x1a4692));}return _0x1f9bdc;}function An(_0x36f28a){const _0x16ef92=_0x1ffb41;if(_0x36f28a['role']!=='user')return _0x36f28a;let _0x3ab07d=[..._0x36f28a[_0x16ef92(0x10a)]??[],...ls(_0x36f28a[_0x16ef92(0x1db)])][_0x16ef92(0xbc)]((_0x34d1ab,_0x4e159c,_0x170c6b)=>_0x34d1ab&&_0x170c6b['indexOf'](_0x34d1ab)===_0x4e159c);return _0x3ab07d[_0x16ef92(0x194)]?{..._0x36f28a,'images':_0x3ab07d}:_0x36f28a;}var cs=['<task-notification>',_0x1ffb41(0x190),_0x1ffb41(0x174),_0x1ffb41(0x8e),'<command-name>',_0x1ffb41(0x1c7),_0x1ffb41(0x185),'<system-reminder>',_0x1ffb41(0x11d),un],wn=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,us=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ds=/<environment_context>[\s\S]*<\/environment_context>/,fs=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function ps(_0x91cb76,_0x2011f2){const _0x2273e1=_0x1ffb41;if(_0x91cb76?.['isMeta']===!0x0)return!0x0;let _0x529fa1=_0x2011f2[_0x2273e1(0x1d9)]();return _0x529fa1?wn[_0x2273e1(0x150)](_0x529fa1)||cs[_0x2273e1(0xe2)](_0x234b80=>_0x529fa1[_0x2273e1(0x11b)](_0x234b80)):!0x1;}function j(_0x223557){const _0x1aaa35=_0x1ffb41;if(_0x223557?.['type']!=='user'||_0x223557[_0x1aaa35(0xeb)]?.['role']!=='user')return'';let _0x41d7f1=H(_0x223557['message']['content']);return ps(_0x223557,_0x41d7f1)?'':_0x41d7f1;}function bn(_0x453acf){const _0x682d30=_0x1ffb41;return Array[_0x682d30(0x115)](_0x453acf)&&_0x453acf[_0x682d30(0xe2)](_0x43c3c4=>_0x43c3c4&&typeof _0x43c3c4==_0x682d30(0xdd)&&_0x43c3c4['type']===_0x682d30(0xdf));}function ms(_0x23bab7){const _0x1c5406=_0x1ffb41;return Array['isArray'](_0x23bab7)?_0x23bab7[_0x1c5406(0x17c)](_0x3063ef=>{const _0x33af42=_0x1c5406;if(!_0x3063ef||typeof _0x3063ef!='object'||_0x3063ef['type']!=='tool_result')return'';let _0x1c240d=_0x3063ef['content'];return typeof _0x1c240d=='string'?_0x1c240d:Array['isArray'](_0x1c240d)?_0x1c240d[_0x33af42(0x17c)](_0x4063ff=>!_0x4063ff||typeof _0x4063ff!='object'?'':typeof _0x4063ff['text']=='string'?_0x4063ff['text']:typeof _0x4063ff['content']=='string'?_0x4063ff['content']:'')[_0x33af42(0xbc)](Boolean)['join']('\x0a'):'';})['filter'](Boolean)[_0x1c5406(0x96)]('\x0a'):'';}function gs(_0x21d62a){const _0x2eae24=_0x1ffb41;return Array['isArray'](_0x21d62a)?_0x21d62a['map'](_0x475a1c=>!_0x475a1c||typeof _0x475a1c!=_0x2eae24(0xdd)?'':typeof _0x475a1c['text']==_0x2eae24(0x11f)?_0x475a1c[_0x2eae24(0x1b1)]:typeof _0x475a1c['content']=='string'?_0x475a1c['content']:'')['filter'](Boolean)[_0x2eae24(0x96)]('\x0a'):'';}function tt(_0x3cc2b3){const _0x171e79=_0x1ffb41;if(typeof _0x3cc2b3=='string')return _0x3cc2b3;let _0x389bf2=gs(_0x3cc2b3);return _0x389bf2||(Array[_0x171e79(0x115)](_0x3cc2b3)&&_0x3cc2b3['length']>0x0&&_0x3cc2b3['every'](_0x17cc71=>_0x17cc71&&typeof _0x17cc71=='object'&&_0x17cc71[_0x171e79(0x10d)]===_0x171e79(0x16c))?'':JSON['stringify'](_0x3cc2b3));}var hs=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function vn(_0x16c3e9){const _0x2d6083=_0x1ffb41;let _0x1619a6=_0x16c3e9[_0x2d6083(0xa6)](hs)?.[0x1];return _0x1619a6&&_0x1619a6['trim']()['length']>0x0?_0x1619a6:null;}function In(_0x4aa85e,_0x537d7f){const _0x10f4b2=_0x1ffb41;return{'role':_0x10f4b2(0x101),'type':'info','historyKey':'claude-sensitive-file:'+_0x4aa85e,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0x4aa85e+_0x10f4b2(0x1bc),..._0x537d7f?{'timestamp':_0x537d7f}:{}};}function En(_0x2bc228){const _0x3b8b0f=_0x1ffb41;let _0x568769=ms(_0x2bc228?.[_0x3b8b0f(0xeb)]?.[_0x3b8b0f(0x1db)]);if(/\[Request interrupted by user(?: for tool use)?\]/i[_0x3b8b0f(0x150)](_0x568769))return!0x0;let _0x607115=_0x2bc228?.['toolUseResult'];return!!(_0x607115&&typeof _0x607115=='object'&&_0x607115['interrupted']===!0x0||typeof _0x607115==_0x3b8b0f(0x11f)&&/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x607115));}function _0x4404(){const _0x1dab02=['CMvHBhbHDgHtEw5J','Aw5JBhvKzxm','y3jLyxrLzefMDgvYtxm','y291BNq','lNnJywXH','AgfZt3DU','zxHLy0zPBgvtEw5J','z2v0','Bwf0y2G','zw50CNK','uM9HBwLUzW','l3vZCI9IAw4','BwLUtxm','y2XLyxi','Bwv0yq','y29KzxHgAwXLCW','BgfZDf90B2TLBL91C2fNzq','Cgf0Aa','C29YDa','ls1Yzxf1AxjL','Ag9TzwrPCG','lMXVy2fS','B3v0Chv0x3rVA2vUCW','y2f0y2G','DMfSDwvZ','n2XvEwrbvq','Dg9VBf9ZzwfYy2HFB3v0Chv0','BM9KztPWyxrO','CM91BMq','AxnszxnWB25KAw5N','zMLSDgvY','DxnHz2u','Cg9ZDe1LC3nHz2u','Ag9Tzq','BM9KzwPZ','CMvZB2X2zvnLC3nPB25gAwXLugf0Aa','y2XHDwrLtwv0ywrHDgfgAw5NzxjWCMLUDa','AxnbCMnOAxzLza','B3jPz2LUq3DK','y3jLyxrLzcbZDwnJzxnZzNvSBhK','ls1LBNyTzMLSzq','C3rVCf9OB29Rx3n1Bw1HCNK','l29WDc9OB21LyNjLDY9IAw4Vy2XHDwrL','yNLdBgLtzxnZAw9Uswq','mZm2otu3m0f5tgT5tq','ls1WzxjTAxnZAw9Ulw1Vzgu','ChjVAMvJDhm','DhvYBL9HyM9YDgvK','BM9KztPMCW','CMvWBgfJzq','CNvUDgLTzq','lMzPC2G','zgLYBMfTzq','ls1WzxjTAxnZAw9Ulw1Vzgu9','DhjPBuvUza','zMfPBgvKihrVihjLywqGy2XHDwrLihnLC3nPB24GAgLZDg9YEq','ls1Kyw5NzxjVDxnSEs1IExbHC3mTyxbWCM92ywXZlwfUzc1Zyw5KyM94','ChjVy2vZCY1Zy2fUBMvY','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbOAxn0B3j5','BgfZDfvZywDL','Cg5WBq','yxjJAgL2zwrcEvjVBgXVDxrqyxrO','qxbWBgLJyxrPB24Gu3vWCg9YDa','B2jQzwn0','C25HChnOB3q','Dg9VBf9Yzxn1Bhq','mJe2ndqYzKLKqxvj','CgXHDgzVCM0','C29Tzq','C3rHCNrLzef0','BgfIzwXZ','lM5WBs1NBg9IywW','DxrMltG','lMv4CW','AwrSzq','zxzLBNrFBxnN','rvnsq0G','BwvZC2fNzq','Dg9VBfjLC3vSDa','C3rVCeHVB2S','C25HChnOB3rZ','C3rHDgvFns5ZCwXPDgu','ywnJzxb0rwrPDhm','C2L6zq','y29SBgvJDenVBNrLEhq','CMvHzfnLC3nPB25dD2rbBMrjza','C2nHBG','pgnVBw1HBMqTBMfTzt4','lwPZB24','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','BM9YBwfS','l29WDc9OB21LyNjLDY9IAw4','BgfZDe1Z','zxjYB3i','Cgf5Bg9Hza','DgvYBwLUywW','lMPZB24','B3jPz2LUywXgAwXL','y29UzMLKzw5Jzq','yxnZAxn0yw50','u0Lhs0Lmta','zM5Tx211BhrPC2HLBgXZ','ls1SB2fKzxi','ls12zxjZAw9U','Dg90ywXnCW','BNvTyMvY','z2f1z2vZ','C291CMnL','Aw1Hz2vZ','CgLK','tMv3ihnLC3nPB24','DhLWzq','vKLcrv9urvnux0LovKvove9swv9xt1jlrvjFrevmqvLFtvm','Aw52zw50B3j5lxDVCMTLCG','Aw1Hz2vFz2vUzxjHDgLVBL9LBMq','DgL0BgvbBgLHC2vZ','lMnSyxvKzq','ChjVy2vZCY5Zy2fUlNbNCMvWx21Z','uhjVz3jHBxm','AxnbCNjHEq','qxbWrgf0yq','mtaWmdeWmeTsBKHMBa','ls1WCMLUDa','zwzMB3j0','AxngAwXL','C3rHCNrZv2L0Aa','DgL0Bgu','pgvUDMLYB25Tzw50x2nVBNrLEhq+','mta0nJiXnuzqr25Hqq','C3rYAw5N','y3vZDg9Tx3rVB2XFy2fSBf9VDxrWDxq','AgfZ','BxrPBwvnCW','B3bLBG','mtK1q0n3D3zr','C2vZC2LVBIbPBNzLBNrVCNKGAw5JCMvTzw50ywXSEsbZy2fUBMvK','zw52','y2XHDwrL','DxvPza','y29UDgv4DfDPBMrVD1rVA2vUCW','D2fYBG','zMfPBgvKihrVihDHBgSGy29KzxGGC2vZC2LVBNmGzgLY','zgvSzxrL','rvbjueu','yxjJAgL2zwrcEuLK','C3bSAxq','ChjVy2vZCW','ChjVBwLZAwz5','BhnVzG','yMLU','y2XVC2u','C2XPy2u','C3rYAw5NAwz5','BwLU','BM93','Aw5WDxq','mtbyyuPLzNu','y2HPBgq','uMvZDw1LzcbZzxnZAw9U','y2XPu2vZC2LVBKLK','DxbKyxrLzef0','y3jLyxrLzef0','CMvHzfnLC3nPB24','C2vZC2LVBNm','Bw9KzwXFy29UDgv4Df93Aw5KB3C','lNrZ','CMvHzezPBgvnzxrH','DgLTzw91Da','l2jPBI96C2G','ogLvqKjZtG','y3vZDg9TvgL0Bgu','q09ervHFuefusa','ls1PBNb1Dc10ExbL','Dhn4','C2vSzwn0igLKlcb0AxrSzsWGCM9SBg91Df9WyxrOlcbHCMnOAxzLzcbMCM9TihrOCMvHzhm','DxnLCLbYB21WDa','CMvZB2X2zq','lM1T','DgvZDa','C2v0','ls1ZzxnZAw9UlwLK','D2LUmZi','y29KzxG','lNjZ','CgfYzw50vxvPza','lxHJ','zgvWzw5Kzw5JAwvZ','Bwf0y2HLzfbYB2nLC3nLCW','Aw5MBW','l3vZCI9SB2nHBc9IAw4Vy2XHDwrL','ChvZAa','BgfZDfvZzwrbDa','CMvZDw1Lu2vZC2LVBG','Dg90ywXgAwXLCW','CgfYzw50x3rOCMvHzf9Pza','Dg9ju09tDhjPBMC','Aw5JCMvTzw50','C3rHCNruAw1L','yMfZzw5HBwu','y2XHDwrLlwnVzguTC2vZC2LVBNm','zw50CMLLCW','zM5T','AxneAxjLy3rVCNK','CgLWzq','BM9KztPJAgLSzf9WCM9JzxnZ','D21PyW','Dg9VBf9YzwzLCMvUy2u','Aw5ZDgfSBgf0Aw9U','Dg9VBf91C2u','yxbWCM92ywXnB2rL','lMPZEa','luzU','C2vZC2LVBL9TzxrH','ywrK','pgXVy2fSlwnVBw1HBMqTC3rKB3v0pG','CMvHzezPBgu','uefusa','DgvYBwLUywWTy29UDhjVBc10B2TLBG','ndy0mJm2m25uy2vfzW','C3vIywDLBNq','y3DK','zgvIDwC','BwfW','l2jPBI9IyxnO','AhLKCMf0zu1Z','zxHWAxjLC0f0','ndm3odjmwMTStvi','yM9VBgvHBG','C2vZC2LVBNmUANnVBG','C2vSzwn0igLKlcb0AxrSzsWGCM9SBg91Df9WyxrOigzYB20GDgHYzwfKCYb3AgvYzsbJB2fSzxnJzsH0AxrSzsWGjYCPidW+icCN','lwLSyW','pgnVBw1HBMqTyxjNCZ4','y3jLyxrLuMvHzfn0CMvHBq','l3vZCI9SB2nHBc9IAw4','zNjVBq','yNLjza','DxbKyxrLtgf0zxn0q29KzxHdywnOzq','CgXHBG','C3rKB3v0','q2XHDwrLierLC2T0B3a','yxbWCM92ywXFCg9SAwn5','AxnFzxjYB3i','pgXVy2fSlwnVBw1HBMqTy2f2zwf0pG','zgLYzwn0q2fUzgLKyxrLCW','C2TPChbLzfbYB2nLC3nezxrHAwXZ','lY5JB2rLEc9ZzxnZAw9UCY8','BgvUz3rO','lMnVzgv4','DMfSDwu','zNvUy3rPB25Fy2fSBa','q0Xbvurfx0nprevFru5uuLLqt0Lova','Bw9KzwW','DMLHv3jHChbLCG','y2XHDwrLtg9VA3vW','BMv2zxi','zMLZAa','BM9KztPMCY9WCM9TAxnLCW','BM9Kzq','Aw5WDxruB2TLBNm','DxbSB2fKCW','B3v0Chv0vg9Rzw5Z','AxngAw5PDgu','y29KzxHmB29RDxa','Aw52zw50B3j5ihnJyw4GD29YA2vYihjLCxvPCMvZigeGCgfYzw50ihbVCNq','y3vYCMvUDa','lNjI','ywXS','C3rHBMrHBg9Uzq','C3rHCNruAw1LCG','AgLNAa','D3jPDgfIBgvFCM9VDhm','BM9Kzs12zxjZAw9UCW','lwLJ','DgLTzxjZ','CgDYzxbnCW','Dgv4Da','r2vUzxjHDgvKigzPBgu6ia','AxnnzxrH','l3n1yMfNzw50CY8','lMPZB25S','zw5KC1DPDgG','zMLUza','y2fJAgvFCMvHzf9PBNb1Df90B2TLBNm','y3jLyxrLsw50zxjMywnL','uhjVy2vZC0LKlenVBw1HBMrmAw5L','mKHqvxrjrq','ioINHUs4UUAvJ+AeN+I3R+w+HooaGUI/MEEXU+AjUEwhHUAxOoAZLEs7JUw3SUACIEs8MUIVNEIUSow9LEMhJoIHPEwBNUwiScbwAwjLBgv044cc6k+36yEn5PAW5OMN6kgm6l+z5QYH5l+U5Ps55BM25zYOienSyxvKzsdKUk3MMi7NOA7MIBNLH4BVVjVLPOlMNPZLUiZMNjVLNkGGvMLIzwXLDcdPH4ZNNiVLIldLRQhMIBNLVlNNQPFVViZOR7FKU44GvMLIzwXLDcdLKk/LIQJMIjBNU6FNU63OV5NKUkRKVjROR53JGii','y29TBwfUza','u0Lhvevstq','zMLUywXSEq','Bg9Nsw50zxj2ywW','yxv0B0fWChjVDMu','CgfJA2fNzxm','CMvZCg9UC2vFAxrLBq','C3rHDa','y29Kzq','CgfYC2u','pgnVBw1HBMqTBwvZC2fNzt4','Dg9VBf91C2vFAwq','lwvJ','BM9KztPVCW','C2nHBM5LCG','DhvYBLn0yxj0zwq','Bwf4','yxjNCW','DhvYBKzPBMLZAgvK','y291BNrLCNm','zxH0BMfTzq','yMLYDgH0Aw1Ltxm','DxnLCG','q0Xbvurfq09erq','BwLUAw1HBa','C2vZC2LVBL9IyxrJAf9JB21WBgv0zq','ls10zxn0','A2LSBa','DhjPBq','C2vZC2LVBKLK','y29UDgvUDa','Cgf0y2HFyxbWBhLFzw5K','A2LUza','ChjVy2vZCYbZy2fUignVBw1HBMqGC2TPChbLzcdIGjqGChjVy2vZCYbLEgL0zwq','BwvKAxvT','DxbKyxrLzcbZDwnJzxnZzNvSBhK','CMvHza','zxH0zxjUywXbCMnOAxzLza','BMfTzq','Dg9mB3DLCKnHC2u','C3vIC3rYAw5N','B3jPz2LUyxrVCG','C2vZC2LVBKzPBgvqyxrO','Dg9VBfvZzvjLC3vSDa','lMzUBq','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','DwX0CMe','ls1SAxn0zw4','C2HHCMu','se9nrq','vw50AxrSzwqGC2vZC2LVBG','CMvHzgrPCG','lwf4BW','pgXVy2fSlwnVBw1HBMqTC3rKzxjYpG','y211Ea','BhnVzK1Z','ywDLBNq','CM9Szq','Dg9tDhjPBMC','C3rVCfjLyxnVBG','yNLsB2XSB3v0ugf0Aa','AM9PBG','C3rVCf9YzwfZB24','C3rKzxjY','zxHPC3rZu3LUyW','AhLKCMf0zwrdyw5KAwrHDgvZ','lNnXBa','AxnbyNnVBhv0zq','DxbKyxrL'];_0x4404=function(){return _0x1dab02;};return _0x4404();}function z(_0x3dff68){const _0x5c0951=_0x1ffb41;let _0x687aae=_0x3dff68['trim']();return _0x687aae?_0x687aae['startsWith']('<environment_context>')||wn[_0x5c0951(0x150)](_0x687aae)?!0x0:ds[_0x5c0951(0x150)](_0x687aae)&&(fs['test'](_0x687aae)||us[_0x5c0951(0x150)](_0x687aae)):!0x1;}function Mn(_0xcd8f00){const _0x7ad941=_0x1ffb41;if(typeof _0xcd8f00?.['timestamp']!=_0x7ad941(0x11f))return null;let _0xa3ac56=Date['parse'](_0xcd8f00['timestamp']);return Number[_0x7ad941(0x1a3)](_0xa3ac56)?_0xa3ac56:null;}function nt(_0x2a2a4f){let _0x42c791=Mn(_0x2a2a4f);return _0x42c791==null?void 0x0:new Date(_0x42c791)['toISOString']();}function q(_0xbc952b,_0x3f844d){let _0x2fba65=nt(_0x3f844d);return _0x2fba65?{..._0xbc952b,'timestamp':_0x2fba65}:_0xbc952b;}var Rn=S[_0x1ffb41(0x13b)]({'module':_0x1ffb41(0x1cb)});function Ss(_0x10f944){const _0x2fbf5a=_0x1ffb41;if(_0x10f944?.['type']===_0x2fbf5a(0x1d3)&&_0x10f944[_0x2fbf5a(0xeb)]?.['role']==='user'){if(_0x10f944[_0x2fbf5a(0x1b3)]===!0x0)return null;if(bn(_0x10f944['message']['content']))return{'kind':'toolResult',...En(_0x10f944)?{'interrupted':!0x0}:{}};let _0x4c4273=j(_0x10f944);return ys(_0x4c4273)?null:_0x4c4273?{'kind':_0x2fbf5a(0x14d)}:null;}if(_0x10f944?.['type']==='assistant'&&_0x10f944[_0x2fbf5a(0xeb)]?.['role']===_0x2fbf5a(0x101)){let _0x3b9e06=H(_0x10f944['message'][_0x2fbf5a(0x1db)]),_0x58c36b=_0x10f944['message']?.[_0x2fbf5a(0x97)];return{'kind':'assistant','stopReason':typeof _0x58c36b=='string'?_0x58c36b:_0x58c36b??null,..._0x3b9e06?{'text':_0x3b9e06}:{}};}return _0x10f944?.[_0x2fbf5a(0x10d)]==='system'&&_0x10f944['subtype']===_0x2fbf5a(0xc7)?{'kind':'stopHook'}:null;}function ys(_0x4d8790){const _0x416c32=_0x1ffb41;return _0x4d8790?_0x4d8790['includes'](_0x416c32(0x190))||_0x4d8790['includes']('<command-name>'):!0x1;}function xs(_0x5565ed){const _0x10ec4e=_0x1ffb41;if(!_0x5565ed)return{};if(_0x5565ed['kind']===_0x10ec4e(0xed))return{};if(_0x5565ed['kind']==='assistant'){let _0x5cc3aa=_0x5565ed[_0x10ec4e(0x94)]==null||_0x5565ed[_0x10ec4e(0x94)]===_0x10ec4e(0x16e);return{..._0x5cc3aa?{'isResponding':!0x0}:{},..._0x5cc3aa&&_0x5565ed[_0x10ec4e(0x1b1)]?{'partialReplyText':_0x5565ed[_0x10ec4e(0x1b1)]}:{}};}return _0x5565ed['kind']===_0x10ec4e(0xec)&&_0x5565ed['interrupted']?{}:{'isResponding':!0x0};}function Cs(_0x29ce96){const _0x2a6fa2=_0x1ffb41;let _0x2c7566=_0x29ce96?.[_0x2a6fa2(0xeb)]??_0x29ce96?.['text']??_0x29ce96?.['delta']??_0x29ce96?.['content'];return typeof _0x2c7566==_0x2a6fa2(0x11f)&&_0x2c7566['trim']()?_0x2c7566:void 0x0;}function Ts(_0x1340cc){const _0x42ccc0=_0x1ffb41;if(_0x1340cc?.[_0x42ccc0(0x10d)]===_0x42ccc0(0xe9)){let _0x3ebf5d=_0x1340cc['payload'];switch(_0x3ebf5d?.['type']){case'task_started':return{'kind':'turnStarted'};case'task_complete':case _0x42ccc0(0xcd):case'thread_rolled_back':return{'kind':'turnFinished'};case'user_message':{let _0x1ccce6=fe(_0x1340cc);return _0x1ccce6&&!z(_0x1ccce6)?{'kind':_0x42ccc0(0x14d)}:null;}case'agent_message':case'agent_message_delta':{let _0x5b2d38=Cs(_0x3ebf5d);return _0x5b2d38?{'kind':_0x42ccc0(0x101),'text':_0x5b2d38}:{'kind':'assistant'};}case'mcp_tool_call_end':case _0x42ccc0(0x1dc):case'web_search_end':return{'kind':'activity'};default:return null;}}if(_0x1340cc?.[_0x42ccc0(0x10d)]!==_0x42ccc0(0x1c3))return null;let _0x100f42=_0x1340cc['payload'];switch(_0x100f42?.[_0x42ccc0(0x10d)]){case'message':{if(_0x100f42[_0x42ccc0(0x92)]===_0x42ccc0(0x1d3)){let _0x129aab=N(_0x100f42[_0x42ccc0(0x1db)]);return _0x129aab&&!z(_0x129aab)?{'kind':'userPrompt'}:null;}if(_0x100f42['role']==='assistant'){let _0x20fbc3=N(_0x100f42[_0x42ccc0(0x1db)]);return _0x20fbc3?{'kind':'assistant','text':_0x20fbc3}:{'kind':'assistant'};}return null;}case'reasoning':case _0x42ccc0(0x197):case'function_call_output':case'custom_tool_call':case _0x42ccc0(0x120):case'web_search_call':case'tool_search_call':case _0x42ccc0(0xb8):return{'kind':'activity'};default:return null;}}async function _n(_0x1ab4d6){const _0x293078=_0x1ffb41;let _0x3bf3f5=null;try{await B(_0x1ab4d6,_0x30853f=>{let _0x350077=Ss(_0x30853f);_0x350077&&(_0x3bf3f5=_0x350077);});}catch(_0x5b7eae){return _0x5b7eae[_0x293078(0x1c5)]!=='ENOENT'&&Rn['warn']({'filePath':_0x1ab4d6,'error':String(_0x5b7eae)},_0x293078(0xf7)),{};}return xs(_0x3bf3f5);}async function Pn(_0x2365bb){let _0x39abe4=!0x1,_0x10c8b8=!0x1,_0x3b55c0;try{await B(_0x2365bb,_0x3bbb43=>{const _0x30e965=_0x1bf4;let _0x17d072=Ts(_0x3bbb43);if(_0x17d072){if(_0x17d072['kind']===_0x30e965(0x1cc)){_0x39abe4=!0x0,_0x10c8b8=!0x0,_0x3b55c0=void 0x0;return;}if(_0x17d072['kind']===_0x30e965(0x1cf)){_0x39abe4=!0x1,_0x10c8b8=!0x1,_0x3b55c0=void 0x0;return;}_0x39abe4&&(_0x10c8b8=!0x0,_0x17d072[_0x30e965(0x1dd)]==='assistant'&&_0x17d072['text']&&(_0x3b55c0=_0x17d072[_0x30e965(0x1b1)]));}});}catch(_0x286097){return _0x286097['code']!=='ENOENT'&&Rn['warn']({'filePath':_0x2365bb,'error':String(_0x286097)},'failed\x20to\x20read\x20codex\x20session\x20runtime\x20hints'),{};}return!_0x39abe4||!_0x10c8b8?{}:{'isResponding':!0x0,..._0x3b55c0?{'partialReplyText':_0x3b55c0}:{}};}var rt=require(_0x1ffb41(0xb9));function st(_0x27ef1f){return(0x0,rt['basename'])(_0x27ef1f,'.jsonl')||null;}function ot(_0x5b8c93){const _0x17b56e=_0x1ffb41;return(0x0,rt[_0x17b56e(0x164)])(_0x5b8c93,'.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(_0x2a121b,_0x1e31ef){const _0x3b67d9=_0x1ffb41;return _0x2a121b===_0x3b67d9(0x127)?st(_0x1e31ef):ot(_0x1e31ef);}var Pa=S[_0x1ffb41(0x13b)]({'module':_0x1ffb41(0x1cb)}),G=new Map(),Fn=0x2710;function Me(_0x57db31,_0x3a7fca){return _0x57db31+':'+_0x3a7fca;}function As(_0x106d46,_0x49fcea){const _0x468efc=_0x1ffb41;return _0x106d46[_0x468efc(0xf1)]===_0x49fcea['size']&&_0x106d46[_0x468efc(0x122)]===_0x49fcea['mtimeMs']&&_0x106d46['birthtimeMs']===_0x49fcea['birthtimeMs'];}function it(_0x48c231,_0xa0c9bc,_0xb2949e){const _0x435ac0=_0x1ffb41;let _0x366780=Me(_0xa0c9bc,_0x48c231),_0x4261e8=G[_0x435ac0(0xa5)](_0x366780);if(_0x4261e8){if(!As(_0x4261e8,_0xb2949e)){G[_0x435ac0(0x12c)](_0x366780);return;}return _0x4261e8['lastUsedAt']=Date['now'](),_0x4261e8[_0x435ac0(0x196)];}}function ws(){const _0x449791=_0x1ffb41;if(G[_0x449791(0xf1)]<=Fn)return;let _0x142c1b=[...G['entries']()]['sort']((_0x4b1467,_0x3b6973)=>_0x4b1467[0x1][_0x449791(0x15d)]-_0x3b6973[0x1][_0x449791(0x15d)]),_0x524e6f=G[_0x449791(0xf1)]-Fn;for(let _0x49a7a9=0x0;_0x49a7a9<_0x524e6f;_0x49a7a9+=0x1){let _0x3ed0c5=_0x142c1b[_0x49a7a9]?.[0x0];_0x3ed0c5&&G['delete'](_0x3ed0c5);}}function at(_0x58184b,_0xc408c9,_0x4d4352,_0xc4c44e){const _0x516d54=_0x1ffb41;G['set'](Me(_0xc408c9,_0x58184b),{'size':_0x4d4352['size'],'mtimeMs':_0x4d4352['mtimeMs'],'birthtimeMs':_0x4d4352[_0x516d54(0x1d2)],'value':_0xc4c44e,'lastUsedAt':Date[_0x516d54(0x138)]()}),ws();}async function lt(_0x29947c,_0x5d70cd){let _0x3b342e,_0x1e5f1c,_0xe5dc90=await et(_0x29947c,_0x5d70cd);for(let _0x1c789a of _0xe5dc90['split']('\x0a')){if(!_0x1c789a['trim']())continue;let _0x1eccde;try{_0x1eccde=JSON['parse'](_0x1c789a);}catch{continue;}let _0x350a07=on(_0x1eccde);_0x350a07&&(_0x3b342e=_0x350a07);let _0xab1705=an(_0x1eccde);_0xab1705&&(_0x1e5f1c=_0xab1705);}return{'approvalMode':_0x3b342e,'lastUsage':_0x1e5f1c};}async function ct(_0x4a044c,_0x5d3f7f){const _0x311068=_0x1ffb41;let _0x17a1b2,_0x2d4020,_0xe00deb=await et(_0x4a044c,_0x5d3f7f);for(let _0x3b5626 of _0xe00deb['split']('\x0a')){if(!_0x3b5626['trim']())continue;let _0x38851a;try{_0x38851a=JSON[_0x311068(0x1c6)](_0x3b5626);}catch{continue;}let _0x4f504b=sn(_0x38851a);_0x4f504b&&(_0x17a1b2=_0x4f504b);let _0x1f161a=ln(_0x38851a);_0x1f161a&&(_0x2d4020=_0x1f161a);}return{'approvalMode':_0x17a1b2,'lastUsage':_0x2d4020};}var $a=S['child']({'module':'inventory'});function kn(_0x495b2d='high',_0x2c7987=_0x1ffb41(0x15e)){const _0x5647b5=_0x1ffb41;return{'state':_0x5647b5(0xe8),'confidence':_0x495b2d,'resumeMode':_0x2c7987};}var ft=S['child']({'module':'scanner'}),_e=0x7530,sl=re(_e),ol=re(_e),il=re(_e),Re=re(_e),ut=new Map(),dt=new Map();function Dn(_0x59e31b){const _0x4c53ab=_0x1ffb41;let _0x1fdb9e='codex-latest:'+(0x0,ee['homedir'])(),_0x1e2a55=new Map();for(let _0x383b0c of _0x59e31b)_0x1e2a55['has'](_0x383b0c[_0x4c53ab(0x17a)])||_0x1e2a55['set'](_0x383b0c['cwd'],_0x383b0c['match']);Re['set'](_0x1fdb9e,_0x1e2a55);}function bs(_0x4415a0){const _0x2afbf0=_0x1ffb41;let _0x21516c=(0x0,v[_0x2afbf0(0x164)])(_0x4415a0[_0x2afbf0(0xaf)])['match'](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x21516c){let _0x51c74d=Date['parse'](_0x21516c[0x1]+':'+_0x21516c[0x2]+':'+_0x21516c[0x3]);if(Number['isFinite'](_0x51c74d))return _0x51c74d;}return _0x4415a0['birthtimeMs'];}function Ln(_0x27a97e){const _0x189011=_0x1ffb41;return _0x27a97e?.[_0x189011(0x1d9)]()||void 0x0;}function vs(_0x1bf0eb){const _0x32a6de=_0x1ffb41;if(_0x1bf0eb['type']!=='session_meta')return null;let _0x29bf31=_0x1bf0eb['payload']?.[_0x32a6de(0x109)],_0x294a7d=typeof _0x29bf31==_0x32a6de(0xdd)&&_0x29bf31!==null&&Object[_0x32a6de(0xa3)](_0x29bf31,_0x32a6de(0x179)),_0x1fa35e=Ln(_0x1bf0eb['payload']?.[_0x32a6de(0x160)])||(_0x294a7d?Ln(_0x29bf31[_0x32a6de(0x179)]?.['thread_spawn']?.['parent_thread_id']):void 0x0);return!_0x1fa35e&&!_0x294a7d?null:_0x1fa35e?{'parentSessionId':_0x1fa35e}:{};}function Un(_0x34a212){const _0x27d673=_0x1ffb41;for(let _0x1dd40b of de(_0x34a212,0x60)){let _0x30771e;try{_0x30771e=JSON['parse'](_0x1dd40b);}catch{continue;}if(_0x30771e['type']===_0x27d673(0x172))return vs(_0x30771e);}return null;}async function Is(_0x5e3d23,_0xe1ce16){const _0x4cfd34=_0x1ffb41;if(_0xe1ce16){let _0x466ab7=it(_0x5e3d23,'codex',_0xe1ce16);if(_0x466ab7!==void 0x0)return _0x466ab7?{'cwd':_0x466ab7['cwd'],'sessionId':_0x466ab7['sessionId']}:null;}let _0x124d81=_0xe1ce16??await(0x0,R['stat'])(_0x5e3d23)[_0x4cfd34(0xb5)](()=>null);if(!_0x124d81)return null;try{let _0x4f2d46=await Ee(_0x5e3d23,_0x124d81[_0x4cfd34(0xf1)]);if(Un(_0x4f2d46))return null;let _0xab590e='',_0x45cb73='';for(let _0x2819b7 of de(_0x4f2d46,0x60)){let _0x3c5256;try{_0x3c5256=JSON[_0x4cfd34(0x1c6)](_0x2819b7);}catch{continue;}if(_0xab590e||(_0xab590e=_0x3c5256[_0x4cfd34(0xfc)]?.[_0x4cfd34(0x17a)]??_0x3c5256['cwd']??''),_0x45cb73||(_0x45cb73=_0x3c5256['payload']?.['id']??_0x3c5256['id']??''),_0xab590e&&_0x45cb73)break;}return _0xab590e?{'cwd':_0xab590e,'sessionId':_0x45cb73||M(_0x4cfd34(0x154),_0x5e3d23)||(0x0,v[_0x4cfd34(0x164)])(_0x5e3d23,_0x4cfd34(0x1b5))}:null;}catch{return null;}}function On(_0xbac0c7,_0x5b26bd='scanner'){const _0x1ad311=_0x1ffb41;return{'sessionId':_0xbac0c7[_0x1ad311(0x1da)],'agent':_0xbac0c7[_0x1ad311(0x91)],'cwd':_0xbac0c7[_0x1ad311(0x17a)],..._0xbac0c7['originCwd']?{'originCwd':_0xbac0c7['originCwd']}:{},..._0xbac0c7['model']?{'model':_0xbac0c7[_0x1ad311(0x199)]}:{},..._0xbac0c7['effort']?{'effort':_0xbac0c7['effort']}:{},'title':_0xbac0c7['title'],..._0xbac0c7['titleAliases']?.['length']?{'titleAliases':_0xbac0c7[_0x1ad311(0x111)]}:{},..._0xbac0c7[_0x1ad311(0x148)]?{'customTitle':_0xbac0c7['customTitle']}:{},..._0xbac0c7[_0x1ad311(0x1e6)]?{'originator':_0xbac0c7['originator']}:{},...typeof _0xbac0c7[_0x1ad311(0x1e2)]=='boolean'?{'externalArchived':_0xbac0c7['externalArchived']}:{},'observedApprovalMode':_0xbac0c7['approvalMode'],'lastUsage':_0xbac0c7[_0x1ad311(0xd9)],'createdAt':_0xbac0c7[_0x1ad311(0x13f)],'lastActivityAt':_0xbac0c7['lastActivityAt'],'sources':[_0x5b26bd],'runtime':kn()};}async function Nn(_0x356043,_0x3a4302){const _0x4af12b=_0x1ffb41;let _0xd287e7=await Ee(_0x356043,_0x3a4302),_0x6d99b0=de(_0xd287e7,0x40),_0x20bd23='',_0x73558f='',_0x4cc44d,_0x131cd7,_0x505c23;for(let _0x2c5165 of _0x6d99b0){let _0x5c9ffa;try{_0x5c9ffa=JSON['parse'](_0x2c5165);}catch{continue;}if(!_0x20bd23&&typeof _0x5c9ffa[_0x4af12b(0x17a)]=='string'&&(_0x20bd23=_0x5c9ffa[_0x4af12b(0x17a)]),!_0x73558f&&typeof _0x5c9ffa['sessionId']=='string'&&(_0x73558f=_0x5c9ffa['sessionId']),_0x4cc44d||(_0x4cc44d=L([_0x5c9ffa[_0x4af12b(0x148)],_0x5c9ffa['summary']])),!_0x505c23){let _0x44125d=j(_0x5c9ffa),_0x3907d1=L([],_0x44125d);_0x3907d1&&(_0x131cd7=_0x44125d,_0x505c23=_0x3907d1);}if(_0x20bd23&&(_0x4cc44d||_0x505c23))break;}if(!_0x20bd23)return null;let _0x5c291f=await ct(_0x356043,_0x3a4302);return{'sessionId':_0x73558f||M('claude',_0x356043)||(0x0,v['basename'])(_0x356043,'.jsonl'),'cwd':_0x20bd23,'title':_0x4cc44d??_0x505c23??L([],_0x131cd7),'approvalMode':_0x5c291f[_0x4af12b(0x16f)],'lastUsage':_0x5c291f[_0x4af12b(0xd9)]};}async function Es(_0x1652d6,_0x5ab7e9){const _0xaf598e=_0x1ffb41;let _0x535421=await Ee(_0x1652d6,_0x5ab7e9);if(Un(_0x535421))return null;let _0xacde65=de(_0x535421,0x60),_0x5441af='',_0x1dc4a5='',_0x213520,_0x55bb2d,_0x2276ae,_0x51da63;for(let _0x254a44 of _0xacde65){let _0x34169f;try{_0x34169f=JSON[_0xaf598e(0x1c6)](_0x254a44);}catch{continue;}if(_0x5441af||(_0x5441af=_0x34169f['payload']?.['cwd']??_0x34169f[_0xaf598e(0x17a)]??''),_0x1dc4a5||(_0x1dc4a5=_0x34169f['payload']?.['id']??_0x34169f['id']??''),!_0x51da63&&typeof _0x34169f['payload']?.[_0xaf598e(0x1e6)]=='string'&&(_0x51da63=_0x34169f[_0xaf598e(0xfc)][_0xaf598e(0x1e6)]),_0x213520||(_0x213520=L([_0x34169f['payload']?.[_0xaf598e(0x11c)],_0x34169f['title']])),!_0x2276ae){let _0x23b588=fe(_0x34169f),_0x55f424=_0x23b588&&!z(_0x23b588)?L([],_0x23b588):void 0x0;_0x55f424&&(_0x55bb2d=_0x23b588,_0x2276ae=_0x55f424);}if(_0x5441af&&(_0x213520||_0x2276ae))break;}if(!_0x5441af)return null;let _0x506ff1=await lt(_0x1652d6,_0x5ab7e9),_0x84cf8b=_0x1dc4a5||M(_0xaf598e(0x154),_0x1652d6)||(0x0,v['basename'])(_0x1652d6,'.jsonl'),_0x59b0d6=_0x213520??_0x2276ae??L([],_0x55bb2d);return{'sessionId':_0x84cf8b,'cwd':_0x5441af,'title':_0x59b0d6,'approvalMode':_0x506ff1[_0xaf598e(0x16f)],'lastUsage':_0x506ff1[_0xaf598e(0xd9)],'originator':_0x51da63};}async function Ms(_0x13a15d,_0x5d828c,_0xf221b8){const _0x97cf65=_0x1ffb41;return Pe(_0x5d828c)[_0x97cf65(0x144)](_0x13a15d,_0xf221b8[_0x97cf65(0xf1)]);}async function Rs(_0x1dc74d,_0x4e7ed8,_0x2af2ba){const _0x3d94bf=_0x1ffb41;let _0x4a4e0d=it(_0x1dc74d,_0x4e7ed8,_0x2af2ba);if(_0x4a4e0d!==void 0x0)return _0x4a4e0d;let _0x5c7e0a=Me(_0x4e7ed8,_0x1dc74d)+':'+_0x2af2ba['size']+':'+_0x2af2ba['mtimeMs']+':'+_0x2af2ba['birthtimeMs'],_0x35f7f1=dt['get'](_0x5c7e0a);return _0x35f7f1||(_0x35f7f1=(async()=>{try{let _0x2741b6=await Ms(_0x1dc74d,_0x4e7ed8,_0x2af2ba);return at(_0x1dc74d,_0x4e7ed8,_0x2af2ba,_0x2741b6),_0x2741b6;}catch{return at(_0x1dc74d,_0x4e7ed8,_0x2af2ba,null),null;}})()[_0x3d94bf(0x1bf)](()=>{dt['delete'](_0x5c7e0a);}),dt['set'](_0x5c7e0a,_0x35f7f1)),_0x35f7f1;}function _s(_0xbd1b01,_0x1eed0f,_0x1b9a5e,_0x1e5803){const _0x340926=_0x1ffb41;let _0x3dd8f3={'sessionId':_0xbd1b01['sessionId'],'agent':_0xbd1b01['agent'],'cwd':_0xbd1b01['cwd'],'title':_0xbd1b01['title'],'approvalMode':_0xbd1b01['approvalMode'],'lastUsage':_0xbd1b01[_0x340926(0xd9)],'originator':_0xbd1b01['originator'],'createdAt':new Date(_0x1b9a5e['birthtimeMs'])['toISOString'](),'lastActivityAt':new Date(_0x1b9a5e[_0x340926(0x122)])[_0x340926(0x161)](),'filePath':_0x1eed0f};if(_0xbd1b01['agent']!==_0x340926(0x154))return _0x3dd8f3;let _0x8e02d5=Sn(_0x1e5803,_0xbd1b01['sessionId'],_0x1eed0f),_0x2bedda=yn(_0x1e5803,_0xbd1b01['sessionId'],_0x1eed0f),_0x1f96a0=_0x8e02d5&&_0xbd1b01['title']&&_0x8e02d5!==_0xbd1b01['title']?[_0xbd1b01[_0x340926(0x11c)]]:void 0x0;return{..._0x3dd8f3,'title':_0x8e02d5??_0xbd1b01['title'],..._0x1f96a0?{'titleAliases':_0x1f96a0}:{},...typeof _0x2bedda==_0x340926(0x181)?{'externalArchived':_0x2bedda}:{}};}async function pt(_0x3d305a,_0x5e8a9e,_0x475efd,_0xbec7bf){let _0x4fa084=await Rs(_0x3d305a,_0x5e8a9e,_0x475efd);if(!_0x4fa084)return null;let _0x19ba95=_0x5e8a9e==='codex'?_0xbec7bf??await Ie():void 0x0;return _s(_0x4fa084,_0x3d305a,_0x475efd,_0x19ba95);}async function $n(_0x344096,_0x39127f){const _0x47b84f=_0x1ffb41;let _0x29af2c=await(0x0,R[_0x47b84f(0x1c4)])(_0x344096)[_0x47b84f(0xb5)](()=>null);return _0x29af2c?.['isFile']()?pt(_0x344096,_0x39127f,{'size':_0x29af2c['size'],'mtimeMs':_0x29af2c['mtimeMs'],'birthtimeMs':_0x29af2c[_0x47b84f(0x1d2)]}):null;}async function Wn(_0x3979a3,_0x5cc75c={}){const _0x3f585c=_0x1ffb41;if(!_0x3979a3)return null;let _0x42987e=typeof _0x5cc75c[_0x3f585c(0xa0)]==_0x3f585c(0x107)?_0x5cc75c['createdAfterMs']:null,_0x33a45d='codex-latest:'+(0x0,ee[_0x3f585c(0xb2)])(),_0x55ba1d=_0x42987e===null?Re['get'](_0x33a45d):null;if(_0x55ba1d&&_0x42987e===null){let _0x50038f=_0x55ba1d[_0x3f585c(0xa5)](_0x3979a3);if(_0x55ba1d[_0x3f585c(0x121)](_0x3979a3))return _0x50038f?{'sessionId':_0x50038f['sessionId'],'filePath':_0x50038f[_0x3f585c(0xaf)]}:null;}let _0x38b115=_0x42987e===null?_0x3979a3:_0x3979a3+':'+_0x42987e,_0x3b15ed=ut[_0x3f585c(0xa5)](_0x38b115);_0x3b15ed||(_0x3b15ed=(async()=>{const _0x54e226=_0x3f585c;let _0x3fbb4c=(await ie())['filter'](_0x28038d=>_0x42987e===null||bs(_0x28038d)>=_0x42987e),_0x1d1b9a=Pe(_0x54e226(0x154));for(let _0x2f22f6=0x0;_0x2f22f6<_0x3fbb4c['length'];_0x2f22f6+=b){let _0x5180c2=_0x3fbb4c['slice'](_0x2f22f6,_0x2f22f6+b),_0x5763f0=(await Promise['all'](_0x5180c2[_0x54e226(0x17c)](async _0x4bbfe2=>{const _0x322b73=_0x54e226;let _0x5eaea4=await _0x1d1b9a[_0x322b73(0xf3)](_0x4bbfe2[_0x322b73(0xaf)],_0x4bbfe2);return _0x5eaea4?{'entry':_0x4bbfe2,'meta':_0x5eaea4}:null;})))[_0x54e226(0x1b7)](_0x12952c=>_0x12952c?.[_0x54e226(0xac)][_0x54e226(0x17a)]===_0x3979a3);if(_0x5763f0)return{'path':_0x5763f0['entry'][_0x54e226(0xaf)],'mtimeMs':_0x5763f0['entry']['mtimeMs'],'sessionId':_0x5763f0['meta']['sessionId']};}return null;})()['finally'](()=>{const _0x3938ff=_0x3f585c;ut[_0x3938ff(0x12c)](_0x38b115);}),ut[_0x3f585c(0x151)](_0x38b115,_0x3b15ed));let _0x5ea329=await _0x3b15ed;if(_0x42987e!==null)return _0x5ea329?{'sessionId':_0x5ea329['sessionId'],'filePath':_0x5ea329[_0x3f585c(0xaf)]}:null;let _0x87a8b9=Re[_0x3f585c(0xa5)](_0x33a45d)??_0x55ba1d??new Map();return _0x87a8b9[_0x3f585c(0x151)](_0x3979a3,_0x5ea329),Re[_0x3f585c(0x151)](_0x33a45d,_0x87a8b9),_0x5ea329?{'sessionId':_0x5ea329['sessionId'],'filePath':_0x5ea329['path']}:null;}async function mt(_0x2125cd,_0x5a3c11){const _0x50a3cf=_0x1ffb41;let _0x2b24f9=(0x0,v['join'])((0x0,ee[_0x50a3cf(0xb2)])(),'.claude','projects'),_0x401e59=_0x5a3c11?fn(_0x5a3c11):null,_0x2addf3=await(0x0,R['readdir'])(_0x2b24f9)['catch'](()=>[]),_0x1f18bc=_0x401e59?[_0x401e59,..._0x2addf3[_0x50a3cf(0xbc)](_0x5e5f9d=>_0x5e5f9d!==_0x401e59)]:_0x2addf3;for(let _0x196db2 of _0x1f18bc){let _0x3d2867=(0x0,v['join'])(_0x2b24f9,_0x196db2,_0x2125cd+_0x50a3cf(0x1b5));if((await(0x0,R['stat'])(_0x3d2867)['catch'](()=>null))?.['isFile']())return _0x3d2867;}return null;}async function Ps(_0x523967,_0x138994){const _0x54aef7=_0x1ffb41;let _0x4888c2=await mt(_0x523967,_0x138994);if(!_0x4888c2)return;let _0x567d46=await(0x0,R['stat'])(_0x4888c2)[_0x54aef7(0xb5)](()=>null);return _0x567d46?.['isFile']()?(await ct(_0x4888c2,_0x567d46[_0x54aef7(0xf1)]))[_0x54aef7(0xd9)]:void 0x0;}async function Fs(_0x47a856){const _0x417656=_0x1ffb41;let _0x5c7cbf=(0x0,v[_0x417656(0x96)])((0x0,ee['homedir'])(),'.codex',_0x417656(0x141)),_0x3d4a89=await gt(_0x5c7cbf,_0x47a856);if(!_0x3d4a89)return;let _0x2a5cb7=await(0x0,R['stat'])(_0x3d4a89)[_0x417656(0xb5)](()=>null);return _0x2a5cb7?.[_0x417656(0x11a)]()?(await lt(_0x3d4a89,_0x2a5cb7['size']))[_0x417656(0xd9)]:void 0x0;}async function ks(_0x59786e,_0x583ba1,_0x483019){const _0x22988c=_0x1ffb41;return Pe(_0x583ba1)[_0x22988c(0xc1)](_0x59786e,_0x483019);}async function Bn(_0xce5681,_0x15fef6){return Pe(_0x15fef6)['readRuntimeHintsFromFile'](_0xce5681);}function Z(_0x1a7ada,_0x3fbcd7,_0x29bb56){const _0x5309c4=_0x1ffb41;let _0x14993d=An(_0x3fbcd7);if(_0x29bb56?.['coalesceConsecutiveAssistant']&&_0x14993d[_0x5309c4(0x92)]===_0x5309c4(0x101)){let _0x36cf7b=_0x1a7ada[_0x1a7ada['length']-0x1];if(_0x36cf7b?.['role']===_0x5309c4(0x101)&&_0x36cf7b[_0x5309c4(0x10d)]!=='info'&&_0x14993d['type']!==_0x5309c4(0x15a)&&!_t(_0x36cf7b[_0x5309c4(0x1db)])&&(_0x14993d['content']===_0x36cf7b['content']||_0x14993d['content'][_0x5309c4(0x11b)](_0x36cf7b['content']))){_0x1a7ada[_0x1a7ada['length']-0x1]=_0x14993d;return;}}_0x1a7ada['push'](_0x14993d);}async function Ls(_0x4950ee,_0x2317c9){const _0x544253=_0x1ffb41;let _0x23d0d2=[];try{let _0x556f03=await mt(_0x4950ee,_0x2317c9);if(_0x556f03){let _0x4a3945=new Map();await B(_0x556f03,_0x447317=>{const _0x2be82f=_0x1bf4;if(_0x447317[_0x2be82f(0x10d)]===_0x2be82f(0x101)&&_0x447317['message']?.['role']===_0x2be82f(0x101)&&Array[_0x2be82f(0x115)](_0x447317[_0x2be82f(0xeb)]['content']))for(let _0x4459bb of _0x447317['message']['content']){if(!_0x4459bb||typeof _0x4459bb!='object'||_0x4459bb['type']!=='tool_use'||typeof _0x4459bb['id']!='string')continue;let _0x25cea9=typeof _0x4459bb['name']=='string'?_0x4459bb['name']:null,_0x321c94=_0x4459bb[_0x2be82f(0x139)]&&typeof _0x4459bb[_0x2be82f(0x139)]=='object'?_0x4459bb['input']:null,_0x5f3f04=Pt(_0x25cea9,_0x321c94,_0x2317c9);_0x5f3f04&&_0x4a3945['set'](_0x4459bb['id'],_0x5f3f04);}if(_0x447317['type']==='user'&&_0x447317['message']?.[_0x2be82f(0x92)]===_0x2be82f(0x1d3)){if(Array['isArray'](_0x447317['message'][_0x2be82f(0x1db)]))for(let _0x1cafa4 of _0x447317['message']['content']){if(!_0x1cafa4||typeof _0x1cafa4!=_0x2be82f(0xdd)||_0x1cafa4['type']!=='tool_result')continue;if(_0x1cafa4[_0x2be82f(0x18f)]===!0x0){let _0x17c56f=tt(_0x1cafa4[_0x2be82f(0x1db)]),_0x29d21e=vn(_0x17c56f);_0x29d21e&&Z(_0x23d0d2,In(_0x29d21e,nt(_0x447317)));continue;}let _0x46bc63=typeof _0x1cafa4[_0x2be82f(0x1c8)]==_0x2be82f(0x11f)?_0x1cafa4['tool_use_id']:'',_0xc776fa=_0x46bc63?_0x4a3945[_0x2be82f(0xa5)](_0x46bc63):void 0x0;if(!_0xc776fa)continue;let _0x1d7d7a=tt(_0x1cafa4['content']);if(!Ft(_0x447317['toolUseResult'],_0x1d7d7a))continue;let _0x1e1cab=We([_0xc776fa]);_0x1e1cab&&Z(_0x23d0d2,q({'role':'assistant','content':_0x1e1cab},_0x447317));}let _0x354142=j(_0x447317);if(_0x354142){let _0x220abe=typeof _0x447317['parentUuid']==_0x2be82f(0x11f)&&_0x447317[_0x2be82f(0x156)]?_0x447317[_0x2be82f(0x156)]:null;Z(_0x23d0d2,q({'role':'user','content':_0x354142,...typeof _0x447317[_0x2be82f(0x128)]=='string'&&_0x447317['uuid']?{'rewindPoint':{'provider':'claude','messageId':_0x220abe}}:{}},_0x447317));}}else{if(_0x447317[_0x2be82f(0x10d)]==='assistant'&&_0x447317[_0x2be82f(0xeb)]?.['role']==='assistant'){let _0x145bcf=H(_0x447317['message'][_0x2be82f(0x1db)]);_0x145bcf&&Z(_0x23d0d2,q({'role':_0x2be82f(0x101),'content':_0x145bcf},_0x447317));}}});}}catch(_0xc5766c){ft[_0x544253(0x12a)]({'error':String(_0xc5766c)},_0x544253(0xd5));}return _0x23d0d2;}async function Ns(_0x28d4ff,_0x30867e){const _0xfc65f6=_0x1ffb41;let _0x4d856c=[];try{let _0x3ccd05=await ks(_0x28d4ff,_0xfc65f6(0x154),_0x30867e);if(_0x3ccd05){let _0x9f54c0;await B(_0x3ccd05,_0x2064ef=>{const _0x53f878=_0xfc65f6;_0x2064ef[_0x53f878(0x10d)]==='event_msg'&&_0x2064ef['payload']?.['type']==='task_started'&&(_0x9f54c0=typeof _0x2064ef['payload']['turn_id']=='string'&&_0x2064ef['payload']['turn_id']?_0x2064ef['payload']['turn_id']:void 0x0);let _0x4abb33=kt(_0x2064ef,{'cwd':_0x30867e,'includePatchCalls':!0x0}),_0x1d87bd=We(_0x4abb33);if(_0x1d87bd&&Z(_0x4d856c,q({'role':_0x53f878(0x101),'content':_0x1d87bd},_0x2064ef)),_0x2064ef[_0x53f878(0x10d)]!==_0x53f878(0x1c3)||_0x2064ef[_0x53f878(0xfc)]?.[_0x53f878(0x10d)]!==_0x53f878(0xeb))return;let _0x473a96=_0x2064ef['payload']['role'];if(_0x473a96!==_0x53f878(0x1d3)&&_0x473a96!=='assistant')return;let _0xf54065=N(_0x2064ef['payload'][_0x53f878(0x1db)]);_0xf54065&&(_0x473a96==='user'&&z(_0xf54065)||Z(_0x4d856c,q({'role':_0x473a96,'content':_0xf54065,..._0x473a96==='user'&&_0x9f54c0?{'rewindPoint':{'provider':'codex','turnId':_0x9f54c0}}:{}},_0x2064ef),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0x36d1b4){ft['warn']({'error':String(_0x36d1b4)},_0xfc65f6(0xd8));}return _0x4d856c;}var Ds={'claude':{'agent':_0x1ffb41(0x127),'extractSessionIdFromFile':st,async 'readFileMeta'(_0x51b039,_0x131d0a){const _0x2ac79c=_0x1ffb41;let _0x3b7c0c=await Nn(_0x51b039,_0x131d0a);return _0x3b7c0c?{..._0x3b7c0c,'agent':_0x2ac79c(0x127)}:null;},async 'readSessionCwdAndId'(_0xcb44fa,_0x18024c){const _0x8f1f0b=_0x1ffb41;let _0x1f4d72=_0x18024c??await(0x0,R[_0x8f1f0b(0x1c4)])(_0xcb44fa)[_0x8f1f0b(0xb5)](()=>null);if(!_0x1f4d72)return null;let _0xad9616=await Nn(_0xcb44fa,_0x1f4d72[_0x8f1f0b(0xf1)]);return _0xad9616?{'cwd':_0xad9616['cwd'],'sessionId':_0xad9616[_0x8f1f0b(0x1da)]}:null;},'resolveSessionFilePath':mt,'readLastUsage':Ps,'readRuntimeHintsFromFile':_n,'readHistory':Ls},'codex':{'agent':'codex','extractSessionIdFromFile':ot,async 'readFileMeta'(_0x48a512,_0x4e64ea){let _0x2fc6a3=await Es(_0x48a512,_0x4e64ea);return _0x2fc6a3?{..._0x2fc6a3,'agent':'codex'}:null;},'readSessionCwdAndId':Is,async 'resolveSessionFilePath'(_0x3baf35){let _0xbbd2b6=(0x0,v['join'])((0x0,ee['homedir'])(),'.codex','sessions');return gt(_0xbbd2b6,_0x3baf35);},'readLastUsage':Fs,'readRuntimeHintsFromFile':Pn,'readHistory':Ns}};function Pe(_0x3dafff){return Ds[_0x3dafff];}async function gt(_0xbcf70b,_0x3d9640){const _0x518fe0=_0x1ffb41;try{let _0x27d476=await(0x0,R['readdir'])(_0xbcf70b,{'withFileTypes':!0x0});for(let _0x4e9036 of _0x27d476){let _0xbddd43=(0x0,v[_0x518fe0(0x96)])(_0xbcf70b,_0x4e9036[_0x518fe0(0x1e3)]);if(_0x4e9036[_0x518fe0(0x168)]()){let _0xb7a6d2=await gt(_0xbddd43,_0x3d9640);if(_0xb7a6d2)return _0xb7a6d2;}else{if(_0x4e9036['name']['includes'](_0x3d9640)&&_0x4e9036['name'][_0x518fe0(0x1b6)]('.jsonl'))return _0xbddd43;}}}catch(_0x530e89){ft[_0x518fe0(0x12a)]({'error':String(_0x530e89)},_0x518fe0(0x12b));}return null;}var Us=0x40;function ht(_0x276159){const _0x520dc7=_0x1ffb41;return _0x276159['size']+':'+_0x276159['mtimeMs']+':'+_0x276159[_0x520dc7(0x1d2)];}function Os(_0x2caa4e){const _0x42c3ab=_0x1ffb41;return _0x2caa4e['map'](_0x4f642a=>_0x4f642a[_0x42c3ab(0xaf)]+'\x00'+ht(_0x4f642a))[_0x42c3ab(0xb0)]()[_0x42c3ab(0x96)]('\x0a');}async function $s(){const _0x1cd4f4=_0x1ffb41;let [_0x16d65a,_0x4ad95a,_0x697a25,_0x16fe48]=await Promise['all']([Be(),ie(),oe(),(0x0,Hn['stat'])((0x0,zn[_0x1cd4f4(0x96)])((0x0,jn[_0x1cd4f4(0xb2)])(),'.codex','state_5.sqlite'))['catch'](()=>null)]),[_0x475ded,_0x32d3da]=await Promise['all']([J(_0x16d65a),J(_0x697a25)]);return{'claudeFiles':_0x475ded,'codexFiles':_0x4ad95a,'claudeMetadataFingerprint':Os(_0x32d3da),'codexMetadataFingerprint':_0x16fe48?.['isFile']()?_0x16fe48['size']+':'+_0x16fe48[_0x1cd4f4(0x122)]+':'+_0x16fe48['birthtimeMs']:''};}async function Ws(_0x126fde,_0x47a128,_0x1685f1){const _0x28ef2e=_0x1ffb41;let _0x26b9a2=await pt(_0x126fde[_0x28ef2e(0xaf)],_0x47a128,_0x126fde,_0x47a128==='codex'?_0x1685f1[_0x28ef2e(0x154)]:void 0x0);if(!_0x26b9a2)return null;let _0x578721=_0x47a128==='claude'?Ve(_0x26b9a2,_0x1685f1[_0x28ef2e(0x127)][_0x28ef2e(0xc9)]['get'](_0x26b9a2[_0x28ef2e(0x1da)])):_0x26b9a2;return On(_0x578721);}var Bs={'collectContext':$s,'loadClaudeLookup':Ge,'loadCodexLookup':async _0x30089e=>(_0x30089e&&Ye(),Ie()),'readSession':Ws,'updateLatestCodexCache':Dn},Fe=class{constructor(_0x2bfcc4=Bs,_0x19b9f8=Us){this['dependencies']=_0x2bfcc4,this['batchSize']=_0x19b9f8;}['entries']=new Map();['claudeMetadataFingerprint']=null;['codexMetadataFingerprint']=null;[_0x1ffb41(0x19b)]=null;[_0x1ffb41(0x1a4)]=null;async['scan'](_0x3d494d){const _0xe4b405=_0x1ffb41;let _0x5d858f=await this['dependencies'][_0xe4b405(0xf2)](),_0x3230d3=this['claudeMetadataFingerprint']===null||this[_0xe4b405(0xc2)]!==_0x5d858f['claudeMetadataFingerprint'],_0x1ee9ac=this['codexMetadataFingerprint']===null||this['codexMetadataFingerprint']!==_0x5d858f['codexMetadataFingerprint'],[_0x37eb57,_0x397111]=await Promise[_0xe4b405(0x1a8)]([_0x3230d3||!this['claudeLookup']?this['dependencies']['loadClaudeLookup']():Promise[_0xe4b405(0x14e)](this[_0xe4b405(0x19b)]),_0x1ee9ac||!this['codexLookup']?this['dependencies']['loadCodexLookup'](this['codexMetadataFingerprint']!==null):Promise[_0xe4b405(0x14e)](this[_0xe4b405(0x1a4)])]),_0x35a4ce={'claude':_0x37eb57,'codex':_0x397111},_0x498d61=[..._0x5d858f['claudeFiles']['map'](_0x30dffb=>({'agent':_0xe4b405(0x127),'entry':_0x30dffb})),..._0x5d858f[_0xe4b405(0xad)][_0xe4b405(0x17c)](_0x8fafa5=>({'agent':_0xe4b405(0x154),'entry':_0x8fafa5}))]['sort']((_0x507473,_0x361587)=>_0x361587['entry'][_0xe4b405(0x122)]-_0x507473['entry'][_0xe4b405(0x122)]),_0x2eedec=new Set(_0x498d61[_0xe4b405(0x17c)](({entry:_0x49af1b})=>_0x49af1b[_0xe4b405(0xaf)])),_0x1a4c85=[...this[_0xe4b405(0x166)]['keys']()]['filter'](_0x3ff009=>!_0x2eedec['has'](_0x3ff009))[_0xe4b405(0x194)],_0x32ff92=new Map(),_0x47e34e=_0x498d61['filter'](({agent:_0x36c1ef,entry:_0x2ad2ed})=>{const _0x310c07=_0xe4b405;let _0x25c3df=this['entries']['get'](_0x2ad2ed[_0x310c07(0xaf)]);return!(_0x36c1ef==='claude'?_0x3230d3:_0x1ee9ac)&&_0x25c3df?.['fingerprint']===ht(_0x2ad2ed)?(_0x32ff92['set'](_0x2ad2ed['path'],_0x25c3df),!0x1):!0x0;}),_0x1b8a76=0x0,_0x3817f1=Math['max'](0x1,this['batchSize']);for(let _0x5a2a4e=0x0;_0x5a2a4e<_0x47e34e['length'];_0x5a2a4e+=_0x3817f1){let _0x3ab7d7=_0x47e34e[_0xe4b405(0x135)](_0x5a2a4e,_0x5a2a4e+_0x3817f1),_0x27c845=await _(_0x3ab7d7,b,({agent:_0x55ea6b,entry:_0x4f9eb1})=>this[_0xe4b405(0x158)][_0xe4b405(0x140)](_0x4f9eb1,_0x55ea6b,_0x35a4ce));for(let _0x2b04fe=0x0;_0x2b04fe<_0x3ab7d7['length'];_0x2b04fe+=0x1){let _0x2bc2a1=_0x3ab7d7[_0x2b04fe];_0x32ff92[_0xe4b405(0x151)](_0x2bc2a1[_0xe4b405(0xa7)][_0xe4b405(0xaf)],{'fingerprint':ht(_0x2bc2a1['entry']),'session':_0x27c845[_0x2b04fe]});}_0x1b8a76+=_0x3ab7d7['length'],_0x3d494d?.({'processedFiles':_0x1b8a76,'changedFiles':_0x47e34e[_0xe4b405(0x194)],'totalFiles':_0x498d61['length'],'removedFiles':_0x1a4c85});}let _0x46f23f=[..._0x32ff92[_0xe4b405(0xb6)]()][_0xe4b405(0x17c)](_0x5907a9=>_0x5907a9['session'])['filter'](_0x535cd9=>_0x535cd9!==null)[_0xe4b405(0xb0)]((_0x8042d6,_0x54add4)=>_0x54add4['lastActivityAt']['localeCompare'](_0x8042d6['lastActivityAt']));return this['dependencies'][_0xe4b405(0x18a)](_0x498d61[_0xe4b405(0xbc)](({agent:_0x45b177})=>_0x45b177===_0xe4b405(0x154))[_0xe4b405(0x17c)](({entry:_0x27d2c5})=>{const _0x101009=_0xe4b405;let _0x219f0d=_0x32ff92[_0x101009(0xa5)](_0x27d2c5[_0x101009(0xaf)])?.['session'];return _0x219f0d?{'cwd':_0x219f0d['cwd'],'match':{'path':_0x27d2c5[_0x101009(0xaf)],'mtimeMs':_0x27d2c5['mtimeMs'],'sessionId':_0x219f0d[_0x101009(0x1da)]}}:null;})['filter'](_0x58ff6b=>_0x58ff6b!==null)),this['entries']=_0x32ff92,this['claudeLookup']=_0x37eb57,this['codexLookup']=_0x397111,this['claudeMetadataFingerprint']=_0x5d858f[_0xe4b405(0xc2)],this['codexMetadataFingerprint']=_0x5d858f['codexMetadataFingerprint'],{'sessions':_0x46f23f,'changedFiles':_0x47e34e[_0xe4b405(0x194)],'reusedFiles':_0x498d61['length']-_0x47e34e['length'],'removedFiles':_0x1a4c85,'totalFiles':_0x498d61[_0xe4b405(0x194)]};}},nr=require(_0x1ffb41(0x16a)),Se=require(_0x1ffb41(0x19e)),vt=require('node:os'),ge=require('node:path'),rr=require('node:util'),St=class{[_0x1ffb41(0x1d0)]=new Map();['timers']=new Map();[_0x1ffb41(0x108)]=new Map();['startTime']=Date['now']();['logInterval']=null;[_0x1ffb41(0x162)](_0x1b04b6,_0x221fa8={}){const _0x3c6358=_0x1ffb41;this[_0x3c6358(0x1d0)]['has'](_0x1b04b6)||this[_0x3c6358(0x1d0)][_0x3c6358(0x151)](_0x1b04b6,[]);let _0x3ab908=this[_0x3c6358(0x1d0)][_0x3c6358(0xa5)](_0x1b04b6),_0x2681d5=JSON[_0x3c6358(0x136)](_0x221fa8),_0x539508=_0x3ab908[_0x3c6358(0x1b7)](_0x2ad2e6=>JSON['stringify'](_0x2ad2e6[_0x3c6358(0xe4)])===_0x2681d5);_0x539508?_0x539508['value']++:_0x3ab908[_0x3c6358(0x15c)]({'value':0x1,'labels':_0x221fa8});}['gauge'](_0x505af1,_0x319c3f){const _0x1860e8=_0x1ffb41;this['gauges'][_0x1860e8(0x151)](_0x505af1,_0x319c3f);}[_0x1ffb41(0x1aa)](_0x2773c2){let _0x495342=performance['now']();return()=>{const _0x342ad1=_0x1bf4;let _0xbca35c=Math[_0x342ad1(0xba)](performance['now']()-_0x495342),_0xa28a7a=this['timers']['get'](_0x2773c2)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0xa28a7a[_0x342ad1(0xa1)]++,_0xa28a7a['totalMs']+=_0xbca35c,_0xa28a7a[_0x342ad1(0xaa)]=Math[_0x342ad1(0x137)](_0xa28a7a['minMs'],_0xbca35c),_0xa28a7a['maxMs']=Math[_0x342ad1(0x1cd)](_0xa28a7a['maxMs'],_0xbca35c),_0xa28a7a[_0x342ad1(0xfa)]=_0xbca35c,this['timers']['set'](_0x2773c2,_0xa28a7a),_0xbca35c;};}[_0x1ffb41(0xde)](){const _0x57a5c3=_0x1ffb41;let _0x2f5c38={};for(let [_0x1c8c00,_0x1bb919]of this['counters'])_0x2f5c38[_0x1c8c00]=_0x1bb919[_0x57a5c3(0x17c)](_0x13e162=>({..._0x13e162}));let _0x3c3fa5={};for(let [_0xef4a18,_0x4a880a]of this[_0x57a5c3(0x1af)])_0x3c3fa5[_0xef4a18]={..._0x4a880a,'minMs':_0x4a880a[_0x57a5c3(0xaa)]===0x1/0x0?0x0:_0x4a880a['minMs']};let _0x1fc27d={};for(let [_0x11b34a,_0x55e6b3]of this['gauges'])_0x1fc27d[_0x11b34a]=_0x55e6b3;return{'uptimeMs':Date['now']()-this[_0x57a5c3(0x163)],'counters':_0x2f5c38,'timers':_0x3c3fa5,'gauges':_0x1fc27d};}['startPeriodicLog'](_0x184731=0xea60){const _0xd3d220=_0x1ffb41;this['logInterval']||(this['logInterval']=setInterval(()=>{const _0x18c95d=_0x1bf4;let _0xe13ade=this['snapshot']();S[_0x18c95d(0x15a)]({'metrics':_0xe13ade},'periodic\x20metrics\x20snapshot');},_0x184731),this[_0xd3d220(0x1c0)]['unref']());}['stopPeriodicLog'](){const _0x200ec7=_0x1ffb41;this[_0x200ec7(0x1c0)]&&(clearInterval(this[_0x200ec7(0x1c0)]),this['logInterval']=null);}},V=new St(),xl=S['child']({'module':_0x1ffb41(0xd7)}),yt=require(_0x1ffb41(0xb9)),Hs=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,js=new Set(['sh','bash','zsh',_0x1ffb41(0x19d)]),zs=new Set([_0x1ffb41(0x126),'nohup',_0x1ffb41(0x145),'gtimeout']),qs=new Set([_0x1ffb41(0x19f),_0x1ffb41(0xc0),'bun',_0x1ffb41(0x14b)]),Gs=new Set(['-e','--eval','-p',_0x1ffb41(0x118)]),Vs=new Set(['-r',_0x1ffb41(0xb1),'--import',_0x1ffb41(0x104),'--experimental-loader',_0x1ffb41(0xc6),_0x1ffb41(0x14a)]);function Qs(_0x152d40){return _0x152d40['replace'](/^['"]|['"]$/g,'');}function Gn(_0x59a856){const _0x597fc7=_0x1ffb41;return(_0x59a856['match'](/"[^"]*"|'[^']*'|\S+/g)??[])[_0x597fc7(0x17c)](Qs);}function qn(_0x449776){let _0x37ebac=(0x0,yt['basename'])(_0x449776);return _0x37ebac==='claude'||_0x37ebac==='codex'?_0x37ebac:null;}function Js(_0xf73ae9){const _0x375818=_0x1ffb41;for(let _0x52ddb7 of _0xf73ae9[_0x375818(0x12f)](/&&|\|\||;|\n/)){let _0x224010=Vn(Gn(_0x52ddb7['trim']()),!0x0);if(_0x224010)return _0x224010;}return null;}function Vn(_0x1fce0c,_0x27208b=!0x1){const _0x39e5e8=_0x1ffb41;let _0x4e0337=0x0;for(;_0x4e0337<_0x1fce0c['length'];){let _0x520898=_0x1fce0c[_0x4e0337],_0xc9f6cf=(0x0,yt[_0x39e5e8(0x164)])(_0x520898);if(zs[_0x39e5e8(0x121)](_0xc9f6cf)){if(_0x4e0337+=0x1,_0xc9f6cf===_0x39e5e8(0x126)){for(;_0x4e0337<_0x1fce0c['length']&&/^[A-Za-z_][A-Za-z0-9_]*=/['test'](_0x1fce0c[_0x4e0337]);)_0x4e0337+=0x1;}else{if(_0xc9f6cf===_0x39e5e8(0x145)||_0xc9f6cf==='gtimeout'){for(;_0x4e0337<_0x1fce0c['length']&&_0x1fce0c[_0x4e0337][_0x39e5e8(0x11b)]('-');){let _0x583ec3=_0x1fce0c[_0x4e0337];_0x4e0337+=0x1,_0x583ec3==='-k'&&_0x4e0337<_0x1fce0c['length']&&(_0x4e0337+=0x1);}_0x4e0337<_0x1fce0c['length']&&(_0x4e0337+=0x1);}}continue;}if(js['has'](_0xc9f6cf)){for(let _0x32120c=_0x4e0337+0x1;_0x32120c<_0x1fce0c['length'];_0x32120c+=0x1){let _0x4c8b42=_0x1fce0c[_0x32120c];if(['-c','-lc',_0x39e5e8(0x1ae),_0x39e5e8(0x157),_0x39e5e8(0x1c9),'-xec'][_0x39e5e8(0x9f)](_0x4c8b42)){let _0x28c927=_0x1fce0c[_0x32120c+0x1];return _0x28c927?Js(_0x28c927):null;}}return null;}if(qs['has'](_0xc9f6cf)){let _0x377169=_0x4e0337+0x1;for(;_0x377169<_0x1fce0c['length'];){let _0x9b94c6=_0x1fce0c[_0x377169];if(Gs['has'](_0x9b94c6))return null;if(_0x9b94c6==='--'){_0x377169+=0x1;break;}if(!_0x9b94c6['startsWith']('-'))break;_0x377169+=0x1,Vs[_0x39e5e8(0x121)](_0x9b94c6)&&_0x377169<_0x1fce0c[_0x39e5e8(0x194)]&&(_0x377169+=0x1);}if(_0x377169>=_0x1fce0c[_0x39e5e8(0x194)])return null;let _0x3e5094=qn(_0x1fce0c[_0x377169]);return _0x3e5094?{'agent':_0x3e5094,'args':_0x1fce0c[_0x39e5e8(0x135)](_0x377169+0x1),'viaWrapper':!0x0}:null;}let _0x641937=qn(_0x520898);return _0x641937?{'agent':_0x641937,'args':_0x1fce0c['slice'](_0x4e0337+0x1),'viaWrapper':_0x27208b}:null;}return null;}function xt(_0x20c9cc,_0x19af5c=!0x1){return Vn(Gn(_0x20c9cc),_0x19af5c);}function pe(_0x2592b5){const _0x7b4514=_0x1ffb41;let _0x1de2a1=xt(_0x2592b5);return _0x1de2a1?{'agent':_0x1de2a1[_0x7b4514(0x91)],'args':_0x1de2a1[_0x7b4514(0x1ce)]}:null;}function Le(_0xd5fbc8){const _0x3731ae=_0x1ffb41;return Hs[_0x3731ae(0x150)](_0xd5fbc8)&&xt(_0xd5fbc8)!==null;}function Qn(_0x1ab4a1,_0x4a98ea){const _0xd286b6=_0x1ffb41;let _0x5cfa0f=pe(_0x4a98ea);if(!_0x5cfa0f||_0x5cfa0f['agent']!==_0x1ab4a1)return null;let {args:_0x2c620a}=_0x5cfa0f;if(_0x1ab4a1==='claude'){for(let _0x4cb41f=0x0;_0x4cb41f<_0x2c620a['length'];_0x4cb41f+=0x1){let _0x236e51=_0x2c620a[_0x4cb41f];if((_0x236e51==='--resume'||_0x236e51===_0xd286b6(0x152))&&_0x2c620a[_0x4cb41f+0x1]&&!_0x2c620a[_0x4cb41f+0x1][_0xd286b6(0x11b)]('-'))return _0x2c620a[_0x4cb41f+0x1];if(_0x236e51['startsWith']('--resume='))return _0x236e51[_0xd286b6(0x135)](0x9);if(_0x236e51[_0xd286b6(0x11b)]('--session-id='))return _0x236e51['slice'](0xd);}return null;}return _0x2c620a[0x0]!=='resume'?null:_0x2c620a[_0xd286b6(0x135)](0x1)['find'](_0xe84df1=>!_0xe84df1['startsWith']('-'))??null;}function Ks(_0xb9f80a,_0xf5b1e8){const _0x39ba8f=_0x1ffb41;let _0x31a41f=pe(_0xf5b1e8);if(!(!_0x31a41f||_0x31a41f[_0x39ba8f(0x91)]!==_0xb9f80a)){if(_0xb9f80a==='codex')return _0x31a41f[_0x39ba8f(0x1ce)]['includes'](_0x39ba8f(0xd6))?_0x39ba8f(0x1c1):void 0x0;if(_0x31a41f['args']['includes']('--dangerously-skip-permissions'))return _0x39ba8f(0x1c1);for(let _0x4d65d1=0x0;_0x4d65d1<_0x31a41f[_0x39ba8f(0x1ce)][_0x39ba8f(0x194)];_0x4d65d1+=0x1){let _0x2bead9=_0x31a41f['args'][_0x4d65d1],_0x33f934=_0x2bead9===_0x39ba8f(0xcb)?_0x31a41f['args'][_0x4d65d1+0x1]:_0x2bead9['startsWith'](_0x39ba8f(0xd3))?_0x2bead9['slice'](0x12):void 0x0;if(_0x33f934==='plan')return'plan';if(_0x33f934===_0x39ba8f(0xf0))return'acceptEdits';if(_0x33f934==='default')return'normal';}}}function Ct(_0x103cbc,_0x305cad){const _0x1df2ae=_0x1ffb41;let _0x4d8b65=xt(_0x305cad);return!_0x4d8b65||_0x4d8b65[_0x1df2ae(0x91)]!==_0x103cbc||_0x4d8b65[_0x1df2ae(0x19a)]?!0x1:_0x103cbc===_0x1df2ae(0x127)?!_0x4d8b65['args'][_0x1df2ae(0x9f)]('--continue')&&!_0x4d8b65['args']['includes']('-c'):!(_0x4d8b65['args'][0x0]==='app-server'&&!_0x4d8b65['args']['includes'](_0x1df2ae(0x88))&&!_0x4d8b65['args']['some'](_0x52c417=>_0x52c417['startsWith']('--listen=')));}function ke(_0x3229d0){const _0x41aa76=_0x1ffb41;return _0x3229d0===_0x41aa76(0x1ab)?0x3:_0x3229d0===_0x41aa76(0x1df)?0x2:0x1;}function Xs(_0x5be5e2,_0x14228f){const _0x545016=_0x1ffb41;return _0x5be5e2==='claude'?_0x14228f[_0x545016(0x9f)]('/.claude/projects/')&&!_0x14228f[_0x545016(0x9f)](_0x545016(0x1b4)):_0x14228f['includes'](_0x545016(0x193));}function Tt(_0x1436aa){const _0x16aaa4=_0x1ffb41;let _0x135d6e=[...new Set(_0x1436aa['sessionFiles'])]['filter'](_0x425a69=>Xs(_0x1436aa['agent'],_0x425a69)),_0x584c8f=Qn(_0x1436aa[_0x16aaa4(0x91)],_0x1436aa[_0x16aaa4(0x1bd)]),_0x2e7c4e=Ks(_0x1436aa[_0x16aaa4(0x91)],_0x1436aa[_0x16aaa4(0x1bd)]);if(_0x584c8f)return{'agent':_0x1436aa[_0x16aaa4(0x91)],'pid':_0x1436aa[_0x16aaa4(0x10b)],'cwd':_0x1436aa['cwd'],'command':_0x1436aa[_0x16aaa4(0x1bd)],'sessionId':_0x584c8f,'confidence':'high',..._0x2e7c4e?{'approvalMode':_0x2e7c4e}:{},..._0x135d6e['length']===0x1?{'sessionFilePath':_0x135d6e[0x0]}:{}};if(_0x135d6e[_0x16aaa4(0x194)]!==0x1)return null;let _0x7b1a10=M(_0x1436aa['agent'],_0x135d6e[0x0]);return _0x7b1a10?{'agent':_0x1436aa[_0x16aaa4(0x91)],'pid':_0x1436aa[_0x16aaa4(0x10b)],'cwd':_0x1436aa[_0x16aaa4(0x17a)],'command':_0x1436aa['command'],'sessionId':_0x7b1a10,'confidence':'medium',..._0x2e7c4e?{'approvalMode':_0x2e7c4e}:{},'sessionFilePath':_0x135d6e[0x0]}:null;}function Ys(_0x35ac7a,_0x7e2731){const _0x39ab6a=_0x1ffb41;let _0x103283=_0x35ac7a,_0x212eff=_0x7e2731;(ke(_0x7e2731['confidence'])>ke(_0x35ac7a['confidence'])||ke(_0x7e2731[_0x39ab6a(0x100)])===ke(_0x35ac7a['confidence'])&&_0x7e2731['pid']!==void 0x0&&_0x35ac7a['pid']!==void 0x0&&_0x7e2731[_0x39ab6a(0x10b)]<_0x35ac7a[_0x39ab6a(0x10b)])&&(_0x103283=_0x7e2731,_0x212eff=_0x35ac7a);let _0x3514c3=_0x103283['approvalMode']??_0x212eff['approvalMode'],_0xdf459f=_0x103283[_0x39ab6a(0x11c)]??_0x212eff['title'],_0x3c46f6=_0x103283[_0x39ab6a(0x1e7)]??_0x212eff['sessionFilePath'],_0x37b3ab=_0x103283['isResponding']??_0x212eff[_0x39ab6a(0xbb)],_0x20757f=_0x103283['terminal']??_0x212eff[_0x39ab6a(0xfd)],_0x5a98c5={..._0x103283,'cwd':_0x103283['cwd']||_0x212eff['cwd'],..._0x3514c3?{'approvalMode':_0x3514c3}:{}};return _0xdf459f!==void 0x0&&(_0x5a98c5[_0x39ab6a(0x11c)]=_0xdf459f),_0x3c46f6!==void 0x0&&(_0x5a98c5[_0x39ab6a(0x1e7)]=_0x3c46f6),_0x37b3ab!==void 0x0&&(_0x5a98c5[_0x39ab6a(0xbb)]=_0x37b3ab),_0x20757f!==void 0x0&&(_0x5a98c5[_0x39ab6a(0xfd)]=_0x20757f),_0x5a98c5;}function At(_0x5dcb8c){const _0x291985=_0x1ffb41;let _0x579edd=new Map();for(let _0x1bde0c of _0x5dcb8c){let _0x55a5b2=_0x1bde0c[_0x291985(0x91)]+':'+_0x1bde0c['sessionId'],_0x121b21=_0x579edd['get'](_0x55a5b2);_0x579edd['set'](_0x55a5b2,_0x121b21?Ys(_0x121b21,_0x1bde0c):_0x1bde0c);}return[..._0x579edd[_0x291985(0xb6)]()];}var Ne=require('node:fs/promises'),Xn=require(_0x1ffb41(0x1ca)),wt=require(_0x1ffb41(0xb9));function Yn(){const _0x15b3b1=_0x1ffb41;return(0x0,wt[_0x15b3b1(0x96)])((0x0,Xn['homedir'])(),_0x15b3b1(0x112),'sessions');}function Jn(_0x2da9b0){const _0x9be367=_0x1ffb41;let _0x5a4d08=typeof _0x2da9b0==_0x9be367(0x107)?_0x2da9b0:typeof _0x2da9b0==_0x9be367(0x11f)?Number(_0x2da9b0):Number['NaN'];return Number['isFinite'](_0x5a4d08)&&_0x5a4d08>0x0?_0x5a4d08:void 0x0;}function Kn(_0x11aeea){const _0x3ee838=_0x1ffb41;return _0x11aeea['updatedAt']??_0x11aeea[_0x3ee838(0xe3)]??0x0;}function Zn(_0x21e830){const _0x4cab21=_0x1ffb41;switch(_0x21e830){case'busy':case'responding':return!0x0;case _0x4cab21(0xe8):return!0x1;default:return;}}async function Zs(_0x4941af=Yn()){const _0x19de33=_0x1ffb41;return(await(0x0,Ne['readdir'])(_0x4941af,{'withFileTypes':!0x0})['catch'](()=>[]))['filter'](_0x1b2019=>_0x1b2019['isFile']()&&_0x1b2019[_0x19de33(0x1e3)]['endsWith'](_0x19de33(0xfe)))['map'](_0x43d33d=>(0x0,wt[_0x19de33(0x96)])(_0x4941af,_0x43d33d['name']));}async function eo(_0x6fd5cf){const _0x5dc2a6=_0x1ffb41;try{let _0x626269=JSON[_0x5dc2a6(0x1c6)](await(0x0,Ne['readFile'])(_0x6fd5cf,_0x5dc2a6(0xe6))),_0x44d9d0=T(_0x626269['sessionId']);if(!_0x44d9d0)return;let _0xeebc66={'sessionId':_0x44d9d0},_0x144ca6=T(_0x626269['cwd']),_0x2c5cde=T(_0x626269['status']),_0x2b1668=Jn(_0x626269[_0x5dc2a6(0xe3)]),_0x129ab8=Jn(_0x626269[_0x5dc2a6(0x13e)]);return _0x144ca6&&(_0xeebc66['cwd']=_0x144ca6),_0x2c5cde&&(_0xeebc66['status']=_0x2c5cde),_0x2b1668&&(_0xeebc66['startedAt']=_0x2b1668),_0x129ab8&&(_0xeebc66[_0x5dc2a6(0x13e)]=_0x129ab8),_0xeebc66;}catch{return;}}async function er(_0x554cc5,_0xd2939b=Yn()){if(!_0x554cc5)return;let _0x4ba044=await Zs(_0xd2939b),_0x103aee=await _(_0x4ba044,b,eo),_0x461098;for(let _0x359453 of _0x103aee)!_0x359453||_0x359453['sessionId']!==_0x554cc5||(!_0x461098||Kn(_0x359453)>Kn(_0x461098))&&(_0x461098=_0x359453);return _0x461098;}var no=(0x0,rr[_0x1ffb41(0x131)])(nr['execFile']),bt=S[_0x1ffb41(0x13b)]({'module':_0x1ffb41(0xd7)}),sr=0xbb8,ro=0x3e8,so=0xfa0,tr=0x3,oo=0x1f4,io=0x3a98,he=null,me=null;function or(){he=null;}function ao(_0x7eea51,_0x1cd7bc=Date[_0x1ffb41(0x138)]()){return _0x1cd7bc-_0x7eea51<so;}function lo(_0x463897){const _0x276732=_0x1ffb41;try{return process[_0x276732(0x1d8)](_0x463897,0x0),!0x0;}catch{return!0x1;}}async function De(_0x45ebaf,_0x463d96,_0x22008a=ro){const _0x4e3f15=_0x1ffb41;try{let {stdout:_0x560c5a}=await no(_0x45ebaf,_0x463d96,{'killSignal':process['platform']===_0x4e3f15(0x153)?_0x4e3f15(0x1be):_0x4e3f15(0x102),'maxBuffer':0x800000,'timeout':_0x22008a,'windowsHide':!0x0});return _0x560c5a;}catch(_0x1988a8){let _0x3fa8d6=typeof _0x1988a8==_0x4e3f15(0xdd)&&_0x1988a8!==null?{'code':_0x4e3f15(0x1c5)in _0x1988a8?_0x1988a8[_0x4e3f15(0x1c5)]:void 0x0,'signal':'signal'in _0x1988a8?_0x1988a8['signal']:void 0x0,'killed':'killed'in _0x1988a8?_0x1988a8['killed']:void 0x0}:{},_0x24e975=String(_0x1988a8);return _0x24e975['includes'](_0x4e3f15(0xea))||_0x24e975[_0x4e3f15(0x9f)]('No\x20such\x20process')?bt[_0x4e3f15(0x17b)]({'file':_0x45ebaf,'args':_0x463d96,'timeoutMs':_0x22008a,'error':_0x24e975,..._0x3fa8d6},_0x4e3f15(0x1de)):bt['warn']({'file':_0x45ebaf,'args':_0x463d96,'timeoutMs':_0x22008a,'error':_0x24e975,..._0x3fa8d6},'process\x20scan\x20command\x20failed'),'';}}async function co(_0x42eca6){const _0xd576e5=_0x1ffb41;let _0x3f4aad=_0x42eca6;if(_0x42eca6['sessionFilePath']){let _0x403fcc=await $n(_0x42eca6['sessionFilePath'],_0x42eca6[_0xd576e5(0x91)]);if(!_0x403fcc)return null;let _0x5894ce=await Bn(_0x42eca6['sessionFilePath'],_0x42eca6[_0xd576e5(0x91)]),_0x5e1859=_0x403fcc['approvalMode']??_0x42eca6['approvalMode'];_0x3f4aad={..._0x42eca6,'cwd':_0x42eca6['cwd']||_0x403fcc[_0xd576e5(0x17a)],..._0x5e1859?{'approvalMode':_0x5e1859}:{},'title':_0x42eca6[_0xd576e5(0x11c)]??_0x403fcc['title'],'isResponding':_0x5894ce[_0xd576e5(0xbb)]};}if(_0x3f4aad['agent']!=='claude')return _0x3f4aad;let _0x50c796=await er(_0x3f4aad['sessionId']);if(!_0x50c796)return _0x3f4aad;let _0x45462f=Zn(_0x50c796['status']);return{..._0x3f4aad,'cwd':_0x3f4aad['cwd']||_0x50c796['cwd']||'','isResponding':_0x45462f??_0x3f4aad['isResponding']};}async function uo(_0x18e0df){const _0x9a5743=_0x1ffb41;return process['platform']==='win32'?'':(await De(_0x9a5743(0x132),['-a','-p',String(_0x18e0df),'-d',_0x9a5743(0x17a),_0x9a5743(0x171)]))[_0x9a5743(0x12f)]('\x0a')[_0x9a5743(0x1b7)](_0x1542f6=>_0x1542f6['startsWith']('n'))?.[_0x9a5743(0x135)](0x1)['trim']()??'';}async function fo(_0x18084e){const _0x20520e=_0x1ffb41;if(process[_0x20520e(0xe1)]==='win32')return[];let _0x3b49aa=(await De('lsof',['-p',String(_0x18084e),_0x20520e(0x171)]))[_0x20520e(0x12f)]('\x0a')[_0x20520e(0xbc)](_0x3bbfaa=>_0x3bbfaa['startsWith']('n'))[_0x20520e(0x17c)](_0x1ef8f7=>_0x1ef8f7['slice'](0x1)['trim']())[_0x20520e(0xbc)](_0x11461d=>_0x11461d[_0x20520e(0x1b6)]('.jsonl')?_0x11461d[_0x20520e(0x9f)]('/.claude/projects/')||_0x11461d['includes'](_0x20520e(0x193)):!0x1);return[...new Set(_0x3b49aa)];}function po(_0x16d5c3){const _0x141102=_0x1ffb41;return _0x16d5c3[_0x141102(0x12f)]('\x0a')['map'](_0x4289b3=>_0x4289b3[_0x141102(0x1d9)]())['filter'](Boolean)['map'](_0x2f2dbc=>{let _0x616abe=_0x2f2dbc['match'](/^(\d+)\s+(.*)$/);if(!_0x616abe)return null;let _0x230c81=Number(_0x616abe[0x1]),_0x470615=_0x616abe[0x2];if(!Le(_0x470615))return null;let _0x478f9f=pe(_0x470615);return!Number['isFinite'](_0x230c81)||!_0x478f9f?null:{'pid':_0x230c81,'command':_0x470615,'agent':_0x478f9f['agent']};})[_0x141102(0xbc)](_0x407f48=>!!_0x407f48);}async function mo(){const _0x2266d4=_0x1ffb41;let _0x6e955d=await De('ps',[_0x2266d4(0x8d),'pid=,command='],sr);return po(_0x6e955d);}async function go(){const _0x2ba2c8=_0x1ffb41;return(await De(_0x2ba2c8(0x16b),['process',_0x2ba2c8(0xa5),_0x2ba2c8(0x1ba),'/FORMAT:CSV'],sr))['split']('\x0a')['map'](_0x20758b=>_0x20758b[_0x2ba2c8(0x1d9)]())[_0x2ba2c8(0xbc)](Boolean)[_0x2ba2c8(0x17c)](_0x2dfd2b=>{const _0x426849=_0x2ba2c8;let _0x480b7d=_0x2dfd2b[_0x426849(0x12f)](',');if(_0x480b7d[_0x426849(0x194)]<0x3)return null;let _0x54caae=Number(_0x480b7d[_0x480b7d['length']-0x1]),_0x136660=_0x480b7d['slice'](0x1,_0x480b7d[_0x426849(0x194)]-0x1)['join'](',');if(!Number[_0x426849(0x1a3)](_0x54caae)||_0x54caae===0x0||!Le(_0x136660))return null;let _0x3cacb1=pe(_0x136660);return _0x3cacb1?{'pid':_0x54caae,'command':_0x136660,'agent':_0x3cacb1['agent']}:null;})['filter'](_0x1fcec3=>!!_0x1fcec3);}async function ho(){const _0x59994e=_0x1ffb41;return process['platform']===_0x59994e(0x153)?go():mo();}async function So(_0x5caa4f){const _0x16fed3=_0x1ffb41;let _0x451409=Date[_0x16fed3(0x138)](),_0x286409=V[_0x16fed3(0x1aa)](_0x16fed3(0x113)),_0x2c66d9=await ho();_0x5caa4f&&(_0x5caa4f[_0x16fed3(0x1b0)]+=_0x286409()),_0x5caa4f&&(_0x5caa4f['matchedProcesses']=_0x2c66d9['length']);let _0x5e026e=_0x2c66d9['filter'](_0x54c542=>lo(_0x54c542['pid']));_0x5caa4f&&(_0x5caa4f['aliveProcesses']=_0x5e026e[_0x16fed3(0x194)]);let _0x13f221=V['startTimer']('process.scan.lsof_ms'),_0x1b3514=[];for(let _0x4a5c64=0x0;_0x4a5c64<_0x5e026e['length'];_0x4a5c64+=tr){if(!ao(_0x451409)){_0x5caa4f&&(_0x5caa4f['skippedProcessDetails']+=_0x5e026e[_0x16fed3(0x194)]-_0x4a5c64);break;}let _0x471d81=_0x5e026e[_0x16fed3(0x135)](_0x4a5c64,_0x4a5c64+tr),_0x1f3adf=await Promise['all'](_0x471d81['map'](async _0x11c43e=>{const _0x337aa7=_0x16fed3;let [_0x2a4c22,_0xbbf3b2]=await Promise['all']([uo(_0x11c43e['pid']),fo(_0x11c43e[_0x337aa7(0x10b)])]);return{'pid':_0x11c43e['pid'],'agent':_0x11c43e[_0x337aa7(0x91)],'command':_0x11c43e[_0x337aa7(0x1bd)],'cwd':_0x2a4c22,'sessionFiles':_0xbbf3b2};}));_0x1b3514[_0x16fed3(0x15c)](..._0x1f3adf);}return _0x5caa4f&&(_0x5caa4f['lsofMs']+=_0x13f221()),_0x5caa4f&&(_0x5caa4f[_0x16fed3(0xee)]=_0x1b3514[_0x16fed3(0x194)]),_0x1b3514;}function ir(_0x2c6f8c){return _0x2c6f8c['replace'](/[^a-zA-Z0-9]/g,'-');}async function yo(_0x4333bc,_0x4f2a30){const _0x269268=_0x1ffb41;if(!_0x4f2a30)return null;try{if(_0x4333bc==='claude'){let _0x553e86=(0x0,ge[_0x269268(0x96)])((0x0,vt['homedir'])(),_0x269268(0x112),_0x269268(0xcc),ir(_0x4f2a30)),_0x4c5ceb=(await(0x0,Se[_0x269268(0x8c)])(_0x553e86)['catch'](()=>[]))[_0x269268(0xbc)](_0x56f4b6=>_0x56f4b6['endsWith']('.jsonl'));if(_0x4c5ceb['length']===0x0)return null;let _0x53390a=null;if(await Promise['all'](_0x4c5ceb['map'](async _0x1b8645=>{const _0xd0854a=_0x269268;let _0xbd2ee3=await(0x0,Se[_0xd0854a(0x1c4)])((0x0,ge[_0xd0854a(0x96)])(_0x553e86,_0x1b8645))['catch'](()=>null);_0xbd2ee3&&(!_0x53390a||_0xbd2ee3[_0xd0854a(0x122)]>_0x53390a['mtimeMs'])&&(_0x53390a={'name':_0x1b8645,'mtimeMs':_0xbd2ee3['mtimeMs']});})),!_0x53390a)return null;let _0x41163a=(0x0,ge[_0x269268(0x96)])(_0x553e86,_0x53390a['name']),_0x1034ff=M(_0x4333bc,_0x41163a);return _0x1034ff?{'sessionId':_0x1034ff,'filePath':_0x41163a}:null;}return Wn(_0x4f2a30);}catch{return null;}}async function xo(_0x10c5e8,_0x230c86,_0x43e7f9){const _0x2989a9=_0x1ffb41;if(!_0x230c86||!_0x43e7f9)return null;try{if(_0x10c5e8===_0x2989a9(0x127)){let _0x1eb553=(0x0,ge['join'])((0x0,vt[_0x2989a9(0xb2)])(),'.claude',_0x2989a9(0xcc),ir(_0x230c86),_0x43e7f9+'.jsonl');return(await(0x0,Se['stat'])(_0x1eb553)['catch'](()=>null))?.['isFile']()?_0x1eb553:null;}return null;}catch{return null;}}async function Co(_0x405e45){const _0x4fbfd8=_0x1ffb41;if(_0x405e45['sessionFilePath']||_0x405e45['confidence']!==_0x4fbfd8(0x1ab))return _0x405e45;let _0xfe0302=await xo(_0x405e45['agent'],_0x405e45[_0x4fbfd8(0x17a)],_0x405e45[_0x4fbfd8(0x1da)]);return _0xfe0302?{..._0x405e45,'sessionFilePath':_0xfe0302}:_0x405e45;}async function To(){const _0x13842b=_0x1ffb41;let _0x297111={'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},_0xef0ede=V['startTimer']('process.scan.total_ms'),_0x29929a=await So(_0x297111),_0x1af6b2=[],_0x1fa76d=[];for(let _0x4efc92 of _0x29929a){let _0x5aa0ab=Tt(_0x4efc92);if(_0x5aa0ab){_0x1af6b2['push'](_0x5aa0ab);continue;}Ct(_0x4efc92['agent'],_0x4efc92['command'])&&_0x1fa76d[_0x13842b(0x15c)](_0x4efc92);}_0x297111[_0x13842b(0x191)]=_0x1af6b2['length'],_0x297111['fallbackLookups']=_0x1fa76d['length'];let _0xdaf507=V[_0x13842b(0x1aa)]('process.scan.fallback_ms'),_0x30f8f1=await Promise['all'](_0x1fa76d['map'](async _0x4b071f=>{const _0xde85c6=_0x13842b;let _0xaa2e70=await yo(_0x4b071f['agent'],_0x4b071f['cwd']);return _0xaa2e70?{'agent':_0x4b071f[_0xde85c6(0x91)],'pid':_0x4b071f['pid'],'cwd':_0x4b071f['cwd'],'command':_0x4b071f[_0xde85c6(0x1bd)],'sessionId':_0xaa2e70[_0xde85c6(0x1da)],'confidence':'low','sessionFilePath':_0xaa2e70['filePath']}:null;}));_0x297111['fallbackMs']=_0xdaf507(),_0x297111['fallbackHits']=_0x30f8f1['filter'](_0xf69aba=>_0xf69aba!==null)['length'];let _0x21f850=V['startTimer']('process.scan.hydrate_ms'),_0x3a7e74=await Promise['all']([..._0x1af6b2,..._0x30f8f1[_0x13842b(0xbc)](_0x53f29c=>_0x53f29c!==null)][_0x13842b(0x17c)](_0x1ecbe4=>Co(_0x1ecbe4))),_0x1d44dd=await Promise[_0x13842b(0x1a8)](_0x3a7e74['map'](_0x74f287=>co(_0x74f287)));_0x297111['hydrateMs']=_0x21f850(),_0x297111['hydratedCandidates']=_0x1d44dd['filter'](_0x4d4688=>_0x4d4688!==null)['length'];let _0x7ad1e3=At(_0x1d44dd[_0x13842b(0xbc)](_0x3476ff=>_0x3476ff!==null));return _0x297111['totalMs']=_0xef0ede(),(_0x297111[_0x13842b(0x106)]>=oo||_0x297111['fallbackLookups']>0x0)&&bt['info']({'durationMs':_0x297111['totalMs'],'pgrepMs':_0x297111[_0x13842b(0x1b0)],'lsofMs':_0x297111[_0x13842b(0x90)],'fallbackMs':_0x297111['fallbackMs'],'hydrateMs':_0x297111[_0x13842b(0x17e)],'matchedProcesses':_0x297111[_0x13842b(0x159)],'aliveProcesses':_0x297111['aliveProcesses'],'snapshots':_0x297111['snapshots'],'skippedProcessDetails':_0x297111[_0x13842b(0x192)]||void 0x0,'directCandidates':_0x297111['directCandidates'],'fallbackLookups':_0x297111['fallbackLookups'],'fallbackHits':_0x297111['fallbackHits'],'hydratedCandidates':_0x297111[_0x13842b(0x9a)],'sessions':_0x7ad1e3[_0x13842b(0x194)]},'process\x20running\x20sessions\x20scanned'),he={'value':_0x7ad1e3,'expiresAt':Date[_0x13842b(0x138)]()+io},_0x7ad1e3;}async function ar(){const _0x314440=_0x1ffb41;return he&&Date['now']()<he['expiresAt']?he[_0x314440(0x196)]:me||(me=To()[_0x314440(0x1bf)](()=>{me=null;}),me);}if(!It['parentPort'])throw new Error(_0x1ffb41(0x1a5));var Ue=It['parentPort'],Ao=S[_0x1ffb41(0x13b)]({'module':_0x1ffb41(0x10f)}),wo=new Fe(),lr=0x40;function cr(_0x4c60f7){const _0x15c413=_0x1ffb41;if(process.env.VIBE_TEST!=='1')return;let _0x943c09=Number(process.env[_0x4c60f7]??0x0);if(!Number['isFinite'](_0x943c09)||_0x943c09<=0x0)return;let _0x463bf2=Date['now']()+Math[_0x15c413(0x137)](_0x943c09,0x2710);for(;Date['now']()<_0x463bf2;);}async function bo(_0x13b9bf){const _0x53562f=_0x1ffb41;try{if(_0x13b9bf['kind']===_0x53562f(0x130))return cr('VIBE_TEST_PROCESS_WORKER_DELAY_MS'),_0x13b9bf['invalidate']&&or(),{'id':_0x13b9bf['id'],'ok':!0x0,'result':await ar()};cr(_0x53562f(0x10e));let _0x35dd6b=Date[_0x53562f(0x138)](),_0x2be556=await wo[_0x53562f(0xf4)](_0x1c0121=>{const _0x4bbe21=_0x53562f;Ue[_0x4bbe21(0xbe)]({'id':_0x13b9bf['id'],'ok':!0x0,'progress':_0x4bbe21(0x1d6),..._0x1c0121});});Ao['info']({'durationMs':Date['now']()-_0x35dd6b,'sessions':_0x2be556[_0x53562f(0x141)][_0x53562f(0x194)],'files':_0x2be556[_0x53562f(0x15f)],'changedFiles':_0x2be556['changedFiles'],'reusedFiles':_0x2be556['reusedFiles'],'removedFiles':_0x2be556['removedFiles']},_0x53562f(0x125));for(let _0x13e49e=0x0;_0x13e49e<_0x2be556['sessions']['length'];_0x13e49e+=lr)Ue[_0x53562f(0xbe)]({'id':_0x13b9bf['id'],'ok':!0x0,'progress':'session_result_batch','sessions':_0x2be556[_0x53562f(0x141)]['slice'](_0x13e49e,_0x13e49e+lr)});return{'id':_0x13b9bf['id'],'ok':!0x0,'result':{'scannedSessions':[],'runningSessions':[]}};}catch(_0x4ca835){return{'id':_0x13b9bf['id'],'ok':!0x1,'error':_0x4ca835 instanceof Error?_0x4ca835['name']+':\x20'+_0x4ca835['message']:String(_0x4ca835)};}}var ur=Promise['resolve']();Ue['on'](_0x1ffb41(0xeb),_0x178112=>{ur=ur['then'](async()=>{const _0x338210=_0x1bf4;Ue[_0x338210(0xbe)](await bo(_0x178112));});});
|