@loxia-labs/loxia-autopilot-one 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.js +1 -1
- package/bin/loxia-terminal-v2.js +1 -1
- package/bin/loxia-terminal.js +1 -1
- package/bin/start-with-terminal.js +1 -1
- package/package.json +1 -1
- package/scripts/install-scanners.js +1 -1
- package/src/analyzers/CSSAnalyzer.js +1 -1
- package/src/analyzers/ConfigValidator.js +1 -1
- package/src/analyzers/ESLintAnalyzer.js +1 -1
- package/src/analyzers/JavaScriptAnalyzer.js +1 -1
- package/src/analyzers/PrettierFormatter.js +1 -1
- package/src/analyzers/PythonAnalyzer.js +1 -1
- package/src/analyzers/SecurityAnalyzer.js +1 -1
- package/src/analyzers/TypeScriptAnalyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/detector.js +1 -1
- package/src/analyzers/codeCloneDetector/index.js +1 -1
- package/src/analyzers/codeCloneDetector/parser.js +1 -1
- package/src/analyzers/codeCloneDetector/reporter.js +1 -1
- package/src/analyzers/codeCloneDetector/scanner.js +1 -1
- package/src/core/agentPool.js +1 -1
- package/src/core/agentScheduler.js +1 -1
- package/src/core/contextManager.js +1 -1
- package/src/core/messageProcessor.js +1 -1
- package/src/core/orchestrator.js +1 -1
- package/src/core/stateManager.js +1 -1
- package/src/index.js +1 -1
- package/src/interfaces/cli.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
- package/src/interfaces/terminal/api/apiClient.js +1 -1
- package/src/interfaces/terminal/api/messageRouter.js +1 -1
- package/src/interfaces/terminal/api/session.js +1 -1
- package/src/interfaces/terminal/api/websocket.js +1 -1
- package/src/interfaces/terminal/components/AgentCreator.js +1 -1
- package/src/interfaces/terminal/components/AgentEditor.js +1 -1
- package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
- package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
- package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
- package/src/interfaces/terminal/components/Header.js +1 -1
- package/src/interfaces/terminal/components/HelpPanel.js +1 -1
- package/src/interfaces/terminal/components/InputBox.js +1 -1
- package/src/interfaces/terminal/components/Layout.js +1 -1
- package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
- package/src/interfaces/terminal/components/MessageList.js +1 -1
- package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
- package/src/interfaces/terminal/components/SearchPanel.js +1 -1
- package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
- package/src/interfaces/terminal/components/StatusBar.js +1 -1
- package/src/interfaces/terminal/components/TextInput.js +1 -1
- package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
- package/src/interfaces/terminal/config/constants.js +1 -1
- package/src/interfaces/terminal/index.js +1 -1
- package/src/interfaces/terminal/state/useAgentControl.js +1 -1
- package/src/interfaces/terminal/state/useAgents.js +1 -1
- package/src/interfaces/terminal/state/useConnection.js +1 -1
- package/src/interfaces/terminal/state/useMessages.js +1 -1
- package/src/interfaces/terminal/state/useTools.js +1 -1
- package/src/interfaces/terminal/utils/debugLogger.js +1 -1
- package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
- package/src/interfaces/terminal/utils/theme.js +1 -1
- package/src/interfaces/webServer.js +1 -1
- package/src/modules/fileExplorer/controller.js +1 -1
- package/src/modules/fileExplorer/index.js +1 -1
- package/src/modules/fileExplorer/middleware.js +1 -1
- package/src/modules/fileExplorer/routes.js +1 -1
- package/src/services/aiService.js +1 -1
- package/src/services/apiKeyManager.js +1 -1
- package/src/services/benchmarkService.js +1 -1
- package/src/services/budgetService.js +1 -1
- package/src/services/contextInjectionService.js +1 -1
- package/src/services/conversationCompactionService.js +1 -1
- package/src/services/errorHandler.js +1 -1
- package/src/services/fileAttachmentService.js +1 -1
- package/src/services/modelRouterService.js +1 -1
- package/src/services/modelsService.js +1 -1
- package/src/services/qualityInspector.js +1 -1
- package/src/services/tokenCountingService.js +1 -1
- package/src/tools/agentCommunicationTool.js +1 -1
- package/src/tools/agentDelayTool.js +1 -1
- package/src/tools/asyncToolManager.js +1 -1
- package/src/tools/baseTool.js +1 -1
- package/src/tools/browserTool.js +1 -1
- package/src/tools/cloneDetectionTool.js +1 -1
- package/src/tools/dependencyResolverTool.js +1 -1
- package/src/tools/fileContentReplaceTool.js +1 -1
- package/src/tools/fileSystemTool.js +1 -1
- package/src/tools/fileTreeTool.js +1 -1
- package/src/tools/imageTool.js +1 -1
- package/src/tools/importAnalyzerTool.js +1 -1
- package/src/tools/jobDoneTool.js +1 -1
- package/src/tools/seekTool.js +1 -1
- package/src/tools/staticAnalysisTool.js +1 -1
- package/src/tools/taskManagerTool.js +1 -1
- package/src/tools/terminalTool.js +1 -1
- package/src/tools/webTool.js +1 -1
- package/src/types/agent.js +1 -1
- package/src/types/contextReference.js +1 -1
- package/src/types/conversation.js +1 -1
- package/src/types/toolCommand.js +1 -1
- package/src/utilities/attachmentValidator.js +1 -1
- package/src/utilities/configManager.js +1 -1
- package/src/utilities/constants.js +1 -1
- package/src/utilities/directoryAccessManager.js +1 -1
- package/src/utilities/fileProcessor.js +1 -1
- package/src/utilities/logger.js +1 -1
- package/src/utilities/tagParser.js +1 -1
- package/src/utilities/toolConstants.js +1 -1
- package/web-ui/build/index.html +2 -2
- package/web-ui/build/static/{index-BzXbDs8z.js → index-CoRE46V-.js} +28 -28
- package/web-ui/build/static/index-P281Rusr.css +1 -0
- package/web-ui/build/static/index-BmKxmRe3.css +0 -1
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
|
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
101
|
loxia --version
|
|
102
|
-
# Should display: Loxia Autopilot One v1.0.
|
|
102
|
+
# Should display: Loxia Autopilot One v1.0.10
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
### 4. Create an API Key
|
|
@@ -368,7 +368,7 @@ Loxia automatically compacts long conversations to stay within token limits:
|
|
|
368
368
|
|
|
369
369
|
## 🛣️ Roadmap
|
|
370
370
|
|
|
371
|
-
### Current Version (1.0.
|
|
371
|
+
### Current Version (1.0.10)
|
|
372
372
|
|
|
373
373
|
- ✅ Multi-agent orchestration
|
|
374
374
|
- ✅ 18+ specialized tools
|
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const a0_0x1cf3b5=a0_0x427f;(function(_0x251f47,_0x335b46){const _0x580400=a0_0x427f,_0x51d01d=_0x251f47();while(!![]){try{const _0x51f3ee=-parseInt(_0x580400(0x213))/0x1+-parseInt(_0x580400(0x1f8))/0x2*(-parseInt(_0x580400(0x223))/0x3)+-parseInt(_0x580400(0x228))/0x4+parseInt(_0x580400(0x210))/0x5+-parseInt(_0x580400(0x1f7))/0x6*(parseInt(_0x580400(0x219))/0x7)+-parseInt(_0x580400(0x222))/0x8*(-parseInt(_0x580400(0x1ff))/0x9)+-parseInt(_0x580400(0x224))/0xa;if(_0x51f3ee===_0x335b46)break;else _0x51d01d['push'](_0x51d01d['shift']());}catch(_0x2ba819){_0x51d01d['push'](_0x51d01d['shift']());}}}(a0_0x26d3,0x99221));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';function a0_0x427f(_0x55836e,_0x31f002){_0x55836e=_0x55836e-0x1f4;const _0x26d3c8=a0_0x26d3();let _0x427f90=_0x26d3c8[_0x55836e];return _0x427f90;}import{readFileSync}from'fs';import a0_0x56f43f from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x1cf3b5(0x1fe),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x1cf3b5(0x221)][a0_0x1cf3b5(0x201)](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x1cf3b5(0x227)](a0_0x1cf3b5(0x218))||args[a0_0x1cf3b5(0x227)]('-h'),'version':args[a0_0x1cf3b5(0x227)](a0_0x1cf3b5(0x20e))||args['includes']('-v')};function a0_0x26d3(){const _0xace574=['setTimeout','http://','Starting\x20Terminal\x20UI...\x0a','index.js','toString','\x20manually.','error','package.json','catch','--host','ignore','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.',')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Connect\x20Terminal\x20UI\x20to\x20running\x20server\x0a\x20\x20loxia\x20plus-terminal\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a\x20\x20loxia\x20web\x20--port\x203000\x20\x20\x20\x20#\x20Use\x20custom\x20port\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Run\x20\x27loxia\x20web\x27\x20to\x20start\x20with\x20Web\x20UI\x0a\x20\x202.\x20Or\x20run\x20\x27loxia\x20plus-terminal\x27\x20for\x20Terminal\x20UI\x20experience\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a','\x0aPlease\x20start\x20the\x20server\x20first:','279306HLupDZ','4ScyvLu','parse','exit','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','src','win32','localhost','3177oIWbVM','open\x20\x22','slice','get','help','pid','/api/health','Waiting\x20for\x20server\x20to\x20start...','destroy','Please\x20open\x20manually:\x20','Could\x20not\x20open\x20browser\x20automatically.','log','utf8','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','darwin','--version','kill','3101605pdKdwi',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','694504HPPHZd','length','Checking\x20if\x20server\x20is\x20running...','env','Unknown\x20command:\x20','--help','70VNxgXR','web','Server\x20is\x20running\x20at\x20','SIGINT','host','Error:','SIGTERM','node','argv','21608NiVhnk','1119867VuBQWJ','1171530fhwrQq','platform','inherit','includes','1663808jHNbmv','port','\x0aShutting\x20down\x20server...','LOXIA_HOST','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','\x0aServer\x20is\x20not\x20running\x20at\x20','version','xdg-open\x20\x22','statusCode'];a0_0x26d3=function(){return _0xace574;};return a0_0x26d3();}for(let i=0x0;i<args[a0_0x1cf3b5(0x214)];i++){args[i]==='--port'&&args[i+0x1]&&(flags[a0_0x1cf3b5(0x229)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x1cf3b5(0x23a)&&args[i+0x1]&&(flags[a0_0x1cf3b5(0x21d)]=args[i+0x1]);}const port=flags[a0_0x1cf3b5(0x229)]||DEFAULT_PORT,host=flags[a0_0x1cf3b5(0x21d)]||DEFAULT_HOST,serverUrl=a0_0x1cf3b5(0x232)+host+':'+port;if(flags[a0_0x1cf3b5(0x22e)]){const pkgPath=join(__dirname,'..',a0_0x1cf3b5(0x238)),pkg=JSON[a0_0x1cf3b5(0x1f9)](readFileSync(pkgPath,a0_0x1cf3b5(0x20b)));console['log']('Loxia\x20Autopilot\x20One\x20v'+pkg[a0_0x1cf3b5(0x22e)]),process[a0_0x1cf3b5(0x1fa)](0x0);}if(flags[a0_0x1cf3b5(0x203)]||!command){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON['parse'](readFileSync(pkgPath,'utf8'));console[a0_0x1cf3b5(0x20a)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x1cf3b5(0x22e)]+'\x20-\x20AI\x20Agent\x20System\x0a\x0aUsage:\x0a\x20\x20loxia\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20+\x20open\x20Web\x20UI\x20in\x20browser\x0a\x20\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20Start\x20Terminal\x20UI\x20(server\x20must\x20be\x20running)\x0a\x20\x20plus-web\x20\x20\x20\x20\x20\x20\x20\x20Alias\x20for\x20\x27web\x27\x0a\x20\x20plus-terminal\x20\x20\x20Start\x20server\x20+\x20Terminal\x20UI\x20together\x0a\x0aOptions:\x0a\x20\x20--port\x20<number>\x20\x20\x20Specify\x20port\x20(default:\x20'+DEFAULT_PORT+a0_0x1cf3b5(0x211)+DEFAULT_HOST+a0_0x1cf3b5(0x1f5)),process['exit'](0x0);}async function checkServerRunning(_0x1ee160,_0xa1e672,_0x4dac60=0x1){for(let _0x4620e9=0x0;_0x4620e9<_0x4dac60;_0x4620e9++){const _0x1bd8ba=await new Promise(_0x3afe98=>{const _0x49d120=a0_0x427f,_0x26671f=a0_0x56f43f[_0x49d120(0x202)](_0x49d120(0x232)+_0x1ee160+':'+_0xa1e672+_0x49d120(0x205),_0x5474e3=>{const _0xdb4741=_0x49d120;_0x3afe98(_0x5474e3[_0xdb4741(0x230)]===0xc8);});_0x26671f['on'](_0x49d120(0x237),()=>_0x3afe98(![])),_0x26671f[_0x49d120(0x231)](0x7d0,()=>{const _0x7e8e0d=_0x49d120;_0x26671f[_0x7e8e0d(0x207)](),_0x3afe98(![]);});});if(_0x1bd8ba)return!![];_0x4620e9<_0x4dac60-0x1&&await new Promise(_0x91950f=>setTimeout(_0x91950f,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x4b5f1d,_0x205ea7,_0x2a4325=SERVER_STARTUP_TIMEOUT){const _0x40a0fb=Math['ceil'](_0x2a4325/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x4b5f1d,_0x205ea7,_0x40a0fb);}function openBrowser(_0x3a61ee){const _0x1898bd=a0_0x1cf3b5,_0x47c2fe=process[_0x1898bd(0x225)];let _0x19a3e7;if(_0x47c2fe===_0x1898bd(0x20d))_0x19a3e7=_0x1898bd(0x200)+_0x3a61ee+'\x22';else _0x47c2fe===_0x1898bd(0x1fd)?_0x19a3e7='start\x20\x22\x22\x20\x22'+_0x3a61ee+'\x22':_0x19a3e7=_0x1898bd(0x22f)+_0x3a61ee+'\x22';exec(_0x19a3e7,_0x47235d=>{const _0x17d41e=_0x1898bd;_0x47235d&&(console['log'](_0x17d41e(0x209)),console[_0x17d41e(0x20a)](_0x17d41e(0x208)+_0x3a61ee));});}function startServer(_0x3a06c5=![]){const _0x1f13d=a0_0x1cf3b5,_0x8ad2b8={...process[_0x1f13d(0x216)],'LOXIA_PORT':port[_0x1f13d(0x235)](),'PORT':port[_0x1f13d(0x235)]()};flags[_0x1f13d(0x21d)]&&(_0x8ad2b8[_0x1f13d(0x22b)]=flags[_0x1f13d(0x21d)]);const _0x23bb31=join(__dirname,'..',_0x1f13d(0x1fc),_0x1f13d(0x234)),_0xc11f2b=spawn(_0x1f13d(0x220),[_0x23bb31],{'cwd':join(__dirname,'..'),'env':_0x8ad2b8,'stdio':_0x3a06c5?[_0x1f13d(0x23b),'ignore','ignore']:_0x1f13d(0x226),'detached':_0x3a06c5});return _0x3a06c5&&_0xc11f2b['unref'](),_0xc11f2b;}function startTerminalUI(){const _0x1e120b=a0_0x1cf3b5,_0x462d77=join(__dirname,'loxia-terminal.js'),_0x43cf34={...process[_0x1e120b(0x216)],'LOXIA_PORT':port['toString'](),'LOXIA_HOST':host},_0x1488b2=spawn('node',[_0x462d77],{'cwd':join(__dirname,'..'),'env':_0x43cf34,'stdio':_0x1e120b(0x226)});return _0x1488b2;}const commands={'web':async()=>{const _0x671bb7=a0_0x1cf3b5;console[_0x671bb7(0x20a)]('Starting\x20Loxia\x20server...\x0a');const _0x78ff55=startServer(![]);console[_0x671bb7(0x20a)](_0x671bb7(0x206));const _0x1d6fd1=await waitForServer(host,port);_0x1d6fd1?(console[_0x671bb7(0x20a)]('\x0aOpening\x20Web\x20UI\x20at\x20'+serverUrl),openBrowser(serverUrl)):console[_0x671bb7(0x20a)](_0x671bb7(0x22c)+serverUrl+_0x671bb7(0x236)),process['on'](_0x671bb7(0x21c),()=>_0x78ff55['kill'](_0x671bb7(0x21c))),process['on'](_0x671bb7(0x21f),()=>_0x78ff55[_0x671bb7(0x20f)]('SIGTERM')),_0x78ff55['on'](_0x671bb7(0x1fa),_0x5c6727=>process['exit'](_0x5c6727||0x0));},'plus-web':async()=>{const _0x43b846=a0_0x1cf3b5;await commands[_0x43b846(0x21a)]();},'terminal':async()=>{const _0x4c2f50=a0_0x1cf3b5;console[_0x4c2f50(0x20a)](_0x4c2f50(0x215));const _0x2d9bbf=await checkServerRunning(host,port);!_0x2d9bbf&&(console['error'](_0x4c2f50(0x22d)+serverUrl),console[_0x4c2f50(0x237)](_0x4c2f50(0x1f6)),console[_0x4c2f50(0x237)](_0x4c2f50(0x1fb)),console[_0x4c2f50(0x237)](_0x4c2f50(0x212)),process[_0x4c2f50(0x1fa)](0x1));console[_0x4c2f50(0x20a)](_0x4c2f50(0x21b)+serverUrl),console[_0x4c2f50(0x20a)](_0x4c2f50(0x233));const _0x4c688a=startTerminalUI();process['on']('SIGINT',()=>_0x4c688a['kill'](_0x4c2f50(0x21c))),process['on'](_0x4c2f50(0x21f),()=>_0x4c688a[_0x4c2f50(0x20f)](_0x4c2f50(0x21f))),_0x4c688a['on'](_0x4c2f50(0x1fa),_0xc23a12=>process['exit'](_0xc23a12||0x0));},'plus-terminal':async()=>{const _0x332f3b=a0_0x1cf3b5;console[_0x332f3b(0x20a)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x38b33b=startServer(!![]),_0x4f3f5e=await waitForServer(host,port);!_0x4f3f5e&&(console[_0x332f3b(0x237)](_0x332f3b(0x20c)),process[_0x332f3b(0x1fa)](0x1));console[_0x332f3b(0x20a)]('Server\x20running\x20at\x20'+serverUrl),console[_0x332f3b(0x20a)](_0x332f3b(0x233));const _0x16d2c2=startTerminalUI();_0x16d2c2['on'](_0x332f3b(0x1fa),_0xf48d5=>{const _0x57a3f1=_0x332f3b;console[_0x57a3f1(0x20a)](_0x57a3f1(0x22a));try{process['kill'](_0x38b33b[_0x57a3f1(0x204)],_0x57a3f1(0x21f));}catch(_0x3105e9){}process[_0x57a3f1(0x1fa)](_0xf48d5||0x0);}),process['on'](_0x332f3b(0x21c),()=>{_0x16d2c2['kill']('SIGINT');}),process['on']('SIGTERM',()=>{const _0x1cd371=_0x332f3b;_0x16d2c2['kill'](_0x1cd371(0x21f));});}};commands[command]?commands[command]()[a0_0x1cf3b5(0x239)](_0x1d8285=>{const _0x200c92=a0_0x1cf3b5;console[_0x200c92(0x237)](_0x200c92(0x21e),_0x1d8285['message']),process['exit'](0x1);}):(console['error'](a0_0x1cf3b5(0x217)+command),console[a0_0x1cf3b5(0x237)](a0_0x1cf3b5(0x1f4)),process['exit'](0x1));
|
|
3
|
+
const a0_0x121421=a0_0x533d;(function(_0x2bd853,_0x4dd01d){const _0x17aba0=a0_0x533d,_0x5da70f=_0x2bd853();while(!![]){try{const _0x5074cb=-parseInt(_0x17aba0(0xb3))/0x1+-parseInt(_0x17aba0(0x98))/0x2+-parseInt(_0x17aba0(0x9c))/0x3+-parseInt(_0x17aba0(0xa5))/0x4*(parseInt(_0x17aba0(0xb1))/0x5)+parseInt(_0x17aba0(0xaa))/0x6+-parseInt(_0x17aba0(0xc0))/0x7*(parseInt(_0x17aba0(0x8b))/0x8)+-parseInt(_0x17aba0(0xc3))/0x9*(-parseInt(_0x17aba0(0x95))/0xa);if(_0x5074cb===_0x4dd01d)break;else _0x5da70f['push'](_0x5da70f['shift']());}catch(_0x3a9de5){_0x5da70f['push'](_0x5da70f['shift']());}}}(a0_0x2668,0x5f60d));import{fileURLToPath}from'url';function a0_0x2668(){const _0x470a03=['1185050tECZhJ','Please\x20open\x20manually:\x20','startsWith','win32','2302812CbhFql','ignore','Loxia\x20Autopilot\x20One\x20v','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','log','port','kill','Waiting\x20for\x20server\x20to\x20start...','Checking\x20if\x20server\x20is\x20running...','523372yGTqcJ','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','version','SIGINT','destroy','3766686OpIvmg','env','argv','exit','xdg-open\x20\x22','length','ceil','15nFKBKP','utf8','237655hEvvBr','Error:','\x0aOpening\x20Web\x20UI\x20at\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','localhost','Server\x20is\x20running\x20at\x20','start\x20\x22\x22\x20\x22','Starting\x20Loxia\x20server...\x0a','pid','parse','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','includes','setTimeout','497469RUsaeC','--host','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','414awqIjQ','help',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','darwin','Starting\x20Loxia\x20server\x20in\x20background...','toString','loxia-terminal.js','unref','\x0aPlease\x20start\x20the\x20server\x20first:','catch','Starting\x20Terminal\x20UI...\x0a','8MFkhWt','inherit','SIGTERM','host',')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Connect\x20Terminal\x20UI\x20to\x20running\x20server\x0a\x20\x20loxia\x20plus-terminal\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a\x20\x20loxia\x20web\x20--port\x203000\x20\x20\x20\x20#\x20Use\x20custom\x20port\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Run\x20\x27loxia\x20web\x27\x20to\x20start\x20with\x20Web\x20UI\x0a\x20\x202.\x20Or\x20run\x20\x27loxia\x20plus-terminal\x27\x20for\x20Terminal\x20UI\x20experience\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a','--version','\x0aShutting\x20down\x20server...','error','\x20manually.','--help','396580cTKqyb','package.json','\x20-\x20AI\x20Agent\x20System\x0a\x0aUsage:\x0a\x20\x20loxia\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20+\x20open\x20Web\x20UI\x20in\x20browser\x0a\x20\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20Start\x20Terminal\x20UI\x20(server\x20must\x20be\x20running)\x0a\x20\x20plus-web\x20\x20\x20\x20\x20\x20\x20\x20Alias\x20for\x20\x27web\x27\x0a\x20\x20plus-terminal\x20\x20\x20Start\x20server\x20+\x20Terminal\x20UI\x20together\x0a\x0aOptions:\x0a\x20\x20--port\x20<number>\x20\x20\x20Specify\x20port\x20(default:\x20'];a0_0x2668=function(){return _0x470a03;};return a0_0x2668();}import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x1805c9 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x121421(0xb7),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x121421(0xac)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x121421(0x9a)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x121421(0xbe)](a0_0x121421(0x94))||args[a0_0x121421(0xbe)]('-h'),'version':args[a0_0x121421(0xbe)](a0_0x121421(0x90))||args[a0_0x121421(0xbe)]('-v')};for(let i=0x0;i<args[a0_0x121421(0xaf)];i++){args[i]==='--port'&&args[i+0x1]&&(flags[a0_0x121421(0xa1)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x121421(0xc1)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}function a0_0x533d(_0x4a6df9,_0xe35a22){_0x4a6df9=_0x4a6df9-0x83;const _0x2668df=a0_0x2668();let _0x533d7f=_0x2668df[_0x4a6df9];return _0x533d7f;}const port=flags[a0_0x121421(0xa1)]||DEFAULT_PORT,host=flags[a0_0x121421(0x8e)]||DEFAULT_HOST,serverUrl='http://'+host+':'+port;if(flags[a0_0x121421(0xa7)]){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x121421(0xbc)](readFileSync(pkgPath,a0_0x121421(0xb2)));console['log'](a0_0x121421(0x9e)+pkg[a0_0x121421(0xa7)]),process['exit'](0x0);}if(flags[a0_0x121421(0xc4)]||!command){const pkgPath=join(__dirname,'..',a0_0x121421(0x96)),pkg=JSON[a0_0x121421(0xbc)](readFileSync(pkgPath,a0_0x121421(0xb2)));console[a0_0x121421(0xa0)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x121421(0xa7)]+a0_0x121421(0x97)+DEFAULT_PORT+a0_0x121421(0xc5)+DEFAULT_HOST+a0_0x121421(0x8f)),process[a0_0x121421(0xad)](0x0);}async function checkServerRunning(_0xafbbc9,_0x290101,_0x3bad71=0x1){for(let _0x4eb6ea=0x0;_0x4eb6ea<_0x3bad71;_0x4eb6ea++){const _0x4f5050=await new Promise(_0x66b4f1=>{const _0x4fbbdb=a0_0x533d,_0x50ffbb=a0_0x1805c9['get']('http://'+_0xafbbc9+':'+_0x290101+'/api/health',_0x27b858=>{_0x66b4f1(_0x27b858['statusCode']===0xc8);});_0x50ffbb['on'](_0x4fbbdb(0x92),()=>_0x66b4f1(![])),_0x50ffbb[_0x4fbbdb(0xbf)](0x7d0,()=>{const _0xb1b894=_0x4fbbdb;_0x50ffbb[_0xb1b894(0xa9)](),_0x66b4f1(![]);});});if(_0x4f5050)return!![];_0x4eb6ea<_0x3bad71-0x1&&await new Promise(_0x137aa6=>setTimeout(_0x137aa6,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x1b6be9,_0x3c27b2,_0x361439=SERVER_STARTUP_TIMEOUT){const _0xa02673=a0_0x121421,_0x477994=Math[_0xa02673(0xb0)](_0x361439/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x1b6be9,_0x3c27b2,_0x477994);}function openBrowser(_0x3becef){const _0x5c299d=a0_0x121421,_0x15ec12=process['platform'];let _0x928030;if(_0x15ec12===_0x5c299d(0x83))_0x928030='open\x20\x22'+_0x3becef+'\x22';else _0x15ec12===_0x5c299d(0x9b)?_0x928030=_0x5c299d(0xb9)+_0x3becef+'\x22':_0x928030=_0x5c299d(0xae)+_0x3becef+'\x22';exec(_0x928030,_0x414f50=>{const _0x120875=_0x5c299d;_0x414f50&&(console[_0x120875(0xa0)]('Could\x20not\x20open\x20browser\x20automatically.'),console['log'](_0x120875(0x99)+_0x3becef));});}function startServer(_0x208e3e=![]){const _0x4ac1e2=a0_0x121421,_0x40f758={...process[_0x4ac1e2(0xab)],'LOXIA_PORT':port[_0x4ac1e2(0x85)](),'PORT':port[_0x4ac1e2(0x85)]()};flags[_0x4ac1e2(0x8e)]&&(_0x40f758['LOXIA_HOST']=flags['host']);const _0x516cc5=join(__dirname,'..','src','index.js'),_0x238ee3=spawn('node',[_0x516cc5],{'cwd':join(__dirname,'..'),'env':_0x40f758,'stdio':_0x208e3e?[_0x4ac1e2(0x9d),_0x4ac1e2(0x9d),_0x4ac1e2(0x9d)]:_0x4ac1e2(0x8c),'detached':_0x208e3e});return _0x208e3e&&_0x238ee3[_0x4ac1e2(0x87)](),_0x238ee3;}function startTerminalUI(){const _0x53012=a0_0x121421,_0x25735f=join(__dirname,_0x53012(0x86)),_0x4960c7={...process[_0x53012(0xab)],'LOXIA_PORT':port['toString'](),'LOXIA_HOST':host},_0x20a1d1=spawn('node',[_0x25735f],{'cwd':join(__dirname,'..'),'env':_0x4960c7,'stdio':_0x53012(0x8c)});return _0x20a1d1;}const commands={'web':async()=>{const _0x2003c0=a0_0x121421;console['log'](_0x2003c0(0xba));const _0x49917b=startServer(![]);console[_0x2003c0(0xa0)](_0x2003c0(0xa3));const _0x47f7a0=await waitForServer(host,port);_0x47f7a0?(console[_0x2003c0(0xa0)](_0x2003c0(0xb5)+serverUrl),openBrowser(serverUrl)):console[_0x2003c0(0xa0)](_0x2003c0(0xc2)+serverUrl+_0x2003c0(0x93)),process['on'](_0x2003c0(0xa8),()=>_0x49917b[_0x2003c0(0xa2)](_0x2003c0(0xa8))),process['on'](_0x2003c0(0x8d),()=>_0x49917b['kill']('SIGTERM')),_0x49917b['on'](_0x2003c0(0xad),_0x42ab96=>process[_0x2003c0(0xad)](_0x42ab96||0x0));},'plus-web':async()=>{await commands['web']();},'terminal':async()=>{const _0x2777bb=a0_0x121421;console[_0x2777bb(0xa0)](_0x2777bb(0xa4));const _0x55448d=await checkServerRunning(host,port);!_0x55448d&&(console[_0x2777bb(0x92)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console[_0x2777bb(0x92)](_0x2777bb(0x88)),console['error'](_0x2777bb(0xa6)),console[_0x2777bb(0x92)](_0x2777bb(0xbd)),process[_0x2777bb(0xad)](0x1));console['log'](_0x2777bb(0xb8)+serverUrl),console[_0x2777bb(0xa0)](_0x2777bb(0x8a));const _0x103323=startTerminalUI();process['on']('SIGINT',()=>_0x103323[_0x2777bb(0xa2)]('SIGINT')),process['on'](_0x2777bb(0x8d),()=>_0x103323['kill'](_0x2777bb(0x8d))),_0x103323['on']('exit',_0x41590f=>process[_0x2777bb(0xad)](_0x41590f||0x0));},'plus-terminal':async()=>{const _0x28492d=a0_0x121421;console[_0x28492d(0xa0)](_0x28492d(0x84));const _0x51140a=startServer(!![]),_0x5727db=await waitForServer(host,port);!_0x5727db&&(console[_0x28492d(0x92)](_0x28492d(0x9f)),process[_0x28492d(0xad)](0x1));console[_0x28492d(0xa0)]('Server\x20running\x20at\x20'+serverUrl),console[_0x28492d(0xa0)](_0x28492d(0x8a));const _0x2e1c83=startTerminalUI();_0x2e1c83['on']('exit',_0x494a7c=>{const _0x208c18=_0x28492d;console[_0x208c18(0xa0)](_0x208c18(0x91));try{process['kill'](_0x51140a[_0x208c18(0xbb)],'SIGTERM');}catch(_0x57f5da){}process[_0x208c18(0xad)](_0x494a7c||0x0);}),process['on'](_0x28492d(0xa8),()=>{const _0x4c3a1f=_0x28492d;_0x2e1c83['kill'](_0x4c3a1f(0xa8));}),process['on'](_0x28492d(0x8d),()=>{const _0x30b9db=_0x28492d;_0x2e1c83['kill'](_0x30b9db(0x8d));});}};commands[command]?commands[command]()[a0_0x121421(0x89)](_0x154dcb=>{const _0x4b3af7=a0_0x121421;console['error'](_0x4b3af7(0xb4),_0x154dcb['message']),process[_0x4b3af7(0xad)](0x1);}):(console[a0_0x121421(0x92)]('Unknown\x20command:\x20'+command),console[a0_0x121421(0x92)](a0_0x121421(0xb6)),process[a0_0x121421(0xad)](0x1));
|
package/bin/loxia-terminal-v2.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function a0_0x586c(_0x55c1e0,_0x393858){_0x55c1e0=_0x55c1e0-0xcd;const _0x384c04=a0_0x384c();let _0x586cb5=_0x384c04[_0x55c1e0];return _0x586cb5;}const a0_0x1ce17a=a0_0x586c;function a0_0x384c(){const _0x387b44=['web','923840PxkKiv','length','✗\x20Server\x20is\x20not\x20running','LOXIA_HOST','321UmhLMs','connect','data','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','exit','now','106393XmYYwn','--ui','LOXIA_PORT','Failed\x20to\x20start\x20server:','🚀\x20Starting\x20Loxia\x20server...','env','destroy','7GoQHyq','💡\x20Troubleshooting:','545940ePPZkj','slice','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','error','✓\x20Server\x20started\x20at\x20','localhost','pipe','1737012WVmpWT','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','--port','toString','--host','5960448JScaaS','1818vvODZb','message','stderr','log','setTimeout','../src/interfaces/terminal/index.js','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','bin/cli.js','timeout','Socket','1186520cVclpi','kill'];a0_0x384c=function(){return _0x387b44;};return a0_0x384c();}(function(_0x319fc1,_0x3484c7){const _0x4a8c21=a0_0x586c,_0x138553=_0x319fc1();while(!![]){try{const _0x5aaad8=-parseInt(_0x4a8c21(0xd0))/0x1+-parseInt(_0x4a8c21(0xe8))/0x2*(parseInt(_0x4a8c21(0xfa))/0x3)+-parseInt(_0x4a8c21(0xd9))/0x4+parseInt(_0x4a8c21(0xf3))/0x5+-parseInt(_0x4a8c21(0xe1))/0x6+parseInt(_0x4a8c21(0xd7))/0x7*(-parseInt(_0x4a8c21(0xf6))/0x8)+parseInt(_0x4a8c21(0xe7))/0x9;if(_0x5aaad8===_0x3484c7)break;else _0x138553['push'](_0x138553['shift']());}catch(_0x42d6ac){_0x138553['push'](_0x138553['shift']());}}}(a0_0x384c,0x25b55));import{spawn}from'child_process';import a0_0x56009c from'net';import a0_0x8da3fc from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x8da3fc['dirname'](__filename),projectRoot=a0_0x8da3fc['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x1ce17a(0xdf),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x3ed3ac,_0x5bb33a){return new Promise(_0x5d493e=>{const _0x3d0209=a0_0x586c,_0x22aada=new a0_0x56009c[(_0x3d0209(0xf2))]();_0x22aada[_0x3d0209(0xec)](0x7d0),_0x22aada['on']('connect',()=>{const _0xe5e5cb=_0x3d0209;_0x22aada[_0xe5e5cb(0xd6)](),_0x5d493e(!![]);}),_0x22aada['on'](_0x3d0209(0xf1),()=>{const _0x23f15a=_0x3d0209;_0x22aada[_0x23f15a(0xd6)](),_0x5d493e(![]);}),_0x22aada['on'](_0x3d0209(0xdd),()=>{const _0x47e350=_0x3d0209;_0x22aada[_0x47e350(0xd6)](),_0x5d493e(![]);}),_0x22aada[_0x3d0209(0xfb)](_0x5bb33a,_0x3ed3ac);});}async function startServer(_0x363ae3,_0x529456){const _0x15dd02=a0_0x1ce17a;return console['log'](_0x15dd02(0xd4)),new Promise((_0x362c2c,_0x2375a4)=>{const _0x1bece5=_0x15dd02,_0x5c9b29=spawn('node',[a0_0x8da3fc['join'](projectRoot,_0x1bece5(0xf0)),_0x1bece5(0xd1),_0x1bece5(0xf5),_0x1bece5(0xe6),_0x363ae3,_0x1bece5(0xe4),_0x529456[_0x1bece5(0xe5)]()],{'detached':![],'stdio':['ignore',_0x1bece5(0xe0),'pipe']});_0x5c9b29['stdout']['on'](_0x1bece5(0xfc),()=>{}),_0x5c9b29[_0x1bece5(0xea)]['on']('data',()=>{}),_0x5c9b29['on'](_0x1bece5(0xdd),_0x5bc133=>{const _0x472b2b=_0x1bece5;console[_0x472b2b(0xdd)](_0x472b2b(0xd3),_0x5bc133[_0x472b2b(0xe9)]),_0x2375a4(_0x5bc133);});const _0xa7d85b=Date[_0x1bece5(0xcf)](),_0x2158b5=setInterval(async()=>{const _0x4d7fe7=_0x1bece5,_0x4c2a5e=await isServerRunning(_0x363ae3,_0x529456);if(_0x4c2a5e)clearInterval(_0x2158b5),console[_0x4d7fe7(0xeb)](_0x4d7fe7(0xde)+_0x363ae3+':'+_0x529456),_0x362c2c();else Date[_0x4d7fe7(0xcf)]()-_0xa7d85b>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x2158b5),_0x5c9b29[_0x4d7fe7(0xf4)](),_0x2375a4(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x2e2d35=a0_0x1ce17a;try{console['log'](_0x2e2d35(0xdb)),console[_0x2e2d35(0xeb)](_0x2e2d35(0xe3)),console[_0x2e2d35(0xeb)](_0x2e2d35(0xdb)),console[_0x2e2d35(0xeb)]('');const _0x276ae4=process['argv'][_0x2e2d35(0xda)](0x2);let _0x583436=DEFAULT_HOST,_0xbd1154=DEFAULT_PORT;for(let _0x57c852=0x0;_0x57c852<_0x276ae4[_0x2e2d35(0xf7)];_0x57c852++){if(_0x276ae4[_0x57c852]===_0x2e2d35(0xe6)&&_0x276ae4[_0x57c852+0x1])_0x583436=_0x276ae4[_0x57c852+0x1],_0x57c852++;else _0x276ae4[_0x57c852]===_0x2e2d35(0xe4)&&_0x276ae4[_0x57c852+0x1]&&(_0xbd1154=parseInt(_0x276ae4[_0x57c852+0x1],0xa),_0x57c852++);}console[_0x2e2d35(0xeb)](_0x2e2d35(0xe2)+_0x583436+':'+_0xbd1154+'...');const _0x3d1b58=await isServerRunning(_0x583436,_0xbd1154);!_0x3d1b58?(console['log'](_0x2e2d35(0xf8)),await startServer(_0x583436,_0xbd1154)):console['log']('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x583436+':'+_0xbd1154),console[_0x2e2d35(0xeb)](''),console[_0x2e2d35(0xeb)](_0x2e2d35(0xdc)),console['log'](''),await new Promise(_0x2495c1=>setTimeout(_0x2495c1,0x1f4)),process[_0x2e2d35(0xd5)][_0x2e2d35(0xf9)]=_0x583436,process[_0x2e2d35(0xd5)][_0x2e2d35(0xd2)]=_0xbd1154[_0x2e2d35(0xe5)](),await import(_0x2e2d35(0xed));}catch(_0x234179){console[_0x2e2d35(0xdd)](''),console[_0x2e2d35(0xdd)](_0x2e2d35(0xef)),console['error']('\x20\x20',_0x234179[_0x2e2d35(0xe9)]),console[_0x2e2d35(0xdd)](''),console['error'](_0x2e2d35(0xd8)),console['error']('\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'),console['error'](_0x2e2d35(0xee)),console[_0x2e2d35(0xdd)](_0x2e2d35(0xcd)),console[_0x2e2d35(0xdd)](''),process[_0x2e2d35(0xce)](0x1);}}main();
|
package/bin/loxia-terminal.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x2b9757=a0_0x3f10;(function(_0x35aaea,_0x2bbfd2){const _0x52c588=a0_0x3f10,_0x4eb66d=_0x35aaea();while(!![]){try{const _0x402c86=parseInt(_0x52c588(0x6f))/0x1+parseInt(_0x52c588(0x7e))/0x2+-parseInt(_0x52c588(0x75))/0x3+-parseInt(_0x52c588(0x81))/0x4*(parseInt(_0x52c588(0x7b))/0x5)+parseInt(_0x52c588(0x6b))/0x6+-parseInt(_0x52c588(0x68))/0x7*(-parseInt(_0x52c588(0x7d))/0x8)+parseInt(_0x52c588(0x8b))/0x9*(-parseInt(_0x52c588(0x89))/0xa);if(_0x402c86===_0x2bbfd2)break;else _0x4eb66d['push'](_0x4eb66d['shift']());}catch(_0x1883a8){_0x4eb66d['push'](_0x4eb66d['shift']());}}}(a0_0x3a0b,0xb3d4e));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x2b9757(0x6a)][a0_0x2b9757(0x80)](0x2),options={'host':a0_0x2b9757(0x6e),'port':0x1f90};function a0_0x3f10(_0x4d4e14,_0x25a38e){_0x4d4e14=_0x4d4e14-0x66;const _0x3a0bca=a0_0x3a0b();let _0x3f10b6=_0x3a0bca[_0x4d4e14];return _0x3f10b6;}for(let i=0x0;i<args[a0_0x2b9757(0x82)];i++){const arg=args[i];if(arg==='--host'||arg==='-h')options['host']=args[++i];else{if(arg===a0_0x2b9757(0x72)||arg==='-p')options[a0_0x2b9757(0x84)]=parseInt(args[++i],0xa);else arg===a0_0x2b9757(0x71)&&(console[a0_0x2b9757(0x7a)]('\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a'),process['exit'](0x0));}}process['env']['LOXIA_HOST']&&(options[a0_0x2b9757(0x88)]=process['env'][a0_0x2b9757(0x7f)]);process['env'][a0_0x2b9757(0x87)]&&(options[a0_0x2b9757(0x84)]=parseInt(process['env'][a0_0x2b9757(0x87)],0xa));!process[a0_0x2b9757(0x66)]['isTTY']&&(console[a0_0x2b9757(0x83)]('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x6d)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x70)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x78)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x76)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x6c)),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x67)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x73)),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x79)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x85)),process[a0_0x2b9757(0x77)](0x1));console[a0_0x2b9757(0x7a)](a0_0x2b9757(0x8a)),console['log']('Connecting\x20to:\x20'+options[a0_0x2b9757(0x88)]+':'+options[a0_0x2b9757(0x84)]),console[a0_0x2b9757(0x7a)](a0_0x2b9757(0x74));const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x2b9757(0x7c)](()=>{const _0x583d21=a0_0x2b9757;console[_0x583d21(0x7a)]('\x0aTerminal\x20UI\x20exited'),process[_0x583d21(0x77)](0x0);})[a0_0x2b9757(0x69)](_0x403f74=>{const _0x4dcfbc=a0_0x2b9757;console[_0x4dcfbc(0x83)](_0x4dcfbc(0x86),_0x403f74),process[_0x4dcfbc(0x77)](0x1);});function a0_0x3a0b(){const _0x2b7687=['localhost','1306195nsyJzK','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','--help','--port','\x20\x20npm\x20run\x20terminal-ui','Press\x20Ctrl+C\x20to\x20exit\x0a','965388uAeqJX','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','exit','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','Or\x20use\x20the\x20web\x20UI\x20instead:','log','48595sJFTyI','then','8yiuDwm','1784450fKHlle','LOXIA_HOST','slice','344yNKsDH','length','error','port','\x20\x20npm\x20start','\x0aTerminal\x20UI\x20error:','LOXIA_PORT','host','10BpgyER','Starting\x20Loxia\x20Terminal\x20UI...','24521661UBEnLz','stdin','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','7368977GMoSPb','catch','argv','8206308gzWwGm','\x20\x20-\x20Some\x20CI/CD\x20environments','The\x20terminal\x20UI\x20cannot\x20run\x20in:'];a0_0x3a0b=function(){return _0x2b7687;};return a0_0x3a0b();}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
function a0_0x3952(){const _0x55ecc2=['SIGTERM','Failed\x20to\x20start\x20server:','29068yHCzRM','index.js','ignore','[SERVER\x20ERROR]\x20','33lvdJbS','setTimeout','2185365GWsKov','8990802XnmXlv','env','message','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','Server\x20exited\x20with\x20code\x20','🛑\x20Stopping\x20server...','data','ExperimentalWarning','355npugqC','bin','stderr','http://localhost:','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','4693689bkEcpc','exit','2rRzHLq','loxia-terminal.js','Timeout','\x0a👋\x20Terminal\x20UI\x20closed.','trim','Server\x20returned\x20','8wWZwiY','16819420ISMjAe','SIGINT','includes','1729409hhpFTm','/health','pipe','2560365vshCjn','🖥️\x20\x20Starting\x20Terminal\x20UI...','log','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','error','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','killed','kill'];a0_0x3952=function(){return _0x55ecc2;};return a0_0x3952();}const a0_0x45e7e5=a0_0x459c;(function(_0x248636,_0x2f2f5e){const _0x2eb81e=a0_0x459c,_0x47e6d2=_0x248636();while(!![]){try{const _0x286478=-parseInt(_0x2eb81e(0x161))/0x1+-parseInt(_0x2eb81e(0x157))/0x2*(parseInt(_0x2eb81e(0x147))/0x3)+parseInt(_0x2eb81e(0x141))/0x4*(-parseInt(_0x2eb81e(0x150))/0x5)+-parseInt(_0x2eb81e(0x148))/0x6+parseInt(_0x2eb81e(0x155))/0x7+parseInt(_0x2eb81e(0x15d))/0x8*(-parseInt(_0x2eb81e(0x137))/0x9)+-parseInt(_0x2eb81e(0x15e))/0xa*(-parseInt(_0x2eb81e(0x145))/0xb);if(_0x286478===_0x2f2f5e)break;else _0x47e6d2['push'](_0x47e6d2['shift']());}catch(_0x27dd46){_0x47e6d2['push'](_0x47e6d2['shift']());}}}(a0_0x3952,0xea45c));import{spawn}from'child_process';function a0_0x459c(_0x37790d,_0x5b1559){_0x37790d=_0x37790d-0x136;const _0x39522b=a0_0x3952();let _0x459c31=_0x39522b[_0x37790d];return _0x459c31;}import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x23887b from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env']['PORT']||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0xe6ac7c=0xa,_0x598143=0x1f4){const _0x255d4f=a0_0x459c;for(let _0x87576c=0x0;_0x87576c<_0xe6ac7c;_0x87576c++){try{return await new Promise((_0x499cc7,_0x5dbb07)=>{const _0x2861c8=a0_0x459c,_0x58f245=a0_0x23887b['get'](_0x2861c8(0x153)+SERVER_PORT+_0x2861c8(0x162),_0x1b5b56=>{const _0x577292=_0x2861c8;_0x1b5b56['statusCode']===0xc8?_0x499cc7():_0x5dbb07(new Error(_0x577292(0x15c)+_0x1b5b56['statusCode']));});_0x58f245['on'](_0x2861c8(0x13b),_0x5dbb07),_0x58f245[_0x2861c8(0x146)](0x3e8,()=>{const _0x4ba0e8=_0x2861c8;_0x58f245['destroy'](),_0x5dbb07(new Error(_0x4ba0e8(0x159)));});}),console[_0x255d4f(0x139)]('✅\x20Server\x20is\x20ready!'),!![];}catch(_0x3438a3){_0x87576c<_0xe6ac7c-0x1&&await new Promise(_0x4c3590=>setTimeout(_0x4c3590,_0x598143));}}return console[_0x255d4f(0x139)](_0x255d4f(0x13a)),![];}async function startServer(){return new Promise(_0x4a31af=>{const _0x4c7172=a0_0x459c;console[_0x4c7172(0x139)]('🚀\x20Starting\x20Loxia\x20server...');const _0x17f61f=join(rootDir,'src',_0x4c7172(0x142));serverProcess=spawn('node',[_0x17f61f],{'cwd':rootDir,'env':{...process['env']},'stdio':[_0x4c7172(0x143),_0x4c7172(0x136),'pipe'],'detached':![]}),serverProcess['stdout']['on'](_0x4c7172(0x14e),_0x6efd4b=>{const _0x57d7c7=_0x4c7172,_0x423a1b=_0x6efd4b['toString']()[_0x57d7c7(0x15b)]();_0x423a1b&&console['log']('[SERVER]\x20'+_0x423a1b);}),serverProcess[_0x4c7172(0x152)]['on'](_0x4c7172(0x14e),_0x2c2636=>{const _0x7cfb0c=_0x4c7172,_0x44588f=_0x2c2636['toString']()[_0x7cfb0c(0x15b)]();_0x44588f&&!_0x44588f[_0x7cfb0c(0x160)](_0x7cfb0c(0x14f))&&console[_0x7cfb0c(0x13b)](_0x7cfb0c(0x144)+_0x44588f);}),serverProcess['on'](_0x4c7172(0x13b),_0x436f53=>{const _0x5698c0=_0x4c7172;console['error'](_0x5698c0(0x140),_0x436f53[_0x5698c0(0x14a)]),process[_0x5698c0(0x156)](0x1);}),serverProcess['on'](_0x4c7172(0x156),(_0x36cca4,_0x5d72e8)=>{const _0x3e2120=_0x4c7172;_0x36cca4!==null&&_0x36cca4!==0x0&&(console[_0x3e2120(0x13b)](_0x3e2120(0x14c)+_0x36cca4),process[_0x3e2120(0x156)](_0x36cca4));}),setTimeout(_0x4a31af,STARTUP_WAIT);});}async function startTerminalUI(){const _0x5a04e8=a0_0x459c;console[_0x5a04e8(0x139)](_0x5a04e8(0x138)),console['log']('');const _0xbf3853=join(rootDir,_0x5a04e8(0x151),_0x5a04e8(0x158)),_0x895476=spawn('node',[_0xbf3853],{'cwd':rootDir,'env':{...process[_0x5a04e8(0x149)]},'stdio':'inherit'});return _0x895476['on'](_0x5a04e8(0x13b),_0x37f25d=>{const _0x464584=_0x5a04e8;console['error']('Failed\x20to\x20start\x20Terminal\x20UI:',_0x37f25d['message']),cleanup(),process[_0x464584(0x156)](0x1);}),_0x895476['on'](_0x5a04e8(0x156),_0x59c5ff=>{const _0x4ecc30=_0x5a04e8;console[_0x4ecc30(0x139)](_0x4ecc30(0x15a)),cleanup(),process[_0x4ecc30(0x156)](_0x59c5ff||0x0);}),_0x895476;}function cleanup(){const _0xea2580=a0_0x459c;serverProcess&&!serverProcess[_0xea2580(0x13d)]&&(console['log'](_0xea2580(0x14d)),serverProcess[_0xea2580(0x13e)](_0xea2580(0x13f)),setTimeout(()=>{const _0x482447=_0xea2580;!serverProcess[_0x482447(0x13d)]&&serverProcess[_0x482447(0x13e)]('SIGKILL');},0x1388));}process['on'](a0_0x45e7e5(0x15f),()=>{const _0x3cb839=a0_0x45e7e5;console['log'](_0x3cb839(0x14b)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x45e7e5(0x13f),()=>{const _0xdb5229=a0_0x45e7e5;console[_0xdb5229(0x139)](_0xdb5229(0x13c)),cleanup(),process[_0xdb5229(0x156)](0x0);}),process['on'](a0_0x45e7e5(0x156),()=>{cleanup();});async function main(){const _0x32d8af=a0_0x45e7e5;console[_0x32d8af(0x139)]('╔════════════════════════════════════════════════╗'),console['log'](_0x32d8af(0x154)),console[_0x32d8af(0x139)]('╚════════════════════════════════════════════════╝'),console[_0x32d8af(0x139)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x49f2a7){console[_0x32d8af(0x13b)]('Error\x20during\x20startup:',_0x49f2a7[_0x32d8af(0x14a)]),cleanup(),process[_0x32d8af(0x156)](0x1);}}main();
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x245eb1=a0_0x4569;(function(_0x336276,_0x1cbed4){const _0x328552=a0_0x4569,_0x56c623=_0x336276();while(!![]){try{const _0xabc068=parseInt(_0x328552(0x1e0))/0x1*(-parseInt(_0x328552(0x21a))/0x2)+-parseInt(_0x328552(0x20a))/0x3+-parseInt(_0x328552(0x1f7))/0x4*(-parseInt(_0x328552(0x1df))/0x5)+parseInt(_0x328552(0x201))/0x6+-parseInt(_0x328552(0x1fb))/0x7+-parseInt(_0x328552(0x1d7))/0x8*(-parseInt(_0x328552(0x1eb))/0x9)+parseInt(_0x328552(0x1fd))/0xa*(parseInt(_0x328552(0x1f9))/0xb);if(_0xabc068===_0x1cbed4)break;else _0x56c623['push'](_0x56c623['shift']());}catch(_0x36d040){_0x56c623['push'](_0x56c623['shift']());}}}(a0_0x5a5f,0x36e2f));import{exec}from'child_process';import{promisify}from'util';import a0_0x684c96 from'https';import a0_0x293a9c from'http';import a0_0xafba44 from'fs';import a0_0x5e48e2 from'path';import{fileURLToPath}from'url';import{createWriteStream}from'fs';import{pipeline}from'stream/promises';const execAsync=promisify(exec),__filename=fileURLToPath(import.meta.url),__dirname=a0_0x5e48e2['dirname'](__filename),SCANNER_DIR=a0_0x5e48e2['join'](__dirname,'..','node_modules',a0_0x245eb1(0x202)),SEMGREP_VERSION=a0_0x245eb1(0x1da);console[a0_0x245eb1(0x1f8)]('═══════════════════════════════════════════════════════════'),console[a0_0x245eb1(0x1f8)](a0_0x245eb1(0x1f0)),console[a0_0x245eb1(0x1f8)](a0_0x245eb1(0x1f4));function a0_0x5a5f(){const _0x3479f0=['\x0a═══════════════════════════════════════════════════════════','\x20\x20Installing\x20Security\x20Scanners','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','headers','promises','═══════════════════════════════════════════════════════════\x0a','...','\x20\x20\x20✅\x20Python\x20found:\x20','1088316EOoBsl','log','23727KnHXyj','python3','1829562xIAjlI','\x0aYou\x20can\x20manually\x20install\x20scanners:','910pCMztT','\x20\x20Installation\x20Complete','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','catch','534408cpxJGO','.scanners','message','then','🔍\x20Installing\x20Semgrep...','semgrep','url','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','🐍\x20Checking\x20Python\x20scanners...','1302147QgxMrX','semgrep\x20--version','unlink','python\x20--version','❌\x20Installation\x20failed:','eslint-plugin-security','pipe','error','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','bandit','get','\x20\x20\x20Installing\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','arch','2802VEGsGg','join','24ZjMmSW','checkov','Failed\x20to\x20download:\x20HTTP\x20','v1.55.0','\x20-m\x20pip\x20show\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','finish','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','5hhoKTR','54auPlda','statusCode','location','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','trim','\x20\x20\x20Downloading\x20from\x20','startsWith','chmod','close','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','1315350GSfPEd','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20\x20\x20✅\x20'];a0_0x5a5f=function(){return _0x3479f0;};return a0_0x5a5f();}async function installScanners(){const _0xd781c7=a0_0x245eb1;await a0_0xafba44[_0xd781c7(0x1f3)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0xd781c7(0x1f8)](_0xd781c7(0x1ef)),console[_0xd781c7(0x1f8)](_0xd781c7(0x1fe)),console[_0xd781c7(0x1f8)](_0xd781c7(0x1f4));}async function checkESLintSecurity(){const _0x53a808=a0_0x245eb1;console[_0x53a808(0x1f8)](_0x53a808(0x208));try{await import(_0x53a808(0x20f)),console[_0x53a808(0x1f8)](_0x53a808(0x212));}catch(_0x8c7edd){console['log'](_0x53a808(0x1e3)),console[_0x53a808(0x1f8)]('\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a');}}async function installSemgrep(){const _0x1f2b87=a0_0x245eb1;console[_0x1f2b87(0x1f8)](_0x1f2b87(0x205));const _0x35602d=process['platform'],_0x289444=process[_0x1f2b87(0x219)];try{const _0x370418=await execAsync(_0x1f2b87(0x20b),{'timeout':0x1388});console['log']('\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20'+_0x370418['stdout'][_0x1f2b87(0x1e4)]()),console['log'](_0x1f2b87(0x218));return;}catch(_0x5dcf04){console['log'](_0x1f2b87(0x1ea));}const _0x5c49bf=getSemgrepBinaryInfo(_0x35602d,_0x289444);if(!_0x5c49bf){console[_0x1f2b87(0x1f8)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x35602d+'-'+_0x289444),console[_0x1f2b87(0x1f8)]('\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a');return;}try{const _0x36003c=a0_0x5e48e2[_0x1f2b87(0x1d6)](SCANNER_DIR,'semgrep');console['log'](_0x1f2b87(0x1e5)+_0x5c49bf[_0x1f2b87(0x207)]+'...'),await downloadFile(_0x5c49bf['url'],_0x36003c),await a0_0xafba44[_0x1f2b87(0x1f3)][_0x1f2b87(0x1e7)](_0x36003c,0x1ed),console['log']('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x1f2b87(0x1f8)]('\x20\x20\x20Location:\x20'+_0x36003c+'\x0a'),console[_0x1f2b87(0x1f8)](_0x1f2b87(0x1de)),console[_0x1f2b87(0x1f8)]('\x20\x20\x20pip\x20install\x20semgrep\x0a');}catch(_0x533a91){console[_0x1f2b87(0x1f8)](_0x1f2b87(0x216)+_0x533a91[_0x1f2b87(0x203)]),console['log']('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function a0_0x4569(_0x48d950,_0x3222f7){_0x48d950=_0x48d950-0x1d6;const _0x5a5f01=a0_0x5a5f();let _0x456938=_0x5a5f01[_0x48d950];return _0x456938;}function getSemgrepBinaryInfo(_0x3194ca,_0x2f180a){return null;}async function installPythonScanners(){const _0x4ef95c=a0_0x245eb1;console['log'](_0x4ef95c(0x209));let _0x396cb4=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x396cb4=_0x4ef95c(0x1fa);}catch(_0x27dd2b){try{await execAsync(_0x4ef95c(0x20d),{'timeout':0x1388}),_0x396cb4='python';}catch(_0x3a21dc){console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1f1)),console[_0x4ef95c(0x1f8)](_0x4ef95c(0x217)),console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1e9));return;}}console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1f6)+_0x396cb4),await installViaPip(_0x4ef95c(0x206),_0x396cb4),await installViaPip(_0x4ef95c(0x213),_0x396cb4),await installViaPip('pip-audit',_0x396cb4),await installViaPip(_0x4ef95c(0x1d8),_0x396cb4),await installViaPip('yamllint',_0x396cb4),console[_0x4ef95c(0x1f8)]('');}async function installViaPip(_0x51bb4e,_0x4cd793){const _0x49eeba=a0_0x245eb1;try{const _0x5aaad7=await execAsync(_0x4cd793+_0x49eeba(0x1db)+_0x51bb4e,{'timeout':0x1388});return console['log'](_0x49eeba(0x1ee)+_0x51bb4e+'\x20already\x20installed'),!![];}catch(_0x3360c5){console[_0x49eeba(0x1f8)](_0x49eeba(0x215)+_0x51bb4e+_0x49eeba(0x1f5));try{return await execAsync(_0x4cd793+'\x20-m\x20pip\x20install\x20--user\x20'+_0x51bb4e,{'timeout':0xea60}),console[_0x49eeba(0x1f8)](_0x49eeba(0x1ee)+_0x51bb4e+'\x20installed\x20successfully'),!![];}catch(_0x4b90e6){return console['log'](_0x49eeba(0x1dc)+_0x51bb4e+':\x20'+_0x4b90e6[_0x49eeba(0x203)]),console[_0x49eeba(0x1f8)](_0x49eeba(0x1ff)+_0x51bb4e),![];}}}async function downloadFile(_0x126a32,_0x4c79c6){return new Promise((_0x51d159,_0x35f267)=>{const _0x77eadc=a0_0x4569,_0xc96dc3=_0x126a32[_0x77eadc(0x1e6)]('https')?a0_0x684c96:a0_0x293a9c;_0xc96dc3[_0x77eadc(0x214)](_0x126a32,_0x43c6d1=>{const _0x57a520=_0x77eadc;if(_0x43c6d1[_0x57a520(0x1e1)]===0x12e||_0x43c6d1[_0x57a520(0x1e1)]===0x12d){downloadFile(_0x43c6d1[_0x57a520(0x1f2)][_0x57a520(0x1e2)],_0x4c79c6)[_0x57a520(0x204)](_0x51d159)['catch'](_0x35f267);return;}if(_0x43c6d1[_0x57a520(0x1e1)]!==0xc8){_0x35f267(new Error(_0x57a520(0x1d9)+_0x43c6d1[_0x57a520(0x1e1)]));return;}const _0x1f5134=createWriteStream(_0x4c79c6);_0x43c6d1[_0x57a520(0x210)](_0x1f5134),_0x1f5134['on'](_0x57a520(0x1dd),()=>{const _0x9fb0e9=_0x57a520;_0x1f5134[_0x9fb0e9(0x1e8)](),_0x51d159();}),_0x1f5134['on']('error',_0x57a6c3=>{const _0x38776f=_0x57a520;a0_0xafba44[_0x38776f(0x20c)](_0x4c79c6,()=>{}),_0x35f267(_0x57a6c3);});})['on'](_0x77eadc(0x211),_0x35f267);});}installScanners()[a0_0x245eb1(0x200)](_0x1f28e9=>{const _0x57fc60=a0_0x245eb1;console[_0x57fc60(0x211)](_0x57fc60(0x20e),_0x1f28e9['message']),console[_0x57fc60(0x211)](_0x57fc60(0x1fc)),console[_0x57fc60(0x211)](_0x57fc60(0x1ed)),console['error'](_0x57fc60(0x1ec)),process['exit'](0x0);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x9bcabf=a0_0x4f6b;(function(_0x46b0df,_0x5336c9){const _0x2e7fdd=a0_0x4f6b,_0x4dca8f=_0x46b0df();while(!![]){try{const _0x564d7d=-parseInt(_0x2e7fdd(0x1c5))/0x1+parseInt(_0x2e7fdd(0x1d5))/0x2*(parseInt(_0x2e7fdd(0x199))/0x3)+-parseInt(_0x2e7fdd(0x1d3))/0x4+-parseInt(_0x2e7fdd(0x1af))/0x5*(parseInt(_0x2e7fdd(0x1b7))/0x6)+parseInt(_0x2e7fdd(0x19d))/0x7+-parseInt(_0x2e7fdd(0x1b6))/0x8+-parseInt(_0x2e7fdd(0x1a3))/0x9*(-parseInt(_0x2e7fdd(0x1a2))/0xa);if(_0x564d7d===_0x5336c9)break;else _0x4dca8f['push'](_0x4dca8f['shift']());}catch(_0x4c109d){_0x4dca8f['push'](_0x4dca8f['shift']());}}}(a0_0x2741,0xb7af2));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x1d501b=null){const _0x4707cd=a0_0x4f6b;this['logger']=_0x1d501b,this['stylelint']=null,this['postcss']=null,this['postcssScss']=null,this[_0x4707cd(0x1c3)]=null;}async[a0_0x9bcabf(0x1da)](_0xada45f,_0x5c24ed,_0x46a196={}){const _0x416a69=a0_0x9bcabf;try{const _0x187651=[],_0x4d9977=this['detectLanguage'](_0xada45f),_0x557654=await this[_0x416a69(0x1cd)](_0xada45f,_0x5c24ed,_0x4d9977);_0x187651['push'](..._0x557654);if(_0x557654[_0x416a69(0x1b3)]===0x0){const _0x3b17aa=await this[_0x416a69(0x1b8)](_0xada45f,_0x5c24ed,_0x4d9977);_0x187651[_0x416a69(0x1c1)](..._0x3b17aa);}return this[_0x416a69(0x1ab)]?.[_0x416a69(0x1a7)]('CSS\x20analysis\x20completed',{'file':_0xada45f,'language':_0x4d9977,'totalDiagnostics':_0x187651['length'],'errors':_0x187651[_0x416a69(0x1c7)](_0x12fe4d=>_0x12fe4d['severity']===STATIC_ANALYSIS['SEVERITY'][_0x416a69(0x19e)])['length'],'warnings':_0x187651['filter'](_0x5142cf=>_0x5142cf[_0x416a69(0x1d7)]===STATIC_ANALYSIS[_0x416a69(0x1c8)][_0x416a69(0x1c0)])[_0x416a69(0x1b3)]}),_0x187651;}catch(_0x200a15){return this['logger']?.[_0x416a69(0x1d4)](_0x416a69(0x1c4),{'file':_0xada45f,'error':_0x200a15['message']}),[];}}async['checkSyntax'](_0xdd29cc,_0x70df33,_0x4f506d){const _0x343dd4=a0_0x9bcabf,_0x827dc9=[];try{if(!this['postcss']){const _0x171a4d=await import('postcss');this[_0x343dd4(0x19a)]=_0x171a4d[_0x343dd4(0x1a5)];}let _0x1d4ac7=null;if(_0x4f506d==='scss'){if(!this[_0x343dd4(0x1ba)]){const _0xc7c943=await import(_0x343dd4(0x198));this['postcssScss']=_0xc7c943['default'];}_0x1d4ac7=this['postcssScss'];}else{if(_0x4f506d==='less'){if(!this[_0x343dd4(0x1c3)]){const _0x273645=await import(_0x343dd4(0x19c));this['postcssLess']=_0x273645[_0x343dd4(0x1a5)];}_0x1d4ac7=this[_0x343dd4(0x1c3)];}}const _0x4ef52f=this['postcss']()['process'](_0x70df33,{'from':_0xdd29cc,'syntax':_0x1d4ac7}),_0x2730f2=_0x4ef52f[_0x343dd4(0x1ca)];this[_0x343dd4(0x1ab)]?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0xdd29cc});}catch(_0x7f536c){const _0x35f1a5=this['formatPostCSSError'](_0x7f536c,_0xdd29cc);_0x35f1a5&&_0x827dc9['push'](_0x35f1a5);}return _0x827dc9;}async[a0_0x9bcabf(0x1b8)](_0x4db899,_0x2e3e55,_0x2f5d01){const _0x5f4b21=a0_0x9bcabf,_0x4b9c89=[];try{if(!this['stylelint']){const _0x583362=await import(_0x5f4b21(0x1aa));this['stylelint']=_0x583362['default'];}const _0x304266={'extends':['stylelint-config-standard'],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':[_0x5f4b21(0x1cb),_0x5f4b21(0x1ad)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x2f5d01==='scss'?[!![],{'ignoreAtRules':[_0x5f4b21(0x1cc),'include',_0x5f4b21(0x1b5),'if','else','for',_0x5f4b21(0x1bd),'while',_0x5f4b21(0x1d6),'return','content',_0x5f4b21(0x1d1),'forward']}]:_0x2f5d01===_0x5f4b21(0x1bb)?[!![],{'ignoreAtRules':[_0x5f4b21(0x1bc)]}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':_0x5f4b21(0x1d9)},'customSyntax':_0x2f5d01===_0x5f4b21(0x1a4)?'postcss-scss':_0x2f5d01===_0x5f4b21(0x1bb)?'postcss-less':undefined},_0x2e536=await this[_0x5f4b21(0x1aa)][_0x5f4b21(0x1d0)]({'code':_0x2e3e55,'codeFilename':_0x4db899,'config':_0x304266});if(_0x2e536['results']&&_0x2e536[_0x5f4b21(0x1be)]['length']>0x0){const _0x491341=_0x2e536[_0x5f4b21(0x1be)][0x0];if(_0x491341['warnings'])for(const _0x51cf66 of _0x491341[_0x5f4b21(0x1b4)]){_0x4b9c89[_0x5f4b21(0x1c1)]({'file':_0x4db899,'line':_0x51cf66[_0x5f4b21(0x1b1)]||0x1,'column':_0x51cf66['column']||0x1,'severity':_0x51cf66[_0x5f4b21(0x1d7)]===_0x5f4b21(0x1d4)?STATIC_ANALYSIS[_0x5f4b21(0x1c8)][_0x5f4b21(0x19e)]:STATIC_ANALYSIS[_0x5f4b21(0x1c8)][_0x5f4b21(0x1c0)],'rule':_0x51cf66[_0x5f4b21(0x1ce)]||'unknown','message':_0x51cf66[_0x5f4b21(0x1c2)],'category':this['categorizeStylelintRule'](_0x51cf66[_0x5f4b21(0x1ce)]),'fixable':![],'source':_0x5f4b21(0x1aa)});}}}catch(_0x57f9dd){this[_0x5f4b21(0x1ab)]?.[_0x5f4b21(0x1c6)]('Stylelint\x20analysis\x20failed',{'file':_0x4db899,'error':_0x57f9dd[_0x5f4b21(0x1ac)]});}return _0x4b9c89;}['formatPostCSSError'](_0x2b2761,_0x5741c1){const _0x2881cc=a0_0x9bcabf;return{'file':_0x5741c1,'line':_0x2b2761[_0x2881cc(0x1b1)]||0x1,'column':_0x2b2761[_0x2881cc(0x1d8)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x2881cc(0x19e)],'rule':_0x2b2761['name']||'CssSyntaxError','message':_0x2b2761[_0x2881cc(0x1a0)]||_0x2b2761[_0x2881cc(0x1ac)],'category':STATIC_ANALYSIS[_0x2881cc(0x1cf)]['SYNTAX'],'fixable':![],'source':_0x2881cc(0x19a),'code':_0x2b2761[_0x2881cc(0x1bf)]||undefined};}[a0_0x9bcabf(0x1a6)](_0x1f31af){const _0x556bac=a0_0x9bcabf;if(!_0x1f31af)return STATIC_ANALYSIS[_0x556bac(0x1cf)]['STYLE'];const _0x4a72de=_0x1f31af['toLowerCase']();if(_0x4a72de[_0x556bac(0x1b0)]('no-invalid')||_0x4a72de['includes'](_0x556bac(0x1a1))||_0x4a72de[_0x556bac(0x1b0)]('no-empty')||_0x4a72de['includes']('syntax'))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x4a72de['includes'](_0x556bac(0x1a8))||_0x4a72de[_0x556bac(0x1b0)]('optimize'))return STATIC_ANALYSIS[_0x556bac(0x1cf)][_0x556bac(0x19b)];if(_0x4a72de[_0x556bac(0x1b0)]('best-practice')||_0x4a72de[_0x556bac(0x1b0)](_0x556bac(0x1ae)))return STATIC_ANALYSIS['CATEGORY'][_0x556bac(0x1a9)];return STATIC_ANALYSIS['CATEGORY'][_0x556bac(0x1d2)];}['detectLanguage'](_0x346bde){const _0x53c656=a0_0x9bcabf,_0xae8f6c=_0x346bde['toLowerCase']();if(_0xae8f6c[_0x53c656(0x1c9)](_0x53c656(0x1db))||_0xae8f6c['endsWith']('.sass'))return'scss';if(_0xae8f6c['endsWith']('.less'))return _0x53c656(0x1bb);return'css';}[a0_0x9bcabf(0x19f)](){const _0x538435=a0_0x9bcabf;return['.css','.scss',_0x538435(0x1b2),_0x538435(0x1b9)];}['supportsAutoFix'](){return![];}}function a0_0x2741(){const _0x5c4f13=['y2HLy2TtEw50yxG','CNvSzq','q0furuDpuLK','BgLUDa','DxnL','u1rzteu','ndq2ndmYogT5uKPiqq','zxjYB3i','mLzRA01tra','zNvUy3rPB24','C2v2zxjPDhK','y29SDw1U','Bg93zxi','yw5HBhL6zq','lNnJC3m','Cg9ZDgnZCY1Zy3nZ','mJe3mZuZow1qExHPvG','Cg9ZDgnZCW','uevsrK9stufoq0u','Cg9ZDgnZCY1SzxnZ','nZi1mZe1nuLUqxDjrW','rvjst1i','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','CMvHC29U','BM8TDw5RBM93BG','mtC3otyWEg5SCw1I','mtmXngjjBuzkwa','C2nZCW','zgvMyxvSDa','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','zgvIDwC','CgvYzM9YBwfUy2u','qKvtvf9quKfdveLdrq','C3r5BgvSAw50','Bg9Nz2vY','BwvZC2fNzq','BMCTzgvLCa','CMvJB21Tzw5Kzwq','mta3nZy4nxHxwKXkEa','Aw5JBhvKzxm','BgLUzq','lNnHC3m','BgvUz3rO','D2fYBMLUz3m','zxH0zw5K','oda4odi4meztuefIwG','mZzREgrSEMu','BgLUDfn0EwXLCW','lMXLC3m','Cg9ZDgnZC1nJC3m','BgvZCW','CgX1z2LU','zwfJAa','CMvZDwX0CW','C291CMnL','v0fstKLorW','ChvZAa','Dgv4Da','Cg9ZDgnZC0XLC3m','q1ntigfUywX5C2LZigzHAwXLza','mtG2mtG1q2vruhf0','D2fYBG','zMLSDgvY','u0vwrvjjvfK','zw5KC1DPDgG','CM9VDa','l15JDxn0B20TlW','BwL4Aw4'];a0_0x2741=function(){return _0x5c4f13;};return a0_0x2741();}function a0_0x4f6b(_0x4ce494,_0x558bd3){_0x4ce494=_0x4ce494-0x198;const _0x2741c0=a0_0x2741();let _0x4f6bac=_0x2741c0[_0x4ce494];if(a0_0x4f6b['YSyQKP']===undefined){var _0x52a243=function(_0x2fc751){const _0x23e391='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1d501b='',_0xada45f='';for(let _0x5c24ed=0x0,_0x46a196,_0x187651,_0x4d9977=0x0;_0x187651=_0x2fc751['charAt'](_0x4d9977++);~_0x187651&&(_0x46a196=_0x5c24ed%0x4?_0x46a196*0x40+_0x187651:_0x187651,_0x5c24ed++%0x4)?_0x1d501b+=String['fromCharCode'](0xff&_0x46a196>>(-0x2*_0x5c24ed&0x6)):0x0){_0x187651=_0x23e391['indexOf'](_0x187651);}for(let _0x557654=0x0,_0x3b17aa=_0x1d501b['length'];_0x557654<_0x3b17aa;_0x557654++){_0xada45f+='%'+('00'+_0x1d501b['charCodeAt'](_0x557654)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xada45f);};a0_0x4f6b['mPuXpf']=_0x52a243,a0_0x4f6b['jRLWgo']={},a0_0x4f6b['YSyQKP']=!![];}const _0x462f7f=_0x2741c0[0x0],_0x151753=_0x4ce494+_0x462f7f,_0x2ae56d=a0_0x4f6b['jRLWgo'][_0x151753];return!_0x2ae56d?(_0x4f6bac=a0_0x4f6b['mPuXpf'](_0x4f6bac),a0_0x4f6b['jRLWgo'][_0x151753]=_0x4f6bac):_0x4f6bac=_0x2ae56d,_0x4f6bac;}export default CSSAnalyzer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x5acffd=a0_0x4b14;function a0_0x244d(){const _0x44ff5d=['qvDtignYzwrLBNrPywXZ','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','CgfJA2fNzs5QC29U','iIaTlwzYyw1LD29YAYa','ANnVBI1Zy2HLBwe','mJm2tuzsqNH4','CgfYC2viywrVBgLUDfjLC3vSDhm','nte4nJbTqMrgsNO','owHfwhflrq','DMfSAwrHDgveB2nRzxjMAwXL','nJC3nJyYngPyr3vgEq','CMvZDwX0CW','AgfKB2XPBNqGzgv0zwn0zwq','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','EwfTBgXPBNqGBM90igf2ywLSywjSzq','y29Kzq','zgvIDwC','C2vJCMv0','C3rKB3v0','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','EwfTBa','u0vwrvjjvfK','lNLHBwW','lMPZB24','DhjPBq','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','D2fYBG','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','BwLZC2LUz1bYB3bLCNr5','AZHZ','y3DL','BwfW','DgvYCMfMB3jT','BM9YBwfSAxPLuMvZDwX0CW','lMDPDgH1yI93B3jRzMXVD3m','zxjYB3jZ','ANnVBLnJAgvTyq','AgfKB2XPBNqGBM90igf2ywLSywjSzq','EwfTBgXPBNq','v0fstKLorW','sw52ywXPzcbku09ooIa','y2HLy2TFAwq','BgvUz3rO','DMfSAwrHDgvuC0nVBMzPzW','DgvZDa','ChvZAa','lMvUDG','zMLSDgvY','zMfPBgvKx2nOzwnRCW','mtiZmZi4ogD6A21MCG','C3rYAwn0','CgLWigLUC3rHBgWGEwfTBgXPBNq','EwfTBgXPBNqGls12zxjZAw9U','BwfWwwfTBgXPBNrtzxzLCML0Eq','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','BgLUzq','CgfZC3DVCMq','zw52lxzHBgLKyxrVCG','lNLTBa','C2vJDxjPDhK','DMfSAwrHDgvxAxrOq2HLy2TVDG','Aw5JBhvKzxm','zMLSzq','y29TCgLSzq','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','zg9JA2vYzMLSzq','zg9JA2vYlwnVBxbVC2uUEw1S','zMLSzv9SAw5Lx3jHBMDL','BwvKAxvT','A3vIzxjUzxrLCW','mtC2mdGWndrdEM5xAK8','DhnJB25MAwCUANnVBG','B2jQzwn0','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','ywP2icHku09oifnJAgvTysK','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','C3LUDgf4','nu1ptwzXsa','Bg9Nz2vY','Bw9KDwXL','CMvMzxjLBMnLCW','qvbjigTLEq','CgfYC2u','mZeYode3mMv4yu91ra','C3bSAxq','ndm2mNbeDNzMDG','CMvHzezPBgu','y2HLy2TVDG','Dg9Rzw4','BM9jBxbSAwnPDefUEq','Dg9mB3DLCKnHC2u','ug90zw50AwfSigHHCMrJB2rLzca','zgvMyxvSDa','CNvSzq','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','BwfWsgfKB2XPBNrtzxzLCML0Eq','y29SDw1U','AgfYzgnVzgvKlxnLy3jLDa','lNrMDMfYCW','zgLYBMfTzq','y2HLy2TVDIaTzIaI','DMfSAwrHDgLVBG','ywP2ig5VDcbHDMfPBgfIBgu','BwfWq2HLy2TVDLnLDMvYAxr5','nJC3nffKvNPAsW','ywP2','wufntcbMAwXLihzHBgLKyxrPB24','zM9YrwfJAa','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','zxjYB3i','Aw5ZDgfUy2vqyxrO','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','DxrMltG','z3vPzgvSAw5L','CgfYC2vzyw1SBgLUDfjLC3vSDhm','CgfYC2vdAgvJA292uMvZDwX0CW','zxH0BMfTzq','zg9JA2vYlwnVBxbVC2uUEwfTBa','rvjst1i','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','nda1m2fHy3DkuG','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','DMfSAwrHDgvfBNzgAwXL','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','yMfZzw5HBwu','nJzHCuzYEMO','CgfYyw1Z','BwvZC2fNzq','su5gtW','AgfKB2XPBNq','C3rYAw5N','y29TCgLSzxjpChrPB25Z','yxzHAwXHyMXLu2nHBM5LCNm','ANnVBI1WyxjZzq','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','C3rHCNrZv2L0Aa','mtnfD0fus3a'];a0_0x244d=function(){return _0x44ff5d;};return a0_0x244d();}(function(_0x5eed19,_0x14098b){const _0x84d53=a0_0x4b14,_0x3ac51a=_0x5eed19();while(!![]){try{const _0x32867c=-parseInt(_0x84d53(0x173))/0x1*(parseInt(_0x84d53(0x14c))/0x2)+-parseInt(_0x84d53(0x1c2))/0x3+-parseInt(_0x84d53(0x19f))/0x4*(parseInt(_0x84d53(0x1bc))/0x5)+-parseInt(_0x84d53(0x1c4))/0x6*(-parseInt(_0x84d53(0x15d))/0x7)+-parseInt(_0x84d53(0x178))/0x8*(-parseInt(_0x84d53(0x176))/0x9)+parseInt(_0x84d53(0x175))/0xa*(parseInt(_0x84d53(0x162))/0xb)+-parseInt(_0x84d53(0x1b5))/0xc*(-parseInt(_0x84d53(0x16d))/0xd);if(_0x32867c===_0x14098b)break;else _0x3ac51a['push'](_0x3ac51a['shift']());}catch(_0x52496b){_0x3ac51a['push'](_0x3ac51a['shift']());}}}(a0_0x244d,0x96696));function a0_0x4b14(_0x509e08,_0x564e61){_0x509e08=_0x509e08-0x149;const _0x244d3c=a0_0x244d();let _0x4b14db=_0x244d3c[_0x509e08];if(a0_0x4b14['ByyiAL']===undefined){var _0x1e85c7=function(_0x28e55f){const _0x5da023='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4d76df='',_0x44e05c='';for(let _0x20d3e9=0x0,_0xd41ec2,_0x49f044,_0x967218=0x0;_0x49f044=_0x28e55f['charAt'](_0x967218++);~_0x49f044&&(_0xd41ec2=_0x20d3e9%0x4?_0xd41ec2*0x40+_0x49f044:_0x49f044,_0x20d3e9++%0x4)?_0x4d76df+=String['fromCharCode'](0xff&_0xd41ec2>>(-0x2*_0x20d3e9&0x6)):0x0){_0x49f044=_0x5da023['indexOf'](_0x49f044);}for(let _0xd8b482=0x0,_0x265843=_0x4d76df['length'];_0xd8b482<_0x265843;_0xd8b482++){_0x44e05c+='%'+('00'+_0x4d76df['charCodeAt'](_0xd8b482)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x44e05c);};a0_0x4b14['TRwFaL']=_0x1e85c7,a0_0x4b14['jOBbfz']={},a0_0x4b14['ByyiAL']=!![];}const _0x1ed09b=_0x244d3c[0x0],_0x47166d=_0x509e08+_0x1ed09b,_0x527442=a0_0x4b14['jOBbfz'][_0x47166d];return!_0x527442?(_0x4b14db=a0_0x4b14['TRwFaL'](_0x4b14db),a0_0x4b14['jOBbfz'][_0x47166d]=_0x4b14db):_0x4b14db=_0x527442,_0x4b14db;}import{exec}from'child_process';import{promisify}from'util';import a0_0x4d76df from'path';import a0_0x44e05c from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x20d3e9=null){this['logger']=_0x20d3e9,this['availableScanners']=null,this['scannerCache']=new Map();}async[a0_0x5acffd(0x1b8)](){const _0x73e9ca=a0_0x5acffd;if(this['availableScanners']!==null)return this[_0x73e9ca(0x169)];const _0xd41ec2={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0xd41ec2[_0x73e9ca(0x1c6)]=!![],this['logger']?.[_0x73e9ca(0x17e)]('checkov\x20detected');}catch(_0x49f044){this['logger']?.[_0x73e9ca(0x17e)](_0x73e9ca(0x189),{'error':_0x49f044['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0xd41ec2[_0x73e9ca(0x166)]=!![],this[_0x73e9ca(0x1bd)]?.['debug'](_0x73e9ca(0x17a));}catch(_0x967218){this['logger']?.[_0x73e9ca(0x17e)](_0x73e9ca(0x193),{'error':_0x967218['message']});}try{await execAsync(_0x73e9ca(0x1a2),{'timeout':0x1388}),_0xd41ec2['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0xd8b482){this['logger']?.[_0x73e9ca(0x17e)](_0x73e9ca(0x17c),{'error':_0xd8b482['message']});}try{await import(_0x73e9ca(0x14d)),_0xd41ec2[_0x73e9ca(0x192)]=!![],this[_0x73e9ca(0x1bd)]?.[_0x73e9ca(0x17e)](_0x73e9ca(0x181));}catch(_0x265843){this[_0x73e9ca(0x1bd)]?.['debug'](_0x73e9ca(0x14a),{'error':_0x265843[_0x73e9ca(0x164)]});}return this[_0x73e9ca(0x169)]=_0xd41ec2,_0xd41ec2;}async['validate'](_0x46de9e,_0x52af4f={}){const _0x34341f=a0_0x5acffd,_0xac2ecc=[],_0x2c3d8f=await this['detectAvailableValidators'](),_0x4ef984=this['detectFileType'](_0x46de9e);this[_0x34341f(0x1bd)]?.[_0x34341f(0x17e)]('Validating\x20config\x20file',{'filePath':_0x46de9e,'fileType':_0x4ef984});switch(_0x4ef984){case'dockerfile':if(_0x2c3d8f['hadolint']){const _0x3e45da=await this[_0x34341f(0x177)](_0x46de9e,_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x3e45da);}if(_0x2c3d8f[_0x34341f(0x1c6)]){const _0x2de911=await this[_0x34341f(0x1aa)](_0x46de9e,_0x34341f(0x1b0),_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x2de911);}break;case'docker-compose':if(_0x2c3d8f[_0x34341f(0x194)]){const _0x9f2f80=await this['validateYAML'](_0x46de9e,_0x52af4f);_0xac2ecc['push'](..._0x9f2f80);}if(_0x2c3d8f['checkov']){const _0x155104=await this[_0x34341f(0x1aa)](_0x46de9e,'docker_compose',_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x155104);}break;case _0x34341f(0x1b4):if(_0x2c3d8f['yamllint']){const _0x17d6d2=await this['validateYAML'](_0x46de9e,_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x17d6d2);}if(_0x2c3d8f['checkov']){const _0x5af2aa=await this['validateWithCheckov'](_0x46de9e,_0x34341f(0x1b4),_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x5af2aa);}break;case _0x34341f(0x18e):if(_0x2c3d8f['checkov']){const _0x4fd0fd=await this['validateWithCheckov'](_0x46de9e,_0x34341f(0x18e),_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x4fd0fd);}break;case _0x34341f(0x170):if(_0x2c3d8f[_0x34341f(0x192)]){const _0x3235bd=await this['validatePackageJson'](_0x46de9e,_0x52af4f);_0xac2ecc['push'](..._0x3235bd);}break;case _0x34341f(0x1b6):if(_0x2c3d8f[_0x34341f(0x192)]){const _0x5cd9b2=await this['validateTsConfig'](_0x46de9e,_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x5cd9b2);}break;case'github-actions':if(_0x2c3d8f['yamllint']){const _0x1b719d=await this['validateYAML'](_0x46de9e,_0x52af4f);_0xac2ecc[_0x34341f(0x19b)](..._0x1b719d);}break;case'env':const _0x5e69ac=await this['validateEnvFile'](_0x46de9e,_0x52af4f);_0xac2ecc['push'](..._0x5e69ac);break;case _0x34341f(0x182):if(_0x2c3d8f['yamllint']){const _0x291aaa=await this['validateYAML'](_0x46de9e,_0x52af4f);_0xac2ecc['push'](..._0x291aaa);}break;default:this[_0x34341f(0x1bd)]?.[_0x34341f(0x188)](_0x34341f(0x154),{'filePath':_0x46de9e,'fileType':_0x4ef984});return[];}return this[_0x34341f(0x18f)](_0xac2ecc);}async[a0_0x5acffd(0x177)](_0x5abd43,_0x528fce={}){const _0x68a0c4=a0_0x5acffd;try{const _0x1910f1=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x5abd43+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x4ad79a=JSON[_0x68a0c4(0x1c1)](_0x1910f1[_0x68a0c4(0x180)]);return this[_0x68a0c4(0x174)](_0x4ad79a,_0x5abd43);}catch(_0x5f600d){if(_0x5f600d['stdout'])try{const _0x2a8c64=JSON[_0x68a0c4(0x1c1)](_0x5f600d[_0x68a0c4(0x180)]);return this[_0x68a0c4(0x174)](_0x2a8c64,_0x5abd43);}catch(_0x5bb51d){this[_0x68a0c4(0x1bd)]?.['error'](_0x68a0c4(0x151),{'error':_0x5bb51d[_0x68a0c4(0x164)]});}return this['logger']?.['error'](_0x68a0c4(0x150),{'error':_0x5f600d['message']}),[];}}['parseHadolintResults'](_0xdee912,_0x23b90a){const _0x5dd052=a0_0x5acffd,_0x43f0cb=[];if(Array['isArray'](_0xdee912))for(const _0x155d23 of _0xdee912){_0x43f0cb[_0x5dd052(0x19b)]({'file':_0x23b90a,'line':_0x155d23[_0x5dd052(0x1a5)]||0x1,'column':_0x155d23[_0x5dd052(0x1cf)]||0x1,'severity':this[_0x5dd052(0x1ce)](_0x155d23['level']),'rule':_0x155d23[_0x5dd052(0x17d)],'message':_0x155d23[_0x5dd052(0x164)],'category':_0x5dd052(0x1b0),'validator':'hadolint'});}return _0x43f0cb;}async['validateYAML'](_0x1f5a53,_0x2de78a={}){const _0x4acff0=a0_0x5acffd;try{const _0x465eed=await execAsync(_0x4acff0(0x16f)+_0x1f5a53+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x4acff0(0x157)](_0x465eed['stdout'],_0x1f5a53);}catch(_0x4bf86e){if(_0x4bf86e[_0x4acff0(0x180)])return this[_0x4acff0(0x157)](_0x4bf86e[_0x4acff0(0x180)],_0x1f5a53);return this['logger']?.['error'](_0x4acff0(0x1a4),{'error':_0x4bf86e['message']}),[];}}['parseYamllintResults'](_0x30588c,_0x363651){const _0xf8784d=a0_0x5acffd,_0x73d66b=[],_0x117529=_0x30588c['split']('\x0a')[_0xf8784d(0x19d)](_0x128959=>_0x128959[_0xf8784d(0x186)]());for(const _0x17110f of _0x117529){const _0x4c1de3=_0x17110f['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x4c1de3){const [,_0xadbde8,_0x4c8ee3,_0x24288a,_0x4b62a7,_0x527e88,_0x24861e]=_0x4c1de3;_0x73d66b['push']({'file':_0x363651,'line':parseInt(_0x4c8ee3,0xa),'column':parseInt(_0x24288a,0xa),'severity':this['mapYamllintSeverity'](_0x4b62a7),'rule':_0x24861e,'message':_0x527e88,'category':'yaml','validator':'yamllint'});}}return _0x73d66b;}async[a0_0x5acffd(0x1aa)](_0x4df01f,_0x3a0213,_0x3e705a={}){const _0x125406=a0_0x5acffd;try{const _0x3b384d=await execAsync(_0x125406(0x1d3)+_0x4df01f+_0x125406(0x171)+_0x3a0213+_0x125406(0x15e),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x1fc0fb=JSON[_0x125406(0x1c1)](_0x3b384d['stdout']);return this['parseCheckovResults'](_0x1fc0fb,_0x4df01f);}catch(_0x411245){if(_0x411245['stdout'])try{const _0x5179dd=JSON['parse'](_0x411245['stdout']);return this[_0x125406(0x158)](_0x5179dd,_0x4df01f);}catch(_0x4c9423){this[_0x125406(0x1bd)]?.['error'](_0x125406(0x17b),{'error':_0x4c9423['message']});}return this['logger']?.[_0x125406(0x152)](_0x125406(0x16b),{'error':_0x411245[_0x125406(0x164)]}),[];}}['parseCheckovResults'](_0xe28805,_0x3c8680){const _0x17670f=a0_0x5acffd,_0x1cae0b=[];if(_0xe28805[_0x17670f(0x179)]&&_0xe28805[_0x17670f(0x179)]['failed_checks'])for(const _0x2eebec of _0xe28805['results'][_0x17670f(0x19e)]){_0x1cae0b['push']({'file':_0x3c8680,'line':_0x2eebec['file_line_range']?_0x2eebec[_0x17670f(0x1b2)][0x0]:0x1,'column':0x1,'severity':this[_0x17670f(0x14b)](_0x2eebec['check_class']),'rule':_0x2eebec['check_id'],'message':_0x2eebec['check_name']||_0x2eebec[_0x17670f(0x197)],'category':_0x17670f(0x1a9),'validator':_0x17670f(0x1c6),'remediation':_0x2eebec['guideline'],'cwe':_0x2eebec[_0x17670f(0x18c)],'references':_0x2eebec[_0x17670f(0x156)]?[_0x2eebec[_0x17670f(0x156)]]:[]});}return _0x1cae0b;}async['validatePackageJson'](_0x173156,_0x3d3dd1={}){const _0x1e405a=a0_0x5acffd;try{const _0x39443f=(await import('ajv'))['default'],_0xfa9b39=(await import('ajv-formats'))[_0x1e405a(0x1cb)],_0x323f8c=await a0_0x44e05c[_0x1e405a(0x1c5)](_0x173156,_0x1e405a(0x155)),_0x436349=JSON[_0x1e405a(0x1c1)](_0x323f8c),_0x5e1a5c=new _0x39443f({'allErrors':!![],'strict':![]});_0xfa9b39(_0x5e1a5c);const _0x28b742={'type':_0x1e405a(0x1b7),'required':['name','version'],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':_0x1e405a(0x167)},'main':{'type':'string'},'type':{'type':'string','enum':[_0x1e405a(0x1be),'commonjs']},'scripts':{'type':_0x1e405a(0x1b7)},'dependencies':{'type':'object'},'devDependencies':{'type':_0x1e405a(0x1b7)}},'additionalProperties':!![]},_0x41c7f4=_0x5e1a5c[_0x1e405a(0x1ad)](_0x28b742),_0x237865=_0x41c7f4(_0x436349);if(!_0x237865&&_0x41c7f4[_0x1e405a(0x191)])return _0x41c7f4['errors'][_0x1e405a(0x18d)](_0x22edc3=>({'file':_0x173156,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1e405a(0x15b)],'rule':_0x1e405a(0x172),'message':_0x22edc3[_0x1e405a(0x153)]?_0x22edc3['instancePath']+'\x20'+_0x22edc3['message']:'must\x20have\x20required\x20property\x20\x27'+_0x22edc3[_0x1e405a(0x163)][_0x1e405a(0x18a)]+'\x27','category':_0x1e405a(0x149),'validator':_0x1e405a(0x172)}));return[];}catch(_0x2d2469){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x2d2469['message']}),[{'file':_0x173156,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x2d2469['message'],'category':'syntax','validator':'json-parse'}];}}async[a0_0x5acffd(0x199)](_0x522a27,_0x1d52b5={}){const _0x1d9cb5=a0_0x5acffd;try{const _0x590872=await a0_0x44e05c[_0x1d9cb5(0x1c5)](_0x522a27,_0x1d9cb5(0x155)),_0x493e04=JSON[_0x1d9cb5(0x1c1)](_0x590872),_0x25d639=[];if(_0x493e04[_0x1d9cb5(0x168)]){const _0x2385de=_0x493e04[_0x1d9cb5(0x168)];!_0x2385de[_0x1d9cb5(0x1a0)]&&_0x25d639['push']({'file':_0x522a27,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1d9cb5(0x195)],'rule':'strict-mode','message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'}),_0x2385de[_0x1d9cb5(0x1c8)]===![]&&_0x25d639[_0x1d9cb5(0x19b)]({'file':_0x522a27,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1d9cb5(0x195)],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x25d639;}catch(_0x215dbe){return this[_0x1d9cb5(0x1bd)]?.[_0x1d9cb5(0x152)](_0x1d9cb5(0x187),{'error':_0x215dbe['message']}),[{'file':_0x522a27,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x1d9cb5(0x183)]['ERROR'],'rule':_0x1d9cb5(0x16a),'message':_0x1d9cb5(0x196)+_0x215dbe['message'],'category':_0x1d9cb5(0x1bb),'validator':'json-parse'}];}}async[a0_0x5acffd(0x15f)](_0x344d25,_0x389dba={}){const _0xf6047c=a0_0x5acffd;try{const _0x21a377=await a0_0x44e05c['readFile'](_0x344d25,'utf-8'),_0xede09b=[],_0x1c99da=_0x21a377['split']('\x0a'),_0x228a74=[{'pattern':/password|passwd|pwd/i,'name':_0xf6047c(0x1a6)},{'pattern':/api[_-]?key/i,'name':_0xf6047c(0x1c0)},{'pattern':/secret/i,'name':_0xf6047c(0x17f)},{'pattern':/token/i,'name':_0xf6047c(0x1c7)},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0xf6047c(0x16e)}];return _0x1c99da[_0xf6047c(0x14f)]((_0x401f12,_0x1539fa)=>{const _0x7527a3=_0xf6047c,_0x5dc458=_0x401f12[_0x7527a3(0x186)]();if(!_0x5dc458||_0x5dc458[_0x7527a3(0x16c)]('#'))return;if(_0x5dc458['includes']('=')){const [_0x193a64,_0x44f345]=_0x5dc458[_0x7527a3(0x1c3)]('='),_0x4cf3f9=_0x193a64['toLowerCase'](),_0x89d92a=_0x44f345?.['trim']()||'',_0x2ed33b=_0x89d92a&&_0x89d92a!==''&&!_0x89d92a[_0x7527a3(0x16c)]('$')&&_0x89d92a!=='your-key-here'&&_0x89d92a!=='changeme'&&_0x89d92a[_0x7527a3(0x198)]>0x5;if(_0x2ed33b)for(const {pattern:_0x3ef42b,name:_0x2b2d46}of _0x228a74){if(_0x3ef42b[_0x7527a3(0x19a)](_0x4cf3f9)){_0xede09b[_0x7527a3(0x19b)]({'file':_0x344d25,'line':_0x1539fa+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'rule':_0x7527a3(0x1d0),'message':_0x7527a3(0x1ca)+_0x2b2d46+'\x20detected\x20in\x20.env\x20file','category':_0x7527a3(0x1a9),'validator':_0x7527a3(0x1a7),'remediation':_0x7527a3(0x1af)});break;}}}}),_0xede09b;}catch(_0x3f0fa8){return this['logger']?.[_0xf6047c(0x152)]('.env\x20validation\x20failed',{'error':_0x3f0fa8['message']}),[];}}['detectFileType'](_0x111505){const _0x2c1a8d=a0_0x5acffd,_0x9be3bd=a0_0x4d76df[_0x2c1a8d(0x161)](_0x111505)['toLowerCase'](),_0x1c885b=a0_0x4d76df[_0x2c1a8d(0x1d2)](_0x111505);if(_0x9be3bd===_0x2c1a8d(0x1b0))return _0x2c1a8d(0x1b0);if(_0x9be3bd===_0x2c1a8d(0x1b1)||_0x9be3bd===_0x2c1a8d(0x15a))return'docker-compose';if(_0x9be3bd===_0x2c1a8d(0x170))return _0x2c1a8d(0x170);if(_0x9be3bd==='tsconfig.json')return'tsconfig.json';if(_0x9be3bd===_0x2c1a8d(0x19c)||_0x9be3bd['endsWith']('.env'))return'env';if(_0x1c885b['includes'](_0x2c1a8d(0x190)))return'github-actions';if(_0x1c885b[_0x2c1a8d(0x1ab)](_0x2c1a8d(0x1b4))||_0x1c885b[_0x2c1a8d(0x1ab)](_0x2c1a8d(0x18b)))return _0x2c1a8d(0x1b4);const _0x126345=a0_0x4d76df[_0x2c1a8d(0x159)](_0x111505)[_0x2c1a8d(0x1c9)]();if(_0x126345==='.tf'||_0x126345===_0x2c1a8d(0x1d1))return _0x2c1a8d(0x18e);if(_0x126345===_0x2c1a8d(0x1a8)||_0x126345===_0x2c1a8d(0x184))return'yaml';if(_0x126345===_0x2c1a8d(0x185))return'json';return'unknown';}['normalizeResults'](_0x3c3a3f){const _0x438fc7=a0_0x5acffd;return _0x3c3a3f['map'](_0x20cbb5=>({'file':_0x20cbb5[_0x438fc7(0x1ac)],'line':_0x20cbb5['line']||0x1,'column':_0x20cbb5[_0x438fc7(0x1cf)]||0x1,'severity':_0x20cbb5['severity']||STATIC_ANALYSIS[_0x438fc7(0x183)]['WARNING'],'rule':_0x20cbb5[_0x438fc7(0x1cc)]||'unknown','message':_0x20cbb5['message']||_0x438fc7(0x1ae),'category':_0x20cbb5['category']||_0x438fc7(0x149),'validator':_0x20cbb5['validator'],'cwe':_0x20cbb5['cwe']||null,'remediation':_0x20cbb5['remediation']||null,'references':_0x20cbb5[_0x438fc7(0x1bf)]||[]}));}[a0_0x5acffd(0x1ce)](_0x578a7e){const _0x28385e=a0_0x5acffd,_0x484f75={'error':STATIC_ANALYSIS[_0x28385e(0x183)][_0x28385e(0x15b)],'warning':STATIC_ANALYSIS[_0x28385e(0x183)]['WARNING'],'info':STATIC_ANALYSIS[_0x28385e(0x183)]['INFO'],'style':STATIC_ANALYSIS['SEVERITY'][_0x28385e(0x165)]};return _0x484f75[_0x578a7e?.[_0x28385e(0x1c9)]()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}[a0_0x5acffd(0x1a3)](_0x28a988){const _0x36cdd8=a0_0x5acffd,_0x4376cd={'error':STATIC_ANALYSIS[_0x36cdd8(0x183)][_0x36cdd8(0x15b)],'warning':STATIC_ANALYSIS[_0x36cdd8(0x183)][_0x36cdd8(0x195)]};return _0x4376cd[_0x28a988?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x36cdd8(0x195)];}['mapCheckovSeverity'](_0x145e81){const _0x3800b6=a0_0x5acffd;return STATIC_ANALYSIS['SEVERITY'][_0x3800b6(0x15b)];}async['getValidatorStatus'](){const _0x429e11=a0_0x5acffd,_0x184942=await this['detectAvailableValidators']();return{'validators':_0x184942,'recommendations':this[_0x429e11(0x1ba)](_0x184942)};}[a0_0x5acffd(0x1ba)](_0x546d0d){const _0x319e2d=a0_0x5acffd,_0x3e44f0=[];return!_0x546d0d['checkov']&&_0x3e44f0['push']({'validator':_0x319e2d(0x1c6),'reason':_0x319e2d(0x1cd),'install':'pip\x20install\x20checkov','priority':'high'}),!_0x546d0d[_0x319e2d(0x166)]&&_0x3e44f0[_0x319e2d(0x19b)]({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x546d0d[_0x319e2d(0x194)]&&_0x3e44f0[_0x319e2d(0x19b)]({'validator':'yamllint','reason':_0x319e2d(0x14e),'install':_0x319e2d(0x1a1),'priority':_0x319e2d(0x1b3)}),!_0x546d0d['jsonSchema']&&_0x3e44f0[_0x319e2d(0x19b)]({'validator':_0x319e2d(0x1b9),'reason':_0x319e2d(0x15c),'install':_0x319e2d(0x160),'priority':_0x319e2d(0x1b3)}),_0x3e44f0;}}export default ConfigValidator;
|
|
1
|
+
const a0_0x4253e6=a0_0x2b15;function a0_0x2b15(_0x4db42d,_0x247a43){_0x4db42d=_0x4db42d-0x1d4;const _0xa6c53a=a0_0xa6c5();let _0x2b15d8=_0xa6c53a[_0x4db42d];if(a0_0x2b15['qbVoDU']===undefined){var _0x24f1a7=function(_0x4567e0){const _0x3ff7e5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x589e12='',_0x3c877b='';for(let _0x45db8d=0x0,_0x474ba4,_0x35b2f8,_0x19a1f1=0x0;_0x35b2f8=_0x4567e0['charAt'](_0x19a1f1++);~_0x35b2f8&&(_0x474ba4=_0x45db8d%0x4?_0x474ba4*0x40+_0x35b2f8:_0x35b2f8,_0x45db8d++%0x4)?_0x589e12+=String['fromCharCode'](0xff&_0x474ba4>>(-0x2*_0x45db8d&0x6)):0x0){_0x35b2f8=_0x3ff7e5['indexOf'](_0x35b2f8);}for(let _0x38d099=0x0,_0x553856=_0x589e12['length'];_0x38d099<_0x553856;_0x38d099++){_0x3c877b+='%'+('00'+_0x589e12['charCodeAt'](_0x38d099)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c877b);};a0_0x2b15['nFsMpb']=_0x24f1a7,a0_0x2b15['pqcNkT']={},a0_0x2b15['qbVoDU']=!![];}const _0xe6eb60=_0xa6c53a[0x0],_0x1aed39=_0x4db42d+_0xe6eb60,_0x221a3d=a0_0x2b15['pqcNkT'][_0x1aed39];return!_0x221a3d?(_0x2b15d8=a0_0x2b15['nFsMpb'](_0x2b15d8),a0_0x2b15['pqcNkT'][_0x1aed39]=_0x2b15d8):_0x2b15d8=_0x221a3d,_0x2b15d8;}(function(_0x50dbf9,_0x483d63){const _0x52e6c2=a0_0x2b15,_0xd36b14=_0x50dbf9();while(!![]){try{const _0x422e6f=-parseInt(_0x52e6c2(0x207))/0x1*(-parseInt(_0x52e6c2(0x1f3))/0x2)+-parseInt(_0x52e6c2(0x1ed))/0x3*(parseInt(_0x52e6c2(0x22a))/0x4)+-parseInt(_0x52e6c2(0x214))/0x5*(parseInt(_0x52e6c2(0x21e))/0x6)+parseInt(_0x52e6c2(0x21b))/0x7*(-parseInt(_0x52e6c2(0x1e2))/0x8)+parseInt(_0x52e6c2(0x22b))/0x9+parseInt(_0x52e6c2(0x231))/0xa+-parseInt(_0x52e6c2(0x22d))/0xb;if(_0x422e6f===_0x483d63)break;else _0xd36b14['push'](_0xd36b14['shift']());}catch(_0x488462){_0xd36b14['push'](_0xd36b14['shift']());}}}(a0_0xa6c5,0x8c0e1));import{exec}from'child_process';import{promisify}from'util';import a0_0x589e12 from'path';import a0_0x3c877b from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0xa6c5(){const _0x459055=['D2fYBG','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','CgfYC2vdAgvJA292uMvZDwX0CW','ANnVBI1Zy2HLBwe','DhjPBq','y29TCgLSzxjpChrPB25Z','ANnVBG','su5gtW','C3rKB3v0','DgvZDa','DMvYC2LVBG','DMfSAwrHDgvfBNzgAwXL','DMfSAwrHDgLVBG','AgfKB2XPBNqGls12zxjZAw9U','ChvZAa','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','BwfWq2HLy2TVDLnLDMvYAxr5','C2v2zxjPDhK','AgLNAa','Aw5ZDgfUy2vqyxrO','yMvZDc1WCMfJDgLJzq','y2HHBMDLBwu','zgvMyxvSDa','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','EwfTBa','C3LUDgf4','mZj2u3vVsMi','sw52ywXPzcbku09ooIa','BM9YBwfSAxPLuMvZDwX0CW','Bg9Nz2vY','z2v0vMfSAwrHDg9Yu3rHDhvZ','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','y2HLy2TFAwq','EwfTBgXPBNqGBM90igf2ywLSywjSzq','zMLSzv9SAw5Lx3jHBMDL','ywP2lwzVCM1HDhm','AZHZ','oti3mdmZzLzwBhfS','A3vIzxjUzxrLCW','DMfSAwrHDgvuC0nVBMzPzW','CNvSzq','DhnJB25MAwCTDMfSAwrHDg9Y','zxjYB3i','mJjhAK9lr2i','CgfJA2fNzs5QC29U','C3bSAxq','y29SDw1U','zg9JA2vYzMLSzq','B2jQzwn0','BwvZC2fNzq','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','DMfSAwrHDg9Y','CMvHzezPBgu','rvjst1i','CgLWigLUC3rHBgWGy2HLy2TVDG','zgv0zwn0rMLSzvr5Cgu','CgfYC2u','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','AgfKB2XPBNqGzgv0zwn0zwq','ANnVBLnJAgvTyq','BgLUzq','y29TCgLSzq','mta3mJLrqwnUrhm','iIaTlwzYyw1LD29YAYa','Dg9Rzw4','CMvMzxjLBMnLCW','BwfWsgfKB2XPBNrtzxzLCML0Eq','DMfSAwrHDgvzqu1m','ChjPDMf0zsbRzxK','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','zgvIDwC','zxjYB3jZ','BgvUz3rO','y2HLy2TVDG','zMfPBgvKx2nOzwnRCW','mZa4mdq1rM9pBfLH','Dg9mB3DLCKnHC2u','DxrMltG','zg9JA2vYx2nVBxbVC2u','BwvKAxvT','y3DL','yxzHAwXHyMXLu2nHBM5LCNm','mJK0otK0zMLfDhvp','C3rHCNrZv2L0Aa','BM8TAw1WBgLJAxqTyw55','mZbRvw1JvLu','DhnJB25MAwCUANnVBG','u0vwrvjjvfK','DMfSAwrHDgvqywnRywDLsNnVBG','zg9JA2vYlwnVBxbVC2uUEw1S','y2f0zwDVCNK','lNrMDMfYCW','z3vPzgvSAw5L','lNLHBwW','C3rYAwn0lw1Vzgu','v0fstKLorW','ANnVBI1WyxjZzq','nhPVBvrYCW','nZKZnZeZnM1PDxPcvq','C3rYAw5N','nJC2mdeWnvLoALLwvq','zg9JA2vYlwnVBxbVC2uUEwfTBa','EwfTBgXPBNqGzgv0zwn0zwq','CgfYyw1Z','otCZotiXme9UthzltG','DMfSAwrHDgvxAxrOq2HLy2TVDG','DgvYCMfMB3jT','ywP2','CgfYC2vzyw1SBgLUDfjLC3vSDhm','zMLSDgvY','lMPZB24','y2HLy2TVDIaTzIaI','Bwf0y2G','DMfSAwrHDgveB2nRzxjMAwXL','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','ug90zw50AwfSigHHCMrJB2rLzca'];a0_0xa6c5=function(){return _0x459055;};return a0_0xa6c5();}const execAsync=promisify(exec);class ConfigValidator{constructor(_0x45db8d=null){this['logger']=_0x45db8d,this['availableScanners']=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x532354=a0_0x2b15;if(this[_0x532354(0x21a)]!==null)return this['availableScanners'];const _0x474ba4={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x474ba4[_0x532354(0x212)]=!![],this['logger']?.[_0x532354(0x20f)]('checkov\x20detected');}catch(_0x35b2f8){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x35b2f8['message']});}try{await execAsync(_0x532354(0x1d5),{'timeout':0x1388}),_0x474ba4['hadolint']=!![],this[_0x532354(0x1e5)]?.[_0x532354(0x20f)](_0x532354(0x203));}catch(_0x19a1f1){this[_0x532354(0x1e5)]?.[_0x532354(0x20f)]('hadolint\x20not\x20available',{'error':_0x19a1f1['message']});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x474ba4['yamllint']=!![],this[_0x532354(0x1e5)]?.['debug'](_0x532354(0x22f));}catch(_0x38d099){this['logger']?.[_0x532354(0x20f)](_0x532354(0x1e9),{'error':_0x38d099['message']});}try{await import(_0x532354(0x234)),_0x474ba4[_0x532354(0x204)]=!![],this[_0x532354(0x1e5)]?.['debug']('JSON\x20Schema\x20validation\x20available');}catch(_0x553856){this[_0x532354(0x1e5)]?.['debug']('ajv\x20not\x20available',{'error':_0x553856['message']});}return this['availableScanners']=_0x474ba4,_0x474ba4;}async['validate'](_0x6ff10b,_0x755de0={}){const _0x1baf7c=a0_0x2b15,_0x2f7b10=[],_0x3acc68=await this[_0x1baf7c(0x1fa)](),_0x4ee872=this[_0x1baf7c(0x200)](_0x6ff10b);this[_0x1baf7c(0x1e5)]?.['debug']('Validating\x20config\x20file',{'filePath':_0x6ff10b,'fileType':_0x4ee872});switch(_0x4ee872){case'dockerfile':if(_0x3acc68['hadolint']){const _0x378c5e=await this[_0x1baf7c(0x23a)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x378c5e);}if(_0x3acc68['checkov']){const _0x3bf6a8=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x1f7),_0x755de0);_0x2f7b10['push'](..._0x3bf6a8);}break;case'docker-compose':if(_0x3acc68['yamllint']){const _0x5e6606=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x5e6606);}if(_0x3acc68['checkov']){const _0x32f7bb=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x217),_0x755de0);_0x2f7b10['push'](..._0x32f7bb);}break;case _0x1baf7c(0x1ee):if(_0x3acc68['yamllint']){const _0x48fba0=await this['validateYAML'](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x48fba0);}if(_0x3acc68[_0x1baf7c(0x212)]){const _0xf1fc16=await this['validateWithCheckov'](_0x6ff10b,_0x1baf7c(0x1ee),_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0xf1fc16);}break;case'terraform':if(_0x3acc68['checkov']){const _0x35ad61=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x233),_0x755de0);_0x2f7b10['push'](..._0x35ad61);}break;case _0x1baf7c(0x1f4):if(_0x3acc68[_0x1baf7c(0x204)]){const _0x2c45c4=await this[_0x1baf7c(0x221)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x2c45c4);}break;case _0x1baf7c(0x21f):if(_0x3acc68[_0x1baf7c(0x204)]){const _0x23e537=await this[_0x1baf7c(0x1ef)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x23e537);}break;case'github-actions':if(_0x3acc68['yamllint']){const _0xdad36a=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0xdad36a);}break;case'env':const _0x462a8c=await this[_0x1baf7c(0x248)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x462a8c);break;case _0x1baf7c(0x1e0):if(_0x3acc68['yamllint']){const _0x3d4148=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x3d4148);}break;default:this[_0x1baf7c(0x1e5)]?.[_0x1baf7c(0x23d)](_0x1baf7c(0x20e),{'filePath':_0x6ff10b,'fileType':_0x4ee872});return[];}return this[_0x1baf7c(0x1e4)](_0x2f7b10);}async['validateDockerfile'](_0x3b48ad,_0x2cd95b={}){const _0x3b9a0e=a0_0x2b15;try{const _0x983fa0=await execAsync(_0x3b9a0e(0x23e)+_0x3b48ad+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x2ac6c0=JSON['parse'](_0x983fa0['stdout']);return this['parseHadolintResults'](_0x2ac6c0,_0x3b48ad);}catch(_0x5f49a8){if(_0x5f49a8[_0x3b9a0e(0x245)])try{const _0x5ec9b0=JSON[_0x3b9a0e(0x201)](_0x5f49a8['stdout']);return this['parseHadolintResults'](_0x5ec9b0,_0x3b48ad);}catch(_0xf1cca2){this['logger']?.[_0x3b9a0e(0x1f2)]('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0xf1cca2['message']});}return this['logger']?.[_0x3b9a0e(0x1f2)]('hadolint\x20validation\x20failed',{'error':_0x5f49a8[_0x3b9a0e(0x1f9)]}),[];}}['parseHadolintResults'](_0x4ee372,_0x474c4f){const _0x360137=a0_0x2b15,_0x177ac5=[];if(Array['isArray'](_0x4ee372))for(const _0x30fa55 of _0x4ee372){_0x177ac5[_0x360137(0x1d6)]({'file':_0x474c4f,'line':_0x30fa55[_0x360137(0x205)]||0x1,'column':_0x30fa55[_0x360137(0x1f6)]||0x1,'severity':this['mapHadolintSeverity'](_0x30fa55['level']),'rule':_0x30fa55['code'],'message':_0x30fa55[_0x360137(0x1f9)],'category':_0x360137(0x1f7),'validator':'hadolint'});}return _0x177ac5;}async['validateYAML'](_0x36c1ed,_0x11aea4={}){const _0x3d332d=a0_0x2b15;try{const _0x2722a2=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x36c1ed+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x3d332d(0x235)](_0x2722a2['stdout'],_0x36c1ed);}catch(_0x576590){if(_0x576590[_0x3d332d(0x245)])return this['parseYamllintResults'](_0x576590[_0x3d332d(0x245)],_0x36c1ed);return this[_0x3d332d(0x1e5)]?.['error']('yamllint\x20validation\x20failed',{'error':_0x576590['message']}),[];}}['parseYamllintResults'](_0x9187ec,_0x12cc66){const _0x19def8=a0_0x2b15,_0x34af1d=[],_0x494132=_0x9187ec[_0x19def8(0x1f5)]('\x0a')[_0x19def8(0x236)](_0x102a0f=>_0x102a0f[_0x19def8(0x241)]());for(const _0x37442e of _0x494132){const _0x5841b0=_0x37442e[_0x19def8(0x239)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x5841b0){const [,_0x3e3f20,_0x58cfc0,_0x30a432,_0x475be8,_0x54d8b7,_0x5f04ab]=_0x5841b0;_0x34af1d[_0x19def8(0x1d6)]({'file':_0x12cc66,'line':parseInt(_0x58cfc0,0xa),'column':parseInt(_0x30a432,0xa),'severity':this['mapYamllintSeverity'](_0x475be8),'rule':_0x5f04ab,'message':_0x54d8b7,'category':_0x19def8(0x1e0),'validator':'yamllint'});}}return _0x34af1d;}async[a0_0x4253e6(0x232)](_0x34fff2,_0x5e27fe,_0x5a38f6={}){const _0x8a9c15=a0_0x4253e6;try{const _0x3b4630=await execAsync(_0x8a9c15(0x238)+_0x34fff2+_0x8a9c15(0x208)+_0x5e27fe+_0x8a9c15(0x202),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x320f0c=JSON[_0x8a9c15(0x201)](_0x3b4630[_0x8a9c15(0x245)]);return this['parseCheckovResults'](_0x320f0c,_0x34fff2);}catch(_0x31e567){if(_0x31e567[_0x8a9c15(0x245)])try{const _0x23a0c3=JSON['parse'](_0x31e567['stdout']);return this['parseCheckovResults'](_0x23a0c3,_0x34fff2);}catch(_0x34f46f){this['logger']?.['error'](_0x8a9c15(0x1fb),{'error':_0x34f46f['message']});}return this[_0x8a9c15(0x1e5)]?.['error'](_0x8a9c15(0x1d7),{'error':_0x31e567[_0x8a9c15(0x1f9)]}),[];}}[a0_0x4253e6(0x23f)](_0x56e580,_0x204330){const _0x30d9dc=a0_0x4253e6,_0x13e60e=[];if(_0x56e580['results']&&_0x56e580['results'][_0x30d9dc(0x213)])for(const _0x5c8dc2 of _0x56e580['results'][_0x30d9dc(0x213)]){_0x13e60e['push']({'file':_0x204330,'line':_0x5c8dc2[_0x30d9dc(0x1ea)]?_0x5c8dc2['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x5c8dc2['check_class']),'rule':_0x5c8dc2['check_id'],'message':_0x5c8dc2['check_name']||_0x5c8dc2[_0x30d9dc(0x1e8)],'category':'security','validator':_0x30d9dc(0x212),'remediation':_0x5c8dc2[_0x30d9dc(0x225)],'cwe':_0x5c8dc2[_0x30d9dc(0x219)],'references':_0x5c8dc2[_0x30d9dc(0x225)]?[_0x5c8dc2['guideline']]:[]});}return _0x13e60e;}async['validatePackageJson'](_0x25b460,_0xabadf={}){const _0x1f7b41=a0_0x4253e6;try{const _0x23ebc0=(await import('ajv'))[_0x1f7b41(0x1de)],_0x49b09a=(await import(_0x1f7b41(0x1eb)))[_0x1f7b41(0x1de)],_0x3b904a=await a0_0x3c877b['readFile'](_0x25b460,'utf-8'),_0x761227=JSON[_0x1f7b41(0x201)](_0x3b904a),_0x3f4386=new _0x23ebc0({'allErrors':!![],'strict':![]});_0x49b09a(_0x3f4386);const _0x42ddeb={'type':_0x1f7b41(0x1f8),'required':['name',_0x1f7b41(0x247)],'properties':{'name':{'type':_0x1f7b41(0x22c),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':'string','enum':['module','commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x1f7b41(0x1f8)},'devDependencies':{'type':_0x1f7b41(0x1f8)}},'additionalProperties':!![]},_0x38e1e9=_0x3f4386[_0x1f7b41(0x206)](_0x42ddeb),_0x348764=_0x38e1e9(_0x761227);if(!_0x348764&&_0x38e1e9[_0x1f7b41(0x210)])return _0x38e1e9[_0x1f7b41(0x210)]['map'](_0x2d6ad0=>({'file':_0x25b460,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x1f7b41(0x220)]['ERROR'],'rule':_0x1f7b41(0x240),'message':_0x2d6ad0[_0x1f7b41(0x1db)]?_0x2d6ad0['instancePath']+'\x20'+_0x2d6ad0[_0x1f7b41(0x1f9)]:'must\x20have\x20required\x20property\x20\x27'+_0x2d6ad0[_0x1f7b41(0x230)]['missingProperty']+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x20a660){return this[_0x1f7b41(0x1e5)]?.[_0x1f7b41(0x1f2)]('package.json\x20validation\x20failed',{'error':_0x20a660[_0x1f7b41(0x1f9)]}),[{'file':_0x25b460,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1f7b41(0x1fe)],'rule':_0x1f7b41(0x229),'message':'Invalid\x20JSON:\x20'+_0x20a660['message'],'category':_0x1f7b41(0x1e1),'validator':'json-parse'}];}}async[a0_0x4253e6(0x1ef)](_0x154b5f,_0x2c2f8f={}){const _0x596684=a0_0x4253e6;try{const _0x1558e9=await a0_0x3c877b[_0x596684(0x1fd)](_0x154b5f,_0x596684(0x216)),_0x4fb3f5=JSON['parse'](_0x1558e9),_0x284490=[];if(_0x4fb3f5['compilerOptions']){const _0x19fd8b=_0x4fb3f5[_0x596684(0x242)];!_0x19fd8b['strict']&&_0x284490['push']({'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x596684(0x227),'message':_0x596684(0x1e7),'category':_0x596684(0x1dc),'validator':_0x596684(0x1f1)}),_0x19fd8b['noImplicitAny']===![]&&_0x284490[_0x596684(0x1d6)]({'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x596684(0x220)]['WARNING'],'rule':_0x596684(0x21d),'message':_0x596684(0x1df),'category':'best-practice','validator':_0x596684(0x1f1)});}return _0x284490;}catch(_0x265006){return this[_0x596684(0x1e5)]?.[_0x596684(0x1f2)]('tsconfig.json\x20validation\x20failed',{'error':_0x265006[_0x596684(0x1f9)]}),[{'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x596684(0x1fe)],'rule':_0x596684(0x229),'message':_0x596684(0x1e3)+_0x265006[_0x596684(0x1f9)],'category':_0x596684(0x1e1),'validator':'json-parse'}];}}async['validateEnvFile'](_0x2fe225,_0x4415e0={}){const _0x1db483=a0_0x4253e6;try{const _0x445fbc=await a0_0x3c877b['readFile'](_0x2fe225,_0x1db483(0x216)),_0x241898=[],_0x4d7e2e=_0x445fbc['split']('\x0a'),_0x41c9d1=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':_0x1db483(0x209)},{'pattern':/private[_-]?key/i,'name':_0x1db483(0x20d)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x4d7e2e['forEach']((_0x5e2859,_0x2c1ce0)=>{const _0x35a629=_0x1db483,_0x26d484=_0x5e2859[_0x35a629(0x241)]();if(!_0x26d484||_0x26d484[_0x35a629(0x21c)]('#'))return;if(_0x26d484['includes']('=')){const [_0x4988f8,_0x3b3a03]=_0x26d484['split']('='),_0x333552=_0x4988f8[_0x35a629(0x215)](),_0x3c56e3=_0x3b3a03?.[_0x35a629(0x241)]()||'',_0x51c3e7=_0x3c56e3&&_0x3c56e3!==''&&!_0x3c56e3[_0x35a629(0x21c)]('$')&&_0x3c56e3!=='your-key-here'&&_0x3c56e3!==_0x35a629(0x1dd)&&_0x3c56e3[_0x35a629(0x211)]>0x5;if(_0x51c3e7)for(const {pattern:_0x57e224,name:_0x1850b7}of _0x41c9d1){if(_0x57e224[_0x35a629(0x246)](_0x333552)){_0x241898[_0x35a629(0x1d6)]({'file':_0x2fe225,'line':_0x2c1ce0+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x35a629(0x220)]['CRITICAL'],'rule':'hardcoded-secret','message':_0x35a629(0x23c)+_0x1850b7+'\x20detected\x20in\x20.env\x20file','category':'security','validator':'env-validator','remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x241898;}catch(_0x383b2c){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x383b2c['message']}),[];}}['detectFileType'](_0x2441d6){const _0x1ef027=a0_0x4253e6,_0x5f402f=a0_0x589e12['basename'](_0x2441d6)['toLowerCase'](),_0x1ce333=a0_0x589e12['dirname'](_0x2441d6);if(_0x5f402f===_0x1ef027(0x1f7))return _0x1ef027(0x1f7);if(_0x5f402f===_0x1ef027(0x222)||_0x5f402f===_0x1ef027(0x22e))return'docker-compose';if(_0x5f402f==='package.json')return'package.json';if(_0x5f402f===_0x1ef027(0x21f))return'tsconfig.json';if(_0x5f402f==='.env'||_0x5f402f['endsWith']('.env'))return'env';if(_0x1ce333['includes']('.github/workflows'))return'github-actions';if(_0x1ce333['includes'](_0x1ef027(0x1ee))||_0x1ce333['includes'](_0x1ef027(0x1ec)))return _0x1ef027(0x1ee);const _0x4176f5=a0_0x589e12['extname'](_0x2441d6)['toLowerCase']();if(_0x4176f5==='.tf'||_0x4176f5===_0x1ef027(0x224))return'terraform';if(_0x4176f5==='.yml'||_0x4176f5===_0x1ef027(0x226))return _0x1ef027(0x1e0);if(_0x4176f5===_0x1ef027(0x237))return _0x1ef027(0x243);return'unknown';}[a0_0x4253e6(0x1e4)](_0x37ca84){const _0x210ac8=a0_0x4253e6;return _0x37ca84['map'](_0x578f8d=>({'file':_0x578f8d['file'],'line':_0x578f8d['line']||0x1,'column':_0x578f8d['column']||0x1,'severity':_0x578f8d[_0x210ac8(0x1d9)]||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x578f8d[_0x210ac8(0x1f0)]||'unknown','message':_0x578f8d[_0x210ac8(0x1f9)]||'Validation\x20issue\x20detected','category':_0x578f8d[_0x210ac8(0x223)]||_0x210ac8(0x1d4),'validator':_0x578f8d[_0x210ac8(0x1fc)],'cwe':_0x578f8d['cwe']||null,'remediation':_0x578f8d['remediation']||null,'references':_0x578f8d[_0x210ac8(0x20a)]||[]}));}[a0_0x4253e6(0x20b)](_0x370eda){const _0x3936cd=a0_0x4253e6,_0x586c74={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x228)],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x244)]};return _0x586c74[_0x370eda?.[_0x3936cd(0x215)]()]||STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x228)];}['mapYamllintSeverity'](_0x3502b8){const _0x57e771=a0_0x4253e6,_0x139eaf={'error':STATIC_ANALYSIS[_0x57e771(0x220)][_0x57e771(0x1fe)],'warning':STATIC_ANALYSIS[_0x57e771(0x220)]['WARNING']};return _0x139eaf[_0x3502b8?.['toLowerCase']()]||STATIC_ANALYSIS[_0x57e771(0x220)][_0x57e771(0x228)];}[a0_0x4253e6(0x1d8)](_0x2db3a3){const _0x53b4c2=a0_0x4253e6;return STATIC_ANALYSIS[_0x53b4c2(0x220)]['ERROR'];}async[a0_0x4253e6(0x1e6)](){const _0x185213=a0_0x4253e6,_0x517e3f=await this[_0x185213(0x1fa)]();return{'validators':_0x517e3f,'recommendations':this['getInstallRecommendations'](_0x517e3f)};}['getInstallRecommendations'](_0x56c50f){const _0x4a01a4=a0_0x4253e6,_0x31fa5b=[];return!_0x56c50f[_0x4a01a4(0x212)]&&_0x31fa5b['push']({'validator':_0x4a01a4(0x212),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':_0x4a01a4(0x1ff),'priority':'high'}),!_0x56c50f['hadolint']&&_0x31fa5b['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':_0x4a01a4(0x1da)}),!_0x56c50f['yamllint']&&_0x31fa5b['push']({'validator':'yamllint','reason':'YAML\x20file\x20validation','install':'pip\x20install\x20yamllint','priority':'medium'}),!_0x56c50f[_0x4a01a4(0x204)]&&_0x31fa5b[_0x4a01a4(0x1d6)]({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x4a01a4(0x23b),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x4a01a4(0x218)}),_0x31fa5b;}}export default ConfigValidator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a0_0x291e45=a0_0x23d0;(function(_0x54b4bf,_0x3a9c3b){const _0x599c62=a0_0x23d0,_0x35ca68=_0x54b4bf();while(!![]){try{const _0x40d0b5=-parseInt(_0x599c62(0xf3))/0x1+-parseInt(_0x599c62(0xee))/0x2*(-parseInt(_0x599c62(0xca))/0x3)+parseInt(_0x599c62(0xde))/0x4*(parseInt(_0x599c62(0xec))/0x5)+parseInt(_0x599c62(0xc8))/0x6*(parseInt(_0x599c62(0xe5))/0x7)+-parseInt(_0x599c62(0xd8))/0x8+parseInt(_0x599c62(0xd9))/0x9*(parseInt(_0x599c62(0xe2))/0xa)+-parseInt(_0x599c62(0xfa))/0xb;if(_0x40d0b5===_0x3a9c3b)break;else _0x35ca68['push'](_0x35ca68['shift']());}catch(_0x438b26){_0x35ca68['push'](_0x35ca68['shift']());}}}(a0_0x37a0,0xbfe15));import{ESLint}from'eslint';import a0_0x4cccf8 from'path';import a0_0x4a7477 from'fs/promises';function a0_0x37a0(){const _0x221999=['D2fYBMLUz0nVDw50','u0vdvvjjvfK','ChjLzMvYlxbYB21PC2uTCMvQzwn0lwvYCM9YCW','BM8TDw5YzwfJAgfIBgu','ndq4nJj6DhDPtNO','zMLSDgvY','mtKWmJndBxzbrLa','v0fstKLorW','BwvZC2fNzq','CMvTB3zLza','Aw5JBhvKzxm','yMvZDc1WCMfJDgLJzxm','CgvYzM9YBwfUy2u','BM8TDw51C2vKlxzHCNm','Bw9KDwXL','u0vwrvjjvfK','lMvZBgLUDhjJlMPZ','Bg9Nz2vY','zwnTyuzLyxr1CMvZ','EhnZ','mtm5mteWneXWvwHOtG','mtq4otvKs0jLzxm','ChvZAa','BgvUz3rO','zxnSAw50oNjLy29TBwvUzgvK','BgLUDfrLEhq','nte4mZi0yLvHBgnJ','BwvZC2fNzxm','CNvSzuLK','z2v0rvnmAw50q29UzMLN','ndC5meLOshrABq','C2v0DgLUz3m','y29SDw1U','mZC4yMDPtMXe','CMvHy3q','zgvZy3jPyMvdAgfUz2vZ','zML4','rvnmAw50igfUywX5C2LZignVBxbSzxrLza','BM8TDMfY','zM9YBwf0twvZC2fNzq','mtvjtwLUtNC','AM9PBG','mZq4A2Xvrg1U','zML4ywjSzuvYCM9Yq291BNq','u1rzteu','yw5HBhL6zq','q0furuDpuLK','mteXmde4mgrnyM5RAW','C3bSAxq','C2v2zxjPDhK','zxjYB3i','C2LUz2XL','lMPZ','ywnJzxnZ','nJGWndi4mufQCxvnuG','rvjst1i','zML4ywjSzvDHCM5PBMDdB3vUDa','Bwf4','zxnSAw50','D2fYBG','B3v0Chv0','y2f0zwDVCML6zvj1Bgu','zxH0zw5KCW','z2v0rvnmAw50sw5ZDgfUy2u'];a0_0x37a0=function(){return _0x221999;};return a0_0x37a0();}function a0_0x23d0(_0x45d404,_0x48e4cc){_0x45d404=_0x45d404-0xc4;const _0x37a025=a0_0x37a0();let _0x23d0e0=_0x37a025[_0x45d404];if(a0_0x23d0['AvosjP']===undefined){var _0x3ada3e=function(_0x120c17){const _0x50cdd4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4cccf8='',_0x4a7477='';for(let _0x18a8bc=0x0,_0x357d8a,_0x1b1502,_0x364949=0x0;_0x1b1502=_0x120c17['charAt'](_0x364949++);~_0x1b1502&&(_0x357d8a=_0x18a8bc%0x4?_0x357d8a*0x40+_0x1b1502:_0x1b1502,_0x18a8bc++%0x4)?_0x4cccf8+=String['fromCharCode'](0xff&_0x357d8a>>(-0x2*_0x18a8bc&0x6)):0x0){_0x1b1502=_0x50cdd4['indexOf'](_0x1b1502);}for(let _0x452e42=0x0,_0xc21cf3=_0x4cccf8['length'];_0x452e42<_0xc21cf3;_0x452e42++){_0x4a7477+='%'+('00'+_0x4cccf8['charCodeAt'](_0x452e42)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a7477);};a0_0x23d0['CWTBWI']=_0x3ada3e,a0_0x23d0['bHelEU']={},a0_0x23d0['AvosjP']=!![];}const _0x4801a5=_0x37a025[0x0],_0x9400=_0x45d404+_0x4801a5,_0x12effc=a0_0x23d0['bHelEU'][_0x9400];return!_0x12effc?(_0x23d0e0=a0_0x23d0['CWTBWI'](_0x23d0e0),a0_0x23d0['bHelEU'][_0x9400]=_0x23d0e0):_0x23d0e0=_0x12effc,_0x23d0e0;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x18a8bc=null){const _0x4fdf94=a0_0x23d0;this[_0x4fdf94(0xd5)]=_0x18a8bc,this['eslintCache']=new Map();}async[a0_0x291e45(0xf1)](_0x357d8a,_0x1b1502,_0x364949={}){const _0x751b33=a0_0x291e45;try{const _0x452e42=await this[_0x751b33(0x103)](_0x364949),_0xc21cf3=await _0x452e42['lintText'](_0x1b1502,{'filePath':_0x357d8a,'warnIgnored':![]}),_0x2e01f3=[];if(_0xc21cf3&&_0xc21cf3['length']>0x0){const _0x192151=_0xc21cf3[0x0];for(const _0x332e91 of _0x192151[_0x751b33(0xdf)]){_0x2e01f3['push'](this['formatMessage'](_0x332e91,_0x357d8a));}}return this['logger']?.['debug'](_0x751b33(0xe9),{'file':_0x357d8a,'totalDiagnostics':_0x2e01f3['length'],'errors':_0x2e01f3[_0x751b33(0xc9)](_0x5aa48b=>_0x5aa48b[_0x751b33(0xf5)]===STATIC_ANALYSIS['SEVERITY'][_0x751b33(0xfb)])[_0x751b33(0xdb)],'warnings':_0x2e01f3[_0x751b33(0xc9)](_0x13ba25=>_0x13ba25[_0x751b33(0xf5)]===STATIC_ANALYSIS['SEVERITY'][_0x751b33(0xcb)])['length']}),_0x2e01f3;}catch(_0x12295b){return this['logger']?.['error']('ESLint\x20analysis\x20failed',{'file':_0x357d8a,'error':_0x12295b[_0x751b33(0xcc)]}),[];}}async['fix'](_0x1a8a00,_0x66256e,_0x5121e5={}){const _0x585029=a0_0x291e45;try{const _0x1915ee=await this['getESLintInstance']({..._0x5121e5,'fix':!![]}),_0x137a0e=await _0x1915ee[_0x585029(0xdd)](_0x66256e,{'filePath':_0x1a8a00,'warnIgnored':![]});if(_0x137a0e&&_0x137a0e[_0x585029(0xdb)]>0x0){const _0x58e2ae=_0x137a0e[0x0];return{'fixed':_0x58e2ae['output']!==undefined,'content':_0x58e2ae[_0x585029(0x100)]||_0x66256e,'fixedCount':_0x58e2ae['fixableErrorCount']+_0x58e2ae[_0x585029(0xfc)],'remainingErrors':_0x58e2ae['errorCount']-_0x58e2ae[_0x585029(0xef)],'remainingWarnings':_0x58e2ae[_0x585029(0xc4)]-_0x58e2ae['fixableWarningCount'],'changes':_0x58e2ae['output']?this[_0x585029(0xe7)](_0x66256e,_0x58e2ae['output']):[]};}return{'fixed':![],'content':_0x66256e,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x26e29c){this[_0x585029(0xd5)]?.['error']('ESLint\x20fix\x20failed',{'file':_0x1a8a00,'error':_0x26e29c[_0x585029(0xcc)]});throw new Error('ESLint\x20fix\x20failed:\x20'+_0x26e29c['message']);}}async['getESLintInstance'](_0x3db309={}){const _0x31ce26=a0_0x291e45,{workingDir:_0x171977,fix:fix=![],framework:_0x4961a8}=_0x3db309,_0x3325ad=await this[_0x31ce26(0xe1)](_0x171977,_0x4961a8),_0x376136=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x3325ad,'errorOnUnmatchedPattern':![]});return _0x376136;}async['getESLintConfig'](_0xf30da2,_0x2c6c1e){const _0x52b910=a0_0x291e45,_0x27369f={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':'latest','sourceType':_0x52b910(0xd2)},'rules':{'no-unused-vars':_0x52b910(0xff),'no-undef':_0x52b910(0xf6),'no-console':'off','semi':[_0x52b910(0xff),'always'],'quotes':['warn',_0x52b910(0xf7),{'avoidEscape':!![]}]}};if(_0x2c6c1e===_0x52b910(0xe6))_0x27369f['extends']=['eslint:recommended'],_0x27369f['parserOptions'][_0x52b910(0xd6)]={'jsx':!![]},_0x27369f[_0x52b910(0xe3)]={'react':{'version':'detect'}};else _0x2c6c1e==='vue'?_0x27369f['extends']=['eslint:recommended']:_0x27369f[_0x52b910(0x102)]=[_0x52b910(0xdc)];if(_0xf30da2){const _0x5a8857=[_0x52b910(0xd4),'.eslintrc.cjs','.eslintrc.json','eslint.config.js'];for(const _0xa16679 of _0x5a8857){try{const _0x3cf4d4=a0_0x4cccf8[_0x52b910(0xed)](_0xf30da2,_0xa16679);return await a0_0x4a7477[_0x52b910(0xf9)](_0x3cf4d4),this['logger']?.['debug']('Found\x20ESLint\x20config',{'configFile':_0xa16679}),{};}catch{}}}return _0x27369f;}[a0_0x291e45(0xeb)](_0x550d32,_0x554c05){const _0x5e41ee=a0_0x291e45;return{'file':_0x554c05,'line':_0x550d32['line']||0x1,'column':_0x550d32[_0x5e41ee(0xe4)]||0x1,'endLine':_0x550d32['endLine'],'endColumn':_0x550d32['endColumn'],'severity':_0x550d32[_0x5e41ee(0xf5)]===0x2?STATIC_ANALYSIS[_0x5e41ee(0xd3)][_0x5e41ee(0xfb)]:STATIC_ANALYSIS[_0x5e41ee(0xd3)]['WARNING'],'rule':_0x550d32[_0x5e41ee(0xe0)]||_0x5e41ee(0xfe),'message':_0x550d32[_0x5e41ee(0xcc)],'category':this[_0x5e41ee(0x101)](_0x550d32[_0x5e41ee(0xe0)]),'fixable':_0x550d32[_0x5e41ee(0xe8)]!==undefined,'source':'eslint'};}[a0_0x291e45(0x101)](_0x57a02c){const _0x47a3fd=a0_0x291e45;if(!_0x57a02c)return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['STYLE'];if(_0x57a02c[_0x47a3fd(0xce)]('security')||_0x57a02c['includes'](_0x47a3fd(0xd7))||_0x57a02c==='no-eval'||_0x57a02c==='no-implied-eval')return STATIC_ANALYSIS[_0x47a3fd(0xf2)][_0x47a3fd(0xc5)];if(_0x57a02c['includes'](_0x47a3fd(0xd0))||_0x57a02c==='no-await-in-loop'||_0x57a02c===_0x47a3fd(0xc6))return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['PERFORMANCE'];if(_0x57a02c[_0x47a3fd(0xce)]('import')||_0x57a02c==='no-undef')return STATIC_ANALYSIS['CATEGORY']['IMPORT'];if(_0x57a02c['includes'](_0x47a3fd(0xcf))||_0x57a02c===_0x47a3fd(0xd1)||_0x57a02c===_0x47a3fd(0xc7)||_0x57a02c===_0x47a3fd(0xea))return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['BEST_PRACTICE'];return STATIC_ANALYSIS['CATEGORY'][_0x47a3fd(0xf0)];}['describeChanges'](_0x160372,_0x4caeae){const _0x4223c5=a0_0x291e45,_0xcbdff1=[],_0x3e16c3=_0x160372['split']('\x0a'),_0x592638=_0x4caeae[_0x4223c5(0xf4)]('\x0a'),_0x55ac8b=Math[_0x4223c5(0xfd)](_0x3e16c3[_0x4223c5(0xdb)],_0x592638['length']);for(let _0x3cb571=0x0;_0x3cb571<_0x55ac8b;_0x3cb571++){const _0x4565fb=_0x3e16c3[_0x3cb571]||'',_0x59bf4e=_0x592638[_0x3cb571]||'';_0x4565fb!==_0x59bf4e&&_0xcbdff1[_0x4223c5(0xda)]({'line':_0x3cb571+0x1,'type':_0x4565fb&&_0x59bf4e?'modified':_0x4565fb?_0x4223c5(0xcd):'added','original':_0x4565fb,'fixed':_0x59bf4e});}return _0xcbdff1;}['getSupportedExtensions'](){const _0x5f3e66=a0_0x291e45;return[_0x5f3e66(0xf8),'.jsx','.mjs','.cjs'];}['supportsAutoFix'](){return!![];}}export default ESLintAnalyzer;
|