trimprompt 1.0.44 → 1.0.46
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 +4 -25
- 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';const
|
|
1
|
+
'use strict';const a0_0x2a8718=a0_0x58dd;(function(_0x1815a8,_0x5ce21d){const _0x10d087=a0_0x58dd,_0x1949a2=_0x1815a8();while(!![]){try{const _0x50c59d=-parseInt(_0x10d087(0xcf))/0x1+parseInt(_0x10d087(0xd8))/0x2+-parseInt(_0x10d087(0xfa))/0x3+-parseInt(_0x10d087(0xf1))/0x4+-parseInt(_0x10d087(0xdb))/0x5+-parseInt(_0x10d087(0x100))/0x6+-parseInt(_0x10d087(0xcb))/0x7*(-parseInt(_0x10d087(0xcc))/0x8);if(_0x50c59d===_0x5ce21d)break;else _0x1949a2['push'](_0x1949a2['shift']());}catch(_0x3bd435){_0x1949a2['push'](_0x1949a2['shift']());}}}(a0_0xc1bb,0xd2a5e));var __createBinding=this&&this[a0_0x2a8718(0xf6)]||(Object[a0_0x2a8718(0xfc)]?function(_0x1833ee,_0x14e6d6,_0x3768d0,_0x5890e6){const _0x257325=a0_0x2a8718;if(_0x5890e6===undefined)_0x5890e6=_0x3768d0;var _0x381bea=Object['getOwnPropertyDescriptor'](_0x14e6d6,_0x3768d0);(!_0x381bea||(_0x257325(0xf4)in _0x381bea?!_0x14e6d6[_0x257325(0xe6)]:_0x381bea[_0x257325(0xe0)]||_0x381bea[_0x257325(0xca)]))&&(_0x381bea={'enumerable':!![],'get':function(){return _0x14e6d6[_0x3768d0];}}),Object['defineProperty'](_0x1833ee,_0x5890e6,_0x381bea);}:function(_0x531dde,_0x281489,_0x151866,_0x5891e1){if(_0x5891e1===undefined)_0x5891e1=_0x151866;_0x531dde[_0x5891e1]=_0x281489[_0x151866];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0xffe9d5,_0x598889){const _0x1bac8d=a0_0x2a8718;Object[_0x1bac8d(0xdc)](_0xffe9d5,_0x1bac8d(0xf7),{'enumerable':!![],'value':_0x598889});}:function(_0x208fa5,_0x4c42b5){const _0x3e760a=a0_0x2a8718;_0x208fa5[_0x3e760a(0xf7)]=_0x4c42b5;}),__importStar=this&&this[a0_0x2a8718(0xdf)]||(function(){var _0x473e64=function(_0x29ac91){const _0x5e8b6e=a0_0x58dd;return _0x473e64=Object[_0x5e8b6e(0xfd)]||function(_0x4a1ad9){const _0x47d3f1=_0x5e8b6e;var _0x52aa9f=[];for(var _0x1cb962 in _0x4a1ad9)if(Object[_0x47d3f1(0x101)]['hasOwnProperty']['call'](_0x4a1ad9,_0x1cb962))_0x52aa9f[_0x52aa9f[_0x47d3f1(0xd6)]]=_0x1cb962;return _0x52aa9f;},_0x473e64(_0x29ac91);};return function(_0x2a67aa){const _0x4f8252=a0_0x58dd;if(_0x2a67aa&&_0x2a67aa[_0x4f8252(0xe6)])return _0x2a67aa;var _0x3d48a3={};if(_0x2a67aa!=null){for(var _0x35731f=_0x473e64(_0x2a67aa),_0x2a4b82=0x0;_0x2a4b82<_0x35731f[_0x4f8252(0xd6)];_0x2a4b82++)if(_0x35731f[_0x2a4b82]!==_0x4f8252(0xf7))__createBinding(_0x3d48a3,_0x2a67aa,_0x35731f[_0x2a4b82]);}return __setModuleDefault(_0x3d48a3,_0x2a67aa),_0x3d48a3;};}());Object[a0_0x2a8718(0xdc)](exports,a0_0x2a8718(0xe6),{'value':!![]}),exports[a0_0x2a8718(0xda)]=saveChunk,exports[a0_0x2a8718(0xd9)]=retrieveChunk,exports['enforceEvictionPolicy']=enforceEvictionPolicy;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),crypto=__importStar(require(a0_0x2a8718(0xf3))),baseDir=path[a0_0x2a8718(0xeb)](os[a0_0x2a8718(0xd3)](),a0_0x2a8718(0xe3)),cacheDir=path[a0_0x2a8718(0xeb)](baseDir,a0_0x2a8718(0xf9)),MAX_CACHE_BYTES=0x1f4*0x400*0x400,TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function ensureCacheDir(){const _0x38eb11=a0_0x2a8718;!fs[_0x38eb11(0xe5)](cacheDir)&&fs[_0x38eb11(0xf0)](cacheDir,{'recursive':!![]});}function a0_0x58dd(_0x330b43,_0x552f78){_0x330b43=_0x330b43-0xc9;const _0xc1bb73=a0_0xc1bb();let _0x58dd29=_0xc1bb73[_0x330b43];return _0x58dd29;}function saveChunk(_0x176c15,_0x4f0aed,_0x2ceaf2,_0xf986d4){const _0x3dba66=a0_0x2a8718;ensureCacheDir();const _0x440eab=crypto[_0x3dba66(0xf5)](_0x3dba66(0xde))[_0x3dba66(0xff)](_0x2ceaf2)[_0x3dba66(0xee)](_0x3dba66(0xea))['substring'](0x0,0x8),_0x47554a='tp_chk_'+_0x440eab,_0x478fd1=path[_0x3dba66(0xeb)](cacheDir,_0x176c15);!fs['existsSync'](_0x478fd1)&&fs[_0x3dba66(0xf0)](_0x478fd1,{'recursive':!![]});const _0x3cbce0=path[_0x3dba66(0xeb)](_0x478fd1,_0x47554a+_0x3dba66(0xd2)),_0x48246d=new Date()[_0x3dba66(0xfb)](),_0x494e88=Math[_0x3dba66(0xfe)](_0x2ceaf2[_0x3dba66(0xd6)]/0x4),_0x14c201=Math['ceil'](_0xf986d4[_0x3dba66(0xd6)]/0x4),_0x5c731b={'chunk_id':_0x47554a,'session_id':_0x176c15,'agent_key':_0x4f0aed,'raw_tokens':_0x494e88,'compressed_tokens':_0x14c201,'created_at':_0x48246d,'last_accessed_at':_0x48246d,'summary':_0xf986d4,'raw_payload':_0x2ceaf2};return fs[_0x3dba66(0xe2)](_0x3cbce0,JSON[_0x3dba66(0xf2)](_0x5c731b,null,0x2),_0x3dba66(0xe1)),enforceEvictionPolicy(),_0x5c731b;}function retrieveChunk(_0x2162d8){const _0x2cf893=a0_0x2a8718;ensureCacheDir();try{const _0x3cfcf2=fs['readdirSync'](cacheDir);for(const _0x16feeb of _0x3cfcf2){const _0x99a100=path[_0x2cf893(0xeb)](cacheDir,_0x16feeb);if(fs[_0x2cf893(0xec)](_0x99a100)[_0x2cf893(0xe7)]()){const _0x42e028=path[_0x2cf893(0xeb)](_0x99a100,_0x2162d8+'.json');if(fs[_0x2cf893(0xe5)](_0x42e028)){const _0x21d4d1=fs[_0x2cf893(0xd0)](_0x42e028,_0x2cf893(0xe1)),_0x148296=JSON[_0x2cf893(0xd5)](_0x21d4d1);return _0x148296[_0x2cf893(0xc9)]=new Date()['toISOString'](),fs[_0x2cf893(0xe2)](_0x42e028,JSON[_0x2cf893(0xf2)](_0x148296,null,0x2),_0x2cf893(0xe1)),_0x148296;}}}}catch{}return null;}function enforceEvictionPolicy(){const _0x4ecbdc=a0_0x2a8718;ensureCacheDir();try{const _0x45a9c3=Date[_0x4ecbdc(0xe4)]();let _0x4eb7b2=0x0;const _0xa07853=[],_0x276cf9=fs[_0x4ecbdc(0xe8)](cacheDir);for(const _0x1e97c0 of _0x276cf9){const _0x2273eb=path[_0x4ecbdc(0xeb)](cacheDir,_0x1e97c0);if(fs[_0x4ecbdc(0xec)](_0x2273eb)[_0x4ecbdc(0xe7)]()){const _0x4fc5de=fs[_0x4ecbdc(0xe8)](_0x2273eb);for(const _0xb41c3c of _0x4fc5de){if(_0xb41c3c[_0x4ecbdc(0xe9)](_0x4ecbdc(0xd2))){const _0x55dcf6=path[_0x4ecbdc(0xeb)](_0x2273eb,_0xb41c3c),_0x29728f=fs['statSync'](_0x55dcf6);try{const _0x29ab20=JSON[_0x4ecbdc(0xd5)](fs[_0x4ecbdc(0xd0)](_0x55dcf6,_0x4ecbdc(0xe1))),_0x80ea46=new Date(_0x29ab20[_0x4ecbdc(0xed)]||_0x29728f['birthtime'])[_0x4ecbdc(0xd4)](),_0x1adcb1=new Date(_0x29ab20[_0x4ecbdc(0xc9)]||_0x29728f[_0x4ecbdc(0xdd)])['getTime']();if(_0x45a9c3-_0x80ea46>TTL_MS){fs[_0x4ecbdc(0xd7)](_0x55dcf6);continue;}_0x4eb7b2+=_0x29728f[_0x4ecbdc(0xf8)],_0xa07853[_0x4ecbdc(0xef)]({'path':_0x55dcf6,'size':_0x29728f[_0x4ecbdc(0xf8)],'lastAccessed':_0x1adcb1,'createdAt':_0x80ea46});}catch{fs[_0x4ecbdc(0xd7)](_0x55dcf6);}}}}}if(_0x4eb7b2>MAX_CACHE_BYTES){_0xa07853[_0x4ecbdc(0xd1)]((_0x1eef74,_0x506a64)=>_0x1eef74[_0x4ecbdc(0xce)]-_0x506a64[_0x4ecbdc(0xce)]);for(const _0x2dafaa of _0xa07853){if(_0x4eb7b2<=MAX_CACHE_BYTES*0.8)break;try{fs['unlinkSync'](_0x2dafaa[_0x4ecbdc(0xcd)]),_0x4eb7b2-=_0x2dafaa[_0x4ecbdc(0xf8)];}catch{}}}}catch{}}function a0_0xc1bb(){const _0x58f856=['utf8','writeFileSync','.trimprompt','now','existsSync','__esModule','isDirectory','readdirSync','endsWith','hex','join','statSync','created_at','digest','push','mkdirSync','5763788mbqRkK','stringify','crypto','get','createHash','__createBinding','default','size','cache','1091403NeWMri','toISOString','create','getOwnPropertyNames','ceil','update','7214430foPCcv','prototype','last_accessed_at','configurable','7hiuysx','39150896djjdIy','path','lastAccessed','540734TUbCfA','readFileSync','sort','.json','homedir','getTime','parse','length','unlinkSync','2358430nkFNYz','retrieveChunk','saveChunk','8311880VtvFbK','defineProperty','mtime','sha256','__importStar','writable'];a0_0xc1bb=function(){return _0x58f856;};return a0_0xc1bb();}
|
package/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x22b70f=a0_0x2ae2;(function(_0x4bdadb,_0x1e5fc0){const _0x3575f2=a0_0x2ae2,_0x3ef1a6=_0x4bdadb();while(!![]){try{const _0x40efde=-parseInt(_0x3575f2(0x1f1))/0x1+parseInt(_0x3575f2(0x1fa))/0x2*(-parseInt(_0x3575f2(0x219))/0x3)+parseInt(_0x3575f2(0x21c))/0x4*(parseInt(_0x3575f2(0x229))/0x5)+-parseInt(_0x3575f2(0x21f))/0x6*(parseInt(_0x3575f2(0x20e))/0x7)+parseInt(_0x3575f2(0x1e0))/0x8+parseInt(_0x3575f2(0x1ed))/0x9+parseInt(_0x3575f2(0x224))/0xa;if(_0x40efde===_0x1e5fc0)break;else _0x3ef1a6['push'](_0x3ef1a6['shift']());}catch(_0x3c82e2){_0x3ef1a6['push'](_0x3ef1a6['shift']());}}}(a0_0x1bc6,0x2d8fa));var __createBinding=this&&this[a0_0x22b70f(0x228)]||(Object[a0_0x22b70f(0x215)]?function(_0xf80b5d,_0x332cde,_0x9087e,_0x5be118){const _0x13194d=a0_0x22b70f;if(_0x5be118===undefined)_0x5be118=_0x9087e;var _0x19aad4=Object['getOwnPropertyDescriptor'](_0x332cde,_0x9087e);(!_0x19aad4||(_0x13194d(0x1ff)in _0x19aad4?!_0x332cde[_0x13194d(0x1fe)]:_0x19aad4[_0x13194d(0x1fd)]||_0x19aad4[_0x13194d(0x21d)]))&&(_0x19aad4={'enumerable':!![],'get':function(){return _0x332cde[_0x9087e];}}),Object[_0x13194d(0x218)](_0xf80b5d,_0x5be118,_0x19aad4);}:function(_0x6f801d,_0x1b7a40,_0x185282,_0x874d24){if(_0x874d24===undefined)_0x874d24=_0x185282;_0x6f801d[_0x874d24]=_0x1b7a40[_0x185282];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x22b70f(0x215)]?function(_0xf54378,_0x4a83ba){const _0x15d4e5=a0_0x22b70f;Object[_0x15d4e5(0x218)](_0xf54378,_0x15d4e5(0x21a),{'enumerable':!![],'value':_0x4a83ba});}:function(_0x55b588,_0x4abc5b){const _0x51f920=a0_0x22b70f;_0x55b588[_0x51f920(0x21a)]=_0x4abc5b;}),__importStar=this&&this[a0_0x22b70f(0x21b)]||(function(){var _0x31190a=function(_0x60430b){const _0x301f58=a0_0x2ae2;return _0x31190a=Object[_0x301f58(0x1fb)]||function(_0x1cf9f9){const _0xb7b917=_0x301f58;var _0x424445=[];for(var _0x15846a in _0x1cf9f9)if(Object['prototype'][_0xb7b917(0x21e)][_0xb7b917(0x203)](_0x1cf9f9,_0x15846a))_0x424445[_0x424445[_0xb7b917(0x1e8)]]=_0x15846a;return _0x424445;},_0x31190a(_0x60430b);};return function(_0x4e40f2){const _0x121153=a0_0x2ae2;if(_0x4e40f2&&_0x4e40f2[_0x121153(0x1fe)])return _0x4e40f2;var _0x2fec6e={};if(_0x4e40f2!=null){for(var _0x46c3f9=_0x31190a(_0x4e40f2),_0x5c1dd0=0x0;_0x5c1dd0<_0x46c3f9['length'];_0x5c1dd0++)if(_0x46c3f9[_0x5c1dd0]!=='default')__createBinding(_0x2fec6e,_0x4e40f2,_0x46c3f9[_0x5c1dd0]);}return __setModuleDefault(_0x2fec6e,_0x4e40f2),_0x2fec6e;};}());Object[a0_0x22b70f(0x218)](exports,a0_0x22b70f(0x1fe),{'value':!![]}),exports['dedup']=dedup;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x22b70f(0x221))),os=__importStar(require('os')),crypto=__importStar(require('crypto')),CACHE_DIR=path[a0_0x22b70f(0x1e9)](os[a0_0x22b70f(0x209)](),a0_0x22b70f(0x1dd)),CACHE_FILE=path[a0_0x22b70f(0x1e9)](CACHE_DIR,'cache.json'),MAX_ENTRIES=0x12c,TTL_SECONDS={'file':0x78,'git-status':0x1e,'git-log':0x3c,'git-show':0xe10,'ls':0x3c,'tree':0x3c,'docker-ps':0x1e,'docker-images':0x3c,'kubectl':0x1e,'ruff':0x3c,'go-vet':0x3c};function classifyCommand(_0x356bd6){const _0x177c5b=a0_0x22b70f,_0x4c4aa6=_0x356bd6[_0x177c5b(0x216)]()[_0x177c5b(0x1f6)]();if(_0x4c4aa6['match'](/^(cat|head|tail|read|bat)\s/))return _0x177c5b(0x1fc);if(_0x4c4aa6[_0x177c5b(0x1ea)](_0x177c5b(0x220))||_0x4c4aa6['includes'](_0x177c5b(0x217)))return'git-status';if(_0x4c4aa6[_0x177c5b(0x1ea)](_0x177c5b(0x205))||_0x4c4aa6[_0x177c5b(0x1ea)](_0x177c5b(0x1ec)))return _0x177c5b(0x226);if(_0x4c4aa6['includes'](_0x177c5b(0x227))||_0x4c4aa6['includes']('yadm\x20show'))return _0x177c5b(0x22c);if(_0x4c4aa6[_0x177c5b(0x210)](/^(ls|dir)(\s|$)/)||_0x4c4aa6[_0x177c5b(0x1ea)](_0x177c5b(0x1f2))||_0x4c4aa6['endsWith'](_0x177c5b(0x1f5)))return'ls';if(_0x4c4aa6['match'](/^tree(\s|$)/)||_0x4c4aa6[_0x177c5b(0x1ea)](_0x177c5b(0x225))||_0x4c4aa6[_0x177c5b(0x1e7)]('\x20tree'))return _0x177c5b(0x223);if(_0x4c4aa6[_0x177c5b(0x210)](/docker\s+ps/))return _0x177c5b(0x1f7);if(_0x4c4aa6['match'](/docker\s+images/))return _0x177c5b(0x1e2);if(_0x4c4aa6['includes'](_0x177c5b(0x1df))||_0x4c4aa6[_0x177c5b(0x1ea)]('kubectl\x20describe'))return _0x177c5b(0x20b);if(_0x4c4aa6['includes'](_0x177c5b(0x211))||_0x4c4aa6['includes'](_0x177c5b(0x1e4)))return'ruff';if(_0x4c4aa6[_0x177c5b(0x1ea)]('go\x20vet'))return _0x177c5b(0x201);return'';}function md5(_0x4c6c1b){const _0x209f5c=a0_0x22b70f;return crypto[_0x209f5c(0x20a)](_0x209f5c(0x207))['update'](_0x4c6c1b)[_0x209f5c(0x20d)](_0x209f5c(0x1f3));}function loadStore(){const _0x12d6b8=a0_0x22b70f;try{if(fs[_0x12d6b8(0x222)](CACHE_FILE))return JSON[_0x12d6b8(0x1e1)](fs[_0x12d6b8(0x200)](CACHE_FILE,_0x12d6b8(0x212)));}catch{}return{};}function a0_0x2ae2(_0x4ec529,_0x5ec940){_0x4ec529=_0x4ec529-0x1dd;const _0x1bc61e=a0_0x1bc6();let _0x2ae24e=_0x1bc61e[_0x4ec529];return _0x2ae24e;}function saveStore(_0x5de66f){const _0x4f757e=a0_0x22b70f;try{if(!fs[_0x4f757e(0x222)](CACHE_DIR))fs['mkdirSync'](CACHE_DIR,{'recursive':!![]});const _0x5ce439=Object[_0x4f757e(0x20f)](_0x5de66f);if(_0x5ce439[_0x4f757e(0x1e8)]>MAX_ENTRIES){const _0x36c4ca=_0x5ce439[_0x4f757e(0x214)]((_0x2b45e4,_0x2cdc50)=>_0x5de66f[_0x2b45e4][_0x4f757e(0x22b)]-_0x5de66f[_0x2cdc50][_0x4f757e(0x22b)]);for(const _0x3fb21b of _0x36c4ca[_0x4f757e(0x1f9)](0x0,_0x5ce439[_0x4f757e(0x1e8)]-MAX_ENTRIES)){delete _0x5de66f[_0x3fb21b];}}fs[_0x4f757e(0x208)](CACHE_FILE,JSON[_0x4f757e(0x213)](_0x5de66f),_0x4f757e(0x212));}catch{}}function a0_0x1bc6(){const _0x49d213=['cwd','now','329907Vjagzn','\x20ls\x20','hex','[cached\x20—\x20unchanged\x20since\x20','\x20ls','toLowerCase','docker-ps','git-status','slice','4bkhIcJ','getOwnPropertyNames','file','writable','__esModule','get','readFileSync','go-vet','\x20lines','call','s\x20ago,\x20','git\x20log','split','md5','writeFileSync','homedir','createHash','kubectl','\x20entries','digest','21721PnEBVQ','keys','match','ruff\x20check','utf8','stringify','sort','create','trim','yadm\x20status','defineProperty','302334kjmPMP','default','__importStar','1255724KrmYnv','configurable','hasOwnProperty','630pTISfT','git\x20status','path','existsSync','tree','5626840nyYozC','\x20tree\x20','git-log','git\x20show','__createBinding','5YXkpJF','startsWith','timestamp','git-show','.trimprompt','\x20chars','kubectl\x20get','1251360mlQDpj','parse','docker-images','round','ruff\x20','summary','hash','endsWith','length','join','includes','docker','yadm\x20log','97749eWVPpp','\x20lines,\x20'];a0_0x1bc6=function(){return _0x49d213;};return a0_0x1bc6();}function buildSummary(_0x2d64a0,_0x2bba73){const _0x2b730c=a0_0x22b70f,_0x28ff60=_0x2d64a0[_0x2b730c(0x206)]('\x0a')[_0x2b730c(0x1e8)],_0xb54135=_0x2d64a0[_0x2b730c(0x1e8)];if(_0x2bba73===_0x2b730c(0x1fc))return _0x28ff60+_0x2b730c(0x1ee)+_0xb54135+_0x2b730c(0x1de);if(_0x2bba73===_0x2b730c(0x1f8))return _0x28ff60+'\x20lines';if(_0x2bba73===_0x2b730c(0x226))return _0x28ff60+_0x2b730c(0x20c);if(_0x2bba73[_0x2b730c(0x22a)](_0x2b730c(0x1eb)))return _0x28ff60+_0x2b730c(0x202);return _0x28ff60+_0x2b730c(0x1ee)+_0xb54135+'\x20chars';}function dedup(_0x26faff,_0x30b018){const _0x178eac=a0_0x22b70f;try{const _0x2e2da5=classifyCommand(_0x26faff);if(!_0x2e2da5)return null;const _0x42f8be=TTL_SECONDS[_0x2e2da5];if(!_0x42f8be)return null;const _0x2cc25e=process[_0x178eac(0x1ef)](),_0x23e623=md5(_0x2cc25e+'::'+_0x26faff[_0x178eac(0x216)]()),_0x43cbca=md5(_0x30b018),_0xe1e134=Date[_0x178eac(0x1f0)](),_0x2b7c31=loadStore(),_0x2ec648=_0x2b7c31[_0x23e623];if(_0x2ec648&&_0x2ec648[_0x178eac(0x1e6)]===_0x43cbca&&_0xe1e134-_0x2ec648[_0x178eac(0x22b)]<_0x42f8be*0x3e8){const _0x116222=Math[_0x178eac(0x1e3)]((_0xe1e134-_0x2ec648[_0x178eac(0x22b)])/0x3e8);return _0x178eac(0x1f4)+_0x116222+_0x178eac(0x204)+_0x2ec648[_0x178eac(0x1e5)]+']';}_0x2b7c31[_0x23e623]={'hash':_0x43cbca,'summary':buildSummary(_0x30b018,_0x2e2da5),'timestamp':_0xe1e134,'chars':_0x30b018[_0x178eac(0x1e8)]},saveStore(_0x2b7c31);}catch{}return null;}
|
package/ccr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x206317=a0_0x1e04;(function(_0x30cfbc,_0x55d7a2){const _0x1f1084=a0_0x1e04,_0x25c4e4=_0x30cfbc();while(!![]){try{const _0x64ddfe=parseInt(_0x1f1084(0xa5))/0x1*(parseInt(_0x1f1084(0xd4))/0x2)+-parseInt(_0x1f1084(0xb1))/0x3+parseInt(_0x1f1084(0xc4))/0x4+parseInt(_0x1f1084(0xa2))/0x5+parseInt(_0x1f1084(0xb8))/0x6+-parseInt(_0x1f1084(0xaa))/0x7*(parseInt(_0x1f1084(0xd6))/0x8)+-parseInt(_0x1f1084(0xd3))/0x9;if(_0x64ddfe===_0x55d7a2)break;else _0x25c4e4['push'](_0x25c4e4['shift']());}catch(_0xb91856){_0x25c4e4['push'](_0x25c4e4['shift']());}}}(a0_0x4c50,0xa4303));var __createBinding=this&&this[a0_0x206317(0x96)]||(Object['create']?function(_0x5a5890,_0x4b23a6,_0x165a71,_0x1a8be1){const _0x5647a5=a0_0x206317;if(_0x1a8be1===undefined)_0x1a8be1=_0x165a71;var _0x3f811b=Object[_0x5647a5(0xd1)](_0x4b23a6,_0x165a71);(!_0x3f811b||(_0x5647a5(0xb4)in _0x3f811b?!_0x4b23a6[_0x5647a5(0x9e)]:_0x3f811b['writable']||_0x3f811b[_0x5647a5(0x9c)]))&&(_0x3f811b={'enumerable':!![],'get':function(){return _0x4b23a6[_0x165a71];}}),Object[_0x5647a5(0x97)](_0x5a5890,_0x1a8be1,_0x3f811b);}:function(_0xf3d8db,_0x264afd,_0x237317,_0x189c56){if(_0x189c56===undefined)_0x189c56=_0x237317;_0xf3d8db[_0x189c56]=_0x264afd[_0x237317];}),__setModuleDefault=this&&this[a0_0x206317(0xac)]||(Object[a0_0x206317(0xbb)]?function(_0x5117f2,_0x4ff192){const _0x19e915=a0_0x206317;Object[_0x19e915(0x97)](_0x5117f2,_0x19e915(0xc1),{'enumerable':!![],'value':_0x4ff192});}:function(_0x1e90c7,_0x15ab0b){const _0x5123cc=a0_0x206317;_0x1e90c7[_0x5123cc(0xc1)]=_0x15ab0b;}),__importStar=this&&this[a0_0x206317(0xc3)]||(function(){var _0x459263=function(_0x3f8006){const _0x416b48=a0_0x1e04;return _0x459263=Object[_0x416b48(0xdb)]||function(_0x2200a6){const _0x421bf1=_0x416b48;var _0x2e55ab=[];for(var _0x2659ad in _0x2200a6)if(Object[_0x421bf1(0xa6)][_0x421bf1(0xba)][_0x421bf1(0xa1)](_0x2200a6,_0x2659ad))_0x2e55ab[_0x2e55ab[_0x421bf1(0xce)]]=_0x2659ad;return _0x2e55ab;},_0x459263(_0x3f8006);};return function(_0x37772b){if(_0x37772b&&_0x37772b['__esModule'])return _0x37772b;var _0x423055={};if(_0x37772b!=null){for(var _0x23bb4a=_0x459263(_0x37772b),_0x1333d1=0x0;_0x1333d1<_0x23bb4a['length'];_0x1333d1++)if(_0x23bb4a[_0x1333d1]!=='default')__createBinding(_0x423055,_0x37772b,_0x23bb4a[_0x1333d1]);}return __setModuleDefault(_0x423055,_0x37772b),_0x423055;};}());Object[a0_0x206317(0x97)](exports,'__esModule',{'value':!![]}),exports[a0_0x206317(0xb7)]=skeletonize,exports['runCcr']=runCcr;function a0_0x4c50(){const _0x4edd06=['getOwnPropertyDescriptor','replace','16279758nBOOyi','781486jinbpo','[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20','8FgeeKy','mkdirSync','.jsx','md5','.js','getOwnPropertyNames','tp_','startsWith','function','digest','push','__createBinding','defineProperty',']\x0a\x0a','join','.py','trim','configurable','extname','__esModule','from\x20','let','call','6687400TCJzrN','interface','.go','2WAPiHv','prototype','match','update','.java','1454551GtvosT','utf8','__setModuleDefault','path','ccr','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','.rs','1244865tkWdIJ','#\x20...\x20[collapsed]','pub','get','.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20','class','skeletonize','547608sYWiGV','split','hasOwnProperty','create','.tsx','endsWith','class\x20','package','\x27\x27\x27','default','const','__importStar','3575564JpVNLQ','toLowerCase','import\x20','trimStart','homedir','crypto','repeat','\x22\x22\x22','substring','pop','length','.trimprompt','slice'];a0_0x4c50=function(){return _0x4edd06;};return a0_0x4c50();}function a0_0x1e04(_0x55a279,_0x32db2e){_0x55a279=_0x55a279-0x95;const _0x4c503e=a0_0x4c50();let _0x1e0480=_0x4c503e[_0x55a279];return _0x1e0480;}const crypto=__importStar(require(a0_0x206317(0xc9))),fs=__importStar(require('fs')),path=__importStar(require(a0_0x206317(0xad))),os=__importStar(require('os'));function skeletonize(_0x372d41,_0x274135){const _0x48dc53=a0_0x206317,_0x4707a8=path[_0x48dc53(0x9d)](_0x274135[_0x48dc53(0xb9)]('\x20')[_0x48dc53(0xcd)]()||'')[_0x48dc53(0xc5)](),_0x34d7bf=_0x372d41[_0x48dc53(0xb9)]('\x0a'),_0x2926f7=[];if(_0x4707a8===_0x48dc53(0x9a)){let _0x74fafb=![],_0x320c28='';for(let _0x4c19e2=0x0;_0x4c19e2<_0x34d7bf[_0x48dc53(0xce)];_0x4c19e2++){const _0x41f450=_0x34d7bf[_0x4c19e2],_0x1177bf=_0x41f450['trim'](),_0x44612c=_0x41f450[_0x48dc53(0xce)]-_0x41f450[_0x48dc53(0xc7)]()[_0x48dc53(0xce)];if(!_0x74fafb&&(_0x1177bf['startsWith'](_0x48dc53(0xcb))||_0x1177bf['startsWith'](_0x48dc53(0xc0)))){_0x74fafb=!![],_0x320c28=_0x1177bf['substring'](0x0,0x3),_0x2926f7[_0x48dc53(0x95)](_0x41f450);_0x1177bf['endsWith'](_0x320c28)&&_0x1177bf[_0x48dc53(0xce)]>0x3&&(_0x74fafb=![]);continue;}if(_0x74fafb){_0x2926f7[_0x48dc53(0x95)](_0x41f450);_0x1177bf[_0x48dc53(0xbd)](_0x320c28)&&(_0x74fafb=![]);continue;}if(_0x1177bf[_0x48dc53(0xdd)](_0x48dc53(0xc6))||_0x1177bf['startsWith'](_0x48dc53(0x9f))||_0x1177bf[_0x48dc53(0xdd)](_0x48dc53(0xbe))||_0x1177bf[_0x48dc53(0xdd)]('def\x20')||_0x1177bf[_0x48dc53(0xdd)]('@')||_0x1177bf[_0x48dc53(0xdd)]('#')||_0x1177bf[_0x48dc53(0xce)]===0x0)_0x2926f7['push'](_0x41f450);else{const _0x6d236=_0x2926f7[_0x2926f7[_0x48dc53(0xce)]-0x1]||'';if(!_0x6d236[_0x48dc53(0x9b)]()[_0x48dc53(0xbd)](_0x48dc53(0xb2))){const _0x254d11='\x20'[_0x48dc53(0xca)](_0x44612c);_0x2926f7[_0x48dc53(0x95)](_0x254d11+_0x48dc53(0xb2));}}}return _0x2926f7['join']('\x0a');}if([_0x48dc53(0xda),'.ts',_0x48dc53(0xd8),_0x48dc53(0xbc),_0x48dc53(0xa4),_0x48dc53(0xb0),_0x48dc53(0xa9),'.c','.cpp','.h']['includes'](_0x4707a8)){let _0x3bf915=0x0;for(let _0x34bccb=0x0;_0x34bccb<_0x34d7bf[_0x48dc53(0xce)];_0x34bccb++){const _0x3901e3=_0x34d7bf[_0x34bccb],_0x303978=_0x3901e3['trim'](),_0x1d5f9b=(_0x303978['match'](/\{/g)||[])[_0x48dc53(0xce)],_0x169ced=(_0x303978[_0x48dc53(0xa7)](/\}/g)||[])[_0x48dc53(0xce)];if(_0x3bf915===0x0)(_0x303978[_0x48dc53(0xdd)]('import')||_0x303978[_0x48dc53(0xdd)]('export')||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xc2))||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xa0))||_0x303978[_0x48dc53(0xdd)]('var')||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xb6))||_0x303978['startsWith'](_0x48dc53(0xde))||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xa3))||_0x303978['startsWith']('type')||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xbf))||_0x303978[_0x48dc53(0xdd)]('fn')||_0x303978[_0x48dc53(0xdd)](_0x48dc53(0xb3))||_0x303978[_0x48dc53(0xce)]===0x0||_0x303978[_0x48dc53(0xdd)]('//')||_0x303978[_0x48dc53(0xdd)]('/*')||_0x303978['startsWith']('*'))&&_0x2926f7[_0x48dc53(0x95)](_0x3901e3),_0x1d5f9b>_0x169ced&&(_0x3bf915+=_0x1d5f9b-_0x169ced);else{const _0x4db297=_0x3bf915+_0x1d5f9b-_0x169ced;if(_0x4db297<=0x0){const _0x405ddf=_0x3901e3[_0x48dc53(0xa7)](/^\s*/)?.[0x0]||'';_0x2926f7[_0x48dc53(0x95)](_0x405ddf+'//\x20...\x20[collapsed]'),_0x2926f7[_0x48dc53(0x95)](_0x3901e3),_0x3bf915=0x0;}else _0x3bf915=_0x4db297;}}return _0x2926f7['join']('\x0a');}if(_0x34d7bf[_0x48dc53(0xce)]<=0x64)return _0x372d41;return[..._0x34d7bf['slice'](0x0,0x1e),'\x0a...\x20['+(_0x34d7bf[_0x48dc53(0xce)]-0x32)+_0x48dc53(0xaf),..._0x34d7bf[_0x48dc53(0xd0)](-0x14)][_0x48dc53(0x99)]('\x0a');}function runCcr(_0x469d84,_0x4e28b3){const _0x10694f=a0_0x206317,_0x387b2c=_0x4e28b3[_0x10694f(0xd2)](/\\/g,'/'),_0x29f24f=_0x10694f(0xdc)+crypto['createHash'](_0x10694f(0xd9))[_0x10694f(0xa8)](_0x469d84)[_0x10694f(0xdf)]('hex')[_0x10694f(0xcc)](0x0,0xa),_0x1548e3=path[_0x10694f(0x99)](os[_0x10694f(0xc8)](),_0x10694f(0xcf)),_0x47031c=path[_0x10694f(0x99)](_0x1548e3,_0x10694f(0xae));!fs['existsSync'](_0x47031c)&&fs[_0x10694f(0xd7)](_0x47031c,{'recursive':!![]});fs['writeFileSync'](path[_0x10694f(0x99)](_0x47031c,_0x29f24f+'.txt'),_0x469d84,_0x10694f(0xab));const _0x343b20=skeletonize(_0x469d84,_0x387b2c);return _0x10694f(0xd5)+_0x29f24f+_0x10694f(0xb5)+_0x29f24f+_0x10694f(0x98)+_0x343b20;}
|
package/cli.js
CHANGED
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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']);});}
|
|
1
|
+
'use strict';const a0_0x1fbc46=a0_0x4f84;(function(_0x325096,_0x1c964e){const _0x117ff7=a0_0x4f84,_0x5670d8=_0x325096();while(!![]){try{const _0x182012=-parseInt(_0x117ff7(0x1cd))/0x1*(-parseInt(_0x117ff7(0x1cc))/0x2)+parseInt(_0x117ff7(0x1ae))/0x3*(parseInt(_0x117ff7(0x186))/0x4)+-parseInt(_0x117ff7(0x188))/0x5+parseInt(_0x117ff7(0x16d))/0x6*(-parseInt(_0x117ff7(0x190))/0x7)+parseInt(_0x117ff7(0x1d4))/0x8*(parseInt(_0x117ff7(0x1b3))/0x9)+-parseInt(_0x117ff7(0x180))/0xa+-parseInt(_0x117ff7(0x17f))/0xb;if(_0x182012===_0x1c964e)break;else _0x5670d8['push'](_0x5670d8['shift']());}catch(_0xd7cf90){_0x5670d8['push'](_0x5670d8['shift']());}}}(a0_0x5cfb,0x6ed5d));var __createBinding=this&&this[a0_0x1fbc46(0x19e)]||(Object['create']?function(_0x3b7bc0,_0x44db2b,_0x316d53,_0x2d5bf9){const _0xc813f9=a0_0x1fbc46;if(_0x2d5bf9===undefined)_0x2d5bf9=_0x316d53;var _0x307601=Object['getOwnPropertyDescriptor'](_0x44db2b,_0x316d53);(!_0x307601||(_0xc813f9(0x177)in _0x307601?!_0x44db2b['__esModule']:_0x307601[_0xc813f9(0x1d3)]||_0x307601[_0xc813f9(0x185)]))&&(_0x307601={'enumerable':!![],'get':function(){return _0x44db2b[_0x316d53];}}),Object[_0xc813f9(0x179)](_0x3b7bc0,_0x2d5bf9,_0x307601);}:function(_0x45eab2,_0x1ecc9b,_0x270856,_0x2e31fe){if(_0x2e31fe===undefined)_0x2e31fe=_0x270856;_0x45eab2[_0x2e31fe]=_0x1ecc9b[_0x270856];}),__setModuleDefault=this&&this[a0_0x1fbc46(0x1d2)]||(Object[a0_0x1fbc46(0x1c9)]?function(_0x4429e4,_0x1bddaa){const _0x13e8e5=a0_0x1fbc46;Object[_0x13e8e5(0x179)](_0x4429e4,_0x13e8e5(0x174),{'enumerable':!![],'value':_0x1bddaa});}:function(_0x2b97ff,_0x418c95){const _0x5b7541=a0_0x1fbc46;_0x2b97ff[_0x5b7541(0x174)]=_0x418c95;}),__importStar=this&&this[a0_0x1fbc46(0x1c5)]||(function(){var _0x4252d9=function(_0x342a63){const _0xb0d154=a0_0x4f84;return _0x4252d9=Object[_0xb0d154(0x1b5)]||function(_0x56a180){const _0x3a264c=_0xb0d154;var _0x351ba0=[];for(var _0x3c2e1d in _0x56a180)if(Object[_0x3a264c(0x176)]['hasOwnProperty'][_0x3a264c(0x175)](_0x56a180,_0x3c2e1d))_0x351ba0[_0x351ba0[_0x3a264c(0x184)]]=_0x3c2e1d;return _0x351ba0;},_0x4252d9(_0x342a63);};return function(_0xd86d3f){const _0x5bf5bb=a0_0x4f84;if(_0xd86d3f&&_0xd86d3f['__esModule'])return _0xd86d3f;var _0x348cfb={};if(_0xd86d3f!=null){for(var _0x34b6f3=_0x4252d9(_0xd86d3f),_0x41a739=0x0;_0x41a739<_0x34b6f3[_0x5bf5bb(0x184)];_0x41a739++)if(_0x34b6f3[_0x41a739]!=='default')__createBinding(_0x348cfb,_0xd86d3f,_0x34b6f3[_0x41a739]);}return __setModuleDefault(_0x348cfb,_0xd86d3f),_0x348cfb;};}()),__importDefault=this&&this[a0_0x1fbc46(0x181)]||function(_0x1245a4){const _0x3d4a7b=a0_0x1fbc46;return _0x1245a4&&_0x1245a4[_0x3d4a7b(0x1e0)]?_0x1245a4:{'default':_0x1245a4};};Object[a0_0x1fbc46(0x179)](exports,a0_0x1fbc46(0x1e0),{'value':!![]}),exports[a0_0x1fbc46(0x1c8)]=startDashboard;const express_1=__importDefault(require('express')),path=__importStar(require(a0_0x1fbc46(0x1df))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x1fbc46(0x1de))),tracker_1=require(a0_0x1fbc46(0x1e5)),app=(0x0,express_1['default'])();function a0_0x5cfb(){const _0x22a89d=['Missing\x20agentKey','argv','find','Raw\x20output\x20log\x20file\x20not\x20found.','kill','log','reason','__createBinding','logs','slice','.trimprompt','listen','filter','win32','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','error','then','No\x20compressible\x20content\x20found\x20in\x20this\x20session','copilot','includes','/api/config/toggle','--headless','json','1243374viiQlP','Compressed\x20output\x20log\x20file\x20not\x20found.','/api/stats/inspect/:id','message','SIGINT','5709402HWTclW','Directory\x20not\x20found','getOwnPropertyNames','now','exit','aider','getConfig','execPath','openclaw','join','SIGTERM','compactPath','child_process','http://localhost:','.comp.txt','opencode','explorer\x20\x22','/api/config/features','__importStar','conv:','ignore','startDashboard','create','cli.js','body','1456556ARrWnr','1nUobEe','codex','getStatsSummary','start','use','__setModuleDefault','writable','8YRUkWh','getLogs','index.html','resolve','catch','/favicon.png','features_enabled','post','../src/favicon.png','/api/config','open','path','__esModule','EADDRINUSE','existsSync','status','darwin','./tracker','5172qRARyd','platform','payload','lastModified','No\x20active\x20session\x20file\x20found','fullPath','reductionPct','default','call','prototype','get','command','defineProperty','favicon.png','homedir','activeSavedTokens','params','claude','5773306BozPMj','3533660xNjgud','__importDefault','utf8','Missing\x20key','length','configurable','8WEmfql','timestamp','2917695MHogAd','/api/config/open-dir','tracker','[TrimPrompt]\x20Dashboard\x20error:\x20','cursor','/api/agent/compact','readFileSync','sendFile','2240yYARvF','.raw.txt','/api/stats/summary','xdg-open\x20\x22','/api/config/custom-path','model','./file-watcher'];a0_0x5cfb=function(){return _0x22a89d;};return a0_0x5cfb();}app[a0_0x1fbc46(0x1d1)](express_1[a0_0x1fbc46(0x174)][a0_0x1fbc46(0x1ad)]());const baseDir=path[a0_0x1fbc46(0x1bc)](os[a0_0x1fbc46(0x17b)](),a0_0x1fbc46(0x1a1)),logsDir=path[a0_0x1fbc46(0x1bc)](baseDir,a0_0x1fbc46(0x19f));let configPayloadCache=null;const CONFIG_CACHE_TTL_MS=0x2710;function invalidateConfigCache(){configPayloadCache=null;}function a0_0x4f84(_0x784d6a,_0x352a){_0x784d6a=_0x784d6a-0x16d;const _0x5cfbda=a0_0x5cfb();let _0x4f849d=_0x5cfbda[_0x784d6a];return _0x4f849d;}app[a0_0x1fbc46(0x177)]('/',(_0x53c8c4,_0x9a7bcb)=>{const _0xa7f589=a0_0x1fbc46,_0x5bc6d5=path[_0xa7f589(0x1bc)](__dirname,_0xa7f589(0x1d6));fs[_0xa7f589(0x1e2)](_0x5bc6d5)?_0x9a7bcb[_0xa7f589(0x18f)](_0x5bc6d5):_0x9a7bcb['sendFile'](path[_0xa7f589(0x1bc)](__dirname,'../src/index.html'));}),app[a0_0x1fbc46(0x177)](a0_0x1fbc46(0x1d9),(_0x546880,_0x1a319d)=>{const _0x693dea=a0_0x1fbc46,_0x1d81c9=path['join'](__dirname,_0x693dea(0x17a));fs[_0x693dea(0x1e2)](_0x1d81c9)?_0x1a319d['sendFile'](_0x1d81c9):_0x1a319d[_0x693dea(0x18f)](path[_0x693dea(0x1bc)](__dirname,_0x693dea(0x1dc)));}),app[a0_0x1fbc46(0x177)](a0_0x1fbc46(0x192),(_0x140ccf,_0x5c93cc)=>{const _0x52a90e=a0_0x1fbc46,_0x132241=_0x140ccf['query'][_0x52a90e(0x195)]||'auto',_0x16dda0=tracker_1[_0x52a90e(0x18a)][_0x52a90e(0x1cf)](_0x132241);_0x5c93cc[_0x52a90e(0x1ad)](_0x16dda0);}),app[a0_0x1fbc46(0x177)]('/api/stats/history',(_0xff49da,_0xb53c84)=>{const _0xc96c9d=a0_0x1fbc46,_0x368c3c=tracker_1[_0xc96c9d(0x18a)][_0xc96c9d(0x1d5)]();_0xb53c84[_0xc96c9d(0x1ad)](_0x368c3c[_0xc96c9d(0x184)]>0x1f4?_0x368c3c[_0xc96c9d(0x1a0)](-0x1f4):_0x368c3c);}),app[a0_0x1fbc46(0x177)](a0_0x1fbc46(0x1b0),(_0x3ac379,_0x36954c)=>{const _0x9b3aef=a0_0x1fbc46,_0x252a8b=_0x3ac379[_0x9b3aef(0x17d)]['id'],_0x119253=path[_0x9b3aef(0x1bc)](logsDir,_0x252a8b+_0x9b3aef(0x191)),_0x1f2d70=path[_0x9b3aef(0x1bc)](logsDir,_0x252a8b+_0x9b3aef(0x1c1));let _0x36405f=_0x9b3aef(0x19a),_0x56a836=_0x9b3aef(0x1af);try{fs[_0x9b3aef(0x1e2)](_0x119253)&&(_0x36405f=fs['readFileSync'](_0x119253,_0x9b3aef(0x182))),fs['existsSync'](_0x1f2d70)&&(_0x56a836=fs[_0x9b3aef(0x18e)](_0x1f2d70,_0x9b3aef(0x182)));}catch(_0x455821){}_0x36954c[_0x9b3aef(0x1ad)]({'id':_0x252a8b,'raw':_0x36405f,'compressed':_0x56a836});}),app['get']('/api/config/features',(_0x1ae296,_0x3424a5)=>{const _0x4b8930=a0_0x1fbc46,_0x11d5e1=tracker_1[_0x4b8930(0x18a)][_0x4b8930(0x1b9)]();_0x3424a5[_0x4b8930(0x1ad)](_0x11d5e1['features_enabled']||{});}),app[a0_0x1fbc46(0x1db)](a0_0x1fbc46(0x1c4),(_0x271a0f,_0x2529bd)=>{const _0x2181a0=a0_0x1fbc46,_0x3e2ae3=_0x271a0f[_0x2181a0(0x1cb)];tracker_1['tracker']['setConfig'](_0x2181a0(0x1da),_0x3e2ae3),invalidateConfigCache(),_0x2529bd[_0x2181a0(0x1ad)]({'ok':!![]});}),app[a0_0x1fbc46(0x1db)](a0_0x1fbc46(0x18d),async(_0x17c94e,_0x2130e7)=>{const _0x3cdd1f=a0_0x1fbc46;try{const {getLatestSessionFile:_0x56ec34,compactSessionCopy:_0x4ec027}=await Promise[_0x3cdd1f(0x1d7)]()['then'](()=>__importStar(require('./file-watcher'))),{agentKey:_0x440a1d}=_0x17c94e['body']||{},_0x58672a=_0x440a1d||_0x3cdd1f(0x17e),_0x2c490f=_0x56ec34(_0x58672a);if(_0x2c490f&&_0x2c490f[_0x3cdd1f(0x172)]&&fs[_0x3cdd1f(0x1e2)](_0x2c490f[_0x3cdd1f(0x172)])){const _0x2fee21=_0x4ec027(_0x2c490f[_0x3cdd1f(0x172)],_0x58672a);_0x2fee21['ok']&&(_0x2fee21['savedTokens']||0x0)>0x0?_0x2130e7[_0x3cdd1f(0x1ad)]({'ok':!![],'fileName':_0x2c490f['fileName'],'tokensSaved':_0x2fee21['savedTokens'],'rawTokens':_0x2fee21['rawTokens'],'compressedTokens':_0x2fee21['compressedTokens'],'reductionPct':_0x2fee21[_0x3cdd1f(0x173)],'compactPath':_0x2fee21[_0x3cdd1f(0x1be)]}):_0x2130e7['json']({'ok':![],'message':_0x2fee21[_0x3cdd1f(0x19d)]||_0x3cdd1f(0x1a8)});}else _0x2130e7[_0x3cdd1f(0x1ad)]({'ok':![],'message':_0x3cdd1f(0x171)});}catch(_0x3bb928){_0x2130e7[_0x3cdd1f(0x1e3)](0x1f4)[_0x3cdd1f(0x1ad)]({'ok':![],'error':_0x3bb928[_0x3cdd1f(0x1b1)]});}}),app[a0_0x1fbc46(0x177)](a0_0x1fbc46(0x1dd),async(_0x15c2f7,_0x5c2ce0)=>{const _0x619907=a0_0x1fbc46;if(configPayloadCache&&Date[_0x619907(0x1b6)]()-configPayloadCache['at']<CONFIG_CACHE_TTL_MS)return _0x5c2ce0[_0x619907(0x1ad)](configPayloadCache[_0x619907(0x16f)]);const {loadConfig:_0x2af485,getAgentStoragePaths:_0x458d78,getLatestSessionFile:_0x52c765,loadSessionsState:_0x588e5d}=await Promise[_0x619907(0x1d7)]()[_0x619907(0x1a7)](()=>__importStar(require(_0x619907(0x196)))),_0x48745b=_0x2af485(),_0x164315=[_0x619907(0x17e),'gemini',_0x619907(0x1ce),_0x619907(0x18c),_0x619907(0x1b8),_0x619907(0x1a9),_0x619907(0x1bb),_0x619907(0x1c2),'cortex'],_0x13a638={},_0x1d8189={},_0x385b05={},_0x15680e=_0x588e5d(),_0x1cde8c=tracker_1[_0x619907(0x18a)]['getLogs']()||[];for(const _0x3091c4 of _0x164315){_0x13a638[_0x3091c4]=_0x458d78(_0x3091c4);const _0x14440d=_0x52c765(_0x3091c4);if(_0x14440d&&_0x14440d[_0x619907(0x172)]&&_0x15680e[_0x14440d['fullPath']])_0x14440d['activeSavedTokens']=_0x15680e[_0x14440d[_0x619907(0x172)]][_0x619907(0x17c)]||0x0;else{if(_0x14440d)_0x14440d[_0x619907(0x17c)]=0x0;}_0x385b05[_0x3091c4]=_0x14440d;const _0x1466d2=_0x1cde8c[_0x619907(0x1a3)](_0x5459c1=>_0x5459c1[_0x619907(0x178)]&&_0x5459c1[_0x619907(0x178)][_0x619907(0x1aa)](_0x619907(0x1c6)+_0x3091c4));_0x1466d2['length']>0x0?_0x1d8189[_0x3091c4]=_0x1466d2[_0x1466d2['length']-0x1][_0x619907(0x187)]:_0x1d8189[_0x3091c4]=_0x14440d?_0x14440d[_0x619907(0x170)]:null;}const _0x441936={..._0x48745b,'resolvedPaths':_0x13a638,'lastActiveTimestamps':_0x1d8189,'latestSessions':_0x385b05};configPayloadCache={'at':Date[_0x619907(0x1b6)](),'payload':_0x441936},_0x5c2ce0[_0x619907(0x1ad)](_0x441936);}),app[a0_0x1fbc46(0x1db)](a0_0x1fbc46(0x189),async(_0x374126,_0x27390b)=>{const _0x396757=a0_0x1fbc46,{getAgentStoragePaths:_0x126aea}=await Promise[_0x396757(0x1d7)]()[_0x396757(0x1a7)](()=>__importStar(require(_0x396757(0x196)))),{agentKey:_0x4cf6ce}=_0x374126[_0x396757(0x1cb)]||{};if(!_0x4cf6ce)return _0x27390b[_0x396757(0x1e3)](0x190)[_0x396757(0x1ad)]({'error':_0x396757(0x197)});const _0x59d870=_0x126aea(_0x4cf6ce),_0x1f3f5f=_0x59d870[_0x396757(0x199)](_0x1ba4a5=>fs[_0x396757(0x1e2)](_0x1ba4a5))||_0x59d870[0x0];if(_0x1f3f5f){if(!fs[_0x396757(0x1e2)](_0x1f3f5f))try{fs['mkdirSync'](_0x1f3f5f,{'recursive':!![]});}catch{}const {exec:_0x59488d}=await Promise[_0x396757(0x1d7)]()[_0x396757(0x1a7)](()=>__importStar(require(_0x396757(0x1bf)))),_0x10e4ac=process[_0x396757(0x16e)]===_0x396757(0x1a4)?_0x396757(0x1c3)+_0x1f3f5f+'\x22':process[_0x396757(0x16e)]===_0x396757(0x1e4)?'open\x20\x22'+_0x1f3f5f+'\x22':_0x396757(0x193)+_0x1f3f5f+'\x22';return _0x59488d(_0x10e4ac),_0x27390b[_0x396757(0x1ad)]({'success':!![],'openedPath':_0x1f3f5f});}_0x27390b[_0x396757(0x1e3)](0x194)[_0x396757(0x1ad)]({'error':_0x396757(0x1b4)});}),app[a0_0x1fbc46(0x1db)](a0_0x1fbc46(0x1ab),async(_0x1a47f0,_0x169873)=>{const _0x1b3c6c=a0_0x1fbc46,{saveConfig:_0x5aa2af}=await Promise[_0x1b3c6c(0x1d7)]()[_0x1b3c6c(0x1a7)](()=>__importStar(require(_0x1b3c6c(0x196)))),{key:_0x571537,value:_0x544c03}=_0x1a47f0[_0x1b3c6c(0x1cb)]||{};if(_0x571537){const _0x56a6e6=_0x5aa2af({'conversation_toggles':{[_0x571537]:_0x544c03}});return invalidateConfigCache(),_0x169873[_0x1b3c6c(0x1ad)](_0x56a6e6);}_0x169873[_0x1b3c6c(0x1e3)](0x190)['json']({'error':_0x1b3c6c(0x183)});}),app['post'](a0_0x1fbc46(0x194),async(_0x35276b,_0x2bc3e3)=>{const _0x2db46d=a0_0x1fbc46,{saveConfig:_0x761a50}=await Promise['resolve']()['then'](()=>__importStar(require(_0x2db46d(0x196)))),{agentKey:_0x4e3261,path:_0x3cded8}=_0x35276b[_0x2db46d(0x1cb)]||{};if(_0x4e3261){const _0x4f25a4=_0x761a50({'custom_storage_paths':{[_0x4e3261]:_0x3cded8||null}});return invalidateConfigCache(),_0x2bc3e3[_0x2db46d(0x1ad)](_0x4f25a4);}_0x2bc3e3['status'](0x190)['json']({'error':'Missing\x20agentKey'});});function startDashboard(_0x4d87ce=0xfa0){const _0x12cc97=a0_0x1fbc46;let _0x153efb=_0x4d87ce;const _0x1293cd=process[_0x12cc97(0x198)][_0x12cc97(0x1aa)](_0x12cc97(0x1ac))||process.env.TRIMPROMPT_HEADLESS==='1',_0x32f908=app[_0x12cc97(0x1a2)](_0x153efb,()=>{const _0x285ac7=_0x12cc97,_0x2c6d34=_0x285ac7(0x1c0)+_0x153efb;!_0x1293cd&&(console[_0x285ac7(0x19c)](_0x285ac7(0x1a5)+_0x2c6d34),console[_0x285ac7(0x19c)]('Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.'));try{const {spawn:_0xc73a1e}=require('child_process'),_0x3f4d3a=_0xc73a1e(process[_0x285ac7(0x1ba)],[path[_0x285ac7(0x1bc)](__dirname,_0x285ac7(0x1ca)),'watcher',_0x285ac7(0x1d0)],{'stdio':_0x285ac7(0x1c7),'windowsHide':!![]}),_0x340313=()=>{const _0xd14f6b=_0x285ac7;try{_0x3f4d3a[_0xd14f6b(0x19b)]();}catch{}};process['on'](_0x285ac7(0x1b7),_0x340313),process['on'](_0x285ac7(0x1b2),()=>{_0x340313(),process['exit'](0x0);}),process['on'](_0x285ac7(0x1bd),()=>{_0x340313(),process['exit'](0x0);});}catch{}!_0x1293cd&&process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1[_0x285ac7(0x174)])(_0x2c6d34)[_0x285ac7(0x1d8)](()=>{});});_0x32f908['on'](_0x12cc97(0x1a6),_0x45000c=>{const _0x24e606=_0x12cc97;_0x45000c['code']===_0x24e606(0x1e1)?startDashboard(_0x153efb+0x1):console[_0x24e606(0x1a6)](_0x24e606(0x18b)+_0x45000c[_0x24e606(0x1b1)]);});}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x237c(){var _0x41649e=['654852MDMGdT','includes','length','toLowerCase','spawn','__createBinding','pipe','Failed\x20to\x20spawn\x20command\x20\x22','__setModuleDefault','error','child_process','trim','4250637KVAAdA','7204eTVAtE','path','2AeXLTC','stdout','588462JVUcgG','split','inherit','toString','getOwnPropertyDescriptor','550289jqJaid','\x22:\x20','6nCRoKa','defineProperty','data','join','close','delimiter','prototype','5201420feNnRV','configurable','homedir','create','__esModule','hasOwnProperty','map','24TZGdRn','__importStar','default','2731440wAQecy'];a0_0x237c=function(){return _0x41649e;};return a0_0x237c();}var a0_0x191477=a0_0x37fc;(function(_0x41fde7,_0x5df267){var _0xe092d4=a0_0x37fc,_0x36587f=_0x41fde7();while(!![]){try{var _0x240ede=-parseInt(_0xe092d4(0x16f))/0x1*(-parseInt(_0xe092d4(0x168))/0x2)+-parseInt(_0xe092d4(0x171))/0x3*(parseInt(_0xe092d4(0x166))/0x4)+-parseInt(_0xe092d4(0x158))/0x5+parseInt(_0xe092d4(0x159))/0x6+parseInt(_0xe092d4(0x16a))/0x7*(parseInt(_0xe092d4(0x155))/0x8)+parseInt(_0xe092d4(0x165))/0x9+-parseInt(_0xe092d4(0x14e))/0xa;if(_0x240ede===_0x5df267)break;else _0x36587f['push'](_0x36587f['shift']());}catch(_0x2b8ae8){_0x36587f['push'](_0x36587f['shift']());}}}(a0_0x237c,0x4ca22));var __createBinding=this&&this[a0_0x191477(0x15e)]||(Object[a0_0x191477(0x151)]?function(_0x362104,_0x49e25a,_0xd2763c,_0x11b87e){var _0x3a0b37=a0_0x191477;if(_0x11b87e===undefined)_0x11b87e=_0xd2763c;var _0x480c1f=Object[_0x3a0b37(0x16e)](_0x49e25a,_0xd2763c);(!_0x480c1f||('get'in _0x480c1f?!_0x49e25a[_0x3a0b37(0x152)]:_0x480c1f['writable']||_0x480c1f[_0x3a0b37(0x14f)]))&&(_0x480c1f={'enumerable':!![],'get':function(){return _0x49e25a[_0xd2763c];}}),Object[_0x3a0b37(0x172)](_0x362104,_0x11b87e,_0x480c1f);}:function(_0x7d64e3,_0x28ea29,_0x15228d,_0x2222dd){if(_0x2222dd===undefined)_0x2222dd=_0x15228d;_0x7d64e3[_0x2222dd]=_0x28ea29[_0x15228d];}),__setModuleDefault=this&&this[a0_0x191477(0x161)]||(Object[a0_0x191477(0x151)]?function(_0x59c8c9,_0x1cb7cf){var _0x9a3047=a0_0x191477;Object[_0x9a3047(0x172)](_0x59c8c9,_0x9a3047(0x157),{'enumerable':!![],'value':_0x1cb7cf});}:function(_0x4f15e4,_0x69c3f7){var _0x964990=a0_0x191477;_0x4f15e4[_0x964990(0x157)]=_0x69c3f7;}),__importStar=this&&this[a0_0x191477(0x156)]||(function(){var _0x2fbc56=function(_0x4b56d0){return _0x2fbc56=Object['getOwnPropertyNames']||function(_0xdfea07){var _0x4772d2=a0_0x37fc,_0x4d9a39=[];for(var _0x2c4c07 in _0xdfea07)if(Object[_0x4772d2(0x14d)][_0x4772d2(0x153)]['call'](_0xdfea07,_0x2c4c07))_0x4d9a39[_0x4d9a39[_0x4772d2(0x15b)]]=_0x2c4c07;return _0x4d9a39;},_0x2fbc56(_0x4b56d0);};return function(_0x30029a){var _0xe88ddc=a0_0x37fc;if(_0x30029a&&_0x30029a['__esModule'])return _0x30029a;var _0x5c3816={};if(_0x30029a!=null){for(var _0x54d202=_0x2fbc56(_0x30029a),_0x2ac4a3=0x0;_0x2ac4a3<_0x54d202[_0xe88ddc(0x15b)];_0x2ac4a3++)if(_0x54d202[_0x2ac4a3]!==_0xe88ddc(0x157))__createBinding(_0x5c3816,_0x30029a,_0x54d202[_0x2ac4a3]);}return __setModuleDefault(_0x5c3816,_0x30029a),_0x5c3816;};}());Object[a0_0x191477(0x172)](exports,'__esModule',{'value':!![]}),exports['executeCommand']=executeCommand;const child_process_1=require(a0_0x191477(0x163)),path=__importStar(require(a0_0x191477(0x167))),os=__importStar(require('os'));function a0_0x37fc(_0x5bba5a,_0x1b7375){_0x5bba5a=_0x5bba5a-0x14a;var _0x237c18=a0_0x237c();var _0x37fc25=_0x237c18[_0x5bba5a];return _0x37fc25;}function executeCommand(_0x219440,_0x12b86f){return new Promise(_0x2eef7c=>{var _0x1332d3=a0_0x37fc;const _0x5a0316=path[_0x1332d3(0x14a)](os[_0x1332d3(0x150)](),'.trimprompt','shims'),_0x3dd9cf=(process.env.PATH||'')[_0x1332d3(0x16b)](path[_0x1332d3(0x14c)])['filter'](_0x278088=>_0x278088[_0x1332d3(0x164)]()['toLowerCase']()!==_0x5a0316[_0x1332d3(0x15c)]())[_0x1332d3(0x14a)](path[_0x1332d3(0x14c)]),_0x5ab793={...process.env,'PATH':_0x3dd9cf,'TRIMPROMPT_DISABLED':'1'},_0x5ed89f=_0x12b86f[_0x1332d3(0x154)](_0x18cf3e=>_0x18cf3e[_0x1332d3(0x15a)]('\x20')&&!_0x18cf3e['startsWith']('\x22')?'\x22'+_0x18cf3e+'\x22':_0x18cf3e),_0x34424e=[_0x219440,..._0x5ed89f][_0x1332d3(0x14a)]('\x20'),_0x390a21=(0x0,child_process_1[_0x1332d3(0x15d)])(_0x34424e,[],{'stdio':[_0x1332d3(0x16c),_0x1332d3(0x15f),_0x1332d3(0x15f)],'shell':!![],'env':_0x5ab793});let _0x41de48='',_0x36ab07='';_0x390a21[_0x1332d3(0x169)]?.['on'](_0x1332d3(0x173),_0x48fb7a=>{_0x41de48+=_0x48fb7a['toString']();}),_0x390a21['stderr']?.['on'](_0x1332d3(0x173),_0x2440c4=>{var _0xd67630=_0x1332d3;_0x36ab07+=_0x2440c4[_0xd67630(0x16d)]();}),_0x390a21['on'](_0x1332d3(0x162),_0x3e9a9c=>{var _0x1a2034=_0x1332d3;_0x2eef7c({'exitCode':0x1,'stdout':'','stderr':_0x1a2034(0x160)+_0x219440+_0x1a2034(0x170)+_0x3e9a9c['message']});}),_0x390a21['on'](_0x1332d3(0x14b),_0x375355=>{_0x2eef7c({'exitCode':_0x375355??0x0,'stdout':_0x41de48,'stderr':_0x36ab07});});});}
|
package/file-watcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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);}
|
|
1
|
+
'use strict';const a0_0x1f9d15=a0_0x2c0f;(function(_0x49225d,_0x441a41){const _0x42859b=a0_0x2c0f,_0x224fd1=_0x49225d();while(!![]){try{const _0x3b0bbb=-parseInt(_0x42859b(0x1be))/0x1+parseInt(_0x42859b(0x13f))/0x2*(parseInt(_0x42859b(0x1c7))/0x3)+-parseInt(_0x42859b(0x13b))/0x4+parseInt(_0x42859b(0x183))/0x5*(-parseInt(_0x42859b(0x189))/0x6)+parseInt(_0x42859b(0x161))/0x7*(parseInt(_0x42859b(0x1d0))/0x8)+-parseInt(_0x42859b(0x196))/0x9+parseInt(_0x42859b(0x1ca))/0xa;if(_0x3b0bbb===_0x441a41)break;else _0x224fd1['push'](_0x224fd1['shift']());}catch(_0x50f9b0){_0x224fd1['push'](_0x224fd1['shift']());}}}(a0_0x4b02,0xd779d));var __createBinding=this&&this[a0_0x1f9d15(0x13c)]||(Object['create']?function(_0x227863,_0x272f96,_0x7d61b6,_0x177cad){const _0x37c8c7=a0_0x1f9d15;if(_0x177cad===undefined)_0x177cad=_0x7d61b6;var _0x1454f3=Object['getOwnPropertyDescriptor'](_0x272f96,_0x7d61b6);(!_0x1454f3||(_0x37c8c7(0x168)in _0x1454f3?!_0x272f96['__esModule']:_0x1454f3[_0x37c8c7(0x174)]||_0x1454f3[_0x37c8c7(0x142)]))&&(_0x1454f3={'enumerable':!![],'get':function(){return _0x272f96[_0x7d61b6];}}),Object['defineProperty'](_0x227863,_0x177cad,_0x1454f3);}:function(_0x214ccb,_0x255837,_0x21b397,_0x35327c){if(_0x35327c===undefined)_0x35327c=_0x21b397;_0x214ccb[_0x35327c]=_0x255837[_0x21b397];}),__setModuleDefault=this&&this[a0_0x1f9d15(0x1d8)]||(Object[a0_0x1f9d15(0x19d)]?function(_0x29d69d,_0x5958a4){const _0x55bf57=a0_0x1f9d15;Object[_0x55bf57(0x139)](_0x29d69d,_0x55bf57(0x14c),{'enumerable':!![],'value':_0x5958a4});}:function(_0xfca22e,_0x5a5ec9){const _0x2f788b=a0_0x1f9d15;_0xfca22e[_0x2f788b(0x14c)]=_0x5a5ec9;}),__importStar=this&&this['__importStar']||(function(){var _0x49d2aa=function(_0xd8b154){const _0x5c481b=a0_0x2c0f;return _0x49d2aa=Object[_0x5c481b(0x1c0)]||function(_0x27b53e){const _0x566766=_0x5c481b;var _0x72dcc3=[];for(var _0x5cc988 in _0x27b53e)if(Object['prototype']['hasOwnProperty']['call'](_0x27b53e,_0x5cc988))_0x72dcc3[_0x72dcc3[_0x566766(0x140)]]=_0x5cc988;return _0x72dcc3;},_0x49d2aa(_0xd8b154);};return function(_0x177bb0){const _0x39a296=a0_0x2c0f;if(_0x177bb0&&_0x177bb0[_0x39a296(0x1b5)])return _0x177bb0;var _0x262a52={};if(_0x177bb0!=null){for(var _0x2ced8f=_0x49d2aa(_0x177bb0),_0x1a2a57=0x0;_0x1a2a57<_0x2ced8f[_0x39a296(0x140)];_0x1a2a57++)if(_0x2ced8f[_0x1a2a57]!==_0x39a296(0x14c))__createBinding(_0x262a52,_0x177bb0,_0x2ced8f[_0x1a2a57]);}return __setModuleDefault(_0x262a52,_0x177bb0),_0x262a52;};}());Object[a0_0x1f9d15(0x139)](exports,a0_0x1f9d15(0x1b5),{'value':!![]}),exports[a0_0x1f9d15(0x1bb)]=loadConfig,exports['saveConfig']=saveConfig,exports[a0_0x1f9d15(0x17d)]=getAgentStoragePaths,exports[a0_0x1f9d15(0x1cb)]=getLatestSessionFile,exports[a0_0x1f9d15(0x1bd)]=loadSessionsState,exports[a0_0x1f9d15(0x159)]=saveSessionStateItem,exports[a0_0x1f9d15(0x19b)]=processSessionFile,exports[a0_0x1f9d15(0x1a4)]=compactSessionCopy,exports[a0_0x1f9d15(0x1a9)]=compactLiveSession,exports[a0_0x1f9d15(0x1c3)]=installWindowsStartupService,exports[a0_0x1f9d15(0x1c6)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x1f9d15(0x134))),os=__importStar(require('os')),cache_manager_1=require(a0_0x1f9d15(0x173)),tracker_1=require(a0_0x1f9d15(0x1cf)),baseDir=path[a0_0x1f9d15(0x14b)](os[a0_0x1f9d15(0x16a)](),a0_0x1f9d15(0x12c)),configPath=path['join'](baseDir,a0_0x1f9d15(0x1ba)),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 _0xfed28=a0_0x1f9d15;try{if(!fs[_0xfed28(0x133)](baseDir))fs[_0xfed28(0x16d)](baseDir,{'recursive':!![]});if(fs[_0xfed28(0x133)](configPath)){const _0x2199ba=JSON[_0xfed28(0x138)](fs[_0xfed28(0x155)](configPath,_0xfed28(0x1a6)));return{...DEFAULT_CONFIG,..._0x2199ba,'conversation_toggles':{...DEFAULT_CONFIG[_0xfed28(0x14d)],..._0x2199ba[_0xfed28(0x14d)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG['custom_storage_paths'],..._0x2199ba[_0xfed28(0x1a5)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x2c401d){const _0x251d1c=a0_0x1f9d15,_0x18e12b=loadConfig(),_0x238a17={..._0x18e12b,..._0x2c401d,'conversation_toggles':{..._0x18e12b[_0x251d1c(0x14d)],..._0x2c401d[_0x251d1c(0x14d)]||{}},'custom_storage_paths':{..._0x18e12b[_0x251d1c(0x1a5)],..._0x2c401d['custom_storage_paths']||{}}};try{if(!fs['existsSync'](baseDir))fs[_0x251d1c(0x16d)](baseDir,{'recursive':!![]});fs[_0x251d1c(0x149)](configPath,JSON[_0x251d1c(0x194)](_0x238a17,null,0x2),_0x251d1c(0x1a6));}catch{}return _0x238a17;}function getAgentStoragePaths(_0x251390){const _0x246747=a0_0x1f9d15,_0x444fb3=loadConfig(),_0x3ab16d=_0x444fb3[_0x246747(0x1a5)][_0x251390];if(_0x3ab16d&&fs[_0x246747(0x133)](_0x3ab16d))return[_0x3ab16d];const _0x1636b9=os[_0x246747(0x16a)](),_0x1d77f9=process[_0x246747(0x18b)]===_0x246747(0x186),_0x50447b=process[_0x246747(0x18b)]===_0x246747(0x19c);switch(_0x251390){case'claude':return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x150),_0x246747(0x18a)),path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x150),_0x246747(0x1b4))];case'codex':return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x164),_0x246747(0x16e)),path['join'](_0x1636b9,_0x246747(0x123),_0x246747(0x17e),_0x246747(0x1b1))];case _0x246747(0x188):case _0x246747(0x1cc):return[path[_0x246747(0x14b)](_0x1636b9,'.gemini',_0x246747(0x1cc)),path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x127)),path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x123),_0x246747(0x17e),'Gemini'),path['join'](_0x1636b9,_0x246747(0x131),_0x246747(0x188))];case'cursor':if(_0x1d77f9)return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x123),_0x246747(0x17e),_0x246747(0x13d),'User',_0x246747(0x172))];if(_0x50447b)return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x129),_0x246747(0x165),_0x246747(0x13d),'User',_0x246747(0x172))];return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x131),_0x246747(0x13d),_0x246747(0x187),_0x246747(0x172))];case _0x246747(0x17a):return[process[_0x246747(0x137)](),path['join'](_0x1636b9,_0x246747(0x18d))];case'copilot':if(_0x1d77f9)return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x123),'Local',_0x246747(0x1ae))];return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x131),'github-copilot-cli')];case _0x246747(0x1b9):return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x1ce),_0x246747(0x185)),path[_0x246747(0x14b)](process[_0x246747(0x137)](),_0x246747(0x1ce),_0x246747(0x126))];case'opencode':return[path[_0x246747(0x14b)](_0x1636b9,_0x246747(0x146),'sessions')];case'cortex':return[path['join'](_0x1636b9,'.cortex',_0x246747(0x15b))];default:return[];}}function a0_0x2c0f(_0x5b91e3,_0x2b5f8b){_0x5b91e3=_0x5b91e3-0x11e;const _0x4b02c5=a0_0x4b02();let _0x2c0fbf=_0x4b02c5[_0x5b91e3];return _0x2c0fbf;}function getLatestSessionFile(_0x2f3cc7){const _0x255ff5=getAgentStoragePaths(_0x2f3cc7);let _0x5538c3=null,_0x476e61=0x0,_0x2ecab5=null,_0x201ec3=null;for(const _0x36bfae of _0x255ff5){if(fs['existsSync'](_0x36bfae)){if(!_0x201ec3)_0x201ec3=_0x36bfae;const _0x2e70e7=(_0x28a5aa,_0x4a2fdb=0x0)=>{const _0x5a0c7f=a0_0x2c0f;if(_0x4a2fdb>0x6)return;try{const _0x1953d9=fs['readdirSync'](_0x28a5aa,{'withFileTypes':!![]});for(const _0x28e7e9 of _0x1953d9){const _0x49a534=path['join'](_0x28a5aa,_0x28e7e9['name']);if(_0x28e7e9[_0x5a0c7f(0x144)]()){const _0x1e4411=_0x28e7e9[_0x5a0c7f(0x16c)][_0x5a0c7f(0x154)]();if(_0x1e4411===_0x5a0c7f(0x192)||_0x1e4411===_0x5a0c7f(0x190)||_0x1e4411===_0x5a0c7f(0x1c4)||_0x1e4411===_0x5a0c7f(0x1a2)||_0x1e4411===_0x5a0c7f(0x1aa)||_0x1e4411===_0x5a0c7f(0x195)||_0x1e4411===_0x5a0c7f(0x166)||_0x1e4411==='dist'||_0x1e4411===_0x5a0c7f(0x156)||_0x1e4411===_0x5a0c7f(0x15e)||_0x1e4411===_0x5a0c7f(0x143))continue;_0x2e70e7(_0x49a534,_0x4a2fdb+0x1);}else{if(_0x28e7e9[_0x5a0c7f(0x1bf)]()&&!_0x28e7e9['name']['startsWith']('.')){const _0xc89168=_0x28e7e9[_0x5a0c7f(0x16c)]['toLowerCase']();if(_0xc89168[_0x5a0c7f(0x193)](_0x5a0c7f(0x171))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x1ab))||_0xc89168['endsWith'](_0x5a0c7f(0x175))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x1d2))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x1d5))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x1d3))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x181))||_0xc89168['endsWith']('.webp')||_0xc89168['endsWith'](_0x5a0c7f(0x18e))||_0xc89168[_0x5a0c7f(0x17b)](_0x5a0c7f(0x121))||_0xc89168['endsWith']('.shm')||_0xc89168[_0x5a0c7f(0x17b)]('.tmp')||_0xc89168[_0x5a0c7f(0x17b)]('.lock')||_0xc89168[_0x5a0c7f(0x17b)]('.dat')||_0xc89168['startsWith'](_0x5a0c7f(0x145))||_0xc89168[_0x5a0c7f(0x1cd)](_0x5a0c7f(0x157)))continue;const _0x48bc76=fs[_0x5a0c7f(0x1ad)](_0x49a534);_0x48bc76[_0x5a0c7f(0x15f)]>_0x476e61&&(_0x476e61=_0x48bc76[_0x5a0c7f(0x15f)],_0x5538c3=_0x28e7e9['name'],_0x2ecab5=_0x49a534,_0x201ec3=_0x36bfae);}}}}catch{}};_0x2e70e7(_0x36bfae);}}return{'fileName':_0x5538c3,'lastModified':_0x476e61>0x0?new Date(_0x476e61)['toISOString']():null,'fullPath':_0x2ecab5,'dirPath':_0x201ec3};}const debounceTimers=new Map(),lastLoggedTimes=new Map(),OFFLOAD_THRESHOLD_CHARS=0x7d0;function compressMessageContent(_0x33defa,_0x198c3e,_0x3facf2){const _0x5ee4cc=a0_0x1f9d15;let _0x27cc2b=![],_0x379f02=0x0;if(!_0x33defa)return{'modified':_0x27cc2b,'savedTokens':_0x379f02};const _0x1db284=_0x2eb1fc=>_0x2eb1fc[_0x5ee4cc(0x1ac)](/\r\n/g,'\x0a')['replace'](/\n{3,}/g,'\x0a\x0a');if(typeof _0x33defa[_0x5ee4cc(0x19e)]===_0x5ee4cc(0x162)){let _0x437767=_0x33defa['content'],_0x122464=_0x1db284(_0x437767);_0x122464[_0x5ee4cc(0x140)]<_0x437767[_0x5ee4cc(0x140)]&&(_0x33defa[_0x5ee4cc(0x19e)]=_0x122464,_0x27cc2b=!![],_0x379f02+=Math['ceil']((_0x437767['length']-_0x122464['length'])/0x4));if(_0x33defa[_0x5ee4cc(0x19e)][_0x5ee4cc(0x140)]>OFFLOAD_THRESHOLD_CHARS&&!_0x33defa[_0x5ee4cc(0x19e)][_0x5ee4cc(0x193)]('TrimPrompt\x20Cache\x20Engine')){const _0x5b669b=_0x5ee4cc(0x14e)+Math[_0x5ee4cc(0x141)](_0x33defa['content'][_0x5ee4cc(0x140)]/0x4)+'\x20tokens).',_0x5d38fa=(0x0,cache_manager_1['saveChunk'])(_0x198c3e,_0x3facf2,_0x33defa['content'],_0x5b669b);_0x33defa['content']=_0x5ee4cc(0x15c)+_0x5d38fa['raw_tokens']+'\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x5d38fa[_0x5ee4cc(0x1a7)]+'`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20'+_0x5d38fa[_0x5ee4cc(0x1a7)]+'`\x0a',_0x27cc2b=!![],_0x379f02+=Math[_0x5ee4cc(0x176)](0x0,_0x5d38fa['raw_tokens']-_0x5d38fa[_0x5ee4cc(0x15d)]);}}else{if(Array[_0x5ee4cc(0x19a)](_0x33defa['content']))for(const _0x1f405a of _0x33defa[_0x5ee4cc(0x19e)]){if(_0x1f405a&&typeof _0x1f405a==='object'){if(typeof _0x1f405a['text']===_0x5ee4cc(0x162)){let _0x26028d=_0x1f405a[_0x5ee4cc(0x169)],_0x15ad12=_0x1db284(_0x26028d);_0x15ad12[_0x5ee4cc(0x140)]<_0x26028d['length']&&(_0x1f405a['text']=_0x15ad12,_0x27cc2b=!![],_0x379f02+=Math['ceil']((_0x26028d[_0x5ee4cc(0x140)]-_0x15ad12[_0x5ee4cc(0x140)])/0x4));if(_0x1f405a[_0x5ee4cc(0x169)][_0x5ee4cc(0x140)]>OFFLOAD_THRESHOLD_CHARS&&!_0x1f405a[_0x5ee4cc(0x169)][_0x5ee4cc(0x193)](_0x5ee4cc(0x1a8))){const _0x93856e='Summary:\x20Text\x20block\x20offloaded\x20('+Math[_0x5ee4cc(0x141)](_0x1f405a[_0x5ee4cc(0x169)]['length']/0x4)+_0x5ee4cc(0x152),_0x16f7ef=(0x0,cache_manager_1[_0x5ee4cc(0x14a)])(_0x198c3e,_0x3facf2,_0x1f405a['text'],_0x93856e);_0x1f405a['text']='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x16f7ef[_0x5ee4cc(0x1a7)]+_0x5ee4cc(0x12e)+_0x16f7ef[_0x5ee4cc(0x1a7)]+'`\x0a',_0x27cc2b=!![],_0x379f02+=Math['max'](0x0,_0x16f7ef[_0x5ee4cc(0x122)]-_0x16f7ef[_0x5ee4cc(0x15d)]);}}else{if(typeof _0x1f405a[_0x5ee4cc(0x19e)]===_0x5ee4cc(0x162)){let _0x759ac7=_0x1f405a[_0x5ee4cc(0x19e)],_0x5b7404=_0x1db284(_0x759ac7);_0x5b7404[_0x5ee4cc(0x140)]<_0x759ac7[_0x5ee4cc(0x140)]&&(_0x1f405a[_0x5ee4cc(0x19e)]=_0x5b7404,_0x27cc2b=!![],_0x379f02+=Math[_0x5ee4cc(0x141)]((_0x759ac7[_0x5ee4cc(0x140)]-_0x5b7404[_0x5ee4cc(0x140)])/0x4));if(_0x1f405a[_0x5ee4cc(0x19e)][_0x5ee4cc(0x140)]>OFFLOAD_THRESHOLD_CHARS&&!_0x1f405a[_0x5ee4cc(0x19e)][_0x5ee4cc(0x193)](_0x5ee4cc(0x1a8))){const _0x277d52=_0x5ee4cc(0x158)+Math[_0x5ee4cc(0x141)](_0x1f405a['content'][_0x5ee4cc(0x140)]/0x4)+'\x20tokens).',_0x3b8d00=(0x0,cache_manager_1['saveChunk'])(_0x198c3e,_0x3facf2,_0x1f405a[_0x5ee4cc(0x19e)],_0x277d52);_0x1f405a[_0x5ee4cc(0x19e)]=_0x5ee4cc(0x132)+_0x3b8d00['chunk_id']+_0x5ee4cc(0x12e)+_0x3b8d00[_0x5ee4cc(0x1a7)]+'`\x0a',_0x27cc2b=!![],_0x379f02+=Math[_0x5ee4cc(0x176)](0x0,_0x3b8d00['raw_tokens']-_0x3b8d00[_0x5ee4cc(0x15d)]);}}}}}}return{'modified':_0x27cc2b,'savedTokens':_0x379f02};}const sessionsStatePath=path[a0_0x1f9d15(0x14b)](baseDir,a0_0x1f9d15(0x151));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x85cd4a=a0_0x1f9d15;try{if(fs[_0x85cd4a(0x133)](sessionsStatePath)){const _0x371a2f=JSON[_0x85cd4a(0x138)](fs['readFileSync'](sessionsStatePath,_0x85cd4a(0x1a6)));if(_0x371a2f&&typeof _0x371a2f==='object')return sessionsStateMemoryCache=_0x371a2f,_0x371a2f;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x217088,_0x35ef21,_0x533b5c,_0x4c1802=0x0,_0x515054=0x0,_0x2c9bca=0x0){const _0x55d187=a0_0x1f9d15;try{const _0x4dc4a7=loadSessionsState(),_0x1a2aae=_0x4dc4a7[_0x217088]||{},_0x50a375=_0x515054||_0x1a2aae['autoCompactSaved']||0x0,_0x10de4b=_0x2c9bca||_0x1a2aae[_0x55d187(0x1b0)]||0x0,_0x316658=_0x533b5c!==undefined?_0x533b5c:_0x1a2aae[_0x55d187(0x1b6)]||0x0;_0x4dc4a7[_0x217088]={'lineCount':_0x35ef21||_0x1a2aae[_0x55d187(0x1b7)]||0x1,'activeSavedTokens':_0x316658+_0x50a375+_0x10de4b,'sideCacheSaved':_0x4c1802||_0x1a2aae[_0x55d187(0x160)]||0x0,'officialCompactSaved':_0x316658,'autoCompactSaved':_0x50a375,'hookSavedTokens':_0x10de4b},sessionsStateMemoryCache=_0x4dc4a7;if(!fs['existsSync'](baseDir))fs[_0x55d187(0x16d)](baseDir,{'recursive':!![]});const _0x31ff8a=sessionsStatePath+_0x55d187(0x17c);fs[_0x55d187(0x149)](_0x31ff8a,JSON['stringify'](_0x4dc4a7,null,0x2),_0x55d187(0x1a6)),fs['renameSync'](_0x31ff8a,sessionsStatePath);}catch{}}function processSessionFile(_0x5028a5,_0xf332ac){const _0x5848c4=a0_0x1f9d15;try{if(!fs[_0x5848c4(0x133)](_0x5028a5))return;const _0x4e5857=fs[_0x5848c4(0x1ad)](_0x5028a5);if(_0x4e5857[_0x5848c4(0x144)]()||_0x4e5857['size']===0x0)return;const _0x5639bb=loadConfig(),_0x57a2f7=_0x5848c4(0x11f)+_0xf332ac;if(_0x5639bb[_0x5848c4(0x14d)][_0x57a2f7]===![])return;const _0x8ae682=fs[_0x5848c4(0x155)](_0x5028a5,_0x5848c4(0x1a6)),_0xf3c6c5=path[_0x5848c4(0x18f)](_0x5028a5)[_0x5848c4(0x154)]();let _0x4a7a15=0x1;if(_0xf3c6c5===_0x5848c4(0x167)||_0xf3c6c5===_0x5848c4(0x136))_0x4a7a15=_0x8ae682[_0x5848c4(0x12b)]('\x0a')[_0x5848c4(0x191)](Boolean)[_0x5848c4(0x140)];else{if(_0xf3c6c5===_0x5848c4(0x1c1))try{const _0x3beacf=JSON[_0x5848c4(0x138)](_0x8ae682),_0x3db2e7=Array[_0x5848c4(0x19a)](_0x3beacf[_0x5848c4(0x178)])?_0x3beacf[_0x5848c4(0x178)]:Array[_0x5848c4(0x19a)](_0x3beacf)?_0x3beacf:null;if(_0x3db2e7)_0x4a7a15=_0x3db2e7[_0x5848c4(0x140)];}catch{}}let _0x182cda=0x0;if((_0xf3c6c5==='.jsonl'||_0xf3c6c5===_0x5848c4(0x136))&&_0x8ae682[_0x5848c4(0x193)](_0x5848c4(0x148))&&_0x8ae682[_0x5848c4(0x193)](_0x5848c4(0x184))){const _0x5a2b21=/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi;for(const _0x39f575 of _0x8ae682[_0x5848c4(0x12b)]('\x0a')){if(!_0x39f575[_0x5848c4(0x193)](_0x5848c4(0x148))||!_0x39f575[_0x5848c4(0x193)](_0x5848c4(0x184)))continue;try{const _0x145138=JSON[_0x5848c4(0x138)](_0x39f575);if(_0x145138[_0x5848c4(0x120)]!=='system')continue;const _0x57fc28=typeof _0x145138[_0x5848c4(0x19e)]===_0x5848c4(0x162)?_0x145138['content']:_0x145138[_0x5848c4(0x179)]&&typeof _0x145138[_0x5848c4(0x179)][_0x5848c4(0x19e)]===_0x5848c4(0x162)?_0x145138['message'][_0x5848c4(0x19e)]:'';if(!_0x57fc28)continue;for(const _0x33ad63 of _0x57fc28['matchAll'](_0x5a2b21)){let _0x5b1a7d=parseFloat(_0x33ad63[0x1]);if(_0x33ad63[0x0][_0x5848c4(0x154)]()[_0x5848c4(0x193)]('k'))_0x5b1a7d=_0x5b1a7d*0x3e8;_0x182cda+=Math[_0x5848c4(0x13a)](_0x5b1a7d);}}catch{}}}const _0x283d42=loadSessionsState(),_0x408ec9=_0x283d42[_0x5028a5],_0x3c3208=_0x408ec9?_0x408ec9[_0x5848c4(0x1b7)]:0x0,_0x94a06e=_0x408ec9?_0x408ec9[_0x5848c4(0x1a3)]||0x0:0x0;if(_0x3c3208>0x0&&_0x4a7a15>_0x3c3208&&_0x94a06e>0x0){const _0x247ee4=_0x5848c4(0x180)+_0xf332ac;tracker_1[_0x5848c4(0x163)][_0x5848c4(0x19f)](_0x247ee4,'A'[_0x5848c4(0x170)](_0x94a06e*0x4),'',0x0,undefined,['conv_'+_0xf332ac,'live-conv',_0xf332ac,'prompt_turn']);}const _0x5d4c70=_0x408ec9&&_0x408ec9[_0x5848c4(0x1b6)]!==undefined?_0x408ec9[_0x5848c4(0x1b6)]:0x0,_0x11daea=Math[_0x5848c4(0x176)](_0x5d4c70,_0x182cda);saveSessionStateItem(_0x5028a5,_0x4a7a15,_0x11daea,0x0,0x0,0x0);}catch{}}function compactSessionCopy(_0x3f2425,_0x400a2f){const _0x5feacb=a0_0x1f9d15;try{if(!fs[_0x5feacb(0x133)](_0x3f2425))return{'ok':![],'reason':'Session\x20file\x20not\x20found'};const _0x28f60a=path['extname'](_0x3f2425)[_0x5feacb(0x154)]();if(_0x28f60a!=='.json'&&_0x28f60a!==_0x5feacb(0x167)&&_0x28f60a!=='.json1')return{'ok':![],'reason':_0x5feacb(0x1a0)+(_0x28f60a||_0x5feacb(0x16f))+_0x5feacb(0x125)};const _0x233716=fs['readFileSync'](_0x3f2425,_0x5feacb(0x1a6)),_0x52ceeb=Buffer[_0x5feacb(0x198)](_0x233716,_0x5feacb(0x1a6)),_0x2ee70d=path['basename'](_0x3f2425,_0x28f60a);let _0x4322b6=_0x233716,_0x5d155f=![];if(_0x28f60a===_0x5feacb(0x1c1)){const _0x46b6ca=JSON[_0x5feacb(0x138)](_0x233716),_0x21ffb9=Array[_0x5feacb(0x19a)](_0x46b6ca['messages'])?_0x46b6ca['messages']:Array['isArray'](_0x46b6ca)?_0x46b6ca:null;if(_0x21ffb9){for(const _0x4d1954 of _0x21ffb9){const _0x832e8c=compressMessageContent(_0x4d1954,_0x2ee70d,_0x400a2f);if(_0x832e8c[_0x5feacb(0x1c2)])_0x5d155f=!![];}if(_0x5d155f)_0x4322b6=JSON['stringify'](_0x46b6ca,null,0x2);}}else{const _0xbcf97e=_0x233716[_0x5feacb(0x12b)]('\x0a'),_0x5b7711=[];for(let _0x3cf99a of _0xbcf97e){if(!_0x3cf99a['trim']()){_0x5b7711['push'](_0x3cf99a);continue;}try{const _0x153c32=JSON[_0x5feacb(0x138)](_0x3cf99a),_0x403f13=_0x153c32['message']||_0x153c32;if(_0x403f13){const _0x91baed=compressMessageContent(_0x403f13,_0x2ee70d,_0x400a2f);_0x91baed[_0x5feacb(0x1c2)]&&(_0x5d155f=!![],_0x3cf99a=JSON[_0x5feacb(0x194)](_0x153c32));}}catch{}_0x5b7711['push'](_0x3cf99a);}if(_0x5d155f)_0x4322b6=_0x5b7711[_0x5feacb(0x14b)]('\x0a');}const _0x1c68bd=Buffer[_0x5feacb(0x198)](_0x4322b6,_0x5feacb(0x1a6)),_0x21cd89=path[_0x5feacb(0x14b)](path[_0x5feacb(0x12d)](_0x3f2425),_0x2ee70d+_0x5feacb(0x171)+_0x28f60a);fs[_0x5feacb(0x149)](_0x21cd89,_0x4322b6,_0x5feacb(0x1a6));const _0x24f756=Math[_0x5feacb(0x141)](_0x52ceeb/0x4),_0x4ac63a=Math[_0x5feacb(0x141)](_0x1c68bd/0x4),_0x4f8195=Math['max'](0x0,_0x24f756-_0x4ac63a),_0x3ae99b=_0x52ceeb>0x0?Math[_0x5feacb(0x13a)]((0x1-_0x1c68bd/_0x52ceeb)*0x3e8)/0xa:0x0;return _0x4f8195>0x0&&tracker_1[_0x5feacb(0x163)][_0x5feacb(0x19f)]('compact:'+_0x400a2f,_0x233716,_0x4322b6,_0x4f8195,undefined,['conv_'+_0x400a2f,'live-conv',_0x400a2f,_0x5feacb(0x124)]),{'ok':!![],'compactPath':_0x21cd89,'rawBytes':_0x52ceeb,'compressedBytes':_0x1c68bd,'rawTokens':_0x24f756,'compressedTokens':_0x4ac63a,'savedTokens':_0x4f8195,'reductionPct':_0x3ae99b};}catch(_0x549743){return{'ok':![],'reason':_0x549743?.['message']||_0x5feacb(0x18c)};}}function compactLiveSession(_0x228845,_0x3d4880){const _0xed72c5=a0_0x1f9d15;try{if(!fs['existsSync'](_0x228845))return{'ok':![],'savedTokens':0x0,'reason':_0xed72c5(0x1d1)};const _0x3ab526=path[_0xed72c5(0x18f)](_0x228845)[_0xed72c5(0x154)]();if(_0x3ab526!==_0xed72c5(0x1c1)&&_0x3ab526!=='.jsonl'&&_0x3ab526!=='.json1')return{'ok':![],'savedTokens':0x0,'reason':_0xed72c5(0x177)};const _0x1d2a7c=fs[_0xed72c5(0x155)](_0x228845,_0xed72c5(0x1a6)),_0x3a1c35=Buffer[_0xed72c5(0x198)](_0x1d2a7c,_0xed72c5(0x1a6)),_0x2b6acd=Math[_0xed72c5(0x141)](_0x3a1c35/0x4),_0x1a1461=path[_0xed72c5(0x1b3)](_0x228845,_0x3ab526);let _0x543951=_0x1d2a7c,_0x29fd05=![];if(_0x3ab526===_0xed72c5(0x1c1)){const _0x3fa573=JSON['parse'](_0x1d2a7c),_0x769171=Array[_0xed72c5(0x19a)](_0x3fa573['messages'])?_0x3fa573[_0xed72c5(0x178)]:Array['isArray'](_0x3fa573)?_0x3fa573:null;if(_0x769171){for(const _0x314f83 of _0x769171){const _0x11b79e=compressMessageContent(_0x314f83,_0x1a1461,_0x3d4880);if(_0x11b79e['modified'])_0x29fd05=!![];}const {compressConversation:_0x569077}=require(_0xed72c5(0x197)),_0x30280f=_0x569077(_0x769171,0x9c40);_0x30280f['savedTokens']>0x0&&(_0x29fd05=!![],Array['isArray'](_0x3fa573[_0xed72c5(0x178)])?_0x3fa573[_0xed72c5(0x178)]=_0x30280f[_0xed72c5(0x178)]:_0x543951=JSON[_0xed72c5(0x194)](_0x30280f['messages'],null,0x2)),_0x29fd05&&!Array[_0xed72c5(0x19a)](_0x3fa573)&&(_0x543951=JSON['stringify'](_0x3fa573,null,0x2));}}else{const _0x29d504=_0x1d2a7c[_0xed72c5(0x12b)]('\x0a'),_0x4f37ad=[],_0x3a1f9a=[];for(const _0x3f36ea of _0x29d504){if(!_0x3f36ea[_0xed72c5(0x153)]())continue;try{const _0x4c60e7=JSON[_0xed72c5(0x138)](_0x3f36ea);_0x4f37ad[_0xed72c5(0x182)](_0x4c60e7);const _0x203217=_0x4c60e7[_0xed72c5(0x179)]||_0x4c60e7;_0x203217&&typeof _0x203217[_0xed72c5(0x12a)]===_0xed72c5(0x162)&&_0x3a1f9a['push'](_0x203217);}catch{}}for(const _0x227bbb of _0x3a1f9a){const _0x3d74b9=compressMessageContent(_0x227bbb,_0x1a1461,_0x3d4880);if(_0x3d74b9[_0xed72c5(0x1c2)])_0x29fd05=!![];}const {compressConversation:_0x43874e}=require(_0xed72c5(0x197)),_0xd49f0a=_0x43874e(_0x3a1f9a,0x9c40);if(_0xd49f0a[_0xed72c5(0x1d4)]>0x0||_0x29fd05){const _0x38211d=[];for(const _0x114a28 of _0x4f37ad){const _0x28f528=_0x114a28[_0xed72c5(0x179)]||_0x114a28;if(_0x28f528&&typeof _0x28f528[_0xed72c5(0x12a)]===_0xed72c5(0x162)){const _0x221017=_0xd49f0a[_0xed72c5(0x178)][_0xed72c5(0x147)](_0x143fd6=>_0x143fd6===_0x28f528);_0x221017?(_0x114a28[_0xed72c5(0x179)]?_0x114a28[_0xed72c5(0x179)]=_0x221017:Object[_0xed72c5(0x135)](_0x114a28,_0x221017),_0x38211d['push'](JSON[_0xed72c5(0x194)](_0x114a28))):_0x29fd05=!![];}else _0x38211d[_0xed72c5(0x182)](JSON[_0xed72c5(0x194)](_0x114a28));}_0x543951=_0x38211d['join']('\x0a'),_0x29fd05=!![];}}if(_0x29fd05){const _0x272879=Buffer[_0xed72c5(0x198)](_0x543951,'utf8');fs[_0xed72c5(0x149)](_0x228845,_0x543951,'utf8');const _0x116928=Math[_0xed72c5(0x141)](_0x272879/0x4),_0x56c145=Math['max'](0x0,_0x2b6acd-_0x116928);if(_0x56c145>0x0){const _0xd3ad61=loadSessionsState(),_0x40e414=_0xd3ad61[_0x228845]||{'lineCount':0x1,'activeSavedTokens':0x0,'sideCacheSaved':0x0,'officialCompactSaved':0x0,'autoCompactSaved':0x0},_0x413f27=_0x40e414[_0xed72c5(0x1c9)]||0x0,_0x483895=_0x413f27+_0x56c145;saveSessionStateItem(_0x228845,_0x40e414[_0xed72c5(0x1b7)],_0x40e414[_0xed72c5(0x1b6)]||0x0,_0x40e414['sideCacheSaved']||0x0,_0x483895,_0x40e414['hookSavedTokens']||0x0),tracker_1[_0xed72c5(0x163)][_0xed72c5(0x19f)](_0xed72c5(0x14f)+_0x3d4880,_0x1d2a7c,_0x543951,_0x56c145,undefined,[_0xed72c5(0x11f)+_0x3d4880,_0xed72c5(0x1d6),_0x3d4880,_0xed72c5(0x124)]);}return{'ok':!![],'savedTokens':_0x56c145};}return{'ok':!![],'savedTokens':0x0};}catch(_0x581b8d){return{'ok':![],'savedTokens':0x0,'reason':_0x581b8d[_0xed72c5(0x179)]||_0xed72c5(0x13e)};}}function installWindowsStartupService(){const _0x5c4e50=a0_0x1f9d15;if(process['platform']!=='win32')return;try{const _0xa91162=path[_0x5c4e50(0x14b)](os['homedir'](),'AppData','Roaming','Microsoft',_0x5c4e50(0x128),'Start\x20Menu',_0x5c4e50(0x1c5),_0x5c4e50(0x199));if(!fs['existsSync'](_0xa91162))fs['mkdirSync'](_0xa91162,{'recursive':!![]});const _0x2cadb8=path[_0x5c4e50(0x14b)](_0xa91162,_0x5c4e50(0x12f)),_0x2192a1=path[_0x5c4e50(0x14b)](__dirname,_0x5c4e50(0x17f)),_0x2b900c=_0x2192a1[_0x5c4e50(0x1ac)](/\\/g,'\x5c\x5c'),_0x388af5=_0x5c4e50(0x130)+_0x2b900c+_0x5c4e50(0x1c8);fs[_0x5c4e50(0x149)](_0x2cadb8,_0x388af5,_0x5c4e50(0x1a6));}catch{}}function startWatcherDaemon(){const _0x382c77=a0_0x1f9d15;installWindowsStartupService();try{const {installClaudeHooks:_0x5177b7}=require(_0x382c77(0x1af));_0x5177b7();}catch(_0x35a884){}const _0x8145e3=['claude',_0x382c77(0x188),_0x382c77(0x11e),_0x382c77(0x16b),_0x382c77(0x17a),_0x382c77(0x1b8),_0x382c77(0x1b9),'opencode',_0x382c77(0x1a1)];for(const _0x38f61f of _0x8145e3){const _0x19878f=getAgentStoragePaths(_0x38f61f);for(const _0x45d913 of _0x19878f){if(fs[_0x382c77(0x133)](_0x45d913))try{fs[_0x382c77(0x1d7)](_0x45d913,{'recursive':!![]},(_0x44a963,_0x365c08)=>{const _0x5b9ca8=_0x382c77;if(!_0x365c08)return;const _0x2b9019=path[_0x5b9ca8(0x14b)](_0x45d913,_0x365c08);if(debounceTimers[_0x5b9ca8(0x15a)](_0x2b9019))clearTimeout(debounceTimers[_0x5b9ca8(0x168)](_0x2b9019));const _0xa211f5=setTimeout(()=>processSessionFile(_0x2b9019,_0x38f61f),0x1f4);debounceTimers[_0x5b9ca8(0x1b2)](_0x2b9019,_0xa211f5);});}catch{}}}setInterval(()=>{const _0x509d03=_0x382c77;for(const _0x1511b8 of _0x8145e3){try{const _0x51d9c4=getLatestSessionFile(_0x1511b8);_0x51d9c4&&_0x51d9c4['fullPath']&&processSessionFile(_0x51d9c4[_0x509d03(0x1bc)],_0x1511b8);}catch{}}},0xbb8);const _0x5d0464=()=>{const _0x1273eb=_0x382c77;for(const _0x557959 of _0x8145e3){try{const _0x3e2008=getLatestSessionFile(_0x557959);_0x3e2008&&_0x3e2008[_0x1273eb(0x1bc)]&&compactLiveSession(_0x3e2008[_0x1273eb(0x1bc)],_0x557959);}catch{}}};setTimeout(_0x5d0464,0x7d0),setInterval(_0x5d0464,0x2bf20);}function a0_0x4b02(){const _0x5e0884=['sessions','none','repeat','.compact','workspaceStorage','./cache-manager','writable','.vscdb','max','Unsupported\x20extension','messages','message','aider','endsWith','.tmp','getAgentStoragePaths','Roaming','cli.js','conv:','.gif','push','5IYragk','tokens','storage','win32','User','gemini','4919442OfqHIf','projects','platform','compaction\x20failed','.aider.chat.history.md','.pb','extname','.git','filter','node_modules','includes','stringify','__pycache__','6697269AqrpBq','./proxy-conv','byteLength','Startup','isArray','processSessionFile','darwin','create','content','logExecution','Unsupported\x20format\x20\x27','cortex','env','activeSavedTokens','compactSessionCopy','custom_storage_paths','utf8','chunk_id','TrimPrompt\x20Cache\x20Engine','compactLiveSession','venv','.db','replace','statSync','github-copilot-cli','./hooks/claude-hook','hookSavedTokens','Codex','set','basename','history','__esModule','officialCompactSaved','lineCount','copilot','openclaw','config.json','loadConfig','fullPath','loadSessionsState','1744214AQCFtI','isFile','getOwnPropertyNames','.json','modified','installWindowsStartupService','.venv','Programs','startWatcherDaemon','3FUswMe','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','autoCompactSaved','26137980gizCzn','getLatestSessionFile','antigravity','startsWith','.openclaw','./tracker','101256GKXKjY','File\x20not\x20found','.png','.jpeg','savedTokens','.jpg','live-conv','watch','__setModuleDefault','codex','conv_','type','.wal','raw_tokens','AppData','compact_copy','\x27\x20—\x20only\x20JSON/JSONL\x20sessions\x20can\x20be\x20compacted\x20(binary\x20.pb/.db\x20stores\x20are\x20not\x20supported)','context','.gemini','Windows','Library','role','split','.trimprompt','dirname','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','TrimPromptDaemon.vbs','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','.config','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','existsSync','path','assign','.json1','cwd','parse','defineProperty','round','253072hLyhaI','__createBinding','Cursor','Compaction\x20failed','1863058cUpwSq','length','ceil','configurable','.agents','isDirectory','media__','.opencode','find','saved','writeFileSync','saveChunk','join','default','conversation_toggles','Summary:\x20Content\x20offloaded\x20(','compact:','.claude','sessions_state.json','\x20tokens).','trim','toLowerCase','readFileSync','build','image_','Summary:\x20Tool\x20result\x20offloaded\x20(','saveSessionStateItem','has','cache','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','compressed_tokens','out','mtimeMs','sideCacheSaved','392VFbqZE','string','tracker','.codex','Application\x20Support','.next','.jsonl','get','text','homedir','cursor','name','mkdirSync'];a0_0x4b02=function(){return _0x5e0884;};return a0_0x4b02();}
|
package/filters/devops.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x3c8c(){const _0x1310e2=['1334583XEQtMi','includes','filterRuff','540304DUFfpg','Ruff:\x20','\x20\x20...\x20+','match','\x20files','push','\x20log\x20lines\x20total)','substring','14nAZMoo','\x20more\x20resources','No\x20containers\x20running','Ruff:\x20all\x20checks\x20passed','2usVyWu','\x20total','\x20issues\x20in\x20','logs','390ipQeOG','\x20more\x20files','60IECgpv','1559976aGBaJI','defineProperty','Docker\x20images:\x20','2126991UWmdqV','\x20lines\x20truncated]\x20...\x0a','filter','filterDockerPs','\x20\x20...\x20(','20UaLRAq','2872760hBqKpW','Events:','split','8210807ZQrufR','join','4TVRChc','All\x20checks\x20passed','startsWith','__esModule','\x20more\x20lines','filterDockerLogs','Containers:\x20','\x20more\x20images','226890ZslKao','length','Found\x200\x20error','slice','...\x20+','trim','\x20resources\x20found'];a0_0x3c8c=function(){return _0x1310e2;};return a0_0x3c8c();}const a0_0x25abc8=a0_0x5749;(function(_0x521aa1,_0x204c4a){const _0x52b0ac=a0_0x5749,_0x183c86=_0x521aa1();while(!![]){try{const _0x3e6fd4=parseInt(_0x52b0ac(0x167))/0x1*(-parseInt(_0x52b0ac(0x15b))/0x2)+parseInt(_0x52b0ac(0x171))/0x3*(-parseInt(_0x52b0ac(0x17c))/0x4)+parseInt(_0x52b0ac(0x184))/0x5*(-parseInt(_0x52b0ac(0x16d))/0x6)+parseInt(_0x52b0ac(0x163))/0x7*(-parseInt(_0x52b0ac(0x177))/0x8)+-parseInt(_0x52b0ac(0x158))/0x9*(parseInt(_0x52b0ac(0x176))/0xa)+-parseInt(_0x52b0ac(0x17a))/0xb+parseInt(_0x52b0ac(0x16e))/0xc*(parseInt(_0x52b0ac(0x16b))/0xd);if(_0x3e6fd4===_0x204c4a)break;else _0x183c86['push'](_0x183c86['shift']());}catch(_0x331711){_0x183c86['push'](_0x183c86['shift']());}}}(a0_0x3c8c,0x6a5ca));Object[a0_0x25abc8(0x16f)](exports,a0_0x25abc8(0x17f),{'value':!![]}),exports[a0_0x25abc8(0x174)]=filterDockerPs,exports['filterDockerImages']=filterDockerImages,exports[a0_0x25abc8(0x181)]=filterDockerLogs,exports['filterKubectl']=filterKubectl,exports[a0_0x25abc8(0x15a)]=filterRuff;function filterDockerPs(_0x41bff3){const _0x2ad973=a0_0x25abc8,_0x2bd358=_0x41bff3[_0x2ad973(0x179)]('\x0a')['filter'](_0x2589d0=>_0x2589d0[_0x2ad973(0x156)]()[_0x2ad973(0x152)]>0x0);if(_0x2bd358[_0x2ad973(0x152)]===0x0)return _0x2ad973(0x165);if(_0x2bd358[_0x2ad973(0x152)]<=0xa)return _0x41bff3[_0x2ad973(0x156)]();const _0xe03b94=_0x2bd358[0x0],_0x14a946=_0x2bd358[_0x2ad973(0x154)](0x1),_0x292456=[];_0x292456[_0x2ad973(0x160)](_0x2ad973(0x182)+_0x14a946[_0x2ad973(0x152)]+_0x2ad973(0x168)),_0x292456[_0x2ad973(0x160)]('');for(const _0x1a3c9d of _0x14a946){const _0x4edf43=_0x1a3c9d['split'](/\s{2,}/);if(_0x4edf43[_0x2ad973(0x152)]>=0x5){const _0x4e3887=_0x4edf43[0x0][_0x2ad973(0x162)](0x0,0xc),_0x10c7c9=_0x4edf43[0x1],_0x53cc4b=_0x4edf43[_0x4edf43[_0x2ad973(0x152)]-0x2]||'',_0x242af6=_0x4edf43[_0x4edf43[_0x2ad973(0x152)]-0x1]||'';_0x292456[_0x2ad973(0x160)]('\x20\x20'+_0x4e3887+'\x20\x20'+_0x10c7c9+'\x20\x20'+_0x53cc4b+'\x20\x20'+_0x242af6);}else _0x292456[_0x2ad973(0x160)]('\x20\x20'+_0x1a3c9d[_0x2ad973(0x156)]());}return _0x292456[_0x2ad973(0x17b)]('\x0a');}function filterDockerImages(_0x394c37){const _0x1d20b4=a0_0x25abc8,_0x4266ec=_0x394c37[_0x1d20b4(0x179)]('\x0a')[_0x1d20b4(0x173)](_0x25da5f=>_0x25da5f[_0x1d20b4(0x156)]()[_0x1d20b4(0x152)]>0x0);if(_0x4266ec[_0x1d20b4(0x152)]<=0x1)return'No\x20images\x20found';if(_0x4266ec[_0x1d20b4(0x152)]<=0xf)return _0x394c37[_0x1d20b4(0x156)]();const _0x1eed06=_0x4266ec['slice'](0x1),_0x1ce29d=[_0x1d20b4(0x170)+_0x1eed06[_0x1d20b4(0x152)]+_0x1d20b4(0x168)];_0x1ce29d[_0x1d20b4(0x160)]('');const _0x262b64=_0x1eed06[_0x1d20b4(0x154)](0x0,0x14);for(const _0x2e274a of _0x262b64){const _0x77279f=_0x2e274a[_0x1d20b4(0x179)](/\s{2,}/);if(_0x77279f[_0x1d20b4(0x152)]>=0x3){const _0x5ead5f=_0x77279f[0x0],_0x7a4fc7=_0x77279f[0x1],_0x6a55fb=_0x77279f[_0x77279f[_0x1d20b4(0x152)]-0x1]||'';_0x1ce29d[_0x1d20b4(0x160)]('\x20\x20'+_0x5ead5f+':'+_0x7a4fc7+'\x20\x20'+_0x6a55fb);}else _0x1ce29d[_0x1d20b4(0x160)]('\x20\x20'+_0x2e274a[_0x1d20b4(0x156)]());}return _0x1eed06[_0x1d20b4(0x152)]>0x14&&_0x1ce29d[_0x1d20b4(0x160)]('\x20\x20...\x20+'+(_0x1eed06[_0x1d20b4(0x152)]-0x14)+_0x1d20b4(0x183)),_0x1ce29d[_0x1d20b4(0x17b)]('\x0a');}function filterDockerLogs(_0xe13d72){const _0x388ff9=a0_0x25abc8,_0x28ae33=_0xe13d72['split']('\x0a');if(_0x28ae33[_0x388ff9(0x152)]<=0x32)return _0xe13d72;const _0x1e8125=[];return _0x1e8125[_0x388ff9(0x160)](..._0x28ae33['slice'](0x0,0x14)),_0x1e8125['push']('\x0a...\x20['+(_0x28ae33[_0x388ff9(0x152)]-0x28)+_0x388ff9(0x172)),_0x1e8125['push'](..._0x28ae33['slice'](-0x14)),_0x1e8125[_0x388ff9(0x160)]('\x0a('+_0x28ae33[_0x388ff9(0x152)]+_0x388ff9(0x161)),_0x1e8125[_0x388ff9(0x17b)]('\x0a');}function a0_0x5749(_0x597f04,_0x1e7d0a){_0x597f04=_0x597f04-0x152;const _0x3c8cbb=a0_0x3c8c();let _0x5749e3=_0x3c8cbb[_0x597f04];return _0x5749e3;}function filterKubectl(_0x577a3f,_0x1b0637){const _0x4b92a6=a0_0x25abc8,_0x59833b=_0x577a3f[_0x4b92a6(0x179)]('\x0a')[_0x4b92a6(0x173)](_0x137c05=>_0x137c05[_0x4b92a6(0x156)]()['length']>0x0);if(_0x59833b[_0x4b92a6(0x152)]===0x0)return'No\x20resources\x20found';if(_0x59833b[_0x4b92a6(0x152)]<=0x14)return _0x577a3f[_0x4b92a6(0x156)]();if(_0x1b0637==='get'){const _0x33fc31=_0x59833b[0x0],_0x169371=_0x59833b[_0x4b92a6(0x154)](0x1),_0x44248d=[_0x169371[_0x4b92a6(0x152)]+_0x4b92a6(0x157),'',_0x33fc31];return _0x169371[_0x4b92a6(0x152)]<=0x1e?_0x44248d['push'](..._0x169371):(_0x44248d['push'](..._0x169371[_0x4b92a6(0x154)](0x0,0x19)),_0x44248d[_0x4b92a6(0x160)]('...\x20+'+(_0x169371['length']-0x19)+_0x4b92a6(0x164))),_0x44248d[_0x4b92a6(0x17b)]('\x0a');}if(_0x1b0637==='describe'){const _0x770975=[];let _0xdee4a7=![],_0xe39796=0x0;for(const _0x4ab2bd of _0x59833b){if(_0x4ab2bd[_0x4b92a6(0x17e)](_0x4b92a6(0x178))){_0xdee4a7=!![],_0x770975[_0x4b92a6(0x160)](_0x4ab2bd);continue;}if(_0xdee4a7){_0xe39796++;if(_0xe39796<=0x5)_0x770975[_0x4b92a6(0x160)](_0x4ab2bd);}else _0x770975[_0x4b92a6(0x160)](_0x4ab2bd);}return _0xe39796>0x5&&_0x770975[_0x4b92a6(0x160)](_0x4b92a6(0x15d)+(_0xe39796-0x5)+'\x20more\x20events'),_0x770975[_0x4b92a6(0x17b)]('\x0a');}if(_0x1b0637===_0x4b92a6(0x16a))return filterDockerLogs(_0x577a3f);const _0x51085c=_0x59833b[_0x4b92a6(0x154)](0x0,0x1e);return _0x59833b[_0x4b92a6(0x152)]>0x1e&&_0x51085c['push'](_0x4b92a6(0x155)+(_0x59833b[_0x4b92a6(0x152)]-0x1e)+_0x4b92a6(0x180)),_0x51085c[_0x4b92a6(0x17b)]('\x0a');}function filterRuff(_0x3b84ac){const _0x1d9e90=a0_0x25abc8,_0x4de94b=_0x3b84ac[_0x1d9e90(0x179)]('\x0a')[_0x1d9e90(0x173)](_0x266a39=>_0x266a39[_0x1d9e90(0x156)]()[_0x1d9e90(0x152)]>0x0);if(_0x4de94b['length']===0x0)return'Ruff:\x20no\x20issues\x20found';if(_0x3b84ac['includes'](_0x1d9e90(0x17d))||_0x3b84ac[_0x1d9e90(0x159)](_0x1d9e90(0x153)))return _0x1d9e90(0x166);const _0x1ea68d=_0x3b84ac['match'](/Found (\d+) error/),_0x1ceab1=_0x1ea68d?parseInt(_0x1ea68d[0x1]):_0x4de94b[_0x1d9e90(0x152)],_0x336c82={},_0x3112fd=[];for(const _0x57f027 of _0x4de94b){const _0x585829=_0x57f027[_0x1d9e90(0x15e)](/^([^:]+:\d+:\d+):\s*(.*)/);if(_0x585829){const _0x3a29d5=_0x585829[0x1],_0x2811ed=_0x3a29d5[_0x1d9e90(0x179)](':')[0x0];if(!_0x336c82[_0x2811ed])_0x336c82[_0x2811ed]=[];_0x336c82[_0x2811ed][_0x1d9e90(0x160)](_0x57f027);}else _0x3112fd[_0x1d9e90(0x160)](_0x57f027);}const _0x5c01fe=Object['keys'](_0x336c82);if(_0x5c01fe[_0x1d9e90(0x152)]===0x0){if(_0x4de94b[_0x1d9e90(0x152)]<=0x14)return _0x3b84ac[_0x1d9e90(0x156)]();return _0x4de94b[_0x1d9e90(0x154)](0x0,0xf)[_0x1d9e90(0x17b)]('\x0a')+('\x0a...\x20+'+(_0x4de94b['length']-0xf)+'\x20more');}const _0x14c330=[_0x1d9e90(0x15c)+_0x1ceab1+_0x1d9e90(0x169)+_0x5c01fe[_0x1d9e90(0x152)]+_0x1d9e90(0x15f)];_0x14c330['push']('');const _0x1c9548=0xa;for(const _0x2a06b4 of _0x5c01fe[_0x1d9e90(0x154)](0x0,_0x1c9548)){const _0x3e229b=_0x336c82[_0x2a06b4];if(_0x3e229b['length']<=0x3){for(const _0x21341d of _0x3e229b)_0x14c330['push']('\x20\x20'+_0x21341d);}else _0x14c330[_0x1d9e90(0x160)]('\x20\x20'+_0x3e229b[0x0]),_0x14c330[_0x1d9e90(0x160)](_0x1d9e90(0x175)+_0x3e229b[_0x1d9e90(0x152)]+'\x20issues\x20in\x20'+_0x2a06b4+')');}return _0x5c01fe[_0x1d9e90(0x152)]>_0x1c9548&&_0x14c330[_0x1d9e90(0x160)](_0x1d9e90(0x15d)+(_0x5c01fe[_0x1d9e90(0x152)]-_0x1c9548)+_0x1d9e90(0x16c)),_0x14c330['join']('\x0a');}
|