trimprompt 1.0.30 → 1.0.31
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 +13 -0
- package/api-proxy.js +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 +99 -1
- package/filters/index.js +185 -1
- package/filters/js.js +78 -1
- package/filters/python.js +130 -1
- package/filters/rust.js +115 -1
- package/filters/shell.js +395 -1
- package/hooks/claude-hook.js +79 -1
- package/mcp.js +132 -1
- package/package.json +1 -4
- package/proxy-conv.js +181 -1
- package/proxy-daemon.js +382 -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/traffic-interceptor.js +1 -1
package/file-watcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x517c16=a0_0x2839;function a0_0x3956(){const _0x77adaa=['raw_tokens','conversation_toggles','TrimPrompt\x20Cache\x20Engine','chunk_id','config.json','cwd','sessions','tracker','extname','processSessionFile','Gemini','active_turn','messages','default','copilot','push','.gif','getOwnPropertyNames','github-copilot-cli','.opencode','228543wcKEet','.wal','opencode','isDirectory','mtimeMs','4082089QTwMfx','loadConfig','claude','repeat','conv_','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','startsWith','24bUWtnt','history','endsWith','includes','./hooks/claude-hook','sideCacheSaved','.codex','.jpeg','object','50aMyBON','win32','.lock','codex','.json','get','length','image_','169173uTbCoN','existsSync','ceil','.tmp','cortex','context','.shm','homedir','.gemini','message','.jsonl','round','saveChunk','598970YJgzTH','AppData','call','name','defineProperty','readdirSync','replace','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','.trimprompt','projects','custom_storage_paths','__importStar','loadSessionsState','User','readFileSync','cache','Codex','storage','toLowerCase','Roaming','startWatcherDaemon','.aider.chat.history.md','hasOwnProperty','content','live-conv','parse','trim','openclaw','.openclaw','trim_offload','path','isArray','.json1','statSync','writable','.webp','Application\x20Support','antigravity','max','.cortex','activeSavedTokens','split','watch','getAgentStoragePaths','string','mkdirSync','lineCount','modified','writeFileSync','248bICaqc','.config','logExecution','Summary:\x20Tool\x20result\x20offloaded\x20(','Cursor','Summary:\x20Text\x20block\x20offloaded\x20(','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','official_compact','basename','join','cursor','gemini','isFile','\x20tokens).','21aPldqg','getLatestSessionFile','conv:','__createBinding','stringify','compressed_tokens','1986092bYhRfR','create','248961zIGfUc','fullPath','configurable','1317558XlpmFD','officialCompactSaved','TrimPromptDaemon.vbs','.dat','Microsoft','.claude','media__','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','saveConfig','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','utf8','toISOString','text'];a0_0x3956=function(){return _0x77adaa;};return a0_0x3956();}(function(_0x26eac8,_0x1b0abb){const _0x448785=a0_0x2839,_0x5c5da6=_0x26eac8();while(!![]){try{const _0x3c720a=-parseInt(_0x448785(0x18f))/0x1+parseInt(_0x448785(0x169))/0x2+-parseInt(_0x448785(0x16b))/0x3*(-parseInt(_0x448785(0x19b))/0x4)+-parseInt(_0x448785(0x1b9))/0x5+-parseInt(_0x448785(0x16e))/0x6*(-parseInt(_0x448785(0x163))/0x7)+-parseInt(_0x448785(0x155))/0x8*(-parseInt(_0x448785(0x1ac))/0x9)+parseInt(_0x448785(0x1a4))/0xa*(-parseInt(_0x448785(0x194))/0xb);if(_0x3c720a===_0x1b0abb)break;else _0x5c5da6['push'](_0x5c5da6['shift']());}catch(_0x3fb371){_0x5c5da6['push'](_0x5c5da6['shift']());}}}(a0_0x3956,0x810ee));var __createBinding=this&&this[a0_0x517c16(0x166)]||(Object[a0_0x517c16(0x16a)]?function(_0x1b04a6,_0x231efa,_0x2abc5f,_0x587b8a){const _0x2584a4=a0_0x517c16;if(_0x587b8a===undefined)_0x587b8a=_0x2abc5f;var _0x316232=Object['getOwnPropertyDescriptor'](_0x231efa,_0x2abc5f);(!_0x316232||(_0x2584a4(0x1a9)in _0x316232?!_0x231efa['__esModule']:_0x316232[_0x2584a4(0x1db)]||_0x316232[_0x2584a4(0x16d)]))&&(_0x316232={'enumerable':!![],'get':function(){return _0x231efa[_0x2abc5f];}}),Object[_0x2584a4(0x1bd)](_0x1b04a6,_0x587b8a,_0x316232);}:function(_0x62c5ba,_0x30a797,_0x2249a5,_0xeb8195){if(_0xeb8195===undefined)_0xeb8195=_0x2249a5;_0x62c5ba[_0xeb8195]=_0x30a797[_0x2249a5];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x517c16(0x16a)]?function(_0x3a41c8,_0x5a84cc){const _0x5ce255=a0_0x517c16;Object['defineProperty'](_0x3a41c8,_0x5ce255(0x188),{'enumerable':!![],'value':_0x5a84cc});}:function(_0x4cd396,_0xb624ea){const _0x467439=a0_0x517c16;_0x4cd396[_0x467439(0x188)]=_0xb624ea;}),__importStar=this&&this[a0_0x517c16(0x1c4)]||(function(){var _0x18e172=function(_0x56b473){const _0x45572b=a0_0x2839;return _0x18e172=Object[_0x45572b(0x18c)]||function(_0x3818a3){const _0x199910=_0x45572b;var _0x407d4a=[];for(var _0x3517a0 in _0x3818a3)if(Object['prototype'][_0x199910(0x1cf)][_0x199910(0x1bb)](_0x3818a3,_0x3517a0))_0x407d4a[_0x407d4a[_0x199910(0x1aa)]]=_0x3517a0;return _0x407d4a;},_0x18e172(_0x56b473);};return function(_0x1adc3e){const _0x56268c=a0_0x2839;if(_0x1adc3e&&_0x1adc3e['__esModule'])return _0x1adc3e;var _0x3df53f={};if(_0x1adc3e!=null){for(var _0x391ac0=_0x18e172(_0x1adc3e),_0x5e37dd=0x0;_0x5e37dd<_0x391ac0[_0x56268c(0x1aa)];_0x5e37dd++)if(_0x391ac0[_0x5e37dd]!==_0x56268c(0x188))__createBinding(_0x3df53f,_0x1adc3e,_0x391ac0[_0x5e37dd]);}return __setModuleDefault(_0x3df53f,_0x1adc3e),_0x3df53f;};}());Object[a0_0x517c16(0x1bd)](exports,'__esModule',{'value':!![]}),exports[a0_0x517c16(0x195)]=loadConfig,exports[a0_0x517c16(0x176)]=saveConfig,exports[a0_0x517c16(0x1e4)]=getAgentStoragePaths,exports[a0_0x517c16(0x164)]=getLatestSessionFile,exports[a0_0x517c16(0x1c5)]=loadSessionsState,exports[a0_0x517c16(0x184)]=processSessionFile,exports['installWindowsStartupService']=installWindowsStartupService,exports[a0_0x517c16(0x1cd)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x517c16(0x1d7))),os=__importStar(require('os')),cache_manager_1=require('./cache-manager'),tracker_1=require('./tracker'),baseDir=path[a0_0x517c16(0x15e)](os[a0_0x517c16(0x1b3)](),a0_0x517c16(0x1c1)),configPath=path[a0_0x517c16(0x15e)](baseDir,a0_0x517c16(0x17f)),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function loadConfig(){const _0x3396aa=a0_0x517c16;try{if(!fs[_0x3396aa(0x1ad)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});if(fs[_0x3396aa(0x1ad)](configPath)){const _0x3dc6ae=JSON[_0x3396aa(0x1d2)](fs[_0x3396aa(0x1c7)](configPath,'utf8'));return{...DEFAULT_CONFIG,..._0x3dc6ae,'conversation_toggles':{...DEFAULT_CONFIG[_0x3396aa(0x17c)],..._0x3dc6ae[_0x3396aa(0x17c)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG['custom_storage_paths'],..._0x3dc6ae[_0x3396aa(0x1c3)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x7f9a11){const _0x56eded=a0_0x517c16,_0x10b1df=loadConfig(),_0x1df747={..._0x10b1df,..._0x7f9a11,'conversation_toggles':{..._0x10b1df[_0x56eded(0x17c)],..._0x7f9a11['conversation_toggles']||{}},'custom_storage_paths':{..._0x10b1df[_0x56eded(0x1c3)],..._0x7f9a11[_0x56eded(0x1c3)]||{}}};try{if(!fs['existsSync'](baseDir))fs[_0x56eded(0x1e6)](baseDir,{'recursive':!![]});fs[_0x56eded(0x154)](configPath,JSON[_0x56eded(0x167)](_0x1df747,null,0x2),_0x56eded(0x178));}catch{}return _0x1df747;}function a0_0x2839(_0x3b842f,_0xded721){_0x3b842f=_0x3b842f-0x154;const _0x3956e1=a0_0x3956();let _0x2839de=_0x3956e1[_0x3b842f];return _0x2839de;}function getAgentStoragePaths(_0x2f6833){const _0x54baa3=a0_0x517c16,_0x2de53d=loadConfig(),_0x20f67e=_0x2de53d[_0x54baa3(0x1c3)][_0x2f6833];if(_0x20f67e&&fs[_0x54baa3(0x1ad)](_0x20f67e))return[_0x20f67e];const _0x45a174=os[_0x54baa3(0x1b3)](),_0x6e6f93=process['platform']===_0x54baa3(0x1a5),_0x43cb79=process['platform']==='darwin';switch(_0x2f6833){case _0x54baa3(0x196):return[path['join'](_0x45a174,_0x54baa3(0x173),_0x54baa3(0x1c2)),path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x173),_0x54baa3(0x19c))];case _0x54baa3(0x1a7):return[path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1a1),_0x54baa3(0x181)),path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1ba),_0x54baa3(0x1cc),_0x54baa3(0x1c9))];case'gemini':return[path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1b4),_0x54baa3(0x1de)),path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1b4)),path['join'](_0x45a174,_0x54baa3(0x1ba),_0x54baa3(0x1cc),_0x54baa3(0x185)),path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x156),_0x54baa3(0x160))];case'cursor':if(_0x6e6f93)return[path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1ba),_0x54baa3(0x1cc),'Cursor',_0x54baa3(0x1c6),'workspaceStorage')];if(_0x43cb79)return[path['join'](_0x45a174,'Library',_0x54baa3(0x1dd),_0x54baa3(0x159),_0x54baa3(0x1c6),'workspaceStorage')];return[path['join'](_0x45a174,_0x54baa3(0x156),_0x54baa3(0x159),_0x54baa3(0x1c6),'workspaceStorage')];case'aider':return[process[_0x54baa3(0x180)](),path['join'](_0x45a174,_0x54baa3(0x1ce))];case'copilot':if(_0x6e6f93)return[path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1ba),'Local',_0x54baa3(0x18d))];return[path[_0x54baa3(0x15e)](_0x45a174,'.config',_0x54baa3(0x18d))];case _0x54baa3(0x1d4):return[path[_0x54baa3(0x15e)](_0x45a174,'.openclaw',_0x54baa3(0x1ca)),path[_0x54baa3(0x15e)](process[_0x54baa3(0x180)](),_0x54baa3(0x1d5),_0x54baa3(0x1b1))];case _0x54baa3(0x191):return[path['join'](_0x45a174,_0x54baa3(0x18e),_0x54baa3(0x181))];case _0x54baa3(0x1b0):return[path[_0x54baa3(0x15e)](_0x45a174,_0x54baa3(0x1e0),_0x54baa3(0x1c8))];default:return[];}}function getLatestSessionFile(_0x1a43b5){const _0x553ded=a0_0x517c16,_0x1a13e0=getAgentStoragePaths(_0x1a43b5);let _0x271c0a=null,_0x40f347=0x0,_0x352e0c=null,_0x1976a4=null;for(const _0x451adb of _0x1a13e0){if(fs[_0x553ded(0x1ad)](_0x451adb)){if(!_0x1976a4)_0x1976a4=_0x451adb;const _0x41932b=(_0x17bb73,_0x5915a8=0x0)=>{const _0x44029e=_0x553ded;if(_0x5915a8>0x3)return;try{const _0x15475a=fs[_0x44029e(0x1be)](_0x17bb73,{'withFileTypes':!![]});for(const _0xba4fe5 of _0x15475a){const _0x48f29a=path[_0x44029e(0x15e)](_0x17bb73,_0xba4fe5['name']);if(_0xba4fe5['isDirectory']())_0x41932b(_0x48f29a,_0x5915a8+0x1);else{if(_0xba4fe5[_0x44029e(0x161)]()&&!_0xba4fe5[_0x44029e(0x1bc)][_0x44029e(0x19a)]('.')){const _0x29d419=_0xba4fe5[_0x44029e(0x1bc)]['toLowerCase']();if(_0x29d419[_0x44029e(0x19d)]('.png')||_0x29d419[_0x44029e(0x19d)]('.jpg')||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x1a2))||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x18b))||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x1dc))||_0x29d419[_0x44029e(0x19d)]('.pb')||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x190))||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x1b2))||_0x29d419[_0x44029e(0x19d)]('.tmp')||_0x29d419['endsWith'](_0x44029e(0x1a6))||_0x29d419[_0x44029e(0x19d)](_0x44029e(0x171))||_0x29d419[_0x44029e(0x19a)](_0x44029e(0x174))||_0x29d419[_0x44029e(0x19a)](_0x44029e(0x1ab)))continue;const _0x198627=fs[_0x44029e(0x1da)](_0x48f29a);_0x198627[_0x44029e(0x193)]>_0x40f347&&(_0x40f347=_0x198627[_0x44029e(0x193)],_0x271c0a=_0xba4fe5['name'],_0x352e0c=_0x48f29a,_0x1976a4=_0x451adb);}}}}catch{}};_0x41932b(_0x451adb);}}return{'fileName':_0x271c0a,'lastModified':_0x40f347>0x0?new Date(_0x40f347)[_0x553ded(0x179)]():null,'fullPath':_0x352e0c,'dirPath':_0x1976a4};}const debounceTimers=new Map(),lastLoggedTimes=new Map();function compressMessageContent(_0x395a68,_0x603dc5,_0x5e8100){const _0x130449=a0_0x517c16;let _0x398d05=![],_0x317ddd=0x0;if(!_0x395a68)return{'modified':_0x398d05,'savedTokens':_0x317ddd};const _0x3f170c=_0x47cdd5=>_0x47cdd5[_0x130449(0x1bf)](/\r\n/g,'\x0a')['replace'](/\n{3,}/g,'\x0a\x0a');if(typeof _0x395a68[_0x130449(0x1d0)]===_0x130449(0x1e5)){let _0x5151b2=_0x395a68[_0x130449(0x1d0)],_0x91e9ad=_0x3f170c(_0x5151b2);_0x91e9ad[_0x130449(0x1aa)]<_0x5151b2[_0x130449(0x1aa)]&&(_0x395a68['content']=_0x91e9ad,_0x398d05=!![],_0x317ddd+=Math[_0x130449(0x1ae)]((_0x5151b2[_0x130449(0x1aa)]-_0x91e9ad[_0x130449(0x1aa)])/0x4));if(_0x395a68[_0x130449(0x1d0)]['length']>0x12c&&!_0x395a68['content'][_0x130449(0x19e)](_0x130449(0x17d))){const _0x13c420='Summary:\x20Content\x20offloaded\x20('+Math[_0x130449(0x1ae)](_0x395a68[_0x130449(0x1d0)]['length']/0x4)+_0x130449(0x162),_0x1ddb4c=(0x0,cache_manager_1[_0x130449(0x1b8)])(_0x603dc5,_0x5e8100,_0x395a68[_0x130449(0x1d0)],_0x13c420);_0x395a68[_0x130449(0x1d0)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20('+_0x1ddb4c[_0x130449(0x17b)]+_0x130449(0x199)+_0x1ddb4c[_0x130449(0x17e)]+'`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20'+_0x1ddb4c[_0x130449(0x17e)]+'`\x0a',_0x398d05=!![],_0x317ddd+=Math[_0x130449(0x1df)](0x0,_0x1ddb4c['raw_tokens']-_0x1ddb4c[_0x130449(0x168)]);}}else{if(Array[_0x130449(0x1d8)](_0x395a68[_0x130449(0x1d0)]))for(const _0x28ac20 of _0x395a68['content']){if(_0x28ac20&&typeof _0x28ac20===_0x130449(0x1a3)){if(typeof _0x28ac20[_0x130449(0x17a)]==='string'){let _0x5ef8cb=_0x28ac20[_0x130449(0x17a)],_0x4c5b88=_0x3f170c(_0x5ef8cb);_0x4c5b88[_0x130449(0x1aa)]<_0x5ef8cb['length']&&(_0x28ac20['text']=_0x4c5b88,_0x398d05=!![],_0x317ddd+=Math['ceil']((_0x5ef8cb[_0x130449(0x1aa)]-_0x4c5b88[_0x130449(0x1aa)])/0x4));if(_0x28ac20[_0x130449(0x17a)]['length']>0x12c&&!_0x28ac20[_0x130449(0x17a)][_0x130449(0x19e)]('TrimPrompt\x20Cache\x20Engine')){const _0x56b203=_0x130449(0x15a)+Math[_0x130449(0x1ae)](_0x28ac20['text'][_0x130449(0x1aa)]/0x4)+_0x130449(0x162),_0x30b73a=(0x0,cache_manager_1[_0x130449(0x1b8)])(_0x603dc5,_0x5e8100,_0x28ac20[_0x130449(0x17a)],_0x56b203);_0x28ac20[_0x130449(0x17a)]=_0x130449(0x177)+_0x30b73a[_0x130449(0x17e)]+_0x130449(0x175)+_0x30b73a['chunk_id']+'`\x0a',_0x398d05=!![],_0x317ddd+=Math['max'](0x0,_0x30b73a[_0x130449(0x17b)]-_0x30b73a[_0x130449(0x168)]);}}else{if(typeof _0x28ac20[_0x130449(0x1d0)]===_0x130449(0x1e5)){let _0x51a902=_0x28ac20[_0x130449(0x1d0)],_0x254d58=_0x3f170c(_0x51a902);_0x254d58[_0x130449(0x1aa)]<_0x51a902[_0x130449(0x1aa)]&&(_0x28ac20['content']=_0x254d58,_0x398d05=!![],_0x317ddd+=Math['ceil']((_0x51a902[_0x130449(0x1aa)]-_0x254d58['length'])/0x4));if(_0x28ac20[_0x130449(0x1d0)][_0x130449(0x1aa)]>0x12c&&!_0x28ac20['content']['includes']('TrimPrompt\x20Cache\x20Engine')){const _0x1e83f8=_0x130449(0x158)+Math[_0x130449(0x1ae)](_0x28ac20[_0x130449(0x1d0)][_0x130449(0x1aa)]/0x4)+_0x130449(0x162),_0x4d74fe=(0x0,cache_manager_1[_0x130449(0x1b8)])(_0x603dc5,_0x5e8100,_0x28ac20['content'],_0x1e83f8);_0x28ac20[_0x130449(0x1d0)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x4d74fe[_0x130449(0x17e)]+'`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20'+_0x4d74fe[_0x130449(0x17e)]+'`\x0a',_0x398d05=!![],_0x317ddd+=Math[_0x130449(0x1df)](0x0,_0x4d74fe['raw_tokens']-_0x4d74fe[_0x130449(0x168)]);}}}}}}return{'modified':_0x398d05,'savedTokens':_0x317ddd};}const sessionsStatePath=path[a0_0x517c16(0x15e)](baseDir,'sessions_state.json');let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x8527a=a0_0x517c16;try{if(fs[_0x8527a(0x1ad)](sessionsStatePath)){const _0x210193=JSON[_0x8527a(0x1d2)](fs['readFileSync'](sessionsStatePath,_0x8527a(0x178)));if(_0x210193&&typeof _0x210193===_0x8527a(0x1a3))return sessionsStateMemoryCache=_0x210193,_0x210193;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x1936ea,_0x14db71,_0x39a6e9,_0x35a1f2=0x0,_0x5c1dbc=0x0){const _0x1f5192=a0_0x517c16;try{const _0x631ffc=loadSessionsState();_0x631ffc[_0x1936ea]={'lineCount':_0x14db71,'activeSavedTokens':_0x39a6e9,'sideCacheSaved':_0x35a1f2,'officialCompactSaved':_0x5c1dbc},sessionsStateMemoryCache=_0x631ffc;if(!fs[_0x1f5192(0x1ad)](baseDir))fs[_0x1f5192(0x1e6)](baseDir,{'recursive':!![]});const _0x298bce=sessionsStatePath+_0x1f5192(0x1af);fs[_0x1f5192(0x154)](_0x298bce,JSON[_0x1f5192(0x167)](_0x631ffc,null,0x2),'utf8'),fs['renameSync'](_0x298bce,sessionsStatePath);}catch{}}function processSessionFile(_0x478639,_0x2d556e){const _0x58fba8=a0_0x517c16;try{if(!fs[_0x58fba8(0x1ad)](_0x478639))return;const _0x5d6531=fs[_0x58fba8(0x1da)](_0x478639);if(_0x5d6531[_0x58fba8(0x192)]()||_0x5d6531['size']===0x0)return;const _0x1e1b80=loadConfig(),_0x18612f=_0x58fba8(0x198)+_0x2d556e;if(_0x1e1b80['conversation_toggles'][_0x18612f]===![])return;const _0x1ad922=fs[_0x58fba8(0x1c7)](_0x478639,_0x58fba8(0x178));let _0xee39c2=![],_0x4d403a=_0x1ad922,_0x13a07e=0x0;const _0x5a4084=path[_0x58fba8(0x183)](_0x478639)[_0x58fba8(0x1cb)](),_0x52fbed=path[_0x58fba8(0x15d)](_0x478639,_0x5a4084);let _0x866cff=0x1;if(_0x2d556e!==_0x58fba8(0x196)){if(_0x5a4084===_0x58fba8(0x1a8))try{const _0x54e8e9=JSON['parse'](_0x1ad922),_0xc60501=Array[_0x58fba8(0x1d8)](_0x54e8e9[_0x58fba8(0x187)])?_0x54e8e9[_0x58fba8(0x187)]:Array[_0x58fba8(0x1d8)](_0x54e8e9)?_0x54e8e9:null;if(_0xc60501){_0x866cff=_0xc60501['length'];for(let _0x51399a=0x0;_0x51399a<_0xc60501['length'];_0x51399a++){const _0x56c2cf=compressMessageContent(_0xc60501[_0x51399a],_0x52fbed,_0x2d556e);_0x56c2cf[_0x58fba8(0x1e8)]&&(_0xee39c2=!![],_0x13a07e+=_0x56c2cf['savedTokens']);}_0xee39c2&&(_0x4d403a=JSON['stringify'](_0x54e8e9,null,0x2));}}catch{}else{if(_0x5a4084===_0x58fba8(0x1b6)||_0x5a4084===_0x58fba8(0x1d9))try{const _0x1ad439=_0x1ad922['split']('\x0a');_0x866cff=_0x1ad439[_0x58fba8(0x1aa)];const _0x558672=[];for(let _0x46f6a2 of _0x1ad439){if(!_0x46f6a2[_0x58fba8(0x1d3)]()){_0x558672[_0x58fba8(0x18a)](_0x46f6a2);continue;}try{const _0x40907e=JSON[_0x58fba8(0x1d2)](_0x46f6a2),_0x47cb09=_0x40907e[_0x58fba8(0x1b5)]||_0x40907e;if(_0x47cb09){const _0x3e4f27=compressMessageContent(_0x47cb09,_0x52fbed,_0x2d556e);_0x3e4f27[_0x58fba8(0x1e8)]&&(_0xee39c2=!![],_0x13a07e+=_0x3e4f27['savedTokens'],_0x46f6a2=JSON[_0x58fba8(0x167)](_0x40907e));}}catch{}_0x558672[_0x58fba8(0x18a)](_0x46f6a2);}_0xee39c2&&(_0x4d403a=_0x558672[_0x58fba8(0x15e)]('\x0a'));}catch{}}}else(_0x5a4084===_0x58fba8(0x1b6)||_0x5a4084==='.json1')&&(_0x866cff=_0x1ad922[_0x58fba8(0x1e2)]('\x0a')['filter'](Boolean)['length']);let _0xa39ed4=0x0;const _0x4ddc8c=_0x1ad922['matchAll'](/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi);for(const _0x40628f of _0x4ddc8c){let _0x27ff98=parseFloat(_0x40628f[0x1]);_0x40628f[0x0][_0x58fba8(0x1cb)]()['includes']('k')&&(_0x27ff98=_0x27ff98*0x3e8),_0xa39ed4+=Math[_0x58fba8(0x1b7)](_0x27ff98);}const _0x195ae0=loadSessionsState(),_0x289e64=_0x195ae0[_0x478639],_0x15b857=_0x289e64&&_0x289e64[_0x58fba8(0x1a0)]!==undefined?_0x289e64[_0x58fba8(0x1a0)]:0x0,_0x3aec7c=_0x289e64&&_0x289e64['officialCompactSaved']!==undefined?_0x289e64[_0x58fba8(0x16f)]:_0x289e64?_0x289e64[_0x58fba8(0x1e1)]:0x0,_0xc12c6c=_0x289e64?_0x289e64[_0x58fba8(0x1e7)]:0x0,_0x4d65ce=_0x866cff>_0xc12c6c;let _0x505574=_0x15b857,_0x3803e4=Math['max'](_0x3aec7c,_0xa39ed4);if(_0xee39c2){fs[_0x58fba8(0x154)](_0x478639,_0x4d403a,_0x58fba8(0x178)),_0x505574+=_0x13a07e;const _0x4fe9f2=_0x505574+_0x3803e4;saveSessionStateItem(_0x478639,_0x866cff,_0x4fe9f2,_0x505574,_0x3803e4);const _0xa76acd='x'[_0x58fba8(0x197)](_0x4fe9f2*0x4);tracker_1[_0x58fba8(0x182)]['logExecution'](_0x58fba8(0x165)+_0x2d556e,_0xa76acd,'',0x0,undefined,[_0x58fba8(0x198)+_0x2d556e,_0x58fba8(0x1d1),_0x2d556e,_0x58fba8(0x1d6)]);}else{if(_0xa39ed4>_0x3aec7c){_0x3803e4=_0xa39ed4;const _0x487fe0=_0x505574+_0x3803e4;saveSessionStateItem(_0x478639,_0x866cff,_0x487fe0,_0x505574,_0x3803e4);const _0x2dda9f='x'['repeat'](_0x487fe0*0x4);tracker_1['tracker'][_0x58fba8(0x157)](_0x58fba8(0x165)+_0x2d556e,_0x2dda9f,'',0x0,undefined,[_0x58fba8(0x198)+_0x2d556e,_0x58fba8(0x1d1),_0x2d556e,_0x58fba8(0x15c)]);}else{if(_0x4d65ce){const _0x2f238d=_0x505574+_0x3803e4;saveSessionStateItem(_0x478639,_0x866cff,_0x2f238d,_0x505574,_0x3803e4);if(_0x2f238d>0x0){const _0x1e5567='x'[_0x58fba8(0x197)](_0x2f238d*0x4);tracker_1[_0x58fba8(0x182)][_0x58fba8(0x157)]('conv:'+_0x2d556e,_0x1e5567,'',0x0,undefined,[_0x58fba8(0x198)+_0x2d556e,_0x58fba8(0x1d1),_0x2d556e,_0x58fba8(0x186)]);}}else{const _0x58e54d=_0x505574+_0x3803e4;saveSessionStateItem(_0x478639,_0x866cff,_0x58e54d,_0x505574,_0x3803e4);}}}}catch{}}function installWindowsStartupService(){const _0x2924b7=a0_0x517c16;if(process['platform']!=='win32')return;try{const _0x30a72d=path[_0x2924b7(0x15e)](os[_0x2924b7(0x1b3)](),_0x2924b7(0x1ba),_0x2924b7(0x1cc),_0x2924b7(0x172),'Windows','Start\x20Menu','Programs','Startup');if(!fs[_0x2924b7(0x1ad)](_0x30a72d))fs[_0x2924b7(0x1e6)](_0x30a72d,{'recursive':!![]});const _0x4642c3=path[_0x2924b7(0x15e)](_0x30a72d,_0x2924b7(0x170)),_0x537298=path['join'](__dirname,'cli.js'),_0x9755c8=_0x537298[_0x2924b7(0x1bf)](/\\/g,'\x5c\x5c'),_0x4090b5=_0x2924b7(0x15b)+_0x9755c8+_0x2924b7(0x1c0);fs[_0x2924b7(0x154)](_0x4642c3,_0x4090b5,_0x2924b7(0x178));}catch{}}function startWatcherDaemon(){const _0x41723a=a0_0x517c16;installWindowsStartupService();try{const {installClaudeHooks:_0x243110}=require(_0x41723a(0x19f));_0x243110();}catch(_0x1a748f){}const _0x290522=[_0x41723a(0x196),_0x41723a(0x160),_0x41723a(0x1a7),_0x41723a(0x15f),'aider',_0x41723a(0x189),_0x41723a(0x1d4),'opencode',_0x41723a(0x1b0)];for(const _0x482229 of _0x290522){const _0x295733=getAgentStoragePaths(_0x482229);for(const _0x75994a of _0x295733){if(fs['existsSync'](_0x75994a))try{fs[_0x41723a(0x1e3)](_0x75994a,{'recursive':!![]},(_0x37de0a,_0x4f6ee3)=>{const _0x370748=_0x41723a;if(!_0x4f6ee3)return;const _0x194c25=path[_0x370748(0x15e)](_0x75994a,_0x4f6ee3);if(debounceTimers['has'](_0x194c25))clearTimeout(debounceTimers['get'](_0x194c25));const _0x4b6689=setTimeout(()=>processSessionFile(_0x194c25,_0x482229),0x1f4);debounceTimers['set'](_0x194c25,_0x4b6689);});}catch{}}}setInterval(()=>{const _0x3637d3=_0x41723a;for(const _0x3b1a1f of _0x290522){try{const _0x693e9f=getLatestSessionFile(_0x3b1a1f);_0x693e9f&&_0x693e9f['fullPath']&&processSessionFile(_0x693e9f[_0x3637d3(0x16c)],_0x3b1a1f);}catch{}}},0xbb8);}
|
|
1
|
+
'use strict';const a0_0x14bc19=a0_0x2798;function a0_0x2798(_0x4cb7f4,_0x3d1f36){const _0x17190b=a0_0x1719();return a0_0x2798=function(_0x27982c,_0x13350c){_0x27982c=_0x27982c-0x18b;let _0xd24a9c=_0x17190b[_0x27982c];return _0xd24a9c;},a0_0x2798(_0x4cb7f4,_0x3d1f36);}(function(_0x340720,_0x2e2967){const _0x59d632=a0_0x2798,_0x50c9b5=_0x340720();while(!![]){try{const _0x40ae42=-parseInt(_0x59d632(0x1c7))/0x1+-parseInt(_0x59d632(0x18b))/0x2*(-parseInt(_0x59d632(0x1d2))/0x3)+parseInt(_0x59d632(0x1ac))/0x4+parseInt(_0x59d632(0x19f))/0x5+-parseInt(_0x59d632(0x1a2))/0x6+parseInt(_0x59d632(0x1ad))/0x7*(parseInt(_0x59d632(0x1cd))/0x8)+-parseInt(_0x59d632(0x20a))/0x9*(parseInt(_0x59d632(0x199))/0xa);if(_0x40ae42===_0x2e2967)break;else _0x50c9b5['push'](_0x50c9b5['shift']());}catch(_0x2fc725){_0x50c9b5['push'](_0x50c9b5['shift']());}}}(a0_0x1719,0x573d0));var __createBinding=this&&this[a0_0x14bc19(0x1f9)]||(Object['create']?function(_0x29b554,_0x501a33,_0x2d9217,_0x556e7e){const _0x43edae=a0_0x14bc19;if(_0x556e7e===undefined)_0x556e7e=_0x2d9217;var _0x29accf=Object[_0x43edae(0x1c0)](_0x501a33,_0x2d9217);(!_0x29accf||(_0x43edae(0x209)in _0x29accf?!_0x501a33['__esModule']:_0x29accf[_0x43edae(0x222)]||_0x29accf[_0x43edae(0x19e)]))&&(_0x29accf={'enumerable':!![],'get':function(){return _0x501a33[_0x2d9217];}}),Object[_0x43edae(0x1c2)](_0x29b554,_0x556e7e,_0x29accf);}:function(_0x31c1c0,_0x4ccfc3,_0x448f12,_0xbf660f){if(_0xbf660f===undefined)_0xbf660f=_0x448f12;_0x31c1c0[_0xbf660f]=_0x4ccfc3[_0x448f12];}),__setModuleDefault=this&&this[a0_0x14bc19(0x218)]||(Object[a0_0x14bc19(0x1f8)]?function(_0x3be507,_0x557529){const _0x20189d=a0_0x14bc19;Object['defineProperty'](_0x3be507,_0x20189d(0x1e6),{'enumerable':!![],'value':_0x557529});}:function(_0x4fff73,_0x4c74ca){_0x4fff73['default']=_0x4c74ca;}),__importStar=this&&this[a0_0x14bc19(0x1ae)]||(function(){var _0x101012=function(_0x3392af){const _0x5b3cfe=a0_0x2798;return _0x101012=Object[_0x5b3cfe(0x1ec)]||function(_0x1e42f2){const _0x40faef=_0x5b3cfe;var _0x2c81fe=[];for(var _0x5f0538 in _0x1e42f2)if(Object['prototype'][_0x40faef(0x219)][_0x40faef(0x224)](_0x1e42f2,_0x5f0538))_0x2c81fe[_0x2c81fe[_0x40faef(0x1f4)]]=_0x5f0538;return _0x2c81fe;},_0x101012(_0x3392af);};return function(_0x524aaf){const _0x42ab40=a0_0x2798;if(_0x524aaf&&_0x524aaf[_0x42ab40(0x1db)])return _0x524aaf;var _0x297c70={};if(_0x524aaf!=null){for(var _0x5c5aea=_0x101012(_0x524aaf),_0x422e22=0x0;_0x422e22<_0x5c5aea[_0x42ab40(0x1f4)];_0x422e22++)if(_0x5c5aea[_0x422e22]!==_0x42ab40(0x1e6))__createBinding(_0x297c70,_0x524aaf,_0x5c5aea[_0x422e22]);}return __setModuleDefault(_0x297c70,_0x524aaf),_0x297c70;};}());Object[a0_0x14bc19(0x1c2)](exports,'__esModule',{'value':!![]}),exports[a0_0x14bc19(0x208)]=loadConfig,exports[a0_0x14bc19(0x1d8)]=saveConfig,exports[a0_0x14bc19(0x1e4)]=getAgentStoragePaths,exports[a0_0x14bc19(0x20f)]=getLatestSessionFile,exports['loadSessionsState']=loadSessionsState,exports['processSessionFile']=processSessionFile,exports['installWindowsStartupService']=installWindowsStartupService,exports[a0_0x14bc19(0x1f5)]=startWatcherDaemon;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x14bc19(0x214))),os=__importStar(require('os')),cache_manager_1=require(a0_0x14bc19(0x223)),tracker_1=require(a0_0x14bc19(0x1a5)),baseDir=path['join'](os[a0_0x14bc19(0x1e3)](),a0_0x14bc19(0x21a)),configPath=path[a0_0x14bc19(0x217)](baseDir,'config.json'),DEFAULT_CONFIG={'autostart_enabled':!![],'conversation_toggles':{'conv_claude':!![],'conv_codex':!![],'conv_cursor':!![],'conv_aider':!![],'conv_copilot':!![],'conv_openclaw':!![],'conv_opencode':!![],'conv_cortex':!![]},'custom_storage_paths':{'claude':null,'codex':null,'cursor':null,'aider':null,'copilot':null,'openclaw':null,'opencode':null,'cortex':null}};function loadConfig(){const _0x6e5ff=a0_0x14bc19;try{if(!fs['existsSync'](baseDir))fs[_0x6e5ff(0x1b6)](baseDir,{'recursive':!![]});if(fs[_0x6e5ff(0x221)](configPath)){const _0xf3414a=JSON[_0x6e5ff(0x1d3)](fs[_0x6e5ff(0x1da)](configPath,'utf8'));return{...DEFAULT_CONFIG,..._0xf3414a,'conversation_toggles':{...DEFAULT_CONFIG[_0x6e5ff(0x191)],..._0xf3414a[_0x6e5ff(0x191)]||{}},'custom_storage_paths':{...DEFAULT_CONFIG[_0x6e5ff(0x1e1)],..._0xf3414a[_0x6e5ff(0x1e1)]||{}}};}}catch{}return DEFAULT_CONFIG;}function saveConfig(_0x4d60cd){const _0x5629ea=a0_0x14bc19,_0x2da764=loadConfig(),_0xb64c01={..._0x2da764,..._0x4d60cd,'conversation_toggles':{..._0x2da764[_0x5629ea(0x191)],..._0x4d60cd[_0x5629ea(0x191)]||{}},'custom_storage_paths':{..._0x2da764['custom_storage_paths'],..._0x4d60cd['custom_storage_paths']||{}}};try{if(!fs[_0x5629ea(0x221)](baseDir))fs['mkdirSync'](baseDir,{'recursive':!![]});fs[_0x5629ea(0x20b)](configPath,JSON[_0x5629ea(0x1fa)](_0xb64c01,null,0x2),_0x5629ea(0x1a3));}catch{}return _0xb64c01;}function getAgentStoragePaths(_0xde90d3){const _0x3994a9=a0_0x14bc19,_0x11719d=loadConfig(),_0x5b2081=_0x11719d['custom_storage_paths'][_0xde90d3];if(_0x5b2081&&fs[_0x3994a9(0x221)](_0x5b2081))return[_0x5b2081];const _0x3bebc0=os[_0x3994a9(0x1e3)](),_0xe3aca3=process[_0x3994a9(0x1cc)]===_0x3994a9(0x1c8),_0x30be2c=process['platform']==='darwin';switch(_0xde90d3){case _0x3994a9(0x1e0):return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1f2),_0x3994a9(0x202)),path[_0x3994a9(0x217)](_0x3bebc0,'.claude',_0x3994a9(0x1ef))];case'codex':return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1e7),_0x3994a9(0x18f)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),_0x3994a9(0x1bd),'Codex')];case _0x3994a9(0x1cb):return[path['join'](_0x3bebc0,_0x3994a9(0x1ed),_0x3994a9(0x216)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1ed)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),'Roaming',_0x3994a9(0x18d)),path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c3),'gemini')];case _0x3994a9(0x18e):if(_0xe3aca3)return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),'Roaming',_0x3994a9(0x1dd),'User','workspaceStorage')];if(_0x30be2c)return[path[_0x3994a9(0x217)](_0x3bebc0,'Library','Application\x20Support',_0x3994a9(0x1dd),'User','workspaceStorage')];return[path['join'](_0x3bebc0,_0x3994a9(0x1c3),'Cursor',_0x3994a9(0x1fb),_0x3994a9(0x21d))];case _0x3994a9(0x211):return[process[_0x3994a9(0x201)](),path['join'](_0x3bebc0,'.aider.chat.history.md')];case _0x3994a9(0x206):if(_0xe3aca3)return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x1c6),_0x3994a9(0x1df),_0x3994a9(0x205))];return[path['join'](_0x3bebc0,_0x3994a9(0x1c3),_0x3994a9(0x205))];case _0x3994a9(0x1ba):return[path[_0x3994a9(0x217)](_0x3bebc0,'.openclaw','storage'),path[_0x3994a9(0x217)](process[_0x3994a9(0x201)](),_0x3994a9(0x194),'context')];case _0x3994a9(0x1c4):return[path[_0x3994a9(0x217)](_0x3bebc0,_0x3994a9(0x197),_0x3994a9(0x18f))];case _0x3994a9(0x20d):return[path['join'](_0x3bebc0,_0x3994a9(0x1ce),'cache')];default:return[];}}function getLatestSessionFile(_0x8f90ca){const _0x1e9c3c=a0_0x14bc19,_0x295874=getAgentStoragePaths(_0x8f90ca);let _0x237513=null,_0x35dead=0x0,_0x5cb83c=null,_0x4f1fdc=null;for(const _0x4e172a of _0x295874){if(fs['existsSync'](_0x4e172a)){if(!_0x4f1fdc)_0x4f1fdc=_0x4e172a;const _0x35ff24=(_0x1cf536,_0x2e2bcf=0x0)=>{const _0x269d42=a0_0x2798;if(_0x2e2bcf>0x3)return;try{const _0x41db31=fs['readdirSync'](_0x1cf536,{'withFileTypes':!![]});for(const _0x3b963f of _0x41db31){const _0xfd8639=path[_0x269d42(0x217)](_0x1cf536,_0x3b963f[_0x269d42(0x220)]);if(_0x3b963f[_0x269d42(0x1a4)]())_0x35ff24(_0xfd8639,_0x2e2bcf+0x1);else{if(_0x3b963f[_0x269d42(0x21f)]()&&!_0x3b963f[_0x269d42(0x220)][_0x269d42(0x1f6)]('.')){const _0x51093a=_0x3b963f[_0x269d42(0x220)]['toLowerCase']();if(_0x51093a[_0x269d42(0x215)]('.png')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1e8))||_0x51093a['endsWith'](_0x269d42(0x1c1))||_0x51093a['endsWith']('.gif')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1a0))||_0x51093a[_0x269d42(0x215)](_0x269d42(0x21b))||_0x51093a['endsWith']('.wal')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1cf))||_0x51093a[_0x269d42(0x215)]('.tmp')||_0x51093a[_0x269d42(0x215)](_0x269d42(0x1e2))||_0x51093a[_0x269d42(0x215)]('.dat')||_0x51093a['startsWith']('media__')||_0x51093a[_0x269d42(0x1f6)](_0x269d42(0x193)))continue;const _0x534232=fs[_0x269d42(0x1d4)](_0xfd8639);_0x534232['mtimeMs']>_0x35dead&&(_0x35dead=_0x534232[_0x269d42(0x19a)],_0x237513=_0x3b963f[_0x269d42(0x220)],_0x5cb83c=_0xfd8639,_0x4f1fdc=_0x4e172a);}}}}catch{}};_0x35ff24(_0x4e172a);}}return{'fileName':_0x237513,'lastModified':_0x35dead>0x0?new Date(_0x35dead)[_0x1e9c3c(0x19d)]():null,'fullPath':_0x5cb83c,'dirPath':_0x4f1fdc};}const debounceTimers=new Map(),lastLoggedTimes=new Map();function compressMessageContent(_0xc18c2c,_0x1d66a8,_0x2f0c1c){const _0xf4f2=a0_0x14bc19;let _0x4be605=![],_0x150784=0x0;if(!_0xc18c2c)return{'modified':_0x4be605,'savedTokens':_0x150784};const _0x24d82c=_0x2ae0b9=>_0x2ae0b9[_0xf4f2(0x190)](/\r\n/g,'\x0a')[_0xf4f2(0x190)](/\n{3,}/g,'\x0a\x0a');if(typeof _0xc18c2c[_0xf4f2(0x1d9)]===_0xf4f2(0x198)){let _0x12f513=_0xc18c2c['content'],_0x3303de=_0x24d82c(_0x12f513);_0x3303de[_0xf4f2(0x1f4)]<_0x12f513[_0xf4f2(0x1f4)]&&(_0xc18c2c['content']=_0x3303de,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x12f513[_0xf4f2(0x1f4)]-_0x3303de[_0xf4f2(0x1f4)])/0x4));if(_0xc18c2c['content'][_0xf4f2(0x1f4)]>0x12c&&!_0xc18c2c['content'][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x57d7c4=_0xf4f2(0x1b9)+Math[_0xf4f2(0x203)](_0xc18c2c[_0xf4f2(0x1d9)]['length']/0x4)+'\x20tokens).',_0x38a3dc=(0x0,cache_manager_1[_0xf4f2(0x1de)])(_0x1d66a8,_0x2f0c1c,_0xc18c2c['content'],_0x57d7c4);_0xc18c2c[_0xf4f2(0x1d9)]=_0xf4f2(0x20e)+_0x38a3dc[_0xf4f2(0x1b0)]+_0xf4f2(0x1f7)+_0x38a3dc[_0xf4f2(0x1c9)]+_0xf4f2(0x1a6)+_0x38a3dc[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x38a3dc[_0xf4f2(0x1b0)]-_0x38a3dc[_0xf4f2(0x20c)]);}}else{if(Array[_0xf4f2(0x212)](_0xc18c2c[_0xf4f2(0x1d9)]))for(const _0x5dec0b of _0xc18c2c[_0xf4f2(0x1d9)]){if(_0x5dec0b&&typeof _0x5dec0b===_0xf4f2(0x1b5)){if(typeof _0x5dec0b[_0xf4f2(0x1a1)]==='string'){let _0x5bd31e=_0x5dec0b['text'],_0x46fd28=_0x24d82c(_0x5bd31e);_0x46fd28[_0xf4f2(0x1f4)]<_0x5bd31e[_0xf4f2(0x1f4)]&&(_0x5dec0b[_0xf4f2(0x1a1)]=_0x46fd28,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x5bd31e[_0xf4f2(0x1f4)]-_0x46fd28['length'])/0x4));if(_0x5dec0b[_0xf4f2(0x1a1)][_0xf4f2(0x1f4)]>0x12c&&!_0x5dec0b[_0xf4f2(0x1a1)][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x822b89=_0xf4f2(0x1ab)+Math[_0xf4f2(0x203)](_0x5dec0b['text'][_0xf4f2(0x1f4)]/0x4)+_0xf4f2(0x1b1),_0x209e44=(0x0,cache_manager_1['saveChunk'])(_0x1d66a8,_0x2f0c1c,_0x5dec0b[_0xf4f2(0x1a1)],_0x822b89);_0x5dec0b[_0xf4f2(0x1a1)]='\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`'+_0x209e44[_0xf4f2(0x1c9)]+'`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20'+_0x209e44[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x209e44[_0xf4f2(0x1b0)]-_0x209e44[_0xf4f2(0x20c)]);}}else{if(typeof _0x5dec0b[_0xf4f2(0x1d9)]===_0xf4f2(0x198)){let _0x34f7b2=_0x5dec0b[_0xf4f2(0x1d9)],_0x1afd8a=_0x24d82c(_0x34f7b2);_0x1afd8a[_0xf4f2(0x1f4)]<_0x34f7b2[_0xf4f2(0x1f4)]&&(_0x5dec0b[_0xf4f2(0x1d9)]=_0x1afd8a,_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x203)]((_0x34f7b2[_0xf4f2(0x1f4)]-_0x1afd8a['length'])/0x4));if(_0x5dec0b[_0xf4f2(0x1d9)][_0xf4f2(0x1f4)]>0x12c&&!_0x5dec0b['content'][_0xf4f2(0x1b2)](_0xf4f2(0x1d6))){const _0x334d2c=_0xf4f2(0x1dc)+Math[_0xf4f2(0x203)](_0x5dec0b['content'][_0xf4f2(0x1f4)]/0x4)+'\x20tokens).',_0x93bde2=(0x0,cache_manager_1[_0xf4f2(0x1de)])(_0x1d66a8,_0x2f0c1c,_0x5dec0b[_0xf4f2(0x1d9)],_0x334d2c);_0x5dec0b[_0xf4f2(0x1d9)]=_0xf4f2(0x195)+_0x93bde2[_0xf4f2(0x1c9)]+_0xf4f2(0x1ff)+_0x93bde2[_0xf4f2(0x1c9)]+'`\x0a',_0x4be605=!![],_0x150784+=Math[_0xf4f2(0x1e5)](0x0,_0x93bde2[_0xf4f2(0x1b0)]-_0x93bde2[_0xf4f2(0x20c)]);}}}}}}return{'modified':_0x4be605,'savedTokens':_0x150784};}const sessionsStatePath=path['join'](baseDir,a0_0x14bc19(0x1b3));let sessionsStateMemoryCache=null;function loadSessionsState(){const _0x2485fc=a0_0x14bc19;try{if(fs[_0x2485fc(0x221)](sessionsStatePath)){const _0x4b077f=JSON['parse'](fs[_0x2485fc(0x1da)](sessionsStatePath,_0x2485fc(0x1a3)));if(_0x4b077f&&typeof _0x4b077f===_0x2485fc(0x1b5))return sessionsStateMemoryCache=_0x4b077f,_0x4b077f;}}catch{}return sessionsStateMemoryCache||{};}function saveSessionStateItem(_0x567c40,_0x2bb427,_0x14af53,_0x7b9f12=0x0,_0x3e3a92=0x0){const _0x5b9e32=a0_0x14bc19;try{const _0x27a161=loadSessionsState();_0x27a161[_0x567c40]={'lineCount':_0x2bb427,'activeSavedTokens':_0x14af53,'sideCacheSaved':_0x7b9f12,'officialCompactSaved':_0x3e3a92},sessionsStateMemoryCache=_0x27a161;if(!fs[_0x5b9e32(0x221)](baseDir))fs[_0x5b9e32(0x1b6)](baseDir,{'recursive':!![]});const _0x4ad677=sessionsStatePath+_0x5b9e32(0x1c5);fs[_0x5b9e32(0x20b)](_0x4ad677,JSON['stringify'](_0x27a161,null,0x2),_0x5b9e32(0x1a3)),fs['renameSync'](_0x4ad677,sessionsStatePath);}catch{}}function processSessionFile(_0x5547e9,_0x5baf3c){const _0x468f75=a0_0x14bc19;try{if(!fs[_0x468f75(0x221)](_0x5547e9))return;const _0x2bfbce=fs['statSync'](_0x5547e9);if(_0x2bfbce['isDirectory']()||_0x2bfbce['size']===0x0)return;const _0x4c005b=loadConfig(),_0x184afb='conv_'+_0x5baf3c;if(_0x4c005b[_0x468f75(0x191)][_0x184afb]===![])return;const _0x3e85c3=fs['readFileSync'](_0x5547e9,_0x468f75(0x1a3));let _0x19c7b4=![],_0x229be8=_0x3e85c3,_0x148ba5=0x0;const _0x1a4990=path[_0x468f75(0x204)](_0x5547e9)['toLowerCase'](),_0x31178e=path['basename'](_0x5547e9,_0x1a4990);let _0x2299d2=0x1;if(_0x5baf3c!==_0x468f75(0x1e0)){if(_0x1a4990===_0x468f75(0x192))try{const _0x35f515=JSON['parse'](_0x3e85c3),_0x401f5d=Array[_0x468f75(0x212)](_0x35f515[_0x468f75(0x1ea)])?_0x35f515[_0x468f75(0x1ea)]:Array[_0x468f75(0x212)](_0x35f515)?_0x35f515:null;if(_0x401f5d){_0x2299d2=_0x401f5d[_0x468f75(0x1f4)];for(let _0x2f85a8=0x0;_0x2f85a8<_0x401f5d[_0x468f75(0x1f4)];_0x2f85a8++){const _0x36e8e=compressMessageContent(_0x401f5d[_0x2f85a8],_0x31178e,_0x5baf3c);_0x36e8e[_0x468f75(0x1d7)]&&(_0x19c7b4=!![],_0x148ba5+=_0x36e8e['savedTokens']);}_0x19c7b4&&(_0x229be8=JSON[_0x468f75(0x1fa)](_0x35f515,null,0x2));}}catch{}else{if(_0x1a4990===_0x468f75(0x1b7)||_0x1a4990==='.json1')try{const _0x19877a=_0x3e85c3[_0x468f75(0x1fe)]('\x0a');_0x2299d2=_0x19877a[_0x468f75(0x1f4)];const _0x17c2aa=[];for(let _0x4632c5 of _0x19877a){if(!_0x4632c5[_0x468f75(0x213)]()){_0x17c2aa[_0x468f75(0x196)](_0x4632c5);continue;}try{const _0x5bb480=JSON[_0x468f75(0x1d3)](_0x4632c5),_0x59fce5=_0x5bb480[_0x468f75(0x1bc)]||_0x5bb480;if(_0x59fce5){const _0x211b3e=compressMessageContent(_0x59fce5,_0x31178e,_0x5baf3c);_0x211b3e[_0x468f75(0x1d7)]&&(_0x19c7b4=!![],_0x148ba5+=_0x211b3e[_0x468f75(0x1d5)],_0x4632c5=JSON[_0x468f75(0x1fa)](_0x5bb480));}}catch{}_0x17c2aa[_0x468f75(0x196)](_0x4632c5);}_0x19c7b4&&(_0x229be8=_0x17c2aa[_0x468f75(0x217)]('\x0a'));}catch{}}}else(_0x1a4990===_0x468f75(0x1b7)||_0x1a4990===_0x468f75(0x18c))&&(_0x2299d2=_0x3e85c3['split']('\x0a')[_0x468f75(0x1a9)](Boolean)[_0x468f75(0x1f4)]);let _0x5843d3=0x0;const _0x3c9b9a=_0x3e85c3[_0x468f75(0x1f0)](/(?:Compacted conversation\s*·\s*)?saved\s*([\d\.]+)k?\s*tokens/gi);for(const _0x5a0cd7 of _0x3c9b9a){let _0x1012a3=parseFloat(_0x5a0cd7[0x1]);_0x5a0cd7[0x0][_0x468f75(0x19c)]()[_0x468f75(0x1b2)]('k')&&(_0x1012a3=_0x1012a3*0x3e8),_0x5843d3+=Math[_0x468f75(0x21e)](_0x1012a3);}const _0x3a2400=loadSessionsState(),_0x53c7a4=_0x3a2400[_0x5547e9],_0x2736af=_0x53c7a4&&_0x53c7a4['sideCacheSaved']!==undefined?_0x53c7a4[_0x468f75(0x1f3)]:0x0,_0x29e9ac=_0x53c7a4&&_0x53c7a4[_0x468f75(0x1d1)]!==undefined?_0x53c7a4[_0x468f75(0x1d1)]:_0x53c7a4?_0x53c7a4['activeSavedTokens']:0x0,_0x4f0751=_0x53c7a4?_0x53c7a4[_0x468f75(0x19b)]:0x0,_0x456676=_0x2299d2>_0x4f0751;let _0x21d489=_0x2736af,_0x14e6d3=Math[_0x468f75(0x1e5)](_0x29e9ac,_0x5843d3);if(_0x19c7b4){fs[_0x468f75(0x20b)](_0x5547e9,_0x229be8,_0x468f75(0x1a3)),_0x21d489+=_0x148ba5;const _0x5cc743=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x5cc743,_0x21d489,_0x14e6d3);const _0x51ca40='x'[_0x468f75(0x1be)](_0x5cc743*0x4);tracker_1[_0x468f75(0x207)][_0x468f75(0x200)](_0x468f75(0x1a7)+_0x5baf3c,_0x51ca40,'',0x0,undefined,['conv_'+_0x5baf3c,_0x468f75(0x1b8),_0x5baf3c,_0x468f75(0x1d0)]);}else{if(_0x5843d3>_0x29e9ac){_0x14e6d3=_0x5843d3;const _0x1234e3=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x1234e3,_0x21d489,_0x14e6d3);const _0x20b33d='x'[_0x468f75(0x1be)](_0x1234e3*0x4);tracker_1[_0x468f75(0x207)][_0x468f75(0x200)](_0x468f75(0x1a7)+_0x5baf3c,_0x20b33d,'',0x0,undefined,[_0x468f75(0x1ca)+_0x5baf3c,'live-conv',_0x5baf3c,_0x468f75(0x1a8)]);}else{if(_0x456676){const _0x34b4d7=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x34b4d7,_0x21d489,_0x14e6d3);if(_0x34b4d7>0x0){const _0x52f569='x'[_0x468f75(0x1be)](_0x34b4d7*0x4);tracker_1['tracker']['logExecution'](_0x468f75(0x1a7)+_0x5baf3c,_0x52f569,'',0x0,undefined,[_0x468f75(0x1ca)+_0x5baf3c,_0x468f75(0x1b8),_0x5baf3c,_0x468f75(0x1b4)]);}}else{const _0x21a8f4=_0x21d489+_0x14e6d3;saveSessionStateItem(_0x5547e9,_0x2299d2,_0x21a8f4,_0x21d489,_0x14e6d3);}}}}catch{}}function installWindowsStartupService(){const _0x546a29=a0_0x14bc19;if(process[_0x546a29(0x1cc)]!==_0x546a29(0x1c8))return;try{const _0x17f587=path[_0x546a29(0x217)](os[_0x546a29(0x1e3)](),_0x546a29(0x1c6),_0x546a29(0x1bd),'Microsoft',_0x546a29(0x1fc),_0x546a29(0x21c),_0x546a29(0x1f1),_0x546a29(0x1bb));if(!fs[_0x546a29(0x221)](_0x17f587))fs['mkdirSync'](_0x17f587,{'recursive':!![]});const _0x2af766=path['join'](_0x17f587,'TrimPromptDaemon.vbs'),_0x13d76e=path[_0x546a29(0x217)](__dirname,_0x546a29(0x1bf)),_0x568129=_0x13d76e['replace'](/\\/g,'\x5c\x5c'),_0x4cd165=_0x546a29(0x1ee)+_0x568129+_0x546a29(0x1af);fs['writeFileSync'](_0x2af766,_0x4cd165,'utf8');}catch{}}function startWatcherDaemon(){const _0xfb7f71=a0_0x14bc19;installWindowsStartupService();try{const {installClaudeHooks:_0x1024cf}=require(_0xfb7f71(0x1aa));_0x1024cf();}catch(_0x3ee9e8){}const _0x47b907=[_0xfb7f71(0x1e0),'gemini',_0xfb7f71(0x1eb),_0xfb7f71(0x18e),_0xfb7f71(0x211),_0xfb7f71(0x206),_0xfb7f71(0x1ba),_0xfb7f71(0x1c4),_0xfb7f71(0x20d)];for(const _0x5024d1 of _0x47b907){const _0x3dd82c=getAgentStoragePaths(_0x5024d1);for(const _0xd750e3 of _0x3dd82c){if(fs[_0xfb7f71(0x221)](_0xd750e3))try{fs[_0xfb7f71(0x1e9)](_0xd750e3,{'recursive':!![]},(_0x19182c,_0x2d661a)=>{const _0x32d428=_0xfb7f71;if(!_0x2d661a)return;const _0x30e1bc=path['join'](_0xd750e3,_0x2d661a);if(debounceTimers[_0x32d428(0x210)](_0x30e1bc))clearTimeout(debounceTimers['get'](_0x30e1bc));const _0x1c12ea=setTimeout(()=>processSessionFile(_0x30e1bc,_0x5024d1),0x1f4);debounceTimers['set'](_0x30e1bc,_0x1c12ea);});}catch{}}}setInterval(()=>{const _0x5d316d=_0xfb7f71;for(const _0x59356d of _0x47b907){try{const _0x5b026d=getLatestSessionFile(_0x59356d);_0x5b026d&&_0x5b026d['fullPath']&&processSessionFile(_0x5b026d[_0x5d316d(0x1fd)],_0x59356d);}catch{}}},0xbb8);}function a0_0x1719(){const _0x5dcac5=['toISOString','configurable','1259905diKUqJ','.webp','text','3726906KLqzVk','utf8','isDirectory','./tracker','`\x0a>\x20If\x20required,\x20execute:\x20`trim\x20retrieve\x20','conv:','official_compact','filter','./hooks/claude-hook','Summary:\x20Text\x20block\x20offloaded\x20(','304844ccSeAn','14iMPqeD','__importStar','\x22\x20&\x20\x22\x22\x22\x20ui\x20--headless\x22,\x200,\x20False\x0a','raw_tokens','\x20tokens).','includes','sessions_state.json','active_turn','object','mkdirSync','.jsonl','live-conv','Summary:\x20Content\x20offloaded\x20(','openclaw','Startup','message','Roaming','repeat','cli.js','getOwnPropertyDescriptor','.jpeg','defineProperty','.config','opencode','.tmp','AppData','325147TfiZvC','win32','chunk_id','conv_','gemini','platform','2211056FjhXzH','.cortex','.shm','trim_offload','officialCompactSaved','3DkAEiA','parse','statSync','savedTokens','TrimPrompt\x20Cache\x20Engine','modified','saveConfig','content','readFileSync','__esModule','Summary:\x20Tool\x20result\x20offloaded\x20(','Cursor','saveChunk','Local','claude','custom_storage_paths','.lock','homedir','getAgentStoragePaths','max','default','.codex','.jpg','watch','messages','codex','getOwnPropertyNames','.gemini','Set\x20WshShell\x20=\x20CreateObject(\x22WScript.Shell\x22)\x0aWshShell.Run\x20\x22node\x20\x22\x22\x22\x20&\x20\x22','history','matchAll','Programs','.claude','sideCacheSaved','length','startWatcherDaemon','startsWith','\x20tokens)\x20was\x20moved\x20to\x20local\x20side-cache.\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','create','__createBinding','stringify','User','Windows','fullPath','split','`\x0a>\x20Retrieve\x20with:\x20`trim\x20retrieve\x20','logExecution','cwd','projects','ceil','extname','github-copilot-cli','copilot','tracker','loadConfig','get','1076913MDSofU','writeFileSync','compressed_tokens','cortex','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20The\x20raw\x20content\x20of\x20this\x20step\x20(','getLatestSessionFile','has','aider','isArray','trim','path','endsWith','antigravity','join','__setModuleDefault','hasOwnProperty','.trimprompt','.pb','Start\x20Menu','workspaceStorage','round','isFile','name','existsSync','writable','./cache-manager','call','1084654THNobv','.json1','Gemini','cursor','sessions','replace','conversation_toggles','.json','image_','.openclaw','\x0a>\x20[!IMPORTANT]\x0a>\x20**[TrimPrompt\x20Cache\x20Engine\x20—\x20Context\x20Offloaded]**\x0a>\x20**Chunk\x20Reference\x20ID:**\x20`','push','.opencode','string','10MbOTgZ','mtimeMs','lineCount','toLowerCase'];a0_0x1719=function(){return _0x5dcac5;};return a0_0x1719();}
|
package/filters/devops.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x268fa7=a0_0x43dc;(function(_0x150307,_0x52ab1e){const _0x18d317=a0_0x43dc,_0x177bad=_0x150307();while(!![]){try{const _0x143653=-parseInt(_0x18d317(0x105))/0x1*(-parseInt(_0x18d317(0xf4))/0x2)+-parseInt(_0x18d317(0x11a))/0x3+-parseInt(_0x18d317(0x111))/0x4*(-parseInt(_0x18d317(0x10e))/0x5)+-parseInt(_0x18d317(0x113))/0x6*(parseInt(_0x18d317(0xeb))/0x7)+parseInt(_0x18d317(0xec))/0x8+-parseInt(_0x18d317(0xea))/0x9*(-parseInt(_0x18d317(0x100))/0xa)+-parseInt(_0x18d317(0xf3))/0xb;if(_0x143653===_0x52ab1e)break;else _0x177bad['push'](_0x177bad['shift']());}catch(_0x1b1f9a){_0x177bad['push'](_0x177bad['shift']());}}}(a0_0x3e74,0xd91e7));Object[a0_0x268fa7(0xf2)](exports,a0_0x268fa7(0x11c),{'value':!![]}),exports[a0_0x268fa7(0x102)]=filterDockerPs,exports[a0_0x268fa7(0x11b)]=filterDockerImages,exports[a0_0x268fa7(0x115)]=filterDockerLogs,exports[a0_0x268fa7(0xee)]=filterKubectl,exports[a0_0x268fa7(0xf0)]=filterRuff;function a0_0x43dc(_0x2da4d8,_0x313aee){const _0x3e74eb=a0_0x3e74();return a0_0x43dc=function(_0x43dc80,_0x52c78a){_0x43dc80=_0x43dc80-0xe7;let _0x19d990=_0x3e74eb[_0x43dc80];return _0x19d990;},a0_0x43dc(_0x2da4d8,_0x313aee);}function filterDockerPs(_0x27c3da){const _0x26324d=a0_0x268fa7,_0xa066a5=_0x27c3da[_0x26324d(0xe7)]('\x0a')['filter'](_0x435de1=>_0x435de1[_0x26324d(0xfb)]()[_0x26324d(0x10c)]>0x0);if(_0xa066a5[_0x26324d(0x10c)]===0x0)return _0x26324d(0x10b);if(_0xa066a5[_0x26324d(0x10c)]<=0xa)return _0x27c3da[_0x26324d(0xfb)]();const _0x1db453=_0xa066a5[0x0],_0x16d889=_0xa066a5[_0x26324d(0x107)](0x1),_0xf19ce=[];_0xf19ce[_0x26324d(0xf7)](_0x26324d(0x112)+_0x16d889['length']+_0x26324d(0xf9)),_0xf19ce[_0x26324d(0xf7)]('');for(const _0x1832b0 of _0x16d889){const _0x1403fe=_0x1832b0[_0x26324d(0xe7)](/\s{2,}/);if(_0x1403fe['length']>=0x5){const _0x587848=_0x1403fe[0x0][_0x26324d(0x10a)](0x0,0xc),_0x585e97=_0x1403fe[0x1],_0x4bf87c=_0x1403fe[_0x1403fe[_0x26324d(0x10c)]-0x2]||'',_0x3cef04=_0x1403fe[_0x1403fe[_0x26324d(0x10c)]-0x1]||'';_0xf19ce[_0x26324d(0xf7)]('\x20\x20'+_0x587848+'\x20\x20'+_0x585e97+'\x20\x20'+_0x4bf87c+'\x20\x20'+_0x3cef04);}else _0xf19ce['push']('\x20\x20'+_0x1832b0[_0x26324d(0xfb)]());}return _0xf19ce['join']('\x0a');}function filterDockerImages(_0x3a9dfd){const _0x403e40=a0_0x268fa7,_0x1ee3a0=_0x3a9dfd['split']('\x0a')[_0x403e40(0xff)](_0x1e3577=>_0x1e3577['trim']()[_0x403e40(0x10c)]>0x0);if(_0x1ee3a0[_0x403e40(0x10c)]<=0x1)return _0x403e40(0xf1);if(_0x1ee3a0[_0x403e40(0x10c)]<=0xf)return _0x3a9dfd[_0x403e40(0xfb)]();const _0x38cb04=_0x1ee3a0[_0x403e40(0x107)](0x1),_0x31082e=[_0x403e40(0xfa)+_0x38cb04[_0x403e40(0x10c)]+_0x403e40(0xf9)];_0x31082e['push']('');const _0x92dda3=_0x38cb04['slice'](0x0,0x14);for(const _0x54e548 of _0x92dda3){const _0x4a2f96=_0x54e548['split'](/\s{2,}/);if(_0x4a2f96[_0x403e40(0x10c)]>=0x3){const _0x4cfff6=_0x4a2f96[0x0],_0x281053=_0x4a2f96[0x1],_0x19640d=_0x4a2f96[_0x4a2f96[_0x403e40(0x10c)]-0x1]||'';_0x31082e[_0x403e40(0xf7)]('\x20\x20'+_0x4cfff6+':'+_0x281053+'\x20\x20'+_0x19640d);}else _0x31082e[_0x403e40(0xf7)]('\x20\x20'+_0x54e548[_0x403e40(0xfb)]());}return _0x38cb04[_0x403e40(0x10c)]>0x14&&_0x31082e['push'](_0x403e40(0xef)+(_0x38cb04[_0x403e40(0x10c)]-0x14)+_0x403e40(0x118)),_0x31082e['join']('\x0a');}function filterDockerLogs(_0x12cfb3){const _0x5f2dbb=a0_0x268fa7,_0xe6d4d1=_0x12cfb3[_0x5f2dbb(0xe7)]('\x0a');if(_0xe6d4d1[_0x5f2dbb(0x10c)]<=0x32)return _0x12cfb3;const _0x57435f=[];return _0x57435f[_0x5f2dbb(0xf7)](..._0xe6d4d1[_0x5f2dbb(0x107)](0x0,0x14)),_0x57435f[_0x5f2dbb(0xf7)](_0x5f2dbb(0x101)+(_0xe6d4d1[_0x5f2dbb(0x10c)]-0x28)+_0x5f2dbb(0x103)),_0x57435f['push'](..._0xe6d4d1['slice'](-0x14)),_0x57435f[_0x5f2dbb(0xf7)]('\x0a('+_0xe6d4d1['length']+'\x20log\x20lines\x20total)'),_0x57435f['join']('\x0a');}function a0_0x3e74(){const _0x581155=['match','Found\x200\x20error','642942qotvuj','9807ulfVqd','7484008qdJbLP','Events:','filterKubectl','\x20\x20...\x20+','filterRuff','No\x20images\x20found','defineProperty','4650844uidAak','2mfITxw','Ruff:\x20','No\x20resources\x20found','push','\x20more\x20files','\x20total','Docker\x20images:\x20','trim','\x20issues\x20in\x20','join','describe','filter','100uEARYc','\x0a...\x20[','filterDockerPs','\x20lines\x20truncated]\x20...\x0a','\x20more\x20resources','1160141orYctF','\x20more\x20lines','slice','\x20more\x20events','All\x20checks\x20passed','substring','No\x20containers\x20running','length','...\x20+','95MlqarO','includes','\x20more','150004lRlPNw','Containers:\x20','4860AanyYp','\x20resources\x20found','filterDockerLogs','startsWith','Ruff:\x20no\x20issues\x20found','\x20more\x20images','Ruff:\x20all\x20checks\x20passed','3226824KusalY','filterDockerImages','__esModule','split'];a0_0x3e74=function(){return _0x581155;};return a0_0x3e74();}function filterKubectl(_0x26a843,_0x133539){const _0xd621f8=a0_0x268fa7,_0x2eac0e=_0x26a843['split']('\x0a')[_0xd621f8(0xff)](_0x29e147=>_0x29e147[_0xd621f8(0xfb)]()[_0xd621f8(0x10c)]>0x0);if(_0x2eac0e['length']===0x0)return _0xd621f8(0xf6);if(_0x2eac0e['length']<=0x14)return _0x26a843['trim']();if(_0x133539==='get'){const _0x6d5efa=_0x2eac0e[0x0],_0x3650a9=_0x2eac0e[_0xd621f8(0x107)](0x1),_0x5494ad=[_0x3650a9[_0xd621f8(0x10c)]+_0xd621f8(0x114),'',_0x6d5efa];return _0x3650a9[_0xd621f8(0x10c)]<=0x1e?_0x5494ad[_0xd621f8(0xf7)](..._0x3650a9):(_0x5494ad['push'](..._0x3650a9['slice'](0x0,0x19)),_0x5494ad[_0xd621f8(0xf7)](_0xd621f8(0x10d)+(_0x3650a9[_0xd621f8(0x10c)]-0x19)+_0xd621f8(0x104))),_0x5494ad[_0xd621f8(0xfd)]('\x0a');}if(_0x133539===_0xd621f8(0xfe)){const _0x16cf85=[];let _0x28fa5b=![],_0x278a24=0x0;for(const _0xee532 of _0x2eac0e){if(_0xee532[_0xd621f8(0x116)](_0xd621f8(0xed))){_0x28fa5b=!![],_0x16cf85[_0xd621f8(0xf7)](_0xee532);continue;}if(_0x28fa5b){_0x278a24++;if(_0x278a24<=0x5)_0x16cf85[_0xd621f8(0xf7)](_0xee532);}else _0x16cf85[_0xd621f8(0xf7)](_0xee532);}return _0x278a24>0x5&&_0x16cf85[_0xd621f8(0xf7)](_0xd621f8(0xef)+(_0x278a24-0x5)+_0xd621f8(0x108)),_0x16cf85[_0xd621f8(0xfd)]('\x0a');}if(_0x133539==='logs')return filterDockerLogs(_0x26a843);const _0x3fe0a0=_0x2eac0e[_0xd621f8(0x107)](0x0,0x1e);return _0x2eac0e[_0xd621f8(0x10c)]>0x1e&&_0x3fe0a0['push'](_0xd621f8(0x10d)+(_0x2eac0e[_0xd621f8(0x10c)]-0x1e)+_0xd621f8(0x106)),_0x3fe0a0['join']('\x0a');}function filterRuff(_0x31ab6a){const _0x222c7c=a0_0x268fa7,_0x579774=_0x31ab6a[_0x222c7c(0xe7)]('\x0a')[_0x222c7c(0xff)](_0x46d339=>_0x46d339['trim']()['length']>0x0);if(_0x579774['length']===0x0)return _0x222c7c(0x117);if(_0x31ab6a[_0x222c7c(0x10f)](_0x222c7c(0x109))||_0x31ab6a['includes'](_0x222c7c(0xe9)))return _0x222c7c(0x119);const _0x2d72be=_0x31ab6a[_0x222c7c(0xe8)](/Found (\d+) error/),_0x227a55=_0x2d72be?parseInt(_0x2d72be[0x1]):_0x579774[_0x222c7c(0x10c)],_0x1e4c84={},_0x4700f3=[];for(const _0x593a57 of _0x579774){const _0x402711=_0x593a57[_0x222c7c(0xe8)](/^([^:]+:\d+:\d+):\s*(.*)/);if(_0x402711){const _0x1fd7a6=_0x402711[0x1],_0x3597db=_0x1fd7a6[_0x222c7c(0xe7)](':')[0x0];if(!_0x1e4c84[_0x3597db])_0x1e4c84[_0x3597db]=[];_0x1e4c84[_0x3597db][_0x222c7c(0xf7)](_0x593a57);}else _0x4700f3[_0x222c7c(0xf7)](_0x593a57);}const _0x8ac0b=Object['keys'](_0x1e4c84);if(_0x8ac0b[_0x222c7c(0x10c)]===0x0){if(_0x579774[_0x222c7c(0x10c)]<=0x14)return _0x31ab6a['trim']();return _0x579774[_0x222c7c(0x107)](0x0,0xf)[_0x222c7c(0xfd)]('\x0a')+('\x0a...\x20+'+(_0x579774[_0x222c7c(0x10c)]-0xf)+_0x222c7c(0x110));}const _0x4de67c=[_0x222c7c(0xf5)+_0x227a55+'\x20issues\x20in\x20'+_0x8ac0b[_0x222c7c(0x10c)]+'\x20files'];_0x4de67c[_0x222c7c(0xf7)]('');const _0x5094ab=0xa;for(const _0xfde25d of _0x8ac0b['slice'](0x0,_0x5094ab)){const _0x14e464=_0x1e4c84[_0xfde25d];if(_0x14e464['length']<=0x3){for(const _0x4770ae of _0x14e464)_0x4de67c[_0x222c7c(0xf7)]('\x20\x20'+_0x4770ae);}else _0x4de67c[_0x222c7c(0xf7)]('\x20\x20'+_0x14e464[0x0]),_0x4de67c[_0x222c7c(0xf7)]('\x20\x20...\x20('+_0x14e464[_0x222c7c(0x10c)]+_0x222c7c(0xfc)+_0xfde25d+')');}return _0x8ac0b[_0x222c7c(0x10c)]>_0x5094ab&&_0x4de67c['push'](_0x222c7c(0xef)+(_0x8ac0b[_0x222c7c(0x10c)]-_0x5094ab)+_0x222c7c(0xf8)),_0x4de67c[_0x222c7c(0xfd)]('\x0a');}
|
package/filters/generic.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x529a75=a0_0x4929;(function(_0x4bab02,_0x31161b){const _0x2c1f7d=a0_0x4929,_0x54407f=_0x4bab02();while(!![]){try{const _0x27eafc=-parseInt(_0x2c1f7d(0xdc))/0x1+-parseInt(_0x2c1f7d(0xd1))/0x2+parseInt(_0x2c1f7d(0xcc))/0x3+-parseInt(_0x2c1f7d(0xc9))/0x4+-parseInt(_0x2c1f7d(0xb7))/0x5+parseInt(_0x2c1f7d(0xcb))/0x6+-parseInt(_0x2c1f7d(0xbd))/0x7*(-parseInt(_0x2c1f7d(0xb9))/0x8);if(_0x27eafc===_0x31161b)break;else _0x54407f['push'](_0x54407f['shift']());}catch(_0x3f697c){_0x54407f['push'](_0x54407f['shift']());}}}(a0_0x4d45,0x21a2c));Object['defineProperty'](exports,a0_0x529a75(0xc2),{'value':!![]}),exports['stripAnsi']=stripAnsi,exports[a0_0x529a75(0xcf)]=collapseDuplicates,exports['collapseWhitespace']=collapseWhitespace,exports[a0_0x529a75(0xb5)]=stripComments,exports[a0_0x529a75(0xcd)]=smartCrushJson,exports[a0_0x529a75(0xca)]=softTruncate;function stripAnsi(_0x3886c2){const _0x53b8f0=a0_0x529a75,_0x4d0737=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;return _0x3886c2[_0x53b8f0(0xd5)](_0x4d0737,'');}function collapseDuplicates(_0xc7867a){const _0x461084=a0_0x529a75,_0x3e72a3=_0xc7867a[_0x461084(0xc0)]('\x0a');if(_0x3e72a3[_0x461084(0xd0)]<=0x1)return _0xc7867a;const _0x44b5f2=[];let _0x3ca40b=_0x3e72a3[0x0],_0x37547d=0x1;for(let _0x4abb3a=0x1;_0x4abb3a<_0x3e72a3['length'];_0x4abb3a++){const _0x3ac645=_0x3e72a3[_0x4abb3a];_0x3ac645===_0x3ca40b&&_0x3ac645['trim']()[_0x461084(0xd0)]>0x0?_0x37547d++:(_0x37547d>0x1?_0x44b5f2[_0x461084(0xba)](_0x3ca40b+_0x461084(0xc4)+_0x37547d+']'):_0x44b5f2['push'](_0x3ca40b),_0x3ca40b=_0x3ac645,_0x37547d=0x1);}return _0x37547d>0x1?_0x44b5f2[_0x461084(0xba)](_0x3ca40b+_0x461084(0xc4)+_0x37547d+']'):_0x44b5f2[_0x461084(0xba)](_0x3ca40b),_0x44b5f2[_0x461084(0xb2)]('\x0a');}function collapseWhitespace(_0x40a3b3){const _0x4ef8f4=a0_0x529a75;let _0x2c3f28=_0x40a3b3[_0x4ef8f4(0xd5)](/[ \t]+$/gm,'');return _0x2c3f28=_0x2c3f28[_0x4ef8f4(0xd5)](/\n{4,}/g,_0x4ef8f4(0xb6)),_0x2c3f28;}function stripComments(_0xefc7d,_0x4c0d15){const _0x3ef4fe=a0_0x529a75;if(!_0x4c0d15)return _0xefc7d;const _0x56d2d0=_0xefc7d[_0x3ef4fe(0xc0)]('\x0a');if(_0x56d2d0[_0x3ef4fe(0xd0)]<=0x96)return _0xefc7d;const _0x412b27={'.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*#(?!!)/},_0x261851=_0x412b27[_0x4c0d15[_0x3ef4fe(0xce)]()];if(!_0x261851)return _0xefc7d;const _0x5c8590=_0x56d2d0[_0x3ef4fe(0xd4)](_0x6afd86=>!_0x261851['test'](_0x6afd86));return _0x5c8590[_0x3ef4fe(0xb2)]('\x0a');}function a0_0x4929(_0x3a63a7,_0x316b12){const _0x4d4508=a0_0x4d45();return a0_0x4929=function(_0x492946,_0x3c064b){_0x492946=_0x492946-0xb2;let _0x1d4cf2=_0x4d4508[_0x492946];return _0x1d4cf2;},a0_0x4929(_0x3a63a7,_0x316b12);}function smartCrushJson(_0xb82d84){const _0xbcce12=a0_0x529a75;try{const _0xf993f2=_0xb82d84['trim']();if(!_0xf993f2[_0xbcce12(0xc7)]('['))return null;const _0x2c57c8=JSON[_0xbcce12(0xbe)](_0xf993f2);if(!Array[_0xbcce12(0xd6)](_0x2c57c8)||_0x2c57c8[_0xbcce12(0xd0)]<0x3)return null;if(typeof _0x2c57c8[0x0]!=='object'||_0x2c57c8[0x0]===null)return null;const _0xf67c17=Object[_0xbcce12(0xd8)](_0x2c57c8[0x0]);if(_0xf67c17[_0xbcce12(0xd0)]===0x0)return null;const _0x4f173f=_0xf67c17['filter'](_0x16ad86=>{const _0x336053=_0xbcce12,_0x3f869d=_0x16ad86['toLowerCase']();return!_0x3f869d[_0x336053(0xbb)](_0x336053(0xdb))&&!_0x3f869d['includes'](_0x336053(0xd7))&&!_0x3f869d[_0x336053(0xbb)](_0x336053(0xbf))&&!_0x3f869d[_0x336053(0xbb)]('hash')&&!_0x3f869d[_0x336053(0xbb)](_0x336053(0xd3))&&!_0x3f869d['includes'](_0x336053(0xc8))&&!_0x3f869d['includes'](_0x336053(0xc3))&&_0x3f869d!==_0x336053(0xb8)&&_0x3f869d!=='engines'&&_0x3f869d!==_0x336053(0xd9)&&_0x3f869d!==_0x336053(0xda);})[_0xbcce12(0xc6)](0x0,0x6);if(_0x4f173f[_0xbcce12(0xd0)]===0x0)return null;const _0x1aed47=[];_0x1aed47[_0xbcce12(0xba)](_0x4f173f['join']('|'));const _0x4c8463=0x1e;for(let _0x4b4a85=0x0;_0x4b4a85<Math[_0xbcce12(0xb3)](_0x2c57c8[_0xbcce12(0xd0)],_0x4c8463);_0x4b4a85++){const _0x47e983=_0x4f173f['map'](_0x735a4b=>{const _0x1809c9=_0xbcce12,_0x79a549=_0x2c57c8[_0x4b4a85][_0x735a4b];if(_0x79a549===null||_0x79a549===undefined)return'';if(typeof _0x79a549===_0x1809c9(0xc5))return JSON[_0x1809c9(0xb4)](_0x79a549)[_0x1809c9(0xde)](0x0,0x28);return String(_0x79a549)[_0x1809c9(0xde)](0x0,0x3c);});_0x1aed47[_0xbcce12(0xba)](_0x47e983['join']('|'));}_0x2c57c8['length']>_0x4c8463&&_0x1aed47['push'](_0xbcce12(0xd2)+(_0x2c57c8[_0xbcce12(0xd0)]-_0x4c8463)+'\x20more\x20rows');_0x1aed47[_0xbcce12(0xba)]('\x0a('+_0x2c57c8[_0xbcce12(0xd0)]+_0xbcce12(0xdd)+_0xf67c17[_0xbcce12(0xd0)]+_0xbcce12(0xbc)+_0x4f173f[_0xbcce12(0xd0)]+_0xbcce12(0xdf));const _0x3d35bd=_0x1aed47[_0xbcce12(0xb2)]('\x0a');if(_0x3d35bd['length']<_0xf993f2['length'])return _0x3d35bd;return null;}catch{return null;}}function softTruncate(_0x30046a,_0x512b91=0x4e20){const _0x521d76=a0_0x529a75;if(_0x30046a[_0x521d76(0xd0)]<=_0x512b91)return _0x30046a;const _0xd179e1=_0x30046a[_0x521d76(0xc0)]('\x0a');if(_0xd179e1[_0x521d76(0xd0)]<=0xc8)return _0x30046a;const _0x339eef=0x32,_0x1b275e=0x96,_0x1f4f18=_0xd179e1[_0x521d76(0xc6)](0x0,_0x339eef),_0x161340=_0xd179e1[_0x521d76(0xc6)](_0xd179e1[_0x521d76(0xd0)]-_0x1b275e),_0x555600=_0x30046a['length']-(_0x1f4f18[_0x521d76(0xb2)]('\x0a')['length']+_0x161340['join']('\x0a')['length']);return[..._0x1f4f18,_0x521d76(0xc1)+_0x555600+'\x20characters\x20of\x20output]\x20...\x0a',..._0x161340][_0x521d76(0xb2)]('\x0a');}function a0_0x4d45(){const _0x274e8c=['parse','sha','split','\x0a...\x20[TrimPrompt:\x20Truncated\x20','__esModule','dev','\x20[x','object','slice','startsWith','signature','195812ZHYNeu','softTruncate','88374vrUzSm','404517qUncql','smartCrushJson','toLowerCase','collapseDuplicates','length','446866layOJC','...\x20+','checksum','filter','replace','isArray','integrity','keys','bugs','repository','resolved','27058aLzBos','\x20items,\x20','substring','\x20key\x20fields)','join','min','stringify','stripComments','\x0a\x0a\x0a','511670zzQUpv','funding','1559928SzDBeo','push','includes','\x20fields,\x20showing\x20','14rtgNXg'];a0_0x4d45=function(){return _0x274e8c;};return a0_0x4d45();}
|
package/filters/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0x2baf71=a0_0x50e5;(function(_0x35a5b1,_0x28b95d){const _0x4ebbc3=a0_0x50e5,_0x1acf57=_0x35a5b1();while(!![]){try{const _0x1ab4ba=parseInt(_0x4ebbc3(0x19e))/0x1+parseInt(_0x4ebbc3(0x19c))/0x2*(-parseInt(_0x4ebbc3(0x196))/0x3)+parseInt(_0x4ebbc3(0x178))/0x4+-parseInt(_0x4ebbc3(0x19a))/0x5*(-parseInt(_0x4ebbc3(0x171))/0x6)+parseInt(_0x4ebbc3(0x185))/0x7*(parseInt(_0x4ebbc3(0x175))/0x8)+-parseInt(_0x4ebbc3(0x18d))/0x9+parseInt(_0x4ebbc3(0x172))/0xa*(parseInt(_0x4ebbc3(0x1a1))/0xb);if(_0x1ab4ba===_0x28b95d)break;else _0x1acf57['push'](_0x1acf57['shift']());}catch(_0x4d3b4b){_0x1acf57['push'](_0x1acf57['shift']());}}}(a0_0x15f1,0xcd95e));var __createBinding=this&&this[a0_0x2baf71(0x188)]||(Object[a0_0x2baf71(0x198)]?function(_0x5e4be3,_0x2283e0,_0x574b70,_0x37be69){const _0x5e71cf=a0_0x2baf71;if(_0x37be69===undefined)_0x37be69=_0x574b70;var _0x4737f9=Object[_0x5e71cf(0x176)](_0x2283e0,_0x574b70);(!_0x4737f9||(_0x5e71cf(0x179)in _0x4737f9?!_0x2283e0[_0x5e71cf(0x195)]:_0x4737f9[_0x5e71cf(0x189)]||_0x4737f9[_0x5e71cf(0x17e)]))&&(_0x4737f9={'enumerable':!![],'get':function(){return _0x2283e0[_0x574b70];}}),Object['defineProperty'](_0x5e4be3,_0x37be69,_0x4737f9);}:function(_0x1ffbf0,_0x1103b7,_0x394adb,_0x48e00b){if(_0x48e00b===undefined)_0x48e00b=_0x394adb;_0x1ffbf0[_0x48e00b]=_0x1103b7[_0x394adb];}),__setModuleDefault=this&&this[a0_0x2baf71(0x18e)]||(Object['create']?function(_0x3c4151,_0x277711){Object['defineProperty'](_0x3c4151,'default',{'enumerable':!![],'value':_0x277711});}:function(_0xdf7bac,_0x42faae){const _0x30a92b=a0_0x2baf71;_0xdf7bac[_0x30a92b(0x18c)]=_0x42faae;}),__importStar=this&&this[a0_0x2baf71(0x183)]||(function(){var _0x269152=function(_0xcd5811){const _0x215bd4=a0_0x50e5;return _0x269152=Object[_0x215bd4(0x177)]||function(_0x501f20){const _0x8e0164=_0x215bd4;var _0x397ce3=[];for(var _0x46bf35 in _0x501f20)if(Object[_0x8e0164(0x16e)][_0x8e0164(0x173)][_0x8e0164(0x187)](_0x501f20,_0x46bf35))_0x397ce3[_0x397ce3['length']]=_0x46bf35;return _0x397ce3;},_0x269152(_0xcd5811);};return function(_0x5c3098){const _0x4f0a88=a0_0x50e5;if(_0x5c3098&&_0x5c3098[_0x4f0a88(0x195)])return _0x5c3098;var _0x3626a7={};if(_0x5c3098!=null){for(var _0x896690=_0x269152(_0x5c3098),_0x475846=0x0;_0x475846<_0x896690[_0x4f0a88(0x191)];_0x475846++)if(_0x896690[_0x475846]!==_0x4f0a88(0x18c))__createBinding(_0x3626a7,_0x5c3098,_0x896690[_0x475846]);}return __setModuleDefault(_0x3626a7,_0x5c3098),_0x3626a7;};}());function a0_0x50e5(_0x3f7f4b,_0x1dbb2c){const _0x15f12b=a0_0x15f1();return a0_0x50e5=function(_0x50e563,_0x589cc5){_0x50e563=_0x50e563-0x16e;let _0x5bf689=_0x15f12b[_0x50e563];return _0x5bf689;},a0_0x50e5(_0x3f7f4b,_0x1dbb2c);}Object[a0_0x2baf71(0x170)](exports,'__esModule',{'value':!![]}),exports[a0_0x2baf71(0x18a)]=filterGitStatus,exports[a0_0x2baf71(0x1a4)]=filterGitLog,exports[a0_0x2baf71(0x1a3)]=filterGitDiff;function a0_0x15f1(){const _0x2d5572=['configurable','*\x20Branch:\x20','map','\x20\x20??\x20','basename','__importStar','---END---','7609bwVOjc','+++','call','__createBinding','writable','filterGitStatus','substring','default','9830763AqVUeS','__setModuleDefault','split','\x0aChanges:','length','match','slice','\x20(+','__esModule','3oBbgRJ','path','create','join','165RLMPhs','Clean\x20working\x20tree','2737346VgsEZM','No\x20modifications','1365252lDuScO','startsWith','\x20\x20...\x20+','77wnVZAV','trim','filterGitDiff','filterGitLog','dirname','diff\x20--git','entries','/\x20(','filter','prototype','push','defineProperty','44220XHXZBC','788420FEioOO','hasOwnProperty','replace','8000DUNVZj','getOwnPropertyDescriptor','getOwnPropertyNames','222808qqbqMb','get','\x20more\x20modifications','\x20\x20...\x20(+','\x20lines\x20of\x20description)','\x20untracked\x20files)'];a0_0x15f1=function(){return _0x2d5572;};return a0_0x15f1();}const path=__importStar(require(a0_0x2baf71(0x197)));function filterGitStatus(_0x2186df){const _0x1efb1f=a0_0x2baf71,_0x74d6ed=_0x2186df[_0x1efb1f(0x18f)]('\x0a')[_0x1efb1f(0x180)](_0x2ba678=>_0x2ba678[_0x1efb1f(0x1a2)]())[_0x1efb1f(0x1a9)](_0x53c192=>_0x53c192[_0x1efb1f(0x191)]>0x0);if(_0x74d6ed[_0x1efb1f(0x191)]===0x0)return _0x1efb1f(0x19b);const _0x438969=[],_0x5d2a7b=[],_0x56de78=[];for(const _0xbfcbbd of _0x74d6ed){if(_0xbfcbbd[_0x1efb1f(0x19f)]('##')){const _0x5aed20=_0xbfcbbd[_0x1efb1f(0x174)](/^##\s*/,'');_0x438969[_0x1efb1f(0x16f)](_0x1efb1f(0x17f)+_0x5aed20);}else _0xbfcbbd[_0x1efb1f(0x19f)]('??')?_0x5d2a7b[_0x1efb1f(0x16f)](_0xbfcbbd[_0x1efb1f(0x18b)](0x3)[_0x1efb1f(0x1a2)]()):_0x56de78[_0x1efb1f(0x16f)](_0xbfcbbd);}_0x56de78[_0x1efb1f(0x191)]>0x0&&(_0x438969['push'](_0x1efb1f(0x190)),_0x438969['push'](..._0x56de78['map'](_0x380843=>'\x20\x20'+_0x380843)));if(_0x5d2a7b[_0x1efb1f(0x191)]>0x0){_0x438969['push']('\x0aUntracked\x20files:');const _0x53cfda={},_0x3daa9d=[];for(const _0x5c2dc5 of _0x5d2a7b){const _0x47df02=path[_0x1efb1f(0x1a5)](_0x5c2dc5);_0x47df02==='.'||_0x47df02===''?_0x3daa9d[_0x1efb1f(0x16f)](_0x5c2dc5):(!_0x53cfda[_0x47df02]&&(_0x53cfda[_0x47df02]=[]),_0x53cfda[_0x47df02][_0x1efb1f(0x16f)](path[_0x1efb1f(0x182)](_0x5c2dc5)));}for(const [_0x2158d3,_0x368d4d]of Object[_0x1efb1f(0x1a7)](_0x53cfda)){if(_0x368d4d[_0x1efb1f(0x191)]>0x5)_0x438969[_0x1efb1f(0x16f)]('\x20\x20??\x20'+_0x2158d3+_0x1efb1f(0x1a8)+_0x368d4d['length']+_0x1efb1f(0x17d));else for(const _0x4d452d of _0x368d4d){_0x438969[_0x1efb1f(0x16f)](_0x1efb1f(0x181)+path[_0x1efb1f(0x199)](_0x2158d3,_0x4d452d));}}for(const _0x1bc3fd of _0x3daa9d){_0x438969[_0x1efb1f(0x16f)](_0x1efb1f(0x181)+_0x1bc3fd);}}return _0x438969[_0x1efb1f(0x199)]('\x0a');}function filterGitLog(_0x41d7ba){const _0x512b70=a0_0x2baf71,_0x44bba5=_0x41d7ba[_0x512b70(0x18f)](_0x512b70(0x184))['map'](_0x4f1a7f=>_0x4f1a7f['trim']())['filter'](_0x233240=>_0x233240[_0x512b70(0x191)]>0x0);if(_0x44bba5['length']===0x0)return _0x41d7ba;const _0x2c3a23=[];for(const _0x50d55c of _0x44bba5){const _0x1a9ad0=_0x50d55c['split']('\x0a'),_0x451cd5=_0x1a9ad0[0x0]||'',_0x16bce0=_0x1a9ad0['slice'](0x1)[_0x512b70(0x180)](_0x37e70e=>_0x37e70e[_0x512b70(0x1a2)]())['filter'](_0x1b0b96=>_0x1b0b96[_0x512b70(0x191)]>0x0);_0x2c3a23[_0x512b70(0x16f)]('-\x20'+_0x451cd5),_0x16bce0['length']>0x0&&(_0x2c3a23['push']('\x20\x20'+_0x16bce0[0x0]),_0x16bce0['length']>0x1&&_0x2c3a23[_0x512b70(0x16f)](_0x512b70(0x17b)+(_0x16bce0[_0x512b70(0x191)]-0x1)+_0x512b70(0x17c)));}return _0x2c3a23['join']('\x0a');}function filterGitDiff(_0x309db6){const _0x77906a=a0_0x2baf71,_0x47e737=_0x309db6[_0x77906a(0x18f)]('\x0a'),_0x7be569=[];let _0x568726='',_0x4e09c9=0x0,_0x86f9c5=0x0,_0x2b2a75=[];const _0x11563a=()=>{const _0x4f05d8=_0x77906a;if(_0x568726&&(_0x4e09c9>0x0||_0x86f9c5>0x0)){_0x7be569[_0x4f05d8(0x16f)]('[file]\x20'+_0x568726+_0x4f05d8(0x194)+_0x4e09c9+'\x20-'+_0x86f9c5+')');const _0x7e5183=0xa,_0x28a28e=_0x2b2a75[_0x4f05d8(0x193)](0x0,_0x7e5183);for(const _0x3b3c35 of _0x28a28e){_0x7be569[_0x4f05d8(0x16f)]('\x20\x20'+_0x3b3c35);}const _0x119136=_0x4e09c9+_0x86f9c5-_0x7e5183;_0x119136>0x0&&_0x7be569[_0x4f05d8(0x16f)](_0x4f05d8(0x1a0)+_0x119136+_0x4f05d8(0x17a));}_0x4e09c9=0x0,_0x86f9c5=0x0,_0x2b2a75=[];};for(const _0x585292 of _0x47e737){if(_0x585292[_0x77906a(0x19f)](_0x77906a(0x1a6))){_0x11563a();const _0x552376=_0x585292[_0x77906a(0x192)](/\sb\/(.+)$/);_0x568726=_0x552376?_0x552376[0x1]:'unknown_file';}else{if(_0x585292[_0x77906a(0x19f)]('+')&&!_0x585292[_0x77906a(0x19f)](_0x77906a(0x186)))_0x4e09c9++,_0x2b2a75[_0x77906a(0x16f)](_0x585292);else _0x585292[_0x77906a(0x19f)]('-')&&!_0x585292['startsWith']('---')&&(_0x86f9c5++,_0x2b2a75['push'](_0x585292));}}_0x11563a();const _0x41f2a5=_0x7be569[_0x77906a(0x199)]('\x0a');return _0x41f2a5['length']>0x0?_0x41f2a5:_0x77906a(0x19d);}
|
package/filters/go.js
CHANGED
|
@@ -1 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
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
|
+
}
|