trimprompt 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cache-manager.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +2 -2
- package/proxy-conv.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/filters/rust.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a0_0x3da8(_0x229dbd,_0x39f91b){const _0x5a1040=a0_0x5a10();return a0_0x3da8=function(_0x3da889,_0x38b3b3){_0x3da889=_0x3da889-0x89;let _0x5027fe=_0x5a1040[_0x3da889];return _0x5027fe;},a0_0x3da8(_0x229dbd,_0x39f91b);}const a0_0x3b433a=a0_0x3da8;(function(_0x385653,_0x16bad0){const _0x486bcc=a0_0x3da8,_0x230526=_0x385653();while(!![]){try{const _0x55af12=parseInt(_0x486bcc(0x96))/0x1*(-parseInt(_0x486bcc(0xa7))/0x2)+-parseInt(_0x486bcc(0xb8))/0x3*(parseInt(_0x486bcc(0xb6))/0x4)+parseInt(_0x486bcc(0xac))/0x5*(-parseInt(_0x486bcc(0x9c))/0x6)+-parseInt(_0x486bcc(0x9d))/0x7*(parseInt(_0x486bcc(0xbc))/0x8)+-parseInt(_0x486bcc(0xae))/0x9*(-parseInt(_0x486bcc(0xa9))/0xa)+-parseInt(_0x486bcc(0xb5))/0xb*(-parseInt(_0x486bcc(0xbb))/0xc)+parseInt(_0x486bcc(0xa0))/0xd;if(_0x55af12===_0x16bad0)break;else _0x230526['push'](_0x230526['shift']());}catch(_0x37e3b8){_0x230526['push'](_0x230526['shift']());}}}(a0_0x5a10,0x5f7d5));Object[a0_0x3b433a(0xb0)](exports,a0_0x3b433a(0xaa),{'value':!![]}),exports[a0_0x3b433a(0x90)]=filterCargoTest,exports[a0_0x3b433a(0xbd)]=filterCargoBuild;function a0_0x5a10(){const _0x45ee0c=['161ZEYxke','\x20passed,\x20','panicked','14448369DRrdpy','\x20\x20...\x20+','startsWith','slice','left:','filter','trim','8402dxiGVe','Cargo:\x20compiled\x20','20HnVCAd','__esModule','\x20failed,\x20','85yJuZjV','includes','601974DzbOBx','\x20warnings','defineProperty','\x20more\x20failures','warning:','\x0aFailures:','test\x20result:\x20ok','44LZKGZN','548LTouQC','join','3111OnlbNd','\x0aWarnings:','----\x20failures\x20----','149412VROPPP','71592IWWyjq','filterCargoBuild','\x20crates\x20successfully','push','split','right:','test\x20result:','\x20crates,\x20','warning[','assert','filterCargoTest','thread','length','failures:','Cargo:\x20','----\x20','102ceAWvD','match','\x20errors,\x20','\x20warnings\x20—\x20run\x20cargo\x20clippy\x20for\x20details)','\x20----','replace','44988cIAKot'];a0_0x5a10=function(){return _0x45ee0c;};return a0_0x5a10();}function filterCargoTest(_0x8f751b){const _0x44ac85=a0_0x3b433a,_0x50d35a=_0x8f751b[_0x44ac85(0x8a)]('\x0a');let _0x289292=0x0,_0x19dfac=0x0,_0x213a88=0x0,_0x357ce8=0x0;const _0x57c008=[];let _0x16609f=![],_0x142bd9=[];for(const _0x55c83e of _0x50d35a){const _0x58883b=_0x55c83e[_0x44ac85(0xa6)](),_0x541c72=_0x58883b[_0x44ac85(0x97)](/test result:\s*(\w+)\.\s*(\d+)\s+passed;\s*(\d+)\s+failed;\s*(\d+)\s+ignored;\s*(\d+)\s+measured/);if(_0x541c72){_0x289292+=parseInt(_0x541c72[0x2]),_0x19dfac+=parseInt(_0x541c72[0x3]),_0x213a88+=parseInt(_0x541c72[0x4]),_0x357ce8+=parseInt(_0x541c72[0x5]);continue;}if(_0x58883b===_0x44ac85(0x93)||_0x58883b===_0x44ac85(0xba)){_0x16609f=!![];continue;}if(_0x16609f){if(_0x58883b[_0x44ac85(0xa2)](_0x44ac85(0x95))&&_0x58883b['endsWith'](_0x44ac85(0x9a))){if(_0x142bd9[_0x44ac85(0x92)]>0x0)_0x57c008['push'](_0x142bd9[_0x44ac85(0xb7)]('\x0a'));_0x142bd9=[_0x58883b[_0x44ac85(0x9b)](/^-+\s*/,'')[_0x44ac85(0x9b)](/\s*-+$/,'')];}else{if(_0x58883b===_0x44ac85(0x93)||_0x58883b[_0x44ac85(0xa2)](_0x44ac85(0x8c))){if(_0x142bd9['length']>0x0)_0x57c008['push'](_0x142bd9[_0x44ac85(0xb7)]('\x0a'));_0x142bd9=[],_0x16609f=![];}else _0x58883b[_0x44ac85(0x92)]>0x0&&_0x142bd9[_0x44ac85(0x89)](_0x55c83e);}}}if(_0x142bd9['length']>0x0)_0x57c008[_0x44ac85(0x89)](_0x142bd9[_0x44ac85(0xb7)]('\x0a'));if(_0x289292===0x0&&_0x19dfac===0x0&&_0x213a88===0x0){if(_0x8f751b[_0x44ac85(0xad)](_0x44ac85(0xb4)))return'Cargo\x20test:\x20all\x20tests\x20passed';return _0x8f751b;}if(_0x19dfac===0x0){const _0xcc735f=['Cargo\x20test:\x20'+_0x289292+'\x20passed'];if(_0x213a88>0x0)_0xcc735f[_0x44ac85(0x89)](_0x213a88+'\x20ignored');return _0xcc735f[_0x44ac85(0xb7)](',\x20');}const _0x12c729=['Cargo\x20test:\x20'+_0x289292+_0x44ac85(0x9e)+_0x19dfac+_0x44ac85(0xab)+_0x213a88+'\x20ignored'];if(_0x57c008[_0x44ac85(0x92)]>0x0){_0x12c729[_0x44ac85(0x89)](_0x44ac85(0xb3));const _0x43dae8=0x3;for(let _0xd28713=0x0;_0xd28713<Math['min'](_0x57c008[_0x44ac85(0x92)],_0x43dae8);_0xd28713++){const _0x5a7d7b=_0x57c008[_0xd28713][_0x44ac85(0x8a)]('\x0a');_0x12c729[_0x44ac85(0x89)]('\x20\x20'+(_0xd28713+0x1)+'.\x20'+_0x5a7d7b[0x0]);const _0x3645da=_0x5a7d7b[_0x44ac85(0xa3)](0x1),_0x27a442=_0x3645da[_0x44ac85(0xa5)](_0x27328f=>_0x27328f[_0x44ac85(0xa6)]()['startsWith'](_0x44ac85(0x91))||_0x27328f[_0x44ac85(0xad)](_0x44ac85(0x9f))||_0x27328f['includes'](_0x44ac85(0x8f))||_0x27328f[_0x44ac85(0xad)](_0x44ac85(0xa4))||_0x27328f[_0x44ac85(0xad)](_0x44ac85(0x8b)));for(const _0x2e15f8 of _0x27a442[_0x44ac85(0xa3)](0x0,0x5)){_0x12c729[_0x44ac85(0x89)]('\x20\x20\x20\x20'+_0x2e15f8['trim']());}}_0x57c008[_0x44ac85(0x92)]>_0x43dae8&&_0x12c729[_0x44ac85(0x89)](_0x44ac85(0xa1)+(_0x57c008[_0x44ac85(0x92)]-_0x43dae8)+_0x44ac85(0xb1));}return _0x12c729[_0x44ac85(0xb7)]('\x0a');}function filterCargoBuild(_0x580ffa){const _0x480643=a0_0x3b433a,_0x44d3d6=_0x580ffa[_0x480643(0x8a)]('\x0a'),_0x2bd7cf=[],_0x270238=[];let _0xf9d77d=0x0;for(const _0x1501e4 of _0x44d3d6){const _0x24ff37=_0x1501e4[_0x480643(0xa6)]();if(_0x24ff37[_0x480643(0xa2)]('Compiling\x20'))_0xf9d77d++;else{if(_0x24ff37[_0x480643(0xa2)](_0x480643(0x8e))||_0x24ff37[_0x480643(0xa2)](_0x480643(0xb2)))_0x2bd7cf[_0x480643(0x89)](_0x24ff37);else{if(_0x24ff37[_0x480643(0xa2)]('error[')||_0x24ff37[_0x480643(0xa2)]('error:'))_0x270238[_0x480643(0x89)](_0x24ff37);}}}if(_0x270238['length']===0x0&&_0x2bd7cf[_0x480643(0x92)]===0x0)return _0xf9d77d>0x0?'Cargo:\x20compiled\x20'+_0xf9d77d+_0x480643(0xbe):_0x580ffa[_0x480643(0xa6)]();const _0x1e8d74=[];if(_0x270238[_0x480643(0x92)]>0x0){_0x1e8d74[_0x480643(0x89)](_0x480643(0x94)+_0x270238[_0x480643(0x92)]+_0x480643(0x98)+_0x2bd7cf[_0x480643(0x92)]+_0x480643(0xaf)),_0x1e8d74['push']('\x0aErrors:');for(const _0x4c5f57 of _0x270238[_0x480643(0xa3)](0x0,0x5))_0x1e8d74[_0x480643(0x89)]('\x20\x20'+_0x4c5f57);if(_0x270238[_0x480643(0x92)]>0x5)_0x1e8d74[_0x480643(0x89)](_0x480643(0xa1)+(_0x270238['length']-0x5)+'\x20more\x20errors');}else _0x1e8d74['push'](_0x480643(0xa8)+_0xf9d77d+_0x480643(0x8d)+_0x2bd7cf['length']+_0x480643(0xaf));if(_0x2bd7cf[_0x480643(0x92)]>0x0&&_0x2bd7cf[_0x480643(0x92)]<=0x5){_0x1e8d74[_0x480643(0x89)](_0x480643(0xb9));for(const _0x2fd353 of _0x2bd7cf)_0x1e8d74[_0x480643(0x89)]('\x20\x20'+_0x2fd353);}else _0x2bd7cf[_0x480643(0x92)]>0x5&&_0x1e8d74[_0x480643(0x89)]('\x0a('+_0x2bd7cf[_0x480643(0x92)]+_0x480643(0x99));return _0x1e8d74[_0x480643(0xb7)]('\x0a');}
|
package/filters/shell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x1162d7=a0_0x2135;(function(_0x269706,_0x355d5a){const _0x17ef99=a0_0x2135,_0x38d9bd=_0x269706();while(!![]){try{const _0x1c5c85=parseInt(_0x17ef99(0x239))/0x1*(-parseInt(_0x17ef99(0x1c6))/0x2)+parseInt(_0x17ef99(0x249))/0x3*(-parseInt(_0x17ef99(0x23e))/0x4)+-parseInt(_0x17ef99(0x1f2))/0x5+parseInt(_0x17ef99(0x1db))/0x6+-parseInt(_0x17ef99(0x1ff))/0x7*(parseInt(_0x17ef99(0x219))/0x8)+-parseInt(_0x17ef99(0x1f4))/0x9*(-parseInt(_0x17ef99(0x216))/0xa)+parseInt(_0x17ef99(0x1cc))/0xb;if(_0x1c5c85===_0x355d5a)break;else _0x38d9bd['push'](_0x38d9bd['shift']());}catch(_0x41237c){_0x38d9bd['push'](_0x38d9bd['shift']());}}}(a0_0x1679,0x9efc2));var __createBinding=this&&this[a0_0x1162d7(0x1e4)]||(Object[a0_0x1162d7(0x23a)]?function(_0x50199b,_0x4891d4,_0x5153e4,_0xee1e9e){const _0x469e96=a0_0x1162d7;if(_0xee1e9e===undefined)_0xee1e9e=_0x5153e4;var _0x1b4995=Object['getOwnPropertyDescriptor'](_0x4891d4,_0x5153e4);(!_0x1b4995||(_0x469e96(0x230)in _0x1b4995?!_0x4891d4['__esModule']:_0x1b4995['writable']||_0x1b4995[_0x469e96(0x222)]))&&(_0x1b4995={'enumerable':!![],'get':function(){return _0x4891d4[_0x5153e4];}}),Object[_0x469e96(0x20e)](_0x50199b,_0xee1e9e,_0x1b4995);}:function(_0xbc40cf,_0x53fc0f,_0x579530,_0x2f58b6){if(_0x2f58b6===undefined)_0x2f58b6=_0x579530;_0xbc40cf[_0x2f58b6]=_0x53fc0f[_0x579530];}),__setModuleDefault=this&&this[a0_0x1162d7(0x211)]||(Object[a0_0x1162d7(0x23a)]?function(_0x511dd3,_0x5796d5){const _0x52ac00=a0_0x1162d7;Object[_0x52ac00(0x20e)](_0x511dd3,_0x52ac00(0x243),{'enumerable':!![],'value':_0x5796d5});}:function(_0x4ccc52,_0x297ea7){const _0x511141=a0_0x1162d7;_0x4ccc52[_0x511141(0x243)]=_0x297ea7;}),__importStar=this&&this[a0_0x1162d7(0x224)]||(function(){var _0x3d3a82=function(_0x581624){const _0x410c11=a0_0x2135;return _0x3d3a82=Object[_0x410c11(0x21f)]||function(_0x5ab0a0){const _0x386c99=_0x410c11;var _0x28ce6f=[];for(var _0x37f308 in _0x5ab0a0)if(Object[_0x386c99(0x1c1)][_0x386c99(0x21e)][_0x386c99(0x1fc)](_0x5ab0a0,_0x37f308))_0x28ce6f[_0x28ce6f[_0x386c99(0x253)]]=_0x37f308;return _0x28ce6f;},_0x3d3a82(_0x581624);};return function(_0x11a193){const _0x38a6ca=a0_0x2135;if(_0x11a193&&_0x11a193[_0x38a6ca(0x21d)])return _0x11a193;var _0x5aa6b6={};if(_0x11a193!=null){for(var _0x4f9abb=_0x3d3a82(_0x11a193),_0xdfa2ba=0x0;_0xdfa2ba<_0x4f9abb[_0x38a6ca(0x253)];_0xdfa2ba++)if(_0x4f9abb[_0xdfa2ba]!==_0x38a6ca(0x243))__createBinding(_0x5aa6b6,_0x11a193,_0x4f9abb[_0xdfa2ba]);}return __setModuleDefault(_0x5aa6b6,_0x11a193),_0x5aa6b6;};}());Object[a0_0x1162d7(0x20e)](exports,a0_0x1162d7(0x21d),{'value':!![]}),exports['filterLs']=filterLs,exports['filterTree']=filterTree,exports[a0_0x1162d7(0x217)]=filterCat,exports[a0_0x1162d7(0x1cb)]=filterGrep,exports[a0_0x1162d7(0x1c9)]=filterFind;const path=__importStar(require(a0_0x1162d7(0x1cd))),generic_1=require(a0_0x1162d7(0x251)),tracker_1=require(a0_0x1162d7(0x1d0));function isFeatureEnabled(_0x5d8fe2){const _0x5a3a99=a0_0x1162d7;try{const _0x4df771=tracker_1['tracker'][_0x5a3a99(0x1e1)](),_0x572619=_0x4df771[_0x5a3a99(0x23d)];if(!_0x572619||_0x572619[_0x5d8fe2]===undefined)return!![];return _0x572619[_0x5d8fe2]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x1162d7(0x1c5),a0_0x1162d7(0x212),a0_0x1162d7(0x1f3),a0_0x1162d7(0x24c),a0_0x1162d7(0x1e3),a0_0x1162d7(0x226),'composer.lock',a0_0x1162d7(0x1ef),a0_0x1162d7(0x201)],BINARY_EXTENSIONS=[a0_0x1162d7(0x24f),a0_0x1162d7(0x24d),'.map',a0_0x1162d7(0x1dd),'.png',a0_0x1162d7(0x229),a0_0x1162d7(0x209),a0_0x1162d7(0x220),a0_0x1162d7(0x1d9),a0_0x1162d7(0x20d),a0_0x1162d7(0x213),a0_0x1162d7(0x24a),'.pdf',a0_0x1162d7(0x1d6),a0_0x1162d7(0x21c),a0_0x1162d7(0x20b),'.gz',a0_0x1162d7(0x228),'.7z',a0_0x1162d7(0x204),a0_0x1162d7(0x240),a0_0x1162d7(0x1ee),a0_0x1162d7(0x247),a0_0x1162d7(0x1d1),'.bin',a0_0x1162d7(0x1c0),a0_0x1162d7(0x1da),'.db','.sqlite3','.woff',a0_0x1162d7(0x22f),'.ttf',a0_0x1162d7(0x1d4),a0_0x1162d7(0x1f1),'.mp3',a0_0x1162d7(0x23c),a0_0x1162d7(0x1c4),a0_0x1162d7(0x221),a0_0x1162d7(0x1ec),a0_0x1162d7(0x1f6),a0_0x1162d7(0x234),a0_0x1162d7(0x1ce),a0_0x1162d7(0x1f9),'.o',a0_0x1162d7(0x1e8)];function a0_0x2135(_0x86cfcf,_0x1d1b21){const _0x16797f=a0_0x1679();return a0_0x2135=function(_0x21350f,_0x3db057){_0x21350f=_0x21350f-0x1be;let _0xeba2fb=_0x16797f[_0x21350f];return _0xeba2fb;},a0_0x2135(_0x86cfcf,_0x1d1b21);}function extractFilename(_0x4727a4){const _0x14d6aa=a0_0x1162d7,_0x5146cf=_0x4727a4[_0x14d6aa(0x1df)]()['split'](/\s+/);for(let _0x205111=0x1;_0x205111<_0x5146cf['length'];_0x205111++){if(!_0x5146cf[_0x205111][_0x14d6aa(0x1f7)]('-'))return _0x5146cf[_0x205111];}return null;}function filterLockFile(_0x23515f,_0x5d6331){const _0x56e519=a0_0x1162d7;try{const _0x185f66=path[_0x56e519(0x1d2)](_0x5d6331)[_0x56e519(0x23f)]();if(!LOCK_FILES['some'](_0x464968=>_0x185f66===_0x464968[_0x56e519(0x23f)]()))return null;const _0x2203c5=_0x23515f['length'];let _0x344629=0x0;if(_0x185f66===_0x56e519(0x1c5))try{const _0xb2fd0e=JSON[_0x56e519(0x22a)](_0x23515f);_0x344629=Object[_0x56e519(0x1eb)](_0xb2fd0e[_0x56e519(0x1ea)]||_0xb2fd0e['dependencies']||{})['length'];}catch{_0x344629=(_0x23515f[_0x56e519(0x1e9)](/"resolved":/g)||[])['length'];}else{if(_0x185f66==='yarn.lock')_0x344629=(_0x23515f['match'](/^"?[^#\s][^:]*:$/gm)||[])['length'];else{if(_0x185f66===_0x56e519(0x208)||_0x185f66===_0x56e519(0x226))_0x344629=(_0x23515f[_0x56e519(0x1e9)](/\[\[package\]\]/g)||[])[_0x56e519(0x253)];else{if(_0x185f66===_0x56e519(0x1e3))_0x344629=Math[_0x56e519(0x210)](_0x23515f[_0x56e519(0x200)]('\x0a')[_0x56e519(0x245)](_0x4f4742=>_0x4f4742[_0x56e519(0x1df)]())[_0x56e519(0x253)]/0x2);else{if(_0x185f66===_0x56e519(0x1e5))try{_0x344629=JSON['parse'](_0x23515f)[_0x56e519(0x1ea)]?.[_0x56e519(0x253)]||0x0;}catch{}else _0x185f66===_0x56e519(0x1f3)?_0x344629=(_0x23515f[_0x56e519(0x1e9)](/^\s{2}['"@a-z]/gm)||[])[_0x56e519(0x253)]:_0x344629=_0x23515f[_0x56e519(0x200)]('\x0a')['filter'](_0x303fe7=>_0x303fe7[_0x56e519(0x1df)]())[_0x56e519(0x253)];}}}}return _0x56e519(0x232)+path[_0x56e519(0x1d2)](_0x5d6331)+':\x20'+_0x344629+_0x56e519(0x218)+_0x2203c5[_0x56e519(0x242)]()+_0x56e519(0x23b);}catch{return null;}}function filterBinaryOrMinified(_0x2d4105,_0x4cdecc){const _0x69d974=a0_0x1162d7;try{if(_0x4cdecc){const _0x489831=_0x4cdecc['toLowerCase']();for(const _0x52456b of BINARY_EXTENSIONS){if(_0x489831[_0x69d974(0x1fe)](_0x52456b))return'[binary/minified\x20file]\x20'+path['basename'](_0x4cdecc)+',\x20'+_0x2d4105[_0x69d974(0x253)][_0x69d974(0x242)]()+_0x69d974(0x1f0)+_0x52456b+'\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)';}}const _0x1a0f48=_0x2d4105[_0x69d974(0x1de)](0x0,0x3e8);let _0x3e3a6a=0x0;for(let _0x4ef19e=0x0;_0x4ef19e<_0x1a0f48[_0x69d974(0x253)];_0x4ef19e++){if(_0x1a0f48[_0x69d974(0x1fd)](_0x4ef19e)===0x0)_0x3e3a6a++;}if(_0x3e3a6a>0x0)return _0x69d974(0x1e7)+_0x2d4105[_0x69d974(0x253)]['toLocaleString']()+_0x69d974(0x207);let _0x289a65=0x0;for(let _0x597b3f=0x0;_0x597b3f<_0x1a0f48['length'];_0x597b3f++){const _0x57bfc5=_0x1a0f48[_0x69d974(0x1fd)](_0x597b3f);if(_0x57bfc5<0x20&&_0x57bfc5!==0xa&&_0x57bfc5!==0xd&&_0x57bfc5!==0x9)_0x289a65++;}if(_0x1a0f48[_0x69d974(0x253)]>0x64&&_0x289a65>_0x1a0f48[_0x69d974(0x253)]*0.1)return _0x69d974(0x1e7)+_0x2d4105[_0x69d974(0x253)][_0x69d974(0x242)]()+'\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)';const _0x1fe37d=_0x2d4105[_0x69d974(0x200)]('\x0a');if(_0x1fe37d[_0x69d974(0x253)]<=0x3&&_0x2d4105[_0x69d974(0x253)]>0x1388)return _0x69d974(0x1e6)+_0x2d4105[_0x69d974(0x253)]['toLocaleString']()+'\x20chars\x20across\x20'+_0x1fe37d[_0x69d974(0x253)]+_0x69d974(0x1c3);return null;}catch{return null;}}function filterJsonMinify(_0xcba4fb){const _0x3f3a8e=a0_0x1162d7;try{const _0xa73847=_0xcba4fb[_0x3f3a8e(0x1df)]();if(!_0xa73847[_0x3f3a8e(0x1f7)]('{')&&!_0xa73847[_0x3f3a8e(0x1f7)]('['))return null;const _0x57b54b=_0xa73847['split']('\x0a');if(_0x57b54b[_0x3f3a8e(0x253)]<=0x14)return null;const _0x8e7dd4=JSON[_0x3f3a8e(0x22a)](_0xa73847),_0x200f63=JSON[_0x3f3a8e(0x1d5)](_0x8e7dd4);if(_0x200f63['length']<_0xa73847[_0x3f3a8e(0x253)])return _0x200f63;return null;}catch{return null;}}function filterLs(_0x1eaaa9){const _0xdacf21=a0_0x1162d7,_0x3eff4b=_0x1eaaa9[_0xdacf21(0x200)]('\x0a')[_0xdacf21(0x245)](_0x366263=>_0x366263[_0xdacf21(0x1df)]()[_0xdacf21(0x253)]>0x0);if(_0x3eff4b[_0xdacf21(0x253)]===0x0)return _0xdacf21(0x1cf);if(_0x3eff4b[_0xdacf21(0x253)]<=0x1e)return _0x1eaaa9[_0xdacf21(0x1df)]();const _0x120374=[],_0xca8b88=[];for(const _0x3b355d of _0x3eff4b){const _0x4085d5=_0x3b355d[_0xdacf21(0x1df)]();if(_0x4085d5[_0xdacf21(0x1f7)](_0xdacf21(0x24e))||_0x4085d5[_0xdacf21(0x1f7)]('d')&&_0x4085d5['includes']('..'))continue;_0x4085d5['endsWith']('/')||_0x4085d5[_0xdacf21(0x1f7)]('d')&&_0x4085d5[_0xdacf21(0x1fa)]('\x20')?_0x120374[_0xdacf21(0x22b)](_0x4085d5):_0xca8b88[_0xdacf21(0x22b)](_0x4085d5);}const _0x1ab9cc=[];return _0x120374[_0xdacf21(0x253)]>0x0&&(_0x120374['length']<=0xf?_0x1ab9cc['push'](..._0x120374):(_0x1ab9cc[_0xdacf21(0x22b)](..._0x120374[_0xdacf21(0x1d7)](0x0,0xa)),_0x1ab9cc[_0xdacf21(0x22b)](_0xdacf21(0x225)+(_0x120374[_0xdacf21(0x253)]-0xa)+_0xdacf21(0x202)))),_0xca8b88[_0xdacf21(0x253)]>0x0&&(_0xca8b88[_0xdacf21(0x253)]<=0x14?_0x1ab9cc[_0xdacf21(0x22b)](..._0xca8b88):(_0x1ab9cc[_0xdacf21(0x22b)](..._0xca8b88[_0xdacf21(0x1d7)](0x0,0xf)),_0x1ab9cc[_0xdacf21(0x22b)](_0xdacf21(0x225)+(_0xca8b88[_0xdacf21(0x253)]-0xf)+_0xdacf21(0x205)))),_0x1ab9cc[_0xdacf21(0x22b)]('\x0a('+_0x120374['length']+_0xdacf21(0x1e2)+_0xca8b88[_0xdacf21(0x253)]+_0xdacf21(0x20f)),_0x1ab9cc[_0xdacf21(0x1c2)]('\x0a');}function filterTree(_0x209730){const _0x20c0de=a0_0x1162d7,_0x5a0089=_0x209730['split']('\x0a');if(_0x5a0089[_0x20c0de(0x253)]<=0x32)return _0x209730[_0x20c0de(0x1df)]();const _0x5af45d=[];let _0x542eff=0x0,_0x36f528=0x0,_0x40fa12=0x0;for(const _0x7ebb10 of _0x5a0089){const _0x3755db=_0x7ebb10['match'](/(\d+)\s+director/),_0x465430=_0x7ebb10['match'](/(\d+)\s+file/);if(_0x3755db)_0x40fa12=parseInt(_0x3755db[0x1]);if(_0x465430)_0x36f528=parseInt(_0x465430[0x1]);const _0xe31847=(_0x7ebb10[_0x20c0de(0x1e9)](/^[│├└\s─]+/)||[''])[0x0][_0x20c0de(0x253)];_0xe31847<=0x4&&(_0x5af45d[_0x20c0de(0x22b)](_0x7ebb10),_0x542eff++);}return _0x5a0089[_0x20c0de(0x253)]>_0x5af45d[_0x20c0de(0x253)]&&_0x5af45d[_0x20c0de(0x22b)]('\x0a...\x20('+_0x40fa12+_0x20c0de(0x1e2)+_0x36f528+'\x20files\x20total\x20—\x20deep\x20entries\x20truncated)'),_0x5af45d[_0x20c0de(0x1c2)]('\x0a');}function filterCat(_0x54856a,_0x4783cd=''){const _0xfca43b=a0_0x1162d7,_0x359153=extractFilename(_0x4783cd);try{if(_0x359153&&isFeatureEnabled(_0xfca43b(0x246))){const _0x19aa0b=filterLockFile(_0x54856a,_0x359153);if(_0x19aa0b)return _0x19aa0b;}if(isFeatureEnabled('binary')){const _0x4f3771=filterBinaryOrMinified(_0x54856a,_0x359153);if(_0x4f3771)return _0x4f3771;}if(isFeatureEnabled(_0xfca43b(0x235))){const _0x20f77f=(0x0,generic_1[_0xfca43b(0x1ca)])(_0x54856a);if(_0x20f77f)return _0x20f77f;}const _0x8bf557=filterJsonMinify(_0x54856a);if(_0x8bf557)return _0x8bf557;if(_0x359153&&isFeatureEnabled(_0xfca43b(0x24b))){const _0x41abaa=path['extname'](_0x359153)[_0xfca43b(0x23f)](),_0x526212=[_0xfca43b(0x237),'.js',_0xfca43b(0x1c7),_0xfca43b(0x20a),_0xfca43b(0x214),_0xfca43b(0x241),_0xfca43b(0x254),_0xfca43b(0x1be),'.c',_0xfca43b(0x21b),_0xfca43b(0x233),_0xfca43b(0x1f5),_0xfca43b(0x1d8),_0xfca43b(0x236)];if(_0x526212[_0xfca43b(0x1fa)](_0x41abaa)){const _0x174b33=_0x54856a[_0xfca43b(0x200)]('\x0a');if(_0x174b33[_0xfca43b(0x253)]>0x64){const _0x3c35c0=[];_0x3c35c0[_0xfca43b(0x22b)](_0xfca43b(0x1e0)+path[_0xfca43b(0x1d2)](_0x359153)+'\x20('+_0x174b33['length']+'\x20lines)'),_0x3c35c0[_0xfca43b(0x22b)]('');for(const _0x4f3db9 of _0x174b33){const _0x2d229e=_0x4f3db9[_0xfca43b(0x1df)]();if(_0x2d229e[_0xfca43b(0x1f7)]('import\x20')||_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x22e))||_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x227))||_0x2d229e[_0xfca43b(0x1e9)](/=\s*require\(/)||_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x215))||_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x250))||_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x22c)))_0x3c35c0[_0xfca43b(0x22b)](_0x4f3db9);else{if(_0x2d229e[_0xfca43b(0x1e9)](/^(export\s+)?(async\s+)?function\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^(export\s+)?(default\s+)?class\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^(export\s+)?(type|interface|enum)\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^(async\s+)?def\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^func\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^type\s+\w+\s+(struct|interface)/)||_0x2d229e[_0xfca43b(0x1e9)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x2d229e[_0xfca43b(0x1e9)](/^(public|private|protected|static)\s+/))_0x3c35c0[_0xfca43b(0x22b)](_0x4f3db9);else{if(_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x1dc))&&!_0x2d229e[_0xfca43b(0x1fa)]('=>')&&_0x2d229e[_0xfca43b(0x253)]<0x78)_0x3c35c0[_0xfca43b(0x22b)](_0x4f3db9);else _0x2d229e[_0xfca43b(0x1f7)]('@')&&!_0x2d229e[_0xfca43b(0x1f7)](_0xfca43b(0x1ed))&&!_0x2d229e[_0xfca43b(0x1f7)]('@return')&&_0x3c35c0[_0xfca43b(0x22b)](_0x4f3db9);}}}_0x3c35c0[_0xfca43b(0x22b)](''),_0x3c35c0['push']('('+_0x174b33[_0xfca43b(0x253)]+_0xfca43b(0x1bf)+(_0x3c35c0[_0xfca43b(0x253)]-0x2)+_0xfca43b(0x244));const _0x11f601=_0x3c35c0[_0xfca43b(0x1c2)]('\x0a');if(_0x11f601['length']<_0x54856a[_0xfca43b(0x253)])return _0x11f601;}}}}catch{}let _0x584815=(0x0,generic_1['collapseWhitespace'])(_0x54856a);if(_0x359153){const _0x1151ee=path[_0xfca43b(0x1fb)](_0x359153)[_0xfca43b(0x23f)]();_0x584815=(0x0,generic_1[_0xfca43b(0x1f8)])(_0x584815,_0x1151ee);}const _0x5c4e25=_0x584815[_0xfca43b(0x200)]('\x0a');if(_0x5c4e25['length']<=0x64)return _0x584815;const _0x1df4b3=[];return _0x1df4b3[_0xfca43b(0x22b)](..._0x5c4e25['slice'](0x0,0x32)),_0x1df4b3[_0xfca43b(0x22b)](_0xfca43b(0x206)+(_0x5c4e25[_0xfca43b(0x253)]-0x50)+'\x20lines\x20truncated]\x20...\x0a'),_0x1df4b3['push'](..._0x5c4e25[_0xfca43b(0x1d7)](-0x1e)),_0x1df4b3[_0xfca43b(0x22b)]('\x0a('+_0x5c4e25[_0xfca43b(0x253)]+'\x20lines\x20total)'),_0x1df4b3['join']('\x0a');}function filterGrep(_0x5a2390){const _0x4835cd=a0_0x1162d7,_0x1e263b=_0x5a2390[_0x4835cd(0x200)]('\x0a')[_0x4835cd(0x245)](_0x3d2737=>_0x3d2737[_0x4835cd(0x1df)]()['length']>0x0);if(_0x1e263b['length']===0x0)return'No\x20matches\x20found';if(_0x1e263b[_0x4835cd(0x253)]<=0x32)return _0x5a2390['trim']();const _0x5bfba9={},_0x4a3513=[];for(const _0x4e6c11 of _0x1e263b){const _0x105931=_0x4e6c11[_0x4835cd(0x1c8)](':');if(_0x105931>0x0&&_0x105931<0xc8){const _0x296725=_0x4e6c11['substring'](0x0,_0x105931);if(_0x296725['includes']('/')||_0x296725[_0x4835cd(0x1fa)]('\x5c')||_0x296725[_0x4835cd(0x1fa)]('.')){if(!_0x5bfba9[_0x296725])_0x5bfba9[_0x296725]=[];_0x5bfba9[_0x296725][_0x4835cd(0x22b)](_0x4e6c11[_0x4835cd(0x1de)](_0x105931+0x1)['trim']());continue;}}_0x4a3513[_0x4835cd(0x22b)](_0x4e6c11);}const _0x276f63=[],_0x32caf8=Object[_0x4835cd(0x1eb)](_0x5bfba9);if(_0x32caf8[_0x4835cd(0x253)]>0x0){const _0x31295d=0x14,_0xce6e40=_0x32caf8[_0x4835cd(0x1d7)](0x0,_0x31295d);for(const _0x7b248f of _0xce6e40){const _0xbb675b=_0x5bfba9[_0x7b248f];if(_0xbb675b[_0x4835cd(0x253)]<=0x3)for(const _0x3b7144 of _0xbb675b){_0x276f63[_0x4835cd(0x22b)](_0x7b248f+':\x20'+_0x3b7144);}else _0x276f63[_0x4835cd(0x22b)](_0x7b248f+':\x20'+_0xbb675b[0x0]),_0x276f63['push'](_0x7b248f+_0x4835cd(0x248)+_0xbb675b[_0x4835cd(0x253)]+_0x4835cd(0x231));}_0x32caf8['length']>_0x31295d&&_0x276f63[_0x4835cd(0x22b)](_0x4835cd(0x225)+(_0x32caf8[_0x4835cd(0x253)]-_0x31295d)+_0x4835cd(0x22d));}if(_0x4a3513[_0x4835cd(0x253)]>0x0){const _0x78e67a=0x1e;_0x276f63[_0x4835cd(0x22b)](..._0x4a3513[_0x4835cd(0x1d7)](0x0,_0x78e67a)),_0x4a3513[_0x4835cd(0x253)]>_0x78e67a&&_0x276f63[_0x4835cd(0x22b)](_0x4835cd(0x225)+(_0x4a3513[_0x4835cd(0x253)]-_0x78e67a)+_0x4835cd(0x238));}const _0x1d17e3=_0x1e263b['length'];return _0x276f63['push']('\x0a('+_0x1d17e3+_0x4835cd(0x21a)+(_0x32caf8[_0x4835cd(0x253)]||'?')+_0x4835cd(0x20f)),_0x276f63['join']('\x0a');}function filterFind(_0x676b5){const _0x5d654d=a0_0x1162d7,_0x742a43=_0x676b5['split']('\x0a')[_0x5d654d(0x245)](_0x54a59c=>_0x54a59c[_0x5d654d(0x1df)]()[_0x5d654d(0x253)]>0x0);if(_0x742a43[_0x5d654d(0x253)]===0x0)return _0x5d654d(0x1d3);if(_0x742a43[_0x5d654d(0x253)]<=0x32)return _0x676b5[_0x5d654d(0x1df)]();const _0x2e0aa1={};for(const _0x5c7f32 of _0x742a43){const _0xe75d29=path[_0x5d654d(0x252)](_0x5c7f32[_0x5d654d(0x1df)]())||'.';_0x2e0aa1[_0xe75d29]=(_0x2e0aa1[_0xe75d29]||0x0)+0x1;}const _0x508536=Object[_0x5d654d(0x223)](_0x2e0aa1)['sort']((_0x631f9a,_0x575dcf)=>_0x575dcf[0x1]-_0x631f9a[0x1]),_0x4005b5=[_0x742a43[_0x5d654d(0x253)]+_0x5d654d(0x203)+_0x508536['length']+_0x5d654d(0x20c),''],_0x344b4a=0x1e;for(const [_0x2d2516,_0x130eed]of _0x508536['slice'](0x0,_0x344b4a)){_0x4005b5[_0x5d654d(0x22b)]('\x20\x20'+_0x2d2516+'/\x20('+_0x130eed+_0x5d654d(0x20f));}return _0x508536[_0x5d654d(0x253)]>_0x344b4a&&_0x4005b5['push']('\x20\x20...\x20+'+(_0x508536[_0x5d654d(0x253)]-_0x344b4a)+'\x20more\x20directories'),_0x4005b5[_0x5d654d(0x1c2)]('\x0a');}function a0_0x1679(){const _0x4d5bc1=['push','package\x20','\x20more\x20files\x20with\x20matches','from\x20','.woff2','get','\x20matches\x20in\x20this\x20file)','[lock\x20file]\x20','.cs','.pyc','json_crusher','.kt','.ts','\x20more\x20matches','2269loTBeU','create','\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)','.mp4','features_enabled','8grNyCi','toLowerCase','.exe','.go','toLocaleString','default','\x20structural\x20lines\x20shown)','filter','lock','.so',':\x20...\x20(','704049dJfJPl','.svg','skeleton','Cargo.lock','.min.css','total\x20','.min.js','use\x20','./generic','dirname','length','.rs','.java','\x20lines\x20total,\x20','.dat','prototype','join','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','.wav','package-lock.json','158VAtenL','.tsx','indexOf','filterFind','smartCrushJson','filterGrep','15650613IwBHps','path','.pyo','Empty\x20directory','../tracker','.dylib','basename','No\x20files\x20found','.eot','stringify','.zip','slice','.swift','.ico','.sqlite','334758ujWzAk','export\x20','.wasm','substring','trim','[code\x20skeleton]\x20','getConfig','\x20directories,\x20','go.sum','__createBinding','composer.lock','[minified\x20file]\x20','[binary\x20file]\x20','.obj','match','packages','keys','.mov','@param','.dll','Gemfile.lock','\x20chars,\x20type:\x20','.otf','407820zkzvMi','pnpm-lock.yaml','9kMmHUo','.rb','.webm','startsWith','stripComments','.class','includes','extname','call','charCodeAt','endsWith','1106ZeCvbm','split','bun.lockb','\x20more\x20directories','\x20files\x20found\x20across\x20','.rar','\x20more\x20files','\x0a...\x20[','\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)','cargo.lock','.jpeg','.jsx','.tgz','\x20directories','.bmp','defineProperty','\x20files)','floor','__setModuleDefault','yarn.lock','.webp','.py','#include\x20','6468290Vvmbix','filterCat','\x20dependencies,\x20','37672FfjvjJ','\x20matches\x20across\x20','.cpp','.tar.gz','__esModule','hasOwnProperty','getOwnPropertyNames','.gif','.avi','configurable','entries','__importStar','...\x20+','poetry.lock','require(','.bz2','.jpg','parse'];a0_0x1679=function(){return _0x4d5bc1;};return a0_0x1679();}
|
|
1
|
+
'use strict';const a0_0x5db192=a0_0x2a89;function a0_0x2511(){const _0x190105=[':\x20...\x20(','binary','8tmcVwz','1843014JvjyAt','.exe','.jpeg','sort','filterCat','composer.lock','.dylib','.sqlite3','.avi','.bz2','basename','\x20lines\x20truncated]\x20...\x0a','6wRfOSw','.tar.gz','.jsx','.mp4','./generic','\x20files)','path','.java','parse','json_crusher','yarn.lock','total\x20','go.sum','get','.obj','includes','.bin','.sqlite','toLowerCase','1854405edNxmd','/\x20(','.mov','getOwnPropertyNames','\x20more\x20files\x20with\x20matches','create','.pyo','.so','getOwnPropertyDescriptor','lock','push','__createBinding','match','import\x20','.webm','package\x20','.js','.db','#include\x20','.swift','collapseWhitespace','\x20more\x20matches','@return','packages','.eot','[code\x20skeleton]\x20','\x0a...\x20(','__esModule','@param','stripComments','filter','\x20chars\x20across\x20','.dll','default','.jpg','.class','.mp3','.otf','260815wyLtXS','6334803akhsVO','\x20lines\x20total,\x20','length','toLocaleString','.7z','keys','\x20chars\x20(contains\x20null\x20bytes\x20—\x20binary\x20content\x20omitted)','require(','split','filterTree','tracker','.tsx','.bmp','Empty\x20directory','No\x20matches\x20found','1396013ziFCoE','join','substring','.rb','filterGrep','Gemfile.lock','features_enabled','[binary\x20file]\x20','\x20chars,\x20type:\x20','slice','poetry.lock','charCodeAt','.ts','endsWith','package-lock.json','trim','.go','export\x20','110pLXbIm','\x20line(s)\x20(content\x20omitted\x20—\x20not\x20human-readable)','\x20files\x20found\x20across\x20','\x20directories,\x20','defineProperty','some','.wav','2633818LbhjoN','\x20more\x20files','\x20structural\x20lines\x20shown)','startsWith','2kDIssS','.zip','.wasm','.woff','...\x20+','extname','from\x20','.pyc','\x20more\x20directories','\x20dependencies,\x20','__importStar','\x20matches\x20in\x20this\x20file)','configurable','No\x20files\x20found','__setModuleDefault','.svg','5012416FDvTNP','\x20directories','.rar','\x20lines\x20total)','.webp','dependencies','.woff2'];a0_0x2511=function(){return _0x190105;};return a0_0x2511();}(function(_0x1c0a58,_0x266f9d){const _0x4a4e5a=a0_0x2a89,_0x14dcf1=_0x1c0a58();while(!![]){try{const _0x226ef7=-parseInt(_0x4a4e5a(0x1e6))/0x1+parseInt(_0x4a4e5a(0x203))/0x2*(-parseInt(_0x4a4e5a(0x21d))/0x3)+parseInt(_0x4a4e5a(0x213))/0x4+-parseInt(_0x4a4e5a(0x1d6))/0x5*(-parseInt(_0x4a4e5a(0x229))/0x6)+-parseInt(_0x4a4e5a(0x23c))/0x7+-parseInt(_0x4a4e5a(0x21c))/0x8*(parseInt(_0x4a4e5a(0x1d7))/0x9)+-parseInt(_0x4a4e5a(0x1f8))/0xa*(-parseInt(_0x4a4e5a(0x1ff))/0xb);if(_0x226ef7===_0x266f9d)break;else _0x14dcf1['push'](_0x14dcf1['shift']());}catch(_0x41077a){_0x14dcf1['push'](_0x14dcf1['shift']());}}}(a0_0x2511,0xea5d0));var __createBinding=this&&this[a0_0x5db192(0x247)]||(Object[a0_0x5db192(0x241)]?function(_0x4f3957,_0x147560,_0x13a2cf,_0x564db8){const _0x1309c4=a0_0x5db192;if(_0x564db8===undefined)_0x564db8=_0x13a2cf;var _0x33e5f5=Object[_0x1309c4(0x244)](_0x147560,_0x13a2cf);(!_0x33e5f5||(_0x1309c4(0x236)in _0x33e5f5?!_0x147560[_0x1309c4(0x1cb)]:_0x33e5f5['writable']||_0x33e5f5[_0x1309c4(0x20f)]))&&(_0x33e5f5={'enumerable':!![],'get':function(){return _0x147560[_0x13a2cf];}}),Object[_0x1309c4(0x1fc)](_0x4f3957,_0x564db8,_0x33e5f5);}:function(_0xb07f9a,_0x32f8fa,_0x5c4e12,_0x3e492c){if(_0x3e492c===undefined)_0x3e492c=_0x5c4e12;_0xb07f9a[_0x3e492c]=_0x32f8fa[_0x5c4e12];}),__setModuleDefault=this&&this[a0_0x5db192(0x211)]||(Object[a0_0x5db192(0x241)]?function(_0x122a3e,_0x4a28dd){const _0x2d892b=a0_0x5db192;Object[_0x2d892b(0x1fc)](_0x122a3e,_0x2d892b(0x1d1),{'enumerable':!![],'value':_0x4a28dd});}:function(_0x232c81,_0x10ef93){const _0x3ab203=a0_0x5db192;_0x232c81[_0x3ab203(0x1d1)]=_0x10ef93;}),__importStar=this&&this[a0_0x5db192(0x20d)]||(function(){var _0x40ca49=function(_0x35a942){const _0x127b18=a0_0x2a89;return _0x40ca49=Object[_0x127b18(0x23f)]||function(_0x504d3b){const _0x26bec0=_0x127b18;var _0x349611=[];for(var _0x338091 in _0x504d3b)if(Object['prototype']['hasOwnProperty']['call'](_0x504d3b,_0x338091))_0x349611[_0x349611[_0x26bec0(0x1d9)]]=_0x338091;return _0x349611;},_0x40ca49(_0x35a942);};return function(_0x1aa045){const _0x1633f2=a0_0x2a89;if(_0x1aa045&&_0x1aa045[_0x1633f2(0x1cb)])return _0x1aa045;var _0x44c3b3={};if(_0x1aa045!=null){for(var _0x3c0b3d=_0x40ca49(_0x1aa045),_0xcdcd5c=0x0;_0xcdcd5c<_0x3c0b3d[_0x1633f2(0x1d9)];_0xcdcd5c++)if(_0x3c0b3d[_0xcdcd5c]!==_0x1633f2(0x1d1))__createBinding(_0x44c3b3,_0x1aa045,_0x3c0b3d[_0xcdcd5c]);}return __setModuleDefault(_0x44c3b3,_0x1aa045),_0x44c3b3;};}());Object[a0_0x5db192(0x1fc)](exports,a0_0x5db192(0x1cb),{'value':!![]}),exports['filterLs']=filterLs,exports[a0_0x5db192(0x1e0)]=filterTree,exports[a0_0x5db192(0x221)]=filterCat,exports[a0_0x5db192(0x1ea)]=filterGrep,exports['filterFind']=filterFind;const path=__importStar(require(a0_0x5db192(0x22f))),generic_1=require(a0_0x5db192(0x22d)),tracker_1=require('../tracker');function isFeatureEnabled(_0x3b77ec){const _0x54936=a0_0x5db192;try{const _0x146c40=tracker_1[_0x54936(0x1e1)]['getConfig'](),_0xf3aa52=_0x146c40[_0x54936(0x1ec)];if(!_0xf3aa52||_0xf3aa52[_0x3b77ec]===undefined)return!![];return _0xf3aa52[_0x3b77ec]!==![];}catch{return!![];}}const LOCK_FILES=[a0_0x5db192(0x1f4),a0_0x5db192(0x233),'pnpm-lock.yaml','Cargo.lock',a0_0x5db192(0x235),a0_0x5db192(0x1f0),a0_0x5db192(0x222),a0_0x5db192(0x1eb),'bun.lockb'],BINARY_EXTENSIONS=['.min.js','.min.css','.map',a0_0x5db192(0x205),'.png',a0_0x5db192(0x1d2),a0_0x5db192(0x21f),'.gif','.ico',a0_0x5db192(0x1e3),a0_0x5db192(0x217),a0_0x5db192(0x212),'.pdf',a0_0x5db192(0x204),a0_0x5db192(0x22a),'.tgz','.gz',a0_0x5db192(0x226),a0_0x5db192(0x1db),a0_0x5db192(0x215),a0_0x5db192(0x21e),a0_0x5db192(0x1d0),a0_0x5db192(0x243),a0_0x5db192(0x223),a0_0x5db192(0x239),'.dat',a0_0x5db192(0x23a),a0_0x5db192(0x24d),a0_0x5db192(0x224),a0_0x5db192(0x206),a0_0x5db192(0x219),'.ttf',a0_0x5db192(0x254),a0_0x5db192(0x1d5),a0_0x5db192(0x1d4),a0_0x5db192(0x22c),a0_0x5db192(0x1fe),a0_0x5db192(0x225),a0_0x5db192(0x23e),a0_0x5db192(0x24a),a0_0x5db192(0x20a),a0_0x5db192(0x242),a0_0x5db192(0x1d3),'.o',a0_0x5db192(0x237)];function extractFilename(_0x420975){const _0x4898ed=a0_0x5db192,_0xef2a1=_0x420975[_0x4898ed(0x1f5)]()[_0x4898ed(0x1df)](/\s+/);for(let _0x3e16e5=0x1;_0x3e16e5<_0xef2a1[_0x4898ed(0x1d9)];_0x3e16e5++){if(!_0xef2a1[_0x3e16e5][_0x4898ed(0x202)]('-'))return _0xef2a1[_0x3e16e5];}return null;}function filterLockFile(_0x11ab42,_0x39b9fd){const _0x1ac91e=a0_0x5db192;try{const _0x592023=path[_0x1ac91e(0x227)](_0x39b9fd)[_0x1ac91e(0x23b)]();if(!LOCK_FILES[_0x1ac91e(0x1fd)](_0x5e8414=>_0x592023===_0x5e8414['toLowerCase']()))return null;const _0x2525e2=_0x11ab42[_0x1ac91e(0x1d9)];let _0x31baa6=0x0;if(_0x592023===_0x1ac91e(0x1f4))try{const _0x51ccce=JSON[_0x1ac91e(0x231)](_0x11ab42);_0x31baa6=Object[_0x1ac91e(0x1dc)](_0x51ccce[_0x1ac91e(0x253)]||_0x51ccce[_0x1ac91e(0x218)]||{})['length'];}catch{_0x31baa6=(_0x11ab42['match'](/"resolved":/g)||[])[_0x1ac91e(0x1d9)];}else{if(_0x592023===_0x1ac91e(0x233))_0x31baa6=(_0x11ab42[_0x1ac91e(0x248)](/^"?[^#\s][^:]*:$/gm)||[])[_0x1ac91e(0x1d9)];else{if(_0x592023==='cargo.lock'||_0x592023==='poetry.lock')_0x31baa6=(_0x11ab42['match'](/\[\[package\]\]/g)||[])[_0x1ac91e(0x1d9)];else{if(_0x592023==='go.sum')_0x31baa6=Math['floor'](_0x11ab42['split']('\x0a')[_0x1ac91e(0x1ce)](_0x165c87=>_0x165c87[_0x1ac91e(0x1f5)]())[_0x1ac91e(0x1d9)]/0x2);else{if(_0x592023==='composer.lock')try{_0x31baa6=JSON[_0x1ac91e(0x231)](_0x11ab42)[_0x1ac91e(0x253)]?.['length']||0x0;}catch{}else _0x592023==='pnpm-lock.yaml'?_0x31baa6=(_0x11ab42[_0x1ac91e(0x248)](/^\s{2}['"@a-z]/gm)||[])[_0x1ac91e(0x1d9)]:_0x31baa6=_0x11ab42[_0x1ac91e(0x1df)]('\x0a')[_0x1ac91e(0x1ce)](_0x16fd01=>_0x16fd01[_0x1ac91e(0x1f5)]())[_0x1ac91e(0x1d9)];}}}}return'[lock\x20file]\x20'+path[_0x1ac91e(0x227)](_0x39b9fd)+':\x20'+_0x31baa6+_0x1ac91e(0x20c)+_0x2525e2[_0x1ac91e(0x1da)]()+'\x20chars\x20(content\x20omitted\x20—\x20lock\x20files\x20are\x20not\x20useful\x20for\x20LLM\x20context)';}catch{return null;}}function filterBinaryOrMinified(_0x3b4d1f,_0x196c24){const _0x5c3e4f=a0_0x5db192;try{if(_0x196c24){const _0x9727de=_0x196c24[_0x5c3e4f(0x23b)]();for(const _0x1533cf of BINARY_EXTENSIONS){if(_0x9727de[_0x5c3e4f(0x1f3)](_0x1533cf))return'[binary/minified\x20file]\x20'+path[_0x5c3e4f(0x227)](_0x196c24)+',\x20'+_0x3b4d1f['length'][_0x5c3e4f(0x1da)]()+_0x5c3e4f(0x1ee)+_0x1533cf+'\x20(content\x20omitted\x20—\x20not\x20useful\x20for\x20LLM\x20context)';}}const _0x24a84c=_0x3b4d1f[_0x5c3e4f(0x1e8)](0x0,0x3e8);let _0x2d148c=0x0;for(let _0x1b5ece=0x0;_0x1b5ece<_0x24a84c[_0x5c3e4f(0x1d9)];_0x1b5ece++){if(_0x24a84c[_0x5c3e4f(0x1f1)](_0x1b5ece)===0x0)_0x2d148c++;}if(_0x2d148c>0x0)return _0x5c3e4f(0x1ed)+_0x3b4d1f['length'][_0x5c3e4f(0x1da)]()+_0x5c3e4f(0x1dd);let _0x385a33=0x0;for(let _0x37b96=0x0;_0x37b96<_0x24a84c[_0x5c3e4f(0x1d9)];_0x37b96++){const _0x32d116=_0x24a84c[_0x5c3e4f(0x1f1)](_0x37b96);if(_0x32d116<0x20&&_0x32d116!==0xa&&_0x32d116!==0xd&&_0x32d116!==0x9)_0x385a33++;}if(_0x24a84c[_0x5c3e4f(0x1d9)]>0x64&&_0x385a33>_0x24a84c['length']*0.1)return'[binary\x20file]\x20'+_0x3b4d1f[_0x5c3e4f(0x1d9)][_0x5c3e4f(0x1da)]()+'\x20chars\x20(high\x20non-printable\x20ratio\x20—\x20content\x20omitted)';const _0xdc806e=_0x3b4d1f[_0x5c3e4f(0x1df)]('\x0a');if(_0xdc806e[_0x5c3e4f(0x1d9)]<=0x3&&_0x3b4d1f[_0x5c3e4f(0x1d9)]>0x1388)return'[minified\x20file]\x20'+_0x3b4d1f[_0x5c3e4f(0x1d9)][_0x5c3e4f(0x1da)]()+_0x5c3e4f(0x1cf)+_0xdc806e[_0x5c3e4f(0x1d9)]+_0x5c3e4f(0x1f9);return null;}catch{return null;}}function a0_0x2a89(_0x24c633,_0x5c346e){const _0x251182=a0_0x2511();return a0_0x2a89=function(_0x2a893b,_0x2ea917){_0x2a893b=_0x2a893b-0x1ca;let _0x276654=_0x251182[_0x2a893b];return _0x276654;},a0_0x2a89(_0x24c633,_0x5c346e);}function filterJsonMinify(_0x14bc43){const _0x6bde8d=a0_0x5db192;try{const _0x496a2e=_0x14bc43['trim']();if(!_0x496a2e[_0x6bde8d(0x202)]('{')&&!_0x496a2e[_0x6bde8d(0x202)]('['))return null;const _0x1c0a2b=_0x496a2e['split']('\x0a');if(_0x1c0a2b['length']<=0x14)return null;const _0x50e0d5=JSON['parse'](_0x496a2e),_0x114ae7=JSON['stringify'](_0x50e0d5);if(_0x114ae7[_0x6bde8d(0x1d9)]<_0x496a2e[_0x6bde8d(0x1d9)])return _0x114ae7;return null;}catch{return null;}}function filterLs(_0x43ac7b){const _0x3ba55a=a0_0x5db192,_0x5cbd2b=_0x43ac7b[_0x3ba55a(0x1df)]('\x0a')[_0x3ba55a(0x1ce)](_0x278c5c=>_0x278c5c[_0x3ba55a(0x1f5)]()[_0x3ba55a(0x1d9)]>0x0);if(_0x5cbd2b['length']===0x0)return _0x3ba55a(0x1e4);if(_0x5cbd2b['length']<=0x1e)return _0x43ac7b[_0x3ba55a(0x1f5)]();const _0x30e442=[],_0x16c375=[];for(const _0x3be89f of _0x5cbd2b){const _0x5167af=_0x3be89f['trim']();if(_0x5167af[_0x3ba55a(0x202)](_0x3ba55a(0x234))||_0x5167af[_0x3ba55a(0x202)]('d')&&_0x5167af[_0x3ba55a(0x238)]('..'))continue;_0x5167af[_0x3ba55a(0x1f3)]('/')||_0x5167af[_0x3ba55a(0x202)]('d')&&_0x5167af[_0x3ba55a(0x238)]('\x20')?_0x30e442[_0x3ba55a(0x246)](_0x5167af):_0x16c375[_0x3ba55a(0x246)](_0x5167af);}const _0x463c93=[];return _0x30e442[_0x3ba55a(0x1d9)]>0x0&&(_0x30e442[_0x3ba55a(0x1d9)]<=0xf?_0x463c93[_0x3ba55a(0x246)](..._0x30e442):(_0x463c93[_0x3ba55a(0x246)](..._0x30e442[_0x3ba55a(0x1ef)](0x0,0xa)),_0x463c93[_0x3ba55a(0x246)](_0x3ba55a(0x207)+(_0x30e442['length']-0xa)+_0x3ba55a(0x20b)))),_0x16c375[_0x3ba55a(0x1d9)]>0x0&&(_0x16c375[_0x3ba55a(0x1d9)]<=0x14?_0x463c93['push'](..._0x16c375):(_0x463c93[_0x3ba55a(0x246)](..._0x16c375[_0x3ba55a(0x1ef)](0x0,0xf)),_0x463c93['push']('...\x20+'+(_0x16c375[_0x3ba55a(0x1d9)]-0xf)+_0x3ba55a(0x200)))),_0x463c93[_0x3ba55a(0x246)]('\x0a('+_0x30e442[_0x3ba55a(0x1d9)]+_0x3ba55a(0x1fb)+_0x16c375['length']+'\x20files)'),_0x463c93[_0x3ba55a(0x1e7)]('\x0a');}function filterTree(_0x54192a){const _0x27d550=a0_0x5db192,_0x31b5fe=_0x54192a[_0x27d550(0x1df)]('\x0a');if(_0x31b5fe[_0x27d550(0x1d9)]<=0x32)return _0x54192a[_0x27d550(0x1f5)]();const _0x3a047f=[];let _0x5d6f32=0x0,_0x1a2e88=0x0,_0x5a0c5c=0x0;for(const _0x7d120e of _0x31b5fe){const _0x5cfb1c=_0x7d120e[_0x27d550(0x248)](/(\d+)\s+director/),_0x47f62a=_0x7d120e[_0x27d550(0x248)](/(\d+)\s+file/);if(_0x5cfb1c)_0x5a0c5c=parseInt(_0x5cfb1c[0x1]);if(_0x47f62a)_0x1a2e88=parseInt(_0x47f62a[0x1]);const _0x41674d=(_0x7d120e['match'](/^[│├└\s─]+/)||[''])[0x0]['length'];_0x41674d<=0x4&&(_0x3a047f['push'](_0x7d120e),_0x5d6f32++);}return _0x31b5fe['length']>_0x3a047f['length']&&_0x3a047f[_0x27d550(0x246)](_0x27d550(0x1ca)+_0x5a0c5c+'\x20directories,\x20'+_0x1a2e88+'\x20files\x20total\x20—\x20deep\x20entries\x20truncated)'),_0x3a047f['join']('\x0a');}function filterCat(_0x41fb37,_0x322490=''){const _0x28f973=a0_0x5db192,_0xf5858=extractFilename(_0x322490);try{if(_0xf5858&&isFeatureEnabled(_0x28f973(0x245))){const _0x19b045=filterLockFile(_0x41fb37,_0xf5858);if(_0x19b045)return _0x19b045;}if(isFeatureEnabled(_0x28f973(0x21b))){const _0x4e987e=filterBinaryOrMinified(_0x41fb37,_0xf5858);if(_0x4e987e)return _0x4e987e;}if(isFeatureEnabled(_0x28f973(0x232))){const _0x4605da=(0x0,generic_1['smartCrushJson'])(_0x41fb37);if(_0x4605da)return _0x4605da;}const _0x54b6d7=filterJsonMinify(_0x41fb37);if(_0x54b6d7)return _0x54b6d7;if(_0xf5858&&isFeatureEnabled('skeleton')){const _0x131b16=path[_0x28f973(0x208)](_0xf5858)[_0x28f973(0x23b)](),_0x32290a=[_0x28f973(0x1f2),_0x28f973(0x24c),_0x28f973(0x1e2),_0x28f973(0x22b),'.py',_0x28f973(0x1f6),'.rs',_0x28f973(0x230),'.c','.cpp','.cs',_0x28f973(0x1e9),_0x28f973(0x24f),'.kt'];if(_0x32290a[_0x28f973(0x238)](_0x131b16)){const _0x1ea055=_0x41fb37[_0x28f973(0x1df)]('\x0a');if(_0x1ea055[_0x28f973(0x1d9)]>0x64){const _0x2ed640=[];_0x2ed640[_0x28f973(0x246)](_0x28f973(0x255)+path[_0x28f973(0x227)](_0xf5858)+'\x20('+_0x1ea055[_0x28f973(0x1d9)]+'\x20lines)'),_0x2ed640['push']('');for(const _0x2c05f5 of _0x1ea055){const _0x32b270=_0x2c05f5['trim']();if(_0x32b270[_0x28f973(0x202)](_0x28f973(0x249))||_0x32b270['startsWith'](_0x28f973(0x209))||_0x32b270[_0x28f973(0x202)](_0x28f973(0x1de))||_0x32b270[_0x28f973(0x248)](/=\s*require\(/)||_0x32b270['startsWith'](_0x28f973(0x24e))||_0x32b270[_0x28f973(0x202)]('use\x20')||_0x32b270[_0x28f973(0x202)](_0x28f973(0x24b)))_0x2ed640[_0x28f973(0x246)](_0x2c05f5);else{if(_0x32b270['match'](/^(export\s+)?(async\s+)?function\s+/)||_0x32b270[_0x28f973(0x248)](/^(export\s+)?(default\s+)?class\s+/)||_0x32b270[_0x28f973(0x248)](/^(export\s+)?(type|interface|enum)\s+/)||_0x32b270['match'](/^(async\s+)?def\s+/)||_0x32b270[_0x28f973(0x248)](/^func\s+/)||_0x32b270['match'](/^type\s+\w+\s+(struct|interface)/)||_0x32b270[_0x28f973(0x248)](/^(pub\s+)?(async\s+)?fn\s+/)||_0x32b270[_0x28f973(0x248)](/^(pub\s+)?(struct|enum|trait|impl)\s+/)||_0x32b270[_0x28f973(0x248)](/^(public|private|protected|static)\s+/))_0x2ed640[_0x28f973(0x246)](_0x2c05f5);else{if(_0x32b270[_0x28f973(0x202)](_0x28f973(0x1f7))&&!_0x32b270[_0x28f973(0x238)]('=>')&&_0x32b270[_0x28f973(0x1d9)]<0x78)_0x2ed640[_0x28f973(0x246)](_0x2c05f5);else _0x32b270['startsWith']('@')&&!_0x32b270[_0x28f973(0x202)](_0x28f973(0x1cc))&&!_0x32b270[_0x28f973(0x202)](_0x28f973(0x252))&&_0x2ed640[_0x28f973(0x246)](_0x2c05f5);}}}_0x2ed640[_0x28f973(0x246)](''),_0x2ed640['push']('('+_0x1ea055[_0x28f973(0x1d9)]+_0x28f973(0x1d8)+(_0x2ed640[_0x28f973(0x1d9)]-0x2)+_0x28f973(0x201));const _0x4dbe2c=_0x2ed640[_0x28f973(0x1e7)]('\x0a');if(_0x4dbe2c['length']<_0x41fb37[_0x28f973(0x1d9)])return _0x4dbe2c;}}}}catch{}let _0x22e0d7=(0x0,generic_1[_0x28f973(0x250)])(_0x41fb37);if(_0xf5858){const _0x5e9cfc=path['extname'](_0xf5858)[_0x28f973(0x23b)]();_0x22e0d7=(0x0,generic_1[_0x28f973(0x1cd)])(_0x22e0d7,_0x5e9cfc);}const _0x4b1c06=_0x22e0d7[_0x28f973(0x1df)]('\x0a');if(_0x4b1c06[_0x28f973(0x1d9)]<=0x64)return _0x22e0d7;const _0x3dfb27=[];return _0x3dfb27[_0x28f973(0x246)](..._0x4b1c06['slice'](0x0,0x32)),_0x3dfb27['push']('\x0a...\x20['+(_0x4b1c06[_0x28f973(0x1d9)]-0x50)+_0x28f973(0x228)),_0x3dfb27[_0x28f973(0x246)](..._0x4b1c06[_0x28f973(0x1ef)](-0x1e)),_0x3dfb27['push']('\x0a('+_0x4b1c06[_0x28f973(0x1d9)]+_0x28f973(0x216)),_0x3dfb27[_0x28f973(0x1e7)]('\x0a');}function filterGrep(_0x2b0db6){const _0x144bf7=a0_0x5db192,_0x52c524=_0x2b0db6[_0x144bf7(0x1df)]('\x0a')['filter'](_0x40ee6f=>_0x40ee6f['trim']()[_0x144bf7(0x1d9)]>0x0);if(_0x52c524[_0x144bf7(0x1d9)]===0x0)return _0x144bf7(0x1e5);if(_0x52c524['length']<=0x32)return _0x2b0db6['trim']();const _0x1be74b={},_0x3fc92d=[];for(const _0x35d59e of _0x52c524){const _0x2c0923=_0x35d59e['indexOf'](':');if(_0x2c0923>0x0&&_0x2c0923<0xc8){const _0x19621d=_0x35d59e['substring'](0x0,_0x2c0923);if(_0x19621d[_0x144bf7(0x238)]('/')||_0x19621d[_0x144bf7(0x238)]('\x5c')||_0x19621d['includes']('.')){if(!_0x1be74b[_0x19621d])_0x1be74b[_0x19621d]=[];_0x1be74b[_0x19621d]['push'](_0x35d59e[_0x144bf7(0x1e8)](_0x2c0923+0x1)[_0x144bf7(0x1f5)]());continue;}}_0x3fc92d[_0x144bf7(0x246)](_0x35d59e);}const _0x3a5552=[],_0x46fb0e=Object['keys'](_0x1be74b);if(_0x46fb0e[_0x144bf7(0x1d9)]>0x0){const _0x1e0cde=0x14,_0x13eaab=_0x46fb0e[_0x144bf7(0x1ef)](0x0,_0x1e0cde);for(const _0x61a17f of _0x13eaab){const _0x312876=_0x1be74b[_0x61a17f];if(_0x312876[_0x144bf7(0x1d9)]<=0x3)for(const _0x47f6a3 of _0x312876){_0x3a5552['push'](_0x61a17f+':\x20'+_0x47f6a3);}else _0x3a5552['push'](_0x61a17f+':\x20'+_0x312876[0x0]),_0x3a5552[_0x144bf7(0x246)](_0x61a17f+_0x144bf7(0x21a)+_0x312876[_0x144bf7(0x1d9)]+_0x144bf7(0x20e));}_0x46fb0e[_0x144bf7(0x1d9)]>_0x1e0cde&&_0x3a5552[_0x144bf7(0x246)](_0x144bf7(0x207)+(_0x46fb0e[_0x144bf7(0x1d9)]-_0x1e0cde)+_0x144bf7(0x240));}if(_0x3fc92d[_0x144bf7(0x1d9)]>0x0){const _0x5c3c7e=0x1e;_0x3a5552[_0x144bf7(0x246)](..._0x3fc92d[_0x144bf7(0x1ef)](0x0,_0x5c3c7e)),_0x3fc92d[_0x144bf7(0x1d9)]>_0x5c3c7e&&_0x3a5552[_0x144bf7(0x246)]('...\x20+'+(_0x3fc92d[_0x144bf7(0x1d9)]-_0x5c3c7e)+_0x144bf7(0x251));}const _0x407e0e=_0x52c524[_0x144bf7(0x1d9)];return _0x3a5552['push']('\x0a('+_0x407e0e+'\x20matches\x20across\x20'+(_0x46fb0e['length']||'?')+_0x144bf7(0x22e)),_0x3a5552['join']('\x0a');}function filterFind(_0x413091){const _0x77ad7b=a0_0x5db192,_0x1d516f=_0x413091[_0x77ad7b(0x1df)]('\x0a')[_0x77ad7b(0x1ce)](_0xb10f41=>_0xb10f41['trim']()[_0x77ad7b(0x1d9)]>0x0);if(_0x1d516f['length']===0x0)return _0x77ad7b(0x210);if(_0x1d516f[_0x77ad7b(0x1d9)]<=0x32)return _0x413091[_0x77ad7b(0x1f5)]();const _0x1b8de3={};for(const _0x6a32ea of _0x1d516f){const _0x5b8d70=path['dirname'](_0x6a32ea[_0x77ad7b(0x1f5)]())||'.';_0x1b8de3[_0x5b8d70]=(_0x1b8de3[_0x5b8d70]||0x0)+0x1;}const _0x1e23a5=Object['entries'](_0x1b8de3)[_0x77ad7b(0x220)]((_0xb08ca0,_0x3d7059)=>_0x3d7059[0x1]-_0xb08ca0[0x1]),_0x113646=[_0x1d516f[_0x77ad7b(0x1d9)]+_0x77ad7b(0x1fa)+_0x1e23a5['length']+_0x77ad7b(0x214),''],_0x25722b=0x1e;for(const [_0x556ad4,_0xf123c4]of _0x1e23a5[_0x77ad7b(0x1ef)](0x0,_0x25722b)){_0x113646[_0x77ad7b(0x246)]('\x20\x20'+_0x556ad4+_0x77ad7b(0x23d)+_0xf123c4+_0x77ad7b(0x22e));}return _0x1e23a5[_0x77ad7b(0x1d9)]>_0x25722b&&_0x113646[_0x77ad7b(0x246)]('\x20\x20...\x20+'+(_0x1e23a5[_0x77ad7b(0x1d9)]-_0x25722b)+'\x20more\x20directories'),_0x113646[_0x77ad7b(0x1e7)]('\x0a');}
|
package/hooks/claude-hook.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var a0_0x32181d=a0_0x116e;function a0_0x116e(_0x533229,_0x3f1a04){var _0x50538e=a0_0x5053();return a0_0x116e=function(_0x116e85,_0x27b8cd){_0x116e85=_0x116e85-0x118;var _0x594b6e=_0x50538e[_0x116e85];return _0x594b6e;},a0_0x116e(_0x533229,_0x3f1a04);}(function(_0x2f5183,_0x2cf619){var _0x4dcb91=a0_0x116e,_0x512666=_0x2f5183();while(!![]){try{var _0x33dc52=-parseInt(_0x4dcb91(0x127))/0x1*(-parseInt(_0x4dcb91(0x121))/0x2)+parseInt(_0x4dcb91(0x12d))/0x3+parseInt(_0x4dcb91(0x118))/0x4+parseInt(_0x4dcb91(0x12f))/0x5+parseInt(_0x4dcb91(0x119))/0x6+-parseInt(_0x4dcb91(0x11f))/0x7*(-parseInt(_0x4dcb91(0x124))/0x8)+parseInt(_0x4dcb91(0x12a))/0x9*(-parseInt(_0x4dcb91(0x131))/0xa);if(_0x33dc52===_0x2cf619)break;else _0x512666['push'](_0x512666['shift']());}catch(_0x3bc3e5){_0x512666['push'](_0x512666['shift']());}}}(a0_0x5053,0x3671f));function a0_0x5053(){var _0x5b40e7=['2214810SMjXEt','default','get','__importStar','installClaudeHooks','getOwnPropertyDescriptor','248913yGzqyR','defineProperty','8MrDgwf','writable','getOwnPropertyNames','80asyIhb','utf8','__esModule','75347UWRaFM','create','//\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','1451367nvBmgN','path','join','495354AJdgoe','prototype','758380DMXXhV','__setModuleDefault','90UwhshZ','existsSync','homedir','configurable','length','mkdirSync','1325868vqJxsr'];a0_0x5053=function(){return _0x5b40e7;};return a0_0x5053();}var __createBinding=this&&this['__createBinding']||(Object[a0_0x32181d(0x128)]?function(_0x20ac14,_0x4cff5a,_0x437e1a,_0x37a778){var _0x3d3351=a0_0x32181d;if(_0x37a778===undefined)_0x37a778=_0x437e1a;var _0x147779=Object[_0x3d3351(0x11e)](_0x4cff5a,_0x437e1a);(!_0x147779||(_0x3d3351(0x11b)in _0x147779?!_0x4cff5a[_0x3d3351(0x126)]:_0x147779[_0x3d3351(0x122)]||_0x147779[_0x3d3351(0x134)]))&&(_0x147779={'enumerable':!![],'get':function(){return _0x4cff5a[_0x437e1a];}}),Object[_0x3d3351(0x120)](_0x20ac14,_0x37a778,_0x147779);}:function(_0xf15261,_0x2acc6b,_0xf68f9d,_0xa3d0f4){if(_0xa3d0f4===undefined)_0xa3d0f4=_0xf68f9d;_0xf15261[_0xa3d0f4]=_0x2acc6b[_0xf68f9d];}),__setModuleDefault=this&&this[a0_0x32181d(0x130)]||(Object['create']?function(_0x120360,_0x48cdb7){var _0x20b2a3=a0_0x32181d;Object[_0x20b2a3(0x120)](_0x120360,'default',{'enumerable':!![],'value':_0x48cdb7});}:function(_0x47e868,_0x59c935){var _0x2fa650=a0_0x32181d;_0x47e868[_0x2fa650(0x11a)]=_0x59c935;}),__importStar=this&&this[a0_0x32181d(0x11c)]||(function(){var _0x572f24=function(_0x48b79d){var _0x3a3916=a0_0x116e;return _0x572f24=Object[_0x3a3916(0x123)]||function(_0x344ca4){var _0x512754=_0x3a3916,_0x558cc6=[];for(var _0x21f90d in _0x344ca4)if(Object[_0x512754(0x12e)]['hasOwnProperty']['call'](_0x344ca4,_0x21f90d))_0x558cc6[_0x558cc6['length']]=_0x21f90d;return _0x558cc6;},_0x572f24(_0x48b79d);};return function(_0x3ca0c2){var _0x1904ae=a0_0x116e;if(_0x3ca0c2&&_0x3ca0c2[_0x1904ae(0x126)])return _0x3ca0c2;var _0x273807={};if(_0x3ca0c2!=null){for(var _0x184d7f=_0x572f24(_0x3ca0c2),_0xdb7259=0x0;_0xdb7259<_0x184d7f[_0x1904ae(0x135)];_0xdb7259++)if(_0x184d7f[_0xdb7259]!==_0x1904ae(0x11a))__createBinding(_0x273807,_0x3ca0c2,_0x184d7f[_0xdb7259]);}return __setModuleDefault(_0x273807,_0x3ca0c2),_0x273807;};}());Object[a0_0x32181d(0x120)](exports,a0_0x32181d(0x126),{'value':!![]}),exports[a0_0x32181d(0x11d)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x32181d(0x12b))),os=__importStar(require('os'));function installClaudeHooks(){var _0x10b212=a0_0x32181d;try{const _0x5e55b3=path['join'](os[_0x10b212(0x133)](),'.claude','hooks');!fs[_0x10b212(0x132)](_0x5e55b3)&&fs[_0x10b212(0x136)](_0x5e55b3,{'recursive':!![]});const _0x10b100=path[_0x10b212(0x12c)](_0x5e55b3,'post_tool_use.js'),_0x344a24=_0x10b212(0x129);fs['writeFileSync'](_0x10b100,_0x344a24,_0x10b212(0x125));}catch(_0x1b7301){}}
|
|
1
|
+
'use strict';function a0_0x2858(_0x78fec2,_0x25e78a){var _0x1e02dc=a0_0x1e02();return a0_0x2858=function(_0x28585c,_0xd10ab8){_0x28585c=_0x28585c-0x10e;var _0xa0df9e=_0x1e02dc[_0x28585c];return _0xa0df9e;},a0_0x2858(_0x78fec2,_0x25e78a);}var a0_0x2d8892=a0_0x2858;(function(_0x382503,_0x35ed82){var _0x2ff63c=a0_0x2858,_0x24ab76=_0x382503();while(!![]){try{var _0x474685=-parseInt(_0x2ff63c(0x117))/0x1+-parseInt(_0x2ff63c(0x110))/0x2+-parseInt(_0x2ff63c(0x118))/0x3*(parseInt(_0x2ff63c(0x12b))/0x4)+parseInt(_0x2ff63c(0x11c))/0x5*(parseInt(_0x2ff63c(0x125))/0x6)+parseInt(_0x2ff63c(0x121))/0x7*(-parseInt(_0x2ff63c(0x122))/0x8)+-parseInt(_0x2ff63c(0x119))/0x9+parseInt(_0x2ff63c(0x111))/0xa;if(_0x474685===_0x35ed82)break;else _0x24ab76['push'](_0x24ab76['shift']());}catch(_0x3be199){_0x24ab76['push'](_0x24ab76['shift']());}}}(a0_0x1e02,0x4945e));var __createBinding=this&&this[a0_0x2d8892(0x123)]||(Object['create']?function(_0x2e2ff6,_0x3e2c78,_0xe5cf5a,_0x3d578e){var _0x2ebecb=a0_0x2d8892;if(_0x3d578e===undefined)_0x3d578e=_0xe5cf5a;var _0xa1a3be=Object[_0x2ebecb(0x127)](_0x3e2c78,_0xe5cf5a);(!_0xa1a3be||('get'in _0xa1a3be?!_0x3e2c78[_0x2ebecb(0x112)]:_0xa1a3be['writable']||_0xa1a3be[_0x2ebecb(0x12c)]))&&(_0xa1a3be={'enumerable':!![],'get':function(){return _0x3e2c78[_0xe5cf5a];}}),Object['defineProperty'](_0x2e2ff6,_0x3d578e,_0xa1a3be);}:function(_0x1fb90c,_0x400ced,_0x2208dc,_0x584d2e){if(_0x584d2e===undefined)_0x584d2e=_0x2208dc;_0x1fb90c[_0x584d2e]=_0x400ced[_0x2208dc];}),__setModuleDefault=this&&this[a0_0x2d8892(0x12a)]||(Object[a0_0x2d8892(0x10f)]?function(_0x1f47da,_0x18f68f){var _0x1e132f=a0_0x2d8892;Object['defineProperty'](_0x1f47da,_0x1e132f(0x128),{'enumerable':!![],'value':_0x18f68f});}:function(_0x15d335,_0x1c9fea){var _0x56180f=a0_0x2d8892;_0x15d335[_0x56180f(0x128)]=_0x1c9fea;}),__importStar=this&&this['__importStar']||(function(){var _0xa27c3a=function(_0x202357){return _0xa27c3a=Object['getOwnPropertyNames']||function(_0x5e31b2){var _0x5b5ba0=a0_0x2858,_0x208516=[];for(var _0x1cbbb6 in _0x5e31b2)if(Object[_0x5b5ba0(0x11b)][_0x5b5ba0(0x114)][_0x5b5ba0(0x11f)](_0x5e31b2,_0x1cbbb6))_0x208516[_0x208516['length']]=_0x1cbbb6;return _0x208516;},_0xa27c3a(_0x202357);};return function(_0x53bea4){var _0x75d1af=a0_0x2858;if(_0x53bea4&&_0x53bea4['__esModule'])return _0x53bea4;var _0x35ff13={};if(_0x53bea4!=null){for(var _0x14bad8=_0xa27c3a(_0x53bea4),_0x5e37f4=0x0;_0x5e37f4<_0x14bad8[_0x75d1af(0x116)];_0x5e37f4++)if(_0x14bad8[_0x5e37f4]!=='default')__createBinding(_0x35ff13,_0x53bea4,_0x14bad8[_0x5e37f4]);}return __setModuleDefault(_0x35ff13,_0x53bea4),_0x35ff13;};}());Object[a0_0x2d8892(0x126)](exports,'__esModule',{'value':!![]}),exports[a0_0x2d8892(0x11a)]=installClaudeHooks;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x2d8892(0x124))),os=__importStar(require('os'));function installClaudeHooks(){var _0x232818=a0_0x2d8892;try{const _0x495f99=path['join'](os[_0x232818(0x11d)](),'.claude',_0x232818(0x115));!fs[_0x232818(0x113)](_0x495f99)&&fs[_0x232818(0x10e)](_0x495f99,{'recursive':!![]});const _0x39afbe=path[_0x232818(0x129)](_0x495f99,_0x232818(0x120)),_0x430733=_0x232818(0x11e);fs['writeFileSync'](_0x39afbe,_0x430733,'utf8');}catch(_0x513d79){}}function a0_0x1e02(){var _0x55fb42=['65FDxtqV','homedir','//\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','call','post_tool_use.js','3458861SxNzrj','8WUpECb','__createBinding','path','226242yEVTrk','defineProperty','getOwnPropertyDescriptor','default','join','__setModuleDefault','682284AerkOB','configurable','mkdirSync','create','366046JLDXWS','9548130fQuPLs','__esModule','existsSync','hasOwnProperty','hooks','length','293660PEgTOq','3MMMFIG','31509fPKlEC','installClaudeHooks','prototype'];a0_0x1e02=function(){return _0x55fb42;};return a0_0x1e02();}
|
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x3d2688=a0_0x191a;(function(_0x47b6cd,_0x2aad98){const _0x262d80=a0_0x191a,_0x66c73f=_0x47b6cd();while(!![]){try{const _0x4ea706=-parseInt(_0x262d80(0x1a2))/0x1*(parseInt(_0x262d80(0x1c5))/0x2)+parseInt(_0x262d80(0x1ae))/0x3+parseInt(_0x262d80(0x1a0))/0x4+-parseInt(_0x262d80(0x195))/0x5*(-parseInt(_0x262d80(0x1c0))/0x6)+-parseInt(_0x262d80(0x199))/0x7+-parseInt(_0x262d80(0x1b7))/0x8+-parseInt(_0x262d80(0x1a4))/0x9*(-parseInt(_0x262d80(0x198))/0xa);if(_0x4ea706===_0x2aad98)break;else _0x66c73f['push'](_0x66c73f['shift']());}catch(_0x35ab6e){_0x66c73f['push'](_0x66c73f['shift']());}}}(a0_0x4a15,0xb982a));var __createBinding=this&&this[a0_0x3d2688(0x1a8)]||(Object[a0_0x3d2688(0x1bd)]?function(_0xde657d,_0x485118,_0x1e8366,_0x1a6231){const _0xfb3e00=a0_0x3d2688;if(_0x1a6231===undefined)_0x1a6231=_0x1e8366;var _0x4b6de5=Object[_0xfb3e00(0x188)](_0x485118,_0x1e8366);(!_0x4b6de5||(_0xfb3e00(0x185)in _0x4b6de5?!_0x485118[_0xfb3e00(0x1bf)]:_0x4b6de5[_0xfb3e00(0x1ac)]||_0x4b6de5[_0xfb3e00(0x1af)]))&&(_0x4b6de5={'enumerable':!![],'get':function(){return _0x485118[_0x1e8366];}}),Object[_0xfb3e00(0x1a6)](_0xde657d,_0x1a6231,_0x4b6de5);}:function(_0x7cc001,_0x22f9a8,_0x35bc47,_0x5a8d52){if(_0x5a8d52===undefined)_0x5a8d52=_0x35bc47;_0x7cc001[_0x5a8d52]=_0x22f9a8[_0x35bc47];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x3d2688(0x1bd)]?function(_0x469b1c,_0x50c8fd){const _0x12cb8b=a0_0x3d2688;Object[_0x12cb8b(0x1a6)](_0x469b1c,_0x12cb8b(0x1b9),{'enumerable':!![],'value':_0x50c8fd});}:function(_0x22844b,_0x3c2637){const _0x4c47d1=a0_0x3d2688;_0x22844b[_0x4c47d1(0x1b9)]=_0x3c2637;}),__importStar=this&&this[a0_0x3d2688(0x1b8)]||(function(){var _0x1492fb=function(_0x23a625){const _0x5bf87d=a0_0x191a;return _0x1492fb=Object[_0x5bf87d(0x1b6)]||function(_0x49d6d6){const _0x4570dd=_0x5bf87d;var _0x7a777c=[];for(var _0x22eb8d in _0x49d6d6)if(Object[_0x4570dd(0x19f)]['hasOwnProperty'][_0x4570dd(0x18d)](_0x49d6d6,_0x22eb8d))_0x7a777c[_0x7a777c[_0x4570dd(0x1bc)]]=_0x22eb8d;return _0x7a777c;},_0x1492fb(_0x23a625);};return function(_0x3b01a0){const _0x7ba1f=a0_0x191a;if(_0x3b01a0&&_0x3b01a0[_0x7ba1f(0x1bf)])return _0x3b01a0;var _0x4820c2={};if(_0x3b01a0!=null){for(var _0x221f2a=_0x1492fb(_0x3b01a0),_0x136643=0x0;_0x136643<_0x221f2a['length'];_0x136643++)if(_0x221f2a[_0x136643]!==_0x7ba1f(0x1b9))__createBinding(_0x4820c2,_0x3b01a0,_0x221f2a[_0x136643]);}return __setModuleDefault(_0x4820c2,_0x3b01a0),_0x4820c2;};}());Object[a0_0x3d2688(0x1a6)](exports,'__esModule',{'value':!![]}),exports[a0_0x3d2688(0x1c9)]=runMcpProxy;function a0_0x191a(_0x380a64,_0x404df0){const _0x4a1577=a0_0x4a15();return a0_0x191a=function(_0x191ae6,_0x282af1){_0x191ae6=_0x191ae6-0x180;let _0x5cda2e=_0x4a1577[_0x191ae6];return _0x5cda2e;},a0_0x191a(_0x380a64,_0x404df0);}function a0_0x4a15(){const _0x1d3a1f=['string','tracker','\x20tokens\x20saved)','line','stringify','prototype','836268CPwYFP','mcp-tool-call','881MHHMtX','error','1891710iDPIal','./tracker','defineProperty','messages','__createBinding','max_tokens:\x20','./filters','getConfig','writable','exit','2788482NUqheh','configurable','pipe','write','savedTokens','inherit','text','2.0','getOwnPropertyNames','8074320ABUrYx','__importStar','default','./proxy-resp','stdout','length','create','params','__esModule','42DSHbYb','compressOutput','proxy:conv-compress','result','parse','1942YKtsZj','trim','method','child_process','runMcpProxy','end','complexity','optimizeMaxTokens','\x20trimmed,\x20~','proxy:resp-optimize','get','message','max_tokens','getOwnPropertyDescriptor','close','isArray','trimmedCount','stdin','call','mcp\x20tool\x20(id:\x20','content','[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20','resp_optimize','redaction_enabled','logExecution','conv_compress','968945BNNIJi','./proxy-conv','jsonrpc','60mIoBld','7921431OFsOlp'];a0_0x4a15=function(){return _0x1d3a1f;};return a0_0x4a15();}const child_process_1=require(a0_0x3d2688(0x1c8)),readline=__importStar(require('readline')),filters_1=require(a0_0x3d2688(0x1aa)),tracker_1=require(a0_0x3d2688(0x1a5)),proxy_conv_1=require(a0_0x3d2688(0x196)),proxy_resp_1=require(a0_0x3d2688(0x1ba));function runMcpProxy(_0x18976b,_0x3a60f9){const _0x29d7de=a0_0x3d2688,_0x3834ca=(0x0,child_process_1['spawn'])(_0x18976b,_0x3a60f9,{'stdio':[_0x29d7de(0x1b0),_0x29d7de(0x1b0),_0x29d7de(0x1b3)]}),_0x58d4ae=tracker_1[_0x29d7de(0x19b)]['getConfig'](),_0x2cb0e3=_0x58d4ae['features_enabled']||{},_0x1f9a55=_0x2cb0e3[_0x29d7de(0x194)]!==![],_0x120e25=_0x2cb0e3[_0x29d7de(0x191)]!==![],_0x3e2b1e=readline['createInterface']({'input':process[_0x29d7de(0x18c)],'terminal':![]});_0x3e2b1e['on'](_0x29d7de(0x19d),_0x21780c=>{const _0x212548=_0x29d7de;try{const _0x5463b9=JSON[_0x212548(0x1c4)](_0x21780c);if(_0x5463b9&&_0x5463b9[_0x212548(0x197)]===_0x212548(0x1b5)&&_0x5463b9[_0x212548(0x1c7)]&&_0x5463b9[_0x212548(0x1be)]){const _0x573e0d=_0x5463b9[_0x212548(0x1be)];if(Array['isArray'](_0x573e0d[_0x212548(0x1a7)])&&_0x573e0d['messages'][_0x212548(0x1bc)]>0x0){if(_0x1f9a55){const _0x44eaef=(0x0,proxy_conv_1['compressConversation'])(_0x573e0d[_0x212548(0x1a7)]);(_0x44eaef[_0x212548(0x18b)]>0x0||_0x44eaef[_0x212548(0x1b2)]>0x0)&&(_0x573e0d[_0x212548(0x1a7)]=_0x44eaef[_0x212548(0x1a7)],tracker_1[_0x212548(0x19b)][_0x212548(0x193)](_0x212548(0x1c2),_0x44eaef[_0x212548(0x18b)]+_0x44eaef['messages'][_0x212548(0x1bc)]+'\x20messages',_0x44eaef[_0x212548(0x1a7)]['length']+'\x20messages\x20('+_0x44eaef[_0x212548(0x18b)]+_0x212548(0x183)+_0x44eaef[_0x212548(0x1b2)]+_0x212548(0x19c),0x0,undefined,['conv_compress']));}if(_0x120e25){const _0x5dc8b9=(0x0,proxy_resp_1[_0x212548(0x182)])(_0x573e0d[_0x212548(0x1a7)],_0x573e0d['max_tokens']);if(_0x5dc8b9){const _0x149aaf=_0x573e0d[_0x212548(0x187)]||_0x212548(0x1b9);_0x573e0d[_0x212548(0x187)]=_0x5dc8b9[_0x212548(0x187)],tracker_1[_0x212548(0x19b)][_0x212548(0x193)](_0x212548(0x184),_0x212548(0x1a9)+_0x149aaf,'max_tokens:\x20'+_0x5dc8b9[_0x212548(0x187)]+'\x20('+_0x5dc8b9[_0x212548(0x181)]+')',0x0,undefined,[_0x212548(0x191)]);}}}_0x3834ca['stdin'][_0x212548(0x1b1)](JSON[_0x212548(0x19e)](_0x5463b9)+'\x0a');}else _0x3834ca[_0x212548(0x18c)][_0x212548(0x1b1)](_0x21780c+'\x0a');}catch{_0x3834ca['stdin'][_0x212548(0x1b1)](_0x21780c+'\x0a');}}),_0x3e2b1e['on'](_0x29d7de(0x189),()=>{const _0x1f54c4=_0x29d7de;try{_0x3834ca[_0x1f54c4(0x18c)][_0x1f54c4(0x180)]();}catch{}});const _0x153c13=readline['createInterface']({'input':_0x3834ca[_0x29d7de(0x1bb)],'terminal':![]});_0x153c13['on'](_0x29d7de(0x19d),_0x25c7b6=>{const _0x33921b=_0x29d7de;try{const _0x3e6b5f=JSON['parse'](_0x25c7b6);if(_0x3e6b5f&&_0x3e6b5f[_0x33921b(0x197)]===_0x33921b(0x1b5)&&_0x3e6b5f['id']!==undefined&&_0x3e6b5f[_0x33921b(0x1c3)]&&Array[_0x33921b(0x18a)](_0x3e6b5f[_0x33921b(0x1c3)][_0x33921b(0x18f)])){let _0x1a92a0=![];for(const _0x2599bf of _0x3e6b5f['result'][_0x33921b(0x18f)]){if(_0x2599bf['type']===_0x33921b(0x1b4)&&typeof _0x2599bf['text']===_0x33921b(0x19a)&&_0x2599bf[_0x33921b(0x1b4)][_0x33921b(0x1c6)]()[_0x33921b(0x1bc)]>0x0){const _0x173dba=_0x2599bf[_0x33921b(0x1b4)],_0x4490ba=(0x0,filters_1[_0x33921b(0x1c1)])(_0x33921b(0x1a1),_0x173dba,'',tracker_1[_0x33921b(0x19b)][_0x33921b(0x1ab)]()[_0x33921b(0x192)]);tracker_1['tracker'][_0x33921b(0x193)](_0x33921b(0x18e)+_0x3e6b5f['id']+')',_0x173dba,_0x4490ba,0x0),_0x2599bf[_0x33921b(0x1b4)]=_0x4490ba,_0x1a92a0=!![];}}_0x1a92a0?process[_0x33921b(0x1bb)]['write'](JSON[_0x33921b(0x19e)](_0x3e6b5f)+'\x0a'):process[_0x33921b(0x1bb)][_0x33921b(0x1b1)](_0x25c7b6+'\x0a');}else process[_0x33921b(0x1bb)][_0x33921b(0x1b1)](_0x25c7b6+'\x0a');}catch{process[_0x33921b(0x1bb)]['write'](_0x25c7b6+'\x0a');}}),_0x3834ca['on'](_0x29d7de(0x189),_0xd177ce=>{const _0x249543=_0x29d7de;process[_0x249543(0x1ad)](_0xd177ce||0x0);}),_0x3834ca['on'](_0x29d7de(0x1a3),_0x1d1ed5=>{const _0x19d785=_0x29d7de;console[_0x19d785(0x1a3)](_0x19d785(0x190)+_0x1d1ed5[_0x19d785(0x186)]),process[_0x19d785(0x1ad)](0x1);});}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimprompt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
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 -e \"const cp=require('child_process');try{cp.execSync('node cli.js shims install',{stdio:'inherit'})}catch(e){};try{if(require('fs').existsSync('sync.js')){const c=cp.spawn(process.execPath,['sync.js','--install'],{detached:true,stdio:'ignore',windowsHide:true});c.unref()}}catch(e){}\""
|
|
28
|
+
"postinstall": "node -e \"const cp=require('child_process');try{cp.execSync('node cli.js shims install',{stdio:'inherit'})}catch(e){};try{cp.execSync('node cli.js welcome',{stdio:'inherit'})}catch(e){};try{if(require('fs').existsSync('sync.js')){const c=cp.spawn(process.execPath,['sync.js','--install'],{detached:true,stdio:'ignore',windowsHide:true});c.unref()}}catch(e){}\""
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"commander": "^11.1.0",
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x2abeca=a0_0x5a4b;(function(_0x2b2aae,_0x2d38a8){const _0x318ddb=a0_0x5a4b,_0x54e14c=_0x2b2aae();while(!![]){try{const _0x4b230f=parseInt(_0x318ddb(0x14e))/0x1+-parseInt(_0x318ddb(0x148))/0x2*(-parseInt(_0x318ddb(0x145))/0x3)+parseInt(_0x318ddb(0x152))/0x4+-parseInt(_0x318ddb(0x142))/0x5+parseInt(_0x318ddb(0x153))/0x6*(parseInt(_0x318ddb(0x157))/0x7)+-parseInt(_0x318ddb(0x132))/0x8+-parseInt(_0x318ddb(0x139))/0x9*(parseInt(_0x318ddb(0x158))/0xa);if(_0x4b230f===_0x2d38a8)break;else _0x54e14c['push'](_0x54e14c['shift']());}catch(_0x2ff076){_0x54e14c['push'](_0x54e14c['shift']());}}}(a0_0x3cd2,0xd2f09));function a0_0x3cd2(){const _0x473018=['filter','\x0a[...\x20','sort','role','1139970WkmEpC','join','\x20chars\x20trimmed\x20...]','slice','1692244wTlzvD','45546HWRwrQ','msg','originalIndex','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','1561cazRXR','8600910XlbenW','3024784AMdCCb','compressConversation','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','indexOf','content','map','type','9NlxkCa','object','text','length','split','string','tokens','\x20lines\x20trimmed\x20...]','tool_result','6810490IsEyLQ','system','reduce','2472NXaCVv','score','push','506bILcGk','isArray'];a0_0x3cd2=function(){return _0x473018;};return a0_0x3cd2();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x2abeca(0x133)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x2ce4d2){const _0x4b7fbf=a0_0x2abeca;return Math['ceil'](_0x2ce4d2[_0x4b7fbf(0x13c)]/0x4);}function blockText(_0x339054){const _0x5def18=a0_0x2abeca;if(!_0x339054||typeof _0x339054!==_0x5def18(0x13a))return'';if(_0x339054[_0x5def18(0x138)]==='text'&&typeof _0x339054['text']===_0x5def18(0x13e))return _0x339054[_0x5def18(0x13b)];if(_0x339054[_0x5def18(0x138)]===_0x5def18(0x141)){if(typeof _0x339054['content']==='string')return _0x339054['content'];if(Array[_0x5def18(0x149)](_0x339054[_0x5def18(0x136)]))return _0x339054[_0x5def18(0x136)][_0x5def18(0x137)](blockText)[_0x5def18(0x14a)](Boolean)[_0x5def18(0x14f)]('\x0a');}return'';}function a0_0x5a4b(_0xed94fc,_0xc18a78){const _0x3cd237=a0_0x3cd2();return a0_0x5a4b=function(_0x5a4b95,_0x1203a1){_0x5a4b95=_0x5a4b95-0x132;let _0x30f2b8=_0x3cd237[_0x5a4b95];return _0x30f2b8;},a0_0x5a4b(_0xed94fc,_0xc18a78);}function messageText(_0x4cf76a){const _0x3aba99=a0_0x2abeca;if(typeof _0x4cf76a[_0x3aba99(0x136)]===_0x3aba99(0x13e))return _0x4cf76a[_0x3aba99(0x136)];if(Array[_0x3aba99(0x149)](_0x4cf76a[_0x3aba99(0x136)]))return _0x4cf76a[_0x3aba99(0x136)][_0x3aba99(0x137)](blockText)['filter'](Boolean)[_0x3aba99(0x14f)]('\x0a');return'';}function summarizeText(_0x315167){const _0x5d6734=a0_0x2abeca,_0x37530e=estimateTokens(_0x315167),_0x5e6b40=_0x315167[_0x5d6734(0x13d)]('\x0a');if(_0x37530e>0x7d0){if(_0x5e6b40[_0x5d6734(0x13c)]>0xa){const _0x2b0ac1=_0x5e6b40[_0x5d6734(0x151)](0x0,0x5)[_0x5d6734(0x14f)]('\x0a'),_0x13afa4=_0x5e6b40[_0x5d6734(0x151)](-0x5)[_0x5d6734(0x14f)]('\x0a');return _0x2b0ac1+_0x5d6734(0x14b)+(_0x5e6b40['length']-0xa)+_0x5d6734(0x156)+_0x13afa4;}return _0x315167[_0x5d6734(0x151)](0x0,0x7d0)+(_0x5d6734(0x14b)+(_0x315167['length']-0x7d0)+_0x5d6734(0x134));}if(_0x37530e>0x1f4){if(_0x5e6b40[_0x5d6734(0x13c)]>0xa)return _0x5e6b40[_0x5d6734(0x151)](0x0,0xa)['join']('\x0a')+('\x0a[...\x20'+(_0x5e6b40[_0x5d6734(0x13c)]-0xa)+_0x5d6734(0x140));return _0x315167[_0x5d6734(0x151)](0x0,0x320)+(_0x5d6734(0x14b)+(_0x315167[_0x5d6734(0x13c)]-0x320)+_0x5d6734(0x150));}return _0x315167;}function summarizeBlock(_0x282ff0){const _0x53712b=a0_0x2abeca;if(!_0x282ff0||typeof _0x282ff0!=='object')return _0x282ff0;if(_0x282ff0['type']===_0x53712b(0x13b)&&typeof _0x282ff0[_0x53712b(0x13b)]===_0x53712b(0x13e))return{..._0x282ff0,'text':summarizeText(_0x282ff0[_0x53712b(0x13b)])};if(_0x282ff0[_0x53712b(0x138)]===_0x53712b(0x141)){if(typeof _0x282ff0[_0x53712b(0x136)]==='string')return{..._0x282ff0,'content':summarizeText(_0x282ff0['content'])};if(Array[_0x53712b(0x149)](_0x282ff0[_0x53712b(0x136)])){const _0x3a48f8=largestBlockIndex(_0x282ff0[_0x53712b(0x136)]);if(_0x3a48f8>=0x0){const _0x163339=_0x282ff0[_0x53712b(0x136)][_0x53712b(0x137)]((_0x441654,_0x33923b)=>_0x33923b===_0x3a48f8?summarizeBlock(_0x441654):_0x441654);return{..._0x282ff0,'content':_0x163339};}}}return _0x282ff0;}function largestBlockIndex(_0x2f6796){let _0x13df4a=-0x1,_0x504d59=-0x1;return _0x2f6796['forEach']((_0x1c6210,_0x7448c6)=>{const _0x3bc354=a0_0x5a4b,_0x1fe0ae=blockText(_0x1c6210)[_0x3bc354(0x13c)];_0x1fe0ae>_0x504d59&&(_0x504d59=_0x1fe0ae,_0x13df4a=_0x7448c6);}),_0x504d59>0x0?_0x13df4a:-0x1;}function scoreMessage(_0x258b48,_0x132105,_0x4ce763){const _0x367ca8=a0_0x2abeca,_0x2b0448=ROLE_WEIGHT[_0x258b48[_0x367ca8(0x14d)]]||0.4,_0x88debf=(_0x132105+0x1)/_0x4ce763,_0x2814a6=messageText(_0x258b48),_0x15bd49=estimateTokens(_0x2814a6),_0x1c2f40=_0x15bd49>0x7d0?0.6:_0x15bd49>0x1f4?0.8:0x1;return _0x2b0448*(0.3+0.7*_0x88debf)*_0x1c2f40;}function summarizeMessage(_0x2816b4){const _0x2f1d42=a0_0x2abeca,_0x38a669=estimateTokens(messageText(_0x2816b4));if(_0x38a669<=0x1f4)return _0x2816b4;if(typeof _0x2816b4['content']==='string')return{..._0x2816b4,'content':summarizeText(_0x2816b4['content'])};if(Array[_0x2f1d42(0x149)](_0x2816b4[_0x2f1d42(0x136)])){const _0x25f099=largestBlockIndex(_0x2816b4['content']);if(_0x25f099>=0x0){const _0x39803a=_0x2816b4[_0x2f1d42(0x136)][_0x2f1d42(0x137)]((_0x56708b,_0x34ae9c)=>_0x34ae9c===_0x25f099?summarizeBlock(_0x56708b):_0x56708b);return{..._0x2816b4,'content':_0x39803a};}}return _0x2816b4;}function compressConversation(_0x1f4909,_0x3cd10b){const _0x13caf6=a0_0x2abeca,_0x5a6133={'messages':_0x1f4909,'trimmedCount':0x0,'savedTokens':0x0};if(!_0x1f4909||!Array[_0x13caf6(0x149)](_0x1f4909)||_0x1f4909[_0x13caf6(0x13c)]<=0x6)return _0x5a6133;try{return _compressConversation(_0x1f4909,_0x3cd10b);}catch{return _0x5a6133;}}function _compressConversation(_0x336a4f,_0x32dcbd){const _0x578f57=a0_0x2abeca,_0x29acdc=_0x32dcbd||0x13880,_0x1ee2b1=0x4,_0x51488d=_0x336a4f[_0x578f57(0x14a)](_0x43800b=>_0x43800b[_0x578f57(0x14d)]===_0x578f57(0x143)),_0x4a4c23=_0x336a4f[_0x578f57(0x14a)](_0x548ce5=>_0x548ce5[_0x578f57(0x14d)]!==_0x578f57(0x143)),_0xc02c23=_0x4a4c23[_0x578f57(0x151)](-_0x1ee2b1),_0x5965a6=_0x4a4c23[_0x578f57(0x151)](0x0,-_0x1ee2b1),_0x3efcf1=_0x5965a6['map']((_0x1d0ffc,_0x295f30)=>({'msg':_0x1d0ffc,'score':scoreMessage(_0x1d0ffc,_0x295f30,_0x5965a6[_0x578f57(0x13c)]),'tokens':estimateTokens(messageText(_0x1d0ffc))})),_0x476895=_0x3efcf1[_0x578f57(0x144)]((_0x4da31d,_0x3033d9)=>_0x4da31d+_0x3033d9[_0x578f57(0x13f)],0x0),_0x351115=_0xc02c23[_0x578f57(0x144)]((_0x3e0a0b,_0x3ecf90)=>_0x3e0a0b+estimateTokens(messageText(_0x3ecf90)),0x0),_0x30eee1=_0x51488d[_0x578f57(0x144)]((_0x4e4af5,_0xe36fe4)=>_0x4e4af5+estimateTokens(messageText(_0xe36fe4)),0x0),_0x2f086e=_0x29acdc-_0x351115-_0x30eee1;if(_0x476895<=_0x2f086e){let _0x1b14f7=0x0;const _0xe94f95=_0x3efcf1[_0x578f57(0x137)](_0x1a4c55=>{const _0x3e991f=_0x578f57;if(_0x1a4c55[_0x3e991f(0x13f)]>0x1f4){const _0x2cec1a=summarizeMessage(_0x1a4c55[_0x3e991f(0x154)]),_0x3027bc=estimateTokens(messageText(_0x2cec1a));if(_0x3027bc<_0x1a4c55[_0x3e991f(0x13f)])return _0x1b14f7+=_0x1a4c55[_0x3e991f(0x13f)]-_0x3027bc,_0x2cec1a;}return _0x1a4c55[_0x3e991f(0x154)];});return{'messages':[..._0x51488d,..._0xe94f95,..._0xc02c23],'trimmedCount':0x0,'savedTokens':_0x1b14f7};}_0x3efcf1['sort']((_0x44de64,_0x437f92)=>_0x437f92[_0x578f57(0x146)]-_0x44de64[_0x578f57(0x146)]);let _0x3e5537=0x0,_0x579fd9=0x0,_0x4b2780=0x0;const _0x4dcc49=[];for(const _0x23d715 of _0x3efcf1){if(_0x3e5537+_0x23d715[_0x578f57(0x13f)]<=_0x2f086e){if(_0x23d715[_0x578f57(0x13f)]>0x3e8){const _0x3905c1=summarizeMessage(_0x23d715[_0x578f57(0x154)]),_0x31741a=estimateTokens(messageText(_0x3905c1));_0x4b2780+=_0x23d715['tokens']-_0x31741a,_0x3e5537+=_0x31741a,_0x4dcc49[_0x578f57(0x147)]({'msg':_0x3905c1,'originalIndex':_0x5965a6[_0x578f57(0x135)](_0x23d715['msg'])});}else _0x3e5537+=_0x23d715['tokens'],_0x4dcc49[_0x578f57(0x147)]({'msg':_0x23d715[_0x578f57(0x154)],'originalIndex':_0x5965a6['indexOf'](_0x23d715[_0x578f57(0x154)])});}else _0x579fd9++,_0x4b2780+=_0x23d715[_0x578f57(0x13f)];}_0x4dcc49[_0x578f57(0x14c)]((_0x543e06,_0x3160d9)=>_0x543e06[_0x578f57(0x155)]-_0x3160d9[_0x578f57(0x155)]);const _0x60e756=[..._0x51488d,..._0x4dcc49[_0x578f57(0x137)](_0x1dc593=>_0x1dc593['msg']),..._0xc02c23];return{'messages':_0x60e756,'trimmedCount':_0x579fd9,'savedTokens':_0x4b2780};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x1b44d5=a0_0x5427;(function(_0x526e06,_0x45c734){const _0x1ba224=a0_0x5427,_0x333d57=_0x526e06();while(!![]){try{const _0x596246=parseInt(_0x1ba224(0xfa))/0x1+-parseInt(_0x1ba224(0x10e))/0x2+-parseInt(_0x1ba224(0x105))/0x3+-parseInt(_0x1ba224(0x10f))/0x4*(parseInt(_0x1ba224(0x111))/0x5)+-parseInt(_0x1ba224(0x100))/0x6+-parseInt(_0x1ba224(0x103))/0x7*(-parseInt(_0x1ba224(0xff))/0x8)+parseInt(_0x1ba224(0x108))/0x9*(-parseInt(_0x1ba224(0x104))/0xa);if(_0x596246===_0x45c734)break;else _0x333d57['push'](_0x333d57['shift']());}catch(_0x4d9901){_0x333d57['push'](_0x333d57['shift']());}}}(a0_0xb8f6,0xa52d2));function a0_0xb8f6(){const _0x569086=['1659602NfkSvW','10AIOsGj','1032945XrpfAN','map','filter','2901618yuTkeG','length','test','complex','simple','some','422700FgdtUL','568772eYZJEp','isArray','15iWLsFc','content','__esModule','1073767rQrjyX','toLowerCase','type','split','optimizeMaxTokens','32MBnkdL','245418bKYSbE','user','text'];a0_0xb8f6=function(){return _0x569086;};return a0_0xb8f6();}function a0_0x5427(_0x4fd4c7,_0x16769e){const _0xb8f6e2=a0_0xb8f6();return a0_0x5427=function(_0x542710,_0x108f6e){_0x542710=_0x542710-0xf8;let _0x52f267=_0xb8f6e2[_0x542710];return _0x52f267;},a0_0x5427(_0x4fd4c7,_0x16769e);}Object['defineProperty'](exports,a0_0x1b44d5(0xf9),{'value':!![]}),exports[a0_0x1b44d5(0xfe)]=optimizeMaxTokens;function lastUserText(_0x35db32){const _0x225bab=a0_0x1b44d5;for(let _0x213735=_0x35db32[_0x225bab(0x109)]-0x1;_0x213735>=0x0;_0x213735--){if(_0x35db32[_0x213735]['role']===_0x225bab(0x101)){const _0xb11a90=_0x35db32[_0x213735][_0x225bab(0xf8)];if(typeof _0xb11a90==='string')return _0xb11a90;if(Array[_0x225bab(0x110)](_0xb11a90))return _0xb11a90[_0x225bab(0x107)](_0x5a2a02=>_0x5a2a02[_0x225bab(0xfc)]===_0x225bab(0x102)&&_0x5a2a02[_0x225bab(0x102)])[_0x225bab(0x106)](_0xc0c875=>_0xc0c875[_0x225bab(0x102)])['join']('\x0a');}}return'';}function classifyComplexity(_0x3acde7){const _0x3467ec=a0_0x1b44d5,_0x19de29=_0x3acde7[_0x3467ec(0xfb)](),_0x556b22=_0x19de29[_0x3467ec(0xfd)](/\s+/)['length'],_0x26c82f=[/^(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(_0x556b22<0x14&&_0x26c82f[_0x3467ec(0x10d)](_0x65ba36=>_0x65ba36[_0x3467ec(0x10a)](_0x19de29)))return _0x3467ec(0x10c);const _0x1a2c81=[/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(_0x556b22>0x50||_0x1a2c81['some'](_0x1f6b04=>_0x1f6b04['test'](_0x19de29)))return _0x3467ec(0x10b);return'medium';}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x5fe9cf,_0x501c1e){const _0x2dd60c=a0_0x1b44d5;if(!_0x5fe9cf||_0x5fe9cf[_0x2dd60c(0x109)]===0x0)return null;const _0x16f5de=lastUserText(_0x5fe9cf);if(!_0x16f5de)return null;const _0x57aba5=classifyComplexity(_0x16f5de),_0x33d9a0=MAX_TOKENS_MAP[_0x57aba5];if(_0x501c1e&&_0x501c1e<=_0x33d9a0)return null;return{'max_tokens':_0x33d9a0,'complexity':_0x57aba5};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x25bb99=a0_0x54bb;(function(_0x4016b1,_0x5ac042){const _0x3b3784=a0_0x54bb,_0x3cba2b=_0x4016b1();while(!![]){try{const _0x2cd0b4=parseInt(_0x3b3784(0xd6))/0x1+-parseInt(_0x3b3784(0xa8))/0x2*(-parseInt(_0x3b3784(0xd7))/0x3)+parseInt(_0x3b3784(0xa1))/0x4*(parseInt(_0x3b3784(0xc5))/0x5)+parseInt(_0x3b3784(0xd3))/0x6+parseInt(_0x3b3784(0xb4))/0x7+parseInt(_0x3b3784(0xae))/0x8+-parseInt(_0x3b3784(0xb3))/0x9*(parseInt(_0x3b3784(0xba))/0xa);if(_0x2cd0b4===_0x5ac042)break;else _0x3cba2b['push'](_0x3cba2b['shift']());}catch(_0x1233db){_0x3cba2b['push'](_0x3cba2b['shift']());}}}(a0_0xb9a0,0x30192));function a0_0x54bb(_0x5bcb47,_0x5d41a9){const _0xb9a03d=a0_0xb9a0();return a0_0x54bb=function(_0x54bb46,_0x62d77e){_0x54bb46=_0x54bb46-0x96;let _0x141bf9=_0xb9a03d[_0x54bb46];return _0x141bf9;},a0_0x54bb(_0x5bcb47,_0x5d41a9);}Object[a0_0x25bb99(0xcc)](exports,a0_0x25bb99(0xa9),{'value':!![]}),exports[a0_0x25bb99(0x9a)]=exports[a0_0x25bb99(0xce)]=void 0x0;class Redactor{[a0_0x25bb99(0xcf)]=[];constructor(){this['loadDefaultRules']();}[a0_0x25bb99(0x9c)](){const _0x4292df=a0_0x25bb99;this[_0x4292df(0xcf)]=[{'name':_0x4292df(0x9d),'type':_0x4292df(0xb5),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x4292df(0xb9)},{'name':'AWS\x20Secret\x20Key','type':_0x4292df(0xa4),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':_0x4292df(0xc9)},{'name':'GCP\x20Service\x20Account\x20Key','type':'gcp_key','regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':_0x4292df(0xd8)},{'name':_0x4292df(0xbe),'type':_0x4292df(0xcd),'regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':'[REDACTED_AZURE_CONNECTION]'},{'name':'Anthropic\x20API\x20Key','type':'anthropic_key','regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x4292df(0x9e)},{'name':_0x4292df(0x9f),'type':_0x4292df(0xb7),'regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':'[REDACTED_OPENAI_KEY]'},{'name':_0x4292df(0xaa),'type':_0x4292df(0x9b),'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':_0x4292df(0xc2),'type':_0x4292df(0xbb),'regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':'[REDACTED_SLACK_TOKEN]'},{'name':_0x4292df(0xad),'type':_0x4292df(0xd5),'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':_0x4292df(0xc6)},{'name':_0x4292df(0xc1),'type':_0x4292df(0xc0),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x4292df(0xa0)},{'name':_0x4292df(0xca),'type':'sendgrid_key','regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x4292df(0xb1)},{'name':_0x4292df(0xac),'type':_0x4292df(0xb0),'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':_0x4292df(0xcb)},{'name':_0x4292df(0xd9),'type':_0x4292df(0xaf),'regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':'[REDACTED_JWT]'},{'name':_0x4292df(0xd0),'type':_0x4292df(0xc3),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':_0x4292df(0xbd)},{'name':_0x4292df(0xa5),'type':_0x4292df(0xc8),'regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x4292df(0xbf)},{'name':_0x4292df(0xd4),'type':_0x4292df(0xb8),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':'[REDACTED_DB_CONNECTION]'},{'name':_0x4292df(0xab),'type':'generic_credential','regex':/(api[_-]?key|secret[_-]?key|password|passwd|auth[_-]?token|private[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)[\s:="']+[A-Za-z0-9_\-./+=]{16,}/gi,'replacement':'$1=[REDACTED_CREDENTIAL]'},{'name':_0x4292df(0x97),'type':_0x4292df(0xbc),'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':_0x4292df(0xa6),'alert':![]},{'name':_0x4292df(0x98),'type':_0x4292df(0xa2),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x4292df(0x99),'alert':![]}];}[a0_0x25bb99(0xb6)](_0x27d1d3){return this['redactWithAudit'](_0x27d1d3)['text'];}[a0_0x25bb99(0xc4)](_0x2b77c7){const _0x168e81=a0_0x25bb99;let _0x5864cb=_0x2b77c7,_0x24255c=0x0;const _0x481597=[];for(const _0x155052 of this[_0x168e81(0xcf)]){const _0x55f409=_0x5864cb[_0x168e81(0xb2)](_0x155052[_0x168e81(0xc7)]);_0x55f409&&_0x55f409['length']>0x0&&(_0x155052['alert']!==![]&&(_0x24255c+=_0x55f409[_0x168e81(0xd2)],!_0x481597[_0x168e81(0xa3)](_0x155052[_0x168e81(0xd1)])&&_0x481597[_0x168e81(0x96)](_0x155052['type'])),_0x5864cb=_0x5864cb['replace'](_0x155052[_0x168e81(0xc7)],_0x155052[_0x168e81(0xa7)]));}return{'text':_0x5864cb,'secretsFound':_0x24255c,'secretTypes':_0x481597};}}exports[a0_0x25bb99(0xce)]=Redactor,exports[a0_0x25bb99(0x9a)]=new Redactor();function a0_0xb9a0(){const _0x2955f2=['loadDefaultRules','AWS\x20Access\x20Key','[REDACTED_ANTHROPIC_KEY]','OpenAI\x20API\x20Key','[REDACTED_TWILIO_KEY]','44aaVzEU','email','includes','aws_secret','Basic\x20Auth','[REDACTED_IP]','replacement','6laScpm','__esModule','GitHub\x20Token','Generic\x20API\x20Key/Secret/Password','Private\x20Key\x20Block','Stripe\x20Key','2741888uuvPGU','jwt','private_key','[REDACTED_SENDGRID_KEY]','match','1110132WJpzLf','1637398iITBmv','aws_key','redact','openai_key','db_connection','[REDACTED_AWS_KEY]','60xigOIx','slack_token','ip_address','Bearer\x20[REDACTED_TOKEN]','Azure\x20Connection\x20String','Basic\x20[REDACTED_AUTH]','twilio_key','Twilio\x20Key','Slack\x20Token','bearer','redactWithAudit','49980QDEagX','[REDACTED_STRIPE_KEY]','regex','basic_auth','$1=[REDACTED_AWS_SECRET]','SendGrid\x20Key','[REDACTED_PRIVATE_KEY]','defineProperty','azure_conn','Redactor','rules','Bearer\x20Token','type','length','1359456HsxSlA','Database\x20Connection\x20String','stripe_key','21882amaFFx','2034YstMgL','\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22','JWT\x20Token','push','IPv4\x20Address\x20(non-local)','Email\x20Address','[REDACTED_EMAIL]','redactor','github_token'];a0_0xb9a0=function(){return _0x2955f2;};return a0_0xb9a0();}
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0xc86201=a0_0x30fd;(function(_0x1990af,_0x5047fb){const _0x4edea1=a0_0x30fd,_0x186df0=_0x1990af();while(!![]){try{const _0x44a6a2=-parseInt(_0x4edea1(0x117))/0x1+-parseInt(_0x4edea1(0x114))/0x2+parseInt(_0x4edea1(0x118))/0x3*(-parseInt(_0x4edea1(0x116))/0x4)+-parseInt(_0x4edea1(0x12b))/0x5*(-parseInt(_0x4edea1(0x128))/0x6)+-parseInt(_0x4edea1(0x11d))/0x7*(-parseInt(_0x4edea1(0x129))/0x8)+parseInt(_0x4edea1(0x10d))/0x9+parseInt(_0x4edea1(0x10c))/0xa;if(_0x44a6a2===_0x5047fb)break;else _0x186df0['push'](_0x186df0['shift']());}catch(_0x5b013d){_0x186df0['push'](_0x186df0['shift']());}}}(a0_0xd7f1,0xde9fa));Object[a0_0xc86201(0x124)](exports,a0_0xc86201(0x123),{'value':!![]});const tracker_1=require('./tracker');function a0_0x30fd(_0x31052f,_0x599b32){const _0xd7f15b=a0_0xd7f1();return a0_0x30fd=function(_0x30fdc4,_0x36d35c){_0x30fdc4=_0x30fdc4-0x10b;let _0x5561cc=_0xd7f15b[_0x30fdc4];return _0x5561cc;},a0_0x30fd(_0x31052f,_0x599b32);}function a0_0xd7f1(){const _0x1ea02c=['105472WlDjWB','[INFO]\x20Building\x20modules...\x0a','115RoMZXa','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','2789690MYlgen','14840235uVCYGJ','repeat','TRIMPROMPT_MODEL','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','gemini-1-5-pro','logExecution','test_db.py\x20PASS\x0a','2759466csjDWj','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','3884TuTXAn','1145885mwFqqH','1131fhIjvm','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','Successfully\x20built\x20image.','Database\x20successfully\x20seeded!','env','700KlRHOz','log','tracker','Step\x201/10\x20:\x20FROM\x20node:20\x0a','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','docker\x20build\x20.','__esModule','defineProperty','Compilation\x20Output:\x0a','gpt-4o','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','145374JhApLL'];a0_0xd7f1=function(){return _0x1ea02c;};return a0_0xd7f1();}console[a0_0xc86201(0x11e)](a0_0xc86201(0x115)),process[a0_0xc86201(0x11c)]['TRIMPROMPT_MODEL']='claude-3-opus',tracker_1[a0_0xc86201(0x11f)][a0_0xc86201(0x112)]('npm\x20run\x20build',a0_0xc86201(0x125)+a0_0xc86201(0x12a)+'Optimizing\x20assets...\x0a'+'[SUCCESS]\x20Compiled\x20512\x20modules.\x0a'[a0_0xc86201(0x10e)](0x190),a0_0xc86201(0x121),0x0),process[a0_0xc86201(0x11c)][a0_0xc86201(0x10f)]=a0_0xc86201(0x126),tracker_1[a0_0xc86201(0x11f)]['logExecution']('pytest\x20tests/app','Test\x20suite\x20run\x20starting...\x0a'+'test_auth.py\x20PASS\x0a'+a0_0xc86201(0x113)+'test_api.py\x20PASS\x0a'[a0_0xc86201(0x10e)](0x12c)+'All\x20303\x20tests\x20passed\x20in\x204.22s.',a0_0xc86201(0x119),0x0),process[a0_0xc86201(0x11c)][a0_0xc86201(0x10f)]=a0_0xc86201(0x111),tracker_1['tracker']['logExecution'](a0_0xc86201(0x122),a0_0xc86201(0x110)+a0_0xc86201(0x120)+a0_0xc86201(0x127)+'Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a'+'added\x201420\x20packages\x20in\x2014s\x0a'['repeat'](0x3)+a0_0xc86201(0x11a),a0_0xc86201(0x10b),0x0),console[a0_0xc86201(0x11e)](a0_0xc86201(0x11b));
|