trimprompt 1.0.33 → 1.0.34
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/index.html +79 -8
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/proxy-conv.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/cache-manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2938cb=a0_0x4cf2;(function(_0x26befe,_0x3bdb59){const _0x3d488c=a0_0x4cf2,_0x5e689c=_0x26befe();while(!![]){try{const _0x22e5c0=parseInt(_0x3d488c(0x11a))/0x1*(parseInt(_0x3d488c(0x10b))/0x2)+parseInt(_0x3d488c(0x115))/0x3*(-parseInt(_0x3d488c(0xe6))/0x4)+parseInt(_0x3d488c(0x117))/0x5+-parseInt(_0x3d488c(0xe7))/0x6+parseInt(_0x3d488c(0xff))/0x7*(-parseInt(_0x3d488c(0x113))/0x8)+-parseInt(_0x3d488c(0xeb))/0x9*(parseInt(_0x3d488c(0xf4))/0xa)+-parseInt(_0x3d488c(0xed))/0xb;if(_0x22e5c0===_0x3bdb59)break;else _0x5e689c['push'](_0x5e689c['shift']());}catch(_0x1d31db){_0x5e689c['push'](_0x5e689c['shift']());}}}(a0_0x4402,0x8b570));var __createBinding=this&&this[a0_0x2938cb(0x11b)]||(Object[a0_0x2938cb(0xfa)]?function(_0x2a8fed,_0x32b077,_0x2d2faa,_0x4eaf15){const _0x1eb11d=a0_0x2938cb;if(_0x4eaf15===undefined)_0x4eaf15=_0x2d2faa;var _0x2ec550=Object[_0x1eb11d(0x118)](_0x32b077,_0x2d2faa);(!_0x2ec550||(_0x1eb11d(0x119)in _0x2ec550?!_0x32b077[_0x1eb11d(0xe5)]:_0x2ec550[_0x1eb11d(0xfb)]||_0x2ec550['configurable']))&&(_0x2ec550={'enumerable':!![],'get':function(){return _0x32b077[_0x2d2faa];}}),Object[_0x1eb11d(0xfe)](_0x2a8fed,_0x4eaf15,_0x2ec550);}:function(_0xa8c104,_0x556dee,_0x561192,_0x4b3808){if(_0x4b3808===undefined)_0x4b3808=_0x561192;_0xa8c104[_0x4b3808]=_0x556dee[_0x561192];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x2b8030,_0x1d6c9e){const _0x22545c=a0_0x2938cb;Object['defineProperty'](_0x2b8030,_0x22545c(0x11c),{'enumerable':!![],'value':_0x1d6c9e});}:function(_0x42c8bf,_0x51d0cc){const _0x356ece=a0_0x2938cb;_0x42c8bf[_0x356ece(0x11c)]=_0x51d0cc;}),__importStar=this&&this[a0_0x2938cb(0xee)]||(function(){var _0x244d01=function(_0x276173){const _0x1b51b6=a0_0x4cf2;return _0x244d01=Object[_0x1b51b6(0x110)]||function(_0x4bb066){const _0x36c731=_0x1b51b6;var _0x39404a=[];for(var _0x11ab2f in _0x4bb066)if(Object[_0x36c731(0xf7)][_0x36c731(0x102)]['call'](_0x4bb066,_0x11ab2f))_0x39404a[_0x39404a[_0x36c731(0x103)]]=_0x11ab2f;return _0x39404a;},_0x244d01(_0x276173);};return function(_0x39ccbb){const _0x452840=a0_0x4cf2;if(_0x39ccbb&&_0x39ccbb[_0x452840(0xe5)])return _0x39ccbb;var _0x31ddc9={};if(_0x39ccbb!=null){for(var _0x4624fc=_0x244d01(_0x39ccbb),_0x5648c7=0x0;_0x5648c7<_0x4624fc['length'];_0x5648c7++)if(_0x4624fc[_0x5648c7]!==_0x452840(0x11c))__createBinding(_0x31ddc9,_0x39ccbb,_0x4624fc[_0x5648c7]);}return __setModuleDefault(_0x31ddc9,_0x39ccbb),_0x31ddc9;};}());function a0_0x4402(){const _0x34c153=['__esModule','36LtlcLP','687372zpScmg','sort','toISOString','update','18ZFFzXa','createHash','4541295fSPGlz','__importStar','readdirSync','utf8','stringify','.json','hex','501290VmixxL','substring','existsSync','prototype','readFileSync','writeFileSync','create','writable','getTime','statSync','defineProperty','13244yMxIaU','tp_chk_','lastAccessed','hasOwnProperty','length','now','isDirectory','push','birthtime','cache','unlinkSync','path','5366BYtFgw','mtime','parse','sha256','endsWith','getOwnPropertyNames','homedir','join','1328gBlHWG','last_accessed_at','227622BqBbai','ceil','5355810uacMyH','getOwnPropertyDescriptor','get','419hURLsr','__createBinding','default','created_at','size'];a0_0x4402=function(){return _0x34c153;};return a0_0x4402();}Object[a0_0x2938cb(0xfe)](exports,a0_0x2938cb(0xe5),{'value':!![]}),exports['saveChunk']=saveChunk,exports['retrieveChunk']=retrieveChunk,exports['enforceEvictionPolicy']=enforceEvictionPolicy;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2938cb(0x10a))),os=__importStar(require('os')),crypto=__importStar(require('crypto')),baseDir=path[a0_0x2938cb(0x112)](os[a0_0x2938cb(0x111)](),'.trimprompt'),cacheDir=path['join'](baseDir,a0_0x2938cb(0x108)),MAX_CACHE_BYTES=0x1f4*0x400*0x400,TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function ensureCacheDir(){const _0x4e3691=a0_0x2938cb;!fs[_0x4e3691(0xf6)](cacheDir)&&fs['mkdirSync'](cacheDir,{'recursive':!![]});}function saveChunk(_0xe2875e,_0x544172,_0x58e1f7,_0x3b165a){const _0x4f524e=a0_0x2938cb;ensureCacheDir();const _0x4fc3e5=crypto[_0x4f524e(0xec)](_0x4f524e(0x10e))[_0x4f524e(0xea)](_0x58e1f7)['digest'](_0x4f524e(0xf3))[_0x4f524e(0xf5)](0x0,0x8),_0x304feb=_0x4f524e(0x100)+_0x4fc3e5,_0x1ca6e9=path[_0x4f524e(0x112)](cacheDir,_0xe2875e);!fs['existsSync'](_0x1ca6e9)&&fs['mkdirSync'](_0x1ca6e9,{'recursive':!![]});const _0xf34bc0=path[_0x4f524e(0x112)](_0x1ca6e9,_0x304feb+_0x4f524e(0xf2)),_0x2c7b46=new Date()[_0x4f524e(0xe9)](),_0x5b1133=Math['ceil'](_0x58e1f7[_0x4f524e(0x103)]/0x4),_0x532b13=Math[_0x4f524e(0x116)](_0x3b165a[_0x4f524e(0x103)]/0x4),_0x37b097={'chunk_id':_0x304feb,'session_id':_0xe2875e,'agent_key':_0x544172,'raw_tokens':_0x5b1133,'compressed_tokens':_0x532b13,'created_at':_0x2c7b46,'last_accessed_at':_0x2c7b46,'summary':_0x3b165a,'raw_payload':_0x58e1f7};return fs[_0x4f524e(0xf9)](_0xf34bc0,JSON['stringify'](_0x37b097,null,0x2),_0x4f524e(0xf0)),enforceEvictionPolicy(),_0x37b097;}function retrieveChunk(_0x529313){const _0x1d5b34=a0_0x2938cb;ensureCacheDir();try{const _0x2ff839=fs['readdirSync'](cacheDir);for(const _0x37f52f of _0x2ff839){const _0x2312c2=path[_0x1d5b34(0x112)](cacheDir,_0x37f52f);if(fs[_0x1d5b34(0xfd)](_0x2312c2)[_0x1d5b34(0x105)]()){const _0x40d1c=path[_0x1d5b34(0x112)](_0x2312c2,_0x529313+_0x1d5b34(0xf2));if(fs[_0x1d5b34(0xf6)](_0x40d1c)){const _0x5da306=fs[_0x1d5b34(0xf8)](_0x40d1c,'utf8'),_0x1181f3=JSON[_0x1d5b34(0x10d)](_0x5da306);return _0x1181f3[_0x1d5b34(0x114)]=new Date()[_0x1d5b34(0xe9)](),fs['writeFileSync'](_0x40d1c,JSON[_0x1d5b34(0xf1)](_0x1181f3,null,0x2),_0x1d5b34(0xf0)),_0x1181f3;}}}}catch{}return null;}function a0_0x4cf2(_0x374dc4,_0x1a2b5b){_0x374dc4=_0x374dc4-0xe5;const _0x440220=a0_0x4402();let _0x4cf2f2=_0x440220[_0x374dc4];return _0x4cf2f2;}function enforceEvictionPolicy(){const _0x5b359c=a0_0x2938cb;ensureCacheDir();try{const _0x43ee0d=Date[_0x5b359c(0x104)]();let _0x538c42=0x0;const _0x5d81dc=[],_0x4a7a7=fs['readdirSync'](cacheDir);for(const _0x3f96eb of _0x4a7a7){const _0x20c076=path[_0x5b359c(0x112)](cacheDir,_0x3f96eb);if(fs[_0x5b359c(0xfd)](_0x20c076)[_0x5b359c(0x105)]()){const _0x396550=fs[_0x5b359c(0xef)](_0x20c076);for(const _0x20a51f of _0x396550){if(_0x20a51f[_0x5b359c(0x10f)](_0x5b359c(0xf2))){const _0x29a23f=path['join'](_0x20c076,_0x20a51f),_0x934f4b=fs[_0x5b359c(0xfd)](_0x29a23f);try{const _0x409bfd=JSON[_0x5b359c(0x10d)](fs[_0x5b359c(0xf8)](_0x29a23f,_0x5b359c(0xf0))),_0x5c2d4d=new Date(_0x409bfd[_0x5b359c(0x11d)]||_0x934f4b[_0x5b359c(0x107)])[_0x5b359c(0xfc)](),_0x57028c=new Date(_0x409bfd[_0x5b359c(0x114)]||_0x934f4b[_0x5b359c(0x10c)])[_0x5b359c(0xfc)]();if(_0x43ee0d-_0x5c2d4d>TTL_MS){fs['unlinkSync'](_0x29a23f);continue;}_0x538c42+=_0x934f4b[_0x5b359c(0x11e)],_0x5d81dc[_0x5b359c(0x106)]({'path':_0x29a23f,'size':_0x934f4b[_0x5b359c(0x11e)],'lastAccessed':_0x57028c,'createdAt':_0x5c2d4d});}catch{fs[_0x5b359c(0x109)](_0x29a23f);}}}}}if(_0x538c42>MAX_CACHE_BYTES){_0x5d81dc[_0x5b359c(0xe8)]((_0x1b627b,_0x6ebee3)=>_0x1b627b[_0x5b359c(0x101)]-_0x6ebee3[_0x5b359c(0x101)]);for(const _0x48e972 of _0x5d81dc){if(_0x538c42<=MAX_CACHE_BYTES*0.8)break;try{fs[_0x5b359c(0x109)](_0x48e972['path']),_0x538c42-=_0x48e972[_0x5b359c(0x11e)];}catch{}}}}catch{}}
|
package/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x31fdd1=a0_0x23db;(function(_0x3d9c9f,_0x218365){const _0x57923f=a0_0x23db,_0x450337=_0x3d9c9f();while(!![]){try{const _0x252989=-parseInt(_0x57923f(0xd8))/0x1+-parseInt(_0x57923f(0xd1))/0x2+-parseInt(_0x57923f(0xc1))/0x3+-parseInt(_0x57923f(0xbd))/0x4+parseInt(_0x57923f(0xa7))/0x5*(-parseInt(_0x57923f(0xd6))/0x6)+-parseInt(_0x57923f(0xd9))/0x7*(parseInt(_0x57923f(0xca))/0x8)+parseInt(_0x57923f(0xde))/0x9;if(_0x252989===_0x218365)break;else _0x450337['push'](_0x450337['shift']());}catch(_0x5675d1){_0x450337['push'](_0x450337['shift']());}}}(a0_0x525d,0xe14e8));var __createBinding=this&&this[a0_0x31fdd1(0xc8)]||(Object[a0_0x31fdd1(0xb3)]?function(_0xb7e905,_0x43fde8,_0x41e5ce,_0x30e54d){const _0x39ff33=a0_0x31fdd1;if(_0x30e54d===undefined)_0x30e54d=_0x41e5ce;var _0x3a8fb2=Object[_0x39ff33(0xb2)](_0x43fde8,_0x41e5ce);(!_0x3a8fb2||(_0x39ff33(0xb0)in _0x3a8fb2?!_0x43fde8[_0x39ff33(0xa6)]:_0x3a8fb2['writable']||_0x3a8fb2['configurable']))&&(_0x3a8fb2={'enumerable':!![],'get':function(){return _0x43fde8[_0x41e5ce];}}),Object['defineProperty'](_0xb7e905,_0x30e54d,_0x3a8fb2);}:function(_0x310bdf,_0x13d127,_0x3de4ad,_0x461e99){if(_0x461e99===undefined)_0x461e99=_0x3de4ad;_0x310bdf[_0x461e99]=_0x13d127[_0x3de4ad];}),__setModuleDefault=this&&this[a0_0x31fdd1(0xa9)]||(Object[a0_0x31fdd1(0xb3)]?function(_0x5e0045,_0x9fb12){const _0x2bbc53=a0_0x31fdd1;Object[_0x2bbc53(0xa1)](_0x5e0045,_0x2bbc53(0xd3),{'enumerable':!![],'value':_0x9fb12});}:function(_0x56feff,_0x34897b){const _0x58357=a0_0x31fdd1;_0x56feff[_0x58357(0xd3)]=_0x34897b;}),__importStar=this&&this['__importStar']||(function(){var _0xa49e3e=function(_0x3466dd){const _0x393c2c=a0_0x23db;return _0xa49e3e=Object[_0x393c2c(0xd0)]||function(_0x2eb9ac){const _0x3d3283=_0x393c2c;var _0x5e1c89=[];for(var _0x56a9a5 in _0x2eb9ac)if(Object['prototype'][_0x3d3283(0xbb)]['call'](_0x2eb9ac,_0x56a9a5))_0x5e1c89[_0x5e1c89[_0x3d3283(0xdd)]]=_0x56a9a5;return _0x5e1c89;},_0xa49e3e(_0x3466dd);};return function(_0xeba05b){const _0x4f9064=a0_0x23db;if(_0xeba05b&&_0xeba05b[_0x4f9064(0xa6)])return _0xeba05b;var _0x52e602={};if(_0xeba05b!=null){for(var _0x5e4af9=_0xa49e3e(_0xeba05b),_0x4260d6=0x0;_0x4260d6<_0x5e4af9[_0x4f9064(0xdd)];_0x4260d6++)if(_0x5e4af9[_0x4260d6]!==_0x4f9064(0xd3))__createBinding(_0x52e602,_0xeba05b,_0x5e4af9[_0x4260d6]);}return __setModuleDefault(_0x52e602,_0xeba05b),_0x52e602;};}());function a0_0x525d(){const _0x282796=['1448416ewShOl','7PGKRrw','ruff\x20','path','[cached\x20—\x20unchanged\x20since\x20','length','80497944WMuYAq','\x20chars','git\x20show','existsSync','endsWith','go-vet','match','homedir','defineProperty','git-log','docker','stringify','kubectl','__esModule','197305IXnnnh','hash','__setModuleDefault','ruff\x20check','createHash','cwd','utf8','s\x20ago,\x20','timestamp','get','crypto','getOwnPropertyDescriptor','create','readFileSync','yadm\x20log','startsWith','\x20ls','\x20lines,\x20','git\x20status','update','hasOwnProperty','dedup','5602308DMAUnK','join','kubectl\x20get','kubectl\x20describe','4190091ldEKWu','toLowerCase','trim','keys','\x20tree','mkdirSync','tree','__createBinding','includes','8918408GKrisA','file','parse','hex','writeFileSync','slice','getOwnPropertyNames','3033000otriad','\x20tree\x20','default','git-status','digest','174TQyLud','docker-images'];a0_0x525d=function(){return _0x282796;};return a0_0x525d();}Object[a0_0x31fdd1(0xa1)](exports,a0_0x31fdd1(0xa6),{'value':!![]}),exports[a0_0x31fdd1(0xbc)]=dedup;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x31fdd1(0xdb))),os=__importStar(require('os')),crypto=__importStar(require(a0_0x31fdd1(0xb1))),CACHE_DIR=path[a0_0x31fdd1(0xbe)](os[a0_0x31fdd1(0xa0)](),'.trimprompt'),CACHE_FILE=path[a0_0x31fdd1(0xbe)](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(_0x3e256b){const _0x369dda=a0_0x31fdd1,_0x1090ed=_0x3e256b[_0x369dda(0xc3)]()[_0x369dda(0xc2)]();if(_0x1090ed[_0x369dda(0x9f)](/^(cat|head|tail|read|bat)\s/))return _0x369dda(0xcb);if(_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xb9))||_0x1090ed[_0x369dda(0xc9)]('yadm\x20status'))return _0x369dda(0xd4);if(_0x1090ed[_0x369dda(0xc9)]('git\x20log')||_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xb5)))return _0x369dda(0xa2);if(_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xe0))||_0x1090ed[_0x369dda(0xc9)]('yadm\x20show'))return'git-show';if(_0x1090ed['match'](/^(ls|dir)(\s|$)/)||_0x1090ed['includes']('\x20ls\x20')||_0x1090ed[_0x369dda(0xe2)](_0x369dda(0xb7)))return'ls';if(_0x1090ed[_0x369dda(0x9f)](/^tree(\s|$)/)||_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xd2))||_0x1090ed['endsWith'](_0x369dda(0xc5)))return _0x369dda(0xc7);if(_0x1090ed[_0x369dda(0x9f)](/docker\s+ps/))return'docker-ps';if(_0x1090ed[_0x369dda(0x9f)](/docker\s+images/))return _0x369dda(0xd7);if(_0x1090ed['includes'](_0x369dda(0xbf))||_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xc0)))return _0x369dda(0xa5);if(_0x1090ed['includes'](_0x369dda(0xaa))||_0x1090ed[_0x369dda(0xc9)](_0x369dda(0xda)))return'ruff';if(_0x1090ed['includes']('go\x20vet'))return _0x369dda(0x9e);return'';}function a0_0x23db(_0x366496,_0x3974df){_0x366496=_0x366496-0x9e;const _0x525ddc=a0_0x525d();let _0x23db38=_0x525ddc[_0x366496];return _0x23db38;}function md5(_0x4b9770){const _0x11b2b4=a0_0x31fdd1;return crypto[_0x11b2b4(0xab)]('md5')[_0x11b2b4(0xba)](_0x4b9770)[_0x11b2b4(0xd5)](_0x11b2b4(0xcd));}function loadStore(){const _0x3a34e4=a0_0x31fdd1;try{if(fs[_0x3a34e4(0xe1)](CACHE_FILE))return JSON[_0x3a34e4(0xcc)](fs[_0x3a34e4(0xb4)](CACHE_FILE,_0x3a34e4(0xad)));}catch{}return{};}function saveStore(_0x3e17ff){const _0x2d69b7=a0_0x31fdd1;try{if(!fs[_0x2d69b7(0xe1)](CACHE_DIR))fs[_0x2d69b7(0xc6)](CACHE_DIR,{'recursive':!![]});const _0x2658e3=Object[_0x2d69b7(0xc4)](_0x3e17ff);if(_0x2658e3['length']>MAX_ENTRIES){const _0x3280bc=_0x2658e3['sort']((_0x418f46,_0x3288e4)=>_0x3e17ff[_0x418f46][_0x2d69b7(0xaf)]-_0x3e17ff[_0x3288e4][_0x2d69b7(0xaf)]);for(const _0x45473e of _0x3280bc[_0x2d69b7(0xcf)](0x0,_0x2658e3[_0x2d69b7(0xdd)]-MAX_ENTRIES)){delete _0x3e17ff[_0x45473e];}}fs[_0x2d69b7(0xce)](CACHE_FILE,JSON[_0x2d69b7(0xa4)](_0x3e17ff),_0x2d69b7(0xad));}catch{}}function buildSummary(_0x2e71cc,_0x5aa0b5){const _0xe226a6=a0_0x31fdd1,_0x1412c5=_0x2e71cc['split']('\x0a')[_0xe226a6(0xdd)],_0x20055d=_0x2e71cc[_0xe226a6(0xdd)];if(_0x5aa0b5===_0xe226a6(0xcb))return _0x1412c5+_0xe226a6(0xb8)+_0x20055d+'\x20chars';if(_0x5aa0b5==='git-status')return _0x1412c5+'\x20lines';if(_0x5aa0b5===_0xe226a6(0xa2))return _0x1412c5+'\x20entries';if(_0x5aa0b5[_0xe226a6(0xb6)](_0xe226a6(0xa3)))return _0x1412c5+'\x20lines';return _0x1412c5+_0xe226a6(0xb8)+_0x20055d+_0xe226a6(0xdf);}function dedup(_0x48428a,_0x33d9a5){const _0x252068=a0_0x31fdd1;try{const _0x2cf490=classifyCommand(_0x48428a);if(!_0x2cf490)return null;const _0x58247a=TTL_SECONDS[_0x2cf490];if(!_0x58247a)return null;const _0x4bad4b=process[_0x252068(0xac)](),_0x58acd3=md5(_0x4bad4b+'::'+_0x48428a['trim']()),_0x5b0519=md5(_0x33d9a5),_0xacb0b6=Date['now'](),_0x442751=loadStore(),_0x2e9191=_0x442751[_0x58acd3];if(_0x2e9191&&_0x2e9191[_0x252068(0xa8)]===_0x5b0519&&_0xacb0b6-_0x2e9191[_0x252068(0xaf)]<_0x58247a*0x3e8){const _0x2d0171=Math['round']((_0xacb0b6-_0x2e9191['timestamp'])/0x3e8);return _0x252068(0xdc)+_0x2d0171+_0x252068(0xae)+_0x2e9191['summary']+']';}_0x442751[_0x58acd3]={'hash':_0x5b0519,'summary':buildSummary(_0x33d9a5,_0x2cf490),'timestamp':_0xacb0b6,'chars':_0x33d9a5['length']},saveStore(_0x442751);}catch{}return null;}
|
package/ccr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x47c1(){const _0x3139a3=['4256640sEUcUN','.js','slice','utf8','create','import\x20','function','skeletonize','#\x20...\x20[collapsed]','6117786JhsPUj','package','[TrimPrompt:\x20CCR\x20Active.\x20Body\x20of\x20functions\x20collapsed\x20to\x20save\x20tokens.\x20Hash:\x20','.go','4169922tgGsaA','\x22\x22\x22','writeFileSync','join','md5','writable','class','9805859AECKyj','2PQpNpS','substring','2547981VIHMFx','.cpp','type','7602016ELNOsO','runCcr','extname','replace','toLowerCase','getOwnPropertyDescriptor','.jsx','call','default','.trimprompt','8DPzjqA','from\x20','\x27\x27\x27','__importStar','endsWith','class\x20','mkdirSync','import','.rs','match','trim','startsWith','const','includes','\x20lines\x20collapsed\x20to\x20save\x20tokens]\x20...\x0a','__createBinding','tp_','export','var','hex','defineProperty','.\x20To\x20read\x20the\x20full\x20raw\x20content,\x20run\x20the\x20shell\x20command:\x20trim\x20retrieve\x20','split','configurable','hasOwnProperty','.txt','homedir','pop','get','path','getOwnPropertyNames','__esModule','length','trimStart','668867YpWCIJ','pub','55PKJcVj','push','5heSxFE','def\x20','.java','ccr','//\x20...\x20[collapsed]','.ts','createHash','digest'];a0_0x47c1=function(){return _0x3139a3;};return a0_0x47c1();}const a0_0x225c49=a0_0x4caf;(function(_0x47e471,_0x2b0d06){const _0x4078b0=a0_0x4caf,_0x29d129=_0x47e471();while(!![]){try{const _0x354e2b=-parseInt(_0x4078b0(0x1c4))/0x1*(-parseInt(_0x4078b0(0x193))/0x2)+-parseInt(_0x4078b0(0x195))/0x3+parseInt(_0x4078b0(0x198))/0x4+-parseInt(_0x4078b0(0x1c8))/0x5*(parseInt(_0x4078b0(0x1dd))/0x6)+parseInt(_0x4078b0(0x192))/0x7+-parseInt(_0x4078b0(0x1a2))/0x8*(-parseInt(_0x4078b0(0x1d9))/0x9)+parseInt(_0x4078b0(0x1d0))/0xa*(-parseInt(_0x4078b0(0x1c6))/0xb);if(_0x354e2b===_0x2b0d06)break;else _0x29d129['push'](_0x29d129['shift']());}catch(_0x349ddf){_0x29d129['push'](_0x29d129['shift']());}}}(a0_0x47c1,0xee9b0));function a0_0x4caf(_0x2ce463,_0x5a3e1a){_0x2ce463=_0x2ce463-0x18c;const _0x47c13e=a0_0x47c1();let _0x4caf3e=_0x47c13e[_0x2ce463];return _0x4caf3e;}var __createBinding=this&&this[a0_0x225c49(0x1b1)]||(Object[a0_0x225c49(0x1d4)]?function(_0x5d0bc9,_0x291544,_0x17d4af,_0x14d7cc){const _0x33cbac=a0_0x225c49;if(_0x14d7cc===undefined)_0x14d7cc=_0x17d4af;var _0x52002e=Object[_0x33cbac(0x19d)](_0x291544,_0x17d4af);(!_0x52002e||(_0x33cbac(0x1be)in _0x52002e?!_0x291544[_0x33cbac(0x1c1)]:_0x52002e[_0x33cbac(0x190)]||_0x52002e[_0x33cbac(0x1b9)]))&&(_0x52002e={'enumerable':!![],'get':function(){return _0x291544[_0x17d4af];}}),Object[_0x33cbac(0x1b6)](_0x5d0bc9,_0x14d7cc,_0x52002e);}:function(_0x4fa3f4,_0x407160,_0x35e7e8,_0x21d51b){if(_0x21d51b===undefined)_0x21d51b=_0x35e7e8;_0x4fa3f4[_0x21d51b]=_0x407160[_0x35e7e8];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x225c49(0x1d4)]?function(_0x1fe341,_0x5cb7e1){const _0x19cd73=a0_0x225c49;Object[_0x19cd73(0x1b6)](_0x1fe341,_0x19cd73(0x1a0),{'enumerable':!![],'value':_0x5cb7e1});}:function(_0x4ac33d,_0x1ebb3d){const _0x5dc37b=a0_0x225c49;_0x4ac33d[_0x5dc37b(0x1a0)]=_0x1ebb3d;}),__importStar=this&&this[a0_0x225c49(0x1a5)]||(function(){var _0x32f923=function(_0x49bf49){const _0x113c83=a0_0x4caf;return _0x32f923=Object[_0x113c83(0x1c0)]||function(_0x1a5537){const _0x23cc1d=_0x113c83;var _0x299c50=[];for(var _0x3b2b3d in _0x1a5537)if(Object['prototype'][_0x23cc1d(0x1ba)][_0x23cc1d(0x19f)](_0x1a5537,_0x3b2b3d))_0x299c50[_0x299c50['length']]=_0x3b2b3d;return _0x299c50;},_0x32f923(_0x49bf49);};return function(_0x4ce78b){const _0x4cd9bf=a0_0x4caf;if(_0x4ce78b&&_0x4ce78b[_0x4cd9bf(0x1c1)])return _0x4ce78b;var _0xd6adc6={};if(_0x4ce78b!=null){for(var _0x8b8255=_0x32f923(_0x4ce78b),_0x15a535=0x0;_0x15a535<_0x8b8255['length'];_0x15a535++)if(_0x8b8255[_0x15a535]!=='default')__createBinding(_0xd6adc6,_0x4ce78b,_0x8b8255[_0x15a535]);}return __setModuleDefault(_0xd6adc6,_0x4ce78b),_0xd6adc6;};}());Object['defineProperty'](exports,a0_0x225c49(0x1c1),{'value':!![]}),exports[a0_0x225c49(0x1d7)]=skeletonize,exports[a0_0x225c49(0x199)]=runCcr;const crypto=__importStar(require('crypto')),fs=__importStar(require('fs')),path=__importStar(require(a0_0x225c49(0x1bf))),os=__importStar(require('os'));function skeletonize(_0x5e959c,_0x2f9d41){const _0x1c2083=a0_0x225c49,_0x500e68=path[_0x1c2083(0x19a)](_0x2f9d41[_0x1c2083(0x1b8)]('\x20')[_0x1c2083(0x1bd)]()||'')[_0x1c2083(0x19c)](),_0xc9a4ba=_0x5e959c[_0x1c2083(0x1b8)]('\x0a'),_0x48762c=[];if(_0x500e68==='.py'){let _0x5022ab=![],_0x2c4fb2='';for(let _0x4acbcf=0x0;_0x4acbcf<_0xc9a4ba[_0x1c2083(0x1c2)];_0x4acbcf++){const _0x26d70e=_0xc9a4ba[_0x4acbcf],_0x22895b=_0x26d70e[_0x1c2083(0x1ac)](),_0x5c7c8d=_0x26d70e[_0x1c2083(0x1c2)]-_0x26d70e[_0x1c2083(0x1c3)]()[_0x1c2083(0x1c2)];if(!_0x5022ab&&(_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x18c))||_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x1a4)))){_0x5022ab=!![],_0x2c4fb2=_0x22895b[_0x1c2083(0x194)](0x0,0x3),_0x48762c[_0x1c2083(0x1c7)](_0x26d70e);_0x22895b['endsWith'](_0x2c4fb2)&&_0x22895b[_0x1c2083(0x1c2)]>0x3&&(_0x5022ab=![]);continue;}if(_0x5022ab){_0x48762c[_0x1c2083(0x1c7)](_0x26d70e);_0x22895b['endsWith'](_0x2c4fb2)&&(_0x5022ab=![]);continue;}if(_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x1d5))||_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x1a3))||_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x1a7))||_0x22895b[_0x1c2083(0x1ad)](_0x1c2083(0x1c9))||_0x22895b[_0x1c2083(0x1ad)]('@')||_0x22895b[_0x1c2083(0x1ad)]('#')||_0x22895b[_0x1c2083(0x1c2)]===0x0)_0x48762c[_0x1c2083(0x1c7)](_0x26d70e);else{const _0x141dc9=_0x48762c[_0x48762c[_0x1c2083(0x1c2)]-0x1]||'';if(!_0x141dc9[_0x1c2083(0x1ac)]()[_0x1c2083(0x1a6)](_0x1c2083(0x1d8))){const _0x165d6a='\x20'['repeat'](_0x5c7c8d);_0x48762c[_0x1c2083(0x1c7)](_0x165d6a+'#\x20...\x20[collapsed]');}}}return _0x48762c[_0x1c2083(0x18e)]('\x0a');}if([_0x1c2083(0x1d1),_0x1c2083(0x1cd),_0x1c2083(0x19e),'.tsx',_0x1c2083(0x1dc),_0x1c2083(0x1aa),_0x1c2083(0x1ca),'.c',_0x1c2083(0x196),'.h'][_0x1c2083(0x1af)](_0x500e68)){let _0x525a2f=0x0;for(let _0x549e4e=0x0;_0x549e4e<_0xc9a4ba[_0x1c2083(0x1c2)];_0x549e4e++){const _0x417a1b=_0xc9a4ba[_0x549e4e],_0x15c474=_0x417a1b[_0x1c2083(0x1ac)](),_0x24cb03=(_0x15c474[_0x1c2083(0x1ab)](/\{/g)||[])[_0x1c2083(0x1c2)],_0x39f25e=(_0x15c474[_0x1c2083(0x1ab)](/\}/g)||[])[_0x1c2083(0x1c2)];if(_0x525a2f===0x0)(_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1a9))||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1b3))||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1ae))||_0x15c474[_0x1c2083(0x1ad)]('let')||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1b4))||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x191))||_0x15c474['startsWith'](_0x1c2083(0x1d6))||_0x15c474[_0x1c2083(0x1ad)]('interface')||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x197))||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1da))||_0x15c474[_0x1c2083(0x1ad)]('fn')||_0x15c474[_0x1c2083(0x1ad)](_0x1c2083(0x1c5))||_0x15c474[_0x1c2083(0x1c2)]===0x0||_0x15c474[_0x1c2083(0x1ad)]('//')||_0x15c474[_0x1c2083(0x1ad)]('/*')||_0x15c474[_0x1c2083(0x1ad)]('*'))&&_0x48762c[_0x1c2083(0x1c7)](_0x417a1b),_0x24cb03>_0x39f25e&&(_0x525a2f+=_0x24cb03-_0x39f25e);else{const _0x27b3aa=_0x525a2f+_0x24cb03-_0x39f25e;if(_0x27b3aa<=0x0){const _0xf5da22=_0x417a1b['match'](/^\s*/)?.[0x0]||'';_0x48762c[_0x1c2083(0x1c7)](_0xf5da22+_0x1c2083(0x1cc)),_0x48762c[_0x1c2083(0x1c7)](_0x417a1b),_0x525a2f=0x0;}else _0x525a2f=_0x27b3aa;}}return _0x48762c['join']('\x0a');}if(_0xc9a4ba[_0x1c2083(0x1c2)]<=0x64)return _0x5e959c;return[..._0xc9a4ba[_0x1c2083(0x1d2)](0x0,0x1e),'\x0a...\x20['+(_0xc9a4ba[_0x1c2083(0x1c2)]-0x32)+_0x1c2083(0x1b0),..._0xc9a4ba[_0x1c2083(0x1d2)](-0x14)][_0x1c2083(0x18e)]('\x0a');}function runCcr(_0xa22528,_0x5ec612){const _0x19ee5f=a0_0x225c49,_0x3a8e49=_0x5ec612[_0x19ee5f(0x19b)](/\\/g,'/'),_0x5dcb91=_0x19ee5f(0x1b2)+crypto[_0x19ee5f(0x1ce)](_0x19ee5f(0x18f))['update'](_0xa22528)[_0x19ee5f(0x1cf)](_0x19ee5f(0x1b5))[_0x19ee5f(0x194)](0x0,0xa),_0x233be2=path[_0x19ee5f(0x18e)](os[_0x19ee5f(0x1bc)](),_0x19ee5f(0x1a1)),_0x32ac9a=path[_0x19ee5f(0x18e)](_0x233be2,_0x19ee5f(0x1cb));!fs['existsSync'](_0x32ac9a)&&fs[_0x19ee5f(0x1a8)](_0x32ac9a,{'recursive':!![]});fs[_0x19ee5f(0x18d)](path[_0x19ee5f(0x18e)](_0x32ac9a,_0x5dcb91+_0x19ee5f(0x1bb)),_0xa22528,_0x19ee5f(0x1d3));const _0x2a85bf=skeletonize(_0xa22528,_0x3a8e49);return _0x19ee5f(0x1db)+_0x5dcb91+_0x19ee5f(0x1b7)+_0x5dcb91+']\x0a\x0a'+_0x2a85bf;}
|
package/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';const a0_0x32cd0e=a0_0x2489;(function(_0x1868da,_0x27be4c){const _0x24d8ee=a0_0x2489,_0x5a3982=_0x1868da();while(!![]){try{const _0x4511c6=parseInt(_0x24d8ee(0x1d5))/0x1+-parseInt(_0x24d8ee(0x20e))/0x2+parseInt(_0x24d8ee(0x240))/0x3*(parseInt(_0x24d8ee(0x22e))/0x4)+-parseInt(_0x24d8ee(0x19c))/0x5+-parseInt(_0x24d8ee(0x230))/0x6+parseInt(_0x24d8ee(0x21f))/0x7*(-parseInt(_0x24d8ee(0x1f9))/0x8)+-parseInt(_0x24d8ee(0x22a))/0x9*(-parseInt(_0x24d8ee(0x211))/0xa);if(_0x4511c6===_0x27be4c)break;else _0x5a3982['push'](_0x5a3982['shift']());}catch(_0xf55014){_0x5a3982['push'](_0x5a3982['shift']());}}}(a0_0x59a0,0xa4dd2));var __createBinding=this&&this[a0_0x32cd0e(0x201)]||(Object['create']?function(_0x4291ec,_0x5958ea,_0x4db872,_0x4c5e7c){const _0x2e2936=a0_0x32cd0e;if(_0x4c5e7c===undefined)_0x4c5e7c=_0x4db872;var _0x3f75ff=Object[_0x2e2936(0x1df)](_0x5958ea,_0x4db872);(!_0x3f75ff||(_0x2e2936(0x1e7)in _0x3f75ff?!_0x5958ea[_0x2e2936(0x1a5)]:_0x3f75ff[_0x2e2936(0x18d)]||_0x3f75ff['configurable']))&&(_0x3f75ff={'enumerable':!![],'get':function(){return _0x5958ea[_0x4db872];}}),Object[_0x2e2936(0x1ab)](_0x4291ec,_0x4c5e7c,_0x3f75ff);}:function(_0x33f7dd,_0x5d0b9c,_0x438c63,_0x1b0495){if(_0x1b0495===undefined)_0x1b0495=_0x438c63;_0x33f7dd[_0x1b0495]=_0x5d0b9c[_0x438c63];}),__setModuleDefault=this&&this[a0_0x32cd0e(0x1a3)]||(Object[a0_0x32cd0e(0x195)]?function(_0x132d4a,_0x940ffa){const _0xdddbc0=a0_0x32cd0e;Object[_0xdddbc0(0x1ab)](_0x132d4a,_0xdddbc0(0x1a7),{'enumerable':!![],'value':_0x940ffa});}:function(_0x101ee2,_0x1c153c){const _0x57f49e=a0_0x32cd0e;_0x101ee2[_0x57f49e(0x1a7)]=_0x1c153c;}),__importStar=this&&this[a0_0x32cd0e(0x220)]||(function(){var _0x350de4=function(_0x455fde){return _0x350de4=Object['getOwnPropertyNames']||function(_0x25ccd5){const _0x4162db=a0_0x2489;var _0x26b218=[];for(var _0x100a03 in _0x25ccd5)if(Object[_0x4162db(0x23d)][_0x4162db(0x18a)][_0x4162db(0x19a)](_0x25ccd5,_0x100a03))_0x26b218[_0x26b218[_0x4162db(0x23f)]]=_0x100a03;return _0x26b218;},_0x350de4(_0x455fde);};return function(_0x42fed3){const _0xd0e634=a0_0x2489;if(_0x42fed3&&_0x42fed3[_0xd0e634(0x1a5)])return _0x42fed3;var _0x318ec3={};if(_0x42fed3!=null){for(var _0x1357ce=_0x350de4(_0x42fed3),_0x3b437a=0x0;_0x3b437a<_0x1357ce[_0xd0e634(0x23f)];_0x3b437a++)if(_0x1357ce[_0x3b437a]!==_0xd0e634(0x1a7))__createBinding(_0x318ec3,_0x42fed3,_0x1357ce[_0x3b437a]);}return __setModuleDefault(_0x318ec3,_0x42fed3),_0x318ec3;};}());Object[a0_0x32cd0e(0x1ab)](exports,a0_0x32cd0e(0x1a5),{'value':!![]});const commander_1=require(a0_0x32cd0e(0x198)),executor_1=require('./executor'),filters_1=require(a0_0x32cd0e(0x205)),tracker_1=require(a0_0x32cd0e(0x224)),cache_1=require(a0_0x32cd0e(0x239)),shims_1=require(a0_0x32cd0e(0x1c8)),dashboard_1=require(a0_0x32cd0e(0x1f3)),program=new commander_1[(a0_0x32cd0e(0x200))]();function isDisabled(){const _0x3c9aad=a0_0x32cd0e;return process[_0x3c9aad(0x229)][_0x3c9aad(0x1e2)]==='1';}function adjustCommandArgs(_0x4f89bc,_0x25fcd2){const _0x28c172=a0_0x32cd0e,_0x4992b4=_0x4f89bc[_0x28c172(0x23a)]();if(_0x4992b4===_0x28c172(0x1dc)||_0x4992b4===_0x28c172(0x216)){const _0x129a5d=_0x25fcd2[0x0];if(_0x129a5d==='status'){const _0x5577d8=_0x25fcd2[_0x28c172(0x1ea)](0x1),_0x544699=_0x5577d8[_0x28c172(0x23f)]===0x0||_0x5577d8[_0x28c172(0x207)](_0x5bc043=>{const _0x53b47b=_0x28c172;return _0x5bc043==='-b'||_0x5bc043===_0x53b47b(0x1a0)||_0x5bc043===_0x53b47b(0x232)||_0x5bc043===_0x53b47b(0x1c6)||_0x5bc043==='-s'||_0x5bc043===_0x53b47b(0x21a);});if(_0x544699)return{'cmd':_0x4f89bc,'args':[_0x28c172(0x20f),'--porcelain','-b']};}else{if(_0x129a5d===_0x28c172(0x193)){const _0x56e26a=_0x25fcd2[_0x28c172(0x1ea)](0x1),_0x915200=_0x56e26a[_0x28c172(0x1d9)](_0x25ed53=>_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x221))||_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x1ed))||_0x25ed53[_0x28c172(0x1cd)](_0x28c172(0x20a))),_0x1f1a14=_0x56e26a['some'](_0x4241b6=>_0x4241b6['startsWith']('-')&&/^\d+$/['test'](_0x4241b6[_0x28c172(0x1ea)](0x1))||_0x4241b6==='-n'||_0x4241b6[_0x28c172(0x1cd)](_0x28c172(0x1b7))),_0x212147=[..._0x25fcd2];if(!_0x915200){const _0x574df4=_0x28c172(0x1ef);_0x212147[_0x28c172(0x1aa)](process[_0x28c172(0x1d0)]===_0x28c172(0x1c3)?'\x22'+_0x574df4+'\x22':_0x574df4);}!_0x1f1a14&&(_0x915200?_0x212147[_0x28c172(0x1aa)]('-50'):_0x212147[_0x28c172(0x1aa)]('-10'));const _0x7a391d=_0x56e26a[_0x28c172(0x1d9)](_0x405e6b=>_0x405e6b===_0x28c172(0x237)||_0x405e6b===_0x28c172(0x1ee)||_0x405e6b[_0x28c172(0x1cd)](_0x28c172(0x1db)));return!_0x7a391d&&!_0x1f1a14&&_0x212147[_0x28c172(0x1aa)]('--no-merges'),{'cmd':_0x4f89bc,'args':_0x212147};}}}return{'cmd':_0x4f89bc,'args':_0x25fcd2};}function a0_0x59a0(){const _0x994e42=['Port\x20to\x20run\x20the\x20dashboard\x20on','1704736QpxjDL','status','--version','80pJIdtc','npm_lifecycle_event','dedup','[value]','name','yadm','=============================================','server-mcp','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','--short','<action>','raw_cost_usd','config\x20parameter\x20name','start','501746SqEeEa','__importStar','--oneline','claude','true','./tracker','message','Estimated\x20Cost:\x20\x20\x20\x20$','yarn','option','env','3491865ZtuieQ','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','write','install\x20or\x20uninstall','1124084huVRWf','<commandLine>','1977876PyjQRj','toFixed','-sb','tracker','\x20(before\x20Trim)','\x5c\x5c.\x5cCON','bun','--merges','Original\x20file\x20untouched:\x20','./cache','toLowerCase','\x20\x20claude\x20--resume\x20\x22','raw_payload','prototype','Live\x20conversation\x20file-watcher\x20daemon\x20—\x20start,\x20install','length','3alkTBi','pnpm','exitCode','toLocaleString','compressed_cost_usd','description','---------------------------------------------','Generate\x20a\x20clean,\x20compressed\x20copy\x20of\x20a\x20conversation\x20session\x20file\x20for\x20safe\x20resume','\x20(after\x20Trim)','hasOwnProperty','server','rewriteCommand','writable','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','install','alias','mcp-server','-m,\x20--model\x20<string>','log','total_raw_tokens','create','value\x20to\x20set','../package.json','commander','Start\x20the\x20local\x20developer\x20dashboard','call','uninstall','6085255QvGIZd','trim','retrieve','exit','--branch','\x27\x20not\x20found\x20or\x20expired.','installShims','__setModuleDefault','stderr','__esModule','stats','default','dirname','error','push','defineProperty','Manage\x20local\x20configuration\x20parameters','4000','mcp-proxy','path','\x20USD','postinstall','1.0.33','claude-3-5-sonnet','compressOutput','then','Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line','--max-count','node','<key>','=============================================\x0a','--help','-p,\x20--port\x20<number>','./mcp','/dev/tty','@modelcontextprotocol/','total_tokens_saved','includes','resolve','win32','join','./package.json','-bs','writeFileSync','./shims','Reduction\x20Rate:\x20\x20\x20\x20','./file-watcher','parse','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','startsWith','Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20','modelcontextprotocol','platform','action','help','mcp','getConfig','549582cIjfyx','money_saved_usd','rewrite','compact','some','shims','--min-parents','git','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','__VERSION__','getOwnPropertyDescriptor','Command\x20line\x20to\x20evaluate','argv','TRIMPROMPT_DISABLED','total_compressed_tokens','basename','version','redaction_enabled','get','Config\x20set\x20','executeCommand','slice','args','Error:\x20Value\x20required\x20for\x20set\x20action','--pretty','--no-merges','--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---','set','argument','[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20','./dashboard','stdout','watcher\x20[action]','command','Compact\x20session\x20copy:\x20','watcher','96VrjWvg','lastRedactAudit','retrieve\x20<chunkId>','1.0.0','fullPath','lastFeatures','dashboard','Command','__createBinding','Install\x20or\x20uninstall\x20system\x20command\x20shims','startDashboard','.compact','./filters','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','every','npm','extname','--format','Retrieve\x20raw\x20offloaded\x20content\x20chunk\x20from\x20local\x20side-cache','model_name'];a0_0x59a0=function(){return _0x994e42;};return a0_0x59a0();}function isMcpServerExecution(_0x5a39e3,_0x29a79b){const _0xd0ed5d=a0_0x32cd0e,_0x4e1bdf=_0x5a39e3['toLowerCase'](),_0x4543a0=_0x29a79b[_0xd0ed5d(0x1c4)]('\x20')['toLowerCase']();if(_0x4e1bdf['includes'](_0xd0ed5d(0x1d3))&&(_0x4e1bdf[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x18b))||_0x4e1bdf[_0xd0ed5d(0x1c1)]('proxy')))return!![];if(_0x4e1bdf==='npx'||_0x4e1bdf===_0xd0ed5d(0x1b8)||_0x4e1bdf===_0xd0ed5d(0x236)||_0x4e1bdf===_0xd0ed5d(0x208)||_0x4e1bdf===_0xd0ed5d(0x241)||_0x4e1bdf===_0xd0ed5d(0x227)){if(_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x1bf))||_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x1cf))||_0x4543a0[_0xd0ed5d(0x1c1)](_0xd0ed5d(0x191))||_0x4543a0[_0xd0ed5d(0x1c1)]('server-mcp'))return!![];}if(_0x29a79b[_0xd0ed5d(0x1d9)](_0x399246=>{const _0x3d5a1c=_0xd0ed5d,_0x2120cb=_0x399246[_0x3d5a1c(0x23a)]();return _0x2120cb[_0x3d5a1c(0x1c1)](_0x3d5a1c(0x191))||_0x2120cb['includes'](_0x3d5a1c(0x218))||_0x2120cb[_0x3d5a1c(0x1c1)](_0x3d5a1c(0x1bf))||_0x2120cb===_0x3d5a1c(0x1ae)||_0x2120cb==='mcp';}))return!![];return![];}async function runProxy(_0x46ed28){const _0x4bf7dc=a0_0x32cd0e;if(_0x46ed28[_0x4bf7dc(0x23f)]===0x0){program[_0x4bf7dc(0x1d2)]();return;}const _0x269325=_0x46ed28[0x0],_0x1a4b08=_0x46ed28[_0x4bf7dc(0x1ea)](0x1),_0x24491=_0x46ed28['join']('\x20');if(isDisabled()){const _0x4e2f37=await(0x0,executor_1['executeCommand'])(_0x269325,_0x1a4b08);process[_0x4bf7dc(0x1f4)]['write'](_0x4e2f37[_0x4bf7dc(0x1f4)]),process[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x22c)](_0x4e2f37['stderr']),process[_0x4bf7dc(0x19f)](_0x4e2f37['exitCode']);}if(isMcpServerExecution(_0x269325,_0x1a4b08)){console['error']('[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...');const {runMcpProxy:_0x257f8f}=await Promise[_0x4bf7dc(0x1c2)]()[_0x4bf7dc(0x1b5)](()=>__importStar(require(_0x4bf7dc(0x1bd))));_0x257f8f(_0x269325,_0x1a4b08);return;}const _0x5301d3=adjustCommandArgs(_0x269325,_0x1a4b08),_0x5ea1c5=await(0x0,executor_1[_0x4bf7dc(0x1e9)])(_0x5301d3['cmd'],_0x5301d3[_0x4bf7dc(0x1eb)]),_0x22a4c4=(0x0,filters_1[_0x4bf7dc(0x1b4)])(_0x24491,_0x5ea1c5['stdout'],_0x5ea1c5[_0x4bf7dc(0x1a4)],tracker_1[_0x4bf7dc(0x233)][_0x4bf7dc(0x1d4)]()[_0x4bf7dc(0x1e6)]),_0x171fa9={...filters_1[_0x4bf7dc(0x1fa)]},_0x12e887=_0x5ea1c5['stdout']+(_0x5ea1c5[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x19d)]()[_0x4bf7dc(0x23f)]>0x0?'\x0a'+_0x5ea1c5['stderr']:''),_0x1a424e=_0x22a4c4[_0x4bf7dc(0x23f)]<_0x12e887[_0x4bf7dc(0x23f)]?_0x22a4c4:_0x12e887,_0x5597f9=_0x5ea1c5['exitCode']===0x0?(0x0,cache_1[_0x4bf7dc(0x213)])(_0x24491,_0x1a424e):null;tracker_1[_0x4bf7dc(0x233)]['logExecution'](_0x24491,_0x12e887,_0x5597f9||_0x1a424e,_0x5ea1c5[_0x4bf7dc(0x242)],_0x171fa9,[...filters_1[_0x4bf7dc(0x1fe)]]),_0x5ea1c5['exitCode']===0x0?process['stdout'][_0x4bf7dc(0x22c)](_0x1a424e+'\x0a'):(process[_0x4bf7dc(0x1f4)]['write'](_0x22a4c4+'\x0a'),_0x5ea1c5['stderr'][_0x4bf7dc(0x19d)]()['length']>0x0&&!_0x22a4c4[_0x4bf7dc(0x1c1)](_0x5ea1c5[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x19d)]())&&process[_0x4bf7dc(0x1a4)][_0x4bf7dc(0x22c)](_0x5ea1c5[_0x4bf7dc(0x1a4)]+'\x0a')),process[_0x4bf7dc(0x19f)](_0x5ea1c5[_0x4bf7dc(0x242)]);}program[a0_0x32cd0e(0x215)](a0_0x32cd0e(0x19d))['description'](a0_0x32cd0e(0x219))['version'](((()=>{const _0x11edfe=a0_0x32cd0e,_0x2ebb12=_0x11edfe(0x1b2);if(_0x2ebb12!==_0x11edfe(0x1de))return _0x2ebb12;try{return require(_0x11edfe(0x197))[_0x11edfe(0x1e5)];}catch{try{return require(_0x11edfe(0x1c5))['version'];}catch{return _0x11edfe(0x1fc);}}})())),program[a0_0x32cd0e(0x1f6)]('ui')[a0_0x32cd0e(0x190)](a0_0x32cd0e(0x1ff))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x199))[a0_0x32cd0e(0x228)](a0_0x32cd0e(0x1bc),a0_0x32cd0e(0x20d),a0_0x32cd0e(0x1ad))[a0_0x32cd0e(0x1d1)](_0x29dde9=>{const _0x35e65d=a0_0x32cd0e,_0x5b4cda=parseInt(_0x29dde9['port'],0xa);(0x0,dashboard_1[_0x35e65d(0x203)])(_0x5b4cda);}),program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1a6))[a0_0x32cd0e(0x186)]('Show\x20token\x20and\x20cost\x20savings\x20summary')[a0_0x32cd0e(0x228)](a0_0x32cd0e(0x192),'Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)',a0_0x32cd0e(0x1b3))[a0_0x32cd0e(0x1d1)](_0x4a8f7a=>{const _0x1db359=a0_0x32cd0e,_0x5e056d=tracker_1[_0x1db359(0x233)]['getStatsSummary'](_0x4a8f7a['model']);console['log']('\x0a============================================='),console[_0x1db359(0x193)]('\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20'),console[_0x1db359(0x193)](_0x1db359(0x217)),console[_0x1db359(0x193)]('Model\x20Context:\x20\x20\x20\x20\x20'+_0x5e056d[_0x1db359(0x20c)]),console[_0x1db359(0x193)](_0x1db359(0x1ce)+_0x5e056d[_0x1db359(0x194)]['toLocaleString']()),console[_0x1db359(0x193)](_0x1db359(0x1cc)+_0x5e056d[_0x1db359(0x1e3)][_0x1db359(0x243)]()),console['log'](_0x1db359(0x18e)+_0x5e056d[_0x1db359(0x1c0)][_0x1db359(0x243)]()),console[_0x1db359(0x193)](_0x1db359(0x1c9)+_0x5e056d['savings_percentage']+'%'),console['log'](_0x1db359(0x226)+_0x5e056d[_0x1db359(0x21c)][_0x1db359(0x231)](0x4)+_0x1db359(0x234)),console[_0x1db359(0x193)](_0x1db359(0x22b)+_0x5e056d[_0x1db359(0x244)][_0x1db359(0x231)](0x4)+_0x1db359(0x189)),console[_0x1db359(0x193)](_0x1db359(0x187)),console[_0x1db359(0x193)]('Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$'+_0x5e056d[_0x1db359(0x1d6)][_0x1db359(0x231)](0x4)+_0x1db359(0x1b0)),console[_0x1db359(0x193)](_0x1db359(0x1ba));}),program[a0_0x32cd0e(0x1f6)]('config')[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x1ac))['argument'](a0_0x32cd0e(0x21b),'get\x20or\x20set')[a0_0x32cd0e(0x1f1)](a0_0x32cd0e(0x1b9),a0_0x32cd0e(0x21d))['argument'](a0_0x32cd0e(0x214),a0_0x32cd0e(0x196))[a0_0x32cd0e(0x1d1)]((_0x58ed1a,_0x14d63f,_0xb0014f)=>{const _0x481196=a0_0x32cd0e;if(_0x58ed1a===_0x481196(0x1e7)){const _0x44e27a=tracker_1[_0x481196(0x233)]['getConfig']();console[_0x481196(0x193)](_0x14d63f+':\x20'+_0x44e27a[_0x14d63f]);}else{if(_0x58ed1a===_0x481196(0x1f0)){_0xb0014f===undefined&&(console[_0x481196(0x1a9)](_0x481196(0x1ec)),process[_0x481196(0x19f)](0x1));let _0x345c51=_0xb0014f;if(_0xb0014f===_0x481196(0x223))_0x345c51=!![];if(_0xb0014f==='false')_0x345c51=![];if(/^\d+$/['test'](_0xb0014f))_0x345c51=parseInt(_0xb0014f,0xa);tracker_1[_0x481196(0x233)]['setConfig'](_0x14d63f,_0x345c51),console[_0x481196(0x193)](_0x481196(0x1e8)+_0x14d63f+'\x20=\x20'+_0xb0014f);}else console[_0x481196(0x1a9)](_0x481196(0x206)),process[_0x481196(0x19f)](0x1);}});function a0_0x2489(_0x733dbb,_0x57aefe){const _0x59a070=a0_0x59a0();return a0_0x2489=function(_0x248955,_0x4b8f7b){_0x248955=_0x248955-0x186;let _0xb5300f=_0x59a070[_0x248955];return _0xb5300f;},a0_0x2489(_0x733dbb,_0x57aefe);}function printMessage(_0x19befe){const _0x3bc7fd=a0_0x32cd0e;if(process['env'][_0x3bc7fd(0x212)]===_0x3bc7fd(0x1b1))try{const _0x28d958=require('fs'),_0xe25c4e=process['platform']==='win32'?_0x3bc7fd(0x235):_0x3bc7fd(0x1be);_0x28d958[_0x3bc7fd(0x1c7)](_0xe25c4e,'\x0a'+_0x19befe+'\x0a');return;}catch{}console['log'](_0x19befe);}program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1da))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x202))[a0_0x32cd0e(0x1f1)]('<action>',a0_0x32cd0e(0x22d))['action'](_0x1f9899=>{const _0x3fa435=a0_0x32cd0e;if(_0x1f9899===_0x3fa435(0x18f)){const _0x71d2d0=(0x0,shims_1[_0x3fa435(0x1a2)])();printMessage(_0x71d2d0[_0x3fa435(0x225)]);}else{if(_0x1f9899===_0x3fa435(0x19b)){const _0x4f7712=(0x0,shims_1['uninstallShims'])();printMessage(_0x4f7712[_0x3fa435(0x225)]);}else console[_0x3fa435(0x1a9)](_0x3fa435(0x1dd)),process['exit'](0x1);}}),program['command'](a0_0x32cd0e(0x1d7))['description'](a0_0x32cd0e(0x1b6))['argument'](a0_0x32cd0e(0x22f),a0_0x32cd0e(0x1e0))[a0_0x32cd0e(0x1d1)](_0x336c24=>{const _0x2c4a5d=a0_0x32cd0e;if(isDisabled()){console[_0x2c4a5d(0x193)](_0x336c24);return;}const _0x1ff4fc=(0x0,filters_1[_0x2c4a5d(0x18c)])(_0x336c24);console['log'](_0x1ff4fc);}),program[a0_0x32cd0e(0x1f6)](a0_0x32cd0e(0x1f5))[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x23e))[a0_0x32cd0e(0x1d1)](async _0x365036=>{const _0xdf2477=a0_0x32cd0e,{startWatcherDaemon:_0x2a31fd}=await Promise['resolve']()[_0xdf2477(0x1b5)](()=>__importStar(require('./file-watcher')));(!_0x365036||_0x365036===_0xdf2477(0x21e)||_0x365036===_0xdf2477(0x18f))&&_0x2a31fd();}),program['command'](a0_0x32cd0e(0x1fb))['description'](a0_0x32cd0e(0x20b))[a0_0x32cd0e(0x1d1)](async _0x31ab2e=>{const _0x261a87=a0_0x32cd0e,{retrieveChunk:_0xb84696}=await Promise[_0x261a87(0x1c2)]()['then'](()=>__importStar(require('./cache-manager'))),_0x2002f1=_0xb84696(_0x31ab2e);_0x2002f1?console['log'](_0x2002f1[_0x261a87(0x23c)]):(console['error']('[TrimPrompt\x20Cache]\x20Chunk\x20\x27'+_0x31ab2e+_0x261a87(0x1a1)),process[_0x261a87(0x19f)](0x1));}),program[a0_0x32cd0e(0x1f6)]('compact\x20[sessionId]')[a0_0x32cd0e(0x186)](a0_0x32cd0e(0x188))[a0_0x32cd0e(0x1d1)](async _0x876ad4=>{const _0x5e4426=a0_0x32cd0e,{getLatestSessionFile:_0x4ed277,processSessionFile:_0x1887b0}=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require(_0x5e4426(0x1ca)))),_0x395a04=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require('fs'))),_0x2296bb=await Promise[_0x5e4426(0x1c2)]()[_0x5e4426(0x1b5)](()=>__importStar(require(_0x5e4426(0x1af))));let _0xc69849=_0x876ad4;if(!_0x876ad4||!_0x395a04['existsSync'](_0x876ad4)){const _0x27d825=_0x4ed277(_0x5e4426(0x222));_0xc69849=_0x27d825[_0x5e4426(0x1fd)];}if(_0xc69849&&_0x395a04['existsSync'](_0xc69849)){const _0x294b16=_0x2296bb[_0x5e4426(0x209)](_0xc69849),_0x57d371=_0x2296bb[_0x5e4426(0x1a8)](_0xc69849),_0x4145e5=_0x2296bb[_0x5e4426(0x1e4)](_0xc69849,_0x294b16),_0x4c6178=_0x2296bb[_0x5e4426(0x1c4)](_0x57d371,_0x4145e5+_0x5e4426(0x204)+_0x294b16);_0x395a04['copyFileSync'](_0xc69849,_0x4c6178),_0x1887b0(_0x4c6178,'claude'),console['log']('\x0a[TrimPrompt\x20Compact]\x20Clean\x20compressed\x20session\x20generated\x20successfully!'),console[_0x5e4426(0x193)](_0x5e4426(0x238)+_0xc69849),console['log'](_0x5e4426(0x1f7)+_0x4c6178),console[_0x5e4426(0x193)]('\x0aTo\x20resume\x20with\x20lightweight\x20context,\x20execute:'),console[_0x5e4426(0x193)](_0x5e4426(0x23b)+_0x4c6178+'\x22\x0a');}else console[_0x5e4426(0x1a9)]('[TrimPrompt\x20Compact]\x20Could\x20not\x20find\x20session\x20file.');});const args=process[a0_0x32cd0e(0x1e1)][a0_0x32cd0e(0x1ea)](0x2),firstArg=args[0x0],subcommands=['ui',a0_0x32cd0e(0x1ff),a0_0x32cd0e(0x1a6),'config',a0_0x32cd0e(0x1da),a0_0x32cd0e(0x1d7),'mcp-proxy','mcp',a0_0x32cd0e(0x1f8),a0_0x32cd0e(0x19e),a0_0x32cd0e(0x1d8),a0_0x32cd0e(0x1d2),a0_0x32cd0e(0x1bb),'-h',a0_0x32cd0e(0x1e5),a0_0x32cd0e(0x210),'-v'];firstArg&&!subcommands[a0_0x32cd0e(0x1c1)](firstArg)?runProxy(args)['catch'](_0x52415d=>{const _0x491b96=a0_0x32cd0e;console[_0x491b96(0x1a9)](_0x491b96(0x1f2)+_0x52415d[_0x491b96(0x225)]),process['exit'](0x1);}):program[a0_0x32cd0e(0x1cb)](process['argv']);
|
|
2
|
+
'use strict';function a0_0x2aac(_0x5788d3,_0x1d4797){_0x5788d3=_0x5788d3-0xb0;const _0x34498c=a0_0x3449();let _0x2aac61=_0x34498c[_0x5788d3];return _0x2aac61;}const a0_0xea4645=a0_0x2aac;(function(_0xbdb9c8,_0x137e0e){const _0x3243a0=a0_0x2aac,_0x5455bc=_0xbdb9c8();while(!![]){try{const _0x5bdc06=-parseInt(_0x3243a0(0xb0))/0x1*(parseInt(_0x3243a0(0x120))/0x2)+-parseInt(_0x3243a0(0x139))/0x3*(-parseInt(_0x3243a0(0x13e))/0x4)+parseInt(_0x3243a0(0xfe))/0x5+parseInt(_0x3243a0(0x132))/0x6*(parseInt(_0x3243a0(0x143))/0x7)+parseInt(_0x3243a0(0x10b))/0x8*(-parseInt(_0x3243a0(0xbe))/0x9)+parseInt(_0x3243a0(0xe4))/0xa*(parseInt(_0x3243a0(0xcb))/0xb)+-parseInt(_0x3243a0(0x14e))/0xc;if(_0x5bdc06===_0x137e0e)break;else _0x5455bc['push'](_0x5455bc['shift']());}catch(_0xd0647e){_0x5455bc['push'](_0x5455bc['shift']());}}}(a0_0x3449,0xb296a));var __createBinding=this&&this['__createBinding']||(Object[a0_0xea4645(0x13c)]?function(_0x362a76,_0xd493c2,_0x513620,_0x43816c){const _0x37e422=a0_0xea4645;if(_0x43816c===undefined)_0x43816c=_0x513620;var _0x3e5afc=Object[_0x37e422(0xb6)](_0xd493c2,_0x513620);(!_0x3e5afc||(_0x37e422(0xe3)in _0x3e5afc?!_0xd493c2[_0x37e422(0x112)]:_0x3e5afc[_0x37e422(0x107)]||_0x3e5afc[_0x37e422(0x116)]))&&(_0x3e5afc={'enumerable':!![],'get':function(){return _0xd493c2[_0x513620];}}),Object[_0x37e422(0x11f)](_0x362a76,_0x43816c,_0x3e5afc);}:function(_0x406a8d,_0x37d0a9,_0x57d95a,_0x51f871){if(_0x51f871===undefined)_0x51f871=_0x57d95a;_0x406a8d[_0x51f871]=_0x37d0a9[_0x57d95a];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0xea4645(0x13c)]?function(_0x163dd1,_0x3d8765){const _0xc05072=a0_0xea4645;Object[_0xc05072(0x11f)](_0x163dd1,_0xc05072(0x171),{'enumerable':!![],'value':_0x3d8765});}:function(_0x49c310,_0x493451){_0x49c310['default']=_0x493451;}),__importStar=this&&this[a0_0xea4645(0x123)]||(function(){var _0x2c84f7=function(_0x1d8514){const _0x1896c4=a0_0x2aac;return _0x2c84f7=Object[_0x1896c4(0x13b)]||function(_0x43c05c){const _0x664378=_0x1896c4;var _0x15b461=[];for(var _0x36c3ac in _0x43c05c)if(Object[_0x664378(0xdc)]['hasOwnProperty'][_0x664378(0x13a)](_0x43c05c,_0x36c3ac))_0x15b461[_0x15b461[_0x664378(0xf1)]]=_0x36c3ac;return _0x15b461;},_0x2c84f7(_0x1d8514);};return function(_0x448527){const _0x1a09a2=a0_0x2aac;if(_0x448527&&_0x448527[_0x1a09a2(0x112)])return _0x448527;var _0x41b186={};if(_0x448527!=null){for(var _0x5c5b26=_0x2c84f7(_0x448527),_0x449882=0x0;_0x449882<_0x5c5b26[_0x1a09a2(0xf1)];_0x449882++)if(_0x5c5b26[_0x449882]!==_0x1a09a2(0x171))__createBinding(_0x41b186,_0x448527,_0x5c5b26[_0x449882]);}return __setModuleDefault(_0x41b186,_0x448527),_0x41b186;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]});const commander_1=require(a0_0xea4645(0x158)),executor_1=require(a0_0xea4645(0x12d)),filters_1=require(a0_0xea4645(0x126)),tracker_1=require('./tracker'),cache_1=require(a0_0xea4645(0xda)),shims_1=require(a0_0xea4645(0xc7)),dashboard_1=require(a0_0xea4645(0x162)),program=new commander_1[(a0_0xea4645(0x100))]();function isDisabled(){return process.env.TRIMPROMPT_DISABLED==='1';}function adjustCommandArgs(_0x574405,_0x317102){const _0x2d4862=a0_0xea4645,_0x1beee3=_0x574405['toLowerCase']();if(_0x1beee3===_0x2d4862(0xec)||_0x1beee3===_0x2d4862(0x148)){const _0x540aa0=_0x317102[0x0];if(_0x540aa0===_0x2d4862(0x12b)){const _0x205853=_0x317102[_0x2d4862(0x16d)](0x1),_0x24b4c6=_0x205853[_0x2d4862(0xf1)]===0x0||_0x205853[_0x2d4862(0x168)](_0x1acbff=>{const _0x55dae9=_0x2d4862;return _0x1acbff==='-b'||_0x1acbff===_0x55dae9(0x114)||_0x1acbff===_0x55dae9(0x135)||_0x1acbff==='-bs'||_0x1acbff==='-s'||_0x1acbff===_0x55dae9(0x117);});if(_0x24b4c6)return{'cmd':_0x574405,'args':[_0x2d4862(0x12b),'--porcelain','-b']};}else{if(_0x540aa0==='log'){const _0x37d9b9=_0x317102[_0x2d4862(0x16d)](0x1),_0x338c2d=_0x37d9b9[_0x2d4862(0x11a)](_0x3d95ea=>_0x3d95ea['startsWith']('--oneline')||_0x3d95ea[_0x2d4862(0x147)](_0x2d4862(0x12e))||_0x3d95ea['startsWith']('--format')),_0x422954=_0x37d9b9[_0x2d4862(0x11a)](_0x36003e=>_0x36003e[_0x2d4862(0x147)]('-')&&/^\d+$/['test'](_0x36003e[_0x2d4862(0x16d)](0x1))||_0x36003e==='-n'||_0x36003e['startsWith'](_0x2d4862(0x16e))),_0x2efc89=[..._0x317102];if(!_0x338c2d){const _0x27ec4b='--pretty=format:%h\x20%s\x20(%ar)\x20(%an)%n%b%n---END---';_0x2efc89[_0x2d4862(0xed)](process[_0x2d4862(0xe0)]===_0x2d4862(0xe6)?'\x22'+_0x27ec4b+'\x22':_0x27ec4b);}!_0x422954&&(_0x338c2d?_0x2efc89[_0x2d4862(0xed)](_0x2d4862(0xf2)):_0x2efc89[_0x2d4862(0xed)](_0x2d4862(0x169)));const _0x18a13f=_0x37d9b9[_0x2d4862(0x11a)](_0x4b4d28=>_0x4b4d28==='--merges'||_0x4b4d28===_0x2d4862(0xde)||_0x4b4d28[_0x2d4862(0x147)](_0x2d4862(0x109)));return!_0x18a13f&&!_0x422954&&_0x2efc89[_0x2d4862(0xed)](_0x2d4862(0xde)),{'cmd':_0x574405,'args':_0x2efc89};}}}return{'cmd':_0x574405,'args':_0x317102};}function isMcpServerExecution(_0x786487,_0x243f2b){const _0xc89235=a0_0xea4645,_0x2f26f1=_0x786487[_0xc89235(0x14f)](),_0x22c0ce=_0x243f2b[_0xc89235(0xf7)]('\x20')[_0xc89235(0x14f)]();if(_0x2f26f1[_0xc89235(0x160)](_0xc89235(0xf3))&&(_0x2f26f1['includes'](_0xc89235(0x11b))||_0x2f26f1[_0xc89235(0x160)](_0xc89235(0x15a))))return!![];if(_0x2f26f1===_0xc89235(0xc2)||_0x2f26f1===_0xc89235(0x101)||_0x2f26f1==='bun'||_0x2f26f1===_0xc89235(0x15d)||_0x2f26f1===_0xc89235(0xe9)||_0x2f26f1===_0xc89235(0x165)){if(_0x22c0ce[_0xc89235(0x160)]('@modelcontextprotocol/')||_0x22c0ce['includes'](_0xc89235(0x15c))||_0x22c0ce[_0xc89235(0x160)](_0xc89235(0xc3))||_0x22c0ce[_0xc89235(0x160)](_0xc89235(0x13f)))return!![];}if(_0x243f2b['some'](_0x1fd68b=>{const _0x1f684e=_0xc89235,_0x245240=_0x1fd68b[_0x1f684e(0x14f)]();return _0x245240[_0x1f684e(0x160)]('mcp-server')||_0x245240['includes'](_0x1f684e(0x13f))||_0x245240[_0x1f684e(0x160)]('@modelcontextprotocol/')||_0x245240===_0x1f684e(0x151)||_0x245240===_0x1f684e(0xf3);}))return!![];return![];}async function runProxy(_0x10845e){const _0x283daf=a0_0xea4645;if(_0x10845e[_0x283daf(0xf1)]===0x0){program['help']();return;}const _0xfcad17=_0x10845e[0x0],_0xcd744=_0x10845e[_0x283daf(0x16d)](0x1),_0x4dd2f3=_0x10845e[_0x283daf(0xf7)]('\x20');if(isDisabled()){const _0x9dd982=await(0x0,executor_1['executeCommand'])(_0xfcad17,_0xcd744);process[_0x283daf(0x127)][_0x283daf(0x170)](_0x9dd982[_0x283daf(0x127)]),process[_0x283daf(0xd5)]['write'](_0x9dd982['stderr']),process[_0x283daf(0xd4)](_0x9dd982['exitCode']);}if(isMcpServerExecution(_0xfcad17,_0xcd744)){console['error']('[TrimPrompt]\x20Autodetected\x20MCP\x20server\x20execution.\x20Activating\x20real-time\x20JSON-RPC\x20proxy...');const {runMcpProxy:_0x285100}=await Promise['resolve']()[_0x283daf(0xe8)](()=>__importStar(require(_0x283daf(0x161))));_0x285100(_0xfcad17,_0xcd744);return;}const _0x4ad4ba=adjustCommandArgs(_0xfcad17,_0xcd744),_0x3678ff=await(0x0,executor_1[_0x283daf(0x142)])(_0x4ad4ba['cmd'],_0x4ad4ba[_0x283daf(0x10f)]),_0x5f25e9=(0x0,filters_1['compressOutput'])(_0x4dd2f3,_0x3678ff['stdout'],_0x3678ff['stderr'],tracker_1[_0x283daf(0xc9)][_0x283daf(0xf8)]()[_0x283daf(0x14a)]),_0x343ec5={...filters_1[_0x283daf(0xce)]},_0x51cdb8=_0x3678ff[_0x283daf(0x127)]+(_0x3678ff[_0x283daf(0xd5)][_0x283daf(0xee)]()[_0x283daf(0xf1)]>0x0?'\x0a'+_0x3678ff[_0x283daf(0xd5)]:''),_0x558f4d=_0x5f25e9['length']<_0x51cdb8['length']?_0x5f25e9:_0x51cdb8,_0x5152ea=_0x3678ff['exitCode']===0x0?(0x0,cache_1[_0x283daf(0x154)])(_0x4dd2f3,_0x558f4d):null;tracker_1[_0x283daf(0xc9)][_0x283daf(0x16f)](_0x4dd2f3,_0x51cdb8,_0x5152ea||_0x558f4d,_0x3678ff[_0x283daf(0x164)],_0x343ec5,[...filters_1[_0x283daf(0xc6)]]);_0x3678ff[_0x283daf(0x164)]===0x0?process[_0x283daf(0x127)][_0x283daf(0x170)](_0x558f4d+'\x0a'):(process['stdout']['write'](_0x5f25e9+'\x0a'),_0x3678ff[_0x283daf(0xd5)][_0x283daf(0xee)]()['length']>0x0&&!_0x5f25e9[_0x283daf(0x160)](_0x3678ff[_0x283daf(0xd5)]['trim']())&&process[_0x283daf(0xd5)][_0x283daf(0x170)](_0x3678ff[_0x283daf(0xd5)]+'\x0a'));try{const {loadSessionsState:_0x86a131,getLatestSessionFile:_0x294017}=await Promise[_0x283daf(0xfb)]()[_0x283daf(0xe8)](()=>__importStar(require(_0x283daf(0x16a)))),_0xa4da63=_0x86a131(),_0x41b0bb=(0x0,tracker_1[_0x283daf(0x131)])(),_0x1181ba=_0x41b0bb[_0x283daf(0x105)]==='antigravity'?_0x283daf(0x119):_0x41b0bb['tool']||'claude',_0x27f533=_0x294017(_0x1181ba);let _0x476efb=0x0;_0x27f533&&_0x27f533['fullPath']&&_0xa4da63[_0x27f533[_0x283daf(0x166)]]&&(_0x476efb=_0xa4da63[_0x27f533[_0x283daf(0x166)]][_0x283daf(0xc5)]||0x0);let _0x1fdbba=0x0;for(const _0x23e307 of Object[_0x283daf(0x134)](_0xa4da63)){_0x1fdbba+=_0xa4da63[_0x23e307][_0x283daf(0xc5)]||0x0;}(_0x476efb>0x0||_0x1fdbba>0x0)&&process[_0x283daf(0xd5)][_0x283daf(0x170)](_0x283daf(0xc1)+_0x1181ba+_0x283daf(0xb5)+_0x476efb['toLocaleString']()+_0x283daf(0xcc)+_0x1fdbba[_0x283daf(0xf6)]()+_0x283daf(0xb2));}catch{}process[_0x283daf(0xd4)](_0x3678ff[_0x283daf(0x164)]);}program['name'](a0_0xea4645(0xee))[a0_0xea4645(0x145)](a0_0xea4645(0xd0))[a0_0xea4645(0xb7)](((()=>{const _0x273274=a0_0xea4645,_0x537e88='1.0.34';if(_0x537e88!==_0x273274(0x10d))return _0x537e88;try{return require(_0x273274(0xbc))['version'];}catch{try{return require(_0x273274(0xfc))['version'];}catch{return _0x273274(0x14c);}}})())),program['command']('ui')[a0_0xea4645(0xb3)](a0_0xea4645(0x15b))[a0_0xea4645(0x145)](a0_0xea4645(0x133))[a0_0xea4645(0x115)](a0_0xea4645(0x152),a0_0xea4645(0xd3),a0_0xea4645(0xd9))['action'](_0x2c9d7e=>{const _0x36fa7d=a0_0xea4645,_0x9b8e4e=parseInt(_0x2c9d7e[_0x36fa7d(0xba)],0xa);(0x0,dashboard_1[_0x36fa7d(0xe2)])(_0x9b8e4e);}),program[a0_0xea4645(0x111)]('stats')[a0_0xea4645(0x145)](a0_0xea4645(0x146))['option']('-m,\x20--model\x20<string>',a0_0xea4645(0x11c),a0_0xea4645(0xe7))[a0_0xea4645(0xd2)](_0x390967=>{const _0x271779=a0_0xea4645,_0x1dd8c3=tracker_1[_0x271779(0xc9)]['getStatsSummary'](_0x390967[_0x271779(0x144)]);console['log'](_0x271779(0x137)),console[_0x271779(0x11d)](_0x271779(0x155)),console[_0x271779(0x11d)](_0x271779(0xcd)),console[_0x271779(0x11d)](_0x271779(0x149)+_0x1dd8c3['model_name']),console[_0x271779(0x11d)]('Raw\x20Tokens:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1dd8c3[_0x271779(0x14d)][_0x271779(0xf6)]()),console[_0x271779(0x11d)](_0x271779(0xf0)+_0x1dd8c3['total_compressed_tokens'][_0x271779(0xf6)]()),console['log'](_0x271779(0xe1)+_0x1dd8c3['total_tokens_saved'][_0x271779(0xf6)]()),console[_0x271779(0x11d)](_0x271779(0xea)+_0x1dd8c3['savings_percentage']+'%'),console[_0x271779(0x11d)](_0x271779(0x10a)+_0x1dd8c3['raw_cost_usd']['toFixed'](0x4)+_0x271779(0xf5)),console[_0x271779(0x11d)](_0x271779(0x153)+_0x1dd8c3[_0x271779(0xeb)][_0x271779(0x150)](0x4)+_0x271779(0xdf)),console['log'](_0x271779(0xb4)),console[_0x271779(0x11d)](_0x271779(0x16b)+_0x1dd8c3['money_saved_usd']['toFixed'](0x4)+'\x20USD'),console['log'](_0x271779(0xdd));}),program['command'](a0_0xea4645(0x110))[a0_0xea4645(0x145)](a0_0xea4645(0xf9))['argument'](a0_0xea4645(0x113),a0_0xea4645(0x106))[a0_0xea4645(0xca)]('<key>',a0_0xea4645(0xbb))[a0_0xea4645(0xca)](a0_0xea4645(0x167),a0_0xea4645(0x103))[a0_0xea4645(0xd2)]((_0x2f788d,_0x5509ca,_0x4b5a84)=>{const _0x5b255e=a0_0xea4645;if(_0x2f788d===_0x5b255e(0xe3)){const _0x579f55=tracker_1[_0x5b255e(0xc9)][_0x5b255e(0xf8)]();console[_0x5b255e(0x11d)](_0x5509ca+':\x20'+_0x579f55[_0x5509ca]);}else{if(_0x2f788d===_0x5b255e(0x15f)){_0x4b5a84===undefined&&(console[_0x5b255e(0x16c)](_0x5b255e(0x122)),process[_0x5b255e(0xd4)](0x1));let _0x3040a3=_0x4b5a84;if(_0x4b5a84===_0x5b255e(0x12a))_0x3040a3=!![];if(_0x4b5a84===_0x5b255e(0xf4))_0x3040a3=![];if(/^\d+$/[_0x5b255e(0x13d)](_0x4b5a84))_0x3040a3=parseInt(_0x4b5a84,0xa);tracker_1[_0x5b255e(0xc9)][_0x5b255e(0x125)](_0x5509ca,_0x3040a3),console[_0x5b255e(0x11d)](_0x5b255e(0xc0)+_0x5509ca+_0x5b255e(0x140)+_0x4b5a84);}else console[_0x5b255e(0x16c)](_0x5b255e(0x136)),process['exit'](0x1);}});function printMessage(_0x2fbb0b){const _0x3b6f7e=a0_0xea4645;if(process.env.npm_lifecycle_event===_0x3b6f7e(0x141))try{const _0x3da0c1=require('fs'),_0x1ef074=process['platform']===_0x3b6f7e(0xe6)?'\x5c\x5c.\x5cCON':_0x3b6f7e(0x104);_0x3da0c1['writeFileSync'](_0x1ef074,'\x0a'+_0x2fbb0b+'\x0a');return;}catch{}console[_0x3b6f7e(0x11d)](_0x2fbb0b);}function a0_0x3449(){const _0x44d02c=['3eUJIcs','call','getOwnPropertyNames','create','test','5138748eWYRCw','server-mcp','\x20=\x20','postinstall','executeCommand','7UjcPnr','model','description','Show\x20token\x20and\x20cost\x20savings\x20summary','startsWith','yadm','Model\x20Context:\x20\x20\x20\x20\x20','redaction_enabled','uninstallShims','1.0.0','total_raw_tokens','6791784iFsUbT','toLowerCase','toFixed','mcp-proxy','-p,\x20--port\x20<number>','Actual\x20Cost:\x20\x20\x20\x20\x20\x20\x20$','dedup','\x20\x20\x20\x20\x20\x20\x20TRIMPROMPT.AI\x20SAVINGS\x20SUMMARY\x20\x20\x20\x20\x20\x20\x20\x20','catch','rawBytes','commander','--help','proxy','dashboard','modelcontextprotocol','npm','\x27\x20not\x20found\x20or\x20expired.','set','includes','./mcp','./dashboard','compact\x20[sessionId]','exitCode','yarn','fullPath','[value]','every','-10','./file-watcher','Money\x20Saved:\x20\x20\x20\x20\x20\x20\x20$','error','slice','--max-count','logExecution','write','default','savedTokens','help','reason','rawTokens','52492PHUMnH','message','\x20tokens\x1b[39m\x0a','alias','---------------------------------------------',')\x20saved\x20','getOwnPropertyDescriptor','version','\x20bytes)','Original\x20file\x20untouched:\x20','port','config\x20parameter\x20name','../package.json','existsSync','207Usiara','compressedTokens','Config\x20set\x20','\x0a\x1b[90m[TrimPrompt]\x20⚡\x20Active\x20session\x20(','npx','mcp-server','rewrite','activeSavedTokens','lastFeatures','./shims','compressedBytes','tracker','argument','11990ZLsnFe','\x20tokens\x20|\x20Total\x20savings:\x20','=============================================','lastRedactAudit','Compressed:\x20','TrimPrompt.ai\x20-\x20Reduce\x20LLM\x20token\x20consumption\x20by\x2060-90%','(No\x20content\x20exceeded\x20the\x20offload\x20threshold\x20—\x20nothing\x20to\x20compress.)','action','Port\x20to\x20run\x20the\x20dashboard\x20on','exit','stderr','\x0aTo\x20resume\x20with\x20lightweight\x20context,\x20execute:','install','start','4000','./cache','reductionPct','prototype','=============================================\x0a','--no-merges','\x20(after\x20Trim)','platform','Tokens\x20Saved:\x20\x20\x20\x20\x20\x20','startDashboard','get','10210tgVGzW','Compact\x20session\x20copy:\x20\x20\x20\x20','win32','claude-3-5-sonnet','then','pnpm','Reduction\x20Rate:\x20\x20\x20\x20','compressed_cost_usd','git','push','trim','argv','Compressed:\x20\x20\x20\x20\x20\x20\x20\x20','length','-50','mcp','false','\x20(before\x20Trim)','toLocaleString','join','getConfig','Manage\x20local\x20configuration\x20parameters','Live\x20conversation\x20file-watcher\x20daemon\x20—\x20start,\x20install','resolve','./package.json','retrieve\x20<chunkId>','1040780Ygstnh','installShims','Command','node','Retrieve\x20raw\x20offloaded\x20content\x20chunk\x20from\x20local\x20side-cache','value\x20to\x20set','/dev/tty','tool','get\x20or\x20set','writable','parse','--min-parents','Estimated\x20Cost:\x20\x20\x20\x20$','422752Ljzlpu','\x20tokens\x20(','__VERSION__','Generate\x20a\x20clean,\x20compressed\x20copy\x20of\x20a\x20conversation\x20session\x20file\x20for\x20safe\x20resume','args','config','command','__esModule','<action>','--branch','option','configurable','--short','Error:\x20Action\x20must\x20be\x20install\x20or\x20uninstall','gemini','some','server','Select\x20pricing\x20model\x20(e.g.\x20claude-3-5-sonnet,\x20gpt-4o)','log','%\x20reduction)','defineProperty','24bqNNHG','shims','Error:\x20Value\x20required\x20for\x20set\x20action','__importStar','stats','setConfig','./filters','stdout','claude','watcher\x20[action]','true','status','uninstall','./executor','--pretty','Command\x20line\x20to\x20evaluate','agent','detectSessionTool','3222378UZZFfG','Start\x20the\x20local\x20developer\x20dashboard','keys','-sb','Error:\x20Action\x20must\x20be\x20get\x20or\x20set','\x0a=============================================','Saved:\x20\x20\x20\x20\x20\x20'];a0_0x3449=function(){return _0x44d02c;};return a0_0x3449();}program['command'](a0_0xea4645(0x121))[a0_0xea4645(0x145)]('Install\x20or\x20uninstall\x20system\x20command\x20shims')[a0_0xea4645(0xca)]('<action>','install\x20or\x20uninstall')['action'](_0x57c5be=>{const _0x40c623=a0_0xea4645;if(_0x57c5be===_0x40c623(0xd7)){const _0x3d5ab7=(0x0,shims_1[_0x40c623(0xff)])();printMessage(_0x3d5ab7['message']);}else{if(_0x57c5be===_0x40c623(0x12c)){const _0x337494=(0x0,shims_1[_0x40c623(0x14b)])();printMessage(_0x337494[_0x40c623(0xb1)]);}else console['error'](_0x40c623(0x118)),process[_0x40c623(0xd4)](0x1);}}),program[a0_0xea4645(0x111)](a0_0xea4645(0xc4))[a0_0xea4645(0x145)]('Check\x20a\x20command\x20line\x20and\x20return\x20the\x20optimized\x20command\x20line')[a0_0xea4645(0xca)]('<commandLine>',a0_0xea4645(0x12f))['action'](_0x4259c9=>{const _0x46b591=a0_0xea4645;if(isDisabled()){console[_0x46b591(0x11d)](_0x4259c9);return;}const _0x2862f6=(0x0,filters_1['rewriteCommand'])(_0x4259c9);console[_0x46b591(0x11d)](_0x2862f6);}),program[a0_0xea4645(0x111)](a0_0xea4645(0x129))['description'](a0_0xea4645(0xfa))[a0_0xea4645(0xd2)](async _0x4595c2=>{const _0x2012f3=a0_0xea4645,{startWatcherDaemon:_0x29c19d}=await Promise[_0x2012f3(0xfb)]()[_0x2012f3(0xe8)](()=>__importStar(require('./file-watcher')));(!_0x4595c2||_0x4595c2===_0x2012f3(0xd8)||_0x4595c2==='install')&&_0x29c19d();}),program[a0_0xea4645(0x111)](a0_0xea4645(0xfd))['description'](a0_0xea4645(0x102))['action'](async _0x1e9e3a=>{const _0x351d96=a0_0xea4645,{retrieveChunk:_0x1f38ba}=await Promise[_0x351d96(0xfb)]()['then'](()=>__importStar(require('./cache-manager'))),_0x12d3d8=_0x1f38ba(_0x1e9e3a);_0x12d3d8?console[_0x351d96(0x11d)](_0x12d3d8['raw_payload']):(console['error']('[TrimPrompt\x20Cache]\x20Chunk\x20\x27'+_0x1e9e3a+_0x351d96(0x15e)),process[_0x351d96(0xd4)](0x1));}),program[a0_0xea4645(0x111)](a0_0xea4645(0x163))['description'](a0_0xea4645(0x10e))[a0_0xea4645(0x115)]('-a,\x20--agent\x20<agent>','Agent\x20key\x20(claude,\x20cursor,\x20codex,\x20...)','claude')[a0_0xea4645(0xd2)](async(_0x1330c1,_0xd4cbba)=>{const _0x50c98a=a0_0xea4645,{getLatestSessionFile:_0x37a6f4,compactSessionCopy:_0x47f2e9}=await Promise[_0x50c98a(0xfb)]()[_0x50c98a(0xe8)](()=>__importStar(require(_0x50c98a(0x16a)))),_0x5085e0=await Promise['resolve']()[_0x50c98a(0xe8)](()=>__importStar(require('fs'))),_0x38dfe1=_0xd4cbba&&_0xd4cbba[_0x50c98a(0x130)]||_0x50c98a(0x128);let _0x39614e=_0x1330c1;if(!_0x1330c1||!_0x5085e0['existsSync'](_0x1330c1)){const _0x1ad770=_0x37a6f4(_0x38dfe1);_0x39614e=_0x1ad770[_0x50c98a(0x166)];}if(!_0x39614e||!_0x5085e0[_0x50c98a(0xbd)](_0x39614e)){console[_0x50c98a(0x16c)]('[TrimPrompt\x20Compact]\x20Could\x20not\x20find\x20a\x20session\x20file\x20for\x20\x27'+_0x38dfe1+'\x27.');return;}const _0x3d445a=_0x47f2e9(_0x39614e,_0x38dfe1);if(!_0x3d445a['ok']){console[_0x50c98a(0x16c)]('[TrimPrompt\x20Compact]\x20'+_0x3d445a[_0x50c98a(0x174)]);return;}console['log']('\x0a[TrimPrompt\x20Compact]\x20Clean\x20compressed\x20session\x20copy\x20generated.'),console[_0x50c98a(0x11d)](_0x50c98a(0xb9)+_0x39614e),console[_0x50c98a(0x11d)](_0x50c98a(0xe5)+_0x3d445a['compactPath']),console[_0x50c98a(0x11d)]('Raw:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3d445a[_0x50c98a(0x175)]?.[_0x50c98a(0xf6)]()+'\x20tokens\x20('+_0x3d445a[_0x50c98a(0x157)]?.[_0x50c98a(0xf6)]()+'\x20bytes)'),console['log'](_0x50c98a(0xcf)+_0x3d445a[_0x50c98a(0xbf)]?.[_0x50c98a(0xf6)]()+_0x50c98a(0x10c)+_0x3d445a[_0x50c98a(0xc8)]?.['toLocaleString']()+_0x50c98a(0xb8)),console['log'](_0x50c98a(0x138)+_0x3d445a[_0x50c98a(0x172)]?.[_0x50c98a(0xf6)]()+'\x20tokens\x20('+_0x3d445a[_0x50c98a(0xdb)]+_0x50c98a(0x11e)),(_0x3d445a[_0x50c98a(0x172)]||0x0)===0x0?console[_0x50c98a(0x11d)](_0x50c98a(0xd1)):(console['log'](_0x50c98a(0xd6)),console[_0x50c98a(0x11d)]('\x20\x20claude\x20--resume\x20\x22'+_0x3d445a['compactPath']+'\x22')),console['log']('');});const args=process[a0_0xea4645(0xef)][a0_0xea4645(0x16d)](0x2),firstArg=args[0x0],subcommands=['ui','dashboard',a0_0xea4645(0x124),a0_0xea4645(0x110),'shims',a0_0xea4645(0xc4),a0_0xea4645(0x151),a0_0xea4645(0xf3),'watcher','retrieve','compact',a0_0xea4645(0x173),a0_0xea4645(0x159),'-h','version','--version','-v'];firstArg&&!subcommands[a0_0xea4645(0x160)](firstArg)?runProxy(args)[a0_0xea4645(0x156)](_0x4b8444=>{const _0x1d9603=a0_0xea4645;console['error']('[TrimPrompt]\x20Fatal\x20Proxy\x20Error:\x20'+_0x4b8444[_0x1d9603(0xb1)]),process[_0x1d9603(0xd4)](0x1);}):program[a0_0xea4645(0x108)](process['argv']);
|
package/dashboard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x590a69=a0_0x2a47;(function(_0x136d31,_0x458ccb){const _0x30d120=a0_0x2a47,_0x5bd3af=_0x136d31();while(!![]){try{const _0x22affc=-parseInt(_0x30d120(0xe4))/0x1+parseInt(_0x30d120(0xe8))/0x2*(-parseInt(_0x30d120(0xb4))/0x3)+parseInt(_0x30d120(0x105))/0x4*(-parseInt(_0x30d120(0xea))/0x5)+-parseInt(_0x30d120(0xb5))/0x6+parseInt(_0x30d120(0xf4))/0x7+-parseInt(_0x30d120(0xf1))/0x8*(-parseInt(_0x30d120(0x100))/0x9)+-parseInt(_0x30d120(0xc6))/0xa*(-parseInt(_0x30d120(0xb7))/0xb);if(_0x22affc===_0x458ccb)break;else _0x5bd3af['push'](_0x5bd3af['shift']());}catch(_0x144391){_0x5bd3af['push'](_0x5bd3af['shift']());}}}(a0_0x5110,0xd74ea));var __createBinding=this&&this['__createBinding']||(Object[a0_0x590a69(0xbf)]?function(_0x4cf040,_0x5bb670,_0x9fbf68,_0x16118b){const _0xf58858=a0_0x590a69;if(_0x16118b===undefined)_0x16118b=_0x9fbf68;var _0x3f83d2=Object[_0xf58858(0xac)](_0x5bb670,_0x9fbf68);(!_0x3f83d2||(_0xf58858(0xa5)in _0x3f83d2?!_0x5bb670[_0xf58858(0xae)]:_0x3f83d2['writable']||_0x3f83d2[_0xf58858(0xd9)]))&&(_0x3f83d2={'enumerable':!![],'get':function(){return _0x5bb670[_0x9fbf68];}}),Object['defineProperty'](_0x4cf040,_0x16118b,_0x3f83d2);}:function(_0xc66e6,_0x3ccc96,_0x1d1355,_0x9fe357){if(_0x9fe357===undefined)_0x9fe357=_0x1d1355;_0xc66e6[_0x9fe357]=_0x3ccc96[_0x1d1355];}),__setModuleDefault=this&&this[a0_0x590a69(0xc4)]||(Object[a0_0x590a69(0xbf)]?function(_0x12a78a,_0x5c689c){const _0x36895e=a0_0x590a69;Object[_0x36895e(0xee)](_0x12a78a,_0x36895e(0xf9),{'enumerable':!![],'value':_0x5c689c});}:function(_0x4377bb,_0x4e33cc){const _0x1e1852=a0_0x590a69;_0x4377bb[_0x1e1852(0xf9)]=_0x4e33cc;}),__importStar=this&&this[a0_0x590a69(0xcb)]||(function(){var _0x30fe9d=function(_0x1f96a3){const _0x3ee0e2=a0_0x2a47;return _0x30fe9d=Object[_0x3ee0e2(0xc0)]||function(_0x13af18){const _0x3fe9a8=_0x3ee0e2;var _0x4e229e=[];for(var _0x4c22f6 in _0x13af18)if(Object[_0x3fe9a8(0xc9)][_0x3fe9a8(0xbe)][_0x3fe9a8(0xff)](_0x13af18,_0x4c22f6))_0x4e229e[_0x4e229e[_0x3fe9a8(0xc8)]]=_0x4c22f6;return _0x4e229e;},_0x30fe9d(_0x1f96a3);};return function(_0x2cea95){const _0x34c080=a0_0x2a47;if(_0x2cea95&&_0x2cea95[_0x34c080(0xae)])return _0x2cea95;var _0xdb5d89={};if(_0x2cea95!=null){for(var _0x3b0b47=_0x30fe9d(_0x2cea95),_0x7e336a=0x0;_0x7e336a<_0x3b0b47[_0x34c080(0xc8)];_0x7e336a++)if(_0x3b0b47[_0x7e336a]!==_0x34c080(0xf9))__createBinding(_0xdb5d89,_0x2cea95,_0x3b0b47[_0x7e336a]);}return __setModuleDefault(_0xdb5d89,_0x2cea95),_0xdb5d89;};}()),__importDefault=this&&this[a0_0x590a69(0xf3)]||function(_0x17580b){const _0x518161=a0_0x590a69;return _0x17580b&&_0x17580b[_0x518161(0xae)]?_0x17580b:{'default':_0x17580b};};function a0_0x5110(){const _0x9e6ba7=['openclaw','__importDefault','1317414TtiUGF','index.html','Raw\x20output\x20log\x20file\x20not\x20found.','Missing\x20key','activeSavedTokens','default','../src/favicon.png','opencode','claude','codex','filter','call','9hvPEWw','utf8','post','startDashboard','body','71940OjhPpo','log','.trimprompt','./file-watcher','Missing\x20agentKey','--headless','TRIMPROMPT_NO_OPEN','\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20','EADDRINUSE','No\x20active\x20session\x20file\x20found','setConfig','get','gemini','command','TRIMPROMPT_HEADLESS','logExecution','xdg-open\x20\x22','getConfig','getOwnPropertyDescriptor','includes','__esModule','Compressed\x20output\x20log\x20file\x20not\x20found.','error','getStatsSummary','/api/config/features','features_enabled','9wDnTIx','8851596uvoUmV','existsSync','44ytNtAC','use','/api/config/open-dir','join','json','fileName','platform','hasOwnProperty','create','getOwnPropertyNames','homedir','status','child_process','__setModuleDefault','[TrimPrompt]\x20Dashboard\x20error:\x20','5497220zwrHfT','tracker','length','prototype','darwin','__importStar','/api/config/toggle','resolve','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','env','/api/stats/history','.comp.txt','/favicon.png','/api/agent/compact','catch','/api/config','timestamp','live-conv','sendFile','configurable','repeat','auto','fullPath','getLogs','readFileSync','argv','open\x20\x22','conv:','query','slice','307188duupPB','express','Directory\x20not\x20found','./tracker','732206CIvRiz','then','55ljiDxt','win32','code','path','defineProperty','open','/api/stats/inspect/:id','12587248fTsiqs'];a0_0x5110=function(){return _0x9e6ba7;};return a0_0x5110();}function a0_0x2a47(_0x2f9032,_0x2992d6){const _0x511071=a0_0x5110();return a0_0x2a47=function(_0x2a47f0,_0x3790c8){_0x2a47f0=_0x2a47f0-0xa0;let _0x3d5923=_0x511071[_0x2a47f0];return _0x3d5923;},a0_0x2a47(_0x2f9032,_0x2992d6);}Object[a0_0x590a69(0xee)](exports,a0_0x590a69(0xae),{'value':!![]}),exports[a0_0x590a69(0x103)]=startDashboard;const express_1=__importDefault(require(a0_0x590a69(0xe5))),path=__importStar(require(a0_0x590a69(0xed))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x590a69(0xef))),tracker_1=require(a0_0x590a69(0xe7)),app=(0x0,express_1[a0_0x590a69(0xf9)])();app[a0_0x590a69(0xb8)](express_1[a0_0x590a69(0xf9)][a0_0x590a69(0xbb)]());const baseDir=path['join'](os[a0_0x590a69(0xc1)](),a0_0x590a69(0x107)),logsDir=path['join'](baseDir,'logs');app[a0_0x590a69(0xa5)]('/',(_0xf52127,_0x1a2c16)=>{const _0x2b5e02=a0_0x590a69,_0x5e8bc1=path[_0x2b5e02(0xba)](__dirname,_0x2b5e02(0xf5));fs[_0x2b5e02(0xb6)](_0x5e8bc1)?_0x1a2c16[_0x2b5e02(0xd8)](_0x5e8bc1):_0x1a2c16['sendFile'](path['join'](__dirname,'../src/index.html'));}),app[a0_0x590a69(0xa5)](a0_0x590a69(0xd2),(_0x30c95b,_0x2a64b6)=>{const _0x42f57d=a0_0x590a69,_0x15f838=path[_0x42f57d(0xba)](__dirname,'favicon.png');fs[_0x42f57d(0xb6)](_0x15f838)?_0x2a64b6[_0x42f57d(0xd8)](_0x15f838):_0x2a64b6[_0x42f57d(0xd8)](path['join'](__dirname,_0x42f57d(0xfa)));}),app['get']('/api/stats/summary',(_0x594e48,_0x2f5ea4)=>{const _0x10b3b5=a0_0x590a69,_0x5eb0a1=_0x594e48[_0x10b3b5(0xe2)]['model']||_0x10b3b5(0xdb),_0x202317=tracker_1[_0x10b3b5(0xc7)][_0x10b3b5(0xb1)](_0x5eb0a1);_0x2f5ea4[_0x10b3b5(0xbb)](_0x202317);}),app['get'](a0_0x590a69(0xd0),(_0x215dbb,_0x53bec0)=>{const _0x1077ab=a0_0x590a69,_0x357ff3=tracker_1['tracker'][_0x1077ab(0xdd)]();_0x53bec0[_0x1077ab(0xbb)](_0x357ff3[_0x1077ab(0xc8)]>0x1f4?_0x357ff3[_0x1077ab(0xe3)](-0x1f4):_0x357ff3);}),app['get'](a0_0x590a69(0xf0),(_0xab419,_0x456708)=>{const _0xcea5ea=a0_0x590a69,_0x313c94=_0xab419['params']['id'],_0x1186e0=path[_0xcea5ea(0xba)](logsDir,_0x313c94+'.raw.txt'),_0x300008=path[_0xcea5ea(0xba)](logsDir,_0x313c94+_0xcea5ea(0xd1));let _0x5e2fe9=_0xcea5ea(0xf6),_0x1e5bd0=_0xcea5ea(0xaf);try{fs[_0xcea5ea(0xb6)](_0x1186e0)&&(_0x5e2fe9=fs[_0xcea5ea(0xde)](_0x1186e0,_0xcea5ea(0x101))),fs[_0xcea5ea(0xb6)](_0x300008)&&(_0x1e5bd0=fs['readFileSync'](_0x300008,'utf8'));}catch(_0x338477){}_0x456708[_0xcea5ea(0xbb)]({'id':_0x313c94,'raw':_0x5e2fe9,'compressed':_0x1e5bd0});}),app[a0_0x590a69(0xa5)](a0_0x590a69(0xb2),(_0x193ab1,_0x2cf65f)=>{const _0x17a711=a0_0x590a69,_0x411dbe=tracker_1[_0x17a711(0xc7)][_0x17a711(0xab)]();_0x2cf65f[_0x17a711(0xbb)](_0x411dbe[_0x17a711(0xb3)]||{});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xb2),(_0xe10778,_0x25e9a2)=>{const _0x589acd=a0_0x590a69,_0x59c50e=_0xe10778[_0x589acd(0x104)];tracker_1[_0x589acd(0xc7)][_0x589acd(0xa4)](_0x589acd(0xb3),_0x59c50e),_0x25e9a2[_0x589acd(0xbb)]({'ok':!![]});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xd3),async(_0x4df95b,_0xcbb1ee)=>{const _0x51d317=a0_0x590a69;try{const {getLatestSessionFile:_0x744df5,processSessionFile:_0x18e112,loadSessionsState:_0x4ed3ee}=await Promise[_0x51d317(0xcd)]()['then'](()=>__importStar(require(_0x51d317(0x108)))),{agentKey:_0x43db3e}=_0x4df95b[_0x51d317(0x104)]||{},_0x1e9ea0=_0x43db3e||_0x51d317(0xfc),_0x36db47=_0x744df5(_0x1e9ea0);if(_0x36db47&&_0x36db47[_0x51d317(0xdc)]&&fs[_0x51d317(0xb6)](_0x36db47['fullPath'])){_0x18e112(_0x36db47[_0x51d317(0xdc)],_0x1e9ea0);const _0x3a2eeb=_0x4ed3ee(),_0x181b86=_0x3a2eeb[_0x36db47[_0x51d317(0xdc)]]&&_0x3a2eeb[_0x36db47['fullPath']][_0x51d317(0xf8)]>0x0?_0x3a2eeb[_0x36db47[_0x51d317(0xdc)]][_0x51d317(0xf8)]:0x5b108,_0x394556='x'[_0x51d317(0xda)]((_0x181b86+0x1f4)*0x4),_0x371e0e='x'[_0x51d317(0xda)](0x1f4*0x4);tracker_1[_0x51d317(0xc7)][_0x51d317(0xa9)]('conv:'+_0x1e9ea0,_0x394556,_0x371e0e,_0x181b86,undefined,['conv_'+_0x1e9ea0,_0x51d317(0xd7),_0x1e9ea0]),_0xcbb1ee[_0x51d317(0xbb)]({'ok':!![],'fileName':_0x36db47[_0x51d317(0xbc)],'tokensSaved':_0x181b86});}else _0xcbb1ee[_0x51d317(0xbb)]({'ok':![],'message':_0x51d317(0xa3)});}catch(_0x8ad0ff){_0xcbb1ee[_0x51d317(0xc2)](0x1f4)[_0x51d317(0xbb)]({'ok':![],'error':_0x8ad0ff['message']});}}),app['get'](a0_0x590a69(0xd5),async(_0x2c8503,_0x4dc7f0)=>{const _0x128f6f=a0_0x590a69,{loadConfig:_0x1f6893,getAgentStoragePaths:_0x141b71,getLatestSessionFile:_0x34b2fd,loadSessionsState:_0x535b64}=await Promise[_0x128f6f(0xcd)]()[_0x128f6f(0xe9)](()=>__importStar(require(_0x128f6f(0x108)))),_0x5000b1=_0x1f6893(),_0x422b5f=['claude',_0x128f6f(0xa6),_0x128f6f(0xfd),'cursor','aider','copilot',_0x128f6f(0xf2),_0x128f6f(0xfb),'cortex'],_0x51a12f={},_0x2e3a72={},_0x34c7f7={},_0x1cd28e=_0x535b64(),_0x565f7f=tracker_1[_0x128f6f(0xc7)][_0x128f6f(0xdd)]()||[];for(const _0x10148d of _0x422b5f){_0x51a12f[_0x10148d]=_0x141b71(_0x10148d);const _0xcbc88e=_0x34b2fd(_0x10148d);if(_0xcbc88e&&_0xcbc88e[_0x128f6f(0xdc)]&&_0x1cd28e[_0xcbc88e['fullPath']])_0xcbc88e[_0x128f6f(0xf8)]=_0x1cd28e[_0xcbc88e['fullPath']]['activeSavedTokens']||0x0;else{if(_0xcbc88e)_0xcbc88e[_0x128f6f(0xf8)]=0x0;}_0x34c7f7[_0x10148d]=_0xcbc88e;const _0x2a323=_0x565f7f[_0x128f6f(0xfe)](_0x17b5f7=>_0x17b5f7[_0x128f6f(0xa7)]&&_0x17b5f7[_0x128f6f(0xa7)][_0x128f6f(0xad)](_0x128f6f(0xe1)+_0x10148d));_0x2a323[_0x128f6f(0xc8)]>0x0?_0x2e3a72[_0x10148d]=_0x2a323[_0x2a323[_0x128f6f(0xc8)]-0x1][_0x128f6f(0xd6)]:_0x2e3a72[_0x10148d]=_0xcbc88e?_0xcbc88e['lastModified']:null;}_0x4dc7f0[_0x128f6f(0xbb)]({..._0x5000b1,'resolvedPaths':_0x51a12f,'lastActiveTimestamps':_0x2e3a72,'latestSessions':_0x34c7f7});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xb9),async(_0x1379de,_0x6adb80)=>{const _0x10ce38=a0_0x590a69,{getAgentStoragePaths:_0x3a7e36}=await Promise[_0x10ce38(0xcd)]()['then'](()=>__importStar(require('./file-watcher'))),{agentKey:_0x3a4c83}=_0x1379de[_0x10ce38(0x104)]||{};if(!_0x3a4c83)return _0x6adb80['status'](0x190)['json']({'error':_0x10ce38(0x109)});const _0x3357c7=_0x3a7e36(_0x3a4c83),_0x366d4d=_0x3357c7['find'](_0x396c08=>fs['existsSync'](_0x396c08))||_0x3357c7[0x0];if(_0x366d4d){if(!fs[_0x10ce38(0xb6)](_0x366d4d))try{fs['mkdirSync'](_0x366d4d,{'recursive':!![]});}catch{}const {exec:_0x30f240}=await Promise['resolve']()[_0x10ce38(0xe9)](()=>__importStar(require(_0x10ce38(0xc3)))),_0x5a9ff3=process[_0x10ce38(0xbd)]===_0x10ce38(0xeb)?'explorer\x20\x22'+_0x366d4d+'\x22':process[_0x10ce38(0xbd)]===_0x10ce38(0xca)?_0x10ce38(0xe0)+_0x366d4d+'\x22':_0x10ce38(0xaa)+_0x366d4d+'\x22';return _0x30f240(_0x5a9ff3),_0x6adb80[_0x10ce38(0xbb)]({'success':!![],'openedPath':_0x366d4d});}_0x6adb80[_0x10ce38(0xc2)](0x194)['json']({'error':_0x10ce38(0xe6)});}),app[a0_0x590a69(0x102)](a0_0x590a69(0xcc),async(_0x4144b7,_0x2b8a95)=>{const _0xe2f1cc=a0_0x590a69,{saveConfig:_0x7547e2}=await Promise['resolve']()[_0xe2f1cc(0xe9)](()=>__importStar(require(_0xe2f1cc(0x108)))),{key:_0x3a64a9,value:_0x102c28}=_0x4144b7['body']||{};if(_0x3a64a9){const _0x4f229c=_0x7547e2({'conversation_toggles':{[_0x3a64a9]:_0x102c28}});return _0x2b8a95[_0xe2f1cc(0xbb)](_0x4f229c);}_0x2b8a95[_0xe2f1cc(0xc2)](0x190)[_0xe2f1cc(0xbb)]({'error':_0xe2f1cc(0xf7)});}),app['post']('/api/config/custom-path',async(_0x30d4f4,_0x5b9271)=>{const _0x16ce3d=a0_0x590a69,{saveConfig:_0x5cd5c0}=await Promise[_0x16ce3d(0xcd)]()[_0x16ce3d(0xe9)](()=>__importStar(require(_0x16ce3d(0x108)))),{agentKey:_0x504bdb,path:_0x1dabb4}=_0x30d4f4[_0x16ce3d(0x104)]||{};if(_0x504bdb){const _0x25841c=_0x5cd5c0({'custom_storage_paths':{[_0x504bdb]:_0x1dabb4||null}});return _0x5b9271[_0x16ce3d(0xbb)](_0x25841c);}_0x5b9271['status'](0x190)['json']({'error':'Missing\x20agentKey'});});function startDashboard(_0x387f4a=0xfa0){const _0x49efd1=a0_0x590a69;let _0x3841bc=_0x387f4a;const _0x3884b8=process[_0x49efd1(0xdf)][_0x49efd1(0xad)](_0x49efd1(0x10a))||process[_0x49efd1(0xcf)][_0x49efd1(0xa8)]==='1',_0x461e5d=app['listen'](_0x3841bc,()=>{const _0x29b5ab=_0x49efd1,_0x101517='http://localhost:'+_0x3841bc;!_0x3884b8&&(console['log'](_0x29b5ab(0xa1)+_0x101517),console[_0x29b5ab(0x106)](_0x29b5ab(0xce))),Promise[_0x29b5ab(0xcd)]()[_0x29b5ab(0xe9)](()=>__importStar(require(_0x29b5ab(0x108))))[_0x29b5ab(0xe9)](_0x376287=>_0x376287['startWatcherDaemon']())[_0x29b5ab(0xd4)](()=>{}),!_0x3884b8&&process['env'][_0x29b5ab(0xa0)]!=='1'&&(0x0,open_1['default'])(_0x101517)[_0x29b5ab(0xd4)](()=>{});});_0x461e5d['on'](_0x49efd1(0xb0),_0x3b3d9d=>{const _0x1afb15=_0x49efd1;_0x3b3d9d[_0x1afb15(0xec)]===_0x1afb15(0xa2)?startDashboard(_0x3841bc+0x1):console[_0x1afb15(0xb0)](_0x1afb15(0xc5)+_0x3b3d9d['message']);});}
|
|
1
|
+
'use strict';const a0_0x2e761f=a0_0x4e0b;function a0_0x4e0b(_0x47658a,_0x4d3e16){_0x47658a=_0x47658a-0xc5;const _0x479c1a=a0_0x479c();let _0x4e0bf3=_0x479c1a[_0x47658a];return _0x4e0bf3;}(function(_0x470905,_0x369f10){const _0x4fed51=a0_0x4e0b,_0x4b4c36=_0x470905();while(!![]){try{const _0x248635=-parseInt(_0x4fed51(0xf7))/0x1*(-parseInt(_0x4fed51(0x11b))/0x2)+parseInt(_0x4fed51(0xf8))/0x3+-parseInt(_0x4fed51(0x122))/0x4+parseInt(_0x4fed51(0x124))/0x5+parseInt(_0x4fed51(0x127))/0x6+-parseInt(_0x4fed51(0xd2))/0x7+parseInt(_0x4fed51(0x123))/0x8;if(_0x248635===_0x369f10)break;else _0x4b4c36['push'](_0x4b4c36['shift']());}catch(_0x47a937){_0x4b4c36['push'](_0x4b4c36['shift']());}}}(a0_0x479c,0x6c094));var __createBinding=this&&this['__createBinding']||(Object[a0_0x2e761f(0x10a)]?function(_0x274917,_0x1f3f7a,_0x3a0df5,_0x33cf37){const _0x19a22c=a0_0x2e761f;if(_0x33cf37===undefined)_0x33cf37=_0x3a0df5;var _0x39d7e6=Object[_0x19a22c(0x12a)](_0x1f3f7a,_0x3a0df5);(!_0x39d7e6||(_0x19a22c(0xfa)in _0x39d7e6?!_0x1f3f7a[_0x19a22c(0x126)]:_0x39d7e6[_0x19a22c(0xf1)]||_0x39d7e6[_0x19a22c(0x121)]))&&(_0x39d7e6={'enumerable':!![],'get':function(){return _0x1f3f7a[_0x3a0df5];}}),Object[_0x19a22c(0xed)](_0x274917,_0x33cf37,_0x39d7e6);}:function(_0x2f64c8,_0x539962,_0x2ccdb1,_0x3420b7){if(_0x3420b7===undefined)_0x3420b7=_0x2ccdb1;_0x2f64c8[_0x3420b7]=_0x539962[_0x2ccdb1];}),__setModuleDefault=this&&this[a0_0x2e761f(0x130)]||(Object[a0_0x2e761f(0x10a)]?function(_0x10e084,_0x519a4f){const _0xdf633c=a0_0x2e761f;Object['defineProperty'](_0x10e084,_0xdf633c(0x11c),{'enumerable':!![],'value':_0x519a4f});}:function(_0x32e492,_0x1e8f68){const _0x2d78af=a0_0x2e761f;_0x32e492[_0x2d78af(0x11c)]=_0x1e8f68;}),__importStar=this&&this[a0_0x2e761f(0x12f)]||(function(){var _0x24d984=function(_0x570a14){const _0x104484=a0_0x4e0b;return _0x24d984=Object[_0x104484(0xd0)]||function(_0x3d3c0c){const _0xe99f2b=_0x104484;var _0x333938=[];for(var _0x77cad3 in _0x3d3c0c)if(Object[_0xe99f2b(0xf4)]['hasOwnProperty'][_0xe99f2b(0xec)](_0x3d3c0c,_0x77cad3))_0x333938[_0x333938[_0xe99f2b(0xf5)]]=_0x77cad3;return _0x333938;},_0x24d984(_0x570a14);};return function(_0xe86284){const _0x3270e7=a0_0x4e0b;if(_0xe86284&&_0xe86284[_0x3270e7(0x126)])return _0xe86284;var _0x3bba18={};if(_0xe86284!=null){for(var _0x21950c=_0x24d984(_0xe86284),_0xc76c96=0x0;_0xc76c96<_0x21950c['length'];_0xc76c96++)if(_0x21950c[_0xc76c96]!=='default')__createBinding(_0x3bba18,_0xe86284,_0x21950c[_0xc76c96]);}return __setModuleDefault(_0x3bba18,_0xe86284),_0x3bba18;};}()),__importDefault=this&&this[a0_0x2e761f(0xf9)]||function(_0x1198dd){const _0x2f4640=a0_0x2e761f;return _0x1198dd&&_0x1198dd[_0x2f4640(0x126)]?_0x1198dd:{'default':_0x1198dd};};Object[a0_0x2e761f(0xed)](exports,a0_0x2e761f(0x126),{'value':!![]}),exports[a0_0x2e761f(0xfc)]=startDashboard;const express_1=__importDefault(require('express')),path=__importStar(require(a0_0x2e761f(0xe4))),fs=__importStar(require('fs')),os=__importStar(require('os')),open_1=__importDefault(require(a0_0x2e761f(0xdd))),tracker_1=require(a0_0x2e761f(0x12d)),app=(0x0,express_1[a0_0x2e761f(0x11c)])();app[a0_0x2e761f(0xfd)](express_1['default'][a0_0x2e761f(0xe1)]());const baseDir=path[a0_0x2e761f(0x10b)](os['homedir'](),a0_0x2e761f(0xc7)),logsDir=path[a0_0x2e761f(0x10b)](baseDir,a0_0x2e761f(0xd5));app[a0_0x2e761f(0xfa)]('/',(_0xe8239c,_0x2f6279)=>{const _0x3ad7a5=a0_0x2e761f,_0x3ae830=path[_0x3ad7a5(0x10b)](__dirname,'index.html');fs[_0x3ad7a5(0x131)](_0x3ae830)?_0x2f6279[_0x3ad7a5(0x111)](_0x3ae830):_0x2f6279['sendFile'](path['join'](__dirname,_0x3ad7a5(0x117)));}),app[a0_0x2e761f(0xfa)](a0_0x2e761f(0xf0),(_0x404eca,_0x2a99a3)=>{const _0x588932=a0_0x2e761f,_0x593db4=path[_0x588932(0x10b)](__dirname,_0x588932(0x102));fs[_0x588932(0x131)](_0x593db4)?_0x2a99a3[_0x588932(0x111)](_0x593db4):_0x2a99a3[_0x588932(0x111)](path[_0x588932(0x10b)](__dirname,_0x588932(0xeb)));}),app['get'](a0_0x2e761f(0xc5),(_0x59d77b,_0x574004)=>{const _0x432956=a0_0x2e761f,_0x1ebdfd=_0x59d77b[_0x432956(0x110)][_0x432956(0x11e)]||_0x432956(0xd7),_0x1746ea=tracker_1['tracker'][_0x432956(0xdc)](_0x1ebdfd);_0x574004[_0x432956(0xe1)](_0x1746ea);}),app[a0_0x2e761f(0xfa)](a0_0x2e761f(0x12c),(_0x491781,_0x3922e4)=>{const _0x2a3b94=a0_0x2e761f,_0x5e48a5=tracker_1[_0x2a3b94(0xe5)]['getLogs']();_0x3922e4[_0x2a3b94(0xe1)](_0x5e48a5[_0x2a3b94(0xf5)]>0x1f4?_0x5e48a5[_0x2a3b94(0xda)](-0x1f4):_0x5e48a5);}),app[a0_0x2e761f(0xfa)](a0_0x2e761f(0x10c),(_0x55f2d3,_0x4ed83d)=>{const _0x482c78=a0_0x2e761f,_0x122367=_0x55f2d3[_0x482c78(0x128)]['id'],_0x182737=path[_0x482c78(0x10b)](logsDir,_0x122367+_0x482c78(0x11d)),_0x409a2c=path[_0x482c78(0x10b)](logsDir,_0x122367+_0x482c78(0xe3));let _0x42d778=_0x482c78(0x104),_0x3f75a3=_0x482c78(0xe6);try{fs[_0x482c78(0x131)](_0x182737)&&(_0x42d778=fs[_0x482c78(0x12b)](_0x182737,_0x482c78(0x108))),fs[_0x482c78(0x131)](_0x409a2c)&&(_0x3f75a3=fs['readFileSync'](_0x409a2c,_0x482c78(0x108)));}catch(_0xe8b453){}_0x4ed83d[_0x482c78(0xe1)]({'id':_0x122367,'raw':_0x42d778,'compressed':_0x3f75a3});}),app[a0_0x2e761f(0xfa)](a0_0x2e761f(0xfe),(_0x3736c8,_0x3eecd6)=>{const _0x114df2=a0_0x2e761f,_0x3ee7ce=tracker_1[_0x114df2(0xe5)][_0x114df2(0xd8)]();_0x3eecd6[_0x114df2(0xe1)](_0x3ee7ce[_0x114df2(0x12e)]||{});}),app['post'](a0_0x2e761f(0xfe),(_0x1d2b44,_0x5277f3)=>{const _0x5c4a4c=a0_0x2e761f,_0x33dffd=_0x1d2b44['body'];tracker_1[_0x5c4a4c(0xe5)][_0x5c4a4c(0xd4)](_0x5c4a4c(0x12e),_0x33dffd),_0x5277f3[_0x5c4a4c(0xe1)]({'ok':!![]});}),app[a0_0x2e761f(0xcc)](a0_0x2e761f(0x116),async(_0xfd653,_0x1f1862)=>{const _0x3f3f56=a0_0x2e761f;try{const {getLatestSessionFile:_0x4e6118,compactSessionCopy:_0x5aa48f}=await Promise[_0x3f3f56(0x103)]()['then'](()=>__importStar(require('./file-watcher'))),{agentKey:_0x57900c}=_0xfd653[_0x3f3f56(0xc6)]||{},_0x5e335d=_0x57900c||_0x3f3f56(0x132),_0x3db206=_0x4e6118(_0x5e335d);if(_0x3db206&&_0x3db206[_0x3f3f56(0x112)]&&fs[_0x3f3f56(0x131)](_0x3db206['fullPath'])){const _0x4a8958=_0x5aa48f(_0x3db206[_0x3f3f56(0x112)],_0x5e335d);_0x4a8958['ok']&&(_0x4a8958[_0x3f3f56(0xf2)]||0x0)>0x0?_0x1f1862[_0x3f3f56(0xe1)]({'ok':!![],'fileName':_0x3db206[_0x3f3f56(0xff)],'tokensSaved':_0x4a8958['savedTokens'],'rawTokens':_0x4a8958[_0x3f3f56(0xd3)],'compressedTokens':_0x4a8958[_0x3f3f56(0xe7)],'reductionPct':_0x4a8958[_0x3f3f56(0xd9)],'compactPath':_0x4a8958[_0x3f3f56(0xef)]}):_0x1f1862[_0x3f3f56(0xe1)]({'ok':![],'message':_0x4a8958[_0x3f3f56(0x115)]||_0x3f3f56(0xc8)});}else _0x1f1862['json']({'ok':![],'message':_0x3f3f56(0x101)});}catch(_0x457fcd){_0x1f1862[_0x3f3f56(0xc9)](0x1f4)[_0x3f3f56(0xe1)]({'ok':![],'error':_0x457fcd[_0x3f3f56(0xcd)]});}}),app[a0_0x2e761f(0xfa)]('/api/config',async(_0x2bbcec,_0x12ef42)=>{const _0x4d38bd=a0_0x2e761f,{loadConfig:_0x45be83,getAgentStoragePaths:_0xd89178,getLatestSessionFile:_0x35b392,loadSessionsState:_0x25790f}=await Promise[_0x4d38bd(0x103)]()['then'](()=>__importStar(require(_0x4d38bd(0x10f)))),_0x10511b=_0x45be83(),_0x4b1edd=[_0x4d38bd(0x132),_0x4d38bd(0xca),_0x4d38bd(0x114),_0x4d38bd(0xea),_0x4d38bd(0x109),'copilot',_0x4d38bd(0x106),'opencode','cortex'],_0x12147b={},_0x88a432={},_0x1c0a89={},_0x33f243=_0x25790f(),_0x146f92=tracker_1[_0x4d38bd(0xe5)][_0x4d38bd(0xe2)]()||[];for(const _0x410014 of _0x4b1edd){_0x12147b[_0x410014]=_0xd89178(_0x410014);const _0x124dc5=_0x35b392(_0x410014);if(_0x124dc5&&_0x124dc5[_0x4d38bd(0x112)]&&_0x33f243[_0x124dc5[_0x4d38bd(0x112)]])_0x124dc5[_0x4d38bd(0xd6)]=_0x33f243[_0x124dc5[_0x4d38bd(0x112)]][_0x4d38bd(0xd6)]||0x0;else{if(_0x124dc5)_0x124dc5[_0x4d38bd(0xd6)]=0x0;}_0x1c0a89[_0x410014]=_0x124dc5;const _0x144462=_0x146f92[_0x4d38bd(0xe0)](_0x42b3d5=>_0x42b3d5[_0x4d38bd(0xd1)]&&_0x42b3d5[_0x4d38bd(0xd1)][_0x4d38bd(0xcf)](_0x4d38bd(0xdb)+_0x410014));_0x144462['length']>0x0?_0x88a432[_0x410014]=_0x144462[_0x144462[_0x4d38bd(0xf5)]-0x1][_0x4d38bd(0xde)]:_0x88a432[_0x410014]=_0x124dc5?_0x124dc5[_0x4d38bd(0xdf)]:null;}_0x12ef42[_0x4d38bd(0xe1)]({..._0x10511b,'resolvedPaths':_0x12147b,'lastActiveTimestamps':_0x88a432,'latestSessions':_0x1c0a89});}),app[a0_0x2e761f(0xcc)]('/api/config/open-dir',async(_0x50d70a,_0x45f675)=>{const _0x146935=a0_0x2e761f,{getAgentStoragePaths:_0x10e7d5}=await Promise[_0x146935(0x103)]()[_0x146935(0x10e)](()=>__importStar(require('./file-watcher'))),{agentKey:_0x153847}=_0x50d70a[_0x146935(0xc6)]||{};if(!_0x153847)return _0x45f675['status'](0x190)[_0x146935(0xe1)]({'error':_0x146935(0x133)});const _0x2e6086=_0x10e7d5(_0x153847),_0x51cf53=_0x2e6086['find'](_0x1037a1=>fs[_0x146935(0x131)](_0x1037a1))||_0x2e6086[0x0];if(_0x51cf53){if(!fs[_0x146935(0x131)](_0x51cf53))try{fs['mkdirSync'](_0x51cf53,{'recursive':!![]});}catch{}const {exec:_0x4959d2}=await Promise[_0x146935(0x103)]()[_0x146935(0x10e)](()=>__importStar(require(_0x146935(0xf3)))),_0x527672=process['platform']===_0x146935(0x125)?_0x146935(0x11f)+_0x51cf53+'\x22':process['platform']===_0x146935(0xfb)?_0x146935(0x11a)+_0x51cf53+'\x22':_0x146935(0xe9)+_0x51cf53+'\x22';return _0x4959d2(_0x527672),_0x45f675[_0x146935(0xe1)]({'success':!![],'openedPath':_0x51cf53});}_0x45f675['status'](0x194)[_0x146935(0xe1)]({'error':_0x146935(0x100)});}),app[a0_0x2e761f(0xcc)](a0_0x2e761f(0x105),async(_0x3b702f,_0x1ba8da)=>{const _0x4045fa=a0_0x2e761f,{saveConfig:_0x301ffc}=await Promise['resolve']()[_0x4045fa(0x10e)](()=>__importStar(require(_0x4045fa(0x10f)))),{key:_0x2e673d,value:_0xdd56c1}=_0x3b702f[_0x4045fa(0xc6)]||{};if(_0x2e673d){const _0x599848=_0x301ffc({'conversation_toggles':{[_0x2e673d]:_0xdd56c1}});return _0x1ba8da[_0x4045fa(0xe1)](_0x599848);}_0x1ba8da['status'](0x190)[_0x4045fa(0xe1)]({'error':_0x4045fa(0x113)});}),app[a0_0x2e761f(0xcc)](a0_0x2e761f(0x129),async(_0x12ffea,_0x23e123)=>{const _0x5e4a9d=a0_0x2e761f,{saveConfig:_0x252373}=await Promise[_0x5e4a9d(0x103)]()['then'](()=>__importStar(require(_0x5e4a9d(0x10f)))),{agentKey:_0x13d495,path:_0x34a598}=_0x12ffea[_0x5e4a9d(0xc6)]||{};if(_0x13d495){const _0x4ecb54=_0x252373({'custom_storage_paths':{[_0x13d495]:_0x34a598||null}});return _0x23e123[_0x5e4a9d(0xe1)](_0x4ecb54);}_0x23e123[_0x5e4a9d(0xc9)](0x190)[_0x5e4a9d(0xe1)]({'error':'Missing\x20agentKey'});});function startDashboard(_0x11b33a=0xfa0){const _0x4cd259=a0_0x2e761f;let _0x1ff9d1=_0x11b33a;const _0x21f4c8=process['argv'][_0x4cd259(0xcf)](_0x4cd259(0xcb))||process.env.TRIMPROMPT_HEADLESS==='1',_0x54a79c=app[_0x4cd259(0xe8)](_0x1ff9d1,()=>{const _0x450b6d=_0x4cd259,_0x51ae0f=_0x450b6d(0x10d)+_0x1ff9d1;!_0x21f4c8&&(console[_0x450b6d(0x107)]('\x0a[TrimPrompt]\x20Dashboard\x20server\x20started\x20at:\x20'+_0x51ae0f),console[_0x450b6d(0x107)](_0x450b6d(0x134))),Promise[_0x450b6d(0x103)]()[_0x450b6d(0x10e)](()=>__importStar(require(_0x450b6d(0x10f))))['then'](_0x12a6a8=>_0x12a6a8[_0x450b6d(0xce)]())[_0x450b6d(0xee)](()=>{}),!_0x21f4c8&&process.env.TRIMPROMPT_NO_OPEN!=='1'&&(0x0,open_1['default'])(_0x51ae0f)['catch'](()=>{});});_0x54a79c['on'](_0x4cd259(0xf6),_0x81348e=>{const _0x1179aa=_0x4cd259;_0x81348e[_0x1179aa(0x118)]===_0x1179aa(0x119)?startDashboard(_0x1ff9d1+0x1):console[_0x1179aa(0xf6)](_0x1179aa(0x120)+_0x81348e[_0x1179aa(0xcd)]);});}function a0_0x479c(){const _0x1da72a=['message','startWatcherDaemon','includes','getOwnPropertyNames','command','5416250VbYKUz','rawTokens','setConfig','logs','activeSavedTokens','auto','getConfig','reductionPct','slice','conv:','getStatsSummary','open','timestamp','lastModified','filter','json','getLogs','.comp.txt','path','tracker','Compressed\x20output\x20log\x20file\x20not\x20found.','compressedTokens','listen','xdg-open\x20\x22','cursor','../src/favicon.png','call','defineProperty','catch','compactPath','/favicon.png','writable','savedTokens','child_process','prototype','length','error','79521jysNUt','911571dpcPdX','__importDefault','get','darwin','startDashboard','use','/api/config/features','fileName','Directory\x20not\x20found','No\x20active\x20session\x20file\x20found','favicon.png','resolve','Raw\x20output\x20log\x20file\x20not\x20found.','/api/config/toggle','openclaw','log','utf8','aider','create','join','/api/stats/inspect/:id','http://localhost:','then','./file-watcher','query','sendFile','fullPath','Missing\x20key','codex','reason','/api/agent/compact','../src/index.html','code','EADDRINUSE','open\x20\x22','18tPJYqN','default','.raw.txt','model','explorer\x20\x22','[TrimPrompt]\x20Dashboard\x20error:\x20','configurable','3268292mZpxPE','6372472gvMdHX','61370TkisXm','win32','__esModule','1229760XUiHZo','params','/api/config/custom-path','getOwnPropertyDescriptor','readFileSync','/api/stats/history','./tracker','features_enabled','__importStar','__setModuleDefault','existsSync','claude','Missing\x20agentKey','Press\x20Ctrl+C\x20in\x20this\x20terminal\x20to\x20shut\x20down.','/api/stats/summary','body','.trimprompt','No\x20compressible\x20content\x20found\x20in\x20this\x20session','status','gemini','--headless','post'];a0_0x479c=function(){return _0x1da72a;};return a0_0x479c();}
|
package/executor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';var a0_0x55d2be=a0_0x392b;(function(_0x334637,_0x47c501){var _0x3c7cee=a0_0x392b,_0x4aa804=_0x334637();while(!![]){try{var _0x2ca95b=-parseInt(_0x3c7cee(0x214))/0x1+-parseInt(_0x3c7cee(0x215))/0x2+parseInt(_0x3c7cee(0x218))/0x3+-parseInt(_0x3c7cee(0x1fa))/0x4+-parseInt(_0x3c7cee(0x204))/0x5+parseInt(_0x3c7cee(0x1f8))/0x6*(-parseInt(_0x3c7cee(0x217))/0x7)+-parseInt(_0x3c7cee(0x1f1))/0x8*(-parseInt(_0x3c7cee(0x1fb))/0x9);if(_0x2ca95b===_0x47c501)break;else _0x4aa804['push'](_0x4aa804['shift']());}catch(_0x51d581){_0x4aa804['push'](_0x4aa804['shift']());}}}(a0_0x2a48,0xb45d8));function a0_0x392b(_0x29b8d1,_0x199f45){_0x29b8d1=_0x29b8d1-0x1ef;var _0x2a481f=a0_0x2a48();var _0x392be4=_0x2a481f[_0x29b8d1];return _0x392be4;}function a0_0x2a48(){var _0x5406ed=['default','894LJOtfQ','__createBinding','2726856rjRoWf','36WRLaXA','shims','filter','data','delimiter','hasOwnProperty','Failed\x20to\x20spawn\x20command\x20\x22','\x22:\x20','.trimprompt','6032095RFbBaS','create','get','getOwnPropertyDescriptor','child_process','inherit','map','join','message','stdout','configurable','executeCommand','__esModule','split','prototype','toLowerCase','558743rMqApm','695450bavcCn','path','47131kVJasV','1140978NMgtov','call','stderr','pipe','8312536GrdPUT','includes','getOwnPropertyNames','__setModuleDefault','length','spawn'];a0_0x2a48=function(){return _0x5406ed;};return a0_0x2a48();}var __createBinding=this&&this[a0_0x55d2be(0x1f9)]||(Object[a0_0x55d2be(0x205)]?function(_0x5cf28a,_0x32a0da,_0x5e7097,_0x8e8a11){var _0x3d6e07=a0_0x55d2be;if(_0x8e8a11===undefined)_0x8e8a11=_0x5e7097;var _0xa4dfdf=Object[_0x3d6e07(0x207)](_0x32a0da,_0x5e7097);(!_0xa4dfdf||(_0x3d6e07(0x206)in _0xa4dfdf?!_0x32a0da['__esModule']:_0xa4dfdf['writable']||_0xa4dfdf[_0x3d6e07(0x20e)]))&&(_0xa4dfdf={'enumerable':!![],'get':function(){return _0x32a0da[_0x5e7097];}}),Object['defineProperty'](_0x5cf28a,_0x8e8a11,_0xa4dfdf);}:function(_0x153ab3,_0x6e07d1,_0x15ee8c,_0x3d2481){if(_0x3d2481===undefined)_0x3d2481=_0x15ee8c;_0x153ab3[_0x3d2481]=_0x6e07d1[_0x15ee8c];}),__setModuleDefault=this&&this[a0_0x55d2be(0x1f4)]||(Object[a0_0x55d2be(0x205)]?function(_0x2346f4,_0x22a4d5){var _0x3358c7=a0_0x55d2be;Object['defineProperty'](_0x2346f4,_0x3358c7(0x1f7),{'enumerable':!![],'value':_0x22a4d5});}:function(_0x115430,_0x2e0448){var _0x3068e3=a0_0x55d2be;_0x115430[_0x3068e3(0x1f7)]=_0x2e0448;}),__importStar=this&&this['__importStar']||(function(){var _0x567796=function(_0x179876){var _0x51409e=a0_0x392b;return _0x567796=Object[_0x51409e(0x1f3)]||function(_0x4bff68){var _0x1c56f4=_0x51409e,_0x16cd2f=[];for(var _0x3a56eb in _0x4bff68)if(Object[_0x1c56f4(0x212)][_0x1c56f4(0x200)][_0x1c56f4(0x219)](_0x4bff68,_0x3a56eb))_0x16cd2f[_0x16cd2f['length']]=_0x3a56eb;return _0x16cd2f;},_0x567796(_0x179876);};return function(_0x4b138e){var _0x2bfdd8=a0_0x392b;if(_0x4b138e&&_0x4b138e[_0x2bfdd8(0x210)])return _0x4b138e;var _0x437c97={};if(_0x4b138e!=null){for(var _0x901815=_0x567796(_0x4b138e),_0x41525e=0x0;_0x41525e<_0x901815[_0x2bfdd8(0x1f5)];_0x41525e++)if(_0x901815[_0x41525e]!==_0x2bfdd8(0x1f7))__createBinding(_0x437c97,_0x4b138e,_0x901815[_0x41525e]);}return __setModuleDefault(_0x437c97,_0x4b138e),_0x437c97;};}());Object['defineProperty'](exports,a0_0x55d2be(0x210),{'value':!![]}),exports[a0_0x55d2be(0x20f)]=executeCommand;const child_process_1=require(a0_0x55d2be(0x208)),path=__importStar(require(a0_0x55d2be(0x216))),os=__importStar(require('os'));function executeCommand(_0x2316a1,_0x378917){return new Promise(_0x5aa6ce=>{var _0x2170fd=a0_0x392b;const _0x2b6ff7=path['join'](os['homedir'](),_0x2170fd(0x203),_0x2170fd(0x1fc)),_0x3354d2=(process.env.PATH||'')[_0x2170fd(0x211)](path[_0x2170fd(0x1ff)])[_0x2170fd(0x1fd)](_0x502530=>_0x502530['trim']()[_0x2170fd(0x213)]()!==_0x2b6ff7[_0x2170fd(0x213)]())[_0x2170fd(0x20b)](path[_0x2170fd(0x1ff)]),_0x326e7d={...process.env,'PATH':_0x3354d2,'TRIMPROMPT_DISABLED':'1'},_0x547944=_0x378917[_0x2170fd(0x20a)](_0x3c48c8=>_0x3c48c8[_0x2170fd(0x1f2)]('\x20')&&!_0x3c48c8['startsWith']('\x22')?'\x22'+_0x3c48c8+'\x22':_0x3c48c8),_0x5cab=[_0x2316a1,..._0x547944][_0x2170fd(0x20b)]('\x20'),_0x42e2e5=(0x0,child_process_1[_0x2170fd(0x1f6)])(_0x5cab,[],{'stdio':[_0x2170fd(0x209),_0x2170fd(0x1f0),'pipe'],'shell':!![],'env':_0x326e7d});let _0x2d2046='',_0x1aebea='';_0x42e2e5[_0x2170fd(0x20d)]?.['on'](_0x2170fd(0x1fe),_0x8f5ec4=>{_0x2d2046+=_0x8f5ec4['toString']();}),_0x42e2e5[_0x2170fd(0x1ef)]?.['on'](_0x2170fd(0x1fe),_0x725686=>{_0x1aebea+=_0x725686['toString']();}),_0x42e2e5['on']('error',_0xb40e25=>{var _0x4780db=_0x2170fd;_0x5aa6ce({'exitCode':0x1,'stdout':'','stderr':_0x4780db(0x201)+_0x2316a1+_0x4780db(0x202)+_0xb40e25[_0x4780db(0x20c)]});}),_0x42e2e5['on']('close',_0x268fb0=>{_0x5aa6ce({'exitCode':_0x268fb0??0x0,'stdout':_0x2d2046,'stderr':_0x1aebea});});});}
|
package/file-watcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x403f(){const _0x4e1992=['savedTokens','5018881cjFWkS','cortex','context','30358440gXdnhq','cache','TrimPrompt\x20Cache\x20Engine','.webp','raw_tokens','existsSync','44VbpxkO','create','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','\x20tokens).','media__','isArray','Roaming','configurable','Windows','statSync','14tQoyhE','.codex','saveChunk','conv_','6kMrwpG','cli.js','claude','text','isFile','messages','string','getLatestSessionFile','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','processSessionFile','codex','mtimeMs','.aider.chat.history.md','Microsoft','workspaceStorage','extname','basename','defineProperty','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','.trimprompt','cursor','.png','opencode','compressed_tokens','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','stringify','.pb','sessions_state.json','.jpeg','conv:','endsWith','set','image_','toISOString','github-copilot-cli','split','.gemini','isDirectory','lineCount','loadSessionsState','officialCompactSaved','Summary:\x20Text\x20block\x20offloaded\x20(','.wal','startWatcherDaemon','./tracker','round','6384195UyKqff','config.json','openclaw','.tmp','./cache-manager','includes','modified','darwin','copilot','.cortex','Application\x20Support','get','length','parse','object','content','chunk_id','.jpg','ceil','default','__importStar','utf8','max','AppData','.shm','message','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','writeFileSync','gemini','User','activeSavedTokens','filter','Library','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','toLowerCase','custom_storage_paths','mkdirSync','.jsonl','./hooks/claude-hook','active_turn','aider','live-conv','join','sessions','cwd','82868yxbAmQ','.dat','logExecution','call','replace','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','fullPath','readdirSync','matchAll','__esModule','sideCacheSaved','__createBinding','loadConfig','name','Local','Gemini','TrimPromptDaemon.vbs','382456LoSQVS','has','Cursor','Programs','history','__setModuleDefault','.json1','platform','push','.claude','Start\x20Menu','projects','startsWith','.lock','readFileSync','tracker','conversation_toggles','.config','571050BUMcrj','hasOwnProperty','getOwnPropertyNames','installWindowsStartupService','homedir','size','198249DMnCYA','path','win32'];a0_0x403f=function(){return _0x4e1992;};return a0_0x403f();}const a0_0x57d459=a0_0x8518;(function(_0x4d7ff7,_0x51685d){const _0x3eb05a=a0_0x8518,_0xffaec9=_0x4d7ff7();while(!![]){try{const _0x1e60d0=-parseInt(_0x3eb05a(0x11e))/0x1*(parseInt(_0x3eb05a(0xde))/0x2)+parseInt(_0x3eb05a(0x107))/0x3*(-parseInt(_0x3eb05a(0x114))/0x4)+parseInt(_0x3eb05a(0x101))/0x5+parseInt(_0x3eb05a(0x122))/0x6*(-parseInt(_0x3eb05a(0x10b))/0x7)+-parseInt(_0x3eb05a(0xef))/0x8+-parseInt(_0x3eb05a(0xb1))/0x9+parseInt(_0x3eb05a(0x10e))/0xa;if(_0x1e60d0===_0x51685d)break;else _0xffaec9['push'](_0xffaec9['shift']());}catch(_0x2647f){_0xffaec9['push'](_0xffaec9['shift']());}}}(a0_0x403f,0x5a118));var __createBinding=this&&this[a0_0x57d459(0xe9)]||(Object[a0_0x57d459(0x115)]?function(_0x2a405b,_0x290b32,_0x12fc60,_0x3a3b15){const _0x320293=a0_0x57d459;if(_0x3a3b15===undefined)_0x3a3b15=_0x12fc60;var _0x9de4d0=Object['getOwnPropertyDescriptor'](_0x290b32,_0x12fc60);(!_0x9de4d0||(_0x320293(0xbc)in _0x9de4d0?!_0x290b32['__esModule']:_0x9de4d0['writable']||_0x9de4d0[_0x320293(0x11b)]))&&(_0x9de4d0={'enumerable':!![],'get':function(){return _0x290b32[_0x12fc60];}}),Object[_0x320293(0x133)](_0x2a405b,_0x3a3b15,_0x9de4d0);}:function(_0x221fef,_0x9d9a58,_0x4051cc,_0x6bddbc){if(_0x6bddbc===undefined)_0x6bddbc=_0x4051cc;_0x221fef[_0x6bddbc]=_0x9d9a58[_0x4051cc];}),__setModuleDefault=this&&this[a0_0x57d459(0xf4)]||(Object[a0_0x57d459(0x115)]?function(_0x451e6b,_0xb93b1){const _0x2a0a5b=a0_0x57d459;Object[_0x2a0a5b(0x133)](_0x451e6b,'default',{'enumerable':!![],'value':_0xb93b1});}:function(_0x1ec0bb,_0x387988){const _0x1c97b7=a0_0x57d459;_0x1ec0bb[_0x1c97b7(0xc4)]=_0x387988;}),__importStar=this&&this[a0_0x57d459(0xc5)]||(function(){var _0x26f3ce=function(_0x1e96cd){const _0x2f3a55=a0_0x8518;return _0x26f3ce=Object[_0x2f3a55(0x103)]||function(_0x20dffa){const _0x5eb613=_0x2f3a55;var _0x16f92b=[];for(var _0x2dec5e in _0x20dffa)if(Object['prototype'][_0x5eb613(0x102)][_0x5eb613(0xe1)](_0x20dffa,_0x2dec5e))_0x16f92b[_0x16f92b[_0x5eb613(0xbd)]]=_0x2dec5e;return _0x16f92b;},_0x26f3ce(_0x1e96cd);};return function(_0x3480dd){const _0x2c4f01=a0_0x8518;if(_0x3480dd&&_0x3480dd[_0x2c4f01(0xe7)])return _0x3480dd;var _0x27ac06={};if(_0x3480dd!=null){for(var _0x3d660d=_0x26f3ce(_0x3480dd),_0x3901b2=0x0;_0x3901b2<_0x3d660d[_0x2c4f01(0xbd)];_0x3901b2++)if(_0x3d660d[_0x3901b2]!==_0x2c4f01(0xc4))__createBinding(_0x27ac06,_0x3480dd,_0x3d660d[_0x3901b2]);}return __setModuleDefault(_0x27ac06,_0x3480dd),_0x27ac06;};}());Object[a0_0x57d459(0x133)](exports,a0_0x57d459(0xe7),{'value':!![]}),exports[a0_0x57d459(0xea)]=loadConfig,exports['saveConfig']=saveConfig,exports['getAgentStoragePaths']=getAgentStoragePaths,exports[a0_0x57d459(0x129)]=getLatestSessionFile,exports[a0_0x57d459(0xaa)]=loadSessionsState,exports[a0_0x57d459(0x12b)]=processSessionFile,exports[a0_0x57d459(0x104)]=installWindowsStartupService,exports[a0_0x57d459(0xae)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x57d459(0x108))),os=__importStar(require('os')),cache_manager_1=require(a0_0x57d459(0xb5)),tracker_1=require(a0_0x57d459(0xaf)),baseDir=path[a0_0x57d459(0xdb)](os[a0_0x57d459(0x105)](),a0_0x57d459(0x135)),configPath=path[a0_0x57d459(0xdb)](baseDir,a0_0x57d459(0xb2)),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function a0_0x8518(_0x52e711,_0x3bcc7a){const _0x403fe0=a0_0x403f();return a0_0x8518=function(_0x8518b6,_0x1668fd){_0x8518b6=_0x8518b6-0x9b;let _0x317a76=_0x403fe0[_0x8518b6];return _0x317a76;},a0_0x8518(_0x52e711,_0x3bcc7a);}function loadConfig(){const _0x6a49ff=a0_0x57d459;try{if(!fs[_0x6a49ff(0x113)](baseDir))fs[_0x6a49ff(0xd5)](baseDir,{'recursive':!![]});if(fs[_0x6a49ff(0x113)](configPath)){const _0x1cfaba=JSON[_0x6a49ff(0xbe)](fs[_0x6a49ff(0xfd)](configPath,'utf8'));return{...DEFAULT_CONFIG,..._0x1cfaba,'conversation_toggles':{...DEFAULT_CONFIG['conversation_toggles'],..._0x1cfaba[_0x6a49ff(0xff)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0x6a49ff(0xd4)],..._0x1cfaba[_0x6a49ff(0xd4)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x3dea78){const _0x26eb13=a0_0x57d459,_0xd5b58d=loadConfig(),_0x5d63f4={..._0xd5b58d,..._0x3dea78,'conversation_toggles':{..._0xd5b58d[_0x26eb13(0xff)],..._0x3dea78[_0x26eb13(0xff)]||{}},'custom_storage_paths':{..._0xd5b58d[_0x26eb13(0xd4)],..._0x3dea78[_0x26eb13(0xd4)]||{}}};try{if(!fs[_0x26eb13(0x113)](baseDir))fs[_0x26eb13(0xd5)](baseDir,{'recursive':!![]});fs['writeFileSync'](configPath,JSON['stringify'](_0x5d63f4,null,0x2),_0x26eb13(0xc6));}catch{}return _0x5d63f4;}function getAgentStoragePaths(_0x51504d){const _0x2c420c=a0_0x57d459,_0x8fa487=loadConfig(),_0x2a1849=_0x8fa487[_0x2c420c(0xd4)][_0x51504d];if(_0x2a1849&&fs[_0x2c420c(0x113)](_0x2a1849))return[_0x2a1849];const _0x32eb16=os[_0x2c420c(0x105)](),_0x40e353=process[_0x2c420c(0xf6)]==='win32',_0x1fd419=process[_0x2c420c(0xf6)]===_0x2c420c(0xb8);switch(_0x51504d){case'claude':return[path[_0x2c420c(0xdb)](_0x32eb16,'.claude',_0x2c420c(0xfa)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xf8),_0x2c420c(0xf3))];case _0x2c420c(0x12c):return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x11f),_0x2c420c(0xdc)),path['join'](_0x32eb16,'AppData',_0x2c420c(0x11a),'Codex')];case'gemini':return[path[_0x2c420c(0xdb)](_0x32eb16,'.gemini','antigravity'),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xa7)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0x11a),_0x2c420c(0xed)),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xcd))];case _0x2c420c(0x136):if(_0x40e353)return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0x11a),_0x2c420c(0xf1),_0x2c420c(0xce),'workspaceStorage')];if(_0x1fd419)return[path['join'](_0x32eb16,_0x2c420c(0xd1),_0x2c420c(0xbb),_0x2c420c(0xf1),'User','workspaceStorage')];return[path['join'](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xf1),_0x2c420c(0xce),_0x2c420c(0x130))];case'aider':return[process[_0x2c420c(0xdd)](),path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x12e))];case'copilot':if(_0x40e353)return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xc8),_0x2c420c(0xec),_0x2c420c(0xa5))];return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0x100),_0x2c420c(0xa5))];case'openclaw':return[path[_0x2c420c(0xdb)](_0x32eb16,'.openclaw','storage'),path[_0x2c420c(0xdb)](process['cwd'](),'.openclaw',_0x2c420c(0x10d))];case _0x2c420c(0x138):return[path['join'](_0x32eb16,'.opencode',_0x2c420c(0xdc))];case _0x2c420c(0x10c):return[path[_0x2c420c(0xdb)](_0x32eb16,_0x2c420c(0xba),_0x2c420c(0x10f))];default:return[];}}function getLatestSessionFile(_0x3430bf){const _0x44424b=a0_0x57d459,_0x6dbf61=getAgentStoragePaths(_0x3430bf);let _0x3de25c=null,_0x128496=0x0,_0x55c80b=null,_0xda118f=null;for(const _0x1e0dc9 of _0x6dbf61){if(fs['existsSync'](_0x1e0dc9)){if(!_0xda118f)_0xda118f=_0x1e0dc9;const _0x46b4ae=(_0x178301,_0x4bc383=0x0)=>{const _0x3ff068=a0_0x8518;if(_0x4bc383>0x3)return;try{const _0x11d4bf=fs[_0x3ff068(0xe5)](_0x178301,{'withFileTypes':!![]});for(const _0x5ea6c0 of _0x11d4bf){const _0x3f0ee3=path['join'](_0x178301,_0x5ea6c0['name']);if(_0x5ea6c0[_0x3ff068(0xa8)]())_0x46b4ae(_0x3f0ee3,_0x4bc383+0x1);else{if(_0x5ea6c0[_0x3ff068(0x126)]()&&!_0x5ea6c0[_0x3ff068(0xeb)][_0x3ff068(0xfb)]('.')){const _0x3e5478=_0x5ea6c0[_0x3ff068(0xeb)][_0x3ff068(0xd3)]();if(_0x3e5478['endsWith'](_0x3ff068(0x137))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xc2))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0x9f))||_0x3e5478[_0x3ff068(0xa1)]('.gif')||_0x3e5478['endsWith'](_0x3ff068(0x111))||_0x3e5478['endsWith'](_0x3ff068(0x9d))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xad))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xc9))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xb4))||_0x3e5478['endsWith'](_0x3ff068(0xfc))||_0x3e5478[_0x3ff068(0xa1)](_0x3ff068(0xdf))||_0x3e5478[_0x3ff068(0xfb)](_0x3ff068(0x118))||_0x3e5478[_0x3ff068(0xfb)](_0x3ff068(0xa3)))continue;const _0x5a7f5b=fs[_0x3ff068(0x11d)](_0x3f0ee3);_0x5a7f5b[_0x3ff068(0x12d)]>_0x128496&&(_0x128496=_0x5a7f5b[_0x3ff068(0x12d)],_0x3de25c=_0x5ea6c0[_0x3ff068(0xeb)],_0x55c80b=_0x3f0ee3,_0xda118f=_0x1e0dc9);}}}}catch{}};_0x46b4ae(_0x1e0dc9);}}return{'fileName':_0x3de25c,'lastModified':_0x128496>0x0?new Date(_0x128496)[_0x44424b(0xa4)]():null,'fullPath':_0x55c80b,'dirPath':_0xda118f};}const debounceTimers=new Map(),lastLoggedTimes=new Map();function compressMessageContent(_0x4b0c88,_0x581c77,_0x35247e){const _0x3f015f=a0_0x57d459;let _0x5630bb=![],_0x5b3404=0x0;if(!_0x4b0c88)return{'modified':_0x5630bb,'savedTokens':_0x5b3404};const _0x2df728=_0x43e3ea=>_0x43e3ea['replace'](/\r\n/g,'\x0a')[_0x3f015f(0xe2)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x4b0c88[_0x3f015f(0xc0)]==='string'){let _0x290ec1=_0x4b0c88[_0x3f015f(0xc0)],_0x2b219a=_0x2df728(_0x290ec1);_0x2b219a['length']<_0x290ec1['length']&&(_0x4b0c88[_0x3f015f(0xc0)]=_0x2b219a,_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc3)]((_0x290ec1[_0x3f015f(0xbd)]-_0x2b219a[_0x3f015f(0xbd)])/0x4));if(_0x4b0c88[_0x3f015f(0xc0)]['length']>0x12c&&!_0x4b0c88[_0x3f015f(0xc0)]['includes'](_0x3f015f(0x110))){const _0x4fc678='Summary:\x20Content\x20offloaded\x20('+Math[_0x3f015f(0xc3)](_0x4b0c88[_0x3f015f(0xc0)]['length']/0x4)+'\x20tokens).',_0xa64436=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x4b0c88[_0x3f015f(0xc0)],_0x4fc678);_0x4b0c88[_0x3f015f(0xc0)]=_0x3f015f(0x12a)+_0xa64436[_0x3f015f(0x112)]+_0x3f015f(0xcb)+_0xa64436[_0x3f015f(0xc1)]+_0x3f015f(0x134)+_0xa64436[_0x3f015f(0xc1)]+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc7)](0x0,_0xa64436[_0x3f015f(0x112)]-_0xa64436[_0x3f015f(0x139)]);}}else{if(Array[_0x3f015f(0x119)](_0x4b0c88['content']))for(const _0x15db6d of _0x4b0c88[_0x3f015f(0xc0)]){if(_0x15db6d&&typeof _0x15db6d==='object'){if(typeof _0x15db6d[_0x3f015f(0x125)]===_0x3f015f(0x128)){let _0x743363=_0x15db6d[_0x3f015f(0x125)],_0x21dcf7=_0x2df728(_0x743363);_0x21dcf7[_0x3f015f(0xbd)]<_0x743363[_0x3f015f(0xbd)]&&(_0x15db6d['text']=_0x21dcf7,_0x5630bb=!![],_0x5b3404+=Math['ceil']((_0x743363[_0x3f015f(0xbd)]-_0x21dcf7['length'])/0x4));if(_0x15db6d['text']['length']>0x12c&&!_0x15db6d[_0x3f015f(0x125)]['includes'](_0x3f015f(0x110))){const _0x4f0f2f=_0x3f015f(0xac)+Math[_0x3f015f(0xc3)](_0x15db6d[_0x3f015f(0x125)][_0x3f015f(0xbd)]/0x4)+_0x3f015f(0x117),_0x325afa=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x15db6d[_0x3f015f(0x125)],_0x4f0f2f);_0x15db6d['text']=_0x3f015f(0x9b)+_0x325afa['chunk_id']+_0x3f015f(0xe3)+_0x325afa[_0x3f015f(0xc1)]+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math['max'](0x0,_0x325afa['raw_tokens']-_0x325afa[_0x3f015f(0x139)]);}}else{if(typeof _0x15db6d[_0x3f015f(0xc0)]===_0x3f015f(0x128)){let _0x36bcc4=_0x15db6d[_0x3f015f(0xc0)],_0x1a4d9c=_0x2df728(_0x36bcc4);_0x1a4d9c[_0x3f015f(0xbd)]<_0x36bcc4[_0x3f015f(0xbd)]&&(_0x15db6d['content']=_0x1a4d9c,_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc3)]((_0x36bcc4[_0x3f015f(0xbd)]-_0x1a4d9c['length'])/0x4));if(_0x15db6d[_0x3f015f(0xc0)]['length']>0x12c&&!_0x15db6d['content'][_0x3f015f(0xb6)](_0x3f015f(0x110))){const _0x2127bb='Summary:\x20Tool\x20result\x20offloaded\x20('+Math['ceil'](_0x15db6d[_0x3f015f(0xc0)][_0x3f015f(0xbd)]/0x4)+_0x3f015f(0x117),_0x52b529=(0x0,cache_manager_1[_0x3f015f(0x120)])(_0x581c77,_0x35247e,_0x15db6d['content'],_0x2127bb);_0x15db6d[_0x3f015f(0xc0)]=_0x3f015f(0x9b)+_0x52b529[_0x3f015f(0xc1)]+_0x3f015f(0xe3)+_0x52b529['chunk_id']+'`\x0a',_0x5630bb=!![],_0x5b3404+=Math[_0x3f015f(0xc7)](0x0,_0x52b529[_0x3f015f(0x112)]-_0x52b529['compressed_tokens']);}}}}}}return{'modified':_0x5630bb,'savedTokens':_0x5b3404};}const sessionsStatePath=path['join'](baseDir,a0_0x57d459(0x9e));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0xef13a0=a0_0x57d459;try{if(fs[_0xef13a0(0x113)](sessionsStatePath)){const _0x3d215b=JSON[_0xef13a0(0xbe)](fs[_0xef13a0(0xfd)](sessionsStatePath,_0xef13a0(0xc6)));if(_0x3d215b&&typeof _0x3d215b===_0xef13a0(0xbf))return sessionsStateMemoryCache=_0x3d215b,_0x3d215b;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x15e0ff,_0x519e36,_0x3c81dc,_0x21351f=0x0,_0x202017=0x0){const _0x2bf111=a0_0x57d459;try{const _0x27ce42=loadSessionsState();_0x27ce42[_0x15e0ff]={'lineCount':_0x519e36,'activeSavedTokens':_0x3c81dc,'sideCacheSaved':_0x21351f,'officialCompactSaved':_0x202017},sessionsStateMemoryCache=_0x27ce42;if(!fs[_0x2bf111(0x113)](baseDir))fs[_0x2bf111(0xd5)](baseDir,{'recursive':!![]});const _0x3e0925=sessionsStatePath+_0x2bf111(0xb4);fs[_0x2bf111(0xcc)](_0x3e0925,JSON[_0x2bf111(0x9c)](_0x27ce42,null,0x2),_0x2bf111(0xc6)),fs['renameSync'](_0x3e0925,sessionsStatePath);}catch{}}function processSessionFile(_0x474771,_0x39c4e6){const _0x27efd0=a0_0x57d459;try{if(!fs[_0x27efd0(0x113)](_0x474771))return;const _0x5b5524=fs[_0x27efd0(0x11d)](_0x474771);if(_0x5b5524[_0x27efd0(0xa8)]()||_0x5b5524[_0x27efd0(0x106)]===0x0)return;const _0x1e056b=loadConfig(),_0x38dced='conv_'+_0x39c4e6;if(_0x1e056b[_0x27efd0(0xff)][_0x38dced]===![])return;const _0x2ee24c=fs['readFileSync'](_0x474771,'utf8');let _0x25c58c=![],_0x180bed=_0x2ee24c,_0x2e007a=0x0;const _0x4b411e=path[_0x27efd0(0x131)](_0x474771)[_0x27efd0(0xd3)](),_0x487762=path[_0x27efd0(0x132)](_0x474771,_0x4b411e);let _0x56c186=0x1;if(_0x39c4e6!==_0x27efd0(0x124)){if(_0x4b411e==='.json')try{const _0x18f730=JSON[_0x27efd0(0xbe)](_0x2ee24c),_0x51cb3f=Array[_0x27efd0(0x119)](_0x18f730[_0x27efd0(0x127)])?_0x18f730[_0x27efd0(0x127)]:Array[_0x27efd0(0x119)](_0x18f730)?_0x18f730:null;if(_0x51cb3f){_0x56c186=_0x51cb3f[_0x27efd0(0xbd)];for(let _0x4ab83a=0x0;_0x4ab83a<_0x51cb3f[_0x27efd0(0xbd)];_0x4ab83a++){const _0x49e75c=compressMessageContent(_0x51cb3f[_0x4ab83a],_0x487762,_0x39c4e6);_0x49e75c[_0x27efd0(0xb7)]&&(_0x25c58c=!![],_0x2e007a+=_0x49e75c[_0x27efd0(0x10a)]);}_0x25c58c&&(_0x180bed=JSON[_0x27efd0(0x9c)](_0x18f730,null,0x2));}}catch{}else{if(_0x4b411e===_0x27efd0(0xd6)||_0x4b411e===_0x27efd0(0xf5))try{const _0x568375=_0x2ee24c[_0x27efd0(0xa6)]('\x0a');_0x56c186=_0x568375[_0x27efd0(0xbd)];const _0x18dd7f=[];for(let _0x503790 of _0x568375){if(!_0x503790['trim']()){_0x18dd7f[_0x27efd0(0xf7)](_0x503790);continue;}try{const _0x52f364=JSON[_0x27efd0(0xbe)](_0x503790),_0x5160be=_0x52f364[_0x27efd0(0xca)]||_0x52f364;if(_0x5160be){const _0x2c1b09=compressMessageContent(_0x5160be,_0x487762,_0x39c4e6);_0x2c1b09[_0x27efd0(0xb7)]&&(_0x25c58c=!![],_0x2e007a+=_0x2c1b09[_0x27efd0(0x10a)],_0x503790=JSON['stringify'](_0x52f364));}}catch{}_0x18dd7f[_0x27efd0(0xf7)](_0x503790);}_0x25c58c&&(_0x180bed=_0x18dd7f['join']('\x0a'));}catch{}}}else(_0x4b411e===_0x27efd0(0xd6)||_0x4b411e==='.json1')&&(_0x56c186=_0x2ee24c['split']('\x0a')[_0x27efd0(0xd0)](Boolean)['length']);let _0x35df43=0x0;const _0x42f10a=_0x2ee24c[_0x27efd0(0xe6)](/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi);for(const _0x5d1a8c of _0x42f10a){let _0xad95f8=parseFloat(_0x5d1a8c[0x1]);_0x5d1a8c[0x0][_0x27efd0(0xd3)]()[_0x27efd0(0xb6)]('k')&&(_0xad95f8=_0xad95f8*0x3e8),_0x35df43+=Math[_0x27efd0(0xb0)](_0xad95f8);}const _0x43a7b1=loadSessionsState(),_0xf5027a=_0x43a7b1[_0x474771],_0xde75c2=_0xf5027a&&_0xf5027a['sideCacheSaved']!==undefined?_0xf5027a[_0x27efd0(0xe8)]:0x0,_0x151bf5=_0xf5027a&&_0xf5027a['officialCompactSaved']!==undefined?_0xf5027a[_0x27efd0(0xab)]:_0xf5027a?_0xf5027a[_0x27efd0(0xcf)]:0x0,_0x5f59c9=_0xf5027a?_0xf5027a[_0x27efd0(0xa9)]:0x0,_0x2de642=_0x56c186>_0x5f59c9;let _0x3abfc8=_0xde75c2,_0x422fb8=Math['max'](_0x151bf5,_0x35df43);if(_0x25c58c){fs[_0x27efd0(0xcc)](_0x474771,_0x180bed,_0x27efd0(0xc6)),_0x3abfc8+=_0x2e007a;const _0x1cf36a=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x1cf36a,_0x3abfc8,_0x422fb8);const _0xa6b06b='x'['repeat'](_0x1cf36a*0x4);tracker_1['tracker'][_0x27efd0(0xe0)](_0x27efd0(0xa0)+_0x39c4e6,_0xa6b06b,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,'trim_offload']);}else{if(_0x35df43>_0x151bf5){_0x422fb8=_0x35df43;const _0x51da1d=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x51da1d,_0x3abfc8,_0x422fb8);const _0x55d507='x'['repeat'](_0x51da1d*0x4);tracker_1[_0x27efd0(0xfe)][_0x27efd0(0xe0)](_0x27efd0(0xa0)+_0x39c4e6,_0x55d507,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,'official_compact']);}else{if(_0x2de642){const _0x4fe9e8=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x4fe9e8,_0x3abfc8,_0x422fb8);if(_0x4fe9e8>0x0){const _0x3f10ac='x'['repeat'](_0x4fe9e8*0x4);tracker_1['tracker']['logExecution'](_0x27efd0(0xa0)+_0x39c4e6,_0x3f10ac,'',0x0,undefined,[_0x27efd0(0x121)+_0x39c4e6,_0x27efd0(0xda),_0x39c4e6,_0x27efd0(0xd8)]);}}else{const _0x5ab255=_0x3abfc8+_0x422fb8;saveSessionStateItem(_0x474771,_0x56c186,_0x5ab255,_0x3abfc8,_0x422fb8);}}}}catch{}}function installWindowsStartupService(){const _0x5a732a=a0_0x57d459;if(process[_0x5a732a(0xf6)]!==_0x5a732a(0x109))return;try{const _0x584cf5=path[_0x5a732a(0xdb)](os['homedir'](),_0x5a732a(0xc8),_0x5a732a(0x11a),_0x5a732a(0x12f),_0x5a732a(0x11c),_0x5a732a(0xf9),_0x5a732a(0xf2),'Startup');if(!fs[_0x5a732a(0x113)](_0x584cf5))fs[_0x5a732a(0xd5)](_0x584cf5,{'recursive':!![]});const _0x4f3f8d=path[_0x5a732a(0xdb)](_0x584cf5,_0x5a732a(0xee)),_0x3f7b02=path[_0x5a732a(0xdb)](__dirname,_0x5a732a(0x123)),_0x2897b9=_0x3f7b02['replace'](/\\/g,'\x5c\x5c'),_0x3fec31=_0x5a732a(0xd2)+_0x2897b9+_0x5a732a(0x116);fs[_0x5a732a(0xcc)](_0x4f3f8d,_0x3fec31,_0x5a732a(0xc6));}catch{}}function startWatcherDaemon(){const _0x1d0542=a0_0x57d459;installWindowsStartupService();try{const {installClaudeHooks:_0x26ab25}=require(_0x1d0542(0xd7));_0x26ab25();}catch(_0x296864){}const _0xa6b4e1=[_0x1d0542(0x124),'gemini',_0x1d0542(0x12c),'cursor',_0x1d0542(0xd9),_0x1d0542(0xb9),_0x1d0542(0xb3),_0x1d0542(0x138),_0x1d0542(0x10c)];for(const _0x347c3c of _0xa6b4e1){const _0x49f8e1=getAgentStoragePaths(_0x347c3c);for(const _0x38fc13 of _0x49f8e1){if(fs[_0x1d0542(0x113)](_0x38fc13))try{fs['watch'](_0x38fc13,{'recursive':!![]},(_0x31f7bc,_0x45fe1d)=>{const _0x5c1627=_0x1d0542;if(!_0x45fe1d)return;const _0x5e80e6=path[_0x5c1627(0xdb)](_0x38fc13,_0x45fe1d);if(debounceTimers[_0x5c1627(0xf0)](_0x5e80e6))clearTimeout(debounceTimers[_0x5c1627(0xbc)](_0x5e80e6));const _0x386189=setTimeout(()=>processSessionFile(_0x5e80e6,_0x347c3c),0x1f4);debounceTimers[_0x5c1627(0xa2)](_0x5e80e6,_0x386189);});}catch{}}}setInterval(()=>{const _0x5588ca=_0x1d0542;for(const _0x51d69b of _0xa6b4e1){try{const _0x447a70=getLatestSessionFile(_0x51d69b);_0x447a70&&_0x447a70['fullPath']&&processSessionFile(_0x447a70[_0x5588ca(0xe4)],_0x51d69b);}catch{}}},0xbb8);}
|
|
1
|
+
'use strict';const a0_0x19419e=a0_0x799b;(function(_0x3f1be8,_0x29242f){const _0x580b94=a0_0x799b,_0x3fb8d8=_0x3f1be8();while(!![]){try{const _0x379d4f=parseInt(_0x580b94(0x1f7))/0x1+-parseInt(_0x580b94(0x19e))/0x2+-parseInt(_0x580b94(0x1f3))/0x3+parseInt(_0x580b94(0x1b7))/0x4*(-parseInt(_0x580b94(0x203))/0x5)+parseInt(_0x580b94(0x1ae))/0x6*(-parseInt(_0x580b94(0x1a7))/0x7)+-parseInt(_0x580b94(0x1f8))/0x8+parseInt(_0x580b94(0x202))/0x9;if(_0x379d4f===_0x29242f)break;else _0x3fb8d8['push'](_0x3fb8d8['shift']());}catch(_0x39d3f1){_0x3fb8d8['push'](_0x3fb8d8['shift']());}}}(a0_0x23f4,0xb3e41));var __createBinding=this&&this[a0_0x19419e(0x199)]||(Object[a0_0x19419e(0x1f4)]?function(_0x1d9428,_0x299f45,_0x15b8c7,_0x241a6d){const _0x54b920=a0_0x19419e;if(_0x241a6d===undefined)_0x241a6d=_0x15b8c7;var _0x399f14=Object[_0x54b920(0x1d9)](_0x299f45,_0x15b8c7);(!_0x399f14||(_0x54b920(0x1e0)in _0x399f14?!_0x299f45[_0x54b920(0x19d)]:_0x399f14[_0x54b920(0x22e)]||_0x399f14[_0x54b920(0x1a4)]))&&(_0x399f14={'enumerable':!![],'get':function(){return _0x299f45[_0x15b8c7];}}),Object[_0x54b920(0x1ea)](_0x1d9428,_0x241a6d,_0x399f14);}:function(_0x54b573,_0x53cf74,_0x5cbf39,_0x1ce9fa){if(_0x1ce9fa===undefined)_0x1ce9fa=_0x5cbf39;_0x54b573[_0x1ce9fa]=_0x53cf74[_0x5cbf39];}),__setModuleDefault=this&&this[a0_0x19419e(0x1bb)]||(Object['create']?function(_0x2e5fb4,_0x434be9){const _0x294ca9=a0_0x19419e;Object[_0x294ca9(0x1ea)](_0x2e5fb4,_0x294ca9(0x230),{'enumerable':!![],'value':_0x434be9});}:function(_0x17a662,_0x5aee82){_0x17a662['default']=_0x5aee82;}),__importStar=this&&this[a0_0x19419e(0x19c)]||(function(){var _0x14c194=function(_0x49f43f){const _0xa8ecd9=a0_0x799b;return _0x14c194=Object[_0xa8ecd9(0x19b)]||function(_0x17e8b3){const _0x342c4d=_0xa8ecd9;var _0x4d089e=[];for(var _0x193b3e in _0x17e8b3)if(Object[_0x342c4d(0x246)][_0x342c4d(0x251)][_0x342c4d(0x1ee)](_0x17e8b3,_0x193b3e))_0x4d089e[_0x4d089e[_0x342c4d(0x248)]]=_0x193b3e;return _0x4d089e;},_0x14c194(_0x49f43f);};return function(_0x8e7a3c){const _0x1efadc=a0_0x799b;if(_0x8e7a3c&&_0x8e7a3c[_0x1efadc(0x19d)])return _0x8e7a3c;var _0x59e9ec={};if(_0x8e7a3c!=null){for(var _0x1a7288=_0x14c194(_0x8e7a3c),_0x462d34=0x0;_0x462d34<_0x1a7288[_0x1efadc(0x248)];_0x462d34++)if(_0x1a7288[_0x462d34]!==_0x1efadc(0x230))__createBinding(_0x59e9ec,_0x8e7a3c,_0x1a7288[_0x462d34]);}return __setModuleDefault(_0x59e9ec,_0x8e7a3c),_0x59e9ec;};}());Object['defineProperty'](exports,a0_0x19419e(0x19d),{'value':!![]}),exports[a0_0x19419e(0x1af)]=loadConfig,exports[a0_0x19419e(0x1d0)]=saveConfig,exports[a0_0x19419e(0x214)]=getAgentStoragePaths,exports[a0_0x19419e(0x1ff)]=getLatestSessionFile,exports[a0_0x19419e(0x220)]=loadSessionsState,exports[a0_0x19419e(0x237)]=saveSessionStateItem,exports[a0_0x19419e(0x236)]=processSessionFile,exports[a0_0x19419e(0x254)]=compactSessionCopy,exports[a0_0x19419e(0x1b2)]=compactLiveSession,exports[a0_0x19419e(0x233)]=installWindowsStartupService,exports[a0_0x19419e(0x1f1)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),cache_manager_1=require('./cache-manager'),tracker_1=require(a0_0x19419e(0x219)),baseDir=path[a0_0x19419e(0x20f)](os[a0_0x19419e(0x1b0)](),'.trimprompt'),configPath=path['join'](baseDir,a0_0x19419e(0x1e8)),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function a0_0x799b(_0x55c360,_0x1240ef){_0x55c360=_0x55c360-0x195;const _0x23f4b8=a0_0x23f4();let _0x799b0e=_0x23f4b8[_0x55c360];return _0x799b0e;}function loadConfig(){const _0x13d142=a0_0x19419e;try{if(!fs[_0x13d142(0x1c9)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});if(fs['existsSync'](configPath)){const _0x2b0c74=JSON[_0x13d142(0x1e2)](fs[_0x13d142(0x19a)](configPath,_0x13d142(0x1f0)));return{...DEFAULT_CONFIG,..._0x2b0c74,'conversation_toggles':{...DEFAULT_CONFIG[_0x13d142(0x1c6)],..._0x2b0c74[_0x13d142(0x1c6)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG['custom_storage_paths'],..._0x2b0c74[_0x13d142(0x1c2)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x3a0244){const _0x288e67=a0_0x19419e,_0x4abd3b=loadConfig(),_0x5a8066={..._0x4abd3b,..._0x3a0244,'conversation_toggles':{..._0x4abd3b['conversation_toggles'],..._0x3a0244[_0x288e67(0x1c6)]||{}},'custom_storage_paths':{..._0x4abd3b[_0x288e67(0x1c2)],..._0x3a0244[_0x288e67(0x1c2)]||{}}};try{if(!fs[_0x288e67(0x1c9)](baseDir))fs[_0x288e67(0x22b)](baseDir,{'recursive':!![]});fs[_0x288e67(0x22c)](configPath,JSON[_0x288e67(0x21f)](_0x5a8066,null,0x2),_0x288e67(0x1f0));}catch{}return _0x5a8066;}function getAgentStoragePaths(_0x7da94e){const _0x4ac033=a0_0x19419e,_0x18a7aa=loadConfig(),_0x167f63=_0x18a7aa[_0x4ac033(0x1c2)][_0x7da94e];if(_0x167f63&&fs['existsSync'](_0x167f63))return[_0x167f63];const _0x53ec10=os[_0x4ac033(0x1b0)](),_0x222abb=process['platform']==='win32',_0x1e8189=process[_0x4ac033(0x213)]===_0x4ac033(0x1a2);switch(_0x7da94e){case _0x4ac033(0x206):return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1b9),'projects'),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1b9),_0x4ac033(0x1ba))];case'codex':return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1cd),_0x4ac033(0x24b)),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1ca),_0x4ac033(0x21c),_0x4ac033(0x205))];case _0x4ac033(0x1a9):case _0x4ac033(0x196):return[path[_0x4ac033(0x20f)](_0x53ec10,'.gemini',_0x4ac033(0x196)),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1e1)),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1ca),'Roaming',_0x4ac033(0x22f)),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x223),_0x4ac033(0x1a9))];case'cursor':if(_0x222abb)return[path['join'](_0x53ec10,_0x4ac033(0x1ca),'Roaming',_0x4ac033(0x240),_0x4ac033(0x232),_0x4ac033(0x247))];if(_0x1e8189)return[path[_0x4ac033(0x20f)](_0x53ec10,'Library',_0x4ac033(0x1a1),_0x4ac033(0x240),'User',_0x4ac033(0x247))];return[path['join'](_0x53ec10,_0x4ac033(0x223),_0x4ac033(0x240),_0x4ac033(0x232),'workspaceStorage')];case _0x4ac033(0x1fa):return[process[_0x4ac033(0x1e5)](),path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x20b))];case _0x4ac033(0x1b4):if(_0x222abb)return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x1ca),_0x4ac033(0x1df),_0x4ac033(0x1ab))];return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x223),'github-copilot-cli')];case _0x4ac033(0x259):return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x23a),_0x4ac033(0x238)),path['join'](process[_0x4ac033(0x1e5)](),_0x4ac033(0x23a),_0x4ac033(0x21a))];case _0x4ac033(0x1a3):return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x231),_0x4ac033(0x24b))];case _0x4ac033(0x1ac):return[path[_0x4ac033(0x20f)](_0x53ec10,_0x4ac033(0x225),_0x4ac033(0x256))];default:return[];}}function getLatestSessionFile(_0x11deb6){const _0x13669e=a0_0x19419e,_0x57045a=getAgentStoragePaths(_0x11deb6);let _0x555857=null,_0x43037d=0x0,_0x334236=null,_0x4d19ee=null;for(const _0x4499c3 of _0x57045a){if(fs[_0x13669e(0x1c9)](_0x4499c3)){if(!_0x4d19ee)_0x4d19ee=_0x4499c3;const _0x23aa76=(_0x65db8a,_0x25484e=0x0)=>{const _0x6e84b2=_0x13669e;if(_0x25484e>0x6)return;try{const _0x41b8e4=fs[_0x6e84b2(0x1e3)](_0x65db8a,{'withFileTypes':!![]});for(const _0x22483b of _0x41b8e4){const _0xdc23=path[_0x6e84b2(0x20f)](_0x65db8a,_0x22483b[_0x6e84b2(0x211)]);if(_0x22483b[_0x6e84b2(0x20a)]()){const _0x3b291c=_0x22483b['name'][_0x6e84b2(0x1b8)]();if(_0x3b291c==='node_modules'||_0x3b291c===_0x6e84b2(0x210)||_0x3b291c==='.venv'||_0x3b291c==='env'||_0x3b291c===_0x6e84b2(0x23f)||_0x3b291c==='__pycache__'||_0x3b291c===_0x6e84b2(0x1c5)||_0x3b291c==='dist'||_0x3b291c===_0x6e84b2(0x1b5)||_0x3b291c===_0x6e84b2(0x1d1)||_0x3b291c===_0x6e84b2(0x1ef))continue;_0x23aa76(_0xdc23,_0x25484e+0x1);}else{if(_0x22483b[_0x6e84b2(0x22d)]()&&!_0x22483b['name'][_0x6e84b2(0x23e)]('.')){const _0x122747=_0x22483b['name'][_0x6e84b2(0x1b8)]();if(_0x122747[_0x6e84b2(0x209)](_0x6e84b2(0x1de))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x1be))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x224))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x20c))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x1ec))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x221))||_0x122747[_0x6e84b2(0x1d8)]('.gif')||_0x122747['endsWith'](_0x6e84b2(0x1e9))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x1f6))||_0x122747['endsWith'](_0x6e84b2(0x1a0))||_0x122747['endsWith'](_0x6e84b2(0x1f5))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x250))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x239))||_0x122747[_0x6e84b2(0x1d8)](_0x6e84b2(0x24f))||_0x122747[_0x6e84b2(0x23e)](_0x6e84b2(0x23c))||_0x122747[_0x6e84b2(0x23e)](_0x6e84b2(0x1dd)))continue;const _0x17bfd8=fs[_0x6e84b2(0x1dc)](_0xdc23);_0x17bfd8[_0x6e84b2(0x200)]>_0x43037d&&(_0x43037d=_0x17bfd8[_0x6e84b2(0x200)],_0x555857=_0x22483b[_0x6e84b2(0x211)],_0x334236=_0xdc23,_0x4d19ee=_0x4499c3);}}}}catch{}};_0x23aa76(_0x4499c3);}}return{'fileName':_0x555857,'lastModified':_0x43037d>0x0?new Date(_0x43037d)[_0x13669e(0x1cc)]():null,'fullPath':_0x334236,'dirPath':_0x4d19ee};}const debounceTimers=new Map(),lastLoggedTimes=new Map(),OFFLOAD_THRESHOLD_CHARS=0x7d0;function compressMessageContent(_0x1b0791,_0x3abd55,_0x31651a){const _0x48cf98=a0_0x19419e;let _0xdc2a71=![],_0x15dd48=0x0;if(!_0x1b0791)return{'modified':_0xdc2a71,'savedTokens':_0x15dd48};const _0x1d9cc7=_0x2bfb93=>_0x2bfb93[_0x48cf98(0x1bc)](/\r\n/g,'\x0a')[_0x48cf98(0x1bc)](/\n{3,}/g,'\x0a\x0a');if(typeof _0x1b0791[_0x48cf98(0x249)]==='string'){let _0x149cb2=_0x1b0791[_0x48cf98(0x249)],_0x12480d=_0x1d9cc7(_0x149cb2);_0x12480d[_0x48cf98(0x248)]<_0x149cb2[_0x48cf98(0x248)]&&(_0x1b0791['content']=_0x12480d,_0xdc2a71=!![],_0x15dd48+=Math[_0x48cf98(0x244)]((_0x149cb2[_0x48cf98(0x248)]-_0x12480d[_0x48cf98(0x248)])/0x4));if(_0x1b0791[_0x48cf98(0x249)][_0x48cf98(0x248)]>OFFLOAD_THRESHOLD_CHARS&&!_0x1b0791[_0x48cf98(0x249)][_0x48cf98(0x209)](_0x48cf98(0x1ce))){const _0x172376=_0x48cf98(0x1c1)+Math[_0x48cf98(0x244)](_0x1b0791[_0x48cf98(0x249)]['length']/0x4)+_0x48cf98(0x1db),_0x3a7515=(0x0,cache_manager_1[_0x48cf98(0x227)])(_0x3abd55,_0x31651a,_0x1b0791[_0x48cf98(0x249)],_0x172376);_0x1b0791[_0x48cf98(0x249)]=_0x48cf98(0x24a)+_0x3a7515[_0x48cf98(0x1fe)]+_0x48cf98(0x1c4)+_0x3a7515[_0x48cf98(0x217)]+_0x48cf98(0x24d)+_0x3a7515['chunk_id']+'`\x0a',_0xdc2a71=!![],_0x15dd48+=Math[_0x48cf98(0x216)](0x0,_0x3a7515[_0x48cf98(0x1fe)]-_0x3a7515[_0x48cf98(0x257)]);}}else{if(Array[_0x48cf98(0x22a)](_0x1b0791[_0x48cf98(0x249)]))for(const _0x80aff of _0x1b0791['content']){if(_0x80aff&&typeof _0x80aff===_0x48cf98(0x212)){if(typeof _0x80aff[_0x48cf98(0x1d3)]===_0x48cf98(0x1d2)){let _0x356c4c=_0x80aff[_0x48cf98(0x1d3)],_0x565edf=_0x1d9cc7(_0x356c4c);_0x565edf['length']<_0x356c4c[_0x48cf98(0x248)]&&(_0x80aff[_0x48cf98(0x1d3)]=_0x565edf,_0xdc2a71=!![],_0x15dd48+=Math[_0x48cf98(0x244)]((_0x356c4c[_0x48cf98(0x248)]-_0x565edf['length'])/0x4));if(_0x80aff['text']['length']>OFFLOAD_THRESHOLD_CHARS&&!_0x80aff[_0x48cf98(0x1d3)]['includes'](_0x48cf98(0x1ce))){const _0x335d9c=_0x48cf98(0x245)+Math[_0x48cf98(0x244)](_0x80aff[_0x48cf98(0x1d3)]['length']/0x4)+_0x48cf98(0x1db),_0x2adfba=(0x0,cache_manager_1[_0x48cf98(0x227)])(_0x3abd55,_0x31651a,_0x80aff['text'],_0x335d9c);_0x80aff['text']=_0x48cf98(0x208)+_0x2adfba[_0x48cf98(0x217)]+_0x48cf98(0x1c7)+_0x2adfba[_0x48cf98(0x217)]+'`\x0a',_0xdc2a71=!![],_0x15dd48+=Math[_0x48cf98(0x216)](0x0,_0x2adfba['raw_tokens']-_0x2adfba[_0x48cf98(0x257)]);}}else{if(typeof _0x80aff['content']===_0x48cf98(0x1d2)){let _0x104ae6=_0x80aff[_0x48cf98(0x249)],_0x5061b2=_0x1d9cc7(_0x104ae6);_0x5061b2[_0x48cf98(0x248)]<_0x104ae6['length']&&(_0x80aff[_0x48cf98(0x249)]=_0x5061b2,_0xdc2a71=!![],_0x15dd48+=Math[_0x48cf98(0x244)]((_0x104ae6[_0x48cf98(0x248)]-_0x5061b2[_0x48cf98(0x248)])/0x4));if(_0x80aff['content']['length']>OFFLOAD_THRESHOLD_CHARS&&!_0x80aff[_0x48cf98(0x249)][_0x48cf98(0x209)](_0x48cf98(0x1ce))){const _0x4156ac=_0x48cf98(0x1b1)+Math[_0x48cf98(0x244)](_0x80aff[_0x48cf98(0x249)][_0x48cf98(0x248)]/0x4)+'\x20tokens).',_0x191344=(0x0,cache_manager_1[_0x48cf98(0x227)])(_0x3abd55,_0x31651a,_0x80aff[_0x48cf98(0x249)],_0x4156ac);_0x80aff[_0x48cf98(0x249)]=_0x48cf98(0x208)+_0x191344[_0x48cf98(0x217)]+'`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20'+_0x191344[_0x48cf98(0x217)]+'`\x0a',_0xdc2a71=!![],_0x15dd48+=Math['max'](0x0,_0x191344[_0x48cf98(0x1fe)]-_0x191344[_0x48cf98(0x257)]);}}}}}}return{'modified':_0xdc2a71,'savedTokens':_0x15dd48};}const sessionsStatePath=path[a0_0x19419e(0x20f)](baseDir,a0_0x19419e(0x215));let sessionsStateMemoryCache=null;function a0_0x23f4(){const _0x14263e=['compressed_tokens','prompt_turn','openclaw','messages','antigravity','split','tokens','__createBinding','readFileSync','getOwnPropertyNames','__importStar','__esModule','2942876gtWdCT','system','.wal','Application\x20Support','darwin','opencode','configurable','matchAll','compact_copy','120701UDmhLg','push','gemini','live-conv','github-copilot-cli','cortex','repeat','408SLravG','loadConfig','homedir','Summary:\x20Tool\x20result\x20offloaded\x20(','compactLiveSession','byteLength','copilot','build','type','4921196uWxmzT','toLowerCase','.claude','history','__setModuleDefault','replace','modified','.db','autoCompactSaved','set','Summary:\x20Content\x20offloaded\x20(','custom_storage_paths','conv_','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','.next','conversation_toggles','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','lineCount','existsSync','AppData','./proxy-conv','toISOString','.codex','TrimPrompt\x20Cache\x20Engine','activeSavedTokens','saveConfig','out','string','text','.json','officialCompactSaved','cursor','role','endsWith','getOwnPropertyDescriptor','./hooks/claude-hook','\x20tokens).','statSync','image_','.compact','Local','get','.gemini','parse','readdirSync','TrimPromptDaemon.vbs','cwd','basename','renameSync','config.json','.webp','defineProperty','Microsoft','.jpg','cli.js','call','.agents','utf8','startWatcherDaemon','Windows','2841774QraGzn','create','.shm','.pb','999475UdvjYd','900784odoGcw','find','aider','compaction\x20failed','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','message','raw_tokens','getLatestSessionFile','mtimeMs','logExecution','42043275UxNxEb','5kLgmMw','savedTokens','Codex','claude','size','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','includes','isDirectory','.aider.chat.history.md','.png','.jsonl','has','join','.git','name','object','platform','getAgentStoragePaths','sessions_state.json','max','chunk_id','codex','./tracker','context','saved','Roaming','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','hookSavedTokens','stringify','loadSessionsState','.jpeg','filter','.config','.vscdb','.cortex','assign','saveChunk','dirname','.json1','isArray','mkdirSync','writeFileSync','isFile','writable','Gemini','default','.opencode','User','installWindowsStartupService','tracker','compact:','processSessionFile','saveSessionStateItem','storage','.lock','.openclaw','none','media__','Startup','startsWith','venv','Cursor','fullPath','Unsupported\x20extension','sideCacheSaved','ceil','Summary:\x20Text\x20block\x20offloaded\x20(','prototype','workspaceStorage','length','content','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','sessions','watch','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','Programs','.dat','.tmp','hasOwnProperty','extname','round','compactSessionCopy','trim','cache'];a0_0x23f4=function(){return _0x14263e;};return a0_0x23f4();}function loadSessionsState(){const _0x36be39=a0_0x19419e;try{if(fs[_0x36be39(0x1c9)](sessionsStatePath)){const _0x77e2db=JSON[_0x36be39(0x1e2)](fs[_0x36be39(0x19a)](sessionsStatePath,'utf8'));if(_0x77e2db&&typeof _0x77e2db==='object')return sessionsStateMemoryCache=_0x77e2db,_0x77e2db;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x55f74e,_0x2f1d01,_0x42e22d,_0x29727e=0x0,_0x49bcd0=0x0,_0x892f0=0x0){const _0x5a5338=a0_0x19419e;try{const _0xa443a8=loadSessionsState(),_0x2552f3=_0xa443a8[_0x55f74e]||{},_0x4c3f41=_0x49bcd0||_0x2552f3[_0x5a5338(0x1bf)]||0x0,_0x2d0886=_0x892f0||_0x2552f3['hookSavedTokens']||0x0,_0x5699a0=_0x42e22d!==undefined?_0x42e22d:_0x2552f3['officialCompactSaved']||0x0;_0xa443a8[_0x55f74e]={'lineCount':_0x2f1d01||_0x2552f3[_0x5a5338(0x1c8)]||0x1,'activeSavedTokens':_0x5699a0+_0x4c3f41+_0x2d0886,'sideCacheSaved':_0x29727e||_0x2552f3[_0x5a5338(0x243)]||0x0,'officialCompactSaved':_0x5699a0,'autoCompactSaved':_0x4c3f41,'hookSavedTokens':_0x2d0886},sessionsStateMemoryCache=_0xa443a8;if(!fs[_0x5a5338(0x1c9)](baseDir))fs[_0x5a5338(0x22b)](baseDir,{'recursive':!![]});const _0x5967d1=sessionsStatePath+'.tmp';fs['writeFileSync'](_0x5967d1,JSON[_0x5a5338(0x21f)](_0xa443a8,null,0x2),'utf8'),fs[_0x5a5338(0x1e7)](_0x5967d1,sessionsStatePath);}catch{}}function processSessionFile(_0xec5c54,_0x5736b3){const _0x579a1a=a0_0x19419e;try{if(!fs[_0x579a1a(0x1c9)](_0xec5c54))return;const _0x302365=fs[_0x579a1a(0x1dc)](_0xec5c54);if(_0x302365[_0x579a1a(0x20a)]()||_0x302365[_0x579a1a(0x207)]===0x0)return;const _0x4ea476=loadConfig(),_0x140c95=_0x579a1a(0x1c3)+_0x5736b3;if(_0x4ea476[_0x579a1a(0x1c6)][_0x140c95]===![])return;const _0x1d0ea5=fs[_0x579a1a(0x19a)](_0xec5c54,_0x579a1a(0x1f0)),_0x590a19=path[_0x579a1a(0x252)](_0xec5c54)[_0x579a1a(0x1b8)]();let _0x171aa9=0x1;if(_0x590a19==='.jsonl'||_0x590a19===_0x579a1a(0x229))_0x171aa9=_0x1d0ea5['split']('\x0a')[_0x579a1a(0x222)](Boolean)['length'];else{if(_0x590a19===_0x579a1a(0x1d4))try{const _0x302b49=JSON[_0x579a1a(0x1e2)](_0x1d0ea5),_0x420e50=Array[_0x579a1a(0x22a)](_0x302b49[_0x579a1a(0x195)])?_0x302b49[_0x579a1a(0x195)]:Array[_0x579a1a(0x22a)](_0x302b49)?_0x302b49:null;if(_0x420e50)_0x171aa9=_0x420e50[_0x579a1a(0x248)];}catch{}}let _0x43e5fd=0x0;if((_0x590a19===_0x579a1a(0x20d)||_0x590a19===_0x579a1a(0x229))&&_0x1d0ea5[_0x579a1a(0x209)]('saved')&&_0x1d0ea5[_0x579a1a(0x209)](_0x579a1a(0x198))){const _0x470ab4=/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi;for(const _0x58961c of _0x1d0ea5[_0x579a1a(0x197)]('\x0a')){if(!_0x58961c['includes'](_0x579a1a(0x21b))||!_0x58961c[_0x579a1a(0x209)](_0x579a1a(0x198)))continue;try{const _0x1fea2b=JSON[_0x579a1a(0x1e2)](_0x58961c);if(_0x1fea2b[_0x579a1a(0x1b6)]!==_0x579a1a(0x19f))continue;const _0xb22a1e=typeof _0x1fea2b[_0x579a1a(0x249)]===_0x579a1a(0x1d2)?_0x1fea2b[_0x579a1a(0x249)]:_0x1fea2b[_0x579a1a(0x1fd)]&&typeof _0x1fea2b[_0x579a1a(0x1fd)]['content']==='string'?_0x1fea2b[_0x579a1a(0x1fd)][_0x579a1a(0x249)]:'';if(!_0xb22a1e)continue;for(const _0x25fd15 of _0xb22a1e[_0x579a1a(0x1a5)](_0x470ab4)){let _0x4e2e08=parseFloat(_0x25fd15[0x1]);if(_0x25fd15[0x0][_0x579a1a(0x1b8)]()[_0x579a1a(0x209)]('k'))_0x4e2e08=_0x4e2e08*0x3e8;_0x43e5fd+=Math['round'](_0x4e2e08);}}catch{}}}const _0x40178a=loadSessionsState(),_0x3e4cb8=_0x40178a[_0xec5c54],_0xd00f35=_0x3e4cb8?_0x3e4cb8[_0x579a1a(0x1c8)]:0x0,_0x5364da=_0x3e4cb8?_0x3e4cb8[_0x579a1a(0x1cf)]||0x0:0x0;if(_0xd00f35>0x0&&_0x171aa9>_0xd00f35&&_0x5364da>0x0){const _0x37d718='conv:'+_0x5736b3;tracker_1[_0x579a1a(0x234)][_0x579a1a(0x201)](_0x37d718,'A'[_0x579a1a(0x1ad)](_0x5364da*0x4),'',0x0,undefined,[_0x579a1a(0x1c3)+_0x5736b3,_0x579a1a(0x1aa),_0x5736b3,_0x579a1a(0x258)]);}const _0x35adbc=_0x3e4cb8&&_0x3e4cb8['officialCompactSaved']!==undefined?_0x3e4cb8[_0x579a1a(0x1d5)]:0x0,_0x3acfe9=Math[_0x579a1a(0x216)](_0x35adbc,_0x43e5fd);saveSessionStateItem(_0xec5c54,_0x171aa9,_0x3acfe9,0x0,0x0,0x0);}catch{}}function compactSessionCopy(_0x447e00,_0x13399a){const _0x23dc86=a0_0x19419e;try{if(!fs[_0x23dc86(0x1c9)](_0x447e00))return{'ok':![],'reason':'Session\x20file\x20not\x20found'};const _0x6be111=path[_0x23dc86(0x252)](_0x447e00)['toLowerCase']();if(_0x6be111!=='.json'&&_0x6be111!==_0x23dc86(0x20d)&&_0x6be111!==_0x23dc86(0x229))return{'ok':![],'reason':'Unsupported\x20format\x20\x27'+(_0x6be111||_0x23dc86(0x23b))+'\x27\x20—\x20only\x20JSON/JSONL\x20sessions\x20can\x20be\x20compacted\x20(binary\x20.pb/.db\x20stores\x20are\x20not\x20supported)'};const _0x34d46e=fs[_0x23dc86(0x19a)](_0x447e00,_0x23dc86(0x1f0)),_0x471ccf=Buffer[_0x23dc86(0x1b3)](_0x34d46e,_0x23dc86(0x1f0)),_0x80b725=path['basename'](_0x447e00,_0x6be111);let _0x187713=_0x34d46e,_0x20686a=![];if(_0x6be111===_0x23dc86(0x1d4)){const _0x2ecebc=JSON[_0x23dc86(0x1e2)](_0x34d46e),_0x3c5a66=Array[_0x23dc86(0x22a)](_0x2ecebc[_0x23dc86(0x195)])?_0x2ecebc[_0x23dc86(0x195)]:Array['isArray'](_0x2ecebc)?_0x2ecebc:null;if(_0x3c5a66){for(const _0x5a1938 of _0x3c5a66){const _0x5179ed=compressMessageContent(_0x5a1938,_0x80b725,_0x13399a);if(_0x5179ed[_0x23dc86(0x1bd)])_0x20686a=!![];}if(_0x20686a)_0x187713=JSON[_0x23dc86(0x21f)](_0x2ecebc,null,0x2);}}else{const _0x5ef0de=_0x34d46e[_0x23dc86(0x197)]('\x0a'),_0x4f552b=[];for(let _0x4e69d0 of _0x5ef0de){if(!_0x4e69d0[_0x23dc86(0x255)]()){_0x4f552b['push'](_0x4e69d0);continue;}try{const _0x231550=JSON[_0x23dc86(0x1e2)](_0x4e69d0),_0x179928=_0x231550[_0x23dc86(0x1fd)]||_0x231550;if(_0x179928){const _0x1991e9=compressMessageContent(_0x179928,_0x80b725,_0x13399a);_0x1991e9[_0x23dc86(0x1bd)]&&(_0x20686a=!![],_0x4e69d0=JSON[_0x23dc86(0x21f)](_0x231550));}}catch{}_0x4f552b[_0x23dc86(0x1a8)](_0x4e69d0);}if(_0x20686a)_0x187713=_0x4f552b[_0x23dc86(0x20f)]('\x0a');}const _0x4dfe25=Buffer[_0x23dc86(0x1b3)](_0x187713,_0x23dc86(0x1f0)),_0x3eaa3a=path[_0x23dc86(0x20f)](path[_0x23dc86(0x228)](_0x447e00),_0x80b725+'.compact'+_0x6be111);fs[_0x23dc86(0x22c)](_0x3eaa3a,_0x187713,_0x23dc86(0x1f0));const _0x30ca71=Math[_0x23dc86(0x244)](_0x471ccf/0x4),_0x162256=Math[_0x23dc86(0x244)](_0x4dfe25/0x4),_0x47ffa8=Math['max'](0x0,_0x30ca71-_0x162256),_0x160fc4=_0x471ccf>0x0?Math[_0x23dc86(0x253)]((0x1-_0x4dfe25/_0x471ccf)*0x3e8)/0xa:0x0;return _0x47ffa8>0x0&&tracker_1['tracker'][_0x23dc86(0x201)]('compact:'+_0x13399a,_0x34d46e,_0x187713,_0x47ffa8,undefined,[_0x23dc86(0x1c3)+_0x13399a,'live-conv',_0x13399a,_0x23dc86(0x1a6)]),{'ok':!![],'compactPath':_0x3eaa3a,'rawBytes':_0x471ccf,'compressedBytes':_0x4dfe25,'rawTokens':_0x30ca71,'compressedTokens':_0x162256,'savedTokens':_0x47ffa8,'reductionPct':_0x160fc4};}catch(_0x299a1d){return{'ok':![],'reason':_0x299a1d?.['message']||_0x23dc86(0x1fb)};}}function compactLiveSession(_0x294cb7,_0x49cc01){const _0x516305=a0_0x19419e;try{if(!fs['existsSync'](_0x294cb7))return{'ok':![],'savedTokens':0x0,'reason':'File\x20not\x20found'};const _0x4b5028=path[_0x516305(0x252)](_0x294cb7)['toLowerCase']();if(_0x4b5028!==_0x516305(0x1d4)&&_0x4b5028!==_0x516305(0x20d)&&_0x4b5028!==_0x516305(0x229))return{'ok':![],'savedTokens':0x0,'reason':_0x516305(0x242)};const _0x3da27a=fs[_0x516305(0x19a)](_0x294cb7,_0x516305(0x1f0)),_0x4926da=Buffer[_0x516305(0x1b3)](_0x3da27a,'utf8'),_0x51a6d3=Math[_0x516305(0x244)](_0x4926da/0x4),_0x38f8e7=path[_0x516305(0x1e6)](_0x294cb7,_0x4b5028);let _0x30bd59=_0x3da27a,_0x321519=![];if(_0x4b5028===_0x516305(0x1d4)){const _0x1007e2=JSON[_0x516305(0x1e2)](_0x3da27a),_0x533f36=Array['isArray'](_0x1007e2['messages'])?_0x1007e2[_0x516305(0x195)]:Array[_0x516305(0x22a)](_0x1007e2)?_0x1007e2:null;if(_0x533f36){for(const _0x193b4d of _0x533f36){const _0xfbed88=compressMessageContent(_0x193b4d,_0x38f8e7,_0x49cc01);if(_0xfbed88['modified'])_0x321519=!![];}const {compressConversation:_0x6d04c}=require(_0x516305(0x1cb)),_0x34c091=_0x6d04c(_0x533f36,0x9c40);_0x34c091['savedTokens']>0x0&&(_0x321519=!![],Array[_0x516305(0x22a)](_0x1007e2[_0x516305(0x195)])?_0x1007e2[_0x516305(0x195)]=_0x34c091['messages']:_0x30bd59=JSON[_0x516305(0x21f)](_0x34c091[_0x516305(0x195)],null,0x2)),_0x321519&&!Array['isArray'](_0x1007e2)&&(_0x30bd59=JSON[_0x516305(0x21f)](_0x1007e2,null,0x2));}}else{const _0x58a0c3=_0x3da27a[_0x516305(0x197)]('\x0a'),_0x35b37a=[],_0xfb756d=[];for(const _0x2d9b3f of _0x58a0c3){if(!_0x2d9b3f[_0x516305(0x255)]())continue;try{const _0x29ced0=JSON[_0x516305(0x1e2)](_0x2d9b3f);_0x35b37a['push'](_0x29ced0);const _0x4d34ba=_0x29ced0[_0x516305(0x1fd)]||_0x29ced0;_0x4d34ba&&typeof _0x4d34ba['role']==='string'&&_0xfb756d[_0x516305(0x1a8)](_0x4d34ba);}catch{}}for(const _0x264867 of _0xfb756d){const _0x256893=compressMessageContent(_0x264867,_0x38f8e7,_0x49cc01);if(_0x256893[_0x516305(0x1bd)])_0x321519=!![];}const {compressConversation:_0x42eef1}=require(_0x516305(0x1cb)),_0x27f793=_0x42eef1(_0xfb756d,0x9c40);if(_0x27f793[_0x516305(0x204)]>0x0||_0x321519){const _0x71ed77=[];for(const _0x13f03d of _0x35b37a){const _0x5e308d=_0x13f03d['message']||_0x13f03d;if(_0x5e308d&&typeof _0x5e308d[_0x516305(0x1d7)]===_0x516305(0x1d2)){const _0xb12c0a=_0x27f793['messages'][_0x516305(0x1f9)](_0x2d2bbe=>_0x2d2bbe===_0x5e308d);_0xb12c0a?(_0x13f03d[_0x516305(0x1fd)]?_0x13f03d['message']=_0xb12c0a:Object[_0x516305(0x226)](_0x13f03d,_0xb12c0a),_0x71ed77['push'](JSON['stringify'](_0x13f03d))):_0x321519=!![];}else _0x71ed77['push'](JSON[_0x516305(0x21f)](_0x13f03d));}_0x30bd59=_0x71ed77[_0x516305(0x20f)]('\x0a'),_0x321519=!![];}}if(_0x321519){const _0x2cf736=Buffer[_0x516305(0x1b3)](_0x30bd59,_0x516305(0x1f0));fs[_0x516305(0x22c)](_0x294cb7,_0x30bd59,'utf8');const _0x4f2d63=Math[_0x516305(0x244)](_0x2cf736/0x4),_0x47386d=Math[_0x516305(0x216)](0x0,_0x51a6d3-_0x4f2d63);if(_0x47386d>0x0){const _0x2e8217=loadSessionsState(),_0x433b75=_0x2e8217[_0x294cb7]||{'lineCount':0x1,'activeSavedTokens':0x0,'sideCacheSaved':0x0,'officialCompactSaved':0x0,'autoCompactSaved':0x0},_0x1e3823=_0x433b75[_0x516305(0x1bf)]||0x0,_0x4318ea=_0x1e3823+_0x47386d;saveSessionStateItem(_0x294cb7,_0x433b75['lineCount'],_0x433b75[_0x516305(0x1d5)]||0x0,_0x433b75['sideCacheSaved']||0x0,_0x4318ea,_0x433b75[_0x516305(0x21e)]||0x0),tracker_1['tracker'][_0x516305(0x201)](_0x516305(0x235)+_0x49cc01,_0x3da27a,_0x30bd59,_0x47386d,undefined,[_0x516305(0x1c3)+_0x49cc01,_0x516305(0x1aa),_0x49cc01,_0x516305(0x1a6)]);}return{'ok':!![],'savedTokens':_0x47386d};}return{'ok':!![],'savedTokens':0x0};}catch(_0x2e00c7){return{'ok':![],'savedTokens':0x0,'reason':_0x2e00c7[_0x516305(0x1fd)]||'Compaction\x20failed'};}}function installWindowsStartupService(){const _0x50c7c1=a0_0x19419e;if(process[_0x50c7c1(0x213)]!=='win32')return;try{const _0x24fc87=path[_0x50c7c1(0x20f)](os[_0x50c7c1(0x1b0)](),_0x50c7c1(0x1ca),_0x50c7c1(0x21c),_0x50c7c1(0x1eb),_0x50c7c1(0x1f2),'Start\x20Menu',_0x50c7c1(0x24e),_0x50c7c1(0x23d));if(!fs[_0x50c7c1(0x1c9)](_0x24fc87))fs[_0x50c7c1(0x22b)](_0x24fc87,{'recursive':!![]});const _0x205533=path[_0x50c7c1(0x20f)](_0x24fc87,_0x50c7c1(0x1e4)),_0x435e20=path[_0x50c7c1(0x20f)](__dirname,_0x50c7c1(0x1ed)),_0x23bc8c=_0x435e20[_0x50c7c1(0x1bc)](/\\/g,'\x5c\x5c'),_0x41a010=_0x50c7c1(0x21d)+_0x23bc8c+_0x50c7c1(0x1fc);fs[_0x50c7c1(0x22c)](_0x205533,_0x41a010,'utf8');}catch{}}function startWatcherDaemon(){const _0x55b9e7=a0_0x19419e;installWindowsStartupService();try{const {installClaudeHooks:_0x47bdb0}=require(_0x55b9e7(0x1da));_0x47bdb0();}catch(_0x461317){}const _0x320dbc=[_0x55b9e7(0x206),_0x55b9e7(0x1a9),_0x55b9e7(0x218),_0x55b9e7(0x1d6),_0x55b9e7(0x1fa),_0x55b9e7(0x1b4),_0x55b9e7(0x259),_0x55b9e7(0x1a3),_0x55b9e7(0x1ac)];for(const _0x5269c2 of _0x320dbc){const _0x1c0a53=getAgentStoragePaths(_0x5269c2);for(const _0x572f8a of _0x1c0a53){if(fs[_0x55b9e7(0x1c9)](_0x572f8a))try{fs[_0x55b9e7(0x24c)](_0x572f8a,{'recursive':!![]},(_0x5bcdba,_0x4356b1)=>{const _0x481d1c=_0x55b9e7;if(!_0x4356b1)return;const _0xa6bc84=path[_0x481d1c(0x20f)](_0x572f8a,_0x4356b1);if(debounceTimers[_0x481d1c(0x20e)](_0xa6bc84))clearTimeout(debounceTimers['get'](_0xa6bc84));const _0x42419e=setTimeout(()=>processSessionFile(_0xa6bc84,_0x5269c2),0x1f4);debounceTimers[_0x481d1c(0x1c0)](_0xa6bc84,_0x42419e);});}catch{}}}setInterval(()=>{const _0x16f569=_0x55b9e7;for(const _0xb7b81c of _0x320dbc){try{const _0x10e837=getLatestSessionFile(_0xb7b81c);_0x10e837&&_0x10e837[_0x16f569(0x241)]&&processSessionFile(_0x10e837[_0x16f569(0x241)],_0xb7b81c);}catch{}}},0xbb8);const _0x1ee2ce=()=>{const _0x52873f=_0x55b9e7;for(const _0x29fd6d of _0x320dbc){try{const _0x2a431c=getLatestSessionFile(_0x29fd6d);_0x2a431c&&_0x2a431c['fullPath']&&compactLiveSession(_0x2a431c[_0x52873f(0x241)],_0x29fd6d);}catch{}}};setTimeout(_0x1ee2ce,0x7d0),setInterval(_0x1ee2ce,0x2bf20);}
|