@loxia-labs/loxia-autopilot-one 2.0.3 → 2.0.5
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/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/scripts/watchdog.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/SparrowAnalyzer.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/flowExecutor.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 -1
- package/src/services/aiService.js +1 -1
- package/src/services/apiKeyManager.js +1 -1
- package/src/services/benchmarkService.js +1 -1
- package/src/services/budgetService.js +1 -1
- package/src/services/contextInjectionService.js +1 -1
- package/src/services/conversationCompactionService.js +1 -1
- package/src/services/credentialVault.js +1 -1
- package/src/services/errorHandler.js +1 -1
- package/src/services/fileAttachmentService.js +1 -1
- package/src/services/flowContextService.js +1 -1
- package/src/services/memoryService.js +1 -1
- package/src/services/modelRouterService.js +1 -1
- package/src/services/modelsService.js +1 -1
- package/src/services/portRegistry.js +1 -1
- package/src/services/portTracker.js +1 -1
- package/src/services/projectDetector.js +1 -1
- package/src/services/promptService.js +1 -1
- package/src/services/qualityInspector.js +1 -1
- package/src/services/serviceRegistry.js +1 -1
- package/src/services/tokenCountingService.js +1 -1
- package/src/services/visualEditorBridge.js +1 -1
- package/src/services/visualEditorServer.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/docxTool.js +1 -1
- package/src/tools/excelTool.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/helpTool.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/memoryTool.js +1 -1
- package/src/tools/pdfTool.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/userPromptTool.js +1 -1
- package/src/tools/videoTool.js +1 -1
- package/src/tools/visualEditorTool.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/browserStealth.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/humanBehavior.js +1 -1
- package/src/utilities/jsonRepair.js +1 -1
- package/src/utilities/logger.js +1 -1
- package/src/utilities/platformUtils.js +1 -1
- package/src/utilities/platformUtils.test.js +1 -1
- package/src/utilities/stealthConstants.js +1 -1
- package/src/utilities/structuredFileValidator.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/web-ui/build/index.html +1 -1
- package/web-ui/build/static/{index-B5f---1N.js → index-DZSa_5Fn.js} +109 -109
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const a0_0x55b6c9=a0_0x5411;(function(_0x2a9365,_0xdd6ac8){const _0x6a1dcb=a0_0x5411,_0x3ef263=_0x2a9365();while(!![]){try{const _0x2c4f46=-parseInt(_0x6a1dcb(0x78))/0x1+parseInt(_0x6a1dcb(0xb0))/0x2+-parseInt(_0x6a1dcb(0x70))/0x3+-parseInt(_0x6a1dcb(0xbb))/0x4*(-parseInt(_0x6a1dcb(0x6e))/0x5)+parseInt(_0x6a1dcb(0xc1))/0x6*(-parseInt(_0x6a1dcb(0x83))/0x7)+parseInt(_0x6a1dcb(0x9b))/0x8+-parseInt(_0x6a1dcb(0xc0))/0x9*(-parseInt(_0x6a1dcb(0xb4))/0xa);if(_0x2c4f46===_0xdd6ac8)break;else _0x3ef263['push'](_0x3ef263['shift']());}catch(_0x1b7d52){_0x3ef263['push'](_0x3ef263['shift']());}}}(a0_0x584a,0x4a177));function a0_0x5411(_0xad9da5,_0x3b09c2){_0xad9da5=_0xad9da5-0x6d;const _0x584a48=a0_0x584a();let _0x5411f8=_0x584a48[_0xad9da5];return _0x5411f8;}import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x79ae3 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x55b6c9(0x94),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x55b6c9(0x72)][a0_0x55b6c9(0x97)](0x2),command=args[0x0]&&!args[0x0][a0_0x55b6c9(0xa9)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args['includes'](a0_0x55b6c9(0xb1))||args[a0_0x55b6c9(0xa5)]('-h'),'version':args[a0_0x55b6c9(0xa5)]('--version')||args['includes']('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x55b6c9(0xbd)&&args[i+0x1]&&(flags[a0_0x55b6c9(0x82)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x55b6c9(0x8a)&&args[i+0x1]&&(flags[a0_0x55b6c9(0xc5)]=args[i+0x1]);}const explicitPort=flags[a0_0x55b6c9(0x82)],host=flags[a0_0x55b6c9(0xc5)]||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x55b6c9(0xc3)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x55b6c9(0xc6)));console[a0_0x55b6c9(0xa0)](a0_0x55b6c9(0x9f)+pkg['version']),process[a0_0x55b6c9(0xa2)](0x0);}if(flags[a0_0x55b6c9(0x6d)]||!command){const pkgPath=join(__dirname,'..',a0_0x55b6c9(0xc3)),pkg=JSON[a0_0x55b6c9(0x8c)](readFileSync(pkgPath,a0_0x55b6c9(0xc6)));console[a0_0x55b6c9(0xa0)](a0_0x55b6c9(0xa6)+pkg[a0_0x55b6c9(0xc7)]+a0_0x55b6c9(0xbf)+DEFAULT_PORT+a0_0x55b6c9(0xba)+DEFAULT_HOST+a0_0x55b6c9(0x7f)),process[a0_0x55b6c9(0xa2)](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x179478}=await import('../src/services/portRegistry.js');return _0x179478();}async function discoverBackend(){const _0x3ad5d8=a0_0x55b6c9;try{const _0x439112=await getPortRegistry();await _0x439112[_0x3ad5d8(0x7b)]();const _0xa5bda8=await _0x439112[_0x3ad5d8(0x77)](_0x3ad5d8(0xa8));if(_0xa5bda8)return{'host':_0xa5bda8['host']||_0x3ad5d8(0x7c),'port':_0xa5bda8[_0x3ad5d8(0x82)],'pid':_0xa5bda8[_0x3ad5d8(0x7e)]};return null;}catch(_0x4978f9){return null;}}function a0_0x584a(){const _0x4b93ab=['PORT','slice','kill','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','unref','1045104KqxHsQ','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','\x0aPlease\x20start\x20the\x20server\x20first:','Loxia\x20Autopilot\x20One\x20v','log','index.js','exit','Waiting\x20for\x20server\x20to\x20start...','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','includes','\x0aLoxia\x20Autopilot\x20One\x20v','win32','backend','startsWith','\x20\x20API\x20Health:\x20\x20\x20','\x0aOpening\x20Web\x20UI\x20at\x20','Server\x20running\x20at\x20http://','ignore','/api/health\x0a','start','619560qpfFiz','--help','\x0aShutting\x20down\x20server...','SIGINT','581680tDCJIp','inherit','ceil','\x0aServer\x20registered\x20at\x20','SIGTERM','Starting\x20Loxia\x20server...\x0a',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','1268116rHAFeq','now','--port','darwin','\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20only\x20(no\x20UI\x20opened)\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:\x20auto-select\x20starting\x20from\x20','36vEsUsv','564024jfKJOR','\x0a✓\x20Server\x20running\x20at\x20','package.json','Could\x20not\x20open\x20browser\x20automatically.','host','utf8','version','help','5crkzmp','src','1369986PCVGQo','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','argv','web','get','error','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','getService','135974uPwoyK','node','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','cleanupStaleEntries','localhost','Please\x20open\x20manually:\x20','pid',')\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only\x20(headless)\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\x20specific\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\x20\x203.\x20Or\x20run\x20\x27loxia\x20serve\x27\x20for\x20headless\x20server\x20(connect\x20remotely)\x0a\x0aNote:\x20If\x20no\x20port\x20is\x20specified,\x20the\x20server\x20will\x20automatically\x20find\x0aan\x20available\x20port.\x20The\x20Terminal\x20UI\x20will\x20discover\x20the\x20server\x20port\x0aautomatically\x20from\x20the\x20port\x20registry.\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a','setTimeout','Starting\x20Terminal\x20UI...\x0a','port','7ivurAE','toString','Unknown\x20command:\x20','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','catch','LOXIA_HOST','LOXIA_PORT','--host','statusCode','parse','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','Looking\x20for\x20running\x20server...','Starting\x20Loxia\x20server\x20in\x20background...','open','platform','http://','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','127.0.0.1','cmd'];a0_0x584a=function(){return _0x4b93ab;};return a0_0x584a();}async function checkServerRunning(_0x3e3c8b,_0x12123b,_0x14f45b=0x1){for(let _0x24debd=0x0;_0x24debd<_0x14f45b;_0x24debd++){const _0x128419=await new Promise(_0xe8bedc=>{const _0x2cf8f8=a0_0x5411,_0x10f895=a0_0x79ae3[_0x2cf8f8(0x74)](_0x2cf8f8(0x92)+_0x3e3c8b+':'+_0x12123b+'/api/health',_0x2ec930=>{const _0x2cbac2=_0x2cf8f8;_0xe8bedc(_0x2ec930[_0x2cbac2(0x8b)]===0xc8);});_0x10f895['on'](_0x2cf8f8(0x75),()=>_0xe8bedc(![])),_0x10f895[_0x2cf8f8(0x80)](0x7d0,()=>{_0x10f895['destroy'](),_0xe8bedc(![]);});});if(_0x128419)return!![];_0x24debd<_0x14f45b-0x1&&await new Promise(_0x16cef8=>setTimeout(_0x16cef8,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x2fe2fd=SERVER_STARTUP_TIMEOUT){const _0x4b6eba=a0_0x55b6c9,_0x15410d=Date[_0x4b6eba(0xbc)]();while(Date[_0x4b6eba(0xbc)]()-_0x15410d<_0x2fe2fd){const _0x2b016d=await discoverBackend();if(_0x2b016d){const _0xfa731b=await checkServerRunning(_0x2b016d['host'],_0x2b016d[_0x4b6eba(0x82)]);if(_0xfa731b)return _0x2b016d;}await new Promise(_0x251782=>setTimeout(_0x251782,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x4c2343,_0x57e8f1,_0x5f1fbc=SERVER_STARTUP_TIMEOUT){const _0x2ee7ff=a0_0x55b6c9,_0x56b383=Math[_0x2ee7ff(0xb6)](_0x5f1fbc/SERVER_CHECK_INTERVAL),_0x4ab25f=await checkServerRunning(_0x4c2343,_0x57e8f1,_0x56b383);return _0x4ab25f?{'host':_0x4c2343,'port':_0x57e8f1}:null;}function openBrowser(_0x223849){const _0x27a7fb=a0_0x55b6c9;let _0x34af75,_0x391c4e;if(process[_0x27a7fb(0x91)]===_0x27a7fb(0xbe))_0x34af75=_0x27a7fb(0x90),_0x391c4e=[_0x223849];else process[_0x27a7fb(0x91)]===_0x27a7fb(0xa7)?(_0x34af75=_0x27a7fb(0x95),_0x391c4e=['/c',_0x27a7fb(0xaf),'\x22\x22',_0x223849]):(_0x34af75='xdg-open',_0x391c4e=[_0x223849]);const _0x95d74d=spawn(_0x34af75,_0x391c4e,{'detached':!![],'stdio':_0x27a7fb(0xad)});_0x95d74d[_0x27a7fb(0x9a)](),_0x95d74d['on'](_0x27a7fb(0x75),()=>{const _0x13e2ef=_0x27a7fb;console[_0x13e2ef(0xa0)](_0x13e2ef(0xc4)),console[_0x13e2ef(0xa0)](_0x13e2ef(0x7d)+_0x223849);});}function startServer(_0x28fad2=![]){const _0xf22ae6=a0_0x55b6c9,_0x44e254={...process.env};explicitPort&&(_0x44e254[_0xf22ae6(0x89)]=explicitPort[_0xf22ae6(0x84)](),_0x44e254[_0xf22ae6(0x96)]=explicitPort[_0xf22ae6(0x84)]());flags[_0xf22ae6(0xc5)]&&(_0x44e254[_0xf22ae6(0x88)]=flags[_0xf22ae6(0xc5)]);const _0x265ad6=join(__dirname,'..',_0xf22ae6(0x6f),_0xf22ae6(0xa1)),_0x56fafa=spawn(_0xf22ae6(0x79),[_0x265ad6],{'cwd':join(__dirname,'..'),'env':_0x44e254,'stdio':_0x28fad2?[_0xf22ae6(0xad),_0xf22ae6(0xad),_0xf22ae6(0xad)]:'inherit','detached':_0x28fad2});return _0x28fad2&&_0x56fafa[_0xf22ae6(0x9a)](),_0x56fafa;}function startTerminalUIProcess(_0x346682,_0x3448e1){const _0x1c6a35=a0_0x55b6c9,_0xf01db=join(__dirname,'loxia-terminal.js'),_0x354a6e={...process.env,'LOXIA_PORT':_0x3448e1[_0x1c6a35(0x84)](),'LOXIA_HOST':_0x346682},_0x3b7085=spawn(_0x1c6a35(0x79),[_0xf01db],{'cwd':join(__dirname,'..'),'env':_0x354a6e,'stdio':_0x1c6a35(0xb5)});return _0x3b7085;}const commands={'web':async()=>{const _0x5cfa3b=a0_0x55b6c9;console[_0x5cfa3b(0xa0)]('Starting\x20Loxia\x20server...\x0a');const _0x489527=startServer(![]);console[_0x5cfa3b(0xa0)](_0x5cfa3b(0xa3));let _0xf668dc;explicitPort?_0xf668dc=await waitForServerAtPort(host,explicitPort):_0xf668dc=await waitForServerWithDiscovery();if(_0xf668dc){const _0x2179ab=_0x5cfa3b(0x92)+_0xf668dc[_0x5cfa3b(0xc5)]+':'+_0xf668dc['port'];console['log'](_0x5cfa3b(0xab)+_0x2179ab),openBrowser(_0x2179ab);}else console['log'](_0x5cfa3b(0x76));process['on'](_0x5cfa3b(0xb3),()=>_0x489527[_0x5cfa3b(0x98)](_0x5cfa3b(0xb3))),process['on'](_0x5cfa3b(0xb8),()=>_0x489527['kill']('SIGTERM')),_0x489527['on']('exit',_0x20f8eb=>process['exit'](_0x20f8eb||0x0));},'plus-web':async()=>{const _0x38c781=a0_0x55b6c9;await commands[_0x38c781(0x73)]();},'serve':async()=>{const _0x6f6341=a0_0x55b6c9;console[_0x6f6341(0xa0)](_0x6f6341(0xb9));const _0x4ba47a=startServer(![]);console['log'](_0x6f6341(0xa3));let _0x5d439e;explicitPort?_0x5d439e=await waitForServerAtPort(host,explicitPort):_0x5d439e=await waitForServerWithDiscovery();if(_0x5d439e){const _0x37241a=_0x6f6341(0x92)+_0x5d439e[_0x6f6341(0xc5)]+':'+_0x5d439e['port'];console[_0x6f6341(0xa0)](_0x6f6341(0xc2)+_0x37241a),console['log'](_0x6f6341(0x93)+_0x37241a),console[_0x6f6341(0xa0)](_0x6f6341(0x71)),console[_0x6f6341(0xa0)](_0x6f6341(0xaa)+_0x37241a+_0x6f6341(0xae));}else console['log'](_0x6f6341(0x9c)),console['log'](_0x6f6341(0x9d));process['on'](_0x6f6341(0xb3),()=>_0x4ba47a[_0x6f6341(0x98)](_0x6f6341(0xb3))),process['on'](_0x6f6341(0xb8),()=>_0x4ba47a[_0x6f6341(0x98)](_0x6f6341(0xb8))),_0x4ba47a['on'](_0x6f6341(0xa2),_0x2f7abe=>process[_0x6f6341(0xa2)](_0x2f7abe||0x0));},'terminal':async()=>{const _0x420081=a0_0x55b6c9;console[_0x420081(0xa0)](_0x420081(0x8e));let _0x9d75b9=await discoverBackend();explicitPort&&(_0x9d75b9={'host':host,'port':explicitPort});!_0x9d75b9&&(console[_0x420081(0x75)]('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console[_0x420081(0x75)](_0x420081(0x9e)),console['error'](_0x420081(0x7a)),console[_0x420081(0x75)](_0x420081(0x8d)),console[_0x420081(0x75)](_0x420081(0x86)),process[_0x420081(0xa2)](0x1));const _0x2602fe=await checkServerRunning(_0x9d75b9[_0x420081(0xc5)],_0x9d75b9[_0x420081(0x82)]);!_0x2602fe&&(console[_0x420081(0x75)](_0x420081(0xb7)+_0x9d75b9['host']+':'+_0x9d75b9[_0x420081(0x82)]+'\x20but\x20not\x20responding.'),console[_0x420081(0x75)](_0x420081(0x99)),process[_0x420081(0xa2)](0x1));console[_0x420081(0xa0)]('Server\x20discovered\x20at\x20'+_0x9d75b9[_0x420081(0xc5)]+':'+_0x9d75b9[_0x420081(0x82)]),console[_0x420081(0xa0)](_0x420081(0x81));const _0x347374=startTerminalUIProcess(_0x9d75b9[_0x420081(0xc5)],_0x9d75b9[_0x420081(0x82)]);process['on'](_0x420081(0xb3),()=>_0x347374[_0x420081(0x98)]('SIGINT')),process['on'](_0x420081(0xb8),()=>_0x347374[_0x420081(0x98)](_0x420081(0xb8))),_0x347374['on'](_0x420081(0xa2),_0x4b9879=>process['exit'](_0x4b9879||0x0));},'plus-terminal':async()=>{const _0x304cc5=a0_0x55b6c9;console[_0x304cc5(0xa0)](_0x304cc5(0x8f));const _0x489177=startServer(!![]);let _0x55942e;explicitPort?_0x55942e=await waitForServerAtPort(host,explicitPort):_0x55942e=await waitForServerWithDiscovery();!_0x55942e&&(console[_0x304cc5(0x75)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process['exit'](0x1));console['log'](_0x304cc5(0xac)+_0x55942e[_0x304cc5(0xc5)]+':'+_0x55942e[_0x304cc5(0x82)]),console[_0x304cc5(0xa0)](_0x304cc5(0x81));const _0x4ace15=startTerminalUIProcess(_0x55942e[_0x304cc5(0xc5)],_0x55942e[_0x304cc5(0x82)]);_0x4ace15['on']('exit',_0x4fa176=>{const _0x2ff6d5=_0x304cc5;console['log'](_0x2ff6d5(0xb2));try{process[_0x2ff6d5(0x98)](_0x489177[_0x2ff6d5(0x7e)],'SIGTERM');}catch(_0x33deeb){}process[_0x2ff6d5(0xa2)](_0x4fa176||0x0);}),process['on'](_0x304cc5(0xb3),()=>{const _0x542e94=_0x304cc5;_0x4ace15['kill'](_0x542e94(0xb3));}),process['on'](_0x304cc5(0xb8),()=>{const _0x49508f=_0x304cc5;_0x4ace15[_0x49508f(0x98)](_0x49508f(0xb8));});}};commands[command]?commands[command]()[a0_0x55b6c9(0x87)](_0x456520=>{const _0x4076a6=a0_0x55b6c9;console['error']('Error:',_0x456520['message']),process[_0x4076a6(0xa2)](0x1);}):(console[a0_0x55b6c9(0x75)](a0_0x55b6c9(0x85)+command),console[a0_0x55b6c9(0x75)](a0_0x55b6c9(0xa4)),process['exit'](0x1));
|
|
3
|
+
const a0_0x214cf5=a0_0x21a6;(function(_0x2726d1,_0xba8122){const _0x124719=a0_0x21a6,_0x493df4=_0x2726d1();while(!![]){try{const _0xe8781b=-parseInt(_0x124719(0x19b))/0x1+parseInt(_0x124719(0x178))/0x2*(-parseInt(_0x124719(0x15a))/0x3)+parseInt(_0x124719(0x14f))/0x4*(-parseInt(_0x124719(0x18d))/0x5)+parseInt(_0x124719(0x182))/0x6*(-parseInt(_0x124719(0x19c))/0x7)+parseInt(_0x124719(0x183))/0x8+-parseInt(_0x124719(0x154))/0x9*(parseInt(_0x124719(0x194))/0xa)+parseInt(_0x124719(0x158))/0xb;if(_0xe8781b===_0xba8122)break;else _0x493df4['push'](_0x493df4['shift']());}catch(_0x35f1ab){_0x493df4['push'](_0x493df4['shift']());}}}(a0_0x20f9,0x5b613));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x52437a from'http';function a0_0x20f9(){const _0x3bcd70=['\x0a✓\x20Server\x20running\x20at\x20','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','node','35HhoyWi','src','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','open','host','\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20only\x20(no\x20UI\x20opened)\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:\x20auto-select\x20starting\x20from\x20','message','10UvpdRz','log','/api/health','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','inherit','index.js','setTimeout','287304MCaIoX','5495xhqBUD','SIGTERM','pid','Server\x20discovered\x20at\x20','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','start','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','Error:','getService','77320OSqkce','--port','length','toString','win32','2032812UFlgzp','web','SIGINT','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','16926613ndDnXe','loxia-terminal.js','708qqhQDU','parse','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','Please\x20open\x20manually:\x20','darwin','LOXIA_HOST','platform','exit','cmd','port','error','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','help','\x0aOpening\x20Web\x20UI\x20at\x20','cleanupStaleEntries','version','http://','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','Waiting\x20for\x20server\x20to\x20start...','statusCode','--host','ceil','Starting\x20Loxia\x20server...\x0a',')\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only\x20(headless)\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\x20specific\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\x20\x203.\x20Or\x20run\x20\x27loxia\x20serve\x27\x20for\x20headless\x20server\x20(connect\x20remotely)\x0a\x0aNote:\x20If\x20no\x20port\x20is\x20specified,\x20the\x20server\x20will\x20automatically\x20find\x0aan\x20available\x20port.\x20The\x20Terminal\x20UI\x20will\x20discover\x20the\x20server\x20port\x0aautomatically\x20from\x20the\x20port\x20registry.\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a','startsWith','Loxia\x20Autopilot\x20One\x20v','../src/services/portRegistry.js','Starting\x20Terminal\x20UI...\x0a','includes','xdg-open','5618OHmHgz','catch','\x20but\x20not\x20responding.','\x0aShutting\x20down\x20server...','now','unref','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','localhost','ignore','\x0aPlease\x20start\x20the\x20server\x20first:','4458DTSkvd','5841352YXKotD','package.json','Looking\x20for\x20running\x20server...','\x20\x20API\x20Health:\x20\x20\x20','kill'];a0_0x20f9=function(){return _0x3bcd70;};return a0_0x20f9();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST='127.0.0.1',SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process['argv']['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x214cf5(0x172)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x214cf5(0x176)]('--help')||args[a0_0x214cf5(0x176)]('-h'),'version':args[a0_0x214cf5(0x176)]('--version')||args[a0_0x214cf5(0x176)]('-v')};for(let i=0x0;i<args[a0_0x214cf5(0x151)];i++){args[i]===a0_0x214cf5(0x150)&&args[i+0x1]&&(flags[a0_0x214cf5(0x163)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x214cf5(0x16e)&&args[i+0x1]&&(flags[a0_0x214cf5(0x191)]=args[i+0x1]);}const explicitPort=flags[a0_0x214cf5(0x163)],host=flags[a0_0x214cf5(0x191)]||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x214cf5(0x184)),pkg=JSON[a0_0x214cf5(0x15b)](readFileSync(pkgPath,'utf8'));console[a0_0x214cf5(0x195)](a0_0x214cf5(0x173)+pkg[a0_0x214cf5(0x169)]),process[a0_0x214cf5(0x161)](0x0);}function a0_0x21a6(_0x5b9b1e,_0xcb24e5){_0x5b9b1e=_0x5b9b1e-0x149;const _0x20f9a7=a0_0x20f9();let _0x21a61f=_0x20f9a7[_0x5b9b1e];return _0x21a61f;}if(flags[a0_0x214cf5(0x166)]||!command){const pkgPath=join(__dirname,'..',a0_0x214cf5(0x184)),pkg=JSON[a0_0x214cf5(0x15b)](readFileSync(pkgPath,'utf8'));console[a0_0x214cf5(0x195)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x214cf5(0x169)]+a0_0x214cf5(0x192)+DEFAULT_PORT+a0_0x214cf5(0x18b)+DEFAULT_HOST+a0_0x214cf5(0x171)),process[a0_0x214cf5(0x161)](0x0);}async function getPortRegistry(){const _0x3d7a37=a0_0x214cf5,{getPortRegistry:_0x14723c}=await import(_0x3d7a37(0x174));return _0x14723c();}async function discoverBackend(){const _0x18233e=a0_0x214cf5;try{const _0x5496fe=await getPortRegistry();await _0x5496fe[_0x18233e(0x168)]();const _0x2d67eb=await _0x5496fe[_0x18233e(0x14e)]('backend');if(_0x2d67eb)return{'host':_0x2d67eb[_0x18233e(0x191)]||_0x18233e(0x17f),'port':_0x2d67eb[_0x18233e(0x163)],'pid':_0x2d67eb[_0x18233e(0x19e)]};return null;}catch(_0x20590a){return null;}}async function checkServerRunning(_0x22f38b,_0x1b9b9b,_0x537102=0x1){for(let _0x369c01=0x0;_0x369c01<_0x537102;_0x369c01++){const _0x5234e9=await new Promise(_0x2e5f56=>{const _0x25b09b=a0_0x21a6,_0x3a865a=a0_0x52437a['get']('http://'+_0x22f38b+':'+_0x1b9b9b+_0x25b09b(0x196),_0x19a09a=>{const _0x569fde=_0x25b09b;_0x2e5f56(_0x19a09a[_0x569fde(0x16d)]===0xc8);});_0x3a865a['on'](_0x25b09b(0x164),()=>_0x2e5f56(![])),_0x3a865a[_0x25b09b(0x19a)](0x7d0,()=>{_0x3a865a['destroy'](),_0x2e5f56(![]);});});if(_0x5234e9)return!![];_0x369c01<_0x537102-0x1&&await new Promise(_0x153430=>setTimeout(_0x153430,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x59c058=SERVER_STARTUP_TIMEOUT){const _0x1757ea=a0_0x214cf5,_0x501f25=Date['now']();while(Date[_0x1757ea(0x17c)]()-_0x501f25<_0x59c058){const _0x2cde50=await discoverBackend();if(_0x2cde50){const _0x405320=await checkServerRunning(_0x2cde50['host'],_0x2cde50[_0x1757ea(0x163)]);if(_0x405320)return _0x2cde50;}await new Promise(_0x12e2dd=>setTimeout(_0x12e2dd,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x39dfdf,_0x4cee37,_0x5ec349=SERVER_STARTUP_TIMEOUT){const _0x4e1dfc=a0_0x214cf5,_0x3205b4=Math[_0x4e1dfc(0x16f)](_0x5ec349/SERVER_CHECK_INTERVAL),_0x1cad8a=await checkServerRunning(_0x39dfdf,_0x4cee37,_0x3205b4);return _0x1cad8a?{'host':_0x39dfdf,'port':_0x4cee37}:null;}function openBrowser(_0x16bda2){const _0x1634f3=a0_0x214cf5;let _0x21b2c6,_0x162449;if(process[_0x1634f3(0x160)]===_0x1634f3(0x15e))_0x21b2c6=_0x1634f3(0x190),_0x162449=[_0x16bda2];else process[_0x1634f3(0x160)]===_0x1634f3(0x153)?(_0x21b2c6=_0x1634f3(0x162),_0x162449=['/c',_0x1634f3(0x14b),'\x22\x22',_0x16bda2]):(_0x21b2c6=_0x1634f3(0x177),_0x162449=[_0x16bda2]);const _0x333c0b=spawn(_0x21b2c6,_0x162449,{'detached':!![],'stdio':_0x1634f3(0x180)});_0x333c0b[_0x1634f3(0x17d)](),_0x333c0b['on'](_0x1634f3(0x164),()=>{const _0x569c88=_0x1634f3;console['log']('Could\x20not\x20open\x20browser\x20automatically.'),console[_0x569c88(0x195)](_0x569c88(0x15d)+_0x16bda2);});}function startServer(_0x16865d=![]){const _0x92bafb=a0_0x214cf5,_0x103a5e={...process.env};explicitPort&&(_0x103a5e['LOXIA_PORT']=explicitPort[_0x92bafb(0x152)](),_0x103a5e['PORT']=explicitPort['toString']());flags['host']&&(_0x103a5e[_0x92bafb(0x15f)]=flags[_0x92bafb(0x191)]);const _0x18efa3=join(__dirname,'..',_0x92bafb(0x18e),_0x92bafb(0x199)),_0x20dcab=spawn(_0x92bafb(0x18c),[_0x18efa3],{'cwd':join(__dirname,'..'),'env':_0x103a5e,'stdio':_0x16865d?[_0x92bafb(0x180),_0x92bafb(0x180),_0x92bafb(0x180)]:_0x92bafb(0x198),'detached':_0x16865d});return _0x16865d&&_0x20dcab[_0x92bafb(0x17d)](),_0x20dcab;}function startTerminalUIProcess(_0x4bf315,_0x3d041f){const _0x3a57a8=a0_0x214cf5,_0x109ef6=join(__dirname,_0x3a57a8(0x159)),_0x5d9185={...process.env,'LOXIA_PORT':_0x3d041f['toString'](),'LOXIA_HOST':_0x4bf315},_0x13a703=spawn('node',[_0x109ef6],{'cwd':join(__dirname,'..'),'env':_0x5d9185,'stdio':'inherit'});return _0x13a703;}const commands={'web':async()=>{const _0x45c815=a0_0x214cf5;console[_0x45c815(0x195)](_0x45c815(0x170));const _0x59af0f=startServer(![]);console['log'](_0x45c815(0x16c));let _0x468250;explicitPort?_0x468250=await waitForServerAtPort(host,explicitPort):_0x468250=await waitForServerWithDiscovery();if(_0x468250){const _0x35de45=_0x45c815(0x16a)+_0x468250[_0x45c815(0x191)]+':'+_0x468250['port'];console[_0x45c815(0x195)](_0x45c815(0x167)+_0x35de45),openBrowser(_0x35de45);}else console[_0x45c815(0x195)](_0x45c815(0x197));process['on'](_0x45c815(0x156),()=>_0x59af0f[_0x45c815(0x187)](_0x45c815(0x156))),process['on'](_0x45c815(0x19d),()=>_0x59af0f['kill']('SIGTERM')),_0x59af0f['on']('exit',_0x49894d=>process[_0x45c815(0x161)](_0x49894d||0x0));},'plus-web':async()=>{const _0x429c85=a0_0x214cf5;await commands[_0x429c85(0x155)]();},'serve':async()=>{const _0x322eba=a0_0x214cf5;console[_0x322eba(0x195)](_0x322eba(0x170));const _0x52aeab=startServer(![]);console[_0x322eba(0x195)](_0x322eba(0x16c));let _0x5e9b8d;explicitPort?_0x5e9b8d=await waitForServerAtPort(host,explicitPort):_0x5e9b8d=await waitForServerWithDiscovery();if(_0x5e9b8d){const _0x11a870=_0x322eba(0x16a)+_0x5e9b8d[_0x322eba(0x191)]+':'+_0x5e9b8d[_0x322eba(0x163)];console[_0x322eba(0x195)](_0x322eba(0x188)+_0x11a870),console[_0x322eba(0x195)](_0x322eba(0x14c)+_0x11a870),console[_0x322eba(0x195)](_0x322eba(0x17e)),console[_0x322eba(0x195)](_0x322eba(0x186)+_0x11a870+'/api/health\x0a');}else console[_0x322eba(0x195)](_0x322eba(0x16b)),console[_0x322eba(0x195)](_0x322eba(0x189));process['on']('SIGINT',()=>_0x52aeab[_0x322eba(0x187)](_0x322eba(0x156))),process['on'](_0x322eba(0x19d),()=>_0x52aeab[_0x322eba(0x187)](_0x322eba(0x19d))),_0x52aeab['on'](_0x322eba(0x161),_0x5b1f7d=>process[_0x322eba(0x161)](_0x5b1f7d||0x0));},'terminal':async()=>{const _0x330981=a0_0x214cf5;console[_0x330981(0x195)](_0x330981(0x185));let _0x5c7c47=await discoverBackend();explicitPort&&(_0x5c7c47={'host':host,'port':explicitPort});!_0x5c7c47&&(console[_0x330981(0x164)](_0x330981(0x15c)),console[_0x330981(0x164)](_0x330981(0x181)),console[_0x330981(0x164)](_0x330981(0x157)),console['error'](_0x330981(0x14a)),console[_0x330981(0x164)]('\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a'),process[_0x330981(0x161)](0x1));const _0x25e540=await checkServerRunning(_0x5c7c47['host'],_0x5c7c47[_0x330981(0x163)]);!_0x25e540&&(console[_0x330981(0x164)]('\x0aServer\x20registered\x20at\x20'+_0x5c7c47['host']+':'+_0x5c7c47['port']+_0x330981(0x17a)),console[_0x330981(0x164)](_0x330981(0x18f)),process[_0x330981(0x161)](0x1));console['log'](_0x330981(0x149)+_0x5c7c47[_0x330981(0x191)]+':'+_0x5c7c47['port']),console[_0x330981(0x195)](_0x330981(0x175));const _0x2d4bbc=startTerminalUIProcess(_0x5c7c47['host'],_0x5c7c47['port']);process['on'](_0x330981(0x156),()=>_0x2d4bbc[_0x330981(0x187)](_0x330981(0x156))),process['on']('SIGTERM',()=>_0x2d4bbc[_0x330981(0x187)](_0x330981(0x19d))),_0x2d4bbc['on'](_0x330981(0x161),_0x27fb92=>process['exit'](_0x27fb92||0x0));},'plus-terminal':async()=>{const _0x1e0606=a0_0x214cf5;console[_0x1e0606(0x195)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x98ae2e=startServer(!![]);let _0x4d9787;explicitPort?_0x4d9787=await waitForServerAtPort(host,explicitPort):_0x4d9787=await waitForServerWithDiscovery();!_0x4d9787&&(console[_0x1e0606(0x164)](_0x1e0606(0x18a)),process['exit'](0x1));console[_0x1e0606(0x195)]('Server\x20running\x20at\x20http://'+_0x4d9787[_0x1e0606(0x191)]+':'+_0x4d9787['port']),console[_0x1e0606(0x195)]('Starting\x20Terminal\x20UI...\x0a');const _0x509ddc=startTerminalUIProcess(_0x4d9787[_0x1e0606(0x191)],_0x4d9787[_0x1e0606(0x163)]);_0x509ddc['on'](_0x1e0606(0x161),_0x17798b=>{const _0x36cf8c=_0x1e0606;console[_0x36cf8c(0x195)](_0x36cf8c(0x17b));try{process['kill'](_0x98ae2e['pid'],'SIGTERM');}catch(_0x43008b){}process[_0x36cf8c(0x161)](_0x17798b||0x0);}),process['on'](_0x1e0606(0x156),()=>{const _0x19ad5e=_0x1e0606;_0x509ddc[_0x19ad5e(0x187)](_0x19ad5e(0x156));}),process['on']('SIGTERM',()=>{const _0x1a4ff7=_0x1e0606;_0x509ddc[_0x1a4ff7(0x187)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x214cf5(0x179)](_0x204db3=>{const _0x411eba=a0_0x214cf5;console[_0x411eba(0x164)](_0x411eba(0x14d),_0x204db3[_0x411eba(0x193)]),process[_0x411eba(0x161)](0x1);}):(console['error']('Unknown\x20command:\x20'+command),console[a0_0x214cf5(0x164)](a0_0x214cf5(0x165)),process['exit'](0x1));
|
package/bin/loxia-terminal-v2.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function a0_0xe78c(){const _0x5ab26d=['slice','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','join','destroy','...','bin/cli.js','✗\x20Server\x20is\x20not\x20running','19698175JxpQIV','758090bIpVEN','connect','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','293544nnMbdm','timeout','533380RhRFVa','../src/interfaces/terminal/index.js','--host','exit','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','error','Failed\x20to\x20start\x20server:','localhost','stdout','now','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','1198404CsUIAU','node','toString','🚀\x20Starting\x20Loxia\x20server...','Server\x20startup\x20timeout','log','stderr','kill','--port','setTimeout','3857208dmVoaO','1096248auKBDs','message','--ui','length','web','✓\x20Server\x20started\x20at\x20','data','pipe','Socket','💡\x20Troubleshooting:'];a0_0xe78c=function(){return _0x5ab26d;};return a0_0xe78c();}const a0_0x16b6c9=a0_0xc4d3;(function(_0x5f1b01,_0x128beb){const _0x4d4456=a0_0xc4d3,_0x436e7d=_0x5f1b01();while(!![]){try{const _0x489d0e=-parseInt(_0x4d4456(0x92))/0x1+-parseInt(_0x4d4456(0x75))/0x2+-parseInt(_0x4d4456(0x80))/0x3+parseInt(_0x4d4456(0x95))/0x4+-parseInt(_0x4d4456(0x97))/0x5+-parseInt(_0x4d4456(0x7f))/0x6+parseInt(_0x4d4456(0x91))/0x7;if(_0x489d0e===_0x128beb)break;else _0x436e7d['push'](_0x436e7d['shift']());}catch(_0x29a913){_0x436e7d['push'](_0x436e7d['shift']());}}}(a0_0xe78c,0x655b7));function a0_0xc4d3(_0x3ff70f,_0x1a0782){_0x3ff70f=_0x3ff70f-0x70;const _0xe78c46=a0_0xe78c();let _0xc4d3df=_0xe78c46[_0x3ff70f];return _0xc4d3df;}import{spawn}from'child_process';import a0_0x243f74 from'net';import a0_0x171926 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x171926['dirname'](__filename),projectRoot=a0_0x171926['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x16b6c9(0x71),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x2e22fb,_0x118139){return new Promise(_0xf131b3=>{const _0x42f284=a0_0xc4d3,_0x3864e0=new a0_0x243f74[(_0x42f284(0x88))]();_0x3864e0[_0x42f284(0x7e)](0x7d0),_0x3864e0['on'](_0x42f284(0x93),()=>{const _0x2cf43b=_0x42f284;_0x3864e0[_0x2cf43b(0x8d)](),_0xf131b3(!![]);}),_0x3864e0['on'](_0x42f284(0x96),()=>{const _0x4051c1=_0x42f284;_0x3864e0[_0x4051c1(0x8d)](),_0xf131b3(![]);}),_0x3864e0['on']('error',()=>{_0x3864e0['destroy'](),_0xf131b3(![]);}),_0x3864e0[_0x42f284(0x93)](_0x118139,_0x2e22fb);});}async function startServer(_0x3555d0,_0x56c9dc){const _0x44ae29=a0_0x16b6c9;return console['log'](_0x44ae29(0x78)),new Promise((_0x229c1c,_0x17e0f7)=>{const _0x4b4bc9=_0x44ae29,_0x319333=spawn(_0x4b4bc9(0x76),[a0_0x171926[_0x4b4bc9(0x8c)](projectRoot,_0x4b4bc9(0x8f)),_0x4b4bc9(0x82),_0x4b4bc9(0x84),_0x4b4bc9(0x99),_0x3555d0,_0x4b4bc9(0x7d),_0x56c9dc['toString']()],{'detached':![],'stdio':['ignore',_0x4b4bc9(0x87),_0x4b4bc9(0x87)]});_0x319333[_0x4b4bc9(0x72)]['on'](_0x4b4bc9(0x86),()=>{}),_0x319333[_0x4b4bc9(0x7b)]['on']('data',()=>{}),_0x319333['on'](_0x4b4bc9(0x9c),_0x55fcab=>{const _0x181952=_0x4b4bc9;console[_0x181952(0x9c)](_0x181952(0x70),_0x55fcab[_0x181952(0x81)]),_0x17e0f7(_0x55fcab);});const _0x5d8dcb=Date[_0x4b4bc9(0x73)](),_0x400a4e=setInterval(async()=>{const _0x547a12=_0x4b4bc9,_0x445722=await isServerRunning(_0x3555d0,_0x56c9dc);if(_0x445722)clearInterval(_0x400a4e),console['log'](_0x547a12(0x85)+_0x3555d0+':'+_0x56c9dc),_0x229c1c();else Date['now']()-_0x5d8dcb>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x400a4e),_0x319333[_0x547a12(0x7c)](),_0x17e0f7(new Error(_0x547a12(0x79))));},0x1f4);});}async function main(){const _0x39f865=a0_0x16b6c9;try{console[_0x39f865(0x7a)](_0x39f865(0x8b)),console[_0x39f865(0x7a)](_0x39f865(0x74)),console[_0x39f865(0x7a)](_0x39f865(0x8b)),console['log']('');const _0x4ba951=process['argv'][_0x39f865(0x8a)](0x2);let _0x204fcd=DEFAULT_HOST,_0x4442e1=DEFAULT_PORT;for(let _0x3000b7=0x0;_0x3000b7<_0x4ba951[_0x39f865(0x83)];_0x3000b7++){if(_0x4ba951[_0x3000b7]===_0x39f865(0x99)&&_0x4ba951[_0x3000b7+0x1])_0x204fcd=_0x4ba951[_0x3000b7+0x1],_0x3000b7++;else _0x4ba951[_0x3000b7]===_0x39f865(0x7d)&&_0x4ba951[_0x3000b7+0x1]&&(_0x4442e1=parseInt(_0x4ba951[_0x3000b7+0x1],0xa),_0x3000b7++);}console['log']('🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20'+_0x204fcd+':'+_0x4442e1+_0x39f865(0x8e));const _0x586b6c=await isServerRunning(_0x204fcd,_0x4442e1);!_0x586b6c?(console['log'](_0x39f865(0x90)),await startServer(_0x204fcd,_0x4442e1)):console[_0x39f865(0x7a)]('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x204fcd+':'+_0x4442e1),console[_0x39f865(0x7a)](''),console[_0x39f865(0x7a)]('🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'),console[_0x39f865(0x7a)](''),await new Promise(_0x2425d5=>setTimeout(_0x2425d5,0x1f4)),process.env.LOXIA_HOST=_0x204fcd,process.env.LOXIA_PORT=_0x4442e1[_0x39f865(0x77)](),await import(_0x39f865(0x98));}catch(_0x4f4f7d){console[_0x39f865(0x9c)](''),console[_0x39f865(0x9c)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console['error']('\x20\x20',_0x4f4f7d[_0x39f865(0x81)]),console[_0x39f865(0x9c)](''),console[_0x39f865(0x9c)](_0x39f865(0x89)),console['error'](_0x39f865(0x94)),console[_0x39f865(0x9c)](_0x39f865(0x9b)),console[_0x39f865(0x9c)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x39f865(0x9c)](''),process[_0x39f865(0x9a)](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_0xe5e72d=a0_0x31df;(function(_0x72b42a,_0x2f45a2){const _0x140ea5=a0_0x31df,_0x5be3cb=_0x72b42a();while(!![]){try{const _0x183af0=parseInt(_0x140ea5(0xb0))/0x1*(parseInt(_0x140ea5(0xcc))/0x2)+parseInt(_0x140ea5(0xce))/0x3+-parseInt(_0x140ea5(0xaf))/0x4*(-parseInt(_0x140ea5(0xc1))/0x5)+parseInt(_0x140ea5(0xcb))/0x6+parseInt(_0x140ea5(0xc6))/0x7+-parseInt(_0x140ea5(0xc9))/0x8+-parseInt(_0x140ea5(0xb6))/0x9;if(_0x183af0===_0x2f45a2)break;else _0x5be3cb['push'](_0x5be3cb['shift']());}catch(_0x12573d){_0x5be3cb['push'](_0x5be3cb['shift']());}}}(a0_0xff02,0x1ab54));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0xe5e72d(0xad)][a0_0xe5e72d(0xbe)](0x2),options={'host':a0_0xe5e72d(0xc2),'port':0x1f90};function a0_0xff02(){const _0x1434c0=['\x20\x20-\x20Some\x20CI/CD\x20environments','Press\x20Ctrl+C\x20to\x20exit\x0a','Or\x20use\x20the\x20web\x20UI\x20instead:','log','slice','length','port','527515bHorfu','localhost','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','waitUntilExit','The\x20terminal\x20UI\x20cannot\x20run\x20in:','1286684ayzNXp','--host','host','1654872tiXRhY','\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','669174Hvmaby','13286YUxoHk','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','11238NIGWlU','then','\x0aTerminal\x20UI\x20exited','argv','--help','4WqCzDv','3QDRORp','\x20\x20npm\x20run\x20terminal-ui','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20npm\x20start','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','exit','974376UhxAYl','error','stdin','\x0aTerminal\x20UI\x20error:'];a0_0xff02=function(){return _0x1434c0;};return a0_0xff02();}function a0_0x31df(_0x8a2fe1,_0x208e1c){_0x8a2fe1=_0x8a2fe1-0xac;const _0xff028e=a0_0xff02();let _0x31df5b=_0xff028e[_0x8a2fe1];return _0x31df5b;}for(let i=0x0;i<args[a0_0xe5e72d(0xbf)];i++){const arg=args[i];if(arg===a0_0xe5e72d(0xc7)||arg==='-h')options['host']=args[++i];else{if(arg==='--port'||arg==='-p')options[a0_0xe5e72d(0xc0)]=parseInt(args[++i],0xa);else arg===a0_0xe5e72d(0xae)&&(console[a0_0xe5e72d(0xbd)](a0_0xe5e72d(0xca)),process['exit'](0x0));}}process.env.LOXIA_HOST&&(options[a0_0xe5e72d(0xc8)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0xe5e72d(0xc0)]=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0xe5e72d(0xb8)]['isTTY']&&(console[a0_0xe5e72d(0xb7)](a0_0xe5e72d(0xb4)),console[a0_0xe5e72d(0xb7)](''),console['error'](a0_0xe5e72d(0xc5)),console[a0_0xe5e72d(0xb7)]('\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)'),console[a0_0xe5e72d(0xb7)](a0_0xe5e72d(0xcd)),console['error'](a0_0xe5e72d(0xc3)),console['error'](a0_0xe5e72d(0xba)),console['error'](''),console[a0_0xe5e72d(0xb7)](a0_0xe5e72d(0xb2)),console[a0_0xe5e72d(0xb7)](a0_0xe5e72d(0xb1)),console['error'](''),console[a0_0xe5e72d(0xb7)](a0_0xe5e72d(0xbc)),console['error'](a0_0xe5e72d(0xb3)),process['exit'](0x1));console['log']('Starting\x20Loxia\x20Terminal\x20UI...'),console[a0_0xe5e72d(0xbd)]('Connecting\x20to:\x20'+options[a0_0xe5e72d(0xc8)]+':'+options[a0_0xe5e72d(0xc0)]),console[a0_0xe5e72d(0xbd)](a0_0xe5e72d(0xbb));const instance=startTerminalUI(options);instance[a0_0xe5e72d(0xc4)]()[a0_0xe5e72d(0xcf)](()=>{const _0x56374f=a0_0xe5e72d;console['log'](_0x56374f(0xac)),process[_0x56374f(0xb5)](0x0);})['catch'](_0x257596=>{const _0x168eb6=a0_0xe5e72d;console[_0x168eb6(0xb7)](_0x168eb6(0xb9),_0x257596),process[_0x168eb6(0xb5)](0x1);});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x2743e1=a0_0x6195;(function(_0x52e7c8,_0x5858f8){const _0xab7645=a0_0x6195,_0x5547ac=_0x52e7c8();while(!![]){try{const _0x52d84b=-parseInt(_0xab7645(0xf2))/0x1*(-parseInt(_0xab7645(0x103))/0x2)+parseInt(_0xab7645(0x105))/0x3+-parseInt(_0xab7645(0xfa))/0x4*(parseInt(_0xab7645(0x118))/0x5)+parseInt(_0xab7645(0xec))/0x6+parseInt(_0xab7645(0xfd))/0x7*(parseInt(_0xab7645(0x10d))/0x8)+-parseInt(_0xab7645(0x108))/0x9*(-parseInt(_0xab7645(0xff))/0xa)+parseInt(_0xab7645(0xe8))/0xb*(-parseInt(_0xab7645(0x119))/0xc);if(_0x52d84b===_0x5858f8)break;else _0x5547ac['push'](_0x5547ac['shift']());}catch(_0x3f16e8){_0x5547ac['push'](_0x5547ac['shift']());}}}(a0_0x5cbe,0x4acbe));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x101243 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;function a0_0x6195(_0x1b9706,_0x12cedc){_0x1b9706=_0x1b9706-0xe6;const _0x5cbe17=a0_0x5cbe();let _0x61950c=_0x5cbe17[_0x1b9706];return _0x61950c;}let serverProcess=null;async function checkServerReady(_0x42910c=0xa,_0x431768=0x1f4){const _0x3969fd=a0_0x6195;for(let _0x52beb2=0x0;_0x52beb2<_0x42910c;_0x52beb2++){try{return await new Promise((_0x48a01d,_0x5c1496)=>{const _0xa1b03c=a0_0x6195,_0x5e1cbf=a0_0x101243[_0xa1b03c(0x117)](_0xa1b03c(0x10e)+SERVER_PORT+_0xa1b03c(0x100),_0x1ff39d=>{const _0x2f8746=_0xa1b03c;_0x1ff39d[_0x2f8746(0xee)]===0xc8?_0x48a01d():_0x5c1496(new Error(_0x2f8746(0x115)+_0x1ff39d['statusCode']));});_0x5e1cbf['on']('error',_0x5c1496),_0x5e1cbf[_0xa1b03c(0xfb)](0x3e8,()=>{const _0x5b3603=_0xa1b03c;_0x5e1cbf[_0x5b3603(0xeb)](),_0x5c1496(new Error(_0x5b3603(0x104)));});}),console[_0x3969fd(0x106)](_0x3969fd(0xed)),!![];}catch(_0x188aaf){_0x52beb2<_0x42910c-0x1&&await new Promise(_0x88acda=>setTimeout(_0x88acda,_0x431768));}}return console[_0x3969fd(0x106)](_0x3969fd(0x101)),![];}async function startServer(){return new Promise(_0x516727=>{const _0x2dfd62=a0_0x6195;console[_0x2dfd62(0x106)](_0x2dfd62(0x116));const _0x3f40fb=join(rootDir,_0x2dfd62(0xfe),_0x2dfd62(0xf6));serverProcess=spawn('node',[_0x3f40fb],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x2dfd62(0xf1),_0x2dfd62(0xe6),_0x2dfd62(0xe6)],'detached':![]}),serverProcess[_0x2dfd62(0xea)]['on']('data',_0x443bb6=>{const _0x2ece98=_0x2dfd62,_0x2b056b=_0x443bb6[_0x2ece98(0xf3)]()[_0x2ece98(0xf0)]();_0x2b056b&&console[_0x2ece98(0x106)](_0x2ece98(0x111)+_0x2b056b);}),serverProcess[_0x2dfd62(0x112)]['on'](_0x2dfd62(0xfc),_0x39c5c1=>{const _0x1be1b1=_0x2dfd62,_0x38f833=_0x39c5c1[_0x1be1b1(0xf3)]()[_0x1be1b1(0xf0)]();_0x38f833&&!_0x38f833['includes'](_0x1be1b1(0xf8))&&console[_0x1be1b1(0xf9)](_0x1be1b1(0x10a)+_0x38f833);}),serverProcess['on']('error',_0x57631a=>{const _0x2017e1=_0x2dfd62;console[_0x2017e1(0xf9)](_0x2017e1(0xf5),_0x57631a[_0x2017e1(0x109)]),process[_0x2017e1(0x11a)](0x1);}),serverProcess['on']('exit',(_0xcfeb4c,_0x10620f)=>{const _0x3a35b1=_0x2dfd62;_0xcfeb4c!==null&&_0xcfeb4c!==0x0&&(console['error'](_0x3a35b1(0xf4)+_0xcfeb4c),process[_0x3a35b1(0x11a)](_0xcfeb4c));}),setTimeout(_0x516727,STARTUP_WAIT);});}async function startTerminalUI(){const _0x2ac6b7=a0_0x6195;console[_0x2ac6b7(0x106)](_0x2ac6b7(0x113)),console['log']('');const _0x11d27d=join(rootDir,_0x2ac6b7(0x10f),'loxia-terminal.js'),_0x25ed0e=spawn('node',[_0x11d27d],{'cwd':rootDir,'env':{...process.env},'stdio':_0x2ac6b7(0x102)});return _0x25ed0e['on'](_0x2ac6b7(0xf9),_0x9db66=>{const _0x127c88=_0x2ac6b7;console[_0x127c88(0xf9)](_0x127c88(0x110),_0x9db66[_0x127c88(0x109)]),cleanup(),process['exit'](0x1);}),_0x25ed0e['on'](_0x2ac6b7(0x11a),_0x5bf66c=>{const _0x5df6b6=_0x2ac6b7;console[_0x5df6b6(0x106)]('\x0a👋\x20Terminal\x20UI\x20closed.'),cleanup(),process[_0x5df6b6(0x11a)](_0x5bf66c||0x0);}),_0x25ed0e;}function cleanup(){const _0x4a5b99=a0_0x6195;serverProcess&&!serverProcess[_0x4a5b99(0x10c)]&&(console['log']('🛑\x20Stopping\x20server...'),serverProcess[_0x4a5b99(0xef)](_0x4a5b99(0x10b)),setTimeout(()=>{const _0xf3533a=_0x4a5b99;!serverProcess[_0xf3533a(0x10c)]&&serverProcess[_0xf3533a(0xef)](_0xf3533a(0xf7));},0x1388));}process['on']('SIGINT',()=>{const _0x27b957=a0_0x6195;console[_0x27b957(0x106)](_0x27b957(0xe7)),cleanup(),process[_0x27b957(0x11a)](0x0);}),process['on'](a0_0x2743e1(0x10b),()=>{const _0x53c2ca=a0_0x2743e1;console[_0x53c2ca(0x106)](_0x53c2ca(0xe9)),cleanup(),process[_0x53c2ca(0x11a)](0x0);}),process['on'](a0_0x2743e1(0x11a),()=>{cleanup();});async function main(){const _0x48e72d=a0_0x2743e1;console[_0x48e72d(0x106)](_0x48e72d(0x11b)),console[_0x48e72d(0x106)](_0x48e72d(0x107)),console[_0x48e72d(0x106)]('╚════════════════════════════════════════════════╝'),console[_0x48e72d(0x106)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x4b9793){console[_0x48e72d(0xf9)](_0x48e72d(0x114),_0x4b9793[_0x48e72d(0x109)]),cleanup(),process[_0x48e72d(0x11a)](0x1);}}function a0_0x5cbe(){const _0x46093b=['🖥️\x20\x20Starting\x20Terminal\x20UI...','Error\x20during\x20startup:','Server\x20returned\x20','🚀\x20Starting\x20Loxia\x20server...','get','5LWPZPG','36xCWaip','exit','╔════════════════════════════════════════════════╗','pipe','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','4111173fevhUX','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','stdout','destroy','2643024oYECjb','✅\x20Server\x20is\x20ready!','statusCode','kill','trim','ignore','1lGqFgP','toString','Server\x20exited\x20with\x20code\x20','Failed\x20to\x20start\x20server:','index.js','SIGKILL','ExperimentalWarning','error','326408ciPIxk','setTimeout','data','1750833glwrZl','src','233660suBGKb','/health','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','inherit','316346jnafwc','Timeout','1490517CWBJpk','log','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','63FqBEEU','message','[SERVER\x20ERROR]\x20','SIGTERM','killed','8knNStA','http://localhost:','bin','Failed\x20to\x20start\x20Terminal\x20UI:','[SERVER]\x20','stderr'];a0_0x5cbe=function(){return _0x46093b;};return a0_0x5cbe();}main();
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
function a0_0x2b01(_0x414be2,_0xdd83d3){_0x414be2=_0x414be2-0xc1;const _0x383914=a0_0x3839();let _0x2b01a0=_0x383914[_0x414be2];return _0x2b01a0;}const a0_0x40f9f0=a0_0x2b01;(function(_0x2afe4d,_0x213248){const _0x42c4f6=a0_0x2b01,_0x5d0fc0=_0x2afe4d();while(!![]){try{const _0x2e427d=parseInt(_0x42c4f6(0xfb))/0x1*(-parseInt(_0x42c4f6(0x10a))/0x2)+-parseInt(_0x42c4f6(0xee))/0x3+-parseInt(_0x42c4f6(0xe2))/0x4+-parseInt(_0x42c4f6(0xc7))/0x5+parseInt(_0x42c4f6(0xcb))/0x6+parseInt(_0x42c4f6(0xf2))/0x7*(parseInt(_0x42c4f6(0xfc))/0x8)+parseInt(_0x42c4f6(0xce))/0x9*(parseInt(_0x42c4f6(0xec))/0xa);if(_0x2e427d===_0x213248)break;else _0x5d0fc0['push'](_0x5d0fc0['shift']());}catch(_0x36d4a3){_0x5d0fc0['push'](_0x5d0fc0['shift']());}}}(a0_0x3839,0xe6e17));import{exec}from'child_process';import{promisify}from'util';import a0_0x1b406d from'https';import a0_0x519d56 from'http';import a0_0x4894c4 from'fs';import a0_0x3680d8 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_0x3680d8['dirname'](__filename),SCANNER_DIR=a0_0x3680d8[a0_0x40f9f0(0xda)](__dirname,'..',a0_0x40f9f0(0x104),a0_0x40f9f0(0xdc)),SEMGREP_VERSION=a0_0x40f9f0(0x108);console[a0_0x40f9f0(0x107)](a0_0x40f9f0(0xc8)),console[a0_0x40f9f0(0x107)](a0_0x40f9f0(0xdb)),console['log'](a0_0x40f9f0(0xe7)+process['platform']+'\x20('+process['arch']+')'),console[a0_0x40f9f0(0x107)](a0_0x40f9f0(0x103));async function installScanners(){const _0x144dd4=a0_0x40f9f0;await a0_0x4894c4['promises'][_0x144dd4(0xc2)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x144dd4(0x107)](_0x144dd4(0xde)),console[_0x144dd4(0x107)](_0x144dd4(0xd7)),console[_0x144dd4(0x107)](_0x144dd4(0x103));}async function checkESLintSecurity(){const _0x2c28e9=a0_0x40f9f0;console[_0x2c28e9(0x107)]('📦\x20Checking\x20ESLint\x20Security\x20Plugin...');try{await import(_0x2c28e9(0xca)),console['log'](_0x2c28e9(0xc5));}catch(_0x3ddc67){console['log']('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x2c28e9(0x107)](_0x2c28e9(0xd1));}}async function installSemgrep(){const _0x6675d9=a0_0x40f9f0;console[_0x6675d9(0x107)](_0x6675d9(0xed));const _0x1598b5=process[_0x6675d9(0xd6)],_0x5236e7=process[_0x6675d9(0xc9)];try{const _0x2921e9=await execAsync('semgrep\x20--version',{'timeout':0x1388});console[_0x6675d9(0x107)]('\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20'+_0x2921e9[_0x6675d9(0xd5)][_0x6675d9(0xe4)]()),console[_0x6675d9(0x107)](_0x6675d9(0xeb));return;}catch(_0x481e1b){console['log'](_0x6675d9(0xef));}const _0xab72c7=getSemgrepBinaryInfo(_0x1598b5,_0x5236e7);if(!_0xab72c7){console[_0x6675d9(0x107)](_0x6675d9(0xfd)+_0x1598b5+'-'+_0x5236e7),console['log']('\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a');return;}try{const _0x2b0d31=a0_0x3680d8[_0x6675d9(0xda)](SCANNER_DIR,_0x6675d9(0xe3));console[_0x6675d9(0x107)](_0x6675d9(0x102)+_0xab72c7[_0x6675d9(0xcd)]+'...'),await downloadFile(_0xab72c7['url'],_0x2b0d31),await a0_0x4894c4[_0x6675d9(0xe5)][_0x6675d9(0xfa)](_0x2b0d31,0x1ed),console[_0x6675d9(0x107)]('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x6675d9(0x107)]('\x20\x20\x20Location:\x20'+_0x2b0d31+'\x0a'),console['log']('\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'),console[_0x6675d9(0x107)](_0x6675d9(0xff));}catch(_0x534b51){console['log'](_0x6675d9(0xf9)+_0x534b51['message']),console[_0x6675d9(0x107)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0xfd1399,_0x3b90a9){return null;}function a0_0x3839(){const _0x35c36e=['\x20\x20Platform:\x20','startsWith','\x20installed\x20successfully','\x20\x20\x20✅\x20','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','23329710yzTZuu','🔍\x20Installing\x20Semgrep...','3758622NOrfsD','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','bandit','python3','7779191OTXKUf','headers','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','yamllint','get','/opt/homebrew','--user','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','chmod','55wKEVjR','8HmHrGw','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20pip\x20install\x20semgrep\x0a','error','python3\x20--version','\x20\x20\x20Downloading\x20from\x20','═══════════════════════════════════════════════════════════\x0a','node_modules','catch','...','log','v1.55.0','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','25502PwbAUt','includes','python\x20--version','mkdir','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','statusCode','645365OUaIuY','═══════════════════════════════════════════════════════════','arch','eslint-plugin-security','2074140NtDuTl','unlink','url','9dyqxjS','Failed\x20to\x20download:\x20HTTP\x20','\x20already\x20installed','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','close','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','message','stdout','platform','\x20\x20Installation\x20Complete','🐍\x20Checking\x20Python\x20scanners...','\x20-m\x20pip\x20show\x20','join','\x20\x20Installing\x20Security\x20Scanners','.scanners','\x20\x20\x20Installing\x20','\x0a═══════════════════════════════════════════════════════════','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','exit','finish','3044140QxaWpo','semgrep','trim','promises','pip-audit'];a0_0x3839=function(){return _0x35c36e;};return a0_0x3839();}async function installPythonScanners(){const _0x5ae26e=a0_0x40f9f0;console[_0x5ae26e(0x107)](_0x5ae26e(0xd8));let _0x8a8eae=null;try{await execAsync(_0x5ae26e(0x101),{'timeout':0x1388}),_0x8a8eae=_0x5ae26e(0xf1);}catch(_0x5ec49e){try{await execAsync(_0x5ae26e(0xc1),{'timeout':0x1388}),_0x8a8eae='python';}catch(_0x1a4a2a){console[_0x5ae26e(0x107)]('\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners'),console[_0x5ae26e(0x107)](_0x5ae26e(0xfe)),console[_0x5ae26e(0x107)](_0x5ae26e(0xc4));return;}}console[_0x5ae26e(0x107)]('\x20\x20\x20✅\x20Python\x20found:\x20'+_0x8a8eae),await installViaPip(_0x5ae26e(0xe3),_0x8a8eae),await installViaPip(_0x5ae26e(0xf0),_0x8a8eae),await installViaPip(_0x5ae26e(0xe6),_0x8a8eae),await installViaPip('checkov',_0x8a8eae),await installViaPip(_0x5ae26e(0xf5),_0x8a8eae),console[_0x5ae26e(0x107)]('');}async function isHomebrewPython(_0x486606){const _0x12366b=a0_0x40f9f0;try{const {stdout:_0x28fd20}=await execAsync(_0x486606+_0x12366b(0xdf),{'timeout':0x1388});return _0x28fd20[_0x12366b(0x10b)](_0x12366b(0xf7))||_0x28fd20[_0x12366b(0x10b)]('/usr/local/Cellar');}catch{return![];}}async function installViaPip(_0x2b9b70,_0x24ed1a){const _0x458a74=a0_0x40f9f0;try{const _0x289a0d=await execAsync(_0x24ed1a+_0x458a74(0xd9)+_0x2b9b70,{'timeout':0x1388});return console['log']('\x20\x20\x20✅\x20'+_0x2b9b70+_0x458a74(0xd0)),!![];}catch(_0x1147eb){console['log'](_0x458a74(0xdd)+_0x2b9b70+_0x458a74(0x106));try{const _0x465c11=await isHomebrewPython(_0x24ed1a),_0x2ddddd=_0x465c11?'':_0x458a74(0xf8),_0x2f462c=(_0x24ed1a+'\x20-m\x20pip\x20install\x20'+_0x2ddddd+'\x20'+_0x2b9b70)['replace'](/\s+/g,'\x20')[_0x458a74(0xe4)]();return await execAsync(_0x2f462c,{'timeout':0xea60}),console[_0x458a74(0x107)](_0x458a74(0xea)+_0x2b9b70+_0x458a74(0xe9)),!![];}catch(_0x226af3){return console['log'](_0x458a74(0x109)+_0x2b9b70+':\x20'+_0x226af3[_0x458a74(0xd4)]),console[_0x458a74(0x107)](_0x458a74(0xf4)+_0x2b9b70),![];}}}async function downloadFile(_0x49e21d,_0x447985){return new Promise((_0x131087,_0x477279)=>{const _0x4fb9d0=a0_0x2b01,_0x1ed955=_0x49e21d[_0x4fb9d0(0xe8)]('https')?a0_0x1b406d:a0_0x519d56;_0x1ed955[_0x4fb9d0(0xf6)](_0x49e21d,_0x2a574a=>{const _0x583367=_0x4fb9d0;if(_0x2a574a['statusCode']===0x12e||_0x2a574a[_0x583367(0xc6)]===0x12d){downloadFile(_0x2a574a[_0x583367(0xf3)]['location'],_0x447985)['then'](_0x131087)[_0x583367(0x105)](_0x477279);return;}if(_0x2a574a[_0x583367(0xc6)]!==0xc8){_0x477279(new Error(_0x583367(0xcf)+_0x2a574a[_0x583367(0xc6)]));return;}const _0x442578=createWriteStream(_0x447985);_0x2a574a['pipe'](_0x442578),_0x442578['on'](_0x583367(0xe1),()=>{const _0x47231a=_0x583367;_0x442578[_0x47231a(0xd2)](),_0x131087();}),_0x442578['on'](_0x583367(0x100),_0xedb219=>{const _0x35b9f6=_0x583367;a0_0x4894c4[_0x35b9f6(0xcc)](_0x447985,()=>{}),_0x477279(_0xedb219);});})['on']('error',_0x477279);});}installScanners()['catch'](_0x3c9ad2=>{const _0x5e4176=a0_0x40f9f0;console[_0x5e4176(0x100)]('❌\x20Installation\x20failed:',_0x3c9ad2[_0x5e4176(0xd4)]),console[_0x5e4176(0x100)]('\x0aYou\x20can\x20manually\x20install\x20scanners:'),console[_0x5e4176(0x100)](_0x5e4176(0xd3)),console[_0x5e4176(0x100)](_0x5e4176(0xc3)),process[_0x5e4176(0xe0)](0x0);});
|
package/scripts/watchdog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
function a0_0x1c22(_0x410e78,_0x131bed){_0x410e78=_0x410e78-0xd4;const _0x515849=a0_0x5158();let _0x1c22a0=_0x515849[_0x410e78];return _0x1c22a0;}const a0_0x366c75=a0_0x1c22;(function(_0x2e05e1,_0x387c48){const _0x1ca94f=a0_0x1c22,_0xba7aca=_0x2e05e1();while(!![]){try{const _0x56a035=-parseInt(_0x1ca94f(0xd6))/0x1+-parseInt(_0x1ca94f(0xd9))/0x2*(parseInt(_0x1ca94f(0xec))/0x3)+parseInt(_0x1ca94f(0xd8))/0x4*(parseInt(_0x1ca94f(0xf4))/0x5)+parseInt(_0x1ca94f(0xe8))/0x6+-parseInt(_0x1ca94f(0xdc))/0x7*(-parseInt(_0x1ca94f(0xfd))/0x8)+parseInt(_0x1ca94f(0xd4))/0x9*(-parseInt(_0x1ca94f(0xe6))/0xa)+parseInt(_0x1ca94f(0xfc))/0xb*(parseInt(_0x1ca94f(0xd5))/0xc);if(_0x56a035===_0x387c48)break;else _0xba7aca['push'](_0xba7aca['shift']());}catch(_0x290d4d){_0xba7aca['push'](_0xba7aca['shift']());}}}(a0_0x5158,0xbd1eb));const {spawn,execSync}=require('child_process'),path=require(a0_0x366c75(0xda)),fs=require('fs'),logFile=path[a0_0x366c75(0xe4)](__dirname,a0_0x366c75(0xf2));function log(_0x11cf66){const _0x3ef3b4=a0_0x366c75,_0xd26f86=new Date()['toISOString'](),_0x96823='['+_0xd26f86+']\x20'+_0x11cf66+'\x0a';console[_0x3ef3b4(0xee)](_0x11cf66);try{fs[_0x3ef3b4(0xe3)](logFile,_0x96823);}catch(_0xd7881b){}}log('[Watchdog]\x20Script\x20loaded');function a0_0x5158(){const _0x2d68ce=['\x20still\x20running\x20after\x20','platform','now','catch','784454BhDsKK','16bVrZov','--command','[Watchdog]\x20Parent\x20process\x20','--pid','5651766fQZQpe','276TFLeTX','837769Cvduii','ms\x20before\x20restart...','4jfnnuj','5278OltxQV','path','exit','432026rsXbCF','unref','message','[Watchdog]\x20Waiting\x20','delay','loxia\x20web','split','appendFileSync','join','ms,\x20proceeding\x20anyway','20EeAxiO','\x20to\x20exit...','4352508mlaGyC','[Watchdog]\x20Started\x20with\x20options:','command','[Watchdog]\x20Error:\x20','1257lSFZoZ','[Watchdog]\x20Executing:\x20','log','\x20has\x20terminated','slice','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','watchdog.log','pid','7425085aAHAyJ','[Watchdog]\x20Watchdog\x20exiting...','kill','[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20'];a0_0x5158=function(){return _0x2d68ce;};return a0_0x5158();}function parseArgs(){const _0x2cc264=a0_0x366c75,_0x2fbac9=process['argv'][_0x2cc264(0xf0)](0x2),_0x366ad6={'delay':0x1388,'command':'loxia\x20web','pid':null};for(let _0x493faf=0x0;_0x493faf<_0x2fbac9['length'];_0x493faf++){switch(_0x2fbac9[_0x493faf]){case'--delay':_0x366ad6[_0x2cc264(0xe0)]=parseInt(_0x2fbac9[++_0x493faf],0xa)||0x1388;break;case _0x2cc264(0xfe):_0x366ad6[_0x2cc264(0xea)]=_0x2fbac9[++_0x493faf]||_0x2cc264(0xe1);break;case _0x2cc264(0x100):_0x366ad6['pid']=parseInt(_0x2fbac9[++_0x493faf],0xa)||null;break;}}return _0x366ad6;}function isProcessRunning(_0x2e7f0e){const _0x428140=a0_0x366c75;try{return process[_0x428140(0xf6)](_0x2e7f0e,0x0),!![];}catch(_0x5eb534){return![];}}async function waitForParentExit(_0x37a9bd,_0x4526f1=0x7530){const _0x4852b6=a0_0x366c75;if(!_0x37a9bd)return;const _0x1bbaa5=Date[_0x4852b6(0xfa)]();while(isProcessRunning(_0x37a9bd)){if(Date[_0x4852b6(0xfa)]()-_0x1bbaa5>_0x4526f1){log(_0x4852b6(0xff)+_0x37a9bd+_0x4852b6(0xf8)+_0x4526f1+_0x4852b6(0xe5));return;}await new Promise(_0x498d43=>setTimeout(_0x498d43,0x1f4));}log(_0x4852b6(0xff)+_0x37a9bd+_0x4852b6(0xef));}async function main(){const _0x429daa=a0_0x366c75,_0x344b4f=parseArgs();log(_0x429daa(0xe9),{'delay':_0x344b4f[_0x429daa(0xe0)],'command':_0x344b4f['command'],'pid':_0x344b4f[_0x429daa(0xf3)]});_0x344b4f[_0x429daa(0xf3)]&&(log(_0x429daa(0xf1)+_0x344b4f[_0x429daa(0xf3)]+_0x429daa(0xe7)),await waitForParentExit(_0x344b4f[_0x429daa(0xf3)]));log(_0x429daa(0xdf)+_0x344b4f[_0x429daa(0xe0)]+_0x429daa(0xd7)),await new Promise(_0x1267ef=>setTimeout(_0x1267ef,_0x344b4f[_0x429daa(0xe0)]));const _0x28e579=_0x344b4f[_0x429daa(0xea)][_0x429daa(0xe2)]('\x20'),_0x256d6d=_0x28e579[0x0],_0x331e2a=_0x28e579[_0x429daa(0xf0)](0x1);log(_0x429daa(0xed)+_0x256d6d+'\x20'+_0x331e2a[_0x429daa(0xe4)]('\x20'));const _0x515266=process[_0x429daa(0xf9)]==='win32',_0x259974=spawn(_0x256d6d,_0x331e2a,{'detached':!![],'stdio':'ignore','shell':!![],'windowsHide':![]});_0x259974[_0x429daa(0xdd)](),log(_0x429daa(0xf7)+_0x259974[_0x429daa(0xf3)]),log(_0x429daa(0xf5)),setTimeout(()=>process[_0x429daa(0xdb)](0x0),0x3e8);}main()[a0_0x366c75(0xfb)](_0x4d1859=>{const _0x9e59c=a0_0x366c75;log(_0x9e59c(0xeb)+_0x4d1859[_0x9e59c(0xde)]),process[_0x9e59c(0xdb)](0x1);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x18183f=a0_0x103c;(function(_0x1ca7c9,_0x480ac7){const _0x4d922c=a0_0x103c,_0xf8bd51=_0x1ca7c9();while(!![]){try{const _0xe2b89d=parseInt(_0x4d922c(0x138))/0x1+parseInt(_0x4d922c(0x123))/0x2*(parseInt(_0x4d922c(0x112))/0x3)+parseInt(_0x4d922c(0x120))/0x4*(-parseInt(_0x4d922c(0x12f))/0x5)+-parseInt(_0x4d922c(0x137))/0x6+-parseInt(_0x4d922c(0x10e))/0x7+-parseInt(_0x4d922c(0x12a))/0x8*(parseInt(_0x4d922c(0x12e))/0x9)+parseInt(_0x4d922c(0x109))/0xa;if(_0xe2b89d===_0x480ac7)break;else _0xf8bd51['push'](_0xf8bd51['shift']());}catch(_0x14fb75){_0xf8bd51['push'](_0xf8bd51['shift']());}}}(a0_0x4ce4,0xd926a));function a0_0x103c(_0x3f536f,_0x383b50){_0x3f536f=_0x3f536f-0x101;const _0x4ce4a0=a0_0x4ce4();let _0x103cf1=_0x4ce4a0[_0x3f536f];if(a0_0x103c['dXiyqH']===undefined){var _0x23c54f=function(_0x1a94c0){const _0x17cfb2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x302c2b='',_0x111efa='';for(let _0x44c717=0x0,_0x419f86,_0x12810d,_0x51b477=0x0;_0x12810d=_0x1a94c0['charAt'](_0x51b477++);~_0x12810d&&(_0x419f86=_0x44c717%0x4?_0x419f86*0x40+_0x12810d:_0x12810d,_0x44c717++%0x4)?_0x302c2b+=String['fromCharCode'](0xff&_0x419f86>>(-0x2*_0x44c717&0x6)):0x0){_0x12810d=_0x17cfb2['indexOf'](_0x12810d);}for(let _0x436e8e=0x0,_0x3bbe0e=_0x302c2b['length'];_0x436e8e<_0x3bbe0e;_0x436e8e++){_0x111efa+='%'+('00'+_0x302c2b['charCodeAt'](_0x436e8e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x111efa);};a0_0x103c['Fhzcbn']=_0x23c54f,a0_0x103c['ajUmvs']={},a0_0x103c['dXiyqH']=!![];}const _0x34a9ec=_0x4ce4a0[0x0],_0x7fc722=_0x3f536f+_0x34a9ec,_0x5ec253=a0_0x103c['ajUmvs'][_0x7fc722];return!_0x5ec253?(_0x103cf1=a0_0x103c['Fhzcbn'](_0x103cf1),a0_0x103c['ajUmvs'][_0x7fc722]=_0x103cf1):_0x103cf1=_0x5ec253,_0x103cf1;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x302c2b=null){const _0x3ae2ab=a0_0x103c;this[_0x3ae2ab(0x13e)]=_0x302c2b,this[_0x3ae2ab(0x11f)]=null,this[_0x3ae2ab(0x101)]=null,this['postcssScss']=null,this['postcssLess']=null;}async['analyze'](_0x111efa,_0x44c717,_0x419f86={}){const _0x4aa808=a0_0x103c;try{const _0x12810d=[],_0x51b477=this[_0x4aa808(0x115)](_0x111efa),_0x436e8e=await this['checkSyntax'](_0x111efa,_0x44c717,_0x51b477);_0x12810d['push'](..._0x436e8e);if(_0x436e8e['length']===0x0){const _0x3bbe0e=await this[_0x4aa808(0x107)](_0x111efa,_0x44c717,_0x51b477);_0x12810d['push'](..._0x3bbe0e);}return this[_0x4aa808(0x13e)]?.[_0x4aa808(0x104)]('CSS\x20analysis\x20completed',{'file':_0x111efa,'language':_0x51b477,'totalDiagnostics':_0x12810d[_0x4aa808(0x114)],'errors':_0x12810d['filter'](_0x43e505=>_0x43e505['severity']===STATIC_ANALYSIS[_0x4aa808(0x11d)][_0x4aa808(0x13a)])['length'],'warnings':_0x12810d['filter'](_0x4ea4fd=>_0x4ea4fd['severity']===STATIC_ANALYSIS['SEVERITY']['WARNING'])[_0x4aa808(0x114)]}),_0x12810d;}catch(_0x163d7c){return this['logger']?.[_0x4aa808(0x10c)]('CSS\x20analysis\x20failed',{'file':_0x111efa,'error':_0x163d7c['message']}),[];}}async['checkSyntax'](_0x5e60b9,_0x188255,_0xabe9){const _0x4dbcd8=a0_0x103c,_0x31e496=[];try{if(!this[_0x4dbcd8(0x101)]){const _0x330d6a=await import(_0x4dbcd8(0x101));this[_0x4dbcd8(0x101)]=_0x330d6a[_0x4dbcd8(0x10f)];}let _0x3fd849=null;if(_0xabe9===_0x4dbcd8(0x117)){if(!this[_0x4dbcd8(0x126)]){const _0x213d0c=await import('postcss-scss');this['postcssScss']=_0x213d0c[_0x4dbcd8(0x10f)];}_0x3fd849=this['postcssScss'];}else{if(_0xabe9==='less'){if(!this[_0x4dbcd8(0x124)]){const _0x65bcde=await import('postcss-less');this['postcssLess']=_0x65bcde[_0x4dbcd8(0x10f)];}_0x3fd849=this[_0x4dbcd8(0x124)];}}const _0x403396=this['postcss']()['process'](_0x188255,{'from':_0x5e60b9,'syntax':_0x3fd849}),_0x1a062c=_0x403396['root'];this['logger']?.[_0x4dbcd8(0x104)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x5e60b9});}catch(_0x5729e3){const _0x1f2bbe=this[_0x4dbcd8(0x139)](_0x5729e3,_0x5e60b9);_0x1f2bbe&&_0x31e496['push'](_0x1f2bbe);}return _0x31e496;}async['lintStyles'](_0x237c47,_0x2346ab,_0x2e7709){const _0x2f7550=a0_0x103c,_0x38a155=[];try{if(!this[_0x2f7550(0x11f)]){const _0x6aa4b3=await import('stylelint');this['stylelint']=_0x6aa4b3['default'];}const _0x3ad1bc={'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':[_0x2f7550(0x125),'ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x2e7709===_0x2f7550(0x117)?[!![],{'ignoreAtRules':['mixin',_0x2f7550(0x110),_0x2f7550(0x134),'if','else',_0x2f7550(0x103),'each','while','function',_0x2f7550(0x10b),'content','use','forward']}]:_0x2e7709==='less'?[!![],{'ignoreAtRules':['plugin']}]:!![],'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':_0x2f7550(0x102),'selector-type-case':_0x2f7550(0x108)},'customSyntax':_0x2e7709==='scss'?_0x2f7550(0x116):_0x2e7709==='less'?'postcss-less':undefined},_0x2409eb=await this[_0x2f7550(0x11f)]['lint']({'code':_0x2346ab,'codeFilename':_0x237c47,'config':_0x3ad1bc});if(_0x2409eb['results']&&_0x2409eb[_0x2f7550(0x11e)]['length']>0x0){const _0x4c4536=_0x2409eb[_0x2f7550(0x11e)][0x0];if(_0x4c4536[_0x2f7550(0x13b)])for(const _0x37cf59 of _0x4c4536[_0x2f7550(0x13b)]){_0x38a155[_0x2f7550(0x111)]({'file':_0x237c47,'line':_0x37cf59['line']||0x1,'column':_0x37cf59['column']||0x1,'severity':_0x37cf59[_0x2f7550(0x11c)]===_0x2f7550(0x10c)?STATIC_ANALYSIS[_0x2f7550(0x11d)][_0x2f7550(0x13a)]:STATIC_ANALYSIS['SEVERITY'][_0x2f7550(0x121)],'rule':_0x37cf59[_0x2f7550(0x13d)]||_0x2f7550(0x12c),'message':_0x37cf59[_0x2f7550(0x12b)],'category':this[_0x2f7550(0x118)](_0x37cf59[_0x2f7550(0x13d)]),'fixable':![],'source':_0x2f7550(0x11f)});}}}catch(_0x3886b0){this[_0x2f7550(0x13e)]?.['warn'](_0x2f7550(0x122),{'file':_0x237c47,'error':_0x3886b0['message']});}return _0x38a155;}['formatPostCSSError'](_0x5f56d4,_0x127b15){const _0x22be42=a0_0x103c;return{'file':_0x127b15,'line':_0x5f56d4['line']||0x1,'column':_0x5f56d4[_0x22be42(0x131)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x22be42(0x13a)],'rule':_0x5f56d4[_0x22be42(0x127)]||'CssSyntaxError','message':_0x5f56d4['reason']||_0x5f56d4['message'],'category':STATIC_ANALYSIS[_0x22be42(0x13c)][_0x22be42(0x135)],'fixable':![],'source':'postcss','code':_0x5f56d4['source']||undefined};}['categorizeStylelintRule'](_0x4dd79d){const _0x490f35=a0_0x103c;if(!_0x4dd79d)return STATIC_ANALYSIS[_0x490f35(0x13c)]['STYLE'];const _0x4d3dc3=_0x4dd79d[_0x490f35(0x128)]();if(_0x4d3dc3[_0x490f35(0x106)]('no-invalid')||_0x4d3dc3[_0x490f35(0x106)]('no-unknown')||_0x4d3dc3['includes'](_0x490f35(0x132))||_0x4d3dc3['includes'](_0x490f35(0x11a)))return STATIC_ANALYSIS[_0x490f35(0x13c)]['SYNTAX'];if(_0x4d3dc3['includes'](_0x490f35(0x11b))||_0x4d3dc3['includes']('optimize'))return STATIC_ANALYSIS['CATEGORY'][_0x490f35(0x119)];if(_0x4d3dc3['includes']('best-practice')||_0x4d3dc3[_0x490f35(0x106)](_0x490f35(0x10a)))return STATIC_ANALYSIS[_0x490f35(0x13c)][_0x490f35(0x130)];return STATIC_ANALYSIS['CATEGORY'][_0x490f35(0x129)];}[a0_0x18183f(0x115)](_0xb7fd69){const _0x7eee20=a0_0x18183f,_0x2820a6=_0xb7fd69[_0x7eee20(0x128)]();if(_0x2820a6[_0x7eee20(0x113)]('.scss')||_0x2820a6[_0x7eee20(0x113)]('.sass'))return'scss';if(_0x2820a6['endsWith'](_0x7eee20(0x10d)))return _0x7eee20(0x105);return _0x7eee20(0x133);}[a0_0x18183f(0x12d)](){const _0x2d9c86=a0_0x18183f;return[_0x2d9c86(0x136),'.scss','.sass','.less'];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;function a0_0x4ce4(){const _0x15c8ba=['Dw5RBM93BG','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','ntaYntG3ouflAeDjEq','mtm1otvUA3PUugO','qKvtvf9quKfdveLdrq','y29SDw1U','BM8Tzw1WDhK','y3nZ','zxH0zw5K','u1Lovefy','lMnZCW','oduXotGZoeTWAfDdCG','ndmXmZy4r3v3r3D6','zM9YBwf0ug9ZDentu0vYCM9Y','rvjst1i','D2fYBMLUz3m','q0furuDpuLK','CNvSzq','Bg9Nz2vY','Cg9ZDgnZCW','zg91yMXL','zM9Y','zgvIDwC','BgvZCW','Aw5JBhvKzxm','BgLUDfn0EwXLCW','Bg93zxi','mJqZnZe4nJbmBwPitxa','CMvJB21Tzw5Kzwq','CMv0DxjU','zxjYB3i','lMXLC3m','nda0mtaZBu93v0jV','zgvMyxvSDa','Aw5JBhvKzq','ChvZAa','mZbtAufbDeu','zw5KC1DPDgG','BgvUz3rO','zgv0zwn0tgfUz3vHz2u','Cg9ZDgnZCY1Zy3nZ','C2nZCW','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','uevsrK9stufoq0u','C3LUDgf4','CgvYzM9YBwfUy2u','C2v2zxjPDhK','u0vwrvjjvfK','CMvZDwX0CW','C3r5BgvSAw50','mJG0CKfurKXZ','v0fstKLorW','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','mJCZmZG4wejvrvHI','Cg9ZDgnZC0XLC3m','l15JDxn0B20TlW','Cg9ZDgnZC1nJC3m','BMfTzq','Dg9mB3DLCKnHC2u','u1rzteu','mJrzBxnVt2S','Dgv4Da'];a0_0x4ce4=function(){return _0x15c8ba;};return a0_0x4ce4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x139e9d=a0_0x4baa;(function(_0x305a13,_0x8c57e3){const _0x268503=a0_0x4baa,_0x14956d=_0x305a13();while(!![]){try{const _0x46ce2b=parseInt(_0x268503(0x1fb))/0x1*(parseInt(_0x268503(0x1e2))/0x2)+-parseInt(_0x268503(0x227))/0x3*(-parseInt(_0x268503(0x204))/0x4)+parseInt(_0x268503(0x1ea))/0x5*(-parseInt(_0x268503(0x21a))/0x6)+-parseInt(_0x268503(0x205))/0x7*(-parseInt(_0x268503(0x1eb))/0x8)+-parseInt(_0x268503(0x1df))/0x9+-parseInt(_0x268503(0x21c))/0xa+-parseInt(_0x268503(0x1ec))/0xb*(-parseInt(_0x268503(0x1db))/0xc);if(_0x46ce2b===_0x8c57e3)break;else _0x14956d['push'](_0x14956d['shift']());}catch(_0x50295e){_0x14956d['push'](_0x14956d['shift']());}}}(a0_0x2dc2,0x5e94b));import{exec}from'child_process';import{promisify}from'util';import a0_0xae44fc from'path';function a0_0x2dc2(){const _0x1cfe04=['CgfYyw1Z','CgfJA2fNzs5QC29U','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','DMfSAwrHDgvzqu1m','A3vIzxjUzxrLCW','zg9JA2vYlwnVBxbVC2uUEwfTBa','Aw5JBhvKzxm','CMvTzwrPyxrPB24','C2vJCMv0','DMfSAwrHDgvqywnRywDLsNnVBG','C3rKB3v0','C3LUDgf4','BM9YBwfSAxPLuMvZDwX0CW','BwLZC2LUz1bYB3bLCNr5','mZG2mdm1zfriA0fq','ChjPDMf0zsbRzxK','Bwf0y2G','DMfSAwrHDgLVBG','DhnJB25MAwCTDMfSAwrHDg9Y','rvjst1i','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','sw52ywXPzcbku09ooIa','DMvYC2LVBG','mtaZntzIvgryAMe','mtC1mJGWDuTbuuTL','z2L0AhvIlwfJDgLVBNm','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','BwfWwwfTBgXPBNrtzxzLCML0Eq','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','DMfSAwrHDgvfBNzgAwXL','zw52lxzHBgLKyxrVCG','qvbjigTLEq','y2HLy2TFAwq','Bg9Nz2vY','B2jQzwn0','y2HLy2TVDG','CgfYC2viywrVBgLUDfjLC3vSDhm','DgvYCMfMB3jT','y29TCgLSzxjpChrPB25Z','zgv0zwn0rMLSzvr5Cgu','AxnbCNjHEq','Dg9mB3DLCKnHC2u','z3vPzgvSAw5L','y29TCgLSzq','ANnVBI1Zy2HLBwe','mJeXotmZmMnMAvjerG','Dw5RBM93BG','ndCYota2mhDvqLLSCq','zgvIDwC','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','lMvUDG','CgfYC2vdAgvJA292uMvZDwX0CW','yxzHAwXHyMXLu2nHBM5LCNm','yMvZDc1WCMfJDgLJzq','C3rYAwn0lw1Vzgu','y2HLy2TVDIbKzxrLy3rLza','zw52','DMfSAwrHDgveB2nRzxjMAwXL','mteXDhrACgnK','Bgv2zwW','lNLHBwW','wufntcbMAwXLihzHBgLKyxrPB24','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','q1jjveLdquW','Dg9Rzw4','BwvZC2fNzq','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','zg9JA2vYzMLSzq','EwfTBgXPBNqGzgv0zwn0zwq','CMvZDwX0CW','v0fstKLorW','C3bSAxq','Aw5ZDgfUy2vqyxrO','yMfZzw5HBwu','ANnVBI1WyxjZzq','zMLSDgvY','CgfYC2vzyw1SBgLUDfjLC3vSDhm','BwfW','BgvUz3rO','BgLUzq','EwfTBgXPBNq','ywP2ig5VDcbHDMfPBgfIBgu','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','DMfSAwrHDgvuC0nVBMzPzW','DhnJB25MAwCUANnVBG','zxjYB3i','CgfYC2u','AgfKB2XPBNq','CMvHzezPBgu','CgfZC3DVCMq','ChvZAa','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','zg9JA2vYlwnVBxbVC2u','y2HHBMDLBwu','lNrM','C3rYAw5N','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','AgfYzgnVzgvKlxnLy3jLDa','EwfTBgXPBNqGls12zxjZAw9U','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','ANnVBLnJAgvTyq','Ew91CI1RzxKTAgvYzq','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','mta3mtzJuLv2y0O','CMvMzxjLBMnLCW','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','CgLWigLUC3rHBgWGy2HLy2TVDG','mZa5ota4n29rrefNAG','EwfTBa','zMLSzv9SAw5Lx3jHBMDL','mM5TqKLcsG','y2HLy2TFBMfTzq','C3rHCNrZv2L0Aa','u0vwrvjjvfK','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','lMPZB24','AgLNAa','DMfSAwrHDgvxAxrOq2HLy2TVDG','mtbuChn3EKy','mta0Eff0Dw13','mtm1otzVwgX4zNu'];a0_0x2dc2=function(){return _0x1cfe04;};return a0_0x2dc2();}import a0_0x1d2b10 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x18c9f7=null){const _0x5aff01=a0_0x4baa;this[_0x5aff01(0x20e)]=_0x18c9f7,this[_0x5aff01(0x221)]=null,this['scannerCache']=new Map();}async[a0_0x139e9d(0x1dd)](){const _0xf085ca=a0_0x139e9d;if(this['availableScanners']!==null)return this['availableScanners'];const _0x1e9ce2={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x1e9ce2['checkov']=!![],this['logger']?.[_0xf085ca(0x21d)](_0xf085ca(0x224));}catch(_0x15586c){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x15586c[_0xf085ca(0x1b5)]});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x1e9ce2['hadolint']=!![],this['logger']?.[_0xf085ca(0x21d)]('hadolint\x20detected');}catch(_0x55a341){this[_0xf085ca(0x20e)]?.['debug']('hadolint\x20not\x20available',{'error':_0x55a341[_0xf085ca(0x1b5)]});}try{await execAsync(_0xf085ca(0x1d6),{'timeout':0x1388}),_0x1e9ce2[_0xf085ca(0x1c4)]=!![],this[_0xf085ca(0x20e)]?.[_0xf085ca(0x21d)](_0xf085ca(0x1b8));}catch(_0x1fdf0b){this['logger']?.[_0xf085ca(0x21d)]('yamllint\x20not\x20available',{'error':_0x1fdf0b[_0xf085ca(0x1b5)]});}try{await import('ajv'),_0x1e9ce2[_0xf085ca(0x1d8)]=!![],this['logger']?.['debug'](_0xf085ca(0x1ef));}catch(_0x559fdc){this[_0xf085ca(0x20e)]?.['debug'](_0xf085ca(0x1c5),{'error':_0x559fdc['message']});}return this[_0xf085ca(0x221)]=_0x1e9ce2,_0x1e9ce2;}async['validate'](_0x454b2e,_0xfac408={}){const _0x2b2bbb=a0_0x139e9d,_0x1041b2=[],_0x5c491c=await this[_0x2b2bbb(0x1dd)](),_0x3da523=this['detectFileType'](_0x454b2e);this['logger']?.['debug'](_0x2b2bbb(0x22b),{'filePath':_0x454b2e,'fileType':_0x3da523});switch(_0x3da523){case'dockerfile':if(_0x5c491c[_0x2b2bbb(0x1cb)]){const _0x3e25b9=await this['validateDockerfile'](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x3e25b9);}if(_0x5c491c[_0x2b2bbb(0x210)]){const _0x326d9b=await this[_0x2b2bbb(0x1e9)](_0x454b2e,_0x2b2bbb(0x1b7),_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x326d9b);}break;case'docker-compose':if(_0x5c491c['yamllint']){const _0x36e185=await this[_0x2b2bbb(0x1f0)](_0x454b2e,_0xfac408);_0x1041b2['push'](..._0x36e185);}if(_0x5c491c['checkov']){const _0x34331c=await this['validateWithCheckov'](_0x454b2e,'docker_compose',_0xfac408);_0x1041b2['push'](..._0x34331c);}break;case _0x2b2bbb(0x1f1):if(_0x5c491c['yamllint']){const _0x158a3a=await this['validateYAML'](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x158a3a);}if(_0x5c491c[_0x2b2bbb(0x210)]){const _0x582204=await this['validateWithCheckov'](_0x454b2e,'kubernetes',_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x582204);}break;case'terraform':if(_0x5c491c[_0x2b2bbb(0x210)]){const _0x299925=await this[_0x2b2bbb(0x1e9)](_0x454b2e,_0x2b2bbb(0x212),_0xfac408);_0x1041b2['push'](..._0x299925);}break;case _0x2b2bbb(0x1ee):if(_0x5c491c['jsonSchema']){const _0x393332=await this[_0x2b2bbb(0x1f6)](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x393332);}break;case _0x2b2bbb(0x1c8):if(_0x5c491c[_0x2b2bbb(0x1d8)]){const _0x38360c=await this[_0x2b2bbb(0x1c7)](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x38360c);}break;case _0x2b2bbb(0x206):if(_0x5c491c[_0x2b2bbb(0x1c4)]){const _0x2c724d=await this['validateYAML'](_0x454b2e,_0xfac408);_0x1041b2['push'](..._0x2c724d);}break;case _0x2b2bbb(0x225):const _0x21fdbd=await this['validateEnvFile'](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x21fdbd);break;case _0x2b2bbb(0x1e0):if(_0x5c491c[_0x2b2bbb(0x1c4)]){const _0x80ed67=await this[_0x2b2bbb(0x1f0)](_0x454b2e,_0xfac408);_0x1041b2[_0x2b2bbb(0x1ce)](..._0x80ed67);}break;default:this[_0x2b2bbb(0x20e)]?.['warn'](_0x2b2bbb(0x1d4),{'filePath':_0x454b2e,'fileType':_0x3da523});return[];}return this[_0x2b2bbb(0x1f9)](_0x1041b2);}async[a0_0x139e9d(0x226)](_0x30ce50,_0x2814f2={}){const _0x3b2973=a0_0x139e9d;try{const _0x363268=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x30ce50+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x20da63=JSON['parse'](_0x363268[_0x3b2973(0x1f7)]);return this['parseHadolintResults'](_0x20da63,_0x30ce50);}catch(_0x6cbf37){if(_0x6cbf37[_0x3b2973(0x1f7)])try{const _0x234f8c=JSON[_0x3b2973(0x1ca)](_0x6cbf37['stdout']);return this[_0x3b2973(0x211)](_0x234f8c,_0x30ce50);}catch(_0xab3344){this[_0x3b2973(0x20e)]?.[_0x3b2973(0x1c9)]('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0xab3344[_0x3b2973(0x1b5)]});}return this['logger']?.[_0x3b2973(0x1c9)]('hadolint\x20validation\x20failed',{'error':_0x6cbf37[_0x3b2973(0x1b5)]}),[];}}[a0_0x139e9d(0x211)](_0x4b52d8,_0xdab310){const _0x401044=a0_0x139e9d,_0x266b37=[];if(Array[_0x401044(0x215)](_0x4b52d8))for(const _0x288a84 of _0x4b52d8){_0x266b37['push']({'file':_0xdab310,'line':_0x288a84[_0x401044(0x1c3)]||0x1,'column':_0x288a84['column']||0x1,'severity':this['mapHadolintSeverity'](_0x288a84[_0x401044(0x228)]),'rule':_0x288a84['code'],'message':_0x288a84['message'],'category':_0x401044(0x1b7),'validator':_0x401044(0x1cb)});}return _0x266b37;}async[a0_0x139e9d(0x1f0)](_0x48e913,_0x3a2c31={}){const _0x47861f=a0_0x139e9d;try{const _0xb0ad23=await execAsync(_0x47861f(0x1c6)+_0x48e913+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x47861f(0x1c0)](_0xb0ad23[_0x47861f(0x1f7)],_0x48e913);}catch(_0x4a458b){if(_0x4a458b[_0x47861f(0x1f7)])return this['parseYamllintResults'](_0x4a458b[_0x47861f(0x1f7)],_0x48e913);return this['logger']?.['error']('yamllint\x20validation\x20failed',{'error':_0x4a458b['message']}),[];}}[a0_0x139e9d(0x1c0)](_0xfae5d5,_0x519ff9){const _0x5d8212=a0_0x139e9d,_0x3cbb2c=[],_0x3bd788=_0xfae5d5[_0x5d8212(0x1bb)]('\x0a')[_0x5d8212(0x1bf)](_0x18039f=>_0x18039f['trim']());for(const _0x340fe5 of _0x3bd788){const _0x2cac3e=_0x340fe5[_0x5d8212(0x1fd)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x2cac3e){const [,_0x40d599,_0x1bc823,_0xfc9899,_0x54bb07,_0x2a0e80,_0x476dc0]=_0x2cac3e;_0x3cbb2c['push']({'file':_0x519ff9,'line':parseInt(_0x1bc823,0xa),'column':parseInt(_0xfc9899,0xa),'severity':this[_0x5d8212(0x208)](_0x54bb07),'rule':_0x476dc0,'message':_0x2a0e80,'category':_0x5d8212(0x1e0),'validator':'yamllint'});}}return _0x3cbb2c;}async['validateWithCheckov'](_0x16711f,_0x50e42b,_0x44fefc={}){const _0x37c126=a0_0x139e9d;try{const _0x23f9ef=await execAsync('checkov\x20-f\x20\x22'+_0x16711f+'\x22\x20--framework\x20'+_0x50e42b+_0x37c126(0x209),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x477efb=JSON[_0x37c126(0x1ca)](_0x23f9ef[_0x37c126(0x1f7)]);return this['parseCheckovResults'](_0x477efb,_0x16711f);}catch(_0x29927b){if(_0x29927b[_0x37c126(0x1f7)])try{const _0x47baa5=JSON['parse'](_0x29927b['stdout']);return this['parseCheckovResults'](_0x47baa5,_0x16711f);}catch(_0x3db50e){this['logger']?.[_0x37c126(0x1c9)](_0x37c126(0x21e),{'error':_0x3db50e['message']});}return this[_0x37c126(0x20e)]?.[_0x37c126(0x1c9)](_0x37c126(0x207),{'error':_0x29927b['message']}),[];}}[a0_0x139e9d(0x220)](_0x53e81f,_0x9de270){const _0x5406eb=a0_0x139e9d,_0x43779=[];if(_0x53e81f[_0x5406eb(0x1b9)]&&_0x53e81f[_0x5406eb(0x1b9)]['failed_checks'])for(const _0x1dd2fb of _0x53e81f['results']['failed_checks']){_0x43779['push']({'file':_0x9de270,'line':_0x1dd2fb[_0x5406eb(0x1e1)]?_0x1dd2fb[_0x5406eb(0x1e1)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x1dd2fb['check_class']),'rule':_0x1dd2fb[_0x5406eb(0x20d)],'message':_0x1dd2fb[_0x5406eb(0x1e3)]||_0x1dd2fb[_0x5406eb(0x20d)],'category':'security','validator':_0x5406eb(0x210),'remediation':_0x1dd2fb[_0x5406eb(0x217)],'cwe':_0x1dd2fb['cwe'],'references':_0x1dd2fb[_0x5406eb(0x217)]?[_0x1dd2fb['guideline']]:[]});}return _0x43779;}async[a0_0x139e9d(0x1f6)](_0x420f45,_0x490aa7={}){const _0x5af4b7=a0_0x139e9d;try{const _0x272e84=(await import('ajv'))['default'],_0x553cdb=(await import('ajv-formats'))['default'],_0x8802c6=await a0_0x1d2b10['readFile'](_0x420f45,'utf-8'),_0x26d410=JSON['parse'](_0x8802c6),_0x24707=new _0x272e84({'allErrors':!![],'strict':![]});_0x553cdb(_0x24707);const _0x1daad4={'type':'object','required':['name',_0x5af4b7(0x203)],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x5af4b7(0x1d3)},'description':{'type':_0x5af4b7(0x1d3)},'main':{'type':'string'},'type':{'type':_0x5af4b7(0x1d3),'enum':['module','commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x5af4b7(0x20f)},'devDependencies':{'type':_0x5af4b7(0x20f)}},'additionalProperties':!![]},_0x1acf6f=_0x24707[_0x5af4b7(0x218)](_0x1daad4),_0x52892f=_0x1acf6f(_0x26d410);if(!_0x52892f&&_0x1acf6f['errors'])return _0x1acf6f['errors'][_0x5af4b7(0x1c1)](_0x3d88be=>({'file':_0x420f45,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x5af4b7(0x200)],'rule':_0x5af4b7(0x219),'message':_0x3d88be[_0x5af4b7(0x1bc)]?_0x3d88be[_0x5af4b7(0x1bc)]+'\x20'+_0x3d88be[_0x5af4b7(0x1b5)]:_0x5af4b7(0x1cf)+_0x3d88be[_0x5af4b7(0x1ed)][_0x5af4b7(0x1fa)]+'\x27','category':_0x5af4b7(0x1fe),'validator':_0x5af4b7(0x219)}));return[];}catch(_0x50c482){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x50c482[_0x5af4b7(0x1b5)]}),[{'file':_0x420f45,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x5af4b7(0x1be),'message':_0x5af4b7(0x202)+_0x50c482['message'],'category':_0x5af4b7(0x1f8),'validator':_0x5af4b7(0x1be)}];}}async['validateTsConfig'](_0x38fa11,_0x4fb938={}){const _0x17970f=a0_0x139e9d;try{const _0x571232=await a0_0x1d2b10[_0x17970f(0x1cc)](_0x38fa11,'utf-8'),_0x1a26be=JSON['parse'](_0x571232),_0x7bb284=[];if(_0x1a26be[_0x17970f(0x213)]){const _0x19173f=_0x1a26be['compilerOptions'];!_0x19173f['strict']&&_0x7bb284['push']({'file':_0x38fa11,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x17970f(0x1ba)],'rule':_0x17970f(0x223),'message':_0x17970f(0x1da),'category':'best-practice','validator':_0x17970f(0x1ff)}),_0x19173f['noImplicitAny']===![]&&_0x7bb284[_0x17970f(0x1ce)]({'file':_0x38fa11,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x17970f(0x1ba)],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':_0x17970f(0x222),'validator':_0x17970f(0x1ff)});}return _0x7bb284;}catch(_0x5cd53b){return this['logger']?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0x5cd53b[_0x17970f(0x1b5)]}),[{'file':_0x38fa11,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x17970f(0x200)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x5cd53b[_0x17970f(0x1b5)],'category':_0x17970f(0x1f8),'validator':_0x17970f(0x1be)}];}}async[a0_0x139e9d(0x20a)](_0x5c4926,_0x54506a={}){const _0x60e026=a0_0x139e9d;try{const _0x537dc5=await a0_0x1d2b10[_0x60e026(0x1cc)](_0x5c4926,'utf-8'),_0x4f2434=[],_0x405b95=_0x537dc5[_0x60e026(0x1bb)]('\x0a'),_0x4e283c=[{'pattern':/password|passwd|pwd/i,'name':_0x60e026(0x1cd)},{'pattern':/api[_-]?key/i,'name':_0x60e026(0x20c)},{'pattern':/secret/i,'name':_0x60e026(0x1f5)},{'pattern':/token/i,'name':_0x60e026(0x1b4)},{'pattern':/private[_-]?key/i,'name':_0x60e026(0x1fc)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x405b95['forEach']((_0x2eb21d,_0x470e7a)=>{const _0x2af2e3=_0x60e026,_0x156b4b=_0x2eb21d['trim']();if(!_0x156b4b||_0x156b4b['startsWith']('#'))return;if(_0x156b4b[_0x2af2e3(0x1f3)]('=')){const [_0x587897,_0x1ff446]=_0x156b4b[_0x2af2e3(0x1bb)]('='),_0xfe4490=_0x587897['toLowerCase'](),_0x2eeba5=_0x1ff446?.['trim']()||'',_0x353949=_0x2eeba5&&_0x2eeba5!==''&&!_0x2eeba5[_0x2af2e3(0x1e4)]('$')&&_0x2eeba5!==_0x2af2e3(0x1d9)&&_0x2eeba5!==_0x2af2e3(0x1d1)&&_0x2eeba5[_0x2af2e3(0x1c2)]>0x5;if(_0x353949)for(const {pattern:_0x32a30b,name:_0x1e0d41}of _0x4e283c){if(_0x32a30b['test'](_0xfe4490)){_0x4f2434[_0x2af2e3(0x1ce)]({'file':_0x5c4926,'line':_0x470e7a+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2af2e3(0x1e5)][_0x2af2e3(0x22c)],'rule':_0x2af2e3(0x1d5),'message':'Potential\x20hardcoded\x20'+_0x1e0d41+'\x20detected\x20in\x20.env\x20file','category':'security','validator':_0x2af2e3(0x20b),'remediation':_0x2af2e3(0x201)});break;}}}}),_0x4f2434;}catch(_0x3e5cab){return this[_0x60e026(0x20e)]?.[_0x60e026(0x1c9)](_0x60e026(0x1e6),{'error':_0x3e5cab[_0x60e026(0x1b5)]}),[];}}[a0_0x139e9d(0x214)](_0x5211fb){const _0x393e46=a0_0x139e9d,_0x2a4e66=a0_0xae44fc[_0x393e46(0x1bd)](_0x5211fb)['toLowerCase'](),_0x467ee5=a0_0xae44fc['dirname'](_0x5211fb);if(_0x2a4e66==='dockerfile')return _0x393e46(0x1b7);if(_0x2a4e66==='docker-compose.yml'||_0x2a4e66===_0x393e46(0x1f2))return _0x393e46(0x1d0);if(_0x2a4e66===_0x393e46(0x1ee))return _0x393e46(0x1ee);if(_0x2a4e66===_0x393e46(0x1c8))return'tsconfig.json';if(_0x2a4e66===_0x393e46(0x21f)||_0x2a4e66['endsWith']('.env'))return'env';if(_0x467ee5[_0x393e46(0x1f3)]('.github/workflows'))return'github-actions';if(_0x467ee5['includes'](_0x393e46(0x1f1))||_0x467ee5[_0x393e46(0x1f3)]('k8s'))return _0x393e46(0x1f1);const _0x876fa5=a0_0xae44fc['extname'](_0x5211fb)[_0x393e46(0x216)]();if(_0x876fa5===_0x393e46(0x1d2)||_0x876fa5==='.tfvars')return _0x393e46(0x212);if(_0x876fa5==='.yml'||_0x876fa5===_0x393e46(0x229))return'yaml';if(_0x876fa5===_0x393e46(0x1e7))return'json';return _0x393e46(0x21b);}['normalizeResults'](_0x12e684){const _0x1855cb=a0_0x139e9d;return _0x12e684['map'](_0x43b02d=>({'file':_0x43b02d['file'],'line':_0x43b02d['line']||0x1,'column':_0x43b02d['column']||0x1,'severity':_0x43b02d['severity']||STATIC_ANALYSIS[_0x1855cb(0x1e5)]['WARNING'],'rule':_0x43b02d['rule']||'unknown','message':_0x43b02d['message']||'Validation\x20issue\x20detected','category':_0x43b02d['category']||'validation','validator':_0x43b02d['validator'],'cwe':_0x43b02d['cwe']||null,'remediation':_0x43b02d[_0x1855cb(0x1f4)]||null,'references':_0x43b02d[_0x1855cb(0x1dc)]||[]}));}['mapHadolintSeverity'](_0x3025f7){const _0x21eb5b=a0_0x139e9d,_0x5e94fa={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS[_0x21eb5b(0x1e5)]['INFO']};return _0x5e94fa[_0x3025f7?.[_0x21eb5b(0x216)]()]||STATIC_ANALYSIS['SEVERITY'][_0x21eb5b(0x1ba)];}['mapYamllintSeverity'](_0x1cc340){const _0x148f74=a0_0x139e9d,_0x503f3f={'error':STATIC_ANALYSIS[_0x148f74(0x1e5)]['ERROR'],'warning':STATIC_ANALYSIS[_0x148f74(0x1e5)][_0x148f74(0x1ba)]};return _0x503f3f[_0x1cc340?.[_0x148f74(0x216)]()]||STATIC_ANALYSIS[_0x148f74(0x1e5)][_0x148f74(0x1ba)];}['mapCheckovSeverity'](_0x396d4a){const _0x3173d4=a0_0x139e9d;return STATIC_ANALYSIS[_0x3173d4(0x1e5)]['ERROR'];}async['getValidatorStatus'](){const _0x139b71=a0_0x139e9d,_0x3d7a88=await this[_0x139b71(0x1dd)]();return{'validators':_0x3d7a88,'recommendations':this['getInstallRecommendations'](_0x3d7a88)};}['getInstallRecommendations'](_0xdd89b5){const _0x386925=a0_0x139e9d,_0x2e9be1=[];return!_0xdd89b5[_0x386925(0x210)]&&_0x2e9be1[_0x386925(0x1ce)]({'validator':'checkov','reason':_0x386925(0x1b6),'install':_0x386925(0x1de),'priority':_0x386925(0x1e8)}),!_0xdd89b5['hadolint']&&_0x2e9be1['push']({'validator':'hadolint','reason':_0x386925(0x1d7),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0xdd89b5['yamllint']&&_0x2e9be1['push']({'validator':'yamllint','reason':_0x386925(0x22a),'install':'pip\x20install\x20yamllint','priority':'medium'}),!_0xdd89b5['jsonSchema']&&_0x2e9be1[_0x386925(0x1ce)]({'validator':'ajv\x20(JSON\x20Schema)','reason':'JSON\x20configuration\x20validation','install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x2e9be1;}}function a0_0x4baa(_0x3aede1,_0x3cbae0){_0x3aede1=_0x3aede1-0x1b4;const _0x2dc23d=a0_0x2dc2();let _0x4baa04=_0x2dc23d[_0x3aede1];if(a0_0x4baa['kOxVmS']===undefined){var _0x1b64e6=function(_0x5ad4ab){const _0x354698='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xae44fc='',_0x1d2b10='';for(let _0x18c9f7=0x0,_0x1e9ce2,_0x15586c,_0x55a341=0x0;_0x15586c=_0x5ad4ab['charAt'](_0x55a341++);~_0x15586c&&(_0x1e9ce2=_0x18c9f7%0x4?_0x1e9ce2*0x40+_0x15586c:_0x15586c,_0x18c9f7++%0x4)?_0xae44fc+=String['fromCharCode'](0xff&_0x1e9ce2>>(-0x2*_0x18c9f7&0x6)):0x0){_0x15586c=_0x354698['indexOf'](_0x15586c);}for(let _0x1fdf0b=0x0,_0x559fdc=_0xae44fc['length'];_0x1fdf0b<_0x559fdc;_0x1fdf0b++){_0x1d2b10+='%'+('00'+_0xae44fc['charCodeAt'](_0x1fdf0b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d2b10);};a0_0x4baa['jblGhZ']=_0x1b64e6,a0_0x4baa['NrOOAh']={},a0_0x4baa['kOxVmS']=!![];}const _0x535637=_0x2dc23d[0x0],_0x47c268=_0x3aede1+_0x535637,_0x4176fc=a0_0x4baa['NrOOAh'][_0x47c268];return!_0x4176fc?(_0x4baa04=a0_0x4baa['jblGhZ'](_0x4baa04),a0_0x4baa['NrOOAh'][_0x47c268]=_0x4baa04):_0x4baa04=_0x4176fc,_0x4baa04;}export default ConfigValidator;
|
|
1
|
+
const a0_0x547241=a0_0x14f8;(function(_0x2f0149,_0x164bed){const _0x17183f=a0_0x14f8,_0x171ae9=_0x2f0149();while(!![]){try{const _0x314e3c=-parseInt(_0x17183f(0x151))/0x1*(-parseInt(_0x17183f(0x125))/0x2)+-parseInt(_0x17183f(0x16f))/0x3+parseInt(_0x17183f(0x117))/0x4*(parseInt(_0x17183f(0x104))/0x5)+-parseInt(_0x17183f(0x123))/0x6+parseInt(_0x17183f(0x127))/0x7*(parseInt(_0x17183f(0x11d))/0x8)+-parseInt(_0x17183f(0x15e))/0x9+parseInt(_0x17183f(0x170))/0xa;if(_0x314e3c===_0x164bed)break;else _0x171ae9['push'](_0x171ae9['shift']());}catch(_0x3e6091){_0x171ae9['push'](_0x171ae9['shift']());}}}(a0_0x58fc,0x3c260));import{exec}from'child_process';import{promisify}from'util';function a0_0x14f8(_0x87a919,_0x5016e2){_0x87a919=_0x87a919-0xfa;const _0x58fc1b=a0_0x58fc();let _0x14f896=_0x58fc1b[_0x87a919];if(a0_0x14f8['VmOrJg']===undefined){var _0x462fe9=function(_0x2e1dd1){const _0x27e524='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1383c4='',_0x1a4c7f='';for(let _0x3490a5=0x0,_0x22232d,_0xe457a1,_0x5cea46=0x0;_0xe457a1=_0x2e1dd1['charAt'](_0x5cea46++);~_0xe457a1&&(_0x22232d=_0x3490a5%0x4?_0x22232d*0x40+_0xe457a1:_0xe457a1,_0x3490a5++%0x4)?_0x1383c4+=String['fromCharCode'](0xff&_0x22232d>>(-0x2*_0x3490a5&0x6)):0x0){_0xe457a1=_0x27e524['indexOf'](_0xe457a1);}for(let _0x3bf184=0x0,_0x5c19a8=_0x1383c4['length'];_0x3bf184<_0x5c19a8;_0x3bf184++){_0x1a4c7f+='%'+('00'+_0x1383c4['charCodeAt'](_0x3bf184)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1a4c7f);};a0_0x14f8['ZDIYdV']=_0x462fe9,a0_0x14f8['EFkdQP']={},a0_0x14f8['VmOrJg']=!![];}const _0x329109=_0x58fc1b[0x0],_0x4a479e=_0x87a919+_0x329109,_0x58e7d7=a0_0x14f8['EFkdQP'][_0x4a479e];return!_0x58e7d7?(_0x14f896=a0_0x14f8['ZDIYdV'](_0x14f896),a0_0x14f8['EFkdQP'][_0x4a479e]=_0x14f896):_0x14f896=_0x58e7d7,_0x14f896;}function a0_0x58fc(){const _0x3b6239=['nJm4nNf1qK93AG','DhjPBq','ndu1quHfALHL','Dw5RBM93BG','C2v2zxjPDhK','AgLNAa','sw52ywXPzcbku09ooIa','CgfYC2vdAgvJA292uMvZDwX0CW','AgfKB2XPBNq','Ew91CI1RzxKTAgvYzq','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','DMfSAwrHDgvzqu1m','y2HLy2TVDIaTlxzLCNnPB24','lNrM','C3rYAw5N','BwfWq2HLy2TVDLnLDMvYAxr5','zMLSzv9SAw5Lx3jHBMDL','z2L0AhvIlwfJDgLVBNm','CgfYC2u','DMvYC2LVBG','DMfSAwrHDgveB2nRzxjMAwXL','lMvUDG','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','ANnVBI1WyxjZzq','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','DgvYCMfMB3jT','Aw5JBhvKzxm','DMfSAwrHDgvfBNzgAwXL','zg9JA2vYlwnVBxbVC2u','CMvZDwX0CW','y3DL','zgvIDwC','CMvHzezPBgu','Bg9Nz2vY','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','DhnJB25MAwCUANnVBG','zg9JA2vYlwnVBxbVC2uUEwfTBa','zg9JA2vYlwnVBxbVC2uUEw1S','zg9JA2vYzMLSzq','zxjYB3i','lMDPDgH1yI93B3jRzMXVD3m','A3vIzxjUzxrLCW','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','EwfTBgXPBNq','mtaZwfHsEKDy','Aw5ZDgfUy2vqyxrO','AZHZ','DMfSAwrHDgvqywnRywDLsNnVBG','BgvUz3rO','zgvMyxvSDa','ywP2icHku09oifnJAgvTysK','C2vJCMv0','BwfWsgfKB2XPBNrtzxzLCML0Eq','zM9YrwfJAa','EwfTBa','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','zw5KC1DPDgG','mZK0nJu3mM9PufztAq','D2fYBG','C3rKB3v0','CMvTzwrPyxrPB24','zxjYB3jZ','y2HHBMDLBwu','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','q1jjveLdquW','u0vwrvjjvfK','ChvZAa','B2jQzwn0','wufntcbMAwXLihzHBgLKyxrPB24','BM9jBxbSAwnPDefUEq','y2HLy2TVDG','Bwf0y2G','C3LUDgf4','otGXnJK2C1bdCLbn','nJi5otaYmeruvNrOtG','su5gtW','igrLDgvJDgvKigLUic5LBNyGzMLSzq','C3rHCNrZv2L0Aa','iIaTlwzYyw1LD29YAYa','ANnVBI1Zy2HLBwe','BM8TAw1WBgLJAxqTyw55','ug90zw50AwfSigHHCMrJB2rLzca','ywP2','DMfSAwrHDgLVBG','CgfYC2viywrVBgLUDfjLC3vSDhm','qvDtignYzwrLBNrPywXZ','ywP2lwzVCM1HDhm','Dg9mB3DLCKnHC2u','BwfW','mJmWrwXmBhnm','ANnVBG','CgfYyw1Z','EwfTBgXPBNqGzgv0zwn0zwq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','DgvZDa','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','v0fstKLorW','zMfPBgvKx2nOzwnRCW','zxH0BMfTzq','BwvKAxvT','y29TCgLSzxjpChrPB25Z','z3vPzgvSAw5L','DxrMltG','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','y29TCgLSzq','DhnJB25MAwCTDMfSAwrHDg9Y','BwvZC2fNzq','DMfSAwrHDgvxAxrOq2HLy2TVDG','mZC0ntjpvu11uw0','AxnbCNjHEq','rvjst1i','DMfSAwrHDgvuC0nVBMzPzW','DMfSAwrHDgu','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','nJa3mKPXvMDQAa','C2vJDxjPDhK','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','y29SDw1U','C3bSAxq','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','mJu2mdiZnM9uDNjrvq','zgLYBMfTzq'];a0_0x58fc=function(){return _0x3b6239;};return a0_0x58fc();}import a0_0x1383c4 from'path';import a0_0x1a4c7f from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x3490a5=null){this['logger']=_0x3490a5,this['availableScanners']=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x4bc0dc=a0_0x14f8;if(this['availableScanners']!==null)return this['availableScanners'];const _0x22232d={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x4bc0dc(0x131),{'timeout':0x1388}),_0x22232d['checkov']=!![],this[_0x4bc0dc(0x146)]?.[_0x4bc0dc(0x144)]('checkov\x20detected');}catch(_0xe457a1){this['logger']?.[_0x4bc0dc(0x144)]('checkov\x20not\x20available',{'error':_0xe457a1[_0x4bc0dc(0x115)]});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x22232d[_0x4bc0dc(0x12d)]=!![],this['logger']?.['debug']('hadolint\x20detected');}catch(_0x5cea46){this['logger']?.[_0x4bc0dc(0x144)]('hadolint\x20not\x20available',{'error':_0x5cea46['message']});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x22232d[_0x4bc0dc(0x150)]=!![],this['logger']?.['debug'](_0x4bc0dc(0x107));}catch(_0x3bf184){this[_0x4bc0dc(0x146)]?.[_0x4bc0dc(0x144)]('yamllint\x20not\x20available',{'error':_0x3bf184[_0x4bc0dc(0x115)]});}try{await import('ajv'),_0x22232d['jsonSchema']=!![],this[_0x4bc0dc(0x146)]?.['debug'](_0x4bc0dc(0x122));}catch(_0x5c19a8){this['logger']?.[_0x4bc0dc(0x144)]('ajv\x20not\x20available',{'error':_0x5c19a8['message']});}return this['availableScanners']=_0x22232d,_0x22232d;}async[a0_0x547241(0x11b)](_0x623841,_0x46c0bf={}){const _0x5af52d=a0_0x547241,_0x49e15b=[],_0x7c1121=await this[_0x5af52d(0x15c)](),_0x549f9a=this['detectFileType'](_0x623841);this[_0x5af52d(0x146)]?.[_0x5af52d(0x144)]('Validating\x20config\x20file',{'filePath':_0x623841,'fileType':_0x549f9a});switch(_0x549f9a){case _0x5af52d(0x14b):if(_0x7c1121['hadolint']){const _0x39c580=await this[_0x5af52d(0x139)](_0x623841,_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x39c580);}if(_0x7c1121['checkov']){const _0x457528=await this['validateWithCheckov'](_0x623841,'dockerfile',_0x46c0bf);_0x49e15b['push'](..._0x457528);}break;case _0x5af52d(0x141):if(_0x7c1121[_0x5af52d(0x150)]){const _0x92df21=await this['validateYAML'](_0x623841,_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x92df21);}if(_0x7c1121[_0x5af52d(0x16c)]){const _0x30567c=await this['validateWithCheckov'](_0x623841,'docker_compose',_0x46c0bf);_0x49e15b['push'](..._0x30567c);}break;case _0x5af52d(0x14e):if(_0x7c1121['yamllint']){const _0x585840=await this['validateYAML'](_0x623841,_0x46c0bf);_0x49e15b['push'](..._0x585840);}if(_0x7c1121[_0x5af52d(0x16c)]){const _0x5a69ba=await this[_0x5af52d(0x116)](_0x623841,'kubernetes',_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x5a69ba);}break;case _0x5af52d(0x13e):if(_0x7c1121['checkov']){const _0x35d1aa=await this[_0x5af52d(0x116)](_0x623841,_0x5af52d(0x13e),_0x46c0bf);_0x49e15b['push'](..._0x35d1aa);}break;case'package.json':if(_0x7c1121['jsonSchema']){const _0x133fae=await this[_0x5af52d(0x154)](_0x623841,_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x133fae);}break;case'tsconfig.json':if(_0x7c1121['jsonSchema']){const _0x37fa76=await this[_0x5af52d(0x11a)](_0x623841,_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x37fa76);}break;case _0x5af52d(0x136):if(_0x7c1121[_0x5af52d(0x150)]){const _0x24ab58=await this[_0x5af52d(0x130)](_0x623841,_0x46c0bf);_0x49e15b['push'](..._0x24ab58);}break;case'env':const _0x239f7=await this['validateEnvFile'](_0x623841,_0x46c0bf);_0x49e15b[_0x5af52d(0x168)](..._0x239f7);break;case _0x5af52d(0x15b):if(_0x7c1121[_0x5af52d(0x150)]){const _0x35ff1c=await this[_0x5af52d(0x130)](_0x623841,_0x46c0bf);_0x49e15b['push'](..._0x35ff1c);}break;default:this['logger']?.[_0x5af52d(0x15f)](_0x5af52d(0x147),{'filePath':_0x623841,'fileType':_0x549f9a});return[];}return this['normalizeResults'](_0x49e15b);}async['validateDockerfile'](_0x4bab7d,_0x36e10f={}){const _0x455a78=a0_0x547241;try{const _0x3ebb34=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x4bab7d+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x45b28b=JSON[_0x455a78(0x137)](_0x3ebb34[_0x455a78(0x160)]);return this[_0x455a78(0xff)](_0x45b28b,_0x4bab7d);}catch(_0x531ae3){if(_0x531ae3['stdout'])try{const _0x1b30f6=JSON[_0x455a78(0x137)](_0x531ae3[_0x455a78(0x160)]);return this[_0x455a78(0xff)](_0x1b30f6,_0x4bab7d);}catch(_0x3f679f){this[_0x455a78(0x146)]?.['error'](_0x455a78(0x112),{'error':_0x3f679f['message']});}return this['logger']?.[_0x455a78(0x14c)]('hadolint\x20validation\x20failed',{'error':_0x531ae3['message']}),[];}}['parseHadolintResults'](_0x51c971,_0x29dbeb){const _0x2c8f54=a0_0x547241,_0x1f00bb=[];if(Array[_0x2c8f54(0x118)](_0x51c971))for(const _0x3710b7 of _0x51c971){_0x1f00bb[_0x2c8f54(0x168)]({'file':_0x29dbeb,'line':_0x3710b7['line']||0x1,'column':_0x3710b7[_0x2c8f54(0x120)]||0x1,'severity':this[_0x2c8f54(0x159)](_0x3710b7['level']),'rule':_0x3710b7['code'],'message':_0x3710b7[_0x2c8f54(0x115)],'category':'dockerfile','validator':'hadolint'});}return _0x1f00bb;}async['validateYAML'](_0x3fc092,_0x15afe9={}){const _0x2bd19b=a0_0x547241;try{const _0x41c6a2=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x3fc092+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x2bd19b(0x108)](_0x41c6a2['stdout'],_0x3fc092);}catch(_0x4a4315){if(_0x4a4315[_0x2bd19b(0x160)])return this['parseYamllintResults'](_0x4a4315[_0x2bd19b(0x160)],_0x3fc092);return this[_0x2bd19b(0x146)]?.[_0x2bd19b(0x14c)]('yamllint\x20validation\x20failed',{'error':_0x4a4315['message']}),[];}}['parseYamllintResults'](_0x4778cd,_0x1b5a16){const _0x3dc630=a0_0x547241,_0x1860aa=[],_0x589eb3=_0x4778cd[_0x3dc630(0x121)]('\x0a')['filter'](_0x183332=>_0x183332['trim']());for(const _0x49a7ae of _0x589eb3){const _0xbbb4eb=_0x49a7ae[_0x3dc630(0x16d)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0xbbb4eb){const [,_0xc067b8,_0x410c7a,_0x230d8a,_0x4571f7,_0x373b6b,_0x3cfaa2]=_0xbbb4eb;_0x1860aa[_0x3dc630(0x168)]({'file':_0x1b5a16,'line':parseInt(_0x410c7a,0xa),'column':parseInt(_0x230d8a,0xa),'severity':this['mapYamllintSeverity'](_0x4571f7),'rule':_0x3cfaa2,'message':_0x373b6b,'category':'yaml','validator':_0x3dc630(0x150)});}}return _0x1860aa;}async['validateWithCheckov'](_0x18a859,_0x504b95,_0x565094={}){const _0x55b16d=a0_0x547241;try{const _0x5a2bf6=await execAsync('checkov\x20-f\x20\x22'+_0x18a859+_0x55b16d(0x174)+_0x504b95+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x2c9761=JSON['parse'](_0x5a2bf6['stdout']);return this[_0x55b16d(0x12c)](_0x2c9761,_0x18a859);}catch(_0x2f58f8){if(_0x2f58f8[_0x55b16d(0x160)])try{const _0x5a1b44=JSON['parse'](_0x2f58f8[_0x55b16d(0x160)]);return this['parseCheckovResults'](_0x5a1b44,_0x18a859);}catch(_0x2cbd79){this['logger']?.[_0x55b16d(0x14c)](_0x55b16d(0x14f),{'error':_0x2cbd79['message']});}return this[_0x55b16d(0x146)]?.[_0x55b16d(0x14c)](_0x55b16d(0x11f),{'error':_0x2f58f8['message']}),[];}}[a0_0x547241(0x12c)](_0x12b2ea,_0x2d3202){const _0x3ffb01=a0_0x547241,_0x25cd30=[];if(_0x12b2ea[_0x3ffb01(0x142)]&&_0x12b2ea['results'][_0x3ffb01(0x10c)])for(const _0x1adcaf of _0x12b2ea[_0x3ffb01(0x142)][_0x3ffb01(0x10c)]){_0x25cd30['push']({'file':_0x2d3202,'line':_0x1adcaf['file_line_range']?_0x1adcaf[_0x3ffb01(0x135)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x1adcaf['check_class']),'rule':_0x1adcaf['check_id'],'message':_0x1adcaf['check_name']||_0x1adcaf['check_id'],'category':'security','validator':_0x3ffb01(0x16c),'remediation':_0x1adcaf['guideline'],'cwe':_0x1adcaf['cwe'],'references':_0x1adcaf[_0x3ffb01(0x110)]?[_0x1adcaf[_0x3ffb01(0x110)]]:[]});}return _0x25cd30;}async['validatePackageJson'](_0x56301e,_0x5e01a5={}){const _0x381ba7=a0_0x547241;try{const _0x59bbaf=(await import(_0x381ba7(0xfd)))['default'],_0x7bf8ef=(await import(_0x381ba7(0x101)))[_0x381ba7(0x156)],_0x2b8be7=await a0_0x1a4c7f[_0x381ba7(0x145)](_0x56301e,'utf-8'),_0xd4616b=JSON[_0x381ba7(0x137)](_0x2b8be7),_0x37d414=new _0x59bbaf({'allErrors':!![],'strict':![]});_0x7bf8ef(_0x37d414);const _0x38e1c7={'type':'object','required':['name',_0x381ba7(0x138)],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x381ba7(0x133)},'description':{'type':'string'},'main':{'type':_0x381ba7(0x133)},'type':{'type':_0x381ba7(0x133),'enum':['module','commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x381ba7(0x169)},'devDependencies':{'type':_0x381ba7(0x169)}},'additionalProperties':!![]},_0x57afa9=_0x37d414[_0x381ba7(0x113)](_0x38e1c7),_0x115823=_0x57afa9(_0xd4616b);if(!_0x115823&&_0x57afa9['errors'])return _0x57afa9[_0x381ba7(0x162)][_0x381ba7(0x103)](_0xaa430e=>({'file':_0x56301e,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x381ba7(0x119)],'rule':_0x381ba7(0xfa),'message':_0xaa430e[_0x381ba7(0x152)]?_0xaa430e[_0x381ba7(0x152)]+'\x20'+_0xaa430e['message']:'must\x20have\x20required\x20property\x20\x27'+_0xaa430e[_0x381ba7(0x106)]['missingProperty']+'\x27','category':'validation','validator':_0x381ba7(0xfa)}));return[];}catch(_0x4fd416){return this['logger']?.[_0x381ba7(0x14c)](_0x381ba7(0x13d),{'error':_0x4fd416[_0x381ba7(0x115)]}),[{'file':_0x56301e,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x381ba7(0x167)]['ERROR'],'rule':_0x381ba7(0x13c),'message':'Invalid\x20JSON:\x20'+_0x4fd416['message'],'category':_0x381ba7(0x16e),'validator':'json-parse'}];}}async[a0_0x547241(0x11a)](_0x16f337,_0x58d506={}){const _0xe896af=a0_0x547241;try{const _0xf07465=await a0_0x1a4c7f[_0xe896af(0x145)](_0x16f337,'utf-8'),_0x427d07=JSON['parse'](_0xf07465),_0x4d3ac3=[];if(_0x427d07[_0xe896af(0x10f)]){const _0x583283=_0x427d07[_0xe896af(0x10f)];!_0x583283['strict']&&_0x4d3ac3['push']({'file':_0x16f337,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xe896af(0x167)]['WARNING'],'rule':'strict-mode','message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':_0xe896af(0x114)}),_0x583283[_0xe896af(0x16b)]===![]&&_0x4d3ac3[_0xe896af(0x168)]({'file':_0x16f337,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xe896af(0x167)][_0xe896af(0x10b)],'rule':_0xe896af(0xfb),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x4d3ac3;}catch(_0x1c0ddd){return this['logger']?.[_0xe896af(0x14c)]('tsconfig.json\x20validation\x20failed',{'error':_0x1c0ddd[_0xe896af(0x115)]}),[{'file':_0x16f337,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xe896af(0x167)][_0xe896af(0x119)],'rule':_0xe896af(0x13c),'message':_0xe896af(0x12b)+_0x1c0ddd['message'],'category':'syntax','validator':_0xe896af(0x13c)}];}}async[a0_0x547241(0x140)](_0x50282b,_0x55d160={}){const _0x143e53=a0_0x547241;try{const _0x5ba281=await a0_0x1a4c7f[_0x143e53(0x145)](_0x50282b,_0x143e53(0x111)),_0x357988=[],_0x4ba6b4=_0x5ba281['split']('\x0a'),_0x38c720=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':_0x143e53(0x158)},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x143e53(0x100)}];return _0x4ba6b4[_0x143e53(0x15a)]((_0x31c16f,_0x6390a8)=>{const _0x1a11dd=_0x143e53,_0xf1de21=_0x31c16f[_0x1a11dd(0x126)]();if(!_0xf1de21||_0xf1de21[_0x1a11dd(0x173)]('#'))return;if(_0xf1de21[_0x1a11dd(0x13f)]('=')){const [_0x2b308c,_0x32dcc6]=_0xf1de21[_0x1a11dd(0x121)]('='),_0x292c22=_0x2b308c['toLowerCase'](),_0xd611c2=_0x32dcc6?.[_0x1a11dd(0x126)]()||'',_0x495615=_0xd611c2&&_0xd611c2!==''&&!_0xd611c2[_0x1a11dd(0x173)]('$')&&_0xd611c2!==_0x1a11dd(0x12e)&&_0xd611c2!==_0x1a11dd(0x163)&&_0xd611c2[_0x1a11dd(0x155)]>0x5;if(_0x495615)for(const {pattern:_0x108607,name:_0xb18fe2}of _0x38c720){if(_0x108607[_0x1a11dd(0x109)](_0x292c22)){_0x357988[_0x1a11dd(0x168)]({'file':_0x50282b,'line':_0x6390a8+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1a11dd(0x166)],'rule':'hardcoded-secret','message':_0x1a11dd(0xfc)+_0xb18fe2+_0x1a11dd(0x172),'category':_0x1a11dd(0x11e),'validator':'env-validator','remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x357988;}catch(_0x33c31b){return this[_0x143e53(0x146)]?.['error'](_0x143e53(0x10a),{'error':_0x33c31b[_0x143e53(0x115)]}),[];}}['detectFileType'](_0x59711c){const _0x3589a1=a0_0x547241,_0x164d40=a0_0x1383c4['basename'](_0x59711c)['toLowerCase'](),_0x29e5c7=a0_0x1383c4[_0x3589a1(0x124)](_0x59711c);if(_0x164d40===_0x3589a1(0x14b))return _0x3589a1(0x14b);if(_0x164d40===_0x3589a1(0x14a)||_0x164d40===_0x3589a1(0x149))return'docker-compose';if(_0x164d40==='package.json')return'package.json';if(_0x164d40==='tsconfig.json')return _0x3589a1(0x148);if(_0x164d40==='.env'||_0x164d40[_0x3589a1(0x15d)](_0x3589a1(0x13a)))return'env';if(_0x29e5c7['includes'](_0x3589a1(0x14d)))return'github-actions';if(_0x29e5c7['includes']('kubernetes')||_0x29e5c7['includes'](_0x3589a1(0x153)))return _0x3589a1(0x14e);const _0x49cf23=a0_0x1383c4[_0x3589a1(0x10d)](_0x59711c)['toLowerCase']();if(_0x49cf23===_0x3589a1(0x132)||_0x49cf23==='.tfvars')return _0x3589a1(0x13e);if(_0x49cf23==='.yml'||_0x49cf23==='.yaml')return _0x3589a1(0x15b);if(_0x49cf23==='.json')return _0x3589a1(0x105);return _0x3589a1(0x128);}['normalizeResults'](_0x4f52b3){const _0x2c89b0=a0_0x547241;return _0x4f52b3[_0x2c89b0(0x103)](_0x112b5b=>({'file':_0x112b5b['file'],'line':_0x112b5b['line']||0x1,'column':_0x112b5b[_0x2c89b0(0x120)]||0x1,'severity':_0x112b5b[_0x2c89b0(0x129)]||STATIC_ANALYSIS[_0x2c89b0(0x167)][_0x2c89b0(0x10b)],'rule':_0x112b5b['rule']||'unknown','message':_0x112b5b[_0x2c89b0(0x115)]||_0x2c89b0(0x165),'category':_0x112b5b['category']||_0x2c89b0(0xfe),'validator':_0x112b5b['validator'],'cwe':_0x112b5b[_0x2c89b0(0x143)]||null,'remediation':_0x112b5b[_0x2c89b0(0x161)]||null,'references':_0x112b5b['references']||[]}));}['mapHadolintSeverity'](_0x2c9225){const _0x4ceb17=a0_0x547241,_0x25ca5a={'error':STATIC_ANALYSIS['SEVERITY'][_0x4ceb17(0x119)],'warning':STATIC_ANALYSIS[_0x4ceb17(0x167)]['WARNING'],'info':STATIC_ANALYSIS[_0x4ceb17(0x167)]['INFO'],'style':STATIC_ANALYSIS[_0x4ceb17(0x167)][_0x4ceb17(0x171)]};return _0x25ca5a[_0x2c9225?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x4ceb17(0x10b)];}['mapYamllintSeverity'](_0x20e8bd){const _0x50b6d0=a0_0x547241,_0x18bd5e={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x50b6d0(0x167)]['WARNING']};return _0x18bd5e[_0x20e8bd?.[_0x50b6d0(0x102)]()]||STATIC_ANALYSIS[_0x50b6d0(0x167)]['WARNING'];}[a0_0x547241(0x134)](_0x52276e){const _0x2c6a49=a0_0x547241;return STATIC_ANALYSIS[_0x2c6a49(0x167)][_0x2c6a49(0x119)];}async['getValidatorStatus'](){const _0x346d3b=a0_0x547241,_0x576cb1=await this[_0x346d3b(0x15c)]();return{'validators':_0x576cb1,'recommendations':this[_0x346d3b(0x12f)](_0x576cb1)};}['getInstallRecommendations'](_0x426d98){const _0x2b59e8=a0_0x547241,_0x452aab=[];return!_0x426d98['checkov']&&_0x452aab[_0x2b59e8(0x168)]({'validator':'checkov','reason':_0x2b59e8(0x164),'install':'pip\x20install\x20checkov','priority':_0x2b59e8(0x12a)}),!_0x426d98['hadolint']&&_0x452aab['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x426d98[_0x2b59e8(0x150)]&&_0x452aab['push']({'validator':_0x2b59e8(0x150),'reason':_0x2b59e8(0x16a),'install':'pip\x20install\x20yamllint','priority':_0x2b59e8(0x10e)}),!_0x426d98['jsonSchema']&&_0x452aab['push']({'validator':_0x2b59e8(0x157),'reason':_0x2b59e8(0x11c),'install':_0x2b59e8(0x13b),'priority':_0x2b59e8(0x10e)}),_0x452aab;}}export default ConfigValidator;
|