trimprompt 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cache-manager.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -99
- package/filters/index.js +1 -185
- package/filters/js.js +1 -78
- package/filters/python.js +1 -130
- package/filters/rust.js +1 -115
- package/filters/shell.js +1 -395
- package/hooks/claude-hook.js +1 -79
- package/index.html +0 -73
- package/mcp.js +1 -132
- package/package.json +4 -1
- package/proxy-conv.js +1 -181
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/api-proxy.js +0 -1
- package/proxy-daemon.js +0 -382
- package/traffic-interceptor.js +0 -1
package/filters/devops.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x483f1a=a0_0x4bef;(function(_0x3dc763,_0x152b76){const _0x3ca538=a0_0x4bef,_0x301de9=_0x3dc763();while(!![]){try{const _0x4a7e=parseInt(_0x3ca538(0x1b0))/0x1*(parseInt(_0x3ca538(0x1a4))/0x2)+-parseInt(_0x3ca538(0x190))/0x3*(parseInt(_0x3ca538(0x18d))/0x4)+-parseInt(_0x3ca538(0x19f))/0x5*(parseInt(_0x3ca538(0x177))/0x6)+parseInt(_0x3ca538(0x19d))/0x7+parseInt(_0x3ca538(0x184))/0x8+parseInt(_0x3ca538(0x17b))/0x9*(parseInt(_0x3ca538(0x1af))/0xa)+-parseInt(_0x3ca538(0x1b1))/0xb*(parseInt(_0x3ca538(0x18c))/0xc);if(_0x4a7e===_0x152b76)break;else _0x301de9['push'](_0x301de9['shift']());}catch(_0x2cbe89){_0x301de9['push'](_0x301de9['shift']());}}}(a0_0x4d26,0x4eb4d));Object[a0_0x483f1a(0x18f)](exports,a0_0x483f1a(0x1a3),{'value':!![]}),exports[a0_0x483f1a(0x19b)]=filterDockerPs,exports[a0_0x483f1a(0x1a5)]=filterDockerImages,exports[a0_0x483f1a(0x186)]=filterDockerLogs,exports[a0_0x483f1a(0x180)]=filterKubectl,exports[a0_0x483f1a(0x1a8)]=filterRuff;function filterDockerPs(_0x3287c2){const _0x15e0ad=a0_0x483f1a,_0x591da9=_0x3287c2['split']('\x0a')['filter'](_0x5d2882=>_0x5d2882[_0x15e0ad(0x1a2)]()[_0x15e0ad(0x17d)]>0x0);if(_0x591da9['length']===0x0)return _0x15e0ad(0x19a);if(_0x591da9[_0x15e0ad(0x17d)]<=0xa)return _0x3287c2[_0x15e0ad(0x1a2)]();const _0x52495c=_0x591da9[0x0],_0x3a4625=_0x591da9[_0x15e0ad(0x19c)](0x1),_0x3cd64a=[];_0x3cd64a['push'](_0x15e0ad(0x17f)+_0x3a4625[_0x15e0ad(0x17d)]+_0x15e0ad(0x196)),_0x3cd64a[_0x15e0ad(0x1ab)]('');for(const _0x1e9842 of _0x3a4625){const _0x4a9aff=_0x1e9842['split'](/\s{2,}/);if(_0x4a9aff['length']>=0x5){const _0x3206ea=_0x4a9aff[0x0]['substring'](0x0,0xc),_0x31f935=_0x4a9aff[0x1],_0x3d91f4=_0x4a9aff[_0x4a9aff['length']-0x2]||'',_0x43b50=_0x4a9aff[_0x4a9aff[_0x15e0ad(0x17d)]-0x1]||'';_0x3cd64a['push']('\x20\x20'+_0x3206ea+'\x20\x20'+_0x31f935+'\x20\x20'+_0x3d91f4+'\x20\x20'+_0x43b50);}else _0x3cd64a[_0x15e0ad(0x1ab)]('\x20\x20'+_0x1e9842[_0x15e0ad(0x1a2)]());}return _0x3cd64a[_0x15e0ad(0x17c)]('\x0a');}function filterDockerImages(_0x37a61e){const _0x2ba48f=a0_0x483f1a,_0x77d3f4=_0x37a61e[_0x2ba48f(0x195)]('\x0a')[_0x2ba48f(0x185)](_0x4f2f39=>_0x4f2f39['trim']()['length']>0x0);if(_0x77d3f4[_0x2ba48f(0x17d)]<=0x1)return _0x2ba48f(0x187);if(_0x77d3f4[_0x2ba48f(0x17d)]<=0xf)return _0x37a61e[_0x2ba48f(0x1a2)]();const _0x5e90b2=_0x77d3f4[_0x2ba48f(0x19c)](0x1),_0x235c89=[_0x2ba48f(0x1ac)+_0x5e90b2['length']+'\x20total'];_0x235c89[_0x2ba48f(0x1ab)]('');const _0x5b47df=_0x5e90b2[_0x2ba48f(0x19c)](0x0,0x14);for(const _0x1937d5 of _0x5b47df){const _0x2dd639=_0x1937d5[_0x2ba48f(0x195)](/\s{2,}/);if(_0x2dd639['length']>=0x3){const _0x58b6c0=_0x2dd639[0x0],_0x2e3d31=_0x2dd639[0x1],_0x4a1104=_0x2dd639[_0x2dd639['length']-0x1]||'';_0x235c89[_0x2ba48f(0x1ab)]('\x20\x20'+_0x58b6c0+':'+_0x2e3d31+'\x20\x20'+_0x4a1104);}else _0x235c89[_0x2ba48f(0x1ab)]('\x20\x20'+_0x1937d5['trim']());}return _0x5e90b2[_0x2ba48f(0x17d)]>0x14&&_0x235c89[_0x2ba48f(0x1ab)](_0x2ba48f(0x194)+(_0x5e90b2[_0x2ba48f(0x17d)]-0x14)+_0x2ba48f(0x1a1)),_0x235c89[_0x2ba48f(0x17c)]('\x0a');}function a0_0x4d26(){const _0x4702c5=['filterKubectl','\x0a...\x20[','keys','get','3234256bwSAkk','filter','filterDockerLogs','No\x20images\x20found','match','\x20lines\x20truncated]\x20...\x0a','Events:','All\x20checks\x20passed','97932OwYecj','4zFsDOl','Ruff:\x20','defineProperty','1374951uDAsXv','Found\x200\x20error','describe','logs','\x20\x20...\x20+','split','\x20total','\x20more\x20resources','\x0a...\x20+','\x20resources\x20found','No\x20containers\x20running','filterDockerPs','slice','3974271MZdjQw','includes','32610vQOCPw','Ruff:\x20no\x20issues\x20found','\x20more\x20images','trim','__esModule','7418NMjyaq','filterDockerImages','\x20more\x20events','\x20log\x20lines\x20total)','filterRuff','\x20\x20...\x20(','\x20more\x20lines','push','Docker\x20images:\x20','\x20files','Ruff:\x20all\x20checks\x20passed','1135020bzFYto','109XKGMtY','1100Ndgbov','startsWith','6rzibLc','\x20more\x20files','\x20more','...\x20+','18mqcoTN','join','length','\x20issues\x20in\x20','Containers:\x20'];a0_0x4d26=function(){return _0x4702c5;};return a0_0x4d26();}function filterDockerLogs(_0x3736c1){const _0x4a9e2c=a0_0x483f1a,_0x282475=_0x3736c1['split']('\x0a');if(_0x282475[_0x4a9e2c(0x17d)]<=0x32)return _0x3736c1;const _0xfb2477=[];return _0xfb2477[_0x4a9e2c(0x1ab)](..._0x282475[_0x4a9e2c(0x19c)](0x0,0x14)),_0xfb2477[_0x4a9e2c(0x1ab)](_0x4a9e2c(0x181)+(_0x282475['length']-0x28)+_0x4a9e2c(0x189)),_0xfb2477['push'](..._0x282475[_0x4a9e2c(0x19c)](-0x14)),_0xfb2477[_0x4a9e2c(0x1ab)]('\x0a('+_0x282475['length']+_0x4a9e2c(0x1a7)),_0xfb2477[_0x4a9e2c(0x17c)]('\x0a');}function filterKubectl(_0xfaf044,_0x1b644d){const _0x8eb9a0=a0_0x483f1a,_0x24833e=_0xfaf044[_0x8eb9a0(0x195)]('\x0a')[_0x8eb9a0(0x185)](_0x59cfd3=>_0x59cfd3[_0x8eb9a0(0x1a2)]()['length']>0x0);if(_0x24833e[_0x8eb9a0(0x17d)]===0x0)return'No\x20resources\x20found';if(_0x24833e[_0x8eb9a0(0x17d)]<=0x14)return _0xfaf044[_0x8eb9a0(0x1a2)]();if(_0x1b644d===_0x8eb9a0(0x183)){const _0x46d8bd=_0x24833e[0x0],_0x2593e3=_0x24833e[_0x8eb9a0(0x19c)](0x1),_0x194e96=[_0x2593e3[_0x8eb9a0(0x17d)]+_0x8eb9a0(0x199),'',_0x46d8bd];return _0x2593e3[_0x8eb9a0(0x17d)]<=0x1e?_0x194e96['push'](..._0x2593e3):(_0x194e96[_0x8eb9a0(0x1ab)](..._0x2593e3[_0x8eb9a0(0x19c)](0x0,0x19)),_0x194e96[_0x8eb9a0(0x1ab)](_0x8eb9a0(0x17a)+(_0x2593e3[_0x8eb9a0(0x17d)]-0x19)+_0x8eb9a0(0x197))),_0x194e96[_0x8eb9a0(0x17c)]('\x0a');}if(_0x1b644d===_0x8eb9a0(0x192)){const _0x5797f7=[];let _0x5ce54f=![],_0x4ae192=0x0;for(const _0x451b5e of _0x24833e){if(_0x451b5e[_0x8eb9a0(0x1b2)](_0x8eb9a0(0x18a))){_0x5ce54f=!![],_0x5797f7[_0x8eb9a0(0x1ab)](_0x451b5e);continue;}if(_0x5ce54f){_0x4ae192++;if(_0x4ae192<=0x5)_0x5797f7[_0x8eb9a0(0x1ab)](_0x451b5e);}else _0x5797f7['push'](_0x451b5e);}return _0x4ae192>0x5&&_0x5797f7['push']('\x20\x20...\x20+'+(_0x4ae192-0x5)+_0x8eb9a0(0x1a6)),_0x5797f7[_0x8eb9a0(0x17c)]('\x0a');}if(_0x1b644d===_0x8eb9a0(0x193))return filterDockerLogs(_0xfaf044);const _0x1de6fa=_0x24833e[_0x8eb9a0(0x19c)](0x0,0x1e);return _0x24833e[_0x8eb9a0(0x17d)]>0x1e&&_0x1de6fa['push'](_0x8eb9a0(0x17a)+(_0x24833e[_0x8eb9a0(0x17d)]-0x1e)+_0x8eb9a0(0x1aa)),_0x1de6fa[_0x8eb9a0(0x17c)]('\x0a');}function a0_0x4bef(_0x224351,_0x23318f){const _0x4d265d=a0_0x4d26();return a0_0x4bef=function(_0x4befb2,_0x3084f6){_0x4befb2=_0x4befb2-0x177;let _0x46ac6b=_0x4d265d[_0x4befb2];return _0x46ac6b;},a0_0x4bef(_0x224351,_0x23318f);}function filterRuff(_0x3f54d8){const _0x17d4aa=a0_0x483f1a,_0x180a4b=_0x3f54d8['split']('\x0a')[_0x17d4aa(0x185)](_0x340752=>_0x340752[_0x17d4aa(0x1a2)]()['length']>0x0);if(_0x180a4b[_0x17d4aa(0x17d)]===0x0)return _0x17d4aa(0x1a0);if(_0x3f54d8[_0x17d4aa(0x19e)](_0x17d4aa(0x18b))||_0x3f54d8[_0x17d4aa(0x19e)](_0x17d4aa(0x191)))return _0x17d4aa(0x1ae);const _0xaf1a76=_0x3f54d8[_0x17d4aa(0x188)](/Found (\d+) error/),_0x12d9dd=_0xaf1a76?parseInt(_0xaf1a76[0x1]):_0x180a4b[_0x17d4aa(0x17d)],_0x331250={},_0x3c6329=[];for(const _0x1b264c of _0x180a4b){const _0x25db41=_0x1b264c['match'](/^([^:]+:\d+:\d+):\s*(.*)/);if(_0x25db41){const _0xe8ecc=_0x25db41[0x1],_0x3656c9=_0xe8ecc[_0x17d4aa(0x195)](':')[0x0];if(!_0x331250[_0x3656c9])_0x331250[_0x3656c9]=[];_0x331250[_0x3656c9][_0x17d4aa(0x1ab)](_0x1b264c);}else _0x3c6329[_0x17d4aa(0x1ab)](_0x1b264c);}const _0x15bcf8=Object[_0x17d4aa(0x182)](_0x331250);if(_0x15bcf8[_0x17d4aa(0x17d)]===0x0){if(_0x180a4b[_0x17d4aa(0x17d)]<=0x14)return _0x3f54d8[_0x17d4aa(0x1a2)]();return _0x180a4b['slice'](0x0,0xf)[_0x17d4aa(0x17c)]('\x0a')+(_0x17d4aa(0x198)+(_0x180a4b['length']-0xf)+_0x17d4aa(0x179));}const _0x27171a=[_0x17d4aa(0x18e)+_0x12d9dd+_0x17d4aa(0x17e)+_0x15bcf8['length']+_0x17d4aa(0x1ad)];_0x27171a[_0x17d4aa(0x1ab)]('');const _0x565fe7=0xa;for(const _0x550ccc of _0x15bcf8[_0x17d4aa(0x19c)](0x0,_0x565fe7)){const _0x57d556=_0x331250[_0x550ccc];if(_0x57d556[_0x17d4aa(0x17d)]<=0x3){for(const _0xeaaf61 of _0x57d556)_0x27171a[_0x17d4aa(0x1ab)]('\x20\x20'+_0xeaaf61);}else _0x27171a[_0x17d4aa(0x1ab)]('\x20\x20'+_0x57d556[0x0]),_0x27171a[_0x17d4aa(0x1ab)](_0x17d4aa(0x1a9)+_0x57d556[_0x17d4aa(0x17d)]+_0x17d4aa(0x17e)+_0x550ccc+')');}return _0x15bcf8[_0x17d4aa(0x17d)]>_0x565fe7&&_0x27171a[_0x17d4aa(0x1ab)]('\x20\x20...\x20+'+(_0x15bcf8['length']-_0x565fe7)+_0x17d4aa(0x178)),_0x27171a['join']('\x0a');}
|
package/filters/generic.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x44e949=a0_0x8140;(function(_0x22224f,_0x12d454){const _0x33061f=a0_0x8140,_0x20c128=_0x22224f();while(!![]){try{const _0x225c77=-parseInt(_0x33061f(0xe9))/0x1+-parseInt(_0x33061f(0xe1))/0x2+-parseInt(_0x33061f(0xe7))/0x3*(-parseInt(_0x33061f(0xe2))/0x4)+-parseInt(_0x33061f(0xfb))/0x5+-parseInt(_0x33061f(0xfa))/0x6*(-parseInt(_0x33061f(0xf9))/0x7)+parseInt(_0x33061f(0x105))/0x8+parseInt(_0x33061f(0xed))/0x9;if(_0x225c77===_0x12d454)break;else _0x20c128['push'](_0x20c128['shift']());}catch(_0xf9c659){_0x20c128['push'](_0x20c128['shift']());}}}(a0_0xe636,0xa50c1));Object['defineProperty'](exports,a0_0x44e949(0xff),{'value':!![]}),exports[a0_0x44e949(0xfc)]=stripAnsi,exports[a0_0x44e949(0x102)]=collapseDuplicates,exports[a0_0x44e949(0xe6)]=collapseWhitespace,exports['stripComments']=stripComments,exports[a0_0x44e949(0xd8)]=smartCrushJson,exports[a0_0x44e949(0xda)]=softTruncate;function a0_0x8140(_0xd40131,_0x4a68ab){const _0xe636e8=a0_0xe636();return a0_0x8140=function(_0x814018,_0x244430){_0x814018=_0x814018-0xd8;let _0x5e2bba=_0xe636e8[_0x814018];return _0x5e2bba;},a0_0x8140(_0xd40131,_0x4a68ab);}function stripAnsi(_0x26ebff){const _0x897b5e=a0_0x44e949,_0x5368a2=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;return _0x26ebff[_0x897b5e(0x103)](_0x5368a2,'');}function collapseDuplicates(_0x340900){const _0x9adf71=a0_0x44e949,_0x529aa2=_0x340900['split']('\x0a');if(_0x529aa2[_0x9adf71(0xe8)]<=0x1)return _0x340900;const _0x1e1501=[];let _0x188f2c=_0x529aa2[0x0],_0x3dfe4f=0x1;for(let _0x546c36=0x1;_0x546c36<_0x529aa2['length'];_0x546c36++){const _0x5740aa=_0x529aa2[_0x546c36];_0x5740aa===_0x188f2c&&_0x5740aa['trim']()['length']>0x0?_0x3dfe4f++:(_0x3dfe4f>0x1?_0x1e1501['push'](_0x188f2c+_0x9adf71(0xde)+_0x3dfe4f+']'):_0x1e1501[_0x9adf71(0xf0)](_0x188f2c),_0x188f2c=_0x5740aa,_0x3dfe4f=0x1);}return _0x3dfe4f>0x1?_0x1e1501['push'](_0x188f2c+_0x9adf71(0xde)+_0x3dfe4f+']'):_0x1e1501['push'](_0x188f2c),_0x1e1501['join']('\x0a');}function collapseWhitespace(_0x35b590){const _0xa4c6c7=a0_0x44e949;let _0x4d0cfc=_0x35b590[_0xa4c6c7(0x103)](/[ \t]+$/gm,'');return _0x4d0cfc=_0x4d0cfc[_0xa4c6c7(0x103)](/\n{4,}/g,'\x0a\x0a\x0a'),_0x4d0cfc;}function stripComments(_0x461e88,_0x476716){const _0x23d57f=a0_0x44e949;if(!_0x476716)return _0x461e88;const _0x2288ff=_0x461e88[_0x23d57f(0xeb)]('\x0a');if(_0x2288ff[_0x23d57f(0xe8)]<=0x96)return _0x461e88;const _0x4b0838={'.ts':/^\s*\/\//,'.js':/^\s*\/\//,'.tsx':/^\s*\/\//,'.jsx':/^\s*\/\//,'.py':/^\s*#(?!!)/,'.rb':/^\s*#(?!!)/,'.sh':/^\s*#(?!!)/,'.go':/^\s*\/\//,'.rs':/^\s*\/\//,'.java':/^\s*\/\//,'.c':/^\s*\/\//,'.cpp':/^\s*\/\//,'.cs':/^\s*\/\//,'.swift':/^\s*\/\//,'.kt':/^\s*\/\//,'.yaml':/^\s*#(?!!)/,'.yml':/^\s*#(?!!)/},_0x152ab1=_0x4b0838[_0x476716[_0x23d57f(0xfe)]()];if(!_0x152ab1)return _0x461e88;const _0x3d8f75=_0x2288ff[_0x23d57f(0x100)](_0x36ca06=>!_0x152ab1['test'](_0x36ca06));return _0x3d8f75['join']('\x0a');}function smartCrushJson(_0x188f71){const _0x1f54c2=a0_0x44e949;try{const _0x404d92=_0x188f71[_0x1f54c2(0xf2)]();if(!_0x404d92[_0x1f54c2(0xdb)]('['))return null;const _0x3cd92a=JSON[_0x1f54c2(0xf4)](_0x404d92);if(!Array[_0x1f54c2(0xdd)](_0x3cd92a)||_0x3cd92a['length']<0x3)return null;if(typeof _0x3cd92a[0x0]!==_0x1f54c2(0xe3)||_0x3cd92a[0x0]===null)return null;const _0x47b36d=Object[_0x1f54c2(0x104)](_0x3cd92a[0x0]);if(_0x47b36d[_0x1f54c2(0xe8)]===0x0)return null;const _0x3eab07=_0x47b36d['filter'](_0x157668=>{const _0x4cfd4c=_0x1f54c2,_0x44e914=_0x157668[_0x4cfd4c(0xfe)]();return!_0x44e914[_0x4cfd4c(0xfd)](_0x4cfd4c(0xf6))&&!_0x44e914['includes'](_0x4cfd4c(0xee))&&!_0x44e914['includes'](_0x4cfd4c(0x101))&&!_0x44e914['includes'](_0x4cfd4c(0xf1))&&!_0x44e914['includes']('checksum')&&!_0x44e914[_0x4cfd4c(0xfd)](_0x4cfd4c(0xef))&&!_0x44e914[_0x4cfd4c(0xfd)](_0x4cfd4c(0xf3))&&_0x44e914!==_0x4cfd4c(0xea)&&_0x44e914!==_0x4cfd4c(0xf8)&&_0x44e914!==_0x4cfd4c(0xdc)&&_0x44e914!=='repository';})[_0x1f54c2(0xe5)](0x0,0x6);if(_0x3eab07[_0x1f54c2(0xe8)]===0x0)return null;const _0x292aa6=[];_0x292aa6[_0x1f54c2(0xf0)](_0x3eab07['join']('|'));const _0x95ffdb=0x1e;for(let _0x4f3890=0x0;_0x4f3890<Math['min'](_0x3cd92a[_0x1f54c2(0xe8)],_0x95ffdb);_0x4f3890++){const _0x558347=_0x3eab07[_0x1f54c2(0xe4)](_0x34aecc=>{const _0x4a0675=_0x1f54c2,_0x5b9708=_0x3cd92a[_0x4f3890][_0x34aecc];if(_0x5b9708===null||_0x5b9708===undefined)return'';if(typeof _0x5b9708===_0x4a0675(0xe3))return JSON[_0x4a0675(0xe0)](_0x5b9708)[_0x4a0675(0xd9)](0x0,0x28);return String(_0x5b9708)['substring'](0x0,0x3c);});_0x292aa6['push'](_0x558347['join']('|'));}_0x3cd92a[_0x1f54c2(0xe8)]>_0x95ffdb&&_0x292aa6[_0x1f54c2(0xf0)]('...\x20+'+(_0x3cd92a['length']-_0x95ffdb)+_0x1f54c2(0xec));_0x292aa6['push']('\x0a('+_0x3cd92a[_0x1f54c2(0xe8)]+'\x20items,\x20'+_0x47b36d[_0x1f54c2(0xe8)]+'\x20fields,\x20showing\x20'+_0x3eab07[_0x1f54c2(0xe8)]+'\x20key\x20fields)');const _0x177ac0=_0x292aa6[_0x1f54c2(0xdf)]('\x0a');if(_0x177ac0[_0x1f54c2(0xe8)]<_0x404d92[_0x1f54c2(0xe8)])return _0x177ac0;return null;}catch{return null;}}function a0_0xe636(){const _0x546a9d=['engines','11767ohdqKk','2946xEmSIv','4016395kkMoBD','stripAnsi','includes','toLowerCase','__esModule','filter','sha','collapseDuplicates','replace','keys','7822048bCPBba','smartCrushJson','substring','softTruncate','startsWith','bugs','isArray','\x20[x','join','stringify','2629512EHOYDd','3220148AkoKKT','object','map','slice','collapseWhitespace','3LwodOi','length','371187SyLRXb','funding','split','\x20more\x20rows','5013819YzOTmx','integrity','signature','push','hash','trim','dev','parse','\x0a...\x20[TrimPrompt:\x20Truncated\x20','resolved','\x20characters\x20of\x20output]\x20...\x0a'];a0_0xe636=function(){return _0x546a9d;};return a0_0xe636();}function softTruncate(_0x1172da,_0x5bd2e9=0x4e20){const _0x1d31b1=a0_0x44e949;if(_0x1172da[_0x1d31b1(0xe8)]<=_0x5bd2e9)return _0x1172da;const _0x471772=_0x1172da[_0x1d31b1(0xeb)]('\x0a');if(_0x471772['length']<=0xc8)return _0x1172da;const _0x5b2c73=0x32,_0x185120=0x96,_0x58a223=_0x471772[_0x1d31b1(0xe5)](0x0,_0x5b2c73),_0x237b16=_0x471772['slice'](_0x471772[_0x1d31b1(0xe8)]-_0x185120),_0x219449=_0x1172da[_0x1d31b1(0xe8)]-(_0x58a223['join']('\x0a')['length']+_0x237b16[_0x1d31b1(0xdf)]('\x0a')[_0x1d31b1(0xe8)]);return[..._0x58a223,_0x1d31b1(0xf5)+_0x219449+_0x1d31b1(0xf7),..._0x237b16][_0x1d31b1(0xdf)]('\x0a');}
|
package/filters/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x1c5c87=a0_0xc565;function a0_0xc565(_0x88f127,_0x141aa5){const _0x4e3437=a0_0x4e34();return a0_0xc565=function(_0xc56529,_0x366cd0){_0xc56529=_0xc56529-0x19f;let _0x44d409=_0x4e3437[_0xc56529];return _0x44d409;},a0_0xc565(_0x88f127,_0x141aa5);}(function(_0xd1d22e,_0x3c6469){const _0x11cd45=a0_0xc565,_0x519fcd=_0xd1d22e();while(!![]){try{const _0x572ee4=parseInt(_0x11cd45(0x1ac))/0x1+parseInt(_0x11cd45(0x1cb))/0x2+-parseInt(_0x11cd45(0x1a8))/0x3+parseInt(_0x11cd45(0x1a0))/0x4+parseInt(_0x11cd45(0x1c7))/0x5+parseInt(_0x11cd45(0x1b5))/0x6*(parseInt(_0x11cd45(0x1c0))/0x7)+-parseInt(_0x11cd45(0x1c5))/0x8;if(_0x572ee4===_0x3c6469)break;else _0x519fcd['push'](_0x519fcd['shift']());}catch(_0x3f3f49){_0x519fcd['push'](_0x519fcd['shift']());}}}(a0_0x4e34,0xd21a0));var __createBinding=this&&this['__createBinding']||(Object[a0_0x1c5c87(0x1cc)]?function(_0x195b50,_0x14cdf9,_0x48f89b,_0x42ef99){const _0x181c97=a0_0x1c5c87;if(_0x42ef99===undefined)_0x42ef99=_0x48f89b;var _0x2ec5d8=Object['getOwnPropertyDescriptor'](_0x14cdf9,_0x48f89b);(!_0x2ec5d8||(_0x181c97(0x1ca)in _0x2ec5d8?!_0x14cdf9['__esModule']:_0x2ec5d8[_0x181c97(0x1b6)]||_0x2ec5d8[_0x181c97(0x1b0)]))&&(_0x2ec5d8={'enumerable':!![],'get':function(){return _0x14cdf9[_0x48f89b];}}),Object[_0x181c97(0x1c9)](_0x195b50,_0x42ef99,_0x2ec5d8);}:function(_0x4b5b14,_0x20fc40,_0x557b62,_0xcd9cc3){if(_0xcd9cc3===undefined)_0xcd9cc3=_0x557b62;_0x4b5b14[_0xcd9cc3]=_0x20fc40[_0x557b62];}),__setModuleDefault=this&&this[a0_0x1c5c87(0x1b9)]||(Object['create']?function(_0x318b5c,_0x3764cc){const _0x2bf537=a0_0x1c5c87;Object[_0x2bf537(0x1c9)](_0x318b5c,_0x2bf537(0x1ad),{'enumerable':!![],'value':_0x3764cc});}:function(_0x4fc2e7,_0x4c69b1){const _0x1627c6=a0_0x1c5c87;_0x4fc2e7[_0x1627c6(0x1ad)]=_0x4c69b1;}),__importStar=this&&this[a0_0x1c5c87(0x1d1)]||(function(){var _0x286127=function(_0x1e0aae){const _0x4248bf=a0_0xc565;return _0x286127=Object[_0x4248bf(0x1ce)]||function(_0x41bdb5){const _0x1c76f9=_0x4248bf;var _0x11d128=[];for(var _0x45f830 in _0x41bdb5)if(Object[_0x1c76f9(0x1bb)][_0x1c76f9(0x1ab)][_0x1c76f9(0x1a9)](_0x41bdb5,_0x45f830))_0x11d128[_0x11d128[_0x1c76f9(0x1cd)]]=_0x45f830;return _0x11d128;},_0x286127(_0x1e0aae);};return function(_0x2aacc7){const _0x2fde50=a0_0xc565;if(_0x2aacc7&&_0x2aacc7['__esModule'])return _0x2aacc7;var _0x5185ca={};if(_0x2aacc7!=null){for(var _0x56f692=_0x286127(_0x2aacc7),_0x23cd5e=0x0;_0x23cd5e<_0x56f692['length'];_0x23cd5e++)if(_0x56f692[_0x23cd5e]!==_0x2fde50(0x1ad))__createBinding(_0x5185ca,_0x2aacc7,_0x56f692[_0x23cd5e]);}return __setModuleDefault(_0x5185ca,_0x2aacc7),_0x5185ca;};}());Object['defineProperty'](exports,a0_0x1c5c87(0x1c4),{'value':!![]}),exports[a0_0x1c5c87(0x1b2)]=filterGitStatus,exports[a0_0x1c5c87(0x1b7)]=filterGitLog,exports[a0_0x1c5c87(0x1a7)]=filterGitDiff;const path=__importStar(require(a0_0x1c5c87(0x1a6)));function filterGitStatus(_0x27614f){const _0x4e813e=a0_0x1c5c87,_0x1f374e=_0x27614f[_0x4e813e(0x1d0)]('\x0a')[_0x4e813e(0x1ba)](_0x123532=>_0x123532['trim']())[_0x4e813e(0x1a1)](_0x196cef=>_0x196cef[_0x4e813e(0x1cd)]>0x0);if(_0x1f374e['length']===0x0)return _0x4e813e(0x1b4);const _0x4f6b15=[],_0x4bde21=[],_0x3f12e2=[];for(const _0x188a96 of _0x1f374e){if(_0x188a96['startsWith']('##')){const _0x512eee=_0x188a96[_0x4e813e(0x1c2)](/^##\s*/,'');_0x4f6b15[_0x4e813e(0x1aa)](_0x4e813e(0x1c1)+_0x512eee);}else _0x188a96[_0x4e813e(0x1a2)]('??')?_0x4bde21[_0x4e813e(0x1aa)](_0x188a96[_0x4e813e(0x1bd)](0x3)[_0x4e813e(0x1d2)]()):_0x3f12e2[_0x4e813e(0x1aa)](_0x188a96);}_0x3f12e2[_0x4e813e(0x1cd)]>0x0&&(_0x4f6b15[_0x4e813e(0x1aa)](_0x4e813e(0x1c6)),_0x4f6b15[_0x4e813e(0x1aa)](..._0x3f12e2[_0x4e813e(0x1ba)](_0x436e85=>'\x20\x20'+_0x436e85)));if(_0x4bde21[_0x4e813e(0x1cd)]>0x0){_0x4f6b15[_0x4e813e(0x1aa)]('\x0aUntracked\x20files:');const _0x215a32={},_0x156c9c=[];for(const _0x31ae18 of _0x4bde21){const _0x2e4b33=path[_0x4e813e(0x1be)](_0x31ae18);_0x2e4b33==='.'||_0x2e4b33===''?_0x156c9c[_0x4e813e(0x1aa)](_0x31ae18):(!_0x215a32[_0x2e4b33]&&(_0x215a32[_0x2e4b33]=[]),_0x215a32[_0x2e4b33][_0x4e813e(0x1aa)](path[_0x4e813e(0x1b8)](_0x31ae18)));}for(const [_0x244923,_0x1bc15e]of Object['entries'](_0x215a32)){if(_0x1bc15e['length']>0x5)_0x4f6b15[_0x4e813e(0x1aa)]('\x20\x20??\x20'+_0x244923+'/\x20('+_0x1bc15e[_0x4e813e(0x1cd)]+_0x4e813e(0x1d4));else for(const _0xb9dba2 of _0x1bc15e){_0x4f6b15[_0x4e813e(0x1aa)](_0x4e813e(0x1ae)+path[_0x4e813e(0x1c8)](_0x244923,_0xb9dba2));}}for(const _0xe648fc of _0x156c9c){_0x4f6b15[_0x4e813e(0x1aa)](_0x4e813e(0x1ae)+_0xe648fc);}}return _0x4f6b15['join']('\x0a');}function filterGitLog(_0x47e284){const _0x23d7c1=a0_0x1c5c87,_0x54e211=_0x47e284[_0x23d7c1(0x1d0)](_0x23d7c1(0x1d3))[_0x23d7c1(0x1ba)](_0x1badf7=>_0x1badf7['trim']())[_0x23d7c1(0x1a1)](_0x5248eb=>_0x5248eb['length']>0x0);if(_0x54e211[_0x23d7c1(0x1cd)]===0x0)return _0x47e284;const _0x17dcd8=[];for(const _0x297d2c of _0x54e211){const _0xe92077=_0x297d2c[_0x23d7c1(0x1d0)]('\x0a'),_0x25f768=_0xe92077[0x0]||'',_0x3ab07e=_0xe92077['slice'](0x1)[_0x23d7c1(0x1ba)](_0x9fdb35=>_0x9fdb35['trim']())[_0x23d7c1(0x1a1)](_0x5c2f79=>_0x5c2f79['length']>0x0);_0x17dcd8['push']('-\x20'+_0x25f768),_0x3ab07e[_0x23d7c1(0x1cd)]>0x0&&(_0x17dcd8[_0x23d7c1(0x1aa)]('\x20\x20'+_0x3ab07e[0x0]),_0x3ab07e[_0x23d7c1(0x1cd)]>0x1&&_0x17dcd8[_0x23d7c1(0x1aa)]('\x20\x20...\x20(+'+(_0x3ab07e['length']-0x1)+_0x23d7c1(0x1bf)));}return _0x17dcd8[_0x23d7c1(0x1c8)]('\x0a');}function filterGitDiff(_0x5469bd){const _0x586b00=a0_0x1c5c87,_0x5553ac=_0x5469bd[_0x586b00(0x1d0)]('\x0a'),_0x1dccfe=[];let _0x4cd0d2='',_0x59a53d=0x0,_0x49582c=0x0,_0x8ef8c6=[];const _0x1c90f1=()=>{const _0x211592=_0x586b00;if(_0x4cd0d2&&(_0x59a53d>0x0||_0x49582c>0x0)){_0x1dccfe[_0x211592(0x1aa)](_0x211592(0x1a4)+_0x4cd0d2+_0x211592(0x1a5)+_0x59a53d+'\x20-'+_0x49582c+')');const _0x4bd0f0=0xa,_0x4663a4=_0x8ef8c6['slice'](0x0,_0x4bd0f0);for(const _0x4065e8 of _0x4663a4){_0x1dccfe[_0x211592(0x1aa)]('\x20\x20'+_0x4065e8);}const _0x3fca8d=_0x59a53d+_0x49582c-_0x4bd0f0;_0x3fca8d>0x0&&_0x1dccfe[_0x211592(0x1aa)](_0x211592(0x1cf)+_0x3fca8d+_0x211592(0x1af));}_0x59a53d=0x0,_0x49582c=0x0,_0x8ef8c6=[];};for(const _0xebcf6c of _0x5553ac){if(_0xebcf6c['startsWith'](_0x586b00(0x1b3))){_0x1c90f1();const _0x49687a=_0xebcf6c[_0x586b00(0x1bc)](/\sb\/(.+)$/);_0x4cd0d2=_0x49687a?_0x49687a[0x1]:_0x586b00(0x1b1);}else{if(_0xebcf6c[_0x586b00(0x1a2)]('+')&&!_0xebcf6c[_0x586b00(0x1a2)](_0x586b00(0x19f)))_0x59a53d++,_0x8ef8c6['push'](_0xebcf6c);else _0xebcf6c[_0x586b00(0x1a2)]('-')&&!_0xebcf6c[_0x586b00(0x1a2)](_0x586b00(0x1a3))&&(_0x49582c++,_0x8ef8c6[_0x586b00(0x1aa)](_0xebcf6c));}}_0x1c90f1();const _0x7b0fd2=_0x1dccfe[_0x586b00(0x1c8)]('\x0a');return _0x7b0fd2[_0x586b00(0x1cd)]>0x0?_0x7b0fd2:_0x586b00(0x1c3);}function a0_0x4e34(){const _0x3bea3b=['basename','__setModuleDefault','map','prototype','match','substring','dirname','\x20lines\x20of\x20description)','7CRkLFu','*\x20Branch:\x20','replace','No\x20modifications','__esModule','20501152HcTsEa','\x0aChanges:','6945260JOcHMz','join','defineProperty','get','3269364marinC','create','length','getOwnPropertyNames','\x20\x20...\x20+','split','__importStar','trim','---END---','\x20untracked\x20files)','+++','1770832snlruo','filter','startsWith','---','[file]\x20','\x20(+','path','filterGitDiff','4880340bfnykx','call','push','hasOwnProperty','1098519UBOHCc','default','\x20\x20??\x20','\x20more\x20modifications','configurable','unknown_file','filterGitStatus','diff\x20--git','Clean\x20working\x20tree','2910234GltHHt','writable','filterGitLog'];a0_0x4e34=function(){return _0x3bea3b;};return a0_0x4e34();}
|
package/filters/go.js
CHANGED
|
@@ -1,99 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterGoTest = filterGoTest;
|
|
4
|
-
exports.filterGoVet = filterGoVet;
|
|
5
|
-
function filterGoTest(stdout) {
|
|
6
|
-
const lines = stdout.split('\n');
|
|
7
|
-
let totalPassed = 0;
|
|
8
|
-
let totalFailed = 0;
|
|
9
|
-
let totalSkipped = 0;
|
|
10
|
-
const failedTests = [];
|
|
11
|
-
const packageResults = [];
|
|
12
|
-
let currentFail = null;
|
|
13
|
-
for (const line of lines) {
|
|
14
|
-
const trimmed = line.trim();
|
|
15
|
-
const okMatch = trimmed.match(/^ok\s+\S+\s+[\d.]+s/);
|
|
16
|
-
if (okMatch) {
|
|
17
|
-
packageResults.push(trimmed);
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const failMatch = trimmed.match(/^FAIL\s+\S+/);
|
|
21
|
-
if (failMatch) {
|
|
22
|
-
packageResults.push(trimmed);
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
const passMatch = trimmed.match(/^--- PASS:/);
|
|
26
|
-
if (passMatch) {
|
|
27
|
-
totalPassed++;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
const failTestMatch = trimmed.match(/^--- FAIL:\s+(\S+)/);
|
|
31
|
-
if (failTestMatch) {
|
|
32
|
-
if (currentFail)
|
|
33
|
-
failedTests.push(currentFail);
|
|
34
|
-
currentFail = { name: failTestMatch[1], lines: [] };
|
|
35
|
-
totalFailed++;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (trimmed.startsWith('--- SKIP:')) {
|
|
39
|
-
totalSkipped++;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (currentFail && trimmed.length > 0 && !trimmed.startsWith('=== RUN')) {
|
|
43
|
-
currentFail.lines.push(line);
|
|
44
|
-
}
|
|
45
|
-
if (trimmed.startsWith('=== RUN')) {
|
|
46
|
-
if (currentFail) {
|
|
47
|
-
failedTests.push(currentFail);
|
|
48
|
-
currentFail = null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (currentFail)
|
|
53
|
-
failedTests.push(currentFail);
|
|
54
|
-
if (totalPassed === 0 && totalFailed === 0 && totalSkipped === 0) {
|
|
55
|
-
if (stdout.includes('PASS') && !stdout.includes('FAIL'))
|
|
56
|
-
return "Go test: all tests passed";
|
|
57
|
-
if (stdout.includes('no test files'))
|
|
58
|
-
return "Go test: no test files";
|
|
59
|
-
return stdout;
|
|
60
|
-
}
|
|
61
|
-
if (totalFailed === 0) {
|
|
62
|
-
const parts = [`Go test: ${totalPassed} passed`];
|
|
63
|
-
if (totalSkipped > 0)
|
|
64
|
-
parts.push(`${totalSkipped} skipped`);
|
|
65
|
-
return parts.join(', ');
|
|
66
|
-
}
|
|
67
|
-
const result = [`Go test: ${totalPassed} passed, ${totalFailed} failed, ${totalSkipped} skipped`];
|
|
68
|
-
if (failedTests.length > 0) {
|
|
69
|
-
result.push("\nFailures:");
|
|
70
|
-
const limit = 3;
|
|
71
|
-
for (let i = 0; i < Math.min(failedTests.length, limit); i++) {
|
|
72
|
-
const ft = failedTests[i];
|
|
73
|
-
result.push(` ${i + 1}. ${ft.name}`);
|
|
74
|
-
for (const l of ft.lines.slice(0, 5)) {
|
|
75
|
-
result.push(` ${l.trim()}`);
|
|
76
|
-
}
|
|
77
|
-
if (ft.lines.length > 5) {
|
|
78
|
-
result.push(` ... +${ft.lines.length - 5} more lines`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (failedTests.length > limit) {
|
|
82
|
-
result.push(` ... +${failedTests.length - limit} more failures`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return result.join('\n');
|
|
86
|
-
}
|
|
87
|
-
function filterGoVet(stdout) {
|
|
88
|
-
const lines = stdout.split('\n').filter(l => l.trim().length > 0);
|
|
89
|
-
if (lines.length === 0)
|
|
90
|
-
return "Go vet: no issues found";
|
|
91
|
-
if (lines.length <= 20)
|
|
92
|
-
return stdout.trim();
|
|
93
|
-
const result = [`Go vet: ${lines.length} issues found`];
|
|
94
|
-
result.push(...lines.slice(0, 10));
|
|
95
|
-
if (lines.length > 10) {
|
|
96
|
-
result.push(`... +${lines.length - 10} more issues`);
|
|
97
|
-
}
|
|
98
|
-
return result.join('\n');
|
|
99
|
-
}
|
|
1
|
+
'use strict';const a0_0x519178=a0_0x4488;(function(_0x5323e8,_0x3c5bcf){const _0x105b74=a0_0x4488,_0x3b51a5=_0x5323e8();while(!![]){try{const _0x41d143=-parseInt(_0x105b74(0x11c))/0x1*(parseInt(_0x105b74(0x115))/0x2)+parseInt(_0x105b74(0xf8))/0x3+-parseInt(_0x105b74(0x120))/0x4*(-parseInt(_0x105b74(0xfc))/0x5)+parseInt(_0x105b74(0x11b))/0x6*(parseInt(_0x105b74(0x123))/0x7)+parseInt(_0x105b74(0x11f))/0x8+-parseInt(_0x105b74(0x10d))/0x9+-parseInt(_0x105b74(0x10c))/0xa*(parseInt(_0x105b74(0x11e))/0xb);if(_0x41d143===_0x3c5bcf)break;else _0x3b51a5['push'](_0x3b51a5['shift']());}catch(_0x15a62b){_0x3b51a5['push'](_0x3b51a5['shift']());}}}(a0_0x5af7,0x95ecd));function a0_0x4488(_0x1de51f,_0x4fcb71){const _0x5af765=a0_0x5af7();return a0_0x4488=function(_0x4488a2,_0x4e2a3a){_0x4488a2=_0x4488a2-0xf8;let _0x462ec9=_0x5af765[_0x4488a2];return _0x462ec9;},a0_0x4488(_0x1de51f,_0x4fcb71);}Object['defineProperty'](exports,a0_0x519178(0x11a),{'value':!![]}),exports['filterGoTest']=filterGoTest,exports['filterGoVet']=filterGoVet;function filterGoTest(_0x66e348){const _0x1f1b3d=a0_0x519178,_0x1d3411=_0x66e348['split']('\x0a');let _0x174cd6=0x0,_0x19508f=0x0,_0x211ba9=0x0;const _0x32d474=[],_0x578732=[];let _0x3f07ad=null;for(const _0x4929f9 of _0x1d3411){const _0x5036c4=_0x4929f9[_0x1f1b3d(0x119)](),_0x5e37aa=_0x5036c4[_0x1f1b3d(0x101)](/^ok\s+\S+\s+[\d.]+s/);if(_0x5e37aa){_0x578732[_0x1f1b3d(0x100)](_0x5036c4);continue;}const _0x2303b6=_0x5036c4['match'](/^FAIL\s+\S+/);if(_0x2303b6){_0x578732[_0x1f1b3d(0x100)](_0x5036c4);continue;}const _0x1009e5=_0x5036c4[_0x1f1b3d(0x101)](/^--- PASS:/);if(_0x1009e5){_0x174cd6++;continue;}const _0x29359d=_0x5036c4[_0x1f1b3d(0x101)](/^--- FAIL:\s+(\S+)/);if(_0x29359d){if(_0x3f07ad)_0x32d474[_0x1f1b3d(0x100)](_0x3f07ad);_0x3f07ad={'name':_0x29359d[0x1],'lines':[]},_0x19508f++;continue;}if(_0x5036c4['startsWith'](_0x1f1b3d(0xf9))){_0x211ba9++;continue;}_0x3f07ad&&_0x5036c4[_0x1f1b3d(0xfe)]>0x0&&!_0x5036c4[_0x1f1b3d(0xff)](_0x1f1b3d(0x109))&&_0x3f07ad[_0x1f1b3d(0x111)]['push'](_0x4929f9),_0x5036c4['startsWith'](_0x1f1b3d(0x109))&&(_0x3f07ad&&(_0x32d474['push'](_0x3f07ad),_0x3f07ad=null));}if(_0x3f07ad)_0x32d474[_0x1f1b3d(0x100)](_0x3f07ad);if(_0x174cd6===0x0&&_0x19508f===0x0&&_0x211ba9===0x0){if(_0x66e348[_0x1f1b3d(0x102)](_0x1f1b3d(0x124))&&!_0x66e348['includes'](_0x1f1b3d(0x10a)))return _0x1f1b3d(0x104);if(_0x66e348[_0x1f1b3d(0x102)](_0x1f1b3d(0x114)))return _0x1f1b3d(0xfd);return _0x66e348;}if(_0x19508f===0x0){const _0x4a57b0=['Go\x20test:\x20'+_0x174cd6+_0x1f1b3d(0x107)];if(_0x211ba9>0x0)_0x4a57b0[_0x1f1b3d(0x100)](_0x211ba9+_0x1f1b3d(0x10f));return _0x4a57b0[_0x1f1b3d(0x110)](',\x20');}const _0x512f3=[_0x1f1b3d(0x122)+_0x174cd6+'\x20passed,\x20'+_0x19508f+_0x1f1b3d(0x11d)+_0x211ba9+_0x1f1b3d(0x10f)];if(_0x32d474[_0x1f1b3d(0xfe)]>0x0){_0x512f3['push'](_0x1f1b3d(0x121));const _0x285c64=0x3;for(let _0x2c0819=0x0;_0x2c0819<Math[_0x1f1b3d(0x118)](_0x32d474[_0x1f1b3d(0xfe)],_0x285c64);_0x2c0819++){const _0x1b2d0b=_0x32d474[_0x2c0819];_0x512f3[_0x1f1b3d(0x100)]('\x20\x20'+(_0x2c0819+0x1)+'.\x20'+_0x1b2d0b['name']);for(const _0x2aacc9 of _0x1b2d0b[_0x1f1b3d(0x111)][_0x1f1b3d(0x116)](0x0,0x5)){_0x512f3[_0x1f1b3d(0x100)](_0x1f1b3d(0x105)+_0x2aacc9[_0x1f1b3d(0x119)]());}_0x1b2d0b[_0x1f1b3d(0x111)][_0x1f1b3d(0xfe)]>0x5&&_0x512f3[_0x1f1b3d(0x100)](_0x1f1b3d(0xfb)+(_0x1b2d0b[_0x1f1b3d(0x111)][_0x1f1b3d(0xfe)]-0x5)+_0x1f1b3d(0x117));}_0x32d474['length']>_0x285c64&&_0x512f3[_0x1f1b3d(0x100)](_0x1f1b3d(0x10b)+(_0x32d474['length']-_0x285c64)+'\x20more\x20failures');}return _0x512f3[_0x1f1b3d(0x110)]('\x0a');}function a0_0x5af7(){const _0x566e43=['2668EZhNXF','\x0aFailures:','Go\x20test:\x20','63qONdEt','PASS','1443357NzmOHj','---\x20SKIP:','Go\x20vet:\x20','\x20\x20\x20\x20...\x20+','9095ClVpua','Go\x20test:\x20no\x20test\x20files','length','startsWith','push','match','includes','Go\x20vet:\x20no\x20issues\x20found','Go\x20test:\x20all\x20tests\x20passed','\x20\x20\x20\x20','filter','\x20passed','\x20more\x20issues','===\x20RUN','FAIL','\x20\x20...\x20+','10vpsBNc','6198525MVmpfS','\x20issues\x20found','\x20skipped','join','lines','...\x20+','split','no\x20test\x20files','4rVFoOQ','slice','\x20more\x20lines','min','trim','__esModule','132270HgJesN','24493JgNVZB','\x20failed,\x20','18720449cSqbmv','9286928FpLYSW'];a0_0x5af7=function(){return _0x566e43;};return a0_0x5af7();}function filterGoVet(_0x3cfe34){const _0x5c14a2=a0_0x519178,_0x341eb7=_0x3cfe34[_0x5c14a2(0x113)]('\x0a')[_0x5c14a2(0x106)](_0x46542d=>_0x46542d['trim']()[_0x5c14a2(0xfe)]>0x0);if(_0x341eb7[_0x5c14a2(0xfe)]===0x0)return _0x5c14a2(0x103);if(_0x341eb7[_0x5c14a2(0xfe)]<=0x14)return _0x3cfe34['trim']();const _0x45f995=[_0x5c14a2(0xfa)+_0x341eb7[_0x5c14a2(0xfe)]+_0x5c14a2(0x10e)];return _0x45f995[_0x5c14a2(0x100)](..._0x341eb7[_0x5c14a2(0x116)](0x0,0xa)),_0x341eb7[_0x5c14a2(0xfe)]>0xa&&_0x45f995[_0x5c14a2(0x100)](_0x5c14a2(0x112)+(_0x341eb7['length']-0xa)+_0x5c14a2(0x108)),_0x45f995[_0x5c14a2(0x110)]('\x0a');}
|
package/filters/index.js
CHANGED
|
@@ -1,185 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lastFeatures = exports.lastRedactAudit = void 0;
|
|
4
|
-
exports.compressOutput = compressOutput;
|
|
5
|
-
exports.rewriteCommand = rewriteCommand;
|
|
6
|
-
const generic_1 = require("./generic");
|
|
7
|
-
const git_1 = require("./git");
|
|
8
|
-
const python_1 = require("./python");
|
|
9
|
-
const js_1 = require("./js");
|
|
10
|
-
const shell_1 = require("./shell");
|
|
11
|
-
const rust_1 = require("./rust");
|
|
12
|
-
const go_1 = require("./go");
|
|
13
|
-
const devops_1 = require("./devops");
|
|
14
|
-
const redactor_1 = require("../redactor");
|
|
15
|
-
const tracker_1 = require("../tracker");
|
|
16
|
-
exports.lastRedactAudit = { secretsFound: 0, secretTypes: [] };
|
|
17
|
-
exports.lastFeatures = [];
|
|
18
|
-
function isFeatureEnabled(key) {
|
|
19
|
-
try {
|
|
20
|
-
const config = tracker_1.tracker.getConfig();
|
|
21
|
-
const fe = config.features_enabled;
|
|
22
|
-
if (!fe || fe[key] === undefined)
|
|
23
|
-
return true;
|
|
24
|
-
return fe[key] !== false;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function compressOutput(commandLine, stdout, stderr, redactionEnabled = true) {
|
|
31
|
-
const cmd = commandLine.trim();
|
|
32
|
-
let combinedOutput = stdout;
|
|
33
|
-
if (stderr.trim().length > 0) {
|
|
34
|
-
combinedOutput = `${stdout}\n${stderr}`;
|
|
35
|
-
}
|
|
36
|
-
let processed = isFeatureEnabled('ansi_strip') ? (0, generic_1.stripAnsi)(combinedOutput) : combinedOutput;
|
|
37
|
-
const features = [];
|
|
38
|
-
if (processed.length < combinedOutput.length)
|
|
39
|
-
features.push('ansi_strip');
|
|
40
|
-
const tagged = (tag, result) => { features.push(tag); exports.lastFeatures = features; return result; };
|
|
41
|
-
if (redactionEnabled && isFeatureEnabled('redact')) {
|
|
42
|
-
const result = redactor_1.redactor.redactWithAudit(processed);
|
|
43
|
-
processed = result.text;
|
|
44
|
-
exports.lastRedactAudit = { secretsFound: result.secretsFound, secretTypes: result.secretTypes };
|
|
45
|
-
if (result.secretsFound > 0)
|
|
46
|
-
features.push('redact');
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
exports.lastRedactAudit = { secretsFound: 0, secretTypes: [] };
|
|
50
|
-
}
|
|
51
|
-
const cmdLower = cmd.toLowerCase();
|
|
52
|
-
const filtersOn = isFeatureEnabled('filter');
|
|
53
|
-
try {
|
|
54
|
-
if (filtersOn) {
|
|
55
|
-
if (cmdLower.includes('git status') || cmdLower.includes('yadm status')) {
|
|
56
|
-
return tagged('filter', (0, git_1.filterGitStatus)(processed));
|
|
57
|
-
}
|
|
58
|
-
if (cmdLower.includes('git log') || cmdLower.includes('yadm log')) {
|
|
59
|
-
return tagged('filter', (0, git_1.filterGitLog)(processed));
|
|
60
|
-
}
|
|
61
|
-
if (cmdLower.includes('git diff') || cmdLower.includes('git show') || cmdLower.includes('yadm diff')) {
|
|
62
|
-
return tagged('filter', (0, git_1.filterGitDiff)(processed));
|
|
63
|
-
}
|
|
64
|
-
if (cmdLower.includes('pytest') || cmdLower.match(/python3?\s+-m\s+pytest/)) {
|
|
65
|
-
return tagged('filter', (0, python_1.filterPytest)(processed));
|
|
66
|
-
}
|
|
67
|
-
if (cmdLower.includes('pip install') || cmdLower.includes('pip3 install')) {
|
|
68
|
-
return tagged('filter', (0, python_1.filterPipInstall)(processed));
|
|
69
|
-
}
|
|
70
|
-
if (cmdLower.includes('ruff check') || cmdLower.includes('ruff ')) {
|
|
71
|
-
return tagged('filter', (0, devops_1.filterRuff)(processed));
|
|
72
|
-
}
|
|
73
|
-
if (cmdLower.includes('npm install') ||
|
|
74
|
-
cmdLower.includes('npm i ') ||
|
|
75
|
-
cmdLower.endsWith('npm i') ||
|
|
76
|
-
cmdLower.includes('pnpm install') ||
|
|
77
|
-
cmdLower.includes('yarn install')) {
|
|
78
|
-
return tagged('filter', (0, js_1.filterNpmInstall)(processed));
|
|
79
|
-
}
|
|
80
|
-
if (cmdLower.includes('jest') || cmdLower.includes('vitest')) {
|
|
81
|
-
return tagged('filter', (0, js_1.filterJestVitest)(processed));
|
|
82
|
-
}
|
|
83
|
-
if (cmdLower.includes('npm test') || cmdLower.includes('pnpm test') || cmdLower.includes('yarn test') || cmdLower.includes('npm run test')) {
|
|
84
|
-
return tagged('filter', (0, js_1.filterJestVitest)(processed));
|
|
85
|
-
}
|
|
86
|
-
if (cmdLower.includes('cargo test')) {
|
|
87
|
-
return tagged('filter', (0, rust_1.filterCargoTest)(processed));
|
|
88
|
-
}
|
|
89
|
-
if (cmdLower.includes('cargo build') || cmdLower.includes('cargo check') || cmdLower.includes('cargo clippy')) {
|
|
90
|
-
return tagged('filter', (0, rust_1.filterCargoBuild)(processed));
|
|
91
|
-
}
|
|
92
|
-
if (cmdLower.includes('go test')) {
|
|
93
|
-
return tagged('filter', (0, go_1.filterGoTest)(processed));
|
|
94
|
-
}
|
|
95
|
-
if (cmdLower.includes('go vet')) {
|
|
96
|
-
return tagged('filter', (0, go_1.filterGoVet)(processed));
|
|
97
|
-
}
|
|
98
|
-
if (cmdLower.match(/docker\s+ps/)) {
|
|
99
|
-
return tagged('filter', (0, devops_1.filterDockerPs)(processed));
|
|
100
|
-
}
|
|
101
|
-
if (cmdLower.match(/docker\s+images/)) {
|
|
102
|
-
return tagged('filter', (0, devops_1.filterDockerImages)(processed));
|
|
103
|
-
}
|
|
104
|
-
if (cmdLower.match(/docker\s+logs/)) {
|
|
105
|
-
return tagged('filter', (0, devops_1.filterDockerLogs)(processed));
|
|
106
|
-
}
|
|
107
|
-
if (cmdLower.includes('kubectl')) {
|
|
108
|
-
const subMatch = cmdLower.match(/kubectl\s+(get|logs|describe|apply)/);
|
|
109
|
-
const sub = subMatch ? subMatch[1] : 'get';
|
|
110
|
-
return tagged('filter', (0, devops_1.filterKubectl)(processed, sub));
|
|
111
|
-
}
|
|
112
|
-
if (cmdLower.match(/^(ls|dir)(\s|$)/) || cmdLower.includes(' ls ') || cmdLower.endsWith(' ls')) {
|
|
113
|
-
return tagged('filter', (0, shell_1.filterLs)(processed));
|
|
114
|
-
}
|
|
115
|
-
if (cmdLower.match(/^tree(\s|$)/) || cmdLower.includes(' tree ') || cmdLower.endsWith(' tree')) {
|
|
116
|
-
return tagged('filter', (0, shell_1.filterTree)(processed));
|
|
117
|
-
}
|
|
118
|
-
if (cmdLower.match(/^(cat|head|tail|read|bat)(\s|$)/)) {
|
|
119
|
-
const catResult = (0, shell_1.filterCat)(processed, cmd);
|
|
120
|
-
if (catResult.includes('[lock file]'))
|
|
121
|
-
features.push('lock');
|
|
122
|
-
else if (catResult.includes('[binary') || catResult.includes('[minified file]'))
|
|
123
|
-
features.push('binary');
|
|
124
|
-
else if (catResult.includes('[code skeleton]'))
|
|
125
|
-
features.push('skeleton');
|
|
126
|
-
else if (catResult.includes('| ') && catResult.includes('---') && catResult.length < processed.length * 0.5)
|
|
127
|
-
features.push('json_crusher');
|
|
128
|
-
else if (catResult.includes('lines truncated'))
|
|
129
|
-
features.push('filter');
|
|
130
|
-
if (catResult.length < processed.length && !features.some(f => f !== 'ansi_strip' && f !== 'redact'))
|
|
131
|
-
features.push('filter');
|
|
132
|
-
exports.lastFeatures = features;
|
|
133
|
-
return catResult;
|
|
134
|
-
}
|
|
135
|
-
if (cmdLower.match(/^find(\s|$)/)) {
|
|
136
|
-
return tagged('filter', (0, shell_1.filterFind)(processed));
|
|
137
|
-
}
|
|
138
|
-
if (cmdLower.match(/^(grep|rg|ripgrep)(\s|$)/)) {
|
|
139
|
-
return tagged('filter', (0, shell_1.filterGrep)(processed));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
catch (err) {
|
|
144
|
-
}
|
|
145
|
-
if (isFeatureEnabled('whitespace')) {
|
|
146
|
-
processed = (0, generic_1.collapseWhitespace)(processed);
|
|
147
|
-
features.push('whitespace');
|
|
148
|
-
}
|
|
149
|
-
processed = (0, generic_1.collapseDuplicates)(processed);
|
|
150
|
-
processed = (0, generic_1.softTruncate)(processed, 20000);
|
|
151
|
-
exports.lastFeatures = features;
|
|
152
|
-
return processed;
|
|
153
|
-
}
|
|
154
|
-
const REWRITE_RULES = [
|
|
155
|
-
{ pattern: /^(?:git|yadm)\s+(?:-[Cc]\s+\S+\s+)*(status|log|diff|show|add|commit|push|pull|branch|fetch|stash|worktree)/, prefix: 'trim git' },
|
|
156
|
-
{ pattern: /^gh\s+(pr|issue|run|repo|api|release)/, prefix: 'trim gh' },
|
|
157
|
-
{ pattern: /^glab\s+(mr|issue|ci|pipeline|api|release)/, prefix: 'trim glab' },
|
|
158
|
-
{ pattern: /^cargo\s+(build|test|clippy|check|fmt|install)/, prefix: 'trim cargo' },
|
|
159
|
-
{ pattern: /^pnpm\s+(exec|i|install|list|ls|outdated|run|run-script)/, prefix: 'trim pnpm' },
|
|
160
|
-
{ pattern: /^npm\s+(exec|run|run-script|rum|urn|x|test)(\s|$)/, prefix: 'trim npm' },
|
|
161
|
-
{ pattern: /^npx\s+/, prefix: 'trim npx' },
|
|
162
|
-
{ pattern: /^(cat|head|tail)\s+/, prefix: 'trim read' },
|
|
163
|
-
{ pattern: /^(rg|grep)\s+/, prefix: 'trim grep' },
|
|
164
|
-
{ pattern: /^ls(\s|$)/, prefix: 'trim ls' },
|
|
165
|
-
{ pattern: /^tree(\s|$)/, prefix: 'trim tree' },
|
|
166
|
-
{ pattern: /^find\s+/, prefix: 'trim find' },
|
|
167
|
-
{ pattern: /^docker\s+(ps|images|logs|run|exec|build|compose)/, prefix: 'trim docker' },
|
|
168
|
-
{ pattern: /^kubectl\s+(get|logs|describe|apply)/, prefix: 'trim kubectl' },
|
|
169
|
-
{ pattern: /^(python3?\s+-m\s+)?pytest(\s|$)/, prefix: 'trim pytest' },
|
|
170
|
-
{ pattern: /^ruff\s+(check|format)/, prefix: 'trim ruff' },
|
|
171
|
-
{ pattern: /^(pip3?|uv\s+pip)\s+(list|outdated|install|show)/, prefix: 'trim pip' },
|
|
172
|
-
{ pattern: /^go\s+(test|build|vet)/, prefix: 'trim go' }
|
|
173
|
-
];
|
|
174
|
-
function rewriteCommand(commandLine) {
|
|
175
|
-
const trimmed = commandLine.trim();
|
|
176
|
-
if (trimmed.startsWith('trim ')) {
|
|
177
|
-
return trimmed;
|
|
178
|
-
}
|
|
179
|
-
for (const rule of REWRITE_RULES) {
|
|
180
|
-
if (rule.pattern.test(trimmed)) {
|
|
181
|
-
return `trim ${trimmed}`;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return trimmed;
|
|
185
|
-
}
|
|
1
|
+
'use strict';function a0_0x596d(_0x11b32f,_0xbfaff1){const _0x5cf4d2=a0_0x5cf4();return a0_0x596d=function(_0x596d72,_0x172591){_0x596d72=_0x596d72-0x157;let _0x99961e=_0x5cf4d2[_0x596d72];return _0x99961e;},a0_0x596d(_0x11b32f,_0xbfaff1);}const a0_0x18ac55=a0_0x596d;(function(_0x406ebe,_0x42ea49){const _0x2898b1=a0_0x596d,_0xfca3bc=_0x406ebe();while(!![]){try{const _0x210c59=-parseInt(_0x2898b1(0x183))/0x1+parseInt(_0x2898b1(0x15d))/0x2+parseInt(_0x2898b1(0x1a3))/0x3*(parseInt(_0x2898b1(0x1bb))/0x4)+-parseInt(_0x2898b1(0x1ba))/0x5+-parseInt(_0x2898b1(0x1b6))/0x6*(-parseInt(_0x2898b1(0x1bc))/0x7)+parseInt(_0x2898b1(0x18d))/0x8+-parseInt(_0x2898b1(0x16a))/0x9;if(_0x210c59===_0x42ea49)break;else _0xfca3bc['push'](_0xfca3bc['shift']());}catch(_0xbbcb19){_0xfca3bc['push'](_0xfca3bc['shift']());}}}(a0_0x5cf4,0xcd4a4));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0_0x18ac55(0x19d)]=exports[a0_0x18ac55(0x19a)]=void 0x0,exports[a0_0x18ac55(0x1aa)]=compressOutput,exports['rewriteCommand']=rewriteCommand;const generic_1=require('./generic'),git_1=require('./git'),python_1=require(a0_0x18ac55(0x15e)),js_1=require('./js'),shell_1=require(a0_0x18ac55(0x167)),rust_1=require(a0_0x18ac55(0x1a6)),go_1=require(a0_0x18ac55(0x196)),devops_1=require('./devops'),redactor_1=require(a0_0x18ac55(0x169)),tracker_1=require(a0_0x18ac55(0x1a7));exports[a0_0x18ac55(0x19a)]={'secretsFound':0x0,'secretTypes':[]},exports[a0_0x18ac55(0x19d)]=[];function isFeatureEnabled(_0x47bd11){const _0x473e1b=a0_0x18ac55;try{const _0x41b385=tracker_1[_0x473e1b(0x17e)][_0x473e1b(0x171)](),_0x2c3c1d=_0x41b385[_0x473e1b(0x197)];if(!_0x2c3c1d||_0x2c3c1d[_0x47bd11]===undefined)return!![];return _0x2c3c1d[_0x47bd11]!==![];}catch{return!![];}}function compressOutput(_0x576ec6,_0x1de331,_0x3163f2,_0x3be560=!![]){const _0xc4cf4e=a0_0x18ac55,_0xbd077b=_0x576ec6[_0xc4cf4e(0x192)]();let _0x11b24b=_0x1de331;_0x3163f2['trim']()[_0xc4cf4e(0x175)]>0x0&&(_0x11b24b=_0x1de331+'\x0a'+_0x3163f2);let _0x4c823a=isFeatureEnabled(_0xc4cf4e(0x15b))?(0x0,generic_1[_0xc4cf4e(0x165)])(_0x11b24b):_0x11b24b;const _0x90ee2b=[];if(_0x4c823a[_0xc4cf4e(0x175)]<_0x11b24b[_0xc4cf4e(0x175)])_0x90ee2b[_0xc4cf4e(0x182)](_0xc4cf4e(0x15b));const _0x3f63c9=(_0x86da5c,_0xce0b78)=>{const _0x599582=_0xc4cf4e;return _0x90ee2b[_0x599582(0x182)](_0x86da5c),exports[_0x599582(0x19d)]=_0x90ee2b,_0xce0b78;};if(_0x3be560&&isFeatureEnabled(_0xc4cf4e(0x160))){const _0x2af93d=redactor_1[_0xc4cf4e(0x174)][_0xc4cf4e(0x172)](_0x4c823a);_0x4c823a=_0x2af93d[_0xc4cf4e(0x1a1)],exports[_0xc4cf4e(0x19a)]={'secretsFound':_0x2af93d[_0xc4cf4e(0x16e)],'secretTypes':_0x2af93d[_0xc4cf4e(0x16b)]};if(_0x2af93d[_0xc4cf4e(0x16e)]>0x0)_0x90ee2b[_0xc4cf4e(0x182)](_0xc4cf4e(0x160));}else exports[_0xc4cf4e(0x19a)]={'secretsFound':0x0,'secretTypes':[]};const _0xee6caa=_0xbd077b['toLowerCase'](),_0xe93c8f=isFeatureEnabled(_0xc4cf4e(0x1ae));try{if(_0xe93c8f){if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x1a8))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x1b7)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,git_1['filterGitStatus'])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x15c))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x186)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,git_1['filterGitLog'])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x168))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x189))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x176)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,git_1[_0xc4cf4e(0x198)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)]('pytest')||_0xee6caa[_0xc4cf4e(0x177)](/python3?\s+-m\s+pytest/))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,python_1[_0xc4cf4e(0x1b8)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x185))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x161)))return _0x3f63c9('filter',(0x0,python_1[_0xc4cf4e(0x15a)])(_0x4c823a));if(_0xee6caa['includes'](_0xc4cf4e(0x188))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x18e)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,devops_1[_0xc4cf4e(0x195)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x199))||_0xee6caa['includes'](_0xc4cf4e(0x19b))||_0xee6caa[_0xc4cf4e(0x190)]('npm\x20i')||_0xee6caa['includes'](_0xc4cf4e(0x157))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x180)))return _0x3f63c9('filter',(0x0,js_1[_0xc4cf4e(0x1a5)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)]('jest')||_0xee6caa['includes']('vitest'))return _0x3f63c9('filter',(0x0,js_1[_0xc4cf4e(0x1b3)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)]('npm\x20test')||_0xee6caa['includes'](_0xc4cf4e(0x19e))||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x184))||_0xee6caa[_0xc4cf4e(0x187)]('npm\x20run\x20test'))return _0x3f63c9('filter',(0x0,js_1[_0xc4cf4e(0x1b3)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x1b9)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,rust_1[_0xc4cf4e(0x1a2)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x18c))||_0xee6caa[_0xc4cf4e(0x187)]('cargo\x20check')||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x18b)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,rust_1[_0xc4cf4e(0x18f)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)]('go\x20test'))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,go_1['filterGoTest'])(_0x4c823a));if(_0xee6caa['includes']('go\x20vet'))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,go_1[_0xc4cf4e(0x15f)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x177)](/docker\s+ps/))return _0x3f63c9('filter',(0x0,devops_1[_0xc4cf4e(0x19f)])(_0x4c823a));if(_0xee6caa['match'](/docker\s+images/))return _0x3f63c9('filter',(0x0,devops_1[_0xc4cf4e(0x191)])(_0x4c823a));if(_0xee6caa['match'](/docker\s+logs/))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,devops_1[_0xc4cf4e(0x1a4)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x187)]('kubectl')){const _0x5943fa=_0xee6caa['match'](/kubectl\s+(get|logs|describe|apply)/),_0x19ea8b=_0x5943fa?_0x5943fa[0x1]:_0xc4cf4e(0x17b);return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,devops_1[_0xc4cf4e(0x1ac)])(_0x4c823a,_0x19ea8b));}if(_0xee6caa[_0xc4cf4e(0x177)](/^(ls|dir)(\s|$)/)||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x1b0))||_0xee6caa[_0xc4cf4e(0x190)]('\x20ls'))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,shell_1[_0xc4cf4e(0x164)])(_0x4c823a));if(_0xee6caa['match'](/^tree(\s|$)/)||_0xee6caa[_0xc4cf4e(0x187)](_0xc4cf4e(0x1ad))||_0xee6caa[_0xc4cf4e(0x190)](_0xc4cf4e(0x173)))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,shell_1[_0xc4cf4e(0x1b4)])(_0x4c823a));if(_0xee6caa['match'](/^(cat|head|tail|read|bat)(\s|$)/)){const _0x54ee64=(0x0,shell_1[_0xc4cf4e(0x1af)])(_0x4c823a,_0xbd077b);if(_0x54ee64[_0xc4cf4e(0x187)](_0xc4cf4e(0x17d)))_0x90ee2b[_0xc4cf4e(0x182)](_0xc4cf4e(0x1a9));else{if(_0x54ee64[_0xc4cf4e(0x187)]('[binary')||_0x54ee64[_0xc4cf4e(0x187)](_0xc4cf4e(0x17f)))_0x90ee2b['push']('binary');else{if(_0x54ee64[_0xc4cf4e(0x187)](_0xc4cf4e(0x16d)))_0x90ee2b['push'](_0xc4cf4e(0x158));else{if(_0x54ee64[_0xc4cf4e(0x187)]('|\x20')&&_0x54ee64[_0xc4cf4e(0x187)](_0xc4cf4e(0x18a))&&_0x54ee64[_0xc4cf4e(0x175)]<_0x4c823a['length']*0.5)_0x90ee2b['push'](_0xc4cf4e(0x170));else{if(_0x54ee64[_0xc4cf4e(0x187)]('lines\x20truncated'))_0x90ee2b['push'](_0xc4cf4e(0x1ae));}}}}if(_0x54ee64[_0xc4cf4e(0x175)]<_0x4c823a['length']&&!_0x90ee2b[_0xc4cf4e(0x193)](_0x37da3a=>_0x37da3a!=='ansi_strip'&&_0x37da3a!==_0xc4cf4e(0x160)))_0x90ee2b[_0xc4cf4e(0x182)](_0xc4cf4e(0x1ae));return exports[_0xc4cf4e(0x19d)]=_0x90ee2b,_0x54ee64;}if(_0xee6caa[_0xc4cf4e(0x177)](/^find(\s|$)/))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,shell_1[_0xc4cf4e(0x1b2)])(_0x4c823a));if(_0xee6caa[_0xc4cf4e(0x177)](/^(grep|rg|ripgrep)(\s|$)/))return _0x3f63c9(_0xc4cf4e(0x1ae),(0x0,shell_1[_0xc4cf4e(0x17c)])(_0x4c823a));}}catch(_0x1b044d){}return isFeatureEnabled(_0xc4cf4e(0x166))&&(_0x4c823a=(0x0,generic_1['collapseWhitespace'])(_0x4c823a),_0x90ee2b['push'](_0xc4cf4e(0x166))),_0x4c823a=(0x0,generic_1[_0xc4cf4e(0x16c)])(_0x4c823a),_0x4c823a=(0x0,generic_1[_0xc4cf4e(0x181)])(_0x4c823a,0x4e20),exports[_0xc4cf4e(0x19d)]=_0x90ee2b,_0x4c823a;}const REWRITE_RULES=[{'pattern':/^(?:git|yadm)\s+(?:-[Cc]\s+\S+\s+)*(status|log|diff|show|add|commit|push|pull|branch|fetch|stash|worktree)/,'prefix':a0_0x18ac55(0x1ab)},{'pattern':/^gh\s+(pr|issue|run|repo|api|release)/,'prefix':'trim\x20gh'},{'pattern':/^glab\s+(mr|issue|ci|pipeline|api|release)/,'prefix':a0_0x18ac55(0x162)},{'pattern':/^cargo\s+(build|test|clippy|check|fmt|install)/,'prefix':'trim\x20cargo'},{'pattern':/^pnpm\s+(exec|i|install|list|ls|outdated|run|run-script)/,'prefix':'trim\x20pnpm'},{'pattern':/^npm\s+(exec|run|run-script|rum|urn|x|test)(\s|$)/,'prefix':a0_0x18ac55(0x194)},{'pattern':/^npx\s+/,'prefix':a0_0x18ac55(0x163)},{'pattern':/^(cat|head|tail)\s+/,'prefix':'trim\x20read'},{'pattern':/^(rg|grep)\s+/,'prefix':a0_0x18ac55(0x16f)},{'pattern':/^ls(\s|$)/,'prefix':a0_0x18ac55(0x19c)},{'pattern':/^tree(\s|$)/,'prefix':'trim\x20tree'},{'pattern':/^find\s+/,'prefix':a0_0x18ac55(0x178)},{'pattern':/^docker\s+(ps|images|logs|run|exec|build|compose)/,'prefix':a0_0x18ac55(0x179)},{'pattern':/^kubectl\s+(get|logs|describe|apply)/,'prefix':a0_0x18ac55(0x159)},{'pattern':/^(python3?\s+-m\s+)?pytest(\s|$)/,'prefix':a0_0x18ac55(0x1b1)},{'pattern':/^ruff\s+(check|format)/,'prefix':'trim\x20ruff'},{'pattern':/^(pip3?|uv\s+pip)\s+(list|outdated|install|show)/,'prefix':'trim\x20pip'},{'pattern':/^go\s+(test|build|vet)/,'prefix':'trim\x20go'}];function a0_0x5cf4(){const _0x55eb49=['./go','features_enabled','filterGitDiff','npm\x20install','lastRedactAudit','npm\x20i\x20','trim\x20ls','lastFeatures','pnpm\x20test','filterDockerPs','pattern','text','filterCargoTest','59127NKBhKC','filterDockerLogs','filterNpmInstall','./rust','../tracker','git\x20status','lock','compressOutput','trim\x20git','filterKubectl','\x20tree\x20','filter','filterCat','\x20ls\x20','trim\x20pytest','filterFind','filterJestVitest','filterTree','startsWith','390612Ppymdt','yadm\x20status','filterPytest','cargo\x20test','2064160JJkmAJ','52pJOfAx','28YLTDPf','pnpm\x20install','skeleton','trim\x20kubectl','filterPipInstall','ansi_strip','git\x20log','2885088yUEilj','./python','filterGoVet','redact','pip3\x20install','trim\x20glab','trim\x20npx','filterLs','stripAnsi','whitespace','./shell','git\x20diff','../redactor','3427956XmqFuz','secretTypes','collapseDuplicates','[code\x20skeleton]','secretsFound','trim\x20grep','json_crusher','getConfig','redactWithAudit','\x20tree','redactor','length','yadm\x20diff','match','trim\x20find','trim\x20docker','trim\x20','get','filterGrep','[lock\x20file]','tracker','[minified\x20file]','yarn\x20install','softTruncate','push','1419330ecZtYM','yarn\x20test','pip\x20install','yadm\x20log','includes','ruff\x20check','git\x20show','---','cargo\x20clippy','cargo\x20build','8757960SGBKgL','ruff\x20','filterCargoBuild','endsWith','filterDockerImages','trim','some','trim\x20npm','filterRuff'];a0_0x5cf4=function(){return _0x55eb49;};return a0_0x5cf4();}function rewriteCommand(_0x12d2e5){const _0x59c3ad=a0_0x18ac55,_0x5eb2a6=_0x12d2e5[_0x59c3ad(0x192)]();if(_0x5eb2a6[_0x59c3ad(0x1b5)]('trim\x20'))return _0x5eb2a6;for(const _0x2dc9da of REWRITE_RULES){if(_0x2dc9da[_0x59c3ad(0x1a0)]['test'](_0x5eb2a6))return _0x59c3ad(0x17a)+_0x5eb2a6;}return _0x5eb2a6;}
|
package/filters/js.js
CHANGED
|
@@ -1,78 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterNpmInstall = filterNpmInstall;
|
|
4
|
-
exports.filterJestVitest = filterJestVitest;
|
|
5
|
-
function filterNpmInstall(stdout) {
|
|
6
|
-
const cleanText = stdout.replace(/\r/g, '\n');
|
|
7
|
-
const lines = cleanText.split('\n');
|
|
8
|
-
const result = [];
|
|
9
|
-
for (const line of lines) {
|
|
10
|
-
const trimmed = line.trim();
|
|
11
|
-
if (trimmed.includes('added ') ||
|
|
12
|
-
trimmed.includes('removed ') ||
|
|
13
|
-
trimmed.includes('audited ') ||
|
|
14
|
-
trimmed.includes('up to date') ||
|
|
15
|
-
trimmed.includes('found ')) {
|
|
16
|
-
if (!trimmed.includes('%') && !trimmed.startsWith('⠋') && !trimmed.startsWith('⠙')) {
|
|
17
|
-
result.push(trimmed);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const output = result.join('\n').trim();
|
|
22
|
-
return output.length > 0 ? output : "NPM: Packages verified/installed successfully";
|
|
23
|
-
}
|
|
24
|
-
function filterJestVitest(stdout) {
|
|
25
|
-
const lines = stdout.split('\n');
|
|
26
|
-
let passed = 0;
|
|
27
|
-
let failed = 0;
|
|
28
|
-
let total = 0;
|
|
29
|
-
const failureLines = [];
|
|
30
|
-
let inFailureSection = false;
|
|
31
|
-
for (const line of lines) {
|
|
32
|
-
const trimmed = line.trim();
|
|
33
|
-
if (trimmed.startsWith('Tests:') || trimmed.includes('Test Files:')) {
|
|
34
|
-
const matchPassed = trimmed.match(/(\d+)\s+passed/);
|
|
35
|
-
const matchFailed = trimmed.match(/(\d+)\s+failed/);
|
|
36
|
-
const matchTotal = trimmed.match(/(\d+)\s+total/);
|
|
37
|
-
if (matchPassed)
|
|
38
|
-
passed = parseInt(matchPassed[1]);
|
|
39
|
-
if (matchFailed)
|
|
40
|
-
failed = parseInt(matchFailed[1]);
|
|
41
|
-
if (matchTotal)
|
|
42
|
-
total = parseInt(matchTotal[1]);
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
if (trimmed.startsWith('❯') || trimmed.startsWith('●') || trimmed.startsWith('FAIL ')) {
|
|
46
|
-
inFailureSection = true;
|
|
47
|
-
}
|
|
48
|
-
if (inFailureSection) {
|
|
49
|
-
if (trimmed.length > 0 && !trimmed.startsWith('Test Suites:') && !trimmed.startsWith('Tests:')) {
|
|
50
|
-
failureLines.push(line);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (total === 0 && passed === 0 && failed === 0) {
|
|
55
|
-
if (stdout.includes('PASS') && !stdout.includes('FAIL')) {
|
|
56
|
-
const match = stdout.match(/(\d+)\s+passed/);
|
|
57
|
-
const count = match ? match[1] : "all";
|
|
58
|
-
return `Test Runner: ${count} passed`;
|
|
59
|
-
}
|
|
60
|
-
return stdout;
|
|
61
|
-
}
|
|
62
|
-
if (failed === 0 && passed > 0) {
|
|
63
|
-
return `Test Runner: ${passed} passed`;
|
|
64
|
-
}
|
|
65
|
-
const result = [`Test Runner: ${passed} passed, ${failed} failed (${total} total)`];
|
|
66
|
-
if (failureLines.length > 0) {
|
|
67
|
-
result.push("\nFailures:");
|
|
68
|
-
const limit = 25;
|
|
69
|
-
const printedLines = failureLines.slice(0, limit);
|
|
70
|
-
for (const line of printedLines) {
|
|
71
|
-
result.push(` ${line}`);
|
|
72
|
-
}
|
|
73
|
-
if (failureLines.length > limit) {
|
|
74
|
-
result.push(` ... (${failureLines.length - limit} lines of trace details truncated)`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return result.join('\n');
|
|
78
|
-
}
|
|
1
|
+
'use strict';const a0_0x59eef9=a0_0x2cf2;(function(_0x3aac72,_0xa97c56){const _0x111737=a0_0x2cf2,_0x474261=_0x3aac72();while(!![]){try{const _0x27c463=parseInt(_0x111737(0x192))/0x1+parseInt(_0x111737(0x17e))/0x2*(-parseInt(_0x111737(0x18e))/0x3)+-parseInt(_0x111737(0x18d))/0x4*(-parseInt(_0x111737(0x16c))/0x5)+parseInt(_0x111737(0x175))/0x6+parseInt(_0x111737(0x183))/0x7*(parseInt(_0x111737(0x18a))/0x8)+-parseInt(_0x111737(0x174))/0x9+-parseInt(_0x111737(0x16e))/0xa*(-parseInt(_0x111737(0x190))/0xb);if(_0x27c463===_0xa97c56)break;else _0x474261['push'](_0x474261['shift']());}catch(_0x23ed74){_0x474261['push'](_0x474261['shift']());}}}(a0_0x40b6,0x741fb));Object[a0_0x59eef9(0x173)](exports,a0_0x59eef9(0x182),{'value':!![]}),exports['filterNpmInstall']=filterNpmInstall,exports[a0_0x59eef9(0x176)]=filterJestVitest;function filterNpmInstall(_0x453ddc){const _0xc45ffe=a0_0x59eef9,_0x47ad66=_0x453ddc[_0xc45ffe(0x16a)](/\r/g,'\x0a'),_0x169e9e=_0x47ad66[_0xc45ffe(0x17f)]('\x0a'),_0x368b75=[];for(const _0x2c5302 of _0x169e9e){const _0x52ec4f=_0x2c5302['trim']();(_0x52ec4f[_0xc45ffe(0x16f)](_0xc45ffe(0x185))||_0x52ec4f[_0xc45ffe(0x16f)](_0xc45ffe(0x186))||_0x52ec4f[_0xc45ffe(0x16f)](_0xc45ffe(0x177))||_0x52ec4f[_0xc45ffe(0x16f)](_0xc45ffe(0x178))||_0x52ec4f[_0xc45ffe(0x16f)](_0xc45ffe(0x18f)))&&(!_0x52ec4f[_0xc45ffe(0x16f)]('%')&&!_0x52ec4f[_0xc45ffe(0x17a)]('⠋')&&!_0x52ec4f[_0xc45ffe(0x17a)]('⠙')&&_0x368b75[_0xc45ffe(0x191)](_0x52ec4f));}const _0x19a3dc=_0x368b75[_0xc45ffe(0x17c)]('\x0a')[_0xc45ffe(0x170)]();return _0x19a3dc[_0xc45ffe(0x194)]>0x0?_0x19a3dc:_0xc45ffe(0x16b);}function a0_0x2cf2(_0x1878f6,_0x4fa43f){const _0x40b6b2=a0_0x40b6();return a0_0x2cf2=function(_0x2cf246,_0x2b5920){_0x2cf246=_0x2cf246-0x16a;let _0x4728b8=_0x40b6b2[_0x2cf246];return _0x4728b8;},a0_0x2cf2(_0x1878f6,_0x4fa43f);}function a0_0x40b6(){const _0x4041af=['Test\x20Runner:\x20','\x20lines\x20of\x20trace\x20details\x20truncated)','363220tYIhJY','2281422lHBKnx','found\x20','11ZNyLIV','push','455311JcvUPu','all','length','\x20passed,\x20','replace','NPM:\x20Packages\x20verified/installed\x20successfully','20Hzjseb','PASS','3742770BIKUTb','includes','trim','match','Test\x20Suites:','defineProperty','1676988yLpuvW','847812dtYEGL','filterJestVitest','audited\x20','up\x20to\x20date','Test\x20Files:','startsWith','\x20total)','join','\x20failed\x20(','2nMsUSz','split','FAIL\x20\x20','\x20passed','__esModule','7LSKLIA','\x20\x20...\x20(','added\x20','removed\x20','Tests:','FAIL','slice','706712sHqeqj'];a0_0x40b6=function(){return _0x4041af;};return a0_0x40b6();}function filterJestVitest(_0x5387aa){const _0x5c3e6e=a0_0x59eef9,_0x20902c=_0x5387aa[_0x5c3e6e(0x17f)]('\x0a');let _0xbe2619=0x0,_0x47fdec=0x0,_0x4d5b87=0x0;const _0x124c27=[];let _0x2dad91=![];for(const _0x230eb0 of _0x20902c){const _0x24e1cf=_0x230eb0[_0x5c3e6e(0x170)]();if(_0x24e1cf[_0x5c3e6e(0x17a)](_0x5c3e6e(0x187))||_0x24e1cf[_0x5c3e6e(0x16f)](_0x5c3e6e(0x179))){const _0x97b1b1=_0x24e1cf[_0x5c3e6e(0x171)](/(\d+)\s+passed/),_0x2f91f0=_0x24e1cf[_0x5c3e6e(0x171)](/(\d+)\s+failed/),_0x428d7f=_0x24e1cf[_0x5c3e6e(0x171)](/(\d+)\s+total/);if(_0x97b1b1)_0xbe2619=parseInt(_0x97b1b1[0x1]);if(_0x2f91f0)_0x47fdec=parseInt(_0x2f91f0[0x1]);if(_0x428d7f)_0x4d5b87=parseInt(_0x428d7f[0x1]);continue;}(_0x24e1cf[_0x5c3e6e(0x17a)]('❯')||_0x24e1cf[_0x5c3e6e(0x17a)]('●')||_0x24e1cf[_0x5c3e6e(0x17a)](_0x5c3e6e(0x180)))&&(_0x2dad91=!![]),_0x2dad91&&(_0x24e1cf['length']>0x0&&!_0x24e1cf[_0x5c3e6e(0x17a)](_0x5c3e6e(0x172))&&!_0x24e1cf['startsWith'](_0x5c3e6e(0x187))&&_0x124c27['push'](_0x230eb0));}if(_0x4d5b87===0x0&&_0xbe2619===0x0&&_0x47fdec===0x0){if(_0x5387aa['includes'](_0x5c3e6e(0x16d))&&!_0x5387aa[_0x5c3e6e(0x16f)](_0x5c3e6e(0x188))){const _0x288931=_0x5387aa[_0x5c3e6e(0x171)](/(\d+)\s+passed/),_0x56b1c1=_0x288931?_0x288931[0x1]:_0x5c3e6e(0x193);return'Test\x20Runner:\x20'+_0x56b1c1+_0x5c3e6e(0x181);}return _0x5387aa;}if(_0x47fdec===0x0&&_0xbe2619>0x0)return _0x5c3e6e(0x18b)+_0xbe2619+_0x5c3e6e(0x181);const _0x56b078=[_0x5c3e6e(0x18b)+_0xbe2619+_0x5c3e6e(0x195)+_0x47fdec+_0x5c3e6e(0x17d)+_0x4d5b87+_0x5c3e6e(0x17b)];if(_0x124c27[_0x5c3e6e(0x194)]>0x0){_0x56b078[_0x5c3e6e(0x191)]('\x0aFailures:');const _0x288756=0x19,_0x1d3c01=_0x124c27[_0x5c3e6e(0x189)](0x0,_0x288756);for(const _0x532956 of _0x1d3c01){_0x56b078[_0x5c3e6e(0x191)]('\x20\x20'+_0x532956);}_0x124c27[_0x5c3e6e(0x194)]>_0x288756&&_0x56b078['push'](_0x5c3e6e(0x184)+(_0x124c27[_0x5c3e6e(0x194)]-_0x288756)+_0x5c3e6e(0x18c));}return _0x56b078[_0x5c3e6e(0x17c)]('\x0a');}
|