@vibelet/cli 1.2.164 → 1.2.165

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 _0x472560=_0x1516;(function(_0x5b54ff,_0x28972d){const _0x14f3f8=_0x1516,_0x4017f0=_0x5b54ff();while(!![]){try{const _0x368aeb=parseInt(_0x14f3f8(0x1d0))/0x1*(parseInt(_0x14f3f8(0x242))/0x2)+-parseInt(_0x14f3f8(0x194))/0x3*(parseInt(_0x14f3f8(0x1a8))/0x4)+-parseInt(_0x14f3f8(0x19f))/0x5+-parseInt(_0x14f3f8(0x23a))/0x6*(-parseInt(_0x14f3f8(0x1ce))/0x7)+-parseInt(_0x14f3f8(0x220))/0x8+parseInt(_0x14f3f8(0x1c6))/0x9*(-parseInt(_0x14f3f8(0x212))/0xa)+parseInt(_0x14f3f8(0x1bb))/0xb;if(_0x368aeb===_0x28972d)break;else _0x4017f0['push'](_0x4017f0['shift']());}catch(_0xe59f44){_0x4017f0['push'](_0x4017f0['shift']());}}}(_0x144c,0x694e1));var vt=require('node:worker_threads'),Hn=require('node:fs/promises'),Bn=require(_0x472560(0x22b)),jn=require('node:path'),P=require(_0x472560(0x22a)),Z=require('node:os'),v=require(_0x472560(0x2a5)),It=require(_0x472560(0x22b)),D=require(_0x472560(0x2a5)),dr=new Set(['.c',_0x472560(0x19b),_0x472560(0x22f),_0x472560(0x1a5),_0x472560(0x1ae),_0x472560(0x249),_0x472560(0x184),'.ex',_0x472560(0x273),'.fish','.go','.h','.hpp',_0x472560(0x210),_0x472560(0x20c),'.js',_0x472560(0x2b7),_0x472560(0x24e),_0x472560(0x2b2),'.less',_0x472560(0x209),'.m',_0x472560(0x1e3),'.mjs',_0x472560(0x28a),_0x472560(0x29f),'.ps1',_0x472560(0x266),'.r','.rb','.rs',_0x472560(0x226),_0x472560(0x270),_0x472560(0x293),'.sh',_0x472560(0x2bd),_0x472560(0x1de),'.ts',_0x472560(0x1a1),'.vue',_0x472560(0x24d),_0x472560(0x2ad),'.yml','.zsh']),Mt=_0x472560(0x2e3),Et=_0x472560(0x2a7);function Q(_0x51101d){const _0x3cd345=_0x472560;return typeof _0x51101d==_0x3cd345(0x1cb)&&_0x51101d['trim']()[_0x3cd345(0x20a)]>0x0?_0x51101d[_0x3cd345(0x2dd)]():null;}function ee(_0x578947){const _0x1ae929=_0x472560;return!_0x578947||typeof _0x578947!=_0x1ae929(0x2d8)||Array['isArray'](_0x578947)?null:_0x578947;}function Oe(_0x1c10f6){const _0x413a4c=_0x472560;let _0x10c446=_0x1c10f6['trim']()['replace'](/[.,!?;:,。!?;:、]+$/u,''),_0x3d965c=_0x10c446[_0x413a4c(0x195)]('#');_0x3d965c>0x0&&(_0x10c446=_0x10c446[_0x413a4c(0x274)](0x0,_0x3d965c));let _0x99ee85=_0x10c446['match'](/^(.*?)(:\d+(?::\d+)?)$/);return _0x99ee85?.[0x1]&&(_0x10c446=_0x99ee85[0x1]),_0x10c446;}function xe(_0x1758c2,_0x40924e){const _0x1943f1=_0x472560;let _0x274b2e=Oe(_0x1758c2);return _0x274b2e?_0x274b2e['startsWith']('~/')?(0x0,D[_0x1943f1(0x253)])((0x0,It['homedir'])(),_0x274b2e['slice'](0x2)):(0x0,D[_0x1943f1(0x1f3)])(_0x274b2e)?_0x274b2e:_0x40924e?(0x0,D['resolve'])(_0x40924e,_0x274b2e):_0x274b2e:'';}function ur(_0x47a218){const _0x1fa62b=_0x472560;return dr[_0x1fa62b(0x19a)]((0x0,D['extname'])(Oe(_0x47a218))[_0x1fa62b(0x29b)]());}function $e(_0x4054c7){let _0x55ca16=Oe(_0x4054c7);return _0x55ca16?!ur(_0x55ca16):!0x1;}function We(_0x22b2be){const _0x590257=_0x472560;let _0x388325=[...new Set(_0x22b2be[_0x590257(0x2e0)](_0x1af41e=>xe(_0x1af41e))['filter'](Boolean))];return _0x388325['length']===0x0?'':_0x388325[_0x590257(0x20a)]===0x1?''+Mt+_0x388325[0x0]:''+Et+_0x388325[_0x590257(0x24a)]('\x0a');}function Rt(_0x5f5afe){const _0x49d552=_0x472560;return typeof _0x5f5afe!=_0x49d552(0x1cb)?!0x1:_0x5f5afe['startsWith'](Mt)||_0x5f5afe[_0x49d552(0x232)](Et);}function fr(_0x4cbecd,_0x3ba3ef){let _0x5cabb0=_0x4cbecd['matchAll'](/^\*\*\* Add File: (.+)$/gm),_0x478e1d=new Set();for(let _0x3f16ea of _0x5cabb0){let _0x62636f=Q(_0x3f16ea[0x1]);if(!_0x62636f)continue;let _0x3e8b45=xe(_0x62636f,_0x3ba3ef);!_0x3e8b45||!$e(_0x3e8b45)||_0x478e1d['add'](_0x3e8b45);}return[..._0x478e1d];}function pr(_0x53bf3b){let _0x536104=Q(_0x53bf3b);return _0x536104?_0x536104['toLowerCase']():'';}function mr(_0x4eab52,_0x4acaec){const _0x3f2332=_0x472560;let _0xd433ed=Q(_0x4eab52?.[_0x3f2332(0x2c7)])??Q(_0x4eab52?.['path']);if(!_0xd433ed)return null;let _0x1d5c8c=xe(_0xd433ed,_0x4acaec);return _0x1d5c8c&&$e(_0x1d5c8c)?_0x1d5c8c:null;}function Pt(_0x2c094c,_0x363187,_0x51ecd2){const _0xbd1c01=_0x472560;return pr(_0x2c094c)!==_0xbd1c01(0x20b)?null:mr(_0x363187,_0x51ecd2);}function gr(_0x5ced56){const _0x2d80fc=_0x472560;let _0x5a0a0e=_0x5ced56['toLowerCase']();return _0x5a0a0e[_0x2d80fc(0x2a3)]('updated\x20successfully')||_0x5a0a0e['includes']('updated.\x20all\x20occurrences\x20were\x20successfully\x20replaced')||_0x5a0a0e['includes']('all\x20occurrences\x20were\x20successfully\x20replaced')||_0x5a0a0e[_0x2d80fc(0x2a3)]('successfully\x20replaced');}function hr(_0x31421c){const _0x39c7cc=_0x472560;return/^\d+\t/m[_0x39c7cc(0x18d)](_0x31421c);}function _t(_0x38538c,_0x53480e){const _0x4e32c6=_0x472560;let _0x1bf71b=typeof _0x53480e==_0x4e32c6(0x1cb)?_0x53480e[_0x4e32c6(0x2dd)]():'';if(_0x1bf71b&&gr(_0x1bf71b))return!0x1;let _0x5b7f37=ee(_0x38538c);if(_0x5b7f37?.['type']==='update'||_0x5b7f37?.[_0x4e32c6(0x238)]==='replace'||_0x5b7f37&&(Object['hasOwn'](_0x5b7f37,'oldString')||Object[_0x4e32c6(0x1b4)](_0x5b7f37,_0x4e32c6(0x2a6))||Object[_0x4e32c6(0x1b4)](_0x5b7f37,'originalFile')||Object[_0x4e32c6(0x1b4)](_0x5b7f37,'replaceAll')))return!0x1;if(typeof ee(_0x5b7f37?.[_0x4e32c6(0x2b5)])?.['filePath']=='string'||typeof _0x5b7f37?.['filePath']==_0x4e32c6(0x1cb))return!0x0;if(_0x1bf71b){let _0x5ae54c=_0x1bf71b['toLowerCase']();if(_0x5ae54c[_0x4e32c6(0x2a3)]('created\x20successfully')||_0x5ae54c[_0x4e32c6(0x2a3)](_0x4e32c6(0x279))||hr(_0x1bf71b))return!0x0;}return!0x1;}function Ft(_0x1179f2,_0x4204aa){const _0x56ca46=_0x472560;let _0x26b57a=ee(_0x1179f2);if(!_0x26b57a)return[];let _0x335adc=new Set();if(_0x26b57a['type']===_0x56ca46(0x1b9)){let _0x53495f=ee(_0x26b57a['payload']);if(_0x53495f?.['type']==='image_generation_end'){let _0x7e6cb0=Q(_0x53495f['saved_path']);if(_0x7e6cb0){let _0x2c6e5e=xe(_0x7e6cb0,_0x4204aa?.[_0x56ca46(0x2cc)]);_0x2c6e5e&&$e(_0x2c6e5e)&&_0x335adc[_0x56ca46(0x240)](_0x2c6e5e);}}}if(_0x4204aa?.['includePatchCalls']&&_0x26b57a[_0x56ca46(0x238)]===_0x56ca46(0x280)){let _0x1cfddc=ee(_0x26b57a['payload']);if(_0x1cfddc?.[_0x56ca46(0x238)]==='function_call'&&_0x1cfddc[_0x56ca46(0x28e)]===_0x56ca46(0x1ff)){let _0x2ac682=Q(_0x1cfddc['arguments']);if(_0x2ac682){for(let _0x527955 of fr(_0x2ac682,_0x4204aa?.[_0x56ca46(0x2cc)]))_0x335adc['add'](_0x527955);}}}return[..._0x335adc];}var Ae=require('node:fs'),kt=require('node:os'),h=require(_0x472560(0x2a5)),U=(0x0,h[_0x472560(0x24a)])((0x0,kt[_0x472560(0x23d)])(),'.vibelet'),Ce=(0x0,h['join'])(U,'logs'),te=(0x0,h['join'])(U,'data'),Lt=(0x0,h['join'])(U,'runtime'),wo=(0x0,h[_0x472560(0x24a)])(Lt,_0x472560(0x262)),bo=(0x0,h['join'])(Lt,_0x472560(0x17f)),vo=(0x0,h[_0x472560(0x24a)])(U,'identity.json'),Io=(0x0,h['join'])(U,'pairings.json'),Mo=(0x0,h[_0x472560(0x24a)])(te,'device-profiles.json'),Eo=(0x0,h['join'])(te,_0x472560(0x25c)),Ro=(0x0,h[_0x472560(0x24a)])(te,_0x472560(0x21b)),Po=(0x0,h['join'])(te,_0x472560(0x264)),_o=(0x0,h['join'])(te,_0x472560(0x19d)),Nt=(0x0,h['join'])(Ce,'daemon.stdout.log'),Dt=(0x0,h[_0x472560(0x24a)])(Ce,'daemon.stderr.log'),Fo=(0x0,h[_0x472560(0x24a)])(U,'update-check.json'),ko=(0x0,h['join'])(U,_0x472560(0x1aa)),Te={'stdout':!0x1,'stderr':!0x1};function Ut(_0x197e57){const _0x5634c6=_0x472560;if(!_0x197e57||typeof _0x197e57!=_0x5634c6(0x2d8))return!0x1;let _0x1c8fdb=typeof _0x197e57['code']=='string'?_0x197e57['code']:'';return _0x1c8fdb==='EIO'||_0x1c8fdb===_0x5634c6(0x1cd);}function Sr(_0x15f877){const _0x8fa091=_0x472560;return!_0x15f877[_0x8fa091(0x22d)]&&_0x15f877[_0x8fa091(0x1b8)]!==!0x1;}function Ot(_0x294b51,_0x1e90a1){const _0x1e92cf=_0x472560;if(Te[_0x294b51])return!0x1;let _0x57f7d7=_0x294b51==='stderr'?process[_0x1e92cf(0x1bc)]:process[_0x1e92cf(0x180)];if(!Sr(_0x57f7d7))return Te[_0x294b51]=!0x0,!0x1;try{return _0x57f7d7['write'](_0x1e90a1,_0x1208d9=>{Ut(_0x1208d9)&&(Te[_0x294b51]=!0x0);}),!0x0;}catch(_0x408a3b){return Ut(_0x408a3b)&&(Te[_0x294b51]=!0x0),!0x1;}}function $t(_0x593dcc){return Ot('stdout',_0x593dcc);}function Wt(_0x1d1140){const _0x3b6b27=_0x472560;return Ot(_0x3b6b27(0x1bc),_0x1d1140);}var Ht={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},yr=process.env.VIBE_LOG_LEVEL||_0x472560(0x1dc);function xr(){const _0x184c66=_0x472560;return process.env.VIBE_TEST==='1'||process['argv'][_0x184c66(0x2a3)]('--test');}function Cr(){const _0x1adc5b=_0x472560;try{let {fstatSync:_0x375dd9}=require(_0x1adc5b(0x2c4));return _0x375dd9(0x1)['isFile']();}catch{return!0x1;}}var jt=!xr()&&!Cr();if(jt)try{(0x0,Ae['mkdirSync'])(Ce,{'recursive':!0x0});}catch{}function Bt(_0x12c752,_0x5e6617,_0x5ec8b2){const _0x2a6c4b=_0x472560;if(Ht[_0x12c752]<Ht[yr])return;let _0x4ce4ca={'level':_0x12c752,'ts':new Date()['toISOString'](),'msg':_0x5ec8b2,..._0x5e6617},_0x1120f0=JSON[_0x2a6c4b(0x2de)](_0x4ce4ca);if(_0x12c752==='error'||_0x12c752===_0x2a6c4b(0x29e)?Wt(_0x1120f0+'\x0a'):$t(_0x1120f0+'\x0a'),jt){let _0x2d394f=_0x12c752==='error'||_0x12c752===_0x2a6c4b(0x29e)?Dt:Nt;try{(0x0,Ae['appendFileSync'])(_0x2d394f,_0x1120f0+'\x0a');}catch{}}}function zt(_0x25dd6a={}){function _0x18473c(_0x2ce5d0,_0x4db636,_0x361abb){typeof _0x4db636=='string'?Bt(_0x2ce5d0,_0x25dd6a,_0x4db636):Bt(_0x2ce5d0,{..._0x25dd6a,..._0x4db636},_0x361abb);}return{'debug':(_0x39a312,_0x4ca859)=>_0x18473c('debug',_0x39a312,_0x4ca859),'info':(_0x5df369,_0x2ce593)=>_0x18473c('info',_0x5df369,_0x2ce593),'warn':(_0x7ff320,_0x2c8198)=>_0x18473c('warn',_0x7ff320,_0x2c8198),'error':(_0x313abd,_0x821b9f)=>_0x18473c('error',_0x313abd,_0x821b9f),'child':_0x388e5e=>zt({..._0x25dd6a,..._0x388e5e})};}var S=zt({'module':_0x472560(0x1c2)});function ne(_0x326195){let _0x215048=new Map();return{'get'(_0x42b530){const _0xae4ccb=_0x1516;let _0x40c0ca=_0x215048[_0xae4ccb(0x27b)](_0x42b530);if(_0x40c0ca){if(Date['now']()>_0x40c0ca[_0xae4ccb(0x2cf)]){_0x215048[_0xae4ccb(0x17c)](_0x42b530);return;}return _0x40c0ca[_0xae4ccb(0x25e)];}},'set'(_0x1ba543,_0x424525){const _0x161456=_0x1516;_0x215048['set'](_0x1ba543,{'value':_0x424525,'expiresAt':Date[_0x161456(0x27e)]()+_0x326195});},'clear'(){_0x215048['clear']();}};}var dn=require(_0x472560(0x22a)),w=require('node:fs/promises'),re=require(_0x472560(0x22b)),C=require(_0x472560(0x2a5)),b=0x18;async function _(_0x1e5b2c,_0x203a2b,_0x551643){const _0x564edc=_0x472560;if(_0x1e5b2c['length']===0x0)return[];let _0xad9c85=Math[_0x564edc(0x2e4)](0x1,Math['min'](_0x203a2b,_0x1e5b2c['length'])),_0x4fdad9=new Array(_0x1e5b2c['length']),_0x43ae64=0x0;return await Promise['all'](Array['from']({'length':_0xad9c85},async()=>{for(;;){let _0x7de3f2=_0x43ae64;if(_0x43ae64+=0x1,_0x7de3f2>=_0x1e5b2c['length'])return;_0x4fdad9[_0x7de3f2]=await _0x551643(_0x1e5b2c[_0x7de3f2],_0x7de3f2);}})),_0x4fdad9;}async function J(_0x23927d){const _0x576e38=_0x472560;let _0x32e62e=(await _(_0x23927d,b,async _0x118e22=>{const _0x50cba4=_0x1516;let _0x5b027e=await(0x0,w['stat'])(_0x118e22)[_0x50cba4(0x211)](()=>null);return _0x5b027e?.[_0x50cba4(0x298)]()?{'path':_0x118e22,'mtimeMs':_0x5b027e['mtimeMs'],'birthtimeMs':_0x5b027e[_0x50cba4(0x183)],'size':_0x5b027e[_0x50cba4(0x176)]}:null;}))[_0x576e38(0x29c)](_0x418b8b=>_0x418b8b!==null);return _0x32e62e['sort']((_0x405b24,_0x83b7bb)=>_0x83b7bb['mtimeMs']-_0x405b24['mtimeMs']),_0x32e62e;}async function He(){const _0x22cb61=_0x472560;let _0x40d586=(0x0,C['join'])((0x0,re[_0x22cb61(0x23d)])(),_0x22cb61(0x239),'projects'),_0x425283=[],_0x4ef7f7=await(0x0,w[_0x22cb61(0x2d5)])(_0x40d586,{'withFileTypes':!0x0})['catch'](()=>[]);for(let _0xbfb130 of _0x4ef7f7){if(!_0xbfb130['isDirectory']())continue;let _0x39c54d=(0x0,C['join'])(_0x40d586,_0xbfb130['name']),_0x5931c8=await(0x0,w['readdir'])(_0x39c54d)['catch'](()=>[]);for(let _0x4e67ef of _0x5931c8)_0x4e67ef[_0x22cb61(0x2e6)]('.jsonl')&&_0x425283['push']((0x0,C['join'])(_0x39c54d,_0x4e67ef));}return _0x425283;}async function se(_0x455714=(0x0,C[_0x472560(0x24a)])((0x0,re[_0x472560(0x23d)])(),'Library',_0x472560(0x2b3),_0x472560(0x17b),_0x472560(0x1c9)),_0x19f498=0x0){const _0x5dc99b=_0x472560;if(_0x19f498>0x4)return[];let _0x430ae3=await(0x0,w['readdir'])(_0x455714,{'withFileTypes':!0x0})['catch'](()=>[]),_0x26da6=[];for(let _0x4f02fc of _0x430ae3){let _0x404e75=(0x0,C[_0x5dc99b(0x24a)])(_0x455714,_0x4f02fc['name']);_0x4f02fc[_0x5dc99b(0x2e2)]()?_0x26da6[_0x5dc99b(0x20d)](...await se(_0x404e75,_0x19f498+0x1)):_0x4f02fc['isFile']()&&_0x4f02fc[_0x5dc99b(0x28e)][_0x5dc99b(0x2e6)](_0x5dc99b(0x192))&&_0x26da6['push'](_0x404e75);}return _0x26da6;}async function Tr(){const _0x3481ae=_0x472560;let _0xb9fa0b=(0x0,C['join'])((0x0,re[_0x3481ae(0x23d)])(),'.codex',_0x3481ae(0x1e4)),_0x33ff74=(0x0,C['join'])((0x0,re['homedir'])(),'.codex','archived_sessions'),_0x44f06a=[],_0x795d6a=await(0x0,w['readdir'])(_0xb9fa0b)[_0x3481ae(0x211)](()=>[]);for(let _0x29f8fb of _0x795d6a){let _0x212fae=(0x0,C[_0x3481ae(0x24a)])(_0xb9fa0b,_0x29f8fb),_0x1f7bc1=await(0x0,w[_0x3481ae(0x2d5)])(_0x212fae)['catch'](()=>[]);for(let _0x549547 of _0x1f7bc1){let _0x2629da=(0x0,C['join'])(_0x212fae,_0x549547),_0x52e16d=await(0x0,w[_0x3481ae(0x2d5)])(_0x2629da)['catch'](()=>[]);for(let _0x14c92d of _0x52e16d){let _0x56f5b7=(0x0,C['join'])(_0x2629da,_0x14c92d),_0x281fe4=await(0x0,w['readdir'])(_0x56f5b7)[_0x3481ae(0x211)](()=>[]);for(let _0x4fc2ad of _0x281fe4)_0x4fc2ad[_0x3481ae(0x2e6)](_0x3481ae(0x2c8))&&_0x44f06a['push']((0x0,C['join'])(_0x56f5b7,_0x4fc2ad));}}}let _0x65cd7d=await(0x0,w[_0x3481ae(0x2d5)])(_0x33ff74)[_0x3481ae(0x211)](()=>[]);for(let _0x1d9329 of _0x65cd7d)_0x1d9329['endsWith'](_0x3481ae(0x2c8))&&_0x44f06a['push']((0x0,C['join'])(_0x33ff74,_0x1d9329));return _0x44f06a;}async function oe(){let _0x8347c3=await Tr();return J(_0x8347c3);}var $=require('node:child_process'),M=require(_0x472560(0x2c4)),W=require(_0x472560(0x22b)),u=require(_0x472560(0x2a5)),Ar=['fnm_multishells'],wr=0xea60,O=process['platform']===_0x472560(0x2dc);function I(_0x3e42aa){const _0x8595fa=_0x472560;return Ar['some'](_0x3aa118=>_0x3e42aa[_0x8595fa(0x2a3)](_0x3aa118));}function br(_0x29c493){const _0x3286c5=_0x472560;if(!_0x29c493||!I(_0x29c493))return _0x29c493;try{let _0xff781c=(0x0,u['join'])((0x0,M['realpathSync'])((0x0,u['dirname'])(_0x29c493)),(0x0,u['basename'])(_0x29c493));if((0x0,M[_0x3286c5(0x182)])(_0xff781c)&&!I(_0xff781c))return _0xff781c;}catch{}return _0x29c493;}function vr(_0x2bf365){const _0x377b86=_0x472560;if(!_0x2bf365||!I(_0x2bf365))return _0x2bf365;try{let _0x1fbe14=(0x0,M[_0x377b86(0x2ce)])(_0x2bf365);if(_0x1fbe14&&!I(_0x1fbe14))return _0x1fbe14;}catch{}return _0x2bf365;}function qt(){const _0x576bc8=_0x472560;return O?[]:[process.env.SHELL,_0x576bc8(0x27c),'/bin/bash','/bin/sh'][_0x576bc8(0x29c)](_0x26bc73=>!!_0x26bc73)[_0x576bc8(0x29c)]((_0x5c026c,_0x4a3233,_0x4c898f)=>_0x4c898f[_0x576bc8(0x195)](_0x5c026c)===_0x4a3233)['filter'](_0x11ee92=>(0x0,M['existsSync'])(_0x11ee92));}function Gt(_0x487cc1,_0x3a9825){const _0x302a68=_0x472560;let _0x2f0133=_0x56694a=>{const _0x21e602=_0x1516;let _0x310ccb=/^v?(\d+)\.(\d+)\.(\d+)/[_0x21e602(0x186)](_0x56694a);return _0x310ccb?[Number(_0x310ccb[0x1]),Number(_0x310ccb[0x2]),Number(_0x310ccb[0x3])]:null;},_0x2627db=_0x2f0133(_0x487cc1),_0x3b3495=_0x2f0133(_0x3a9825);if(!_0x2627db&&!_0x3b3495)return _0x3a9825[_0x302a68(0x1b0)](_0x487cc1);if(!_0x2627db)return 0x1;if(!_0x3b3495)return-0x1;for(let _0x3ab2cb=0x0;_0x3ab2cb<_0x2627db[_0x302a68(0x20a)];_0x3ab2cb+=0x1)if(_0x2627db[_0x3ab2cb]!==_0x3b3495[_0x3ab2cb])return _0x3b3495[_0x3ab2cb]-_0x2627db[_0x3ab2cb];return 0x0;}function Vt(){const _0x28ae0c=_0x472560;let _0x5fad45=(0x0,W['homedir'])(),_0x4482b9=(0x0,u['join'])(_0x5fad45,'.nvm',_0x28ae0c(0x2b0),_0x28ae0c(0x178)),_0x564092=[(0x0,u['join'])(_0x5fad45,'.nvm','current',_0x28ae0c(0x27d))];try{let _0x5abfcb=(0x0,M['readdirSync'])(_0x4482b9,{'withFileTypes':!0x0})['filter'](_0xd3dd36=>_0xd3dd36[_0x28ae0c(0x2e2)]())[_0x28ae0c(0x2e0)](_0x50b8ef=>_0x50b8ef['name'])['sort'](Gt);for(let _0x4eba19 of _0x5abfcb)_0x564092['push']((0x0,u['join'])(_0x4482b9,_0x4eba19,_0x28ae0c(0x27d)));}catch{}return _0x564092;}function Qt(){const _0x8de978=_0x472560;let _0x413433=(0x0,W['homedir'])(),_0x1510ee=[process.env.FNM_DIR,(0x0,u['join'])(_0x413433,_0x8de978(0x2b8),'share','fnm'),(0x0,u[_0x8de978(0x24a)])(_0x413433,'Library',_0x8de978(0x2b3),'fnm'),(0x0,u[_0x8de978(0x24a)])(_0x413433,'.fnm')][_0x8de978(0x29c)](_0x32dc71=>!!_0x32dc71),_0x47cb7b=[],_0x4a1ce1=new Set();for(let _0x2ebcc2 of _0x1510ee){if(_0x4a1ce1['has'](_0x2ebcc2))continue;_0x4a1ce1[_0x8de978(0x240)](_0x2ebcc2);let _0x5abcbe=(0x0,u['join'])(_0x2ebcc2,_0x8de978(0x1d2));try{let _0x18b91a=(0x0,M[_0x8de978(0x1dd)])(_0x5abcbe,{'withFileTypes':!0x0})['filter'](_0x28e674=>_0x28e674['isDirectory']())[_0x8de978(0x2e0)](_0x3e0cc0=>_0x3e0cc0[_0x8de978(0x28e)])['sort'](Gt);for(let _0xfac7c6 of _0x18b91a)_0x47cb7b['push']((0x0,u[_0x8de978(0x24a)])(_0x5abcbe,_0xfac7c6,_0x8de978(0x1d3),'bin')),_0x47cb7b[_0x8de978(0x20d)]((0x0,u[_0x8de978(0x24a)])(_0x5abcbe,_0xfac7c6,'bin'));}catch{}}return _0x47cb7b;}var we=null;function Jt(){const _0x16d29f=_0x472560;if(we?.[_0x16d29f(0x1e0)]&&!I(we[_0x16d29f(0x1e0)]))return we;for(let _0x4a6a79 of qt())try{let _0x187160=(0x0,$['execFileSync'])(_0x4a6a79,[_0x16d29f(0x28b),'env'],{'timeout':0x1388,'encoding':'utf-8','stdio':['pipe',_0x16d29f(0x267),'pipe']}),_0x5f0c8e={};for(let _0x65deac of _0x187160['split']('\x0a')){let _0x589db3=_0x65deac['indexOf']('=');_0x589db3>0x0&&(_0x5f0c8e[_0x65deac['slice'](0x0,_0x589db3)]=_0x65deac[_0x16d29f(0x274)](_0x589db3+0x1));}return _0x5f0c8e['PATH']&&!I(_0x5f0c8e['PATH'])&&(we=_0x5f0c8e),_0x5f0c8e;}catch{}return{};}function Ir(_0x4fe1b2=Jt()){const _0x21c252=_0x472560;let _0x1ea77d=(0x0,W['homedir'])(),_0x446193=_0x4fe1b2['PNPM_HOME']||process.env.PNPM_HOME||(O?(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,_0x21c252(0x2be)):(0x0,u['join'])(_0x1ea77d,'Library',_0x21c252(0x2be))),_0x12dcf0=_0x4fe1b2[_0x21c252(0x1e0)]||process.env.PATH||'',_0x1e26a9=O?[(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,'.npm-global','bin'),(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,_0x21c252(0x2b8),_0x21c252(0x27d)),(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,_0x21c252(0x239),'bin'),(0x0,u['join'])(_0x1ea77d,'.codex','packages','standalone',_0x21c252(0x262),'bin'),_0x446193,(0x0,u['join'])(_0x1ea77d,_0x21c252(0x1ea),'Roaming','npm'),(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,_0x21c252(0x1ea),'Local','Programs',_0x21c252(0x178))]:[_0x21c252(0x229),'/opt/homebrew/bin','/usr/bin',_0x21c252(0x283),(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,'.npm-global',_0x21c252(0x27d)),(0x0,u['join'])(_0x1ea77d,_0x21c252(0x2b8),_0x21c252(0x27d)),(0x0,u['join'])(_0x1ea77d,_0x21c252(0x239),_0x21c252(0x27d)),(0x0,u[_0x21c252(0x24a)])(_0x1ea77d,_0x21c252(0x201),'packages','standalone','current','bin'),_0x446193,...Vt(),...Qt()],_0x382d6f=_0x12dcf0['split'](u[_0x21c252(0x21a)])[_0x21c252(0x29c)](Boolean)['map'](vr),_0x561eaa=new Set(_0x382d6f);for(let _0x163a22 of _0x1e26a9)_0x561eaa[_0x21c252(0x19a)](_0x163a22)||(_0x382d6f[_0x21c252(0x20d)](_0x163a22),_0x561eaa['add'](_0x163a22));return _0x382d6f[_0x21c252(0x24a)](u[_0x21c252(0x21a)]);}function Be(){const _0x522890=_0x472560;let _0x275f54=Jt(),_0x1b156b={};for(let [_0x54d0a8,_0x2fc0e1]of Object['entries'](process.env))typeof _0x2fc0e1=='string'&&(_0x1b156b[_0x54d0a8]=_0x2fc0e1);for(let [_0x283471,_0x1868e6]of Object[_0x522890(0x1e1)](_0x275f54))typeof _0x1868e6=='string'&&(_0x1b156b[_0x283471]=_0x1868e6);return _0x1b156b['PATH']=Ir(_0x275f54),_0x1b156b['HOME']||(_0x1b156b[_0x522890(0x26e)]=(0x0,W['homedir'])()),delete _0x1b156b['CLAUDE_CODE_ENTRYPOINT'],delete _0x1b156b[_0x522890(0x1a3)],_0x1b156b;}function Kt(_0xd75b5b){const _0x247908=_0x472560;if(O)try{let _0x8f272=(0x0,$['execFileSync'])('where.exe',[_0xd75b5b],{'timeout':0xbb8,'stdio':'pipe','encoding':_0x247908(0x27a)})[_0x247908(0x2dd)]()[_0x247908(0x235)](/\r?\n/)[_0x247908(0x29c)](Boolean);return _0x8f272[_0x247908(0x219)](_0x2152cb=>_0x2152cb['endsWith']('.exe'))??_0x8f272[0x0];}catch{return;}}function ie(_0x840b54,_0x361b15=0xbb8){try{return(0x0,$['execFileSync'])(_0x840b54,['--version'],{'timeout':_0x361b15,'stdio':'pipe','encoding':'utf-8','env':Be(),...O?{'shell':!0x0}:{}})['trim']()||null;}catch{return null;}}function Mr(_0x4b7557){const _0x549d3f=_0x472560;for(let _0x328056 of qt())try{let _0xdc6e0a=(0x0,$['execFileSync'])(_0x328056,[_0x549d3f(0x28b),'command\x20-v\x20'+_0x4b7557],{'timeout':0x1388,'stdio':['pipe','pipe',_0x549d3f(0x267)],'encoding':'utf-8'})['trim']();if(_0xdc6e0a)return _0xdc6e0a;}catch{}}function Er(){const _0x18ac82=_0x472560;let _0x3ebe26=(0x0,W['homedir'])();return[(0x0,u[_0x18ac82(0x24a)])(_0x3ebe26,_0x18ac82(0x2b8),_0x18ac82(0x27d),'claude'),(0x0,u['join'])(_0x3ebe26,_0x18ac82(0x239),_0x18ac82(0x27d),'claude'),_0x18ac82(0x185),'/opt/homebrew/bin/claude',(0x0,u['join'])(_0x3ebe26,'.npm-global',_0x18ac82(0x27d),'claude')];}function Rr(){const _0x2b4420=_0x472560;if(O){let _0x2fba29=Kt('claude');return _0x2fba29&&ie(_0x2fba29)?_0x2fba29:void 0x0;}for(let _0x5a3bd0 of Er())if(ie(_0x5a3bd0))return _0x5a3bd0;try{let _0x5b01af=(0x0,$[_0x2b4420(0x1f0)])(_0x2b4420(0x205),['claude'],{'timeout':0xbb8,'stdio':_0x2b4420(0x267),'encoding':_0x2b4420(0x27a),'env':Be()})[_0x2b4420(0x2dd)]();if(_0x5b01af&&!_0x5b01af['includes'](_0x2b4420(0x2e7))&&ie(_0x5b01af))return _0x5b01af;}catch{}}function Pr(){const _0xb7e033=_0x472560;let _0x476fe7=(0x0,W['homedir'])(),_0x3b7c14=[process.env.PNPM_HOME,(0x0,u[_0xb7e033(0x24a)])(_0x476fe7,'Library','pnpm')]['filter'](_0x13ead6=>!!_0x13ead6);return['/usr/local/bin/codex','/opt/homebrew/bin/codex',(0x0,u[_0xb7e033(0x24a)])(_0x476fe7,'.npm-global',_0xb7e033(0x27d),_0xb7e033(0x17e)),(0x0,u['join'])(_0x476fe7,'.local',_0xb7e033(0x27d),_0xb7e033(0x17e)),(0x0,u[_0xb7e033(0x24a)])(_0x476fe7,'.codex','packages',_0xb7e033(0x2e8),'current',_0xb7e033(0x27d),'codex'),...Vt()['map'](_0x501ccb=>(0x0,u['join'])(_0x501ccb,_0xb7e033(0x17e))),...Qt()[_0xb7e033(0x2e0)](_0x43a4d8=>(0x0,u['join'])(_0x43a4d8,_0xb7e033(0x17e))),..._0x3b7c14['map'](_0x15d3e1=>(0x0,u[_0xb7e033(0x24a)])(_0x15d3e1,'codex'))];}function _r(){const _0x539934=_0x472560;if(O){let _0x101ed0=Kt(_0x539934(0x17e));return _0x101ed0&&ie(_0x101ed0)?_0x101ed0:void 0x0;}let _0x31942c=_0x3f8bff=>{let _0x55abf8=br(_0x3f8bff);return ie(_0x55abf8)?_0x55abf8:void 0x0;},_0x38d7a2;for(let _0x42d3f6 of Pr()){let _0x375598=_0x31942c(_0x42d3f6);if(_0x375598){if(!I(_0x375598))return _0x375598;_0x38d7a2=_0x375598;}}try{let _0x37b0cf=(0x0,$['execFileSync'])(_0x539934(0x205),[_0x539934(0x17e)],{'timeout':0xbb8,'stdio':'pipe','encoding':_0x539934(0x27a),'env':Be()})['trim'](),_0xa9f0dc=_0x37b0cf?_0x31942c(_0x37b0cf):void 0x0;if(_0xa9f0dc){if(!I(_0xa9f0dc))return _0xa9f0dc;_0x38d7a2=_0x38d7a2??_0xa9f0dc;}}catch{}let _0x3c2237=Mr(_0x539934(0x17e)),_0x2b6919=_0x3c2237?_0x31942c(_0x3c2237):void 0x0;if(_0x2b6919){if(!I(_0x2b6919))return _0x2b6919;_0x38d7a2=_0x38d7a2??_0x2b6919;}return _0x38d7a2;}function Xt(_0x227741){return _0x227741==='claude'?'CLAUDE_PATH':'CODEX_PATH';}function Fr(_0x5b8fd3){let _0x3a4bf3=process.env[Xt(_0x5b8fd3)];return _0x3a4bf3||(_0x5b8fd3==='claude'?Rr()??null:_r()??null);}function Yt(_0x1dc0a2){let _0x4bbc18=null,_0x424cd9=0x0;return()=>{const _0x8b6cc1=_0x1516;let _0x4e5f9f=process.env[Xt(_0x1dc0a2)];if(_0x4e5f9f)return _0x4e5f9f;let _0x886600=Date[_0x8b6cc1(0x27e)]();return(!_0x4bbc18||_0x886600-_0x424cd9>wr||!(0x0,M['existsSync'])(_0x4bbc18)||I(_0x4bbc18))&&(_0x4bbc18=Fr(_0x1dc0a2)??_0x1dc0a2,_0x424cd9=_0x886600),_0x4bbc18;};}var Ho=Yt('claude'),Bo=Yt(_0x472560(0x17e));function E(_0x34f8c7){return!_0x34f8c7||typeof _0x34f8c7!='object'||Array['isArray'](_0x34f8c7)?null:_0x34f8c7;}function ae(_0x1d5e81){let _0x4284f6=Number(_0x1d5e81);return Number['isFinite'](_0x4284f6)?_0x4284f6:null;}function kr(_0x243d0f){const _0x8d94aa=_0x472560;let _0x23ddf3=ae(_0x243d0f);return _0x23ddf3===null||_0x23ddf3<=0x0?null:Math[_0x8d94aa(0x260)](_0x23ddf3);}function le(_0x373870){const _0x2c31bd=_0x472560;let _0x4d86c4=E(_0x373870);if(!_0x4d86c4)return;let _0x8bb6a7=ae(_0x4d86c4[_0x2c31bd(0x2c3)]??_0x4d86c4['inputTokens']),_0x25e2ae=ae(_0x4d86c4['output_tokens']??_0x4d86c4[_0x2c31bd(0x2ba)]);if(_0x8bb6a7===null||_0x25e2ae===null)return;let _0x124006=ae(_0x4d86c4['cache_creation_input_tokens']??_0x4d86c4[_0x2c31bd(0x251)]),_0x8eed98=ae(_0x4d86c4[_0x2c31bd(0x1cc)]??_0x4d86c4[_0x2c31bd(0x29a)]),_0x524dab=kr(_0x4d86c4[_0x2c31bd(0x1ab)]??_0x4d86c4['model_context_window']??_0x4d86c4[_0x2c31bd(0x23e)]);return{'inputTokens':_0x8bb6a7,'outputTokens':_0x25e2ae,..._0x124006!==null?{'cacheCreationInputTokens':_0x124006}:{},..._0x8eed98!==null?{'cacheReadInputTokens':_0x8eed98}:{},..._0x524dab?{'contextWindowTokens':_0x524dab}:{}};}function Zt(_0x1fdfa6){const _0x485cce=_0x472560;let _0x1650a6=le(_0x1fdfa6);if(_0x1650a6&&!(_0x1650a6[_0x485cce(0x17a)]<=0x0&&_0x1650a6['outputTokens']<=0x0&&(_0x1650a6[_0x485cce(0x251)]??0x0)<=0x0&&(_0x1650a6['cacheReadInputTokens']??0x0)<=0x0&&!_0x1650a6['contextWindowTokens']))return _0x1650a6;}function be(_0x28c921){const _0x13b52d=_0x472560;return _0x28c921[_0x13b52d(0x17a)]===0x0&&_0x28c921['outputTokens']===0x0&&(_0x28c921[_0x13b52d(0x251)]??0x0)===0x0&&(_0x28c921['cacheReadInputTokens']??0x0)===0x0&&!_0x28c921[_0x13b52d(0x23e)];}function en(_0x4635ba){const _0x4c9d5b=_0x472560;let _0x258657=E(_0x4635ba);if(!_0x258657)return;if(_0x258657[_0x4c9d5b(0x238)]==='assistant'){let _0x3d91f4=E(_0x258657['message']);if(_0x3d91f4?.['model']===_0x4c9d5b(0x2e5))return;let _0x43838f=le(_0x3d91f4?.[_0x4c9d5b(0x291)]??_0x258657['usage']);return _0x43838f&&!be(_0x43838f)?_0x43838f:void 0x0;}let _0x47631a=E(_0x258657[_0x4c9d5b(0x223)]),_0x1cf556=le(_0x47631a?.[_0x4c9d5b(0x291)]);return _0x1cf556&&!be(_0x1cf556)?_0x1cf556:void 0x0;}function tn(_0x1c2f69){const _0x33bccb=_0x472560;let _0x15f730=E(_0x1c2f69);if(_0x15f730?.['type']!==_0x33bccb(0x1b9))return;let _0x476a31=E(_0x15f730['payload']);if(_0x476a31?.['type']!=='token_count')return;let _0x38becc=E(_0x476a31[_0x33bccb(0x1dc)]),_0x5ee5d7=E(_0x38becc?.['last_token_usage']);if(_0x5ee5d7)return Zt({..._0x5ee5d7,'modelContextWindow':_0x38becc?.[_0x33bccb(0x19c)]});}function ve(_0x4edeb3){const _0x2c3040=_0x472560;switch(_0x4edeb3){case _0x2c3040(0x289):return _0x2c3040(0x289);case'acceptEdits':return'acceptEdits';case'bypassPermissions':return _0x2c3040(0x1ca);case _0x2c3040(0x1f2):return'normal';default:return;}}function T(_0x58b9b9){const _0x9de61c=_0x472560;return typeof _0x58b9b9!=_0x9de61c(0x1cb)?void 0x0:_0x58b9b9[_0x9de61c(0x2c6)](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')[_0x9de61c(0x2dd)]()||void 0x0;}function nn(_0x1003e8){const _0x353094=_0x472560;let _0x2e27f6=T(_0x1003e8);switch(_0x2e27f6){case _0x353094(0x1d5):case _0x353094(0x190):case _0x353094(0x2d2):case _0x353094(0x25b):case _0x353094(0x2ca):case'max':case _0x353094(0x1f1):return _0x2e27f6;default:return;}}function Vr(_0xadb655){const _0x88ce8d=_0x472560;let _0x53bd1f=typeof _0xadb655?.[_0x88ce8d(0x294)]==_0x88ce8d(0x1cb)?_0xadb655[_0x88ce8d(0x294)]:'',_0x552fac=_0xadb655?.['sandbox_policy'],_0x3bc146=typeof _0x552fac?.[_0x88ce8d(0x238)]==_0x88ce8d(0x1cb)?_0x552fac['type']:'',_0x500476=Array[_0x88ce8d(0x272)](_0x552fac?.['writable_roots'])?_0x552fac[_0x88ce8d(0x2db)]:null;if(_0x53bd1f===_0x88ce8d(0x2da)&&_0x3bc146===_0x88ce8d(0x1c1))return'autoApprove';if(_0x53bd1f==='on-request'&&_0x3bc146===_0x88ce8d(0x1c3))return _0x500476?.['length']?_0x88ce8d(0x1c7):'plan';}function rn(_0x377a82){const _0x5e4789=_0x472560;return _0x377a82?.['type']===_0x5e4789(0x193)?ve(_0x377a82['permissionMode']):ve(_0x377a82?.[_0x5e4789(0x21d)]);}function sn(_0x2d6ba5){const _0x2ee988=_0x472560;if(_0x2d6ba5?.['type']==='turn_context')return Vr(_0x2d6ba5[_0x2ee988(0x268)]);}function on(_0x4f0f79){return tn(_0x4f0f79);}function an(_0x5d0071){return en(_0x5d0071);}var Qr=new Set(['New\x20session','Resumed\x20session',_0x472560(0x292)]),Jr=[_0x472560(0x2d0),'<local-command-caveat>',_0x472560(0x1d4),_0x472560(0x2bb),_0x472560(0x189),'<command-message>','<command-args>','#\x20AGENTS.md\x20instructions\x20for\x20'];function Kr(_0xf29a9c){return _0xf29a9c['replace'](/\s+/g,'\x20')['trim']();}function F(_0x1eb0be){const _0x2efade=_0x472560;return typeof _0x1eb0be!=_0x2efade(0x1cb)?void 0x0:Kr(_0x1eb0be)||void 0x0;}function je(_0x53ab0b){const _0x378b6e=_0x472560;let _0x24ba63=F(_0x53ab0b);return _0x24ba63?/^[0-9a-f]{8,}$/i['test'](_0x24ba63)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x24ba63)||/^agent-[a-z0-9_-]{6,}$/i[_0x378b6e(0x18d)](_0x24ba63):!0x1;}function ze(_0xe5b571){let _0x4c56b4=F(_0xe5b571);return!_0x4c56b4||Qr['has'](_0x4c56b4)||je(_0x4c56b4);}function Xr(_0x204555){for(let _0x497c5c of _0x204555['replace'](/\r/g,'')['split']('\x0a')){let _0x29e43b=F(_0x497c5c);if(_0x29e43b&&!Yr(_0x29e43b)&&!Zr(_0x29e43b))return _0x29e43b;}}function Yr(_0x777c09){const _0x296b44=_0x472560;return Jr['some'](_0x1f4e24=>_0x777c09[_0x296b44(0x232)](_0x1f4e24));}function Zr(_0x223a34){const _0x1a9876=_0x472560;let _0xa65a8f=_0x223a34[_0x1a9876(0x2c6)](/^['"`]+/,'')[_0x1a9876(0x2c6)](/['"`\\]+$/,'')['trim']();return!!(!_0xa65a8f||/^(\/|~\/|\.\/|\.\.\/)/['test'](_0xa65a8f)||/^[A-Za-z]:\\/[_0x1a9876(0x18d)](_0xa65a8f));}function es(_0x3f52eb){const _0x37cc1e=_0x472560;for(let _0x38929a=0x0;_0x38929a<_0x3f52eb[_0x37cc1e(0x20a)];_0x38929a+=0x1){let _0x3f03ff=_0x3f52eb[_0x38929a];if(_0x3f03ff==='。'||_0x3f03ff==='!'||_0x3f03ff==='?'||_0x3f03ff===';')return _0x38929a+0x1;if(_0x3f03ff==='.'||_0x3f03ff==='!'||_0x3f03ff==='?'||_0x3f03ff===';'){let _0x288549=_0x3f52eb[_0x38929a+0x1];if(!_0x288549||/\s/[_0x37cc1e(0x18d)](_0x288549))return _0x38929a+0x1;}}return-0x1;}function ln(_0x34b6b5,_0x43fecb=0x50){const _0x5b4cd8=_0x472560;if(typeof _0x34b6b5!=_0x5b4cd8(0x1cb))return;let _0x39abaf=Xr(_0x34b6b5);if(!_0x39abaf)return;let _0x3075fc=es(_0x39abaf),_0x59d660=(_0x3075fc>0x0?_0x39abaf['slice'](0x0,_0x3075fc):_0x39abaf)['replace'](/[。!?;.!?;]+$/gu,'')[_0x5b4cd8(0x2dd)]();if(!(!_0x59d660||je(_0x59d660)))return _0x59d660[_0x5b4cd8(0x20a)]<=_0x43fecb?_0x59d660:_0x59d660[_0x5b4cd8(0x274)](0x0,Math[_0x5b4cd8(0x2e4)](0x1,_0x43fecb-0x3))['trimEnd']()+'...';}function k(_0x3d4ba9,_0x131f02){for(let _0x50e82b of _0x3d4ba9){let _0x28a24d=F(_0x50e82b);if(!(!_0x28a24d||ze(_0x28a24d)))return _0x28a24d;}return ln(_0x131f02);}var cn=_0x472560(0x18b);function un(_0x56ff6f){const _0xd14b5a=_0x472560;return _0x56ff6f[_0xd14b5a(0x2c6)](/[^a-zA-Z0-9]/g,'-');}async function qe(){let _0x2031ad=await se(),_0x48fe1b=await _(_0x2031ad,b,async _0x21e1db=>{const _0x22f822=_0x1516;try{let _0x2f1c72=JSON['parse'](await(0x0,dn['readFile'])(_0x21e1db,'utf-8')),_0x31592d=T(_0x2f1c72[_0x22f822(0x2ac)]);if(!_0x31592d)return null;let _0x55f720=F(T(_0x2f1c72['title'])),_0x17a9db={'cliSessionId':_0x31592d},_0x341cad=T(_0x2f1c72['sessionId']),_0x33b7d5=T(_0x2f1c72[_0x22f822(0x2cc)]),_0x27932c=T(_0x2f1c72['originCwd']),_0x1b4ef0=T(_0x2f1c72[_0x22f822(0x2ae)]),_0x1fd04a=nn(_0x2f1c72['effort']),_0x30e931=ve(T(_0x2f1c72['permissionMode']));return _0x341cad&&(_0x17a9db['localSessionId']=_0x341cad),_0x33b7d5&&(_0x17a9db[_0x22f822(0x2cc)]=_0x33b7d5),_0x27932c&&(_0x17a9db['originCwd']=_0x27932c),_0x55f720&&(_0x17a9db[_0x22f822(0x1e7)]=_0x55f720),_0x1b4ef0&&(_0x17a9db['model']=_0x1b4ef0),_0x1fd04a&&(_0x17a9db['effort']=_0x1fd04a),_0x30e931&&(_0x17a9db[_0x22f822(0x2cd)]=_0x30e931),typeof _0x2f1c72['isArchived']=='boolean'&&(_0x17a9db['externalArchived']=_0x2f1c72[_0x22f822(0x231)]),_0x17a9db;}catch{return null;}}),_0x267ca7=new Map();for(let _0xc1ab9d of _0x48fe1b)_0xc1ab9d&&_0x267ca7['set'](_0xc1ab9d['cliSessionId'],_0xc1ab9d);return{'byCliSessionId':_0x267ca7};}function Ge(_0x38159f,_0x434778){const _0x56f992=_0x472560;if(!_0x434778)return _0x38159f;let _0x12d01b=[..._0x38159f[_0x56f992(0x2cb)]??[],..._0x38159f['title']&&_0x434778[_0x56f992(0x1e7)]&&_0x38159f['title']!==_0x434778['title']?[_0x38159f[_0x56f992(0x1e7)]]:[]];return{..._0x38159f,..._0x434778[_0x56f992(0x2cc)]?{'cwd':_0x434778[_0x56f992(0x2cc)]}:{},..._0x434778[_0x56f992(0x1b5)]?{'originCwd':_0x434778['originCwd']}:{},..._0x434778['model']?{'model':_0x434778['model']}:{},..._0x434778['effort']?{'effort':_0x434778[_0x56f992(0x196)]}:{},..._0x434778[_0x56f992(0x1e7)]?{'title':_0x434778['title']}:{},..._0x12d01b[_0x56f992(0x20a)]?{'titleAliases':_0x12d01b}:{},..._0x434778['approvalMode']?{'approvalMode':_0x434778[_0x56f992(0x2cd)]}:{},'originator':'Claude\x20Desktop',...typeof _0x434778['externalArchived']=='boolean'?{'externalArchived':_0x434778[_0x56f992(0x202)]}:{}};}var pn=require('node:child_process'),mn=require('node:fs/promises'),Je=require('node:os'),Ke=require('node:path'),gn=require('node:util'),ts=S['child']({'module':_0x472560(0x2d4)}),fn=(0x0,gn['promisify'])(pn[_0x472560(0x216)]),ns=0x7530,K=null,ce=null,Ve='';function Qe(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function rs(_0x481ccb){return _0x481ccb['startsWith']('~/')?(0x0,Ke['join'])((0x0,Je['homedir'])(),_0x481ccb['slice'](0x2)):_0x481ccb;}function hn(_0x101f26,_0x1a7373,_0x4829f5){const _0x209464=_0x472560;if(_0x101f26)return _0x101f26['byId'][_0x209464(0x27b)](_0x1a7373)??_0x101f26['byRolloutPath']['get'](_0x4829f5);}function Sn(_0x4c02ee,_0x3ee651,_0x109a41){if(_0x4c02ee)return _0x4c02ee['archivedById']['get'](_0x3ee651)??_0x4c02ee['archivedByRolloutPath']['get'](_0x109a41);}function Xe(){K=null;}async function Ie(){const _0x594cf5=_0x472560;let _0xd6d8cd=Date[_0x594cf5(0x27e)](),_0x38ab9d=(0x0,Je[_0x594cf5(0x23d)])();if(K&&K[_0x594cf5(0x25d)]===_0x38ab9d&&_0xd6d8cd<=K[_0x594cf5(0x2cf)])return K['value'];if(ce&&Ve===_0x38ab9d)return ce;Ve=_0x38ab9d,ce=((async()=>{const _0x55c4ed=_0x594cf5;let _0x3a30b0=(0x0,Ke[_0x55c4ed(0x24a)])(_0x38ab9d,'.codex','state_5.sqlite');if(!(await(0x0,mn[_0x55c4ed(0x276)])(_0x3a30b0)[_0x55c4ed(0x211)](()=>null))?.[_0x55c4ed(0x298)]())return Qe();try{let _0x4fbf07='';try{({stdout:_0x4fbf07}=await fn('sqlite3',['-json',_0x3a30b0,_0x55c4ed(0x21c)],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x4fbf07}=await fn(_0x55c4ed(0x248),[_0x55c4ed(0x245),_0x3a30b0,'select\x20id,\x20title,\x20rollout_path\x20from\x20threads\x20where\x20coalesce(title,\x20\x27\x27)\x20<>\x20\x27\x27'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x17beee=JSON['parse'](_0x4fbf07||'[]'),_0xb4c3a1=Qe();for(let _0x22dfe2 of _0x17beee){if(typeof _0x22dfe2['id']!=_0x55c4ed(0x1cb))continue;let _0x229515=F(typeof _0x22dfe2['title']=='string'?_0x22dfe2['title']:void 0x0);_0x229515&&_0xb4c3a1[_0x55c4ed(0x206)][_0x55c4ed(0x2a1)](_0x22dfe2['id'],_0x229515);let _0x299667=typeof _0x22dfe2['rollout_path']==_0x55c4ed(0x1cb)&&_0x22dfe2['rollout_path'][_0x55c4ed(0x2dd)]()?rs(_0x22dfe2[_0x55c4ed(0x27f)]):'';if(_0x299667&&_0x229515&&_0xb4c3a1[_0x55c4ed(0x234)][_0x55c4ed(0x2a1)](_0x299667,_0x229515),typeof _0x22dfe2[_0x55c4ed(0x18f)]==_0x55c4ed(0x271)||typeof _0x22dfe2['archived']==_0x55c4ed(0x297)){let _0x3c97cb=_0x22dfe2['archived']===!0x0||_0x22dfe2[_0x55c4ed(0x18f)]===0x1;_0xb4c3a1['archivedById']['set'](_0x22dfe2['id'],_0x3c97cb),_0x299667&&_0xb4c3a1[_0x55c4ed(0x1e9)]['set'](_0x299667,_0x3c97cb);}}return _0xb4c3a1;}catch(_0x1fbd16){return ts['debug']({'error':String(_0x1fbd16)},'failed\x20to\x20read\x20codex\x20thread\x20titles\x20from\x20sqlite'),Qe();}})());try{let _0x7287c6=await ce;return K={'value':_0x7287c6,'expiresAt':Date['now']()+ns,'home':_0x38ab9d},_0x7287c6;}finally{ce=null,Ve='';}}var xn=require(_0x472560(0x2c4)),X=require('node:fs/promises'),Cn=require('node:readline');function*de(_0x5cb55d,_0xc515a5){const _0x5091fd=_0x472560;let _0x4d4a3b=0x0,_0x316ec5=0x0;for(;_0x4d4a3b<_0x5cb55d['length']&&_0x316ec5<_0xc515a5;){let _0x26e74d=_0x5cb55d[_0x5091fd(0x195)]('\x0a',_0x4d4a3b);_0x26e74d===-0x1&&(_0x26e74d=_0x5cb55d[_0x5091fd(0x20a)]);let _0x55f769=_0x5cb55d[_0x5091fd(0x2bc)](_0x4d4a3b,_0x26e74d);_0x4d4a3b=_0x26e74d+0x1,!(_0x55f769['length']===0x0||_0x55f769['trim']()[_0x5091fd(0x20a)]===0x0)&&(yield _0x55f769,_0x316ec5+=0x1);}}var Ye=0x200*0x400,yn=0x100*0x400;function _0x144c(){const _0xc02a9c=['y29UzMLKzw5Jzq','C3fSAxrLmW','lMrHCNq','AM9PBG','y2HPBgq','y2XHDwrL','lNHTBa','lMT0','ioINHUs4UUAvJ+AeN+I3R+w+HooaGUI/MEEXU+AjUEwhHUAxOoAZLEs7JUw3SUACIEs8MUIVNEIUSow9LEMhJoIHPEwBNUwiScbwAwjLBgv044cc6k+36yEn5PAW5OMN6kgm6l+z5QYH5l+U5Ps55BM25zYOienSyxvKzsdKUk3MMi7NOA7MIBNLH4BVVjVLPOlMNPZLUiZMNjVLNkGGvMLIzwXLDcdPH4ZNNiVLIldLRQhMIBNLVlNNQPFVViZOR7FKU44GvMLIzwXLDcdLKk/LIQJMIjBNU6FNU63OV5NKUkRKVjROR53JGii','ls1ZzxnZAw9UlwLKpq','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','B3bLBG','CMvZB2X2zq','ls1SB2fKzxi','CgfYzw50x3rOCMvHzf9Pza','DhvYBLn0yxj0zwq','DMfSDwvZ','yxjNCW','CM9Szq','ChjVAMvJDhm','AgLNAa','ChvZAc1ZDwjZy3jPChrPB25ZlMPZB24','Ag9Tzq','DMfSDwu','C2LNBMfS','zMXVB3i','CMvHza','y3vYCMvUDa','C29YDa','yxvKAxqUANnVBMW','y29UDgvUDa','lNb5','CgLWzq','Cgf5Bg9Hza','y3vZDg9TvgL0Bgu','C25HChnOB3rZ','Aw5WDxq','Dg9VBf91C2u','Bg9Nsw50zxj2ywW','se9nrq','Dg9VBfjLC3vSDa','lNnJywXH','BNvTyMvY','AxnbCNjHEq','lMv4CW','C2XPy2u','Bg9HzenVzgv4tg9VA3vW','C3rHDa','DxnLCLbYB21WDa','Aw50zxjYDxb0zwq','AgfZigjLzw4Gy3jLyxrLza','DxrMltG','z2v0','l2jPBI96C2G','yMLU','BM93','CM9SBg91Df9WyxrO','CMvZCg9UC2vFAxrLBq','Cgf0Aa','y291BNrLCNm','l2jPBG','C29Tzq','A2LUza','ls1JB250Aw51zq','Aw1Hz2vZ','Bwf0y2HLzfbYB2nLC3nLCW','CgXHBG','lNbOCa','lwLSyW','ChjVy2vZCY5Zy2fUlMzHBgXIywnRx21Z','ywnJzxb0rwrPDhm','BMfTzq','B3jPz2LUyxrVCG','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','DxnHz2u','vw50AxrSzwqGC2vZC2LVBG','lNnJC3m','yxbWCM92ywXFCg9SAwn5','ywDLBNq','ls1SAxn0zw49','yM9VBgvHBG','AxngAwXL','y2XHDwrLlxnLBNnPDgL2zs1MAwXLoG','y2fJAgvszwfKsw5WDxruB2TLBNm','Dg9mB3DLCKnHC2u','zMLSDgvY','C25HChnOB3q','D2fYBG','lNbS','DhvYBL9Pza','C2v0','DxvPza','Aw5JBhvKzxm','DgLTzxn0yw1W','BM9KztPWyxrO','C3rYDwn0DxjLzfbHDgnO','r2vUzxjHDgvKigzPBgvZoGO','CgLK','DhvYBKzPBMLZAgvK','ywXPDMvqCM9JzxnZzxm','ls1LEhbLCMLTzw50ywWTBg9HzgvY','y2XPu2vZC2LVBKLK','lNLHBwW','Bw9KzwW','zgvSDge','DMvYC2LVBNm','Bwf0y2G','lMT0CW','qxbWBgLJyxrPB24Gu3vWCg9YDa','CMvHzfj1BNrPBwviAw50C0zYB21gAwXL','zMLSzq','Bwf4txm','lMPZEa','lMXVy2fS','C2TPChbLzfbYB2nLC3nezxrHAwXZ','B3v0Chv0vg9Rzw5Z','pgXVy2fSlwnVBw1HBMqTC3rKzxjYpG','C3vIC3rYAw5N','lNnXBa','Cg5WBq','BxrPBwvnCW','C3rHCNruAw1LCG','BwLUtxm','ywXSB2m','Aw5WDxrFDg9Rzw5Z','BM9KztPMCW','DxbKyxrLzef0','CMvWBgfJzq','zMLSzv9WyxrO','lMPZB25S','Dgv4Da','EgHPz2G','DgL0BgvbBgLHC2vZ','y3DK','yxbWCM92ywXnB2rL','CMvHBhbHDgHtEw5J','zxHWAxjLC0f0','pgvUDMLYB25Tzw50x2nVBNrLEhq+','C2vZC2LVBKzPBgvqyxrO','BwvKAxvT','zxzLCNK','C2nHBM5LCG','CMvHzgrPCG','Aw52zw50B3j5lxDVCMTLCG','C2nHBG','B2jQzwn0','BM9ODxa','BMv2zxi','D3jPDgfIBgvFCM9VDhm','D2LUmZi','DhjPBq','C3rYAw5NAwz5','D2vIx3nLyxjJAf9LBMq','BwfW','A2LSBa','AxneAxjLy3rVCNK','r2vUzxjHDgvKigzPBgu6ia','Bwf4','phn5BNrOzxrPyZ4','zw5KC1DPDgG','y211Ea','C3rHBMrHBg9Uzq','CgfYzw50ug9YDa','CgfYC2u','ywn0AxzPDhK','A2v5CW','C2vZC2LVBL9TzxrH','C2L6zq','pgnVBw1HBMqTBwvZC2fNzt4','BM9Kzq','AhLKCMf0zu1Z','Aw5WDxruB2TLBNm','q2XHDwrL','zgvSzxrL','AxnszxnWB25KAw5N','y29KzxG','DgvYBwLUywWTy29UDhjVBc10B2TLBG','C3rKB3v0','CMvHzfnLC3nPB24','zxHPC3rZu3LUyW','yMLYDgH0Aw1Ltxm','lMvSBq','l3vZCI9SB2nHBc9IAw4Vy2XHDwrL','zxHLyW','ywDLBNrFBwvZC2fNzv9KzwX0yq','lwf4BW','pgnVBw1HBMqTBMfTzt4','ChjVy2vZCY5Zy2fUlNbNCMvWx21Z','phzPyMvSzxqTCMvZDw1LlwfMDgvYlwfWChjVDMfSpG','DhvYBL9HyM9YDgvK','DgvZDa','C2vZC2LVBG','yxjJAgL2zwq','Bg93','C2vZC2LVBKLK','lMPZB24','CgvYBwLZC2LVBI1TB2rL','mtu5mtmYm2HZwgnsEq','Aw5KzxHpzG','zwzMB3j0','ChjVy2vZCYbYDw5UAw5NihnLC3nPB25ZihnJyw5Uzwq','ru5pru5u','CgXHDgzVCM0','AgfZ','lMnJ','Bw9KzwXFy29UDgv4Df93Aw5KB3C','DxbSB2fKCW','C2vZC2LVBL9IyxrJAf9JB21WBgv0zq','ndiXnJG5mhP0ueLMAW','ls1Yzxf1AxjL','lNrZEa','y2XHDwrLtwv0ywrHDgfgAw5NzxjWCMLUDa','q0Xbvurfq09erq','ChjVy2vZCW','lMnZ','Dg9ju09tDhjPBMC','yMfZzw5HBwu','nhfXAhzoBG','zNvUy3rPB25Fy2fSBa','CgfPCMLUzY1XCI5WBMC','Bw9KzwXdB250zxH0v2LUzg93','CgvYAw9KAwmGBwv0CMLJCYbZBMfWC2HVDa','zMfPBgvKihrVihjLywqGy2XHDwrLihnLC3nPB24GAgLZDg9YEq','lMnZCW','zw52','Bg9JywXLq29TCgfYzq','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','BhnVzK1Z','zMLUywXSEq','AgfZt3DU','B3jPz2LUq3DK','DxnLCG','zMfPBgvKihrVihDHBgSGy29KzxGGC2vZC2LVBNmGzgLY','D3jPDgfIBgu','zxzLBNrFBxnN','Bwv0yq','mJm1odqWmtfSCMHNvMu','C3rKzxjY','Dg90ywXnCW','C3rVCfbLCMLVzgLJtg9N','CMvHzezPBgvnzxrH','zw50CNK','zgfUz2vYlwz1BgWTywnJzxnZ','zgfLBw9U','D29YA3nWywnLlxDYAxrL','BhnVzG','yNLdBgLtzxnZAw9Uswq','mZuXrMPUCND3','BM9YBwfS','BgfZDe1Z','y2XHDwrLlwnVzguTC2vZC2LVBNm','yxv0B0fWChjVDMu','C3rYAw5N','y2fJAgvFCMvHzf9PBNb1Df90B2TLBNm','rvbjueu','n2zTrvviEa','yMfZAa','mZyZmvbNwxnSBW','CMvHzfnLC3nPB25dD2rbBMrjza','BM9Kzs12zxjZAw9UCW','Aw5ZDgfSBgf0Aw9U','pgXVy2fSlwnVBw1HBMqTC3rKB3v0pG','BwLUAw1HBa','lwXJ','C3vIDhLWzq','ChjVy2vZCY5Zy2fUlMXZB2zFBxm','DgLTzw91Da','DxnLCL9TzxnZywDL','z2f1z2vZ','Aw5MBW','CMvHzgrPCLn5BMm','lNn3Awz0','AxngAw5PDgu','uefusa','zw50CMLLCW','phrHC2STBM90AwzPy2f0Aw9UpG','lM1T','C2vZC2LVBNm','C2vZC2LVBIbPBNzLBNrVCNKGAw5JCMvTzw50ywXSEsbZy2fUBMvK','yMf0y2HtAxPL','DgL0Bgu','zMfSBgjHy2TiAxrZ','yxjJAgL2zwrcEvjVBgXVDxrqyxrO','qxbWrgf0yq','y29KzxGTBgf0zxn0oG','Dg9VBf91C2vFAwq','Cg9ZDe1LC3nHz2u','C3rHCNrqzxjPB2rPy0XVzW','y29KzxHgAwXLCW','zxHLy0zPBgvtEw5J','DwX0CMe','zgvMyxvSDa','AxnbyNnVBhv0zq','BgfZDfvZzwrbDa','CMvHzezPBgu','Dg9VBf9Yzxn1Bhq','ChjVy2vZCY5Zy2fUlNrVDgfSx21Z','Aw5JCMvTzw50','y2HHBMDLzezPBgvZ','y29SBgvJDenVBNrLEhq','Aw52zw50B3j5ihnJyw4GD29YA2vYihjLCxvPCMvZigeGCgfYzw50ihbVCNq','zgvWzw5Kzw5JAwvZ','y2XHDwrLtg9VA3vW','BgfZDfvZywDL','yxbWBhLFCgf0y2G','zMLZAa','lMnVzgv4','zxH0zxjUywXbCMnOAxzLza','C3rVCf9OB29Rx3n1Bw1HCNK','Bwf0y2HbBgW','l3vZCI9IAw4VD2HPy2G','yNLjza','zgLYzwn0q2fUzgLKyxrLCW','ls1Kyw5NzxjVDxnSEs1ZA2LWlxbLCM1PC3nPB25Z','lMX1yq','BgvUz3rO','D3jPDgu','lMPHDMe','ChvZAa','C291CMnL','C3rVCeHVB2S','lMHYBa','y2f0y2G','nZu4mZb6EMzPsfu','zMLSzvbHDgG','CgfYzw50vxvPza','D2vIx3nLyxjJAf9JywXS','zxHLy0zPBgu','y29Kzq','y2XVC2u','zMLUza','zgvSAw1PDgvY','C2vZC2LVBNmUANnVBG','C2vSzwn0igLKlcb0AxrSzsWGCM9SBg91Df9WyxrOlcbHCMnOAxzLzcbMCM9TihrOCMvHzhm','CgvYBwLZC2LVBK1Vzgu','l3n1yMfNzw50CY8','pgnVBw1HBMqTyxjNCZ4','ntG1mZyXnKXWBgDWAW','lxHJ','DgLTzxjZ','Dg9VBfvZzvjLC3vSDa','ls1WzxjTAxnZAw9Ulw1Vzgu9','DgvYBwLUywW','lNnHC3m','ywXS','Cgf0y2HFyxbWBhLFzw5K','l3vZCI9SB2nHBc9IAw4','BM9KztPMCY9WCM9TAxnLCW','BM9KztPVCW','y29HBgvZy2vdB25Zzwn1DgL2zufZC2LZDgfUDa','zgvZDhjVEwvK','Dw5Yzwy','lMnWCa','BwnWx3rVB2XFy2fSBf9LBMq','AxnbCMnOAxzLza','C3rHCNrZv2L0Aa','BwvZC2fNzq','yNLsB2XSB3v0ugf0Aa','C3bSAxq','zNvUy3rPB25Fy2fSBf9VDxrWDxq','y3vZDg9Tx3rVB2XFy2fSBf9VDxrWDxq','DhLWzq','lMnSyxvKzq','mJK3nJG1ogztt0jOva','y29KzxHnzxrHzgf0yuzPBMDLCNbYAw50','z3rPBwvVDxq','Ag9TzwrPCG','y29UDgv4DfDPBMrVD1rVA2vUCW','DxbKyxrLtgf0zxn0q29KzxHdywnOzq','ywrK','yxnZAxn0yw50','mta2r3rOqKjz','y29TBwfUza','CgDYzxbnCW','lwPZB24','ChjVy2vZCY1Zy2fUBMvY'];_0x144c=function(){return _0xc02a9c;};return _0x144c();}async function Me(_0xae82bf,_0x416cbe){const _0x2f60c0=_0x472560;if(_0x416cbe<=Ye)return(0x0,X[_0x2f60c0(0x1f5)])(_0xae82bf,'utf-8');let _0x258ef5=await(0x0,X[_0x2f60c0(0x252)])(_0xae82bf,'r');try{let _0x2f3e62=Buffer[_0x2f60c0(0x2c2)](Ye),{bytesRead:_0x59fab2}=await _0x258ef5['read'](_0x2f3e62,0x0,Ye,0x0);return _0x2f3e62['toString']('utf-8',0x0,_0x59fab2);}finally{await _0x258ef5[_0x2f60c0(0x218)]();}}async function Ze(_0x16ac7f,_0x13e7ed){const _0x4af2a3=_0x472560;if(_0x13e7ed<=yn)return(0x0,X['readFile'])(_0x16ac7f,_0x4af2a3(0x27a));let _0x6df309=await(0x0,X[_0x4af2a3(0x252)])(_0x16ac7f,'r');try{let _0x4cf0df=Math[_0x4af2a3(0x2e4)](0x0,_0x13e7ed-yn),_0x55d4e4=Buffer[_0x4af2a3(0x2c2)](_0x13e7ed-_0x4cf0df),{bytesRead:_0x1c92c0}=await _0x6df309[_0x4af2a3(0x261)](_0x55d4e4,0x0,_0x55d4e4['length'],_0x4cf0df);return _0x55d4e4['toString']('utf-8',0x0,_0x1c92c0);}finally{await _0x6df309['close']();}}async function H(_0xde2c0a,_0x227ae1){const _0x5cc89e=_0x472560;let _0x5285f0=(0x0,xn['createReadStream'])(_0xde2c0a,{'encoding':'utf-8'}),_0x2a088d=(0x0,Cn['createInterface'])({'input':_0x5285f0,'crlfDelay':0x1/0x0});try{for await(let _0x4fe793 of _0x2a088d){if(!_0x4fe793['trim']())continue;let _0x55a2c5;try{_0x55a2c5=JSON[_0x5cc89e(0x172)](_0x4fe793);}catch{continue;}if(_0x227ae1(_0x55a2c5))break;}}finally{_0x2a088d['close'](),_0x5285f0['destroy']();}}function L(_0x50d011){const _0x956741=_0x472560;return typeof _0x50d011=='string'?_0x50d011:Array['isArray'](_0x50d011)?_0x50d011['map'](_0x3a9a98=>!_0x3a9a98||typeof _0x3a9a98!=_0x956741(0x2d8)?'':typeof _0x3a9a98['text']=='string'?_0x3a9a98['text']:typeof _0x3a9a98[_0x956741(0x265)]=='string'?_0x3a9a98['content']:'')[_0x956741(0x24a)](''):'';}function ue(_0x43c7a9){const _0x2c3b98=_0x472560;return _0x43c7a9?.['type']===_0x2c3b98(0x280)&&_0x43c7a9[_0x2c3b98(0x268)]?.['type']===_0x2c3b98(0x233)&&_0x43c7a9[_0x2c3b98(0x268)]['role']==='user'?L(_0x43c7a9[_0x2c3b98(0x268)][_0x2c3b98(0x265)]):_0x43c7a9?.[_0x2c3b98(0x238)]==='event_msg'&&_0x43c7a9['payload']?.['type']===_0x2c3b98(0x1da)&&typeof _0x43c7a9['payload'][_0x2c3b98(0x233)]==_0x2c3b98(0x1cb)?_0x43c7a9['payload'][_0x2c3b98(0x233)]:'';}function B(_0x27c951){const _0x5e56c6=_0x472560;return typeof _0x27c951==_0x5e56c6(0x1cb)?_0x27c951:Array[_0x5e56c6(0x272)](_0x27c951)?_0x27c951[_0x5e56c6(0x2e0)](_0x4f7440=>!_0x4f7440||typeof _0x4f7440!='object'||_0x4f7440['type']!==_0x5e56c6(0x2c9)?'':typeof _0x4f7440['text']=='string'?_0x4f7440['text']:'')[_0x5e56c6(0x24a)](''):'';}var ss=/^\[Attached image: ([^\n]+)\]$/gm;function os(_0x1e640f){const _0x397eaa=_0x472560;let _0x350fd7=[],_0x3e4d5d=new Set();for(let _0x2b2a74 of _0x1e640f[_0x397eaa(0x204)](ss)){let _0x2f4c71=_0x2b2a74[0x1];!_0x2f4c71||_0x2f4c71[_0x397eaa(0x2dd)]()[_0x397eaa(0x20a)]===0x0||_0x3e4d5d['has'](_0x2f4c71)||(_0x3e4d5d[_0x397eaa(0x240)](_0x2f4c71),_0x350fd7[_0x397eaa(0x20d)](_0x2f4c71));}return _0x350fd7;}function Tn(_0x4a86f9){const _0x1d61a5=_0x472560;if(_0x4a86f9['role']!==_0x1d61a5(0x1b6))return _0x4a86f9;let _0x53d790=[..._0x4a86f9[_0x1d61a5(0x287)]??[],...os(_0x4a86f9['content'])][_0x1d61a5(0x29c)]((_0x103e4a,_0x47c6ad,_0x35c0bc)=>_0x103e4a&&_0x35c0bc[_0x1d61a5(0x195)](_0x103e4a)===_0x47c6ad);return _0x53d790['length']?{..._0x4a86f9,'images':_0x53d790}:_0x4a86f9;}var is=[_0x472560(0x1e2),'<local-command-caveat>',_0x472560(0x1d4),_0x472560(0x2bb),_0x472560(0x189),_0x472560(0x177),_0x472560(0x21f),'<system-reminder>',_0x472560(0x2d0),cn],An=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,as=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,ls=/<environment_context>[\s\S]*<\/environment_context>/,cs=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function ds(_0x4e4bea,_0x4c49cc){const _0x1ea47d=_0x472560;if(_0x4e4bea?.['isMeta']===!0x0)return!0x0;let _0x2bf1ad=_0x4c49cc[_0x1ea47d(0x2dd)]();return _0x2bf1ad?An[_0x1ea47d(0x18d)](_0x2bf1ad)||is['some'](_0x5f58bf=>_0x2bf1ad['startsWith'](_0x5f58bf)):!0x1;}function j(_0x31f4f5){const _0x4dfd60=_0x472560;if(_0x31f4f5?.['type']!=='user'||_0x31f4f5[_0x4dfd60(0x233)]?.['role']!==_0x4dfd60(0x1b6))return'';let _0xa7030=B(_0x31f4f5[_0x4dfd60(0x233)]['content']);return ds(_0x31f4f5,_0xa7030)?'':_0xa7030;}function wn(_0x2f2a18){const _0x3fdf8a=_0x472560;return Array['isArray'](_0x2f2a18)&&_0x2f2a18[_0x3fdf8a(0x284)](_0x22e521=>_0x22e521&&typeof _0x22e521==_0x3fdf8a(0x2d8)&&_0x22e521['type']===_0x3fdf8a(0x1f6));}function us(_0x4fa0a8){const _0x591213=_0x472560;return Array['isArray'](_0x4fa0a8)?_0x4fa0a8[_0x591213(0x2e0)](_0x43a580=>{const _0x35f462=_0x591213;if(!_0x43a580||typeof _0x43a580!='object'||_0x43a580['type']!==_0x35f462(0x1f6))return'';let _0xfcf75f=_0x43a580['content'];return typeof _0xfcf75f=='string'?_0xfcf75f:Array[_0x35f462(0x272)](_0xfcf75f)?_0xfcf75f[_0x35f462(0x2e0)](_0x5b27bf=>!_0x5b27bf||typeof _0x5b27bf!='object'?'':typeof _0x5b27bf['text']==_0x35f462(0x1cb)?_0x5b27bf[_0x35f462(0x2c9)]:typeof _0x5b27bf['content']=='string'?_0x5b27bf[_0x35f462(0x265)]:'')[_0x35f462(0x29c)](Boolean)['join']('\x0a'):'';})['filter'](Boolean)['join']('\x0a'):'';}function fs(_0x2e050b){const _0x5ac6bc=_0x472560;return Array[_0x5ac6bc(0x272)](_0x2e050b)?_0x2e050b['map'](_0x1d11e5=>!_0x1d11e5||typeof _0x1d11e5!='object'?'':typeof _0x1d11e5['text']==_0x5ac6bc(0x1cb)?_0x1d11e5[_0x5ac6bc(0x2c9)]:typeof _0x1d11e5['content']=='string'?_0x1d11e5['content']:'')[_0x5ac6bc(0x29c)](Boolean)[_0x5ac6bc(0x24a)]('\x0a'):'';}function et(_0x22ec40){const _0x4e564f=_0x472560;if(typeof _0x22ec40=='string')return _0x22ec40;let _0x5ef029=fs(_0x22ec40);return _0x5ef029||(Array['isArray'](_0x22ec40)&&_0x22ec40[_0x4e564f(0x20a)]>0x0&&_0x22ec40[_0x4e564f(0x2d3)](_0x3c2a90=>_0x3c2a90&&typeof _0x3c2a90=='object'&&_0x3c2a90['type']==='tool_reference')?'':JSON[_0x4e564f(0x2de)](_0x22ec40));}var ps=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function bn(_0x222ac8){const _0x106fd1=_0x472560;let _0x54fa48=_0x222ac8[_0x106fd1(0x2b1)](ps)?.[0x1];return _0x54fa48&&_0x54fa48['trim']()[_0x106fd1(0x20a)]>0x0?_0x54fa48:null;}function vn(_0xf22e31,_0x5002fe){const _0x4cdd72=_0x472560;return{'role':'assistant','type':'info','historyKey':_0x4cdd72(0x299)+_0xf22e31,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0xf22e31+_0x4cdd72(0x24f),..._0x5002fe?{'timestamp':_0x5002fe}:{}};}function In(_0xbad704){const _0x2d312c=_0x472560;let _0x986b30=us(_0xbad704?.[_0x2d312c(0x233)]?.[_0x2d312c(0x265)]);if(/\[Request interrupted by user(?: for tool use)?\]/i[_0x2d312c(0x18d)](_0x986b30))return!0x0;let _0x60f5d9=_0xbad704?.[_0x2d312c(0x223)];return!!(_0x60f5d9&&typeof _0x60f5d9=='object'&&_0x60f5d9[_0x2d312c(0x278)]===!0x0||typeof _0x60f5d9=='string'&&/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x60f5d9));}function z(_0x5ce7d9){const _0x105d42=_0x472560;let _0x529e66=_0x5ce7d9[_0x105d42(0x2dd)]();return _0x529e66?_0x529e66[_0x105d42(0x232)](_0x105d42(0x2d0))||An['test'](_0x529e66)?!0x0:ls['test'](_0x529e66)&&(cs['test'](_0x529e66)||as[_0x105d42(0x18d)](_0x529e66)):!0x1;}function Mn(_0x75b213){const _0x19d979=_0x472560;if(typeof _0x75b213?.[_0x19d979(0x2a4)]!='string')return null;let _0x33220b=Date['parse'](_0x75b213[_0x19d979(0x2a4)]);return Number[_0x19d979(0x1df)](_0x33220b)?_0x33220b:null;}function tt(_0x561b9d){let _0x1fec2f=Mn(_0x561b9d);return _0x1fec2f==null?void 0x0:new Date(_0x1fec2f)['toISOString']();}function q(_0x10caba,_0x445aa0){let _0x278dbb=tt(_0x445aa0);return _0x278dbb?{..._0x10caba,'timestamp':_0x278dbb}:_0x10caba;}var En=S['child']({'module':'scanner'});function ms(_0x2fbf24){const _0x3815ad=_0x472560;if(_0x2fbf24?.[_0x3815ad(0x238)]==='user'&&_0x2fbf24['message']?.['role']==='user'){if(_0x2fbf24['isMeta']===!0x0)return null;if(wn(_0x2fbf24['message']['content']))return{'kind':_0x3815ad(0x26f),...In(_0x2fbf24)?{'interrupted':!0x0}:{}};let _0x575169=j(_0x2fbf24);return gs(_0x575169)?null:_0x575169?{'kind':'userPrompt'}:null;}if(_0x2fbf24?.[_0x3815ad(0x238)]===_0x3815ad(0x241)&&_0x2fbf24[_0x3815ad(0x233)]?.[_0x3815ad(0x259)]==='assistant'){let _0x22adbc=B(_0x2fbf24[_0x3815ad(0x233)][_0x3815ad(0x265)]),_0x34af6c=_0x2fbf24['message']?.['stop_reason'];return{'kind':_0x3815ad(0x241),'stopReason':typeof _0x34af6c==_0x3815ad(0x1cb)?_0x34af6c:_0x34af6c??null,..._0x22adbc?{'text':_0x22adbc}:{}};}return _0x2fbf24?.[_0x3815ad(0x238)]==='system'&&_0x2fbf24[_0x3815ad(0x1d7)]===_0x3815ad(0x203)?{'kind':_0x3815ad(0x20f)}:null;}function gs(_0x58fb98){const _0x209980=_0x472560;return _0x58fb98?_0x58fb98[_0x209980(0x2a3)]('<local-command-caveat>')||_0x58fb98[_0x209980(0x2a3)](_0x209980(0x189)):!0x1;}function hs(_0x1ba7bb){const _0x38cf23=_0x472560;if(!_0x1ba7bb)return{};if(_0x1ba7bb[_0x38cf23(0x285)]==='stopHook')return{};if(_0x1ba7bb[_0x38cf23(0x285)]==='assistant'){let _0x534952=_0x1ba7bb['stopReason']==null||_0x1ba7bb['stopReason']===_0x38cf23(0x26c);return{..._0x534952?{'isResponding':!0x0}:{},..._0x534952&&_0x1ba7bb[_0x38cf23(0x2c9)]?{'partialReplyText':_0x1ba7bb['text']}:{}};}return _0x1ba7bb['kind']===_0x38cf23(0x26f)&&_0x1ba7bb['interrupted']?{}:{'isResponding':!0x0};}function Ss(_0x173571){const _0x3c7f64=_0x472560;let _0x19bd98=_0x173571?.[_0x3c7f64(0x233)]??_0x173571?.[_0x3c7f64(0x2c9)]??_0x173571?.[_0x3c7f64(0x2af)]??_0x173571?.['content'];return typeof _0x19bd98==_0x3c7f64(0x1cb)&&_0x19bd98[_0x3c7f64(0x2dd)]()?_0x19bd98:void 0x0;}function ys(_0x2acc40){const _0x18319a=_0x472560;if(_0x2acc40?.[_0x18319a(0x238)]==='event_msg'){let _0x1d5b7b=_0x2acc40[_0x18319a(0x268)];switch(_0x1d5b7b?.['type']){case'task_started':return{'kind':_0x18319a(0x256)};case'task_complete':case _0x18319a(0x18c):case'thread_rolled_back':return{'kind':'turnFinished'};case'user_message':{let _0x27133b=ue(_0x2acc40);return _0x27133b&&!z(_0x27133b)?{'kind':'userPrompt'}:null;}case'agent_message':case _0x18319a(0x187):{let _0x54df56=Ss(_0x1d5b7b);return _0x54df56?{'kind':_0x18319a(0x241),'text':_0x54df56}:{'kind':'assistant'};}case _0x18319a(0x230):case _0x18319a(0x228):case _0x18319a(0x2df):return{'kind':'activity'};default:return null;}}if(_0x2acc40?.['type']!==_0x18319a(0x280))return null;let _0x4b3bf9=_0x2acc40[_0x18319a(0x268)];switch(_0x4b3bf9?.['type']){case _0x18319a(0x233):{if(_0x4b3bf9['role']==='user'){let _0x3d46a6=L(_0x4b3bf9['content']);return _0x3d46a6&&!z(_0x3d46a6)?{'kind':_0x18319a(0x277)}:null;}if(_0x4b3bf9[_0x18319a(0x259)]===_0x18319a(0x241)){let _0xf8e5a2=L(_0x4b3bf9['content']);return _0xf8e5a2?{'kind':'assistant','text':_0xf8e5a2}:{'kind':'assistant'};}return null;}case'reasoning':case _0x18319a(0x1a9):case _0x18319a(0x236):case'custom_tool_call':case _0x18319a(0x237):case _0x18319a(0x215):case'tool_search_call':case'tool_search_output':return{'kind':_0x18319a(0x173)};default:return null;}}async function Rn(_0x3d08c4){const _0x45f653=_0x472560;let _0x1e86c6=null;try{await H(_0x3d08c4,_0x1bbe6f=>{let _0x4a5980=ms(_0x1bbe6f);_0x4a5980&&(_0x1e86c6=_0x4a5980);});}catch(_0x7f1167){return _0x7f1167['code']!==_0x45f653(0x198)&&En['warn']({'filePath':_0x3d08c4,'error':String(_0x7f1167)},_0x45f653(0x1b1)),{};}return hs(_0x1e86c6);}async function Pn(_0x3b7cda){const _0x39b7f1=_0x472560;let _0x149109=!0x1,_0x1b7f60=!0x1,_0x5de3c7;try{await H(_0x3b7cda,_0x2bf1bf=>{const _0x17a258=_0x1516;let _0x5f3b3b=ys(_0x2bf1bf);if(_0x5f3b3b){if(_0x5f3b3b[_0x17a258(0x285)]==='turnStarted'){_0x149109=!0x0,_0x1b7f60=!0x0,_0x5de3c7=void 0x0;return;}if(_0x5f3b3b['kind']===_0x17a258(0x2a9)){_0x149109=!0x1,_0x1b7f60=!0x1,_0x5de3c7=void 0x0;return;}_0x149109&&(_0x1b7f60=!0x0,_0x5f3b3b[_0x17a258(0x285)]===_0x17a258(0x241)&&_0x5f3b3b[_0x17a258(0x2c9)]&&(_0x5de3c7=_0x5f3b3b['text']));}});}catch(_0x56425e){return _0x56425e['code']!==_0x39b7f1(0x198)&&En['warn']({'filePath':_0x3b7cda,'error':String(_0x56425e)},_0x39b7f1(0x290)),{};}return!_0x149109||!_0x1b7f60?{}:{'isResponding':!0x0,..._0x5de3c7?{'partialReplyText':_0x5de3c7}:{}};}var nt=require('node:path');function rt(_0x428c4b){return(0x0,nt['basename'])(_0x428c4b,'.jsonl')||null;}function st(_0x278996){const _0x3eba75=_0x472560;return(0x0,nt['basename'])(_0x278996,_0x3eba75(0x2c8))[_0x3eba75(0x2b1)](/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[0x1]??null;}function R(_0x20bd1d,_0x100fac){return _0x20bd1d==='claude'?rt(_0x100fac):st(_0x100fac);}var Ea=S[_0x472560(0x24b)]({'module':_0x472560(0x2d4)}),G=new Map(),_n=0x2710;function Ee(_0x157982,_0xa1a6ab){return _0x157982+':'+_0xa1a6ab;}function xs(_0x246a20,_0x151b9f){const _0x52bd95=_0x472560;return _0x246a20[_0x52bd95(0x176)]===_0x151b9f[_0x52bd95(0x176)]&&_0x246a20['mtimeMs']===_0x151b9f[_0x52bd95(0x2bf)]&&_0x246a20[_0x52bd95(0x183)]===_0x151b9f[_0x52bd95(0x183)];}function ot(_0x5c34ac,_0x42161f,_0x412746){const _0x32ebbf=_0x472560;let _0x2fbc17=Ee(_0x42161f,_0x5c34ac),_0x213f3b=G['get'](_0x2fbc17);if(_0x213f3b){if(!xs(_0x213f3b,_0x412746)){G[_0x32ebbf(0x17c)](_0x2fbc17);return;}return _0x213f3b[_0x32ebbf(0x1f4)]=Date[_0x32ebbf(0x27e)](),_0x213f3b[_0x32ebbf(0x25e)];}}function Cs(){const _0x3138ee=_0x472560;if(G[_0x3138ee(0x176)]<=_n)return;let _0x477433=[...G[_0x3138ee(0x1e1)]()]['sort']((_0x240c17,_0x434d22)=>_0x240c17[0x1][_0x3138ee(0x1f4)]-_0x434d22[0x1][_0x3138ee(0x1f4)]),_0x5588dc=G['size']-_n;for(let _0x587679=0x0;_0x587679<_0x5588dc;_0x587679+=0x1){let _0x5d50f2=_0x477433[_0x587679]?.[0x0];_0x5d50f2&&G['delete'](_0x5d50f2);}}function it(_0x1175c8,_0xe9c1f0,_0xe3d167,_0x3995a7){const _0x5828e8=_0x472560;G['set'](Ee(_0xe9c1f0,_0x1175c8),{'size':_0xe3d167[_0x5828e8(0x176)],'mtimeMs':_0xe3d167[_0x5828e8(0x2bf)],'birthtimeMs':_0xe3d167['birthtimeMs'],'value':_0x3995a7,'lastUsedAt':Date['now']()}),Cs();}async function at(_0x4d8330,_0x4b9202){const _0x1654cd=_0x472560;let _0x2ed952,_0x6b27ee,_0xb02265=await Ze(_0x4d8330,_0x4b9202);for(let _0x506612 of _0xb02265['split']('\x0a')){if(!_0x506612[_0x1654cd(0x2dd)]())continue;let _0xe4f71f;try{_0xe4f71f=JSON['parse'](_0x506612);}catch{continue;}let _0x4e45e7=sn(_0xe4f71f);_0x4e45e7&&(_0x2ed952=_0x4e45e7);let _0x3dcace=on(_0xe4f71f);_0x3dcace&&(_0x6b27ee=_0x3dcace);}return{'approvalMode':_0x2ed952,'lastUsage':_0x6b27ee};}async function lt(_0x43088d,_0x2cffd4){const _0x5bb654=_0x472560;let _0x4a923c,_0x410a3f,_0x407de3=await Ze(_0x43088d,_0x2cffd4);for(let _0x29be60 of _0x407de3['split']('\x0a')){if(!_0x29be60['trim']())continue;let _0x59fdef;try{_0x59fdef=JSON[_0x5bb654(0x172)](_0x29be60);}catch{continue;}let _0x2a5223=rn(_0x59fdef);_0x2a5223&&(_0x4a923c=_0x2a5223);let _0x394245=an(_0x59fdef);_0x394245&&(_0x410a3f=_0x394245);}return{'approvalMode':_0x4a923c,'lastUsage':_0x410a3f};}var Da=S[_0x472560(0x24b)]({'module':'inventory'});function Fn(_0x5642ba='high',_0x3598bb='resumeSession'){return{'state':'idle','confidence':_0x5642ba,'resumeMode':_0x3598bb};}var ut=S[_0x472560(0x24b)]({'module':'scanner'}),Pe=0x7530,tl=ne(Pe),nl=ne(Pe),rl=ne(Pe),Re=ne(Pe),ct=new Map(),dt=new Map();function Nn(_0x4a1dbf){const _0x162a91=_0x472560;let _0x209206='codex-latest:'+(0x0,Z[_0x162a91(0x23d)])(),_0x3cf57=new Map();for(let _0x1ec3f4 of _0x4a1dbf)_0x3cf57['has'](_0x1ec3f4['cwd'])||_0x3cf57['set'](_0x1ec3f4['cwd'],_0x1ec3f4['match']);Re['set'](_0x209206,_0x3cf57);}function Ts(_0xf226f9){const _0x46cbdc=_0x472560;let _0x2aac71=(0x0,v['basename'])(_0xf226f9[_0x46cbdc(0x281)])[_0x46cbdc(0x2b1)](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x2aac71){let _0x526b7e=Date['parse'](_0x2aac71[0x1]+':'+_0x2aac71[0x2]+':'+_0x2aac71[0x3]);if(Number['isFinite'](_0x526b7e))return _0x526b7e;}return _0xf226f9[_0x46cbdc(0x183)];}function kn(_0xb2978e){const _0xbd1c88=_0x472560;return _0xb2978e?.[_0xbd1c88(0x2dd)]()||void 0x0;}function As(_0x5bce8a){const _0x4445d0=_0x472560;if(_0x5bce8a[_0x4445d0(0x238)]!==_0x4445d0(0x175))return null;let _0x2654bf=_0x5bce8a[_0x4445d0(0x268)]?.[_0x4445d0(0x20e)],_0x197eac=typeof _0x2654bf==_0x4445d0(0x2d8)&&_0x2654bf!==null&&Object['hasOwn'](_0x2654bf,'subagent'),_0x6ef44=kn(_0x5bce8a['payload']?.[_0x4445d0(0x255)])||(_0x197eac?kn(_0x2654bf['subagent']?.['thread_spawn']?.['parent_thread_id']):void 0x0);return!_0x6ef44&&!_0x197eac?null:_0x6ef44?{'parentSessionId':_0x6ef44}:{};}function Dn(_0x35ccee){const _0x2d647e=_0x472560;for(let _0x523ccb of de(_0x35ccee,0x60)){let _0x74a1d8;try{_0x74a1d8=JSON[_0x2d647e(0x172)](_0x523ccb);}catch{continue;}if(_0x74a1d8['type']===_0x2d647e(0x175))return As(_0x74a1d8);}return null;}async function ws(_0xc13a13,_0x552a25){const _0xed27e2=_0x472560;if(_0x552a25){let _0x4b988b=ot(_0xc13a13,'codex',_0x552a25);if(_0x4b988b!==void 0x0)return _0x4b988b?{'cwd':_0x4b988b['cwd'],'sessionId':_0x4b988b['sessionId']}:null;}let _0x3e1cda=_0x552a25??await(0x0,P['stat'])(_0xc13a13)['catch'](()=>null);if(!_0x3e1cda)return null;try{let _0x1698c9=await Me(_0xc13a13,_0x3e1cda[_0xed27e2(0x176)]);if(Dn(_0x1698c9))return null;let _0x2a52f2='',_0x3903f5='';for(let _0x4fd1bf of de(_0x1698c9,0x60)){let _0x378e05;try{_0x378e05=JSON[_0xed27e2(0x172)](_0x4fd1bf);}catch{continue;}if(_0x2a52f2||(_0x2a52f2=_0x378e05[_0xed27e2(0x268)]?.['cwd']??_0x378e05['cwd']??''),_0x3903f5||(_0x3903f5=_0x378e05['payload']?.['id']??_0x378e05['id']??''),_0x2a52f2&&_0x3903f5)break;}return _0x2a52f2?{'cwd':_0x2a52f2,'sessionId':_0x3903f5||R(_0xed27e2(0x17e),_0xc13a13)||(0x0,v[_0xed27e2(0x1a7)])(_0xc13a13,_0xed27e2(0x2c8))}:null;}catch{return null;}}function Un(_0x3ac11f,_0x4dfb38='scanner'){const _0x2fb710=_0x472560;return{'sessionId':_0x3ac11f[_0x2fb710(0x191)],'agent':_0x3ac11f['agent'],'cwd':_0x3ac11f[_0x2fb710(0x2cc)],..._0x3ac11f['originCwd']?{'originCwd':_0x3ac11f['originCwd']}:{},..._0x3ac11f[_0x2fb710(0x2ae)]?{'model':_0x3ac11f[_0x2fb710(0x2ae)]}:{},..._0x3ac11f[_0x2fb710(0x196)]?{'effort':_0x3ac11f[_0x2fb710(0x196)]}:{},'title':_0x3ac11f[_0x2fb710(0x1e7)],..._0x3ac11f[_0x2fb710(0x2cb)]?.[_0x2fb710(0x20a)]?{'titleAliases':_0x3ac11f['titleAliases']}:{},..._0x3ac11f[_0x2fb710(0x269)]?{'customTitle':_0x3ac11f['customTitle']}:{},..._0x3ac11f[_0x2fb710(0x28f)]?{'originator':_0x3ac11f[_0x2fb710(0x28f)]}:{},...typeof _0x3ac11f['externalArchived']==_0x2fb710(0x297)?{'externalArchived':_0x3ac11f[_0x2fb710(0x202)]}:{},'observedApprovalMode':_0x3ac11f[_0x2fb710(0x2cd)],'lastUsage':_0x3ac11f['lastUsage'],'createdAt':_0x3ac11f['createdAt'],'lastActivityAt':_0x3ac11f['lastActivityAt'],'sources':[_0x4dfb38],'runtime':Fn()};}async function Ln(_0xe4843d,_0x4e9b60){const _0x47045e=_0x472560;let _0x472efb=await Me(_0xe4843d,_0x4e9b60),_0x4517cf=de(_0x472efb,0x40),_0x2d7edb='',_0x2fc777='',_0xd5b69f,_0x5f168f,_0x5e6409;for(let _0x9a1b93 of _0x4517cf){let _0x427bfa;try{_0x427bfa=JSON['parse'](_0x9a1b93);}catch{continue;}if(!_0x2d7edb&&typeof _0x427bfa['cwd']=='string'&&(_0x2d7edb=_0x427bfa['cwd']),!_0x2fc777&&typeof _0x427bfa['sessionId']==_0x47045e(0x1cb)&&(_0x2fc777=_0x427bfa[_0x47045e(0x191)]),_0xd5b69f||(_0xd5b69f=k([_0x427bfa[_0x47045e(0x269)],_0x427bfa['summary']])),!_0x5e6409){let _0x22afe9=j(_0x427bfa),_0x65bd97=k([],_0x22afe9);_0x65bd97&&(_0x5f168f=_0x22afe9,_0x5e6409=_0x65bd97);}if(_0x2d7edb&&(_0xd5b69f||_0x5e6409))break;}if(!_0x2d7edb)return null;let _0x54c733=await lt(_0xe4843d,_0x4e9b60);return{'sessionId':_0x2fc777||R(_0x47045e(0x24c),_0xe4843d)||(0x0,v['basename'])(_0xe4843d,_0x47045e(0x2c8)),'cwd':_0x2d7edb,'title':_0xd5b69f??_0x5e6409??k([],_0x5f168f),'approvalMode':_0x54c733[_0x47045e(0x2cd)],'lastUsage':_0x54c733['lastUsage']};}async function bs(_0x4209ec,_0x586edf){const _0x3ea5ef=_0x472560;let _0x29ec9e=await Me(_0x4209ec,_0x586edf);if(Dn(_0x29ec9e))return null;let _0x57b184=de(_0x29ec9e,0x60),_0x4d6746='',_0x16c1e3='',_0x54d65e,_0x8072f8,_0x5e7723,_0x575199;for(let _0xf785cd of _0x57b184){let _0x3b70e7;try{_0x3b70e7=JSON['parse'](_0xf785cd);}catch{continue;}if(_0x4d6746||(_0x4d6746=_0x3b70e7['payload']?.[_0x3ea5ef(0x2cc)]??_0x3b70e7['cwd']??''),_0x16c1e3||(_0x16c1e3=_0x3b70e7['payload']?.['id']??_0x3b70e7['id']??''),!_0x575199&&typeof _0x3b70e7[_0x3ea5ef(0x268)]?.['originator']==_0x3ea5ef(0x1cb)&&(_0x575199=_0x3b70e7['payload']['originator']),_0x54d65e||(_0x54d65e=k([_0x3b70e7[_0x3ea5ef(0x268)]?.['title'],_0x3b70e7['title']])),!_0x5e7723){let _0x49ae7b=ue(_0x3b70e7),_0x4d34f6=_0x49ae7b&&!z(_0x49ae7b)?k([],_0x49ae7b):void 0x0;_0x4d34f6&&(_0x8072f8=_0x49ae7b,_0x5e7723=_0x4d34f6);}if(_0x4d6746&&(_0x54d65e||_0x5e7723))break;}if(!_0x4d6746)return null;let _0x4b4869=await at(_0x4209ec,_0x586edf),_0x178230=_0x16c1e3||R('codex',_0x4209ec)||(0x0,v[_0x3ea5ef(0x1a7)])(_0x4209ec,_0x3ea5ef(0x2c8)),_0x5b11e2=_0x54d65e??_0x5e7723??k([],_0x8072f8);return{'sessionId':_0x178230,'cwd':_0x4d6746,'title':_0x5b11e2,'approvalMode':_0x4b4869['approvalMode'],'lastUsage':_0x4b4869[_0x3ea5ef(0x1fe)],'originator':_0x575199};}async function vs(_0x1ebae4,_0x528bb9,_0x5676d8){const _0x31ece6=_0x472560;return _e(_0x528bb9)[_0x31ece6(0x1bf)](_0x1ebae4,_0x5676d8[_0x31ece6(0x176)]);}async function Is(_0x329856,_0x264c20,_0x224164){const _0x2976c1=_0x472560;let _0x143af2=ot(_0x329856,_0x264c20,_0x224164);if(_0x143af2!==void 0x0)return _0x143af2;let _0x243ff5=Ee(_0x264c20,_0x329856)+':'+_0x224164['size']+':'+_0x224164[_0x2976c1(0x2bf)]+':'+_0x224164['birthtimeMs'],_0xec9b7e=dt['get'](_0x243ff5);return _0xec9b7e||(_0xec9b7e=(async()=>{try{let _0x3e3c5d=await vs(_0x329856,_0x264c20,_0x224164);return it(_0x329856,_0x264c20,_0x224164,_0x3e3c5d),_0x3e3c5d;}catch{return it(_0x329856,_0x264c20,_0x224164,null),null;}})()['finally'](()=>{const _0x44ce96=_0x2976c1;dt[_0x44ce96(0x17c)](_0x243ff5);}),dt['set'](_0x243ff5,_0xec9b7e)),_0xec9b7e;}function Ms(_0x23f3a9,_0x290950,_0x51ce10,_0x2bfb86){const _0xc1552=_0x472560;let _0x4cf321={'sessionId':_0x23f3a9[_0xc1552(0x191)],'agent':_0x23f3a9['agent'],'cwd':_0x23f3a9['cwd'],'title':_0x23f3a9[_0xc1552(0x1e7)],'approvalMode':_0x23f3a9[_0xc1552(0x2cd)],'lastUsage':_0x23f3a9[_0xc1552(0x1fe)],'originator':_0x23f3a9['originator'],'createdAt':new Date(_0x51ce10['birthtimeMs'])['toISOString'](),'lastActivityAt':new Date(_0x51ce10['mtimeMs'])[_0xc1552(0x1a6)](),'filePath':_0x290950};if(_0x23f3a9[_0xc1552(0x295)]!=='codex')return _0x4cf321;let _0x3a05e0=hn(_0x2bfb86,_0x23f3a9[_0xc1552(0x191)],_0x290950),_0x4a09f5=Sn(_0x2bfb86,_0x23f3a9[_0xc1552(0x191)],_0x290950),_0x5279d9=_0x3a05e0&&_0x23f3a9['title']&&_0x3a05e0!==_0x23f3a9['title']?[_0x23f3a9['title']]:void 0x0;return{..._0x4cf321,'title':_0x3a05e0??_0x23f3a9['title'],..._0x5279d9?{'titleAliases':_0x5279d9}:{},...typeof _0x4a09f5=='boolean'?{'externalArchived':_0x4a09f5}:{}};}async function ft(_0x3af3b3,_0xb1ece6,_0x596bcc,_0x45fbb3){const _0x429622=_0x472560;let _0x2bfd4e=await Is(_0x3af3b3,_0xb1ece6,_0x596bcc);if(!_0x2bfd4e)return null;let _0x15c493=_0xb1ece6===_0x429622(0x17e)?_0x45fbb3??await Ie():void 0x0;return Ms(_0x2bfd4e,_0x3af3b3,_0x596bcc,_0x15c493);}async function On(_0x2da8d3,_0x1cb67b){const _0x2c4853=_0x472560;let _0x5cb5e0=await(0x0,P[_0x2c4853(0x276)])(_0x2da8d3)['catch'](()=>null);return _0x5cb5e0?.['isFile']()?ft(_0x2da8d3,_0x1cb67b,{'size':_0x5cb5e0[_0x2c4853(0x176)],'mtimeMs':_0x5cb5e0['mtimeMs'],'birthtimeMs':_0x5cb5e0['birthtimeMs']}):null;}async function $n(_0x4c418d,_0x285d01={}){const _0x5620ef=_0x472560;if(!_0x4c418d)return null;let _0x330391=typeof _0x285d01['createdAfterMs']==_0x5620ef(0x271)?_0x285d01['createdAfterMs']:null,_0x108220=_0x5620ef(0x1eb)+(0x0,Z[_0x5620ef(0x23d)])(),_0x1bf0bc=_0x330391===null?Re['get'](_0x108220):null;if(_0x1bf0bc&&_0x330391===null){let _0x360989=_0x1bf0bc[_0x5620ef(0x27b)](_0x4c418d);if(_0x1bf0bc['has'](_0x4c418d))return _0x360989?{'sessionId':_0x360989[_0x5620ef(0x191)],'filePath':_0x360989['path']}:null;}let _0x47d130=_0x330391===null?_0x4c418d:_0x4c418d+':'+_0x330391,_0x4fb0d0=ct['get'](_0x47d130);_0x4fb0d0||(_0x4fb0d0=(async()=>{const _0x38a11a=_0x5620ef;let _0x248d27=(await oe())[_0x38a11a(0x29c)](_0x37fabf=>_0x330391===null||Ts(_0x37fabf)>=_0x330391),_0x418de1=_e('codex');for(let _0x17889d=0x0;_0x17889d<_0x248d27['length'];_0x17889d+=b){let _0x55cd9d=_0x248d27['slice'](_0x17889d,_0x17889d+b),_0x268654=(await Promise[_0x38a11a(0x227)](_0x55cd9d[_0x38a11a(0x2e0)](async _0x3752d7=>{const _0x4d347a=_0x38a11a;let _0x334d44=await _0x418de1[_0x4d347a(0x1d1)](_0x3752d7['path'],_0x3752d7);return _0x334d44?{'entry':_0x3752d7,'meta':_0x334d44}:null;})))[_0x38a11a(0x219)](_0x59ac47=>_0x59ac47?.['meta']['cwd']===_0x4c418d);if(_0x268654)return{'path':_0x268654['entry'][_0x38a11a(0x281)],'mtimeMs':_0x268654['entry']['mtimeMs'],'sessionId':_0x268654[_0x38a11a(0x1ba)][_0x38a11a(0x191)]};}return null;})()[_0x5620ef(0x1b3)](()=>{const _0x5a4d14=_0x5620ef;ct[_0x5a4d14(0x17c)](_0x47d130);}),ct['set'](_0x47d130,_0x4fb0d0));let _0x64d0a9=await _0x4fb0d0;if(_0x330391!==null)return _0x64d0a9?{'sessionId':_0x64d0a9[_0x5620ef(0x191)],'filePath':_0x64d0a9['path']}:null;let _0x43df70=Re['get'](_0x108220)??_0x1bf0bc??new Map();return _0x43df70[_0x5620ef(0x2a1)](_0x4c418d,_0x64d0a9),Re['set'](_0x108220,_0x43df70),_0x64d0a9?{'sessionId':_0x64d0a9[_0x5620ef(0x191)],'filePath':_0x64d0a9[_0x5620ef(0x281)]}:null;}async function pt(_0x4931e7,_0x55d5e7){const _0x3c191c=_0x472560;let _0x4d99b7=(0x0,v[_0x3c191c(0x24a)])((0x0,Z[_0x3c191c(0x23d)])(),_0x3c191c(0x239),'projects'),_0xb661f1=_0x55d5e7?un(_0x55d5e7):null,_0x49d455=await(0x0,P[_0x3c191c(0x2d5)])(_0x4d99b7)['catch'](()=>[]),_0x330d33=_0xb661f1?[_0xb661f1,..._0x49d455[_0x3c191c(0x29c)](_0x53d4e0=>_0x53d4e0!==_0xb661f1)]:_0x49d455;for(let _0xe273c9 of _0x330d33){let _0x5255cd=(0x0,v[_0x3c191c(0x24a)])(_0x4d99b7,_0xe273c9,_0x4931e7+'.jsonl');if((await(0x0,P['stat'])(_0x5255cd)[_0x3c191c(0x211)](()=>null))?.['isFile']())return _0x5255cd;}return null;}async function Es(_0x4d0818,_0x44b7a1){const _0x64c468=_0x472560;let _0x116393=await pt(_0x4d0818,_0x44b7a1);if(!_0x116393)return;let _0x44e76e=await(0x0,P['stat'])(_0x116393)['catch'](()=>null);return _0x44e76e?.['isFile']()?(await lt(_0x116393,_0x44e76e[_0x64c468(0x176)]))['lastUsage']:void 0x0;}async function Rs(_0x2c8050){const _0x115e80=_0x472560;let _0x140039=(0x0,v[_0x115e80(0x24a)])((0x0,Z[_0x115e80(0x23d)])(),'.codex',_0x115e80(0x1e4)),_0x1ac754=await mt(_0x140039,_0x2c8050);if(!_0x1ac754)return;let _0x55d43a=await(0x0,P['stat'])(_0x1ac754)[_0x115e80(0x211)](()=>null);return _0x55d43a?.[_0x115e80(0x298)]()?(await at(_0x1ac754,_0x55d43a['size']))[_0x115e80(0x1fe)]:void 0x0;}async function Ps(_0x556d8a,_0x18189a,_0x20dd81){return _e(_0x18189a)['resolveSessionFilePath'](_0x556d8a,_0x20dd81);}async function Wn(_0x5c4d09,_0x4f3caf){const _0x540acb=_0x472560;return _e(_0x4f3caf)[_0x540acb(0x2b4)](_0x5c4d09);}function Y(_0xa5da61,_0x2e2cb8,_0x56876f){const _0x13d382=_0x472560;let _0x361ef6=Tn(_0x2e2cb8);if(_0x56876f?.[_0x13d382(0x22c)]&&_0x361ef6['role']===_0x13d382(0x241)){let _0x4c26ad=_0xa5da61[_0xa5da61['length']-0x1];if(_0x4c26ad?.[_0x13d382(0x259)]===_0x13d382(0x241)&&_0x4c26ad[_0x13d382(0x238)]!==_0x13d382(0x1dc)&&_0x361ef6['type']!=='info'&&!Rt(_0x4c26ad['content'])&&(_0x361ef6['content']===_0x4c26ad['content']||_0x361ef6[_0x13d382(0x265)]['startsWith'](_0x4c26ad['content']))){_0xa5da61[_0xa5da61[_0x13d382(0x20a)]-0x1]=_0x361ef6;return;}}_0xa5da61[_0x13d382(0x20d)](_0x361ef6);}async function _s(_0x5cde5d,_0x5c865a){const _0x3ea88c=_0x472560;let _0x3ac1ac=[];try{let _0xe51800=await pt(_0x5cde5d,_0x5c865a);if(_0xe51800){let _0x18e301=new Map();await H(_0xe51800,_0x249681=>{const _0x43c7cb=_0x1516;if(_0x249681['type']==='assistant'&&_0x249681['message']?.['role']==='assistant'&&Array['isArray'](_0x249681['message']['content']))for(let _0x58580e of _0x249681[_0x43c7cb(0x233)][_0x43c7cb(0x265)]){if(!_0x58580e||typeof _0x58580e!=_0x43c7cb(0x2d8)||_0x58580e['type']!=='tool_use'||typeof _0x58580e['id']!=_0x43c7cb(0x1cb))continue;let _0x3e6a1c=typeof _0x58580e['name']==_0x43c7cb(0x1cb)?_0x58580e[_0x43c7cb(0x28e)]:null,_0xdf3244=_0x58580e['input']&&typeof _0x58580e[_0x43c7cb(0x26b)]=='object'?_0x58580e['input']:null,_0x34bfe0=Pt(_0x3e6a1c,_0xdf3244,_0x5c865a);_0x34bfe0&&_0x18e301['set'](_0x58580e['id'],_0x34bfe0);}if(_0x249681[_0x43c7cb(0x238)]===_0x43c7cb(0x1b6)&&_0x249681['message']?.[_0x43c7cb(0x259)]==='user'){if(Array['isArray'](_0x249681['message']['content']))for(let _0xd78c63 of _0x249681['message']['content']){if(!_0xd78c63||typeof _0xd78c63!='object'||_0xd78c63['type']!==_0x43c7cb(0x1f6))continue;if(_0xd78c63['is_error']===!0x0){let _0x3701b9=et(_0xd78c63[_0x43c7cb(0x265)]),_0x518083=bn(_0x3701b9);_0x518083&&Y(_0x3ac1ac,vn(_0x518083,tt(_0x249681)));continue;}let _0xa9846a=typeof _0xd78c63['tool_use_id']==_0x43c7cb(0x1cb)?_0xd78c63[_0x43c7cb(0x1ec)]:'',_0x1ef33e=_0xa9846a?_0x18e301[_0x43c7cb(0x27b)](_0xa9846a):void 0x0;if(!_0x1ef33e)continue;let _0x271238=et(_0xd78c63['content']);if(!_t(_0x249681[_0x43c7cb(0x223)],_0x271238))continue;let _0x572453=We([_0x1ef33e]);_0x572453&&Y(_0x3ac1ac,q({'role':'assistant','content':_0x572453},_0x249681));}let _0x4219d6=j(_0x249681);if(_0x4219d6){let _0xfbe6e8=typeof _0x249681[_0x43c7cb(0x214)]==_0x43c7cb(0x1cb)&&_0x249681['parentUuid']?_0x249681['parentUuid']:null;Y(_0x3ac1ac,q({'role':_0x43c7cb(0x1b6),'content':_0x4219d6,...typeof _0x249681[_0x43c7cb(0x2a2)]==_0x43c7cb(0x1cb)&&_0x249681['uuid']?{'rewindPoint':{'provider':'claude','messageId':_0xfbe6e8}}:{}},_0x249681));}}else{if(_0x249681['type']===_0x43c7cb(0x241)&&_0x249681['message']?.[_0x43c7cb(0x259)]==='assistant'){let _0x6793c2=B(_0x249681[_0x43c7cb(0x233)][_0x43c7cb(0x265)]);_0x6793c2&&Y(_0x3ac1ac,q({'role':'assistant','content':_0x6793c2},_0x249681));}}});}}catch(_0x100378){ut[_0x3ea88c(0x29e)]({'error':String(_0x100378)},_0x3ea88c(0x1ad));}return _0x3ac1ac;}async function Fs(_0x28e020,_0x582385){const _0x553034=_0x472560;let _0x1fb93a=[];try{let _0x3c0815=await Ps(_0x28e020,_0x553034(0x17e),_0x582385);if(_0x3c0815){let _0x1b3b63;await H(_0x3c0815,_0x2cca9d=>{const _0x4d4864=_0x553034;_0x2cca9d['type']==='event_msg'&&_0x2cca9d[_0x4d4864(0x268)]?.[_0x4d4864(0x238)]==='task_started'&&(_0x1b3b63=typeof _0x2cca9d['payload'][_0x4d4864(0x2a0)]=='string'&&_0x2cca9d['payload'][_0x4d4864(0x2a0)]?_0x2cca9d['payload']['turn_id']:void 0x0);let _0x2a7834=Ft(_0x2cca9d,{'cwd':_0x582385,'includePatchCalls':!0x0}),_0x5f0340=We(_0x2a7834);if(_0x5f0340&&Y(_0x1fb93a,q({'role':'assistant','content':_0x5f0340},_0x2cca9d)),_0x2cca9d['type']!==_0x4d4864(0x280)||_0x2cca9d['payload']?.[_0x4d4864(0x238)]!=='message')return;let _0x275104=_0x2cca9d[_0x4d4864(0x268)][_0x4d4864(0x259)];if(_0x275104!=='user'&&_0x275104!==_0x4d4864(0x241))return;let _0x1923c5=L(_0x2cca9d[_0x4d4864(0x268)]['content']);_0x1923c5&&(_0x275104==='user'&&z(_0x1923c5)||Y(_0x1fb93a,q({'role':_0x275104,'content':_0x1923c5,..._0x275104==='user'&&_0x1b3b63?{'rewindPoint':{'provider':_0x4d4864(0x17e),'turnId':_0x1b3b63}}:{}},_0x2cca9d),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0x17fa39){ut[_0x553034(0x29e)]({'error':String(_0x17fa39)},'failed\x20to\x20read\x20codex\x20session\x20history');}return _0x1fb93a;}var ks={'claude':{'agent':_0x472560(0x24c),'extractSessionIdFromFile':rt,async 'readFileMeta'(_0x441b53,_0x30af2d){let _0x50dbf0=await Ln(_0x441b53,_0x30af2d);return _0x50dbf0?{..._0x50dbf0,'agent':'claude'}:null;},async 'readSessionCwdAndId'(_0x462481,_0x588dee){const _0x1b77c3=_0x472560;let _0x21e6ed=_0x588dee??await(0x0,P['stat'])(_0x462481)[_0x1b77c3(0x211)](()=>null);if(!_0x21e6ed)return null;let _0x37fe19=await Ln(_0x462481,_0x21e6ed['size']);return _0x37fe19?{'cwd':_0x37fe19['cwd'],'sessionId':_0x37fe19['sessionId']}:null;},'resolveSessionFilePath':pt,'readLastUsage':Es,'readRuntimeHintsFromFile':Rn,'readHistory':_s},'codex':{'agent':'codex','extractSessionIdFromFile':st,async 'readFileMeta'(_0x285f62,_0x54734d){const _0x50c2f4=_0x472560;let _0x139160=await bs(_0x285f62,_0x54734d);return _0x139160?{..._0x139160,'agent':_0x50c2f4(0x17e)}:null;},'readSessionCwdAndId':ws,async 'resolveSessionFilePath'(_0x342281){const _0x5cc60f=_0x472560;let _0x2d5825=(0x0,v[_0x5cc60f(0x24a)])((0x0,Z[_0x5cc60f(0x23d)])(),'.codex',_0x5cc60f(0x1e4));return mt(_0x2d5825,_0x342281);},'readLastUsage':Rs,'readRuntimeHintsFromFile':Pn,'readHistory':Fs}};function _e(_0x381d99){return ks[_0x381d99];}async function mt(_0x777679,_0x5d3171){const _0x405b14=_0x472560;try{let _0x91b58=await(0x0,P['readdir'])(_0x777679,{'withFileTypes':!0x0});for(let _0x1e9834 of _0x91b58){let _0x149f85=(0x0,v['join'])(_0x777679,_0x1e9834[_0x405b14(0x28e)]);if(_0x1e9834[_0x405b14(0x2e2)]()){let _0x190b8d=await mt(_0x149f85,_0x5d3171);if(_0x190b8d)return _0x190b8d;}else{if(_0x1e9834['name'][_0x405b14(0x2a3)](_0x5d3171)&&_0x1e9834['name'][_0x405b14(0x2e6)](_0x405b14(0x2c8)))return _0x149f85;}}}catch(_0x407ac5){ut['warn']({'error':String(_0x407ac5)},_0x405b14(0x1b7));}return null;}var Ls=0x40;function gt(_0x3eec64){const _0x14d611=_0x472560;return _0x3eec64[_0x14d611(0x176)]+':'+_0x3eec64['mtimeMs']+':'+_0x3eec64[_0x14d611(0x183)];}function Ns(_0x5291ed){const _0x1839f5=_0x472560;return _0x5291ed[_0x1839f5(0x2e0)](_0x332608=>_0x332608['path']+'\x00'+gt(_0x332608))['sort']()['join']('\x0a');}async function Ds(){const _0x4339a2=_0x472560;let [_0x1fe713,_0x49ac12,_0x31624b,_0x3f912c]=await Promise[_0x4339a2(0x227)]([He(),oe(),se(),(0x0,Hn[_0x4339a2(0x276)])((0x0,jn[_0x4339a2(0x24a)])((0x0,Bn['homedir'])(),'.codex','state_5.sqlite'))['catch'](()=>null)]),[_0x14201a,_0x17131c]=await Promise[_0x4339a2(0x227)]([J(_0x1fe713),J(_0x31624b)]);return{'claudeFiles':_0x14201a,'codexFiles':_0x49ac12,'claudeMetadataFingerprint':Ns(_0x17131c),'codexMetadataFingerprint':_0x3f912c?.['isFile']()?_0x3f912c['size']+':'+_0x3f912c['mtimeMs']+':'+_0x3f912c['birthtimeMs']:''};}async function Us(_0x3af140,_0x57d6a2,_0xee006a){const _0x10ccab=_0x472560;let _0x18f31c=await ft(_0x3af140['path'],_0x57d6a2,_0x3af140,_0x57d6a2==='codex'?_0xee006a[_0x10ccab(0x17e)]:void 0x0);if(!_0x18f31c)return null;let _0x388691=_0x57d6a2==='claude'?Ge(_0x18f31c,_0xee006a['claude'][_0x10ccab(0x1c5)]['get'](_0x18f31c[_0x10ccab(0x191)])):_0x18f31c;return Un(_0x388691);}var Os={'collectContext':Ds,'loadClaudeLookup':qe,'loadCodexLookup':async _0x1a8985=>(_0x1a8985&&Xe(),Ie()),'readSession':Us,'updateLatestCodexCache':Nn},Fe=class{constructor(_0x113e82=Os,_0x159fc2=Ls){const _0x120165=_0x472560;this['dependencies']=_0x113e82,this[_0x120165(0x1e6)]=_0x159fc2;}['entries']=new Map();['claudeMetadataFingerprint']=null;['codexMetadataFingerprint']=null;['claudeLookup']=null;['codexLookup']=null;async[_0x472560(0x2d7)](_0x15aa0c){const _0x2a0bfe=_0x472560;let _0x1af58c=await this['dependencies'][_0x2a0bfe(0x1fa)](),_0x1457ce=this[_0x2a0bfe(0x1a2)]===null||this[_0x2a0bfe(0x1a2)]!==_0x1af58c[_0x2a0bfe(0x1a2)],_0x55bc2a=this['codexMetadataFingerprint']===null||this['codexMetadataFingerprint']!==_0x1af58c['codexMetadataFingerprint'],[_0x226c38,_0x4b9df6]=await Promise['all']([_0x1457ce||!this[_0x2a0bfe(0x1fd)]?this[_0x2a0bfe(0x1fc)]['loadClaudeLookup']():Promise['resolve'](this[_0x2a0bfe(0x1fd)]),_0x55bc2a||!this['codexLookup']?this['dependencies'][_0x2a0bfe(0x275)](this[_0x2a0bfe(0x23b)]!==null):Promise['resolve'](this['codexLookup'])]),_0x6eb47b={'claude':_0x226c38,'codex':_0x4b9df6},_0x2ad172=[..._0x1af58c['claudeFiles']['map'](_0x321070=>({'agent':_0x2a0bfe(0x24c),'entry':_0x321070})),..._0x1af58c[_0x2a0bfe(0x1ef)][_0x2a0bfe(0x2e0)](_0x4347a7=>({'agent':_0x2a0bfe(0x17e),'entry':_0x4347a7}))][_0x2a0bfe(0x263)]((_0x2e31db,_0x3c612c)=>_0x3c612c[_0x2a0bfe(0x1c0)]['mtimeMs']-_0x2e31db[_0x2a0bfe(0x1c0)][_0x2a0bfe(0x2bf)]),_0x11aca5=new Set(_0x2ad172[_0x2a0bfe(0x2e0)](({entry:_0x3d886d})=>_0x3d886d[_0x2a0bfe(0x281)])),_0x23dbce=[...this['entries'][_0x2a0bfe(0x174)]()][_0x2a0bfe(0x29c)](_0x362ba0=>!_0x11aca5['has'](_0x362ba0))[_0x2a0bfe(0x20a)],_0xaa3202=new Map(),_0x4b3e56=_0x2ad172[_0x2a0bfe(0x29c)](({agent:_0x101a3e,entry:_0x379950})=>{const _0x2074e1=_0x2a0bfe;let _0x5e65f0=this[_0x2074e1(0x1e1)]['get'](_0x379950['path']);return!(_0x101a3e==='claude'?_0x1457ce:_0x55bc2a)&&_0x5e65f0?.['fingerprint']===gt(_0x379950)?(_0xaa3202[_0x2074e1(0x2a1)](_0x379950['path'],_0x5e65f0),!0x1):!0x0;}),_0x245b8d=0x0,_0x12ea97=Math['max'](0x1,this['batchSize']);for(let _0x4758f3=0x0;_0x4758f3<_0x4b3e56[_0x2a0bfe(0x20a)];_0x4758f3+=_0x12ea97){let _0x11aa4c=_0x4b3e56['slice'](_0x4758f3,_0x4758f3+_0x12ea97),_0x459f3e=await _(_0x11aa4c,b,({agent:_0xdb0b41,entry:_0x2cf22d})=>this[_0x2a0bfe(0x1fc)][_0x2a0bfe(0x181)](_0x2cf22d,_0xdb0b41,_0x6eb47b));for(let _0x8eaac2=0x0;_0x8eaac2<_0x11aa4c['length'];_0x8eaac2+=0x1){let _0x9b47b5=_0x11aa4c[_0x8eaac2];_0xaa3202[_0x2a0bfe(0x2a1)](_0x9b47b5[_0x2a0bfe(0x1c0)]['path'],{'fingerprint':gt(_0x9b47b5[_0x2a0bfe(0x1c0)]),'session':_0x459f3e[_0x8eaac2]});}_0x245b8d+=_0x11aa4c['length'],_0x15aa0c?.({'processedFiles':_0x245b8d,'changedFiles':_0x4b3e56['length'],'totalFiles':_0x2ad172['length'],'removedFiles':_0x23dbce});}let _0x3e8699=[..._0xaa3202[_0x2a0bfe(0x257)]()]['map'](_0x2799d2=>_0x2799d2[_0x2a0bfe(0x18e)])['filter'](_0x2cd264=>_0x2cd264!==null)['sort']((_0x1fe78b,_0x2dfddd)=>_0x2dfddd['lastActivityAt']['localeCompare'](_0x1fe78b['lastActivityAt']));return this['dependencies'][_0x2a0bfe(0x23f)](_0x2ad172[_0x2a0bfe(0x29c)](({agent:_0x3988ed})=>_0x3988ed==='codex')[_0x2a0bfe(0x2e0)](({entry:_0x280396})=>{const _0x2e2345=_0x2a0bfe;let _0x550ede=_0xaa3202['get'](_0x280396[_0x2e2345(0x281)])?.[_0x2e2345(0x18e)];return _0x550ede?{'cwd':_0x550ede[_0x2e2345(0x2cc)],'match':{'path':_0x280396['path'],'mtimeMs':_0x280396[_0x2e2345(0x2bf)],'sessionId':_0x550ede[_0x2e2345(0x191)]}}:null;})['filter'](_0xaaf7ba=>_0xaaf7ba!==null)),this[_0x2a0bfe(0x1e1)]=_0xaa3202,this[_0x2a0bfe(0x1fd)]=_0x226c38,this['codexLookup']=_0x4b9df6,this[_0x2a0bfe(0x1a2)]=_0x1af58c[_0x2a0bfe(0x1a2)],this['codexMetadataFingerprint']=_0x1af58c[_0x2a0bfe(0x23b)],{'sessions':_0x3e8699,'changedFiles':_0x4b3e56['length'],'reusedFiles':_0x2ad172[_0x2a0bfe(0x20a)]-_0x4b3e56[_0x2a0bfe(0x20a)],'removedFiles':_0x23dbce,'totalFiles':_0x2ad172['length']};}},tr=require('node:child_process'),he=require('node:fs/promises'),bt=require(_0x472560(0x22b)),me=require('node:path'),nr=require('node:util'),ht=class{[_0x472560(0x282)]=new Map();['timers']=new Map();['gauges']=new Map();['startTime']=Date['now']();['logInterval']=null;[_0x472560(0x1f8)](_0x3422a3,_0x53ef71={}){const _0x50fbdc=_0x472560;this[_0x50fbdc(0x282)][_0x50fbdc(0x19a)](_0x3422a3)||this[_0x50fbdc(0x282)]['set'](_0x3422a3,[]);let _0x79e8fe=this['counters'][_0x50fbdc(0x27b)](_0x3422a3),_0x41b8cb=JSON['stringify'](_0x53ef71),_0x45fae1=_0x79e8fe[_0x50fbdc(0x219)](_0x4ca336=>JSON[_0x50fbdc(0x2de)](_0x4ca336['labels'])===_0x41b8cb);_0x45fae1?_0x45fae1['value']++:_0x79e8fe['push']({'value':0x1,'labels':_0x53ef71});}['gauge'](_0x3d25c6,_0x141f21){const _0x2a240f=_0x472560;this[_0x2a240f(0x1db)][_0x2a240f(0x2a1)](_0x3d25c6,_0x141f21);}['startTimer'](_0x31f617){const _0x4d9046=_0x472560;let _0x1907d1=performance[_0x4d9046(0x27e)]();return()=>{const _0x27d89a=_0x4d9046;let _0x330841=Math['round'](performance[_0x27d89a(0x27e)]()-_0x1907d1),_0x3318e7=this[_0x27d89a(0x222)][_0x27d89a(0x27b)](_0x31f617)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0x3318e7['count']++,_0x3318e7['totalMs']+=_0x330841,_0x3318e7[_0x27d89a(0x2c1)]=Math['min'](_0x3318e7['minMs'],_0x330841),_0x3318e7['maxMs']=Math[_0x27d89a(0x2e4)](_0x3318e7[_0x27d89a(0x2b6)],_0x330841),_0x3318e7[_0x27d89a(0x1c8)]=_0x330841,this['timers'][_0x27d89a(0x2a1)](_0x31f617,_0x3318e7),_0x330841;};}[_0x472560(0x29d)](){const _0x164abd=_0x472560;let _0x56b7dc={};for(let [_0x502dd4,_0x4e66e1]of this[_0x164abd(0x282)])_0x56b7dc[_0x502dd4]=_0x4e66e1[_0x164abd(0x2e0)](_0x5b1b9b=>({..._0x5b1b9b}));let _0x1e63ab={};for(let [_0x15ff3e,_0x2f11dd]of this['timers'])_0x1e63ab[_0x15ff3e]={..._0x2f11dd,'minMs':_0x2f11dd[_0x164abd(0x2c1)]===0x1/0x0?0x0:_0x2f11dd[_0x164abd(0x2c1)]};let _0xc161dc={};for(let [_0x47c489,_0xaa6e5a]of this['gauges'])_0xc161dc[_0x47c489]=_0xaa6e5a;return{'uptimeMs':Date['now']()-this['startTime'],'counters':_0x56b7dc,'timers':_0x1e63ab,'gauges':_0xc161dc};}[_0x472560(0x1ee)](_0x1d0872=0xea60){const _0x5d6a47=_0x472560;this[_0x5d6a47(0x26d)]||(this['logInterval']=setInterval(()=>{const _0x15f15f=_0x5d6a47;let _0x53bfc8=this[_0x15f15f(0x29d)]();S['info']({'metrics':_0x53bfc8},_0x15f15f(0x1ac));},_0x1d0872),this[_0x5d6a47(0x26d)][_0x5d6a47(0x22e)]());}[_0x472560(0x1be)](){const _0x1a5d98=_0x472560;this[_0x1a5d98(0x26d)]&&(clearInterval(this['logInterval']),this['logInterval']=null);}},V=new ht(),hl=S[_0x472560(0x24b)]({'module':'process-scanner'}),St=require(_0x472560(0x2a5)),$s=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,Ws=new Set(['sh',_0x472560(0x1cf),'zsh',_0x472560(0x200)]),Hs=new Set([_0x472560(0x1af),_0x472560(0x2d9),'timeout',_0x472560(0x23c)]),Bs=new Set(['node','nodejs','bun','tsx']),js=new Set(['-e','--eval','-p','--print']),zs=new Set(['-r',_0x472560(0x1a0),'--import',_0x472560(0x254),_0x472560(0x2ab),'--env-file','--input-type']);function _0x1516(_0x1ac293,_0x37672e){_0x1ac293=_0x1ac293-0x172;const _0x144cc8=_0x144c();let _0x1516c5=_0x144cc8[_0x1ac293];if(_0x1516['Zkwsov']===undefined){var _0x176073=function(_0x35ee0a){const _0x284e9a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x51101d='',_0x578947='';for(let _0x1c10f6=0x0,_0x10c446,_0x3d965c,_0x99ee85=0x0;_0x3d965c=_0x35ee0a['charAt'](_0x99ee85++);~_0x3d965c&&(_0x10c446=_0x1c10f6%0x4?_0x10c446*0x40+_0x3d965c:_0x3d965c,_0x1c10f6++%0x4)?_0x51101d+=String['fromCharCode'](0xff&_0x10c446>>(-0x2*_0x1c10f6&0x6)):0x0){_0x3d965c=_0x284e9a['indexOf'](_0x3d965c);}for(let _0x1758c2=0x0,_0x40924e=_0x51101d['length'];_0x1758c2<_0x40924e;_0x1758c2++){_0x578947+='%'+('00'+_0x51101d['charCodeAt'](_0x1758c2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x578947);};_0x1516['vjYlOw']=_0x176073,_0x1516['cgjFIA']={},_0x1516['Zkwsov']=!![];}const _0x57bbe2=_0x144cc8[0x0],_0x5d2ffc=_0x1ac293+_0x57bbe2,_0x4103b2=_0x1516['cgjFIA'][_0x5d2ffc];return!_0x4103b2?(_0x1516c5=_0x1516['vjYlOw'](_0x1516c5),_0x1516['cgjFIA'][_0x5d2ffc]=_0x1516c5):_0x1516c5=_0x4103b2,_0x1516c5;}function qs(_0x3609b4){const _0x4fbcd6=_0x472560;return _0x3609b4[_0x4fbcd6(0x2c6)](/^['"]|['"]$/g,'');}function qn(_0x935173){return(_0x935173['match'](/"[^"]*"|'[^']*'|\S+/g)??[])['map'](qs);}function zn(_0x2ed8a7){const _0x44de39=_0x472560;let _0x4fb986=(0x0,St[_0x44de39(0x1a7)])(_0x2ed8a7);return _0x4fb986==='claude'||_0x4fb986==='codex'?_0x4fb986:null;}function Gs(_0x53ab46){const _0xa2d07e=_0x472560;for(let _0x45d248 of _0x53ab46[_0xa2d07e(0x235)](/&&|\|\||;|\n/)){let _0x34deab=Gn(qn(_0x45d248[_0xa2d07e(0x2dd)]()),!0x0);if(_0x34deab)return _0x34deab;}return null;}function Gn(_0x217c23,_0x1f60d9=!0x1){const _0x2659ac=_0x472560;let _0x585b59=0x0;for(;_0x585b59<_0x217c23[_0x2659ac(0x20a)];){let _0x455c73=_0x217c23[_0x585b59],_0x55badd=(0x0,St[_0x2659ac(0x1a7)])(_0x455c73);if(Hs[_0x2659ac(0x19a)](_0x55badd)){if(_0x585b59+=0x1,_0x55badd==='env'){for(;_0x585b59<_0x217c23[_0x2659ac(0x20a)]&&/^[A-Za-z_][A-Za-z0-9_]*=/[_0x2659ac(0x18d)](_0x217c23[_0x585b59]);)_0x585b59+=0x1;}else{if(_0x55badd===_0x2659ac(0x1d9)||_0x55badd==='gtimeout'){for(;_0x585b59<_0x217c23['length']&&_0x217c23[_0x585b59][_0x2659ac(0x232)]('-');){let _0x758e8b=_0x217c23[_0x585b59];_0x585b59+=0x1,_0x758e8b==='-k'&&_0x585b59<_0x217c23['length']&&(_0x585b59+=0x1);}_0x585b59<_0x217c23['length']&&(_0x585b59+=0x1);}}continue;}if(Ws[_0x2659ac(0x19a)](_0x55badd)){for(let _0x382cc9=_0x585b59+0x1;_0x382cc9<_0x217c23[_0x2659ac(0x20a)];_0x382cc9+=0x1){let _0x3ad9d8=_0x217c23[_0x382cc9];if(['-c',_0x2659ac(0x1d6),'-ic',_0x2659ac(0x221),'-ec','-xec']['includes'](_0x3ad9d8)){let _0x16e083=_0x217c23[_0x382cc9+0x1];return _0x16e083?Gs(_0x16e083):null;}}return null;}if(Bs[_0x2659ac(0x19a)](_0x55badd)){let _0x15e13b=_0x585b59+0x1;for(;_0x15e13b<_0x217c23[_0x2659ac(0x20a)];){let _0x577f07=_0x217c23[_0x15e13b];if(js[_0x2659ac(0x19a)](_0x577f07))return null;if(_0x577f07==='--'){_0x15e13b+=0x1;break;}if(!_0x577f07['startsWith']('-'))break;_0x15e13b+=0x1,zs['has'](_0x577f07)&&_0x15e13b<_0x217c23['length']&&(_0x15e13b+=0x1);}if(_0x15e13b>=_0x217c23['length'])return null;let _0x315ff2=zn(_0x217c23[_0x15e13b]);return _0x315ff2?{'agent':_0x315ff2,'args':_0x217c23[_0x2659ac(0x274)](_0x15e13b+0x1),'viaWrapper':!0x0}:null;}let _0x313dbf=zn(_0x455c73);return _0x313dbf?{'agent':_0x313dbf,'args':_0x217c23[_0x2659ac(0x274)](_0x585b59+0x1),'viaWrapper':_0x1f60d9}:null;}return null;}function yt(_0x370ab7,_0x3d0ae4=!0x1){return Gn(qn(_0x370ab7),_0x3d0ae4);}function fe(_0x1f8c06){const _0x22b2ad=_0x472560;let _0x259439=yt(_0x1f8c06);return _0x259439?{'agent':_0x259439['agent'],'args':_0x259439[_0x22b2ad(0x258)]}:null;}function Le(_0x4ae44b){return $s['test'](_0x4ae44b)&&yt(_0x4ae44b)!==null;}function Vn(_0x49d575,_0x7c98e0){const _0x16df39=_0x472560;let _0xb6a7ce=fe(_0x7c98e0);if(!_0xb6a7ce||_0xb6a7ce['agent']!==_0x49d575)return null;let {args:_0x28fcb5}=_0xb6a7ce;if(_0x49d575==='claude'){for(let _0x2f208f=0x0;_0x2f208f<_0x28fcb5[_0x16df39(0x20a)];_0x2f208f+=0x1){let _0x2d8552=_0x28fcb5[_0x2f208f];if((_0x2d8552==='--resume'||_0x2d8552==='--session-id')&&_0x28fcb5[_0x2f208f+0x1]&&!_0x28fcb5[_0x2f208f+0x1][_0x16df39(0x232)]('-'))return _0x28fcb5[_0x2f208f+0x1];if(_0x2d8552[_0x16df39(0x232)]('--resume='))return _0x2d8552['slice'](0x9);if(_0x2d8552[_0x16df39(0x232)](_0x16df39(0x250)))return _0x2d8552['slice'](0xd);}return null;}return _0x28fcb5[0x0]!=='resume'?null:_0x28fcb5['slice'](0x1)['find'](_0x15d292=>!_0x15d292['startsWith']('-'))??null;}function Vs(_0x716781,_0x1ce47d){const _0x1c1a17=_0x472560;let _0x41dacf=fe(_0x1ce47d);if(!(!_0x41dacf||_0x41dacf['agent']!==_0x716781)){if(_0x716781==='codex')return _0x41dacf[_0x1c1a17(0x258)]['includes']('--dangerously-bypass-approvals-and-sandbox')?'autoApprove':void 0x0;if(_0x41dacf['args']['includes'](_0x1c1a17(0x208)))return'autoApprove';for(let _0x59806e=0x0;_0x59806e<_0x41dacf['args']['length'];_0x59806e+=0x1){let _0x562425=_0x41dacf[_0x1c1a17(0x258)][_0x59806e],_0xfe2265=_0x562425==='--permission-mode'?_0x41dacf['args'][_0x59806e+0x1]:_0x562425['startsWith'](_0x1c1a17(0x224))?_0x562425['slice'](0x12):void 0x0;if(_0xfe2265===_0x1c1a17(0x289))return'plan';if(_0xfe2265==='acceptEdits')return _0x1c1a17(0x28d);if(_0xfe2265==='default')return'normal';}}}function xt(_0xb28003,_0x49059c){const _0x5dc4f2=_0x472560;let _0x2ee94d=yt(_0x49059c);return!_0x2ee94d||_0x2ee94d[_0x5dc4f2(0x295)]!==_0xb28003||_0x2ee94d['viaWrapper']?!0x1:_0xb28003==='claude'?!_0x2ee94d['args'][_0x5dc4f2(0x2a3)](_0x5dc4f2(0x286))&&!_0x2ee94d['args']['includes']('-c'):!(_0x2ee94d['args'][0x0]==='app-server'&&!_0x2ee94d['args'][_0x5dc4f2(0x2a3)]('--listen')&&!_0x2ee94d['args']['some'](_0x553796=>_0x553796[_0x5dc4f2(0x232)](_0x5dc4f2(0x296))));}function ke(_0x2292da){const _0x1f14e9=_0x472560;return _0x2292da==='high'?0x3:_0x2292da===_0x1f14e9(0x2d2)?0x2:0x1;}function Qs(_0x4e652f,_0x5e5de0){const _0x14fdaf=_0x472560;return _0x4e652f===_0x14fdaf(0x24c)?_0x5e5de0[_0x14fdaf(0x2a3)]('/.claude/projects/')&&!_0x5e5de0[_0x14fdaf(0x2a3)](_0x14fdaf(0x21e)):_0x5e5de0['includes']('/.codex/sessions/');}function Ct(_0x2a338b){const _0xe28994=_0x472560;let _0x7a19e0=[...new Set(_0x2a338b['sessionFiles'])]['filter'](_0x416b13=>Qs(_0x2a338b[_0xe28994(0x295)],_0x416b13)),_0x56a798=Vn(_0x2a338b[_0xe28994(0x295)],_0x2a338b[_0xe28994(0x243)]),_0x5e469f=Vs(_0x2a338b['agent'],_0x2a338b['command']);if(_0x56a798)return{'agent':_0x2a338b['agent'],'pid':_0x2a338b['pid'],'cwd':_0x2a338b['cwd'],'command':_0x2a338b[_0xe28994(0x243)],'sessionId':_0x56a798,'confidence':'high',..._0x5e469f?{'approvalMode':_0x5e469f}:{},..._0x7a19e0['length']===0x1?{'sessionFilePath':_0x7a19e0[0x0]}:{}};if(_0x7a19e0[_0xe28994(0x20a)]!==0x1)return null;let _0x10b309=R(_0x2a338b[_0xe28994(0x295)],_0x7a19e0[0x0]);return _0x10b309?{'agent':_0x2a338b[_0xe28994(0x295)],'pid':_0x2a338b['pid'],'cwd':_0x2a338b['cwd'],'command':_0x2a338b['command'],'sessionId':_0x10b309,'confidence':_0xe28994(0x2d2),..._0x5e469f?{'approvalMode':_0x5e469f}:{},'sessionFilePath':_0x7a19e0[0x0]}:null;}function Js(_0x98c35e,_0x2a92bb){const _0x421519=_0x472560;let _0x1c7d07=_0x98c35e,_0x20a378=_0x2a92bb;(ke(_0x2a92bb['confidence'])>ke(_0x98c35e['confidence'])||ke(_0x2a92bb[_0x421519(0x247)])===ke(_0x98c35e['confidence'])&&_0x2a92bb[_0x421519(0x2a8)]!==void 0x0&&_0x98c35e['pid']!==void 0x0&&_0x2a92bb['pid']<_0x98c35e['pid'])&&(_0x1c7d07=_0x2a92bb,_0x20a378=_0x98c35e);let _0x4689e1=_0x1c7d07['approvalMode']??_0x20a378[_0x421519(0x2cd)],_0x25ac0a=_0x1c7d07[_0x421519(0x1e7)]??_0x20a378['title'],_0x4ec6ba=_0x1c7d07['sessionFilePath']??_0x20a378[_0x421519(0x2d1)],_0x559e11=_0x1c7d07['isResponding']??_0x20a378['isResponding'],_0xe6d103=_0x1c7d07[_0x421519(0x225)]??_0x20a378[_0x421519(0x225)],_0x43bad5={..._0x1c7d07,'cwd':_0x1c7d07[_0x421519(0x2cc)]||_0x20a378[_0x421519(0x2cc)],..._0x4689e1?{'approvalMode':_0x4689e1}:{}};return _0x25ac0a!==void 0x0&&(_0x43bad5[_0x421519(0x1e7)]=_0x25ac0a),_0x4ec6ba!==void 0x0&&(_0x43bad5[_0x421519(0x2d1)]=_0x4ec6ba),_0x559e11!==void 0x0&&(_0x43bad5['isResponding']=_0x559e11),_0xe6d103!==void 0x0&&(_0x43bad5['terminal']=_0xe6d103),_0x43bad5;}function Tt(_0x6a2f0f){const _0x16e888=_0x472560;let _0x1f12e4=new Map();for(let _0x3037ad of _0x6a2f0f){let _0x4d0f10=_0x3037ad[_0x16e888(0x295)]+':'+_0x3037ad['sessionId'],_0x2a8b1e=_0x1f12e4['get'](_0x4d0f10);_0x1f12e4['set'](_0x4d0f10,_0x2a8b1e?Js(_0x2a8b1e,_0x3037ad):_0x3037ad);}return[..._0x1f12e4[_0x16e888(0x257)]()];}var Ne=require('node:fs/promises'),Kn=require(_0x472560(0x22b)),At=require(_0x472560(0x2a5));function Xn(){const _0x1d6e2d=_0x472560;return(0x0,At['join'])((0x0,Kn[_0x1d6e2d(0x23d)])(),_0x1d6e2d(0x239),'sessions');}function Qn(_0xb00b68){const _0x247f6f=_0x472560;let _0x21b52f=typeof _0xb00b68==_0x247f6f(0x271)?_0xb00b68:typeof _0xb00b68==_0x247f6f(0x1cb)?Number(_0xb00b68):Number['NaN'];return Number['isFinite'](_0x21b52f)&&_0x21b52f>0x0?_0x21b52f:void 0x0;}function Jn(_0x53ac4c){const _0x4ea169=_0x472560;return _0x53ac4c[_0x4ea169(0x2c5)]??_0x53ac4c['startedAt']??0x0;}function Yn(_0x275e48){switch(_0x275e48){case'busy':case'responding':return!0x0;case'idle':return!0x1;default:return;}}async function Ks(_0x2b25bb=Xn()){const _0x4ad788=_0x472560;return(await(0x0,Ne['readdir'])(_0x2b25bb,{'withFileTypes':!0x0})[_0x4ad788(0x211)](()=>[]))['filter'](_0x2d116b=>_0x2d116b['isFile']()&&_0x2d116b['name'][_0x4ad788(0x2e6)](_0x4ad788(0x192)))[_0x4ad788(0x2e0)](_0xf87f61=>(0x0,At[_0x4ad788(0x24a)])(_0x2b25bb,_0xf87f61['name']));}async function Xs(_0x1d7dd6){const _0x538a2d=_0x472560;try{let _0x313b66=JSON[_0x538a2d(0x172)](await(0x0,Ne['readFile'])(_0x1d7dd6,_0x538a2d(0x27a))),_0x57a4ac=T(_0x313b66[_0x538a2d(0x191)]);if(!_0x57a4ac)return;let _0x268136={'sessionId':_0x57a4ac},_0x401fed=T(_0x313b66['cwd']),_0x52e8e6=T(_0x313b66['status']),_0x533ccb=Qn(_0x313b66['startedAt']),_0x1ad4a0=Qn(_0x313b66[_0x538a2d(0x2c5)]);return _0x401fed&&(_0x268136['cwd']=_0x401fed),_0x52e8e6&&(_0x268136['status']=_0x52e8e6),_0x533ccb&&(_0x268136['startedAt']=_0x533ccb),_0x1ad4a0&&(_0x268136['updatedAt']=_0x1ad4a0),_0x268136;}catch{return;}}async function Zn(_0x4782ab,_0x5a6ffe=Xn()){const _0x4cf09b=_0x472560;if(!_0x4782ab)return;let _0x4344ed=await Ks(_0x5a6ffe),_0x543dbf=await _(_0x4344ed,b,Xs),_0x486f79;for(let _0x34b354 of _0x543dbf)!_0x34b354||_0x34b354[_0x4cf09b(0x191)]!==_0x4782ab||(!_0x486f79||Jn(_0x34b354)>Jn(_0x486f79))&&(_0x486f79=_0x34b354);return _0x486f79;}var Zs=(0x0,nr['promisify'])(tr['execFile']),wt=S[_0x472560(0x24b)]({'module':_0x472560(0x246)}),rr=0xbb8,eo=0x3e8,to=0xfa0,er=0x3,no=0x1f4,ro=0x3a98,ge=null,pe=null;function sr(){ge=null;}function so(_0x4bb563,_0x112c46=Date[_0x472560(0x27e)]()){return _0x112c46-_0x4bb563<to;}function oo(_0x4afe4d){const _0x453b60=_0x472560;try{return process[_0x453b60(0x2e1)](_0x4afe4d,0x0),!0x0;}catch{return!0x1;}}async function De(_0x405a96,_0x30091a,_0x24da28=eo){const _0xcd4280=_0x472560;try{let {stdout:_0x3adeae}=await Zs(_0x405a96,_0x30091a,{'killSignal':process[_0xcd4280(0x199)]==='win32'?'SIGTERM':'SIGKILL','maxBuffer':0x800000,'timeout':_0x24da28,'windowsHide':!0x0});return _0x3adeae;}catch(_0x293425){let _0x40acdc=typeof _0x293425=='object'&&_0x293425!==null?{'code':_0xcd4280(0x217)in _0x293425?_0x293425[_0xcd4280(0x217)]:void 0x0,'signal':_0xcd4280(0x25f)in _0x293425?_0x293425['signal']:void 0x0,'killed':'killed'in _0x293425?_0x293425['killed']:void 0x0}:{},_0x1dd26a=String(_0x293425);return _0x1dd26a[_0xcd4280(0x2a3)]('ESRCH')||_0x1dd26a['includes']('No\x20such\x20process')?wt['debug']({'file':_0x405a96,'args':_0x30091a,'timeoutMs':_0x24da28,'error':_0x1dd26a,..._0x40acdc},'process\x20scan\x20command\x20skipped\x20—\x20process\x20exited'):wt[_0xcd4280(0x29e)]({'file':_0x405a96,'args':_0x30091a,'timeoutMs':_0x24da28,'error':_0x1dd26a,..._0x40acdc},'process\x20scan\x20command\x20failed'),'';}}async function io(_0x236041){const _0x1ce03c=_0x472560;let _0x127c77=_0x236041;if(_0x236041['sessionFilePath']){let _0x3713e9=await On(_0x236041[_0x1ce03c(0x2d1)],_0x236041['agent']);if(!_0x3713e9)return null;let _0x1de062=await Wn(_0x236041['sessionFilePath'],_0x236041['agent']),_0x27fef5=_0x3713e9['approvalMode']??_0x236041[_0x1ce03c(0x2cd)];_0x127c77={..._0x236041,'cwd':_0x236041['cwd']||_0x3713e9[_0x1ce03c(0x2cc)],..._0x27fef5?{'approvalMode':_0x27fef5}:{},'title':_0x236041[_0x1ce03c(0x1e7)]??_0x3713e9['title'],'isResponding':_0x1de062['isResponding']};}if(_0x127c77['agent']!==_0x1ce03c(0x24c))return _0x127c77;let _0x19db98=await Zn(_0x127c77[_0x1ce03c(0x191)]);if(!_0x19db98)return _0x127c77;let _0x5a7f4d=Yn(_0x19db98['status']);return{..._0x127c77,'cwd':_0x127c77[_0x1ce03c(0x2cc)]||_0x19db98['cwd']||'','isResponding':_0x5a7f4d??_0x127c77[_0x1ce03c(0x17d)]};}async function ao(_0x280999){const _0xe242f=_0x472560;return process['platform']===_0xe242f(0x2dc)?'':(await De(_0xe242f(0x1c4),['-a','-p',String(_0x280999),'-d','cwd','-Fn']))['split']('\x0a')[_0xe242f(0x219)](_0x3f1dd8=>_0x3f1dd8['startsWith']('n'))?.['slice'](0x1)['trim']()??'';}async function lo(_0x15ead7){const _0xf8e0a0=_0x472560;if(process['platform']==='win32')return[];let _0x346594=(await De('lsof',['-p',String(_0x15ead7),'-Fn']))['split']('\x0a')['filter'](_0x59934b=>_0x59934b['startsWith']('n'))[_0xf8e0a0(0x2e0)](_0x55a577=>_0x55a577['slice'](0x1)[_0xf8e0a0(0x2dd)]())['filter'](_0x37a104=>_0x37a104[_0xf8e0a0(0x2e6)]('.jsonl')?_0x37a104[_0xf8e0a0(0x2a3)]('/.claude/projects/')||_0x37a104['includes']('/.codex/sessions/'):!0x1);return[...new Set(_0x346594)];}function co(_0x52dd5f){const _0x36ab2e=_0x472560;return _0x52dd5f[_0x36ab2e(0x235)]('\x0a')[_0x36ab2e(0x2e0)](_0x46ef2a=>_0x46ef2a['trim']())[_0x36ab2e(0x29c)](Boolean)[_0x36ab2e(0x2e0)](_0x1dae39=>{const _0x3e6d10=_0x36ab2e;let _0x3e199c=_0x1dae39['match'](/^(\d+)\s+(.*)$/);if(!_0x3e199c)return null;let _0xc3fef5=Number(_0x3e199c[0x1]),_0x573d56=_0x3e199c[0x2];if(!Le(_0x573d56))return null;let _0x1ee444=fe(_0x573d56);return!Number[_0x3e6d10(0x1df)](_0xc3fef5)||!_0x1ee444?null:{'pid':_0xc3fef5,'command':_0x573d56,'agent':_0x1ee444['agent']};})['filter'](_0x13cad4=>!!_0x13cad4);}async function uo(){const _0x36bd82=_0x472560;let _0x2a880d=await De('ps',[_0x36bd82(0x188),'pid=,command='],rr);return co(_0x2a880d);}async function fo(){const _0x36af49=_0x472560;return(await De('wmic',[_0x36af49(0x1a4),_0x36af49(0x27b),'ProcessId,CommandLine','/FORMAT:CSV'],rr))[_0x36af49(0x235)]('\x0a')[_0x36af49(0x2e0)](_0x4cf923=>_0x4cf923[_0x36af49(0x2dd)]())[_0x36af49(0x29c)](Boolean)['map'](_0x2319b7=>{const _0x4afdfa=_0x36af49;let _0x5bf87b=_0x2319b7['split'](',');if(_0x5bf87b['length']<0x3)return null;let _0x702b40=Number(_0x5bf87b[_0x5bf87b['length']-0x1]),_0x2f69c9=_0x5bf87b['slice'](0x1,_0x5bf87b[_0x4afdfa(0x20a)]-0x1)[_0x4afdfa(0x24a)](',');if(!Number[_0x4afdfa(0x1df)](_0x702b40)||_0x702b40===0x0||!Le(_0x2f69c9))return null;let _0x4c7898=fe(_0x2f69c9);return _0x4c7898?{'pid':_0x702b40,'command':_0x2f69c9,'agent':_0x4c7898['agent']}:null;})[_0x36af49(0x29c)](_0x17ea60=>!!_0x17ea60);}async function po(){const _0x2d14b0=_0x472560;return process['platform']===_0x2d14b0(0x2dc)?fo():uo();}async function mo(_0xb94d12){const _0x428b54=_0x472560;let _0x2960ed=Date[_0x428b54(0x27e)](),_0x48da27=V['startTimer'](_0x428b54(0x18a)),_0x3580ac=await po();_0xb94d12&&(_0xb94d12[_0x428b54(0x244)]+=_0x48da27()),_0xb94d12&&(_0xb94d12[_0x428b54(0x288)]=_0x3580ac[_0x428b54(0x20a)]);let _0x3d35b5=_0x3580ac['filter'](_0x319fdb=>oo(_0x319fdb['pid']));_0xb94d12&&(_0xb94d12['aliveProcesses']=_0x3d35b5[_0x428b54(0x20a)]);let _0x4e8064=V['startTimer'](_0x428b54(0x1d8)),_0x435df1=[];for(let _0x2cfa20=0x0;_0x2cfa20<_0x3d35b5['length'];_0x2cfa20+=er){if(!so(_0x2960ed)){_0xb94d12&&(_0xb94d12[_0x428b54(0x2b9)]+=_0x3d35b5[_0x428b54(0x20a)]-_0x2cfa20);break;}let _0x139e24=_0x3d35b5[_0x428b54(0x274)](_0x2cfa20,_0x2cfa20+er),_0x509097=await Promise['all'](_0x139e24[_0x428b54(0x2e0)](async _0x88d7d7=>{const _0x6c8ccc=_0x428b54;let [_0x4ccb9c,_0x4f9455]=await Promise[_0x6c8ccc(0x227)]([ao(_0x88d7d7['pid']),lo(_0x88d7d7[_0x6c8ccc(0x2a8)])]);return{'pid':_0x88d7d7['pid'],'agent':_0x88d7d7['agent'],'command':_0x88d7d7['command'],'cwd':_0x4ccb9c,'sessionFiles':_0x4f9455};}));_0x435df1['push'](..._0x509097);}return _0xb94d12&&(_0xb94d12[_0x428b54(0x1b2)]+=_0x4e8064()),_0xb94d12&&(_0xb94d12[_0x428b54(0x26a)]=_0x435df1['length']),_0x435df1;}function or(_0x455d68){const _0xfcc8cb=_0x472560;return _0x455d68[_0xfcc8cb(0x2c6)](/[^a-zA-Z0-9]/g,'-');}async function go(_0x5ac191,_0x5afe58){const _0x2a88b0=_0x472560;if(!_0x5afe58)return null;try{if(_0x5ac191==='claude'){let _0x4fdd5e=(0x0,me['join'])((0x0,bt[_0x2a88b0(0x23d)])(),_0x2a88b0(0x239),'projects',or(_0x5afe58)),_0x1bd1bd=(await(0x0,he[_0x2a88b0(0x2d5)])(_0x4fdd5e)['catch'](()=>[]))['filter'](_0x5d3602=>_0x5d3602[_0x2a88b0(0x2e6)](_0x2a88b0(0x2c8)));if(_0x1bd1bd[_0x2a88b0(0x20a)]===0x0)return null;let _0xb6635d=null;if(await Promise['all'](_0x1bd1bd[_0x2a88b0(0x2e0)](async _0x3e74b3=>{const _0x36aa16=_0x2a88b0;let _0xb135d3=await(0x0,he['stat'])((0x0,me['join'])(_0x4fdd5e,_0x3e74b3))[_0x36aa16(0x211)](()=>null);_0xb135d3&&(!_0xb6635d||_0xb135d3['mtimeMs']>_0xb6635d[_0x36aa16(0x2bf)])&&(_0xb6635d={'name':_0x3e74b3,'mtimeMs':_0xb135d3['mtimeMs']});})),!_0xb6635d)return null;let _0x1cec67=(0x0,me['join'])(_0x4fdd5e,_0xb6635d[_0x2a88b0(0x28e)]),_0x4e81cf=R(_0x5ac191,_0x1cec67);return _0x4e81cf?{'sessionId':_0x4e81cf,'filePath':_0x1cec67}:null;}return $n(_0x5afe58);}catch{return null;}}async function ho(_0x31ec3e,_0x3e41cc,_0x3dbf3b){const _0x544271=_0x472560;if(!_0x3e41cc||!_0x3dbf3b)return null;try{if(_0x31ec3e==='claude'){let _0x3ee546=(0x0,me[_0x544271(0x24a)])((0x0,bt['homedir'])(),'.claude',_0x544271(0x25a),or(_0x3e41cc),_0x3dbf3b+'.jsonl');return(await(0x0,he['stat'])(_0x3ee546)[_0x544271(0x211)](()=>null))?.[_0x544271(0x298)]()?_0x3ee546:null;}return null;}catch{return null;}}async function So(_0x3b6b42){if(_0x3b6b42['sessionFilePath']||_0x3b6b42['confidence']!=='high')return _0x3b6b42;let _0x36b697=await ho(_0x3b6b42['agent'],_0x3b6b42['cwd'],_0x3b6b42['sessionId']);return _0x36b697?{..._0x3b6b42,'sessionFilePath':_0x36b697}:_0x3b6b42;}async function yo(){const _0x423698=_0x472560;let _0x23f6b6={'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},_0x255f28=V[_0x423698(0x2c0)](_0x423698(0x1f7)),_0x43dbe8=await mo(_0x23f6b6),_0x566005=[],_0x434244=[];for(let _0xb50f54 of _0x43dbe8){let _0x17b56f=Ct(_0xb50f54);if(_0x17b56f){_0x566005['push'](_0x17b56f);continue;}xt(_0xb50f54['agent'],_0xb50f54[_0x423698(0x243)])&&_0x434244['push'](_0xb50f54);}_0x23f6b6[_0x423698(0x207)]=_0x566005[_0x423698(0x20a)],_0x23f6b6['fallbackLookups']=_0x434244['length'];let _0x5e9cd4=V[_0x423698(0x2c0)](_0x423698(0x28c)),_0x5bbb74=await Promise['all'](_0x434244[_0x423698(0x2e0)](async _0x143027=>{const _0x308270=_0x423698;let _0x575a17=await go(_0x143027['agent'],_0x143027[_0x308270(0x2cc)]);return _0x575a17?{'agent':_0x143027['agent'],'pid':_0x143027['pid'],'cwd':_0x143027['cwd'],'command':_0x143027['command'],'sessionId':_0x575a17['sessionId'],'confidence':_0x308270(0x190),'sessionFilePath':_0x575a17[_0x308270(0x213)]}:null;}));_0x23f6b6['fallbackMs']=_0x5e9cd4(),_0x23f6b6[_0x423698(0x1e8)]=_0x5bbb74['filter'](_0x1e3c78=>_0x1e3c78!==null)[_0x423698(0x20a)];let _0x5d5d9a=V['startTimer']('process.scan.hydrate_ms'),_0x1a7e9c=await Promise['all']([..._0x566005,..._0x5bbb74[_0x423698(0x29c)](_0x58387f=>_0x58387f!==null)][_0x423698(0x2e0)](_0x4d2798=>So(_0x4d2798))),_0x454145=await Promise[_0x423698(0x227)](_0x1a7e9c[_0x423698(0x2e0)](_0x32017b=>io(_0x32017b)));_0x23f6b6[_0x423698(0x179)]=_0x5d5d9a(),_0x23f6b6['hydratedCandidates']=_0x454145['filter'](_0x2a24b0=>_0x2a24b0!==null)['length'];let _0x251907=Tt(_0x454145['filter'](_0x4893c7=>_0x4893c7!==null));return _0x23f6b6[_0x423698(0x1bd)]=_0x255f28(),(_0x23f6b6['totalMs']>=no||_0x23f6b6['fallbackLookups']>0x0)&&wt['info']({'durationMs':_0x23f6b6[_0x423698(0x1bd)],'pgrepMs':_0x23f6b6[_0x423698(0x244)],'lsofMs':_0x23f6b6['lsofMs'],'fallbackMs':_0x23f6b6['fallbackMs'],'hydrateMs':_0x23f6b6['hydrateMs'],'matchedProcesses':_0x23f6b6[_0x423698(0x288)],'aliveProcesses':_0x23f6b6[_0x423698(0x2aa)],'snapshots':_0x23f6b6['snapshots'],'skippedProcessDetails':_0x23f6b6[_0x423698(0x2b9)]||void 0x0,'directCandidates':_0x23f6b6['directCandidates'],'fallbackLookups':_0x23f6b6['fallbackLookups'],'fallbackHits':_0x23f6b6[_0x423698(0x1e8)],'hydratedCandidates':_0x23f6b6['hydratedCandidates'],'sessions':_0x251907[_0x423698(0x20a)]},_0x423698(0x197)),ge={'value':_0x251907,'expiresAt':Date['now']()+ro},_0x251907;}async function ir(){const _0xce6dd6=_0x472560;return ge&&Date[_0xce6dd6(0x27e)]()<ge['expiresAt']?ge['value']:pe||(pe=yo()['finally'](()=>{pe=null;}),pe);}if(!vt['parentPort'])throw new Error(_0x472560(0x1fb));var Ue=vt[_0x472560(0x2e9)],xo=S[_0x472560(0x24b)]({'module':_0x472560(0x2d6)}),Co=new Fe(),ar=0x40;function lr(_0x4135a1){const _0x40fd3a=_0x472560;if(process.env.VIBE_TEST!=='1')return;let _0x1e1a30=Number(process.env[_0x4135a1]??0x0);if(!Number['isFinite'](_0x1e1a30)||_0x1e1a30<=0x0)return;let _0x2ec346=Date['now']()+Math['min'](_0x1e1a30,0x2710);for(;Date[_0x40fd3a(0x27e)]()<_0x2ec346;);}async function To(_0x2a1e83){const _0x38626b=_0x472560;try{if(_0x2a1e83['kind']===_0x38626b(0x1a4))return lr('VIBE_TEST_PROCESS_WORKER_DELAY_MS'),_0x2a1e83['invalidate']&&sr(),{'id':_0x2a1e83['id'],'ok':!0x0,'result':await ir()};lr('VIBE_TEST_INVENTORY_WORKER_DELAY_MS');let _0x3d16af=Date[_0x38626b(0x27e)](),_0x5ab100=await Co['scan'](_0x3f0a90=>{const _0x366384=_0x38626b;Ue['postMessage']({'id':_0x2a1e83['id'],'ok':!0x0,'progress':_0x366384(0x19e),..._0x3f0a90});});xo[_0x38626b(0x1dc)]({'durationMs':Date['now']()-_0x3d16af,'sessions':_0x5ab100['sessions']['length'],'files':_0x5ab100['totalFiles'],'changedFiles':_0x5ab100[_0x38626b(0x1f9)],'reusedFiles':_0x5ab100['reusedFiles'],'removedFiles':_0x5ab100['removedFiles']},_0x38626b(0x1e5));for(let _0x14c954=0x0;_0x14c954<_0x5ab100[_0x38626b(0x1e4)]['length'];_0x14c954+=ar)Ue[_0x38626b(0x1ed)]({'id':_0x2a1e83['id'],'ok':!0x0,'progress':'session_result_batch','sessions':_0x5ab100[_0x38626b(0x1e4)][_0x38626b(0x274)](_0x14c954,_0x14c954+ar)});return{'id':_0x2a1e83['id'],'ok':!0x0,'result':{'scannedSessions':[],'runningSessions':[]}};}catch(_0x51a8c6){return{'id':_0x2a1e83['id'],'ok':!0x1,'error':_0x51a8c6 instanceof Error?_0x51a8c6['name']+':\x20'+_0x51a8c6['message']:String(_0x51a8c6)};}}var cr=Promise[_0x472560(0x253)]();Ue['on']('message',_0x3502d0=>{cr=cr['then'](async()=>{Ue['postMessage'](await To(_0x3502d0));});});