@vibelet/cli 1.2.162 → 1.2.164

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 _0x14f810=_0x119c;(function(_0x1a6ea1,_0x5215dc){const _0x594f25=_0x119c,_0x2abec3=_0x1a6ea1();while(!![]){try{const _0x3306b0=-parseInt(_0x594f25(0x1e3))/0x1+parseInt(_0x594f25(0x24c))/0x2+parseInt(_0x594f25(0x30c))/0x3*(parseInt(_0x594f25(0x2a6))/0x4)+parseInt(_0x594f25(0x341))/0x5*(parseInt(_0x594f25(0x1f2))/0x6)+-parseInt(_0x594f25(0x251))/0x7*(parseInt(_0x594f25(0x2e7))/0x8)+parseInt(_0x594f25(0x270))/0x9*(-parseInt(_0x594f25(0x1eb))/0xa)+-parseInt(_0x594f25(0x2f9))/0xb;if(_0x3306b0===_0x5215dc)break;else _0x2abec3['push'](_0x2abec3['shift']());}catch(_0x56a614){_0x2abec3['push'](_0x2abec3['shift']());}}}(_0x50b7,0x78f36));var ht=require(_0x14f810(0x233)),qn=require(_0x14f810(0x285)),de=require(_0x14f810(0x257)),dt=require(_0x14f810(0x27d)),L=require(_0x14f810(0x2cf)),zn=require('node:util'),me=require(_0x14f810(0x300)),yt=require('node:os'),g=require(_0x14f810(0x2cf)),N=(0x0,g['join'])((0x0,yt['homedir'])(),_0x14f810(0x253)),fe=(0x0,g['join'])(N,'logs'),Y=(0x0,g['join'])(N,_0x14f810(0x329)),St=(0x0,g['join'])(N,_0x14f810(0x2cb)),ui=(0x0,g['join'])(St,_0x14f810(0x210)),di=(0x0,g[_0x14f810(0x28c)])(St,_0x14f810(0x2ce)),fi=(0x0,g['join'])(N,_0x14f810(0x230)),pi=(0x0,g[_0x14f810(0x28c)])(N,_0x14f810(0x33a)),mi=(0x0,g[_0x14f810(0x28c)])(Y,_0x14f810(0x231)),gi=(0x0,g[_0x14f810(0x28c)])(Y,'push-subscriptions.json'),hi=(0x0,g[_0x14f810(0x28c)])(Y,'sessions.json'),yi=(0x0,g['join'])(Y,'audit.jsonl'),Si=(0x0,g['join'])(Y,'uploads'),xt=(0x0,g[_0x14f810(0x28c)])(fe,_0x14f810(0x235)),Tt=(0x0,g[_0x14f810(0x28c)])(fe,'daemon.stderr.log'),xi=(0x0,g[_0x14f810(0x28c)])(N,'update-check.json'),Ti=(0x0,g['join'])(N,_0x14f810(0x31b)),pe={'stdout':!0x1,'stderr':!0x1};function At(_0x1b0d6e){const _0x5af991=_0x14f810;if(!_0x1b0d6e||typeof _0x1b0d6e!='object')return!0x1;let _0x3f0261=typeof _0x1b0d6e['code']=='string'?_0x1b0d6e[_0x5af991(0x1f9)]:'';return _0x3f0261==='EIO'||_0x3f0261==='EPIPE';}function Yn(_0x5c05c9){const _0x24cc74=_0x14f810;return!_0x5c05c9[_0x24cc74(0x349)]&&_0x5c05c9[_0x24cc74(0x200)]!==!0x1;}function Ct(_0xf59bf3,_0x4b7d43){const _0x5b339d=_0x14f810;if(pe[_0xf59bf3])return!0x1;let _0x14b2c3=_0xf59bf3==='stderr'?process[_0x5b339d(0x1e4)]:process['stdout'];if(!Yn(_0x14b2c3))return pe[_0xf59bf3]=!0x0,!0x1;try{return _0x14b2c3['write'](_0x4b7d43,_0x5a39ba=>{At(_0x5a39ba)&&(pe[_0xf59bf3]=!0x0);}),!0x0;}catch(_0x49e8ea){return At(_0x49e8ea)&&(pe[_0xf59bf3]=!0x0),!0x1;}}function wt(_0x1519c7){return Ct('stdout',_0x1519c7);}function bt(_0x451a16){const _0x1c35ec=_0x14f810;return Ct(_0x1c35ec(0x1e4),_0x451a16);}var vt={'debug':0xa,'info':0x14,'warn':0x1e,'error':0x28},Zn=process.env.VIBE_LOG_LEVEL||_0x14f810(0x27c);function er(){const _0x519810=_0x14f810;return process.env.VIBE_TEST==='1'||process[_0x519810(0x25e)]['includes']('--test');}function tr(){const _0x3cc2f8=_0x14f810;try{let {fstatSync:_0x5c5b11}=require(_0x3cc2f8(0x300));return _0x5c5b11(0x1)['isFile']();}catch{return!0x1;}}var Et=!er()&&!tr();if(Et)try{(0x0,me['mkdirSync'])(fe,{'recursive':!0x0});}catch{}function It(_0x3a04ef,_0x3ea5eb,_0x1f6a03){const _0x6cafc8=_0x14f810;if(vt[_0x3a04ef]<vt[Zn])return;let _0xf7d335={'level':_0x3a04ef,'ts':new Date()['toISOString'](),'msg':_0x1f6a03,..._0x3ea5eb},_0x1e20e0=JSON[_0x6cafc8(0x1da)](_0xf7d335);if(_0x3a04ef==='error'||_0x3a04ef==='warn'?bt(_0x1e20e0+'\x0a'):wt(_0x1e20e0+'\x0a'),Et){let _0x357eae=_0x3a04ef==='error'||_0x3a04ef==='warn'?Tt:xt;try{(0x0,me['appendFileSync'])(_0x357eae,_0x1e20e0+'\x0a');}catch{}}}function Mt(_0xba4ca3={}){const _0x41f4bd=_0x14f810;function _0x4cc18a(_0x3dd119,_0x3ea7b9,_0x23e30c){typeof _0x3ea7b9=='string'?It(_0x3dd119,_0xba4ca3,_0x3ea7b9):It(_0x3dd119,{..._0xba4ca3,..._0x3ea7b9},_0x23e30c);}return{'debug':(_0x3fee04,_0x4de65a)=>_0x4cc18a(_0x41f4bd(0x333),_0x3fee04,_0x4de65a),'info':(_0x1c6a17,_0x57bd9c)=>_0x4cc18a('info',_0x1c6a17,_0x57bd9c),'warn':(_0x19bc18,_0x32a0b3)=>_0x4cc18a(_0x41f4bd(0x26f),_0x19bc18,_0x32a0b3),'error':(_0x431a4e,_0x37fb93)=>_0x4cc18a(_0x41f4bd(0x2a5),_0x431a4e,_0x37fb93),'child':_0xbec180=>Mt({..._0xba4ca3,..._0xbec180})};}var h=Mt({'module':_0x14f810(0x258)}),Fe=class{['counters']=new Map();['timers']=new Map();[_0x14f810(0x1e0)]=new Map();[_0x14f810(0x23f)]=Date[_0x14f810(0x2df)]();['logInterval']=null;['increment'](_0xd6a7e3,_0x269f45={}){const _0x2727da=_0x14f810;this[_0x2727da(0x271)][_0x2727da(0x20f)](_0xd6a7e3)||this[_0x2727da(0x271)]['set'](_0xd6a7e3,[]);let _0x5a6db0=this['counters']['get'](_0xd6a7e3),_0xec52c4=JSON['stringify'](_0x269f45),_0x251f20=_0x5a6db0['find'](_0xc70b10=>JSON['stringify'](_0xc70b10[_0x2727da(0x29c)])===_0xec52c4);_0x251f20?_0x251f20['value']++:_0x5a6db0[_0x2727da(0x26a)]({'value':0x1,'labels':_0x269f45});}[_0x14f810(0x280)](_0x1a8be8,_0x137d4b){const _0x8f1ab5=_0x14f810;this[_0x8f1ab5(0x1e0)][_0x8f1ab5(0x212)](_0x1a8be8,_0x137d4b);}['startTimer'](_0x36e8ab){const _0xd3292c=_0x14f810;let _0x44d683=performance[_0xd3292c(0x2df)]();return()=>{const _0x46c4f9=_0xd3292c;let _0x347439=Math['round'](performance[_0x46c4f9(0x2df)]()-_0x44d683),_0x6b9f1c=this[_0x46c4f9(0x1de)]['get'](_0x36e8ab)??{'count':0x0,'totalMs':0x0,'minMs':0x1/0x0,'maxMs':0x0,'lastMs':0x0};return _0x6b9f1c['count']++,_0x6b9f1c[_0x46c4f9(0x2b1)]+=_0x347439,_0x6b9f1c['minMs']=Math[_0x46c4f9(0x314)](_0x6b9f1c['minMs'],_0x347439),_0x6b9f1c['maxMs']=Math['max'](_0x6b9f1c['maxMs'],_0x347439),_0x6b9f1c[_0x46c4f9(0x335)]=_0x347439,this[_0x46c4f9(0x1de)]['set'](_0x36e8ab,_0x6b9f1c),_0x347439;};}[_0x14f810(0x218)](){const _0x1197c6=_0x14f810;let _0x189a00={};for(let [_0x392f5d,_0x3946ee]of this['counters'])_0x189a00[_0x392f5d]=_0x3946ee[_0x1197c6(0x1ec)](_0x4d7893=>({..._0x4d7893}));let _0x36f8f3={};for(let [_0x58dc0f,_0xd7dce0]of this[_0x1197c6(0x1de)])_0x36f8f3[_0x58dc0f]={..._0xd7dce0,'minMs':_0xd7dce0['minMs']===0x1/0x0?0x0:_0xd7dce0[_0x1197c6(0x31d)]};let _0x554389={};for(let [_0xaa66bc,_0x4ca91a]of this['gauges'])_0x554389[_0xaa66bc]=_0x4ca91a;return{'uptimeMs':Date[_0x1197c6(0x2df)]()-this[_0x1197c6(0x23f)],'counters':_0x189a00,'timers':_0x36f8f3,'gauges':_0x554389};}['startPeriodicLog'](_0xdd156b=0xea60){const _0x498eec=_0x14f810;this['logInterval']||(this['logInterval']=setInterval(()=>{const _0x135c00=_0x119c;let _0x14f0e9=this['snapshot']();h[_0x135c00(0x27c)]({'metrics':_0x14f0e9},'periodic\x20metrics\x20snapshot');},_0xdd156b),this[_0x498eec(0x2d8)]['unref']());}[_0x14f810(0x275)](){const _0x24f9ea=_0x14f810;this[_0x24f9ea(0x2d8)]&&(clearInterval(this[_0x24f9ea(0x2d8)]),this['logInterval']=null);}},G=new Fe(),T=require('node:fs/promises'),k=require('node:os'),y=require(_0x14f810(0x2cf)),Rt=require('node:os'),D=require(_0x14f810(0x2cf)),nr=new Set(['.c','.cc',_0x14f810(0x2ba),'.cs','.css',_0x14f810(0x295),'.elm','.ex',_0x14f810(0x27b),_0x14f810(0x2dc),'.go','.h',_0x14f810(0x1f3),_0x14f810(0x267),'.java','.js',_0x14f810(0x323),'.kt',_0x14f810(0x243),_0x14f810(0x28d),_0x14f810(0x294),'.m',_0x14f810(0x28a),_0x14f810(0x2eb),_0x14f810(0x1f1),_0x14f810(0x1e6),_0x14f810(0x2fd),_0x14f810(0x2ec),'.r','.rb','.rs',_0x14f810(0x34f),'.scala',_0x14f810(0x288),'.sh','.sql','.swift','.ts',_0x14f810(0x252),_0x14f810(0x296),_0x14f810(0x290),_0x14f810(0x1fa),_0x14f810(0x2da),'.zsh']),_t='Generated\x20file:\x20',Pt='Generated\x20files:\x0a';function Q(_0x36a5aa){const _0x1fdcf4=_0x14f810;return typeof _0x36a5aa=='string'&&_0x36a5aa['trim']()[_0x1fdcf4(0x2d5)]>0x0?_0x36a5aa['trim']():null;}function Z(_0x5c2284){const _0x3a41f2=_0x14f810;return!_0x5c2284||typeof _0x5c2284!=_0x3a41f2(0x326)||Array[_0x3a41f2(0x316)](_0x5c2284)?null:_0x5c2284;}function ke(_0x6c09eb){const _0x55a4db=_0x14f810;let _0x37598b=_0x6c09eb['trim']()['replace'](/[.,!?;:,。!?;:、]+$/u,''),_0x2fca96=_0x37598b[_0x55a4db(0x2c0)]('#');_0x2fca96>0x0&&(_0x37598b=_0x37598b['slice'](0x0,_0x2fca96));let _0x7d16b2=_0x37598b[_0x55a4db(0x2f7)](/^(.*?)(:\d+(?::\d+)?)$/);return _0x7d16b2?.[0x1]&&(_0x37598b=_0x7d16b2[0x1]),_0x37598b;}function ge(_0x2e31bc,_0x5ebbf3){const _0x121a25=_0x14f810;let _0x41602a=ke(_0x2e31bc);return _0x41602a?_0x41602a[_0x121a25(0x274)]('~/')?(0x0,D[_0x121a25(0x289)])((0x0,Rt['homedir'])(),_0x41602a['slice'](0x2)):(0x0,D['isAbsolute'])(_0x41602a)?_0x41602a:_0x5ebbf3?(0x0,D['resolve'])(_0x5ebbf3,_0x41602a):_0x41602a:'';}function rr(_0x2ae685){const _0x296fb8=_0x14f810;return nr[_0x296fb8(0x20f)]((0x0,D['extname'])(ke(_0x2ae685))[_0x296fb8(0x30b)]());}function Le(_0x4eeb33){let _0x42775f=ke(_0x4eeb33);return _0x42775f?!rr(_0x42775f):!0x1;}function Ne(_0x48d407){const _0x134dbd=_0x14f810;let _0x467b42=[...new Set(_0x48d407['map'](_0x41e4b5=>ge(_0x41e4b5))[_0x134dbd(0x305)](Boolean))];return _0x467b42['length']===0x0?'':_0x467b42['length']===0x1?''+_t+_0x467b42[0x0]:''+Pt+_0x467b42[_0x134dbd(0x28c)]('\x0a');}function Ft(_0x2950c2){const _0x1d00f8=_0x14f810;return typeof _0x2950c2!=_0x1d00f8(0x2ab)?!0x1:_0x2950c2[_0x1d00f8(0x274)](_t)||_0x2950c2[_0x1d00f8(0x274)](Pt);}function sr(_0x283c22,_0xbfccc2){let _0x235e2f=_0x283c22['matchAll'](/^\*\*\* Add File: (.+)$/gm),_0x2e985d=new Set();for(let _0x1dad95 of _0x235e2f){let _0x3aff5b=Q(_0x1dad95[0x1]);if(!_0x3aff5b)continue;let _0x5025ab=ge(_0x3aff5b,_0xbfccc2);!_0x5025ab||!Le(_0x5025ab)||_0x2e985d['add'](_0x5025ab);}return[..._0x2e985d];}function ir(_0x1609b9){let _0x5c700d=Q(_0x1609b9);return _0x5c700d?_0x5c700d['toLowerCase']():'';}function or(_0x2b2eb2,_0x396986){const _0x2ea66f=_0x14f810;let _0x23b164=Q(_0x2b2eb2?.['file_path'])??Q(_0x2b2eb2?.[_0x2ea66f(0x347)]);if(!_0x23b164)return null;let _0x3a54eb=ge(_0x23b164,_0x396986);return _0x3a54eb&&Le(_0x3a54eb)?_0x3a54eb:null;}function kt(_0x3f298c,_0x4ef363,_0x19fd78){const _0x3a92fe=_0x14f810;return ir(_0x3f298c)!==_0x3a92fe(0x327)?null:or(_0x4ef363,_0x19fd78);}function ar(_0x805d3f){const _0xbce4fd=_0x14f810;let _0x46d0cd=_0x805d3f[_0xbce4fd(0x30b)]();return _0x46d0cd[_0xbce4fd(0x34b)]('updated\x20successfully')||_0x46d0cd[_0xbce4fd(0x34b)]('updated.\x20all\x20occurrences\x20were\x20successfully\x20replaced')||_0x46d0cd['includes'](_0xbce4fd(0x25c))||_0x46d0cd[_0xbce4fd(0x34b)](_0xbce4fd(0x281));}function lr(_0x1236ee){return/^\d+\t/m['test'](_0x1236ee);}function Lt(_0x2efe36,_0x55a658){const _0x5f2079=_0x14f810;let _0x33573d=typeof _0x55a658=='string'?_0x55a658[_0x5f2079(0x2dd)]():'';if(_0x33573d&&ar(_0x33573d))return!0x1;let _0x4a1df3=Z(_0x2efe36);if(_0x4a1df3?.[_0x5f2079(0x2d0)]===_0x5f2079(0x345)||_0x4a1df3?.[_0x5f2079(0x2d0)]==='replace'||_0x4a1df3&&(Object[_0x5f2079(0x26c)](_0x4a1df3,_0x5f2079(0x2c5))||Object['hasOwn'](_0x4a1df3,_0x5f2079(0x1fb))||Object['hasOwn'](_0x4a1df3,'originalFile')||Object[_0x5f2079(0x26c)](_0x4a1df3,_0x5f2079(0x2d2))))return!0x1;if(typeof Z(_0x4a1df3?.['file'])?.[_0x5f2079(0x2be)]=='string'||typeof _0x4a1df3?.[_0x5f2079(0x2be)]=='string')return!0x0;if(_0x33573d){let _0x4f21d2=_0x33573d['toLowerCase']();if(_0x4f21d2['includes']('created\x20successfully')||_0x4f21d2['includes'](_0x5f2079(0x2e6))||lr(_0x33573d))return!0x0;}return!0x1;}function Nt(_0x1efeee,_0x366ec0){const _0x529a23=_0x14f810;let _0x183ecf=Z(_0x1efeee);if(!_0x183ecf)return[];let _0x5e811a=new Set();if(_0x183ecf[_0x529a23(0x2d0)]==='event_msg'){let _0x22acde=Z(_0x183ecf['payload']);if(_0x22acde?.['type']==='image_generation_end'){let _0x40c137=Q(_0x22acde['saved_path']);if(_0x40c137){let _0x42c9c2=ge(_0x40c137,_0x366ec0?.['cwd']);_0x42c9c2&&Le(_0x42c9c2)&&_0x5e811a[_0x529a23(0x332)](_0x42c9c2);}}}if(_0x366ec0?.['includePatchCalls']&&_0x183ecf[_0x529a23(0x2d0)]===_0x529a23(0x217)){let _0x14594d=Z(_0x183ecf[_0x529a23(0x310)]);if(_0x14594d?.['type']===_0x529a23(0x228)&&_0x14594d['name']==='apply_patch'){let _0x569780=Q(_0x14594d['arguments']);if(_0x569780){for(let _0x5c57e4 of sr(_0x569780,_0x366ec0?.['cwd']))_0x5e811a['add'](_0x5c57e4);}}}return[..._0x5e811a];}function ee(_0x1e088e){let _0x462639=new Map();return{'get'(_0x11c821){let _0xc45827=_0x462639['get'](_0x11c821);if(_0xc45827){if(Date['now']()>_0xc45827['expiresAt']){_0x462639['delete'](_0x11c821);return;}return _0xc45827['value'];}},'set'(_0x146d6e,_0x1f271f){const _0x44e12c=_0x119c;_0x462639[_0x44e12c(0x212)](_0x146d6e,{'value':_0x1f271f,'expiresAt':Date[_0x44e12c(0x2df)]()+_0x1e088e});},'clear'(){const _0x14fbe6=_0x119c;_0x462639[_0x14fbe6(0x32e)]();}};}var en=require(_0x14f810(0x257)),E=require(_0x14f810(0x257)),he=require('node:os'),w=require(_0x14f810(0x2cf)),A=0x18;async function M(_0x1526c8,_0x317682,_0x17626b){const _0x15a23b=_0x14f810;if(_0x1526c8[_0x15a23b(0x2d5)]===0x0)return[];let _0x7fd6ee=Math['max'](0x1,Math['min'](_0x317682,_0x1526c8['length'])),_0x254b87=new Array(_0x1526c8[_0x15a23b(0x2d5)]),_0x1c5693=0x0;return await Promise[_0x15a23b(0x2bc)](Array[_0x15a23b(0x1fe)]({'length':_0x7fd6ee},async()=>{const _0x333d7e=_0x15a23b;for(;;){let _0x2b6a0d=_0x1c5693;if(_0x1c5693+=0x1,_0x2b6a0d>=_0x1526c8[_0x333d7e(0x2d5)])return;_0x254b87[_0x2b6a0d]=await _0x17626b(_0x1526c8[_0x2b6a0d],_0x2b6a0d);}})),_0x254b87;}async function ye(_0x1ff819){const _0x17e48f=_0x14f810;let _0x45fd8e=(await M(_0x1ff819,A,async _0x4fbe53=>{const _0x44fac5=_0x119c;let _0x421b93=await(0x0,E[_0x44fac5(0x239)])(_0x4fbe53)['catch'](()=>null);return _0x421b93?.[_0x44fac5(0x266)]()?{'path':_0x4fbe53,'mtimeMs':_0x421b93[_0x44fac5(0x1f5)],'birthtimeMs':_0x421b93['birthtimeMs'],'size':_0x421b93[_0x44fac5(0x249)]}:null;}))['filter'](_0x2e673d=>_0x2e673d!==null);return _0x45fd8e[_0x17e48f(0x20b)]((_0xeee5d9,_0x195b1b)=>_0x195b1b[_0x17e48f(0x1f5)]-_0xeee5d9['mtimeMs']),_0x45fd8e;}async function De(_0x17c24c=(0x0,w['join'])((0x0,he[_0x14f810(0x1f7)])(),'Library','Application\x20Support','Claude',_0x14f810(0x325)),_0x103cf1=0x0){const _0x48e947=_0x14f810;if(_0x103cf1>0x4)return[];let _0xba28b2=await(0x0,E['readdir'])(_0x17c24c,{'withFileTypes':!0x0})[_0x48e947(0x1e9)](()=>[]),_0x1317cd=[];for(let _0x3a8f0e of _0xba28b2){let _0x42aa69=(0x0,w[_0x48e947(0x28c)])(_0x17c24c,_0x3a8f0e['name']);_0x3a8f0e['isDirectory']()?_0x1317cd[_0x48e947(0x26a)](...await De(_0x42aa69,_0x103cf1+0x1)):_0x3a8f0e['isFile']()&&_0x3a8f0e['name'][_0x48e947(0x278)]('.json')&&_0x1317cd['push'](_0x42aa69);}return _0x1317cd;}async function cr(){const _0x3bf829=_0x14f810;let _0x1b4f8b=(0x0,w[_0x3bf829(0x28c)])((0x0,he['homedir'])(),'.codex',_0x3bf829(0x324)),_0x3c3809=(0x0,w[_0x3bf829(0x28c)])((0x0,he['homedir'])(),'.codex','archived_sessions'),_0x1d6a16=[],_0x50e581=await(0x0,E['readdir'])(_0x1b4f8b)['catch'](()=>[]);for(let _0x558de9 of _0x50e581){let _0x50d05f=(0x0,w['join'])(_0x1b4f8b,_0x558de9),_0x3e6ec0=await(0x0,E['readdir'])(_0x50d05f)[_0x3bf829(0x1e9)](()=>[]);for(let _0x13d0b9 of _0x3e6ec0){let _0x13de5b=(0x0,w['join'])(_0x50d05f,_0x13d0b9),_0x27a4d8=await(0x0,E['readdir'])(_0x13de5b)['catch'](()=>[]);for(let _0x3fdef5 of _0x27a4d8){let _0x5ba107=(0x0,w['join'])(_0x13de5b,_0x3fdef5),_0x5172da=await(0x0,E[_0x3bf829(0x315)])(_0x5ba107)[_0x3bf829(0x1e9)](()=>[]);for(let _0x49e820 of _0x5172da)_0x49e820['endsWith'](_0x3bf829(0x1dc))&&_0x1d6a16['push']((0x0,w[_0x3bf829(0x28c)])(_0x5ba107,_0x49e820));}}}let _0x11a440=await(0x0,E['readdir'])(_0x3c3809)[_0x3bf829(0x1e9)](()=>[]);for(let _0x398707 of _0x11a440)_0x398707['endsWith']('.jsonl')&&_0x1d6a16[_0x3bf829(0x26a)]((0x0,w['join'])(_0x3c3809,_0x398707));return _0x1d6a16;}async function Se(){let _0x4f783f=await cr();return ye(_0x4f783f);}var O=require('node:child_process'),v=require('node:fs'),$=require(_0x14f810(0x27d)),f=require('node:path'),ur=[_0x14f810(0x320)],dr=0xea60,U=process[_0x14f810(0x2d3)]==='win32';function b(_0x1348dd){return ur['some'](_0x593bab=>_0x1348dd['includes'](_0x593bab));}function fr(_0x591f43){const _0xf6f82=_0x14f810;if(!_0x591f43||!b(_0x591f43))return _0x591f43;try{let _0x334ef9=(0x0,f['join'])((0x0,v[_0xf6f82(0x283)])((0x0,f['dirname'])(_0x591f43)),(0x0,f[_0xf6f82(0x28e)])(_0x591f43));if((0x0,v['existsSync'])(_0x334ef9)&&!b(_0x334ef9))return _0x334ef9;}catch{}return _0x591f43;}function pr(_0x7ed084){if(!_0x7ed084||!b(_0x7ed084))return _0x7ed084;try{let _0x38ccf2=(0x0,v['realpathSync'])(_0x7ed084);if(_0x38ccf2&&!b(_0x38ccf2))return _0x38ccf2;}catch{}return _0x7ed084;}function Dt(){const _0x3dda22=_0x14f810;return U?[]:[process.env.SHELL,_0x3dda22(0x2d1),_0x3dda22(0x2f8),_0x3dda22(0x273)]['filter'](_0x1f86b9=>!!_0x1f86b9)[_0x3dda22(0x305)]((_0x54786b,_0x34fe84,_0x3de099)=>_0x3de099[_0x3dda22(0x2c0)](_0x54786b)===_0x34fe84)[_0x3dda22(0x305)](_0x4cf33b=>(0x0,v[_0x3dda22(0x23d)])(_0x4cf33b));}function Ut(_0xed3ce3,_0x369f87){const _0x2ab294=_0x14f810;let _0x11d369=_0x41ee2d=>{const _0x45f70d=_0x119c;let _0x4073b9=/^v?(\d+)\.(\d+)\.(\d+)/[_0x45f70d(0x317)](_0x41ee2d);return _0x4073b9?[Number(_0x4073b9[0x1]),Number(_0x4073b9[0x2]),Number(_0x4073b9[0x3])]:null;},_0x2b2ba1=_0x11d369(_0xed3ce3),_0xd208be=_0x11d369(_0x369f87);if(!_0x2b2ba1&&!_0xd208be)return _0x369f87[_0x2ab294(0x299)](_0xed3ce3);if(!_0x2b2ba1)return 0x1;if(!_0xd208be)return-0x1;for(let _0x2e74b2=0x0;_0x2e74b2<_0x2b2ba1[_0x2ab294(0x2d5)];_0x2e74b2+=0x1)if(_0x2b2ba1[_0x2e74b2]!==_0xd208be[_0x2e74b2])return _0xd208be[_0x2e74b2]-_0x2b2ba1[_0x2e74b2];return 0x0;}function Ot(){const _0x3767ab=_0x14f810;let _0x213daf=(0x0,$[_0x3767ab(0x1f7)])(),_0x34f0b1=(0x0,f['join'])(_0x213daf,'.nvm',_0x3767ab(0x34a),'node'),_0x19ac79=[(0x0,f[_0x3767ab(0x28c)])(_0x213daf,'.nvm','current','bin')];try{let _0x4db8c1=(0x0,v['readdirSync'])(_0x34f0b1,{'withFileTypes':!0x0})['filter'](_0x90ba2e=>_0x90ba2e[_0x3767ab(0x29d)]())['map'](_0x2a812e=>_0x2a812e[_0x3767ab(0x282)])['sort'](Ut);for(let _0x4ef17b of _0x4db8c1)_0x19ac79['push']((0x0,f[_0x3767ab(0x28c)])(_0x34f0b1,_0x4ef17b,_0x3767ab(0x2bf)));}catch{}return _0x19ac79;}function $t(){const _0x392a8a=_0x14f810;let _0x575679=(0x0,$[_0x392a8a(0x1f7)])(),_0x2bdb7d=[process.env.FNM_DIR,(0x0,f['join'])(_0x575679,'.local','share',_0x392a8a(0x24b)),(0x0,f[_0x392a8a(0x28c)])(_0x575679,'Library','Application\x20Support','fnm'),(0x0,f[_0x392a8a(0x28c)])(_0x575679,'.fnm')][_0x392a8a(0x305)](_0x14c38c=>!!_0x14c38c),_0x3888ee=[],_0x98c4ea=new Set();for(let _0x4a20b1 of _0x2bdb7d){if(_0x98c4ea['has'](_0x4a20b1))continue;_0x98c4ea['add'](_0x4a20b1);let _0x2b01e6=(0x0,f[_0x392a8a(0x28c)])(_0x4a20b1,_0x392a8a(0x1f0));try{let _0xc1d725=(0x0,v['readdirSync'])(_0x2b01e6,{'withFileTypes':!0x0})['filter'](_0x4232e1=>_0x4232e1['isDirectory']())['map'](_0x34965a=>_0x34965a[_0x392a8a(0x282)])[_0x392a8a(0x20b)](Ut);for(let _0x1ed5f5 of _0xc1d725)_0x3888ee[_0x392a8a(0x26a)]((0x0,f[_0x392a8a(0x28c)])(_0x2b01e6,_0x1ed5f5,_0x392a8a(0x250),'bin')),_0x3888ee['push']((0x0,f[_0x392a8a(0x28c)])(_0x2b01e6,_0x1ed5f5,'bin'));}catch{}}return _0x3888ee;}var xe=null;function Ht(){const _0xd9feb5=_0x14f810;if(xe?.['PATH']&&!b(xe['PATH']))return xe;for(let _0x5d1597 of Dt())try{let _0x1329f8=(0x0,O[_0xd9feb5(0x2a9)])(_0x5d1597,[_0xd9feb5(0x2b6),_0xd9feb5(0x2b5)],{'timeout':0x1388,'encoding':'utf-8','stdio':[_0xd9feb5(0x207),_0xd9feb5(0x207),_0xd9feb5(0x207)]}),_0x1f9c4e={};for(let _0x54b422 of _0x1329f8[_0xd9feb5(0x284)]('\x0a')){let _0x436721=_0x54b422[_0xd9feb5(0x2c0)]('=');_0x436721>0x0&&(_0x1f9c4e[_0x54b422['slice'](0x0,_0x436721)]=_0x54b422['slice'](_0x436721+0x1));}return _0x1f9c4e[_0xd9feb5(0x1ef)]&&!b(_0x1f9c4e[_0xd9feb5(0x1ef)])&&(xe=_0x1f9c4e),_0x1f9c4e;}catch{}return{};}function mr(_0x309e22=Ht()){const _0x9100e=_0x14f810;let _0x4e064f=(0x0,$['homedir'])(),_0x15ed4=_0x309e22['PNPM_HOME']||process.env.PNPM_HOME||(U?(0x0,f['join'])(_0x4e064f,_0x9100e(0x2c3)):(0x0,f[_0x9100e(0x28c)])(_0x4e064f,_0x9100e(0x1ea),'pnpm')),_0x15c799=_0x309e22['PATH']||process.env.PATH||'',_0x5ed227=U?[(0x0,f[_0x9100e(0x28c)])(_0x4e064f,'.npm-global',_0x9100e(0x2bf)),(0x0,f[_0x9100e(0x28c)])(_0x4e064f,_0x9100e(0x301),'bin'),(0x0,f['join'])(_0x4e064f,'.claude',_0x9100e(0x2bf)),(0x0,f['join'])(_0x4e064f,_0x9100e(0x1fc),'packages',_0x9100e(0x2fe),_0x9100e(0x210),'bin'),_0x15ed4,(0x0,f[_0x9100e(0x28c)])(_0x4e064f,'AppData',_0x9100e(0x265),_0x9100e(0x33f)),(0x0,f[_0x9100e(0x28c)])(_0x4e064f,_0x9100e(0x2fa),'Local','Programs','node')]:[_0x9100e(0x21c),_0x9100e(0x334),_0x9100e(0x340),_0x9100e(0x1e7),(0x0,f[_0x9100e(0x28c)])(_0x4e064f,'.npm-global','bin'),(0x0,f[_0x9100e(0x28c)])(_0x4e064f,'.local','bin'),(0x0,f['join'])(_0x4e064f,_0x9100e(0x247),_0x9100e(0x2bf)),(0x0,f['join'])(_0x4e064f,'.codex',_0x9100e(0x30f),_0x9100e(0x2fe),_0x9100e(0x210),_0x9100e(0x2bf)),_0x15ed4,...Ot(),...$t()],_0xa7523a=_0x15c799['split'](f[_0x9100e(0x268)])['filter'](Boolean)['map'](pr),_0x5838bd=new Set(_0xa7523a);for(let _0x460db4 of _0x5ed227)_0x5838bd['has'](_0x460db4)||(_0xa7523a[_0x9100e(0x26a)](_0x460db4),_0x5838bd['add'](_0x460db4));return _0xa7523a[_0x9100e(0x28c)](f['delimiter']);}function Ue(){const _0x5ceb9c=_0x14f810;let _0x1df783=Ht(),_0x4f7a2f={};for(let [_0x16fa15,_0x3a6c48]of Object[_0x5ceb9c(0x348)](process.env))typeof _0x3a6c48==_0x5ceb9c(0x2ab)&&(_0x4f7a2f[_0x16fa15]=_0x3a6c48);for(let [_0x286e18,_0x486d87]of Object['entries'](_0x1df783))typeof _0x486d87==_0x5ceb9c(0x2ab)&&(_0x4f7a2f[_0x286e18]=_0x486d87);return _0x4f7a2f[_0x5ceb9c(0x1ef)]=mr(_0x1df783),_0x4f7a2f[_0x5ceb9c(0x21e)]||(_0x4f7a2f[_0x5ceb9c(0x21e)]=(0x0,$['homedir'])()),delete _0x4f7a2f[_0x5ceb9c(0x346)],delete _0x4f7a2f['CLAUDECODE'],_0x4f7a2f;}function jt(_0x3a0fee){const _0x1b405b=_0x14f810;if(U)try{let _0x4d2d80=(0x0,O[_0x1b405b(0x2a9)])('where.exe',[_0x3a0fee],{'timeout':0xbb8,'stdio':_0x1b405b(0x207),'encoding':_0x1b405b(0x242)})[_0x1b405b(0x2dd)]()['split'](/\r?\n/)[_0x1b405b(0x305)](Boolean);return _0x4d2d80['find'](_0x220d18=>_0x220d18['endsWith'](_0x1b405b(0x214)))??_0x4d2d80[0x0];}catch{return;}}function te(_0x351d71,_0x5def5a=0xbb8){try{return(0x0,O['execFileSync'])(_0x351d71,['--version'],{'timeout':_0x5def5a,'stdio':'pipe','encoding':'utf-8','env':Ue(),...U?{'shell':!0x0}:{}})['trim']()||null;}catch{return null;}}function gr(_0x16c2b5){const _0x3eef33=_0x14f810;for(let _0x50303b of Dt())try{let _0x497d2a=(0x0,O[_0x3eef33(0x2a9)])(_0x50303b,['-ilc',_0x3eef33(0x236)+_0x16c2b5],{'timeout':0x1388,'stdio':['pipe',_0x3eef33(0x207),'pipe'],'encoding':'utf-8'})[_0x3eef33(0x2dd)]();if(_0x497d2a)return _0x497d2a;}catch{}}function hr(){const _0x3c9bc7=_0x14f810;let _0x5d1b10=(0x0,$['homedir'])();return[(0x0,f[_0x3c9bc7(0x28c)])(_0x5d1b10,_0x3c9bc7(0x301),'bin',_0x3c9bc7(0x272)),(0x0,f['join'])(_0x5d1b10,_0x3c9bc7(0x247),_0x3c9bc7(0x2bf),'claude'),'/usr/local/bin/claude',_0x3c9bc7(0x2de),(0x0,f['join'])(_0x5d1b10,_0x3c9bc7(0x245),_0x3c9bc7(0x2bf),_0x3c9bc7(0x272))];}function yr(){const _0xea8620=_0x14f810;if(U){let _0xccb882=jt(_0xea8620(0x272));return _0xccb882&&te(_0xccb882)?_0xccb882:void 0x0;}for(let _0xa60e80 of hr())if(te(_0xa60e80))return _0xa60e80;try{let _0x1caa48=(0x0,O['execFileSync'])('/usr/bin/which',['claude'],{'timeout':0xbb8,'stdio':'pipe','encoding':'utf-8','env':Ue()})['trim']();if(_0x1caa48&&!_0x1caa48[_0xea8620(0x34b)](_0xea8620(0x1f4))&&te(_0x1caa48))return _0x1caa48;}catch{}}function Sr(){const _0x4ab08d=_0x14f810;let _0x12cb31=(0x0,$[_0x4ab08d(0x1f7)])(),_0x3b26fd=[process.env.PNPM_HOME,(0x0,f['join'])(_0x12cb31,_0x4ab08d(0x1ea),'pnpm')]['filter'](_0x162fd7=>!!_0x162fd7);return['/usr/local/bin/codex',_0x4ab08d(0x20e),(0x0,f['join'])(_0x12cb31,_0x4ab08d(0x245),_0x4ab08d(0x2bf),'codex'),(0x0,f['join'])(_0x12cb31,_0x4ab08d(0x301),'bin',_0x4ab08d(0x304)),(0x0,f['join'])(_0x12cb31,'.codex','packages',_0x4ab08d(0x2fe),'current','bin','codex'),...Ot()[_0x4ab08d(0x1ec)](_0x262631=>(0x0,f['join'])(_0x262631,_0x4ab08d(0x304))),...$t()[_0x4ab08d(0x1ec)](_0x42dabe=>(0x0,f['join'])(_0x42dabe,'codex')),..._0x3b26fd[_0x4ab08d(0x1ec)](_0x5cdc2c=>(0x0,f['join'])(_0x5cdc2c,'codex'))];}function xr(){const _0x45f321=_0x14f810;if(U){let _0x25ce5f=jt('codex');return _0x25ce5f&&te(_0x25ce5f)?_0x25ce5f:void 0x0;}let _0x29e8e3=_0x43bfc1=>{let _0x219dae=fr(_0x43bfc1);return te(_0x219dae)?_0x219dae:void 0x0;},_0x3b2e6a;for(let _0x2d9e5a of Sr()){let _0x891d5b=_0x29e8e3(_0x2d9e5a);if(_0x891d5b){if(!b(_0x891d5b))return _0x891d5b;_0x3b2e6a=_0x891d5b;}}try{let _0x1bed1d=(0x0,O['execFileSync'])('/usr/bin/which',['codex'],{'timeout':0xbb8,'stdio':'pipe','encoding':_0x45f321(0x242),'env':Ue()})['trim'](),_0x14765f=_0x1bed1d?_0x29e8e3(_0x1bed1d):void 0x0;if(_0x14765f){if(!b(_0x14765f))return _0x14765f;_0x3b2e6a=_0x3b2e6a??_0x14765f;}}catch{}let _0x40bbdd=gr('codex'),_0x3956bf=_0x40bbdd?_0x29e8e3(_0x40bbdd):void 0x0;if(_0x3956bf){if(!b(_0x3956bf))return _0x3956bf;_0x3b2e6a=_0x3b2e6a??_0x3956bf;}return _0x3b2e6a;}function Bt(_0x1d0daa){const _0x3555fa=_0x14f810;return _0x1d0daa===_0x3555fa(0x272)?_0x3555fa(0x2c4):_0x3555fa(0x293);}function Tr(_0x4004bb){let _0x5a1237=process.env[Bt(_0x4004bb)];return _0x5a1237||(_0x4004bb==='claude'?yr()??null:xr()??null);}function Wt(_0x4768b9){let _0x14e3d7=null,_0x40ff66=0x0;return()=>{const _0x1c90e4=_0x119c;let _0x48608b=process.env[Bt(_0x4768b9)];if(_0x48608b)return _0x48608b;let _0x513575=Date[_0x1c90e4(0x2df)]();return(!_0x14e3d7||_0x513575-_0x40ff66>dr||!(0x0,v['existsSync'])(_0x14e3d7)||b(_0x14e3d7))&&(_0x14e3d7=Tr(_0x4768b9)??_0x4768b9,_0x40ff66=_0x513575),_0x14e3d7;};}var Pi=Wt(_0x14f810(0x272)),Fi=Wt('codex');function I(_0xd587f9){return!_0xd587f9||typeof _0xd587f9!='object'||Array['isArray'](_0xd587f9)?null:_0xd587f9;}function ne(_0x3079ee){const _0x4e15f3=_0x14f810;let _0x20774f=Number(_0x3079ee);return Number[_0x4e15f3(0x32d)](_0x20774f)?_0x20774f:null;}function Ar(_0x5f5c5a){const _0x573b11=_0x14f810;let _0x1dd01b=ne(_0x5f5c5a);return _0x1dd01b===null||_0x1dd01b<=0x0?null:Math[_0x573b11(0x2d6)](_0x1dd01b);}function re(_0x1c09a9){const _0x531917=_0x14f810;let _0x1fade7=I(_0x1c09a9);if(!_0x1fade7)return;let _0x98a75f=ne(_0x1fade7[_0x531917(0x306)]??_0x1fade7['inputTokens']),_0x59e7fd=ne(_0x1fade7[_0x531917(0x33c)]??_0x1fade7['outputTokens']);if(_0x98a75f===null||_0x59e7fd===null)return;let _0x46e807=ne(_0x1fade7['cache_creation_input_tokens']??_0x1fade7['cacheCreationInputTokens']),_0x2e5b3d=ne(_0x1fade7[_0x531917(0x204)]??_0x1fade7['cacheReadInputTokens']),_0x3c5c94=Ar(_0x1fade7[_0x531917(0x31f)]??_0x1fade7['model_context_window']??_0x1fade7['contextWindowTokens']);return{'inputTokens':_0x98a75f,'outputTokens':_0x59e7fd,..._0x46e807!==null?{'cacheCreationInputTokens':_0x46e807}:{},..._0x2e5b3d!==null?{'cacheReadInputTokens':_0x2e5b3d}:{},..._0x3c5c94?{'contextWindowTokens':_0x3c5c94}:{}};}function qt(_0xda1e56){const _0xc607a=_0x14f810;let _0x583065=re(_0xda1e56);if(_0x583065&&!(_0x583065['inputTokens']<=0x0&&_0x583065[_0xc607a(0x238)]<=0x0&&(_0x583065['cacheCreationInputTokens']??0x0)<=0x0&&(_0x583065['cacheReadInputTokens']??0x0)<=0x0&&!_0x583065['contextWindowTokens']))return _0x583065;}function Te(_0x3b7af2){const _0x5d373f=_0x14f810;return _0x3b7af2[_0x5d373f(0x1e5)]===0x0&&_0x3b7af2['outputTokens']===0x0&&(_0x3b7af2[_0x5d373f(0x2bd)]??0x0)===0x0&&(_0x3b7af2['cacheReadInputTokens']??0x0)===0x0&&!_0x3b7af2['contextWindowTokens'];}function zt(_0x2f7f45){const _0x4b1405=_0x14f810;let _0x4f7c86=I(_0x2f7f45);if(!_0x4f7c86)return;if(_0x4f7c86['type']===_0x4b1405(0x339)){let _0x4c339f=I(_0x4f7c86['message']);if(_0x4c339f?.['model']==='<synthetic>')return;let _0x1af650=re(_0x4c339f?.[_0x4b1405(0x2b4)]??_0x4f7c86['usage']);return _0x1af650&&!Te(_0x1af650)?_0x1af650:void 0x0;}let _0x439e99=I(_0x4f7c86[_0x4b1405(0x2d7)]),_0x22a4ba=re(_0x439e99?.['usage']);return _0x22a4ba&&!Te(_0x22a4ba)?_0x22a4ba:void 0x0;}function Gt(_0x18d446){const _0x22727c=_0x14f810;let _0x2c1636=I(_0x18d446);if(_0x2c1636?.['type']!=='event_msg')return;let _0x140ac9=I(_0x2c1636['payload']);if(_0x140ac9?.[_0x22727c(0x2d0)]!==_0x22727c(0x22b))return;let _0x3248ff=I(_0x140ac9['info']),_0x338e79=I(_0x3248ff?.[_0x22727c(0x2f1)]);if(_0x338e79)return qt({..._0x338e79,'modelContextWindow':_0x3248ff?.['model_context_window']});}function Ae(_0x5afdf3){const _0x1aa19b=_0x14f810;switch(_0x5afdf3){case'plan':return _0x1aa19b(0x31e);case'acceptEdits':return _0x1aa19b(0x331);case'bypassPermissions':return'autoApprove';case _0x1aa19b(0x344):return'normal';default:return;}}function x(_0x5ca03a){const _0x25461a=_0x14f810;return typeof _0x5ca03a!=_0x25461a(0x2ab)?void 0x0:_0x5ca03a['replace'](/\x1B\[[0-?]*[ -/]*[@-~]/g,'')[_0x25461a(0x2dd)]()||void 0x0;}function Qt(_0x44d539){const _0x2878b4=_0x14f810;let _0x30eb8a=x(_0x44d539);switch(_0x30eb8a){case _0x2878b4(0x2e8):case'low':case'medium':case'high':case'xhigh':case'max':case _0x2878b4(0x26d):return _0x30eb8a;default:return;}}function Nr(_0x59bbd4){const _0x48a99c=_0x14f810;let _0xcd2aa4=typeof _0x59bbd4?.['approval_policy']==_0x48a99c(0x2ab)?_0x59bbd4[_0x48a99c(0x33e)]:'',_0x5c4e6a=_0x59bbd4?.['sandbox_policy'],_0x4bd67e=typeof _0x5c4e6a?.[_0x48a99c(0x2d0)]=='string'?_0x5c4e6a['type']:'',_0x8462b9=Array[_0x48a99c(0x316)](_0x5c4e6a?.['writable_roots'])?_0x5c4e6a['writable_roots']:null;if(_0xcd2aa4===_0x48a99c(0x2ad)&&_0x4bd67e==='danger-full-access')return _0x48a99c(0x21f);if(_0xcd2aa4===_0x48a99c(0x2ca)&&_0x4bd67e==='workspace-write')return _0x8462b9?.[_0x48a99c(0x2d5)]?'normal':'plan';}function Vt(_0x598782){const _0xad6b54=_0x14f810;return _0x598782?.['type']==='permission-mode'?Ae(_0x598782['permissionMode']):Ae(_0x598782?.[_0xad6b54(0x260)]);}function Jt(_0x2f2afd){const _0xe916aa=_0x14f810;if(_0x2f2afd?.[_0xe916aa(0x2d0)]==='turn_context')return Nr(_0x2f2afd[_0xe916aa(0x310)]);}function _0x50b7(){const _0x13d4c2=['CgXHBG','Bw9KzwXdB250zxH0v2LUzg93','zM5Tx211BhrPC2HLBgXZ','y3vZDg9TvgL0Bgu','vw50AxrSzwqGC2vZC2LVBG','lMPZEa','C2vZC2LVBNm','y2XHDwrLlwnVzguTC2vZC2LVBNm','B2jQzwn0','D3jPDgu','BNvTyMvY','zgf0yq','y3DK','yNvU','CM9SBg91Df9WyxrO','AxngAw5PDgu','y2XLyxi','AxnnzxrH','lY5JBgf1zguVChjVAMvJDhmV','ywnJzxb0rwrPDhm','ywrK','zgvIDwC','l29WDc9OB21LyNjLDY9IAw4','BgfZDe1Z','ChjVy2vZCY5Zy2fUlMXZB2zFBxm','DhvYBKzPBMLZAgvK','ioINHUs4UUAvJ+AeN+I3R+w+HooaGUI/MEEXU+AjUEwhHUAxOoAZLEs7JUw3SUACIEs8MUIVNEIUSow9LEMhJoIHPEwBNUwiScbwAwjLBgv044cc6k+36yEn5PAW5OMN6kgm6l+z5QYH5l+U5Ps55BM25zYOienSyxvKzsdKUk3MMi7NOA7MIBNLH4BVVjVLPOlMNPZLUiZMNjVLNkGGvMLIzwXLDcdPH4ZNNiVLIldLRQhMIBNLVlNNQPFVViZOR7FKU44GvMLIzwXLDcdLKk/LIQJMIjBNU6FNU63OV5NKUkRKVjROR53JGii','yxnZAxn0yw50','CgfPCMLUz3mUANnVBG','DhjPBuvUza','B3v0Chv0x3rVA2vUCW','yNLdBgLtzxnZAw9Uswq','yxbWCM92ywXFCg9SAwn5','BNbT','l3vZCI9IAw4','mZu0mdq4nu1AC2LmuG','z3rPBwvVDxq','uhjVy2vZC0LKlenVBw1HBMrmAw5L','zgvMyxvSDa','DxbKyxrL','q0Xbvurfx0nprevFru5uuLLqt0Lova','Cgf0Aa','zw50CMLLCW','zgvZDhjVEwvK','DMvYC2LVBNm','Aw5JBhvKzxm','yxjJAgL2zwq','A2LSBgvK','Dg9VBf91C2u','lNnHC3m','y3vZDg9Tx3rVB2XFy2fSBf9VDxrWDxq','zxH0zxjUywXbCMnOAxzLza','C3rYAw5NAwz5','y29UzMLKzw5Jzq','lMPZB25S','AhLKCMf0zwrdyw5KAwrHDgvZ','DgLTzxjZ','rvnsq0G','z2f1z2vZ','pgXVy2fSlwnVBw1HBMqTC3rKB3v0pG','iYbbr0vovfmUBwqGAw5ZDhj1y3rPB25ZigzVCIa','mJC3mda2vw9bD0zZ','C3rKzxjY','Aw5WDxruB2TLBNm','lNbS','l2jPBG','y2HPBgq','y2f0y2G','tgLICMfYEq','nJa2ndKWz2nitvPp','BwfW','Dg9ju09tDhjPBMC','CgLK','uefusa','BM9Kzs12zxjZAw9UCW','lNbOCa','nLLlD2PiAG','lMHWCa','y211Ea','BxrPBwvnCW','DhvYBLn0yxj0zwq','Ag9TzwrPCG','BM9Kzq','y29Kzq','lNLHBwW','C3rYDwn0DxjLzfbHDgnO','lMnVzgv4','Dg9VBf91C2vFAwq','zNjVBq','y29HBgvZy2vdB25Zzwn1DgL2zufZC2LZDgfUDa','D3jPDgfIBgu','DMfSDwu','Dgv4Da','ls1LEhbLCMLTzw50ywWTBg9HzgvY','y2fJAgvFCMvHzf9PBNb1Df90B2TLBNm','ChjVy2vZCYbZy2fUignVBw1HBMqGzMfPBgvK','ChjVy2vZCW','CgLWzq','zMfPBgvKihrVigXPC3qGy2XHDwrLihnLC3nPB25Z','ls1SAxn0zw49','C2vZC2LVBL9TzxrH','C29YDa','C2vZC2LVBKLK','lwPZB24','l29WDc9OB21LyNjLDY9IAw4Vy29KzxG','AgfZ','y3vYCMvUDa','DxnLCL9TzxnZywDL','C2v0','AxnbCMnOAxzLza','lMv4zq','zMfSBgjHy2TmB29RDxbZ','ChjVy2vZCY1Zy2fUBMvY','CMvZCg9UC2vFAxrLBq','C25HChnOB3q','AxnszxnWB25KAw5N','A2LUza','pgXVy2fSlwnVBw1HBMqTy2f2zwf0pG','l3vZCI9SB2nHBc9IAw4','CgfYC2u','se9nrq','yxv0B0fWChjVDMu','C2TPChbLzfbYB2nLC3nezxrHAwXZ','DgL0Bgu','y3jLyxrLzefMDgvYtxm','u0Lhs0Lmta','yMfZAa','ENnO','y2XVC2u','C3rHDhvZ','zNvUy3rPB25Fy2fSBa','luzU','tM8GC3vJAcbWCM9JzxnZ','Dg9Rzw5Fy291BNq','C3fSAxrLmW','zxHWAxjLC0f0','DgLTzw91Da','BgfZDfvZzwrbDa','AwrLBNrPDhKUANnVBG','zgv2AwnLlxbYB2zPBgvZlMPZB24','zMLZAa','BM9KztP3B3jRzxjFDgHYzwfKCW','Aw50zxjYDxb0zwq','zgfLBw9UlNn0zg91Dc5SB2C','y29TBwfUzcaTDIa','C3vTBwfYEq','B3v0Chv0vg9Rzw5Z','C3rHDa','lxHJ','B3jPz2LUyxrVCG','C29Tzq','zxHPC3rZu3LUyW','yNvZEq','C3rHCNruAw1L','B3bLBG','BwnWx3rVB2XFy2fSBf9LBMq','DxrMltG','lMT0CW','BgfZDfvZywDL','lM5WBs1NBg9IywW','AgLNAa','lMnSyxvKzq','DgfZA19JB21WBgv0zq','C2L6zq','zMfPBgvKihrVihjLywqGy29KzxGGC2vZC2LVBIbOAxn0B3j5','zM5T','mtiXmtaWmejcEKzjrG','C3rHCNruAw1LCG','CMvHzezPBgu','lwXJ','Aw5ZDgfSBgf0Aw9U','mJy4mdnQAw1jB2e','lNrZEa','lNzPyMvSzxq','zgLYzwn0q2fUzgLKyxrLCW','zxzLBNrFBxnN','ls1SAxn0zw4','BM9KztPMCY9WCM9TAxnLCW','zgfLBw9U','yM9VBgvHBG','Bwf4','zMLUza','ywXSig9Jy3vYCMvUy2vZihDLCMuGC3vJy2vZC2z1BgX5ihjLCgXHy2vK','C2vZC2LVBKzPBgvqyxrO','yxjNDG','zMfSBgjHy2TiAxrZ','CgvYBwLZC2LVBK1Vzgu','zMfPBgvKihrVihjLywqGC2vZC2LVBIbYDw50Aw1LigHPBNrZ','DgfZA19ZDgfYDgvK','zwzMB3j0','C3vIywDLBNq','uM9HBwLUzW','AxngAwXL','lMHYBa','zgvSAw1PDgvY','pgnVBw1HBMqTBMfTzt4','ChvZAa','BgfZDefJDgL2Axr5qxq','AgfZt3DU','DwX0CMe','zMLUywXSEq','D2fYBG','oxbUEuHzrW','y291BNrLCNm','y2XHDwrL','l2jPBI9ZAa','C3rHCNrZv2L0Aa','C3rVCfbLCMLVzgLJtg9N','lI4U','DhvYBL9Pza','zw5KC1DPDgG','Bw9KzwW','ru5pru5u','lMv4CW','Aw5MBW','BM9KztPVCW','C2XPy2u','y29KzxGTBgf0zxn0oG','z2f1z2u','C3vJy2vZC2z1BgX5ihjLCgXHy2vK','BMfTzq','CMvHBhbHDgHtEw5J','C3bSAxq','BM9KztPJAgLSzf9WCM9JzxnZ','CMvHza','Cg9ZDe1LC3nHz2u','lNnJC3m','CMvZB2X2zq','lM1T','z2v0','AM9PBG','lMXLC3m','yMfZzw5HBwu','DgvZDa','lNHTBa','B3jPz2LUq3DK','BwvKAxvT','q09ervHFuefusa','lMX1yq','lMrHCNq','lNz1zq','ChjVy2vZC19JB21WBgv0zq','zMfPBgvKihrVihDHBgSGy29KzxGGC2vZC2LVBNmGzgLY','Bg9JywXLq29TCgfYzq','BM9KztPYzwfKBgLUzq','yMLYDgH0Aw1Ltxm','BgfIzwXZ','AxneAxjLy3rVCNK','yxjNCW','DgL0BgvbBgLHC2vZ','y29TBwfUza','Bwf0y2HbBgW','DxnLCLbYB21WDa','Bwv0yq','yxjJAgL2zwrcEuLK','zxjYB3i','ntiWndHYu095rNm','lY5JB2rLEc9ZzxnZAw9UCY8','Ag9Tzq','zxHLy0zPBgvtEw5J','CgfYzw50vxvPza','C3rYAw5N','BhnVzK1Z','BMv2zxi','zMfPBgvKihrVigXPC3qGy29KzxGGC2vZC2LVBNm','lwLJ','D2LUmZi','Dg90ywXnCW','pgvUDMLYB25Tzw50x2nVBNrLEhq+','ls1LDMfS','DxnHz2u','zw52','lwLSyW','C3rVCf9YzwfZB24','Dg9VBf9Yzxn1Bhq','ywn0AxzPDhK','lMnWCa','zMfSBgjHy2TnCW','ywXS','y2fJAgvdCMvHDgLVBKLUChv0vg9Rzw5Z','zMLSzvbHDgG','yMLU','Aw5KzxHpzG','DMfSDwvZ','CMvZDw1Lu2vZC2LVBG','Cg5WBq','q0Xbvurfx1bbveG','B2XKu3rYAw5N','yNLjza','l3n1yMfNzw50CY8','C2nHBM5LCG','DgLTzxn0yw1W','B24TCMvXDwvZDa','CNvUDgLTzq','Aw52zw50B3j5ihnJyw4GD29YA2vYihjLCxvPCMvZigeGCgfYzw50ihbVCNq','zgvSzxrL','DgvYBwLUywWTy29UDhjVBc10B2TLBG','BM9KztPWyxrO','DhLWzq','l2jPBI96C2G','CMvWBgfJzufSBa','CgXHDgzVCM0','y3jLyxrLsw50zxjMywnL','BgvUz3rO','zMXVB3i','Dg9VBfvZzvjLC3vSDa','Bg9Nsw50zxj2ywW','Dg9VBfjLC3vSDa','lNLTBa','yxbWCM92ywXnB2rL','lMzPC2G','DhjPBq','l29WDc9OB21LyNjLDY9IAw4Vy2XHDwrL','BM93','CMvWBgfJzq','y29UDgvUDa','phn5C3rLBs1Yzw1PBMrLCJ4','ywDLBNq','C25HChnOB3rZ','CM9Szq','AgfZigjLzw4Gy3jLyxrLza','mJaWmefVsfPKAG','BwLUAw1HBa','Aw5WDxq','lMPZB24','lM1QCW','lNb5','y2XPu2vZC2LVBKLK','BwvZC2fNzq','CgfYzw50x3rOCMvHzf9Pza','y3jLyxrLzef0','BgfZDf90B2TLBL91C2fNzq','ls1WzxjTAxnZAw9Ulw1Vzgu','C291CMnL','DhvYBL9HyM9YDgvK','C3rHDgvFns5ZCwXPDgu','zxHLy0zPBgu','Bwf0y2G','l2jPBI9IyxnO','mtm0mdeZmfzbwfv5Ea','qxbWrgf0yq','ls1Kyw5NzxjVDxnSEs1ZA2LWlxbLCM1PC3nPB25Z','DgvYBwLUywW','lNbZmq','C3rHBMrHBg9Uzq','pgnVBw1HBMqTBwvZC2fNzt4','BM9KztPMCW','lMXVy2fS','u0Lhvevstq','C3rHCNrLzef0','y29KzxG','zMLSDgvY','Aw5WDxrFDg9Rzw5Z','ls1WzxjTAxnZAw9Ulw1Vzgu9','Dg9VBf9ZzwfYy2HFy2fSBa','DgHYzwfKx3nWyxDU','C2LNBMfS','Dg9mB3DLCKnHC2u','mtm4Bhz5Bw1O','CMvZCg9UzgLUzW','BhnVzG','CgfJA2fNzxm','Cgf5Bg9Hza','C3rVCeHVB2S','DxnLCG','ChjVAMvJDhm','BwLU','CMvHzgrPCG','AxnbCNjHEq','zxHLyW','pgnVBw1HBMqTyxjNCZ4','DxbKyxrLzef0','ChjVy2vZCYbZy2fUignVBw1HBMqGC2TPChbLzcdIGjqGChjVy2vZCYbLEgL0zwq','CgfPCMLUzY1XCI5WBMC','Dg9tDhjPBMC','BwLUtxm'];_0x50b7=function(){return _0x13d4c2;};return _0x50b7();}function Kt(_0x25a513){return Gt(_0x25a513);}function Xt(_0x2a997b){return zt(_0x2a997b);}var Dr=new Set(['New\x20session','Resumed\x20session',_0x14f810(0x322)]),Ur=[_0x14f810(0x2b2),_0x14f810(0x21b),'<local-command-stdout>','<local-command-stderr>',_0x14f810(0x269),_0x14f810(0x2ff),_0x14f810(0x318),_0x14f810(0x1e2)];function Or(_0x5a5c17){return _0x5a5c17['replace'](/\s+/g,'\x20')['trim']();}function R(_0x13472c){const _0x5c1505=_0x14f810;return typeof _0x13472c!=_0x5c1505(0x2ab)?void 0x0:Or(_0x13472c)||void 0x0;}function Oe(_0x363c51){let _0x2280ac=R(_0x363c51);return _0x2280ac?/^[0-9a-f]{8,}$/i['test'](_0x2280ac)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x2280ac)||/^agent-[a-z0-9_-]{6,}$/i['test'](_0x2280ac):!0x1;}function $e(_0x2d139d){let _0x47b363=R(_0x2d139d);return!_0x47b363||Dr['has'](_0x47b363)||Oe(_0x47b363);}function $r(_0x3f57f6){const _0x45e524=_0x14f810;for(let _0x3f4ac5 of _0x3f57f6['replace'](/\r/g,'')[_0x45e524(0x284)]('\x0a')){let _0x156e9a=R(_0x3f4ac5);if(_0x156e9a&&!Hr(_0x156e9a)&&!jr(_0x156e9a))return _0x156e9a;}}function Hr(_0x180f7a){return Ur['some'](_0x1fa9a2=>_0x180f7a['startsWith'](_0x1fa9a2));}function jr(_0x35b920){const _0x4ee978=_0x14f810;let _0x31f0e4=_0x35b920[_0x4ee978(0x2e0)](/^['"`]+/,'')['replace'](/['"`\\]+$/,'')['trim']();return!!(!_0x31f0e4||/^(\/|~\/|\.\/|\.\.\/)/[_0x4ee978(0x28f)](_0x31f0e4)||/^[A-Za-z]:\\/['test'](_0x31f0e4));}function Br(_0x2454c4){const _0x30e88c=_0x14f810;for(let _0xb60fa4=0x0;_0xb60fa4<_0x2454c4[_0x30e88c(0x2d5)];_0xb60fa4+=0x1){let _0x243128=_0x2454c4[_0xb60fa4];if(_0x243128==='。'||_0x243128==='!'||_0x243128==='?'||_0x243128===';')return _0xb60fa4+0x1;if(_0x243128==='.'||_0x243128==='!'||_0x243128==='?'||_0x243128===';'){let _0x376986=_0x2454c4[_0xb60fa4+0x1];if(!_0x376986||/\s/['test'](_0x376986))return _0xb60fa4+0x1;}}return-0x1;}function Yt(_0x4204a9,_0xc24b24=0x50){const _0x5a0304=_0x14f810;if(typeof _0x4204a9!=_0x5a0304(0x2ab))return;let _0x2e37eb=$r(_0x4204a9);if(!_0x2e37eb)return;let _0x103e72=Br(_0x2e37eb),_0x2f4991=(_0x103e72>0x0?_0x2e37eb['slice'](0x0,_0x103e72):_0x2e37eb)['replace'](/[。!?;.!?;]+$/gu,'')['trim']();if(!(!_0x2f4991||Oe(_0x2f4991)))return _0x2f4991[_0x5a0304(0x2d5)]<=_0xc24b24?_0x2f4991:_0x2f4991[_0x5a0304(0x27e)](0x0,Math['max'](0x1,_0xc24b24-0x3))[_0x5a0304(0x33b)]()+_0x5a0304(0x276);}function P(_0x5402b2,_0xcb7f5b){for(let _0x1796d9 of _0x5402b2){let _0x2ac60a=R(_0x1796d9);if(!(!_0x2ac60a||$e(_0x2ac60a)))return _0x2ac60a;}return Yt(_0xcb7f5b);}var Zt='<vibelet-resume-after-approval>';function Ce(_0x3376d1){return _0x3376d1['replace'](/[^a-zA-Z0-9]/g,'-');}async function tn(){const _0x19101=_0x14f810;let _0x433804=await De(),_0x4e469b=await M(_0x433804,A,async _0x30a848=>{const _0x116303=_0x119c;try{let _0x1a1670=JSON['parse'](await(0x0,en[_0x116303(0x24e)])(_0x30a848,'utf-8')),_0x5390f0=x(_0x1a1670['cliSessionId']);if(!_0x5390f0)return null;let _0x20237d=R(x(_0x1a1670[_0x116303(0x221)])),_0x488117={'cliSessionId':_0x5390f0},_0x3e7851=x(_0x1a1670[_0x116303(0x20c)]),_0x115003=x(_0x1a1670[_0x116303(0x32a)]),_0x38330a=x(_0x1a1670['originCwd']),_0x161856=x(_0x1a1670[_0x116303(0x279)]),_0x530b76=Qt(_0x1a1670['effort']),_0x4a3455=Ae(x(_0x1a1670['permissionMode']));return _0x3e7851&&(_0x488117['localSessionId']=_0x3e7851),_0x115003&&(_0x488117[_0x116303(0x32a)]=_0x115003),_0x38330a&&(_0x488117['originCwd']=_0x38330a),_0x20237d&&(_0x488117[_0x116303(0x221)]=_0x20237d),_0x161856&&(_0x488117['model']=_0x161856),_0x530b76&&(_0x488117['effort']=_0x530b76),_0x4a3455&&(_0x488117[_0x116303(0x2db)]=_0x4a3455),typeof _0x1a1670['isArchived']==_0x116303(0x259)&&(_0x488117[_0x116303(0x1d9)]=_0x1a1670[_0x116303(0x213)]),_0x488117;}catch{return null;}}),_0x5907d7=new Map();for(let _0x53ca7d of _0x4e469b)_0x53ca7d&&_0x5907d7[_0x19101(0x212)](_0x53ca7d[_0x19101(0x2ed)],_0x53ca7d);return{'byCliSessionId':_0x5907d7};}function nn(_0x5bdf6f,_0x1e94e3){const _0x1b6e02=_0x14f810;if(!_0x1e94e3)return _0x5bdf6f;let _0x25f5a3=[..._0x5bdf6f[_0x1b6e02(0x29f)]??[],..._0x5bdf6f['title']&&_0x1e94e3[_0x1b6e02(0x221)]&&_0x5bdf6f[_0x1b6e02(0x221)]!==_0x1e94e3[_0x1b6e02(0x221)]?[_0x5bdf6f['title']]:[]];return{..._0x5bdf6f,..._0x1e94e3[_0x1b6e02(0x32a)]?{'cwd':_0x1e94e3[_0x1b6e02(0x32a)]}:{},..._0x1e94e3['originCwd']?{'originCwd':_0x1e94e3['originCwd']}:{},..._0x1e94e3['model']?{'model':_0x1e94e3['model']}:{},..._0x1e94e3[_0x1b6e02(0x263)]?{'effort':_0x1e94e3['effort']}:{},..._0x1e94e3[_0x1b6e02(0x221)]?{'title':_0x1e94e3[_0x1b6e02(0x221)]}:{},..._0x25f5a3['length']?{'titleAliases':_0x25f5a3}:{},..._0x1e94e3['approvalMode']?{'approvalMode':_0x1e94e3[_0x1b6e02(0x2db)]}:{},'originator':'Claude\x20Desktop',...typeof _0x1e94e3['externalArchived']=='boolean'?{'externalArchived':_0x1e94e3[_0x1b6e02(0x1d9)]}:{}};}var sn=require('node:child_process'),on=require(_0x14f810(0x257)),Be=require('node:os'),We=require('node:path'),an=require('node:util'),Wr=h[_0x14f810(0x1e8)]({'module':'scanner'}),rn=(0x0,an['promisify'])(sn['execFile']),qr=0x7530,V=null,se=null,He='';function je(){return{'byId':new Map(),'byRolloutPath':new Map(),'archivedById':new Map(),'archivedByRolloutPath':new Map()};}function zr(_0x33d6f3){const _0x1c2b05=_0x14f810;return _0x33d6f3['startsWith']('~/')?(0x0,We[_0x1c2b05(0x28c)])((0x0,Be['homedir'])(),_0x33d6f3['slice'](0x2)):_0x33d6f3;}function ln(_0x30590c,_0x98861e,_0xdf8491){const _0x1f93b7=_0x14f810;if(_0x30590c)return _0x30590c[_0x1f93b7(0x2c6)]['get'](_0x98861e)??_0x30590c['byRolloutPath']['get'](_0xdf8491);}function cn(_0x5c244a,_0x519d95,_0x33f821){const _0x530da6=_0x14f810;if(_0x5c244a)return _0x5c244a[_0x530da6(0x2a4)]['get'](_0x519d95)??_0x5c244a['archivedByRolloutPath']['get'](_0x33f821);}function un(){V=null;}async function qe(){const _0x4a9fc3=_0x14f810;let _0x1236de=Date[_0x4a9fc3(0x2df)](),_0x1140a5=(0x0,Be['homedir'])();if(V&&V[_0x4a9fc3(0x2a8)]===_0x1140a5&&_0x1236de<=V['expiresAt'])return V[_0x4a9fc3(0x201)];if(se&&He===_0x1140a5)return se;He=_0x1140a5,se=((async()=>{const _0x5478be=_0x4a9fc3;let _0x423c7d=(0x0,We[_0x5478be(0x28c)])(_0x1140a5,_0x5478be(0x1fc),_0x5478be(0x2f5));if(!(await(0x0,on['stat'])(_0x423c7d)[_0x5478be(0x1e9)](()=>null))?.[_0x5478be(0x266)]())return je();try{let _0x36899c='';try{({stdout:_0x36899c}=await rn(_0x5478be(0x22c),[_0x5478be(0x20d),_0x423c7d,'select\x20id,\x20title,\x20rollout_path,\x20archived\x20from\x20threads'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}catch{({stdout:_0x36899c}=await rn(_0x5478be(0x22c),[_0x5478be(0x20d),_0x423c7d,'select\x20id,\x20title,\x20rollout_path\x20from\x20threads\x20where\x20coalesce(title,\x20\x27\x27)\x20<>\x20\x27\x27'],{'timeout':0x7d0,'maxBuffer':0x4*0x400*0x400}));}let _0x427bb=JSON['parse'](_0x36899c||'[]'),_0x2954bd=je();for(let _0x3a3097 of _0x427bb){if(typeof _0x3a3097['id']!='string')continue;let _0x451ad3=R(typeof _0x3a3097['title']==_0x5478be(0x2ab)?_0x3a3097['title']:void 0x0);_0x451ad3&&_0x2954bd['byId']['set'](_0x3a3097['id'],_0x451ad3);let _0x252e22=typeof _0x3a3097['rollout_path']=='string'&&_0x3a3097[_0x5478be(0x32c)][_0x5478be(0x2dd)]()?zr(_0x3a3097[_0x5478be(0x32c)]):'';if(_0x252e22&&_0x451ad3&&_0x2954bd['byRolloutPath'][_0x5478be(0x212)](_0x252e22,_0x451ad3),typeof _0x3a3097['archived']==_0x5478be(0x328)||typeof _0x3a3097[_0x5478be(0x34c)]==_0x5478be(0x259)){let _0x13e6dc=_0x3a3097[_0x5478be(0x34c)]===!0x0||_0x3a3097[_0x5478be(0x34c)]===0x1;_0x2954bd[_0x5478be(0x2a4)][_0x5478be(0x212)](_0x3a3097['id'],_0x13e6dc),_0x252e22&&_0x2954bd['archivedByRolloutPath']['set'](_0x252e22,_0x13e6dc);}}return _0x2954bd;}catch(_0x3905bd){return Wr['debug']({'error':String(_0x3905bd)},'failed\x20to\x20read\x20codex\x20thread\x20titles\x20from\x20sqlite'),je();}})());try{let _0x3da752=await se;return V={'value':_0x3da752,'expiresAt':Date[_0x4a9fc3(0x2df)]()+qr,'home':_0x1140a5},_0x3da752;}finally{se=null,He='';}}var fn=require(_0x14f810(0x300)),J=require('node:fs/promises'),pn=require(_0x14f810(0x29a));function*ie(_0x16c97d,_0x4667d1){const _0x3c9bd0=_0x14f810;let _0x41a38b=0x0,_0x2e8c2c=0x0;for(;_0x41a38b<_0x16c97d['length']&&_0x2e8c2c<_0x4667d1;){let _0x4258a1=_0x16c97d[_0x3c9bd0(0x2c0)]('\x0a',_0x41a38b);_0x4258a1===-0x1&&(_0x4258a1=_0x16c97d[_0x3c9bd0(0x2d5)]);let _0x2a58be=_0x16c97d['substring'](_0x41a38b,_0x4258a1);_0x41a38b=_0x4258a1+0x1,!(_0x2a58be[_0x3c9bd0(0x2d5)]===0x0||_0x2a58be[_0x3c9bd0(0x2dd)]()['length']===0x0)&&(yield _0x2a58be,_0x2e8c2c+=0x1);}}var ze=0x200*0x400,dn=0x100*0x400;async function we(_0x2566fb,_0x5ada32){const _0xd2955a=_0x14f810;if(_0x5ada32<=ze)return(0x0,J[_0xd2955a(0x24e)])(_0x2566fb,_0xd2955a(0x242));let _0x54abca=await(0x0,J[_0xd2955a(0x240)])(_0x2566fb,'r');try{let _0x58ce8e=Buffer['alloc'](ze),{bytesRead:_0x4b2a12}=await _0x54abca['read'](_0x58ce8e,0x0,ze,0x0);return _0x58ce8e[_0xd2955a(0x31c)]('utf-8',0x0,_0x4b2a12);}finally{await _0x54abca['close']();}}async function Ge(_0x296911,_0x6d184b){const _0x44043c=_0x14f810;if(_0x6d184b<=dn)return(0x0,J['readFile'])(_0x296911,'utf-8');let _0x4d53a5=await(0x0,J['open'])(_0x296911,'r');try{let _0x351a13=Math[_0x44043c(0x25a)](0x0,_0x6d184b-dn),_0x1b8875=Buffer['alloc'](_0x6d184b-_0x351a13),{bytesRead:_0x36f4c9}=await _0x4d53a5[_0x44043c(0x286)](_0x1b8875,0x0,_0x1b8875[_0x44043c(0x2d5)],_0x351a13);return _0x1b8875[_0x44043c(0x31c)]('utf-8',0x0,_0x36f4c9);}finally{await _0x4d53a5[_0x44043c(0x226)]();}}async function H(_0x28d745,_0x144ccd){const _0x46cf37=_0x14f810;let _0x5e6b6c=(0x0,fn['createReadStream'])(_0x28d745,{'encoding':'utf-8'}),_0x48483f=(0x0,pn[_0x46cf37(0x2d4)])({'input':_0x5e6b6c,'crlfDelay':0x1/0x0});try{for await(let _0x315034 of _0x48483f){if(!_0x315034['trim']())continue;let _0x24c780;try{_0x24c780=JSON[_0x46cf37(0x21d)](_0x315034);}catch{continue;}if(_0x144ccd(_0x24c780))break;}}finally{_0x48483f[_0x46cf37(0x226)](),_0x5e6b6c['destroy']();}}function F(_0x499f08){const _0x54a3b6=_0x14f810;return typeof _0x499f08==_0x54a3b6(0x2ab)?_0x499f08:Array[_0x54a3b6(0x316)](_0x499f08)?_0x499f08[_0x54a3b6(0x1ec)](_0x9d9206=>!_0x9d9206||typeof _0x9d9206!=_0x54a3b6(0x326)?'':typeof _0x9d9206['text']==_0x54a3b6(0x2ab)?_0x9d9206['text']:typeof _0x9d9206['content']==_0x54a3b6(0x2ab)?_0x9d9206[_0x54a3b6(0x2e1)]:'')[_0x54a3b6(0x28c)](''):'';}function oe(_0x4f17fe){const _0x1f2b85=_0x14f810;return _0x4f17fe?.['type']===_0x1f2b85(0x217)&&_0x4f17fe[_0x1f2b85(0x310)]?.['type']===_0x1f2b85(0x2ee)&&_0x4f17fe['payload'][_0x1f2b85(0x2e5)]===_0x1f2b85(0x312)?F(_0x4f17fe[_0x1f2b85(0x310)][_0x1f2b85(0x2e1)]):_0x4f17fe?.[_0x1f2b85(0x2d0)]===_0x1f2b85(0x255)&&_0x4f17fe[_0x1f2b85(0x310)]?.[_0x1f2b85(0x2d0)]===_0x1f2b85(0x211)&&typeof _0x4f17fe[_0x1f2b85(0x310)]['message']=='string'?_0x4f17fe['payload']['message']:'';}function j(_0x2050ee){const _0x5b5649=_0x14f810;return typeof _0x2050ee==_0x5b5649(0x2ab)?_0x2050ee:Array['isArray'](_0x2050ee)?_0x2050ee[_0x5b5649(0x1ec)](_0x2ba75b=>!_0x2ba75b||typeof _0x2ba75b!=_0x5b5649(0x326)||_0x2ba75b['type']!==_0x5b5649(0x202)?'':typeof _0x2ba75b['text']=='string'?_0x2ba75b['text']:'')[_0x5b5649(0x28c)](''):'';}var Gr=/^\[Attached image: ([^\n]+)\]$/gm;function Qr(_0x3d5f3e){const _0x967c6d=_0x14f810;let _0x3f91e9=[],_0x4a81b4=new Set();for(let _0x568d7a of _0x3d5f3e[_0x967c6d(0x2a1)](Gr)){let _0x1df3b8=_0x568d7a[0x1];!_0x1df3b8||_0x1df3b8['trim']()[_0x967c6d(0x2d5)]===0x0||_0x4a81b4['has'](_0x1df3b8)||(_0x4a81b4[_0x967c6d(0x332)](_0x1df3b8),_0x3f91e9['push'](_0x1df3b8));}return _0x3f91e9;}function mn(_0x54450d){const _0x3c9108=_0x14f810;if(_0x54450d[_0x3c9108(0x2e5)]!=='user')return _0x54450d;let _0x441572=[..._0x54450d['images']??[],...Qr(_0x54450d['content'])][_0x3c9108(0x305)]((_0x49458f,_0x3e12e4,_0xb296eb)=>_0x49458f&&_0xb296eb[_0x3c9108(0x2c0)](_0x49458f)===_0x3e12e4);return _0x441572['length']?{..._0x54450d,'images':_0x441572}:_0x54450d;}var Vr=['<task-notification>','<local-command-caveat>',_0x14f810(0x1e1),'<local-command-stderr>',_0x14f810(0x269),'<command-message>','<command-args>',_0x14f810(0x2e2),'<environment_context>',Zt],gn=/^#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,Jr=/(?:^|\n)#{1,6}\s*AGENTS\.md instructions(?:\b|$)/,Kr=/<environment_context>[\s\S]*<\/environment_context>/,Xr=/<INSTRUCTIONS>[\s\S]*<\/INSTRUCTIONS>/;function _0x119c(_0x81386c,_0x52f9ee){_0x81386c=_0x81386c-0x1d8;const _0x50b751=_0x50b7();let _0x119c5b=_0x50b751[_0x81386c];if(_0x119c['naAljH']===undefined){var _0x4b13f3=function(_0x54569b){const _0x4a2760='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b0d6e='',_0x3f0261='';for(let _0x5c05c9=0x0,_0xf59bf3,_0x4b7d43,_0x14b2c3=0x0;_0x4b7d43=_0x54569b['charAt'](_0x14b2c3++);~_0x4b7d43&&(_0xf59bf3=_0x5c05c9%0x4?_0xf59bf3*0x40+_0x4b7d43:_0x4b7d43,_0x5c05c9++%0x4)?_0x1b0d6e+=String['fromCharCode'](0xff&_0xf59bf3>>(-0x2*_0x5c05c9&0x6)):0x0){_0x4b7d43=_0x4a2760['indexOf'](_0x4b7d43);}for(let _0x5a39ba=0x0,_0x49e8ea=_0x1b0d6e['length'];_0x5a39ba<_0x49e8ea;_0x5a39ba++){_0x3f0261+='%'+('00'+_0x1b0d6e['charCodeAt'](_0x5a39ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3f0261);};_0x119c['dRWzqJ']=_0x4b13f3,_0x119c['RgBmUl']={},_0x119c['naAljH']=!![];}const _0x305c84=_0x50b751[0x0],_0x30f90d=_0x81386c+_0x305c84,_0x11051a=_0x119c['RgBmUl'][_0x30f90d];return!_0x11051a?(_0x119c5b=_0x119c['dRWzqJ'](_0x119c5b),_0x119c['RgBmUl'][_0x30f90d]=_0x119c5b):_0x119c5b=_0x11051a,_0x119c5b;}function Yr(_0x1753ff,_0x243a57){const _0xb77661=_0x14f810;if(_0x1753ff?.['isMeta']===!0x0)return!0x0;let _0x35cad8=_0x243a57[_0xb77661(0x2dd)]();return _0x35cad8?gn[_0xb77661(0x28f)](_0x35cad8)||Vr[_0xb77661(0x23c)](_0x2574fa=>_0x35cad8['startsWith'](_0x2574fa)):!0x1;}function B(_0x3ad278){const _0x50e39f=_0x14f810;if(_0x3ad278?.['type']!==_0x50e39f(0x312)||_0x3ad278[_0x50e39f(0x2ee)]?.['role']!=='user')return'';let _0x522a71=j(_0x3ad278[_0x50e39f(0x2ee)][_0x50e39f(0x2e1)]);return Yr(_0x3ad278,_0x522a71)?'':_0x522a71;}function hn(_0x3dc336){const _0x1204e0=_0x14f810;return Array[_0x1204e0(0x316)](_0x3dc336)&&_0x3dc336[_0x1204e0(0x23c)](_0x2fe25f=>_0x2fe25f&&typeof _0x2fe25f==_0x1204e0(0x326)&&_0x2fe25f[_0x1204e0(0x2d0)]===_0x1204e0(0x2b8));}function Zr(_0x398d9f){const _0x567080=_0x14f810;return Array[_0x567080(0x316)](_0x398d9f)?_0x398d9f[_0x567080(0x1ec)](_0x31be1f=>{const _0x5dd125=_0x567080;if(!_0x31be1f||typeof _0x31be1f!=_0x5dd125(0x326)||_0x31be1f['type']!=='tool_result')return'';let _0x311a08=_0x31be1f[_0x5dd125(0x2e1)];return typeof _0x311a08=='string'?_0x311a08:Array['isArray'](_0x311a08)?_0x311a08['map'](_0x2a200e=>!_0x2a200e||typeof _0x2a200e!=_0x5dd125(0x326)?'':typeof _0x2a200e['text']=='string'?_0x2a200e['text']:typeof _0x2a200e[_0x5dd125(0x2e1)]==_0x5dd125(0x2ab)?_0x2a200e['content']:'')['filter'](Boolean)[_0x5dd125(0x28c)]('\x0a'):'';})[_0x567080(0x305)](Boolean)['join']('\x0a'):'';}function es(_0x2c98f4){const _0x3c41c3=_0x14f810;return Array[_0x3c41c3(0x316)](_0x2c98f4)?_0x2c98f4[_0x3c41c3(0x1ec)](_0xe58d92=>!_0xe58d92||typeof _0xe58d92!='object'?'':typeof _0xe58d92['text']==_0x3c41c3(0x2ab)?_0xe58d92['text']:typeof _0xe58d92[_0x3c41c3(0x2e1)]=='string'?_0xe58d92[_0x3c41c3(0x2e1)]:'')['filter'](Boolean)['join']('\x0a'):'';}function Qe(_0x14516d){const _0x2206d3=_0x14f810;if(typeof _0x14516d==_0x2206d3(0x2ab))return _0x14516d;let _0x42b5ec=es(_0x14516d);return _0x42b5ec||(Array['isArray'](_0x14516d)&&_0x14516d['length']>0x0&&_0x14516d['every'](_0x487568=>_0x487568&&typeof _0x487568=='object'&&_0x487568[_0x2206d3(0x2d0)]==='tool_reference')?'':JSON['stringify'](_0x14516d));}var ts=/Claude requested permissions to (?:edit|write to) (.+?) which is a sensitive file\.?$/i;function yn(_0x565cfe){const _0x3b1bf4=_0x14f810;let _0x3bff81=_0x565cfe['match'](ts)?.[0x1];return _0x3bff81&&_0x3bff81[_0x3b1bf4(0x2dd)]()[_0x3b1bf4(0x2d5)]>0x0?_0x3bff81:null;}function Sn(_0x3f31f0,_0x2ce072){const _0xfe4c89=_0x14f810;return{'role':_0xfe4c89(0x339),'type':'info','historyKey':'claude-sensitive-file:'+_0x3f31f0,'content':'Vibelet\x20提示:Claude\x20把\x20'+_0x3f31f0+_0xfe4c89(0x338),..._0x2ce072?{'timestamp':_0x2ce072}:{}};}function xn(_0x4a2e5a){const _0x40c5d7=_0x14f810;let _0x583444=Zr(_0x4a2e5a?.['message']?.[_0x40c5d7(0x2e1)]);if(/\[Request interrupted by user(?: for tool use)?\]/i['test'](_0x583444))return!0x0;let _0x5af0b4=_0x4a2e5a?.[_0x40c5d7(0x2d7)];return!!(_0x5af0b4&&typeof _0x5af0b4=='object'&&_0x5af0b4['interrupted']===!0x0||typeof _0x5af0b4=='string'&&/\[Request interrupted by user(?: for tool use)?\]/i[_0x40c5d7(0x28f)](_0x5af0b4));}function W(_0x44b90a){const _0x5027d5=_0x14f810;let _0xbcc0ae=_0x44b90a['trim']();return _0xbcc0ae?_0xbcc0ae['startsWith']('<environment_context>')||gn[_0x5027d5(0x28f)](_0xbcc0ae)?!0x0:Kr['test'](_0xbcc0ae)&&(Xr['test'](_0xbcc0ae)||Jr['test'](_0xbcc0ae)):!0x1;}function Tn(_0x3e3a14){const _0x32866f=_0x14f810;if(typeof _0x3e3a14?.[_0x32866f(0x2c9)]!='string')return null;let _0x46be13=Date[_0x32866f(0x21d)](_0x3e3a14['timestamp']);return Number['isFinite'](_0x46be13)?_0x46be13:null;}function Ve(_0x480419){let _0x907b70=Tn(_0x480419);return _0x907b70==null?void 0x0:new Date(_0x907b70)['toISOString']();}function q(_0x57703f,_0x4f33ea){let _0x3898cc=Ve(_0x4f33ea);return _0x3898cc?{..._0x57703f,'timestamp':_0x3898cc}:_0x57703f;}var An=h['child']({'module':_0x14f810(0x2c8)});function ns(_0x5b7e78){const _0x25bee3=_0x14f810;if(_0x5b7e78?.[_0x25bee3(0x2d0)]===_0x25bee3(0x312)&&_0x5b7e78['message']?.['role']==='user'){if(_0x5b7e78[_0x25bee3(0x32f)]===!0x0)return null;if(hn(_0x5b7e78['message']['content']))return{'kind':_0x25bee3(0x2d9),...xn(_0x5b7e78)?{'interrupted':!0x0}:{}};let _0x3a662c=B(_0x5b7e78);return rs(_0x3a662c)?null:_0x3a662c?{'kind':_0x25bee3(0x2a2)}:null;}if(_0x5b7e78?.[_0x25bee3(0x2d0)]===_0x25bee3(0x339)&&_0x5b7e78[_0x25bee3(0x2ee)]?.['role']===_0x25bee3(0x339)){let _0x1e5031=j(_0x5b7e78[_0x25bee3(0x2ee)]['content']),_0x2513de=_0x5b7e78['message']?.[_0x25bee3(0x2b7)];return{'kind':'assistant','stopReason':typeof _0x2513de==_0x25bee3(0x2ab)?_0x2513de:_0x2513de??null,..._0x1e5031?{'text':_0x1e5031}:{}};}return _0x5b7e78?.['type']==='system'&&_0x5b7e78['subtype']==='stop_hook_summary'?{'kind':'stopHook'}:null;}function rs(_0x2f1496){const _0x22091c=_0x14f810;return _0x2f1496?_0x2f1496['includes'](_0x22091c(0x21b))||_0x2f1496['includes']('<command-name>'):!0x1;}function ss(_0x5b6ac6){const _0x579933=_0x14f810;if(!_0x5b6ac6)return{};if(_0x5b6ac6[_0x579933(0x21a)]===_0x579933(0x311))return{};if(_0x5b6ac6['kind']==='assistant'){let _0x39c69f=_0x5b6ac6['stopReason']==null||_0x5b6ac6['stopReason']==='tool_use';return{..._0x39c69f?{'isResponding':!0x0}:{},..._0x39c69f&&_0x5b6ac6[_0x579933(0x202)]?{'partialReplyText':_0x5b6ac6[_0x579933(0x202)]}:{}};}return _0x5b6ac6[_0x579933(0x21a)]===_0x579933(0x2d9)&&_0x5b6ac6[_0x579933(0x234)]?{}:{'isResponding':!0x0};}function is(_0x2fd55b){const _0x32ad71=_0x14f810;let _0x2f61a1=_0x2fd55b?.[_0x32ad71(0x2ee)]??_0x2fd55b?.[_0x32ad71(0x202)]??_0x2fd55b?.['delta']??_0x2fd55b?.[_0x32ad71(0x2e1)];return typeof _0x2f61a1=='string'&&_0x2f61a1[_0x32ad71(0x2dd)]()?_0x2f61a1:void 0x0;}function os(_0x270788){const _0x1ee99f=_0x14f810;if(_0x270788?.['type']==='event_msg'){let _0x1f46af=_0x270788['payload'];switch(_0x1f46af?.[_0x1ee99f(0x2d0)]){case _0x1ee99f(0x262):return{'kind':_0x1ee99f(0x1f6)};case _0x1ee99f(0x248):case _0x1ee99f(0x2f4):case'thread_rolled_back':return{'kind':'turnFinished'};case'user_message':{let _0x221e74=oe(_0x270788);return _0x221e74&&!W(_0x221e74)?{'kind':_0x1ee99f(0x2a2)}:null;}case'agent_message':case'agent_message_delta':{let _0x1e2ca4=is(_0x1f46af);return _0x1e2ca4?{'kind':'assistant','text':_0x1e2ca4}:{'kind':'assistant'};}case _0x1ee99f(0x241):case'patch_apply_end':case'web_search_end':return{'kind':'activity'};default:return null;}}if(_0x270788?.[_0x1ee99f(0x2d0)]!=='response_item')return null;let _0x50f2af=_0x270788[_0x1ee99f(0x310)];switch(_0x50f2af?.['type']){case'message':{if(_0x50f2af['role']===_0x1ee99f(0x312)){let _0x4db821=F(_0x50f2af[_0x1ee99f(0x2e1)]);return _0x4db821&&!W(_0x4db821)?{'kind':_0x1ee99f(0x2a2)}:null;}if(_0x50f2af['role']===_0x1ee99f(0x339)){let _0x362988=F(_0x50f2af[_0x1ee99f(0x2e1)]);return _0x362988?{'kind':_0x1ee99f(0x339),'text':_0x362988}:{'kind':'assistant'};}return null;}case'reasoning':case'function_call':case'function_call_output':case'custom_tool_call':case _0x1ee99f(0x1d8):case'web_search_call':case _0x1ee99f(0x308):case'tool_search_output':return{'kind':_0x1ee99f(0x2b9)};default:return null;}}async function Cn(_0x457910){const _0x403012=_0x14f810;let _0x5d073e=null;try{await H(_0x457910,_0x25ca5a=>{let _0x29090c=ns(_0x25ca5a);_0x29090c&&(_0x5d073e=_0x29090c);});}catch(_0x15cbab){return _0x15cbab['code']!==_0x403012(0x27a)&&An['warn']({'filePath':_0x457910,'error':String(_0x15cbab)},_0x403012(0x261)),{};}return ss(_0x5d073e);}async function wn(_0x1f5ea1){let _0x114240=!0x1,_0x11816e=!0x1,_0x201476;try{await H(_0x1f5ea1,_0x237fbf=>{const _0x48b62f=_0x119c;let _0x412f96=os(_0x237fbf);if(_0x412f96){if(_0x412f96[_0x48b62f(0x21a)]==='turnStarted'){_0x114240=!0x0,_0x11816e=!0x0,_0x201476=void 0x0;return;}if(_0x412f96[_0x48b62f(0x21a)]===_0x48b62f(0x337)){_0x114240=!0x1,_0x11816e=!0x1,_0x201476=void 0x0;return;}_0x114240&&(_0x11816e=!0x0,_0x412f96[_0x48b62f(0x21a)]==='assistant'&&_0x412f96['text']&&(_0x201476=_0x412f96['text']));}});}catch(_0x95f182){return _0x95f182['code']!=='ENOENT'&&An['warn']({'filePath':_0x1f5ea1,'error':String(_0x95f182)},'failed\x20to\x20read\x20codex\x20session\x20runtime\x20hints'),{};}return!_0x114240||!_0x11816e?{}:{'isResponding':!0x0,..._0x201476?{'partialReplyText':_0x201476}:{}};}var Je=require(_0x14f810(0x2cf));function Ke(_0x287ece){const _0x28909a=_0x14f810;return(0x0,Je[_0x28909a(0x28e)])(_0x287ece,_0x28909a(0x1dc))||null;}function Xe(_0x249d46){return(0x0,Je['basename'])(_0x249d46,'.jsonl')['match'](/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[0x1]??null;}function _(_0x272286,_0x53eab7){const _0x2a9d27=_0x14f810;return _0x272286===_0x2a9d27(0x272)?Ke(_0x53eab7):Xe(_0x53eab7);}var Ta=h[_0x14f810(0x1e8)]({'module':_0x14f810(0x2c8)}),z=new Map(),bn=0x2710;function be(_0x49f072,_0x402a0c){return _0x49f072+':'+_0x402a0c;}function as(_0x288753,_0x2c30db){const _0x7430c7=_0x14f810;return _0x288753['size']===_0x2c30db['size']&&_0x288753['mtimeMs']===_0x2c30db['mtimeMs']&&_0x288753[_0x7430c7(0x29b)]===_0x2c30db[_0x7430c7(0x29b)];}function Ye(_0x472b25,_0x14d1e8,_0x463a37){const _0x1b88cd=_0x14f810;let _0x4f0fab=be(_0x14d1e8,_0x472b25),_0x1809bd=z[_0x1b88cd(0x28b)](_0x4f0fab);if(_0x1809bd){if(!as(_0x1809bd,_0x463a37)){z['delete'](_0x4f0fab);return;}return _0x1809bd['lastUsedAt']=Date['now'](),_0x1809bd[_0x1b88cd(0x201)];}}function ls(){const _0x1a3873=_0x14f810;if(z['size']<=bn)return;let _0x4cf6c8=[...z['entries']()][_0x1a3873(0x20b)]((_0x2cd108,_0x30b49c)=>_0x2cd108[0x1]['lastUsedAt']-_0x30b49c[0x1][_0x1a3873(0x22f)]),_0x304d3f=z['size']-bn;for(let _0x388cd2=0x0;_0x388cd2<_0x304d3f;_0x388cd2+=0x1){let _0x5c27fe=_0x4cf6c8[_0x388cd2]?.[0x0];_0x5c27fe&&z['delete'](_0x5c27fe);}}function Ze(_0x44a58f,_0x222c60,_0xf9d3cb,_0x565d58){const _0x2fe20d=_0x14f810;z['set'](be(_0x222c60,_0x44a58f),{'size':_0xf9d3cb[_0x2fe20d(0x249)],'mtimeMs':_0xf9d3cb['mtimeMs'],'birthtimeMs':_0xf9d3cb[_0x2fe20d(0x29b)],'value':_0x565d58,'lastUsedAt':Date['now']()}),ls();}async function et(_0x5e1aed,_0x23b65a){const _0x3f2228=_0x14f810;let _0x2c4871,_0x258b49,_0x5e79b6=await Ge(_0x5e1aed,_0x23b65a);for(let _0x10e7e3 of _0x5e79b6['split']('\x0a')){if(!_0x10e7e3[_0x3f2228(0x2dd)]())continue;let _0x92629f;try{_0x92629f=JSON['parse'](_0x10e7e3);}catch{continue;}let _0x25e522=Jt(_0x92629f);_0x25e522&&(_0x2c4871=_0x25e522);let _0x2abfa8=Kt(_0x92629f);_0x2abfa8&&(_0x258b49=_0x2abfa8);}return{'approvalMode':_0x2c4871,'lastUsage':_0x258b49};}async function tt(_0x415170,_0x115ab2){let _0x4160ea,_0x4faa44,_0x4b7cd1=await Ge(_0x415170,_0x115ab2);for(let _0x49ff43 of _0x4b7cd1['split']('\x0a')){if(!_0x49ff43['trim']())continue;let _0x2e7a08;try{_0x2e7a08=JSON['parse'](_0x49ff43);}catch{continue;}let _0x1b825c=Vt(_0x2e7a08);_0x1b825c&&(_0x4160ea=_0x1b825c);let _0x13be30=Xt(_0x2e7a08);_0x13be30&&(_0x4faa44=_0x13be30);}return{'approvalMode':_0x4160ea,'lastUsage':_0x4faa44};}var Ma=h[_0x14f810(0x1e8)]({'module':'inventory'});function vn(_0x259ee9=_0x14f810(0x246),_0x535112=_0x14f810(0x2c2)){return{'state':'idle','confidence':_0x259ee9,'resumeMode':_0x535112};}var le=h['child']({'module':_0x14f810(0x2c8)}),Ie=0x7530,it=ee(Ie),cs=ee(Ie),us=ee(Ie),ae=ee(Ie),nt=new Map(),rt=new Map();function _n(){const _0x4e1f39=_0x14f810;it[_0x4e1f39(0x32e)](),cs[_0x4e1f39(0x32e)](),us['clear'](),ae['clear'](),un();}var st=new Map();function ds(_0x3d4e5b){const _0x11e428=_0x14f810;let _0x72b16c='codex-latest:'+(0x0,k['homedir'])(),_0x18193e=new Map();for(let _0x50b3fc of _0x3d4e5b)_0x18193e['has'](_0x50b3fc['cwd'])||_0x18193e['set'](_0x50b3fc[_0x11e428(0x32a)],_0x50b3fc['match']);ae['set'](_0x72b16c,_0x18193e);}function fs(_0x3928e4){const _0x33cd64=_0x14f810;let _0x3a26ab=(0x0,y['basename'])(_0x3928e4['path'])['match'](/^rollout-(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})-/);if(_0x3a26ab){let _0x295bc1=Date['parse'](_0x3a26ab[0x1]+':'+_0x3a26ab[0x2]+':'+_0x3a26ab[0x3]);if(Number['isFinite'](_0x295bc1))return _0x295bc1;}return _0x3928e4[_0x33cd64(0x29b)];}function In(_0x37033c){const _0x28d705=_0x14f810;return _0x37033c?.[_0x28d705(0x2dd)]()||void 0x0;}function ps(_0x226480){const _0xb0b40e=_0x14f810;if(_0x226480['type']!==_0xb0b40e(0x20a))return null;let _0x3c1b45=_0x226480[_0xb0b40e(0x310)]?.[_0xb0b40e(0x2f3)],_0x23e383=typeof _0x3c1b45=='object'&&_0x3c1b45!==null&&Object['hasOwn'](_0x3c1b45,'subagent'),_0x2ec8d0=In(_0x226480[_0xb0b40e(0x310)]?.[_0xb0b40e(0x2ef)])||(_0x23e383?In(_0x3c1b45[_0xb0b40e(0x264)]?.[_0xb0b40e(0x309)]?.['parent_thread_id']):void 0x0);return!_0x2ec8d0&&!_0x23e383?null:_0x2ec8d0?{'parentSessionId':_0x2ec8d0}:{};}function Pn(_0x46ea0a){const _0x1cd175=_0x14f810;for(let _0x3becd1 of ie(_0x46ea0a,0x60)){let _0x66c673;try{_0x66c673=JSON[_0x1cd175(0x21d)](_0x3becd1);}catch{continue;}if(_0x66c673['type']===_0x1cd175(0x20a))return ps(_0x66c673);}return null;}async function ms(_0x53c317,_0x581b23){const _0x33d756=_0x14f810;if(_0x581b23){let _0x1ac39d=Ye(_0x53c317,'codex',_0x581b23);if(_0x1ac39d!==void 0x0)return _0x1ac39d?{'cwd':_0x1ac39d['cwd'],'sessionId':_0x1ac39d[_0x33d756(0x20c)]}:null;}let _0x5acbea=_0x581b23??await(0x0,T['stat'])(_0x53c317)[_0x33d756(0x1e9)](()=>null);if(!_0x5acbea)return null;try{let _0x2bca7e=await we(_0x53c317,_0x5acbea[_0x33d756(0x249)]);if(Pn(_0x2bca7e))return null;let _0xde4488='',_0x4f2e44='';for(let _0x20fa18 of ie(_0x2bca7e,0x60)){let _0x198510;try{_0x198510=JSON[_0x33d756(0x21d)](_0x20fa18);}catch{continue;}if(_0xde4488||(_0xde4488=_0x198510[_0x33d756(0x310)]?.[_0x33d756(0x32a)]??_0x198510[_0x33d756(0x32a)]??''),_0x4f2e44||(_0x4f2e44=_0x198510[_0x33d756(0x310)]?.['id']??_0x198510['id']??''),_0xde4488&&_0x4f2e44)break;}return _0xde4488?{'cwd':_0xde4488,'sessionId':_0x4f2e44||_('codex',_0x53c317)||(0x0,y[_0x33d756(0x28e)])(_0x53c317,'.jsonl')}:null;}catch{return null;}}function ve(_0x443ca8,_0x43d5bf=_0x14f810(0x2c8)){const _0x5e392f=_0x14f810;return{'sessionId':_0x443ca8['sessionId'],'agent':_0x443ca8['agent'],'cwd':_0x443ca8['cwd'],..._0x443ca8[_0x5e392f(0x291)]?{'originCwd':_0x443ca8['originCwd']}:{},..._0x443ca8[_0x5e392f(0x279)]?{'model':_0x443ca8[_0x5e392f(0x279)]}:{},..._0x443ca8[_0x5e392f(0x263)]?{'effort':_0x443ca8[_0x5e392f(0x263)]}:{},'title':_0x443ca8['title'],..._0x443ca8[_0x5e392f(0x29f)]?.['length']?{'titleAliases':_0x443ca8[_0x5e392f(0x29f)]}:{},..._0x443ca8[_0x5e392f(0x321)]?{'customTitle':_0x443ca8['customTitle']}:{},..._0x443ca8[_0x5e392f(0x23b)]?{'originator':_0x443ca8['originator']}:{},...typeof _0x443ca8[_0x5e392f(0x1d9)]==_0x5e392f(0x259)?{'externalArchived':_0x443ca8['externalArchived']}:{},'observedApprovalMode':_0x443ca8['approvalMode'],'lastUsage':_0x443ca8['lastUsage'],'createdAt':_0x443ca8[_0x5e392f(0x2f0)],'lastActivityAt':_0x443ca8[_0x5e392f(0x26b)],'sources':[_0x43d5bf],'runtime':vn()};}async function En(_0x5e2449,_0x547b13){const _0x396b41=_0x14f810;let _0x4cb862=await we(_0x5e2449,_0x547b13),_0x2822a2=ie(_0x4cb862,0x40),_0xa791fa='',_0x5f2f5f='',_0x24e787,_0x281abb,_0x4ccd9e;for(let _0x2e527e of _0x2822a2){let _0x19ef6f;try{_0x19ef6f=JSON[_0x396b41(0x21d)](_0x2e527e);}catch{continue;}if(!_0xa791fa&&typeof _0x19ef6f['cwd']==_0x396b41(0x2ab)&&(_0xa791fa=_0x19ef6f['cwd']),!_0x5f2f5f&&typeof _0x19ef6f[_0x396b41(0x20c)]==_0x396b41(0x2ab)&&(_0x5f2f5f=_0x19ef6f[_0x396b41(0x20c)]),_0x24e787||(_0x24e787=P([_0x19ef6f['customTitle'],_0x19ef6f[_0x396b41(0x237)]])),!_0x4ccd9e){let _0xce9a03=B(_0x19ef6f),_0x563d8f=P([],_0xce9a03);_0x563d8f&&(_0x281abb=_0xce9a03,_0x4ccd9e=_0x563d8f);}if(_0xa791fa&&(_0x24e787||_0x4ccd9e))break;}if(!_0xa791fa)return null;let _0x38bcd3=await tt(_0x5e2449,_0x547b13);return{'sessionId':_0x5f2f5f||_(_0x396b41(0x272),_0x5e2449)||(0x0,y['basename'])(_0x5e2449,_0x396b41(0x1dc)),'cwd':_0xa791fa,'title':_0x24e787??_0x4ccd9e??P([],_0x281abb),'approvalMode':_0x38bcd3['approvalMode'],'lastUsage':_0x38bcd3['lastUsage']};}async function gs(_0x1fe2fe,_0x2e1192){const _0x12f6a7=_0x14f810;let _0x215e28=await we(_0x1fe2fe,_0x2e1192);if(Pn(_0x215e28))return null;let _0x298366=ie(_0x215e28,0x60),_0x11da3a='',_0x2f25fb='',_0x4292f8,_0x243439,_0x50ecf2,_0x2a538c;for(let _0xb69173 of _0x298366){let _0x302cd2;try{_0x302cd2=JSON[_0x12f6a7(0x21d)](_0xb69173);}catch{continue;}if(_0x11da3a||(_0x11da3a=_0x302cd2['payload']?.['cwd']??_0x302cd2[_0x12f6a7(0x32a)]??''),_0x2f25fb||(_0x2f25fb=_0x302cd2[_0x12f6a7(0x310)]?.['id']??_0x302cd2['id']??''),!_0x2a538c&&typeof _0x302cd2[_0x12f6a7(0x310)]?.[_0x12f6a7(0x23b)]=='string'&&(_0x2a538c=_0x302cd2[_0x12f6a7(0x310)]['originator']),_0x4292f8||(_0x4292f8=P([_0x302cd2['payload']?.[_0x12f6a7(0x221)],_0x302cd2[_0x12f6a7(0x221)]])),!_0x50ecf2){let _0x5a82ef=oe(_0x302cd2),_0x242c90=_0x5a82ef&&!W(_0x5a82ef)?P([],_0x5a82ef):void 0x0;_0x242c90&&(_0x243439=_0x5a82ef,_0x50ecf2=_0x242c90);}if(_0x11da3a&&(_0x4292f8||_0x50ecf2))break;}if(!_0x11da3a)return null;let _0xb44c1=await et(_0x1fe2fe,_0x2e1192),_0x5e0a5b=_0x2f25fb||_(_0x12f6a7(0x304),_0x1fe2fe)||(0x0,y[_0x12f6a7(0x28e)])(_0x1fe2fe,_0x12f6a7(0x1dc)),_0x34e5ef=_0x4292f8??_0x50ecf2??P([],_0x243439);return{'sessionId':_0x5e0a5b,'cwd':_0x11da3a,'title':_0x34e5ef,'approvalMode':_0xb44c1['approvalMode'],'lastUsage':_0xb44c1['lastUsage'],'originator':_0x2a538c};}async function hs(_0x221702,_0x3d40ab,_0x1a7358){const _0x2d8c5a=_0x14f810;return Ee(_0x3d40ab)['readFileMeta'](_0x221702,_0x1a7358[_0x2d8c5a(0x249)]);}async function ys(_0x551397,_0x4bbe0c,_0x4a0d32){const _0x3c5161=_0x14f810;let _0x36a2c7=Ye(_0x551397,_0x4bbe0c,_0x4a0d32);if(_0x36a2c7!==void 0x0)return _0x36a2c7;let _0xdb1502=be(_0x4bbe0c,_0x551397)+':'+_0x4a0d32['size']+':'+_0x4a0d32[_0x3c5161(0x1f5)]+':'+_0x4a0d32[_0x3c5161(0x29b)],_0x2a1c3c=st['get'](_0xdb1502);return _0x2a1c3c||(_0x2a1c3c=(async()=>{try{let _0x46645d=await hs(_0x551397,_0x4bbe0c,_0x4a0d32);return Ze(_0x551397,_0x4bbe0c,_0x4a0d32,_0x46645d),_0x46645d;}catch{return Ze(_0x551397,_0x4bbe0c,_0x4a0d32,null),null;}})()[_0x3c5161(0x26e)](()=>{st['delete'](_0xdb1502);}),st[_0x3c5161(0x212)](_0xdb1502,_0x2a1c3c)),_0x2a1c3c;}function Ss(_0x56b8e8,_0x2ae13c,_0x43bf72,_0x40fb54){const _0xec5f4e=_0x14f810;let _0x49c4a0={'sessionId':_0x56b8e8[_0xec5f4e(0x20c)],'agent':_0x56b8e8['agent'],'cwd':_0x56b8e8[_0xec5f4e(0x32a)],'title':_0x56b8e8[_0xec5f4e(0x221)],'approvalMode':_0x56b8e8['approvalMode'],'lastUsage':_0x56b8e8['lastUsage'],'originator':_0x56b8e8['originator'],'createdAt':new Date(_0x43bf72['birthtimeMs'])['toISOString'](),'lastActivityAt':new Date(_0x43bf72[_0xec5f4e(0x1f5)])[_0xec5f4e(0x1ed)](),'filePath':_0x2ae13c};if(_0x56b8e8[_0xec5f4e(0x2e3)]!==_0xec5f4e(0x304))return _0x49c4a0;let _0x33f163=ln(_0x40fb54,_0x56b8e8['sessionId'],_0x2ae13c),_0xdb17f3=cn(_0x40fb54,_0x56b8e8[_0xec5f4e(0x20c)],_0x2ae13c),_0x2ba078=_0x33f163&&_0x56b8e8[_0xec5f4e(0x221)]&&_0x33f163!==_0x56b8e8[_0xec5f4e(0x221)]?[_0x56b8e8[_0xec5f4e(0x221)]]:void 0x0;return{..._0x49c4a0,'title':_0x33f163??_0x56b8e8[_0xec5f4e(0x221)],..._0x2ba078?{'titleAliases':_0x2ba078}:{},...typeof _0xdb17f3==_0xec5f4e(0x259)?{'externalArchived':_0xdb17f3}:{}};}async function ot(_0x377b45,_0x1a8504,_0x16e7ea,_0x5847ba){const _0x5c109d=_0x14f810;let _0xd4a432=await ys(_0x377b45,_0x1a8504,_0x16e7ea);if(!_0xd4a432)return null;let _0x368bff=_0x1a8504===_0x5c109d(0x304)?_0x5847ba??await qe():void 0x0;return Ss(_0xd4a432,_0x377b45,_0x16e7ea,_0x368bff);}async function Fn(_0x1c0afa,_0x19711d){const _0x5eec55=_0x14f810;let _0x35b159=await(0x0,T[_0x5eec55(0x239)])(_0x1c0afa)[_0x5eec55(0x1e9)](()=>null);return _0x35b159?.['isFile']()?ot(_0x1c0afa,_0x19711d,{'size':_0x35b159['size'],'mtimeMs':_0x35b159[_0x5eec55(0x1f5)],'birthtimeMs':_0x35b159['birthtimeMs']}):null;}async function Mn(_0x18b5c6,_0x580566){const _0x53e78e=_0x14f810;let _0x4f7fc1=(0x0,y['join'])((0x0,k['homedir'])(),'.claude','projects');try{let _0x4d60f0=await tn(),_0x446224;if(_0x18b5c6){let _0x4b5084=new Set([Ce(_0x18b5c6)]);for(let _0x4f100f of _0x4d60f0[_0x53e78e(0x33d)][_0x53e78e(0x2c1)]())_0x4f100f['cwd']&&(_0x4f100f[_0x53e78e(0x32a)]===_0x18b5c6||_0x4f100f[_0x53e78e(0x291)]===_0x18b5c6)&&_0x4b5084[_0x53e78e(0x332)](Ce(_0x4f100f['cwd']));_0x446224=[..._0x4b5084];}else _0x446224=(await(0x0,T[_0x53e78e(0x315)])(_0x4f7fc1,{'withFileTypes':!0x0}))[_0x53e78e(0x305)](_0x246774=>_0x246774['isDirectory']())[_0x53e78e(0x1ec)](_0xb70aba=>_0xb70aba['name']);let _0x38acaf=[];for(let _0x991ff1 of _0x446224){let _0xc66586=(0x0,y[_0x53e78e(0x28c)])(_0x4f7fc1,_0x991ff1),_0x276a07=await(0x0,T[_0x53e78e(0x315)])(_0xc66586)['catch'](()=>[]);for(let _0x432487 of _0x276a07)_0x432487[_0x53e78e(0x278)](_0x53e78e(0x1dc))&&_0x38acaf['push']((0x0,y[_0x53e78e(0x28c)])(_0xc66586,_0x432487));}let _0x2bb07d=await ye(_0x38acaf);return(await M(_0x2bb07d,A,async _0x3da245=>{const _0x54d5fe=_0x53e78e;let _0x415251=await ot(_0x3da245['path'],_0x54d5fe(0x272),_0x3da245),_0x18806c=_0x415251?nn(_0x415251,_0x4d60f0[_0x54d5fe(0x33d)][_0x54d5fe(0x28b)](_0x415251['sessionId'])):null;return _0x18806c&&_0x580566&&_0x580566[_0x54d5fe(0x26a)](ve(_0x18806c)),_0x18806c;}))['filter'](_0x2ef374=>_0x2ef374!==null)[_0x53e78e(0x1ec)](_0x1b538d=>ve(_0x1b538d))[_0x53e78e(0x20b)]((_0x5e35fc,_0x105717)=>_0x105717['lastActivityAt'][_0x53e78e(0x299)](_0x5e35fc[_0x53e78e(0x26b)]));}catch(_0x218529){return le['warn']({'error':String(_0x218529)},_0x53e78e(0x208)),[];}}async function Rn(_0x5efb63,_0x356fac){const _0x36b8a4=_0x14f810;try{let _0x2a6c5d=await Se(),_0x17b025=await qe(),_0x66a36d=await M(_0x2a6c5d,A,async _0x55a91a=>{let _0x27be9c=await ot(_0x55a91a['path'],'codex',_0x55a91a,_0x17b025);return _0x27be9c&&_0x356fac&&(!_0x5efb63||_0x27be9c['cwd']===_0x5efb63)&&_0x356fac['push'](ve(_0x27be9c)),_0x27be9c;});return ds(_0x66a36d['map']((_0x11ca16,_0x36a93a)=>_0x11ca16?{'cwd':_0x11ca16[_0x36b8a4(0x32a)],'match':{'path':_0x2a6c5d[_0x36a93a]['path'],'mtimeMs':_0x2a6c5d[_0x36a93a][_0x36b8a4(0x1f5)],'sessionId':_0x11ca16[_0x36b8a4(0x20c)]}}:null)['filter'](_0x4f47ae=>_0x4f47ae!==null)),_0x66a36d['filter'](_0x5411ac=>_0x5411ac!==null)['filter'](_0x10ab6d=>!_0x5efb63||_0x10ab6d['cwd']===_0x5efb63)[_0x36b8a4(0x1ec)](_0x55b968=>ve(_0x55b968))[_0x36b8a4(0x20b)]((_0x31814a,_0x30b7ca)=>_0x30b7ca['lastActivityAt'][_0x36b8a4(0x299)](_0x31814a[_0x36b8a4(0x26b)]));}catch(_0x2d2177){return le[_0x36b8a4(0x26f)]({'error':String(_0x2d2177)},_0x36b8a4(0x2ae)),[];}}async function kn(_0x3ec228,_0x3840b7={}){const _0x3933d3=_0x14f810;if(!_0x3ec228)return null;let _0x393707=typeof _0x3840b7[_0x3933d3(0x222)]==_0x3933d3(0x328)?_0x3840b7[_0x3933d3(0x222)]:null,_0x61b959=_0x3933d3(0x27f)+(0x0,k['homedir'])(),_0x10fee4=_0x393707===null?ae['get'](_0x61b959):null;if(_0x10fee4&&_0x393707===null){let _0x662dc7=_0x10fee4[_0x3933d3(0x28b)](_0x3ec228);if(_0x10fee4[_0x3933d3(0x20f)](_0x3ec228))return _0x662dc7?{'sessionId':_0x662dc7['sessionId'],'filePath':_0x662dc7[_0x3933d3(0x347)]}:null;}let _0x54133a=_0x393707===null?_0x3ec228:_0x3ec228+':'+_0x393707,_0x22b6a2=rt['get'](_0x54133a);_0x22b6a2||(_0x22b6a2=(async()=>{const _0x38d073=_0x3933d3;let _0x304926=(await Se())[_0x38d073(0x305)](_0x21e0bb=>_0x393707===null||fs(_0x21e0bb)>=_0x393707),_0x2f5e96=Ee('codex');for(let _0xbd965d=0x0;_0xbd965d<_0x304926[_0x38d073(0x2d5)];_0xbd965d+=A){let _0x553d4e=_0x304926['slice'](_0xbd965d,_0xbd965d+A),_0x3123e8=(await Promise['all'](_0x553d4e['map'](async _0x3238a3=>{let _0x45c741=await _0x2f5e96['readSessionCwdAndId'](_0x3238a3['path'],_0x3238a3);return _0x45c741?{'entry':_0x3238a3,'meta':_0x45c741}:null;})))[_0x38d073(0x25b)](_0x1b105b=>_0x1b105b?.[_0x38d073(0x2a3)][_0x38d073(0x32a)]===_0x3ec228);if(_0x3123e8)return{'path':_0x3123e8['entry']['path'],'mtimeMs':_0x3123e8['entry']['mtimeMs'],'sessionId':_0x3123e8['meta']['sessionId']};}return null;})()['finally'](()=>{rt['delete'](_0x54133a);}),rt[_0x3933d3(0x212)](_0x54133a,_0x22b6a2));let _0x8e011=await _0x22b6a2;if(_0x393707!==null)return _0x8e011?{'sessionId':_0x8e011[_0x3933d3(0x20c)],'filePath':_0x8e011['path']}:null;let _0x159163=ae[_0x3933d3(0x28b)](_0x61b959)??_0x10fee4??new Map();return _0x159163['set'](_0x3ec228,_0x8e011),ae[_0x3933d3(0x212)](_0x61b959,_0x159163),_0x8e011?{'sessionId':_0x8e011['sessionId'],'filePath':_0x8e011['path']}:null;}async function Ln(_0x29785c,_0x548e23,_0x5d37e7){const _0x4ca754=_0x14f810;let _0x19d094='list:'+(0x0,k['homedir'])()+':'+(_0x29785c??'all')+':'+(_0x548e23??''),_0x13e723=it['get'](_0x19d094);if(_0x13e723)return _0x13e723;let _0x594c4=nt[_0x4ca754(0x28b)](_0x19d094);if(_0x594c4)return _0x594c4;let _0x225647=((async()=>{const _0x38c985=_0x4ca754;let _0x546664;if(_0x29785c==='claude')_0x546664=await Mn(_0x548e23,_0x5d37e7);else{if(_0x29785c===_0x38c985(0x304))_0x546664=await Rn(_0x548e23,_0x5d37e7);else{let [_0x274ea6,_0x31a912]=await Promise[_0x38c985(0x2bc)]([Mn(_0x548e23,_0x5d37e7),Rn(_0x548e23,_0x5d37e7)]);_0x546664=[..._0x274ea6,..._0x31a912]['sort']((_0x33f814,_0x21265e)=>_0x21265e['lastActivityAt']['localeCompare'](_0x33f814['lastActivityAt']));}}return it['set'](_0x19d094,_0x546664),_0x546664;})());return nt[_0x4ca754(0x212)](_0x19d094,_0x225647),_0x225647[_0x4ca754(0x26e)](()=>nt[_0x4ca754(0x2cd)](_0x19d094)),_0x225647;}async function at(_0x1a2df2,_0x5e27e2){const _0x3ed9cf=_0x14f810;let _0x1b5130=(0x0,y[_0x3ed9cf(0x28c)])((0x0,k[_0x3ed9cf(0x1f7)])(),_0x3ed9cf(0x247),_0x3ed9cf(0x313)),_0x20875c=_0x5e27e2?Ce(_0x5e27e2):null,_0x266511=await(0x0,T['readdir'])(_0x1b5130)['catch'](()=>[]),_0x2d2d4a=_0x20875c?[_0x20875c,..._0x266511['filter'](_0x3ad7d6=>_0x3ad7d6!==_0x20875c)]:_0x266511;for(let _0xb7ae4 of _0x2d2d4a){let _0x27aea9=(0x0,y['join'])(_0x1b5130,_0xb7ae4,_0x1a2df2+'.jsonl');if((await(0x0,T[_0x3ed9cf(0x239)])(_0x27aea9)['catch'](()=>null))?.[_0x3ed9cf(0x266)]())return _0x27aea9;}return null;}async function xs(_0x273ecf,_0x4e6b2){const _0x342a89=_0x14f810;let _0x1e6278=await at(_0x273ecf,_0x4e6b2);if(!_0x1e6278)return;let _0x3f6bec=await(0x0,T['stat'])(_0x1e6278)[_0x342a89(0x1e9)](()=>null);return _0x3f6bec?.['isFile']()?(await tt(_0x1e6278,_0x3f6bec['size']))['lastUsage']:void 0x0;}async function Ts(_0x50bd11){const _0xaefef7=_0x14f810;let _0x39d05d=(0x0,y[_0xaefef7(0x28c)])((0x0,k[_0xaefef7(0x1f7)])(),_0xaefef7(0x1fc),_0xaefef7(0x324)),_0xa1a79b=await lt(_0x39d05d,_0x50bd11);if(!_0xa1a79b)return;let _0x58d5bd=await(0x0,T['stat'])(_0xa1a79b)['catch'](()=>null);return _0x58d5bd?.[_0xaefef7(0x266)]()?(await et(_0xa1a79b,_0x58d5bd['size']))[_0xaefef7(0x244)]:void 0x0;}async function As(_0xf0b939,_0x1d03b0,_0x299bd0){return Ee(_0x1d03b0)['resolveSessionFilePath'](_0xf0b939,_0x299bd0);}async function Nn(_0x579f4f,_0x21dbc4){return Ee(_0x21dbc4)['readRuntimeHintsFromFile'](_0x579f4f);}function K(_0x29f82c,_0x1b6556,_0x47d92c){const _0x278343=_0x14f810;let _0x4e2b1f=mn(_0x1b6556);if(_0x47d92c?.[_0x278343(0x1ff)]&&_0x4e2b1f[_0x278343(0x2e5)]==='assistant'){let _0x4a4dde=_0x29f82c[_0x29f82c[_0x278343(0x2d5)]-0x1];if(_0x4a4dde?.['role']==='assistant'&&_0x4a4dde['type']!==_0x278343(0x27c)&&_0x4e2b1f[_0x278343(0x2d0)]!==_0x278343(0x27c)&&!Ft(_0x4a4dde['content'])&&(_0x4e2b1f['content']===_0x4a4dde['content']||_0x4e2b1f['content']['startsWith'](_0x4a4dde['content']))){_0x29f82c[_0x29f82c[_0x278343(0x2d5)]-0x1]=_0x4e2b1f;return;}}_0x29f82c['push'](_0x4e2b1f);}async function Cs(_0x16a4ef,_0xc36fac){const _0x137c70=_0x14f810;let _0x5b5e22=[];try{let _0x3f84b9=await at(_0x16a4ef,_0xc36fac);if(_0x3f84b9){let _0x167b5d=new Map();await H(_0x3f84b9,_0x51c1b2=>{const _0x283df1=_0x119c;if(_0x51c1b2[_0x283df1(0x2d0)]==='assistant'&&_0x51c1b2[_0x283df1(0x2ee)]?.[_0x283df1(0x2e5)]===_0x283df1(0x339)&&Array['isArray'](_0x51c1b2[_0x283df1(0x2ee)]['content']))for(let _0xfc0d13 of _0x51c1b2['message'][_0x283df1(0x2e1)]){if(!_0xfc0d13||typeof _0xfc0d13!=_0x283df1(0x326)||_0xfc0d13['type']!==_0x283df1(0x34e)||typeof _0xfc0d13['id']!=_0x283df1(0x2ab))continue;let _0x920c98=typeof _0xfc0d13['name']==_0x283df1(0x2ab)?_0xfc0d13['name']:null,_0x1338e=_0xfc0d13[_0x283df1(0x2e9)]&&typeof _0xfc0d13['input']==_0x283df1(0x326)?_0xfc0d13[_0x283df1(0x2e9)]:null,_0xa111c4=kt(_0x920c98,_0x1338e,_0xc36fac);_0xa111c4&&_0x167b5d['set'](_0xfc0d13['id'],_0xa111c4);}if(_0x51c1b2['type']==='user'&&_0x51c1b2['message']?.['role']==='user'){if(Array[_0x283df1(0x316)](_0x51c1b2[_0x283df1(0x2ee)]['content']))for(let _0x3d4998 of _0x51c1b2['message'][_0x283df1(0x2e1)]){if(!_0x3d4998||typeof _0x3d4998!='object'||_0x3d4998[_0x283df1(0x2d0)]!==_0x283df1(0x2b8))continue;if(_0x3d4998['is_error']===!0x0){let _0x1b5b70=Qe(_0x3d4998[_0x283df1(0x2e1)]),_0x161806=yn(_0x1b5b70);_0x161806&&K(_0x5b5e22,Sn(_0x161806,Ve(_0x51c1b2)));continue;}let _0x4ee63b=typeof _0x3d4998['tool_use_id']==_0x283df1(0x2ab)?_0x3d4998[_0x283df1(0x1fd)]:'',_0x18ad69=_0x4ee63b?_0x167b5d['get'](_0x4ee63b):void 0x0;if(!_0x18ad69)continue;let _0x217311=Qe(_0x3d4998[_0x283df1(0x2e1)]);if(!Lt(_0x51c1b2['toolUseResult'],_0x217311))continue;let _0x16d729=Ne([_0x18ad69]);_0x16d729&&K(_0x5b5e22,q({'role':_0x283df1(0x339),'content':_0x16d729},_0x51c1b2));}let _0x307211=B(_0x51c1b2);if(_0x307211){let _0x573994=typeof _0x51c1b2[_0x283df1(0x2aa)]==_0x283df1(0x2ab)&&_0x51c1b2['parentUuid']?_0x51c1b2['parentUuid']:null;K(_0x5b5e22,q({'role':'user','content':_0x307211,...typeof _0x51c1b2['uuid']=='string'&&_0x51c1b2['uuid']?{'rewindPoint':{'provider':_0x283df1(0x272),'messageId':_0x573994}}:{}},_0x51c1b2));}}else{if(_0x51c1b2[_0x283df1(0x2d0)]==='assistant'&&_0x51c1b2[_0x283df1(0x2ee)]?.['role']==='assistant'){let _0x4f76b2=j(_0x51c1b2[_0x283df1(0x2ee)]['content']);_0x4f76b2&&K(_0x5b5e22,q({'role':'assistant','content':_0x4f76b2},_0x51c1b2));}}});}}catch(_0x3e65e5){le[_0x137c70(0x26f)]({'error':String(_0x3e65e5)},'failed\x20to\x20read\x20claude\x20session\x20history');}return _0x5b5e22;}async function ws(_0x2ea926,_0x56988a){const _0x54ca84=_0x14f810;let _0x2c61d2=[];try{let _0x3378d0=await As(_0x2ea926,'codex',_0x56988a);if(_0x3378d0){let _0x3f16e3;await H(_0x3378d0,_0x5d869a=>{const _0x1a32a3=_0x119c;_0x5d869a['type']===_0x1a32a3(0x255)&&_0x5d869a[_0x1a32a3(0x310)]?.['type']==='task_started'&&(_0x3f16e3=typeof _0x5d869a['payload']['turn_id']==_0x1a32a3(0x2ab)&&_0x5d869a['payload'][_0x1a32a3(0x277)]?_0x5d869a['payload'][_0x1a32a3(0x277)]:void 0x0);let _0x261389=Nt(_0x5d869a,{'cwd':_0x56988a,'includePatchCalls':!0x0}),_0x8fb5a8=Ne(_0x261389);if(_0x8fb5a8&&K(_0x2c61d2,q({'role':_0x1a32a3(0x339),'content':_0x8fb5a8},_0x5d869a)),_0x5d869a[_0x1a32a3(0x2d0)]!=='response_item'||_0x5d869a['payload']?.['type']!==_0x1a32a3(0x2ee))return;let _0xa94524=_0x5d869a['payload'][_0x1a32a3(0x2e5)];if(_0xa94524!=='user'&&_0xa94524!=='assistant')return;let _0x563b40=F(_0x5d869a['payload'][_0x1a32a3(0x2e1)]);_0x563b40&&(_0xa94524===_0x1a32a3(0x312)&&W(_0x563b40)||K(_0x2c61d2,q({'role':_0xa94524,'content':_0x563b40,..._0xa94524===_0x1a32a3(0x312)&&_0x3f16e3?{'rewindPoint':{'provider':_0x1a32a3(0x304),'turnId':_0x3f16e3}}:{}},_0x5d869a),{'coalesceConsecutiveAssistant':!0x0}));});}}catch(_0xc665de){le['warn']({'error':String(_0xc665de)},_0x54ca84(0x24a));}return _0x2c61d2;}var bs={'claude':{'agent':_0x14f810(0x272),'extractSessionIdFromFile':Ke,async 'readFileMeta'(_0x1135b2,_0x164c3c){let _0x1d92df=await En(_0x1135b2,_0x164c3c);return _0x1d92df?{..._0x1d92df,'agent':'claude'}:null;},async 'readSessionCwdAndId'(_0x281a74,_0x3aeaf4){const _0xda36f=_0x14f810;let _0x59d23e=_0x3aeaf4??await(0x0,T[_0xda36f(0x239)])(_0x281a74)['catch'](()=>null);if(!_0x59d23e)return null;let _0x155040=await En(_0x281a74,_0x59d23e['size']);return _0x155040?{'cwd':_0x155040[_0xda36f(0x32a)],'sessionId':_0x155040[_0xda36f(0x20c)]}:null;},'resolveSessionFilePath':at,'readLastUsage':xs,'readRuntimeHintsFromFile':Cn,'readHistory':Cs},'codex':{'agent':'codex','extractSessionIdFromFile':Xe,async 'readFileMeta'(_0x24ee09,_0x8c4ae5){let _0x2ff2b4=await gs(_0x24ee09,_0x8c4ae5);return _0x2ff2b4?{..._0x2ff2b4,'agent':'codex'}:null;},'readSessionCwdAndId':ms,async 'resolveSessionFilePath'(_0x5f09d3){const _0x16089f=_0x14f810;let _0x106e67=(0x0,y[_0x16089f(0x28c)])((0x0,k[_0x16089f(0x1f7)])(),'.codex','sessions');return lt(_0x106e67,_0x5f09d3);},'readLastUsage':Ts,'readRuntimeHintsFromFile':wn,'readHistory':ws}};function Ee(_0x288b91){return bs[_0x288b91];}async function lt(_0x595aaa,_0x4f296a){const _0x143dae=_0x14f810;try{let _0x66c628=await(0x0,T[_0x143dae(0x315)])(_0x595aaa,{'withFileTypes':!0x0});for(let _0x23122e of _0x66c628){let _0x592b1f=(0x0,y['join'])(_0x595aaa,_0x23122e['name']);if(_0x23122e[_0x143dae(0x29d)]()){let _0x18f1dc=await lt(_0x592b1f,_0x4f296a);if(_0x18f1dc)return _0x18f1dc;}else{if(_0x23122e['name']['includes'](_0x4f296a)&&_0x23122e[_0x143dae(0x282)][_0x143dae(0x278)](_0x143dae(0x1dc)))return _0x592b1f;}}}catch(_0x5847db){le['warn']({'error':String(_0x5847db)},_0x143dae(0x298));}return null;}var Me=require(_0x14f810(0x257)),On=require('node:os'),ct=require('node:path');function $n(){const _0x31d4f4=_0x14f810;return(0x0,ct[_0x31d4f4(0x28c)])((0x0,On[_0x31d4f4(0x1f7)])(),_0x31d4f4(0x247),'sessions');}function Dn(_0x5a5504){const _0x22fef8=_0x14f810;let _0x426a5f=typeof _0x5a5504==_0x22fef8(0x328)?_0x5a5504:typeof _0x5a5504=='string'?Number(_0x5a5504):Number['NaN'];return Number['isFinite'](_0x426a5f)&&_0x426a5f>0x0?_0x426a5f:void 0x0;}function Un(_0x266e86){return _0x266e86['updatedAt']??_0x266e86['startedAt']??0x0;}function Hn(_0x2daa0f){const _0x5205d0=_0x14f810;switch(_0x2daa0f){case _0x5205d0(0x23e):case _0x5205d0(0x30d):return!0x0;case'idle':return!0x1;default:return;}}async function vs(_0xecc074=$n()){const _0x5d6bfc=_0x14f810;return(await(0x0,Me['readdir'])(_0xecc074,{'withFileTypes':!0x0})[_0x5d6bfc(0x1e9)](()=>[]))['filter'](_0x2cbef6=>_0x2cbef6[_0x5d6bfc(0x266)]()&&_0x2cbef6[_0x5d6bfc(0x282)][_0x5d6bfc(0x278)](_0x5d6bfc(0x2ea)))[_0x5d6bfc(0x1ec)](_0x4df318=>(0x0,ct[_0x5d6bfc(0x28c)])(_0xecc074,_0x4df318['name']));}async function Is(_0x461af5){const _0x2d44f0=_0x14f810;try{let _0x488311=JSON['parse'](await(0x0,Me[_0x2d44f0(0x24e)])(_0x461af5,'utf-8')),_0x5c0cbf=x(_0x488311['sessionId']);if(!_0x5c0cbf)return;let _0x30ad92={'sessionId':_0x5c0cbf},_0x39052a=x(_0x488311[_0x2d44f0(0x32a)]),_0x5bc5e0=x(_0x488311['status']),_0x3530dd=Dn(_0x488311[_0x2d44f0(0x303)]),_0x21765b=Dn(_0x488311[_0x2d44f0(0x319)]);return _0x39052a&&(_0x30ad92[_0x2d44f0(0x32a)]=_0x39052a),_0x5bc5e0&&(_0x30ad92['status']=_0x5bc5e0),_0x3530dd&&(_0x30ad92[_0x2d44f0(0x303)]=_0x3530dd),_0x21765b&&(_0x30ad92['updatedAt']=_0x21765b),_0x30ad92;}catch{return;}}async function jn(_0x14a9ea,_0x46f4be=$n()){if(!_0x14a9ea)return;let _0x5985b3=await vs(_0x46f4be),_0x2b317d=await M(_0x5985b3,A,Is),_0x5e4bd1;for(let _0x2f2b8a of _0x2b317d)!_0x2f2b8a||_0x2f2b8a['sessionId']!==_0x14a9ea||(!_0x5e4bd1||Un(_0x2f2b8a)>Un(_0x5e4bd1))&&(_0x5e4bd1=_0x2f2b8a);return _0x5e4bd1;}var Es=(0x0,zn['promisify'])(qn[_0x14f810(0x2f6)]),ut=h['child']({'module':_0x14f810(0x216)}),Gn=0xbb8,Ms=0x3e8,Rs=0xfa0,Bn=0x3,_s=/(^|[^A-Za-z0-9_.-])(claude|codex)([^A-Za-z0-9_.-]|$)/,Ps=0x1f4,Fs=0x3a98,ue=null,ce=null;function ft(){ue=null;}function ks(_0x922aaf,_0x11a217=Date[_0x14f810(0x2df)]()){return _0x11a217-_0x922aaf<Rs;}var Ls=new Set(['sh',_0x14f810(0x224),_0x14f810(0x225),_0x14f810(0x232)]),Ns=new Set([_0x14f810(0x2b5),'nohup',_0x14f810(0x22e),_0x14f810(0x342)]),Ds=new Set([_0x14f810(0x1f8),'nodejs',_0x14f810(0x32b),'tsx']),Us=new Set(['-e',_0x14f810(0x2b3),'-p','--print']),Os=new Set(['-r','--require','--import','--loader',_0x14f810(0x203),'--env-file','--input-type']);function $s(_0x584bad){return _0x584bad['replace'](/^['"]|['"]$/g,'');}function Qn(_0x5965df){const _0x10fb90=_0x14f810;return(_0x5965df[_0x10fb90(0x2f7)](/"[^"]*"|'[^']*'|\S+/g)??[])[_0x10fb90(0x1ec)]($s);}function Wn(_0x309a37){const _0x201178=_0x14f810;let _0xf8725f=(0x0,L[_0x201178(0x28e)])(_0x309a37);return _0xf8725f===_0x201178(0x272)||_0xf8725f==='codex'?_0xf8725f:null;}function Hs(_0x52e917){for(let _0x2b34d7 of _0x52e917['split'](/&&|\|\||;|\n/)){let _0x172b24=Vn(Qn(_0x2b34d7['trim']()),!0x0);if(_0x172b24)return _0x172b24;}return null;}function Vn(_0x572bb1,_0x44ccba=!0x1){const _0x3731d2=_0x14f810;let _0x4825da=0x0;for(;_0x4825da<_0x572bb1['length'];){let _0x2dddec=_0x572bb1[_0x4825da],_0x1b69c9=(0x0,L['basename'])(_0x2dddec);if(Ns[_0x3731d2(0x20f)](_0x1b69c9)){if(_0x4825da+=0x1,_0x1b69c9==='env'){for(;_0x4825da<_0x572bb1[_0x3731d2(0x2d5)]&&/^[A-Za-z_][A-Za-z0-9_]*=/['test'](_0x572bb1[_0x4825da]);)_0x4825da+=0x1;}else{if(_0x1b69c9===_0x3731d2(0x22e)||_0x1b69c9==='gtimeout'){for(;_0x4825da<_0x572bb1['length']&&_0x572bb1[_0x4825da]['startsWith']('-');){let _0x35ce69=_0x572bb1[_0x4825da];_0x4825da+=0x1,_0x35ce69==='-k'&&_0x4825da<_0x572bb1[_0x3731d2(0x2d5)]&&(_0x4825da+=0x1);}_0x4825da<_0x572bb1['length']&&(_0x4825da+=0x1);}}continue;}if(Ls['has'](_0x1b69c9)){for(let _0x2ac16f=_0x4825da+0x1;_0x2ac16f<_0x572bb1['length'];_0x2ac16f+=0x1){let _0x12a44e=_0x572bb1[_0x2ac16f];if(_0x12a44e==='-c'||_0x12a44e===_0x3731d2(0x24f)||_0x12a44e===_0x3731d2(0x2af)||_0x12a44e===_0x3731d2(0x23a)||_0x12a44e==='-ec'||_0x12a44e==='-xec'){let _0x13b452=_0x572bb1[_0x2ac16f+0x1];return _0x13b452?Hs(_0x13b452):null;}}return null;}if(Ds['has'](_0x1b69c9)){let _0x34227c=_0x4825da+0x1;for(;_0x34227c<_0x572bb1['length'];){let _0x1c5e72=_0x572bb1[_0x34227c];if(Us['has'](_0x1c5e72))return null;if(_0x1c5e72==='--'){_0x34227c+=0x1;break;}if(!_0x1c5e72['startsWith']('-'))break;_0x34227c+=0x1,Os[_0x3731d2(0x20f)](_0x1c5e72)&&_0x34227c<_0x572bb1[_0x3731d2(0x2d5)]&&(_0x34227c+=0x1);}if(_0x34227c>=_0x572bb1[_0x3731d2(0x2d5)])return null;let _0x175fa4=Wn(_0x572bb1[_0x34227c]);return _0x175fa4?{'agent':_0x175fa4,'args':_0x572bb1['slice'](_0x34227c+0x1),'viaWrapper':!0x0}:null;}let _0x56b6f8=Wn(_0x2dddec);return _0x56b6f8?{'agent':_0x56b6f8,'args':_0x572bb1['slice'](_0x4825da+0x1),'viaWrapper':_0x44ccba}:null;}return null;}function pt(_0x3d097e,_0x273af6=!0x1){return Vn(Qn(_0x3d097e),_0x273af6);}function _e(_0x143ed6){let _0x39dd4c=pt(_0x143ed6);return _0x39dd4c?{'agent':_0x39dd4c['agent'],'args':_0x39dd4c['args']}:null;}function Jn(_0x381b48){return _s['test'](_0x381b48)&&pt(_0x381b48)!==null;}function js(_0x119859,_0x3d7835){const _0x3be309=_0x14f810;let _0x534ebe=_e(_0x3d7835);if(!_0x534ebe||_0x534ebe[_0x3be309(0x2e3)]!==_0x119859)return null;let {args:_0x4e83c9}=_0x534ebe;if(_0x119859==='claude'){for(let _0x2eba4c=0x0;_0x2eba4c<_0x4e83c9['length'];_0x2eba4c+=0x1){let _0x15ab4d=_0x4e83c9[_0x2eba4c];if((_0x15ab4d==='--resume'||_0x15ab4d==='--session-id')&&_0x4e83c9[_0x2eba4c+0x1]&&!_0x4e83c9[_0x2eba4c+0x1][_0x3be309(0x274)]('-'))return _0x4e83c9[_0x2eba4c+0x1];if(_0x15ab4d[_0x3be309(0x274)]('--resume='))return _0x15ab4d['slice'](0x9);if(_0x15ab4d['startsWith']('--session-id='))return _0x15ab4d['slice'](0xd);}return null;}if(_0x4e83c9[0x0]!=='resume')return null;for(let _0x8d01aa=0x1;_0x8d01aa<_0x4e83c9[_0x3be309(0x2d5)];_0x8d01aa+=0x1){let _0x20bc8e=_0x4e83c9[_0x8d01aa];if(!_0x20bc8e[_0x3be309(0x274)]('-'))return _0x20bc8e;}return null;}function Bs(_0x17d833){const _0x235085=_0x14f810;if(_0x17d833['includes'](_0x235085(0x2fb)))return'autoApprove';for(let _0x12c3d0=0x0;_0x12c3d0<_0x17d833['length'];_0x12c3d0+=0x1){let _0x347b89=_0x17d833[_0x12c3d0],_0x22f33c=_0x17d833[_0x12c3d0+0x1],_0x5457d3=_0x347b89===_0x235085(0x2f2)?_0x22f33c:_0x347b89[_0x235085(0x274)](_0x235085(0x307))?_0x347b89['slice'](0x12):void 0x0;if(_0x5457d3==='plan')return _0x235085(0x31e);if(_0x5457d3==='acceptEdits')return _0x235085(0x331);if(_0x5457d3===_0x235085(0x344))return'normal';}}function Ws(_0x17493a){const _0x21d3a4=_0x14f810;if(_0x17493a['includes']('--dangerously-bypass-approvals-and-sandbox'))return _0x21d3a4(0x21f);}function qs(_0x1473ac,_0x2e4dc7){const _0x2edcbd=_0x14f810;let _0x56473a=_e(_0x2e4dc7);if(!(!_0x56473a||_0x56473a['agent']!==_0x1473ac))return _0x1473ac===_0x2edcbd(0x272)?Bs(_0x56473a['args']):Ws(_0x56473a[_0x2edcbd(0x29e)]);}function Re(_0x245726){const _0x342ff5=_0x14f810;switch(_0x245726){case'high':return 0x3;case _0x342ff5(0x292):return 0x2;default:return 0x1;}}function zs(_0x43bd3f,_0x5d79bb){const _0x2fcedf=_0x14f810;return _0x43bd3f==='claude'?_0x5d79bb['includes'](_0x2fcedf(0x330))&&!_0x5d79bb['includes'](_0x2fcedf(0x2c7)):_0x5d79bb['includes']('/.codex/sessions/');}function Gs(_0x26d7d0,_0x2f4ff4){const _0x167e68=_0x14f810;let _0x30ab3d=pt(_0x2f4ff4);return!_0x30ab3d||_0x30ab3d['agent']!==_0x26d7d0||_0x30ab3d['viaWrapper']?!0x1:_0x26d7d0==='claude'?!_0x30ab3d['args']['includes']('--continue')&&!_0x30ab3d[_0x167e68(0x29e)][_0x167e68(0x34b)]('-c'):!(_0x30ab3d[_0x167e68(0x29e)][0x0]==='app-server'&&!_0x30ab3d[_0x167e68(0x29e)]['includes'](_0x167e68(0x256))&&!_0x30ab3d['args']['some'](_0x34fb93=>_0x34fb93['startsWith'](_0x167e68(0x209))));}function Qs(_0x5e2859){const _0x257f88=_0x14f810;let _0xbcb7ea=[...new Set(_0x5e2859['sessionFiles'])][_0x257f88(0x305)](_0x331eaf=>zs(_0x5e2859['agent'],_0x331eaf)),_0x4676e8=js(_0x5e2859[_0x257f88(0x2e3)],_0x5e2859[_0x257f88(0x2a0)]),_0x54a265=qs(_0x5e2859[_0x257f88(0x2e3)],_0x5e2859['command']);if(_0x4676e8)return{'agent':_0x5e2859[_0x257f88(0x2e3)],'pid':_0x5e2859[_0x257f88(0x1ee)],'cwd':_0x5e2859['cwd'],'command':_0x5e2859['command'],'sessionId':_0x4676e8,'confidence':'high',..._0x54a265?{'approvalMode':_0x54a265}:{},..._0xbcb7ea['length']===0x1?{'sessionFilePath':_0xbcb7ea[0x0]}:{}};if(_0xbcb7ea['length']!==0x1)return null;let _0x584079=_(_0x5e2859[_0x257f88(0x2e3)],_0xbcb7ea[0x0]);return _0x584079?{'agent':_0x5e2859[_0x257f88(0x2e3)],'pid':_0x5e2859[_0x257f88(0x1ee)],'cwd':_0x5e2859[_0x257f88(0x32a)],'command':_0x5e2859['command'],'sessionId':_0x584079,'confidence':_0x257f88(0x292),..._0x54a265?{'approvalMode':_0x54a265}:{},'sessionFilePath':_0xbcb7ea[0x0]}:null;}function Vs(_0x279c94,_0x258cd3){const _0x2adc6a=_0x14f810;let _0x54d41b=_0x279c94,_0x196c60=_0x258cd3;(Re(_0x258cd3[_0x2adc6a(0x1db)])>Re(_0x279c94[_0x2adc6a(0x1db)])||Re(_0x258cd3[_0x2adc6a(0x1db)])===Re(_0x279c94['confidence'])&&_0x258cd3[_0x2adc6a(0x1ee)]!==void 0x0&&_0x279c94[_0x2adc6a(0x1ee)]!==void 0x0&&_0x258cd3[_0x2adc6a(0x1ee)]<_0x279c94[_0x2adc6a(0x1ee)])&&(_0x54d41b=_0x258cd3,_0x196c60=_0x279c94);let _0x393545=_0x54d41b[_0x2adc6a(0x2db)]??_0x196c60[_0x2adc6a(0x2db)],_0x37a113=_0x54d41b[_0x2adc6a(0x221)]??_0x196c60['title'],_0x5cd5aa=_0x54d41b[_0x2adc6a(0x25d)]??_0x196c60[_0x2adc6a(0x25d)],_0x3d0f13=_0x54d41b[_0x2adc6a(0x219)]??_0x196c60[_0x2adc6a(0x219)],_0x18713d=_0x54d41b['terminal']??_0x196c60[_0x2adc6a(0x2fc)],_0x4cfeac={..._0x54d41b,'cwd':_0x54d41b['cwd']||_0x196c60['cwd'],..._0x393545?{'approvalMode':_0x393545}:{}};return _0x37a113!==void 0x0&&(_0x4cfeac[_0x2adc6a(0x221)]=_0x37a113),_0x5cd5aa!==void 0x0&&(_0x4cfeac['sessionFilePath']=_0x5cd5aa),_0x3d0f13!==void 0x0&&(_0x4cfeac['isResponding']=_0x3d0f13),_0x18713d!==void 0x0&&(_0x4cfeac['terminal']=_0x18713d),_0x4cfeac;}function Js(_0x39e710){const _0x334964=_0x14f810;let _0x2159a1=new Map();for(let _0x5bdc8b of _0x39e710){let _0x21f762=_0x5bdc8b[_0x334964(0x2e3)]+':'+_0x5bdc8b[_0x334964(0x20c)],_0x56a2b4=_0x2159a1['get'](_0x21f762);_0x2159a1['set'](_0x21f762,_0x56a2b4?Vs(_0x56a2b4,_0x5bdc8b):_0x5bdc8b);}return[..._0x2159a1[_0x334964(0x2c1)]()];}function Ks(_0x485981){try{return process['kill'](_0x485981,0x0),!0x0;}catch{return!0x1;}}async function Pe(_0x1b1a6e,_0x2595cb,_0x526860=Ms){const _0x38f309=_0x14f810;try{let {stdout:_0x3e7088}=await Es(_0x1b1a6e,_0x2595cb,{'killSignal':process[_0x38f309(0x2d3)]==='win32'?_0x38f309(0x302):_0x38f309(0x223),'maxBuffer':0x800000,'timeout':_0x526860,'windowsHide':!0x0});return _0x3e7088;}catch(_0x59e44d){let _0x176b15=typeof _0x59e44d==_0x38f309(0x326)&&_0x59e44d!==null?{'code':'code'in _0x59e44d?_0x59e44d['code']:void 0x0,'signal':_0x38f309(0x30a)in _0x59e44d?_0x59e44d[_0x38f309(0x30a)]:void 0x0,'killed':'killed'in _0x59e44d?_0x59e44d[_0x38f309(0x34d)]:void 0x0}:{},_0x1e632f=String(_0x59e44d);return _0x1e632f[_0x38f309(0x34b)](_0x38f309(0x1df))||_0x1e632f['includes'](_0x38f309(0x22a))?ut['debug']({'file':_0x1b1a6e,'args':_0x2595cb,'timeoutMs':_0x526860,'error':_0x1e632f,..._0x176b15},_0x38f309(0x31a)):ut['warn']({'file':_0x1b1a6e,'args':_0x2595cb,'timeoutMs':_0x526860,'error':_0x1e632f,..._0x176b15},_0x38f309(0x205)),'';}}async function Xs(_0x485175){const _0x3c18ad=_0x14f810;let _0x54aa7d=_0x485175;if(_0x485175['sessionFilePath']){let _0x41acfe=await Fn(_0x485175['sessionFilePath'],_0x485175[_0x3c18ad(0x2e3)]);if(!_0x41acfe)return null;let _0x1d3ef9=await Nn(_0x485175[_0x3c18ad(0x25d)],_0x485175['agent']),_0x4db3cf=_0x41acfe['approvalMode']??_0x485175['approvalMode'];_0x54aa7d={..._0x485175,'cwd':_0x485175['cwd']||_0x41acfe[_0x3c18ad(0x32a)],..._0x4db3cf?{'approvalMode':_0x4db3cf}:{},'title':_0x485175[_0x3c18ad(0x221)]??_0x41acfe['title'],'isResponding':_0x1d3ef9['isResponding']};}if(_0x54aa7d['agent']!=='claude')return _0x54aa7d;let _0x3293fc=await jn(_0x54aa7d['sessionId']);if(!_0x3293fc)return _0x54aa7d;let _0x20cbf1=Hn(_0x3293fc[_0x3c18ad(0x227)]);return{..._0x54aa7d,'cwd':_0x54aa7d['cwd']||_0x3293fc[_0x3c18ad(0x32a)]||'','isResponding':_0x20cbf1??_0x54aa7d[_0x3c18ad(0x219)]};}async function Ys(_0x37cb6e){const _0x2afeb3=_0x14f810;return process['platform']===_0x2afeb3(0x2b0)?'':(await Pe(_0x2afeb3(0x30e),['-a','-p',String(_0x37cb6e),'-d','cwd','-Fn']))[_0x2afeb3(0x284)]('\x0a')['find'](_0x4bed8c=>_0x4bed8c[_0x2afeb3(0x274)]('n'))?.[_0x2afeb3(0x27e)](0x1)[_0x2afeb3(0x2dd)]()??'';}async function Zs(_0x3e4752){const _0x37ce09=_0x14f810;if(process[_0x37ce09(0x2d3)]==='win32')return[];let _0x5e9a67=(await Pe('lsof',['-p',String(_0x3e4752),_0x37ce09(0x229)]))['split']('\x0a')['filter'](_0x5358bc=>_0x5358bc['startsWith']('n'))[_0x37ce09(0x1ec)](_0x13cc22=>_0x13cc22[_0x37ce09(0x27e)](0x1)[_0x37ce09(0x2dd)]())['filter'](_0xb097b=>_0xb097b['endsWith'](_0x37ce09(0x1dc))?_0xb097b['includes']('/.claude/projects/')||_0xb097b[_0x37ce09(0x34b)](_0x37ce09(0x2a7)):!0x1);return[...new Set(_0x5e9a67)];}function ei(_0x3b6708){const _0x30ccd5=_0x14f810;return _0x3b6708[_0x30ccd5(0x284)]('\x0a')['map'](_0x177dc6=>_0x177dc6['trim']())['filter'](Boolean)['map'](_0x5bc3d7=>{const _0x1d9c13=_0x30ccd5;let _0x8f4c3a=_0x5bc3d7[_0x1d9c13(0x2f7)](/^(\d+)\s+(.*)$/);if(!_0x8f4c3a)return null;let _0xdac109=Number(_0x8f4c3a[0x1]),_0x4ef723=_0x8f4c3a[0x2];if(!Jn(_0x4ef723))return null;let _0x43b510=_e(_0x4ef723);return!Number['isFinite'](_0xdac109)||!_0x43b510?null:{'pid':_0xdac109,'command':_0x4ef723,'agent':_0x43b510['agent']};})['filter'](_0x3a776f=>!!_0x3a776f);}async function ti(){let _0x444289=await Pe('ps',['-axo','pid=,command='],Gn);return ei(_0x444289);}async function ni(){const _0x326bbd=_0x14f810;return(await Pe('wmic',[_0x326bbd(0x206),'get',_0x326bbd(0x343),'/FORMAT:CSV'],Gn))['split']('\x0a')[_0x326bbd(0x1ec)](_0x3f9f54=>_0x3f9f54[_0x326bbd(0x2dd)]())[_0x326bbd(0x305)](Boolean)[_0x326bbd(0x1ec)](_0x226276=>{const _0x2fd938=_0x326bbd;let _0x4b8ed0=_0x226276['split'](',');if(_0x4b8ed0['length']<0x3)return null;let _0x146446=Number(_0x4b8ed0[_0x4b8ed0['length']-0x1]),_0x9e3757=_0x4b8ed0[_0x2fd938(0x27e)](0x1,_0x4b8ed0['length']-0x1)['join'](',');if(!Number[_0x2fd938(0x32d)](_0x146446)||_0x146446===0x0||!Jn(_0x9e3757))return null;let _0x4ab24e=_e(_0x9e3757);return _0x4ab24e?{'pid':_0x146446,'command':_0x9e3757,'agent':_0x4ab24e[_0x2fd938(0x2e3)]}:null;})[_0x326bbd(0x305)](_0x5122bd=>!!_0x5122bd);}async function ri(){const _0x4f8626=_0x14f810;return process['platform']===_0x4f8626(0x2b0)?ni():ti();}async function si(_0x1b9016){const _0x100c4f=_0x14f810;let _0x80c121=Date['now'](),_0x14bb48=G['startTimer']('process.scan.pgrep_ms'),_0x5c2bed=await ri();_0x1b9016&&(_0x1b9016['pgrepMs']+=_0x14bb48()),_0x1b9016&&(_0x1b9016['matchedProcesses']=_0x5c2bed[_0x100c4f(0x2d5)]);let _0x7b6ab7=_0x5c2bed['filter'](_0x35aff1=>Ks(_0x35aff1[_0x100c4f(0x1ee)]));_0x1b9016&&(_0x1b9016['aliveProcesses']=_0x7b6ab7['length']);let _0x4394b6=G[_0x100c4f(0x24d)](_0x100c4f(0x336)),_0x5077ea=[];for(let _0x57e3c7=0x0;_0x57e3c7<_0x7b6ab7['length'];_0x57e3c7+=Bn){if(!ks(_0x80c121)){_0x1b9016&&(_0x1b9016[_0x100c4f(0x220)]+=_0x7b6ab7['length']-_0x57e3c7);break;}let _0x48a988=_0x7b6ab7[_0x100c4f(0x27e)](_0x57e3c7,_0x57e3c7+Bn),_0x4ddf9c=await Promise[_0x100c4f(0x2bc)](_0x48a988[_0x100c4f(0x1ec)](async _0xaa1ff3=>{const _0x2d9cbe=_0x100c4f;let [_0x29f7c7,_0x5272ae]=await Promise[_0x2d9cbe(0x2bc)]([Ys(_0xaa1ff3['pid']),Zs(_0xaa1ff3['pid'])]);return{'pid':_0xaa1ff3[_0x2d9cbe(0x1ee)],'agent':_0xaa1ff3[_0x2d9cbe(0x2e3)],'command':_0xaa1ff3[_0x2d9cbe(0x2a0)],'cwd':_0x29f7c7,'sessionFiles':_0x5272ae};}));_0x5077ea['push'](..._0x4ddf9c);}return _0x1b9016&&(_0x1b9016[_0x100c4f(0x2ac)]+=_0x4394b6()),_0x1b9016&&(_0x1b9016['snapshots']=_0x5077ea[_0x100c4f(0x2d5)]),_0x5077ea;}function Kn(_0x579dcc){return _0x579dcc['replace'](/[^a-zA-Z0-9]/g,'-');}async function ii(_0x54d807,_0x45b4fe){const _0x3956da=_0x14f810;if(!_0x45b4fe)return null;try{if(_0x54d807===_0x3956da(0x272)){let _0x31cfab=(0x0,L['join'])((0x0,dt['homedir'])(),_0x3956da(0x247),_0x3956da(0x313),Kn(_0x45b4fe)),_0x584d0d=(await(0x0,de[_0x3956da(0x315)])(_0x31cfab)['catch'](()=>[]))['filter'](_0x119201=>_0x119201['endsWith'](_0x3956da(0x1dc)));if(_0x584d0d[_0x3956da(0x2d5)]===0x0)return null;let _0x437aca=null;if(await Promise[_0x3956da(0x2bc)](_0x584d0d['map'](async _0x5d9597=>{const _0x50fb2f=_0x3956da;let _0x2ea43a=await(0x0,de[_0x50fb2f(0x239)])((0x0,L['join'])(_0x31cfab,_0x5d9597))['catch'](()=>null);_0x2ea43a&&(!_0x437aca||_0x2ea43a['mtimeMs']>_0x437aca['mtimeMs'])&&(_0x437aca={'name':_0x5d9597,'mtimeMs':_0x2ea43a[_0x50fb2f(0x1f5)]});})),!_0x437aca)return null;let _0x5f3b06=(0x0,L['join'])(_0x31cfab,_0x437aca['name']),_0x5237a1=_(_0x54d807,_0x5f3b06);return _0x5237a1?{'sessionId':_0x5237a1,'filePath':_0x5f3b06}:null;}return kn(_0x45b4fe);}catch{return null;}}async function oi(_0x1b3b99,_0x27a5b8,_0x5df6d4){const _0x54137c=_0x14f810;if(!_0x27a5b8||!_0x5df6d4)return null;try{if(_0x1b3b99==='claude'){let _0x44a951=(0x0,L['join'])((0x0,dt['homedir'])(),_0x54137c(0x247),'projects',Kn(_0x27a5b8),_0x5df6d4+'.jsonl');return(await(0x0,de[_0x54137c(0x239)])(_0x44a951)[_0x54137c(0x1e9)](()=>null))?.['isFile']()?_0x44a951:null;}return null;}catch{return null;}}async function ai(_0x43a2ab){const _0x23e16e=_0x14f810;if(_0x43a2ab[_0x23e16e(0x25d)]||_0x43a2ab[_0x23e16e(0x1db)]!==_0x23e16e(0x246))return _0x43a2ab;let _0x3c2ef2=await oi(_0x43a2ab[_0x23e16e(0x2e3)],_0x43a2ab['cwd'],_0x43a2ab[_0x23e16e(0x20c)]);return _0x3c2ef2?{..._0x43a2ab,'sessionFilePath':_0x3c2ef2}:_0x43a2ab;}async function li(){const _0x42da83=_0x14f810;let _0x35d60e={'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},_0x5563d6=G['startTimer']('process.scan.total_ms'),_0x240c85=await si(_0x35d60e),_0x19b133=[],_0xbc0385=[];for(let _0x1eba31 of _0x240c85){let _0x36d896=Qs(_0x1eba31);if(_0x36d896){_0x19b133['push'](_0x36d896);continue;}Gs(_0x1eba31[_0x42da83(0x2e3)],_0x1eba31[_0x42da83(0x2a0)])&&_0xbc0385[_0x42da83(0x26a)](_0x1eba31);}_0x35d60e['directCandidates']=_0x19b133[_0x42da83(0x2d5)],_0x35d60e[_0x42da83(0x215)]=_0xbc0385[_0x42da83(0x2d5)];let _0x1b763b=G['startTimer']('process.scan.fallback_ms'),_0x39ff5f=await Promise['all'](_0xbc0385['map'](async _0x5bc2f7=>{const _0x30ab4a=_0x42da83;let _0x46c93e=await ii(_0x5bc2f7['agent'],_0x5bc2f7['cwd']);return _0x46c93e?{'agent':_0x5bc2f7[_0x30ab4a(0x2e3)],'pid':_0x5bc2f7['pid'],'cwd':_0x5bc2f7[_0x30ab4a(0x32a)],'command':_0x5bc2f7[_0x30ab4a(0x2a0)],'sessionId':_0x46c93e[_0x30ab4a(0x20c)],'confidence':'low','sessionFilePath':_0x46c93e['filePath']}:null;}));_0x35d60e[_0x42da83(0x2bb)]=_0x1b763b(),_0x35d60e['fallbackHits']=_0x39ff5f[_0x42da83(0x305)](_0x569541=>_0x569541!==null)['length'];let _0x48108e=G[_0x42da83(0x24d)]('process.scan.hydrate_ms'),_0x237e68=await Promise['all']([..._0x19b133,..._0x39ff5f['filter'](_0x50a65c=>_0x50a65c!==null)][_0x42da83(0x1ec)](_0x158a77=>ai(_0x158a77))),_0x1f239a=await Promise['all'](_0x237e68[_0x42da83(0x1ec)](_0x1ee872=>Xs(_0x1ee872)));_0x35d60e['hydrateMs']=_0x48108e(),_0x35d60e[_0x42da83(0x1dd)]=_0x1f239a['filter'](_0x19b786=>_0x19b786!==null)[_0x42da83(0x2d5)];let _0x260b56=Js(_0x1f239a['filter'](_0xd7c61f=>_0xd7c61f!==null));return _0x35d60e[_0x42da83(0x2b1)]=_0x5563d6(),(_0x35d60e[_0x42da83(0x2b1)]>=Ps||_0x35d60e[_0x42da83(0x215)]>0x0)&&ut['info']({'durationMs':_0x35d60e[_0x42da83(0x2b1)],'pgrepMs':_0x35d60e['pgrepMs'],'lsofMs':_0x35d60e[_0x42da83(0x2ac)],'fallbackMs':_0x35d60e[_0x42da83(0x2bb)],'hydrateMs':_0x35d60e['hydrateMs'],'matchedProcesses':_0x35d60e['matchedProcesses'],'aliveProcesses':_0x35d60e['aliveProcesses'],'snapshots':_0x35d60e[_0x42da83(0x2e4)],'skippedProcessDetails':_0x35d60e[_0x42da83(0x220)]||void 0x0,'directCandidates':_0x35d60e[_0x42da83(0x254)],'fallbackLookups':_0x35d60e[_0x42da83(0x215)],'fallbackHits':_0x35d60e[_0x42da83(0x25f)],'hydratedCandidates':_0x35d60e[_0x42da83(0x1dd)],'sessions':_0x260b56[_0x42da83(0x2d5)]},'process\x20running\x20sessions\x20scanned'),ue={'value':_0x260b56,'expiresAt':Date['now']()+Fs},_0x260b56;}async function mt(){const _0x4562c0=_0x14f810;return ue&&Date[_0x4562c0(0x2df)]()<ue[_0x4562c0(0x22d)]?ue['value']:ce||(ce=li()['finally'](()=>{ce=null;}),ce);}if(!ht['parentPort'])throw new Error(_0x14f810(0x2cc));var gt=ht['parentPort'];async function ci(_0x344252){const _0x2e8e4c=_0x14f810;try{if(_0x344252['kind']===_0x2e8e4c(0x206))return _0x344252['invalidate']&&ft(),{'id':_0x344252['id'],'ok':!0x0,'result':await mt()};ft(),_n();let _0x427950=await mt();gt[_0x2e8e4c(0x287)]({'id':_0x344252['id'],'ok':!0x0,'progress':_0x2e8e4c(0x297)});let _0x174240=await Ln();return{'id':_0x344252['id'],'ok':!0x0,'result':{'scannedSessions':_0x174240,'runningSessions':_0x427950}};}catch(_0x47f09b){return{'id':_0x344252['id'],'ok':!0x1,'error':_0x47f09b instanceof Error?_0x47f09b['name']+':\x20'+_0x47f09b[_0x2e8e4c(0x2ee)]:String(_0x47f09b)};}}var Xn=Promise[_0x14f810(0x289)]();gt['on']('message',_0x141def=>{Xn=Xn['then'](async()=>{const _0x5412c9=_0x119c;gt[_0x5412c9(0x287)](await ci(_0x141def));});});
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,2 +1,2 @@
1
- var c=require("node:fs"),n=require("node:path"),p="@vibelet/cli";function i(r){try{let e=JSON.parse((0,c.readFileSync)(r,"utf8"));if(e.name===p&&typeof e.version=="string"&&e.version.length>0)return e.version}catch{}return null}function l(){return"1.2.162"}var a=l();process.stdout.write(`${a}
1
+ var c=require("node:fs"),n=require("node:path"),p="@vibelet/cli";function i(r){try{let e=JSON.parse((0,c.readFileSync)(r,"utf8"));if(e.name===p&&typeof e.version=="string"&&e.version.length>0)return e.version}catch{}return null}function l(){return"1.2.164"}var a=l();process.stdout.write(`${a}
2
2
  `);