trimprompt 1.0.32 → 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 -81
- package/mcp.js +1 -1
- package/package.json +4 -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/api-proxy.js +0 -1
- package/proxy-daemon.js +0 -1
- package/traffic-interceptor.js +0 -1
package/filters/rust.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x12cd9c=a0_0x5e77;(function(_0x37d8d8,_0x15cb32){const _0x17a5be=a0_0x5e77,_0x3ca95e=_0x37d8d8();while(!![]){try{const _0xb41385=parseInt(_0x17a5be(0x9a))/0x1+-parseInt(_0x17a5be(0x98))/0x2+-parseInt(_0x17a5be(0xc2))/0x3*(-parseInt(_0x17a5be(0xae))/0x4)+-parseInt(_0x17a5be(0xa3))/0x5+-parseInt(_0x17a5be(0xb3))/0x6+-parseInt(_0x17a5be(0x9e))/0x7*(parseInt(_0x17a5be(0xbb))/0x8)+parseInt(_0x17a5be(0xac))/0x9*(parseInt(_0x17a5be(0xb2))/0xa);if(_0xb41385===_0x15cb32)break;else _0x3ca95e['push'](_0x3ca95e['shift']());}catch(_0x475f27){_0x3ca95e['push'](_0x3ca95e['shift']());}}}(a0_0x4e9a,0x6dd0d));Object['defineProperty'](exports,a0_0x12cd9c(0xc6),{'value':!![]}),exports[a0_0x12cd9c(0xb9)]=filterCargoTest,exports[a0_0x12cd9c(0xa5)]=filterCargoBuild;function a0_0x5e77(_0x59eb47,_0x5e8fe4){_0x59eb47=_0x59eb47-0x96;const _0x4e9afe=a0_0x4e9a();let _0x5e77d=_0x4e9afe[_0x59eb47];return _0x5e77d;}function filterCargoTest(_0x45452f){const _0x53dc5b=a0_0x12cd9c,_0x4f111f=_0x45452f[_0x53dc5b(0xb6)]('\x0a');let _0x26fb1c=0x0,_0x1952f8=0x0,_0x4615ba=0x0,_0x218fc5=0x0;const _0x3e340a=[];let _0x3f0293=![],_0x4ab4d6=[];for(const _0x27ec90 of _0x4f111f){const _0xb263a1=_0x27ec90[_0x53dc5b(0xc3)](),_0x3d9b6d=_0xb263a1[_0x53dc5b(0xc4)](/test result:\s*(\w+)\.\s*(\d+)\s+passed;\s*(\d+)\s+failed;\s*(\d+)\s+ignored;\s*(\d+)\s+measured/);if(_0x3d9b6d){_0x26fb1c+=parseInt(_0x3d9b6d[0x2]),_0x1952f8+=parseInt(_0x3d9b6d[0x3]),_0x4615ba+=parseInt(_0x3d9b6d[0x4]),_0x218fc5+=parseInt(_0x3d9b6d[0x5]);continue;}if(_0xb263a1===_0x53dc5b(0xb4)||_0xb263a1==='----\x20failures\x20----'){_0x3f0293=!![];continue;}if(_0x3f0293){if(_0xb263a1[_0x53dc5b(0x99)](_0x53dc5b(0x9d))&&_0xb263a1[_0x53dc5b(0xc0)](_0x53dc5b(0xc7))){if(_0x4ab4d6[_0x53dc5b(0xbc)]>0x0)_0x3e340a[_0x53dc5b(0xc1)](_0x4ab4d6[_0x53dc5b(0xb7)]('\x0a'));_0x4ab4d6=[_0xb263a1[_0x53dc5b(0xaa)](/^-+\s*/,'')['replace'](/\s*-+$/,'')];}else{if(_0xb263a1===_0x53dc5b(0xb4)||_0xb263a1[_0x53dc5b(0x99)]('test\x20result:')){if(_0x4ab4d6[_0x53dc5b(0xbc)]>0x0)_0x3e340a[_0x53dc5b(0xc1)](_0x4ab4d6[_0x53dc5b(0xb7)]('\x0a'));_0x4ab4d6=[],_0x3f0293=![];}else _0xb263a1[_0x53dc5b(0xbc)]>0x0&&_0x4ab4d6['push'](_0x27ec90);}}}if(_0x4ab4d6[_0x53dc5b(0xbc)]>0x0)_0x3e340a[_0x53dc5b(0xc1)](_0x4ab4d6[_0x53dc5b(0xb7)]('\x0a'));if(_0x26fb1c===0x0&&_0x1952f8===0x0&&_0x4615ba===0x0){if(_0x45452f[_0x53dc5b(0xa6)](_0x53dc5b(0xab)))return'Cargo\x20test:\x20all\x20tests\x20passed';return _0x45452f;}if(_0x1952f8===0x0){const _0x1f3e0b=['Cargo\x20test:\x20'+_0x26fb1c+_0x53dc5b(0xc8)];if(_0x4615ba>0x0)_0x1f3e0b[_0x53dc5b(0xc1)](_0x4615ba+'\x20ignored');return _0x1f3e0b['join'](',\x20');}const _0x4a9dce=[_0x53dc5b(0xa9)+_0x26fb1c+_0x53dc5b(0xa7)+_0x1952f8+_0x53dc5b(0x9f)+_0x4615ba+'\x20ignored'];if(_0x3e340a[_0x53dc5b(0xbc)]>0x0){_0x4a9dce[_0x53dc5b(0xc1)](_0x53dc5b(0x96));const _0x1b92ac=0x3;for(let _0x559c94=0x0;_0x559c94<Math[_0x53dc5b(0xbf)](_0x3e340a['length'],_0x1b92ac);_0x559c94++){const _0x5a2f4c=_0x3e340a[_0x559c94][_0x53dc5b(0xb6)]('\x0a');_0x4a9dce[_0x53dc5b(0xc1)]('\x20\x20'+(_0x559c94+0x1)+'.\x20'+_0x5a2f4c[0x0]);const _0x1311b2=_0x5a2f4c[_0x53dc5b(0xb8)](0x1),_0x37a7ea=_0x1311b2[_0x53dc5b(0xa4)](_0x59c2e3=>_0x59c2e3[_0x53dc5b(0xc3)]()['startsWith'](_0x53dc5b(0xa8))||_0x59c2e3[_0x53dc5b(0xa6)]('panicked')||_0x59c2e3[_0x53dc5b(0xa6)](_0x53dc5b(0xbd))||_0x59c2e3[_0x53dc5b(0xa6)]('left:')||_0x59c2e3['includes'](_0x53dc5b(0xa2)));for(const _0x40bf10 of _0x37a7ea[_0x53dc5b(0xb8)](0x0,0x5)){_0x4a9dce[_0x53dc5b(0xc1)]('\x20\x20\x20\x20'+_0x40bf10['trim']());}}_0x3e340a['length']>_0x1b92ac&&_0x4a9dce['push'](_0x53dc5b(0xa1)+(_0x3e340a[_0x53dc5b(0xbc)]-_0x1b92ac)+_0x53dc5b(0xa0));}return _0x4a9dce[_0x53dc5b(0xb7)]('\x0a');}function filterCargoBuild(_0x319cb7){const _0xabdbb=a0_0x12cd9c,_0x44153d=_0x319cb7[_0xabdbb(0xb6)]('\x0a'),_0x9ebba=[],_0x25c6cb=[];let _0x377029=0x0;for(const _0xa76936 of _0x44153d){const _0x222fdc=_0xa76936[_0xabdbb(0xc3)]();if(_0x222fdc['startsWith'](_0xabdbb(0xc5)))_0x377029++;else{if(_0x222fdc[_0xabdbb(0x99)]('warning[')||_0x222fdc[_0xabdbb(0x99)](_0xabdbb(0xbe)))_0x9ebba['push'](_0x222fdc);else{if(_0x222fdc[_0xabdbb(0x99)](_0xabdbb(0xb1))||_0x222fdc[_0xabdbb(0x99)](_0xabdbb(0xba)))_0x25c6cb[_0xabdbb(0xc1)](_0x222fdc);}}}if(_0x25c6cb[_0xabdbb(0xbc)]===0x0&&_0x9ebba[_0xabdbb(0xbc)]===0x0)return _0x377029>0x0?_0xabdbb(0x9b)+_0x377029+_0xabdbb(0xad):_0x319cb7['trim']();const _0x3639bb=[];if(_0x25c6cb[_0xabdbb(0xbc)]>0x0){_0x3639bb['push'](_0xabdbb(0xaf)+_0x25c6cb[_0xabdbb(0xbc)]+'\x20errors,\x20'+_0x9ebba[_0xabdbb(0xbc)]+'\x20warnings'),_0x3639bb['push'](_0xabdbb(0x97));for(const _0x37d8ff of _0x25c6cb[_0xabdbb(0xb8)](0x0,0x5))_0x3639bb['push']('\x20\x20'+_0x37d8ff);if(_0x25c6cb['length']>0x5)_0x3639bb['push']('\x20\x20...\x20+'+(_0x25c6cb[_0xabdbb(0xbc)]-0x5)+_0xabdbb(0x9c));}else _0x3639bb[_0xabdbb(0xc1)](_0xabdbb(0x9b)+_0x377029+'\x20crates,\x20'+_0x9ebba[_0xabdbb(0xbc)]+_0xabdbb(0xb0));if(_0x9ebba[_0xabdbb(0xbc)]>0x0&&_0x9ebba['length']<=0x5){_0x3639bb[_0xabdbb(0xc1)](_0xabdbb(0xb5));for(const _0x5ee65d of _0x9ebba)_0x3639bb['push']('\x20\x20'+_0x5ee65d);}else _0x9ebba[_0xabdbb(0xbc)]>0x5&&_0x3639bb['push']('\x0a('+_0x9ebba[_0xabdbb(0xbc)]+'\x20warnings\x20—\x20run\x20cargo\x20clippy\x20for\x20details)');return _0x3639bb[_0xabdbb(0xb7)]('\x0a');}function a0_0x4e9a(){const _0x585339=['right:','3795765VnASss','filter','filterCargoBuild','includes','\x20passed,\x20','thread','Cargo\x20test:\x20','replace','test\x20result:\x20ok','2889IZzdaB','\x20crates\x20successfully','4gjLEHb','Cargo:\x20','\x20warnings','error[','11140iYlmmY','1302588kMaYju','failures:','\x0aWarnings:','split','join','slice','filterCargoTest','error:','1656QjFYyr','length','assert','warning:','min','endsWith','push','2091792TXEaPf','trim','match','Compiling\x20','__esModule','\x20----','\x20passed','\x0aFailures:','\x0aErrors:','606912ZRSqFD','startsWith','715847VwCPIn','Cargo:\x20compiled\x20','\x20more\x20errors','----\x20','1393mepWjs','\x20failed,\x20','\x20more\x20failures','\x20\x20...\x20+'];a0_0x4e9a=function(){return _0x585339;};return a0_0x4e9a();}
|
package/filters/shell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x1cce56=a0_0x3e23;(function(_0x32dfee,_0x474652){const _0x2a3af6=a0_0x3e23,_0x492530=_0x32dfee();while(!![]){try{const _0x2d6bf7=-parseInt(_0x2a3af6(0x11e))/0x1+-parseInt(_0x2a3af6(0x14b))/0x2*(parseInt(_0x2a3af6(0xc4))/0x3)+parseInt(_0x2a3af6(0x109))/0x4+parseInt(_0x2a3af6(0x142))/0x5+parseInt(_0x2a3af6(0x125))/0x6*(parseInt(_0x2a3af6(0xd7))/0x7)+parseInt(_0x2a3af6(0xe8))/0x8*(-parseInt(_0x2a3af6(0x10e))/0x9)+-parseInt(_0x2a3af6(0xfb))/0xa*(-parseInt(_0x2a3af6(0xc3))/0xb);if(_0x2d6bf7===_0x474652)break;else _0x492530['push'](_0x492530['shift']());}catch(_0x2fa67e){_0x492530['push'](_0x492530['shift']());}}}(a0_0x20f1,0x4e4d1));var __createBinding=this&&this[a0_0x1cce56(0xd5)]||(Object[a0_0x1cce56(0x105)]?function(_0x55118a,_0x11d2e3,_0x30b69c,_0x3ced2d){const _0x39b3b8=a0_0x1cce56;if(_0x3ced2d===undefined)_0x3ced2d=_0x30b69c;var _0x1e27a9=Object[_0x39b3b8(0xc5)](_0x11d2e3,_0x30b69c);(!_0x1e27a9||(_0x39b3b8(0xcb)in _0x1e27a9?!_0x11d2e3['__esModule']:_0x1e27a9[_0x39b3b8(0x122)]||_0x1e27a9[_0x39b3b8(0x13c)]))&&(_0x1e27a9={'enumerable':!![],'get':function(){return _0x11d2e3[_0x30b69c];}}),Object[_0x39b3b8(0x117)](_0x55118a,_0x3ced2d,_0x1e27a9);}:function(_0x4ef868,_0x386bd0,_0x41e2c0,_0x5944e4){if(_0x5944e4===undefined)_0x5944e4=_0x41e2c0;_0x4ef868[_0x5944e4]=_0x386bd0[_0x41e2c0];}),__setModuleDefault=this&&this[a0_0x1cce56(0x118)]||(Object['create']?function(_0x5001a9,_0x456331){const _0x5625e0=a0_0x1cce56;Object[_0x5625e0(0x117)](_0x5001a9,'default',{'enumerable':!![],'value':_0x456331});}:function(_0x3355ce,_0x5af9fe){_0x3355ce['default']=_0x5af9fe;}),__importStar=this&&this['__importStar']||(function(){var _0x209bab=function(_0x4ead27){return _0x209bab=Object['getOwnPropertyNames']||function(_0x6b9c81){const _0x3f16e6=a0_0x3e23;var _0x2c3ddc=[];for(var _0x399498 in _0x6b9c81)if(Object[_0x3f16e6(0x13f)][_0x3f16e6(0xc2)]['call'](_0x6b9c81,_0x399498))_0x2c3ddc[_0x2c3ddc['length']]=_0x399498;return _0x2c3ddc;},_0x209bab(_0x4ead27);};return function(_0xfc58c1){const _0x593741=a0_0x3e23;if(_0xfc58c1&&_0xfc58c1[_0x593741(0xf9)])return _0xfc58c1;var _0x266f92={};if(_0xfc58c1!=null){for(var _0x3a4e64=_0x209bab(_0xfc58c1),_0x26d648=0x0;_0x26d648<_0x3a4e64[_0x593741(0x147)];_0x26d648++)if(_0x3a4e64[_0x26d648]!=='default')__createBinding(_0x266f92,_0xfc58c1,_0x3a4e64[_0x26d648]);}return __setModuleDefault(_0x266f92,_0xfc58c1),_0x266f92;};}());Object[a0_0x1cce56(0x117)](exports,'__esModule',{'value':!![]}),exports[a0_0x1cce56(0x127)]=filterLs,exports[a0_0x1cce56(0x10c)]=filterTree,exports[a0_0x1cce56(0xd9)]=filterCat,exports[a0_0x1cce56(0x115)]=filterGrep,exports['filterFind']=filterFind;const path=__importStar(require(a0_0x1cce56(0x103))),generic_1=require('./generic'),tracker_1=require('../tracker');function isFeatureEnabled(_0x26f05c){const _0x459e36=a0_0x1cce56;try{const _0x14494f=tracker_1[_0x459e36(0x11a)][_0x459e36(0xec)](),_0x1c5cef=_0x14494f[_0x459e36(0xf8)];if(!_0x1c5cef||_0x1c5cef[_0x26f05c]===undefined)return!![];return _0x1c5cef[_0x26f05c]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x1cce56(0xf3),'yarn.lock',a0_0x1cce56(0x100),a0_0x1cce56(0x152),a0_0x1cce56(0xd3),a0_0x1cce56(0xd4),a0_0x1cce56(0x12e),a0_0x1cce56(0xfd),a0_0x1cce56(0x143)],BINARY_EXTENSIONS=[a0_0x1cce56(0x131),a0_0x1cce56(0x121),a0_0x1cce56(0xea),a0_0x1cce56(0x14e),a0_0x1cce56(0x116),'.jpg',a0_0x1cce56(0xd6),'.gif',a0_0x1cce56(0xdf),a0_0x1cce56(0xca),a0_0x1cce56(0x14c),'.svg','.pdf','.zip',a0_0x1cce56(0xe5),a0_0x1cce56(0xf1),a0_0x1cce56(0x14d),a0_0x1cce56(0x13d),a0_0x1cce56(0x155),a0_0x1cce56(0x130),a0_0x1cce56(0x154),a0_0x1cce56(0x12b),'.so','.dylib',a0_0x1cce56(0x123),a0_0x1cce56(0x110),'.sqlite',a0_0x1cce56(0xdb),a0_0x1cce56(0xcf),a0_0x1cce56(0xdd),'.woff2',a0_0x1cce56(0x12c),'.eot',a0_0x1cce56(0x12a),'.mp3',a0_0x1cce56(0x145),'.wav',a0_0x1cce56(0x104),a0_0x1cce56(0xfe),a0_0x1cce56(0x12d),a0_0x1cce56(0x124),'.pyo',a0_0x1cce56(0x158),'.o','.obj'];function extractFilename(_0x11b4c5){const _0x2015cd=a0_0x1cce56,_0x53749f=_0x11b4c5[_0x2015cd(0x10a)]()['split'](/\s+/);for(let _0x12bd90=0x1;_0x12bd90<_0x53749f[_0x2015cd(0x147)];_0x12bd90++){if(!_0x53749f[_0x12bd90]['startsWith']('-'))return _0x53749f[_0x12bd90];}return null;}function filterLockFile(_0x15ed6a,_0x277ea5){const _0x1d9b91=a0_0x1cce56;try{const _0x8433c5=path[_0x1d9b91(0x137)](_0x277ea5)[_0x1d9b91(0xcd)]();if(!LOCK_FILES[_0x1d9b91(0x126)](_0x5789b8=>_0x8433c5===_0x5789b8[_0x1d9b91(0xcd)]()))return null;const _0x181ee8=_0x15ed6a['length'];let _0x3700cb=0x0;if(_0x8433c5===_0x1d9b91(0xf3))try{const _0x4068b7=JSON[_0x1d9b91(0x153)](_0x15ed6a);_0x3700cb=Object[_0x1d9b91(0x101)](_0x4068b7[_0x1d9b91(0x151)]||_0x4068b7[_0x1d9b91(0x136)]||{})['length'];}catch{_0x3700cb=(_0x15ed6a[_0x1d9b91(0x132)](/"resolved":/g)||[])[_0x1d9b91(0x147)];}else{if(_0x8433c5===_0x1d9b91(0x119))_0x3700cb=(_0x15ed6a[_0x1d9b91(0x132)](/^"?[^#\s][^:]*:$/gm)||[])['length'];else{if(_0x8433c5===_0x1d9b91(0x159)||_0x8433c5===_0x1d9b91(0xd4))_0x3700cb=(_0x15ed6a[_0x1d9b91(0x132)](/\[\[package\]\]/g)||[])[_0x1d9b91(0x147)];else{if(_0x8433c5===_0x1d9b91(0xd3))_0x3700cb=Math[_0x1d9b91(0xf4)](_0x15ed6a[_0x1d9b91(0xe2)]('\x0a')[_0x1d9b91(0x141)](_0x7d28c3=>_0x7d28c3[_0x1d9b91(0x10a)]())[_0x1d9b91(0x147)]/0x2);else{if(_0x8433c5===_0x1d9b91(0x12e))try{_0x3700cb=JSON[_0x1d9b91(0x153)](_0x15ed6a)[_0x1d9b91(0x151)]?.[_0x1d9b91(0x147)]||0x0;}catch{}else _0x8433c5===_0x1d9b91(0x100)?_0x3700cb=(_0x15ed6a[_0x1d9b91(0x132)](/^\s{2}['"@a-z]/gm)||[])[_0x1d9b91(0x147)]:_0x3700cb=_0x15ed6a[_0x1d9b91(0xe2)]('\x0a')['filter'](_0x176dc1=>_0x176dc1['trim']())['length'];}}}}return _0x1d9b91(0x10f)+path['basename'](_0x277ea5)+':\x20'+_0x3700cb+_0x1d9b91(0x128)+_0x181ee8[_0x1d9b91(0x146)]()+_0x1d9b91(0xda);}catch{return null;}}function a0_0x3e23(_0x4beaef,_0x1468d1){const _0x20f19e=a0_0x20f1();return a0_0x3e23=function(_0x3e231e,_0x47d3e2){_0x3e231e=_0x3e231e-0xbf;let _0x42caf8=_0x20f19e[_0x3e231e];return _0x42caf8;},a0_0x3e23(_0x4beaef,_0x1468d1);}function filterBinaryOrMinified(_0x2aa3fe,_0x29502a){const _0x17f135=a0_0x1cce56;try{if(_0x29502a){const _0x742ffc=_0x29502a[_0x17f135(0xcd)]();for(const _0x6a733d of BINARY_EXTENSIONS){if(_0x742ffc[_0x17f135(0x14a)](_0x6a733d))return _0x17f135(0xc8)+path[_0x17f135(0x137)](_0x29502a)+',\x20'+_0x2aa3fe['length']['toLocaleString']()+_0x17f135(0x114)+_0x6a733d+'\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)';}}const _0x520ae2=_0x2aa3fe[_0x17f135(0x106)](0x0,0x3e8);let _0x195884=0x0;for(let _0x58370e=0x0;_0x58370e<_0x520ae2[_0x17f135(0x147)];_0x58370e++){if(_0x520ae2['charCodeAt'](_0x58370e)===0x0)_0x195884++;}if(_0x195884>0x0)return _0x17f135(0xd8)+_0x2aa3fe['length']['toLocaleString']()+_0x17f135(0x120);let _0x4cb310=0x0;for(let _0x2a85d2=0x0;_0x2a85d2<_0x520ae2[_0x17f135(0x147)];_0x2a85d2++){const _0x4fc427=_0x520ae2[_0x17f135(0x10d)](_0x2a85d2);if(_0x4fc427<0x20&&_0x4fc427!==0xa&&_0x4fc427!==0xd&&_0x4fc427!==0x9)_0x4cb310++;}if(_0x520ae2[_0x17f135(0x147)]>0x64&&_0x4cb310>_0x520ae2[_0x17f135(0x147)]*0.1)return _0x17f135(0xd8)+_0x2aa3fe[_0x17f135(0x147)][_0x17f135(0x146)]()+_0x17f135(0x138);const _0x592b46=_0x2aa3fe[_0x17f135(0xe2)]('\x0a');if(_0x592b46[_0x17f135(0x147)]<=0x3&&_0x2aa3fe[_0x17f135(0x147)]>0x1388)return'[minified\x20file]\x20'+_0x2aa3fe[_0x17f135(0x147)]['toLocaleString']()+_0x17f135(0xfa)+_0x592b46[_0x17f135(0x147)]+_0x17f135(0x139);return null;}catch{return null;}}function a0_0x20f1(){const _0x57d8dd=['.go','prototype','indexOf','filter','955375KZgTvE','bun.lockb','\x20matches\x20in\x20this\x20file)','.mp4','toLocaleString','length','\x20directories','\x20files\x20found\x20across\x20','endsWith','86vHZAhX','.webp','.gz','.wasm','stringify','\x20\x20...\x20+','packages','Cargo.lock','parse','.exe','.7z','\x20structural\x20lines\x20shown)','lock','.class','cargo.lock','collapseWhitespace','\x20more\x20files\x20with\x20matches','No\x20files\x20found','hasOwnProperty','8514sRsNtE','33807pWjsKL','getOwnPropertyDescriptor','sort','binary','[binary/minified\x20file]\x20','startsWith','.bmp','get','...\x20+','toLowerCase','.jsx','.sqlite3','.swift','\x20files)','includes','go.sum','poetry.lock','__createBinding','.jpeg','28XozTds','[binary\x20file]\x20','filterCat','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.db','.tsx','.woff','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','.ico','entries','from\x20','split','export\x20','\x0a...\x20[','.tar.gz',':\x20...\x20(','.cs','8QXqfUb','require(','.map','\x20matches\x20across\x20','getConfig','use\x20','\x20lines)','\x20more\x20files','\x0a...\x20(','.tgz','[code\x20skeleton]\x20','package-lock.json','floor','join','@param','.java','features_enabled','__esModule','\x20chars\x20across\x20','3990hoVDxv','@return','Gemfile.lock','.mov','.rs','pnpm-lock.yaml','keys','push','path','.avi','create','substring','#include\x20','json_crusher','2438852fwSnPV','trim','No\x20matches\x20found','filterTree','charCodeAt','1441197ZwicHL','[lock\x20file]\x20','.dat','\x20directories,\x20','\x20more\x20directories','skeleton','\x20chars,\x20type:\x20','filterGrep','.png','defineProperty','__setModuleDefault','yarn.lock','tracker','extname','.kt','\x20more\x20matches','225309JBHGXt','.cpp','\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)','.min.css','writable','.bin','.pyc','121674cXDhwu','some','filterLs','\x20dependencies,\x20','\x20lines\x20truncated]\x20...\x0a','.otf','.dll','.ttf','.webm','composer.lock','/\x20(','.rar','.min.js','match','import\x20','stripComments','slice','dependencies','basename','\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','.rb','smartCrushJson','configurable','.bz2'];a0_0x20f1=function(){return _0x57d8dd;};return a0_0x20f1();}function filterJsonMinify(_0xc1628e){const _0x193774=a0_0x1cce56;try{const _0x4d1573=_0xc1628e[_0x193774(0x10a)]();if(!_0x4d1573['startsWith']('{')&&!_0x4d1573[_0x193774(0xc9)]('['))return null;const _0x44a2ec=_0x4d1573[_0x193774(0xe2)]('\x0a');if(_0x44a2ec[_0x193774(0x147)]<=0x14)return null;const _0x3e6989=JSON[_0x193774(0x153)](_0x4d1573),_0xaeee0a=JSON[_0x193774(0x14f)](_0x3e6989);if(_0xaeee0a[_0x193774(0x147)]<_0x4d1573[_0x193774(0x147)])return _0xaeee0a;return null;}catch{return null;}}function filterLs(_0x16cb91){const _0x484d40=a0_0x1cce56,_0x30e324=_0x16cb91[_0x484d40(0xe2)]('\x0a')['filter'](_0x2057cc=>_0x2057cc[_0x484d40(0x10a)]()[_0x484d40(0x147)]>0x0);if(_0x30e324[_0x484d40(0x147)]===0x0)return'Empty\x20directory';if(_0x30e324[_0x484d40(0x147)]<=0x1e)return _0x16cb91[_0x484d40(0x10a)]();const _0x4641cb=[],_0x233cff=[];for(const _0xd40203 of _0x30e324){const _0x1a2532=_0xd40203[_0x484d40(0x10a)]();if(_0x1a2532['startsWith']('total\x20')||_0x1a2532[_0x484d40(0xc9)]('d')&&_0x1a2532[_0x484d40(0xd2)]('..'))continue;_0x1a2532['endsWith']('/')||_0x1a2532[_0x484d40(0xc9)]('d')&&_0x1a2532[_0x484d40(0xd2)]('\x20')?_0x4641cb[_0x484d40(0x102)](_0x1a2532):_0x233cff[_0x484d40(0x102)](_0x1a2532);}const _0x420416=[];return _0x4641cb[_0x484d40(0x147)]>0x0&&(_0x4641cb[_0x484d40(0x147)]<=0xf?_0x420416['push'](..._0x4641cb):(_0x420416['push'](..._0x4641cb[_0x484d40(0x135)](0x0,0xa)),_0x420416[_0x484d40(0x102)](_0x484d40(0xcc)+(_0x4641cb[_0x484d40(0x147)]-0xa)+_0x484d40(0x112)))),_0x233cff['length']>0x0&&(_0x233cff[_0x484d40(0x147)]<=0x14?_0x420416[_0x484d40(0x102)](..._0x233cff):(_0x420416['push'](..._0x233cff['slice'](0x0,0xf)),_0x420416[_0x484d40(0x102)]('...\x20+'+(_0x233cff[_0x484d40(0x147)]-0xf)+_0x484d40(0xef)))),_0x420416[_0x484d40(0x102)]('\x0a('+_0x4641cb[_0x484d40(0x147)]+_0x484d40(0x111)+_0x233cff['length']+_0x484d40(0xd1)),_0x420416[_0x484d40(0xf5)]('\x0a');}function filterTree(_0x16677d){const _0x387101=a0_0x1cce56,_0x5c2153=_0x16677d['split']('\x0a');if(_0x5c2153[_0x387101(0x147)]<=0x32)return _0x16677d[_0x387101(0x10a)]();const _0x23c197=[];let _0x41346a=0x0,_0x165639=0x0,_0x304fdd=0x0;for(const _0x2eb1f9 of _0x5c2153){const _0x27c324=_0x2eb1f9[_0x387101(0x132)](/(\d+)\s+director/),_0x3665e5=_0x2eb1f9['match'](/(\d+)\s+file/);if(_0x27c324)_0x304fdd=parseInt(_0x27c324[0x1]);if(_0x3665e5)_0x165639=parseInt(_0x3665e5[0x1]);const _0x2ce2e9=(_0x2eb1f9['match'](/^[│├└\s─]+/)||[''])[0x0][_0x387101(0x147)];_0x2ce2e9<=0x4&&(_0x23c197['push'](_0x2eb1f9),_0x41346a++);}return _0x5c2153['length']>_0x23c197[_0x387101(0x147)]&&_0x23c197[_0x387101(0x102)](_0x387101(0xf0)+_0x304fdd+_0x387101(0x111)+_0x165639+_0x387101(0xde)),_0x23c197[_0x387101(0xf5)]('\x0a');}function filterCat(_0x32471e,_0x43944f=''){const _0x429dea=a0_0x1cce56,_0x539212=extractFilename(_0x43944f);try{if(_0x539212&&isFeatureEnabled(_0x429dea(0x157))){const _0x269d26=filterLockFile(_0x32471e,_0x539212);if(_0x269d26)return _0x269d26;}if(isFeatureEnabled(_0x429dea(0xc7))){const _0x45bea4=filterBinaryOrMinified(_0x32471e,_0x539212);if(_0x45bea4)return _0x45bea4;}if(isFeatureEnabled(_0x429dea(0x108))){const _0x5875dc=(0x0,generic_1[_0x429dea(0x13b)])(_0x32471e);if(_0x5875dc)return _0x5875dc;}const _0x3faece=filterJsonMinify(_0x32471e);if(_0x3faece)return _0x3faece;if(_0x539212&&isFeatureEnabled(_0x429dea(0x113))){const _0xa268f7=path[_0x429dea(0x11b)](_0x539212)[_0x429dea(0xcd)](),_0x20de49=['.ts','.js',_0x429dea(0xdc),_0x429dea(0xce),'.py',_0x429dea(0x13e),_0x429dea(0xff),_0x429dea(0xf7),'.c',_0x429dea(0x11f),_0x429dea(0xe7),_0x429dea(0x13a),_0x429dea(0xd0),_0x429dea(0x11c)];if(_0x20de49[_0x429dea(0xd2)](_0xa268f7)){const _0x2e40ef=_0x32471e['split']('\x0a');if(_0x2e40ef[_0x429dea(0x147)]>0x64){const _0x2f1a4d=[];_0x2f1a4d[_0x429dea(0x102)](_0x429dea(0xf2)+path[_0x429dea(0x137)](_0x539212)+'\x20('+_0x2e40ef[_0x429dea(0x147)]+_0x429dea(0xee)),_0x2f1a4d[_0x429dea(0x102)]('');for(const _0x277dc9 of _0x2e40ef){const _0x558fd3=_0x277dc9[_0x429dea(0x10a)]();if(_0x558fd3[_0x429dea(0xc9)](_0x429dea(0x133))||_0x558fd3['startsWith'](_0x429dea(0xe1))||_0x558fd3[_0x429dea(0xc9)](_0x429dea(0xe9))||_0x558fd3[_0x429dea(0x132)](/=\s*require\(/)||_0x558fd3[_0x429dea(0xc9)](_0x429dea(0x107))||_0x558fd3['startsWith'](_0x429dea(0xed))||_0x558fd3[_0x429dea(0xc9)]('package\x20'))_0x2f1a4d[_0x429dea(0x102)](_0x277dc9);else{if(_0x558fd3[_0x429dea(0x132)](/^(export\s+)?(async\s+)?function\s+/)||_0x558fd3['match'](/^(export\s+)?(default\s+)?class\s+/)||_0x558fd3[_0x429dea(0x132)](/^(export\s+)?(type|interface|enum)\s+/)||_0x558fd3[_0x429dea(0x132)](/^(async\s+)?def\s+/)||_0x558fd3['match'](/^func\s+/)||_0x558fd3[_0x429dea(0x132)](/^type\s+\w+\s+(struct|interface)/)||_0x558fd3[_0x429dea(0x132)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x558fd3['match'](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x558fd3[_0x429dea(0x132)](/^(public|private|protected|static)\s+/))_0x2f1a4d['push'](_0x277dc9);else{if(_0x558fd3['startsWith'](_0x429dea(0xe3))&&!_0x558fd3[_0x429dea(0xd2)]('=>')&&_0x558fd3['length']<0x78)_0x2f1a4d['push'](_0x277dc9);else _0x558fd3[_0x429dea(0xc9)]('@')&&!_0x558fd3[_0x429dea(0xc9)](_0x429dea(0xf6))&&!_0x558fd3[_0x429dea(0xc9)](_0x429dea(0xfc))&&_0x2f1a4d[_0x429dea(0x102)](_0x277dc9);}}}_0x2f1a4d[_0x429dea(0x102)](''),_0x2f1a4d['push']('('+_0x2e40ef[_0x429dea(0x147)]+'\x20lines\x20total,\x20'+(_0x2f1a4d['length']-0x2)+_0x429dea(0x156));const _0x49da79=_0x2f1a4d[_0x429dea(0xf5)]('\x0a');if(_0x49da79['length']<_0x32471e[_0x429dea(0x147)])return _0x49da79;}}}}catch{}let _0x194c4a=(0x0,generic_1[_0x429dea(0xbf)])(_0x32471e);if(_0x539212){const _0xda505e=path['extname'](_0x539212)[_0x429dea(0xcd)]();_0x194c4a=(0x0,generic_1[_0x429dea(0x134)])(_0x194c4a,_0xda505e);}const _0x308a9c=_0x194c4a[_0x429dea(0xe2)]('\x0a');if(_0x308a9c[_0x429dea(0x147)]<=0x64)return _0x194c4a;const _0x3554e7=[];return _0x3554e7['push'](..._0x308a9c[_0x429dea(0x135)](0x0,0x32)),_0x3554e7[_0x429dea(0x102)](_0x429dea(0xe4)+(_0x308a9c[_0x429dea(0x147)]-0x50)+_0x429dea(0x129)),_0x3554e7[_0x429dea(0x102)](..._0x308a9c[_0x429dea(0x135)](-0x1e)),_0x3554e7['push']('\x0a('+_0x308a9c[_0x429dea(0x147)]+'\x20lines\x20total)'),_0x3554e7[_0x429dea(0xf5)]('\x0a');}function filterGrep(_0xb41253){const _0x562fe3=a0_0x1cce56,_0x3d5334=_0xb41253[_0x562fe3(0xe2)]('\x0a')[_0x562fe3(0x141)](_0x57d7a5=>_0x57d7a5[_0x562fe3(0x10a)]()[_0x562fe3(0x147)]>0x0);if(_0x3d5334[_0x562fe3(0x147)]===0x0)return _0x562fe3(0x10b);if(_0x3d5334[_0x562fe3(0x147)]<=0x32)return _0xb41253['trim']();const _0xf7a67a={},_0x17400e=[];for(const _0x4ab7c3 of _0x3d5334){const _0x51abe6=_0x4ab7c3[_0x562fe3(0x140)](':');if(_0x51abe6>0x0&&_0x51abe6<0xc8){const _0x2175f5=_0x4ab7c3[_0x562fe3(0x106)](0x0,_0x51abe6);if(_0x2175f5[_0x562fe3(0xd2)]('/')||_0x2175f5[_0x562fe3(0xd2)]('\x5c')||_0x2175f5['includes']('.')){if(!_0xf7a67a[_0x2175f5])_0xf7a67a[_0x2175f5]=[];_0xf7a67a[_0x2175f5][_0x562fe3(0x102)](_0x4ab7c3[_0x562fe3(0x106)](_0x51abe6+0x1)[_0x562fe3(0x10a)]());continue;}}_0x17400e[_0x562fe3(0x102)](_0x4ab7c3);}const _0x5edb72=[],_0x5594d3=Object[_0x562fe3(0x101)](_0xf7a67a);if(_0x5594d3['length']>0x0){const _0xe6102f=0x14,_0x1f382b=_0x5594d3[_0x562fe3(0x135)](0x0,_0xe6102f);for(const _0xe8919c of _0x1f382b){const _0xe4f0b7=_0xf7a67a[_0xe8919c];if(_0xe4f0b7[_0x562fe3(0x147)]<=0x3)for(const _0x35981b of _0xe4f0b7){_0x5edb72[_0x562fe3(0x102)](_0xe8919c+':\x20'+_0x35981b);}else _0x5edb72[_0x562fe3(0x102)](_0xe8919c+':\x20'+_0xe4f0b7[0x0]),_0x5edb72[_0x562fe3(0x102)](_0xe8919c+_0x562fe3(0xe6)+_0xe4f0b7[_0x562fe3(0x147)]+_0x562fe3(0x144));}_0x5594d3['length']>_0xe6102f&&_0x5edb72[_0x562fe3(0x102)]('...\x20+'+(_0x5594d3[_0x562fe3(0x147)]-_0xe6102f)+_0x562fe3(0xc0));}if(_0x17400e['length']>0x0){const _0x15a240=0x1e;_0x5edb72['push'](..._0x17400e[_0x562fe3(0x135)](0x0,_0x15a240)),_0x17400e[_0x562fe3(0x147)]>_0x15a240&&_0x5edb72[_0x562fe3(0x102)]('...\x20+'+(_0x17400e['length']-_0x15a240)+_0x562fe3(0x11d));}const _0x274c9f=_0x3d5334[_0x562fe3(0x147)];return _0x5edb72[_0x562fe3(0x102)]('\x0a('+_0x274c9f+_0x562fe3(0xeb)+(_0x5594d3[_0x562fe3(0x147)]||'?')+'\x20files)'),_0x5edb72['join']('\x0a');}function filterFind(_0x5120d5){const _0x144ef5=a0_0x1cce56,_0x2d90bb=_0x5120d5[_0x144ef5(0xe2)]('\x0a')['filter'](_0x325305=>_0x325305['trim']()[_0x144ef5(0x147)]>0x0);if(_0x2d90bb['length']===0x0)return _0x144ef5(0xc1);if(_0x2d90bb[_0x144ef5(0x147)]<=0x32)return _0x5120d5[_0x144ef5(0x10a)]();const _0x22600d={};for(const _0x54bdfe of _0x2d90bb){const _0x40a779=path['dirname'](_0x54bdfe['trim']())||'.';_0x22600d[_0x40a779]=(_0x22600d[_0x40a779]||0x0)+0x1;}const _0x591e4e=Object[_0x144ef5(0xe0)](_0x22600d)[_0x144ef5(0xc6)]((_0x1ce05a,_0x3ecb6f)=>_0x3ecb6f[0x1]-_0x1ce05a[0x1]),_0x55a6fd=[_0x2d90bb['length']+_0x144ef5(0x149)+_0x591e4e[_0x144ef5(0x147)]+_0x144ef5(0x148),''],_0x5e68e2=0x1e;for(const [_0x2439e3,_0x1b90ef]of _0x591e4e[_0x144ef5(0x135)](0x0,_0x5e68e2)){_0x55a6fd[_0x144ef5(0x102)]('\x20\x20'+_0x2439e3+_0x144ef5(0x12f)+_0x1b90ef+_0x144ef5(0xd1));}return _0x591e4e[_0x144ef5(0x147)]>_0x5e68e2&&_0x55a6fd[_0x144ef5(0x102)](_0x144ef5(0x150)+(_0x591e4e[_0x144ef5(0x147)]-_0x5e68e2)+_0x144ef5(0x112)),_0x55a6fd[_0x144ef5(0xf5)]('\x0a');}
|
|
1
|
+
'use strict';const a0_0x348bf5=a0_0x5374;(function(_0x3d3242,_0x468759){const _0x274e1c=a0_0x5374,_0x514059=_0x3d3242();while(!![]){try{const _0x44da2f=parseInt(_0x274e1c(0x22b))/0x1*(parseInt(_0x274e1c(0x1b8))/0x2)+-parseInt(_0x274e1c(0x1d5))/0x3+-parseInt(_0x274e1c(0x1f3))/0x4+-parseInt(_0x274e1c(0x211))/0x5*(-parseInt(_0x274e1c(0x204))/0x6)+parseInt(_0x274e1c(0x1d6))/0x7+parseInt(_0x274e1c(0x226))/0x8*(-parseInt(_0x274e1c(0x1a9))/0x9)+-parseInt(_0x274e1c(0x209))/0xa;if(_0x44da2f===_0x468759)break;else _0x514059['push'](_0x514059['shift']());}catch(_0x7e0d5d){_0x514059['push'](_0x514059['shift']());}}}(a0_0x4567,0x24f39));function a0_0x4567(){const _0x5851b5=['\x20\x20...\x20+','.otf','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','slice','filterCat','json_crusher','.tar.gz','dependencies','\x0a...\x20(','keys','.eot','.zip','.webp','.dll','startsWith','.dylib','.mp4','parse','.class','#include\x20','includes','dirname','sort','\x20directories,\x20','__esModule','length','.go','Cargo.lock','206112hGzOMM','[binary\x20file]\x20','...\x20+','.min.js','export\x20','\x0a...\x20[','filterLs','\x20files\x20found\x20across\x20','package\x20','.woff2','create','.db','.bz2','require(','features_enabled','.tgz','filter','6zrGkQn','writable','\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)','getOwnPropertyDescriptor','.sqlite3','3125160gyjLCb','./generic','.rs','pnpm-lock.yaml','.woff','.tsx','\x20chars\x20across\x20','.ts','446585jjSgpz','lock','push','\x20lines\x20total,\x20','use\x20',':\x20...\x20(','indexOf','extname','.7z','collapseWhitespace','toLocaleString','join','.js','.java','\x20structural\x20lines\x20shown)','default','@return','match','smartCrushJson','.cs','../tracker','8kHWYWt','\x20chars,\x20type:\x20','composer.lock','.bin','[lock\x20file]\x20','266833UeoHKm','.ttf','.svg','.gz','split','tracker','charCodeAt','.pdf','.map','.mp3','basename','from\x20','/\x20(','stringify','.pyo','getConfig','No\x20matches\x20found','.wav','\x20more\x20directories','import\x20','490689GXcyRW','.pyc','trim','total\x20','.wasm','hasOwnProperty','package-lock.json','.cpp','yarn.lock','stripComments','__importStar','poetry.lock','.swift','getOwnPropertyNames','defineProperty','2zMIadi','.rb','\x20more\x20files','.mov','.webm','.bmp','entries','Empty\x20directory','\x20directories','cargo.lock','.ico','some','\x20files)','toLowerCase','go.sum','.sqlite','.exe','packages','[minified\x20file]\x20','__createBinding','filterGrep','@param','.py','.rar','.png','\x20more\x20files\x20with\x20matches','.gif','filterFind','\x20lines\x20total)','256986jFnzFL','2096010obmOUY'];a0_0x4567=function(){return _0x5851b5;};return a0_0x4567();}var __createBinding=this&&this[a0_0x348bf5(0x1cb)]||(Object[a0_0x348bf5(0x1fd)]?function(_0x2103fd,_0x54ba66,_0x1affba,_0x40f0fd){const _0x4425fe=a0_0x348bf5;if(_0x40f0fd===undefined)_0x40f0fd=_0x1affba;var _0x344374=Object[_0x4425fe(0x207)](_0x54ba66,_0x1affba);(!_0x344374||('get'in _0x344374?!_0x54ba66[_0x4425fe(0x1ef)]:_0x344374[_0x4425fe(0x205)]||_0x344374['configurable']))&&(_0x344374={'enumerable':!![],'get':function(){return _0x54ba66[_0x1affba];}}),Object[_0x4425fe(0x1b7)](_0x2103fd,_0x40f0fd,_0x344374);}:function(_0x186ac8,_0x5aace4,_0x44c47b,_0x553b66){if(_0x553b66===undefined)_0x553b66=_0x44c47b;_0x186ac8[_0x553b66]=_0x5aace4[_0x44c47b];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x2abab7,_0x5c2161){const _0x13f3ab=a0_0x348bf5;Object[_0x13f3ab(0x1b7)](_0x2abab7,_0x13f3ab(0x220),{'enumerable':!![],'value':_0x5c2161});}:function(_0x41ce93,_0x321b7b){_0x41ce93['default']=_0x321b7b;}),__importStar=this&&this[a0_0x348bf5(0x1b3)]||(function(){var _0x54b26f=function(_0x3457ff){const _0x1bb7ba=a0_0x5374;return _0x54b26f=Object[_0x1bb7ba(0x1b6)]||function(_0x51c863){const _0x29cd7c=_0x1bb7ba;var _0x2c7c19=[];for(var _0x186630 in _0x51c863)if(Object['prototype'][_0x29cd7c(0x1ae)]['call'](_0x51c863,_0x186630))_0x2c7c19[_0x2c7c19[_0x29cd7c(0x1f0)]]=_0x186630;return _0x2c7c19;},_0x54b26f(_0x3457ff);};return function(_0x5e5281){const _0x2b4ee3=a0_0x5374;if(_0x5e5281&&_0x5e5281[_0x2b4ee3(0x1ef)])return _0x5e5281;var _0x5b1d5d={};if(_0x5e5281!=null){for(var _0x5daa5d=_0x54b26f(_0x5e5281),_0x4fe341=0x0;_0x4fe341<_0x5daa5d[_0x2b4ee3(0x1f0)];_0x4fe341++)if(_0x5daa5d[_0x4fe341]!=='default')__createBinding(_0x5b1d5d,_0x5e5281,_0x5daa5d[_0x4fe341]);}return __setModuleDefault(_0x5b1d5d,_0x5e5281),_0x5b1d5d;};}());Object[a0_0x348bf5(0x1b7)](exports,a0_0x348bf5(0x1ef),{'value':!![]}),exports[a0_0x348bf5(0x1f9)]=filterLs,exports['filterTree']=filterTree,exports[a0_0x348bf5(0x1db)]=filterCat,exports[a0_0x348bf5(0x1cc)]=filterGrep,exports[a0_0x348bf5(0x1d3)]=filterFind;const path=__importStar(require('path')),generic_1=require(a0_0x348bf5(0x20a)),tracker_1=require(a0_0x348bf5(0x225));function isFeatureEnabled(_0x35a505){const _0x2f1f27=a0_0x348bf5;try{const _0x46511e=tracker_1[_0x2f1f27(0x19a)][_0x2f1f27(0x1a4)](),_0x1e9137=_0x46511e[_0x2f1f27(0x201)];if(!_0x1e9137||_0x1e9137[_0x35a505]===undefined)return!![];return _0x1e9137[_0x35a505]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x348bf5(0x1af),a0_0x348bf5(0x1b1),a0_0x348bf5(0x20c),a0_0x348bf5(0x1f2),a0_0x348bf5(0x1c6),a0_0x348bf5(0x1b4),a0_0x348bf5(0x228),'Gemfile.lock','bun.lockb'],BINARY_EXTENSIONS=[a0_0x348bf5(0x1f6),'.min.css',a0_0x348bf5(0x19d),a0_0x348bf5(0x1ad),a0_0x348bf5(0x1d0),'.jpg','.jpeg',a0_0x348bf5(0x1d2),a0_0x348bf5(0x1c2),a0_0x348bf5(0x1bd),a0_0x348bf5(0x1e3),a0_0x348bf5(0x22d),a0_0x348bf5(0x19c),a0_0x348bf5(0x1e2),a0_0x348bf5(0x1dd),a0_0x348bf5(0x202),a0_0x348bf5(0x198),a0_0x348bf5(0x1ff),a0_0x348bf5(0x219),a0_0x348bf5(0x1cf),a0_0x348bf5(0x1c8),a0_0x348bf5(0x1e4),'.so',a0_0x348bf5(0x1e6),a0_0x348bf5(0x229),'.dat',a0_0x348bf5(0x1c7),a0_0x348bf5(0x1fe),a0_0x348bf5(0x208),a0_0x348bf5(0x20d),a0_0x348bf5(0x1fc),a0_0x348bf5(0x22c),a0_0x348bf5(0x1e1),a0_0x348bf5(0x1d8),a0_0x348bf5(0x19e),a0_0x348bf5(0x1e7),a0_0x348bf5(0x1a6),'.avi',a0_0x348bf5(0x1bb),a0_0x348bf5(0x1bc),a0_0x348bf5(0x1aa),a0_0x348bf5(0x1a3),a0_0x348bf5(0x1e9),'.o','.obj'];function extractFilename(_0x4a58a9){const _0x47fb21=a0_0x348bf5,_0x32bf7d=_0x4a58a9[_0x47fb21(0x1ab)]()[_0x47fb21(0x199)](/\s+/);for(let _0x236862=0x1;_0x236862<_0x32bf7d[_0x47fb21(0x1f0)];_0x236862++){if(!_0x32bf7d[_0x236862]['startsWith']('-'))return _0x32bf7d[_0x236862];}return null;}function filterLockFile(_0x2d48bc,_0x187c88){const _0x5bcf85=a0_0x348bf5;try{const _0x47ec01=path[_0x5bcf85(0x19f)](_0x187c88)['toLowerCase']();if(!LOCK_FILES[_0x5bcf85(0x1c3)](_0x221eb7=>_0x47ec01===_0x221eb7['toLowerCase']()))return null;const _0x1db99a=_0x2d48bc[_0x5bcf85(0x1f0)];let _0x38e082=0x0;if(_0x47ec01===_0x5bcf85(0x1af))try{const _0x3e1cd0=JSON[_0x5bcf85(0x1e8)](_0x2d48bc);_0x38e082=Object[_0x5bcf85(0x1e0)](_0x3e1cd0[_0x5bcf85(0x1c9)]||_0x3e1cd0[_0x5bcf85(0x1de)]||{})['length'];}catch{_0x38e082=(_0x2d48bc['match'](/"resolved":/g)||[])['length'];}else{if(_0x47ec01===_0x5bcf85(0x1b1))_0x38e082=(_0x2d48bc[_0x5bcf85(0x222)](/^"?[^#\s][^:]*:$/gm)||[])[_0x5bcf85(0x1f0)];else{if(_0x47ec01===_0x5bcf85(0x1c1)||_0x47ec01===_0x5bcf85(0x1b4))_0x38e082=(_0x2d48bc[_0x5bcf85(0x222)](/\[\[package\]\]/g)||[])[_0x5bcf85(0x1f0)];else{if(_0x47ec01==='go.sum')_0x38e082=Math['floor'](_0x2d48bc[_0x5bcf85(0x199)]('\x0a')[_0x5bcf85(0x203)](_0x69eff3=>_0x69eff3[_0x5bcf85(0x1ab)]())['length']/0x2);else{if(_0x47ec01===_0x5bcf85(0x228))try{_0x38e082=JSON['parse'](_0x2d48bc)[_0x5bcf85(0x1c9)]?.[_0x5bcf85(0x1f0)]||0x0;}catch{}else _0x47ec01===_0x5bcf85(0x20c)?_0x38e082=(_0x2d48bc[_0x5bcf85(0x222)](/^\s{2}['"@a-z]/gm)||[])[_0x5bcf85(0x1f0)]:_0x38e082=_0x2d48bc[_0x5bcf85(0x199)]('\x0a')[_0x5bcf85(0x203)](_0x52c498=>_0x52c498['trim']())[_0x5bcf85(0x1f0)];}}}}return _0x5bcf85(0x22a)+path[_0x5bcf85(0x19f)](_0x187c88)+':\x20'+_0x38e082+'\x20dependencies,\x20'+_0x1db99a[_0x5bcf85(0x21b)]()+'\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)';}catch{return null;}}function filterBinaryOrMinified(_0x1be49a,_0x1a3666){const _0x2accf5=a0_0x348bf5;try{if(_0x1a3666){const _0x3608f8=_0x1a3666[_0x2accf5(0x1c5)]();for(const _0x1e9f18 of BINARY_EXTENSIONS){if(_0x3608f8['endsWith'](_0x1e9f18))return'[binary/minified\x20file]\x20'+path[_0x2accf5(0x19f)](_0x1a3666)+',\x20'+_0x1be49a[_0x2accf5(0x1f0)][_0x2accf5(0x21b)]()+_0x2accf5(0x227)+_0x1e9f18+_0x2accf5(0x206);}}const _0x345f5a=_0x1be49a['substring'](0x0,0x3e8);let _0x47ee1a=0x0;for(let _0x34da48=0x0;_0x34da48<_0x345f5a[_0x2accf5(0x1f0)];_0x34da48++){if(_0x345f5a[_0x2accf5(0x19b)](_0x34da48)===0x0)_0x47ee1a++;}if(_0x47ee1a>0x0)return _0x2accf5(0x1f4)+_0x1be49a[_0x2accf5(0x1f0)]['toLocaleString']()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x482f3c=0x0;for(let _0x3ed9c6=0x0;_0x3ed9c6<_0x345f5a[_0x2accf5(0x1f0)];_0x3ed9c6++){const _0x125696=_0x345f5a[_0x2accf5(0x19b)](_0x3ed9c6);if(_0x125696<0x20&&_0x125696!==0xa&&_0x125696!==0xd&&_0x125696!==0x9)_0x482f3c++;}if(_0x345f5a[_0x2accf5(0x1f0)]>0x64&&_0x482f3c>_0x345f5a['length']*0.1)return _0x2accf5(0x1f4)+_0x1be49a[_0x2accf5(0x1f0)][_0x2accf5(0x21b)]()+'\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)';const _0x12dd1a=_0x1be49a['split']('\x0a');if(_0x12dd1a[_0x2accf5(0x1f0)]<=0x3&&_0x1be49a[_0x2accf5(0x1f0)]>0x1388)return _0x2accf5(0x1ca)+_0x1be49a[_0x2accf5(0x1f0)]['toLocaleString']()+_0x2accf5(0x20f)+_0x12dd1a[_0x2accf5(0x1f0)]+'\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)';return null;}catch{return null;}}function filterJsonMinify(_0x4c7be5){const _0x43df66=a0_0x348bf5;try{const _0x11c3df=_0x4c7be5[_0x43df66(0x1ab)]();if(!_0x11c3df[_0x43df66(0x1e5)]('{')&&!_0x11c3df['startsWith']('['))return null;const _0x3c0622=_0x11c3df[_0x43df66(0x199)]('\x0a');if(_0x3c0622[_0x43df66(0x1f0)]<=0x14)return null;const _0x365f31=JSON[_0x43df66(0x1e8)](_0x11c3df),_0x2b167a=JSON[_0x43df66(0x1a2)](_0x365f31);if(_0x2b167a['length']<_0x11c3df[_0x43df66(0x1f0)])return _0x2b167a;return null;}catch{return null;}}function filterLs(_0x5f2c5a){const _0x32ce9c=a0_0x348bf5,_0x1a56dc=_0x5f2c5a[_0x32ce9c(0x199)]('\x0a')[_0x32ce9c(0x203)](_0x2a0bb4=>_0x2a0bb4['trim']()['length']>0x0);if(_0x1a56dc['length']===0x0)return _0x32ce9c(0x1bf);if(_0x1a56dc[_0x32ce9c(0x1f0)]<=0x1e)return _0x5f2c5a['trim']();const _0x480f4e=[],_0x5477df=[];for(const _0x4e8953 of _0x1a56dc){const _0x2031d1=_0x4e8953['trim']();if(_0x2031d1[_0x32ce9c(0x1e5)](_0x32ce9c(0x1ac))||_0x2031d1[_0x32ce9c(0x1e5)]('d')&&_0x2031d1['includes']('..'))continue;_0x2031d1['endsWith']('/')||_0x2031d1[_0x32ce9c(0x1e5)]('d')&&_0x2031d1[_0x32ce9c(0x1eb)]('\x20')?_0x480f4e[_0x32ce9c(0x213)](_0x2031d1):_0x5477df[_0x32ce9c(0x213)](_0x2031d1);}const _0x15415a=[];return _0x480f4e[_0x32ce9c(0x1f0)]>0x0&&(_0x480f4e[_0x32ce9c(0x1f0)]<=0xf?_0x15415a[_0x32ce9c(0x213)](..._0x480f4e):(_0x15415a[_0x32ce9c(0x213)](..._0x480f4e[_0x32ce9c(0x1da)](0x0,0xa)),_0x15415a[_0x32ce9c(0x213)](_0x32ce9c(0x1f5)+(_0x480f4e[_0x32ce9c(0x1f0)]-0xa)+'\x20more\x20directories'))),_0x5477df['length']>0x0&&(_0x5477df['length']<=0x14?_0x15415a[_0x32ce9c(0x213)](..._0x5477df):(_0x15415a[_0x32ce9c(0x213)](..._0x5477df['slice'](0x0,0xf)),_0x15415a[_0x32ce9c(0x213)](_0x32ce9c(0x1f5)+(_0x5477df[_0x32ce9c(0x1f0)]-0xf)+_0x32ce9c(0x1ba)))),_0x15415a['push']('\x0a('+_0x480f4e[_0x32ce9c(0x1f0)]+_0x32ce9c(0x1ee)+_0x5477df[_0x32ce9c(0x1f0)]+_0x32ce9c(0x1c4)),_0x15415a['join']('\x0a');}function a0_0x5374(_0x2946ca,_0x199e1a){_0x2946ca=_0x2946ca-0x198;const _0x456714=a0_0x4567();let _0x5374d9=_0x456714[_0x2946ca];return _0x5374d9;}function filterTree(_0x44b707){const _0x474399=a0_0x348bf5,_0x1ae170=_0x44b707[_0x474399(0x199)]('\x0a');if(_0x1ae170['length']<=0x32)return _0x44b707[_0x474399(0x1ab)]();const _0x4571a6=[];let _0x182e8b=0x0,_0x258e6d=0x0,_0x4208e1=0x0;for(const _0x4b6c90 of _0x1ae170){const _0x478b98=_0x4b6c90[_0x474399(0x222)](/(\d+)\s+director/),_0x4018b9=_0x4b6c90[_0x474399(0x222)](/(\d+)\s+file/);if(_0x478b98)_0x4208e1=parseInt(_0x478b98[0x1]);if(_0x4018b9)_0x258e6d=parseInt(_0x4018b9[0x1]);const _0x3d8315=(_0x4b6c90[_0x474399(0x222)](/^[│├└\s─]+/)||[''])[0x0][_0x474399(0x1f0)];_0x3d8315<=0x4&&(_0x4571a6[_0x474399(0x213)](_0x4b6c90),_0x182e8b++);}return _0x1ae170[_0x474399(0x1f0)]>_0x4571a6['length']&&_0x4571a6[_0x474399(0x213)](_0x474399(0x1df)+_0x4208e1+'\x20directories,\x20'+_0x258e6d+_0x474399(0x1d9)),_0x4571a6[_0x474399(0x21c)]('\x0a');}function filterCat(_0x5cdd75,_0x4dce67=''){const _0x5857c9=a0_0x348bf5,_0x542ea1=extractFilename(_0x4dce67);try{if(_0x542ea1&&isFeatureEnabled(_0x5857c9(0x212))){const _0x4184c8=filterLockFile(_0x5cdd75,_0x542ea1);if(_0x4184c8)return _0x4184c8;}if(isFeatureEnabled('binary')){const _0x350271=filterBinaryOrMinified(_0x5cdd75,_0x542ea1);if(_0x350271)return _0x350271;}if(isFeatureEnabled(_0x5857c9(0x1dc))){const _0x590827=(0x0,generic_1[_0x5857c9(0x223)])(_0x5cdd75);if(_0x590827)return _0x590827;}const _0x30c52d=filterJsonMinify(_0x5cdd75);if(_0x30c52d)return _0x30c52d;if(_0x542ea1&&isFeatureEnabled('skeleton')){const _0x69da86=path[_0x5857c9(0x218)](_0x542ea1)[_0x5857c9(0x1c5)](),_0x31d939=[_0x5857c9(0x210),_0x5857c9(0x21d),_0x5857c9(0x20e),'.jsx',_0x5857c9(0x1ce),_0x5857c9(0x1f1),_0x5857c9(0x20b),_0x5857c9(0x21e),'.c',_0x5857c9(0x1b0),_0x5857c9(0x224),_0x5857c9(0x1b9),_0x5857c9(0x1b5),'.kt'];if(_0x31d939[_0x5857c9(0x1eb)](_0x69da86)){const _0x2c3e57=_0x5cdd75[_0x5857c9(0x199)]('\x0a');if(_0x2c3e57[_0x5857c9(0x1f0)]>0x64){const _0xf83585=[];_0xf83585['push']('[code\x20skeleton]\x20'+path[_0x5857c9(0x19f)](_0x542ea1)+'\x20('+_0x2c3e57[_0x5857c9(0x1f0)]+'\x20lines)'),_0xf83585[_0x5857c9(0x213)]('');for(const _0x2a2bd1 of _0x2c3e57){const _0x2595a3=_0x2a2bd1[_0x5857c9(0x1ab)]();if(_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x1a8))||_0x2595a3['startsWith'](_0x5857c9(0x1a0))||_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x200))||_0x2595a3[_0x5857c9(0x222)](/=\s*require\(/)||_0x2595a3['startsWith'](_0x5857c9(0x1ea))||_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x215))||_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x1fb)))_0xf83585[_0x5857c9(0x213)](_0x2a2bd1);else{if(_0x2595a3[_0x5857c9(0x222)](/^(export\s+)?(async\s+)?function\s+/)||_0x2595a3['match'](/^(export\s+)?(default\s+)?class\s+/)||_0x2595a3[_0x5857c9(0x222)](/^(export\s+)?(type|interface|enum)\s+/)||_0x2595a3[_0x5857c9(0x222)](/^(async\s+)?def\s+/)||_0x2595a3[_0x5857c9(0x222)](/^func\s+/)||_0x2595a3[_0x5857c9(0x222)](/^type\s+\w+\s+(struct|interface)/)||_0x2595a3[_0x5857c9(0x222)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x2595a3[_0x5857c9(0x222)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x2595a3[_0x5857c9(0x222)](/^(public|private|protected|static)\s+/))_0xf83585[_0x5857c9(0x213)](_0x2a2bd1);else{if(_0x2595a3['startsWith'](_0x5857c9(0x1f7))&&!_0x2595a3[_0x5857c9(0x1eb)]('=>')&&_0x2595a3[_0x5857c9(0x1f0)]<0x78)_0xf83585[_0x5857c9(0x213)](_0x2a2bd1);else _0x2595a3[_0x5857c9(0x1e5)]('@')&&!_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x1cd))&&!_0x2595a3[_0x5857c9(0x1e5)](_0x5857c9(0x221))&&_0xf83585[_0x5857c9(0x213)](_0x2a2bd1);}}}_0xf83585[_0x5857c9(0x213)](''),_0xf83585['push']('('+_0x2c3e57[_0x5857c9(0x1f0)]+_0x5857c9(0x214)+(_0xf83585[_0x5857c9(0x1f0)]-0x2)+_0x5857c9(0x21f));const _0x3e4e49=_0xf83585[_0x5857c9(0x21c)]('\x0a');if(_0x3e4e49[_0x5857c9(0x1f0)]<_0x5cdd75[_0x5857c9(0x1f0)])return _0x3e4e49;}}}}catch{}let _0x5873fd=(0x0,generic_1[_0x5857c9(0x21a)])(_0x5cdd75);if(_0x542ea1){const _0x356957=path['extname'](_0x542ea1)['toLowerCase']();_0x5873fd=(0x0,generic_1[_0x5857c9(0x1b2)])(_0x5873fd,_0x356957);}const _0x32fec0=_0x5873fd[_0x5857c9(0x199)]('\x0a');if(_0x32fec0[_0x5857c9(0x1f0)]<=0x64)return _0x5873fd;const _0x48ae23=[];return _0x48ae23[_0x5857c9(0x213)](..._0x32fec0[_0x5857c9(0x1da)](0x0,0x32)),_0x48ae23[_0x5857c9(0x213)](_0x5857c9(0x1f8)+(_0x32fec0[_0x5857c9(0x1f0)]-0x50)+'\x20lines\x20truncated]\x20...\x0a'),_0x48ae23['push'](..._0x32fec0['slice'](-0x1e)),_0x48ae23[_0x5857c9(0x213)]('\x0a('+_0x32fec0[_0x5857c9(0x1f0)]+_0x5857c9(0x1d4)),_0x48ae23[_0x5857c9(0x21c)]('\x0a');}function filterGrep(_0x34e3f1){const _0x5692b9=a0_0x348bf5,_0x35a697=_0x34e3f1[_0x5692b9(0x199)]('\x0a')['filter'](_0x405174=>_0x405174[_0x5692b9(0x1ab)]()[_0x5692b9(0x1f0)]>0x0);if(_0x35a697['length']===0x0)return _0x5692b9(0x1a5);if(_0x35a697[_0x5692b9(0x1f0)]<=0x32)return _0x34e3f1[_0x5692b9(0x1ab)]();const _0x47208f={},_0x246864=[];for(const _0xaec369 of _0x35a697){const _0x2cea7e=_0xaec369[_0x5692b9(0x217)](':');if(_0x2cea7e>0x0&&_0x2cea7e<0xc8){const _0x57a769=_0xaec369['substring'](0x0,_0x2cea7e);if(_0x57a769[_0x5692b9(0x1eb)]('/')||_0x57a769[_0x5692b9(0x1eb)]('\x5c')||_0x57a769[_0x5692b9(0x1eb)]('.')){if(!_0x47208f[_0x57a769])_0x47208f[_0x57a769]=[];_0x47208f[_0x57a769][_0x5692b9(0x213)](_0xaec369['substring'](_0x2cea7e+0x1)['trim']());continue;}}_0x246864['push'](_0xaec369);}const _0x121b20=[],_0xfe4f30=Object[_0x5692b9(0x1e0)](_0x47208f);if(_0xfe4f30['length']>0x0){const _0x7f28ee=0x14,_0x3198cb=_0xfe4f30[_0x5692b9(0x1da)](0x0,_0x7f28ee);for(const _0x5e7c0b of _0x3198cb){const _0x274274=_0x47208f[_0x5e7c0b];if(_0x274274['length']<=0x3)for(const _0x3f19f0 of _0x274274){_0x121b20['push'](_0x5e7c0b+':\x20'+_0x3f19f0);}else _0x121b20[_0x5692b9(0x213)](_0x5e7c0b+':\x20'+_0x274274[0x0]),_0x121b20['push'](_0x5e7c0b+_0x5692b9(0x216)+_0x274274['length']+'\x20matches\x20in\x20this\x20file)');}_0xfe4f30[_0x5692b9(0x1f0)]>_0x7f28ee&&_0x121b20[_0x5692b9(0x213)]('...\x20+'+(_0xfe4f30['length']-_0x7f28ee)+_0x5692b9(0x1d1));}if(_0x246864['length']>0x0){const _0x12b677=0x1e;_0x121b20[_0x5692b9(0x213)](..._0x246864['slice'](0x0,_0x12b677)),_0x246864[_0x5692b9(0x1f0)]>_0x12b677&&_0x121b20[_0x5692b9(0x213)](_0x5692b9(0x1f5)+(_0x246864[_0x5692b9(0x1f0)]-_0x12b677)+'\x20more\x20matches');}const _0x5cc953=_0x35a697[_0x5692b9(0x1f0)];return _0x121b20['push']('\x0a('+_0x5cc953+'\x20matches\x20across\x20'+(_0xfe4f30['length']||'?')+'\x20files)'),_0x121b20[_0x5692b9(0x21c)]('\x0a');}function filterFind(_0x107055){const _0xd59c9=a0_0x348bf5,_0x1d1e0f=_0x107055[_0xd59c9(0x199)]('\x0a')[_0xd59c9(0x203)](_0x13c519=>_0x13c519[_0xd59c9(0x1ab)]()['length']>0x0);if(_0x1d1e0f[_0xd59c9(0x1f0)]===0x0)return'No\x20files\x20found';if(_0x1d1e0f[_0xd59c9(0x1f0)]<=0x32)return _0x107055[_0xd59c9(0x1ab)]();const _0x566d37={};for(const _0x2c28d7 of _0x1d1e0f){const _0x4e429a=path[_0xd59c9(0x1ec)](_0x2c28d7[_0xd59c9(0x1ab)]())||'.';_0x566d37[_0x4e429a]=(_0x566d37[_0x4e429a]||0x0)+0x1;}const _0x2bd376=Object[_0xd59c9(0x1be)](_0x566d37)[_0xd59c9(0x1ed)]((_0x19ebd7,_0x293312)=>_0x293312[0x1]-_0x19ebd7[0x1]),_0x290508=[_0x1d1e0f['length']+_0xd59c9(0x1fa)+_0x2bd376[_0xd59c9(0x1f0)]+_0xd59c9(0x1c0),''],_0x35f35c=0x1e;for(const [_0x5b5453,_0x7c28e5]of _0x2bd376[_0xd59c9(0x1da)](0x0,_0x35f35c)){_0x290508[_0xd59c9(0x213)]('\x20\x20'+_0x5b5453+_0xd59c9(0x1a1)+_0x7c28e5+_0xd59c9(0x1c4));}return _0x2bd376[_0xd59c9(0x1f0)]>_0x35f35c&&_0x290508[_0xd59c9(0x213)](_0xd59c9(0x1d7)+(_0x2bd376['length']-_0x35f35c)+_0xd59c9(0x1a7)),_0x290508['join']('\x0a');}
|
package/hooks/claude-hook.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x1a8e(_0x5e0d6d,_0x51143b){var _0x1d3d98=a0_0x1d3d();return a0_0x1a8e=function(_0x1a8e14,_0xad6a94){_0x1a8e14=_0x1a8e14-0x157;var _0x34ed3b=_0x1d3d98[_0x1a8e14];return _0x34ed3b;},a0_0x1a8e(_0x5e0d6d,_0x51143b);}var a0_0x3670e6=a0_0x1a8e;(function(_0x33be57,_0x109525){var _0x5468f9=a0_0x1a8e,_0x53140a=_0x33be57();while(!![]){try{var _0x151081=parseInt(_0x5468f9(0x169))/0x1*(-parseInt(_0x5468f9(0x164))/0x2)+parseInt(_0x5468f9(0x175))/0x3*(-parseInt(_0x5468f9(0x157))/0x4)+parseInt(_0x5468f9(0x176))/0x5*(parseInt(_0x5468f9(0x16d))/0x6)+parseInt(_0x5468f9(0x158))/0x7+parseInt(_0x5468f9(0x171))/0x8*(-parseInt(_0x5468f9(0x168))/0x9)+-parseInt(_0x5468f9(0x15e))/0xa+-parseInt(_0x5468f9(0x160))/0xb*(-parseInt(_0x5468f9(0x172))/0xc);if(_0x151081===_0x109525)break;else _0x53140a['push'](_0x53140a['shift']());}catch(_0x1c4141){_0x53140a['push'](_0x53140a['shift']());}}}(a0_0x1d3d,0x5a341));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0xf47aaa,_0x25e549,_0x3fd418,_0x37628c){var _0x16fee8=a0_0x1a8e;if(_0x37628c===undefined)_0x37628c=_0x3fd418;var _0x3a10b6=Object[_0x16fee8(0x15f)](_0x25e549,_0x3fd418);(!_0x3a10b6||(_0x16fee8(0x167)in _0x3a10b6?!_0x25e549[_0x16fee8(0x177)]:_0x3a10b6[_0x16fee8(0x16e)]||_0x3a10b6[_0x16fee8(0x16c)]))&&(_0x3a10b6={'enumerable':!![],'get':function(){return _0x25e549[_0x3fd418];}}),Object[_0x16fee8(0x16f)](_0xf47aaa,_0x37628c,_0x3a10b6);}:function(_0x3e4773,_0x354e62,_0x201fe0,_0x3505e7){if(_0x3505e7===undefined)_0x3505e7=_0x201fe0;_0x3e4773[_0x3505e7]=_0x354e62[_0x201fe0];}),__setModuleDefault=this&&this[a0_0x3670e6(0x15d)]||(Object[a0_0x3670e6(0x15b)]?function(_0x128a23,_0x4b44bc){var _0xa468b2=a0_0x3670e6;Object[_0xa468b2(0x16f)](_0x128a23,'default',{'enumerable':!![],'value':_0x4b44bc});}:function(_0x28daac,_0x58fbe5){var _0x12e486=a0_0x3670e6;_0x28daac[_0x12e486(0x170)]=_0x58fbe5;}),__importStar=this&&this[a0_0x3670e6(0x165)]||(function(){var _0x314b27=function(_0x31dd43){var _0x148d3e=a0_0x1a8e;return _0x314b27=Object[_0x148d3e(0x15a)]||function(_0x48a608){var _0x490f8a=_0x148d3e,_0x4c39c2=[];for(var _0x237c03 in _0x48a608)if(Object[_0x490f8a(0x166)][_0x490f8a(0x16b)][_0x490f8a(0x16a)](_0x48a608,_0x237c03))_0x4c39c2[_0x4c39c2[_0x490f8a(0x163)]]=_0x237c03;return _0x4c39c2;},_0x314b27(_0x31dd43);};return function(_0x155d43){var _0x229d33=a0_0x1a8e;if(_0x155d43&&_0x155d43['__esModule'])return _0x155d43;var _0x4719fb={};if(_0x155d43!=null){for(var _0x4478b5=_0x314b27(_0x155d43),_0x5a20a0=0x0;_0x5a20a0<_0x4478b5[_0x229d33(0x163)];_0x5a20a0++)if(_0x4478b5[_0x5a20a0]!==_0x229d33(0x170))__createBinding(_0x4719fb,_0x155d43,_0x4478b5[_0x5a20a0]);}return __setModuleDefault(_0x4719fb,_0x155d43),_0x4719fb;};}());Object[a0_0x3670e6(0x16f)](exports,'__esModule',{'value':!![]}),exports[a0_0x3670e6(0x179)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os'));function a0_0x1d3d(){var _0xb1bf15=['mkdirSync','45rqoDuY','681095DAaDSM','__esModule','utf8','installClaudeHooks','133708DsMQQh','2139592FGgjlX','post_tool_use.js','getOwnPropertyNames','create','.claude','__setModuleDefault','3109120qBlxrq','getOwnPropertyDescriptor','11FUWiNx','homedir','join','length','832054SnSWVl','__importStar','prototype','get','9GTYomd','1Onjtpz','call','hasOwnProperty','configurable','6SxKcGB','writable','defineProperty','default','4669648wPiRYH','20875776pxsOLf','//\x20TrimPrompt\x20Native\x20PostToolUse\x20Hook\x20for\x20Claude\x20Code\x0aconst\x20fs\x20=\x20require(\x27fs\x27);\x0aconst\x20path\x20=\x20require(\x27path\x27);\x0aconst\x20os\x20=\x20require(\x27os\x27);\x0a\x0amodule.exports\x20=\x20async\x20function\x20postToolUse(event)\x20{\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20if\x20(!event\x20||\x20!event.result)\x20return\x20event;\x0a\x20\x20\x20\x20let\x20contentStr\x20=\x20typeof\x20event.result\x20===\x20\x27string\x27\x20?\x20event.result\x20:\x20JSON.stringify(event.result);\x0a\x20\x20\x20\x20if\x20(contentStr.length\x20>\x20500)\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20cacheDir\x20=\x20path.join(os.homedir(),\x20\x27.trimprompt\x27,\x20\x27cache\x27);\x0a\x20\x20\x20\x20\x20\x20if\x20(!fs.existsSync(cacheDir))\x20fs.mkdirSync(cacheDir,\x20{\x20recursive:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20const\x20chunkId\x20=\x20\x27chunk_\x27\x20+\x20Math.random().toString(36).substring(2,\x2011);\x0a\x20\x20\x20\x20\x20\x20fs.writeFileSync(path.join(cacheDir,\x20chunkId\x20+\x20\x27.json\x27),\x20JSON.stringify({\x20raw_payload:\x20contentStr,\x20timestamp:\x20new\x20Date().toISOString()\x20}));\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20snippet\x20=\x20contentStr.substring(0,\x20200).replace(/\x5cn/g,\x20\x27\x20\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20replacement\x20=\x20`>\x20[!NOTE]\x5cn>\x20**[TrimPrompt\x20Context\x20Offloaded]**\x20Raw\x20tool\x20output\x20(${contentStr.length.toLocaleString()}\x20chars)\x20side-cached\x20locally.\x5cn>\x20Preview:\x20${snippet}...\x5cn>\x20Retrieve\x20raw:\x20`trim\x20retrieve\x20${chunkId}``;\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20if\x20(typeof\x20event.result\x20===\x20\x27string\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(event.result\x20&&\x20typeof\x20event.result\x20===\x20\x27object\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result.content\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20return\x20event;\x0a};\x0a'];a0_0x1d3d=function(){return _0xb1bf15;};return a0_0x1d3d();}function installClaudeHooks(){var _0x11864d=a0_0x3670e6;try{const _0x131449=path[_0x11864d(0x162)](os[_0x11864d(0x161)](),_0x11864d(0x15c),'hooks');!fs['existsSync'](_0x131449)&&fs[_0x11864d(0x174)](_0x131449,{'recursive':!![]});const _0x2db70c=path[_0x11864d(0x162)](_0x131449,_0x11864d(0x159)),_0xa0ed3b=_0x11864d(0x173);fs['writeFileSync'](_0x2db70c,_0xa0ed3b,_0x11864d(0x178));}catch(_0x471694){}}
|
|
1
|
+
'use strict';var a0_0x3479f1=a0_0x5a07;(function(_0x1f4917,_0x1751ab){var _0x13b1fb=a0_0x5a07,_0x161237=_0x1f4917();while(!![]){try{var _0x437bb6=-parseInt(_0x13b1fb(0x11e))/0x1*(parseInt(_0x13b1fb(0x130))/0x2)+parseInt(_0x13b1fb(0x123))/0x3+parseInt(_0x13b1fb(0x121))/0x4+parseInt(_0x13b1fb(0x126))/0x5*(parseInt(_0x13b1fb(0x115))/0x6)+parseInt(_0x13b1fb(0x117))/0x7+-parseInt(_0x13b1fb(0x120))/0x8+-parseInt(_0x13b1fb(0x11c))/0x9*(parseInt(_0x13b1fb(0x112))/0xa);if(_0x437bb6===_0x1751ab)break;else _0x161237['push'](_0x161237['shift']());}catch(_0x413e03){_0x161237['push'](_0x161237['shift']());}}}(a0_0x1624,0x5add4));var __createBinding=this&&this[a0_0x3479f1(0x114)]||(Object[a0_0x3479f1(0x11d)]?function(_0x5c4fbc,_0x5aab44,_0x4a1423,_0x466dff){var _0x153bf8=a0_0x3479f1;if(_0x466dff===undefined)_0x466dff=_0x4a1423;var _0x4acefd=Object['getOwnPropertyDescriptor'](_0x5aab44,_0x4a1423);(!_0x4acefd||('get'in _0x4acefd?!_0x5aab44[_0x153bf8(0x125)]:_0x4acefd[_0x153bf8(0x11a)]||_0x4acefd[_0x153bf8(0x119)]))&&(_0x4acefd={'enumerable':!![],'get':function(){return _0x5aab44[_0x4a1423];}}),Object[_0x153bf8(0x118)](_0x5c4fbc,_0x466dff,_0x4acefd);}:function(_0x5a3c96,_0x4fae42,_0x2b172f,_0x262f21){if(_0x262f21===undefined)_0x262f21=_0x2b172f;_0x5a3c96[_0x262f21]=_0x4fae42[_0x2b172f];}),__setModuleDefault=this&&this[a0_0x3479f1(0x12e)]||(Object[a0_0x3479f1(0x11d)]?function(_0x498505,_0x5e550d){var _0xa9f05a=a0_0x3479f1;Object[_0xa9f05a(0x118)](_0x498505,_0xa9f05a(0x113),{'enumerable':!![],'value':_0x5e550d});}:function(_0x4ea14d,_0xd8cbbb){var _0x1f04ac=a0_0x3479f1;_0x4ea14d[_0x1f04ac(0x113)]=_0xd8cbbb;}),__importStar=this&&this['__importStar']||(function(){var _0x5d1b11=function(_0x163fbf){var _0x4c6bd8=a0_0x5a07;return _0x5d1b11=Object[_0x4c6bd8(0x12f)]||function(_0x426718){var _0x38c72c=_0x4c6bd8,_0x37ffd3=[];for(var _0x52c2ad in _0x426718)if(Object[_0x38c72c(0x127)][_0x38c72c(0x11f)][_0x38c72c(0x122)](_0x426718,_0x52c2ad))_0x37ffd3[_0x37ffd3['length']]=_0x52c2ad;return _0x37ffd3;},_0x5d1b11(_0x163fbf);};return function(_0x2a7fc5){var _0x572bc9=a0_0x5a07;if(_0x2a7fc5&&_0x2a7fc5[_0x572bc9(0x125)])return _0x2a7fc5;var _0x4e96f2={};if(_0x2a7fc5!=null){for(var _0x34976d=_0x5d1b11(_0x2a7fc5),_0x31d23f=0x0;_0x31d23f<_0x34976d[_0x572bc9(0x12b)];_0x31d23f++)if(_0x34976d[_0x31d23f]!==_0x572bc9(0x113))__createBinding(_0x4e96f2,_0x2a7fc5,_0x34976d[_0x31d23f]);}return __setModuleDefault(_0x4e96f2,_0x2a7fc5),_0x4e96f2;};}());Object[a0_0x3479f1(0x118)](exports,a0_0x3479f1(0x125),{'value':!![]}),exports[a0_0x3479f1(0x12a)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x3479f1(0x129))),os=__importStar(require('os'));function a0_0x5a07(_0xa1cc00,_0x38799b){_0xa1cc00=_0xa1cc00-0x111;var _0x1624db=a0_0x1624();var _0x5a075f=_0x1624db[_0xa1cc00];return _0x5a075f;}function a0_0x1624(){var _0x4d4626=['240txmSUZ','prototype','mkdirSync','path','installClaudeHooks','length','//\x20TrimPrompt\x20Native\x20PostToolUse\x20Hook\x20for\x20Claude\x20Code\x0aconst\x20fs\x20=\x20require(\x27fs\x27);\x0aconst\x20path\x20=\x20require(\x27path\x27);\x0aconst\x20os\x20=\x20require(\x27os\x27);\x0a\x0amodule.exports\x20=\x20async\x20function\x20postToolUse(event)\x20{\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20if\x20(!event\x20||\x20!event.result)\x20return\x20event;\x0a\x20\x20\x20\x20let\x20contentStr\x20=\x20typeof\x20event.result\x20===\x20\x27string\x27\x20?\x20event.result\x20:\x20JSON.stringify(event.result);\x0a\x20\x20\x20\x20if\x20(contentStr.length\x20>\x20500)\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20baseDir\x20=\x20path.join(os.homedir(),\x20\x27.trimprompt\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20cacheDir\x20=\x20path.join(baseDir,\x20\x27cache\x27);\x0a\x20\x20\x20\x20\x20\x20if\x20(!fs.existsSync(cacheDir))\x20fs.mkdirSync(cacheDir,\x20{\x20recursive:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20const\x20chunkId\x20=\x20\x27chunk_\x27\x20+\x20Math.random().toString(36).substring(2,\x2011);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20rawTokens\x20=\x20Math.ceil(contentStr.length\x20/\x204);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20snippet\x20=\x20contentStr.substring(0,\x20200).replace(/\x5cn/g,\x20\x27\x20\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20replacement\x20=\x20`>\x20[!NOTE]\x5cn>\x20**[TrimPrompt\x20Context\x20Offloaded]**\x20Raw\x20tool\x20output\x20(${contentStr.length.toLocaleString()}\x20chars)\x20side-cached\x20locally.\x5cn>\x20Preview:\x20${snippet}...\x5cn>\x20Retrieve\x20raw:\x20\x5c`trim\x20retrieve\x20${chunkId}\x5c``;\x0a\x20\x20\x20\x20\x20\x20const\x20compressedTokens\x20=\x20Math.ceil(replacement.length\x20/\x204);\x0a\x20\x20\x20\x20\x20\x20const\x20savedTokens\x20=\x20Math.max(0,\x20rawTokens\x20-\x20compressedTokens);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20fs.writeFileSync(path.join(cacheDir,\x20chunkId\x20+\x20\x27.json\x27),\x20JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20chunk_id:\x20chunkId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20raw_tokens:\x20rawTokens,\x0a\x20\x20\x20\x20\x20\x20\x20\x20compressed_tokens:\x20compressedTokens,\x0a\x20\x20\x20\x20\x20\x20\x20\x20created_at:\x20new\x20Date().toISOString(),\x0a\x20\x20\x20\x20\x20\x20\x20\x20last_accessed_at:\x20new\x20Date().toISOString(),\x0a\x20\x20\x20\x20\x20\x20\x20\x20summary:\x20`Summary:\x20Tool\x20result\x20offloaded\x20(${rawTokens}\x20tokens).`,\x0a\x20\x20\x20\x20\x20\x20\x20\x20raw_payload:\x20contentStr\x0a\x20\x20\x20\x20\x20\x20},\x20null,\x202));\x0a\x0a\x20\x20\x20\x20\x20\x20if\x20(typeof\x20event.result\x20===\x20\x27string\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(event.result\x20&&\x20typeof\x20event.result\x20===\x20\x27object\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result.content\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20Update\x20sessions_state.json\x20with\x20hook\x20savings\x0a\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20statePath\x20=\x20path.join(baseDir,\x20\x27sessions_state.json\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20state\x20=\x20{};\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(fs.existsSync(statePath))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20state\x20=\x20JSON.parse(fs.readFileSync(statePath,\x20\x27utf8\x27))\x20||\x20{};\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20Find\x20latest\x20session\x20file\x20for\x20\x27claude\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20claudeDirs\x20=\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path.join(os.homedir(),\x20\x27.claude\x27,\x20\x27projects\x27),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path.join(os.homedir(),\x20\x27.claude\x27,\x20\x27history\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20];\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20latestFullPath\x20=\x20null;\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20latestTime\x20=\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(const\x20dir\x20of\x20claudeDirs)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(fs.existsSync(dir))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20scanDir\x20=\x20(currentDir,\x20depth\x20=\x200)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(depth\x20>\x206)\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20entries\x20=\x20fs.readdirSync(currentDir,\x20{\x20withFileTypes:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for\x20(const\x20entry\x20of\x20entries)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20full\x20=\x20path.join(currentDir,\x20entry.name);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(entry.isDirectory())\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scanDir(full,\x20depth\x20+\x201);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(entry.isFile()\x20&&\x20!entry.name.startsWith(\x27.\x27))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(entry.name.endsWith(\x27.jsonl\x27)\x20||\x20entry.name.endsWith(\x27.json1\x27))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20stat\x20=\x20fs.statSync(full);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(stat.mtimeMs\x20>\x20latestTime)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20latestTime\x20=\x20stat.mtimeMs;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20latestFullPath\x20=\x20full;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scanDir(dir);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(latestFullPath)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20existing\x20=\x20state[latestFullPath]\x20||\x20{};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20prevHook\x20=\x20existing.hookSavedTokens\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20newHook\x20=\x20prevHook\x20+\x20savedTokens;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20finalOfficial\x20=\x20existing.officialCompactSaved\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20finalAuto\x20=\x20existing.autoCompactSaved\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20state[latestFullPath]\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20lineCount:\x20existing.lineCount\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20activeSavedTokens:\x20finalOfficial\x20+\x20finalAuto\x20+\x20newHook,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sideCacheSaved:\x20existing.sideCacheSaved\x20||\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20officialCompactSaved:\x20finalOfficial,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autoCompactSaved:\x20finalAuto,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hookSavedTokens:\x20newHook\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fs.writeFileSync(statePath,\x20JSON.stringify(state,\x20null,\x202),\x20\x27utf8\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20return\x20event;\x0a};\x0a','join','__setModuleDefault','getOwnPropertyNames','30hRGaeK','.claude','10gWJzEp','default','__createBinding','51924DEtpKr','existsSync','2970562mZNIlx','defineProperty','configurable','writable','homedir','1745433lpxhNg','create','12484cLwTyj','hasOwnProperty','5240032XaxdiN','591588ZwuKHR','call','1262178CHnIZW','post_tool_use.js','__esModule'];a0_0x1624=function(){return _0x4d4626;};return a0_0x1624();}function installClaudeHooks(){var _0x4b4731=a0_0x3479f1;try{const _0x561393=path[_0x4b4731(0x12d)](os[_0x4b4731(0x11b)](),_0x4b4731(0x111),'hooks');!fs[_0x4b4731(0x116)](_0x561393)&&fs[_0x4b4731(0x128)](_0x561393,{'recursive':!![]});const _0x211129=path['join'](_0x561393,_0x4b4731(0x124)),_0x4d0002=_0x4b4731(0x12c);fs['writeFileSync'](_0x211129,_0x4d0002,'utf8');}catch(_0xfa3c){}}
|
package/index.html
CHANGED
|
@@ -799,75 +799,6 @@
|
|
|
799
799
|
]},
|
|
800
800
|
];
|
|
801
801
|
|
|
802
|
-
let proxyRunning = false;
|
|
803
|
-
// Cache last-rendered proxy HTML so the periodic full rebuild of the CSA list
|
|
804
|
-
// can repaint these async-filled areas instantly instead of flashing empty.
|
|
805
|
-
let lastProxyToggleHtml = '';
|
|
806
|
-
let lastProxySavingsHtml = '';
|
|
807
|
-
|
|
808
|
-
async function updateProxyToggle() {
|
|
809
|
-
const area = document.getElementById('proxy-toggle-area');
|
|
810
|
-
if (!area) return;
|
|
811
|
-
try {
|
|
812
|
-
const resp = await fetch('/api/proxy/status');
|
|
813
|
-
const status = await resp.json();
|
|
814
|
-
proxyRunning = status.running;
|
|
815
|
-
const color = proxyRunning ? 'var(--emerald)' : '#64748B';
|
|
816
|
-
const label = proxyRunning ? `Running on port ${status.port}` : 'Stopped';
|
|
817
|
-
const html = `
|
|
818
|
-
<span style="display:inline-flex;align-items:center;gap:8px;font-family:'Inter',sans-serif;font-size:12px;font-weight:500;text-transform:none;letter-spacing:0;">
|
|
819
|
-
<span style="color:${color};">${label}</span>
|
|
820
|
-
<label class="csa-toggle" style="transform:scale(0.85);">
|
|
821
|
-
<input type="checkbox" ${proxyRunning ? 'checked' : ''} onchange="toggleProxy(this.checked)">
|
|
822
|
-
<span class="slider"></span>
|
|
823
|
-
</label>
|
|
824
|
-
</span>`;
|
|
825
|
-
// Only touch the DOM when the markup actually changed, to avoid flicker.
|
|
826
|
-
if (html !== lastProxyToggleHtml) {
|
|
827
|
-
lastProxyToggleHtml = html;
|
|
828
|
-
area.innerHTML = html;
|
|
829
|
-
}
|
|
830
|
-
} catch { }
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
async function updateProxySavings() {
|
|
834
|
-
const card = document.getElementById('proxy-savings-card');
|
|
835
|
-
if (!card) return;
|
|
836
|
-
try {
|
|
837
|
-
const model = document.getElementById('model-select').value;
|
|
838
|
-
const resp = await fetch('/api/stats/proxy-summary?model=' + encodeURIComponent(model));
|
|
839
|
-
const s = await resp.json();
|
|
840
|
-
const cell = (label, val, color) =>
|
|
841
|
-
`<div style="flex:1;text-align:center;padding:10px 6px;">
|
|
842
|
-
<div style="font-size:18px;font-weight:700;color:${color};font-family:'Inter',sans-serif;">${val}</div>
|
|
843
|
-
<div style="font-size:10px;color:#64748B;text-transform:uppercase;letter-spacing:0.5px;margin-top:2px;">${label}</div>
|
|
844
|
-
</div>`;
|
|
845
|
-
const html = `
|
|
846
|
-
<div style="display:flex;gap:8px;margin:10px 0 14px;background:rgba(127,119,221,0.06);border:1px solid rgba(127,119,221,0.18);border-radius:10px;">
|
|
847
|
-
${cell('Requests', (s.requests || 0).toLocaleString(), '#7F77DD')}
|
|
848
|
-
${cell('Tokens Saved', (s.total_tokens_saved || 0).toLocaleString(), '#10B981')}
|
|
849
|
-
${cell('Saved', '$' + (s.money_saved_usd || 0).toFixed(2), '#10B981')}
|
|
850
|
-
${cell('Reduction', (s.savings_percentage || 0) + '%', 'var(--indigo)')}
|
|
851
|
-
</div>`;
|
|
852
|
-
// Only touch the DOM when the markup actually changed, to avoid flicker.
|
|
853
|
-
if (html !== lastProxySavingsHtml) {
|
|
854
|
-
lastProxySavingsHtml = html;
|
|
855
|
-
card.innerHTML = html;
|
|
856
|
-
}
|
|
857
|
-
} catch { }
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
async function toggleProxy(enable) {
|
|
861
|
-
try {
|
|
862
|
-
if (enable) {
|
|
863
|
-
await fetch('/api/proxy/start', { method: 'POST' });
|
|
864
|
-
} else {
|
|
865
|
-
await fetch('/api/proxy/stop', { method: 'POST' });
|
|
866
|
-
}
|
|
867
|
-
setTimeout(updateProxyToggle, 500);
|
|
868
|
-
} catch {}
|
|
869
|
-
}
|
|
870
|
-
|
|
871
802
|
let csaOpen = false;
|
|
872
803
|
function toggleCsa() {
|
|
873
804
|
csaOpen = !csaOpen;
|
|
@@ -1028,10 +959,6 @@
|
|
|
1028
959
|
const totalCount = CSA_FEATURES.reduce((s, c) => s + c.features.length, 0);
|
|
1029
960
|
document.getElementById('csa-count-badge').textContent = `${activeCount}/${totalCount} active`;
|
|
1030
961
|
|
|
1031
|
-
// Proxy toggle + dedicated savings card
|
|
1032
|
-
updateProxyToggle();
|
|
1033
|
-
updateProxySavings();
|
|
1034
|
-
|
|
1035
962
|
document.getElementById('csa-summary').innerHTML = `
|
|
1036
963
|
<div class="csa-summary-card">
|
|
1037
964
|
<div class="csa-sum-label">Tokens Saved</div>
|
|
@@ -1115,7 +1042,6 @@
|
|
|
1115
1042
|
setTimeout(() => { btn.innerText = origText; btn.disabled = false; }, 2000);
|
|
1116
1043
|
loadStats();
|
|
1117
1044
|
} else {
|
|
1118
|
-
alert(res.message || 'Compaction finished');
|
|
1119
1045
|
btn.innerText = origText;
|
|
1120
1046
|
btn.disabled = false;
|
|
1121
1047
|
}
|
|
@@ -1365,7 +1291,47 @@
|
|
|
1365
1291
|
// Group logs by command name
|
|
1366
1292
|
const groups = {};
|
|
1367
1293
|
displayLogs.forEach(l => {
|
|
1368
|
-
|
|
1294
|
+
let key = l.command || 'unknown';
|
|
1295
|
+
const lowerKey = key.toLowerCase();
|
|
1296
|
+
if (
|
|
1297
|
+
lowerKey.includes('conv:') ||
|
|
1298
|
+
lowerKey.includes('compact:') ||
|
|
1299
|
+
lowerKey.includes('optimization') ||
|
|
1300
|
+
lowerKey.includes('compaction') ||
|
|
1301
|
+
lowerKey.includes('chat') ||
|
|
1302
|
+
lowerKey.includes('cache update') ||
|
|
1303
|
+
lowerKey.includes('turn') ||
|
|
1304
|
+
lowerKey.includes('message') ||
|
|
1305
|
+
lowerKey.includes('sync')
|
|
1306
|
+
) {
|
|
1307
|
+
let agent = 'claude';
|
|
1308
|
+
if (lowerKey.includes('gemini') || lowerKey.includes('antigravity')) {
|
|
1309
|
+
agent = 'gemini';
|
|
1310
|
+
} else if (lowerKey.includes('cursor')) {
|
|
1311
|
+
agent = 'cursor';
|
|
1312
|
+
} else if (lowerKey.includes('codex')) {
|
|
1313
|
+
agent = 'codex';
|
|
1314
|
+
}
|
|
1315
|
+
const capitalized = agent.charAt(0).toUpperCase() + agent.slice(1);
|
|
1316
|
+
key = capitalized;
|
|
1317
|
+
} else if (key.startsWith('antigravity-gemini-')) {
|
|
1318
|
+
const cleanKey = key.substring('antigravity-gemini-'.length);
|
|
1319
|
+
if (
|
|
1320
|
+
cleanKey.includes('compact:') ||
|
|
1321
|
+
cleanKey.includes('Compact:') ||
|
|
1322
|
+
cleanKey.includes('Optimization') ||
|
|
1323
|
+
cleanKey.includes('Compaction') ||
|
|
1324
|
+
cleanKey.includes('Chat') ||
|
|
1325
|
+
cleanKey.includes('Cache') ||
|
|
1326
|
+
cleanKey.includes('Turn') ||
|
|
1327
|
+
cleanKey.includes('Message') ||
|
|
1328
|
+
cleanKey.includes('Sync')
|
|
1329
|
+
) {
|
|
1330
|
+
key = 'Gemini';
|
|
1331
|
+
} else {
|
|
1332
|
+
key = cleanKey;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1369
1335
|
if (!groups[key]) groups[key] = [];
|
|
1370
1336
|
groups[key].push(l);
|
|
1371
1337
|
});
|
|
@@ -1385,7 +1351,7 @@
|
|
|
1385
1351
|
const latestTime = new Date(latestLog.timestamp).toLocaleTimeString();
|
|
1386
1352
|
|
|
1387
1353
|
let grpRaw = 0, grpComp = 0, grpSaved = 0, grpSecrets = 0;
|
|
1388
|
-
const isLiveConvGroup =
|
|
1354
|
+
const isLiveConvGroup = ['Claude', 'Gemini', 'Cursor', 'Codex'].includes(cmdKey) || (latestLog.features && latestLog.features.includes('live-conv'));
|
|
1389
1355
|
if (isLiveConvGroup) {
|
|
1390
1356
|
grpRaw = latestLog.estimated_raw_tokens || 0;
|
|
1391
1357
|
grpComp = latestLog.estimated_compressed_tokens || 0;
|
|
@@ -1420,7 +1386,7 @@
|
|
|
1420
1386
|
if (chev) chev.style.transform = isHidden ? 'rotate(90deg)' : 'rotate(0deg)';
|
|
1421
1387
|
};
|
|
1422
1388
|
|
|
1423
|
-
const displayCmd = formatCommandName(
|
|
1389
|
+
const displayCmd = ['Claude', 'Gemini', 'Cursor', 'Codex'].includes(cmdKey) ? cmdKey : formatCommandName(cmdKey);
|
|
1424
1390
|
|
|
1425
1391
|
trHead.innerHTML = `
|
|
1426
1392
|
<td style="font-size:12px;color:#94A3B8;white-space:nowrap;"><span id="chev-${groupId}" style="display:inline-block;transition:transform 0.2s;margin-right:6px;font-size:10px;transform:${isGroupExpanded ? 'rotate(90deg)' : 'rotate(0deg)'}">▶</span>${latestTime}</td>
|
|
@@ -1485,11 +1451,43 @@
|
|
|
1485
1451
|
|
|
1486
1452
|
function formatCommandName(cmd) {
|
|
1487
1453
|
if (!cmd) return 'unknown';
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1454
|
+
let clean = cmd;
|
|
1455
|
+
const lower = clean.toLowerCase();
|
|
1456
|
+
|
|
1457
|
+
if (
|
|
1458
|
+
lower.includes('compact:') ||
|
|
1459
|
+
lower.includes('compact') ||
|
|
1460
|
+
lower.includes('optimization') ||
|
|
1461
|
+
lower.includes('compaction') ||
|
|
1462
|
+
lower.includes('cache update') ||
|
|
1463
|
+
lower.includes('sync')
|
|
1464
|
+
) {
|
|
1465
|
+
let agent = 'claude';
|
|
1466
|
+
if (lower.includes('gemini') || lower.includes('antigravity')) agent = 'gemini';
|
|
1467
|
+
else if (lower.includes('cursor')) agent = 'cursor';
|
|
1468
|
+
else if (lower.includes('codex')) agent = 'codex';
|
|
1469
|
+
const capitalized = agent.charAt(0).toUpperCase() + agent.slice(1);
|
|
1470
|
+
return `${capitalized} Sync`;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
if (
|
|
1474
|
+
lower.includes('conv:') ||
|
|
1475
|
+
lower.includes('chat') ||
|
|
1476
|
+
lower.includes('turn') ||
|
|
1477
|
+
lower.includes('message')
|
|
1478
|
+
) {
|
|
1479
|
+
let agent = 'claude';
|
|
1480
|
+
if (lower.includes('gemini') || lower.includes('antigravity')) agent = 'gemini';
|
|
1481
|
+
else if (lower.includes('cursor')) agent = 'cursor';
|
|
1482
|
+
else if (lower.includes('codex')) agent = 'codex';
|
|
1483
|
+
const capitalized = agent.charAt(0).toUpperCase() + agent.slice(1);
|
|
1484
|
+
return `${capitalized} Message`;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
if (clean.startsWith('antigravity-gemini-')) {
|
|
1488
|
+
clean = clean.substring('antigravity-gemini-'.length);
|
|
1491
1489
|
}
|
|
1492
|
-
return
|
|
1490
|
+
return clean;
|
|
1493
1491
|
}
|
|
1494
1492
|
|
|
1495
1493
|
// Human-friendly labels for redactor rule types (see redactor.ts)
|
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x175abc=a0_0x3934;(function(_0x190c94,_0x2dbcc9){const _0x320fda=a0_0x3934,_0x496012=_0x190c94();while(!![]){try{const _0x55cf4d=-parseInt(_0x320fda(0x139))/0x1*(-parseInt(_0x320fda(0x171))/0x2)+parseInt(_0x320fda(0x169))/0x3+-parseInt(_0x320fda(0x13d))/0x4*(parseInt(_0x320fda(0x16d))/0x5)+parseInt(_0x320fda(0x177))/0x6+-parseInt(_0x320fda(0x162))/0x7*(parseInt(_0x320fda(0x15a))/0x8)+parseInt(_0x320fda(0x15d))/0x9+-parseInt(_0x320fda(0x146))/0xa;if(_0x55cf4d===_0x2dbcc9)break;else _0x496012['push'](_0x496012['shift']());}catch(_0x5e268e){_0x496012['push'](_0x496012['shift']());}}}(a0_0x26c9,0x662c7));var __createBinding=this&&this[a0_0x175abc(0x163)]||(Object[a0_0x175abc(0x16e)]?function(_0x408fa7,_0x26f077,_0x2cf5dd,_0x380626){const _0x288eec=a0_0x175abc;if(_0x380626===undefined)_0x380626=_0x2cf5dd;var _0x228f4b=Object[_0x288eec(0x172)](_0x26f077,_0x2cf5dd);(!_0x228f4b||(_0x288eec(0x14c)in _0x228f4b?!_0x26f077['__esModule']:_0x228f4b[_0x288eec(0x160)]||_0x228f4b[_0x288eec(0x13b)]))&&(_0x228f4b={'enumerable':!![],'get':function(){return _0x26f077[_0x2cf5dd];}}),Object[_0x288eec(0x16c)](_0x408fa7,_0x380626,_0x228f4b);}:function(_0x32d6a9,_0x5250dd,_0xa8687f,_0x1c3060){if(_0x1c3060===undefined)_0x1c3060=_0xa8687f;_0x32d6a9[_0x1c3060]=_0x5250dd[_0xa8687f];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x2d1714,_0x4441b8){const _0xe5bda3=a0_0x175abc;Object[_0xe5bda3(0x16c)](_0x2d1714,_0xe5bda3(0x151),{'enumerable':!![],'value':_0x4441b8});}:function(_0x5cdd1a,_0x5cc24f){const _0x4e26cd=a0_0x175abc;_0x5cdd1a[_0x4e26cd(0x151)]=_0x5cc24f;}),__importStar=this&&this[a0_0x175abc(0x16b)]||(function(){var _0x5dfc95=function(_0x148004){const _0x10a53e=a0_0x3934;return _0x5dfc95=Object[_0x10a53e(0x158)]||function(_0x13266d){const _0x4593e9=_0x10a53e;var _0x2479b8=[];for(var _0x3fe727 in _0x13266d)if(Object['prototype'][_0x4593e9(0x13e)][_0x4593e9(0x14e)](_0x13266d,_0x3fe727))_0x2479b8[_0x2479b8[_0x4593e9(0x174)]]=_0x3fe727;return _0x2479b8;},_0x5dfc95(_0x148004);};return function(_0x562433){const _0x30b8ae=a0_0x3934;if(_0x562433&&_0x562433[_0x30b8ae(0x159)])return _0x562433;var _0x2d1828={};if(_0x562433!=null){for(var _0x55f891=_0x5dfc95(_0x562433),_0x1207b6=0x0;_0x1207b6<_0x55f891[_0x30b8ae(0x174)];_0x1207b6++)if(_0x55f891[_0x1207b6]!=='default')__createBinding(_0x2d1828,_0x562433,_0x55f891[_0x1207b6]);}return __setModuleDefault(_0x2d1828,_0x562433),_0x2d1828;};}());Object[a0_0x175abc(0x16c)](exports,a0_0x175abc(0x159),{'value':!![]}),exports[a0_0x175abc(0x15c)]=runMcpProxy;function a0_0x3934(_0x1786c7,_0xb33b25){_0x1786c7=_0x1786c7-0x139;const _0x26c9ab=a0_0x26c9();let _0x3934c5=_0x26c9ab[_0x1786c7];return _0x3934c5;}function a0_0x26c9(){const _0x31ae29=['4049658hBSVwz','child_process','jsonrpc','createInterface','pipe','logExecution','21071XLXWZo','complexity','configurable','trim','32ZKWZdV','hasOwnProperty','content','stdin','exit','resp_optimize','redaction_enabled','conv_compress','./filters','6750580uRJVsx','max_tokens','end','messages','spawn','max_tokens:\x20','get','savedTokens','call','mcp\x20tool\x20(id:\x20','string','default','text','trimmedCount','message','params','mcp-tool-call','\x20messages\x20(','getOwnPropertyNames','__esModule','29304ZgWxnp','error','runMcpProxy','6178203tQRDIA','optimizeMaxTokens','compressConversation','writable','\x20messages','56iXlHDA','__createBinding','result','parse','write','close','line','1367664pZanxN','type','__importStar','defineProperty','447190PgPOoI','create','stringify','stdout','2GAMdka','getOwnPropertyDescriptor','tracker','length','isArray','readline'];a0_0x26c9=function(){return _0x31ae29;};return a0_0x26c9();}const child_process_1=require(a0_0x175abc(0x178)),readline=__importStar(require(a0_0x175abc(0x176))),filters_1=require(a0_0x175abc(0x145)),tracker_1=require('./tracker'),proxy_conv_1=require('./proxy-conv'),proxy_resp_1=require('./proxy-resp');function runMcpProxy(_0x5facab,_0x458771){const _0x4a5acb=a0_0x175abc,_0x5896c5=(0x0,child_process_1[_0x4a5acb(0x14a)])(_0x5facab,_0x458771,{'stdio':[_0x4a5acb(0x17b),_0x4a5acb(0x17b),'inherit']}),_0x2cffe2=tracker_1[_0x4a5acb(0x173)]['getConfig'](),_0x815461=_0x2cffe2['features_enabled']||{},_0x231be8=_0x815461[_0x4a5acb(0x144)]!==![],_0x2d8f59=_0x815461[_0x4a5acb(0x142)]!==![],_0x1fdc21=readline[_0x4a5acb(0x17a)]({'input':process[_0x4a5acb(0x140)],'terminal':![]});_0x1fdc21['on']('line',_0x4e2fce=>{const _0xc180e4=_0x4a5acb;try{const _0x571767=JSON['parse'](_0x4e2fce);if(_0x571767&&_0x571767[_0xc180e4(0x179)]==='2.0'&&_0x571767['method']&&_0x571767[_0xc180e4(0x155)]){const _0x493a1a=_0x571767[_0xc180e4(0x155)];if(Array['isArray'](_0x493a1a[_0xc180e4(0x149)])&&_0x493a1a[_0xc180e4(0x149)][_0xc180e4(0x174)]>0x0){if(_0x231be8){const _0x1bbe29=(0x0,proxy_conv_1[_0xc180e4(0x15f)])(_0x493a1a[_0xc180e4(0x149)]);(_0x1bbe29[_0xc180e4(0x153)]>0x0||_0x1bbe29['savedTokens']>0x0)&&(_0x493a1a[_0xc180e4(0x149)]=_0x1bbe29[_0xc180e4(0x149)],tracker_1[_0xc180e4(0x173)][_0xc180e4(0x17c)]('proxy:conv-compress',_0x1bbe29[_0xc180e4(0x153)]+_0x1bbe29[_0xc180e4(0x149)][_0xc180e4(0x174)]+_0xc180e4(0x161),_0x1bbe29[_0xc180e4(0x149)][_0xc180e4(0x174)]+_0xc180e4(0x157)+_0x1bbe29['trimmedCount']+'\x20trimmed,\x20~'+_0x1bbe29[_0xc180e4(0x14d)]+'\x20tokens\x20saved)',0x0,undefined,[_0xc180e4(0x144)]));}if(_0x2d8f59){const _0x37992e=(0x0,proxy_resp_1[_0xc180e4(0x15e)])(_0x493a1a[_0xc180e4(0x149)],_0x493a1a['max_tokens']);if(_0x37992e){const _0x554f45=_0x493a1a[_0xc180e4(0x147)]||_0xc180e4(0x151);_0x493a1a[_0xc180e4(0x147)]=_0x37992e['max_tokens'],tracker_1['tracker'][_0xc180e4(0x17c)]('proxy:resp-optimize',_0xc180e4(0x14b)+_0x554f45,_0xc180e4(0x14b)+_0x37992e[_0xc180e4(0x147)]+'\x20('+_0x37992e[_0xc180e4(0x13a)]+')',0x0,undefined,[_0xc180e4(0x142)]);}}}_0x5896c5[_0xc180e4(0x140)][_0xc180e4(0x166)](JSON[_0xc180e4(0x16f)](_0x571767)+'\x0a');}else _0x5896c5[_0xc180e4(0x140)][_0xc180e4(0x166)](_0x4e2fce+'\x0a');}catch{_0x5896c5[_0xc180e4(0x140)][_0xc180e4(0x166)](_0x4e2fce+'\x0a');}}),_0x1fdc21['on'](_0x4a5acb(0x167),()=>{const _0xba819f=_0x4a5acb;try{_0x5896c5['stdin'][_0xba819f(0x148)]();}catch{}});const _0x172ade=readline[_0x4a5acb(0x17a)]({'input':_0x5896c5[_0x4a5acb(0x170)],'terminal':![]});_0x172ade['on'](_0x4a5acb(0x168),_0x5840aa=>{const _0x2f92f3=_0x4a5acb;try{const _0x1d4021=JSON[_0x2f92f3(0x165)](_0x5840aa);if(_0x1d4021&&_0x1d4021[_0x2f92f3(0x179)]==='2.0'&&_0x1d4021['id']!==undefined&&_0x1d4021[_0x2f92f3(0x164)]&&Array[_0x2f92f3(0x175)](_0x1d4021[_0x2f92f3(0x164)][_0x2f92f3(0x13f)])){let _0x3bd0ec=![];for(const _0x22db16 of _0x1d4021[_0x2f92f3(0x164)]['content']){if(_0x22db16[_0x2f92f3(0x16a)]==='text'&&typeof _0x22db16[_0x2f92f3(0x152)]===_0x2f92f3(0x150)&&_0x22db16[_0x2f92f3(0x152)][_0x2f92f3(0x13c)]()['length']>0x0){const _0x40fcd1=_0x22db16[_0x2f92f3(0x152)],_0x479074=(0x0,filters_1['compressOutput'])(_0x2f92f3(0x156),_0x40fcd1,'',tracker_1[_0x2f92f3(0x173)]['getConfig']()[_0x2f92f3(0x143)]);tracker_1[_0x2f92f3(0x173)]['logExecution'](_0x2f92f3(0x14f)+_0x1d4021['id']+')',_0x40fcd1,_0x479074,0x0),_0x22db16['text']=_0x479074,_0x3bd0ec=!![];}}_0x3bd0ec?process[_0x2f92f3(0x170)]['write'](JSON[_0x2f92f3(0x16f)](_0x1d4021)+'\x0a'):process[_0x2f92f3(0x170)][_0x2f92f3(0x166)](_0x5840aa+'\x0a');}else process[_0x2f92f3(0x170)][_0x2f92f3(0x166)](_0x5840aa+'\x0a');}catch{process[_0x2f92f3(0x170)][_0x2f92f3(0x166)](_0x5840aa+'\x0a');}}),_0x5896c5['on']('close',_0x17d4b5=>{process['exit'](_0x17d4b5||0x0);}),_0x5896c5['on'](_0x4a5acb(0x15b),_0x14f590=>{const _0x3b3851=_0x4a5acb;console[_0x3b3851(0x15b)]('[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20'+_0x14f590[_0x3b3851(0x154)]),process[_0x3b3851(0x141)](0x1);});}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimprompt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "TrimPrompt — Save 80% on LLM tokens. Zero-config CLI proxy for AI coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm",
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"trim": "cli.js"
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://trimprompt.ai",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"postinstall": "node cli.js shims install || true"
|
|
29
|
+
},
|
|
27
30
|
"dependencies": {
|
|
28
31
|
"commander": "^11.1.0",
|
|
29
32
|
"express": "^4.18.2",
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x325080=a0_0x1767;(function(_0x58a71a,_0x2c5133){const _0x5798b8=a0_0x1767,_0x4c6143=_0x58a71a();while(!![]){try{const _0x470db7=-parseInt(_0x5798b8(0x1af))/0x1*(parseInt(_0x5798b8(0x1d8))/0x2)+parseInt(_0x5798b8(0x1d7))/0x3*(-parseInt(_0x5798b8(0x1bd))/0x4)+-parseInt(_0x5798b8(0x1c4))/0x5*(parseInt(_0x5798b8(0x1d3))/0x6)+-parseInt(_0x5798b8(0x1b9))/0x7*(parseInt(_0x5798b8(0x1bf))/0x8)+-parseInt(_0x5798b8(0x1b8))/0x9+parseInt(_0x5798b8(0x1b3))/0xa*(-parseInt(_0x5798b8(0x1b5))/0xb)+parseInt(_0x5798b8(0x1be))/0xc;if(_0x470db7===_0x2c5133)break;else _0x4c6143['push'](_0x4c6143['shift']());}catch(_0x570d7d){_0x4c6143['push'](_0x4c6143['shift']());}}}(a0_0x354f,0x751e1));Object[a0_0x325080(0x1bc)](exports,a0_0x325080(0x1c0),{'value':!![]}),exports[a0_0x325080(0x1d0)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function a0_0x1767(_0x5f1f5f,_0x3bbfa6){_0x5f1f5f=_0x5f1f5f-0x1af;const _0x354fe3=a0_0x354f();let _0x1767b7=_0x354fe3[_0x5f1f5f];return _0x1767b7;}function estimateTokens(_0x47ec2b){const _0x474f0f=a0_0x325080;return Math[_0x474f0f(0x1c7)](_0x47ec2b['length']/0x4);}function blockText(_0x52fc22){const _0x3d9d5d=a0_0x325080;if(!_0x52fc22||typeof _0x52fc22!==_0x3d9d5d(0x1c2))return'';if(_0x52fc22[_0x3d9d5d(0x1d4)]===_0x3d9d5d(0x1ca)&&typeof _0x52fc22[_0x3d9d5d(0x1ca)]==='string')return _0x52fc22['text'];if(_0x52fc22[_0x3d9d5d(0x1d4)]==='tool_result'){if(typeof _0x52fc22['content']===_0x3d9d5d(0x1cf))return _0x52fc22[_0x3d9d5d(0x1cb)];if(Array[_0x3d9d5d(0x1cc)](_0x52fc22['content']))return _0x52fc22[_0x3d9d5d(0x1cb)]['map'](blockText)['filter'](Boolean)[_0x3d9d5d(0x1c6)]('\x0a');}return'';}function messageText(_0xeefd24){const _0xd41fc2=a0_0x325080;if(typeof _0xeefd24[_0xd41fc2(0x1cb)]==='string')return _0xeefd24[_0xd41fc2(0x1cb)];if(Array[_0xd41fc2(0x1cc)](_0xeefd24[_0xd41fc2(0x1cb)]))return _0xeefd24[_0xd41fc2(0x1cb)][_0xd41fc2(0x1b1)](blockText)['filter'](Boolean)['join']('\x0a');return'';}function summarizeText(_0x166906){const _0x37c22d=a0_0x325080,_0xe8b519=estimateTokens(_0x166906),_0x5d6e96=_0x166906['split']('\x0a');if(_0xe8b519>0x7d0){if(_0x5d6e96[_0x37c22d(0x1b7)]>0xa){const _0x23421f=_0x5d6e96[_0x37c22d(0x1c9)](0x0,0x5)['join']('\x0a'),_0x2c62e8=_0x5d6e96[_0x37c22d(0x1c9)](-0x5)[_0x37c22d(0x1c6)]('\x0a');return _0x23421f+'\x0a[...\x20'+(_0x5d6e96['length']-0xa)+_0x37c22d(0x1c1)+_0x2c62e8;}return _0x166906[_0x37c22d(0x1c9)](0x0,0x7d0)+('\x0a[...\x20'+(_0x166906['length']-0x7d0)+_0x37c22d(0x1d1));}if(_0xe8b519>0x1f4){if(_0x5d6e96['length']>0xa)return _0x5d6e96['slice'](0x0,0xa)[_0x37c22d(0x1c6)]('\x0a')+(_0x37c22d(0x1b4)+(_0x5d6e96[_0x37c22d(0x1b7)]-0xa)+'\x20lines\x20trimmed\x20...]');return _0x166906[_0x37c22d(0x1c9)](0x0,0x320)+(_0x37c22d(0x1b4)+(_0x166906[_0x37c22d(0x1b7)]-0x320)+_0x37c22d(0x1b2));}return _0x166906;}function summarizeBlock(_0x1d55ee){const _0x350997=a0_0x325080;if(!_0x1d55ee||typeof _0x1d55ee!==_0x350997(0x1c2))return _0x1d55ee;if(_0x1d55ee['type']==='text'&&typeof _0x1d55ee[_0x350997(0x1ca)]==='string')return{..._0x1d55ee,'text':summarizeText(_0x1d55ee[_0x350997(0x1ca)])};if(_0x1d55ee['type']===_0x350997(0x1d6)){if(typeof _0x1d55ee[_0x350997(0x1cb)]===_0x350997(0x1cf))return{..._0x1d55ee,'content':summarizeText(_0x1d55ee['content'])};if(Array[_0x350997(0x1cc)](_0x1d55ee[_0x350997(0x1cb)])){const _0x1aea58=largestBlockIndex(_0x1d55ee[_0x350997(0x1cb)]);if(_0x1aea58>=0x0){const _0x5505df=_0x1d55ee[_0x350997(0x1cb)][_0x350997(0x1b1)]((_0x3cac96,_0x5f0588)=>_0x5f0588===_0x1aea58?summarizeBlock(_0x3cac96):_0x3cac96);return{..._0x1d55ee,'content':_0x5505df};}}}return _0x1d55ee;}function largestBlockIndex(_0x131312){const _0x3636d4=a0_0x325080;let _0x17473e=-0x1,_0x5d6eaf=-0x1;return _0x131312[_0x3636d4(0x1ba)]((_0x13d6e5,_0x5b13a0)=>{const _0x95773e=_0x3636d4,_0x22afae=blockText(_0x13d6e5)[_0x95773e(0x1b7)];_0x22afae>_0x5d6eaf&&(_0x5d6eaf=_0x22afae,_0x17473e=_0x5b13a0);}),_0x5d6eaf>0x0?_0x17473e:-0x1;}function scoreMessage(_0x47530c,_0x1cfed6,_0x47c168){const _0x2771cf=ROLE_WEIGHT[_0x47530c['role']]||0.4,_0x56f177=(_0x1cfed6+0x1)/_0x47c168,_0x1f25ce=messageText(_0x47530c),_0x18e10a=estimateTokens(_0x1f25ce),_0x56f3df=_0x18e10a>0x7d0?0.6:_0x18e10a>0x1f4?0.8:0x1;return _0x2771cf*(0.3+0.7*_0x56f177)*_0x56f3df;}function a0_0x354f(){const _0x41d371=['6dspLVG','type','msg','tool_result','266496POpbvr','10THtDpE','sort','176327XYroWg','score','map','\x20chars\x20trimmed\x20...]','40yKECiR','\x0a[...\x20','476179mNMbmM','reduce','length','7265070tMBaJT','237027NSwPdk','forEach','role','defineProperty','28wkryUq','43614456bdBUaX','8TYYFbz','__esModule','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','object','tokens','3185595NPVvSh','system','join','ceil','filter','slice','text','content','isArray','originalIndex','push','string','compressConversation','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','indexOf'];a0_0x354f=function(){return _0x41d371;};return a0_0x354f();}function summarizeMessage(_0x476082){const _0x4afcad=a0_0x325080,_0x1aa184=estimateTokens(messageText(_0x476082));if(_0x1aa184<=0x1f4)return _0x476082;if(typeof _0x476082['content']===_0x4afcad(0x1cf))return{..._0x476082,'content':summarizeText(_0x476082[_0x4afcad(0x1cb)])};if(Array[_0x4afcad(0x1cc)](_0x476082[_0x4afcad(0x1cb)])){const _0x2112f2=largestBlockIndex(_0x476082['content']);if(_0x2112f2>=0x0){const _0x3d1274=_0x476082[_0x4afcad(0x1cb)][_0x4afcad(0x1b1)]((_0x1a4ad3,_0x1dc066)=>_0x1dc066===_0x2112f2?summarizeBlock(_0x1a4ad3):_0x1a4ad3);return{..._0x476082,'content':_0x3d1274};}}return _0x476082;}function compressConversation(_0xd175b9,_0x82292e){const _0x5a6241=a0_0x325080,_0x32d6be={'messages':_0xd175b9,'trimmedCount':0x0,'savedTokens':0x0};if(!_0xd175b9||!Array['isArray'](_0xd175b9)||_0xd175b9[_0x5a6241(0x1b7)]<=0x6)return _0x32d6be;try{return _compressConversation(_0xd175b9,_0x82292e);}catch{return _0x32d6be;}}function _compressConversation(_0x2e9600,_0x4dc8b0){const _0xda2a9e=a0_0x325080,_0x3178cc=_0x4dc8b0||0x13880,_0x10d067=0x4,_0x34787b=_0x2e9600[_0xda2a9e(0x1c8)](_0x22447c=>_0x22447c[_0xda2a9e(0x1bb)]===_0xda2a9e(0x1c5)),_0x5ebf5a=_0x2e9600['filter'](_0x3b419b=>_0x3b419b[_0xda2a9e(0x1bb)]!==_0xda2a9e(0x1c5)),_0xe218b6=_0x5ebf5a['slice'](-_0x10d067),_0x1d7195=_0x5ebf5a['slice'](0x0,-_0x10d067),_0xcba7d9=_0x1d7195[_0xda2a9e(0x1b1)]((_0x35d2e5,_0x863473)=>({'msg':_0x35d2e5,'score':scoreMessage(_0x35d2e5,_0x863473,_0x1d7195['length']),'tokens':estimateTokens(messageText(_0x35d2e5))})),_0x35b05e=_0xcba7d9[_0xda2a9e(0x1b6)]((_0x1d7a3d,_0x1bf766)=>_0x1d7a3d+_0x1bf766[_0xda2a9e(0x1c3)],0x0),_0xc410d7=_0xe218b6[_0xda2a9e(0x1b6)]((_0x2aae97,_0x1873f0)=>_0x2aae97+estimateTokens(messageText(_0x1873f0)),0x0),_0x1ac65c=_0x34787b[_0xda2a9e(0x1b6)]((_0x368c68,_0x44a031)=>_0x368c68+estimateTokens(messageText(_0x44a031)),0x0),_0x4a660b=_0x3178cc-_0xc410d7-_0x1ac65c;if(_0x35b05e<=_0x4a660b){let _0x19c5c9=0x0;const _0x515fae=_0xcba7d9[_0xda2a9e(0x1b1)](_0x4df692=>{const _0x355251=_0xda2a9e;if(_0x4df692['tokens']>0x1f4){const _0x14a8be=summarizeMessage(_0x4df692[_0x355251(0x1d5)]),_0x3055a8=estimateTokens(messageText(_0x14a8be));if(_0x3055a8<_0x4df692[_0x355251(0x1c3)])return _0x19c5c9+=_0x4df692[_0x355251(0x1c3)]-_0x3055a8,_0x14a8be;}return _0x4df692[_0x355251(0x1d5)];});return{'messages':[..._0x34787b,..._0x515fae,..._0xe218b6],'trimmedCount':0x0,'savedTokens':_0x19c5c9};}_0xcba7d9[_0xda2a9e(0x1d9)]((_0x289471,_0x44dc31)=>_0x44dc31[_0xda2a9e(0x1b0)]-_0x289471[_0xda2a9e(0x1b0)]);let _0x4c1596=0x0,_0x4b127b=0x0,_0x158234=0x0;const _0x2b6d6e=[];for(const _0x792971 of _0xcba7d9){if(_0x4c1596+_0x792971['tokens']<=_0x4a660b){if(_0x792971[_0xda2a9e(0x1c3)]>0x3e8){const _0xad5ec1=summarizeMessage(_0x792971['msg']),_0x321942=estimateTokens(messageText(_0xad5ec1));_0x158234+=_0x792971['tokens']-_0x321942,_0x4c1596+=_0x321942,_0x2b6d6e[_0xda2a9e(0x1ce)]({'msg':_0xad5ec1,'originalIndex':_0x1d7195[_0xda2a9e(0x1d2)](_0x792971[_0xda2a9e(0x1d5)])});}else _0x4c1596+=_0x792971['tokens'],_0x2b6d6e[_0xda2a9e(0x1ce)]({'msg':_0x792971[_0xda2a9e(0x1d5)],'originalIndex':_0x1d7195[_0xda2a9e(0x1d2)](_0x792971['msg'])});}else _0x4b127b++,_0x158234+=_0x792971[_0xda2a9e(0x1c3)];}_0x2b6d6e['sort']((_0x34e38d,_0x3e280c)=>_0x34e38d[_0xda2a9e(0x1cd)]-_0x3e280c[_0xda2a9e(0x1cd)]);const _0x32f10b=[..._0x34787b,..._0x2b6d6e[_0xda2a9e(0x1b1)](_0x3e41ac=>_0x3e41ac[_0xda2a9e(0x1d5)]),..._0xe218b6];return{'messages':_0x32f10b,'trimmedCount':_0x4b127b,'savedTokens':_0x158234};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x4432b7=a0_0x4fde;(function(_0x2a3902,_0x3f8f01){const _0x424d21=a0_0x4fde,_0x110797=_0x2a3902();while(!![]){try{const _0x556923=parseInt(_0x424d21(0x8a))/0x1+-parseInt(_0x424d21(0x83))/0x2+-parseInt(_0x424d21(0x81))/0x3*(parseInt(_0x424d21(0x7d))/0x4)+parseInt(_0x424d21(0x84))/0x5+parseInt(_0x424d21(0x91))/0x6+-parseInt(_0x424d21(0x93))/0x7+-parseInt(_0x424d21(0x8c))/0x8*(-parseInt(_0x424d21(0x80))/0x9);if(_0x556923===_0x3f8f01)break;else _0x110797['push'](_0x110797['shift']());}catch(_0xbd2141){_0x110797['push'](_0x110797['shift']());}}}(a0_0x544d,0x2738f));function a0_0x544d(){const _0x53f379=['medium','496408FgqUHk','test','complex','optimizeMaxTokens','join','775458EFwzvm','content','945259hPJxke','user','980RJJNLZ','role','__esModule','9CQhNaP','2157WcgMmj','some','362218smUhqJ','918450eXtzeq','map','text','defineProperty','type','length','277972dGMCyQ'];a0_0x544d=function(){return _0x53f379;};return a0_0x544d();}Object[a0_0x4432b7(0x87)](exports,a0_0x4432b7(0x7f),{'value':!![]}),exports[a0_0x4432b7(0x8f)]=optimizeMaxTokens;function lastUserText(_0x277ce2){const _0x11385b=a0_0x4432b7;for(let _0x285ebf=_0x277ce2[_0x11385b(0x89)]-0x1;_0x285ebf>=0x0;_0x285ebf--){if(_0x277ce2[_0x285ebf][_0x11385b(0x7e)]===_0x11385b(0x94)){const _0x418664=_0x277ce2[_0x285ebf][_0x11385b(0x92)];if(typeof _0x418664==='string')return _0x418664;if(Array['isArray'](_0x418664))return _0x418664['filter'](_0x5ea86d=>_0x5ea86d[_0x11385b(0x88)]===_0x11385b(0x86)&&_0x5ea86d[_0x11385b(0x86)])[_0x11385b(0x85)](_0x2665bc=>_0x2665bc['text'])[_0x11385b(0x90)]('\x0a');}}return'';}function a0_0x4fde(_0x43ae48,_0x392548){_0x43ae48=_0x43ae48-0x7d;const _0x544da2=a0_0x544d();let _0x4fde51=_0x544da2[_0x43ae48];return _0x4fde51;}function classifyComplexity(_0x285127){const _0x5ec964=a0_0x4432b7,_0x44b48b=_0x285127['toLowerCase'](),_0x41a0f4=_0x44b48b['split'](/\s+/)[_0x5ec964(0x89)],_0x477b55=[/^(what|where|which|who|when|how many|is |are |does |do |can |has )\S/,/\?$/,/^(show|list|print|get|find|check|look up)/,/^(yes|no|ok|sure|thanks)/];if(_0x41a0f4<0x14&&_0x477b55['some'](_0x2b6d92=>_0x2b6d92[_0x5ec964(0x8d)](_0x44b48b)))return'simple';const _0x55323c=[/implement|refactor|rewrite|create .+ (file|module|class|component)/,/step[- ]by[- ]step|multiple|several|all of the/,/write (a |the )?(full|complete|entire)/,/add .+ and .+ and/,/migrate|convert .+ to/];if(_0x41a0f4>0x50||_0x55323c[_0x5ec964(0x82)](_0x38700a=>_0x38700a[_0x5ec964(0x8d)](_0x44b48b)))return _0x5ec964(0x8e);return _0x5ec964(0x8b);}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x5d56ce,_0x5041db){const _0x33a8fd=a0_0x4432b7;if(!_0x5d56ce||_0x5d56ce[_0x33a8fd(0x89)]===0x0)return null;const _0x22a9f6=lastUserText(_0x5d56ce);if(!_0x22a9f6)return null;const _0x45c99b=classifyComplexity(_0x22a9f6),_0x21dd02=MAX_TOKENS_MAP[_0x45c99b];if(_0x5041db&&_0x5041db<=_0x21dd02)return null;return{'max_tokens':_0x21dd02,'complexity':_0x45c99b};}
|