trimprompt 1.0.43 → 1.0.44
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 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/postinstall.js +25 -1
- package/proxy-conv.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/cache-manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x5a4648=a0_0x1bbc;(function(_0x3d6f42,_0x11e5cc){const _0x57878f=a0_0x1bbc,_0x1d88a5=_0x3d6f42();while(!![]){try{const _0xe1181c=-parseInt(_0x57878f(0x13d))/0x1+-parseInt(_0x57878f(0x145))/0x2*(-parseInt(_0x57878f(0x16b))/0x3)+parseInt(_0x57878f(0x15c))/0x4*(-parseInt(_0x57878f(0x179))/0x5)+-parseInt(_0x57878f(0x162))/0x6*(parseInt(_0x57878f(0x13e))/0x7)+-parseInt(_0x57878f(0x16e))/0x8*(parseInt(_0x57878f(0x168))/0x9)+-parseInt(_0x57878f(0x148))/0xa+-parseInt(_0x57878f(0x147))/0xb*(-parseInt(_0x57878f(0x150))/0xc);if(_0xe1181c===_0x11e5cc)break;else _0x1d88a5['push'](_0x1d88a5['shift']());}catch(_0x4dfdc1){_0x1d88a5['push'](_0x1d88a5['shift']());}}}(a0_0x3f3a,0x889a8));var __createBinding=this&&this[a0_0x5a4648(0x151)]||(Object[a0_0x5a4648(0x167)]?function(_0x5122b1,_0x2c9eb9,_0x4da103,_0x35abd4){const _0x214f90=a0_0x5a4648;if(_0x35abd4===undefined)_0x35abd4=_0x4da103;var _0x4ccf3c=Object['getOwnPropertyDescriptor'](_0x2c9eb9,_0x4da103);(!_0x4ccf3c||(_0x214f90(0x142)in _0x4ccf3c?!_0x2c9eb9[_0x214f90(0x16f)]:_0x4ccf3c[_0x214f90(0x155)]||_0x4ccf3c[_0x214f90(0x158)]))&&(_0x4ccf3c={'enumerable':!![],'get':function(){return _0x2c9eb9[_0x4da103];}}),Object[_0x214f90(0x154)](_0x5122b1,_0x35abd4,_0x4ccf3c);}:function(_0x367b2a,_0x2b0b8b,_0x2449a2,_0x4782b4){if(_0x4782b4===undefined)_0x4782b4=_0x2449a2;_0x367b2a[_0x4782b4]=_0x2b0b8b[_0x2449a2];}),__setModuleDefault=this&&this[a0_0x5a4648(0x160)]||(Object[a0_0x5a4648(0x167)]?function(_0x1343b5,_0x1f1742){const _0x30e97f=a0_0x5a4648;Object['defineProperty'](_0x1343b5,_0x30e97f(0x177),{'enumerable':!![],'value':_0x1f1742});}:function(_0x58cea1,_0x2f27b7){const _0x136c97=a0_0x5a4648;_0x58cea1[_0x136c97(0x177)]=_0x2f27b7;}),__importStar=this&&this[a0_0x5a4648(0x141)]||(function(){var _0x2986c1=function(_0x420973){const _0x360686=a0_0x1bbc;return _0x2986c1=Object[_0x360686(0x161)]||function(_0x3791c9){const _0x48b21e=_0x360686;var _0x3f0ba1=[];for(var _0xab1e69 in _0x3791c9)if(Object[_0x48b21e(0x15e)][_0x48b21e(0x13f)]['call'](_0x3791c9,_0xab1e69))_0x3f0ba1[_0x3f0ba1[_0x48b21e(0x152)]]=_0xab1e69;return _0x3f0ba1;},_0x2986c1(_0x420973);};return function(_0x45b332){const _0x5993dd=a0_0x1bbc;if(_0x45b332&&_0x45b332[_0x5993dd(0x16f)])return _0x45b332;var _0x2772cf={};if(_0x45b332!=null){for(var _0x195d5f=_0x2986c1(_0x45b332),_0x2d4fa4=0x0;_0x2d4fa4<_0x195d5f[_0x5993dd(0x152)];_0x2d4fa4++)if(_0x195d5f[_0x2d4fa4]!=='default')__createBinding(_0x2772cf,_0x45b332,_0x195d5f[_0x2d4fa4]);}return __setModuleDefault(_0x2772cf,_0x45b332),_0x2772cf;};}());Object['defineProperty'](exports,a0_0x5a4648(0x16f),{'value':!![]}),exports[a0_0x5a4648(0x15f)]=saveChunk,exports['retrieveChunk']=retrieveChunk,exports[a0_0x5a4648(0x176)]=enforceEvictionPolicy;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5a4648(0x175))),os=__importStar(require('os')),crypto=__importStar(require(a0_0x5a4648(0x172))),baseDir=path[a0_0x5a4648(0x166)](os['homedir'](),a0_0x5a4648(0x140)),cacheDir=path[a0_0x5a4648(0x166)](baseDir,a0_0x5a4648(0x178)),MAX_CACHE_BYTES=0x1f4*0x400*0x400,TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function ensureCacheDir(){const _0x38e8ea=a0_0x5a4648;!fs[_0x38e8ea(0x14f)](cacheDir)&&fs[_0x38e8ea(0x15b)](cacheDir,{'recursive':!![]});}function a0_0x3f3a(){const _0x15071e=['parse','crypto','readFileSync','writeFileSync','path','enforceEvictionPolicy','default','cache','5390hddoKX','152715NedEYD','7ILOtxi','hasOwnProperty','.trimprompt','__importStar','get','size','digest','10ooLwwM','hex','4988698YqZpkw','7405570xMGKWj','getTime','update','last_accessed_at','birthtime','createHash','isDirectory','existsSync','60ByaSgw','__createBinding','length','readdirSync','defineProperty','writable','.json','mtime','configurable','created_at','toISOString','mkdirSync','80ODCchD','substring','prototype','saveChunk','__setModuleDefault','getOwnPropertyNames','5629620vGjSZR','utf8','now','statSync','join','create','801iaPLhP','lastAccessed','unlinkSync','557211JpNYfS','stringify','push','70440NyWBhk','__esModule','endsWith'];a0_0x3f3a=function(){return _0x15071e;};return a0_0x3f3a();}function saveChunk(_0x1001dc,_0x137bde,_0x137f29,_0x28f4d2){const _0x17df3d=a0_0x5a4648;ensureCacheDir();const _0x6260a3=crypto[_0x17df3d(0x14d)]('sha256')[_0x17df3d(0x14a)](_0x137f29)[_0x17df3d(0x144)](_0x17df3d(0x146))[_0x17df3d(0x15d)](0x0,0x8),_0x445e2f='tp_chk_'+_0x6260a3,_0x5eb184=path[_0x17df3d(0x166)](cacheDir,_0x1001dc);!fs['existsSync'](_0x5eb184)&&fs[_0x17df3d(0x15b)](_0x5eb184,{'recursive':!![]});const _0x4898e5=path[_0x17df3d(0x166)](_0x5eb184,_0x445e2f+_0x17df3d(0x156)),_0x4cf641=new Date()[_0x17df3d(0x15a)](),_0x194993=Math['ceil'](_0x137f29[_0x17df3d(0x152)]/0x4),_0x232af7=Math['ceil'](_0x28f4d2['length']/0x4),_0x24b194={'chunk_id':_0x445e2f,'session_id':_0x1001dc,'agent_key':_0x137bde,'raw_tokens':_0x194993,'compressed_tokens':_0x232af7,'created_at':_0x4cf641,'last_accessed_at':_0x4cf641,'summary':_0x28f4d2,'raw_payload':_0x137f29};return fs[_0x17df3d(0x174)](_0x4898e5,JSON[_0x17df3d(0x16c)](_0x24b194,null,0x2),'utf8'),enforceEvictionPolicy(),_0x24b194;}function a0_0x1bbc(_0x27266e,_0x392991){_0x27266e=_0x27266e-0x13d;const _0x3f3ac0=a0_0x3f3a();let _0x1bbc96=_0x3f3ac0[_0x27266e];return _0x1bbc96;}function retrieveChunk(_0x4af2c8){const _0x2e11cb=a0_0x5a4648;ensureCacheDir();try{const _0xf6de33=fs[_0x2e11cb(0x153)](cacheDir);for(const _0x2a0917 of _0xf6de33){const _0x3b7b49=path[_0x2e11cb(0x166)](cacheDir,_0x2a0917);if(fs['statSync'](_0x3b7b49)['isDirectory']()){const _0x1f02a1=path[_0x2e11cb(0x166)](_0x3b7b49,_0x4af2c8+'.json');if(fs[_0x2e11cb(0x14f)](_0x1f02a1)){const _0x336bfc=fs['readFileSync'](_0x1f02a1,_0x2e11cb(0x163)),_0x1e5f8c=JSON[_0x2e11cb(0x171)](_0x336bfc);return _0x1e5f8c[_0x2e11cb(0x14b)]=new Date()[_0x2e11cb(0x15a)](),fs[_0x2e11cb(0x174)](_0x1f02a1,JSON[_0x2e11cb(0x16c)](_0x1e5f8c,null,0x2),'utf8'),_0x1e5f8c;}}}}catch{}return null;}function enforceEvictionPolicy(){const _0x7bfc58=a0_0x5a4648;ensureCacheDir();try{const _0x183c82=Date[_0x7bfc58(0x164)]();let _0x17e49e=0x0;const _0x284d2c=[],_0x72d555=fs[_0x7bfc58(0x153)](cacheDir);for(const _0xf5881b of _0x72d555){const _0x4579e2=path[_0x7bfc58(0x166)](cacheDir,_0xf5881b);if(fs[_0x7bfc58(0x165)](_0x4579e2)[_0x7bfc58(0x14e)]()){const _0x455114=fs['readdirSync'](_0x4579e2);for(const _0x320cd1 of _0x455114){if(_0x320cd1[_0x7bfc58(0x170)](_0x7bfc58(0x156))){const _0x4ce186=path[_0x7bfc58(0x166)](_0x4579e2,_0x320cd1),_0x81bfc0=fs[_0x7bfc58(0x165)](_0x4ce186);try{const _0xcaef38=JSON[_0x7bfc58(0x171)](fs[_0x7bfc58(0x173)](_0x4ce186,_0x7bfc58(0x163))),_0xc6eb50=new Date(_0xcaef38[_0x7bfc58(0x159)]||_0x81bfc0[_0x7bfc58(0x14c)])[_0x7bfc58(0x149)](),_0x28c56a=new Date(_0xcaef38['last_accessed_at']||_0x81bfc0[_0x7bfc58(0x157)])[_0x7bfc58(0x149)]();if(_0x183c82-_0xc6eb50>TTL_MS){fs['unlinkSync'](_0x4ce186);continue;}_0x17e49e+=_0x81bfc0[_0x7bfc58(0x143)],_0x284d2c[_0x7bfc58(0x16d)]({'path':_0x4ce186,'size':_0x81bfc0[_0x7bfc58(0x143)],'lastAccessed':_0x28c56a,'createdAt':_0xc6eb50});}catch{fs[_0x7bfc58(0x16a)](_0x4ce186);}}}}}if(_0x17e49e>MAX_CACHE_BYTES){_0x284d2c['sort']((_0x59fc9a,_0x5a9cc7)=>_0x59fc9a[_0x7bfc58(0x169)]-_0x5a9cc7[_0x7bfc58(0x169)]);for(const _0x15678c of _0x284d2c){if(_0x17e49e<=MAX_CACHE_BYTES*0.8)break;try{fs[_0x7bfc58(0x16a)](_0x15678c['path']),_0x17e49e-=_0x15678c[_0x7bfc58(0x143)];}catch{}}}}catch{}}
|
package/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x3070fe=a0_0x4866;(function(_0xdeb4a4,_0x3b33c5){const _0x9759d2=a0_0x4866,_0xfe9d07=_0xdeb4a4();while(!![]){try{const _0x245ab2=-parseInt(_0x9759d2(0xd3))/0x1*(parseInt(_0x9759d2(0xcd))/0x2)+-parseInt(_0x9759d2(0xc0))/0x3+-parseInt(_0x9759d2(0xbd))/0x4*(-parseInt(_0x9759d2(0xa1))/0x5)+parseInt(_0x9759d2(0xa2))/0x6+parseInt(_0x9759d2(0xb3))/0x7+parseInt(_0x9759d2(0xa7))/0x8+-parseInt(_0x9759d2(0xd2))/0x9;if(_0x245ab2===_0x3b33c5)break;else _0xfe9d07['push'](_0xfe9d07['shift']());}catch(_0x44bae9){_0xfe9d07['push'](_0xfe9d07['shift']());}}}(a0_0xa845,0xbbc42));var __createBinding=this&&this[a0_0x3070fe(0xab)]||(Object[a0_0x3070fe(0xa0)]?function(_0x4bf297,_0x4dad18,_0x46ba2c,_0x1de444){const _0x2a3810=a0_0x3070fe;if(_0x1de444===undefined)_0x1de444=_0x46ba2c;var _0x485a5e=Object['getOwnPropertyDescriptor'](_0x4dad18,_0x46ba2c);(!_0x485a5e||(_0x2a3810(0xbb)in _0x485a5e?!_0x4dad18[_0x2a3810(0x9d)]:_0x485a5e[_0x2a3810(0xc9)]||_0x485a5e[_0x2a3810(0xb2)]))&&(_0x485a5e={'enumerable':!![],'get':function(){return _0x4dad18[_0x46ba2c];}}),Object['defineProperty'](_0x4bf297,_0x1de444,_0x485a5e);}:function(_0x4ef7c6,_0x426866,_0x3a9a6b,_0x344d4d){if(_0x344d4d===undefined)_0x344d4d=_0x3a9a6b;_0x4ef7c6[_0x344d4d]=_0x426866[_0x3a9a6b];}),__setModuleDefault=this&&this[a0_0x3070fe(0xc2)]||(Object['create']?function(_0x4c8bd7,_0x2da313){const _0x570033=a0_0x3070fe;Object[_0x570033(0x98)](_0x4c8bd7,_0x570033(0xb9),{'enumerable':!![],'value':_0x2da313});}:function(_0xe41172,_0x2fa789){const _0x379c13=a0_0x3070fe;_0xe41172[_0x379c13(0xb9)]=_0x2fa789;}),__importStar=this&&this[a0_0x3070fe(0xd1)]||(function(){var _0x429068=function(_0x49c4f2){return _0x429068=Object['getOwnPropertyNames']||function(_0x21d015){const _0x344763=a0_0x4866;var _0x1492a3=[];for(var _0x5da38f in _0x21d015)if(Object[_0x344763(0x91)]['hasOwnProperty']['call'](_0x21d015,_0x5da38f))_0x1492a3[_0x1492a3[_0x344763(0xb6)]]=_0x5da38f;return _0x1492a3;},_0x429068(_0x49c4f2);};return function(_0x3b1b33){const _0x1807db=a0_0x4866;if(_0x3b1b33&&_0x3b1b33['__esModule'])return _0x3b1b33;var _0x4ba43b={};if(_0x3b1b33!=null){for(var _0x2a3573=_0x429068(_0x3b1b33),_0x4fec40=0x0;_0x4fec40<_0x2a3573[_0x1807db(0xb6)];_0x4fec40++)if(_0x2a3573[_0x4fec40]!==_0x1807db(0xb9))__createBinding(_0x4ba43b,_0x3b1b33,_0x2a3573[_0x4fec40]);}return __setModuleDefault(_0x4ba43b,_0x3b1b33),_0x4ba43b;};}());Object[a0_0x3070fe(0x98)](exports,a0_0x3070fe(0x9d),{'value':!![]}),exports[a0_0x3070fe(0xb1)]=dedup;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3070fe(0xad))),os=__importStar(require('os')),crypto=__importStar(require('crypto')),CACHE_DIR=path[a0_0x3070fe(0x92)](os['homedir'](),a0_0x3070fe(0x90)),CACHE_FILE=path[a0_0x3070fe(0x92)](CACHE_DIR,a0_0x3070fe(0x95)),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(_0x1cc3a0){const _0x2b871f=a0_0x3070fe,_0x194b22=_0x1cc3a0[_0x2b871f(0xcb)]()[_0x2b871f(0x99)]();if(_0x194b22[_0x2b871f(0x9f)](/^(cat|head|tail|read|bat)\s/))return _0x2b871f(0xa6);if(_0x194b22['includes']('git\x20status')||_0x194b22['includes'](_0x2b871f(0xac)))return _0x2b871f(0xb5);if(_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0xcf))||_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0x9a)))return _0x2b871f(0xba);if(_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0x9c))||_0x194b22['includes']('yadm\x20show'))return'git-show';if(_0x194b22[_0x2b871f(0x9f)](/^(ls|dir)(\s|$)/)||_0x194b22['includes'](_0x2b871f(0xaf))||_0x194b22[_0x2b871f(0xca)](_0x2b871f(0x8e)))return'ls';if(_0x194b22[_0x2b871f(0x9f)](/^tree(\s|$)/)||_0x194b22['includes'](_0x2b871f(0xb7))||_0x194b22[_0x2b871f(0xca)](_0x2b871f(0xd0)))return _0x2b871f(0xc5);if(_0x194b22[_0x2b871f(0x9f)](/docker\s+ps/))return'docker-ps';if(_0x194b22[_0x2b871f(0x9f)](/docker\s+images/))return'docker-images';if(_0x194b22[_0x2b871f(0xc1)]('kubectl\x20get')||_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0x8f)))return _0x2b871f(0xa3);if(_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0xbc))||_0x194b22[_0x2b871f(0xc1)]('ruff\x20'))return'ruff';if(_0x194b22[_0x2b871f(0xc1)](_0x2b871f(0xa5)))return _0x2b871f(0xc7);return'';}function a0_0x4866(_0x4f0dc9,_0x46bbd2){_0x4f0dc9=_0x4f0dc9-0x8e;const _0xa84536=a0_0xa845();let _0x486670=_0xa84536[_0x4f0dc9];return _0x486670;}function md5(_0x4747c4){const _0x422955=a0_0x3070fe;return crypto[_0x422955(0xd4)](_0x422955(0xb4))[_0x422955(0x96)](_0x4747c4)[_0x422955(0xa8)]('hex');}function loadStore(){const _0x2ca9bc=a0_0x3070fe;try{if(fs['existsSync'](CACHE_FILE))return JSON[_0x2ca9bc(0xa4)](fs[_0x2ca9bc(0xd5)](CACHE_FILE,'utf8'));}catch{}return{};}function saveStore(_0x5b71cc){const _0x37eef3=a0_0x3070fe;try{if(!fs[_0x37eef3(0xd6)](CACHE_DIR))fs[_0x37eef3(0x9e)](CACHE_DIR,{'recursive':!![]});const _0x599258=Object['keys'](_0x5b71cc);if(_0x599258[_0x37eef3(0xb6)]>MAX_ENTRIES){const _0x7f6e53=_0x599258[_0x37eef3(0xa9)]((_0x44d877,_0xc6dda7)=>_0x5b71cc[_0x44d877]['timestamp']-_0x5b71cc[_0xc6dda7][_0x37eef3(0xbf)]);for(const _0x56a198 of _0x7f6e53[_0x37eef3(0xc6)](0x0,_0x599258[_0x37eef3(0xb6)]-MAX_ENTRIES)){delete _0x5b71cc[_0x56a198];}}fs[_0x37eef3(0xd7)](CACHE_FILE,JSON['stringify'](_0x5b71cc),_0x37eef3(0xcc));}catch{}}function buildSummary(_0x4289da,_0x56cd83){const _0x80c41c=a0_0x3070fe,_0x29fbe6=_0x4289da[_0x80c41c(0x93)]('\x0a')[_0x80c41c(0xb6)],_0x3f1a21=_0x4289da[_0x80c41c(0xb6)];if(_0x56cd83===_0x80c41c(0xa6))return _0x29fbe6+_0x80c41c(0xb8)+_0x3f1a21+'\x20chars';if(_0x56cd83===_0x80c41c(0xb5))return _0x29fbe6+_0x80c41c(0xc4);if(_0x56cd83===_0x80c41c(0xba))return _0x29fbe6+_0x80c41c(0x9b);if(_0x56cd83[_0x80c41c(0x94)]('docker'))return _0x29fbe6+_0x80c41c(0xc4);return _0x29fbe6+_0x80c41c(0xb8)+_0x3f1a21+_0x80c41c(0xce);}function dedup(_0x3bdeb3,_0x64c56d){const _0x381b0a=a0_0x3070fe;try{const _0x678656=classifyCommand(_0x3bdeb3);if(!_0x678656)return null;const _0x5eec6a=TTL_SECONDS[_0x678656];if(!_0x5eec6a)return null;const _0x11e363=process[_0x381b0a(0x97)](),_0x24cdaa=md5(_0x11e363+'::'+_0x3bdeb3['trim']()),_0x41d2a9=md5(_0x64c56d),_0x41e28e=Date[_0x381b0a(0xbe)](),_0x169660=loadStore(),_0x10224f=_0x169660[_0x24cdaa];if(_0x10224f&&_0x10224f[_0x381b0a(0xc3)]===_0x41d2a9&&_0x41e28e-_0x10224f[_0x381b0a(0xbf)]<_0x5eec6a*0x3e8){const _0x776eaf=Math[_0x381b0a(0xc8)]((_0x41e28e-_0x10224f[_0x381b0a(0xbf)])/0x3e8);return _0x381b0a(0xaa)+_0x776eaf+_0x381b0a(0xae)+_0x10224f[_0x381b0a(0xb0)]+']';}_0x169660[_0x24cdaa]={'hash':_0x41d2a9,'summary':buildSummary(_0x64c56d,_0x678656),'timestamp':_0x41e28e,'chars':_0x64c56d[_0x381b0a(0xb6)]},saveStore(_0x169660);}catch{}return null;}function a0_0xa845(){const _0x39c535=['4011376huoeWD','digest','sort','[cached\x20—\x20unchanged\x20since\x20','__createBinding','yadm\x20status','path','s\x20ago,\x20','\x20ls\x20','summary','dedup','configurable','3518480sIBtjn','md5','git-status','length','\x20tree\x20','\x20lines,\x20','default','git-log','get','ruff\x20check','20KUMKZp','now','timestamp','206091rBNfvb','includes','__setModuleDefault','hash','\x20lines','tree','slice','go-vet','round','writable','endsWith','trim','utf8','64igvpjt','\x20chars','git\x20log','\x20tree','__importStar','13274703dKBOJq','26074ybfKkY','createHash','readFileSync','existsSync','writeFileSync','\x20ls','kubectl\x20describe','.trimprompt','prototype','join','split','startsWith','cache.json','update','cwd','defineProperty','toLowerCase','yadm\x20log','\x20entries','git\x20show','__esModule','mkdirSync','match','create','875440PRDMbF','7605720ypTAmK','kubectl','parse','go\x20vet','file'];a0_0xa845=function(){return _0x39c535;};return a0_0xa845();}
|
package/ccr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2e31a3=a0_0x16f2;(function(_0xa81249,_0x2e6707){const _0x57e8c3=a0_0x16f2,_0x532d47=_0xa81249();while(!![]){try{const _0x31b389=-parseInt(_0x57e8c3(0x13b))/0x1+-parseInt(_0x57e8c3(0x14f))/0x2+parseInt(_0x57e8c3(0x149))/0x3*(parseInt(_0x57e8c3(0x162))/0x4)+parseInt(_0x57e8c3(0x150))/0x5*(-parseInt(_0x57e8c3(0x14a))/0x6)+parseInt(_0x57e8c3(0x141))/0x7+parseInt(_0x57e8c3(0x134))/0x8+parseInt(_0x57e8c3(0x143))/0x9;if(_0x31b389===_0x2e6707)break;else _0x532d47['push'](_0x532d47['shift']());}catch(_0x3a2040){_0x532d47['push'](_0x532d47['shift']());}}}(a0_0x3b87,0x93d6e));var __createBinding=this&&this[a0_0x2e31a3(0x14e)]||(Object['create']?function(_0x48df5c,_0x40893d,_0x2f5b85,_0xfbb945){const _0x19abb7=a0_0x2e31a3;if(_0xfbb945===undefined)_0xfbb945=_0x2f5b85;var _0x1557fd=Object[_0x19abb7(0x14b)](_0x40893d,_0x2f5b85);(!_0x1557fd||(_0x19abb7(0x12e)in _0x1557fd?!_0x40893d[_0x19abb7(0x131)]:_0x1557fd['writable']||_0x1557fd['configurable']))&&(_0x1557fd={'enumerable':!![],'get':function(){return _0x40893d[_0x2f5b85];}}),Object[_0x19abb7(0x124)](_0x48df5c,_0xfbb945,_0x1557fd);}:function(_0x77dfb5,_0x5cf5d5,_0x2da7cb,_0xbbf5bf){if(_0xbbf5bf===undefined)_0xbbf5bf=_0x2da7cb;_0x77dfb5[_0xbbf5bf]=_0x5cf5d5[_0x2da7cb];}),__setModuleDefault=this&&this[a0_0x2e31a3(0x13c)]||(Object[a0_0x2e31a3(0x12d)]?function(_0x400f1d,_0x51c75d){const _0x239ef3=a0_0x2e31a3;Object[_0x239ef3(0x124)](_0x400f1d,_0x239ef3(0x158),{'enumerable':!![],'value':_0x51c75d});}:function(_0x17ef0e,_0x4144f5){_0x17ef0e['default']=_0x4144f5;}),__importStar=this&&this[a0_0x2e31a3(0x153)]||(function(){var _0x142f18=function(_0x1b596a){const _0x206f70=a0_0x16f2;return _0x142f18=Object[_0x206f70(0x139)]||function(_0x2d6108){const _0x1b9d0e=_0x206f70;var _0x2736d2=[];for(var _0x49ef31 in _0x2d6108)if(Object['prototype'][_0x1b9d0e(0x15b)][_0x1b9d0e(0x12b)](_0x2d6108,_0x49ef31))_0x2736d2[_0x2736d2[_0x1b9d0e(0x14c)]]=_0x49ef31;return _0x2736d2;},_0x142f18(_0x1b596a);};return function(_0x523926){const _0x5cac28=a0_0x16f2;if(_0x523926&&_0x523926[_0x5cac28(0x131)])return _0x523926;var _0x15e42e={};if(_0x523926!=null){for(var _0x245e56=_0x142f18(_0x523926),_0x213098=0x0;_0x213098<_0x245e56[_0x5cac28(0x14c)];_0x213098++)if(_0x245e56[_0x213098]!==_0x5cac28(0x158))__createBinding(_0x15e42e,_0x523926,_0x245e56[_0x213098]);}return __setModuleDefault(_0x15e42e,_0x523926),_0x15e42e;};}());function a0_0x3b87(){const _0x14678f=['.java','.trimprompt','.tsx','startsWith','.py','pop','crypto','defineProperty','existsSync','split','interface','createHash','function','hex','call','skeletonize','create','get','def\x20','class\x20','__esModule','writeFileSync','push','1302648gOJZfL','.go','import','var','update','getOwnPropertyNames','let','350617ucGqUC','__setModuleDefault','\x22\x22\x22','export','match','md5','4688432uDfVIn','join','10765062VyItWc','trim','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','substring','includes','runCcr','9RKOOqp','6141204zSrLzZ','getOwnPropertyDescriptor','length','slice','__createBinding','2107238rYlFWf','5lLGXnn','.rs','endsWith','__importStar','from\x20','path','replace','type','default','\x27\x27\x27','.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20','hasOwnProperty','.jsx','const','#\x20...\x20[collapsed]','extname','digest','import\x20','1339460VYhVjb','utf8','.ts',']\x0a\x0a'];a0_0x3b87=function(){return _0x14678f;};return a0_0x3b87();}Object[a0_0x2e31a3(0x124)](exports,a0_0x2e31a3(0x131),{'value':!![]}),exports[a0_0x2e31a3(0x12c)]=skeletonize,exports[a0_0x2e31a3(0x148)]=runCcr;const crypto=__importStar(require(a0_0x2e31a3(0x123))),fs=__importStar(require('fs')),path=__importStar(require(a0_0x2e31a3(0x155))),os=__importStar(require('os'));function a0_0x16f2(_0x17c099,_0x13d157){_0x17c099=_0x17c099-0x11b;const _0x3b87c3=a0_0x3b87();let _0x16f265=_0x3b87c3[_0x17c099];return _0x16f265;}function skeletonize(_0x59a5e1,_0x102dfc){const _0x239999=a0_0x2e31a3,_0x2d07ab=path[_0x239999(0x15f)](_0x102dfc[_0x239999(0x126)]('\x20')[_0x239999(0x122)]()||'')['toLowerCase'](),_0x269a5b=_0x59a5e1['split']('\x0a'),_0xcbf814=[];if(_0x2d07ab===_0x239999(0x121)){let _0x20197d=![],_0x19f4e8='';for(let _0x814797=0x0;_0x814797<_0x269a5b[_0x239999(0x14c)];_0x814797++){const _0x5312ef=_0x269a5b[_0x814797],_0x1b558c=_0x5312ef['trim'](),_0x308faf=_0x5312ef[_0x239999(0x14c)]-_0x5312ef['trimStart']()[_0x239999(0x14c)];if(!_0x20197d&&(_0x1b558c['startsWith'](_0x239999(0x13d))||_0x1b558c[_0x239999(0x120)](_0x239999(0x159)))){_0x20197d=!![],_0x19f4e8=_0x1b558c[_0x239999(0x146)](0x0,0x3),_0xcbf814[_0x239999(0x133)](_0x5312ef);_0x1b558c[_0x239999(0x152)](_0x19f4e8)&&_0x1b558c[_0x239999(0x14c)]>0x3&&(_0x20197d=![]);continue;}if(_0x20197d){_0xcbf814[_0x239999(0x133)](_0x5312ef);_0x1b558c[_0x239999(0x152)](_0x19f4e8)&&(_0x20197d=![]);continue;}if(_0x1b558c[_0x239999(0x120)](_0x239999(0x161))||_0x1b558c[_0x239999(0x120)](_0x239999(0x154))||_0x1b558c[_0x239999(0x120)](_0x239999(0x130))||_0x1b558c[_0x239999(0x120)](_0x239999(0x12f))||_0x1b558c['startsWith']('@')||_0x1b558c[_0x239999(0x120)]('#')||_0x1b558c[_0x239999(0x14c)]===0x0)_0xcbf814[_0x239999(0x133)](_0x5312ef);else{const _0x776046=_0xcbf814[_0xcbf814[_0x239999(0x14c)]-0x1]||'';if(!_0x776046[_0x239999(0x144)]()[_0x239999(0x152)](_0x239999(0x15e))){const _0x22dcfa='\x20'['repeat'](_0x308faf);_0xcbf814[_0x239999(0x133)](_0x22dcfa+_0x239999(0x15e));}}}return _0xcbf814['join']('\x0a');}if(['.js',_0x239999(0x11b),_0x239999(0x15c),_0x239999(0x11f),_0x239999(0x135),_0x239999(0x151),_0x239999(0x11d),'.c','.cpp','.h'][_0x239999(0x147)](_0x2d07ab)){let _0x3d5010=0x0;for(let _0x3b0b0b=0x0;_0x3b0b0b<_0x269a5b[_0x239999(0x14c)];_0x3b0b0b++){const _0x3ae79f=_0x269a5b[_0x3b0b0b],_0x334148=_0x3ae79f['trim'](),_0x8c8f15=(_0x334148[_0x239999(0x13f)](/\{/g)||[])['length'],_0x3f15a5=(_0x334148[_0x239999(0x13f)](/\}/g)||[])[_0x239999(0x14c)];if(_0x3d5010===0x0)(_0x334148[_0x239999(0x120)](_0x239999(0x136))||_0x334148[_0x239999(0x120)](_0x239999(0x13e))||_0x334148['startsWith'](_0x239999(0x15d))||_0x334148[_0x239999(0x120)](_0x239999(0x13a))||_0x334148[_0x239999(0x120)](_0x239999(0x137))||_0x334148[_0x239999(0x120)]('class')||_0x334148[_0x239999(0x120)](_0x239999(0x129))||_0x334148[_0x239999(0x120)](_0x239999(0x127))||_0x334148[_0x239999(0x120)](_0x239999(0x157))||_0x334148[_0x239999(0x120)]('package')||_0x334148[_0x239999(0x120)]('fn')||_0x334148[_0x239999(0x120)]('pub')||_0x334148[_0x239999(0x14c)]===0x0||_0x334148[_0x239999(0x120)]('//')||_0x334148[_0x239999(0x120)]('/*')||_0x334148[_0x239999(0x120)]('*'))&&_0xcbf814[_0x239999(0x133)](_0x3ae79f),_0x8c8f15>_0x3f15a5&&(_0x3d5010+=_0x8c8f15-_0x3f15a5);else{const _0x239448=_0x3d5010+_0x8c8f15-_0x3f15a5;if(_0x239448<=0x0){const _0x1a537b=_0x3ae79f[_0x239999(0x13f)](/^\s*/)?.[0x0]||'';_0xcbf814[_0x239999(0x133)](_0x1a537b+'//\x20...\x20[collapsed]'),_0xcbf814[_0x239999(0x133)](_0x3ae79f),_0x3d5010=0x0;}else _0x3d5010=_0x239448;}}return _0xcbf814[_0x239999(0x142)]('\x0a');}if(_0x269a5b[_0x239999(0x14c)]<=0x64)return _0x59a5e1;return[..._0x269a5b[_0x239999(0x14d)](0x0,0x1e),'\x0a...\x20['+(_0x269a5b['length']-0x32)+_0x239999(0x145),..._0x269a5b[_0x239999(0x14d)](-0x14)][_0x239999(0x142)]('\x0a');}function runCcr(_0x5b7c18,_0x4bcc32){const _0x4184e7=a0_0x2e31a3,_0x1d7a37=_0x4bcc32[_0x4184e7(0x156)](/\\/g,'/'),_0x8682b2='tp_'+crypto[_0x4184e7(0x128)](_0x4184e7(0x140))[_0x4184e7(0x138)](_0x5b7c18)[_0x4184e7(0x160)](_0x4184e7(0x12a))[_0x4184e7(0x146)](0x0,0xa),_0x5d243d=path[_0x4184e7(0x142)](os['homedir'](),_0x4184e7(0x11e)),_0x3a0f1f=path[_0x4184e7(0x142)](_0x5d243d,'ccr');!fs[_0x4184e7(0x125)](_0x3a0f1f)&&fs['mkdirSync'](_0x3a0f1f,{'recursive':!![]});fs[_0x4184e7(0x132)](path[_0x4184e7(0x142)](_0x3a0f1f,_0x8682b2+'.txt'),_0x5b7c18,_0x4184e7(0x163));const _0x4d0400=skeletonize(_0x5b7c18,_0x1d7a37);return'[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20'+_0x8682b2+_0x4184e7(0x15a)+_0x8682b2+_0x4184e7(0x11c)+_0x4d0400;}
|
package/cli.js
CHANGED
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x33a1cc=a0_0x8dea;(function(_0x5e8eba,_0x47595d){const _0x215e3c=a0_0x8dea,_0x93a598=_0x5e8eba();while(!![]){try{const _0x2e5df3=-parseInt(_0x215e3c(0x184))/0x1*(-parseInt(_0x215e3c(0x195))/0x2)+-parseInt(_0x215e3c(0x1a0))/0x3+-parseInt(_0x215e3c(0x165))/0x4*(parseInt(_0x215e3c(0x146))/0x5)+parseInt(_0x215e3c(0x185))/0x6*(parseInt(_0x215e3c(0x193))/0x7)+-parseInt(_0x215e3c(0x15a))/0x8*(-parseInt(_0x215e3c(0x17e))/0x9)+parseInt(_0x215e3c(0x134))/0xa+parseInt(_0x215e3c(0x14e))/0xb;if(_0x2e5df3===_0x47595d)break;else _0x93a598['push'](_0x93a598['shift']());}catch(_0x223efb){_0x93a598['push'](_0x93a598['shift']());}}}(a0_0x4410,0xcaac1));var __createBinding=this&&this[a0_0x33a1cc(0x19d)]||(Object[a0_0x33a1cc(0x135)]?function(_0x8eedad,_0x41149e,_0x371c6b,_0x47a2f9){const _0x1fbafb=a0_0x33a1cc;if(_0x47a2f9===undefined)_0x47a2f9=_0x371c6b;var _0x115363=Object[_0x1fbafb(0x152)](_0x41149e,_0x371c6b);(!_0x115363||(_0x1fbafb(0x143)in _0x115363?!_0x41149e[_0x1fbafb(0x151)]:_0x115363[_0x1fbafb(0x173)]||_0x115363[_0x1fbafb(0x167)]))&&(_0x115363={'enumerable':!![],'get':function(){return _0x41149e[_0x371c6b];}}),Object[_0x1fbafb(0x12a)](_0x8eedad,_0x47a2f9,_0x115363);}:function(_0x47762f,_0x2f0e0c,_0x58ea69,_0x5c0498){if(_0x5c0498===undefined)_0x5c0498=_0x58ea69;_0x47762f[_0x5c0498]=_0x2f0e0c[_0x58ea69];}),__setModuleDefault=this&&this[a0_0x33a1cc(0x16d)]||(Object['create']?function(_0x3bc5a9,_0x316d16){const _0x3cce93=a0_0x33a1cc;Object[_0x3cce93(0x12a)](_0x3bc5a9,_0x3cce93(0x186),{'enumerable':!![],'value':_0x316d16});}:function(_0x5a76d6,_0x1ccb83){_0x5a76d6['default']=_0x1ccb83;}),__importStar=this&&this['__importStar']||(function(){var _0x47f4d7=function(_0x22ab3c){const _0x24b07b=a0_0x8dea;return _0x47f4d7=Object[_0x24b07b(0x196)]||function(_0x43d1ce){const _0x33f4d0=_0x24b07b;var _0x3f6138=[];for(var _0x304c64 in _0x43d1ce)if(Object[_0x33f4d0(0x12e)]['hasOwnProperty'][_0x33f4d0(0x166)](_0x43d1ce,_0x304c64))_0x3f6138[_0x3f6138[_0x33f4d0(0x13a)]]=_0x304c64;return _0x3f6138;},_0x47f4d7(_0x22ab3c);};return function(_0x2da17e){const _0x6e10ab=a0_0x8dea;if(_0x2da17e&&_0x2da17e[_0x6e10ab(0x151)])return _0x2da17e;var _0x1ef465={};if(_0x2da17e!=null){for(var _0x269466=_0x47f4d7(_0x2da17e),_0x2ed819=0x0;_0x2ed819<_0x269466[_0x6e10ab(0x13a)];_0x2ed819++)if(_0x269466[_0x2ed819]!==_0x6e10ab(0x186))__createBinding(_0x1ef465,_0x2da17e,_0x269466[_0x2ed819]);}return __setModuleDefault(_0x1ef465,_0x2da17e),_0x1ef465;};}()),__importDefault=this&&this[a0_0x33a1cc(0x13d)]||function(_0xdd5cea){const _0x15446e=a0_0x33a1cc;return _0xdd5cea&&_0xdd5cea[_0x15446e(0x151)]?_0xdd5cea:{'default':_0xdd5cea};};function a0_0x4410(){const _0xae6eed=['469284YvQZeU','/api/config','defineProperty','--headless','auto','slice','prototype','sendFile','tracker','post','now','readFileSync','8054470aJLdht','create','execPath','rawTokens','platform','codex','length','opencode','Missing\x20key','__importDefault','../src/favicon.png','log','use','exit','No\x20active\x20session\x20file\x20found','get','/api/stats/inspect/:id','listen','5jZqaLk','aider','savedTokens','ignore','gemini','open\x20\x22','SIGTERM','darwin','1550824oVFKkR','openclaw','timestamp','__esModule','getOwnPropertyDescriptor','index.html','status','http://localhost:','compactPath','message','xdg-open\x20\x22','Directory\x20not\x20found','14616ZVbOka','logs','join','copilot','params','fullPath','Missing\x20agentKey','/api/stats/history','lastModified','utf8','/favicon.png','6006588muuGFA','call','configurable','then','fileName','getLogs','.raw.txt','/api/stats/summary','__setModuleDefault','includes','./tracker','claude','mkdirSync','getConfig','writable','catch','startDashboard','/api/config/open-dir','code','/api/config/features','compressedTokens','existsSync','favicon.png','filter','child_process','2718snkSfU','reason','features_enabled','query','Compressed\x20output\x20log\x20file\x20not\x20found.','./file-watcher','109FETLnZ','5142XnjaDF','default','EADDRINUSE','[TrimPrompt]\x20Dashboard\x20error:\x20','error','json','resolve','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','explorer\x20\x22','watcher','homedir','No\x20compressible\x20content\x20found\x20in\x20this\x20session','argv','command','1379WuyCSF','/api/config/custom-path','15068KzGjgG','getOwnPropertyNames','SIGINT','cli.js','Raw\x20output\x20log\x20file\x20not\x20found.','activeSavedTokens','find','../src/index.html','__createBinding','/api/config/toggle','body'];a0_0x4410=function(){return _0xae6eed;};return a0_0x4410();}Object[a0_0x33a1cc(0x12a)](exports,a0_0x33a1cc(0x151),{'value':!![]}),exports[a0_0x33a1cc(0x175)]=startDashboard;const express_1=__importDefault(require('express')),path=__importStar(require('path')),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require('open')),tracker_1=require(a0_0x33a1cc(0x16f)),app=(0x0,express_1[a0_0x33a1cc(0x186)])();app[a0_0x33a1cc(0x140)](express_1[a0_0x33a1cc(0x186)]['json']());function a0_0x8dea(_0xe4642c,_0x48a88c){_0xe4642c=_0xe4642c-0x12a;const _0x441076=a0_0x4410();let _0x8deab6=_0x441076[_0xe4642c];return _0x8deab6;}const baseDir=path[a0_0x33a1cc(0x15c)](os[a0_0x33a1cc(0x18f)](),'.trimprompt'),logsDir=path[a0_0x33a1cc(0x15c)](baseDir,a0_0x33a1cc(0x15b));let configPayloadCache=null;const CONFIG_CACHE_TTL_MS=0x2710;function invalidateConfigCache(){configPayloadCache=null;}app[a0_0x33a1cc(0x143)]('/',(_0x4fa5d3,_0x5b2506)=>{const _0x1d45c8=a0_0x33a1cc,_0x55bc19=path[_0x1d45c8(0x15c)](__dirname,_0x1d45c8(0x153));fs[_0x1d45c8(0x17a)](_0x55bc19)?_0x5b2506[_0x1d45c8(0x12f)](_0x55bc19):_0x5b2506[_0x1d45c8(0x12f)](path[_0x1d45c8(0x15c)](__dirname,_0x1d45c8(0x19c)));}),app['get'](a0_0x33a1cc(0x164),(_0x2b9c94,_0xe4e61e)=>{const _0x1f3572=a0_0x33a1cc,_0xdb90f7=path['join'](__dirname,_0x1f3572(0x17b));fs['existsSync'](_0xdb90f7)?_0xe4e61e[_0x1f3572(0x12f)](_0xdb90f7):_0xe4e61e['sendFile'](path[_0x1f3572(0x15c)](__dirname,_0x1f3572(0x13e)));}),app['get'](a0_0x33a1cc(0x16c),(_0x44f34b,_0x2a9d4d)=>{const _0x4b3a44=a0_0x33a1cc,_0x22f09e=_0x44f34b[_0x4b3a44(0x181)]['model']||_0x4b3a44(0x12c),_0x25c858=tracker_1[_0x4b3a44(0x130)]['getStatsSummary'](_0x22f09e);_0x2a9d4d['json'](_0x25c858);}),app[a0_0x33a1cc(0x143)](a0_0x33a1cc(0x161),(_0x5a0bdc,_0x798054)=>{const _0xa4a020=a0_0x33a1cc,_0x4267d8=tracker_1[_0xa4a020(0x130)][_0xa4a020(0x16a)]();_0x798054[_0xa4a020(0x18a)](_0x4267d8[_0xa4a020(0x13a)]>0x1f4?_0x4267d8[_0xa4a020(0x12d)](-0x1f4):_0x4267d8);}),app[a0_0x33a1cc(0x143)](a0_0x33a1cc(0x144),(_0x6fda3d,_0x43d10b)=>{const _0x3bf5e9=a0_0x33a1cc,_0xddbbed=_0x6fda3d[_0x3bf5e9(0x15e)]['id'],_0x5c7b25=path[_0x3bf5e9(0x15c)](logsDir,_0xddbbed+_0x3bf5e9(0x16b)),_0xfbfef5=path[_0x3bf5e9(0x15c)](logsDir,_0xddbbed+'.comp.txt');let _0x596502=_0x3bf5e9(0x199),_0x6de6be=_0x3bf5e9(0x182);try{fs[_0x3bf5e9(0x17a)](_0x5c7b25)&&(_0x596502=fs[_0x3bf5e9(0x133)](_0x5c7b25,_0x3bf5e9(0x163))),fs[_0x3bf5e9(0x17a)](_0xfbfef5)&&(_0x6de6be=fs['readFileSync'](_0xfbfef5,_0x3bf5e9(0x163)));}catch(_0x3f13c0){}_0x43d10b['json']({'id':_0xddbbed,'raw':_0x596502,'compressed':_0x6de6be});}),app[a0_0x33a1cc(0x143)](a0_0x33a1cc(0x178),(_0x4992d5,_0x49661d)=>{const _0x52e47b=a0_0x33a1cc,_0x26c7a=tracker_1['tracker'][_0x52e47b(0x172)]();_0x49661d['json'](_0x26c7a[_0x52e47b(0x180)]||{});}),app[a0_0x33a1cc(0x131)](a0_0x33a1cc(0x178),(_0x52e4ad,_0x4450a6)=>{const _0x3f9a48=a0_0x33a1cc,_0x2a50d2=_0x52e4ad[_0x3f9a48(0x19f)];tracker_1['tracker']['setConfig']('features_enabled',_0x2a50d2),invalidateConfigCache(),_0x4450a6[_0x3f9a48(0x18a)]({'ok':!![]});}),app['post']('/api/agent/compact',async(_0x4a0a50,_0x2ce8b0)=>{const _0x267732=a0_0x33a1cc;try{const {getLatestSessionFile:_0x4267d4,compactSessionCopy:_0x5916b4}=await Promise[_0x267732(0x18b)]()['then'](()=>__importStar(require(_0x267732(0x183)))),{agentKey:_0x5a4dc8}=_0x4a0a50[_0x267732(0x19f)]||{},_0x23a314=_0x5a4dc8||_0x267732(0x170),_0x5305ef=_0x4267d4(_0x23a314);if(_0x5305ef&&_0x5305ef[_0x267732(0x15f)]&&fs[_0x267732(0x17a)](_0x5305ef[_0x267732(0x15f)])){const _0x49f9c4=_0x5916b4(_0x5305ef['fullPath'],_0x23a314);_0x49f9c4['ok']&&(_0x49f9c4[_0x267732(0x148)]||0x0)>0x0?_0x2ce8b0['json']({'ok':!![],'fileName':_0x5305ef[_0x267732(0x169)],'tokensSaved':_0x49f9c4['savedTokens'],'rawTokens':_0x49f9c4[_0x267732(0x137)],'compressedTokens':_0x49f9c4[_0x267732(0x179)],'reductionPct':_0x49f9c4['reductionPct'],'compactPath':_0x49f9c4[_0x267732(0x156)]}):_0x2ce8b0[_0x267732(0x18a)]({'ok':![],'message':_0x49f9c4[_0x267732(0x17f)]||_0x267732(0x190)});}else _0x2ce8b0[_0x267732(0x18a)]({'ok':![],'message':_0x267732(0x142)});}catch(_0x5f2076){_0x2ce8b0['status'](0x1f4)[_0x267732(0x18a)]({'ok':![],'error':_0x5f2076[_0x267732(0x157)]});}}),app[a0_0x33a1cc(0x143)](a0_0x33a1cc(0x1a1),async(_0x56cb95,_0xe79c7e)=>{const _0x1ffd3b=a0_0x33a1cc;if(configPayloadCache&&Date[_0x1ffd3b(0x132)]()-configPayloadCache['at']<CONFIG_CACHE_TTL_MS)return _0xe79c7e['json'](configPayloadCache['payload']);const {loadConfig:_0x5878a0,getAgentStoragePaths:_0x57623d,getLatestSessionFile:_0x42d225,loadSessionsState:_0x57d6cd}=await Promise[_0x1ffd3b(0x18b)]()['then'](()=>__importStar(require(_0x1ffd3b(0x183)))),_0x7c20d1=_0x5878a0(),_0x12ae89=[_0x1ffd3b(0x170),_0x1ffd3b(0x14a),_0x1ffd3b(0x139),'cursor',_0x1ffd3b(0x147),_0x1ffd3b(0x15d),_0x1ffd3b(0x14f),_0x1ffd3b(0x13b),'cortex'],_0x3556b4={},_0x148e25={},_0x20e9f8={},_0x5e499f=_0x57d6cd(),_0x44b051=tracker_1[_0x1ffd3b(0x130)]['getLogs']()||[];for(const _0x4e1fd6 of _0x12ae89){_0x3556b4[_0x4e1fd6]=_0x57623d(_0x4e1fd6);const _0x3b1ad1=_0x42d225(_0x4e1fd6);if(_0x3b1ad1&&_0x3b1ad1[_0x1ffd3b(0x15f)]&&_0x5e499f[_0x3b1ad1[_0x1ffd3b(0x15f)]])_0x3b1ad1['activeSavedTokens']=_0x5e499f[_0x3b1ad1[_0x1ffd3b(0x15f)]][_0x1ffd3b(0x19a)]||0x0;else{if(_0x3b1ad1)_0x3b1ad1['activeSavedTokens']=0x0;}_0x20e9f8[_0x4e1fd6]=_0x3b1ad1;const _0x460cbb=_0x44b051[_0x1ffd3b(0x17c)](_0x186a78=>_0x186a78[_0x1ffd3b(0x192)]&&_0x186a78[_0x1ffd3b(0x192)][_0x1ffd3b(0x16e)]('conv:'+_0x4e1fd6));_0x460cbb[_0x1ffd3b(0x13a)]>0x0?_0x148e25[_0x4e1fd6]=_0x460cbb[_0x460cbb['length']-0x1][_0x1ffd3b(0x150)]:_0x148e25[_0x4e1fd6]=_0x3b1ad1?_0x3b1ad1[_0x1ffd3b(0x162)]:null;}const _0x12f3d9={..._0x7c20d1,'resolvedPaths':_0x3556b4,'lastActiveTimestamps':_0x148e25,'latestSessions':_0x20e9f8};configPayloadCache={'at':Date[_0x1ffd3b(0x132)](),'payload':_0x12f3d9},_0xe79c7e['json'](_0x12f3d9);}),app[a0_0x33a1cc(0x131)](a0_0x33a1cc(0x176),async(_0x6a0274,_0x294a19)=>{const _0x2ab52f=a0_0x33a1cc,{getAgentStoragePaths:_0x275a21}=await Promise[_0x2ab52f(0x18b)]()[_0x2ab52f(0x168)](()=>__importStar(require('./file-watcher'))),{agentKey:_0x923932}=_0x6a0274[_0x2ab52f(0x19f)]||{};if(!_0x923932)return _0x294a19['status'](0x190)[_0x2ab52f(0x18a)]({'error':'Missing\x20agentKey'});const _0x1f12d2=_0x275a21(_0x923932),_0x10ea13=_0x1f12d2[_0x2ab52f(0x19b)](_0x58c310=>fs['existsSync'](_0x58c310))||_0x1f12d2[0x0];if(_0x10ea13){if(!fs[_0x2ab52f(0x17a)](_0x10ea13))try{fs[_0x2ab52f(0x171)](_0x10ea13,{'recursive':!![]});}catch{}const {exec:_0x1e226c}=await Promise[_0x2ab52f(0x18b)]()['then'](()=>__importStar(require(_0x2ab52f(0x17d)))),_0x562867=process[_0x2ab52f(0x138)]==='win32'?_0x2ab52f(0x18d)+_0x10ea13+'\x22':process['platform']===_0x2ab52f(0x14d)?_0x2ab52f(0x14b)+_0x10ea13+'\x22':_0x2ab52f(0x158)+_0x10ea13+'\x22';return _0x1e226c(_0x562867),_0x294a19[_0x2ab52f(0x18a)]({'success':!![],'openedPath':_0x10ea13});}_0x294a19[_0x2ab52f(0x154)](0x194)[_0x2ab52f(0x18a)]({'error':_0x2ab52f(0x159)});}),app[a0_0x33a1cc(0x131)](a0_0x33a1cc(0x19e),async(_0x324d8b,_0x540b41)=>{const _0x25c1f1=a0_0x33a1cc,{saveConfig:_0x4eb729}=await Promise[_0x25c1f1(0x18b)]()[_0x25c1f1(0x168)](()=>__importStar(require(_0x25c1f1(0x183)))),{key:_0x49e249,value:_0x20a0c6}=_0x324d8b[_0x25c1f1(0x19f)]||{};if(_0x49e249){const _0x2d22bc=_0x4eb729({'conversation_toggles':{[_0x49e249]:_0x20a0c6}});return invalidateConfigCache(),_0x540b41['json'](_0x2d22bc);}_0x540b41[_0x25c1f1(0x154)](0x190)[_0x25c1f1(0x18a)]({'error':_0x25c1f1(0x13c)});}),app['post'](a0_0x33a1cc(0x194),async(_0x56ab78,_0x22e646)=>{const _0x241a88=a0_0x33a1cc,{saveConfig:_0x3c56a2}=await Promise['resolve']()[_0x241a88(0x168)](()=>__importStar(require('./file-watcher'))),{agentKey:_0x2cccc4,path:_0x2a04b7}=_0x56ab78['body']||{};if(_0x2cccc4){const _0x58d4cb=_0x3c56a2({'custom_storage_paths':{[_0x2cccc4]:_0x2a04b7||null}});return invalidateConfigCache(),_0x22e646['json'](_0x58d4cb);}_0x22e646[_0x241a88(0x154)](0x190)[_0x241a88(0x18a)]({'error':_0x241a88(0x160)});});function startDashboard(_0xe7e11e=0xfa0){const _0x5e00b7=a0_0x33a1cc;let _0x406cbe=_0xe7e11e;const _0x242ac7=process[_0x5e00b7(0x191)][_0x5e00b7(0x16e)](_0x5e00b7(0x12b))||process.env.TRIMPROMPT_HEADLESS==='1',_0x44940d=app[_0x5e00b7(0x145)](_0x406cbe,()=>{const _0x775d89=_0x5e00b7,_0x4278e9=_0x775d89(0x155)+_0x406cbe;!_0x242ac7&&(console[_0x775d89(0x13f)]('\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20'+_0x4278e9),console[_0x775d89(0x13f)](_0x775d89(0x18c)));try{const {spawn:_0x1f26ef}=require(_0x775d89(0x17d)),_0x4ae25f=_0x1f26ef(process[_0x775d89(0x136)],[path[_0x775d89(0x15c)](__dirname,_0x775d89(0x198)),_0x775d89(0x18e),'start'],{'stdio':_0x775d89(0x149),'windowsHide':!![]}),_0x44ff95=()=>{try{_0x4ae25f['kill']();}catch{}};process['on'](_0x775d89(0x141),_0x44ff95),process['on'](_0x775d89(0x197),()=>{_0x44ff95(),process['exit'](0x0);}),process['on'](_0x775d89(0x14c),()=>{_0x44ff95(),process['exit'](0x0);});}catch{}!_0x242ac7&&process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1[_0x775d89(0x186)])(_0x4278e9)[_0x775d89(0x174)](()=>{});});_0x44940d['on'](_0x5e00b7(0x189),_0x375b61=>{const _0x1399d8=_0x5e00b7;_0x375b61[_0x1399d8(0x177)]===_0x1399d8(0x187)?startDashboard(_0x406cbe+0x1):console['error'](_0x1399d8(0x188)+_0x375b61[_0x1399d8(0x157)]);});}
|
|
1
|
+
'use strict';const a0_0x55833c=a0_0xfdb5;(function(_0x2ed84b,_0xdd8856){const _0x231e78=a0_0xfdb5,_0x2feb14=_0x2ed84b();while(!![]){try{const _0x461be5=-parseInt(_0x231e78(0x135))/0x1*(-parseInt(_0x231e78(0x118))/0x2)+-parseInt(_0x231e78(0x15d))/0x3*(-parseInt(_0x231e78(0x156))/0x4)+-parseInt(_0x231e78(0x181))/0x5+parseInt(_0x231e78(0x141))/0x6*(-parseInt(_0x231e78(0x134))/0x7)+parseInt(_0x231e78(0x120))/0x8*(parseInt(_0x231e78(0x188))/0x9)+parseInt(_0x231e78(0x18a))/0xa*(parseInt(_0x231e78(0x161))/0xb)+-parseInt(_0x231e78(0x167))/0xc*(parseInt(_0x231e78(0x17e))/0xd);if(_0x461be5===_0xdd8856)break;else _0x2feb14['push'](_0x2feb14['shift']());}catch(_0x824590){_0x2feb14['push'](_0x2feb14['shift']());}}}(a0_0x4eb8,0x2ccfb));function a0_0xfdb5(_0x55d506,_0x5f49c1){_0x55d506=_0x55d506-0x118;const _0x4eb830=a0_0x4eb8();let _0xfdb5d5=_0x4eb830[_0x55d506];return _0xfdb5d5;}function a0_0x4eb8(){const _0x3eead0=['fileName','aider','defineProperty','claude','hasOwnProperty','getConfig','37870DQxVva','1TJTBlm','join','Missing\x20agentKey','lastModified','length','copilot','json','./file-watcher','__createBinding','readFileSync','utf8','logs','330cTzfvE','error','No\x20compressible\x20content\x20found\x20in\x20this\x20session','rawTokens','Directory\x20not\x20found','cli.js','existsSync','cortex','command','path','catch','conv:','watcher','getLogs','/api/config/features','opencode','cursor','/api/stats/history','execPath','call','activeSavedTokens','144dlXHbl','getOwnPropertyNames','getStatsSummary','includes','homedir','explorer\x20\x22','configurable','7191VHxZzL','exit','filter','xdg-open\x20\x22','40667YbmMGf','default','[TrimPrompt]\x20Dashboard\x20error:\x20','ignore','resolve','./tracker','36zOvkTa','child_process','open','/api/stats/summary','getOwnPropertyDescriptor','gemini','.comp.txt','message','/api/agent/compact','timestamp','writable','savedTokens','../src/favicon.png','use','index.html','win32','tracker','compressedTokens','favicon.png','prototype','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','__esModule','slice','120107sFUKXo','compactPath','http://localhost:','72690gyBwFB','now','Compressed\x20output\x20log\x20file\x20not\x20found.','open\x20\x22','__setModuleDefault','EADDRINUSE','listen','10215lkACou','fullPath','150tPkQjy','auto','then','/favicon.png','openclaw','params','SIGTERM','175280JRkBoU','argv','mkdirSync','get','No\x20active\x20session\x20file\x20found','post','platform','.trimprompt','2072lOmhco','darwin','status','features_enabled','reductionPct','/api/config/open-dir','sendFile','body','--headless','kill','log','payload','create','code'];a0_0x4eb8=function(){return _0x3eead0;};return a0_0x4eb8();}var __createBinding=this&&this[a0_0x55833c(0x13d)]||(Object[a0_0x55833c(0x12c)]?function(_0x2fdc54,_0xa8162b,_0x10516b,_0x5d9ca7){const _0x250655=a0_0x55833c;if(_0x5d9ca7===undefined)_0x5d9ca7=_0x10516b;var _0x1773ac=Object[_0x250655(0x16b)](_0xa8162b,_0x10516b);(!_0x1773ac||(_0x250655(0x11b)in _0x1773ac?!_0xa8162b[_0x250655(0x17c)]:_0x1773ac[_0x250655(0x171)]||_0x1773ac[_0x250655(0x15c)]))&&(_0x1773ac={'enumerable':!![],'get':function(){return _0xa8162b[_0x10516b];}}),Object['defineProperty'](_0x2fdc54,_0x5d9ca7,_0x1773ac);}:function(_0xec3ac7,_0xae76de,_0x3a3c3f,_0x160ea1){if(_0x160ea1===undefined)_0x160ea1=_0x3a3c3f;_0xec3ac7[_0x160ea1]=_0xae76de[_0x3a3c3f];}),__setModuleDefault=this&&this[a0_0x55833c(0x185)]||(Object['create']?function(_0x17e692,_0x3bda37){const _0x5470bc=a0_0x55833c;Object[_0x5470bc(0x130)](_0x17e692,_0x5470bc(0x162),{'enumerable':!![],'value':_0x3bda37});}:function(_0x482ccd,_0x395de7){_0x482ccd['default']=_0x395de7;}),__importStar=this&&this['__importStar']||(function(){var _0x2d3933=function(_0x2fff2d){const _0x3853bd=a0_0xfdb5;return _0x2d3933=Object[_0x3853bd(0x157)]||function(_0x57412c){const _0x5b810e=_0x3853bd;var _0x3cad5d=[];for(var _0x3a030a in _0x57412c)if(Object[_0x5b810e(0x17a)][_0x5b810e(0x132)][_0x5b810e(0x154)](_0x57412c,_0x3a030a))_0x3cad5d[_0x3cad5d[_0x5b810e(0x139)]]=_0x3a030a;return _0x3cad5d;},_0x2d3933(_0x2fff2d);};return function(_0x425538){const _0x4e162b=a0_0xfdb5;if(_0x425538&&_0x425538['__esModule'])return _0x425538;var _0x2684a2={};if(_0x425538!=null){for(var _0x3ebf94=_0x2d3933(_0x425538),_0xec4545=0x0;_0xec4545<_0x3ebf94[_0x4e162b(0x139)];_0xec4545++)if(_0x3ebf94[_0xec4545]!==_0x4e162b(0x162))__createBinding(_0x2684a2,_0x425538,_0x3ebf94[_0xec4545]);}return __setModuleDefault(_0x2684a2,_0x425538),_0x2684a2;};}()),__importDefault=this&&this['__importDefault']||function(_0x290e9a){const _0x145cd4=a0_0x55833c;return _0x290e9a&&_0x290e9a[_0x145cd4(0x17c)]?_0x290e9a:{'default':_0x290e9a};};Object[a0_0x55833c(0x130)](exports,a0_0x55833c(0x17c),{'value':!![]}),exports['startDashboard']=startDashboard;const express_1=__importDefault(require('express')),path=__importStar(require(a0_0x55833c(0x14a))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x55833c(0x169))),tracker_1=require(a0_0x55833c(0x166)),app=(0x0,express_1['default'])();app[a0_0x55833c(0x174)](express_1['default'][a0_0x55833c(0x13b)]());const baseDir=path[a0_0x55833c(0x136)](os[a0_0x55833c(0x15a)](),a0_0x55833c(0x11f)),logsDir=path[a0_0x55833c(0x136)](baseDir,a0_0x55833c(0x140));let configPayloadCache=null;const CONFIG_CACHE_TTL_MS=0x2710;function invalidateConfigCache(){configPayloadCache=null;}app[a0_0x55833c(0x11b)]('/',(_0x296b2a,_0x2e24ad)=>{const _0x241dc3=a0_0x55833c,_0x51802e=path['join'](__dirname,_0x241dc3(0x175));fs[_0x241dc3(0x147)](_0x51802e)?_0x2e24ad[_0x241dc3(0x126)](_0x51802e):_0x2e24ad[_0x241dc3(0x126)](path['join'](__dirname,'../src/index.html'));}),app['get'](a0_0x55833c(0x18d),(_0x2ff71f,_0x4be61e)=>{const _0x29e5eb=a0_0x55833c,_0x363c60=path[_0x29e5eb(0x136)](__dirname,_0x29e5eb(0x179));fs[_0x29e5eb(0x147)](_0x363c60)?_0x4be61e['sendFile'](_0x363c60):_0x4be61e[_0x29e5eb(0x126)](path[_0x29e5eb(0x136)](__dirname,_0x29e5eb(0x173)));}),app[a0_0x55833c(0x11b)](a0_0x55833c(0x16a),(_0x2ca565,_0x4fce1f)=>{const _0x50045b=a0_0x55833c,_0x335a87=_0x2ca565['query']['model']||_0x50045b(0x18b),_0x4ad24c=tracker_1[_0x50045b(0x177)][_0x50045b(0x158)](_0x335a87);_0x4fce1f[_0x50045b(0x13b)](_0x4ad24c);}),app['get'](a0_0x55833c(0x152),(_0xb4a280,_0x431709)=>{const _0xa35c78=a0_0x55833c,_0x200e81=tracker_1['tracker'][_0xa35c78(0x14e)]();_0x431709[_0xa35c78(0x13b)](_0x200e81[_0xa35c78(0x139)]>0x1f4?_0x200e81[_0xa35c78(0x17d)](-0x1f4):_0x200e81);}),app[a0_0x55833c(0x11b)]('/api/stats/inspect/:id',(_0x50b664,_0x5450f8)=>{const _0x4ef5d1=a0_0x55833c,_0x581407=_0x50b664[_0x4ef5d1(0x18f)]['id'],_0x1ab6b4=path[_0x4ef5d1(0x136)](logsDir,_0x581407+'.raw.txt'),_0xd9de16=path['join'](logsDir,_0x581407+_0x4ef5d1(0x16d));let _0x5ef6b2='Raw\x20output\x20log\x20file\x20not\x20found.',_0x188256=_0x4ef5d1(0x183);try{fs['existsSync'](_0x1ab6b4)&&(_0x5ef6b2=fs[_0x4ef5d1(0x13e)](_0x1ab6b4,_0x4ef5d1(0x13f))),fs[_0x4ef5d1(0x147)](_0xd9de16)&&(_0x188256=fs[_0x4ef5d1(0x13e)](_0xd9de16,'utf8'));}catch(_0x589cdd){}_0x5450f8['json']({'id':_0x581407,'raw':_0x5ef6b2,'compressed':_0x188256});}),app[a0_0x55833c(0x11b)]('/api/config/features',(_0x16af58,_0x4d97c2)=>{const _0x135c70=a0_0x55833c,_0x53a567=tracker_1[_0x135c70(0x177)][_0x135c70(0x133)]();_0x4d97c2['json'](_0x53a567[_0x135c70(0x123)]||{});}),app[a0_0x55833c(0x11d)](a0_0x55833c(0x14f),(_0x2f7276,_0x3ec1e3)=>{const _0x36184a=a0_0x55833c,_0x440701=_0x2f7276['body'];tracker_1['tracker']['setConfig'](_0x36184a(0x123),_0x440701),invalidateConfigCache(),_0x3ec1e3[_0x36184a(0x13b)]({'ok':!![]});}),app[a0_0x55833c(0x11d)](a0_0x55833c(0x16f),async(_0x1b6331,_0x58e57c)=>{const _0x297fe2=a0_0x55833c;try{const {getLatestSessionFile:_0xe90f60,compactSessionCopy:_0x3973b6}=await Promise[_0x297fe2(0x165)]()['then'](()=>__importStar(require(_0x297fe2(0x13c)))),{agentKey:_0x23f8f7}=_0x1b6331[_0x297fe2(0x127)]||{},_0x4e9009=_0x23f8f7||_0x297fe2(0x131),_0x4017e5=_0xe90f60(_0x4e9009);if(_0x4017e5&&_0x4017e5[_0x297fe2(0x189)]&&fs[_0x297fe2(0x147)](_0x4017e5[_0x297fe2(0x189)])){const _0xa48379=_0x3973b6(_0x4017e5[_0x297fe2(0x189)],_0x4e9009);_0xa48379['ok']&&(_0xa48379[_0x297fe2(0x172)]||0x0)>0x0?_0x58e57c['json']({'ok':!![],'fileName':_0x4017e5[_0x297fe2(0x12e)],'tokensSaved':_0xa48379[_0x297fe2(0x172)],'rawTokens':_0xa48379[_0x297fe2(0x144)],'compressedTokens':_0xa48379[_0x297fe2(0x178)],'reductionPct':_0xa48379[_0x297fe2(0x124)],'compactPath':_0xa48379[_0x297fe2(0x17f)]}):_0x58e57c['json']({'ok':![],'message':_0xa48379['reason']||_0x297fe2(0x143)});}else _0x58e57c['json']({'ok':![],'message':_0x297fe2(0x11c)});}catch(_0x1fc59b){_0x58e57c[_0x297fe2(0x122)](0x1f4)[_0x297fe2(0x13b)]({'ok':![],'error':_0x1fc59b[_0x297fe2(0x16e)]});}}),app[a0_0x55833c(0x11b)]('/api/config',async(_0x43db45,_0x9cf2a2)=>{const _0xc6798=a0_0x55833c;if(configPayloadCache&&Date[_0xc6798(0x182)]()-configPayloadCache['at']<CONFIG_CACHE_TTL_MS)return _0x9cf2a2['json'](configPayloadCache[_0xc6798(0x12b)]);const {loadConfig:_0x254a01,getAgentStoragePaths:_0x3839ef,getLatestSessionFile:_0x1ff27d,loadSessionsState:_0x380b9c}=await Promise[_0xc6798(0x165)]()[_0xc6798(0x18c)](()=>__importStar(require(_0xc6798(0x13c)))),_0x6321d5=_0x254a01(),_0x2c0bb9=[_0xc6798(0x131),_0xc6798(0x16c),'codex',_0xc6798(0x151),_0xc6798(0x12f),_0xc6798(0x13a),_0xc6798(0x18e),_0xc6798(0x150),_0xc6798(0x148)],_0xbc4c62={},_0x1cb9e3={},_0x238a9d={},_0x1e9c44=_0x380b9c(),_0x4d0f4b=tracker_1[_0xc6798(0x177)][_0xc6798(0x14e)]()||[];for(const _0xec1755 of _0x2c0bb9){_0xbc4c62[_0xec1755]=_0x3839ef(_0xec1755);const _0x57d702=_0x1ff27d(_0xec1755);if(_0x57d702&&_0x57d702[_0xc6798(0x189)]&&_0x1e9c44[_0x57d702[_0xc6798(0x189)]])_0x57d702[_0xc6798(0x155)]=_0x1e9c44[_0x57d702['fullPath']][_0xc6798(0x155)]||0x0;else{if(_0x57d702)_0x57d702['activeSavedTokens']=0x0;}_0x238a9d[_0xec1755]=_0x57d702;const _0x2e38ba=_0x4d0f4b[_0xc6798(0x15f)](_0x3089bc=>_0x3089bc[_0xc6798(0x149)]&&_0x3089bc[_0xc6798(0x149)][_0xc6798(0x159)](_0xc6798(0x14c)+_0xec1755));_0x2e38ba[_0xc6798(0x139)]>0x0?_0x1cb9e3[_0xec1755]=_0x2e38ba[_0x2e38ba[_0xc6798(0x139)]-0x1][_0xc6798(0x170)]:_0x1cb9e3[_0xec1755]=_0x57d702?_0x57d702[_0xc6798(0x138)]:null;}const _0x3a2e45={..._0x6321d5,'resolvedPaths':_0xbc4c62,'lastActiveTimestamps':_0x1cb9e3,'latestSessions':_0x238a9d};configPayloadCache={'at':Date[_0xc6798(0x182)](),'payload':_0x3a2e45},_0x9cf2a2['json'](_0x3a2e45);}),app[a0_0x55833c(0x11d)](a0_0x55833c(0x125),async(_0x29bc74,_0x3fcd64)=>{const _0x5a435e=a0_0x55833c,{getAgentStoragePaths:_0x1a482f}=await Promise[_0x5a435e(0x165)]()['then'](()=>__importStar(require(_0x5a435e(0x13c)))),{agentKey:_0x2880a2}=_0x29bc74[_0x5a435e(0x127)]||{};if(!_0x2880a2)return _0x3fcd64['status'](0x190)['json']({'error':'Missing\x20agentKey'});const _0x360555=_0x1a482f(_0x2880a2),_0x4097c8=_0x360555['find'](_0x329916=>fs[_0x5a435e(0x147)](_0x329916))||_0x360555[0x0];if(_0x4097c8){if(!fs[_0x5a435e(0x147)](_0x4097c8))try{fs[_0x5a435e(0x11a)](_0x4097c8,{'recursive':!![]});}catch{}const {exec:_0x9b7a1}=await Promise[_0x5a435e(0x165)]()[_0x5a435e(0x18c)](()=>__importStar(require('child_process'))),_0x423a39=process[_0x5a435e(0x11e)]===_0x5a435e(0x176)?_0x5a435e(0x15b)+_0x4097c8+'\x22':process[_0x5a435e(0x11e)]===_0x5a435e(0x121)?_0x5a435e(0x184)+_0x4097c8+'\x22':_0x5a435e(0x160)+_0x4097c8+'\x22';return _0x9b7a1(_0x423a39),_0x3fcd64[_0x5a435e(0x13b)]({'success':!![],'openedPath':_0x4097c8});}_0x3fcd64[_0x5a435e(0x122)](0x194)[_0x5a435e(0x13b)]({'error':_0x5a435e(0x145)});}),app[a0_0x55833c(0x11d)]('/api/config/toggle',async(_0x1b18e4,_0x379560)=>{const _0x1801f0=a0_0x55833c,{saveConfig:_0x3a4fa5}=await Promise[_0x1801f0(0x165)]()[_0x1801f0(0x18c)](()=>__importStar(require(_0x1801f0(0x13c)))),{key:_0x28f285,value:_0x26a8a2}=_0x1b18e4[_0x1801f0(0x127)]||{};if(_0x28f285){const _0x5c9d4c=_0x3a4fa5({'conversation_toggles':{[_0x28f285]:_0x26a8a2}});return invalidateConfigCache(),_0x379560[_0x1801f0(0x13b)](_0x5c9d4c);}_0x379560[_0x1801f0(0x122)](0x190)['json']({'error':'Missing\x20key'});}),app[a0_0x55833c(0x11d)]('/api/config/custom-path',async(_0x3366e3,_0x8c6490)=>{const _0x51f374=a0_0x55833c,{saveConfig:_0x3c78ca}=await Promise['resolve']()['then'](()=>__importStar(require(_0x51f374(0x13c)))),{agentKey:_0x2cd729,path:_0x4821f5}=_0x3366e3[_0x51f374(0x127)]||{};if(_0x2cd729){const _0x34e65e=_0x3c78ca({'custom_storage_paths':{[_0x2cd729]:_0x4821f5||null}});return invalidateConfigCache(),_0x8c6490[_0x51f374(0x13b)](_0x34e65e);}_0x8c6490[_0x51f374(0x122)](0x190)[_0x51f374(0x13b)]({'error':_0x51f374(0x137)});});function startDashboard(_0x1f9060=0xfa0){const _0x18a1cd=a0_0x55833c;let _0x4e1458=_0x1f9060;const _0x90cefb=process[_0x18a1cd(0x119)][_0x18a1cd(0x159)](_0x18a1cd(0x128))||process.env.TRIMPROMPT_HEADLESS==='1',_0x377093=app[_0x18a1cd(0x187)](_0x4e1458,()=>{const _0x3e5472=_0x18a1cd,_0x3980ec=_0x3e5472(0x180)+_0x4e1458;!_0x90cefb&&(console[_0x3e5472(0x12a)](_0x3e5472(0x17b)+_0x3980ec),console[_0x3e5472(0x12a)]('Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.'));try{const {spawn:_0x57afcd}=require(_0x3e5472(0x168)),_0x5813cd=_0x57afcd(process[_0x3e5472(0x153)],[path['join'](__dirname,_0x3e5472(0x146)),_0x3e5472(0x14d),'start'],{'stdio':_0x3e5472(0x164),'windowsHide':!![]}),_0x49777e=()=>{const _0x5cb490=_0x3e5472;try{_0x5813cd[_0x5cb490(0x129)]();}catch{}};process['on'](_0x3e5472(0x15e),_0x49777e),process['on']('SIGINT',()=>{const _0x1becd3=_0x3e5472;_0x49777e(),process[_0x1becd3(0x15e)](0x0);}),process['on'](_0x3e5472(0x190),()=>{const _0x29477c=_0x3e5472;_0x49777e(),process[_0x29477c(0x15e)](0x0);});}catch{}!_0x90cefb&&process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1['default'])(_0x3980ec)[_0x3e5472(0x14b)](()=>{});});_0x377093['on'](_0x18a1cd(0x142),_0x137596=>{const _0x57495d=_0x18a1cd;_0x137596[_0x57495d(0x12d)]===_0x57495d(0x186)?startDashboard(_0x4e1458+0x1):console['error'](_0x57495d(0x163)+_0x137596['message']);});}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a0_0x22124f=a0_0x3041;(function(_0x351de1,_0x2da0ba){var _0x425a47=a0_0x3041,_0x4919f1=_0x351de1();while(!![]){try{var _0x131ae0=-parseInt(_0x425a47(0x199))/0x1+parseInt(_0x425a47(0x1ab))/0x2*(-parseInt(_0x425a47(0x1ae))/0x3)+-parseInt(_0x425a47(0x1b3))/0x4*(-parseInt(_0x425a47(0x1a2))/0x5)+parseInt(_0x425a47(0x1b2))/0x6+parseInt(_0x425a47(0x1b9))/0x7*(parseInt(_0x425a47(0x1ad))/0x8)+parseInt(_0x425a47(0x1aa))/0x9+parseInt(_0x425a47(0x198))/0xa*(-parseInt(_0x425a47(0x1bb))/0xb);if(_0x131ae0===_0x2da0ba)break;else _0x4919f1['push'](_0x4919f1['shift']());}catch(_0x3854c7){_0x4919f1['push'](_0x4919f1['shift']());}}}(a0_0x296d,0x3672f));function a0_0x296d(){var _0x292466=['inherit','delimiter','executeCommand','prototype','814239guzotE','18GopcOe','__createBinding','632jVrjiV','109941ZHfefX','.trimprompt','homedir','pipe','985770AfZFVn','4ZVAkbL','__esModule','close','__importStar','call','filter','9149xEDtSK','default','24167QeghdV','shims','join','stderr','toLowerCase','length','data','child_process','toString','10ynhBGe','162863eHBcna','configurable','split','map','startsWith','getOwnPropertyDescriptor','defineProperty','writable','path','1799435GsJEyl','message','hasOwnProperty','\x22:\x20'];a0_0x296d=function(){return _0x292466;};return a0_0x296d();}function a0_0x3041(_0x462c05,_0x15451c){_0x462c05=_0x462c05-0x190;var _0x296d27=a0_0x296d();var _0x304172=_0x296d27[_0x462c05];return _0x304172;}var __createBinding=this&&this[a0_0x22124f(0x1ac)]||(Object['create']?function(_0x1cc297,_0x5f0545,_0x38a38b,_0x5dfa3b){var _0x4e5122=a0_0x22124f;if(_0x5dfa3b===undefined)_0x5dfa3b=_0x38a38b;var _0x2daf77=Object[_0x4e5122(0x19e)](_0x5f0545,_0x38a38b);(!_0x2daf77||('get'in _0x2daf77?!_0x5f0545[_0x4e5122(0x1b4)]:_0x2daf77[_0x4e5122(0x1a0)]||_0x2daf77[_0x4e5122(0x19a)]))&&(_0x2daf77={'enumerable':!![],'get':function(){return _0x5f0545[_0x38a38b];}}),Object[_0x4e5122(0x19f)](_0x1cc297,_0x5dfa3b,_0x2daf77);}:function(_0x2bdf24,_0x1d6bbc,_0x378609,_0x50445a){if(_0x50445a===undefined)_0x50445a=_0x378609;_0x2bdf24[_0x50445a]=_0x1d6bbc[_0x378609];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x1e043a,_0x2ef71b){var _0xaf3b1d=a0_0x22124f;Object[_0xaf3b1d(0x19f)](_0x1e043a,_0xaf3b1d(0x1ba),{'enumerable':!![],'value':_0x2ef71b});}:function(_0x57adfe,_0x55300c){var _0x34b62b=a0_0x22124f;_0x57adfe[_0x34b62b(0x1ba)]=_0x55300c;}),__importStar=this&&this[a0_0x22124f(0x1b6)]||(function(){var _0x38ba5b=function(_0x5486b3){return _0x38ba5b=Object['getOwnPropertyNames']||function(_0xf4f40a){var _0x259460=a0_0x3041,_0x266386=[];for(var _0x326dda in _0xf4f40a)if(Object[_0x259460(0x1a9)][_0x259460(0x1a4)][_0x259460(0x1b7)](_0xf4f40a,_0x326dda))_0x266386[_0x266386[_0x259460(0x194)]]=_0x326dda;return _0x266386;},_0x38ba5b(_0x5486b3);};return function(_0x411c0){var _0x224945=a0_0x3041;if(_0x411c0&&_0x411c0[_0x224945(0x1b4)])return _0x411c0;var _0x303dba={};if(_0x411c0!=null){for(var _0x35dc1c=_0x38ba5b(_0x411c0),_0x55ae7b=0x0;_0x55ae7b<_0x35dc1c[_0x224945(0x194)];_0x55ae7b++)if(_0x35dc1c[_0x55ae7b]!=='default')__createBinding(_0x303dba,_0x411c0,_0x35dc1c[_0x55ae7b]);}return __setModuleDefault(_0x303dba,_0x411c0),_0x303dba;};}());Object[a0_0x22124f(0x19f)](exports,a0_0x22124f(0x1b4),{'value':!![]}),exports[a0_0x22124f(0x1a8)]=executeCommand;const child_process_1=require(a0_0x22124f(0x196)),path=__importStar(require(a0_0x22124f(0x1a1))),os=__importStar(require('os'));function executeCommand(_0x2ef379,_0x117eed){return new Promise(_0x1577d1=>{var _0x2388c7=a0_0x3041;const _0x4d8086=path[_0x2388c7(0x191)](os[_0x2388c7(0x1b0)](),_0x2388c7(0x1af),_0x2388c7(0x190)),_0x3a7268=(process.env.PATH||'')[_0x2388c7(0x19b)](path[_0x2388c7(0x1a7)])[_0x2388c7(0x1b8)](_0x5c4f6b=>_0x5c4f6b['trim']()[_0x2388c7(0x193)]()!==_0x4d8086['toLowerCase']())[_0x2388c7(0x191)](path[_0x2388c7(0x1a7)]),_0x18f9cb={...process.env,'PATH':_0x3a7268,'TRIMPROMPT_DISABLED':'1'},_0xea610c=_0x117eed[_0x2388c7(0x19c)](_0x927991=>_0x927991['includes']('\x20')&&!_0x927991[_0x2388c7(0x19d)]('\x22')?'\x22'+_0x927991+'\x22':_0x927991),_0x42de87=[_0x2ef379,..._0xea610c][_0x2388c7(0x191)]('\x20'),_0x3b160b=(0x0,child_process_1['spawn'])(_0x42de87,[],{'stdio':[_0x2388c7(0x1a6),_0x2388c7(0x1b1),_0x2388c7(0x1b1)],'shell':!![],'env':_0x18f9cb});let _0x191cfd='',_0x4eb732='';_0x3b160b['stdout']?.['on'](_0x2388c7(0x195),_0x2569ff=>{var _0x581493=_0x2388c7;_0x191cfd+=_0x2569ff[_0x581493(0x197)]();}),_0x3b160b[_0x2388c7(0x192)]?.['on'](_0x2388c7(0x195),_0xfd6b30=>{_0x4eb732+=_0xfd6b30['toString']();}),_0x3b160b['on']('error',_0x474d91=>{var _0x3d17ac=_0x2388c7;_0x1577d1({'exitCode':0x1,'stdout':'','stderr':'Failed\x20to\x20spawn\x20command\x20\x22'+_0x2ef379+_0x3d17ac(0x1a5)+_0x474d91[_0x3d17ac(0x1a3)]});}),_0x3b160b['on'](_0x2388c7(0x1b5),_0xb56627=>{_0x1577d1({'exitCode':_0xb56627??0x0,'stdout':_0x191cfd,'stderr':_0x4eb732});});});}
|
package/file-watcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x80aab9=a0_0x44dc;(function(_0x1af2ed,_0x3206e7){const _0x256e6c=a0_0x44dc,_0xf0bc71=_0x1af2ed();while(!![]){try{const _0xa86a2c=parseInt(_0x256e6c(0x175))/0x1+parseInt(_0x256e6c(0x1ba))/0x2+-parseInt(_0x256e6c(0x18c))/0x3*(-parseInt(_0x256e6c(0x1a8))/0x4)+parseInt(_0x256e6c(0x12e))/0x5*(-parseInt(_0x256e6c(0x141))/0x6)+-parseInt(_0x256e6c(0x137))/0x7+-parseInt(_0x256e6c(0x119))/0x8*(parseInt(_0x256e6c(0x13d))/0x9)+parseInt(_0x256e6c(0x1b6))/0xa*(parseInt(_0x256e6c(0x156))/0xb);if(_0xa86a2c===_0x3206e7)break;else _0xf0bc71['push'](_0xf0bc71['shift']());}catch(_0x85aaeb){_0xf0bc71['push'](_0xf0bc71['shift']());}}}(a0_0x2cff,0xb3bfd));var __createBinding=this&&this[a0_0x80aab9(0x16d)]||(Object[a0_0x80aab9(0x1ab)]?function(_0x3ccf5e,_0x2e8f70,_0x40d461,_0x34ea79){const _0xe100be=a0_0x80aab9;if(_0x34ea79===undefined)_0x34ea79=_0x40d461;var _0x15ee9=Object[_0xe100be(0x10b)](_0x2e8f70,_0x40d461);(!_0x15ee9||(_0xe100be(0x1a7)in _0x15ee9?!_0x2e8f70[_0xe100be(0x158)]:_0x15ee9[_0xe100be(0x182)]||_0x15ee9[_0xe100be(0x152)]))&&(_0x15ee9={'enumerable':!![],'get':function(){return _0x2e8f70[_0x40d461];}}),Object[_0xe100be(0x1a6)](_0x3ccf5e,_0x34ea79,_0x15ee9);}:function(_0x462716,_0x2ee5c6,_0x143afe,_0x3d66f3){if(_0x3d66f3===undefined)_0x3d66f3=_0x143afe;_0x462716[_0x3d66f3]=_0x2ee5c6[_0x143afe];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x80aab9(0x1ab)]?function(_0x45a10c,_0x55abee){const _0x31e360=a0_0x80aab9;Object[_0x31e360(0x1a6)](_0x45a10c,_0x31e360(0x19d),{'enumerable':!![],'value':_0x55abee});}:function(_0x549b2d,_0x18a059){const _0x2978bf=a0_0x80aab9;_0x549b2d[_0x2978bf(0x19d)]=_0x18a059;}),__importStar=this&&this[a0_0x80aab9(0x16e)]||(function(){var _0x5e5853=function(_0x2ee143){const _0x4840b5=a0_0x44dc;return _0x5e5853=Object[_0x4840b5(0x18e)]||function(_0x2acbd4){const _0x4f7e14=_0x4840b5;var _0x195bc6=[];for(var _0xd3efc4 in _0x2acbd4)if(Object['prototype'][_0x4f7e14(0x186)][_0x4f7e14(0x1b0)](_0x2acbd4,_0xd3efc4))_0x195bc6[_0x195bc6['length']]=_0xd3efc4;return _0x195bc6;},_0x5e5853(_0x2ee143);};return function(_0x555ee2){const _0x741fda=a0_0x44dc;if(_0x555ee2&&_0x555ee2[_0x741fda(0x158)])return _0x555ee2;var _0x438618={};if(_0x555ee2!=null){for(var _0x279cdb=_0x5e5853(_0x555ee2),_0x206105=0x0;_0x206105<_0x279cdb[_0x741fda(0x125)];_0x206105++)if(_0x279cdb[_0x206105]!==_0x741fda(0x19d))__createBinding(_0x438618,_0x555ee2,_0x279cdb[_0x206105]);}return __setModuleDefault(_0x438618,_0x555ee2),_0x438618;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x80aab9(0x128)]=loadConfig,exports['saveConfig']=saveConfig,exports['getAgentStoragePaths']=getAgentStoragePaths,exports[a0_0x80aab9(0x134)]=getLatestSessionFile,exports[a0_0x80aab9(0x124)]=loadSessionsState,exports[a0_0x80aab9(0x121)]=saveSessionStateItem,exports['processSessionFile']=processSessionFile,exports['compactSessionCopy']=compactSessionCopy,exports[a0_0x80aab9(0x148)]=compactLiveSession,exports[a0_0x80aab9(0x116)]=installWindowsStartupService,exports[a0_0x80aab9(0x145)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x80aab9(0x1ad))),os=__importStar(require('os')),cache_manager_1=require(a0_0x80aab9(0x136)),tracker_1=require(a0_0x80aab9(0x13b)),baseDir=path[a0_0x80aab9(0x115)](os[a0_0x80aab9(0x159)](),a0_0x80aab9(0x126)),configPath=path['join'](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 a0_0x44dc(_0xafd0a,_0x12f0ab){_0xafd0a=_0xafd0a-0x10a;const _0x2cffb7=a0_0x2cff();let _0x44dc24=_0x2cffb7[_0xafd0a];return _0x44dc24;}function loadConfig(){const _0x189dfc=a0_0x80aab9;try{if(!fs[_0x189dfc(0x1a5)](baseDir))fs[_0x189dfc(0x167)](baseDir,{'recursive':!![]});if(fs[_0x189dfc(0x1a5)](configPath)){const _0x35233f=JSON['parse'](fs[_0x189dfc(0x111)](configPath,_0x189dfc(0x10a)));return{...DEFAULT_CONFIG,..._0x35233f,'conversation_toggles':{...DEFAULT_CONFIG['conversation_toggles'],..._0x35233f['conversation_toggles']||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0x189dfc(0x112)],..._0x35233f[_0x189dfc(0x112)]||{}}};}}catch{}return DEFAULT_CONFIG;}function a0_0x2cff(){const _0x3b21b7=['watch','build','saveSessionStateItem','.webp','.claude','loadSessionsState','length','.trimprompt','live-conv','loadConfig','./proxy-conv','gemini','\x27\x20—\x20only\x20JSON/JSONL\x20sessions\x20can\x20be\x20compacted\x20(binary\x20.pb/.db\x20stores\x20are\x20not\x20supported)','saved','stringify','5137355nlSZZV','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','compaction\x20failed','platform','openclaw','extname','getLatestSessionFile','type','./cache-manager','2302559FerPpX','compact_copy','mtimeMs','chunk_id','./tracker','.json','441gwfhYc','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','.json1','hookSavedTokens','6nvyRgE','readdirSync','win32','parse','startWatcherDaemon','.db','fullPath','compactLiveSession','set','Session\x20file\x20not\x20found','Gemini','find','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','Cursor','Summary:\x20Content\x20offloaded\x20(','.pb','messages','configurable','role','sessions','includes','121PqXCMe','.openclaw','__esModule','homedir','media__','Library','prompt_turn','.gemini','tracker','Roaming','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','startsWith','File\x20not\x20found','Summary:\x20Tool\x20result\x20offloaded\x20(','name','copilot','compact:','mkdirSync','.opencode','workspaceStorage','renameSync','.compact','conv:','__createBinding','__importStar','ceil','Local','compressed_tokens','has','filter','out','1226099lvgJwP','node_modules','User','split','officialCompactSaved','claude','dirname','sessions_state.json','repeat','TrimPrompt\x20Cache\x20Engine','size','.config','push','writable','conv_','cache','writeFileSync','hasOwnProperty','github-copilot-cli','statSync','.shm','max','message','1617VTOFoG','context','getOwnPropertyNames','toISOString','.codex','.jpeg','autoCompactSaved','none','cwd','byteLength','matchAll','Start\x20Menu','raw_tokens','env','.tmp','cortex','.git','default','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','.aider.chat.history.md','trim','Windows','modified','saveChunk','toLowerCase','existsSync','defineProperty','get','4252FLIEME','\x20tokens).','Application\x20Support','create','isFile','path','isArray','conversation_toggles','call','.venv','Unsupported\x20format\x20\x27','cli.js','isDirectory','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','636770OVVxvn','string','./hooks/claude-hook','replace','1053706Jpbhhg','content','lineCount','.cortex','codex','.lock','logExecution','endsWith','tokens','Programs','assign','.jsonl','darwin','utf8','getOwnPropertyDescriptor','AppData','sideCacheSaved','antigravity','.png','.gif','readFileSync','custom_storage_paths','text','round','join','installWindowsStartupService','.wal','cursor','152440RxKWJg','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','Startup','.jpg','basename','opencode'];a0_0x2cff=function(){return _0x3b21b7;};return a0_0x2cff();}function saveConfig(_0xbf8659){const _0x567657=a0_0x80aab9,_0x50d7a2=loadConfig(),_0x1fcbf6={..._0x50d7a2,..._0xbf8659,'conversation_toggles':{..._0x50d7a2[_0x567657(0x1af)],..._0xbf8659[_0x567657(0x1af)]||{}},'custom_storage_paths':{..._0x50d7a2['custom_storage_paths'],..._0xbf8659['custom_storage_paths']||{}}};try{if(!fs[_0x567657(0x1a5)](baseDir))fs[_0x567657(0x167)](baseDir,{'recursive':!![]});fs[_0x567657(0x185)](configPath,JSON['stringify'](_0x1fcbf6,null,0x2),_0x567657(0x10a));}catch{}return _0x1fcbf6;}function getAgentStoragePaths(_0x1929e9){const _0x439aeb=a0_0x80aab9,_0x1c83b8=loadConfig(),_0x389fa3=_0x1c83b8[_0x439aeb(0x112)][_0x1929e9];if(_0x389fa3&&fs[_0x439aeb(0x1a5)](_0x389fa3))return[_0x389fa3];const _0x1bc7ff=os[_0x439aeb(0x159)](),_0x29f110=process[_0x439aeb(0x131)]===_0x439aeb(0x143),_0xc330e9=process[_0x439aeb(0x131)]===_0x439aeb(0x1c6);switch(_0x1929e9){case _0x439aeb(0x17a):return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x123),'projects'),path['join'](_0x1bc7ff,'.claude','history')];case _0x439aeb(0x1be):return[path['join'](_0x1bc7ff,_0x439aeb(0x190),_0x439aeb(0x154)),path['join'](_0x1bc7ff,_0x439aeb(0x10c),_0x439aeb(0x15f),'Codex')];case _0x439aeb(0x12a):case'antigravity':return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x15d),_0x439aeb(0x10e)),path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x15d)),path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x10c),_0x439aeb(0x15f),_0x439aeb(0x14b)),path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x180),_0x439aeb(0x12a))];case _0x439aeb(0x118):if(_0x29f110)return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x10c),_0x439aeb(0x15f),_0x439aeb(0x14e),_0x439aeb(0x177),_0x439aeb(0x169))];if(_0xc330e9)return[path['join'](_0x1bc7ff,_0x439aeb(0x15b),_0x439aeb(0x1aa),'Cursor','User',_0x439aeb(0x169))];return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x180),_0x439aeb(0x14e),'User',_0x439aeb(0x169))];case'aider':return[process[_0x439aeb(0x194)](),path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x19f))];case _0x439aeb(0x165):if(_0x29f110)return[path[_0x439aeb(0x115)](_0x1bc7ff,'AppData',_0x439aeb(0x170),'github-copilot-cli')];return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x180),_0x439aeb(0x187))];case _0x439aeb(0x132):return[path[_0x439aeb(0x115)](_0x1bc7ff,_0x439aeb(0x157),'storage'),path[_0x439aeb(0x115)](process[_0x439aeb(0x194)](),_0x439aeb(0x157),_0x439aeb(0x18d))];case'opencode':return[path['join'](_0x1bc7ff,_0x439aeb(0x168),_0x439aeb(0x154))];case _0x439aeb(0x19b):return[path['join'](_0x1bc7ff,_0x439aeb(0x1bd),_0x439aeb(0x184))];default:return[];}}function getLatestSessionFile(_0x39eba4){const _0x5081af=a0_0x80aab9,_0x3b872a=getAgentStoragePaths(_0x39eba4);let _0xc62748=null,_0x49bf07=0x0,_0x45fd72=null,_0x40a76b=null;for(const _0x423ac7 of _0x3b872a){if(fs[_0x5081af(0x1a5)](_0x423ac7)){if(!_0x40a76b)_0x40a76b=_0x423ac7;const _0x55d7a3=(_0x5e96d5,_0x5e3c20=0x0)=>{const _0x3984d8=_0x5081af;if(_0x5e3c20>0x6)return;try{const _0xff9269=fs[_0x3984d8(0x142)](_0x5e96d5,{'withFileTypes':!![]});for(const _0x5cc70d of _0xff9269){const _0x3996da=path['join'](_0x5e96d5,_0x5cc70d[_0x3984d8(0x164)]);if(_0x5cc70d[_0x3984d8(0x1b4)]()){const _0x6ba944=_0x5cc70d['name'][_0x3984d8(0x1a4)]();if(_0x6ba944===_0x3984d8(0x176)||_0x6ba944===_0x3984d8(0x19c)||_0x6ba944===_0x3984d8(0x1b1)||_0x6ba944===_0x3984d8(0x199)||_0x6ba944==='venv'||_0x6ba944==='__pycache__'||_0x6ba944==='.next'||_0x6ba944==='dist'||_0x6ba944===_0x3984d8(0x120)||_0x6ba944===_0x3984d8(0x174)||_0x6ba944==='.agents')continue;_0x55d7a3(_0x3996da,_0x5e3c20+0x1);}else{if(_0x5cc70d[_0x3984d8(0x1ac)]()&&!_0x5cc70d[_0x3984d8(0x164)][_0x3984d8(0x161)]('.')){const _0x55ecc3=_0x5cc70d[_0x3984d8(0x164)][_0x3984d8(0x1a4)]();if(_0x55ecc3[_0x3984d8(0x155)](_0x3984d8(0x16b))||_0x55ecc3['endsWith'](_0x3984d8(0x146))||_0x55ecc3[_0x3984d8(0x1c1)]('.vscdb')||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x10f))||_0x55ecc3['endsWith'](_0x3984d8(0x11c))||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x191))||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x110))||_0x55ecc3['endsWith'](_0x3984d8(0x122))||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x150))||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x117))||_0x55ecc3[_0x3984d8(0x1c1)](_0x3984d8(0x189))||_0x55ecc3[_0x3984d8(0x1c1)]('.tmp')||_0x55ecc3['endsWith'](_0x3984d8(0x1bf))||_0x55ecc3[_0x3984d8(0x1c1)]('.dat')||_0x55ecc3[_0x3984d8(0x161)](_0x3984d8(0x15a))||_0x55ecc3['startsWith']('image_'))continue;const _0x2de1ec=fs[_0x3984d8(0x188)](_0x3996da);_0x2de1ec[_0x3984d8(0x139)]>_0x49bf07&&(_0x49bf07=_0x2de1ec[_0x3984d8(0x139)],_0xc62748=_0x5cc70d['name'],_0x45fd72=_0x3996da,_0x40a76b=_0x423ac7);}}}}catch{}};_0x55d7a3(_0x423ac7);}}return{'fileName':_0xc62748,'lastModified':_0x49bf07>0x0?new Date(_0x49bf07)[_0x5081af(0x18f)]():null,'fullPath':_0x45fd72,'dirPath':_0x40a76b};}const debounceTimers=new Map(),lastLoggedTimes=new Map(),OFFLOAD_THRESHOLD_CHARS=0x7d0;function compressMessageContent(_0x32b5cd,_0x63d13c,_0x192d22){const _0x4d9808=a0_0x80aab9;let _0x3d86f6=![],_0x4bf7d9=0x0;if(!_0x32b5cd)return{'modified':_0x3d86f6,'savedTokens':_0x4bf7d9};const _0x58a640=_0x24a567=>_0x24a567[_0x4d9808(0x1b9)](/\r\n/g,'\x0a')[_0x4d9808(0x1b9)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x32b5cd[_0x4d9808(0x1bb)]===_0x4d9808(0x1b7)){let _0x5eec72=_0x32b5cd[_0x4d9808(0x1bb)],_0x5342ea=_0x58a640(_0x5eec72);_0x5342ea[_0x4d9808(0x125)]<_0x5eec72['length']&&(_0x32b5cd[_0x4d9808(0x1bb)]=_0x5342ea,_0x3d86f6=!![],_0x4bf7d9+=Math[_0x4d9808(0x16f)]((_0x5eec72['length']-_0x5342ea[_0x4d9808(0x125)])/0x4));if(_0x32b5cd[_0x4d9808(0x1bb)][_0x4d9808(0x125)]>OFFLOAD_THRESHOLD_CHARS&&!_0x32b5cd[_0x4d9808(0x1bb)][_0x4d9808(0x155)]('TrimPrompt\x20Cache\x20Engine')){const _0xce5328=_0x4d9808(0x14f)+Math['ceil'](_0x32b5cd['content'][_0x4d9808(0x125)]/0x4)+_0x4d9808(0x1a9),_0x32b49d=(0x0,cache_manager_1[_0x4d9808(0x1a3)])(_0x63d13c,_0x192d22,_0x32b5cd[_0x4d9808(0x1bb)],_0xce5328);_0x32b5cd[_0x4d9808(0x1bb)]=_0x4d9808(0x1b5)+_0x32b49d[_0x4d9808(0x198)]+_0x4d9808(0x160)+_0x32b49d[_0x4d9808(0x13a)]+_0x4d9808(0x19e)+_0x32b49d[_0x4d9808(0x13a)]+'`\x0a',_0x3d86f6=!![],_0x4bf7d9+=Math[_0x4d9808(0x18a)](0x0,_0x32b49d[_0x4d9808(0x198)]-_0x32b49d['compressed_tokens']);}}else{if(Array[_0x4d9808(0x1ae)](_0x32b5cd[_0x4d9808(0x1bb)]))for(const _0x309ae9 of _0x32b5cd[_0x4d9808(0x1bb)]){if(_0x309ae9&&typeof _0x309ae9==='object'){if(typeof _0x309ae9[_0x4d9808(0x113)]==='string'){let _0x28fb4f=_0x309ae9[_0x4d9808(0x113)],_0x5e7b07=_0x58a640(_0x28fb4f);_0x5e7b07[_0x4d9808(0x125)]<_0x28fb4f[_0x4d9808(0x125)]&&(_0x309ae9[_0x4d9808(0x113)]=_0x5e7b07,_0x3d86f6=!![],_0x4bf7d9+=Math['ceil']((_0x28fb4f['length']-_0x5e7b07[_0x4d9808(0x125)])/0x4));if(_0x309ae9[_0x4d9808(0x113)]['length']>OFFLOAD_THRESHOLD_CHARS&&!_0x309ae9['text']['includes'](_0x4d9808(0x17e))){const _0x53753a='Summary:\x20Text\x20block\x20offloaded\x20('+Math[_0x4d9808(0x16f)](_0x309ae9[_0x4d9808(0x113)]['length']/0x4)+'\x20tokens).',_0x2f6234=(0x0,cache_manager_1['saveChunk'])(_0x63d13c,_0x192d22,_0x309ae9[_0x4d9808(0x113)],_0x53753a);_0x309ae9[_0x4d9808(0x113)]=_0x4d9808(0x12f)+_0x2f6234[_0x4d9808(0x13a)]+'`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20'+_0x2f6234[_0x4d9808(0x13a)]+'`\x0a',_0x3d86f6=!![],_0x4bf7d9+=Math[_0x4d9808(0x18a)](0x0,_0x2f6234[_0x4d9808(0x198)]-_0x2f6234[_0x4d9808(0x171)]);}}else{if(typeof _0x309ae9[_0x4d9808(0x1bb)]===_0x4d9808(0x1b7)){let _0x1a4f28=_0x309ae9[_0x4d9808(0x1bb)],_0x1e44e6=_0x58a640(_0x1a4f28);_0x1e44e6[_0x4d9808(0x125)]<_0x1a4f28[_0x4d9808(0x125)]&&(_0x309ae9[_0x4d9808(0x1bb)]=_0x1e44e6,_0x3d86f6=!![],_0x4bf7d9+=Math[_0x4d9808(0x16f)]((_0x1a4f28[_0x4d9808(0x125)]-_0x1e44e6[_0x4d9808(0x125)])/0x4));if(_0x309ae9[_0x4d9808(0x1bb)][_0x4d9808(0x125)]>OFFLOAD_THRESHOLD_CHARS&&!_0x309ae9[_0x4d9808(0x1bb)][_0x4d9808(0x155)]('TrimPrompt\x20Cache\x20Engine')){const _0x185656=_0x4d9808(0x163)+Math[_0x4d9808(0x16f)](_0x309ae9[_0x4d9808(0x1bb)][_0x4d9808(0x125)]/0x4)+_0x4d9808(0x1a9),_0x4d10f0=(0x0,cache_manager_1[_0x4d9808(0x1a3)])(_0x63d13c,_0x192d22,_0x309ae9[_0x4d9808(0x1bb)],_0x185656);_0x309ae9[_0x4d9808(0x1bb)]=_0x4d9808(0x12f)+_0x4d10f0[_0x4d9808(0x13a)]+_0x4d9808(0x14d)+_0x4d10f0[_0x4d9808(0x13a)]+'`\x0a',_0x3d86f6=!![],_0x4bf7d9+=Math[_0x4d9808(0x18a)](0x0,_0x4d10f0[_0x4d9808(0x198)]-_0x4d10f0[_0x4d9808(0x171)]);}}}}}}return{'modified':_0x3d86f6,'savedTokens':_0x4bf7d9};}const sessionsStatePath=path[a0_0x80aab9(0x115)](baseDir,a0_0x80aab9(0x17c));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x482867=a0_0x80aab9;try{if(fs[_0x482867(0x1a5)](sessionsStatePath)){const _0x4d2bf3=JSON[_0x482867(0x144)](fs[_0x482867(0x111)](sessionsStatePath,_0x482867(0x10a)));if(_0x4d2bf3&&typeof _0x4d2bf3==='object')return sessionsStateMemoryCache=_0x4d2bf3,_0x4d2bf3;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x1c1be3,_0x1653c1,_0x4ef2a6,_0x2cfcd2=0x0,_0xa762f3=0x0,_0x3cfae9=0x0){const _0x19b3bd=a0_0x80aab9;try{const _0x5e8b3e=loadSessionsState(),_0x2062e4=_0x5e8b3e[_0x1c1be3]||{},_0x562e3c=_0xa762f3||_0x2062e4[_0x19b3bd(0x192)]||0x0,_0x46750c=_0x3cfae9||_0x2062e4[_0x19b3bd(0x140)]||0x0,_0x2eb1a2=_0x4ef2a6!==undefined?_0x4ef2a6:_0x2062e4[_0x19b3bd(0x179)]||0x0;_0x5e8b3e[_0x1c1be3]={'lineCount':_0x1653c1||_0x2062e4[_0x19b3bd(0x1bc)]||0x1,'activeSavedTokens':_0x2eb1a2+_0x562e3c+_0x46750c,'sideCacheSaved':_0x2cfcd2||_0x2062e4['sideCacheSaved']||0x0,'officialCompactSaved':_0x2eb1a2,'autoCompactSaved':_0x562e3c,'hookSavedTokens':_0x46750c},sessionsStateMemoryCache=_0x5e8b3e;if(!fs[_0x19b3bd(0x1a5)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});const _0x1dedcf=sessionsStatePath+_0x19b3bd(0x19a);fs[_0x19b3bd(0x185)](_0x1dedcf,JSON[_0x19b3bd(0x12d)](_0x5e8b3e,null,0x2),_0x19b3bd(0x10a)),fs[_0x19b3bd(0x16a)](_0x1dedcf,sessionsStatePath);}catch{}}function processSessionFile(_0x5b8a82,_0x106d12){const _0x59167e=a0_0x80aab9;try{if(!fs[_0x59167e(0x1a5)](_0x5b8a82))return;const _0x3e59ea=fs['statSync'](_0x5b8a82);if(_0x3e59ea[_0x59167e(0x1b4)]()||_0x3e59ea[_0x59167e(0x17f)]===0x0)return;const _0x446e75=loadConfig(),_0x4acda6=_0x59167e(0x183)+_0x106d12;if(_0x446e75[_0x59167e(0x1af)][_0x4acda6]===![])return;const _0xa7eb91=fs[_0x59167e(0x111)](_0x5b8a82,_0x59167e(0x10a)),_0xf5739e=path[_0x59167e(0x133)](_0x5b8a82)[_0x59167e(0x1a4)]();let _0x354af7=0x1;if(_0xf5739e==='.jsonl'||_0xf5739e===_0x59167e(0x13f))_0x354af7=_0xa7eb91[_0x59167e(0x178)]('\x0a')[_0x59167e(0x173)](Boolean)['length'];else{if(_0xf5739e===_0x59167e(0x13c))try{const _0xc56ab7=JSON[_0x59167e(0x144)](_0xa7eb91),_0x4cd274=Array[_0x59167e(0x1ae)](_0xc56ab7[_0x59167e(0x151)])?_0xc56ab7['messages']:Array[_0x59167e(0x1ae)](_0xc56ab7)?_0xc56ab7:null;if(_0x4cd274)_0x354af7=_0x4cd274[_0x59167e(0x125)];}catch{}}let _0x4cd60c=0x0;if((_0xf5739e===_0x59167e(0x1c5)||_0xf5739e===_0x59167e(0x13f))&&_0xa7eb91[_0x59167e(0x155)](_0x59167e(0x12c))&&_0xa7eb91[_0x59167e(0x155)](_0x59167e(0x1c2))){const _0x224cc7=/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi;for(const _0x461378 of _0xa7eb91[_0x59167e(0x178)]('\x0a')){if(!_0x461378[_0x59167e(0x155)](_0x59167e(0x12c))||!_0x461378['includes'](_0x59167e(0x1c2)))continue;try{const _0x2976bc=JSON[_0x59167e(0x144)](_0x461378);if(_0x2976bc[_0x59167e(0x135)]!=='system')continue;const _0x552d75=typeof _0x2976bc[_0x59167e(0x1bb)]===_0x59167e(0x1b7)?_0x2976bc[_0x59167e(0x1bb)]:_0x2976bc[_0x59167e(0x18b)]&&typeof _0x2976bc['message'][_0x59167e(0x1bb)]===_0x59167e(0x1b7)?_0x2976bc[_0x59167e(0x18b)][_0x59167e(0x1bb)]:'';if(!_0x552d75)continue;for(const _0x5f39ee of _0x552d75[_0x59167e(0x196)](_0x224cc7)){let _0x1ef1df=parseFloat(_0x5f39ee[0x1]);if(_0x5f39ee[0x0]['toLowerCase']()['includes']('k'))_0x1ef1df=_0x1ef1df*0x3e8;_0x4cd60c+=Math['round'](_0x1ef1df);}}catch{}}}const _0x11acd6=loadSessionsState(),_0x118c2e=_0x11acd6[_0x5b8a82],_0x4e898d=_0x118c2e?_0x118c2e[_0x59167e(0x1bc)]:0x0,_0x377109=_0x118c2e?_0x118c2e['activeSavedTokens']||0x0:0x0;if(_0x4e898d>0x0&&_0x354af7>_0x4e898d&&_0x377109>0x0){const _0x2ad844=_0x59167e(0x16c)+_0x106d12;tracker_1['tracker']['logExecution'](_0x2ad844,'A'[_0x59167e(0x17d)](_0x377109*0x4),'',0x0,undefined,[_0x59167e(0x183)+_0x106d12,_0x59167e(0x127),_0x106d12,_0x59167e(0x15c)]);}const _0x44e7f0=_0x118c2e&&_0x118c2e[_0x59167e(0x179)]!==undefined?_0x118c2e[_0x59167e(0x179)]:0x0,_0x2f777e=Math[_0x59167e(0x18a)](_0x44e7f0,_0x4cd60c);saveSessionStateItem(_0x5b8a82,_0x354af7,_0x2f777e,0x0,0x0,0x0);}catch{}}function compactSessionCopy(_0x17af4c,_0x15cec3){const _0x49c5e3=a0_0x80aab9;try{if(!fs[_0x49c5e3(0x1a5)](_0x17af4c))return{'ok':![],'reason':_0x49c5e3(0x14a)};const _0x3b3589=path[_0x49c5e3(0x133)](_0x17af4c)[_0x49c5e3(0x1a4)]();if(_0x3b3589!==_0x49c5e3(0x13c)&&_0x3b3589!=='.jsonl'&&_0x3b3589!=='.json1')return{'ok':![],'reason':_0x49c5e3(0x1b2)+(_0x3b3589||_0x49c5e3(0x193))+_0x49c5e3(0x12b)};const _0x39830b=fs['readFileSync'](_0x17af4c,_0x49c5e3(0x10a)),_0x332fd5=Buffer[_0x49c5e3(0x195)](_0x39830b,'utf8'),_0x39f6ff=path[_0x49c5e3(0x11d)](_0x17af4c,_0x3b3589);let _0x4e0d0b=_0x39830b,_0x16ac63=![];if(_0x3b3589===_0x49c5e3(0x13c)){const _0x330b69=JSON['parse'](_0x39830b),_0x35f05d=Array[_0x49c5e3(0x1ae)](_0x330b69[_0x49c5e3(0x151)])?_0x330b69[_0x49c5e3(0x151)]:Array[_0x49c5e3(0x1ae)](_0x330b69)?_0x330b69:null;if(_0x35f05d){for(const _0x41cef8 of _0x35f05d){const _0x56ef71=compressMessageContent(_0x41cef8,_0x39f6ff,_0x15cec3);if(_0x56ef71[_0x49c5e3(0x1a2)])_0x16ac63=!![];}if(_0x16ac63)_0x4e0d0b=JSON[_0x49c5e3(0x12d)](_0x330b69,null,0x2);}}else{const _0x2a8920=_0x39830b[_0x49c5e3(0x178)]('\x0a'),_0x1466a7=[];for(let _0x3cbbbe of _0x2a8920){if(!_0x3cbbbe[_0x49c5e3(0x1a0)]()){_0x1466a7[_0x49c5e3(0x181)](_0x3cbbbe);continue;}try{const _0x3cf7f3=JSON[_0x49c5e3(0x144)](_0x3cbbbe),_0x424d8f=_0x3cf7f3['message']||_0x3cf7f3;if(_0x424d8f){const _0x140d65=compressMessageContent(_0x424d8f,_0x39f6ff,_0x15cec3);_0x140d65[_0x49c5e3(0x1a2)]&&(_0x16ac63=!![],_0x3cbbbe=JSON[_0x49c5e3(0x12d)](_0x3cf7f3));}}catch{}_0x1466a7[_0x49c5e3(0x181)](_0x3cbbbe);}if(_0x16ac63)_0x4e0d0b=_0x1466a7[_0x49c5e3(0x115)]('\x0a');}const _0xb7ac66=Buffer['byteLength'](_0x4e0d0b,_0x49c5e3(0x10a)),_0x1caa09=path['join'](path[_0x49c5e3(0x17b)](_0x17af4c),_0x39f6ff+'.compact'+_0x3b3589);fs[_0x49c5e3(0x185)](_0x1caa09,_0x4e0d0b,_0x49c5e3(0x10a));const _0x43fdeb=Math['ceil'](_0x332fd5/0x4),_0x33457e=Math['ceil'](_0xb7ac66/0x4),_0x1373e8=Math['max'](0x0,_0x43fdeb-_0x33457e),_0xc38271=_0x332fd5>0x0?Math[_0x49c5e3(0x114)]((0x1-_0xb7ac66/_0x332fd5)*0x3e8)/0xa:0x0;return _0x1373e8>0x0&&tracker_1[_0x49c5e3(0x15e)][_0x49c5e3(0x1c0)](_0x49c5e3(0x166)+_0x15cec3,_0x39830b,_0x4e0d0b,_0x1373e8,undefined,[_0x49c5e3(0x183)+_0x15cec3,_0x49c5e3(0x127),_0x15cec3,_0x49c5e3(0x138)]),{'ok':!![],'compactPath':_0x1caa09,'rawBytes':_0x332fd5,'compressedBytes':_0xb7ac66,'rawTokens':_0x43fdeb,'compressedTokens':_0x33457e,'savedTokens':_0x1373e8,'reductionPct':_0xc38271};}catch(_0xa4a702){return{'ok':![],'reason':_0xa4a702?.['message']||_0x49c5e3(0x130)};}}function compactLiveSession(_0x45fe3e,_0x29b8d5){const _0x516edb=a0_0x80aab9;try{if(!fs[_0x516edb(0x1a5)](_0x45fe3e))return{'ok':![],'savedTokens':0x0,'reason':_0x516edb(0x162)};const _0x27c35d=path['extname'](_0x45fe3e)[_0x516edb(0x1a4)]();if(_0x27c35d!==_0x516edb(0x13c)&&_0x27c35d!==_0x516edb(0x1c5)&&_0x27c35d!==_0x516edb(0x13f))return{'ok':![],'savedTokens':0x0,'reason':'Unsupported\x20extension'};const _0x2431e5=fs[_0x516edb(0x111)](_0x45fe3e,_0x516edb(0x10a)),_0x71e451=Buffer['byteLength'](_0x2431e5,_0x516edb(0x10a)),_0x5ec4dd=Math['ceil'](_0x71e451/0x4),_0x1ad43b=path[_0x516edb(0x11d)](_0x45fe3e,_0x27c35d);let _0x3c009f=_0x2431e5,_0x7a4c6f=![];if(_0x27c35d==='.json'){const _0x5473e2=JSON[_0x516edb(0x144)](_0x2431e5),_0x901b4b=Array['isArray'](_0x5473e2[_0x516edb(0x151)])?_0x5473e2[_0x516edb(0x151)]:Array[_0x516edb(0x1ae)](_0x5473e2)?_0x5473e2:null;if(_0x901b4b){for(const _0x2ebbeb of _0x901b4b){const _0x1f3db7=compressMessageContent(_0x2ebbeb,_0x1ad43b,_0x29b8d5);if(_0x1f3db7[_0x516edb(0x1a2)])_0x7a4c6f=!![];}const {compressConversation:_0x50b182}=require(_0x516edb(0x129)),_0x33b3b6=_0x50b182(_0x901b4b,0x9c40);_0x33b3b6['savedTokens']>0x0&&(_0x7a4c6f=!![],Array[_0x516edb(0x1ae)](_0x5473e2[_0x516edb(0x151)])?_0x5473e2[_0x516edb(0x151)]=_0x33b3b6['messages']:_0x3c009f=JSON[_0x516edb(0x12d)](_0x33b3b6[_0x516edb(0x151)],null,0x2)),_0x7a4c6f&&!Array['isArray'](_0x5473e2)&&(_0x3c009f=JSON[_0x516edb(0x12d)](_0x5473e2,null,0x2));}}else{const _0x389516=_0x2431e5['split']('\x0a'),_0x44863b=[],_0x3a659e=[];for(const _0x4ebc20 of _0x389516){if(!_0x4ebc20[_0x516edb(0x1a0)]())continue;try{const _0x37dfb1=JSON[_0x516edb(0x144)](_0x4ebc20);_0x44863b['push'](_0x37dfb1);const _0x5e1df9=_0x37dfb1['message']||_0x37dfb1;_0x5e1df9&&typeof _0x5e1df9['role']==='string'&&_0x3a659e[_0x516edb(0x181)](_0x5e1df9);}catch{}}for(const _0xa7aae1 of _0x3a659e){const _0xe9bcbc=compressMessageContent(_0xa7aae1,_0x1ad43b,_0x29b8d5);if(_0xe9bcbc[_0x516edb(0x1a2)])_0x7a4c6f=!![];}const {compressConversation:_0x10419c}=require('./proxy-conv'),_0x1ff081=_0x10419c(_0x3a659e,0x9c40);if(_0x1ff081['savedTokens']>0x0||_0x7a4c6f){const _0x113efe=[];for(const _0x4aa323 of _0x44863b){const _0x1abc55=_0x4aa323[_0x516edb(0x18b)]||_0x4aa323;if(_0x1abc55&&typeof _0x1abc55[_0x516edb(0x153)]===_0x516edb(0x1b7)){const _0x33b821=_0x1ff081[_0x516edb(0x151)][_0x516edb(0x14c)](_0x43df88=>_0x43df88===_0x1abc55);_0x33b821?(_0x4aa323[_0x516edb(0x18b)]?_0x4aa323['message']=_0x33b821:Object[_0x516edb(0x1c4)](_0x4aa323,_0x33b821),_0x113efe['push'](JSON[_0x516edb(0x12d)](_0x4aa323))):_0x7a4c6f=!![];}else _0x113efe[_0x516edb(0x181)](JSON[_0x516edb(0x12d)](_0x4aa323));}_0x3c009f=_0x113efe[_0x516edb(0x115)]('\x0a'),_0x7a4c6f=!![];}}if(_0x7a4c6f){const _0x1f0b47=Buffer[_0x516edb(0x195)](_0x3c009f,_0x516edb(0x10a));fs[_0x516edb(0x185)](_0x45fe3e,_0x3c009f,'utf8');const _0x1f8f9e=Math[_0x516edb(0x16f)](_0x1f0b47/0x4),_0xbf3d05=Math[_0x516edb(0x18a)](0x0,_0x5ec4dd-_0x1f8f9e);if(_0xbf3d05>0x0){const _0x2e3d26=loadSessionsState(),_0x41560e=_0x2e3d26[_0x45fe3e]||{'lineCount':0x1,'activeSavedTokens':0x0,'sideCacheSaved':0x0,'officialCompactSaved':0x0,'autoCompactSaved':0x0},_0x46a9a3=_0x41560e['autoCompactSaved']||0x0,_0x5a2985=_0x46a9a3+_0xbf3d05;saveSessionStateItem(_0x45fe3e,_0x41560e[_0x516edb(0x1bc)],_0x41560e[_0x516edb(0x179)]||0x0,_0x41560e[_0x516edb(0x10d)]||0x0,_0x5a2985,_0x41560e[_0x516edb(0x140)]||0x0),tracker_1[_0x516edb(0x15e)][_0x516edb(0x1c0)](_0x516edb(0x166)+_0x29b8d5,_0x2431e5,_0x3c009f,_0xbf3d05,undefined,[_0x516edb(0x183)+_0x29b8d5,_0x516edb(0x127),_0x29b8d5,_0x516edb(0x138)]);}return{'ok':!![],'savedTokens':_0xbf3d05};}return{'ok':!![],'savedTokens':0x0};}catch(_0x1be915){return{'ok':![],'savedTokens':0x0,'reason':_0x1be915[_0x516edb(0x18b)]||'Compaction\x20failed'};}}function installWindowsStartupService(){const _0xb89b0c=a0_0x80aab9;if(process[_0xb89b0c(0x131)]!==_0xb89b0c(0x143))return;try{const _0x1d1ef3=path[_0xb89b0c(0x115)](os[_0xb89b0c(0x159)](),_0xb89b0c(0x10c),_0xb89b0c(0x15f),'Microsoft',_0xb89b0c(0x1a1),_0xb89b0c(0x197),_0xb89b0c(0x1c3),_0xb89b0c(0x11b));if(!fs[_0xb89b0c(0x1a5)](_0x1d1ef3))fs[_0xb89b0c(0x167)](_0x1d1ef3,{'recursive':!![]});const _0x5c4600=path['join'](_0x1d1ef3,'TrimPromptDaemon.vbs'),_0x1b99a1=path[_0xb89b0c(0x115)](__dirname,_0xb89b0c(0x1b3)),_0x534346=_0x1b99a1[_0xb89b0c(0x1b9)](/\\/g,'\x5c\x5c'),_0x2b3042=_0xb89b0c(0x11a)+_0x534346+_0xb89b0c(0x13e);fs[_0xb89b0c(0x185)](_0x5c4600,_0x2b3042,_0xb89b0c(0x10a));}catch{}}function startWatcherDaemon(){const _0x43cd27=a0_0x80aab9;installWindowsStartupService();try{const {installClaudeHooks:_0x907461}=require(_0x43cd27(0x1b8));_0x907461();}catch(_0x4e2c71){}const _0x5cac27=['claude',_0x43cd27(0x12a),_0x43cd27(0x1be),_0x43cd27(0x118),'aider',_0x43cd27(0x165),_0x43cd27(0x132),_0x43cd27(0x11e),_0x43cd27(0x19b)];for(const _0x4bb85c of _0x5cac27){const _0x4dffe1=getAgentStoragePaths(_0x4bb85c);for(const _0x2de245 of _0x4dffe1){if(fs[_0x43cd27(0x1a5)](_0x2de245))try{fs[_0x43cd27(0x11f)](_0x2de245,{'recursive':!![]},(_0x4b3f9f,_0x46a127)=>{const _0x2cf7e8=_0x43cd27;if(!_0x46a127)return;const _0x1c18bb=path[_0x2cf7e8(0x115)](_0x2de245,_0x46a127);if(debounceTimers[_0x2cf7e8(0x172)](_0x1c18bb))clearTimeout(debounceTimers[_0x2cf7e8(0x1a7)](_0x1c18bb));const _0x5e1f91=setTimeout(()=>processSessionFile(_0x1c18bb,_0x4bb85c),0x1f4);debounceTimers[_0x2cf7e8(0x149)](_0x1c18bb,_0x5e1f91);});}catch{}}}setInterval(()=>{const _0x2400c8=_0x43cd27;for(const _0x5ccff of _0x5cac27){try{const _0x5018c3=getLatestSessionFile(_0x5ccff);_0x5018c3&&_0x5018c3['fullPath']&&processSessionFile(_0x5018c3[_0x2400c8(0x147)],_0x5ccff);}catch{}}},0xbb8);const _0x21d3c8=()=>{const _0x453228=_0x43cd27;for(const _0x3bb4d3 of _0x5cac27){try{const _0x960e20=getLatestSessionFile(_0x3bb4d3);_0x960e20&&_0x960e20[_0x453228(0x147)]&&compactLiveSession(_0x960e20[_0x453228(0x147)],_0x3bb4d3);}catch{}}};setTimeout(_0x21d3c8,0x7d0),setInterval(_0x21d3c8,0x2bf20);}
|
|
1
|
+
'use strict';const a0_0x2f8df4=a0_0x3eb6;(function(_0xa3111f,_0x160a1b){const _0x2267b2=a0_0x3eb6,_0x41bfee=_0xa3111f();while(!![]){try{const _0x2cd36e=parseInt(_0x2267b2(0x151))/0x1*(-parseInt(_0x2267b2(0x13f))/0x2)+-parseInt(_0x2267b2(0xe7))/0x3*(parseInt(_0x2267b2(0xb5))/0x4)+-parseInt(_0x2267b2(0xb9))/0x5+parseInt(_0x2267b2(0xba))/0x6*(parseInt(_0x2267b2(0x116))/0x7)+parseInt(_0x2267b2(0xb2))/0x8+-parseInt(_0x2267b2(0xca))/0x9+-parseInt(_0x2267b2(0x10c))/0xa*(-parseInt(_0x2267b2(0x143))/0xb);if(_0x2cd36e===_0x160a1b)break;else _0x41bfee['push'](_0x41bfee['shift']());}catch(_0x44d9fa){_0x41bfee['push'](_0x41bfee['shift']());}}}(a0_0x3ea5,0xd717c));var __createBinding=this&&this[a0_0x2f8df4(0x120)]||(Object[a0_0x2f8df4(0xfe)]?function(_0x32e913,_0x11b711,_0x380613,_0x120cb8){const _0x55ddb1=a0_0x2f8df4;if(_0x120cb8===undefined)_0x120cb8=_0x380613;var _0x387fa2=Object['getOwnPropertyDescriptor'](_0x11b711,_0x380613);(!_0x387fa2||(_0x55ddb1(0xda)in _0x387fa2?!_0x11b711[_0x55ddb1(0xc2)]:_0x387fa2['writable']||_0x387fa2[_0x55ddb1(0x12c)]))&&(_0x387fa2={'enumerable':!![],'get':function(){return _0x11b711[_0x380613];}}),Object[_0x55ddb1(0x10f)](_0x32e913,_0x120cb8,_0x387fa2);}:function(_0x102659,_0x123e41,_0x1a9695,_0x3337e6){if(_0x3337e6===undefined)_0x3337e6=_0x1a9695;_0x102659[_0x3337e6]=_0x123e41[_0x1a9695];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x2f8df4(0xfe)]?function(_0x39ad9a,_0x2e2c34){const _0x21c050=a0_0x2f8df4;Object[_0x21c050(0x10f)](_0x39ad9a,_0x21c050(0x10a),{'enumerable':!![],'value':_0x2e2c34});}:function(_0xb2e89a,_0x39fb84){_0xb2e89a['default']=_0x39fb84;}),__importStar=this&&this[a0_0x2f8df4(0x140)]||(function(){var _0x21d7bb=function(_0x544209){const _0x2b5d07=a0_0x3eb6;return _0x21d7bb=Object[_0x2b5d07(0xf1)]||function(_0x3f3bc1){const _0x3bb63d=_0x2b5d07;var _0x20a601=[];for(var _0x874cdb in _0x3f3bc1)if(Object['prototype'][_0x3bb63d(0xee)][_0x3bb63d(0xbf)](_0x3f3bc1,_0x874cdb))_0x20a601[_0x20a601[_0x3bb63d(0x157)]]=_0x874cdb;return _0x20a601;},_0x21d7bb(_0x544209);};return function(_0x59566e){const _0x143d01=a0_0x3eb6;if(_0x59566e&&_0x59566e[_0x143d01(0xc2)])return _0x59566e;var _0x1dc88b={};if(_0x59566e!=null){for(var _0x12a982=_0x21d7bb(_0x59566e),_0x1b72c8=0x0;_0x1b72c8<_0x12a982[_0x143d01(0x157)];_0x1b72c8++)if(_0x12a982[_0x1b72c8]!==_0x143d01(0x10a))__createBinding(_0x1dc88b,_0x59566e,_0x12a982[_0x1b72c8]);}return __setModuleDefault(_0x1dc88b,_0x59566e),_0x1dc88b;};}());Object[a0_0x2f8df4(0x10f)](exports,a0_0x2f8df4(0xc2),{'value':!![]}),exports['loadConfig']=loadConfig,exports[a0_0x2f8df4(0xfc)]=saveConfig,exports[a0_0x2f8df4(0xe0)]=getAgentStoragePaths,exports[a0_0x2f8df4(0x145)]=getLatestSessionFile,exports[a0_0x2f8df4(0xd7)]=loadSessionsState,exports['saveSessionStateItem']=saveSessionStateItem,exports[a0_0x2f8df4(0xd2)]=processSessionFile,exports[a0_0x2f8df4(0xd3)]=compactSessionCopy,exports[a0_0x2f8df4(0xce)]=compactLiveSession,exports['installWindowsStartupService']=installWindowsStartupService,exports[a0_0x2f8df4(0x109)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2f8df4(0x103))),os=__importStar(require('os')),cache_manager_1=require('./cache-manager'),tracker_1=require(a0_0x2f8df4(0x131)),baseDir=path[a0_0x2f8df4(0x10b)](os[a0_0x2f8df4(0x121)](),a0_0x2f8df4(0x127)),configPath=path[a0_0x2f8df4(0x10b)](baseDir,a0_0x2f8df4(0xf3)),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 _0x36f434=a0_0x2f8df4;try{if(!fs['existsSync'](baseDir))fs[_0x36f434(0xaa)](baseDir,{'recursive':!![]});if(fs[_0x36f434(0xdd)](configPath)){const _0xe8e3af=JSON[_0x36f434(0xde)](fs[_0x36f434(0x11e)](configPath,_0x36f434(0xe1)));return{...DEFAULT_CONFIG,..._0xe8e3af,'conversation_toggles':{...DEFAULT_CONFIG['conversation_toggles'],..._0xe8e3af[_0x36f434(0x148)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG['custom_storage_paths'],..._0xe8e3af['custom_storage_paths']||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x7914a4){const _0x5e989a=a0_0x2f8df4,_0x1e31d8=loadConfig(),_0x14844f={..._0x1e31d8,..._0x7914a4,'conversation_toggles':{..._0x1e31d8[_0x5e989a(0x148)],..._0x7914a4[_0x5e989a(0x148)]||{}},'custom_storage_paths':{..._0x1e31d8[_0x5e989a(0x135)],..._0x7914a4[_0x5e989a(0x135)]||{}}};try{if(!fs[_0x5e989a(0xdd)](baseDir))fs[_0x5e989a(0xaa)](baseDir,{'recursive':!![]});fs['writeFileSync'](configPath,JSON[_0x5e989a(0x101)](_0x14844f,null,0x2),'utf8');}catch{}return _0x14844f;}function getAgentStoragePaths(_0x6c2b6c){const _0x5586d2=a0_0x2f8df4,_0x529b20=loadConfig(),_0xe1127=_0x529b20['custom_storage_paths'][_0x6c2b6c];if(_0xe1127&&fs['existsSync'](_0xe1127))return[_0xe1127];const _0x37dc97=os[_0x5586d2(0x121)](),_0x258c4e=process[_0x5586d2(0xe4)]===_0x5586d2(0xc8),_0x56faa0=process[_0x5586d2(0xe4)]===_0x5586d2(0xcc);switch(_0x6c2b6c){case _0x5586d2(0xe2):return[path[_0x5586d2(0x10b)](_0x37dc97,'.claude','projects'),path[_0x5586d2(0x10b)](_0x37dc97,'.claude','history')];case _0x5586d2(0xea):return[path['join'](_0x37dc97,_0x5586d2(0xd8),'sessions'),path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0xe5),_0x5586d2(0x15e),_0x5586d2(0xd4))];case _0x5586d2(0x141):case _0x5586d2(0xc6):return[path[_0x5586d2(0x10b)](_0x37dc97,'.gemini',_0x5586d2(0xc6)),path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x115)),path['join'](_0x37dc97,'AppData',_0x5586d2(0x15e),_0x5586d2(0xed)),path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x104),_0x5586d2(0x141))];case _0x5586d2(0x146):if(_0x258c4e)return[path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0xe5),_0x5586d2(0x15e),_0x5586d2(0x14a),_0x5586d2(0xf8),'workspaceStorage')];if(_0x56faa0)return[path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x12b),_0x5586d2(0x137),'Cursor',_0x5586d2(0xf8),_0x5586d2(0x123))];return[path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x104),_0x5586d2(0x14a),_0x5586d2(0xf8),_0x5586d2(0x123))];case _0x5586d2(0xb4):return[process[_0x5586d2(0x155)](),path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x159))];case _0x5586d2(0xf9):if(_0x258c4e)return[path[_0x5586d2(0x10b)](_0x37dc97,'AppData',_0x5586d2(0x13b),_0x5586d2(0x12e))];return[path[_0x5586d2(0x10b)](_0x37dc97,'.config',_0x5586d2(0x12e))];case _0x5586d2(0xfb):return[path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0xb1),_0x5586d2(0x13d)),path['join'](process[_0x5586d2(0x155)](),'.openclaw','context')];case _0x5586d2(0xc3):return[path['join'](_0x37dc97,_0x5586d2(0x11c),_0x5586d2(0x125))];case'cortex':return[path[_0x5586d2(0x10b)](_0x37dc97,_0x5586d2(0x132),_0x5586d2(0xad))];default:return[];}}function getLatestSessionFile(_0x55055d){const _0x562e92=a0_0x2f8df4,_0x22cfe=getAgentStoragePaths(_0x55055d);let _0xc542c7=null,_0x1c65d0=0x0,_0x1cd9ae=null,_0x380939=null;for(const _0x13412f of _0x22cfe){if(fs[_0x562e92(0xdd)](_0x13412f)){if(!_0x380939)_0x380939=_0x13412f;const _0x50b2d2=(_0x184e34,_0x58ed53=0x0)=>{const _0x1da612=_0x562e92;if(_0x58ed53>0x6)return;try{const _0xe0c54f=fs[_0x1da612(0x138)](_0x184e34,{'withFileTypes':!![]});for(const _0x45fb40 of _0xe0c54f){const _0x319ad2=path['join'](_0x184e34,_0x45fb40[_0x1da612(0xe6)]);if(_0x45fb40[_0x1da612(0xff)]()){const _0x4f32c7=_0x45fb40['name'][_0x1da612(0x11f)]();if(_0x4f32c7==='node_modules'||_0x4f32c7==='.git'||_0x4f32c7===_0x1da612(0xef)||_0x4f32c7===_0x1da612(0x14e)||_0x4f32c7===_0x1da612(0x15b)||_0x4f32c7===_0x1da612(0x129)||_0x4f32c7===_0x1da612(0xc9)||_0x4f32c7===_0x1da612(0xf5)||_0x4f32c7===_0x1da612(0xb0)||_0x4f32c7==='out'||_0x4f32c7===_0x1da612(0xb8))continue;_0x50b2d2(_0x319ad2,_0x58ed53+0x1);}else{if(_0x45fb40['isFile']()&&!_0x45fb40[_0x1da612(0xe6)]['startsWith']('.')){const _0x3393a1=_0x45fb40[_0x1da612(0xe6)]['toLowerCase']();if(_0x3393a1[_0x1da612(0x126)](_0x1da612(0x118))||_0x3393a1['endsWith'](_0x1da612(0xbb))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0x14c))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0x13a))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0x100))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0xb7))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0x149))||_0x3393a1['endsWith'](_0x1da612(0xd0))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0xcd))||_0x3393a1[_0x1da612(0x153)]('.wal')||_0x3393a1[_0x1da612(0x153)](_0x1da612(0xf0))||_0x3393a1[_0x1da612(0x153)](_0x1da612(0x142))||_0x3393a1['endsWith']('.lock')||_0x3393a1[_0x1da612(0x153)]('.dat')||_0x3393a1[_0x1da612(0xb3)]('media__')||_0x3393a1['startsWith'](_0x1da612(0x156)))continue;const _0x591d99=fs[_0x1da612(0x111)](_0x319ad2);_0x591d99[_0x1da612(0x134)]>_0x1c65d0&&(_0x1c65d0=_0x591d99[_0x1da612(0x134)],_0xc542c7=_0x45fb40['name'],_0x1cd9ae=_0x319ad2,_0x380939=_0x13412f);}}}}catch{}};_0x50b2d2(_0x13412f);}}return{'fileName':_0xc542c7,'lastModified':_0x1c65d0>0x0?new Date(_0x1c65d0)[_0x562e92(0x154)]():null,'fullPath':_0x1cd9ae,'dirPath':_0x380939};}const debounceTimers=new Map(),lastLoggedTimes=new Map(),OFFLOAD_THRESHOLD_CHARS=0x7d0;function a0_0x3ea5(){const _0x4374df=['env','repeat','Windows','4261FOQjle','.json','endsWith','toISOString','cwd','image_','length','TrimPromptDaemon.vbs','.aider.chat.history.md','system','venv','prompt_turn','Unsupported\x20extension','Roaming','mkdirSync','Microsoft','.json1','cache','ceil','push','build','.openclaw','5557752AcVDyQ','startsWith','aider','44zaBXwM','Session\x20file\x20not\x20found','.jpeg','.agents','7776815dQQMZQ','66uuYQkD','.db','logExecution','content','messages','call','live-conv','chunk_id','__esModule','opencode','split','cortex','antigravity','text','win32','.next','1712808lFcKHN','compaction\x20failed','darwin','.pb','compactLiveSession','isArray','.webp','./hooks/claude-hook','processSessionFile','compactSessionCopy','Codex','lineCount','assign','loadSessionsState','.codex','sideCacheSaved','get','role','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','existsSync','parse','modified','getAgentStoragePaths','utf8','claude','matchAll','platform','AppData','name','373629KtftSq','trim','extname','codex','\x27\x20—\x20only\x20JSON/JSONL\x20sessions\x20can\x20be\x20compacted\x20(binary\x20.pb/.db\x20stores\x20are\x20not\x20supported)','tracker','Gemini','hasOwnProperty','.venv','.shm','getOwnPropertyNames','string','config.json','round','dist','TrimPrompt\x20Cache\x20Engine','max','User','copilot','none','openclaw','saveConfig','writeFileSync','create','isDirectory','.jpg','stringify','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','path','.config','hookSavedTokens','saved','set','conv_','startWatcherDaemon','default','join','31731250eNwUGn','has','message','defineProperty','.jsonl','statSync','officialCompactSaved','fullPath','tokens','.gemini','1012039czgUYN','size','.compact','savedTokens','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','\x20tokens).','.opencode','saveChunk','readFileSync','toLowerCase','__createBinding','homedir','./proxy-conv','workspaceStorage','Startup','sessions','includes','.trimprompt','raw_tokens','__pycache__','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','Library','configurable','conv:','github-copilot-cli','replace','compact_copy','./tracker','.cortex','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','mtimeMs','custom_storage_paths','byteLength','Application\x20Support','readdirSync','basename','.png','Local','renameSync','storage','object','686oSLRVh','__importStar','gemini','.tmp','11DOptau','compressed_tokens','getLatestSessionFile','cursor','Summary:\x20Text\x20block\x20offloaded\x20(','conversation_toggles','.gif','Cursor','autoCompactSaved','.vscdb','compact:'];a0_0x3ea5=function(){return _0x4374df;};return a0_0x3ea5();}function a0_0x3eb6(_0x5d545c,_0xa32e60){_0x5d545c=_0x5d545c-0xaa;const _0x3ea5d6=a0_0x3ea5();let _0x3eb609=_0x3ea5d6[_0x5d545c];return _0x3eb609;}function compressMessageContent(_0x59180e,_0x4bd445,_0x103d72){const _0x3e7cc7=a0_0x2f8df4;let _0x3ca0ba=![],_0x518e65=0x0;if(!_0x59180e)return{'modified':_0x3ca0ba,'savedTokens':_0x518e65};const _0x13ad20=_0x3e8090=>_0x3e8090[_0x3e7cc7(0x12f)](/\r\n/g,'\x0a')[_0x3e7cc7(0x12f)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x59180e[_0x3e7cc7(0xbd)]===_0x3e7cc7(0xf2)){let _0x13f079=_0x59180e[_0x3e7cc7(0xbd)],_0x587f08=_0x13ad20(_0x13f079);_0x587f08[_0x3e7cc7(0x157)]<_0x13f079['length']&&(_0x59180e['content']=_0x587f08,_0x3ca0ba=!![],_0x518e65+=Math['ceil']((_0x13f079[_0x3e7cc7(0x157)]-_0x587f08['length'])/0x4));if(_0x59180e[_0x3e7cc7(0xbd)][_0x3e7cc7(0x157)]>OFFLOAD_THRESHOLD_CHARS&&!_0x59180e[_0x3e7cc7(0xbd)][_0x3e7cc7(0x126)](_0x3e7cc7(0xf6))){const _0x3c5dd8='Summary:\x20Content\x20offloaded\x20('+Math[_0x3e7cc7(0xae)](_0x59180e[_0x3e7cc7(0xbd)][_0x3e7cc7(0x157)]/0x4)+_0x3e7cc7(0x11b),_0x19c5c8=(0x0,cache_manager_1['saveChunk'])(_0x4bd445,_0x103d72,_0x59180e[_0x3e7cc7(0xbd)],_0x3c5dd8);_0x59180e[_0x3e7cc7(0xbd)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20('+_0x19c5c8[_0x3e7cc7(0x128)]+_0x3e7cc7(0x133)+_0x19c5c8[_0x3e7cc7(0xc1)]+'`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20'+_0x19c5c8[_0x3e7cc7(0xc1)]+'`\x0a',_0x3ca0ba=!![],_0x518e65+=Math[_0x3e7cc7(0xf7)](0x0,_0x19c5c8[_0x3e7cc7(0x128)]-_0x19c5c8[_0x3e7cc7(0x144)]);}}else{if(Array[_0x3e7cc7(0xcf)](_0x59180e[_0x3e7cc7(0xbd)]))for(const _0x1798c8 of _0x59180e[_0x3e7cc7(0xbd)]){if(_0x1798c8&&typeof _0x1798c8===_0x3e7cc7(0x13e)){if(typeof _0x1798c8[_0x3e7cc7(0xc7)]===_0x3e7cc7(0xf2)){let _0x30e531=_0x1798c8[_0x3e7cc7(0xc7)],_0xa8c308=_0x13ad20(_0x30e531);_0xa8c308[_0x3e7cc7(0x157)]<_0x30e531[_0x3e7cc7(0x157)]&&(_0x1798c8['text']=_0xa8c308,_0x3ca0ba=!![],_0x518e65+=Math['ceil']((_0x30e531['length']-_0xa8c308[_0x3e7cc7(0x157)])/0x4));if(_0x1798c8['text'][_0x3e7cc7(0x157)]>OFFLOAD_THRESHOLD_CHARS&&!_0x1798c8[_0x3e7cc7(0xc7)][_0x3e7cc7(0x126)](_0x3e7cc7(0xf6))){const _0x5df636=_0x3e7cc7(0x147)+Math[_0x3e7cc7(0xae)](_0x1798c8['text'][_0x3e7cc7(0x157)]/0x4)+_0x3e7cc7(0x11b),_0x4fa4f2=(0x0,cache_manager_1[_0x3e7cc7(0x11d)])(_0x4bd445,_0x103d72,_0x1798c8[_0x3e7cc7(0xc7)],_0x5df636);_0x1798c8[_0x3e7cc7(0xc7)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x4fa4f2[_0x3e7cc7(0xc1)]+_0x3e7cc7(0x102)+_0x4fa4f2[_0x3e7cc7(0xc1)]+'`\x0a',_0x3ca0ba=!![],_0x518e65+=Math[_0x3e7cc7(0xf7)](0x0,_0x4fa4f2[_0x3e7cc7(0x128)]-_0x4fa4f2[_0x3e7cc7(0x144)]);}}else{if(typeof _0x1798c8['content']===_0x3e7cc7(0xf2)){let _0x2c7970=_0x1798c8[_0x3e7cc7(0xbd)],_0x334feb=_0x13ad20(_0x2c7970);_0x334feb['length']<_0x2c7970[_0x3e7cc7(0x157)]&&(_0x1798c8[_0x3e7cc7(0xbd)]=_0x334feb,_0x3ca0ba=!![],_0x518e65+=Math['ceil']((_0x2c7970['length']-_0x334feb[_0x3e7cc7(0x157)])/0x4));if(_0x1798c8[_0x3e7cc7(0xbd)]['length']>OFFLOAD_THRESHOLD_CHARS&&!_0x1798c8[_0x3e7cc7(0xbd)][_0x3e7cc7(0x126)](_0x3e7cc7(0xf6))){const _0x4a8129='Summary:\x20Tool\x20result\x20offloaded\x20('+Math['ceil'](_0x1798c8[_0x3e7cc7(0xbd)]['length']/0x4)+_0x3e7cc7(0x11b),_0x27a403=(0x0,cache_manager_1['saveChunk'])(_0x4bd445,_0x103d72,_0x1798c8[_0x3e7cc7(0xbd)],_0x4a8129);_0x1798c8[_0x3e7cc7(0xbd)]=_0x3e7cc7(0x12a)+_0x27a403[_0x3e7cc7(0xc1)]+_0x3e7cc7(0x102)+_0x27a403['chunk_id']+'`\x0a',_0x3ca0ba=!![],_0x518e65+=Math[_0x3e7cc7(0xf7)](0x0,_0x27a403['raw_tokens']-_0x27a403[_0x3e7cc7(0x144)]);}}}}}}return{'modified':_0x3ca0ba,'savedTokens':_0x518e65};}const sessionsStatePath=path[a0_0x2f8df4(0x10b)](baseDir,'sessions_state.json');let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x1f88c6=a0_0x2f8df4;try{if(fs[_0x1f88c6(0xdd)](sessionsStatePath)){const _0x3df304=JSON['parse'](fs[_0x1f88c6(0x11e)](sessionsStatePath,_0x1f88c6(0xe1)));if(_0x3df304&&typeof _0x3df304===_0x1f88c6(0x13e))return sessionsStateMemoryCache=_0x3df304,_0x3df304;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x46cbe0,_0x3b6f78,_0x309e15,_0x5f00b7=0x0,_0x35c065=0x0,_0x3371b5=0x0){const _0x4e01d5=a0_0x2f8df4;try{const _0x49cfed=loadSessionsState(),_0x25ecce=_0x49cfed[_0x46cbe0]||{},_0x291b83=_0x35c065||_0x25ecce[_0x4e01d5(0x14b)]||0x0,_0x16588c=_0x3371b5||_0x25ecce[_0x4e01d5(0x105)]||0x0,_0x2ba1fa=_0x309e15!==undefined?_0x309e15:_0x25ecce[_0x4e01d5(0x112)]||0x0;_0x49cfed[_0x46cbe0]={'lineCount':_0x3b6f78||_0x25ecce[_0x4e01d5(0xd5)]||0x1,'activeSavedTokens':_0x2ba1fa+_0x291b83+_0x16588c,'sideCacheSaved':_0x5f00b7||_0x25ecce[_0x4e01d5(0xd9)]||0x0,'officialCompactSaved':_0x2ba1fa,'autoCompactSaved':_0x291b83,'hookSavedTokens':_0x16588c},sessionsStateMemoryCache=_0x49cfed;if(!fs[_0x4e01d5(0xdd)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});const _0x1960f3=sessionsStatePath+'.tmp';fs['writeFileSync'](_0x1960f3,JSON[_0x4e01d5(0x101)](_0x49cfed,null,0x2),_0x4e01d5(0xe1)),fs[_0x4e01d5(0x13c)](_0x1960f3,sessionsStatePath);}catch{}}function processSessionFile(_0x4567af,_0x414932){const _0x3317c5=a0_0x2f8df4;try{if(!fs[_0x3317c5(0xdd)](_0x4567af))return;const _0x577118=fs[_0x3317c5(0x111)](_0x4567af);if(_0x577118[_0x3317c5(0xff)]()||_0x577118[_0x3317c5(0x117)]===0x0)return;const _0x5e53ae=loadConfig(),_0x4bcc7b=_0x3317c5(0x108)+_0x414932;if(_0x5e53ae[_0x3317c5(0x148)][_0x4bcc7b]===![])return;const _0x2571f0=fs[_0x3317c5(0x11e)](_0x4567af,_0x3317c5(0xe1)),_0x3d7bee=path[_0x3317c5(0xe9)](_0x4567af)[_0x3317c5(0x11f)]();let _0x14fb81=0x1;if(_0x3d7bee===_0x3317c5(0x110)||_0x3d7bee===_0x3317c5(0xac))_0x14fb81=_0x2571f0['split']('\x0a')['filter'](Boolean)[_0x3317c5(0x157)];else{if(_0x3d7bee===_0x3317c5(0x152))try{const _0x478ae7=JSON['parse'](_0x2571f0),_0x3c6961=Array[_0x3317c5(0xcf)](_0x478ae7[_0x3317c5(0xbe)])?_0x478ae7[_0x3317c5(0xbe)]:Array[_0x3317c5(0xcf)](_0x478ae7)?_0x478ae7:null;if(_0x3c6961)_0x14fb81=_0x3c6961[_0x3317c5(0x157)];}catch{}}let _0x6ad753=0x0;if((_0x3d7bee===_0x3317c5(0x110)||_0x3d7bee===_0x3317c5(0xac))&&_0x2571f0[_0x3317c5(0x126)](_0x3317c5(0x106))&&_0x2571f0[_0x3317c5(0x126)](_0x3317c5(0x114))){const _0x59f031=/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi;for(const _0x37165b of _0x2571f0[_0x3317c5(0xc4)]('\x0a')){if(!_0x37165b[_0x3317c5(0x126)](_0x3317c5(0x106))||!_0x37165b[_0x3317c5(0x126)]('tokens'))continue;try{const _0x186ea2=JSON[_0x3317c5(0xde)](_0x37165b);if(_0x186ea2['type']!==_0x3317c5(0x15a))continue;const _0x5aae9c=typeof _0x186ea2[_0x3317c5(0xbd)]==='string'?_0x186ea2[_0x3317c5(0xbd)]:_0x186ea2[_0x3317c5(0x10e)]&&typeof _0x186ea2[_0x3317c5(0x10e)][_0x3317c5(0xbd)]===_0x3317c5(0xf2)?_0x186ea2['message'][_0x3317c5(0xbd)]:'';if(!_0x5aae9c)continue;for(const _0x31c08a of _0x5aae9c[_0x3317c5(0xe3)](_0x59f031)){let _0x7c5384=parseFloat(_0x31c08a[0x1]);if(_0x31c08a[0x0][_0x3317c5(0x11f)]()[_0x3317c5(0x126)]('k'))_0x7c5384=_0x7c5384*0x3e8;_0x6ad753+=Math[_0x3317c5(0xf4)](_0x7c5384);}}catch{}}}const _0x13a357=loadSessionsState(),_0x5bea9b=_0x13a357[_0x4567af],_0x11d7b8=_0x5bea9b?_0x5bea9b['lineCount']:0x0,_0x33e99e=_0x5bea9b?_0x5bea9b['activeSavedTokens']||0x0:0x0;if(_0x11d7b8>0x0&&_0x14fb81>_0x11d7b8&&_0x33e99e>0x0){const _0x312abc=_0x3317c5(0x12d)+_0x414932;tracker_1[_0x3317c5(0xec)][_0x3317c5(0xbc)](_0x312abc,'A'[_0x3317c5(0x14f)](_0x33e99e*0x4),'',0x0,undefined,[_0x3317c5(0x108)+_0x414932,'live-conv',_0x414932,_0x3317c5(0x15c)]);}const _0x43759a=_0x5bea9b&&_0x5bea9b[_0x3317c5(0x112)]!==undefined?_0x5bea9b[_0x3317c5(0x112)]:0x0,_0x5d9d6f=Math['max'](_0x43759a,_0x6ad753);saveSessionStateItem(_0x4567af,_0x14fb81,_0x5d9d6f,0x0,0x0,0x0);}catch{}}function compactSessionCopy(_0x53d3fa,_0x2cc3f7){const _0x16def6=a0_0x2f8df4;try{if(!fs[_0x16def6(0xdd)](_0x53d3fa))return{'ok':![],'reason':_0x16def6(0xb6)};const _0x304c61=path['extname'](_0x53d3fa)['toLowerCase']();if(_0x304c61!==_0x16def6(0x152)&&_0x304c61!==_0x16def6(0x110)&&_0x304c61!==_0x16def6(0xac))return{'ok':![],'reason':'Unsupported\x20format\x20\x27'+(_0x304c61||_0x16def6(0xfa))+_0x16def6(0xeb)};const _0x357b57=fs[_0x16def6(0x11e)](_0x53d3fa,_0x16def6(0xe1)),_0x4c7965=Buffer['byteLength'](_0x357b57,_0x16def6(0xe1)),_0x270686=path[_0x16def6(0x139)](_0x53d3fa,_0x304c61);let _0x1e110a=_0x357b57,_0x3ad7aa=![];if(_0x304c61===_0x16def6(0x152)){const _0x22c7ce=JSON[_0x16def6(0xde)](_0x357b57),_0x2d658f=Array[_0x16def6(0xcf)](_0x22c7ce[_0x16def6(0xbe)])?_0x22c7ce['messages']:Array[_0x16def6(0xcf)](_0x22c7ce)?_0x22c7ce:null;if(_0x2d658f){for(const _0x24274e of _0x2d658f){const _0x49d001=compressMessageContent(_0x24274e,_0x270686,_0x2cc3f7);if(_0x49d001[_0x16def6(0xdf)])_0x3ad7aa=!![];}if(_0x3ad7aa)_0x1e110a=JSON[_0x16def6(0x101)](_0x22c7ce,null,0x2);}}else{const _0x3263c4=_0x357b57[_0x16def6(0xc4)]('\x0a'),_0x1eb52=[];for(let _0x389f25 of _0x3263c4){if(!_0x389f25[_0x16def6(0xe8)]()){_0x1eb52[_0x16def6(0xaf)](_0x389f25);continue;}try{const _0x40e0fc=JSON[_0x16def6(0xde)](_0x389f25),_0x3a604f=_0x40e0fc[_0x16def6(0x10e)]||_0x40e0fc;if(_0x3a604f){const _0x25b81c=compressMessageContent(_0x3a604f,_0x270686,_0x2cc3f7);_0x25b81c[_0x16def6(0xdf)]&&(_0x3ad7aa=!![],_0x389f25=JSON[_0x16def6(0x101)](_0x40e0fc));}}catch{}_0x1eb52[_0x16def6(0xaf)](_0x389f25);}if(_0x3ad7aa)_0x1e110a=_0x1eb52[_0x16def6(0x10b)]('\x0a');}const _0x35be37=Buffer[_0x16def6(0x136)](_0x1e110a,_0x16def6(0xe1)),_0xd67ccd=path[_0x16def6(0x10b)](path['dirname'](_0x53d3fa),_0x270686+_0x16def6(0x118)+_0x304c61);fs[_0x16def6(0xfd)](_0xd67ccd,_0x1e110a,_0x16def6(0xe1));const _0x542571=Math['ceil'](_0x4c7965/0x4),_0x437604=Math[_0x16def6(0xae)](_0x35be37/0x4),_0x5df407=Math[_0x16def6(0xf7)](0x0,_0x542571-_0x437604),_0x355cd9=_0x4c7965>0x0?Math[_0x16def6(0xf4)]((0x1-_0x35be37/_0x4c7965)*0x3e8)/0xa:0x0;return _0x5df407>0x0&&tracker_1[_0x16def6(0xec)][_0x16def6(0xbc)](_0x16def6(0x14d)+_0x2cc3f7,_0x357b57,_0x1e110a,_0x5df407,undefined,[_0x16def6(0x108)+_0x2cc3f7,'live-conv',_0x2cc3f7,_0x16def6(0x130)]),{'ok':!![],'compactPath':_0xd67ccd,'rawBytes':_0x4c7965,'compressedBytes':_0x35be37,'rawTokens':_0x542571,'compressedTokens':_0x437604,'savedTokens':_0x5df407,'reductionPct':_0x355cd9};}catch(_0x1f166e){return{'ok':![],'reason':_0x1f166e?.[_0x16def6(0x10e)]||_0x16def6(0xcb)};}}function compactLiveSession(_0xe52688,_0x39d61e){const _0x1fe993=a0_0x2f8df4;try{if(!fs[_0x1fe993(0xdd)](_0xe52688))return{'ok':![],'savedTokens':0x0,'reason':'File\x20not\x20found'};const _0x4cb948=path[_0x1fe993(0xe9)](_0xe52688)['toLowerCase']();if(_0x4cb948!==_0x1fe993(0x152)&&_0x4cb948!==_0x1fe993(0x110)&&_0x4cb948!==_0x1fe993(0xac))return{'ok':![],'savedTokens':0x0,'reason':_0x1fe993(0x15d)};const _0x3b610f=fs[_0x1fe993(0x11e)](_0xe52688,'utf8'),_0x5b1d95=Buffer[_0x1fe993(0x136)](_0x3b610f,_0x1fe993(0xe1)),_0x317459=Math['ceil'](_0x5b1d95/0x4),_0x186c0e=path[_0x1fe993(0x139)](_0xe52688,_0x4cb948);let _0x2644f6=_0x3b610f,_0x21b5b3=![];if(_0x4cb948===_0x1fe993(0x152)){const _0x5518d2=JSON[_0x1fe993(0xde)](_0x3b610f),_0x479d3e=Array[_0x1fe993(0xcf)](_0x5518d2[_0x1fe993(0xbe)])?_0x5518d2[_0x1fe993(0xbe)]:Array[_0x1fe993(0xcf)](_0x5518d2)?_0x5518d2:null;if(_0x479d3e){for(const _0x2111e4 of _0x479d3e){const _0x49e1a6=compressMessageContent(_0x2111e4,_0x186c0e,_0x39d61e);if(_0x49e1a6[_0x1fe993(0xdf)])_0x21b5b3=!![];}const {compressConversation:_0x34d0c8}=require(_0x1fe993(0x122)),_0x58c82f=_0x34d0c8(_0x479d3e,0x9c40);_0x58c82f[_0x1fe993(0x119)]>0x0&&(_0x21b5b3=!![],Array['isArray'](_0x5518d2[_0x1fe993(0xbe)])?_0x5518d2[_0x1fe993(0xbe)]=_0x58c82f[_0x1fe993(0xbe)]:_0x2644f6=JSON[_0x1fe993(0x101)](_0x58c82f['messages'],null,0x2)),_0x21b5b3&&!Array[_0x1fe993(0xcf)](_0x5518d2)&&(_0x2644f6=JSON['stringify'](_0x5518d2,null,0x2));}}else{const _0x27bd96=_0x3b610f[_0x1fe993(0xc4)]('\x0a'),_0x1d936a=[],_0x5919e9=[];for(const _0x55632b of _0x27bd96){if(!_0x55632b[_0x1fe993(0xe8)]())continue;try{const _0x318c97=JSON[_0x1fe993(0xde)](_0x55632b);_0x1d936a[_0x1fe993(0xaf)](_0x318c97);const _0x546de9=_0x318c97[_0x1fe993(0x10e)]||_0x318c97;_0x546de9&&typeof _0x546de9[_0x1fe993(0xdb)]===_0x1fe993(0xf2)&&_0x5919e9['push'](_0x546de9);}catch{}}for(const _0x5806d2 of _0x5919e9){const _0x44d5b6=compressMessageContent(_0x5806d2,_0x186c0e,_0x39d61e);if(_0x44d5b6[_0x1fe993(0xdf)])_0x21b5b3=!![];}const {compressConversation:_0x324488}=require(_0x1fe993(0x122)),_0x2a1328=_0x324488(_0x5919e9,0x9c40);if(_0x2a1328[_0x1fe993(0x119)]>0x0||_0x21b5b3){const _0x348a20=[];for(const _0x1f70ff of _0x1d936a){const _0x3f3bc0=_0x1f70ff[_0x1fe993(0x10e)]||_0x1f70ff;if(_0x3f3bc0&&typeof _0x3f3bc0['role']===_0x1fe993(0xf2)){const _0x1a01ae=_0x2a1328[_0x1fe993(0xbe)]['find'](_0x382691=>_0x382691===_0x3f3bc0);_0x1a01ae?(_0x1f70ff[_0x1fe993(0x10e)]?_0x1f70ff[_0x1fe993(0x10e)]=_0x1a01ae:Object[_0x1fe993(0xd6)](_0x1f70ff,_0x1a01ae),_0x348a20[_0x1fe993(0xaf)](JSON[_0x1fe993(0x101)](_0x1f70ff))):_0x21b5b3=!![];}else _0x348a20[_0x1fe993(0xaf)](JSON[_0x1fe993(0x101)](_0x1f70ff));}_0x2644f6=_0x348a20[_0x1fe993(0x10b)]('\x0a'),_0x21b5b3=!![];}}if(_0x21b5b3){const _0x2edd48=Buffer[_0x1fe993(0x136)](_0x2644f6,_0x1fe993(0xe1));fs[_0x1fe993(0xfd)](_0xe52688,_0x2644f6,'utf8');const _0xa80a6f=Math[_0x1fe993(0xae)](_0x2edd48/0x4),_0x3c2a98=Math['max'](0x0,_0x317459-_0xa80a6f);if(_0x3c2a98>0x0){const _0x48d8e5=loadSessionsState(),_0x53147=_0x48d8e5[_0xe52688]||{'lineCount':0x1,'activeSavedTokens':0x0,'sideCacheSaved':0x0,'officialCompactSaved':0x0,'autoCompactSaved':0x0},_0xfa708e=_0x53147[_0x1fe993(0x14b)]||0x0,_0x4f4ee6=_0xfa708e+_0x3c2a98;saveSessionStateItem(_0xe52688,_0x53147[_0x1fe993(0xd5)],_0x53147[_0x1fe993(0x112)]||0x0,_0x53147[_0x1fe993(0xd9)]||0x0,_0x4f4ee6,_0x53147['hookSavedTokens']||0x0),tracker_1[_0x1fe993(0xec)]['logExecution']('compact:'+_0x39d61e,_0x3b610f,_0x2644f6,_0x3c2a98,undefined,[_0x1fe993(0x108)+_0x39d61e,_0x1fe993(0xc0),_0x39d61e,'compact_copy']);}return{'ok':!![],'savedTokens':_0x3c2a98};}return{'ok':!![],'savedTokens':0x0};}catch(_0x371577){return{'ok':![],'savedTokens':0x0,'reason':_0x371577[_0x1fe993(0x10e)]||'Compaction\x20failed'};}}function installWindowsStartupService(){const _0x18c38e=a0_0x2f8df4;if(process[_0x18c38e(0xe4)]!==_0x18c38e(0xc8))return;try{const _0x229ff8=path[_0x18c38e(0x10b)](os[_0x18c38e(0x121)](),_0x18c38e(0xe5),_0x18c38e(0x15e),_0x18c38e(0xab),_0x18c38e(0x150),'Start\x20Menu','Programs',_0x18c38e(0x124));if(!fs[_0x18c38e(0xdd)](_0x229ff8))fs[_0x18c38e(0xaa)](_0x229ff8,{'recursive':!![]});const _0x239789=path[_0x18c38e(0x10b)](_0x229ff8,_0x18c38e(0x158)),_0x332f05=path[_0x18c38e(0x10b)](__dirname,'cli.js'),_0x5c3703=_0x332f05[_0x18c38e(0x12f)](/\\/g,'\x5c\x5c'),_0x4a9918=_0x18c38e(0xdc)+_0x5c3703+_0x18c38e(0x11a);fs[_0x18c38e(0xfd)](_0x239789,_0x4a9918,'utf8');}catch{}}function startWatcherDaemon(){const _0x5e6f07=a0_0x2f8df4;installWindowsStartupService();try{const {installClaudeHooks:_0x589d83}=require(_0x5e6f07(0xd1));_0x589d83();}catch(_0x54781b){}const _0x31b930=[_0x5e6f07(0xe2),_0x5e6f07(0x141),'codex',_0x5e6f07(0x146),_0x5e6f07(0xb4),_0x5e6f07(0xf9),'openclaw',_0x5e6f07(0xc3),_0x5e6f07(0xc5)];for(const _0x44944f of _0x31b930){const _0x17adb4=getAgentStoragePaths(_0x44944f);for(const _0x15d2c9 of _0x17adb4){if(fs[_0x5e6f07(0xdd)](_0x15d2c9))try{fs['watch'](_0x15d2c9,{'recursive':!![]},(_0x579df8,_0xeeab2e)=>{const _0x28731e=_0x5e6f07;if(!_0xeeab2e)return;const _0x132712=path[_0x28731e(0x10b)](_0x15d2c9,_0xeeab2e);if(debounceTimers[_0x28731e(0x10d)](_0x132712))clearTimeout(debounceTimers['get'](_0x132712));const _0x244a50=setTimeout(()=>processSessionFile(_0x132712,_0x44944f),0x1f4);debounceTimers[_0x28731e(0x107)](_0x132712,_0x244a50);});}catch{}}}setInterval(()=>{for(const _0x5aca5c of _0x31b930){try{const _0x303c61=getLatestSessionFile(_0x5aca5c);_0x303c61&&_0x303c61['fullPath']&&processSessionFile(_0x303c61['fullPath'],_0x5aca5c);}catch{}}},0xbb8);const _0x3b963e=()=>{const _0x2c2630=_0x5e6f07;for(const _0x1ef1a8 of _0x31b930){try{const _0x323ea4=getLatestSessionFile(_0x1ef1a8);_0x323ea4&&_0x323ea4[_0x2c2630(0x113)]&&compactLiveSession(_0x323ea4[_0x2c2630(0x113)],_0x1ef1a8);}catch{}}};setTimeout(_0x3b963e,0x7d0),setInterval(_0x3b963e,0x2bf20);}
|
package/filters/devops.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x1de0f4=a0_0x70dc;(function(_0x57916d,_0x556d9e){const _0x315967=a0_0x70dc,_0x5583fa=_0x57916d();while(!![]){try{const _0xf560a8=-parseInt(_0x315967(0x19d))/0x1*(-parseInt(_0x315967(0x1ab))/0x2)+-parseInt(_0x315967(0x196))/0x3+-parseInt(_0x315967(0x191))/0x4*(parseInt(_0x315967(0x19c))/0x5)+-parseInt(_0x315967(0x1bf))/0x6+-parseInt(_0x315967(0x1b5))/0x7*(-parseInt(_0x315967(0x19b))/0x8)+-parseInt(_0x315967(0x19a))/0x9+-parseInt(_0x315967(0x1b1))/0xa*(-parseInt(_0x315967(0x1bd))/0xb);if(_0xf560a8===_0x556d9e)break;else _0x5583fa['push'](_0x5583fa['shift']());}catch(_0x347061){_0x5583fa['push'](_0x5583fa['shift']());}}}(a0_0x369e,0x9d23a));function a0_0x70dc(_0x59d48e,_0x29014d){_0x59d48e=_0x59d48e-0x18d;const _0x369e7d=a0_0x369e();let _0x70dc1c=_0x369e7d[_0x59d48e];return _0x70dc1c;}function a0_0x369e(){const _0x114866=['Found\x200\x20error','Docker\x20images:\x20','\x20more','4QehlkV','\x20more\x20images','filterDockerImages','\x20more\x20lines','...\x20+','2647047AQckoL','All\x20checks\x20passed','__esModule','\x20more\x20files','2239992uuDxcA','5112DgHxAL','1962010BuliCX','330793gdXcCG','\x20more\x20events','\x20\x20...\x20(','filterDockerPs','defineProperty','includes','No\x20resources\x20found','\x20lines\x20truncated]\x20...\x0a','trim','slice','\x20\x20...\x20+','\x20total','length','get','4obKRwZ','Ruff:\x20no\x20issues\x20found','match','push','No\x20images\x20found','describe','1370NUJVwX','startsWith','Events:','split','12537bvdAje','filter','filterKubectl','\x20more\x20resources','Ruff:\x20all\x20checks\x20passed','filterDockerLogs','Containers:\x20','\x20issues\x20in\x20','120329IqkUhy','substring','6824382OlmPKy','join','\x20files'];a0_0x369e=function(){return _0x114866;};return a0_0x369e();}Object[a0_0x1de0f4(0x1a1)](exports,a0_0x1de0f4(0x198),{'value':!![]}),exports[a0_0x1de0f4(0x1a0)]=filterDockerPs,exports[a0_0x1de0f4(0x193)]=filterDockerImages,exports[a0_0x1de0f4(0x1ba)]=filterDockerLogs,exports[a0_0x1de0f4(0x1b7)]=filterKubectl,exports['filterRuff']=filterRuff;function filterDockerPs(_0x53dd11){const _0x4273d2=a0_0x1de0f4,_0x34f87e=_0x53dd11[_0x4273d2(0x1b4)]('\x0a')['filter'](_0x30b3fa=>_0x30b3fa[_0x4273d2(0x1a5)]()[_0x4273d2(0x1a9)]>0x0);if(_0x34f87e[_0x4273d2(0x1a9)]===0x0)return'No\x20containers\x20running';if(_0x34f87e['length']<=0xa)return _0x53dd11['trim']();const _0x202f86=_0x34f87e[0x0],_0xe717c2=_0x34f87e[_0x4273d2(0x1a6)](0x1),_0x46e4c9=[];_0x46e4c9[_0x4273d2(0x1ae)](_0x4273d2(0x1bb)+_0xe717c2['length']+'\x20total'),_0x46e4c9[_0x4273d2(0x1ae)]('');for(const _0x43d9e0 of _0xe717c2){const _0x39af27=_0x43d9e0['split'](/\s{2,}/);if(_0x39af27['length']>=0x5){const _0x263cce=_0x39af27[0x0][_0x4273d2(0x1be)](0x0,0xc),_0x78672c=_0x39af27[0x1],_0x4b9150=_0x39af27[_0x39af27['length']-0x2]||'',_0x182b93=_0x39af27[_0x39af27[_0x4273d2(0x1a9)]-0x1]||'';_0x46e4c9[_0x4273d2(0x1ae)]('\x20\x20'+_0x263cce+'\x20\x20'+_0x78672c+'\x20\x20'+_0x4b9150+'\x20\x20'+_0x182b93);}else _0x46e4c9['push']('\x20\x20'+_0x43d9e0[_0x4273d2(0x1a5)]());}return _0x46e4c9['join']('\x0a');}function filterDockerImages(_0x5e1e95){const _0x548058=a0_0x1de0f4,_0x176bfc=_0x5e1e95[_0x548058(0x1b4)]('\x0a')[_0x548058(0x1b6)](_0x571b31=>_0x571b31[_0x548058(0x1a5)]()['length']>0x0);if(_0x176bfc[_0x548058(0x1a9)]<=0x1)return _0x548058(0x1af);if(_0x176bfc['length']<=0xf)return _0x5e1e95[_0x548058(0x1a5)]();const _0xe5f691=_0x176bfc[_0x548058(0x1a6)](0x1),_0x15a363=[_0x548058(0x18f)+_0xe5f691['length']+_0x548058(0x1a8)];_0x15a363['push']('');const _0x43ef94=_0xe5f691[_0x548058(0x1a6)](0x0,0x14);for(const _0x5e88ac of _0x43ef94){const _0x54e7c8=_0x5e88ac[_0x548058(0x1b4)](/\s{2,}/);if(_0x54e7c8[_0x548058(0x1a9)]>=0x3){const _0x1400fe=_0x54e7c8[0x0],_0x3c4e5f=_0x54e7c8[0x1],_0x393f5b=_0x54e7c8[_0x54e7c8[_0x548058(0x1a9)]-0x1]||'';_0x15a363[_0x548058(0x1ae)]('\x20\x20'+_0x1400fe+':'+_0x3c4e5f+'\x20\x20'+_0x393f5b);}else _0x15a363['push']('\x20\x20'+_0x5e88ac[_0x548058(0x1a5)]());}return _0xe5f691[_0x548058(0x1a9)]>0x14&&_0x15a363[_0x548058(0x1ae)](_0x548058(0x1a7)+(_0xe5f691[_0x548058(0x1a9)]-0x14)+_0x548058(0x192)),_0x15a363[_0x548058(0x1c0)]('\x0a');}function filterDockerLogs(_0x69f0e){const _0x15fd4a=a0_0x1de0f4,_0x5e38c1=_0x69f0e[_0x15fd4a(0x1b4)]('\x0a');if(_0x5e38c1[_0x15fd4a(0x1a9)]<=0x32)return _0x69f0e;const _0xc9d4dd=[];return _0xc9d4dd['push'](..._0x5e38c1[_0x15fd4a(0x1a6)](0x0,0x14)),_0xc9d4dd['push']('\x0a...\x20['+(_0x5e38c1[_0x15fd4a(0x1a9)]-0x28)+_0x15fd4a(0x1a4)),_0xc9d4dd[_0x15fd4a(0x1ae)](..._0x5e38c1[_0x15fd4a(0x1a6)](-0x14)),_0xc9d4dd[_0x15fd4a(0x1ae)]('\x0a('+_0x5e38c1['length']+'\x20log\x20lines\x20total)'),_0xc9d4dd[_0x15fd4a(0x1c0)]('\x0a');}function filterKubectl(_0x21f5a4,_0x19dd2e){const _0x1091a0=a0_0x1de0f4,_0x56e54f=_0x21f5a4[_0x1091a0(0x1b4)]('\x0a')[_0x1091a0(0x1b6)](_0x41fbf6=>_0x41fbf6['trim']()[_0x1091a0(0x1a9)]>0x0);if(_0x56e54f[_0x1091a0(0x1a9)]===0x0)return _0x1091a0(0x1a3);if(_0x56e54f['length']<=0x14)return _0x21f5a4['trim']();if(_0x19dd2e===_0x1091a0(0x1aa)){const _0x2b0182=_0x56e54f[0x0],_0x5bca6f=_0x56e54f[_0x1091a0(0x1a6)](0x1),_0x42f09e=[_0x5bca6f['length']+'\x20resources\x20found','',_0x2b0182];return _0x5bca6f[_0x1091a0(0x1a9)]<=0x1e?_0x42f09e['push'](..._0x5bca6f):(_0x42f09e[_0x1091a0(0x1ae)](..._0x5bca6f[_0x1091a0(0x1a6)](0x0,0x19)),_0x42f09e[_0x1091a0(0x1ae)](_0x1091a0(0x195)+(_0x5bca6f[_0x1091a0(0x1a9)]-0x19)+_0x1091a0(0x1b8))),_0x42f09e['join']('\x0a');}if(_0x19dd2e===_0x1091a0(0x1b0)){const _0x213252=[];let _0x15cd67=![],_0x3e7835=0x0;for(const _0x1f598b of _0x56e54f){if(_0x1f598b[_0x1091a0(0x1b2)](_0x1091a0(0x1b3))){_0x15cd67=!![],_0x213252[_0x1091a0(0x1ae)](_0x1f598b);continue;}if(_0x15cd67){_0x3e7835++;if(_0x3e7835<=0x5)_0x213252[_0x1091a0(0x1ae)](_0x1f598b);}else _0x213252['push'](_0x1f598b);}return _0x3e7835>0x5&&_0x213252['push'](_0x1091a0(0x1a7)+(_0x3e7835-0x5)+_0x1091a0(0x19e)),_0x213252[_0x1091a0(0x1c0)]('\x0a');}if(_0x19dd2e==='logs')return filterDockerLogs(_0x21f5a4);const _0x5aae84=_0x56e54f[_0x1091a0(0x1a6)](0x0,0x1e);return _0x56e54f[_0x1091a0(0x1a9)]>0x1e&&_0x5aae84[_0x1091a0(0x1ae)]('...\x20+'+(_0x56e54f['length']-0x1e)+_0x1091a0(0x194)),_0x5aae84[_0x1091a0(0x1c0)]('\x0a');}function filterRuff(_0x56da77){const _0x499763=a0_0x1de0f4,_0x4bc073=_0x56da77['split']('\x0a')[_0x499763(0x1b6)](_0x2e8471=>_0x2e8471[_0x499763(0x1a5)]()['length']>0x0);if(_0x4bc073[_0x499763(0x1a9)]===0x0)return _0x499763(0x1ac);if(_0x56da77[_0x499763(0x1a2)](_0x499763(0x197))||_0x56da77['includes'](_0x499763(0x18e)))return _0x499763(0x1b9);const _0x6147a7=_0x56da77[_0x499763(0x1ad)](/Found (\d+) error/),_0x30396e=_0x6147a7?parseInt(_0x6147a7[0x1]):_0x4bc073[_0x499763(0x1a9)],_0x1e1b29={},_0x45aa48=[];for(const _0x369fe8 of _0x4bc073){const _0xfeaaf1=_0x369fe8[_0x499763(0x1ad)](/^([^:]+:\d+:\d+):\s*(.*)/);if(_0xfeaaf1){const _0x442a78=_0xfeaaf1[0x1],_0x5dac49=_0x442a78[_0x499763(0x1b4)](':')[0x0];if(!_0x1e1b29[_0x5dac49])_0x1e1b29[_0x5dac49]=[];_0x1e1b29[_0x5dac49][_0x499763(0x1ae)](_0x369fe8);}else _0x45aa48[_0x499763(0x1ae)](_0x369fe8);}const _0x108999=Object['keys'](_0x1e1b29);if(_0x108999[_0x499763(0x1a9)]===0x0){if(_0x4bc073[_0x499763(0x1a9)]<=0x14)return _0x56da77['trim']();return _0x4bc073[_0x499763(0x1a6)](0x0,0xf)[_0x499763(0x1c0)]('\x0a')+('\x0a...\x20+'+(_0x4bc073['length']-0xf)+_0x499763(0x190));}const _0x2b5a1d=['Ruff:\x20'+_0x30396e+_0x499763(0x1bc)+_0x108999[_0x499763(0x1a9)]+_0x499763(0x18d)];_0x2b5a1d[_0x499763(0x1ae)]('');const _0x57f257=0xa;for(const _0x300542 of _0x108999[_0x499763(0x1a6)](0x0,_0x57f257)){const _0x289c01=_0x1e1b29[_0x300542];if(_0x289c01[_0x499763(0x1a9)]<=0x3){for(const _0x29a389 of _0x289c01)_0x2b5a1d['push']('\x20\x20'+_0x29a389);}else _0x2b5a1d[_0x499763(0x1ae)]('\x20\x20'+_0x289c01[0x0]),_0x2b5a1d['push'](_0x499763(0x19f)+_0x289c01['length']+'\x20issues\x20in\x20'+_0x300542+')');}return _0x108999['length']>_0x57f257&&_0x2b5a1d[_0x499763(0x1ae)](_0x499763(0x1a7)+(_0x108999[_0x499763(0x1a9)]-_0x57f257)+_0x499763(0x199)),_0x2b5a1d[_0x499763(0x1c0)]('\x0a');}
|