trimprompt 1.0.31 → 1.0.33
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 +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -99
- package/filters/index.js +1 -185
- package/filters/js.js +1 -78
- package/filters/python.js +1 -130
- package/filters/rust.js +1 -115
- package/filters/shell.js +1 -395
- package/hooks/claude-hook.js +1 -79
- package/index.html +0 -73
- package/mcp.js +1 -132
- package/package.json +4 -1
- package/proxy-conv.js +1 -181
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/api-proxy.js +0 -1
- package/proxy-daemon.js +0 -382
- package/traffic-interceptor.js +0 -1
package/cache-manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
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{}}
|
package/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
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;}
|
package/ccr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
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();}
|
package/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';const a0_0x56a941=a0_0x58f0;(function(_0x5d2a5e,_0x224814){const _0x49b520=a0_0x58f0,_0x3cce87=_0x5d2a5e();while(!![]){try{const _0x4defda=parseInt(_0x49b520(0x1ee))/0x1*(-parseInt(_0x49b520(0x1b9))/0x2)+-parseInt(_0x49b520(0x1ca))/0x3*(-parseInt(_0x49b520(0x234))/0x4)+parseInt(_0x49b520(0x245))/0x5*(-parseInt(_0x49b520(0x24e))/0x6)+-parseInt(_0x49b520(0x23f))/0x7+-parseInt(_0x49b520(0x20e))/0x8*(-parseInt(_0x49b520(0x217))/0x9)+parseInt(_0x49b520(0x1b4))/0xa+-parseInt(_0x49b520(0x1da))/0xb*(-parseInt(_0x49b520(0x21d))/0xc);if(_0x4defda===_0x224814)break;else _0x3cce87['push'](_0x3cce87['shift']());}catch(_0x2e2d0b){_0x3cce87['push'](_0x3cce87['shift']());}}}(a0_0x28cb,0x2d937));var __createBinding=this&&this[a0_0x56a941(0x193)]||(Object[a0_0x56a941(0x1b7)]?function(_0x349e3e,_0x37ae80,_0x435600,_0x1ae16b){const _0x282f7f=a0_0x56a941;if(_0x1ae16b===undefined)_0x1ae16b=_0x435600;var _0x14198e=Object[_0x282f7f(0x19a)](_0x37ae80,_0x435600);(!_0x14198e||(_0x282f7f(0x21c)in _0x14198e?!_0x37ae80[_0x282f7f(0x1e0)]:_0x14198e[_0x282f7f(0x1a3)]||_0x14198e[_0x282f7f(0x19e)]))&&(_0x14198e={'enumerable':!![],'get':function(){return _0x37ae80[_0x435600];}}),Object[_0x282f7f(0x1d8)](_0x349e3e,_0x1ae16b,_0x14198e);}:function(_0x5eb45f,_0x132e6e,_0x33fec2,_0x200bec){if(_0x200bec===undefined)_0x200bec=_0x33fec2;_0x5eb45f[_0x200bec]=_0x132e6e[_0x33fec2];}),__setModuleDefault=this&&this[a0_0x56a941(0x1b0)]||(Object[a0_0x56a941(0x1b7)]?function(_0x501c48,_0x496f9d){const _0x40a9f3=a0_0x56a941;Object[_0x40a9f3(0x1d8)](_0x501c48,'default',{'enumerable':!![],'value':_0x496f9d});}:function(_0x5083bd,_0x4c9bcf){const _0x4a4631=a0_0x56a941;_0x5083bd[_0x4a4631(0x1ce)]=_0x4c9bcf;}),__importStar=this&&this[a0_0x56a941(0x194)]||(function(){var _0x33d3ab=function(_0x168211){const _0xca30fc=a0_0x58f0;return _0x33d3ab=Object[_0xca30fc(0x188)]||function(_0x24997b){const _0x1f91cd=_0xca30fc;var _0x41837e=[];for(var _0x1d62b0 in _0x24997b)if(Object[_0x1f91cd(0x22e)][_0x1f91cd(0x240)][_0x1f91cd(0x1c5)](_0x24997b,_0x1d62b0))_0x41837e[_0x41837e[_0x1f91cd(0x1cb)]]=_0x1d62b0;return _0x41837e;},_0x33d3ab(_0x168211);};return function(_0x324e41){const _0x44df09=a0_0x58f0;if(_0x324e41&&_0x324e41[_0x44df09(0x1e0)])return _0x324e41;var _0x36bdba={};if(_0x324e41!=null){for(var _0x25ef3f=_0x33d3ab(_0x324e41),_0x5f51ec=0x0;_0x5f51ec<_0x25ef3f[_0x44df09(0x1cb)];_0x5f51ec++)if(_0x25ef3f[_0x5f51ec]!=='default')__createBinding(_0x36bdba,_0x324e41,_0x25ef3f[_0x5f51ec]);}return __setModuleDefault(_0x36bdba,_0x324e41),_0x36bdba;};}());Object[a0_0x56a941(0x1d8)](exports,'__esModule',{'value':!![]});const commander_1=require(a0_0x56a941(0x20d)),executor_1=require(a0_0x56a941(0x241)),filters_1=require(a0_0x56a941(0x1cf)),tracker_1=require(a0_0x56a941(0x1b1)),cache_1=require(a0_0x56a941(0x1f3)),shims_1=require(a0_0x56a941(0x1e8)),dashboard_1=require(a0_0x56a941(0x196)),program=new commander_1[(a0_0x56a941(0x1b3))]();function isDisabled(){const _0x5dfd92=a0_0x56a941;return process[_0x5dfd92(0x1e1)][_0x5dfd92(0x236)]==='1';}function adjustCommandArgs(_0x5ea188,_0x4df8da){const _0x1ff0a0=a0_0x56a941,_0x2ad75f=_0x5ea188[_0x1ff0a0(0x25f)]();if(_0x2ad75f===_0x1ff0a0(0x1bd)||_0x2ad75f===_0x1ff0a0(0x1cc)){const _0x5d345f=_0x4df8da[0x0];if(_0x5d345f===_0x1ff0a0(0x1aa)){const _0x4d6ef8=_0x4df8da[_0x1ff0a0(0x192)](0x1),_0x55855c=_0x4d6ef8[_0x1ff0a0(0x1cb)]===0x0||_0x4d6ef8[_0x1ff0a0(0x1dc)](_0x303145=>{const _0x12b84e=_0x1ff0a0;return _0x303145==='-b'||_0x303145==='--branch'||_0x303145==='-sb'||_0x303145===_0x12b84e(0x1b5)||_0x303145==='-s'||_0x303145==='--short';});if(_0x55855c)return{'cmd':_0x5ea188,'args':[_0x1ff0a0(0x1aa),_0x1ff0a0(0x256),'-b']};}else{if(_0x5d345f===_0x1ff0a0(0x1c3)){const _0x41b48c=_0x4df8da[_0x1ff0a0(0x192)](0x1),_0x592e9e=_0x41b48c['some'](_0x402ae1=>_0x402ae1[_0x1ff0a0(0x203)](_0x1ff0a0(0x224))||_0x402ae1[_0x1ff0a0(0x203)](_0x1ff0a0(0x205))||_0x402ae1[_0x1ff0a0(0x203)](_0x1ff0a0(0x1c1))),_0x248b05=_0x41b48c[_0x1ff0a0(0x248)](_0x96d036=>_0x96d036[_0x1ff0a0(0x203)]('-')&&/^\d+$/['test'](_0x96d036[_0x1ff0a0(0x192)](0x1))||_0x96d036==='-n'||_0x96d036[_0x1ff0a0(0x203)](_0x1ff0a0(0x260))),_0x241e14=[..._0x4df8da];if(!_0x592e9e){const _0x3baa0d=_0x1ff0a0(0x258);_0x241e14[_0x1ff0a0(0x1d1)](process[_0x1ff0a0(0x206)]===_0x1ff0a0(0x1f0)?'\x22'+_0x3baa0d+'\x22':_0x3baa0d);}!_0x248b05&&(_0x592e9e?_0x241e14[_0x1ff0a0(0x1d1)](_0x1ff0a0(0x23e)):_0x241e14[_0x1ff0a0(0x1d1)](_0x1ff0a0(0x253)));const _0x383cb3=_0x41b48c[_0x1ff0a0(0x248)](_0x321494=>_0x321494===_0x1ff0a0(0x1a0)||_0x321494===_0x1ff0a0(0x1b2)||_0x321494[_0x1ff0a0(0x203)]('--min-parents'));return!_0x383cb3&&!_0x248b05&&_0x241e14[_0x1ff0a0(0x1d1)](_0x1ff0a0(0x1b2)),{'cmd':_0x5ea188,'args':_0x241e14};}}}return{'cmd':_0x5ea188,'args':_0x4df8da};}function isMcpServerExecution(_0x29d061,_0x4dfe79){const _0x4c77d8=a0_0x56a941,_0xb4c75a=_0x29d061['toLowerCase'](),_0x2d4eb7=_0x4dfe79[_0x4c77d8(0x218)]('\x20')['toLowerCase']();if(_0xb4c75a[_0x4c77d8(0x22a)](_0x4c77d8(0x200))&&(_0xb4c75a['includes'](_0x4c77d8(0x20f))||_0xb4c75a[_0x4c77d8(0x22a)](_0x4c77d8(0x24d))))return!![];if(_0xb4c75a===_0x4c77d8(0x222)||_0xb4c75a===_0x4c77d8(0x233)||_0xb4c75a===_0x4c77d8(0x25d)||_0xb4c75a==='npm'||_0xb4c75a==='pnpm'||_0xb4c75a===_0x4c77d8(0x1ec)){if(_0x2d4eb7['includes'](_0x4c77d8(0x221))||_0x2d4eb7[_0x4c77d8(0x22a)](_0x4c77d8(0x1fc))||_0x2d4eb7[_0x4c77d8(0x22a)](_0x4c77d8(0x1cd))||_0x2d4eb7[_0x4c77d8(0x22a)]('server-mcp'))return!![];}if(_0x4dfe79['some'](_0x41156d=>{const _0x45a621=_0x4c77d8,_0x315d3c=_0x41156d[_0x45a621(0x25f)]();return _0x315d3c[_0x45a621(0x22a)]('mcp-server')||_0x315d3c['includes']('server-mcp')||_0x315d3c[_0x45a621(0x22a)](_0x45a621(0x221))||_0x315d3c===_0x45a621(0x23c)||_0x315d3c===_0x45a621(0x200);}))return!![];return![];}async function runProxy(_0x13b59f){const _0x711608=a0_0x56a941;if(_0x13b59f[_0x711608(0x1cb)]===0x0){program[_0x711608(0x24f)]();return;}const _0x59e316=_0x13b59f[0x0],_0x12de93=_0x13b59f[_0x711608(0x192)](0x1),_0x5cb446=_0x13b59f[_0x711608(0x218)]('\x20');if(isDisabled()){const _0x975f42=await(0x0,executor_1[_0x711608(0x1de)])(_0x59e316,_0x12de93);process[_0x711608(0x228)][_0x711608(0x1ef)](_0x975f42[_0x711608(0x228)]),process[_0x711608(0x1a4)][_0x711608(0x1ef)](_0x975f42['stderr']),process[_0x711608(0x1fb)](_0x975f42[_0x711608(0x247)]);}if(isMcpServerExecution(_0x59e316,_0x12de93)){console[_0x711608(0x211)](_0x711608(0x1ae));const {runMcpProxy:_0xfdba62}=await Promise[_0x711608(0x24c)]()['then'](()=>__importStar(require(_0x711608(0x201))));_0xfdba62(_0x59e316,_0x12de93);return;}const _0x221c98=adjustCommandArgs(_0x59e316,_0x12de93),_0x4071e1=await(0x0,executor_1['executeCommand'])(_0x221c98['cmd'],_0x221c98['args']),_0x43e01a=(0x0,filters_1[_0x711608(0x1fd)])(_0x5cb446,_0x4071e1[_0x711608(0x228)],_0x4071e1[_0x711608(0x1a4)],tracker_1[_0x711608(0x18e)][_0x711608(0x257)]()[_0x711608(0x1c0)]),_0x4ac5b1={...filters_1[_0x711608(0x1e9)]},_0x4dcf41=_0x4071e1['stdout']+(_0x4071e1['stderr']['trim']()[_0x711608(0x1cb)]>0x0?'\x0a'+_0x4071e1[_0x711608(0x1a4)]:''),_0x369cf5=_0x43e01a[_0x711608(0x1cb)]<_0x4dcf41[_0x711608(0x1cb)]?_0x43e01a:_0x4dcf41,_0x34710e=_0x4071e1[_0x711608(0x247)]===0x0?(0x0,cache_1[_0x711608(0x18b)])(_0x5cb446,_0x369cf5):null;tracker_1[_0x711608(0x18e)][_0x711608(0x250)](_0x5cb446,_0x4dcf41,_0x34710e||_0x369cf5,_0x4071e1[_0x711608(0x247)],_0x4ac5b1,[...filters_1[_0x711608(0x22d)]]),_0x4071e1[_0x711608(0x247)]===0x0?process[_0x711608(0x228)][_0x711608(0x1ef)](_0x369cf5+'\x0a'):(process['stdout'][_0x711608(0x1ef)](_0x43e01a+'\x0a'),_0x4071e1['stderr']['trim']()[_0x711608(0x1cb)]>0x0&&!_0x43e01a[_0x711608(0x22a)](_0x4071e1['stderr']['trim']())&&process[_0x711608(0x1a4)][_0x711608(0x1ef)](_0x4071e1[_0x711608(0x1a4)]+'\x0a')),process[_0x711608(0x1fb)](_0x4071e1[_0x711608(0x247)]);}function a0_0x58f0(_0x4914bc,_0x4bcef3){const _0x28cb26=a0_0x28cb();return a0_0x58f0=function(_0x58f04c,_0x19ce67){_0x58f04c=_0x58f04c-0x188;let _0x555c01=_0x28cb26[_0x58f04c];return _0x555c01;},a0_0x58f0(_0x4914bc,_0x4bcef3);}program['name'](a0_0x56a941(0x1b6))[a0_0x56a941(0x215)](a0_0x56a941(0x19c))[a0_0x56a941(0x1bf)](((()=>{const _0x171cad=a0_0x56a941,_0x3ba684=_0x171cad(0x208);if(_0x3ba684!=='__VERSION__')return _0x3ba684;try{return require(_0x171cad(0x1d7))[_0x171cad(0x1bf)];}catch{try{return require(_0x171cad(0x1c2))['version'];}catch{return _0x171cad(0x1d9);}}})())),program[a0_0x56a941(0x225)]('ui')[a0_0x56a941(0x1fa)](a0_0x56a941(0x1bb))['description'](a0_0x56a941(0x254))[a0_0x56a941(0x23b)]('-p,\x20--port\x20<number>',a0_0x56a941(0x18a),a0_0x56a941(0x219))[a0_0x56a941(0x23a)](_0x47b065=>{const _0x37bc55=a0_0x56a941,_0x1b8d70=parseInt(_0x47b065['port'],0xa);(0x0,dashboard_1[_0x37bc55(0x18c)])(_0x1b8d70);}),program[a0_0x56a941(0x225)](a0_0x56a941(0x259))[a0_0x56a941(0x215)]('Show\x20token\x20and\x20cost\x20savings\x20summary')[a0_0x56a941(0x23b)]('-m,\x20--model\x20<string>',a0_0x56a941(0x242),'claude-3-5-sonnet')['action'](_0x8ab78c=>{const _0x5578d9=a0_0x56a941,_0x468530=tracker_1[_0x5578d9(0x18e)][_0x5578d9(0x1dd)](_0x8ab78c['model']);console[_0x5578d9(0x1c3)](_0x5578d9(0x20c)),console['log'](_0x5578d9(0x1d4)),console[_0x5578d9(0x1c3)](_0x5578d9(0x1f2)),console[_0x5578d9(0x1c3)](_0x5578d9(0x1a9)+_0x468530[_0x5578d9(0x229)]),console['log'](_0x5578d9(0x1f4)+_0x468530[_0x5578d9(0x1a2)][_0x5578d9(0x1f8)]()),console['log']('Compressed:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x468530[_0x5578d9(0x18d)][_0x5578d9(0x1f8)]()),console[_0x5578d9(0x1c3)](_0x5578d9(0x21f)+_0x468530['total_tokens_saved'][_0x5578d9(0x1f8)]()),console[_0x5578d9(0x1c3)]('Reduction\x20Rate:\x20\x20\x20\x20'+_0x468530[_0x5578d9(0x21a)]+'%'),console['log']('Estimated\x20Cost:\x20\x20\x20\x20$'+_0x468530[_0x5578d9(0x1a8)]['toFixed'](0x4)+_0x5578d9(0x19f)),console[_0x5578d9(0x1c3)](_0x5578d9(0x249)+_0x468530[_0x5578d9(0x235)][_0x5578d9(0x1ea)](0x4)+_0x5578d9(0x1a7)),console[_0x5578d9(0x1c3)]('---------------------------------------------'),console[_0x5578d9(0x1c3)](_0x5578d9(0x1f7)+_0x468530[_0x5578d9(0x22b)][_0x5578d9(0x1ea)](0x4)+_0x5578d9(0x232)),console[_0x5578d9(0x1c3)](_0x5578d9(0x1d2));}),program[a0_0x56a941(0x225)](a0_0x56a941(0x25b))['description']('Manage\x20local\x20configuration\x20parameters')[a0_0x56a941(0x1e6)](a0_0x56a941(0x190),a0_0x56a941(0x195))['argument'](a0_0x56a941(0x1f5),a0_0x56a941(0x213))[a0_0x56a941(0x1e6)](a0_0x56a941(0x21e),a0_0x56a941(0x1a1))[a0_0x56a941(0x23a)]((_0x5455bc,_0x7b8e8f,_0xe5816f)=>{const _0x2f5add=a0_0x56a941;if(_0x5455bc===_0x2f5add(0x21c)){const _0x45d488=tracker_1[_0x2f5add(0x18e)]['getConfig']();console[_0x2f5add(0x1c3)](_0x7b8e8f+':\x20'+_0x45d488[_0x7b8e8f]);}else{if(_0x5455bc==='set'){_0xe5816f===undefined&&(console[_0x2f5add(0x211)](_0x2f5add(0x1d6)),process['exit'](0x1));let _0xe1032e=_0xe5816f;if(_0xe5816f===_0x2f5add(0x239))_0xe1032e=!![];if(_0xe5816f===_0x2f5add(0x1e2))_0xe1032e=![];if(/^\d+$/[_0x2f5add(0x25e)](_0xe5816f))_0xe1032e=parseInt(_0xe5816f,0xa);tracker_1['tracker'][_0x2f5add(0x237)](_0x7b8e8f,_0xe1032e),console[_0x2f5add(0x1c3)](_0x2f5add(0x1d5)+_0x7b8e8f+'\x20=\x20'+_0xe5816f);}else console[_0x2f5add(0x211)]('Error:\x20Action\x20must\x20be\x20get\x20or\x20set'),process[_0x2f5add(0x1fb)](0x1);}});function printMessage(_0xc2988f){const _0x58164e=a0_0x56a941;if(process[_0x58164e(0x1e1)][_0x58164e(0x214)]===_0x58164e(0x204))try{const _0x1fc40d=require('fs'),_0x525868=process['platform']===_0x58164e(0x1f0)?_0x58164e(0x1f6):'/dev/tty';_0x1fc40d['writeFileSync'](_0x525868,'\x0a'+_0xc2988f+'\x0a');return;}catch{}console[_0x58164e(0x1c3)](_0xc2988f);}program['command'](a0_0x56a941(0x1af))[a0_0x56a941(0x215)]('Install\x20or\x20uninstall\x20system\x20command\x20shims')[a0_0x56a941(0x1e6)](a0_0x56a941(0x190),a0_0x56a941(0x1e3))['action'](_0x125124=>{const _0x44c1fa=a0_0x56a941;if(_0x125124==='install'){const _0x1ec11c=(0x0,shims_1[_0x44c1fa(0x207)])();printMessage(_0x1ec11c['message']);}else{if(_0x125124===_0x44c1fa(0x1c8)){const _0x4866fc=(0x0,shims_1['uninstallShims'])();printMessage(_0x4866fc['message']);}else console[_0x44c1fa(0x211)]('Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall'),process[_0x44c1fa(0x1fb)](0x1);}}),program[a0_0x56a941(0x225)](a0_0x56a941(0x24b))[a0_0x56a941(0x215)](a0_0x56a941(0x238))[a0_0x56a941(0x1e6)](a0_0x56a941(0x1ad),a0_0x56a941(0x220))['action'](_0x34e220=>{const _0x392031=a0_0x56a941;if(isDisabled()){console[_0x392031(0x1c3)](_0x34e220);return;}const _0x552476=(0x0,filters_1['rewriteCommand'])(_0x34e220);console[_0x392031(0x1c3)](_0x552476);}),program[a0_0x56a941(0x225)]('proxy\x20[action]')[a0_0x56a941(0x215)](a0_0x56a941(0x231))[a0_0x56a941(0x23b)](a0_0x56a941(0x223),'Port\x20to\x20listen\x20on',a0_0x56a941(0x23d))[a0_0x56a941(0x23a)](async(_0x3a1474,_0x348e95)=>{const _0x475418=a0_0x56a941,_0x3f71ad=parseInt(_0x348e95['port'])||0x1f90;if(!_0x3a1474||_0x3a1474===_0x475418(0x22f)){const {startApiProxy:_0x38d56a}=await Promise[_0x475418(0x24c)]()[_0x475418(0x226)](()=>__importStar(require(_0x475418(0x1e5))));_0x38d56a(_0x3f71ad);}else{if(_0x3a1474==='install'){const {startProxyDaemon:_0x48d80a,setAnthropicBaseUrl:_0x4725f0,enableAutostart:_0x838df9}=await Promise[_0x475418(0x24c)]()[_0x475418(0x226)](()=>__importStar(require(_0x475418(0x1ba)))),_0x191b4b=_0x48d80a(_0x3f71ad);_0x191b4b[_0x475418(0x1a5)]?(_0x4725f0(_0x191b4b[_0x475418(0x1c4)]),_0x838df9(),console['log'](_0x475418(0x22c)+_0x191b4b['pid']+')\x20on\x20port\x20'+_0x191b4b[_0x475418(0x1c4)]),console[_0x475418(0x1c3)](_0x475418(0x20a)+_0x191b4b[_0x475418(0x1c4)]),console[_0x475418(0x1c3)](_0x475418(0x19b)),console[_0x475418(0x1c3)](_0x475418(0x1db))):console['error'](_0x475418(0x24a)+_0x191b4b[_0x475418(0x1ab)]);}else{if(_0x3a1474===_0x475418(0x1ac)){const {stopProxyDaemon:_0x3734f0}=await Promise['resolve']()[_0x475418(0x226)](()=>__importStar(require('./proxy-daemon'))),_0x3d1090=_0x3734f0();console[_0x475418(0x1c3)](_0x475418(0x24a)+_0x3d1090[_0x475418(0x1ab)]);}else{if(_0x3a1474===_0x475418(0x1c8)){const {stopProxyDaemon:_0x3daf95,removeAnthropicBaseUrl:_0x40294a,disableAutostart:_0xb3c485}=await Promise[_0x475418(0x24c)]()['then'](()=>__importStar(require('./proxy-daemon')));_0x3daf95(),_0x40294a(),_0xb3c485(),console[_0x475418(0x1c3)]('[TrimPrompt]\x20API\x20proxy\x20stopped,\x20autostart\x20removed,\x20ANTHROPIC_BASE_URL\x20cleared.');}else{if(_0x3a1474==='status'){const {isProxyRunning:_0x253533}=await Promise[_0x475418(0x24c)]()[_0x475418(0x226)](()=>__importStar(require(_0x475418(0x1ba)))),_0x558396=_0x253533();_0x558396[_0x475418(0x25c)]?console[_0x475418(0x1c3)](_0x475418(0x244)+_0x558396[_0x475418(0x1c9)]+_0x475418(0x18f)+_0x558396[_0x475418(0x1c4)]):console[_0x475418(0x1c3)](_0x475418(0x19d));}}}}}}),program[a0_0x56a941(0x225)](a0_0x56a941(0x191))['description'](a0_0x56a941(0x1ff))[a0_0x56a941(0x23b)](a0_0x56a941(0x223),a0_0x56a941(0x1f9),a0_0x56a941(0x23d))[a0_0x56a941(0x23a)](async(_0x714fb2,_0x30e095)=>{const _0x53a6f3=a0_0x56a941,_0x2de5b5=parseInt(_0x30e095[_0x53a6f3(0x1c4)])||0x1f90,{startTrafficInterceptor:_0x1aedfe,installSystemCaCert:_0x75631,enableSystemProxy:_0x35ee6d,disableSystemProxy:_0x100c0d}=await Promise[_0x53a6f3(0x24c)]()['then'](()=>__importStar(require(_0x53a6f3(0x21b))));if(!_0x714fb2||_0x714fb2===_0x53a6f3(0x22f))_0x1aedfe(_0x2de5b5);else{if(_0x714fb2===_0x53a6f3(0x1fe))_0x75631(),_0x35ee6d(_0x2de5b5),console[_0x53a6f3(0x1c3)]('[TrimPrompt\x20Traffic\x20Engine]\x20System-wide\x20traffic\x20interception\x20enabled\x20on\x20127.0.0.1:'+_0x2de5b5),console[_0x53a6f3(0x1c3)]('[TrimPrompt\x20Traffic\x20Engine]\x20Root\x20CA\x20Certificate\x20installed\x20in\x20Windows\x20Trusted\x20Store.');else _0x714fb2===_0x53a6f3(0x1c8)&&(_0x100c0d(),console[_0x53a6f3(0x1c3)](_0x53a6f3(0x1d0)));}}),program[a0_0x56a941(0x225)]('watcher\x20[action]')['description'](a0_0x56a941(0x255))['action'](async _0x23dade=>{const _0x6993ba=a0_0x56a941,{startWatcherDaemon:_0x8e1ee5}=await Promise[_0x6993ba(0x24c)]()['then'](()=>__importStar(require(_0x6993ba(0x1bc))));(!_0x23dade||_0x23dade===_0x6993ba(0x22f)||_0x23dade==='install')&&_0x8e1ee5();}),program[a0_0x56a941(0x225)](a0_0x56a941(0x1c7))['description'](a0_0x56a941(0x230))[a0_0x56a941(0x23a)](async _0x2e6783=>{const _0x26927f=a0_0x56a941,{retrieveChunk:_0x5ea6fe}=await Promise[_0x26927f(0x24c)]()[_0x26927f(0x226)](()=>__importStar(require(_0x26927f(0x1e4)))),_0x44a6e7=_0x5ea6fe(_0x2e6783);_0x44a6e7?console['log'](_0x44a6e7[_0x26927f(0x1b8)]):(console['error'](_0x26927f(0x1f1)+_0x2e6783+_0x26927f(0x198)),process[_0x26927f(0x1fb)](0x1));}),program[a0_0x56a941(0x225)](a0_0x56a941(0x212))['description'](a0_0x56a941(0x210))[a0_0x56a941(0x23a)](async _0x59f7f6=>{const _0x46dd35=a0_0x56a941,{getLatestSessionFile:_0x327c8a,processSessionFile:_0x1de1d1}=await Promise[_0x46dd35(0x24c)]()['then'](()=>__importStar(require(_0x46dd35(0x1bc)))),_0x14dbfe=await Promise['resolve']()[_0x46dd35(0x226)](()=>__importStar(require('fs'))),_0x1ab679=await Promise[_0x46dd35(0x24c)]()[_0x46dd35(0x226)](()=>__importStar(require(_0x46dd35(0x25a))));let _0x38df9b=_0x59f7f6;if(!_0x59f7f6||!_0x14dbfe[_0x46dd35(0x1a6)](_0x59f7f6)){const _0x51e3f7=_0x327c8a('claude');_0x38df9b=_0x51e3f7[_0x46dd35(0x227)];}if(_0x38df9b&&_0x14dbfe[_0x46dd35(0x1a6)](_0x38df9b)){const _0x1c2330=_0x1ab679['extname'](_0x38df9b),_0x38500c=_0x1ab679['dirname'](_0x38df9b),_0x5716b1=_0x1ab679[_0x46dd35(0x202)](_0x38df9b,_0x1c2330),_0x577410=_0x1ab679[_0x46dd35(0x218)](_0x38500c,_0x5716b1+_0x46dd35(0x209)+_0x1c2330);_0x14dbfe[_0x46dd35(0x243)](_0x38df9b,_0x577410),_0x1de1d1(_0x577410,_0x46dd35(0x1d3)),console[_0x46dd35(0x1c3)](_0x46dd35(0x1e7)),console['log'](_0x46dd35(0x251)+_0x38df9b),console[_0x46dd35(0x1c3)](_0x46dd35(0x20b)+_0x577410),console[_0x46dd35(0x1c3)](_0x46dd35(0x216)),console['log'](_0x46dd35(0x1be)+_0x577410+'\x22\x0a');}else console[_0x46dd35(0x211)](_0x46dd35(0x197));});function a0_0x28cb(){const _0x3e47af=['[TrimPrompt]\x20Autostart\x20registered\x20—\x20proxy\x20will\x20relaunch\x20on\x20every\x20login.','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','[TrimPrompt]\x20API\x20proxy\x20is\x20not\x20running.','configurable','\x20(before\x20Trim)','--merges','value\x20to\x20set','total_raw_tokens','writable','stderr','success','existsSync','\x20(after\x20Trim)','raw_cost_usd','Model\x20Context:\x20\x20\x20\x20\x20','status','message','stop','<commandLine>','[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...','shims','__setModuleDefault','./tracker','--no-merges','Command','3413090zVydav','-bs','trim','create','raw_payload','9006TpVFyo','./proxy-daemon','dashboard','./file-watcher','git','\x20\x20claude\x20--resume\x20\x22','version','redaction_enabled','--format','./package.json','log','port','call','compact','retrieve\x20<chunkId>','uninstall','pid','9327XeNVkf','length','yadm','mcp-server','default','./filters','[TrimPrompt\x20Traffic\x20Engine]\x20System-wide\x20traffic\x20interception\x20disabled.','push','=============================================\x0a','claude','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','Config\x20set\x20','Error:\x20Value\x20required\x20for\x20set\x20action','../package.json','defineProperty','1.0.0','657503OVDYob','[TrimPrompt]\x20Restart\x20your\x20terminal\x20for\x20the\x20env\x20var\x20to\x20take\x20effect.','every','getStatsSummary','executeCommand','--version','__esModule','env','false','install\x20or\x20uninstall','./cache-manager','./api-proxy','argument','\x0a[TrimPrompt\x20Compact]\x20Clean\x20compressed\x20session\x20generated\x20successfully!','./shims','lastRedactAudit','toFixed','traffic','yarn','--help','75EUkTpp','write','win32','[TrimPrompt\x20Cache]\x20Chunk\x20\x27','=============================================','./cache','Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20','<key>','\x5c\x5c.\x5cCON','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','toLocaleString','Port\x20to\x20listen\x20on','alias','exit','modelcontextprotocol','compressOutput','install','Live\x20traffic-level\x20interceptor\x20engine\x20—\x20install\x20(system\x20proxy\x20+\x20SSL\x20Root\x20CA),\x20uninstall,\x20start','mcp','./mcp','basename','startsWith','postinstall','--pretty','platform','installShims','1.0.31','.compact','[TrimPrompt]\x20ANTHROPIC_BASE_URL\x20set\x20to\x20http://127.0.0.1:','Compact\x20session\x20copy:\x20','\x0a=============================================','commander','72sqjCqh','server','Generate\x20a\x20clean,\x20compressed\x20copy\x20of\x20a\x20conversation\x20session\x20file\x20for\x20safe\x20resume','error','compact\x20[sessionId]','config\x20parameter\x20name','npm_lifecycle_event','description','\x0aTo\x20resume\x20with\x20lightweight\x20context,\x20execute:','269685FiJLkh','join','4000','savings_percentage','./traffic-interceptor','get','60AaqhCv','[value]','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','Command\x20line\x20to\x20evaluate','@modelcontextprotocol/','npx','-p,\x20--port\x20<port>','--oneline','command','then','fullPath','stdout','model_name','includes','money_saved_usd','[TrimPrompt]\x20API\x20proxy\x20started\x20in\x20background\x20(pid\x20','lastFeatures','prototype','start','Retrieve\x20raw\x20offloaded\x20content\x20chunk\x20from\x20local\x20side-cache','Claude\x20API\x20proxy\x20—\x20start\x20(foreground),\x20install\x20(background\x20daemon),\x20stop,\x20status,\x20uninstall','\x20USD','node','284sadkbR','compressed_cost_usd','TRIMPROMPT_DISABLED','setConfig','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','true','action','option','mcp-proxy','8080','-50','2481059CQuMBG','hasOwnProperty','./executor','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','copyFileSync','[TrimPrompt]\x20API\x20proxy\x20running\x20(pid\x20','419595ldwFLI','catch','exitCode','some','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','[TrimPrompt]\x20','rewrite','resolve','proxy','18nWIJOy','help','logExecution','Original\x20file\x20untouched:\x20','watcher','-10','Start\x20the\x20local\x20developer\x20dashboard','Live\x20conversation\x20file-watcher\x20daemon\x20—\x20start,\x20install','--porcelain','getConfig','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','stats','path','config','running','bun','test','toLowerCase','--max-count','getOwnPropertyNames','parse','Port\x20to\x20run\x20the\x20dashboard\x20on','dedup','startDashboard','total_compressed_tokens','tracker',')\x20on\x20port\x20','<action>','traffic\x20[action]','slice','__createBinding','__importStar','get\x20or\x20set','./dashboard','[TrimPrompt\x20Compact]\x20Could\x20not\x20find\x20session\x20file.','\x27\x20not\x20found\x20or\x20expired.','argv','getOwnPropertyDescriptor'];a0_0x28cb=function(){return _0x3e47af;};return a0_0x28cb();}const args=process[a0_0x56a941(0x199)][a0_0x56a941(0x192)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0x56a941(0x1bb),'stats',a0_0x56a941(0x25b),a0_0x56a941(0x1af),a0_0x56a941(0x24b),'proxy',a0_0x56a941(0x23c),a0_0x56a941(0x200),a0_0x56a941(0x1eb),a0_0x56a941(0x252),'retrieve',a0_0x56a941(0x1c6),a0_0x56a941(0x24f),a0_0x56a941(0x1ed),'-h',a0_0x56a941(0x1bf),a0_0x56a941(0x1df),'-v'];firstArg&&!subcommands['includes'](firstArg)?runProxy(args)[a0_0x56a941(0x246)](_0x3f9f8e=>{const _0x2d2c0f=a0_0x56a941;console[_0x2d2c0f(0x211)]('[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20'+_0x3f9f8e[_0x2d2c0f(0x1ab)]),process['exit'](0x1);}):program[a0_0x56a941(0x189)](process['argv']);
|
|
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']);
|
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x5b0501=a0_0x4bd9;function a0_0x4bd9(_0x18073a,_0x42a7a){const _0xf5338c=a0_0xf533();return a0_0x4bd9=function(_0x4bd949,_0x55df5b){_0x4bd949=_0x4bd949-0xa0;let _0x105f3a=_0xf5338c[_0x4bd949];return _0x105f3a;},a0_0x4bd9(_0x18073a,_0x42a7a);}(function(_0x36a39b,_0x7012d8){const _0x1e63d1=a0_0x4bd9,_0x1f806b=_0x36a39b();while(!![]){try{const _0x8d69e4=parseInt(_0x1e63d1(0xb7))/0x1+-parseInt(_0x1e63d1(0x10e))/0x2*(-parseInt(_0x1e63d1(0x11a))/0x3)+parseInt(_0x1e63d1(0xda))/0x4+-parseInt(_0x1e63d1(0xf3))/0x5*(parseInt(_0x1e63d1(0xc8))/0x6)+-parseInt(_0x1e63d1(0xa0))/0x7+parseInt(_0x1e63d1(0xec))/0x8+-parseInt(_0x1e63d1(0xfe))/0x9;if(_0x8d69e4===_0x7012d8)break;else _0x1f806b['push'](_0x1f806b['shift']());}catch(_0x512a21){_0x1f806b['push'](_0x1f806b['shift']());}}}(a0_0xf533,0xe6304));function a0_0xf533(){const _0x43a955=['includes','.trimprompt','tracker','fileName','message','copilot','mkdirSync','1329oXSopb','Missing\x20key','create','conv_compress','toFixed','platform','activeSavedTokens','utf8','/api/stats/history','__setModuleDefault','../src/index.html','7027580PaznvU','default','logs','disableAutostart','openclaw','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','timestamp','sendFile','slice','claude','resolve','prototype','/api/config/custom-path','startDashboard','features_enabled','join','readFileSync','get','path','/api/config/features','post','startProxyDaemon','params','759113kWklyY','conv_','setConfig','logExecution','getOwnPropertyNames','estimated_raw_tokens','favicon.png','../src/favicon.png','writable','defineProperty','auto','Raw\x20output\x20log\x20file\x20not\x20found.','http://localhost:','cursor','model_used','aider','status','264xJqYja','__esModule','startsWith','env','tokens_saved','/api/config/open-dir','repeat','/favicon.png','catch','model_name','estimated_compressed_tokens','model_key','__importDefault','.comp.txt','log','.raw.txt','/api/proxy/status','./tracker','7087128eGqmwR','then','total_raw_tokens','./file-watcher','length','call','express','features','setAnthropicBaseUrl','__importStar','No\x20active\x20session\x20file\x20found','index.html','codex','error','getOwnPropertyDescriptor','resp_optimize','enableAutostart','EADDRINUSE','12116376lvkyGZ','__createBinding','listen','Compressed\x20output\x20log\x20file\x20not\x20found.','TRIMPROMPT_HEADLESS','opencode','fullPath','166870ppyUzN','gemini','getLogs','Missing\x20agentKey','homedir','getConfig','query','existsSync','argv','lastModified','cortex','10069407VMaqUd','live-conv','use','darwin','open\x20\x22','command','getStatsSummary','--headless','win32','conv:','raw_cost_usd','json','[TrimPrompt]\x20Dashboard\x20error:\x20','model','/api/proxy/stop','TRIMPROMPT_NO_OPEN','2206AsFkBB','Directory\x20not\x20found','filter','isProxyRunning','body'];a0_0xf533=function(){return _0x43a955;};return a0_0xf533();}var __createBinding=this&&this[a0_0x5b0501(0xed)]||(Object[a0_0x5b0501(0x11c)]?function(_0x3d2900,_0x2e7c8a,_0x35eb4e,_0x145398){const _0x2c1556=a0_0x5b0501;if(_0x145398===undefined)_0x145398=_0x35eb4e;var _0x1dbc6d=Object[_0x2c1556(0xe8)](_0x2e7c8a,_0x35eb4e);(!_0x1dbc6d||('get'in _0x1dbc6d?!_0x2e7c8a['__esModule']:_0x1dbc6d[_0x2c1556(0xbf)]||_0x1dbc6d['configurable']))&&(_0x1dbc6d={'enumerable':!![],'get':function(){return _0x2e7c8a[_0x35eb4e];}}),Object[_0x2c1556(0xc0)](_0x3d2900,_0x145398,_0x1dbc6d);}:function(_0x3988e4,_0x4b0123,_0xd0815b,_0x414a03){if(_0x414a03===undefined)_0x414a03=_0xd0815b;_0x3988e4[_0x414a03]=_0x4b0123[_0xd0815b];}),__setModuleDefault=this&&this[a0_0x5b0501(0x123)]||(Object[a0_0x5b0501(0x11c)]?function(_0x452691,_0x102e1a){const _0x5c0b25=a0_0x5b0501;Object[_0x5c0b25(0xc0)](_0x452691,_0x5c0b25(0xa1),{'enumerable':!![],'value':_0x102e1a});}:function(_0x48ce68,_0x370a32){const _0x596927=a0_0x5b0501;_0x48ce68[_0x596927(0xa1)]=_0x370a32;}),__importStar=this&&this[a0_0x5b0501(0xe3)]||(function(){var _0x4558f7=function(_0x3959f1){const _0x2f533a=a0_0x4bd9;return _0x4558f7=Object[_0x2f533a(0xbb)]||function(_0x4018b3){const _0x16e975=_0x2f533a;var _0x5932ca=[];for(var _0xf608a0 in _0x4018b3)if(Object[_0x16e975(0xab)]['hasOwnProperty'][_0x16e975(0xdf)](_0x4018b3,_0xf608a0))_0x5932ca[_0x5932ca['length']]=_0xf608a0;return _0x5932ca;},_0x4558f7(_0x3959f1);};return function(_0x3eaad5){const _0x563570=a0_0x4bd9;if(_0x3eaad5&&_0x3eaad5['__esModule'])return _0x3eaad5;var _0x2782c1={};if(_0x3eaad5!=null){for(var _0x4b648e=_0x4558f7(_0x3eaad5),_0x42116a=0x0;_0x42116a<_0x4b648e[_0x563570(0xde)];_0x42116a++)if(_0x4b648e[_0x42116a]!==_0x563570(0xa1))__createBinding(_0x2782c1,_0x3eaad5,_0x4b648e[_0x42116a]);}return __setModuleDefault(_0x2782c1,_0x3eaad5),_0x2782c1;};}()),__importDefault=this&&this[a0_0x5b0501(0xd4)]||function(_0x572fc4){const _0x22aea8=a0_0x5b0501;return _0x572fc4&&_0x572fc4[_0x22aea8(0xc9)]?_0x572fc4:{'default':_0x572fc4};};Object[a0_0x5b0501(0xc0)](exports,a0_0x5b0501(0xc9),{'value':!![]}),exports[a0_0x5b0501(0xad)]=startDashboard;const express_1=__importDefault(require(a0_0x5b0501(0xe0))),path=__importStar(require(a0_0x5b0501(0xb2))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require('open')),tracker_1=require(a0_0x5b0501(0xd9)),proxy_daemon_1=require('./proxy-daemon'),app=(0x0,express_1['default'])();app[a0_0x5b0501(0x100)](express_1[a0_0x5b0501(0xa1)]['json']());const baseDir=path[a0_0x5b0501(0xaf)](os[a0_0x5b0501(0xf7)](),a0_0x5b0501(0x114)),logsDir=path[a0_0x5b0501(0xaf)](baseDir,a0_0x5b0501(0xa2));app[a0_0x5b0501(0xb1)]('/',(_0x2db58f,_0x1350e6)=>{const _0x54ffce=a0_0x5b0501,_0x5bff5d=path['join'](__dirname,_0x54ffce(0xe5));fs[_0x54ffce(0xfa)](_0x5bff5d)?_0x1350e6['sendFile'](_0x5bff5d):_0x1350e6[_0x54ffce(0xa7)](path['join'](__dirname,_0x54ffce(0x124)));}),app[a0_0x5b0501(0xb1)](a0_0x5b0501(0xcf),(_0x417941,_0x471556)=>{const _0x13dbd9=a0_0x5b0501,_0x209000=path[_0x13dbd9(0xaf)](__dirname,_0x13dbd9(0xbd));fs['existsSync'](_0x209000)?_0x471556['sendFile'](_0x209000):_0x471556[_0x13dbd9(0xa7)](path[_0x13dbd9(0xaf)](__dirname,_0x13dbd9(0xbe)));}),app['get']('/api/stats/summary',(_0x24f37c,_0x191f6b)=>{const _0x4e5e48=a0_0x5b0501,_0x481be2=_0x24f37c[_0x4e5e48(0xf9)]['model']||'auto',_0x49023c=tracker_1[_0x4e5e48(0x115)][_0x4e5e48(0x104)](_0x481be2);_0x191f6b[_0x4e5e48(0x109)](_0x49023c);}),app[a0_0x5b0501(0xb1)](a0_0x5b0501(0x122),(_0x287750,_0x1fcce5)=>{const _0x403721=a0_0x5b0501,_0x1b5408=tracker_1[_0x403721(0x115)][_0x403721(0xf5)]();_0x1fcce5[_0x403721(0x109)](_0x1b5408[_0x403721(0xde)]>0x1f4?_0x1b5408[_0x403721(0xa8)](-0x1f4):_0x1b5408);}),app['get']('/api/stats/inspect/:id',(_0x28c972,_0x394588)=>{const _0x77ece2=a0_0x5b0501,_0x21e9ea=_0x28c972[_0x77ece2(0xb6)]['id'],_0x564e74=path[_0x77ece2(0xaf)](logsDir,_0x21e9ea+_0x77ece2(0xd7)),_0x1a6c5e=path[_0x77ece2(0xaf)](logsDir,_0x21e9ea+_0x77ece2(0xd5));let _0x1f0435=_0x77ece2(0xc2),_0xbd6080=_0x77ece2(0xef);try{fs[_0x77ece2(0xfa)](_0x564e74)&&(_0x1f0435=fs[_0x77ece2(0xb0)](_0x564e74,_0x77ece2(0x121))),fs[_0x77ece2(0xfa)](_0x1a6c5e)&&(_0xbd6080=fs['readFileSync'](_0x1a6c5e,_0x77ece2(0x121)));}catch(_0x5918a9){}_0x394588[_0x77ece2(0x109)]({'id':_0x21e9ea,'raw':_0x1f0435,'compressed':_0xbd6080});}),app[a0_0x5b0501(0xb1)](a0_0x5b0501(0xb3),(_0x523a40,_0x43729b)=>{const _0x34ffc5=a0_0x5b0501,_0x269dff=tracker_1['tracker'][_0x34ffc5(0xf8)]();_0x43729b[_0x34ffc5(0x109)](_0x269dff[_0x34ffc5(0xae)]||{});}),app['post'](a0_0x5b0501(0xb3),(_0x5f41ab,_0x5d0343)=>{const _0x27d220=a0_0x5b0501,_0x51368b=_0x5f41ab[_0x27d220(0x112)];tracker_1[_0x27d220(0x115)][_0x27d220(0xb9)](_0x27d220(0xae),_0x51368b),_0x5d0343[_0x27d220(0x109)]({'ok':!![]});}),app[a0_0x5b0501(0xb1)]('/api/stats/proxy-summary',(_0xb0b1cb,_0xab3909)=>{const _0x31710c=a0_0x5b0501;try{const _0x2087ed=tracker_1['tracker'][_0x31710c(0xf5)](),_0x43d325=_0x570a3e=>Array['isArray'](_0x570a3e[_0x31710c(0xe1)])&&(_0x570a3e[_0x31710c(0xe1)][_0x31710c(0x113)](_0x31710c(0x11d))||_0x570a3e[_0x31710c(0xe1)][_0x31710c(0x113)](_0x31710c(0xe9)))||typeof _0x570a3e['command']==='string'&&_0x570a3e[_0x31710c(0x103)][_0x31710c(0xca)]('proxy:');let _0x12fffd=0x0,_0x51f923=0x0,_0x234e8a=0x0,_0x40be11=0x0,_0x5996c3='';for(const _0x112436 of _0x2087ed){if(!_0x43d325(_0x112436))continue;_0x12fffd+=_0x112436[_0x31710c(0xbc)]||0x0,_0x51f923+=_0x112436[_0x31710c(0xd2)]||0x0,_0x234e8a+=_0x112436[_0x31710c(0xcc)]||0x0,_0x40be11++;if(_0x112436[_0x31710c(0xc5)])_0x5996c3=_0x112436[_0x31710c(0xc5)];}const _0x25a278=_0xb0b1cb[_0x31710c(0xf9)][_0x31710c(0x10b)]||_0x5996c3||_0x31710c(0xc1),_0xe43588=tracker_1[_0x31710c(0x115)]['getStatsSummary'](_0x25a278),_0x17e0cf=_0xe43588[_0x31710c(0xdc)]>0x0?_0xe43588[_0x31710c(0x108)]/_0xe43588[_0x31710c(0xdc)]:0x0,_0x369f29=_0x12fffd>0x0?_0x234e8a/_0x12fffd*0x64:0x0;_0xab3909[_0x31710c(0x109)]({'requests':_0x40be11,'total_raw_tokens':_0x12fffd,'total_compressed_tokens':_0x51f923,'total_tokens_saved':_0x234e8a,'savings_percentage':parseFloat(_0x369f29[_0x31710c(0x11e)](0x1)),'money_saved_usd':parseFloat((_0x234e8a*_0x17e0cf)[_0x31710c(0x11e)](0x4)),'model_name':_0xe43588[_0x31710c(0xd1)],'model_key':_0xe43588[_0x31710c(0xd3)]});}catch(_0x1ad2b8){_0xab3909['json']({'requests':0x0,'total_raw_tokens':0x0,'total_compressed_tokens':0x0,'total_tokens_saved':0x0,'savings_percentage':0x0,'money_saved_usd':0x0});}}),app['get'](a0_0x5b0501(0xd8),(_0x124f76,_0x22f25c)=>{const _0x5004d4=a0_0x5b0501;_0x22f25c['json']((0x0,proxy_daemon_1[_0x5004d4(0x111)])());}),app[a0_0x5b0501(0xb4)]('/api/proxy/start',(_0x1dbe45,_0x40a4f0)=>{const _0x11a726=a0_0x5b0501,_0x4592fe=(0x0,proxy_daemon_1[_0x11a726(0xb5)])();_0x4592fe['success']&&_0x4592fe['port']&&((0x0,proxy_daemon_1[_0x11a726(0xe2)])(_0x4592fe['port']),(0x0,proxy_daemon_1[_0x11a726(0xea)])()),_0x40a4f0[_0x11a726(0x109)](_0x4592fe);}),app[a0_0x5b0501(0xb4)](a0_0x5b0501(0x10c),(_0x5d7ae2,_0x4317dd)=>{const _0x147fce=a0_0x5b0501,_0x3c7520=(0x0,proxy_daemon_1['stopProxyDaemon'])();(0x0,proxy_daemon_1['removeAnthropicBaseUrl'])(),(0x0,proxy_daemon_1[_0x147fce(0xa3)])(),_0x4317dd[_0x147fce(0x109)](_0x3c7520);}),app['post']('/api/agent/compact',async(_0x159335,_0x39d11d)=>{const _0x383b51=a0_0x5b0501;try{const {getLatestSessionFile:_0x30a930,processSessionFile:_0x2a8018,loadSessionsState:_0x212bea}=await Promise[_0x383b51(0xaa)]()['then'](()=>__importStar(require(_0x383b51(0xdd)))),{agentKey:_0x5d52d6}=_0x159335['body']||{},_0x5ecc00=_0x5d52d6||_0x383b51(0xa9),_0x5ab205=_0x30a930(_0x5ecc00);if(_0x5ab205&&_0x5ab205[_0x383b51(0xf2)]&&fs[_0x383b51(0xfa)](_0x5ab205[_0x383b51(0xf2)])){_0x2a8018(_0x5ab205[_0x383b51(0xf2)],_0x5ecc00);const _0x246c9e=_0x212bea(),_0x52a400=_0x246c9e[_0x5ab205[_0x383b51(0xf2)]]&&_0x246c9e[_0x5ab205[_0x383b51(0xf2)]][_0x383b51(0x120)]>0x0?_0x246c9e[_0x5ab205['fullPath']]['activeSavedTokens']:0x5b108,_0x998335='x'[_0x383b51(0xce)]((_0x52a400+0x1f4)*0x4),_0xa01d96='x'['repeat'](0x1f4*0x4);tracker_1[_0x383b51(0x115)][_0x383b51(0xba)](_0x383b51(0x107)+_0x5ecc00,_0x998335,_0xa01d96,_0x52a400,undefined,[_0x383b51(0xb8)+_0x5ecc00,_0x383b51(0xff),_0x5ecc00]),_0x39d11d[_0x383b51(0x109)]({'ok':!![],'fileName':_0x5ab205[_0x383b51(0x116)],'tokensSaved':_0x52a400});}else _0x39d11d[_0x383b51(0x109)]({'ok':![],'message':_0x383b51(0xe4)});}catch(_0x2e6bb5){_0x39d11d[_0x383b51(0xc7)](0x1f4)[_0x383b51(0x109)]({'ok':![],'error':_0x2e6bb5[_0x383b51(0x117)]});}}),app['get']('/api/config',async(_0x47eff2,_0x84a3f)=>{const _0x56e3e9=a0_0x5b0501,{loadConfig:_0x174a7b,getAgentStoragePaths:_0xa85ced,getLatestSessionFile:_0x2d95b0,loadSessionsState:_0x190d38}=await Promise[_0x56e3e9(0xaa)]()[_0x56e3e9(0xdb)](()=>__importStar(require(_0x56e3e9(0xdd)))),_0x5d0ebe=_0x174a7b(),_0x4c90ec=['claude',_0x56e3e9(0xf4),_0x56e3e9(0xe6),_0x56e3e9(0xc4),_0x56e3e9(0xc6),_0x56e3e9(0x118),_0x56e3e9(0xa4),_0x56e3e9(0xf1),_0x56e3e9(0xfd)],_0x1bcacc={},_0x5a7b93={},_0x16bd49={},_0xb129ea=_0x190d38(),_0x12c7cb=tracker_1[_0x56e3e9(0x115)]['getLogs']()||[];for(const _0x42bd60 of _0x4c90ec){_0x1bcacc[_0x42bd60]=_0xa85ced(_0x42bd60);const _0x5d7bd5=_0x2d95b0(_0x42bd60);if(_0x5d7bd5&&_0x5d7bd5[_0x56e3e9(0xf2)]&&_0xb129ea[_0x5d7bd5[_0x56e3e9(0xf2)]])_0x5d7bd5[_0x56e3e9(0x120)]=_0xb129ea[_0x5d7bd5[_0x56e3e9(0xf2)]][_0x56e3e9(0x120)]||0x0;else{if(_0x5d7bd5)_0x5d7bd5[_0x56e3e9(0x120)]=0x0;}_0x16bd49[_0x42bd60]=_0x5d7bd5;const _0x4844fb=_0x12c7cb[_0x56e3e9(0x110)](_0x2923c0=>_0x2923c0[_0x56e3e9(0x103)]&&_0x2923c0['command'][_0x56e3e9(0x113)](_0x56e3e9(0x107)+_0x42bd60));_0x4844fb[_0x56e3e9(0xde)]>0x0?_0x5a7b93[_0x42bd60]=_0x4844fb[_0x4844fb[_0x56e3e9(0xde)]-0x1][_0x56e3e9(0xa6)]:_0x5a7b93[_0x42bd60]=_0x5d7bd5?_0x5d7bd5[_0x56e3e9(0xfc)]:null;}_0x84a3f[_0x56e3e9(0x109)]({..._0x5d0ebe,'resolvedPaths':_0x1bcacc,'lastActiveTimestamps':_0x5a7b93,'latestSessions':_0x16bd49});}),app[a0_0x5b0501(0xb4)](a0_0x5b0501(0xcd),async(_0x190935,_0x19e0de)=>{const _0x35f0be=a0_0x5b0501,{getAgentStoragePaths:_0x18ebf0}=await Promise[_0x35f0be(0xaa)]()['then'](()=>__importStar(require(_0x35f0be(0xdd)))),{agentKey:_0x1697d0}=_0x190935[_0x35f0be(0x112)]||{};if(!_0x1697d0)return _0x19e0de['status'](0x190)[_0x35f0be(0x109)]({'error':_0x35f0be(0xf6)});const _0x384fab=_0x18ebf0(_0x1697d0),_0x4a56a1=_0x384fab['find'](_0x335fd4=>fs['existsSync'](_0x335fd4))||_0x384fab[0x0];if(_0x4a56a1){if(!fs[_0x35f0be(0xfa)](_0x4a56a1))try{fs[_0x35f0be(0x119)](_0x4a56a1,{'recursive':!![]});}catch{}const {exec:_0x250cb0}=await Promise['resolve']()[_0x35f0be(0xdb)](()=>__importStar(require('child_process'))),_0x5a0a30=process[_0x35f0be(0x11f)]===_0x35f0be(0x106)?'explorer\x20\x22'+_0x4a56a1+'\x22':process[_0x35f0be(0x11f)]===_0x35f0be(0x101)?_0x35f0be(0x102)+_0x4a56a1+'\x22':'xdg-open\x20\x22'+_0x4a56a1+'\x22';return _0x250cb0(_0x5a0a30),_0x19e0de[_0x35f0be(0x109)]({'success':!![],'openedPath':_0x4a56a1});}_0x19e0de['status'](0x194)[_0x35f0be(0x109)]({'error':_0x35f0be(0x10f)});}),app[a0_0x5b0501(0xb4)]('/api/config/toggle',async(_0x5f2095,_0x469bea)=>{const _0x254c50=a0_0x5b0501,{saveConfig:_0x31f597}=await Promise['resolve']()[_0x254c50(0xdb)](()=>__importStar(require(_0x254c50(0xdd)))),{key:_0xfeb1fa,value:_0x48d1fc}=_0x5f2095[_0x254c50(0x112)]||{};if(_0xfeb1fa){const _0x42800e=_0x31f597({'conversation_toggles':{[_0xfeb1fa]:_0x48d1fc}});return _0x469bea[_0x254c50(0x109)](_0x42800e);}_0x469bea[_0x254c50(0xc7)](0x190)[_0x254c50(0x109)]({'error':_0x254c50(0x11b)});}),app[a0_0x5b0501(0xb4)](a0_0x5b0501(0xac),async(_0x25e680,_0x1199ca)=>{const _0x4d4e75=a0_0x5b0501,{saveConfig:_0x2904a4}=await Promise['resolve']()[_0x4d4e75(0xdb)](()=>__importStar(require('./file-watcher'))),{agentKey:_0x1b3937,path:_0xacc0b2}=_0x25e680[_0x4d4e75(0x112)]||{};if(_0x1b3937){const _0xadb1d8=_0x2904a4({'custom_storage_paths':{[_0x1b3937]:_0xacc0b2||null}});return _0x1199ca[_0x4d4e75(0x109)](_0xadb1d8);}_0x1199ca[_0x4d4e75(0xc7)](0x190)['json']({'error':_0x4d4e75(0xf6)});});function startDashboard(_0x3b69a9=0xfa0){const _0x202904=a0_0x5b0501;let _0x49d8ab=_0x3b69a9;const _0x57b9a3=process[_0x202904(0xfb)][_0x202904(0x113)](_0x202904(0x105))||process[_0x202904(0xcb)][_0x202904(0xf0)]==='1',_0x7abe42=app[_0x202904(0xee)](_0x49d8ab,()=>{const _0x253175=_0x202904,_0x1754f9=_0x253175(0xc3)+_0x49d8ab;!_0x57b9a3&&(console[_0x253175(0xd6)]('\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20'+_0x1754f9),console[_0x253175(0xd6)](_0x253175(0xa5))),Promise[_0x253175(0xaa)]()[_0x253175(0xdb)](()=>__importStar(require(_0x253175(0xdd))))[_0x253175(0xdb)](_0x5c5148=>_0x5c5148['startWatcherDaemon']())[_0x253175(0xd0)](()=>{}),!_0x57b9a3&&process[_0x253175(0xcb)][_0x253175(0x10d)]!=='1'&&(0x0,open_1[_0x253175(0xa1)])(_0x1754f9)[_0x253175(0xd0)](()=>{});});_0x7abe42['on']('error',_0x30c975=>{const _0x574fc6=_0x202904;_0x30c975['code']===_0x574fc6(0xeb)?startDashboard(_0x49d8ab+0x1):console[_0x574fc6(0xe7)](_0x574fc6(0x10a)+_0x30c975[_0x574fc6(0x117)]);});}
|
|
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']);});}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
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});});});}
|
package/file-watcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x14bc19=a0_0x2798;function a0_0x2798(_0x4cb7f4,_0x3d1f36){const _0x17190b=a0_0x1719();return a0_0x2798=function(_0x27982c,_0x13350c){_0x27982c=_0x27982c-0x18b;let _0xd24a9c=_0x17190b[_0x27982c];return _0xd24a9c;},a0_0x2798(_0x4cb7f4,_0x3d1f36);}(function(_0x340720,_0x2e2967){const _0x59d632=a0_0x2798,_0x50c9b5=_0x340720();while(!![]){try{const _0x40ae42=-parseInt(_0x59d632(0x1c7))/0x1+-parseInt(_0x59d632(0x18b))/0x2*(-parseInt(_0x59d632(0x1d2))/0x3)+parseInt(_0x59d632(0x1ac))/0x4+parseInt(_0x59d632(0x19f))/0x5+-parseInt(_0x59d632(0x1a2))/0x6+parseInt(_0x59d632(0x1ad))/0x7*(parseInt(_0x59d632(0x1cd))/0x8)+-parseInt(_0x59d632(0x20a))/0x9*(parseInt(_0x59d632(0x199))/0xa);if(_0x40ae42===_0x2e2967)break;else _0x50c9b5['push'](_0x50c9b5['shift']());}catch(_0x2fc725){_0x50c9b5['push'](_0x50c9b5['shift']());}}}(a0_0x1719,0x573d0));var __createBinding=this&&this[a0_0x14bc19(0x1f9)]||(Object['create']?function(_0x29b554,_0x501a33,_0x2d9217,_0x556e7e){const _0x43edae=a0_0x14bc19;if(_0x556e7e===undefined)_0x556e7e=_0x2d9217;var _0x29accf=Object[_0x43edae(0x1c0)](_0x501a33,_0x2d9217);(!_0x29accf||(_0x43edae(0x209)in _0x29accf?!_0x501a33['__esModule']:_0x29accf[_0x43edae(0x222)]||_0x29accf[_0x43edae(0x19e)]))&&(_0x29accf={'enumerable':!![],'get':function(){return _0x501a33[_0x2d9217];}}),Object[_0x43edae(0x1c2)](_0x29b554,_0x556e7e,_0x29accf);}:function(_0x31c1c0,_0x4ccfc3,_0x448f12,_0xbf660f){if(_0xbf660f===undefined)_0xbf660f=_0x448f12;_0x31c1c0[_0xbf660f]=_0x4ccfc3[_0x448f12];}),__setModuleDefault=this&&this[a0_0x14bc19(0x218)]||(Object[a0_0x14bc19(0x1f8)]?function(_0x3be507,_0x557529){const _0x20189d=a0_0x14bc19;Object['defineProperty'](_0x3be507,_0x20189d(0x1e6),{'enumerable':!![],'value':_0x557529});}:function(_0x4fff73,_0x4c74ca){_0x4fff73['default']=_0x4c74ca;}),__importStar=this&&this[a0_0x14bc19(0x1ae)]||(function(){var _0x101012=function(_0x3392af){const _0x5b3cfe=a0_0x2798;return _0x101012=Object[_0x5b3cfe(0x1ec)]||function(_0x1e42f2){const _0x40faef=_0x5b3cfe;var _0x2c81fe=[];for(var _0x5f0538 in _0x1e42f2)if(Object['prototype'][_0x40faef(0x219)][_0x40faef(0x224)](_0x1e42f2,_0x5f0538))_0x2c81fe[_0x2c81fe[_0x40faef(0x1f4)]]=_0x5f0538;return _0x2c81fe;},_0x101012(_0x3392af);};return function(_0x524aaf){const _0x42ab40=a0_0x2798;if(_0x524aaf&&_0x524aaf[_0x42ab40(0x1db)])return _0x524aaf;var _0x297c70={};if(_0x524aaf!=null){for(var _0x5c5aea=_0x101012(_0x524aaf),_0x422e22=0x0;_0x422e22<_0x5c5aea[_0x42ab40(0x1f4)];_0x422e22++)if(_0x5c5aea[_0x422e22]!==_0x42ab40(0x1e6))__createBinding(_0x297c70,_0x524aaf,_0x5c5aea[_0x422e22]);}return __setModuleDefault(_0x297c70,_0x524aaf),_0x297c70;};}());Object[a0_0x14bc19(0x1c2)](exports,'__esModule',{'value':!![]}),exports[a0_0x14bc19(0x208)]=loadConfig,exports[a0_0x14bc19(0x1d8)]=saveConfig,exports[a0_0x14bc19(0x1e4)]=getAgentStoragePaths,exports[a0_0x14bc19(0x20f)]=getLatestSessionFile,exports['loadSessionsState']=loadSessionsState,exports['processSessionFile']=processSessionFile,exports['installWindowsStartupService']=installWindowsStartupService,exports[a0_0x14bc19(0x1f5)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x14bc19(0x214))),os=__importStar(require('os')),cache_manager_1=require(a0_0x14bc19(0x223)),tracker_1=require(a0_0x14bc19(0x1a5)),baseDir=path['join'](os[a0_0x14bc19(0x1e3)](),a0_0x14bc19(0x21a)),configPath=path[a0_0x14bc19(0x217)](baseDir,'config.json'),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 _0x6e5ff=a0_0x14bc19;try{if(!fs['existsSync'](baseDir))fs[_0x6e5ff(0x1b6)](baseDir,{'recursive':!![]});if(fs[_0x6e5ff(0x221)](configPath)){const _0xf3414a=JSON[_0x6e5ff(0x1d3)](fs[_0x6e5ff(0x1da)](configPath,'utf8'));return{...DEFAULT_CONFIG,..._0xf3414a,'conversation_toggles':{...DEFAULT_CONFIG[_0x6e5ff(0x191)],..._0xf3414a[_0x6e5ff(0x191)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0x6e5ff(0x1e1)],..._0xf3414a[_0x6e5ff(0x1e1)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x4d60cd){const _0x5629ea=a0_0x14bc19,_0x2da764=loadConfig(),_0xb64c01={..._0x2da764,..._0x4d60cd,'conversation_toggles':{..._0x2da764[_0x5629ea(0x191)],..._0x4d60cd[_0x5629ea(0x191)]||{}},'custom_storage_paths':{..._0x2da764['custom_storage_paths'],..._0x4d60cd['custom_storage_paths']||{}}};try{if(!fs[_0x5629ea(0x221)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});fs[_0x5629ea(0x20b)](configPath,JSON[_0x5629ea(0x1fa)](_0xb64c01,null,0x2),_0x5629ea(0x1a3));}catch{}return _0xb64c01;}function getAgentStoragePaths(_0xde90d3){const _0x3994a9=a0_0x14bc19,_0x11719d=loadConfig(),_0x5b2081=_0x11719d['custom_storage_paths'][_0xde90d3];if(_0x5b2081&&fs[_0x3994a9(0x221)](_0x5b2081))return[_0x5b2081];const _0x3bebc0=os[_0x3994a9(0x1e3)](),_0xe3aca3=process[_0x3994a9(0x1cc)]===_0x3994a9(0x1c8),_0x30be2c=process['platform']==='darwin';switch(_0xde90d3){case _0x3994a9(0x1e0):return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1f2),_0x3994a9(0x202)),path[_0x3994a9(0x217)](_0x3bebc0,'.claude',_0x3994a9(0x1ef))];case'codex':return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1e7),_0x3994a9(0x18f)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),_0x3994a9(0x1bd),'Codex')];case _0x3994a9(0x1cb):return[path['join'](_0x3bebc0,_0x3994a9(0x1ed),_0x3994a9(0x216)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1ed)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),'Roaming',_0x3994a9(0x18d)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c3),'gemini')];case _0x3994a9(0x18e):if(_0xe3aca3)return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),'Roaming',_0x3994a9(0x1dd),'User','workspaceStorage')];if(_0x30be2c)return[path[_0x3994a9(0x217)](_0x3bebc0,'Library','Application\x20Support',_0x3994a9(0x1dd),'User','workspaceStorage')];return[path['join'](_0x3bebc0,_0x3994a9(0x1c3),'Cursor',_0x3994a9(0x1fb),_0x3994a9(0x21d))];case _0x3994a9(0x211):return[process[_0x3994a9(0x201)](),path['join'](_0x3bebc0,'.aider.chat.history.md')];case _0x3994a9(0x206):if(_0xe3aca3)return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),_0x3994a9(0x1df),_0x3994a9(0x205))];return[path['join'](_0x3bebc0,_0x3994a9(0x1c3),_0x3994a9(0x205))];case _0x3994a9(0x1ba):return[path[_0x3994a9(0x217)](_0x3bebc0,'.openclaw','storage'),path[_0x3994a9(0x217)](process[_0x3994a9(0x201)](),_0x3994a9(0x194),'context')];case _0x3994a9(0x1c4):return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x197),_0x3994a9(0x18f))];case _0x3994a9(0x20d):return[path['join'](_0x3bebc0,_0x3994a9(0x1ce),'cache')];default:return[];}}function getLatestSessionFile(_0x8f90ca){const _0x1e9c3c=a0_0x14bc19,_0x295874=getAgentStoragePaths(_0x8f90ca);let _0x237513=null,_0x35dead=0x0,_0x5cb83c=null,_0x4f1fdc=null;for(const _0x4e172a of _0x295874){if(fs['existsSync'](_0x4e172a)){if(!_0x4f1fdc)_0x4f1fdc=_0x4e172a;const _0x35ff24=(_0x1cf536,_0x2e2bcf=0x0)=>{const _0x269d42=a0_0x2798;if(_0x2e2bcf>0x3)return;try{const _0x41db31=fs['readdirSync'](_0x1cf536,{'withFileTypes':!![]});for(const _0x3b963f of _0x41db31){const _0xfd8639=path[_0x269d42(0x217)](_0x1cf536,_0x3b963f[_0x269d42(0x220)]);if(_0x3b963f[_0x269d42(0x1a4)]())_0x35ff24(_0xfd8639,_0x2e2bcf+0x1);else{if(_0x3b963f[_0x269d42(0x21f)]()&&!_0x3b963f[_0x269d42(0x220)][_0x269d42(0x1f6)]('.')){const _0x51093a=_0x3b963f[_0x269d42(0x220)]['toLowerCase']();if(_0x51093a[_0x269d42(0x215)]('.png')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1e8))||_0x51093a['endsWith'](_0x269d42(0x1c1))||_0x51093a['endsWith']('.gif')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1a0))||_0x51093a[_0x269d42(0x215)](_0x269d42(0x21b))||_0x51093a['endsWith']('.wal')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1cf))||_0x51093a[_0x269d42(0x215)]('.tmp')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1e2))||_0x51093a[_0x269d42(0x215)]('.dat')||_0x51093a['startsWith']('media__')||_0x51093a[_0x269d42(0x1f6)](_0x269d42(0x193)))continue;const _0x534232=fs[_0x269d42(0x1d4)](_0xfd8639);_0x534232['mtimeMs']>_0x35dead&&(_0x35dead=_0x534232[_0x269d42(0x19a)],_0x237513=_0x3b963f[_0x269d42(0x220)],_0x5cb83c=_0xfd8639,_0x4f1fdc=_0x4e172a);}}}}catch{}};_0x35ff24(_0x4e172a);}}return{'fileName':_0x237513,'lastModified':_0x35dead>0x0?new Date(_0x35dead)[_0x1e9c3c(0x19d)]():null,'fullPath':_0x5cb83c,'dirPath':_0x4f1fdc};}const debounceTimers=new Map(),lastLoggedTimes=new Map();function compressMessageContent(_0xc18c2c,_0x1d66a8,_0x2f0c1c){const _0xf4f2=a0_0x14bc19;let _0x4be605=![],_0x150784=0x0;if(!_0xc18c2c)return{'modified':_0x4be605,'savedTokens':_0x150784};const _0x24d82c=_0x2ae0b9=>_0x2ae0b9[_0xf4f2(0x190)](/\r\n/g,'\x0a')[_0xf4f2(0x190)](/\n{3,}/g,'\x0a\x0a');if(typeof _0xc18c2c[_0xf4f2(0x1d9)]===_0xf4f2(0x198)){let _0x12f513=_0xc18c2c['content'],_0x3303de=_0x24d82c(_0x12f513);_0x3303de[_0xf4f2(0x1f4)]<_0x12f513[_0xf4f2(0x1f4)]&&(_0xc18c2c['content']=_0x3303de,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x12f513[_0xf4f2(0x1f4)]-_0x3303de[_0xf4f2(0x1f4)])/0x4));if(_0xc18c2c['content'][_0xf4f2(0x1f4)]>0x12c&&!_0xc18c2c['content'][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x57d7c4=_0xf4f2(0x1b9)+Math[_0xf4f2(0x203)](_0xc18c2c[_0xf4f2(0x1d9)]['length']/0x4)+'\x20tokens).',_0x38a3dc=(0x0,cache_manager_1[_0xf4f2(0x1de)])(_0x1d66a8,_0x2f0c1c,_0xc18c2c['content'],_0x57d7c4);_0xc18c2c[_0xf4f2(0x1d9)]=_0xf4f2(0x20e)+_0x38a3dc[_0xf4f2(0x1b0)]+_0xf4f2(0x1f7)+_0x38a3dc[_0xf4f2(0x1c9)]+_0xf4f2(0x1a6)+_0x38a3dc[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x38a3dc[_0xf4f2(0x1b0)]-_0x38a3dc[_0xf4f2(0x20c)]);}}else{if(Array[_0xf4f2(0x212)](_0xc18c2c[_0xf4f2(0x1d9)]))for(const _0x5dec0b of _0xc18c2c[_0xf4f2(0x1d9)]){if(_0x5dec0b&&typeof _0x5dec0b===_0xf4f2(0x1b5)){if(typeof _0x5dec0b[_0xf4f2(0x1a1)]==='string'){let _0x5bd31e=_0x5dec0b['text'],_0x46fd28=_0x24d82c(_0x5bd31e);_0x46fd28[_0xf4f2(0x1f4)]<_0x5bd31e[_0xf4f2(0x1f4)]&&(_0x5dec0b[_0xf4f2(0x1a1)]=_0x46fd28,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x5bd31e[_0xf4f2(0x1f4)]-_0x46fd28['length'])/0x4));if(_0x5dec0b[_0xf4f2(0x1a1)][_0xf4f2(0x1f4)]>0x12c&&!_0x5dec0b[_0xf4f2(0x1a1)][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x822b89=_0xf4f2(0x1ab)+Math[_0xf4f2(0x203)](_0x5dec0b['text'][_0xf4f2(0x1f4)]/0x4)+_0xf4f2(0x1b1),_0x209e44=(0x0,cache_manager_1['saveChunk'])(_0x1d66a8,_0x2f0c1c,_0x5dec0b[_0xf4f2(0x1a1)],_0x822b89);_0x5dec0b[_0xf4f2(0x1a1)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x209e44[_0xf4f2(0x1c9)]+'`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20'+_0x209e44[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x209e44[_0xf4f2(0x1b0)]-_0x209e44[_0xf4f2(0x20c)]);}}else{if(typeof _0x5dec0b[_0xf4f2(0x1d9)]===_0xf4f2(0x198)){let _0x34f7b2=_0x5dec0b[_0xf4f2(0x1d9)],_0x1afd8a=_0x24d82c(_0x34f7b2);_0x1afd8a[_0xf4f2(0x1f4)]<_0x34f7b2[_0xf4f2(0x1f4)]&&(_0x5dec0b[_0xf4f2(0x1d9)]=_0x1afd8a,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x34f7b2[_0xf4f2(0x1f4)]-_0x1afd8a['length'])/0x4));if(_0x5dec0b[_0xf4f2(0x1d9)][_0xf4f2(0x1f4)]>0x12c&&!_0x5dec0b['content'][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x334d2c=_0xf4f2(0x1dc)+Math[_0xf4f2(0x203)](_0x5dec0b['content'][_0xf4f2(0x1f4)]/0x4)+'\x20tokens).',_0x93bde2=(0x0,cache_manager_1[_0xf4f2(0x1de)])(_0x1d66a8,_0x2f0c1c,_0x5dec0b[_0xf4f2(0x1d9)],_0x334d2c);_0x5dec0b[_0xf4f2(0x1d9)]=_0xf4f2(0x195)+_0x93bde2[_0xf4f2(0x1c9)]+_0xf4f2(0x1ff)+_0x93bde2[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x93bde2[_0xf4f2(0x1b0)]-_0x93bde2[_0xf4f2(0x20c)]);}}}}}}return{'modified':_0x4be605,'savedTokens':_0x150784};}const sessionsStatePath=path['join'](baseDir,a0_0x14bc19(0x1b3));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x2485fc=a0_0x14bc19;try{if(fs[_0x2485fc(0x221)](sessionsStatePath)){const _0x4b077f=JSON['parse'](fs[_0x2485fc(0x1da)](sessionsStatePath,_0x2485fc(0x1a3)));if(_0x4b077f&&typeof _0x4b077f===_0x2485fc(0x1b5))return sessionsStateMemoryCache=_0x4b077f,_0x4b077f;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x567c40,_0x2bb427,_0x14af53,_0x7b9f12=0x0,_0x3e3a92=0x0){const _0x5b9e32=a0_0x14bc19;try{const _0x27a161=loadSessionsState();_0x27a161[_0x567c40]={'lineCount':_0x2bb427,'activeSavedTokens':_0x14af53,'sideCacheSaved':_0x7b9f12,'officialCompactSaved':_0x3e3a92},sessionsStateMemoryCache=_0x27a161;if(!fs[_0x5b9e32(0x221)](baseDir))fs[_0x5b9e32(0x1b6)](baseDir,{'recursive':!![]});const _0x4ad677=sessionsStatePath+_0x5b9e32(0x1c5);fs[_0x5b9e32(0x20b)](_0x4ad677,JSON['stringify'](_0x27a161,null,0x2),_0x5b9e32(0x1a3)),fs['renameSync'](_0x4ad677,sessionsStatePath);}catch{}}function processSessionFile(_0x5547e9,_0x5baf3c){const _0x468f75=a0_0x14bc19;try{if(!fs[_0x468f75(0x221)](_0x5547e9))return;const _0x2bfbce=fs['statSync'](_0x5547e9);if(_0x2bfbce['isDirectory']()||_0x2bfbce['size']===0x0)return;const _0x4c005b=loadConfig(),_0x184afb='conv_'+_0x5baf3c;if(_0x4c005b[_0x468f75(0x191)][_0x184afb]===![])return;const _0x3e85c3=fs['readFileSync'](_0x5547e9,_0x468f75(0x1a3));let _0x19c7b4=![],_0x229be8=_0x3e85c3,_0x148ba5=0x0;const _0x1a4990=path[_0x468f75(0x204)](_0x5547e9)['toLowerCase'](),_0x31178e=path['basename'](_0x5547e9,_0x1a4990);let _0x2299d2=0x1;if(_0x5baf3c!==_0x468f75(0x1e0)){if(_0x1a4990===_0x468f75(0x192))try{const _0x35f515=JSON['parse'](_0x3e85c3),_0x401f5d=Array[_0x468f75(0x212)](_0x35f515[_0x468f75(0x1ea)])?_0x35f515[_0x468f75(0x1ea)]:Array[_0x468f75(0x212)](_0x35f515)?_0x35f515:null;if(_0x401f5d){_0x2299d2=_0x401f5d[_0x468f75(0x1f4)];for(let _0x2f85a8=0x0;_0x2f85a8<_0x401f5d[_0x468f75(0x1f4)];_0x2f85a8++){const _0x36e8e=compressMessageContent(_0x401f5d[_0x2f85a8],_0x31178e,_0x5baf3c);_0x36e8e[_0x468f75(0x1d7)]&&(_0x19c7b4=!![],_0x148ba5+=_0x36e8e['savedTokens']);}_0x19c7b4&&(_0x229be8=JSON[_0x468f75(0x1fa)](_0x35f515,null,0x2));}}catch{}else{if(_0x1a4990===_0x468f75(0x1b7)||_0x1a4990==='.json1')try{const _0x19877a=_0x3e85c3[_0x468f75(0x1fe)]('\x0a');_0x2299d2=_0x19877a[_0x468f75(0x1f4)];const _0x17c2aa=[];for(let _0x4632c5 of _0x19877a){if(!_0x4632c5[_0x468f75(0x213)]()){_0x17c2aa[_0x468f75(0x196)](_0x4632c5);continue;}try{const _0x5bb480=JSON[_0x468f75(0x1d3)](_0x4632c5),_0x59fce5=_0x5bb480[_0x468f75(0x1bc)]||_0x5bb480;if(_0x59fce5){const _0x211b3e=compressMessageContent(_0x59fce5,_0x31178e,_0x5baf3c);_0x211b3e[_0x468f75(0x1d7)]&&(_0x19c7b4=!![],_0x148ba5+=_0x211b3e[_0x468f75(0x1d5)],_0x4632c5=JSON[_0x468f75(0x1fa)](_0x5bb480));}}catch{}_0x17c2aa[_0x468f75(0x196)](_0x4632c5);}_0x19c7b4&&(_0x229be8=_0x17c2aa[_0x468f75(0x217)]('\x0a'));}catch{}}}else(_0x1a4990===_0x468f75(0x1b7)||_0x1a4990===_0x468f75(0x18c))&&(_0x2299d2=_0x3e85c3['split']('\x0a')[_0x468f75(0x1a9)](Boolean)[_0x468f75(0x1f4)]);let _0x5843d3=0x0;const _0x3c9b9a=_0x3e85c3[_0x468f75(0x1f0)](/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi);for(const _0x5a0cd7 of _0x3c9b9a){let _0x1012a3=parseFloat(_0x5a0cd7[0x1]);_0x5a0cd7[0x0][_0x468f75(0x19c)]()[_0x468f75(0x1b2)]('k')&&(_0x1012a3=_0x1012a3*0x3e8),_0x5843d3+=Math[_0x468f75(0x21e)](_0x1012a3);}const _0x3a2400=loadSessionsState(),_0x53c7a4=_0x3a2400[_0x5547e9],_0x2736af=_0x53c7a4&&_0x53c7a4['sideCacheSaved']!==undefined?_0x53c7a4[_0x468f75(0x1f3)]:0x0,_0x29e9ac=_0x53c7a4&&_0x53c7a4[_0x468f75(0x1d1)]!==undefined?_0x53c7a4[_0x468f75(0x1d1)]:_0x53c7a4?_0x53c7a4['activeSavedTokens']:0x0,_0x4f0751=_0x53c7a4?_0x53c7a4[_0x468f75(0x19b)]:0x0,_0x456676=_0x2299d2>_0x4f0751;let _0x21d489=_0x2736af,_0x14e6d3=Math[_0x468f75(0x1e5)](_0x29e9ac,_0x5843d3);if(_0x19c7b4){fs[_0x468f75(0x20b)](_0x5547e9,_0x229be8,_0x468f75(0x1a3)),_0x21d489+=_0x148ba5;const _0x5cc743=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x5cc743,_0x21d489,_0x14e6d3);const _0x51ca40='x'[_0x468f75(0x1be)](_0x5cc743*0x4);tracker_1[_0x468f75(0x207)][_0x468f75(0x200)](_0x468f75(0x1a7)+_0x5baf3c,_0x51ca40,'',0x0,undefined,['conv_'+_0x5baf3c,_0x468f75(0x1b8),_0x5baf3c,_0x468f75(0x1d0)]);}else{if(_0x5843d3>_0x29e9ac){_0x14e6d3=_0x5843d3;const _0x1234e3=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x1234e3,_0x21d489,_0x14e6d3);const _0x20b33d='x'[_0x468f75(0x1be)](_0x1234e3*0x4);tracker_1[_0x468f75(0x207)][_0x468f75(0x200)](_0x468f75(0x1a7)+_0x5baf3c,_0x20b33d,'',0x0,undefined,[_0x468f75(0x1ca)+_0x5baf3c,'live-conv',_0x5baf3c,_0x468f75(0x1a8)]);}else{if(_0x456676){const _0x34b4d7=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x34b4d7,_0x21d489,_0x14e6d3);if(_0x34b4d7>0x0){const _0x52f569='x'[_0x468f75(0x1be)](_0x34b4d7*0x4);tracker_1['tracker']['logExecution'](_0x468f75(0x1a7)+_0x5baf3c,_0x52f569,'',0x0,undefined,[_0x468f75(0x1ca)+_0x5baf3c,_0x468f75(0x1b8),_0x5baf3c,_0x468f75(0x1b4)]);}}else{const _0x21a8f4=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x21a8f4,_0x21d489,_0x14e6d3);}}}}catch{}}function installWindowsStartupService(){const _0x546a29=a0_0x14bc19;if(process[_0x546a29(0x1cc)]!==_0x546a29(0x1c8))return;try{const _0x17f587=path[_0x546a29(0x217)](os[_0x546a29(0x1e3)](),_0x546a29(0x1c6),_0x546a29(0x1bd),'Microsoft',_0x546a29(0x1fc),_0x546a29(0x21c),_0x546a29(0x1f1),_0x546a29(0x1bb));if(!fs[_0x546a29(0x221)](_0x17f587))fs['mkdirSync'](_0x17f587,{'recursive':!![]});const _0x2af766=path['join'](_0x17f587,'TrimPromptDaemon.vbs'),_0x13d76e=path[_0x546a29(0x217)](__dirname,_0x546a29(0x1bf)),_0x568129=_0x13d76e['replace'](/\\/g,'\x5c\x5c'),_0x4cd165=_0x546a29(0x1ee)+_0x568129+_0x546a29(0x1af);fs['writeFileSync'](_0x2af766,_0x4cd165,'utf8');}catch{}}function startWatcherDaemon(){const _0xfb7f71=a0_0x14bc19;installWindowsStartupService();try{const {installClaudeHooks:_0x1024cf}=require(_0xfb7f71(0x1aa));_0x1024cf();}catch(_0x3ee9e8){}const _0x47b907=[_0xfb7f71(0x1e0),'gemini',_0xfb7f71(0x1eb),_0xfb7f71(0x18e),_0xfb7f71(0x211),_0xfb7f71(0x206),_0xfb7f71(0x1ba),_0xfb7f71(0x1c4),_0xfb7f71(0x20d)];for(const _0x5024d1 of _0x47b907){const _0x3dd82c=getAgentStoragePaths(_0x5024d1);for(const _0xd750e3 of _0x3dd82c){if(fs[_0xfb7f71(0x221)](_0xd750e3))try{fs[_0xfb7f71(0x1e9)](_0xd750e3,{'recursive':!![]},(_0x19182c,_0x2d661a)=>{const _0x32d428=_0xfb7f71;if(!_0x2d661a)return;const _0x30e1bc=path['join'](_0xd750e3,_0x2d661a);if(debounceTimers[_0x32d428(0x210)](_0x30e1bc))clearTimeout(debounceTimers['get'](_0x30e1bc));const _0x1c12ea=setTimeout(()=>processSessionFile(_0x30e1bc,_0x5024d1),0x1f4);debounceTimers['set'](_0x30e1bc,_0x1c12ea);});}catch{}}}setInterval(()=>{const _0x5d316d=_0xfb7f71;for(const _0x59356d of _0x47b907){try{const _0x5b026d=getLatestSessionFile(_0x59356d);_0x5b026d&&_0x5b026d['fullPath']&&processSessionFile(_0x5b026d[_0x5d316d(0x1fd)],_0x59356d);}catch{}}},0xbb8);}function a0_0x1719(){const _0x5dcac5=['toISOString','configurable','1259905diKUqJ','.webp','text','3726906KLqzVk','utf8','isDirectory','./tracker','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','conv:','official_compact','filter','./hooks/claude-hook','Summary:\x20Text\x20block\x20offloaded\x20(','304844ccSeAn','14iMPqeD','__importStar','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','raw_tokens','\x20tokens).','includes','sessions_state.json','active_turn','object','mkdirSync','.jsonl','live-conv','Summary:\x20Content\x20offloaded\x20(','openclaw','Startup','message','Roaming','repeat','cli.js','getOwnPropertyDescriptor','.jpeg','defineProperty','.config','opencode','.tmp','AppData','325147TfiZvC','win32','chunk_id','conv_','gemini','platform','2211056FjhXzH','.cortex','.shm','trim_offload','officialCompactSaved','3DkAEiA','parse','statSync','savedTokens','TrimPrompt\x20Cache\x20Engine','modified','saveConfig','content','readFileSync','__esModule','Summary:\x20Tool\x20result\x20offloaded\x20(','Cursor','saveChunk','Local','claude','custom_storage_paths','.lock','homedir','getAgentStoragePaths','max','default','.codex','.jpg','watch','messages','codex','getOwnPropertyNames','.gemini','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','history','matchAll','Programs','.claude','sideCacheSaved','length','startWatcherDaemon','startsWith','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','create','__createBinding','stringify','User','Windows','fullPath','split','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','logExecution','cwd','projects','ceil','extname','github-copilot-cli','copilot','tracker','loadConfig','get','1076913MDSofU','writeFileSync','compressed_tokens','cortex','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','getLatestSessionFile','has','aider','isArray','trim','path','endsWith','antigravity','join','__setModuleDefault','hasOwnProperty','.trimprompt','.pb','Start\x20Menu','workspaceStorage','round','isFile','name','existsSync','writable','./cache-manager','call','1084654THNobv','.json1','Gemini','cursor','sessions','replace','conversation_toggles','.json','image_','.openclaw','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','push','.opencode','string','10MbOTgZ','mtimeMs','lineCount','toLowerCase'];a0_0x1719=function(){return _0x5dcac5;};return a0_0x1719();}
|
|
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);}
|