@loxia-labs/loxia-autopilot-one 1.0.13 → 1.0.14
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 +7 -3
- 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/agentActivityService.js +1 -0
- 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/src/utilities/userDataDir.js +1 -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.14
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
### 4. Create an API Key
|
|
@@ -202,8 +202,9 @@ Loxia comes with 18+ specialized tools that agents can use autonomously:
|
|
|
202
202
|
| Tool | Description | Key Features |
|
|
203
203
|
|------|-------------|--------------|
|
|
204
204
|
| ⏸️ **Agent Delay** | Pause agent execution | Timed delays, background operation support |
|
|
205
|
-
| ✅ **Job Done** | Task completion | Mark
|
|
205
|
+
| ✅ **Job Done** | Task completion | Mark autonomous work complete, exit to chat mode |
|
|
206
206
|
| 🔧 **Async Tool Manager** | Background task handling | Long-running operations, status tracking |
|
|
207
|
+
| 🔄 **Loop Detection** | Repetition prevention | Sliding window analysis, automatic termination |
|
|
207
208
|
|
|
208
209
|
---
|
|
209
210
|
|
|
@@ -368,7 +369,7 @@ Loxia automatically compacts long conversations to stay within token limits:
|
|
|
368
369
|
|
|
369
370
|
## 🛣️ Roadmap
|
|
370
371
|
|
|
371
|
-
### Current Version (1.0.
|
|
372
|
+
### Current Version (1.0.14)
|
|
372
373
|
|
|
373
374
|
- ✅ Multi-agent orchestration
|
|
374
375
|
- ✅ 18+ specialized tools
|
|
@@ -376,6 +377,9 @@ Loxia automatically compacts long conversations to stay within token limits:
|
|
|
376
377
|
- ✅ Conversation compaction
|
|
377
378
|
- ✅ File attachments
|
|
378
379
|
- ✅ Task management
|
|
380
|
+
- ✅ Centralized agent activity service
|
|
381
|
+
- ✅ Intelligent loop detection
|
|
382
|
+
- ✅ Persistent user data across npm updates
|
|
379
383
|
|
|
380
384
|
### Upcoming Features
|
|
381
385
|
|
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const a0_0xbede4f=a0_0x1417;(function(_0x1edeb3,_0x41efbd){const _0x4689af=a0_0x1417,_0x4b6977=_0x1edeb3();while(!![]){try{const _0x2c1c6d=parseInt(_0x4689af(0x10e))/0x1*(-parseInt(_0x4689af(0x122))/0x2)+parseInt(_0x4689af(0xfb))/0x3+-parseInt(_0x4689af(0xe8))/0x4*(parseInt(_0x4689af(0xe7))/0x5)+-parseInt(_0x4689af(0x11a))/0x6*(parseInt(_0x4689af(0xff))/0x7)+-parseInt(_0x4689af(0x121))/0x8*(-parseInt(_0x4689af(0x10b))/0x9)+parseInt(_0x4689af(0xf3))/0xa+parseInt(_0x4689af(0xe4))/0xb;if(_0x2c1c6d===_0x41efbd)break;else _0x4b6977['push'](_0x4b6977['shift']());}catch(_0x397cc9){_0x4b6977['push'](_0x4b6977['shift']());}}}(a0_0x1af8,0x2160d));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';function a0_0x1af8(){const _0x49242e=['destroy','\x0aLoxia\x20Autopilot\x20One\x20v','port','log','src','696xQJRZu','web','Could\x20not\x20open\x20browser\x20automatically.','parse','\x0aServer\x20is\x20not\x20running\x20at\x20','--help','Please\x20open\x20manually:\x20','1510656SyMbTs','32eGKcym','help','utf8','1959188tnDQoF','win32','SIGINT','15ZTdwJq','346660UNmUie','statusCode','Checking\x20if\x20server\x20is\x20running...','node','env','\x0aShutting\x20down\x20server...','host','toString','Unknown\x20command:\x20','LOXIA_HOST','Error:','748200QbKvYW','catch','open\x20\x22','package.json','includes','http://','Waiting\x20for\x20server\x20to\x20start...','startsWith','396348SxQFDP','ignore','SIGTERM','\x20manually.','6377BhBDef','xdg-open\x20\x22','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','version',')\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','/api/health','argv','error','Starting\x20Terminal\x20UI...\x0a','--port','inherit','Starting\x20Loxia\x20server...\x0a','9ZTbndg','Starting\x20Loxia\x20server\x20in\x20background...','exit','4468WGDMRZ','Server\x20is\x20running\x20at\x20','\x0aPlease\x20start\x20the\x20server\x20first:','kill','slice','ceil','loxia-terminal.js'];a0_0x1af8=function(){return _0x49242e;};return a0_0x1af8();}import a0_0x76563a from'http';function a0_0x1417(_0xd3e514,_0x4b1e98){_0xd3e514=_0xd3e514-0xe2;const _0x1af868=a0_0x1af8();let _0x1417b1=_0x1af868[_0xd3e514];return _0x1417b1;}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0xbede4f(0x105)][a0_0xbede4f(0x112)](0x2),command=args[0x0]&&!args[0x0][a0_0xbede4f(0xfa)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0xbede4f(0xf7)](a0_0xbede4f(0x11f))||args['includes']('-h'),'version':args[a0_0xbede4f(0xf7)]('--version')||args[a0_0xbede4f(0xf7)]('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0xbede4f(0x108)&&args[i+0x1]&&(flags[a0_0xbede4f(0x117)]=parseInt(args[i+0x1],0xa)),args[i]==='--host'&&args[i+0x1]&&(flags['host']=args[i+0x1]);}const port=flags[a0_0xbede4f(0x117)]||DEFAULT_PORT,host=flags[a0_0xbede4f(0xee)]||DEFAULT_HOST,serverUrl=a0_0xbede4f(0xf8)+host+':'+port;if(flags[a0_0xbede4f(0x102)]){const pkgPath=join(__dirname,'..',a0_0xbede4f(0xf6)),pkg=JSON[a0_0xbede4f(0x11d)](readFileSync(pkgPath,a0_0xbede4f(0xe3)));console[a0_0xbede4f(0x118)]('Loxia\x20Autopilot\x20One\x20v'+pkg[a0_0xbede4f(0x102)]),process[a0_0xbede4f(0x10d)](0x0);}if(flags[a0_0xbede4f(0xe2)]||!command){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0xbede4f(0x11d)](readFileSync(pkgPath,a0_0xbede4f(0xe3)));console['log'](a0_0xbede4f(0x116)+pkg[a0_0xbede4f(0x102)]+'\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+')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20'+DEFAULT_HOST+a0_0xbede4f(0x103)),process['exit'](0x0);}async function checkServerRunning(_0x438e2e,_0x1089f1,_0x4d8384=0x1){for(let _0x28a420=0x0;_0x28a420<_0x4d8384;_0x28a420++){const _0x3f54a0=await new Promise(_0x235735=>{const _0x3b3026=a0_0x1417,_0x359924=a0_0x76563a['get'](_0x3b3026(0xf8)+_0x438e2e+':'+_0x1089f1+_0x3b3026(0x104),_0x4f0f74=>{const _0x54c757=_0x3b3026;_0x235735(_0x4f0f74[_0x54c757(0xe9)]===0xc8);});_0x359924['on']('error',()=>_0x235735(![])),_0x359924['setTimeout'](0x7d0,()=>{const _0x368466=_0x3b3026;_0x359924[_0x368466(0x115)](),_0x235735(![]);});});if(_0x3f54a0)return!![];_0x28a420<_0x4d8384-0x1&&await new Promise(_0x3421ff=>setTimeout(_0x3421ff,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x15fe32,_0x4a979,_0x498a82=SERVER_STARTUP_TIMEOUT){const _0x557e5a=a0_0xbede4f,_0x422ad2=Math[_0x557e5a(0x113)](_0x498a82/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x15fe32,_0x4a979,_0x422ad2);}function openBrowser(_0x526b9e){const _0x3962a6=a0_0xbede4f,_0x5b480e=process['platform'];let _0x358219;if(_0x5b480e==='darwin')_0x358219=_0x3962a6(0xf5)+_0x526b9e+'\x22';else _0x5b480e===_0x3962a6(0xe5)?_0x358219='start\x20\x22\x22\x20\x22'+_0x526b9e+'\x22':_0x358219=_0x3962a6(0x100)+_0x526b9e+'\x22';exec(_0x358219,_0x4a9e42=>{const _0x2e2348=_0x3962a6;_0x4a9e42&&(console[_0x2e2348(0x118)](_0x2e2348(0x11c)),console[_0x2e2348(0x118)](_0x2e2348(0x120)+_0x526b9e));});}function startServer(_0x2a5526=![]){const _0x5a87d4=a0_0xbede4f,_0x540087={...process['env'],'LOXIA_PORT':port[_0x5a87d4(0xef)](),'PORT':port[_0x5a87d4(0xef)]()};flags[_0x5a87d4(0xee)]&&(_0x540087[_0x5a87d4(0xf1)]=flags[_0x5a87d4(0xee)]);const _0x58e424=join(__dirname,'..',_0x5a87d4(0x119),'index.js'),_0x6c82ef=spawn(_0x5a87d4(0xeb),[_0x58e424],{'cwd':join(__dirname,'..'),'env':_0x540087,'stdio':_0x2a5526?[_0x5a87d4(0xfc),_0x5a87d4(0xfc),_0x5a87d4(0xfc)]:_0x5a87d4(0x109),'detached':_0x2a5526});return _0x2a5526&&_0x6c82ef['unref'](),_0x6c82ef;}function startTerminalUI(){const _0x32f9d2=a0_0xbede4f,_0x128e9e=join(__dirname,_0x32f9d2(0x114)),_0x5438de={...process[_0x32f9d2(0xec)],'LOXIA_PORT':port[_0x32f9d2(0xef)](),'LOXIA_HOST':host},_0x1554c9=spawn(_0x32f9d2(0xeb),[_0x128e9e],{'cwd':join(__dirname,'..'),'env':_0x5438de,'stdio':_0x32f9d2(0x109)});return _0x1554c9;}const commands={'web':async()=>{const _0x3099c9=a0_0xbede4f;console[_0x3099c9(0x118)](_0x3099c9(0x10a));const _0x365622=startServer(![]);console[_0x3099c9(0x118)](_0x3099c9(0xf9));const _0x13c03a=await waitForServer(host,port);_0x13c03a?(console['log']('\x0aOpening\x20Web\x20UI\x20at\x20'+serverUrl),openBrowser(serverUrl)):console[_0x3099c9(0x118)]('\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20'+serverUrl+_0x3099c9(0xfe)),process['on'](_0x3099c9(0xe6),()=>_0x365622[_0x3099c9(0x111)](_0x3099c9(0xe6))),process['on']('SIGTERM',()=>_0x365622[_0x3099c9(0x111)](_0x3099c9(0xfd))),_0x365622['on'](_0x3099c9(0x10d),_0x5ad9f9=>process[_0x3099c9(0x10d)](_0x5ad9f9||0x0));},'plus-web':async()=>{const _0x246639=a0_0xbede4f;await commands[_0x246639(0x11b)]();},'terminal':async()=>{const _0x5f18cc=a0_0xbede4f;console['log'](_0x5f18cc(0xea));const _0x57176a=await checkServerRunning(host,port);!_0x57176a&&(console['error'](_0x5f18cc(0x11e)+serverUrl),console[_0x5f18cc(0x106)](_0x5f18cc(0x110)),console[_0x5f18cc(0x106)]('\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI'),console['error'](_0x5f18cc(0x101)),process[_0x5f18cc(0x10d)](0x1));console[_0x5f18cc(0x118)](_0x5f18cc(0x10f)+serverUrl),console[_0x5f18cc(0x118)](_0x5f18cc(0x107));const _0x3955fa=startTerminalUI();process['on']('SIGINT',()=>_0x3955fa[_0x5f18cc(0x111)](_0x5f18cc(0xe6))),process['on'](_0x5f18cc(0xfd),()=>_0x3955fa[_0x5f18cc(0x111)](_0x5f18cc(0xfd))),_0x3955fa['on']('exit',_0x1fcde0=>process[_0x5f18cc(0x10d)](_0x1fcde0||0x0));},'plus-terminal':async()=>{const _0x493a93=a0_0xbede4f;console['log'](_0x493a93(0x10c));const _0x2f9cfd=startServer(!![]),_0x256bf8=await waitForServer(host,port);!_0x256bf8&&(console[_0x493a93(0x106)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process['exit'](0x1));console['log']('Server\x20running\x20at\x20'+serverUrl),console[_0x493a93(0x118)](_0x493a93(0x107));const _0x5a6726=startTerminalUI();_0x5a6726['on']('exit',_0x282de8=>{const _0xefad54=_0x493a93;console[_0xefad54(0x118)](_0xefad54(0xed));try{process['kill'](_0x2f9cfd['pid'],_0xefad54(0xfd));}catch(_0x1f79db){}process[_0xefad54(0x10d)](_0x282de8||0x0);}),process['on'](_0x493a93(0xe6),()=>{const _0x1807ab=_0x493a93;_0x5a6726[_0x1807ab(0x111)](_0x1807ab(0xe6));}),process['on']('SIGTERM',()=>{const _0x2ba298=_0x493a93;_0x5a6726[_0x2ba298(0x111)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0xbede4f(0xf4)](_0x174ba3=>{const _0x30446a=a0_0xbede4f;console[_0x30446a(0x106)](_0x30446a(0xf2),_0x174ba3['message']),process[_0x30446a(0x10d)](0x1);}):(console['error'](a0_0xbede4f(0xf0)+command),console[a0_0xbede4f(0x106)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process['exit'](0x1));
|
|
3
|
+
const a0_0x20cb28=a0_0x4bad;function a0_0x4bad(_0x77b389,_0x20616e){_0x77b389=_0x77b389-0xbb;const _0x411973=a0_0x4119();let _0x4badc6=_0x411973[_0x77b389];return _0x4badc6;}(function(_0xc749f4,_0x449c4d){const _0x43a51e=a0_0x4bad,_0x18d3df=_0xc749f4();while(!![]){try{const _0x255a64=-parseInt(_0x43a51e(0xf7))/0x1*(-parseInt(_0x43a51e(0xcd))/0x2)+-parseInt(_0x43a51e(0xef))/0x3*(-parseInt(_0x43a51e(0x105))/0x4)+parseInt(_0x43a51e(0xdc))/0x5*(parseInt(_0x43a51e(0xe5))/0x6)+-parseInt(_0x43a51e(0xee))/0x7+-parseInt(_0x43a51e(0xe6))/0x8*(-parseInt(_0x43a51e(0xe4))/0x9)+-parseInt(_0x43a51e(0x102))/0xa+-parseInt(_0x43a51e(0xea))/0xb;if(_0x255a64===_0x449c4d)break;else _0x18d3df['push'](_0x18d3df['shift']());}catch(_0xc8d689){_0x18d3df['push'](_0x18d3df['shift']());}}}(a0_0x4119,0xc2d2a));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x18e68e from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x20cb28(0xd9),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process['argv'][a0_0x20cb28(0xe2)](0x2),command=args[0x0]&&!args[0x0][a0_0x20cb28(0xbb)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x20cb28(0x106)]('--help')||args[a0_0x20cb28(0x106)]('-h'),'version':args['includes'](a0_0x20cb28(0xfb))||args['includes']('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x20cb28(0xce)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x20cb28(0xe1)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}const port=flags[a0_0x20cb28(0xe3)]||DEFAULT_PORT,host=flags[a0_0x20cb28(0xff)]||DEFAULT_HOST,serverUrl='http://'+host+':'+port;if(flags[a0_0x20cb28(0xc5)]){const pkgPath=join(__dirname,'..',a0_0x20cb28(0xf3)),pkg=JSON[a0_0x20cb28(0xc6)](readFileSync(pkgPath,a0_0x20cb28(0xf0)));console['log'](a0_0x20cb28(0xcf)+pkg[a0_0x20cb28(0xc5)]),process[a0_0x20cb28(0xdb)](0x0);}if(flags[a0_0x20cb28(0xd4)]||!command){const pkgPath=join(__dirname,'..',a0_0x20cb28(0xf3)),pkg=JSON[a0_0x20cb28(0xc6)](readFileSync(pkgPath,a0_0x20cb28(0xf0)));console[a0_0x20cb28(0xed)](a0_0x20cb28(0xf1)+pkg[a0_0x20cb28(0xc5)]+'\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_0x20cb28(0xc4)+DEFAULT_HOST+a0_0x20cb28(0xf2)),process['exit'](0x0);}async function checkServerRunning(_0x28014d,_0x193c2a,_0x584934=0x1){for(let _0x55d444=0x0;_0x55d444<_0x584934;_0x55d444++){const _0x25744d=await new Promise(_0x29c34d=>{const _0x5d9af2=a0_0x4bad,_0x2c4ae0=a0_0x18e68e[_0x5d9af2(0xbf)](_0x5d9af2(0xd7)+_0x28014d+':'+_0x193c2a+_0x5d9af2(0xf4),_0x28f7ec=>{const _0x2c8b94=_0x5d9af2;_0x29c34d(_0x28f7ec[_0x2c8b94(0xf8)]===0xc8);});_0x2c4ae0['on'](_0x5d9af2(0x103),()=>_0x29c34d(![])),_0x2c4ae0[_0x5d9af2(0xc1)](0x7d0,()=>{const _0x417a5a=_0x5d9af2;_0x2c4ae0[_0x417a5a(0x107)](),_0x29c34d(![]);});});if(_0x25744d)return!![];_0x55d444<_0x584934-0x1&&await new Promise(_0x3f5158=>setTimeout(_0x3f5158,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x452945,_0x179c3b,_0x17fa3f=SERVER_STARTUP_TIMEOUT){const _0x4db531=a0_0x20cb28,_0x258b12=Math[_0x4db531(0xd3)](_0x17fa3f/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x452945,_0x179c3b,_0x258b12);}function openBrowser(_0x446678){const _0xe237df=a0_0x20cb28,_0x332014=process[_0xe237df(0xc0)];let _0x2120c5;if(_0x332014===_0xe237df(0xcc))_0x2120c5=_0xe237df(0xfa)+_0x446678+'\x22';else _0x332014===_0xe237df(0xf6)?_0x2120c5=_0xe237df(0xda)+_0x446678+'\x22':_0x2120c5=_0xe237df(0x101)+_0x446678+'\x22';exec(_0x2120c5,_0x2b621a=>{const _0x3265b5=_0xe237df;_0x2b621a&&(console[_0x3265b5(0xed)](_0x3265b5(0xc9)),console[_0x3265b5(0xed)](_0x3265b5(0xe9)+_0x446678));});}function startServer(_0x4097b1=![]){const _0x227c4f=a0_0x20cb28,_0x4d0220={...process['env'],'LOXIA_PORT':port['toString'](),'PORT':port['toString']()};flags['host']&&(_0x4d0220['LOXIA_HOST']=flags[_0x227c4f(0xff)]);const _0x1e8555=join(__dirname,'..',_0x227c4f(0xc3),_0x227c4f(0xf5)),_0x280e1c=spawn('node',[_0x1e8555],{'cwd':join(__dirname,'..'),'env':_0x4d0220,'stdio':_0x4097b1?[_0x227c4f(0xfd),_0x227c4f(0xfd),_0x227c4f(0xfd)]:_0x227c4f(0xcb),'detached':_0x4097b1});return _0x4097b1&&_0x280e1c[_0x227c4f(0xde)](),_0x280e1c;}function startTerminalUI(){const _0x3a6fe0=a0_0x20cb28,_0x422de8=join(__dirname,_0x3a6fe0(0xe7)),_0x361614={...process[_0x3a6fe0(0xe0)],'LOXIA_PORT':port['toString'](),'LOXIA_HOST':host},_0x33e343=spawn(_0x3a6fe0(0xc7),[_0x422de8],{'cwd':join(__dirname,'..'),'env':_0x361614,'stdio':_0x3a6fe0(0xcb)});return _0x33e343;}function a0_0x4119(){const _0x366277=['8088340qfxcPJ','error','message','804JYACpw','includes','destroy','\x0aOpening\x20Web\x20UI\x20at\x20','startsWith','Error:','Server\x20is\x20running\x20at\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','get','platform','setTimeout','web','src',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','version','parse','node','SIGINT','Could\x20not\x20open\x20browser\x20automatically.','Starting\x20Loxia\x20server\x20in\x20background...','inherit','darwin','49458RJeGfA','--port','Loxia\x20Autopilot\x20One\x20v','Server\x20running\x20at\x20','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','ceil','help','catch','kill','http://','\x20manually.','localhost','start\x20\x22\x22\x20\x22','exit','6404725CQuUIc','pid','unref','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','env','--host','slice','port','81CHwCWC','6lkzbZI','484856GXIzze','loxia-terminal.js','Starting\x20Terminal\x20UI...\x0a','Please\x20open\x20manually:\x20','28857763BbPGrF','SIGTERM','\x0aShutting\x20down\x20server...','log','130928lOpdqV','17334BOxZQm','utf8','\x0aLoxia\x20Autopilot\x20One\x20v',')\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','package.json','/api/health','index.js','win32','51RaJKki','statusCode','\x0aPlease\x20start\x20the\x20server\x20first:','open\x20\x22','--version','Waiting\x20for\x20server\x20to\x20start...','ignore','Unknown\x20command:\x20','host','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','xdg-open\x20\x22'];a0_0x4119=function(){return _0x366277;};return a0_0x4119();}const commands={'web':async()=>{const _0x15ea42=a0_0x20cb28;console[_0x15ea42(0xed)]('Starting\x20Loxia\x20server...\x0a');const _0x1977fd=startServer(![]);console[_0x15ea42(0xed)](_0x15ea42(0xfc));const _0xf17734=await waitForServer(host,port);_0xf17734?(console[_0x15ea42(0xed)](_0x15ea42(0x108)+serverUrl),openBrowser(serverUrl)):console[_0x15ea42(0xed)](_0x15ea42(0xdf)+serverUrl+_0x15ea42(0xd8)),process['on'](_0x15ea42(0xc8),()=>_0x1977fd[_0x15ea42(0xd6)](_0x15ea42(0xc8))),process['on'](_0x15ea42(0xeb),()=>_0x1977fd['kill'](_0x15ea42(0xeb))),_0x1977fd['on'](_0x15ea42(0xdb),_0xdb146c=>process[_0x15ea42(0xdb)](_0xdb146c||0x0));},'plus-web':async()=>{const _0x19d2af=a0_0x20cb28;await commands[_0x19d2af(0xc2)]();},'terminal':async()=>{const _0x7376ab=a0_0x20cb28;console[_0x7376ab(0xed)]('Checking\x20if\x20server\x20is\x20running...');const _0x199396=await checkServerRunning(host,port);!_0x199396&&(console[_0x7376ab(0x103)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console[_0x7376ab(0x103)](_0x7376ab(0xf9)),console[_0x7376ab(0x103)](_0x7376ab(0xd1)),console[_0x7376ab(0x103)](_0x7376ab(0xd2)),process['exit'](0x1));console[_0x7376ab(0xed)](_0x7376ab(0xbd)+serverUrl),console['log'](_0x7376ab(0xe8));const _0x457bd2=startTerminalUI();process['on']('SIGINT',()=>_0x457bd2['kill'](_0x7376ab(0xc8))),process['on'](_0x7376ab(0xeb),()=>_0x457bd2[_0x7376ab(0xd6)]('SIGTERM')),_0x457bd2['on']('exit',_0x5922e7=>process[_0x7376ab(0xdb)](_0x5922e7||0x0));},'plus-terminal':async()=>{const _0x373936=a0_0x20cb28;console['log'](_0x373936(0xca));const _0x541583=startServer(!![]),_0x2ff221=await waitForServer(host,port);!_0x2ff221&&(console[_0x373936(0x103)](_0x373936(0x100)),process[_0x373936(0xdb)](0x1));console['log'](_0x373936(0xd0)+serverUrl),console['log'](_0x373936(0xe8));const _0x48683f=startTerminalUI();_0x48683f['on'](_0x373936(0xdb),_0xed7ee=>{const _0x311511=_0x373936;console['log'](_0x311511(0xec));try{process['kill'](_0x541583[_0x311511(0xdd)],_0x311511(0xeb));}catch(_0x102b7b){}process['exit'](_0xed7ee||0x0);}),process['on'](_0x373936(0xc8),()=>{const _0x212b76=_0x373936;_0x48683f[_0x212b76(0xd6)](_0x212b76(0xc8));}),process['on'](_0x373936(0xeb),()=>{const _0x3dc8f8=_0x373936;_0x48683f[_0x3dc8f8(0xd6)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x20cb28(0xd5)](_0xda4bf7=>{const _0x4a562c=a0_0x20cb28;console[_0x4a562c(0x103)](_0x4a562c(0xbc),_0xda4bf7[_0x4a562c(0x104)]),process[_0x4a562c(0xdb)](0x1);}):(console[a0_0x20cb28(0x103)](a0_0x20cb28(0xfe)+command),console['error'](a0_0x20cb28(0xbe)),process[a0_0x20cb28(0xdb)](0x1));
|
package/bin/loxia-terminal-v2.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x4b6ec5=a0_0x18a8;(function(_0x45a9b6,_0x5da477){const _0x4fdea8=a0_0x18a8,_0x1fb582=_0x45a9b6();while(!![]){try{const _0x20f106=-parseInt(_0x4fdea8(0xdc))/0x1*(parseInt(_0x4fdea8(0xe1))/0x2)+-parseInt(_0x4fdea8(0xe9))/0x3*(parseInt(_0x4fdea8(0xd1))/0x4)+parseInt(_0x4fdea8(0xd2))/0x5+parseInt(_0x4fdea8(0xe5))/0x6+parseInt(_0x4fdea8(0xd3))/0x7+-parseInt(_0x4fdea8(0xc9))/0x8+parseInt(_0x4fdea8(0xe4))/0x9;if(_0x20f106===_0x5da477)break;else _0x1fb582['push'](_0x1fb582['shift']());}catch(_0x27cb94){_0x1fb582['push'](_0x1fb582['shift']());}}}(a0_0x59d4,0xb6453));import{spawn}from'child_process';function a0_0x18a8(_0x51b6db,_0x38d2f9){_0x51b6db=_0x51b6db-0xc5;const _0x59d45f=a0_0x59d4();let _0x18a888=_0x59d45f[_0x51b6db];return _0x18a888;}import a0_0x21508e from'net';function a0_0x59d4(){const _0x20004d=['exit','...','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','LOXIA_PORT','dirname','slice','ignore','677170hlqmbF','--port','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','message','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','2kdZkUb','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','✓\x20Server\x20is\x20already\x20running\x20at\x20','5365395qhkCBv','4813704JkQhsg','length','stderr','Failed\x20to\x20start\x20server:','163143qHxsrc','--host','bin/cli.js','join','kill','stdout','toString','web','destroy','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','node','error','env','--ui','localhost','now','💡\x20Troubleshooting:','connect','3162288umAlZE','pipe','Server\x20startup\x20timeout','timeout','LOXIA_HOST','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','Socket','log','52TaiPRS','3718965yRUEov','2686292kzdYSm'];a0_0x59d4=function(){return _0x20004d;};return a0_0x59d4();}import a0_0x528584 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x528584['dirname'](__filename),projectRoot=a0_0x528584[a0_0x4b6ec5(0xd9)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x4b6ec5(0xc5),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x4960df,_0x4042f5){return new Promise(_0x3f1c80=>{const _0x20a07d=a0_0x18a8,_0x5e154c=new a0_0x21508e[(_0x20a07d(0xcf))]();_0x5e154c['setTimeout'](0x7d0),_0x5e154c['on'](_0x20a07d(0xc8),()=>{_0x5e154c['destroy'](),_0x3f1c80(!![]);}),_0x5e154c['on'](_0x20a07d(0xcc),()=>{const _0x45890f=_0x20a07d;_0x5e154c[_0x45890f(0xf1)](),_0x3f1c80(![]);}),_0x5e154c['on'](_0x20a07d(0xf4),()=>{const _0x5d21a1=_0x20a07d;_0x5e154c[_0x5d21a1(0xf1)](),_0x3f1c80(![]);}),_0x5e154c[_0x20a07d(0xc8)](_0x4042f5,_0x4960df);});}async function startServer(_0x34f70c,_0x5700e3){const _0x523d40=a0_0x4b6ec5;return console[_0x523d40(0xd0)]('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0x5e645f,_0x2f93bf)=>{const _0x2ef3da=_0x523d40,_0x171e73=spawn(_0x2ef3da(0xf3),[a0_0x528584[_0x2ef3da(0xec)](projectRoot,_0x2ef3da(0xeb)),_0x2ef3da(0xf6),_0x2ef3da(0xf0),_0x2ef3da(0xea),_0x34f70c,_0x2ef3da(0xdd),_0x5700e3[_0x2ef3da(0xef)]()],{'detached':![],'stdio':[_0x2ef3da(0xdb),_0x2ef3da(0xca),_0x2ef3da(0xca)]});_0x171e73[_0x2ef3da(0xee)]['on']('data',()=>{}),_0x171e73[_0x2ef3da(0xe7)]['on']('data',()=>{}),_0x171e73['on'](_0x2ef3da(0xf4),_0x45eb4b=>{const _0x432831=_0x2ef3da;console[_0x432831(0xf4)](_0x432831(0xe8),_0x45eb4b['message']),_0x2f93bf(_0x45eb4b);});const _0x46798e=Date[_0x2ef3da(0xc6)](),_0x45a109=setInterval(async()=>{const _0x4e16e6=_0x2ef3da,_0x70fb24=await isServerRunning(_0x34f70c,_0x5700e3);if(_0x70fb24)clearInterval(_0x45a109),console[_0x4e16e6(0xd0)]('✓\x20Server\x20started\x20at\x20'+_0x34f70c+':'+_0x5700e3),_0x5e645f();else Date[_0x4e16e6(0xc6)]()-_0x46798e>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x45a109),_0x171e73[_0x4e16e6(0xed)](),_0x2f93bf(new Error(_0x4e16e6(0xcb))));},0x1f4);});}async function main(){const _0x2306ee=a0_0x4b6ec5;try{console['log'](_0x2306ee(0xd7)),console[_0x2306ee(0xd0)](_0x2306ee(0xf2)),console['log'](_0x2306ee(0xd7)),console['log']('');const _0x2d8c04=process['argv'][_0x2306ee(0xda)](0x2);let _0x454ad3=DEFAULT_HOST,_0x2c6abb=DEFAULT_PORT;for(let _0x129175=0x0;_0x129175<_0x2d8c04[_0x2306ee(0xe6)];_0x129175++){if(_0x2d8c04[_0x129175]===_0x2306ee(0xea)&&_0x2d8c04[_0x129175+0x1])_0x454ad3=_0x2d8c04[_0x129175+0x1],_0x129175++;else _0x2d8c04[_0x129175]===_0x2306ee(0xdd)&&_0x2d8c04[_0x129175+0x1]&&(_0x2c6abb=parseInt(_0x2d8c04[_0x129175+0x1],0xa),_0x129175++);}console[_0x2306ee(0xd0)]('🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20'+_0x454ad3+':'+_0x2c6abb+_0x2306ee(0xd5));const _0x5aa300=await isServerRunning(_0x454ad3,_0x2c6abb);!_0x5aa300?(console[_0x2306ee(0xd0)]('✗\x20Server\x20is\x20not\x20running'),await startServer(_0x454ad3,_0x2c6abb)):console[_0x2306ee(0xd0)](_0x2306ee(0xe3)+_0x454ad3+':'+_0x2c6abb),console[_0x2306ee(0xd0)](''),console['log'](_0x2306ee(0xde)),console['log'](''),await new Promise(_0x3eaf8d=>setTimeout(_0x3eaf8d,0x1f4)),process[_0x2306ee(0xf5)][_0x2306ee(0xcd)]=_0x454ad3,process[_0x2306ee(0xf5)][_0x2306ee(0xd8)]=_0x2c6abb[_0x2306ee(0xef)](),await import('../src/interfaces/terminal/index.js');}catch(_0x46b5ab){console[_0x2306ee(0xf4)](''),console[_0x2306ee(0xf4)](_0x2306ee(0xd6)),console[_0x2306ee(0xf4)]('\x20\x20',_0x46b5ab[_0x2306ee(0xdf)]),console[_0x2306ee(0xf4)](''),console[_0x2306ee(0xf4)](_0x2306ee(0xc7)),console[_0x2306ee(0xf4)](_0x2306ee(0xe0)),console[_0x2306ee(0xf4)](_0x2306ee(0xe2)),console[_0x2306ee(0xf4)](_0x2306ee(0xce)),console[_0x2306ee(0xf4)](''),process[_0x2306ee(0xd4)](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_0x55c1f5=a0_0x2340;(function(_0x351c1a,_0x113c9e){const _0x3bb446=a0_0x2340,_0x20ce55=_0x351c1a();while(!![]){try{const _0x351a9b=parseInt(_0x3bb446(0x153))/0x1*(-parseInt(_0x3bb446(0x145))/0x2)+-parseInt(_0x3bb446(0x155))/0x3*(-parseInt(_0x3bb446(0x14d))/0x4)+-parseInt(_0x3bb446(0x15d))/0x5*(parseInt(_0x3bb446(0x144))/0x6)+-parseInt(_0x3bb446(0x141))/0x7*(parseInt(_0x3bb446(0x143))/0x8)+parseInt(_0x3bb446(0x15f))/0x9+parseInt(_0x3bb446(0x150))/0xa+parseInt(_0x3bb446(0x154))/0xb;if(_0x351a9b===_0x113c9e)break;else _0x20ce55['push'](_0x20ce55['shift']());}catch(_0x6beea9){_0x20ce55['push'](_0x20ce55['shift']());}}}(a0_0x1114,0x30caa));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x55c1f5(0x14e)][a0_0x55c1f5(0x152)](0x2),options={'host':a0_0x55c1f5(0x163),'port':0x1f90};function a0_0x2340(_0x452cf0,_0x191a49){_0x452cf0=_0x452cf0-0x141;const _0x111416=a0_0x1114();let _0x23400e=_0x111416[_0x452cf0];return _0x23400e;}for(let i=0x0;i<args[a0_0x55c1f5(0x14c)];i++){const arg=args[i];if(arg===a0_0x55c1f5(0x15e)||arg==='-h')options[a0_0x55c1f5(0x165)]=args[++i];else{if(arg===a0_0x55c1f5(0x14f)||arg==='-p')options[a0_0x55c1f5(0x169)]=parseInt(args[++i],0xa);else arg===a0_0x55c1f5(0x164)&&(console[a0_0x55c1f5(0x146)](a0_0x55c1f5(0x160)),process[a0_0x55c1f5(0x161)](0x0));}}process['env']['LOXIA_HOST']&&(options[a0_0x55c1f5(0x165)]=process[a0_0x55c1f5(0x14b)][a0_0x55c1f5(0x168)]);process[a0_0x55c1f5(0x14b)][a0_0x55c1f5(0x142)]&&(options[a0_0x55c1f5(0x169)]=parseInt(process[a0_0x55c1f5(0x14b)]['LOXIA_PORT'],0xa));!process[a0_0x55c1f5(0x15a)][a0_0x55c1f5(0x156)]&&(console['error']('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console[a0_0x55c1f5(0x15c)](''),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x162)),console['error']('\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)'),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x14a)),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x158)),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x167)),console['error'](''),console[a0_0x55c1f5(0x15c)]('Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:'),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x148)),console[a0_0x55c1f5(0x15c)](''),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x157)),console[a0_0x55c1f5(0x15c)](a0_0x55c1f5(0x166)),process[a0_0x55c1f5(0x161)](0x1));console[a0_0x55c1f5(0x146)](a0_0x55c1f5(0x149)),console[a0_0x55c1f5(0x146)]('Connecting\x20to:\x20'+options[a0_0x55c1f5(0x165)]+':'+options[a0_0x55c1f5(0x169)]),console[a0_0x55c1f5(0x146)](a0_0x55c1f5(0x147));const instance=startTerminalUI(options);function a0_0x1114(){const _0xf9d841=['waitUntilExit','slice','122641KBRtrr','4001800FIbNAl','6RANpWZ','isTTY','Or\x20use\x20the\x20web\x20UI\x20instead:','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','\x0aTerminal\x20UI\x20exited','stdin','catch','error','171635ZSHOyM','--host','91863YLzZhP','\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','exit','The\x20terminal\x20UI\x20cannot\x20run\x20in:','localhost','--help','host','\x20\x20npm\x20start','\x20\x20-\x20Some\x20CI/CD\x20environments','LOXIA_HOST','port','274246wvWtBM','LOXIA_PORT','24DJWWxx','18IdrLCH','6ctieny','log','Press\x20Ctrl+C\x20to\x20exit\x0a','\x20\x20npm\x20run\x20terminal-ui','Starting\x20Loxia\x20Terminal\x20UI...','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','env','length','431324jBPQfl','argv','--port','1986190gIhBgS'];a0_0x1114=function(){return _0xf9d841;};return a0_0x1114();}instance[a0_0x55c1f5(0x151)]()['then'](()=>{const _0x45bb2e=a0_0x55c1f5;console[_0x45bb2e(0x146)](_0x45bb2e(0x159)),process[_0x45bb2e(0x161)](0x0);})[a0_0x55c1f5(0x15b)](_0x41f3b1=>{const _0x19b855=a0_0x55c1f5;console[_0x19b855(0x15c)]('\x0aTerminal\x20UI\x20error:',_0x41f3b1),process[_0x19b855(0x161)](0x1);});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const a0_0xcac525=a0_0xf4f2;(function(_0x495c40,_0x4421ef){const _0x375fdd=a0_0xf4f2,_0x350a47=_0x495c40();while(!![]){try{const _0x1aa348=-parseInt(_0x375fdd(0xc3))/0x1+parseInt(_0x375fdd(0xd8))/0x2+parseInt(_0x375fdd(0xe0))/0x3*(parseInt(_0x375fdd(0xc4))/0x4)+-parseInt(_0x375fdd(0xd3))/0x5+parseInt(_0x375fdd(0xc6))/0x6*(-parseInt(_0x375fdd(0xb8))/0x7)+parseInt(_0x375fdd(0xc0))/0x8*(parseInt(_0x375fdd(0xe1))/0x9)+parseInt(_0x375fdd(0xb2))/0xa*(-parseInt(_0x375fdd(0xc8))/0xb);if(_0x1aa348===_0x4421ef)break;else _0x350a47['push'](_0x350a47['shift']());}catch(_0x4b82f3){_0x350a47['push'](_0x350a47['shift']());}}}(a0_0x3a61,0xe2e92));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x311625 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process[a0_0xcac525(0xd4)][a0_0xcac525(0xca)]||0x1f90,STARTUP_WAIT=0x7d0;function a0_0xf4f2(_0x3d9867,_0x55b59a){_0x3d9867=_0x3d9867-0xb1;const _0x3a611b=a0_0x3a61();let _0xf4f28b=_0x3a611b[_0x3d9867];return _0xf4f28b;}let serverProcess=null;async function checkServerReady(_0x4994a0=0xa,_0x2f4eac=0x1f4){const _0x85c636=a0_0xcac525;for(let _0x5a916d=0x0;_0x5a916d<_0x4994a0;_0x5a916d++){try{return await new Promise((_0x2cd364,_0x8784bc)=>{const _0x4cc583=a0_0xf4f2,_0x12fac6=a0_0x311625['get'](_0x4cc583(0xc5)+SERVER_PORT+'/health',_0x46f454=>{const _0x4a352b=_0x4cc583;_0x46f454[_0x4a352b(0xd2)]===0xc8?_0x2cd364():_0x8784bc(new Error(_0x4a352b(0xdc)+_0x46f454[_0x4a352b(0xd2)]));});_0x12fac6['on']('error',_0x8784bc),_0x12fac6[_0x4cc583(0xd5)](0x3e8,()=>{const _0x39f2e8=_0x4cc583;_0x12fac6[_0x39f2e8(0xdd)](),_0x8784bc(new Error(_0x39f2e8(0xb6)));});}),console[_0x85c636(0xbe)](_0x85c636(0xb3)),!![];}catch(_0x2b9dde){_0x5a916d<_0x4994a0-0x1&&await new Promise(_0x3e41f3=>setTimeout(_0x3e41f3,_0x2f4eac));}}return console[_0x85c636(0xbe)](_0x85c636(0xda)),![];}async function startServer(){return new Promise(_0x336b7e=>{const _0x121dff=a0_0xf4f2;console[_0x121dff(0xbe)]('🚀\x20Starting\x20Loxia\x20server...');const _0x39980b=join(rootDir,_0x121dff(0xd1),_0x121dff(0xb5));serverProcess=spawn(_0x121dff(0xd6),[_0x39980b],{'cwd':rootDir,'env':{...process[_0x121dff(0xd4)]},'stdio':['ignore',_0x121dff(0xe2),'pipe'],'detached':![]}),serverProcess['stdout']['on']('data',_0x262e19=>{const _0x2bcac7=_0x121dff,_0x53f54e=_0x262e19[_0x2bcac7(0xb9)]()[_0x2bcac7(0xba)]();_0x53f54e&&console[_0x2bcac7(0xbe)](_0x2bcac7(0xbc)+_0x53f54e);}),serverProcess['stderr']['on']('data',_0x4d9681=>{const _0x3c6161=_0x121dff,_0x41c01b=_0x4d9681[_0x3c6161(0xb9)]()['trim']();_0x41c01b&&!_0x41c01b[_0x3c6161(0xbd)](_0x3c6161(0xcc))&&console[_0x3c6161(0xc1)](_0x3c6161(0xb4)+_0x41c01b);}),serverProcess['on'](_0x121dff(0xc1),_0x13f3c7=>{const _0x808c73=_0x121dff;console['error'](_0x808c73(0xcd),_0x13f3c7[_0x808c73(0xd7)]),process['exit'](0x1);}),serverProcess['on'](_0x121dff(0xce),(_0x1af36e,_0x3da91a)=>{const _0x42f511=_0x121dff;_0x1af36e!==null&&_0x1af36e!==0x0&&(console[_0x42f511(0xc1)](_0x42f511(0xd9)+_0x1af36e),process['exit'](_0x1af36e));}),setTimeout(_0x336b7e,STARTUP_WAIT);});}function a0_0x3a61(){const _0x1687df=['loxia-terminal.js','kill','3dOQUhT','793062bJxcvN','pipe','killed','20dXZkwL','✅\x20Server\x20is\x20ready!','[SERVER\x20ERROR]\x20','index.js','Timeout','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','7wdoSsr','toString','trim','Error\x20during\x20startup:','[SERVER]\x20','includes','log','SIGKILL','112oSpMPG','error','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','825295KUaRuT','3037724FnhVoE','http://localhost:','2350596sIjHFm','Failed\x20to\x20start\x20Terminal\x20UI:','5215078klFSme','\x0a👋\x20Terminal\x20UI\x20closed.','PORT','╚════════════════════════════════════════════════╝','ExperimentalWarning','Failed\x20to\x20start\x20server:','exit','SIGTERM','SIGINT','src','statusCode','1796120NTbjGX','env','setTimeout','node','message','2921648WqUsad','Server\x20exited\x20with\x20code\x20','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','bin','Server\x20returned\x20','destroy'];a0_0x3a61=function(){return _0x1687df;};return a0_0x3a61();}async function startTerminalUI(){const _0x4d213a=a0_0xcac525;console[_0x4d213a(0xbe)]('🖥️\x20\x20Starting\x20Terminal\x20UI...'),console[_0x4d213a(0xbe)]('');const _0x6c5e90=join(rootDir,_0x4d213a(0xdb),_0x4d213a(0xde)),_0x32186f=spawn(_0x4d213a(0xd6),[_0x6c5e90],{'cwd':rootDir,'env':{...process[_0x4d213a(0xd4)]},'stdio':'inherit'});return _0x32186f['on'](_0x4d213a(0xc1),_0x553ea4=>{const _0x44737f=_0x4d213a;console[_0x44737f(0xc1)](_0x44737f(0xc7),_0x553ea4[_0x44737f(0xd7)]),cleanup(),process['exit'](0x1);}),_0x32186f['on'](_0x4d213a(0xce),_0x29ee52=>{const _0x3531c4=_0x4d213a;console[_0x3531c4(0xbe)](_0x3531c4(0xc9)),cleanup(),process[_0x3531c4(0xce)](_0x29ee52||0x0);}),_0x32186f;}function cleanup(){const _0x29cf43=a0_0xcac525;serverProcess&&!serverProcess[_0x29cf43(0xb1)]&&(console[_0x29cf43(0xbe)]('🛑\x20Stopping\x20server...'),serverProcess[_0x29cf43(0xdf)](_0x29cf43(0xcf)),setTimeout(()=>{const _0x239f8c=_0x29cf43;!serverProcess[_0x239f8c(0xb1)]&&serverProcess[_0x239f8c(0xdf)](_0x239f8c(0xbf));},0x1388));}process['on'](a0_0xcac525(0xd0),()=>{const _0x53f6bf=a0_0xcac525;console[_0x53f6bf(0xbe)](_0x53f6bf(0xb7)),cleanup(),process[_0x53f6bf(0xce)](0x0);}),process['on']('SIGTERM',()=>{const _0x487435=a0_0xcac525;console[_0x487435(0xbe)]('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process[_0x487435(0xce)](0x0);}),process['on'](a0_0xcac525(0xce),()=>{cleanup();});async function main(){const _0x3f9e78=a0_0xcac525;console[_0x3f9e78(0xbe)]('╔════════════════════════════════════════════════╗'),console[_0x3f9e78(0xbe)](_0x3f9e78(0xc2)),console[_0x3f9e78(0xbe)](_0x3f9e78(0xcb)),console[_0x3f9e78(0xbe)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x1a28be){console[_0x3f9e78(0xc1)](_0x3f9e78(0xbb),_0x1a28be[_0x3f9e78(0xd7)]),cleanup(),process['exit'](0x1);}}main();
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x3c67e3=a0_0xbe97;(function(_0x3e0301,_0x81b0ac){const _0x6edbb5=a0_0xbe97,_0x184725=_0x3e0301();while(!![]){try{const _0x300fe0=-parseInt(_0x6edbb5(0x202))/0x1*(parseInt(_0x6edbb5(0x1e4))/0x2)+parseInt(_0x6edbb5(0x1ea))/0x3+-parseInt(_0x6edbb5(0x1f2))/0x4*(parseInt(_0x6edbb5(0x1f1))/0x5)+parseInt(_0x6edbb5(0x1fb))/0x6*(parseInt(_0x6edbb5(0x1da))/0x7)+-parseInt(_0x6edbb5(0x1d8))/0x8+parseInt(_0x6edbb5(0x1c4))/0x9*(parseInt(_0x6edbb5(0x1dd))/0xa)+parseInt(_0x6edbb5(0x20c))/0xb;if(_0x300fe0===_0x81b0ac)break;else _0x184725['push'](_0x184725['shift']());}catch(_0x4b3488){_0x184725['push'](_0x184725['shift']());}}}(a0_0x3407,0xf41fa));function a0_0x3407(){const _0x264a83=['mkdir','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','location','\x20\x20\x20pip\x20install\x20semgrep\x0a','\x20\x20Installation\x20Complete','message','\x0a═══════════════════════════════════════════════════════════','startsWith','https','7998032UOcfNn','arch','3976VYpkoa','pipe','\x0aYou\x20can\x20manually\x20install\x20scanners:','5710hzoYZl','python','chmod','platform','finish','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','...','12UELvZj','\x20\x20\x20Downloading\x20from\x20','\x20-m\x20pip\x20show\x20','\x20\x20\x20✅\x20Python\x20found:\x20','\x20\x20\x20Installing\x20','join','2601534wvPlBJ','headers','semgrep\x20--version','log','get','Failed\x20to\x20download:\x20HTTP\x20','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','786020eLJTJQ','40liRFmY','trim','\x20\x20\x20✅\x20','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','python\x20--version','statusCode','semgrep','python3\x20--version','13956mrxrdW','unlink','\x20-m\x20pip\x20install\x20--user\x20','url','catch','checkov','python3','91301KVvkyD','eslint-plugin-security','❌\x20Installation\x20failed:','dirname','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','═══════════════════════════════════════════════════════════\x0a','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20Installing\x20Security\x20Scanners','promises','5879698XHoLGF','.scanners','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','22014iKVbZo','error','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','\x20\x20\x20Location:\x20','🐍\x20Checking\x20Python\x20scanners...','node_modules','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','pip-audit','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'];a0_0x3407=function(){return _0x264a83;};return a0_0x3407();}import{exec}from'child_process';import{promisify}from'util';import a0_0x8db8fe from'https';import a0_0x5740aa from'http';import a0_0x2f8a95 from'fs';import a0_0x114a5a 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_0x114a5a[a0_0x3c67e3(0x205)](__filename),SCANNER_DIR=a0_0x114a5a[a0_0x3c67e3(0x1e9)](__dirname,'..',a0_0x3c67e3(0x1c9),a0_0x3c67e3(0x20d)),SEMGREP_VERSION='v1.55.0';function a0_0xbe97(_0x2da0d6,_0xe79853){_0x2da0d6=_0x2da0d6-0x1c3;const _0x3407c2=a0_0x3407();let _0xbe97f5=_0x3407c2[_0x2da0d6];return _0xbe97f5;}console[a0_0x3c67e3(0x1ed)]('═══════════════════════════════════════════════════════════'),console[a0_0x3c67e3(0x1ed)](a0_0x3c67e3(0x20a)),console[a0_0x3c67e3(0x1ed)](a0_0x3c67e3(0x208));async function installScanners(){const _0x169c3e=a0_0x3c67e3;await a0_0x2f8a95[_0x169c3e(0x20b)][_0x169c3e(0x1cf)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log'](_0x169c3e(0x1d5)),console[_0x169c3e(0x1ed)](_0x169c3e(0x1d3)),console[_0x169c3e(0x1ed)]('═══════════════════════════════════════════════════════════\x0a');}async function checkESLintSecurity(){const _0x3ed22d=a0_0x3c67e3;console[_0x3ed22d(0x1ed)]('📦\x20Checking\x20ESLint\x20Security\x20Plugin...');try{await import(_0x3ed22d(0x203)),console['log'](_0x3ed22d(0x1f5));}catch(_0x3b73cf){console[_0x3ed22d(0x1ed)](_0x3ed22d(0x1d0)),console[_0x3ed22d(0x1ed)](_0x3ed22d(0x1cc));}}async function installSemgrep(){const _0x4ef711=a0_0x3c67e3;console[_0x4ef711(0x1ed)]('🔍\x20Installing\x20Semgrep...');const _0x18dd06=process[_0x4ef711(0x1e0)],_0x593eab=process[_0x4ef711(0x1d9)];try{const _0x3c61c9=await execAsync(_0x4ef711(0x1ec),{'timeout':0x1388});console['log'](_0x4ef711(0x1f6)+_0x3c61c9['stdout'][_0x4ef711(0x1f3)]()),console[_0x4ef711(0x1ed)]('\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a');return;}catch(_0x4fc685){console[_0x4ef711(0x1ed)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0xc6a646=getSemgrepBinaryInfo(_0x18dd06,_0x593eab);if(!_0xc6a646){console[_0x4ef711(0x1ed)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x18dd06+'-'+_0x593eab),console[_0x4ef711(0x1ed)](_0x4ef711(0x1c6));return;}try{const _0x47f8e8=a0_0x114a5a['join'](SCANNER_DIR,'semgrep');console['log'](_0x4ef711(0x1e5)+_0xc6a646[_0x4ef711(0x1fe)]+_0x4ef711(0x1e3)),await downloadFile(_0xc6a646[_0x4ef711(0x1fe)],_0x47f8e8),await a0_0x2f8a95[_0x4ef711(0x20b)][_0x4ef711(0x1df)](_0x47f8e8,0x1ed),console[_0x4ef711(0x1ed)](_0x4ef711(0x1ce)),console[_0x4ef711(0x1ed)](_0x4ef711(0x1c7)+_0x47f8e8+'\x0a'),console['log'](_0x4ef711(0x1f0)),console[_0x4ef711(0x1ed)](_0x4ef711(0x1d2));}catch(_0x51608a){console[_0x4ef711(0x1ed)](_0x4ef711(0x1e2)+_0x51608a[_0x4ef711(0x1d4)]),console[_0x4ef711(0x1ed)](_0x4ef711(0x206));}}function getSemgrepBinaryInfo(_0x41f6d1,_0x507f3a){return null;}async function installPythonScanners(){const _0x294222=a0_0x3c67e3;console['log'](_0x294222(0x1c8));let _0xaf819e=null;try{await execAsync(_0x294222(0x1fa),{'timeout':0x1388}),_0xaf819e=_0x294222(0x201);}catch(_0x3d37eb){try{await execAsync(_0x294222(0x1f7),{'timeout':0x1388}),_0xaf819e=_0x294222(0x1de);}catch(_0x546310){console[_0x294222(0x1ed)]('\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners'),console[_0x294222(0x1ed)](_0x294222(0x1ca)),console[_0x294222(0x1ed)](_0x294222(0x209));return;}}console['log'](_0x294222(0x1e7)+_0xaf819e),await installViaPip(_0x294222(0x1f9),_0xaf819e),await installViaPip('bandit',_0xaf819e),await installViaPip(_0x294222(0x1cb),_0xaf819e),await installViaPip(_0x294222(0x200),_0xaf819e),await installViaPip('yamllint',_0xaf819e),console[_0x294222(0x1ed)]('');}async function installViaPip(_0x1dc106,_0x9c53c7){const _0x5ce952=a0_0x3c67e3;try{const _0x11d2a6=await execAsync(_0x9c53c7+_0x5ce952(0x1e6)+_0x1dc106,{'timeout':0x1388});return console[_0x5ce952(0x1ed)](_0x5ce952(0x1f4)+_0x1dc106+'\x20already\x20installed'),!![];}catch(_0x2cdb10){console[_0x5ce952(0x1ed)](_0x5ce952(0x1e8)+_0x1dc106+'...');try{return await execAsync(_0x9c53c7+_0x5ce952(0x1fd)+_0x1dc106,{'timeout':0xea60}),console[_0x5ce952(0x1ed)]('\x20\x20\x20✅\x20'+_0x1dc106+'\x20installed\x20successfully'),!![];}catch(_0x18b5f1){return console[_0x5ce952(0x1ed)](_0x5ce952(0x1c3)+_0x1dc106+':\x20'+_0x18b5f1[_0x5ce952(0x1d4)]),console[_0x5ce952(0x1ed)](_0x5ce952(0x20e)+_0x1dc106),![];}}}async function downloadFile(_0x277c22,_0x1c116c){return new Promise((_0x530749,_0x225b65)=>{const _0x4de4ea=a0_0xbe97,_0x27d632=_0x277c22[_0x4de4ea(0x1d6)](_0x4de4ea(0x1d7))?a0_0x8db8fe:a0_0x5740aa;_0x27d632[_0x4de4ea(0x1ee)](_0x277c22,_0x3995a6=>{const _0x4a5727=_0x4de4ea;if(_0x3995a6[_0x4a5727(0x1f8)]===0x12e||_0x3995a6[_0x4a5727(0x1f8)]===0x12d){downloadFile(_0x3995a6[_0x4a5727(0x1eb)][_0x4a5727(0x1d1)],_0x1c116c)['then'](_0x530749)[_0x4a5727(0x1ff)](_0x225b65);return;}if(_0x3995a6[_0x4a5727(0x1f8)]!==0xc8){_0x225b65(new Error(_0x4a5727(0x1ef)+_0x3995a6['statusCode']));return;}const _0x5c9687=createWriteStream(_0x1c116c);_0x3995a6[_0x4a5727(0x1db)](_0x5c9687),_0x5c9687['on'](_0x4a5727(0x1e1),()=>{_0x5c9687['close'](),_0x530749();}),_0x5c9687['on'](_0x4a5727(0x1c5),_0x1b88b2=>{const _0xa038ce=_0x4a5727;a0_0x2f8a95[_0xa038ce(0x1fc)](_0x1c116c,()=>{}),_0x225b65(_0x1b88b2);});})['on']('error',_0x225b65);});}installScanners()[a0_0x3c67e3(0x1ff)](_0x4e634b=>{const _0x3378b0=a0_0x3c67e3;console['error'](_0x3378b0(0x204),_0x4e634b[_0x3378b0(0x1d4)]),console[_0x3378b0(0x1c5)](_0x3378b0(0x1dc)),console['error'](_0x3378b0(0x1cd)),console[_0x3378b0(0x1c5)](_0x3378b0(0x207)),process['exit'](0x0);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a0_0x1eeb64=a0_0x4da3;(function(_0x10234f,_0x48c9b3){const _0x2452e5=a0_0x4da3,_0x33d956=_0x10234f();while(!![]){try{const _0x56a8a5=parseInt(_0x2452e5(0x93))/0x1+parseInt(_0x2452e5(0x98))/0x2*(-parseInt(_0x2452e5(0x9e))/0x3)+-parseInt(_0x2452e5(0x82))/0x4*(-parseInt(_0x2452e5(0x9d))/0x5)+parseInt(_0x2452e5(0x9c))/0x6*(parseInt(_0x2452e5(0xb3))/0x7)+parseInt(_0x2452e5(0xaa))/0x8*(-parseInt(_0x2452e5(0xbc))/0x9)+-parseInt(_0x2452e5(0xa9))/0xa+parseInt(_0x2452e5(0xb8))/0xb;if(_0x56a8a5===_0x48c9b3)break;else _0x33d956['push'](_0x33d956['shift']());}catch(_0x1a3a97){_0x33d956['push'](_0x33d956['shift']());}}}(a0_0x5aee,0x98c07));function a0_0x4da3(_0x337817,_0x4afd10){_0x337817=_0x337817-0x7c;const _0x5aeef2=a0_0x5aee();let _0x4da3e3=_0x5aeef2[_0x337817];if(a0_0x4da3['lciYOI']===undefined){var _0x4c7426=function(_0x5902b2){const _0x5c5abf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x35c96e='',_0x5c598c='';for(let _0x50eb5b=0x0,_0x700ee7,_0x4e4ee5,_0x76a4ab=0x0;_0x4e4ee5=_0x5902b2['charAt'](_0x76a4ab++);~_0x4e4ee5&&(_0x700ee7=_0x50eb5b%0x4?_0x700ee7*0x40+_0x4e4ee5:_0x4e4ee5,_0x50eb5b++%0x4)?_0x35c96e+=String['fromCharCode'](0xff&_0x700ee7>>(-0x2*_0x50eb5b&0x6)):0x0){_0x4e4ee5=_0x5c5abf['indexOf'](_0x4e4ee5);}for(let _0xccfe29=0x0,_0x18f76c=_0x35c96e['length'];_0xccfe29<_0x18f76c;_0xccfe29++){_0x5c598c+='%'+('00'+_0x35c96e['charCodeAt'](_0xccfe29)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5c598c);};a0_0x4da3['sKUNsc']=_0x4c7426,a0_0x4da3['ymdFtb']={},a0_0x4da3['lciYOI']=!![];}const _0x42ecdf=_0x5aeef2[0x0],_0x1140d8=_0x337817+_0x42ecdf,_0x2bf161=a0_0x4da3['ymdFtb'][_0x1140d8];return!_0x2bf161?(_0x4da3e3=a0_0x4da3['sKUNsc'](_0x4da3e3),a0_0x4da3['ymdFtb'][_0x1140d8]=_0x4da3e3):_0x4da3e3=_0x2bf161,_0x4da3e3;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x35c96e=null){const _0x337e3e=a0_0x4da3;this['logger']=_0x35c96e,this['stylelint']=null,this['postcss']=null,this['postcssScss']=null,this[_0x337e3e(0xb9)]=null;}async['analyze'](_0x5c598c,_0x50eb5b,_0x700ee7={}){const _0x23de0a=a0_0x4da3;try{const _0x4e4ee5=[],_0x76a4ab=this['detectLanguage'](_0x5c598c),_0xccfe29=await this['checkSyntax'](_0x5c598c,_0x50eb5b,_0x76a4ab);_0x4e4ee5['push'](..._0xccfe29);if(_0xccfe29['length']===0x0){const _0x18f76c=await this['lintStyles'](_0x5c598c,_0x50eb5b,_0x76a4ab);_0x4e4ee5['push'](..._0x18f76c);}return this['logger']?.[_0x23de0a(0x96)]('CSS\x20analysis\x20completed',{'file':_0x5c598c,'language':_0x76a4ab,'totalDiagnostics':_0x4e4ee5['length'],'errors':_0x4e4ee5['filter'](_0xe5695a=>_0xe5695a[_0x23de0a(0x9f)]===STATIC_ANALYSIS['SEVERITY'][_0x23de0a(0x8e)])[_0x23de0a(0x94)],'warnings':_0x4e4ee5['filter'](_0x40ea93=>_0x40ea93[_0x23de0a(0x9f)]===STATIC_ANALYSIS[_0x23de0a(0x87)][_0x23de0a(0xab)])['length']}),_0x4e4ee5;}catch(_0x3cb246){return this[_0x23de0a(0xb0)]?.[_0x23de0a(0xb5)](_0x23de0a(0x8f),{'file':_0x5c598c,'error':_0x3cb246['message']}),[];}}async['checkSyntax'](_0x10e6cd,_0x2c413a,_0x92457e){const _0x21714c=a0_0x4da3,_0x2c6202=[];try{if(!this['postcss']){const _0x5e7a0c=await import(_0x21714c(0x8c));this['postcss']=_0x5e7a0c[_0x21714c(0x83)];}let _0x2feabd=null;if(_0x92457e===_0x21714c(0xb6)){if(!this[_0x21714c(0xbb)]){const _0x5234e8=await import(_0x21714c(0x8b));this[_0x21714c(0xbb)]=_0x5234e8[_0x21714c(0x83)];}_0x2feabd=this[_0x21714c(0xbb)];}else{if(_0x92457e==='less'){if(!this['postcssLess']){const _0x2c5759=await import('postcss-less');this['postcssLess']=_0x2c5759[_0x21714c(0x83)];}_0x2feabd=this['postcssLess'];}}const _0x56fe43=this[_0x21714c(0x8c)]()[_0x21714c(0x8a)](_0x2c413a,{'from':_0x10e6cd,'syntax':_0x2feabd}),_0x3895d=_0x56fe43['root'];this['logger']?.['debug'](_0x21714c(0xbd),{'file':_0x10e6cd});}catch(_0x56180d){const _0x54e4cc=this[_0x21714c(0xa4)](_0x56180d,_0x10e6cd);_0x54e4cc&&_0x2c6202[_0x21714c(0x85)](_0x54e4cc);}return _0x2c6202;}async['lintStyles'](_0x9d08ed,_0x557412,_0x245de1){const _0x5abacf=a0_0x4da3,_0x2650b5=[];try{if(!this[_0x5abacf(0x86)]){const _0x14629d=await import(_0x5abacf(0x86));this['stylelint']=_0x14629d[_0x5abacf(0x83)];}const _0xb6381b={'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':['/^custom-/','ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x245de1==='scss'?[!![],{'ignoreAtRules':['mixin','include','extend','if',_0x5abacf(0xad),_0x5abacf(0x95),'each','while','function','return','content',_0x5abacf(0xb1),'forward']}]:_0x245de1===_0x5abacf(0x88)?[!![],{'ignoreAtRules':[_0x5abacf(0xa5)]}]:!![],'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':_0x5abacf(0xa1),'selector-type-case':_0x5abacf(0x84)},'customSyntax':_0x245de1==='scss'?'postcss-scss':_0x245de1===_0x5abacf(0x88)?'postcss-less':undefined},_0x28fd3e=await this['stylelint'][_0x5abacf(0x90)]({'code':_0x557412,'codeFilename':_0x9d08ed,'config':_0xb6381b});if(_0x28fd3e['results']&&_0x28fd3e[_0x5abacf(0x9b)]['length']>0x0){const _0x42c1b5=_0x28fd3e[_0x5abacf(0x9b)][0x0];if(_0x42c1b5['warnings'])for(const _0x178482 of _0x42c1b5[_0x5abacf(0xaf)]){_0x2650b5['push']({'file':_0x9d08ed,'line':_0x178482['line']||0x1,'column':_0x178482['column']||0x1,'severity':_0x178482['severity']==='error'?STATIC_ANALYSIS[_0x5abacf(0x87)]['ERROR']:STATIC_ANALYSIS['SEVERITY'][_0x5abacf(0xab)],'rule':_0x178482[_0x5abacf(0x91)]||'unknown','message':_0x178482[_0x5abacf(0xa6)],'category':this['categorizeStylelintRule'](_0x178482['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x155717){this['logger']?.[_0x5abacf(0xae)](_0x5abacf(0xba),{'file':_0x9d08ed,'error':_0x155717[_0x5abacf(0xb2)]});}return _0x2650b5;}['formatPostCSSError'](_0x1192f4,_0x4a1f8e){const _0x3b4e20=a0_0x4da3;return{'file':_0x4a1f8e,'line':_0x1192f4[_0x3b4e20(0xa7)]||0x1,'column':_0x1192f4['column']||0x1,'severity':STATIC_ANALYSIS[_0x3b4e20(0x87)]['ERROR'],'rule':_0x1192f4[_0x3b4e20(0x7d)]||_0x3b4e20(0x7e),'message':_0x1192f4[_0x3b4e20(0x99)]||_0x1192f4['message'],'category':STATIC_ANALYSIS[_0x3b4e20(0xa0)]['SYNTAX'],'fixable':![],'source':'postcss','code':_0x1192f4[_0x3b4e20(0xb7)]||undefined};}['categorizeStylelintRule'](_0x1fe91a){const _0x1d2ae3=a0_0x4da3;if(!_0x1fe91a)return STATIC_ANALYSIS[_0x1d2ae3(0xa0)][_0x1d2ae3(0xa2)];const _0x38e83d=_0x1fe91a['toLowerCase']();if(_0x38e83d[_0x1d2ae3(0x8d)](_0x1d2ae3(0x92))||_0x38e83d[_0x1d2ae3(0x8d)](_0x1d2ae3(0x97))||_0x38e83d[_0x1d2ae3(0x8d)](_0x1d2ae3(0xa8))||_0x38e83d['includes']('syntax'))return STATIC_ANALYSIS[_0x1d2ae3(0xa0)]['SYNTAX'];if(_0x38e83d[_0x1d2ae3(0x8d)](_0x1d2ae3(0xac))||_0x38e83d['includes']('optimize'))return STATIC_ANALYSIS['CATEGORY']['PERFORMANCE'];if(_0x38e83d[_0x1d2ae3(0x8d)]('best-practice')||_0x38e83d[_0x1d2ae3(0x8d)](_0x1d2ae3(0xb4)))return STATIC_ANALYSIS['CATEGORY']['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x1d2ae3(0xa0)]['STYLE'];}[a0_0x1eeb64(0xa3)](_0xabd34a){const _0x473ae5=a0_0x1eeb64,_0x126d7c=_0xabd34a['toLowerCase']();if(_0x126d7c['endsWith']('.scss')||_0x126d7c['endsWith'](_0x473ae5(0x7c)))return _0x473ae5(0xb6);if(_0x126d7c[_0x473ae5(0x89)](_0x473ae5(0x7f)))return'less';return _0x473ae5(0x80);}[a0_0x1eeb64(0x81)](){const _0x59aa72=a0_0x1eeb64;return['.css','.scss',_0x59aa72(0x7c),_0x59aa72(0x7f)];}[a0_0x1eeb64(0x9a)](){return![];}}export default CSSAnalyzer;function a0_0x5aee(){const _0x57d302=['zgvMyxvSDa','Bg93zxi','ChvZAa','C3r5BgvSAw50','u0vwrvjjvfK','BgvZCW','zw5KC1DPDgG','ChjVy2vZCW','Cg9ZDgnZCY1Zy3nZ','Cg9ZDgnZCW','Aw5JBhvKzxm','rvjst1i','q1ntigfUywX5C2LZigzHAwXLza','BgLUDa','CNvSzq','BM8TAw52ywXPza','nZaWmJa4CMXUz1zJ','BgvUz3rO','zM9Y','zgvIDwC','BM8TDw5RBM93BG','ngjpy1zhuW','CMvHC29U','C3vWCg9YDhnbDxrVrML4','CMvZDwX0CW','ntK1mZK4wgzor0rs','nta4mJyXnvnurePVtW','mtmYmtC5n2LzDerlta','C2v2zxjPDhK','q0furuDpuLK','zg91yMXL','u1rzteu','zgv0zwn0tgfUz3vHz2u','zM9YBwf0ug9ZDentu0vYCM9Y','CgX1z2LU','Dgv4Da','BgLUzq','BM8Tzw1WDhK','otuXnty2mfPbwe5JCG','mtK0mJCZnKHrAgrwtG','v0fstKLorW','CgvYzM9YBwfUy2u','zwXZzq','D2fYBG','D2fYBMLUz3m','Bg9Nz2vY','DxnL','BwvZC2fNzq','nJnLtNHiB2W','CMvJB21Tzw5Kzwq','zxjYB3i','C2nZCW','C291CMnL','nJm0odq2m1bttwHnsW','Cg9ZDgnZC0XLC3m','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','Cg9ZDgnZC1nJC3m','mJDJCM1vCLe','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','lNnHC3m','BMfTzq','q3nZu3LUDgf4rxjYB3i','lMXLC3m','y3nZ','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','neLNvKTLqW'];a0_0x5aee=function(){return _0x57d302;};return a0_0x5aee();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x4236f8=a0_0x3744;(function(_0x389901,_0x4b6445){const _0x51cf05=a0_0x3744,_0x19338e=_0x389901();while(!![]){try{const _0x140004=parseInt(_0x51cf05(0x24c))/0x1+parseInt(_0x51cf05(0x23d))/0x2+parseInt(_0x51cf05(0x218))/0x3+parseInt(_0x51cf05(0x232))/0x4*(parseInt(_0x51cf05(0x233))/0x5)+-parseInt(_0x51cf05(0x1ee))/0x6*(parseInt(_0x51cf05(0x25c))/0x7)+parseInt(_0x51cf05(0x213))/0x8+-parseInt(_0x51cf05(0x222))/0x9;if(_0x140004===_0x4b6445)break;else _0x19338e['push'](_0x19338e['shift']());}catch(_0x5ef1ec){_0x19338e['push'](_0x19338e['shift']());}}}(a0_0x101e,0x490e7));import{exec}from'child_process';import{promisify}from'util';import a0_0x47ce9b from'path';import a0_0x5ca916 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x3744(_0x4282a0,_0x4495f0){_0x4282a0=_0x4282a0-0x1df;const _0x101e15=a0_0x101e();let _0x3744cb=_0x101e15[_0x4282a0];if(a0_0x3744['BxinHg']===undefined){var _0x1662da=function(_0x5b62f8){const _0x51ce92='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x47ce9b='',_0x5ca916='';for(let _0x3dce79=0x0,_0x472eb4,_0x4ef07f,_0x53548e=0x0;_0x4ef07f=_0x5b62f8['charAt'](_0x53548e++);~_0x4ef07f&&(_0x472eb4=_0x3dce79%0x4?_0x472eb4*0x40+_0x4ef07f:_0x4ef07f,_0x3dce79++%0x4)?_0x47ce9b+=String['fromCharCode'](0xff&_0x472eb4>>(-0x2*_0x3dce79&0x6)):0x0){_0x4ef07f=_0x51ce92['indexOf'](_0x4ef07f);}for(let _0x362e34=0x0,_0x1587d8=_0x47ce9b['length'];_0x362e34<_0x1587d8;_0x362e34++){_0x5ca916+='%'+('00'+_0x47ce9b['charCodeAt'](_0x362e34)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5ca916);};a0_0x3744['vpMdRX']=_0x1662da,a0_0x3744['CrVIAa']={},a0_0x3744['BxinHg']=!![];}const _0xc3979a=_0x101e15[0x0],_0x3bf210=_0x4282a0+_0xc3979a,_0x2e1332=a0_0x3744['CrVIAa'][_0x3bf210];return!_0x2e1332?(_0x3744cb=a0_0x3744['vpMdRX'](_0x3744cb),a0_0x3744['CrVIAa'][_0x3bf210]=_0x3744cb):_0x3744cb=_0x2e1332,_0x3744cb;}const execAsync=promisify(exec);function a0_0x101e(){const _0x3381fd=['v0fstKLorW','CgfYyw1Z','DhnJB25MAwCUANnVBG','qvDtignYzwrLBNrPywXZ','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','Dw5RBM93BG','ANnVBI1WyxjZzq','DMfSAwrHDgvxAxrOq2HLy2TVDG','DgvZDa','su5gtW','C2nHBM5LCKnHy2HL','lNLTBa','zxH0BMfTzq','y29TBw9UANm','y2HLy2TVDG','mtG1mJrAv1blzNK','mJuWufD3t1vm','AgLNAa','zgvMyxvSDa','EwfTBgXPBNq','CgfYC2u','DhjPBq','y29TCgLSzxjpChrPB25Z','ywP2','Bg9Nz2vY','y3DL','nZqYmtK2veLzExvH','igrLDgvJDgvKigLUic5LBNyGzMLSzq','sw52ywXPzcbku09ooIa','zw52','ChvZAa','DgvYCMfMB3jT','CgLWigLUC3rHBgWGy2HLy2TVDG','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','zgv0zwn0rMLSzvr5Cgu','DMfSAwrHDgu','CgfYC2viywrVBgLUDfjLC3vSDhm','y2HHBMDLBwu','ywP2lwzVCM1HDhm','y2HLy2TVDIbKzxrLy3rLza','Bwf0y2G','mti2mtqWvhbtzgHb','ANnVBI1Zy2HLBwe','BwfW','BwfWq2HLy2TVDLnLDMvYAxr5','ChjPDMf0zsbRzxK','C3rKB3v0','BwfWsgfKB2XPBNrtzxzLCML0Eq','Aw5JBhvKzxm','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','yMfZzw5HBwu','ANnVBLnJAgvTyq','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','CgfJA2fNzs5QC29U','BgvUz3rO','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','Bw9KDwXL','mJi4nJqXwM9Lwfjz','DMfSAwrHDgvzqu1m','AZHZ','y2HLy2TFAwq','CgfYC2vdAgvJA292uMvZDwX0CW','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','z2L0AhvIlwfJDgLVBNm','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','y2f0zwDVCNK','y29Kzq','zg9JA2vYlwnVBxbVC2uUEwfTBa','C2vJDxjPDhK','lMvUDG','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','rvjst1i','Aw5ZDgfUy2vqyxrO','nZH0ugH5Eey','DMfSAwrHDgvuC0nVBMzPzW','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','CgfZC3DVCMq','A3vIzxjUzxrLCW','BM8TAw1WBgLJAxqTyw55','BwfWwwfTBgXPBNrtzxzLCML0Eq','z3vPzgvSAw5L','CMvZDwX0CW','zM9YrwfJAa','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','zg9JA2vYlwnVBxbVC2u','DMfSAwrHDgvqywnRywDLsNnVBG','C3bSAxq','zg9JA2vYzMLSzq','y29SDw1U','BwvZC2fNzq','zgLYBMfTzq','zgvIDwC','BwvKAxvT','BM9YBwfSAxPLuMvZDwX0CW','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','Dg9mB3DLCKnHC2u','zg9JA2vYlwnVBxbVC2uUEw1S','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','C3rYAw5N','zxjYB3i','EwfTBgXPBNqGls12zxjZAw9U','y2HLy2TFy2XHC3m','DMfSAwrHDgveB2nRzxjMAwXL','zMLSzv9SAw5Lx3jHBMDL','y29TCgLSzq','EwfTBgXPBNqGzgv0zwn0zwq','zg9JA2vYx2nVBxbVC2u','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','yxzHAwXHyMXLu2nHBM5LCNm','DxrMltG','mtKXmJq4yK5zsfDS','DhnJB25MAwCTDMfSAwrHDg9Y','B2jQzwn0','zw52lxzHBgLKyxrVCG','C3LUDgf4','ntCWodK3qKruwe9q','yMvZDc1WCMfJDgLJzq','qvbjigTLEq','u0vwrvjjvfK','D2fYBG','wufntcbMAwXLihzHBgLKyxrPB24','Bgv2zwW','ug90zw50AwfSigHHCMrJB2rLzca','AgfYzgnVzgvKlxnLy3jLDa','zxjYB3jZ','mtK3mJiXnunyrMTuAa'];a0_0x101e=function(){return _0x3381fd;};return a0_0x101e();}class ConfigValidator{constructor(_0x3dce79=null){const _0x3ba135=a0_0x3744;this['logger']=_0x3dce79,this[_0x3ba135(0x211)]=null,this[_0x3ba135(0x22d)]=new Map();}async['detectAvailableValidators'](){const _0x5d1fbf=a0_0x3744;if(this[_0x5d1fbf(0x211)]!==null)return this[_0x5d1fbf(0x211)];const _0x472eb4={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x472eb4[_0x5d1fbf(0x231)]=!![],this[_0x5d1fbf(0x23b)]?.['debug'](_0x5d1fbf(0x24a));}catch(_0x4ef07f){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x4ef07f[_0x5d1fbf(0x1fe)]});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x472eb4['hadolint']=!![],this['logger']?.['debug']('hadolint\x20detected');}catch(_0x53548e){this['logger']?.['debug']('hadolint\x20not\x20available',{'error':_0x53548e['message']});}try{await execAsync(_0x5d1fbf(0x209),{'timeout':0x1388}),_0x472eb4[_0x5d1fbf(0x236)]=!![],this[_0x5d1fbf(0x23b)]?.['debug'](_0x5d1fbf(0x20e));}catch(_0x362e34){this[_0x5d1fbf(0x23b)]?.['debug']('yamllint\x20not\x20available',{'error':_0x362e34[_0x5d1fbf(0x1fe)]});}try{await import(_0x5d1fbf(0x23a)),_0x472eb4['jsonSchema']=!![],this['logger']?.['debug'](_0x5d1fbf(0x254));}catch(_0x1587d8){this['logger']?.['debug']('ajv\x20not\x20available',{'error':_0x1587d8['message']});}return this[_0x5d1fbf(0x211)]=_0x472eb4,_0x472eb4;}async[a0_0x4236f8(0x246)](_0x19c711,_0x2401d7={}){const _0x19202b=a0_0x4236f8,_0x996cd4=[],_0x3aec8f=await this['detectAvailableValidators'](),_0x3147f5=this['detectFileType'](_0x19c711);this[_0x19202b(0x23b)]?.[_0x19202b(0x200)]('Validating\x20config\x20file',{'filePath':_0x19c711,'fileType':_0x3147f5});switch(_0x3147f5){case'dockerfile':if(_0x3aec8f['hadolint']){const _0x1f5045=await this['validateDockerfile'](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0x1f5045);}if(_0x3aec8f[_0x19202b(0x231)]){const _0x19dae0=await this[_0x19202b(0x22a)](_0x19c711,_0x19202b(0x1fc),_0x2401d7);_0x996cd4[_0x19202b(0x241)](..._0x19dae0);}break;case'docker-compose':if(_0x3aec8f[_0x19202b(0x236)]){const _0x38997d=await this[_0x19202b(0x1df)](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0x38997d);}if(_0x3aec8f[_0x19202b(0x231)]){const _0x447273=await this[_0x19202b(0x22a)](_0x19c711,_0x19202b(0x20f),_0x2401d7);_0x996cd4['push'](..._0x447273);}break;case'kubernetes':if(_0x3aec8f[_0x19202b(0x236)]){const _0x1341d1=await this[_0x19202b(0x1df)](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0x1341d1);}if(_0x3aec8f['checkov']){const _0x1b2920=await this['validateWithCheckov'](_0x19c711,_0x19202b(0x1f2),_0x2401d7);_0x996cd4[_0x19202b(0x241)](..._0x1b2920);}break;case'terraform':if(_0x3aec8f['checkov']){const _0x298ff9=await this[_0x19202b(0x22a)](_0x19c711,'terraform',_0x2401d7);_0x996cd4[_0x19202b(0x241)](..._0x298ff9);}break;case'package.json':if(_0x3aec8f[_0x19202b(0x256)]){const _0x59aae3=await this['validatePackageJson'](_0x19c711,_0x2401d7);_0x996cd4[_0x19202b(0x241)](..._0x59aae3);}break;case'tsconfig.json':if(_0x3aec8f['jsonSchema']){const _0x4b0d07=await this[_0x19202b(0x1ef)](_0x19c711,_0x2401d7);_0x996cd4[_0x19202b(0x241)](..._0x4b0d07);}break;case'github-actions':if(_0x3aec8f[_0x19202b(0x236)]){const _0x53bc79=await this['validateYAML'](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0x53bc79);}break;case _0x19202b(0x240):const _0x12fe6b=await this['validateEnvFile'](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0x12fe6b);break;case'yaml':if(_0x3aec8f['yamllint']){const _0xc20d07=await this['validateYAML'](_0x19c711,_0x2401d7);_0x996cd4['push'](..._0xc20d07);}break;default:this[_0x19202b(0x23b)]?.[_0x19202b(0x21c)](_0x19202b(0x25a),{'filePath':_0x19c711,'fileType':_0x3147f5});return[];}return this[_0x19202b(0x202)](_0x996cd4);}async[a0_0x4236f8(0x20b)](_0x2c7a71,_0x5cd9e2={}){const _0x26b16d=a0_0x4236f8;try{const _0x4a128c=await execAsync(_0x26b16d(0x206)+_0x2c7a71+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x1d90da=JSON[_0x26b16d(0x237)](_0x4a128c[_0x26b16d(0x251)]);return this['parseHadolintResults'](_0x1d90da,_0x2c7a71);}catch(_0x43dcfc){if(_0x43dcfc['stdout'])try{const _0x312acc=JSON['parse'](_0x43dcfc['stdout']);return this[_0x26b16d(0x247)](_0x312acc,_0x2c7a71);}catch(_0x13b033){this['logger']?.['error'](_0x26b16d(0x1e5),{'error':_0x13b033['message']});}return this[_0x26b16d(0x23b)]?.['error'](_0x26b16d(0x1f0),{'error':_0x43dcfc['message']}),[];}}[a0_0x4236f8(0x247)](_0x18b689,_0x468eee){const _0x34ef12=a0_0x4236f8,_0x4c88ea=[];if(Array['isArray'](_0x18b689))for(const _0x35f7ce of _0x18b689){_0x4c88ea[_0x34ef12(0x241)]({'file':_0x468eee,'line':_0x35f7ce['line']||0x1,'column':_0x35f7ce[_0x34ef12(0x1fd)]||0x1,'severity':this[_0x34ef12(0x252)](_0x35f7ce[_0x34ef12(0x21e)]),'rule':_0x35f7ce[_0x34ef12(0x1e7)],'message':_0x35f7ce[_0x34ef12(0x1fe)],'category':_0x34ef12(0x1fc),'validator':'hadolint'});}return _0x4c88ea;}async[a0_0x4236f8(0x1df)](_0x312775,_0xcf3d37={}){const _0x3ad0ec=a0_0x4236f8;try{const _0x443b7c=await execAsync(_0x3ad0ec(0x227)+_0x312775+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x443b7c[_0x3ad0ec(0x251)],_0x312775);}catch(_0x1f6486){if(_0x1f6486['stdout'])return this['parseYamllintResults'](_0x1f6486['stdout'],_0x312775);return this[_0x3ad0ec(0x23b)]?.['error']('yamllint\x20validation\x20failed',{'error':_0x1f6486['message']}),[];}}['parseYamllintResults'](_0x31f370,_0x41522c){const _0x3a7a3b=a0_0x4236f8,_0x52088d=[],_0x57322d=_0x31f370[_0x3a7a3b(0x1fb)]('\x0a')['filter'](_0x3c331b=>_0x3c331b[_0x3a7a3b(0x238)]());for(const _0xa65c85 of _0x57322d){const _0x5b88bf=_0xa65c85[_0x3a7a3b(0x24b)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x5b88bf){const [,_0x5aa599,_0x27cf66,_0x1393d1,_0x2b8465,_0x481192,_0x58f7db]=_0x5b88bf;_0x52088d['push']({'file':_0x41522c,'line':parseInt(_0x27cf66,0xa),'column':parseInt(_0x1393d1,0xa),'severity':this[_0x3a7a3b(0x1f4)](_0x2b8465),'rule':_0x58f7db,'message':_0x481192,'category':'yaml','validator':'yamllint'});}}return _0x52088d;}async[a0_0x4236f8(0x22a)](_0x2829c5,_0x1a5be6,_0x431e86={}){const _0x147ab2=a0_0x4236f8;try{const _0x1fba39=await execAsync('checkov\x20-f\x20\x22'+_0x2829c5+'\x22\x20--framework\x20'+_0x1a5be6+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x2ace28=JSON['parse'](_0x1fba39[_0x147ab2(0x251)]);return this[_0x147ab2(0x1e2)](_0x2ace28,_0x2829c5);}catch(_0xcaeddf){if(_0xcaeddf['stdout'])try{const _0x1ef0dc=JSON[_0x147ab2(0x237)](_0xcaeddf['stdout']);return this[_0x147ab2(0x1e2)](_0x1ef0dc,_0x2829c5);}catch(_0x578094){this[_0x147ab2(0x23b)]?.[_0x147ab2(0x208)](_0x147ab2(0x1e3),{'error':_0x578094[_0x147ab2(0x1fe)]});}return this['logger']?.['error'](_0x147ab2(0x210),{'error':_0xcaeddf[_0x147ab2(0x1fe)]}),[];}}[a0_0x4236f8(0x1e2)](_0x2a5e35,_0x5a39ae){const _0x38dadf=a0_0x4236f8,_0x8a95c=[];if(_0x2a5e35[_0x38dadf(0x1f6)]&&_0x2a5e35['results']['failed_checks'])for(const _0x113992 of _0x2a5e35['results']['failed_checks']){_0x8a95c['push']({'file':_0x5a39ae,'line':_0x113992[_0x38dadf(0x20c)]?_0x113992['file_line_range'][0x0]:0x1,'column':0x1,'severity':this[_0x38dadf(0x24f)](_0x113992[_0x38dadf(0x20a)]),'rule':_0x113992[_0x38dadf(0x1e1)],'message':_0x113992['check_name']||_0x113992['check_id'],'category':_0x38dadf(0x1e9),'validator':_0x38dadf(0x231),'remediation':_0x113992[_0x38dadf(0x1f5)],'cwe':_0x113992[_0x38dadf(0x23c)],'references':_0x113992[_0x38dadf(0x1f5)]?[_0x113992[_0x38dadf(0x1f5)]]:[]});}return _0x8a95c;}async[a0_0x4236f8(0x1fa)](_0x1f55a6,_0x3c295b={}){const _0x2d1015=a0_0x4236f8;try{const _0x2e7a91=(await import(_0x2d1015(0x23a)))[_0x2d1015(0x235)],_0x5182ca=(await import(_0x2d1015(0x249)))[_0x2d1015(0x235)],_0xf2e054=await a0_0x5ca916['readFile'](_0x1f55a6,_0x2d1015(0x212)),_0x36bc34=JSON['parse'](_0xf2e054),_0x4bdffc=new _0x2e7a91({'allErrors':!![],'strict':![]});_0x5182ca(_0x4bdffc);const _0x423bf8={'type':'object','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':_0x2d1015(0x207)},'main':{'type':_0x2d1015(0x207)},'type':{'type':'string','enum':[_0x2d1015(0x25b),_0x2d1015(0x230)]},'scripts':{'type':'object'},'dependencies':{'type':_0x2d1015(0x215)},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0xe60e78=_0x4bdffc[_0x2d1015(0x20d)](_0x423bf8),_0x3b234b=_0xe60e78(_0x36bc34);if(!_0x3b234b&&_0xe60e78['errors'])return _0xe60e78[_0x2d1015(0x221)]['map'](_0x5aff16=>({'file':_0x1f55a6,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2d1015(0x21b)]['ERROR'],'rule':_0x2d1015(0x24d),'message':_0x5aff16[_0x2d1015(0x1ed)]?_0x5aff16[_0x2d1015(0x1ed)]+'\x20'+_0x5aff16[_0x2d1015(0x1fe)]:'must\x20have\x20required\x20property\x20\x27'+_0x5aff16[_0x2d1015(0x224)]['missingProperty']+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x4ec8b4){return this[_0x2d1015(0x23b)]?.['error']('package.json\x20validation\x20failed',{'error':_0x4ec8b4[_0x2d1015(0x1fe)]}),[{'file':_0x1f55a6,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2d1015(0x21b)][_0x2d1015(0x1ec)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x4ec8b4[_0x2d1015(0x1fe)],'category':_0x2d1015(0x217),'validator':'json-parse'}];}}async[a0_0x4236f8(0x1ef)](_0x574348,_0x111d1b={}){const _0x25e90a=a0_0x4236f8;try{const _0x1d031f=await a0_0x5ca916['readFile'](_0x574348,'utf-8'),_0x47e0f1=JSON['parse'](_0x1d031f),_0x12f691=[];if(_0x47e0f1['compilerOptions']){const _0x5c25c7=_0x47e0f1[_0x25e90a(0x239)];!_0x5c25c7['strict']&&_0x12f691['push']({'file':_0x574348,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x25e90a(0x223)],'rule':'strict-mode','message':_0x25e90a(0x1eb),'category':_0x25e90a(0x219),'validator':_0x25e90a(0x214)}),_0x5c25c7['noImplicitAny']===![]&&_0x12f691['push']({'file':_0x574348,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x25e90a(0x1f3),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':_0x25e90a(0x214)});}return _0x12f691;}catch(_0x10a1c8){return this['logger']?.[_0x25e90a(0x208)](_0x25e90a(0x244),{'error':_0x10a1c8[_0x25e90a(0x1fe)]}),[{'file':_0x574348,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':'json-parse','message':_0x25e90a(0x23f)+_0x10a1c8['message'],'category':_0x25e90a(0x217),'validator':_0x25e90a(0x229)}];}}async['validateEnvFile'](_0x4f66c0,_0x150766={}){const _0x4af102=a0_0x4236f8;try{const _0x16d729=await a0_0x5ca916['readFile'](_0x4f66c0,_0x4af102(0x212)),_0x572e53=[],_0x4ede96=_0x16d729[_0x4af102(0x1fb)]('\x0a'),_0x284a6c=[{'pattern':/password|passwd|pwd/i,'name':_0x4af102(0x1f1)},{'pattern':/api[_-]?key/i,'name':_0x4af102(0x21a)},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':_0x4af102(0x250)},{'pattern':/aws[_-]?access/i,'name':_0x4af102(0x226)}];return _0x4ede96[_0x4af102(0x1f7)]((_0x5f4b4c,_0x177b70)=>{const _0x5b1437=_0x4af102,_0x30bf2f=_0x5f4b4c['trim']();if(!_0x30bf2f||_0x30bf2f['startsWith']('#'))return;if(_0x30bf2f[_0x5b1437(0x253)]('=')){const [_0x12e3e7,_0x4e7f8b]=_0x30bf2f[_0x5b1437(0x1fb)]('='),_0x4906e5=_0x12e3e7[_0x5b1437(0x204)](),_0x587c03=_0x4e7f8b?.[_0x5b1437(0x238)]()||'',_0x5e608b=_0x587c03&&_0x587c03!==''&&!_0x587c03['startsWith']('$')&&_0x587c03!=='your-key-here'&&_0x587c03!==_0x5b1437(0x248)&&_0x587c03[_0x5b1437(0x259)]>0x5;if(_0x5e608b)for(const {pattern:_0x5c37e1,name:_0x135230}of _0x284a6c){if(_0x5c37e1[_0x5b1437(0x22b)](_0x4906e5)){_0x572e53[_0x5b1437(0x241)]({'file':_0x4f66c0,'line':_0x177b70+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'rule':_0x5b1437(0x220),'message':_0x5b1437(0x21f)+_0x135230+_0x5b1437(0x23e),'category':_0x5b1437(0x1e9),'validator':_0x5b1437(0x216),'remediation':_0x5b1437(0x203)});break;}}}}),_0x572e53;}catch(_0x2012c1){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x2012c1['message']}),[];}}[a0_0x4236f8(0x245)](_0x4eaf15){const _0xe9a75=a0_0x4236f8,_0x40f68f=a0_0x47ce9b[_0xe9a75(0x255)](_0x4eaf15)['toLowerCase'](),_0x1f6fe3=a0_0x47ce9b[_0xe9a75(0x1ff)](_0x4eaf15);if(_0x40f68f===_0xe9a75(0x1fc))return'dockerfile';if(_0x40f68f===_0xe9a75(0x205)||_0x40f68f===_0xe9a75(0x1e8))return _0xe9a75(0x1f9);if(_0x40f68f==='package.json')return _0xe9a75(0x258);if(_0x40f68f===_0xe9a75(0x225))return _0xe9a75(0x225);if(_0x40f68f===_0xe9a75(0x1ea)||_0x40f68f['endsWith']('.env'))return _0xe9a75(0x240);if(_0x1f6fe3[_0xe9a75(0x253)]('.github/workflows'))return _0xe9a75(0x1e4);if(_0x1f6fe3[_0xe9a75(0x253)](_0xe9a75(0x1f2))||_0x1f6fe3[_0xe9a75(0x253)](_0xe9a75(0x1e0)))return'kubernetes';const _0x5756d4=a0_0x47ce9b[_0xe9a75(0x22f)](_0x4eaf15)['toLowerCase']();if(_0x5756d4==='.tf'||_0x5756d4==='.tfvars')return _0xe9a75(0x242);if(_0x5756d4===_0xe9a75(0x22e)||_0x5756d4==='.yaml')return'yaml';if(_0x5756d4==='.json')return'json';return _0xe9a75(0x228);}['normalizeResults'](_0x3c6a6e){const _0x572d78=a0_0x4236f8;return _0x3c6a6e[_0x572d78(0x24e)](_0x38ca5c=>({'file':_0x38ca5c['file'],'line':_0x38ca5c['line']||0x1,'column':_0x38ca5c['column']||0x1,'severity':_0x38ca5c['severity']||STATIC_ANALYSIS[_0x572d78(0x21b)][_0x572d78(0x223)],'rule':_0x38ca5c['rule']||_0x572d78(0x228),'message':_0x38ca5c['message']||'Validation\x20issue\x20detected','category':_0x38ca5c[_0x572d78(0x1e6)]||'validation','validator':_0x38ca5c['validator'],'cwe':_0x38ca5c[_0x572d78(0x23c)]||null,'remediation':_0x38ca5c['remediation']||null,'references':_0x38ca5c['references']||[]}));}['mapHadolintSeverity'](_0x82d3ab){const _0x5e47f0=a0_0x4236f8,_0x360466={'error':STATIC_ANALYSIS[_0x5e47f0(0x21b)][_0x5e47f0(0x1ec)],'warning':STATIC_ANALYSIS[_0x5e47f0(0x21b)]['WARNING'],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS[_0x5e47f0(0x21b)][_0x5e47f0(0x22c)]};return _0x360466[_0x82d3ab?.[_0x5e47f0(0x204)]()]||STATIC_ANALYSIS['SEVERITY'][_0x5e47f0(0x223)];}[a0_0x4236f8(0x1f4)](_0x2707d1){const _0x73def3=a0_0x4236f8,_0x491619={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x73def3(0x21b)]['WARNING']};return _0x491619[_0x2707d1?.[_0x73def3(0x204)]()]||STATIC_ANALYSIS[_0x73def3(0x21b)][_0x73def3(0x223)];}['mapCheckovSeverity'](_0x55bebf){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async['getValidatorStatus'](){const _0x6da3e7=await this['detectAvailableValidators']();return{'validators':_0x6da3e7,'recommendations':this['getInstallRecommendations'](_0x6da3e7)};}[a0_0x4236f8(0x1f8)](_0x5de0a4){const _0x5d6979=a0_0x4236f8,_0x16878f=[];return!_0x5de0a4[_0x5d6979(0x231)]&&_0x16878f['push']({'validator':'checkov','reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':_0x5d6979(0x243),'priority':'high'}),!_0x5de0a4['hadolint']&&_0x16878f['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':_0x5d6979(0x234)}),!_0x5de0a4['yamllint']&&_0x16878f[_0x5d6979(0x241)]({'validator':'yamllint','reason':_0x5d6979(0x21d),'install':'pip\x20install\x20yamllint','priority':_0x5d6979(0x201)}),!_0x5de0a4['jsonSchema']&&_0x16878f['push']({'validator':'ajv\x20(JSON\x20Schema)','reason':'JSON\x20configuration\x20validation','install':_0x5d6979(0x257),'priority':_0x5d6979(0x201)}),_0x16878f;}}export default ConfigValidator;
|
|
1
|
+
const a0_0x1e7674=a0_0x2583;(function(_0x50da16,_0x1f3232){const _0x8e8f6e=a0_0x2583,_0x4a716e=_0x50da16();while(!![]){try{const _0x42df34=parseInt(_0x8e8f6e(0x1bd))/0x1+parseInt(_0x8e8f6e(0x178))/0x2*(parseInt(_0x8e8f6e(0x166))/0x3)+parseInt(_0x8e8f6e(0x1bb))/0x4+parseInt(_0x8e8f6e(0x17f))/0x5+parseInt(_0x8e8f6e(0x1bf))/0x6*(-parseInt(_0x8e8f6e(0x16c))/0x7)+parseInt(_0x8e8f6e(0x189))/0x8+parseInt(_0x8e8f6e(0x163))/0x9*(-parseInt(_0x8e8f6e(0x186))/0xa);if(_0x42df34===_0x1f3232)break;else _0x4a716e['push'](_0x4a716e['shift']());}catch(_0x16c386){_0x4a716e['push'](_0x4a716e['shift']());}}}(a0_0x3f8e,0xe51ec));function a0_0x2583(_0x1f07ab,_0x59f9b5){_0x1f07ab=_0x1f07ab-0x15b;const _0x3f8efe=a0_0x3f8e();let _0x2583fd=_0x3f8efe[_0x1f07ab];if(a0_0x2583['LfBsnr']===undefined){var _0x2b2d0f=function(_0x755f9){const _0x35067a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f96d7='',_0x15bab0='';for(let _0x40113a=0x0,_0x1a0659,_0x1d442b,_0x5f2cc1=0x0;_0x1d442b=_0x755f9['charAt'](_0x5f2cc1++);~_0x1d442b&&(_0x1a0659=_0x40113a%0x4?_0x1a0659*0x40+_0x1d442b:_0x1d442b,_0x40113a++%0x4)?_0x3f96d7+=String['fromCharCode'](0xff&_0x1a0659>>(-0x2*_0x40113a&0x6)):0x0){_0x1d442b=_0x35067a['indexOf'](_0x1d442b);}for(let _0x14c832=0x0,_0x2f1a04=_0x3f96d7['length'];_0x14c832<_0x2f1a04;_0x14c832++){_0x15bab0+='%'+('00'+_0x3f96d7['charCodeAt'](_0x14c832)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x15bab0);};a0_0x2583['LRUdkd']=_0x2b2d0f,a0_0x2583['PfXROZ']={},a0_0x2583['LfBsnr']=!![];}const _0x115041=_0x3f8efe[0x0],_0x1cea03=_0x1f07ab+_0x115041,_0x2c56a0=a0_0x2583['PfXROZ'][_0x1cea03];return!_0x2c56a0?(_0x2583fd=a0_0x2583['LRUdkd'](_0x2583fd),a0_0x2583['PfXROZ'][_0x1cea03]=_0x2583fd):_0x2583fd=_0x2c56a0,_0x2583fd;}import{exec}from'child_process';import{promisify}from'util';import a0_0x3f96d7 from'path';import a0_0x15bab0 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x40113a=null){const _0x33e92f=a0_0x2583;this['logger']=_0x40113a,this[_0x33e92f(0x165)]=null,this[_0x33e92f(0x1a4)]=new Map();}async['detectAvailableValidators'](){const _0x54eaae=a0_0x2583;if(this['availableScanners']!==null)return this[_0x54eaae(0x165)];const _0x1a0659={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x1a0659[_0x54eaae(0x1d9)]=!![],this['logger']?.['debug']('checkov\x20detected');}catch(_0x1d442b){this[_0x54eaae(0x15d)]?.['debug']('checkov\x20not\x20available',{'error':_0x1d442b['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x1a0659[_0x54eaae(0x175)]=!![],this['logger']?.['debug'](_0x54eaae(0x1d2));}catch(_0x5f2cc1){this[_0x54eaae(0x15d)]?.['debug'](_0x54eaae(0x1aa),{'error':_0x5f2cc1['message']});}try{await execAsync(_0x54eaae(0x1a6),{'timeout':0x1388}),_0x1a0659[_0x54eaae(0x1d3)]=!![],this['logger']?.[_0x54eaae(0x1ae)](_0x54eaae(0x170));}catch(_0x14c832){this['logger']?.['debug'](_0x54eaae(0x1ac),{'error':_0x14c832[_0x54eaae(0x1b3)]});}try{await import(_0x54eaae(0x18b)),_0x1a0659[_0x54eaae(0x1db)]=!![],this[_0x54eaae(0x15d)]?.['debug'](_0x54eaae(0x1c5));}catch(_0x2f1a04){this[_0x54eaae(0x15d)]?.[_0x54eaae(0x1ae)]('ajv\x20not\x20available',{'error':_0x2f1a04[_0x54eaae(0x1b3)]});}return this['availableScanners']=_0x1a0659,_0x1a0659;}async[a0_0x1e7674(0x1bc)](_0x190b0b,_0x30079c={}){const _0x3d260d=a0_0x1e7674,_0x13efdd=[],_0x204ddf=await this['detectAvailableValidators'](),_0x352e67=this[_0x3d260d(0x171)](_0x190b0b);this[_0x3d260d(0x15d)]?.[_0x3d260d(0x1ae)](_0x3d260d(0x1ca),{'filePath':_0x190b0b,'fileType':_0x352e67});switch(_0x352e67){case'dockerfile':if(_0x204ddf['hadolint']){const _0x415659=await this[_0x3d260d(0x1cd)](_0x190b0b,_0x30079c);_0x13efdd['push'](..._0x415659);}if(_0x204ddf['checkov']){const _0x191234=await this[_0x3d260d(0x1ab)](_0x190b0b,'dockerfile',_0x30079c);_0x13efdd['push'](..._0x191234);}break;case'docker-compose':if(_0x204ddf[_0x3d260d(0x1d3)]){const _0x365c55=await this[_0x3d260d(0x172)](_0x190b0b,_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x365c55);}if(_0x204ddf['checkov']){const _0x254dcd=await this['validateWithCheckov'](_0x190b0b,'docker_compose',_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x254dcd);}break;case _0x3d260d(0x196):if(_0x204ddf['yamllint']){const _0x586e97=await this['validateYAML'](_0x190b0b,_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x586e97);}if(_0x204ddf[_0x3d260d(0x1d9)]){const _0x2a81a6=await this[_0x3d260d(0x1ab)](_0x190b0b,_0x3d260d(0x196),_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x2a81a6);}break;case'terraform':if(_0x204ddf['checkov']){const _0x1d6829=await this[_0x3d260d(0x1ab)](_0x190b0b,_0x3d260d(0x19f),_0x30079c);_0x13efdd['push'](..._0x1d6829);}break;case'package.json':if(_0x204ddf['jsonSchema']){const _0xdf9244=await this['validatePackageJson'](_0x190b0b,_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0xdf9244);}break;case _0x3d260d(0x15c):if(_0x204ddf['jsonSchema']){const _0x40d9b6=await this[_0x3d260d(0x168)](_0x190b0b,_0x30079c);_0x13efdd['push'](..._0x40d9b6);}break;case _0x3d260d(0x187):if(_0x204ddf[_0x3d260d(0x1d3)]){const _0x2e3247=await this['validateYAML'](_0x190b0b,_0x30079c);_0x13efdd['push'](..._0x2e3247);}break;case _0x3d260d(0x16d):const _0x45fc39=await this['validateEnvFile'](_0x190b0b,_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x45fc39);break;case'yaml':if(_0x204ddf['yamllint']){const _0x4ae7ba=await this['validateYAML'](_0x190b0b,_0x30079c);_0x13efdd[_0x3d260d(0x1ce)](..._0x4ae7ba);}break;default:this['logger']?.[_0x3d260d(0x167)](_0x3d260d(0x17e),{'filePath':_0x190b0b,'fileType':_0x352e67});return[];}return this['normalizeResults'](_0x13efdd);}async[a0_0x1e7674(0x1cd)](_0x3648af,_0x27786f={}){const _0x406b1d=a0_0x1e7674;try{const _0xa2692d=await execAsync(_0x406b1d(0x197)+_0x3648af+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x22c4c0=JSON[_0x406b1d(0x17b)](_0xa2692d['stdout']);return this[_0x406b1d(0x1c2)](_0x22c4c0,_0x3648af);}catch(_0x549351){if(_0x549351[_0x406b1d(0x1d5)])try{const _0x49e547=JSON['parse'](_0x549351[_0x406b1d(0x1d5)]);return this['parseHadolintResults'](_0x49e547,_0x3648af);}catch(_0x3d06fc){this['logger']?.[_0x406b1d(0x16b)](_0x406b1d(0x1a7),{'error':_0x3d06fc[_0x406b1d(0x1b3)]});}return this[_0x406b1d(0x15d)]?.['error']('hadolint\x20validation\x20failed',{'error':_0x549351[_0x406b1d(0x1b3)]}),[];}}['parseHadolintResults'](_0x3c1308,_0x3b0fdf){const _0xcd075f=a0_0x1e7674,_0x4286c6=[];if(Array[_0xcd075f(0x16e)](_0x3c1308))for(const _0x3de00f of _0x3c1308){_0x4286c6['push']({'file':_0x3b0fdf,'line':_0x3de00f['line']||0x1,'column':_0x3de00f['column']||0x1,'severity':this[_0xcd075f(0x1d6)](_0x3de00f['level']),'rule':_0x3de00f[_0xcd075f(0x1d4)],'message':_0x3de00f[_0xcd075f(0x1b3)],'category':_0xcd075f(0x1a3),'validator':'hadolint'});}return _0x4286c6;}async[a0_0x1e7674(0x172)](_0x55e421,_0x556019={}){const _0x30a80c=a0_0x1e7674;try{const _0x4efb7=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x55e421+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x30a80c(0x190)](_0x4efb7[_0x30a80c(0x1d5)],_0x55e421);}catch(_0x5c6f85){if(_0x5c6f85['stdout'])return this['parseYamllintResults'](_0x5c6f85['stdout'],_0x55e421);return this[_0x30a80c(0x15d)]?.['error']('yamllint\x20validation\x20failed',{'error':_0x5c6f85[_0x30a80c(0x1b3)]}),[];}}[a0_0x1e7674(0x190)](_0x262647,_0xd6365a){const _0x527429=a0_0x1e7674,_0x4edf39=[],_0x194488=_0x262647[_0x527429(0x1d0)]('\x0a')[_0x527429(0x179)](_0x1a5429=>_0x1a5429['trim']());for(const _0x3c8cd5 of _0x194488){const _0x5a6aa2=_0x3c8cd5['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x5a6aa2){const [,_0x3ab82e,_0x27ca33,_0x433616,_0x1caf47,_0x2e9839,_0x126f3c]=_0x5a6aa2;_0x4edf39[_0x527429(0x1ce)]({'file':_0xd6365a,'line':parseInt(_0x27ca33,0xa),'column':parseInt(_0x433616,0xa),'severity':this['mapYamllintSeverity'](_0x1caf47),'rule':_0x126f3c,'message':_0x2e9839,'category':_0x527429(0x162),'validator':'yamllint'});}}return _0x4edf39;}async['validateWithCheckov'](_0x1c9c35,_0xcbe2c9,_0x82952e={}){const _0x37ece1=a0_0x1e7674;try{const _0x552287=await execAsync(_0x37ece1(0x15b)+_0x1c9c35+_0x37ece1(0x19c)+_0xcbe2c9+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x26a82a=JSON['parse'](_0x552287[_0x37ece1(0x1d5)]);return this['parseCheckovResults'](_0x26a82a,_0x1c9c35);}catch(_0x549d26){if(_0x549d26['stdout'])try{const _0x50bdc6=JSON[_0x37ece1(0x17b)](_0x549d26['stdout']);return this[_0x37ece1(0x17d)](_0x50bdc6,_0x1c9c35);}catch(_0x93c2b0){this['logger']?.[_0x37ece1(0x16b)](_0x37ece1(0x19b),{'error':_0x93c2b0['message']});}return this[_0x37ece1(0x15d)]?.[_0x37ece1(0x16b)](_0x37ece1(0x1c4),{'error':_0x549d26[_0x37ece1(0x1b3)]}),[];}}[a0_0x1e7674(0x17d)](_0x317c52,_0x215795){const _0x1cfe93=a0_0x1e7674,_0x2835b6=[];if(_0x317c52[_0x1cfe93(0x174)]&&_0x317c52[_0x1cfe93(0x174)]['failed_checks'])for(const _0x4e5e50 of _0x317c52[_0x1cfe93(0x174)]['failed_checks']){_0x2835b6['push']({'file':_0x215795,'line':_0x4e5e50['file_line_range']?_0x4e5e50[_0x1cfe93(0x181)][0x0]:0x1,'column':0x1,'severity':this[_0x1cfe93(0x188)](_0x4e5e50['check_class']),'rule':_0x4e5e50[_0x1cfe93(0x16f)],'message':_0x4e5e50['check_name']||_0x4e5e50['check_id'],'category':_0x1cfe93(0x173),'validator':_0x1cfe93(0x1d9),'remediation':_0x4e5e50['guideline'],'cwe':_0x4e5e50['cwe'],'references':_0x4e5e50[_0x1cfe93(0x17a)]?[_0x4e5e50['guideline']]:[]});}return _0x2835b6;}async['validatePackageJson'](_0x90ef61,_0x341334={}){const _0x692876=a0_0x1e7674;try{const _0x274cdf=(await import('ajv'))['default'],_0x11f126=(await import(_0x692876(0x193)))['default'],_0x3a197d=await a0_0x15bab0['readFile'](_0x90ef61,'utf-8'),_0x5709a6=JSON[_0x692876(0x17b)](_0x3a197d),_0x120b40=new _0x274cdf({'allErrors':!![],'strict':![]});_0x11f126(_0x120b40);const _0x30a2c0={'type':_0x692876(0x18d),'required':[_0x692876(0x16a),_0x692876(0x1b9)],'properties':{'name':{'type':_0x692876(0x1a1),'pattern':_0x692876(0x1b8)},'version':{'type':_0x692876(0x1a1)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':_0x692876(0x1a1),'enum':['module',_0x692876(0x18a)]},'scripts':{'type':'object'},'dependencies':{'type':'object'},'devDependencies':{'type':_0x692876(0x18d)}},'additionalProperties':!![]},_0x130ad0=_0x120b40[_0x692876(0x182)](_0x30a2c0),_0xa2ce7c=_0x130ad0(_0x5709a6);if(!_0xa2ce7c&&_0x130ad0['errors'])return _0x130ad0['errors']['map'](_0x4ee980=>({'file':_0x90ef61,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x692876(0x1b7)]['ERROR'],'rule':_0x692876(0x1a5),'message':_0x4ee980['instancePath']?_0x4ee980[_0x692876(0x1b5)]+'\x20'+_0x4ee980[_0x692876(0x1b3)]:_0x692876(0x1ad)+_0x4ee980['params'][_0x692876(0x1cf)]+'\x27','category':_0x692876(0x1c9),'validator':_0x692876(0x1a5)}));return[];}catch(_0x22ff53){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x22ff53[_0x692876(0x1b3)]}),[{'file':_0x90ef61,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x22ff53['message'],'category':_0x692876(0x1b6),'validator':'json-parse'}];}}async['validateTsConfig'](_0x5dfbd5,_0x160b63={}){const _0x4b461a=a0_0x1e7674;try{const _0x591187=await a0_0x15bab0[_0x4b461a(0x19e)](_0x5dfbd5,_0x4b461a(0x161)),_0x2d9a81=JSON[_0x4b461a(0x17b)](_0x591187),_0xedc207=[];if(_0x2d9a81[_0x4b461a(0x192)]){const _0xe1d861=_0x2d9a81['compilerOptions'];!_0xe1d861['strict']&&_0xedc207['push']({'file':_0x5dfbd5,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4b461a(0x1b7)]['WARNING'],'rule':'strict-mode','message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':_0x4b461a(0x1ba),'validator':'tsconfig-validator'}),_0xe1d861['noImplicitAny']===![]&&_0xedc207[_0x4b461a(0x1ce)]({'file':_0x5dfbd5,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4b461a(0x1b7)][_0x4b461a(0x1d7)],'rule':_0x4b461a(0x1dc),'message':_0x4b461a(0x1a2),'category':_0x4b461a(0x1ba),'validator':_0x4b461a(0x180)});}return _0xedc207;}catch(_0x56edfc){return this['logger']?.[_0x4b461a(0x16b)]('tsconfig.json\x20validation\x20failed',{'error':_0x56edfc[_0x4b461a(0x1b3)]}),[{'file':_0x5dfbd5,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x4b461a(0x1c0)],'rule':'json-parse','message':_0x4b461a(0x1dd)+_0x56edfc[_0x4b461a(0x1b3)],'category':'syntax','validator':'json-parse'}];}}async['validateEnvFile'](_0x569857,_0x44fb01={}){const _0x1bd5d0=a0_0x1e7674;try{const _0x586ced=await a0_0x15bab0[_0x1bd5d0(0x19e)](_0x569857,'utf-8'),_0x5144f3=[],_0x1edbc5=_0x586ced['split']('\x0a'),_0x36a4b3=[{'pattern':/password|passwd|pwd/i,'name':_0x1bd5d0(0x160)},{'pattern':/api[_-]?key/i,'name':_0x1bd5d0(0x169)},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':_0x1bd5d0(0x176)},{'pattern':/private[_-]?key/i,'name':_0x1bd5d0(0x19d)},{'pattern':/aws[_-]?access/i,'name':_0x1bd5d0(0x1a0)}];return _0x1edbc5['forEach']((_0x3ee824,_0x204df4)=>{const _0x20580f=_0x1bd5d0,_0x27b2ac=_0x3ee824['trim']();if(!_0x27b2ac||_0x27b2ac['startsWith']('#'))return;if(_0x27b2ac[_0x20580f(0x183)]('=')){const [_0x468ef7,_0x2a28fd]=_0x27b2ac[_0x20580f(0x1d0)]('='),_0x3582d5=_0x468ef7[_0x20580f(0x15f)](),_0x146a24=_0x2a28fd?.[_0x20580f(0x1b4)]()||'',_0x1aba8b=_0x146a24&&_0x146a24!==''&&!_0x146a24['startsWith']('$')&&_0x146a24!==_0x20580f(0x1af)&&_0x146a24!=='changeme'&&_0x146a24['length']>0x5;if(_0x1aba8b)for(const {pattern:_0x176cfa,name:_0xdecd7b}of _0x36a4b3){if(_0x176cfa[_0x20580f(0x191)](_0x3582d5)){_0x5144f3[_0x20580f(0x1ce)]({'file':_0x569857,'line':_0x204df4+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x20580f(0x1c7)],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0xdecd7b+_0x20580f(0x194),'category':'security','validator':_0x20580f(0x1be),'remediation':_0x20580f(0x1da)});break;}}}}),_0x5144f3;}catch(_0xfdc90d){return this[_0x1bd5d0(0x15d)]?.['error'](_0x1bd5d0(0x1d8),{'error':_0xfdc90d[_0x1bd5d0(0x1b3)]}),[];}}[a0_0x1e7674(0x171)](_0x5e9aee){const _0x2531df=a0_0x1e7674,_0x3d48d0=a0_0x3f96d7['basename'](_0x5e9aee)['toLowerCase'](),_0x1b7b40=a0_0x3f96d7['dirname'](_0x5e9aee);if(_0x3d48d0===_0x2531df(0x1a3))return'dockerfile';if(_0x3d48d0==='docker-compose.yml'||_0x3d48d0==='docker-compose.yaml')return'docker-compose';if(_0x3d48d0==='package.json')return _0x2531df(0x1d1);if(_0x3d48d0==='tsconfig.json')return'tsconfig.json';if(_0x3d48d0===_0x2531df(0x18c)||_0x3d48d0[_0x2531df(0x17c)](_0x2531df(0x18c)))return _0x2531df(0x16d);if(_0x1b7b40[_0x2531df(0x183)](_0x2531df(0x198)))return'github-actions';if(_0x1b7b40[_0x2531df(0x183)]('kubernetes')||_0x1b7b40['includes']('k8s'))return _0x2531df(0x196);const _0x4043d4=a0_0x3f96d7['extname'](_0x5e9aee)['toLowerCase']();if(_0x4043d4===_0x2531df(0x1b2)||_0x4043d4===_0x2531df(0x1b0))return'terraform';if(_0x4043d4===_0x2531df(0x19a)||_0x4043d4==='.yaml')return _0x2531df(0x162);if(_0x4043d4===_0x2531df(0x18e))return'json';return _0x2531df(0x1a9);}['normalizeResults'](_0x4b95d1){const _0x53b18d=a0_0x1e7674;return _0x4b95d1[_0x53b18d(0x1c8)](_0x1ea8d3=>({'file':_0x1ea8d3['file'],'line':_0x1ea8d3[_0x53b18d(0x1a8)]||0x1,'column':_0x1ea8d3['column']||0x1,'severity':_0x1ea8d3['severity']||STATIC_ANALYSIS[_0x53b18d(0x1b7)][_0x53b18d(0x1d7)],'rule':_0x1ea8d3['rule']||_0x53b18d(0x1a9),'message':_0x1ea8d3['message']||_0x53b18d(0x1c6),'category':_0x1ea8d3['category']||'validation','validator':_0x1ea8d3['validator'],'cwe':_0x1ea8d3[_0x53b18d(0x199)]||null,'remediation':_0x1ea8d3[_0x53b18d(0x1cc)]||null,'references':_0x1ea8d3[_0x53b18d(0x177)]||[]}));}[a0_0x1e7674(0x1d6)](_0x4f884f){const _0x338f91=a0_0x1e7674,_0x57f33a={'error':STATIC_ANALYSIS[_0x338f91(0x1b7)][_0x338f91(0x1c0)],'warning':STATIC_ANALYSIS[_0x338f91(0x1b7)][_0x338f91(0x1d7)],'info':STATIC_ANALYSIS['SEVERITY'][_0x338f91(0x1c1)],'style':STATIC_ANALYSIS[_0x338f91(0x1b7)]['INFO']};return _0x57f33a[_0x4f884f?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapYamllintSeverity'](_0x175127){const _0x5cf1aa=a0_0x1e7674,_0x55f7ac={'error':STATIC_ANALYSIS[_0x5cf1aa(0x1b7)][_0x5cf1aa(0x1c0)],'warning':STATIC_ANALYSIS['SEVERITY'][_0x5cf1aa(0x1d7)]};return _0x55f7ac[_0x175127?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapCheckovSeverity'](_0x441426){const _0x21f3b6=a0_0x1e7674;return STATIC_ANALYSIS[_0x21f3b6(0x1b7)]['ERROR'];}async[a0_0x1e7674(0x15e)](){const _0x30af31=a0_0x1e7674,_0x321d39=await this['detectAvailableValidators']();return{'validators':_0x321d39,'recommendations':this[_0x30af31(0x185)](_0x321d39)};}['getInstallRecommendations'](_0x5da78f){const _0xef8caf=a0_0x1e7674,_0x4a32bb=[];return!_0x5da78f['checkov']&&_0x4a32bb[_0xef8caf(0x1ce)]({'validator':_0xef8caf(0x1d9),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':'pip\x20install\x20checkov','priority':'high'}),!_0x5da78f['hadolint']&&_0x4a32bb[_0xef8caf(0x1ce)]({'validator':_0xef8caf(0x175),'reason':_0xef8caf(0x1c3),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x5da78f['yamllint']&&_0x4a32bb['push']({'validator':'yamllint','reason':_0xef8caf(0x1b1),'install':_0xef8caf(0x18f),'priority':'medium'}),!_0x5da78f['jsonSchema']&&_0x4a32bb[_0xef8caf(0x1ce)]({'validator':_0xef8caf(0x184),'reason':_0xef8caf(0x164),'install':_0xef8caf(0x195),'priority':_0xef8caf(0x1cb)}),_0x4a32bb;}}function a0_0x3f8e(){const _0x186fbe=['z3vPzgvSAw5L','CgfYC2u','zw5KC1DPDgG','CgfYC2vdAgvJA292uMvZDwX0CW','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','ndG5otaWy1bqven5','DhnJB25MAwCTDMfSAwrHDg9Y','zMLSzv9SAw5Lx3jHBMDL','y29TCgLSzq','Aw5JBhvKzxm','ywP2icHku09oifnJAgvTysK','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','nduWndeWBK5Jyu5Q','z2L0AhvIlwfJDgLVBNm','BwfWq2HLy2TVDLnLDMvYAxr5','mti3nJiZndrpyKLXu08','y29TBw9UANm','ywP2','lMvUDG','B2jQzwn0','lMPZB24','CgLWigLUC3rHBgWGEwfTBgXPBNq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','DgvZDa','y29TCgLSzxjpChrPB25Z','ywP2lwzVCM1HDhm','igrLDgvJDgvKigLUic5LBNyGzMLSzq','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','A3vIzxjUzxrLCW','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','lMDPDgH1yI93B3jRzMXVD3m','y3DL','lNLTBa','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','iIaTlwzYyw1LD29YAYa','ChjPDMf0zsbRzxK','CMvHzezPBgu','DgvYCMfMB3jT','qvDtignYzwrLBNrPywXZ','C3rYAw5N','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','zg9JA2vYzMLSzq','C2nHBM5LCKnHy2HL','ANnVBI1Zy2HLBwe','EwfTBgXPBNqGls12zxjZAw9U','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','BgLUzq','Dw5RBM93BG','AgfKB2XPBNqGBM90igf2ywLSywjSzq','DMfSAwrHDgvxAxrOq2HLy2TVDG','EwfTBgXPBNqGBM90igf2ywLSywjSzq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','zgvIDwC','Ew91CI1RzxKTAgvYzq','lNrMDMfYCW','wufntcbMAwXLihzHBgLKyxrPB24','lNrM','BwvZC2fNzq','DhjPBq','Aw5ZDgfUy2vqyxrO','C3LUDgf4','u0vwrvjjvfK','xIG/oKbBys16mc05lx5Dw2eTEJaTos0Ux35DkI8Pp1THlxOWltKTFL1Bys16mc05ls5FFL0Qja','DMvYC2LVBG','yMvZDc1WCMfJDgLJzq','mJu4nZKYner3z3D4Aq','DMfSAwrHDgu','mtq4otq2oxLbyxj2Ca','zw52lxzHBgLKyxrVCG','otm3nte1mgn3vfLNwq','rvjst1i','su5gtW','CgfYC2viywrVBgLUDfjLC3vSDhm','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','q1jjveLdquW','BwfW','DMfSAwrHDgLVBG','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','BwvKAxvT','CMvTzwrPyxrPB24','DMfSAwrHDgveB2nRzxjMAwXL','ChvZAa','BwLZC2LUz1bYB3bLCNr5','C3bSAxq','CgfJA2fNzs5QC29U','AgfKB2XPBNqGzgv0zwn0zwq','EwfTBgXPBNq','y29Kzq','C3rKB3v0','BwfWsgfKB2XPBNrtzxzLCML0Eq','v0fstKLorW','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','y2HLy2TVDG','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','ANnVBLnJAgvTyq','BM8TAw1WBgLJAxqTyw55','sw52ywXPzcbku09ooIa','y2HLy2TVDIaTzIaI','DhnJB25MAwCUANnVBG','Bg9Nz2vY','z2v0vMfSAwrHDg9Yu3rHDhvZ','Dg9mB3DLCKnHC2u','CgfZC3DVCMq','DxrMltG','EwfTBa','mZy5zwLMreLL','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','yxzHAwXHyMXLu2nHBM5LCNm','mtu1mZG3n2H3uNf4sW','D2fYBG','DMfSAwrHDgvuC0nVBMzPzW','qvbjigTLEq','BMfTzq','zxjYB3i','n2P1q2ngzW','zw52','AxnbCNjHEq','y2HLy2TFAwq','EwfTBgXPBNqGzgv0zwn0zwq','zgv0zwn0rMLSzvr5Cgu','DMfSAwrHDgvzqu1m','C2vJDxjPDhK','CMvZDwX0CW','AgfKB2XPBNq','Dg9Rzw4','CMvMzxjLBMnLCW','mLHgB1Hftq','zMLSDgvY'];a0_0x3f8e=function(){return _0x186fbe;};return a0_0x3f8e();}export default ConfigValidator;
|