@loxia-labs/loxia-autopilot-one 2.0.2 → 2.0.3
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 +9 -2
- 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 -0
- package/src/tools/excelTool.js +1 -0
- 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 -0
- 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-9lwuGbV1.js → index-B5f---1N.js} +81 -81
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
function a0_0x11bf(){const _0x44ce9c=['LOXIA_PORT','unref','ignore','utf8','help','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','\x0aServer\x20registered\x20at\x20','getService','cmd','\x0aOpening\x20Web\x20UI\x20at\x20','--port','darwin','statusCode','cleanupStaleEntries','2FiUDOZ','argv','includes','Error:','--host','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','/api/health','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','Unknown\x20command:\x20','host','503256aHVxqH','http://','catch','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','../src/services/portRegistry.js','3545050QBMpgu','open','loxia-terminal.js','PORT','parse','2801412SwoVlU','/api/health\x0a','platform','SIGTERM','SIGINT','package.json','Looking\x20for\x20running\x20server...','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','kill','exit','node','\x0aLoxia\x20Autopilot\x20One\x20v','1848161wTtXQO','Starting\x20Terminal\x20UI...\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','inherit','Server\x20discovered\x20at\x20','setTimeout','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','message',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','\x0aPlease\x20start\x20the\x20server\x20first:','8780778vWasLE','toString','localhost','backend','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','pid','Starting\x20Loxia\x20server\x20in\x20background...','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','LOXIA_HOST','Starting\x20Loxia\x20server...\x0a','web','index.js','log','24291776GpUxux','error','xdg-open','\x0a✓\x20Server\x20running\x20at\x20','version','port','3480432JWctzZ','Could\x20not\x20open\x20browser\x20automatically.'];a0_0x11bf=function(){return _0x44ce9c;};return a0_0x11bf();}const a0_0x2bfa4c=a0_0x4168;(function(_0x449e6a,_0x194cee){const _0x4c8db8=a0_0x4168,_0x2135a0=_0x449e6a();while(!![]){try{const _0xb895a8=parseInt(_0x4c8db8(0x214))/0x1*(-parseInt(_0x4c8db8(0x20a))/0x2)+parseInt(_0x4c8db8(0x1fa))/0x3+parseInt(_0x4c8db8(0x1d1))/0x4+parseInt(_0x4c8db8(0x219))/0x5+parseInt(_0x4c8db8(0x1e7))/0x6+parseInt(_0x4c8db8(0x1dd))/0x7+-parseInt(_0x4c8db8(0x1f4))/0x8;if(_0xb895a8===_0x194cee)break;else _0x2135a0['push'](_0x2135a0['shift']());}catch(_0x1712a7){_0x2135a0['push'](_0x2135a0['shift']());}}}(a0_0x11bf,0xb8e11));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x2ad8e4 from'http';function a0_0x4168(_0x2a5d02,_0x476321){_0x2a5d02=_0x2a5d02-0x1cf;const _0x11bf46=a0_0x11bf();let _0x416807=_0x11bf46[_0x2a5d02];return _0x416807;}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[a0_0x2bfa4c(0x20b)]['slice'](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x2bfa4c(0x20c)]('--help')||args[a0_0x2bfa4c(0x20c)]('-h'),'version':args[a0_0x2bfa4c(0x20c)]('--version')||args[a0_0x2bfa4c(0x20c)]('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x2bfa4c(0x206)&&args[i+0x1]&&(flags[a0_0x2bfa4c(0x1f9)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x2bfa4c(0x20e)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}const explicitPort=flags['port'],host=flags['host']||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x2bfa4c(0x1d6)),pkg=JSON[a0_0x2bfa4c(0x1d0)](readFileSync(pkgPath,a0_0x2bfa4c(0x1ff)));console['log']('Loxia\x20Autopilot\x20One\x20v'+pkg[a0_0x2bfa4c(0x1f8)]),process[a0_0x2bfa4c(0x1da)](0x0);}if(flags[a0_0x2bfa4c(0x200)]||!command){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x2bfa4c(0x1d0)](readFileSync(pkgPath,a0_0x2bfa4c(0x1ff)));console['log'](a0_0x2bfa4c(0x1dc)+pkg['version']+'\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'+DEFAULT_PORT+a0_0x2bfa4c(0x1e5)+DEFAULT_HOST+a0_0x2bfa4c(0x1df)),process[a0_0x2bfa4c(0x1da)](0x0);}async function getPortRegistry(){const _0x1ee3bf=a0_0x2bfa4c,{getPortRegistry:_0x350bbc}=await import(_0x1ee3bf(0x218));return _0x350bbc();}async function discoverBackend(){const _0x3951e9=a0_0x2bfa4c;try{const _0x15f972=await getPortRegistry();await _0x15f972[_0x3951e9(0x209)]();const _0xdbb2da=await _0x15f972[_0x3951e9(0x203)](_0x3951e9(0x1ea));if(_0xdbb2da)return{'host':_0xdbb2da['host']||_0x3951e9(0x1e9),'port':_0xdbb2da[_0x3951e9(0x1f9)],'pid':_0xdbb2da['pid']};return null;}catch(_0x366f04){return null;}}async function checkServerRunning(_0x3aa3f0,_0x12b2b0,_0x5497b8=0x1){for(let _0x3d3490=0x0;_0x3d3490<_0x5497b8;_0x3d3490++){const _0x597a57=await new Promise(_0x19f8ff=>{const _0x1e31fe=a0_0x4168,_0x430be9=a0_0x2ad8e4['get'](_0x1e31fe(0x215)+_0x3aa3f0+':'+_0x12b2b0+_0x1e31fe(0x210),_0x31b188=>{const _0xa90ddc=_0x1e31fe;_0x19f8ff(_0x31b188[_0xa90ddc(0x208)]===0xc8);});_0x430be9['on'](_0x1e31fe(0x1f5),()=>_0x19f8ff(![])),_0x430be9[_0x1e31fe(0x1e2)](0x7d0,()=>{_0x430be9['destroy'](),_0x19f8ff(![]);});});if(_0x597a57)return!![];_0x3d3490<_0x5497b8-0x1&&await new Promise(_0x5e9113=>setTimeout(_0x5e9113,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x370c78=SERVER_STARTUP_TIMEOUT){const _0x38778b=a0_0x2bfa4c,_0x27c905=Date['now']();while(Date['now']()-_0x27c905<_0x370c78){const _0x116ced=await discoverBackend();if(_0x116ced){const _0x472629=await checkServerRunning(_0x116ced[_0x38778b(0x213)],_0x116ced[_0x38778b(0x1f9)]);if(_0x472629)return _0x116ced;}await new Promise(_0x147277=>setTimeout(_0x147277,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x181169,_0x2b6c8c,_0x4a38c0=SERVER_STARTUP_TIMEOUT){const _0x25f81a=Math['ceil'](_0x4a38c0/SERVER_CHECK_INTERVAL),_0x282605=await checkServerRunning(_0x181169,_0x2b6c8c,_0x25f81a);return _0x282605?{'host':_0x181169,'port':_0x2b6c8c}:null;}function openBrowser(_0x305397){const _0x15251b=a0_0x2bfa4c;let _0x8e08f2,_0x59d94e;if(process['platform']===_0x15251b(0x207))_0x8e08f2=_0x15251b(0x21a),_0x59d94e=[_0x305397];else process[_0x15251b(0x1d3)]==='win32'?(_0x8e08f2=_0x15251b(0x204),_0x59d94e=['/c','start','\x22\x22',_0x305397]):(_0x8e08f2=_0x15251b(0x1f6),_0x59d94e=[_0x305397]);const _0x379b10=spawn(_0x8e08f2,_0x59d94e,{'detached':!![],'stdio':'ignore'});_0x379b10['unref'](),_0x379b10['on']('error',()=>{const _0x56e0f9=_0x15251b;console['log'](_0x56e0f9(0x1fb)),console[_0x56e0f9(0x1f3)]('Please\x20open\x20manually:\x20'+_0x305397);});}function startServer(_0x4b71f8=![]){const _0x1b3715=a0_0x2bfa4c,_0x2c28b9={...process.env};explicitPort&&(_0x2c28b9[_0x1b3715(0x1fc)]=explicitPort['toString'](),_0x2c28b9[_0x1b3715(0x1cf)]=explicitPort[_0x1b3715(0x1e8)]());flags[_0x1b3715(0x213)]&&(_0x2c28b9[_0x1b3715(0x1ef)]=flags['host']);const _0x4dc578=join(__dirname,'..','src',_0x1b3715(0x1f2)),_0x58e1ac=spawn(_0x1b3715(0x1db),[_0x4dc578],{'cwd':join(__dirname,'..'),'env':_0x2c28b9,'stdio':_0x4b71f8?['ignore',_0x1b3715(0x1fe),_0x1b3715(0x1fe)]:_0x1b3715(0x1e0),'detached':_0x4b71f8});return _0x4b71f8&&_0x58e1ac[_0x1b3715(0x1fd)](),_0x58e1ac;}function startTerminalUIProcess(_0x3b204,_0x1c7bc6){const _0x3601d9=a0_0x2bfa4c,_0x2d0d27=join(__dirname,_0x3601d9(0x21b)),_0x3135f5={...process.env,'LOXIA_PORT':_0x1c7bc6['toString'](),'LOXIA_HOST':_0x3b204},_0x4540d0=spawn(_0x3601d9(0x1db),[_0x2d0d27],{'cwd':join(__dirname,'..'),'env':_0x3135f5,'stdio':_0x3601d9(0x1e0)});return _0x4540d0;}const commands={'web':async()=>{const _0x320ecf=a0_0x2bfa4c;console[_0x320ecf(0x1f3)](_0x320ecf(0x1f0));const _0x1793d1=startServer(![]);console[_0x320ecf(0x1f3)]('Waiting\x20for\x20server\x20to\x20start...');let _0x299391;explicitPort?_0x299391=await waitForServerAtPort(host,explicitPort):_0x299391=await waitForServerWithDiscovery();if(_0x299391){const _0x57ef80=_0x320ecf(0x215)+_0x299391[_0x320ecf(0x213)]+':'+_0x299391[_0x320ecf(0x1f9)];console[_0x320ecf(0x1f3)](_0x320ecf(0x205)+_0x57ef80),openBrowser(_0x57ef80);}else console[_0x320ecf(0x1f3)](_0x320ecf(0x211));process['on']('SIGINT',()=>_0x1793d1[_0x320ecf(0x1d9)](_0x320ecf(0x1d5))),process['on']('SIGTERM',()=>_0x1793d1['kill']('SIGTERM')),_0x1793d1['on'](_0x320ecf(0x1da),_0x12d33c=>process[_0x320ecf(0x1da)](_0x12d33c||0x0));},'plus-web':async()=>{const _0x455f0c=a0_0x2bfa4c;await commands[_0x455f0c(0x1f1)]();},'serve':async()=>{const _0x418c2a=a0_0x2bfa4c;console[_0x418c2a(0x1f3)](_0x418c2a(0x1f0));const _0x4cf04a=startServer(![]);console['log']('Waiting\x20for\x20server\x20to\x20start...');let _0x1bd023;explicitPort?_0x1bd023=await waitForServerAtPort(host,explicitPort):_0x1bd023=await waitForServerWithDiscovery();if(_0x1bd023){const _0x35621b=_0x418c2a(0x215)+_0x1bd023['host']+':'+_0x1bd023[_0x418c2a(0x1f9)];console[_0x418c2a(0x1f3)](_0x418c2a(0x1f7)+_0x35621b),console[_0x418c2a(0x1f3)](_0x418c2a(0x1ee)+_0x35621b),console[_0x418c2a(0x1f3)]('\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal'),console[_0x418c2a(0x1f3)]('\x20\x20API\x20Health:\x20\x20\x20'+_0x35621b+_0x418c2a(0x1d2));}else console['log'](_0x418c2a(0x1e3)),console[_0x418c2a(0x1f3)]('Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.');process['on'](_0x418c2a(0x1d5),()=>_0x4cf04a['kill'](_0x418c2a(0x1d5))),process['on']('SIGTERM',()=>_0x4cf04a[_0x418c2a(0x1d9)](_0x418c2a(0x1d4))),_0x4cf04a['on'](_0x418c2a(0x1da),_0x4af034=>process[_0x418c2a(0x1da)](_0x4af034||0x0));},'terminal':async()=>{const _0x5bf714=a0_0x2bfa4c;console[_0x5bf714(0x1f3)](_0x5bf714(0x1d7));let _0x47e7b6=await discoverBackend();explicitPort&&(_0x47e7b6={'host':host,'port':explicitPort});!_0x47e7b6&&(console[_0x5bf714(0x1f5)](_0x5bf714(0x20f)),console['error'](_0x5bf714(0x1e6)),console[_0x5bf714(0x1f5)](_0x5bf714(0x201)),console[_0x5bf714(0x1f5)]('\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only'),console['error'](_0x5bf714(0x217)),process['exit'](0x1));const _0x25e350=await checkServerRunning(_0x47e7b6['host'],_0x47e7b6[_0x5bf714(0x1f9)]);!_0x25e350&&(console[_0x5bf714(0x1f5)](_0x5bf714(0x202)+_0x47e7b6['host']+':'+_0x47e7b6[_0x5bf714(0x1f9)]+'\x20but\x20not\x20responding.'),console[_0x5bf714(0x1f5)](_0x5bf714(0x1eb)),process['exit'](0x1));console['log'](_0x5bf714(0x1e1)+_0x47e7b6[_0x5bf714(0x213)]+':'+_0x47e7b6['port']),console[_0x5bf714(0x1f3)](_0x5bf714(0x1de));const _0x906e83=startTerminalUIProcess(_0x47e7b6[_0x5bf714(0x213)],_0x47e7b6['port']);process['on']('SIGINT',()=>_0x906e83[_0x5bf714(0x1d9)](_0x5bf714(0x1d5))),process['on'](_0x5bf714(0x1d4),()=>_0x906e83['kill']('SIGTERM')),_0x906e83['on'](_0x5bf714(0x1da),_0x52b960=>process['exit'](_0x52b960||0x0));},'plus-terminal':async()=>{const _0x2f3438=a0_0x2bfa4c;console[_0x2f3438(0x1f3)](_0x2f3438(0x1ed));const _0x5664ab=startServer(!![]);let _0x5d537d;explicitPort?_0x5d537d=await waitForServerAtPort(host,explicitPort):_0x5d537d=await waitForServerWithDiscovery();!_0x5d537d&&(console[_0x2f3438(0x1f5)](_0x2f3438(0x1d8)),process[_0x2f3438(0x1da)](0x1));console[_0x2f3438(0x1f3)]('Server\x20running\x20at\x20http://'+_0x5d537d['host']+':'+_0x5d537d['port']),console[_0x2f3438(0x1f3)]('Starting\x20Terminal\x20UI...\x0a');const _0x46056c=startTerminalUIProcess(_0x5d537d[_0x2f3438(0x213)],_0x5d537d[_0x2f3438(0x1f9)]);_0x46056c['on'](_0x2f3438(0x1da),_0x26541d=>{const _0x525f79=_0x2f3438;console['log']('\x0aShutting\x20down\x20server...');try{process[_0x525f79(0x1d9)](_0x5664ab[_0x525f79(0x1ec)],_0x525f79(0x1d4));}catch(_0x8e7ce0){}process['exit'](_0x26541d||0x0);}),process['on']('SIGINT',()=>{const _0x4b4b3b=_0x2f3438;_0x46056c[_0x4b4b3b(0x1d9)]('SIGINT');}),process['on'](_0x2f3438(0x1d4),()=>{const _0x4486d7=_0x2f3438;_0x46056c[_0x4486d7(0x1d9)](_0x4486d7(0x1d4));});}};commands[command]?commands[command]()[a0_0x2bfa4c(0x216)](_0x33f5a4=>{const _0x310a81=a0_0x2bfa4c;console[_0x310a81(0x1f5)](_0x310a81(0x20d),_0x33f5a4[_0x310a81(0x1e4)]),process[_0x310a81(0x1da)](0x1);}):(console[a0_0x2bfa4c(0x1f5)](a0_0x2bfa4c(0x212)+command),console['error']('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x2bfa4c(0x1da)](0x1));
|
|
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));
|
package/bin/loxia-terminal-v2.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x16e01e=a0_0x15bb;(function(_0xc5be7a,_0x1c2d40){const _0x4b1c72=a0_0x15bb,_0x187af2=_0xc5be7a();while(!![]){try{const _0x50914e=parseInt(_0x4b1c72(0xf5))/0x1*(-parseInt(_0x4b1c72(0xd6))/0x2)+parseInt(_0x4b1c72(0xd4))/0x3+-parseInt(_0x4b1c72(0xf6))/0x4+-parseInt(_0x4b1c72(0xe9))/0x5*(-parseInt(_0x4b1c72(0xfa))/0x6)+-parseInt(_0x4b1c72(0xea))/0x7*(parseInt(_0x4b1c72(0xf2))/0x8)+-parseInt(_0x4b1c72(0xd2))/0x9*(-parseInt(_0x4b1c72(0xe7))/0xa)+parseInt(_0x4b1c72(0xf8))/0xb*(-parseInt(_0x4b1c72(0xde))/0xc);if(_0x50914e===_0x1c2d40)break;else _0x187af2['push'](_0x187af2['shift']());}catch(_0x3766ff){_0x187af2['push'](_0x187af2['shift']());}}}(a0_0x3449,0xc79d7));import{spawn}from'child_process';import a0_0x3c0379 from'net';function a0_0x3449(){const _0x484ff6=['--ui','exit','connect','node','1533276emxkdz','✓\x20Server\x20is\x20already\x20running\x20at\x20','toString','join','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','kill','stderr','../src/interfaces/terminal/index.js','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','40oGOoGo','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','267435cssujQ','6404209KwEuOC','✗\x20Server\x20is\x20not\x20running','timeout','web','💡\x20Troubleshooting:','data','--host','--port','8MXWpgn','destroy','setTimeout','1889szRKqF','5739452JcPjrM','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','11puVkIZ','message','162DglALY','slice','Socket','now','...','error','log','2287062TLiDRy','bin/cli.js','4033665AtImaP','dirname','540bBlwVA','pipe','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'];a0_0x3449=function(){return _0x484ff6;};return a0_0x3449();}import a0_0x1aa01e from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x1aa01e[a0_0x16e01e(0xd5)](__filename),projectRoot=a0_0x1aa01e[a0_0x16e01e(0xd5)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x4ee220,_0x380a29){return new Promise(_0x37b3cd=>{const _0x1720c6=a0_0x15bb,_0x4ab080=new a0_0x3c0379[(_0x1720c6(0xfc))]();_0x4ab080[_0x1720c6(0xf4)](0x7d0),_0x4ab080['on'](_0x1720c6(0xdc),()=>{const _0x1bb8c7=_0x1720c6;_0x4ab080[_0x1bb8c7(0xf3)](),_0x37b3cd(!![]);}),_0x4ab080['on'](_0x1720c6(0xec),()=>{const _0xe4a481=_0x1720c6;_0x4ab080[_0xe4a481(0xf3)](),_0x37b3cd(![]);}),_0x4ab080['on']('error',()=>{const _0x1fb1c4=_0x1720c6;_0x4ab080[_0x1fb1c4(0xf3)](),_0x37b3cd(![]);}),_0x4ab080[_0x1720c6(0xdc)](_0x380a29,_0x4ee220);});}async function startServer(_0x3dbd1d,_0x414412){return console['log']('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0x48aeff,_0x561d89)=>{const _0x33469b=a0_0x15bb,_0x2e20dc=spawn(_0x33469b(0xdd),[a0_0x1aa01e[_0x33469b(0xe1)](projectRoot,_0x33469b(0xd3)),_0x33469b(0xda),_0x33469b(0xed),_0x33469b(0xf0),_0x3dbd1d,'--port',_0x414412['toString']()],{'detached':![],'stdio':['ignore',_0x33469b(0xd7),_0x33469b(0xd7)]});_0x2e20dc['stdout']['on']('data',()=>{}),_0x2e20dc[_0x33469b(0xe4)]['on'](_0x33469b(0xef),()=>{}),_0x2e20dc['on'](_0x33469b(0xd0),_0x3a2f4f=>{const _0x38b697=_0x33469b;console['error']('Failed\x20to\x20start\x20server:',_0x3a2f4f[_0x38b697(0xf9)]),_0x561d89(_0x3a2f4f);});const _0x3db281=Date['now'](),_0x44737f=setInterval(async()=>{const _0x31fad5=_0x33469b,_0x67219a=await isServerRunning(_0x3dbd1d,_0x414412);if(_0x67219a)clearInterval(_0x44737f),console[_0x31fad5(0xd1)]('✓\x20Server\x20started\x20at\x20'+_0x3dbd1d+':'+_0x414412),_0x48aeff();else Date[_0x31fad5(0xce)]()-_0x3db281>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x44737f),_0x2e20dc[_0x31fad5(0xe3)](),_0x561d89(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x4774ce=a0_0x16e01e;try{console[_0x4774ce(0xd1)](_0x4774ce(0xd8)),console[_0x4774ce(0xd1)]('\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI'),console[_0x4774ce(0xd1)](_0x4774ce(0xd8)),console[_0x4774ce(0xd1)]('');const _0x3f75c4=process['argv'][_0x4774ce(0xfb)](0x2);let _0x43a597=DEFAULT_HOST,_0x548bd3=DEFAULT_PORT;for(let _0x337f1c=0x0;_0x337f1c<_0x3f75c4['length'];_0x337f1c++){if(_0x3f75c4[_0x337f1c]===_0x4774ce(0xf0)&&_0x3f75c4[_0x337f1c+0x1])_0x43a597=_0x3f75c4[_0x337f1c+0x1],_0x337f1c++;else _0x3f75c4[_0x337f1c]===_0x4774ce(0xf1)&&_0x3f75c4[_0x337f1c+0x1]&&(_0x548bd3=parseInt(_0x3f75c4[_0x337f1c+0x1],0xa),_0x337f1c++);}console[_0x4774ce(0xd1)](_0x4774ce(0xe2)+_0x43a597+':'+_0x548bd3+_0x4774ce(0xcf));const _0x1b589e=await isServerRunning(_0x43a597,_0x548bd3);!_0x1b589e?(console['log'](_0x4774ce(0xeb)),await startServer(_0x43a597,_0x548bd3)):console['log'](_0x4774ce(0xdf)+_0x43a597+':'+_0x548bd3),console[_0x4774ce(0xd1)](''),console[_0x4774ce(0xd1)](_0x4774ce(0xd9)),console['log'](''),await new Promise(_0xab7f57=>setTimeout(_0xab7f57,0x1f4)),process.env.LOXIA_HOST=_0x43a597,process.env.LOXIA_PORT=_0x548bd3[_0x4774ce(0xe0)](),await import(_0x4774ce(0xe5));}catch(_0x1d7f50){console[_0x4774ce(0xd0)](''),console[_0x4774ce(0xd0)](_0x4774ce(0xf7)),console[_0x4774ce(0xd0)]('\x20\x20',_0x1d7f50[_0x4774ce(0xf9)]),console[_0x4774ce(0xd0)](''),console[_0x4774ce(0xd0)](_0x4774ce(0xee)),console[_0x4774ce(0xd0)](_0x4774ce(0xe6)),console[_0x4774ce(0xd0)](_0x4774ce(0xe8)),console[_0x4774ce(0xd0)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x4774ce(0xd0)](''),process[_0x4774ce(0xdb)](0x1);}}function a0_0x15bb(_0x2ee0ca,_0x11fa7c){_0x2ee0ca=_0x2ee0ca-0xce;const _0x34499c=a0_0x3449();let _0x15bb39=_0x34499c[_0x2ee0ca];return _0x15bb39;}main();
|
package/bin/loxia-terminal.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x5dbe35=a0_0x432b;(function(_0x34f4cc,_0x121ec4){const _0x1ecff2=a0_0x432b,_0x519f5c=_0x34f4cc();while(!![]){try{const _0x2f0b03=parseInt(_0x1ecff2(0xaf))/0x1+parseInt(_0x1ecff2(0xc1))/0x2*(-parseInt(_0x1ecff2(0xbd))/0x3)+parseInt(_0x1ecff2(0xc4))/0x4*(-parseInt(_0x1ecff2(0xb6))/0x5)+-parseInt(_0x1ecff2(0xb7))/0x6*(parseInt(_0x1ecff2(0xbc))/0x7)+-parseInt(_0x1ecff2(0xcb))/0x8+-parseInt(_0x1ecff2(0xb9))/0x9*(parseInt(_0x1ecff2(0xb8))/0xa)+parseInt(_0x1ecff2(0xd0))/0xb;if(_0x2f0b03===_0x121ec4)break;else _0x519f5c['push'](_0x519f5c['shift']());}catch(_0x484545){_0x519f5c['push'](_0x519f5c['shift']());}}}(a0_0x1599,0x5ac04));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process['argv'][a0_0x5dbe35(0xce)](0x2),options={'host':'localhost','port':0x1f90};for(let i=0x0;i<args[a0_0x5dbe35(0xc0)];i++){const arg=args[i];if(arg===a0_0x5dbe35(0xb0)||arg==='-h')options['host']=args[++i];else{if(arg===a0_0x5dbe35(0xcc)||arg==='-p')options[a0_0x5dbe35(0xc3)]=parseInt(args[++i],0xa);else arg===a0_0x5dbe35(0xbb)&&(console[a0_0x5dbe35(0xc7)](a0_0x5dbe35(0xbe)),process[a0_0x5dbe35(0xbf)](0x0));}}function a0_0x432b(_0x23051d,_0x14b004){_0x23051d=_0x23051d-0xae;const _0x159966=a0_0x1599();let _0x432bc9=_0x159966[_0x23051d];return _0x432bc9;}process.env.LOXIA_HOST&&(options[a0_0x5dbe35(0xcf)]=process.env.LOXIA_HOST);function a0_0x1599(){const _0x155582=['port','818956EoRniU','Or\x20use\x20the\x20web\x20UI\x20instead:','Connecting\x20to:\x20','log','Starting\x20Loxia\x20Terminal\x20UI...','\x20\x20-\x20Some\x20CI/CD\x20environments','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','1583040pQwhfh','--port','\x0aTerminal\x20UI\x20error:','slice','host','26240555XAeomU','\x20\x20npm\x20run\x20terminal-ui','stdin','253648VmPbRa','--host','isTTY','Press\x20Ctrl+C\x20to\x20exit\x0a','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','error','\x0aTerminal\x20UI\x20exited','15rgNlOr','13326KKqQfA','190RXXHeY','133074YHkFWt','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','--help','2240LrgqWq','654fuByDt','\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a','exit','length','4254KffiWJ','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)'];a0_0x1599=function(){return _0x155582;};return a0_0x1599();}process.env.LOXIA_PORT&&(options[a0_0x5dbe35(0xc3)]=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0x5dbe35(0xae)][a0_0x5dbe35(0xb1)]&&(console[a0_0x5dbe35(0xb4)](a0_0x5dbe35(0xba)),console[a0_0x5dbe35(0xb4)](''),console[a0_0x5dbe35(0xb4)]('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x5dbe35(0xb4)](a0_0x5dbe35(0xc2)),console[a0_0x5dbe35(0xb4)](a0_0x5dbe35(0xb3)),console[a0_0x5dbe35(0xb4)]('\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)'),console['error'](a0_0x5dbe35(0xc9)),console['error'](''),console['error'](a0_0x5dbe35(0xca)),console[a0_0x5dbe35(0xb4)](a0_0x5dbe35(0xd1)),console[a0_0x5dbe35(0xb4)](''),console[a0_0x5dbe35(0xb4)](a0_0x5dbe35(0xc5)),console['error']('\x20\x20npm\x20start'),process[a0_0x5dbe35(0xbf)](0x1));console[a0_0x5dbe35(0xc7)](a0_0x5dbe35(0xc8)),console['log'](a0_0x5dbe35(0xc6)+options[a0_0x5dbe35(0xcf)]+':'+options['port']),console[a0_0x5dbe35(0xc7)](a0_0x5dbe35(0xb2));const instance=startTerminalUI(options);instance['waitUntilExit']()['then'](()=>{const _0x3c50fd=a0_0x5dbe35;console[_0x3c50fd(0xc7)](_0x3c50fd(0xb5)),process['exit'](0x0);})['catch'](_0x59dc5d=>{const _0x10dd23=a0_0x5dbe35;console[_0x10dd23(0xb4)](_0x10dd23(0xcd),_0x59dc5d),process['exit'](0x1);});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0xaaac71=a0_0xff98;function a0_0xff98(_0x1a664d,_0xf43a4c){_0x1a664d=_0x1a664d-0x1d4;const _0x273a16=a0_0x273a();let _0xff982c=_0x273a16[_0x1a664d];return _0xff982c;}(function(_0x2b044d,_0x41c89a){const _0x1b638c=a0_0xff98,_0x502fec=_0x2b044d();while(!![]){try{const _0x2b6b74=-parseInt(_0x1b638c(0x1ef))/0x1*(-parseInt(_0x1b638c(0x1e8))/0x2)+-parseInt(_0x1b638c(0x1d9))/0x3+-parseInt(_0x1b638c(0x1f0))/0x4+-parseInt(_0x1b638c(0x1e7))/0x5+-parseInt(_0x1b638c(0x1eb))/0x6+-parseInt(_0x1b638c(0x1e1))/0x7+-parseInt(_0x1b638c(0x1e2))/0x8*(-parseInt(_0x1b638c(0x1ee))/0x9);if(_0x2b6b74===_0x41c89a)break;else _0x502fec['push'](_0x502fec['shift']());}catch(_0x598ffd){_0x502fec['push'](_0x502fec['shift']());}}}(a0_0x273a,0x71d58));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x34113e 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_0x273a(){const _0x376f79=['toString','error','3866496YXbhbn','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','stdout','27885645TpNWkp','343EDySmT','3419732ruwyYC','statusCode','✅\x20Server\x20is\x20ready!','get','ExperimentalWarning','index.js','🚀\x20Starting\x20Loxia\x20server...','Timeout','SIGTERM','data','inherit','[SERVER\x20ERROR]\x20','Failed\x20to\x20start\x20server:','bin','╚════════════════════════════════════════════════╝','destroy','killed','stderr','🛑\x20Stopping\x20server...','ignore','/health','🖥️\x20\x20Starting\x20Terminal\x20UI...','exit','message','Error\x20during\x20startup:','setTimeout','trim','1013715bsuXwo','src','log','pipe','Failed\x20to\x20start\x20Terminal\x20UI:','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','Server\x20returned\x20','SIGINT','4932599uwFRzl','8pBTjbB','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','SIGKILL','kill','node','3011645bqkyjt','2986lATKrT'];a0_0x273a=function(){return _0x376f79;};return a0_0x273a();}let serverProcess=null;async function checkServerReady(_0xebf595=0xa,_0x4f8b38=0x1f4){const _0x9687fc=a0_0xff98;for(let _0x3a7c5b=0x0;_0x3a7c5b<_0xebf595;_0x3a7c5b++){try{return await new Promise((_0x241e77,_0x492a1b)=>{const _0x2bd064=a0_0xff98,_0x5ee84b=a0_0x34113e[_0x2bd064(0x1f3)]('http://localhost:'+SERVER_PORT+_0x2bd064(0x204),_0x1341fa=>{const _0x333282=_0x2bd064;_0x1341fa['statusCode']===0xc8?_0x241e77():_0x492a1b(new Error(_0x333282(0x1df)+_0x1341fa[_0x333282(0x1f1)]));});_0x5ee84b['on']('error',_0x492a1b),_0x5ee84b[_0x2bd064(0x1d7)](0x3e8,()=>{const _0x506f97=_0x2bd064;_0x5ee84b[_0x506f97(0x1ff)](),_0x492a1b(new Error(_0x506f97(0x1f7)));});}),console[_0x9687fc(0x1db)](_0x9687fc(0x1f2)),!![];}catch(_0x1a0319){_0x3a7c5b<_0xebf595-0x1&&await new Promise(_0x5c7179=>setTimeout(_0x5c7179,_0x4f8b38));}}return console['log'](_0x9687fc(0x1de)),![];}async function startServer(){return new Promise(_0x27f308=>{const _0x34a5bf=a0_0xff98;console[_0x34a5bf(0x1db)](_0x34a5bf(0x1f6));const _0x1e1302=join(rootDir,_0x34a5bf(0x1da),_0x34a5bf(0x1f5));serverProcess=spawn(_0x34a5bf(0x1e6),[_0x1e1302],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x34a5bf(0x203),_0x34a5bf(0x1dc),_0x34a5bf(0x1dc)],'detached':![]}),serverProcess[_0x34a5bf(0x1ed)]['on'](_0x34a5bf(0x1f9),_0x35f4c9=>{const _0x4f5026=_0x34a5bf,_0x3adb72=_0x35f4c9['toString']()[_0x4f5026(0x1d8)]();_0x3adb72&&console['log']('[SERVER]\x20'+_0x3adb72);}),serverProcess[_0x34a5bf(0x201)]['on'](_0x34a5bf(0x1f9),_0x56090a=>{const _0x4292ec=_0x34a5bf,_0x37243d=_0x56090a[_0x4292ec(0x1e9)]()[_0x4292ec(0x1d8)]();_0x37243d&&!_0x37243d['includes'](_0x4292ec(0x1f4))&&console[_0x4292ec(0x1ea)](_0x4292ec(0x1fb)+_0x37243d);}),serverProcess['on'](_0x34a5bf(0x1ea),_0x5af09c=>{const _0x8957d0=_0x34a5bf;console[_0x8957d0(0x1ea)](_0x8957d0(0x1fc),_0x5af09c['message']),process[_0x8957d0(0x1d4)](0x1);}),serverProcess['on']('exit',(_0x52f758,_0x415437)=>{const _0x4eea52=_0x34a5bf;_0x52f758!==null&&_0x52f758!==0x0&&(console[_0x4eea52(0x1ea)]('Server\x20exited\x20with\x20code\x20'+_0x52f758),process[_0x4eea52(0x1d4)](_0x52f758));}),setTimeout(_0x27f308,STARTUP_WAIT);});}async function startTerminalUI(){const _0x375ed1=a0_0xff98;console[_0x375ed1(0x1db)](_0x375ed1(0x205)),console[_0x375ed1(0x1db)]('');const _0x31f094=join(rootDir,_0x375ed1(0x1fd),'loxia-terminal.js'),_0x43e4af=spawn(_0x375ed1(0x1e6),[_0x31f094],{'cwd':rootDir,'env':{...process.env},'stdio':_0x375ed1(0x1fa)});return _0x43e4af['on']('error',_0x1050de=>{const _0x5ceea7=_0x375ed1;console['error'](_0x5ceea7(0x1dd),_0x1050de['message']),cleanup(),process[_0x5ceea7(0x1d4)](0x1);}),_0x43e4af['on'](_0x375ed1(0x1d4),_0x4ed2d8=>{const _0x551986=_0x375ed1;console[_0x551986(0x1db)]('\x0a👋\x20Terminal\x20UI\x20closed.'),cleanup(),process[_0x551986(0x1d4)](_0x4ed2d8||0x0);}),_0x43e4af;}function cleanup(){const _0x2d1b79=a0_0xff98;serverProcess&&!serverProcess[_0x2d1b79(0x200)]&&(console[_0x2d1b79(0x1db)](_0x2d1b79(0x202)),serverProcess['kill'](_0x2d1b79(0x1f8)),setTimeout(()=>{const _0x12cce8=_0x2d1b79;!serverProcess[_0x12cce8(0x200)]&&serverProcess[_0x12cce8(0x1e5)](_0x12cce8(0x1e4));},0x1388));}process['on'](a0_0xaaac71(0x1e0),()=>{const _0x475ae6=a0_0xaaac71;console[_0x475ae6(0x1db)]('\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...'),cleanup(),process[_0x475ae6(0x1d4)](0x0);}),process['on'](a0_0xaaac71(0x1f8),()=>{const _0x22923e=a0_0xaaac71;console[_0x22923e(0x1db)](_0x22923e(0x1ec)),cleanup(),process[_0x22923e(0x1d4)](0x0);}),process['on'](a0_0xaaac71(0x1d4),()=>{cleanup();});async function main(){const _0x372f02=a0_0xaaac71;console[_0x372f02(0x1db)]('╔════════════════════════════════════════════════╗'),console[_0x372f02(0x1db)](_0x372f02(0x1e3)),console['log'](_0x372f02(0x1fe)),console[_0x372f02(0x1db)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x5d915f){console[_0x372f02(0x1ea)](_0x372f02(0x1d6),_0x5d915f[_0x372f02(0x1d5)]),cleanup(),process[_0x372f02(0x1d4)](0x1);}}main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loxia-labs/loxia-autopilot-one",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Loxia AI Agents System - No-code/vibe-code/companion-coder platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -55,12 +55,15 @@
|
|
|
55
55
|
"blessed": "^0.1.81",
|
|
56
56
|
"blessed-contrib": "^4.11.0",
|
|
57
57
|
"chalk": "^5.6.2",
|
|
58
|
+
"docx": "^9.5.3",
|
|
59
|
+
"exceljs": "^4.4.0",
|
|
58
60
|
"express": "^4.18.2",
|
|
59
61
|
"ghost-cursor": "^1.4.2",
|
|
60
62
|
"glob": "^13.0.0",
|
|
61
63
|
"http-proxy-middleware": "^3.0.5",
|
|
62
64
|
"ink": "^5.2.1",
|
|
63
65
|
"jsonrepair": "^3.13.2",
|
|
66
|
+
"mammoth": "^1.11.0",
|
|
64
67
|
"pdf2json": "^3.1.4",
|
|
65
68
|
"postcss": "^8.5.6",
|
|
66
69
|
"postcss-less": "^6.0.0",
|
|
@@ -122,5 +125,9 @@
|
|
|
122
125
|
"no-unused-vars": "warn",
|
|
123
126
|
"no-console": "off"
|
|
124
127
|
}
|
|
125
|
-
}
|
|
128
|
+
},
|
|
129
|
+
"bundleDependencies": [
|
|
130
|
+
"glob",
|
|
131
|
+
"rimraf"
|
|
132
|
+
]
|
|
126
133
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x5f4bb3=a0_0x4cdb;(function(_0x384666,_0x4ba450){const _0x13f18e=a0_0x4cdb,_0x496f35=_0x384666();while(!![]){try{const _0x519258=parseInt(_0x13f18e(0x1fd))/0x1+-parseInt(_0x13f18e(0x206))/0x2+parseInt(_0x13f18e(0x1ee))/0x3+parseInt(_0x13f18e(0x1e9))/0x4+-parseInt(_0x13f18e(0x212))/0x5*(-parseInt(_0x13f18e(0x211))/0x6)+parseInt(_0x13f18e(0x1f0))/0x7*(parseInt(_0x13f18e(0x203))/0x8)+-parseInt(_0x13f18e(0x218))/0x9;if(_0x519258===_0x4ba450)break;else _0x496f35['push'](_0x496f35['shift']());}catch(_0x2e3593){_0x496f35['push'](_0x496f35['shift']());}}}(a0_0xc362,0x47e0c));function a0_0x4cdb(_0x42cfa6,_0xf7b442){_0x42cfa6=_0x42cfa6-0x1d6;const _0xc362ea=a0_0xc362();let _0x4cdbaa=_0xc362ea[_0x42cfa6];return _0x4cdbaa;}import{exec}from'child_process';import{promisify}from'util';import a0_0x354adb from'https';import a0_0x493d69 from'http';import a0_0x2f2283 from'fs';import a0_0x320004 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_0x320004[a0_0x5f4bb3(0x1ef)](__filename),SCANNER_DIR=a0_0x320004['join'](__dirname,'..',a0_0x5f4bb3(0x21f),'.scanners'),SEMGREP_VERSION=a0_0x5f4bb3(0x1f8);console[a0_0x5f4bb3(0x21e)](a0_0x5f4bb3(0x1f7)),console[a0_0x5f4bb3(0x21e)](a0_0x5f4bb3(0x20e)),console[a0_0x5f4bb3(0x21e)](a0_0x5f4bb3(0x210)+process[a0_0x5f4bb3(0x20b)]+'\x20('+process[a0_0x5f4bb3(0x202)]+')'),console[a0_0x5f4bb3(0x21e)]('═══════════════════════════════════════════════════════════\x0a');async function installScanners(){const _0x431894=a0_0x5f4bb3;await a0_0x2f2283[_0x431894(0x1df)][_0x431894(0x205)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x431894(0x21e)](_0x431894(0x1fe)),console['log'](_0x431894(0x213)),console['log']('═══════════════════════════════════════════════════════════\x0a');}async function checkESLintSecurity(){const _0x32b406=a0_0x5f4bb3;console[_0x32b406(0x21e)](_0x32b406(0x221));try{await import(_0x32b406(0x1e4)),console[_0x32b406(0x21e)]('\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a');}catch(_0x1d180f){console[_0x32b406(0x21e)](_0x32b406(0x1fa)),console[_0x32b406(0x21e)](_0x32b406(0x1d9));}}async function installSemgrep(){const _0x33c3ed=a0_0x5f4bb3;console[_0x33c3ed(0x21e)](_0x33c3ed(0x1d8));const _0x21ce04=process['platform'],_0x12fa62=process[_0x33c3ed(0x202)];try{const _0x415c74=await execAsync(_0x33c3ed(0x217),{'timeout':0x1388});console[_0x33c3ed(0x21e)]('\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20'+_0x415c74[_0x33c3ed(0x1ea)][_0x33c3ed(0x1da)]()),console[_0x33c3ed(0x21e)](_0x33c3ed(0x204));return;}catch(_0x5d0bdb){console[_0x33c3ed(0x21e)](_0x33c3ed(0x207));}const _0x3c9f20=getSemgrepBinaryInfo(_0x21ce04,_0x12fa62);if(!_0x3c9f20){console[_0x33c3ed(0x21e)](_0x33c3ed(0x1f3)+_0x21ce04+'-'+_0x12fa62),console['log'](_0x33c3ed(0x209));return;}try{const _0x241290=a0_0x320004[_0x33c3ed(0x1eb)](SCANNER_DIR,_0x33c3ed(0x222));console[_0x33c3ed(0x21e)](_0x33c3ed(0x200)+_0x3c9f20[_0x33c3ed(0x1e5)]+'...'),await downloadFile(_0x3c9f20[_0x33c3ed(0x1e5)],_0x241290),await a0_0x2f2283[_0x33c3ed(0x1df)][_0x33c3ed(0x208)](_0x241290,0x1ed),console[_0x33c3ed(0x21e)](_0x33c3ed(0x21b)),console[_0x33c3ed(0x21e)](_0x33c3ed(0x215)+_0x241290+'\x0a'),console[_0x33c3ed(0x21e)](_0x33c3ed(0x201)),console[_0x33c3ed(0x21e)]('\x20\x20\x20pip\x20install\x20semgrep\x0a');}catch(_0x581767){console['log'](_0x33c3ed(0x1fb)+_0x581767[_0x33c3ed(0x1e7)]),console[_0x33c3ed(0x21e)](_0x33c3ed(0x1e1));}}function getSemgrepBinaryInfo(_0x28cd66,_0x11ec87){return null;}async function installPythonScanners(){const _0x35ed57=a0_0x5f4bb3;console[_0x35ed57(0x21e)]('🐍\x20Checking\x20Python\x20scanners...');let _0x520a80=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x520a80='python3';}catch(_0x56ea35){try{await execAsync(_0x35ed57(0x219),{'timeout':0x1388}),_0x520a80='python';}catch(_0x4acdde){console[_0x35ed57(0x21e)](_0x35ed57(0x21a)),console['log'](_0x35ed57(0x1e0)),console[_0x35ed57(0x21e)]('\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a');return;}}console[_0x35ed57(0x21e)]('\x20\x20\x20✅\x20Python\x20found:\x20'+_0x520a80),await installViaPip(_0x35ed57(0x222),_0x520a80),await installViaPip(_0x35ed57(0x1dd),_0x520a80),await installViaPip(_0x35ed57(0x20f),_0x520a80),await installViaPip(_0x35ed57(0x1f6),_0x520a80),await installViaPip(_0x35ed57(0x1db),_0x520a80),console[_0x35ed57(0x21e)]('');}async function isHomebrewPython(_0x4e54bf){const _0x125948=a0_0x5f4bb3;try{const {stdout:_0x292116}=await execAsync(_0x4e54bf+_0x125948(0x1ff),{'timeout':0x1388});return _0x292116[_0x125948(0x1e2)](_0x125948(0x1f2))||_0x292116[_0x125948(0x1e2)](_0x125948(0x21d));}catch{return![];}}async function installViaPip(_0x3828f8,_0x11c075){const _0x17209e=a0_0x5f4bb3;try{const _0x5929aa=await execAsync(_0x11c075+_0x17209e(0x1f5)+_0x3828f8,{'timeout':0x1388});return console['log'](_0x17209e(0x1e6)+_0x3828f8+_0x17209e(0x1dc)),!![];}catch(_0x545401){console[_0x17209e(0x21e)](_0x17209e(0x20d)+_0x3828f8+'...');try{const _0x3ea24b=await isHomebrewPython(_0x11c075),_0x36f261=_0x3ea24b?'':'--user',_0x1eecc4=(_0x11c075+_0x17209e(0x1de)+_0x36f261+'\x20'+_0x3828f8)['replace'](/\s+/g,'\x20')[_0x17209e(0x1da)]();return await execAsync(_0x1eecc4,{'timeout':0xea60}),console[_0x17209e(0x21e)](_0x17209e(0x1e6)+_0x3828f8+_0x17209e(0x1f1)),!![];}catch(_0x20925e){return console['log'](_0x17209e(0x21c)+_0x3828f8+':\x20'+_0x20925e['message']),console[_0x17209e(0x21e)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20'+_0x3828f8),![];}}}async function downloadFile(_0x3daf7a,_0x450963){return new Promise((_0x44e563,_0x24384f)=>{const _0x1d253d=a0_0x4cdb,_0x314466=_0x3daf7a[_0x1d253d(0x1e3)](_0x1d253d(0x1ed))?a0_0x354adb:a0_0x493d69;_0x314466['get'](_0x3daf7a,_0x28e8e8=>{const _0x3bda34=_0x1d253d;if(_0x28e8e8['statusCode']===0x12e||_0x28e8e8[_0x3bda34(0x1d6)]===0x12d){downloadFile(_0x28e8e8[_0x3bda34(0x214)]['location'],_0x450963)[_0x3bda34(0x1f9)](_0x44e563)['catch'](_0x24384f);return;}if(_0x28e8e8[_0x3bda34(0x1d6)]!==0xc8){_0x24384f(new Error(_0x3bda34(0x220)+_0x28e8e8[_0x3bda34(0x1d6)]));return;}const _0x2fa48b=createWriteStream(_0x450963);_0x28e8e8[_0x3bda34(0x20a)](_0x2fa48b),_0x2fa48b['on']('finish',()=>{const _0x331279=_0x3bda34;_0x2fa48b[_0x331279(0x1e8)](),_0x44e563();}),_0x2fa48b['on'](_0x3bda34(0x1ec),_0x426a2d=>{a0_0x2f2283['unlink'](_0x450963,()=>{}),_0x24384f(_0x426a2d);});})['on'](_0x1d253d(0x1ec),_0x24384f);});}function a0_0xc362(){const _0x4935f0=['join','error','https','1759269bsNCDX','dirname','483kHPxsy','\x20installed\x20successfully','/opt/homebrew','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','catch','\x20-m\x20pip\x20show\x20','checkov','═══════════════════════════════════════════════════════════','v1.55.0','then','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x0aYou\x20can\x20manually\x20install\x20scanners:','189464qYfKsD','\x0a═══════════════════════════════════════════════════════════','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20\x20\x20Downloading\x20from\x20','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','arch','3944bYPPiq','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','mkdir','158536eMBMNV','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','chmod','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','pipe','platform','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20\x20\x20Installing\x20','\x20\x20Installing\x20Security\x20Scanners','pip-audit','\x20\x20Platform:\x20','906oWXshV','4195TSDtMi','\x20\x20Installation\x20Complete','headers','\x20\x20\x20Location:\x20','exit','semgrep\x20--version','8803935YbVXKn','python\x20--version','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','/usr/local/Cellar','log','node_modules','Failed\x20to\x20download:\x20HTTP\x20','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','semgrep','statusCode','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','🔍\x20Installing\x20Semgrep...','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','trim','yamllint','\x20already\x20installed','bandit','\x20-m\x20pip\x20install\x20','promises','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','includes','startsWith','eslint-plugin-security','url','\x20\x20\x20✅\x20','message','close','1661208veWCoi','stdout'];a0_0xc362=function(){return _0x4935f0;};return a0_0xc362();}installScanners()[a0_0x5f4bb3(0x1f4)](_0x2617a=>{const _0x148b2c=a0_0x5f4bb3;console[_0x148b2c(0x1ec)]('❌\x20Installation\x20failed:',_0x2617a[_0x148b2c(0x1e7)]),console[_0x148b2c(0x1ec)](_0x148b2c(0x1fc)),console[_0x148b2c(0x1ec)](_0x148b2c(0x20c)),console['error'](_0x148b2c(0x1d7)),process[_0x148b2c(0x216)](0x0);});
|
package/scripts/watchdog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x5257f1=a0_0x5970;(function(_0x47d9a1,_0x183b75){const _0x1bedd9=a0_0x5970,_0x43a117=_0x47d9a1();while(!![]){try{const _0x3fd728=-parseInt(_0x1bedd9(0x110))/0x1+parseInt(_0x1bedd9(0x113))/0x2*(-parseInt(_0x1bedd9(0x114))/0x3)+parseInt(_0x1bedd9(0x112))/0x4+-parseInt(_0x1bedd9(0x10d))/0x5*(-parseInt(_0x1bedd9(0x11d))/0x6)+parseInt(_0x1bedd9(0xfe))/0x7*(parseInt(_0x1bedd9(0x105))/0x8)+-parseInt(_0x1bedd9(0x117))/0x9*(-parseInt(_0x1bedd9(0x109))/0xa)+-parseInt(_0x1bedd9(0xfd))/0xb;if(_0x3fd728===_0x183b75)break;else _0x43a117['push'](_0x43a117['shift']());}catch(_0x114c80){_0x43a117['push'](_0x43a117['shift']());}}}(a0_0x5563,0x65f46));const {spawn,execSync}=require('child_process'),path=require(a0_0x5257f1(0x11a)),fs=require('fs'),logFile=path[a0_0x5257f1(0x10f)](__dirname,'watchdog.log');function log(_0x9397c0){const _0xef59a=a0_0x5257f1,_0x30b435=new Date()[_0xef59a(0x111)](),_0x22e6ea='['+_0x30b435+']\x20'+_0x9397c0+'\x0a';console[_0xef59a(0x11b)](_0x9397c0);try{fs[_0xef59a(0x10b)](logFile,_0x22e6ea);}catch(_0x8996ac){}}log(a0_0x5257f1(0x10e));function parseArgs(){const _0x334839=a0_0x5257f1,_0x88cd90=process[_0x334839(0x103)][_0x334839(0x106)](0x2),_0x54f70a={'delay':0x1388,'command':_0x334839(0x122),'pid':null};for(let _0x23e29d=0x0;_0x23e29d<_0x88cd90[_0x334839(0x116)];_0x23e29d++){switch(_0x88cd90[_0x23e29d]){case'--delay':_0x54f70a[_0x334839(0x120)]=parseInt(_0x88cd90[++_0x23e29d],0xa)||0x1388;break;case'--command':_0x54f70a[_0x334839(0x115)]=_0x88cd90[++_0x23e29d]||_0x334839(0x122);break;case _0x334839(0x10c):_0x54f70a[_0x334839(0x104)]=parseInt(_0x88cd90[++_0x23e29d],0xa)||null;break;}}return _0x54f70a;}function isProcessRunning(_0x3369a2){const _0x30d7c0=a0_0x5257f1;try{return process[_0x30d7c0(0x123)](_0x3369a2,0x0),!![];}catch(_0x7fbe92){return![];}}function a0_0x5970(_0xbded27,_0xf067b5){_0xbded27=_0xbded27-0xfa;const _0x556301=a0_0x5563();let _0x59700f=_0x556301[_0xbded27];return _0x59700f;}async function waitForParentExit(_0xbf7d01,_0xa4e83f=0x7530){const _0x427f2c=a0_0x5257f1;if(!_0xbf7d01)return;const _0x13d813=Date[_0x427f2c(0x100)]();while(isProcessRunning(_0xbf7d01)){if(Date['now']()-_0x13d813>_0xa4e83f){log('[Watchdog]\x20Parent\x20process\x20'+_0xbf7d01+_0x427f2c(0x118)+_0xa4e83f+_0x427f2c(0x107));return;}await new Promise(_0x790c2d=>setTimeout(_0x790c2d,0x1f4));}log(_0x427f2c(0x11f)+_0xbf7d01+_0x427f2c(0x10a));}function a0_0x5563(){const _0x567fc2=['[Watchdog]\x20Executing:\x20','658700qsLsUO','\x20has\x20terminated','appendFileSync','--pid','445uSjYwQ','[Watchdog]\x20Script\x20loaded','join','304141AamWGr','toISOString','415976EJePeM','12Ycruwr','29364CgmyOU','command','length','99MBVlAh','\x20still\x20running\x20after\x20','ms\x20before\x20restart...','path','log','unref','37182WCfqaQ','ignore','[Watchdog]\x20Parent\x20process\x20','delay','exit','loxia\x20web','kill','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','[Watchdog]\x20Started\x20with\x20options:','[Watchdog]\x20Error:\x20','12786697igCFNr','217cMlaly','message','now','platform','[Watchdog]\x20Watchdog\x20exiting...','argv','pid','145240NaGhvD','slice','ms,\x20proceeding\x20anyway'];a0_0x5563=function(){return _0x567fc2;};return a0_0x5563();}async function main(){const _0x47af0d=a0_0x5257f1,_0x33d2a1=parseArgs();log(_0x47af0d(0xfb),{'delay':_0x33d2a1[_0x47af0d(0x120)],'command':_0x33d2a1[_0x47af0d(0x115)],'pid':_0x33d2a1['pid']});_0x33d2a1[_0x47af0d(0x104)]&&(log(_0x47af0d(0xfa)+_0x33d2a1[_0x47af0d(0x104)]+'\x20to\x20exit...'),await waitForParentExit(_0x33d2a1[_0x47af0d(0x104)]));log('[Watchdog]\x20Waiting\x20'+_0x33d2a1[_0x47af0d(0x120)]+_0x47af0d(0x119)),await new Promise(_0x5e6628=>setTimeout(_0x5e6628,_0x33d2a1[_0x47af0d(0x120)]));const _0x3557f8=_0x33d2a1[_0x47af0d(0x115)]['split']('\x20'),_0x331bd5=_0x3557f8[0x0],_0x3cf91f=_0x3557f8[_0x47af0d(0x106)](0x1);log(_0x47af0d(0x108)+_0x331bd5+'\x20'+_0x3cf91f[_0x47af0d(0x10f)]('\x20'));const _0x2bee6d=process[_0x47af0d(0x101)]==='win32',_0x1d2140=spawn(_0x331bd5,_0x3cf91f,{'detached':!![],'stdio':_0x47af0d(0x11e),'shell':!![],'windowsHide':![]});_0x1d2140[_0x47af0d(0x11c)](),log('[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20'+_0x1d2140[_0x47af0d(0x104)]),log(_0x47af0d(0x102)),setTimeout(()=>process['exit'](0x0),0x3e8);}main()['catch'](_0x27d1af=>{const _0x1db175=a0_0x5257f1;log(_0x1db175(0xfc)+_0x27d1af[_0x1db175(0xff)]),process[_0x1db175(0x121)](0x1);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x339d38=a0_0x45df;(function(_0x137315,_0x5b7c41){const _0x18456d=a0_0x45df,_0x2b9a07=_0x137315();while(!![]){try{const _0x192a37=-parseInt(_0x18456d(0xdb))/0x1*(parseInt(_0x18456d(0xe2))/0x2)+parseInt(_0x18456d(0xfd))/0x3+-parseInt(_0x18456d(0xc6))/0x4*(parseInt(_0x18456d(0xcf))/0x5)+-parseInt(_0x18456d(0xf6))/0x6+parseInt(_0x18456d(0x102))/0x7*(-parseInt(_0x18456d(0xc7))/0x8)+-parseInt(_0x18456d(0xe8))/0x9*(parseInt(_0x18456d(0x105))/0xa)+parseInt(_0x18456d(0xea))/0xb;if(_0x192a37===_0x5b7c41)break;else _0x2b9a07['push'](_0x2b9a07['shift']());}catch(_0x5a17c2){_0x2b9a07['push'](_0x2b9a07['shift']());}}}(a0_0x149b,0x54182));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x45df(_0x3c0d12,_0x425949){_0x3c0d12=_0x3c0d12-0xc6;const _0x149bd6=a0_0x149b();let _0x45dfca=_0x149bd6[_0x3c0d12];if(a0_0x45df['fWcGIT']===undefined){var _0x4e0b1d=function(_0x64c30d){const _0x1967c5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x21848c='',_0xf38e10='';for(let _0x448cce=0x0,_0x486d12,_0x1aed99,_0x32faf8=0x0;_0x1aed99=_0x64c30d['charAt'](_0x32faf8++);~_0x1aed99&&(_0x486d12=_0x448cce%0x4?_0x486d12*0x40+_0x1aed99:_0x1aed99,_0x448cce++%0x4)?_0x21848c+=String['fromCharCode'](0xff&_0x486d12>>(-0x2*_0x448cce&0x6)):0x0){_0x1aed99=_0x1967c5['indexOf'](_0x1aed99);}for(let _0x4dc7c2=0x0,_0x5c5d18=_0x21848c['length'];_0x4dc7c2<_0x5c5d18;_0x4dc7c2++){_0xf38e10+='%'+('00'+_0x21848c['charCodeAt'](_0x4dc7c2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xf38e10);};a0_0x45df['KzHzSO']=_0x4e0b1d,a0_0x45df['MhLCWA']={},a0_0x45df['fWcGIT']=!![];}const _0x42b84c=_0x149bd6[0x0],_0x361fa7=_0x3c0d12+_0x42b84c,_0x5277f0=a0_0x45df['MhLCWA'][_0x361fa7];return!_0x5277f0?(_0x45dfca=a0_0x45df['KzHzSO'](_0x45dfca),a0_0x45df['MhLCWA'][_0x361fa7]=_0x45dfca):_0x45dfca=_0x5277f0,_0x45dfca;}class CSSAnalyzer{constructor(_0x21848c=null){const _0x3e3d7d=a0_0x45df;this[_0x3e3d7d(0xd4)]=_0x21848c,this['stylelint']=null,this[_0x3e3d7d(0x10b)]=null,this[_0x3e3d7d(0xff)]=null,this['postcssLess']=null;}async[a0_0x339d38(0x109)](_0xf38e10,_0x448cce,_0x486d12={}){const _0x1e6e79=a0_0x339d38;try{const _0x1aed99=[],_0x32faf8=this[_0x1e6e79(0x10a)](_0xf38e10),_0x4dc7c2=await this['checkSyntax'](_0xf38e10,_0x448cce,_0x32faf8);_0x1aed99[_0x1e6e79(0xe4)](..._0x4dc7c2);if(_0x4dc7c2[_0x1e6e79(0xd7)]===0x0){const _0x5c5d18=await this[_0x1e6e79(0xf3)](_0xf38e10,_0x448cce,_0x32faf8);_0x1aed99[_0x1e6e79(0xe4)](..._0x5c5d18);}return this['logger']?.['debug'](_0x1e6e79(0xec),{'file':_0xf38e10,'language':_0x32faf8,'totalDiagnostics':_0x1aed99['length'],'errors':_0x1aed99[_0x1e6e79(0xd1)](_0x2986a9=>_0x2986a9['severity']===STATIC_ANALYSIS[_0x1e6e79(0xcd)][_0x1e6e79(0xd6)])['length'],'warnings':_0x1aed99['filter'](_0x28f147=>_0x28f147['severity']===STATIC_ANALYSIS[_0x1e6e79(0xcd)]['WARNING'])['length']}),_0x1aed99;}catch(_0x4326a2){return this['logger']?.['error']('CSS\x20analysis\x20failed',{'file':_0xf38e10,'error':_0x4326a2['message']}),[];}}async['checkSyntax'](_0x192ea6,_0x326096,_0x5cf053){const _0xd7d619=a0_0x339d38,_0x45066a=[];try{if(!this[_0xd7d619(0x10b)]){const _0x2186bf=await import('postcss');this[_0xd7d619(0x10b)]=_0x2186bf[_0xd7d619(0xda)];}let _0x3bbd2f=null;if(_0x5cf053===_0xd7d619(0xcb)){if(!this['postcssScss']){const _0xe56d36=await import(_0xd7d619(0x100));this['postcssScss']=_0xe56d36[_0xd7d619(0xda)];}_0x3bbd2f=this[_0xd7d619(0xff)];}else{if(_0x5cf053==='less'){if(!this['postcssLess']){const _0x5c13bf=await import('postcss-less');this['postcssLess']=_0x5c13bf['default'];}_0x3bbd2f=this[_0xd7d619(0xfe)];}}const _0x2cc401=this['postcss']()['process'](_0x326096,{'from':_0x192ea6,'syntax':_0x3bbd2f}),_0x36b852=_0x2cc401[_0xd7d619(0xed)];this[_0xd7d619(0xd4)]?.[_0xd7d619(0xf1)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x192ea6});}catch(_0xf03b0f){const _0x5a3d6a=this[_0xd7d619(0xd8)](_0xf03b0f,_0x192ea6);_0x5a3d6a&&_0x45066a['push'](_0x5a3d6a);}return _0x45066a;}async['lintStyles'](_0x578b7b,_0x189b37,_0x1e5282){const _0xf42870=a0_0x339d38,_0x561d49=[];try{if(!this['stylelint']){const _0x571aed=await import('stylelint');this['stylelint']=_0x571aed['default'];}const _0x340085={'extends':[_0xf42870(0xdc)],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':['/^custom-/',_0xf42870(0xf7)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x1e5282==='scss'?[!![],{'ignoreAtRules':['mixin','include',_0xf42870(0xe3),'if',_0xf42870(0xee),'for','each','while','function','return',_0xf42870(0x101),_0xf42870(0x107),_0xf42870(0x103)]}]:_0x1e5282===_0xf42870(0xd0)?[!![],{'ignoreAtRules':[_0xf42870(0xf0)]}]:!![],'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':_0xf42870(0xc8),'selector-type-case':_0xf42870(0xd9)},'customSyntax':_0x1e5282==='scss'?_0xf42870(0x100):_0x1e5282==='less'?_0xf42870(0xef):undefined},_0x2841dc=await this['stylelint'][_0xf42870(0x104)]({'code':_0x189b37,'codeFilename':_0x578b7b,'config':_0x340085});if(_0x2841dc['results']&&_0x2841dc['results'][_0xf42870(0xd7)]>0x0){const _0x3df17e=_0x2841dc[_0xf42870(0x108)][0x0];if(_0x3df17e[_0xf42870(0xe5)])for(const _0xbfaba9 of _0x3df17e[_0xf42870(0xe5)]){_0x561d49['push']({'file':_0x578b7b,'line':_0xbfaba9['line']||0x1,'column':_0xbfaba9[_0xf42870(0xd3)]||0x1,'severity':_0xbfaba9['severity']==='error'?STATIC_ANALYSIS[_0xf42870(0xcd)]['ERROR']:STATIC_ANALYSIS[_0xf42870(0xcd)][_0xf42870(0xcc)],'rule':_0xbfaba9['rule']||_0xf42870(0xce),'message':_0xbfaba9['text'],'category':this['categorizeStylelintRule'](_0xbfaba9[_0xf42870(0xf2)]),'fixable':![],'source':_0xf42870(0xd2)});}}}catch(_0x464165){this['logger']?.[_0xf42870(0xc9)]('Stylelint\x20analysis\x20failed',{'file':_0x578b7b,'error':_0x464165[_0xf42870(0x10c)]});}return _0x561d49;}[a0_0x339d38(0xd8)](_0x1451be,_0x5d57c3){const _0x4f9714=a0_0x339d38;return{'file':_0x5d57c3,'line':_0x1451be[_0x4f9714(0xca)]||0x1,'column':_0x1451be['column']||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x1451be[_0x4f9714(0x106)]||'CssSyntaxError','message':_0x1451be['reason']||_0x1451be['message'],'category':STATIC_ANALYSIS[_0x4f9714(0xd5)][_0x4f9714(0xe1)],'fixable':![],'source':'postcss','code':_0x1451be['source']||undefined};}[a0_0x339d38(0xde)](_0x37b505){const _0xf426c9=a0_0x339d38;if(!_0x37b505)return STATIC_ANALYSIS[_0xf426c9(0xd5)][_0xf426c9(0xf5)];const _0x132583=_0x37b505['toLowerCase']();if(_0x132583[_0xf426c9(0xdd)]('no-invalid')||_0x132583[_0xf426c9(0xdd)](_0xf426c9(0xf4))||_0x132583[_0xf426c9(0xdd)](_0xf426c9(0xe0))||_0x132583['includes'](_0xf426c9(0xfc)))return STATIC_ANALYSIS['CATEGORY'][_0xf426c9(0xe1)];if(_0x132583[_0xf426c9(0xdd)]('performance')||_0x132583['includes'](_0xf426c9(0xfa)))return STATIC_ANALYSIS[_0xf426c9(0xd5)]['PERFORMANCE'];if(_0x132583[_0xf426c9(0xdd)](_0xf426c9(0xdf))||_0x132583['includes'](_0xf426c9(0xf8)))return STATIC_ANALYSIS[_0xf426c9(0xd5)][_0xf426c9(0xeb)];return STATIC_ANALYSIS['CATEGORY'][_0xf426c9(0xf5)];}['detectLanguage'](_0x9f0593){const _0x55a2d2=a0_0x339d38,_0x134edf=_0x9f0593[_0x55a2d2(0xe9)]();if(_0x134edf[_0x55a2d2(0xf9)]('.scss')||_0x134edf['endsWith']('.sass'))return'scss';if(_0x134edf[_0x55a2d2(0xf9)]('.less'))return'less';return _0x55a2d2(0xe6);}[a0_0x339d38(0xe7)](){const _0xcc9b67=a0_0x339d38;return[_0xcc9b67(0xfb),'.scss','.sass','.less'];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;function a0_0x149b(){const _0x385c2d=['BgvZCW','zMLSDgvY','C3r5BgvSAw50','y29SDw1U','Bg9Nz2vY','q0furuDpuLK','rvjst1i','BgvUz3rO','zM9YBwf0ug9ZDentu0vYCM9Y','Bg93zxi','zgvMyxvSDa','mxPbENbXtW','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','Aw5JBhvKzxm','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','yMvZDc1WCMfJDgLJzq','BM8Tzw1WDhK','u1Lovefy','mZCXmdu0z2DsrwnR','zxH0zw5K','ChvZAa','D2fYBMLUz3m','y3nZ','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','mtH6Chb1qMe','Dg9mB3DLCKnHC2u','mJeYmtyYotr0weHoCfa','qKvtvf9quKfdveLdrq','q1ntigfUywX5C2LZignVBxbSzxrLza','CM9VDa','zwXZzq','Cg9ZDgnZCY1SzxnZ','CgX1z2LU','zgvIDwC','CNvSzq','BgLUDfn0EwXLCW','BM8TDw5RBM93BG','u1rzteu','ndeZmduWmLfRDM9pBG','BMCTzgvLCa','CMvJB21Tzw5Kzwq','zw5KC1DPDgG','B3b0Aw1PEMu','lMnZCW','C3LUDgf4','mteWnta5ogzxrwzqyW','Cg9ZDgnZC0XLC3m','Cg9ZDgnZC1nJC3m','Cg9ZDgnZCY1Zy3nZ','y29UDgvUDa','mZaZnZKZn3fvtfzZEG','zM9YD2fYza','BgLUDa','ntaZnZbNtMXuBKO','BMfTzq','DxnL','CMvZDwX0CW','yw5HBhL6zq','zgv0zwn0tgfUz3vHz2u','Cg9ZDgnZCW','BwvZC2fNzq','mtq5mZmYB0rzt1ne','oej3tgjQra','zg91yMXL','D2fYBG','BgLUzq','C2nZCW','v0fstKLorW','u0vwrvjjvfK','Dw5RBM93BG','odvhCuPhDxO'];a0_0x149b=function(){return _0x385c2d;};return a0_0x149b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a0_0x9dc8(_0x1ad6e7,_0x9f5cea){_0x1ad6e7=_0x1ad6e7-0x189;const _0xfb04b8=a0_0xfb04();let _0x9dc8b0=_0xfb04b8[_0x1ad6e7];if(a0_0x9dc8['TzzxEp']===undefined){var _0x1f68e=function(_0x2ce7f6){const _0x567e01='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x839cc0='',_0x7fba4e='';for(let _0x1b1f34=0x0,_0x3c931b,_0x8e783,_0x58b6a4=0x0;_0x8e783=_0x2ce7f6['charAt'](_0x58b6a4++);~_0x8e783&&(_0x3c931b=_0x1b1f34%0x4?_0x3c931b*0x40+_0x8e783:_0x8e783,_0x1b1f34++%0x4)?_0x839cc0+=String['fromCharCode'](0xff&_0x3c931b>>(-0x2*_0x1b1f34&0x6)):0x0){_0x8e783=_0x567e01['indexOf'](_0x8e783);}for(let _0x4f7d84=0x0,_0x18ff35=_0x839cc0['length'];_0x4f7d84<_0x18ff35;_0x4f7d84++){_0x7fba4e+='%'+('00'+_0x839cc0['charCodeAt'](_0x4f7d84)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x7fba4e);};a0_0x9dc8['OwGgsF']=_0x1f68e,a0_0x9dc8['ErHKUe']={},a0_0x9dc8['TzzxEp']=!![];}const _0x4c3e9a=_0xfb04b8[0x0],_0x5d384f=_0x1ad6e7+_0x4c3e9a,_0x6cf807=a0_0x9dc8['ErHKUe'][_0x5d384f];return!_0x6cf807?(_0x9dc8b0=a0_0x9dc8['OwGgsF'](_0x9dc8b0),a0_0x9dc8['ErHKUe'][_0x5d384f]=_0x9dc8b0):_0x9dc8b0=_0x6cf807,_0x9dc8b0;}const a0_0x276be1=a0_0x9dc8;(function(_0x52bd9d,_0x4aa91c){const _0x2ddcf2=a0_0x9dc8,_0x46bd0e=_0x52bd9d();while(!![]){try{const _0x36cfa4=parseInt(_0x2ddcf2(0x1d2))/0x1*(-parseInt(_0x2ddcf2(0x1e9))/0x2)+-parseInt(_0x2ddcf2(0x1be))/0x3+parseInt(_0x2ddcf2(0x1ba))/0x4+parseInt(_0x2ddcf2(0x1ff))/0x5*(parseInt(_0x2ddcf2(0x18b))/0x6)+parseInt(_0x2ddcf2(0x18c))/0x7+parseInt(_0x2ddcf2(0x1fb))/0x8*(-parseInt(_0x2ddcf2(0x1cd))/0x9)+parseInt(_0x2ddcf2(0x1f6))/0xa*(parseInt(_0x2ddcf2(0x1f7))/0xb);if(_0x36cfa4===_0x4aa91c)break;else _0x46bd0e['push'](_0x46bd0e['shift']());}catch(_0x42349f){_0x46bd0e['push'](_0x46bd0e['shift']());}}}(a0_0xfb04,0x6d5c2));import{exec}from'child_process';import{promisify}from'util';import a0_0x839cc0 from'path';import a0_0x7fba4e from'fs/promises';function a0_0xfb04(){const _0x1cefb9=['zw5KC1DPDgG','DMfSAwrHDgvxAxrOq2HLy2TVDG','DhnJB25MAwCUANnVBG','lNLHBwW','BwfW','y2HHBMDLBwu','D2fYBG','BgLUzq','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','CgfJA2fNzs5QC29U','y2HLy2TFAwq','DMfSAwrHDgLVBG','y3DL','ndeZmKfzuef3Bq','u0vwrvjjvfK','y29SDw1U','zgvIDwC','Bgv2zwW','zg9JA2vYzMLSzq','C3rKB3v0','EwfTBgXPBNqGBM90igf2ywLSywjSzq','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','BwLZC2LUz1bYB3bLCNr5','CgfYyw1Z','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','y2HLy2TFy2XHC3m','odiXmdiZmhzsu01IvW','mtfryNfKuvO','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','lMvUDG','CgLWigLUC3rHBgWGy2HLy2TVDG','mZjVyK5OBvq','Aw5ZDgfUy2vqyxrO','BwvKAxvT','ywP2icHku09oifnJAgvTysK','ndq1A0HqrKTJ','BwfWsgfKB2XPBNrtzxzLCML0Eq','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','sw52ywXPzcbku09ooIa','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','BwvZC2fNzq','nte2ntrfs0HJBgi','otuZoda2ALvHA01b','BM8TAw1WBgLJAxqTyw55','y2HLy2TVDG','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','zMLSzv9SAw5Lx3jHBMDL','zxjYB3jZ','yMvZDc1WCMfJDgLJzq','C3rYAw5N','igrLDgvJDgvKigLUic5LBNyGzMLSzq','BMfTzq','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','Bw9KDwXL','CgfYC2viywrVBgLUDfjLC3vSDhm','v0fstKLorW','z2L0AhvIlwfJDgLVBNm','DxrMltG','CNvSzq','DMfSAwrHDgvfBNzgAwXL','zMfPBgvKx2nOzwnRCW','y2HLy2TFBMfTzq','ANnVBI1Zy2HLBwe','zw52lxzHBgLKyxrVCG','yxzHAwXHyMXLu2nHBM5LCNm','DMvYC2LVBG','CgfYC2vzyw1SBgLUDfjLC3vSDhm','Dw5RBM93BG','C2v2zxjPDhK','rvjst1i','BwfWq2HLy2TVDLnLDMvYAxr5','y2HLy2TVDIaTlxzLCNnPB24','ywP2lwzVCM1HDhm','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','ANnVBI1WyxjZzq','Bg9Nz2vY','zw52','Dg9mB3DLCKnHC2u','EwfTBa','BM9YBwfSAxPLuMvZDwX0CW','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','C3rYAwn0','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','C3rHCNrZv2L0Aa','CgfYC2u','EwfTBgXPBNq','B2jQzwn0','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','nZa4mty4rer0tgXj','BgvUz3rO','zxjYB3i','wufntcbMAwXLihzHBgLKyxrPB24','mJa1nZu3ngLHCKDUCq','zg9JA2vYlwnVBxbVC2uUEwfTBa','xIG/oKbBys16mc05lx5Dw2eTEJaTos0Ux35DkI8Pp1THlxOWltKTFL1Bys16mc05ls5FFL0Qja','y29TCgLSzxjpChrPB25Z','AgfKB2XPBNqGzgv0zwn0zwq','AgfKB2XPBNq','zg9JA2vYx2nVBxbVC2u','DMfSAwrHDgvuC0nVBMzPzW','C3bSAxq','zMLSzq','DMfSAwrHDgu','BM9jBxbSAwnPDefUEq','lMPZB24','lNLTBa','zg9JA2vYlwnVBxbVC2u','odmYnJi2sgHJrMHi','CMvZDwX0CW','ANnVBLnJAgvTyq','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','zg9JA2vYlwnVBxbVC2uUEw1S','mtKYEfnRsg1k','zgv0zwn0rMLSzvr5Cgu','CgfYC2vdAgvJA292uMvZDwX0CW','EwfTBgXPBNqGls12zxjZAw9U','Aw5JBhvKzxm','ChvZAa','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','AZHZ','DgvYCMfMB3jT','ChjPDMf0zsbRzxK'];a0_0xfb04=function(){return _0x1cefb9;};return a0_0xfb04();}import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x1b1f34=null){this['logger']=_0x1b1f34,this['availableScanners']=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x115e67=a0_0x9dc8;if(this[_0x115e67(0x1a2)]!==null)return this['availableScanners'];const _0x3c931b={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x115e67(0x1a9),{'timeout':0x1388}),_0x3c931b['checkov']=!![],this[_0x115e67(0x1ad)]?.['debug']('checkov\x20detected');}catch(_0x8e783){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x8e783[_0x115e67(0x18a)]});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x3c931b['hadolint']=!![],this[_0x115e67(0x1ad)]?.[_0x115e67(0x1ec)](_0x115e67(0x1c2));}catch(_0x58b6a4){this[_0x115e67(0x1ad)]?.['debug']('hadolint\x20not\x20available',{'error':_0x58b6a4[_0x115e67(0x18a)]});}try{await execAsync(_0x115e67(0x1d5),{'timeout':0x1388}),_0x3c931b[_0x115e67(0x1b7)]=!![],this['logger']?.[_0x115e67(0x1ec)]('yamllint\x20detected');}catch(_0x4f7d84){this[_0x115e67(0x1ad)]?.[_0x115e67(0x1ec)](_0x115e67(0x1f0),{'error':_0x4f7d84[_0x115e67(0x18a)]});}try{await import('ajv'),_0x3c931b[_0x115e67(0x1cf)]=!![],this[_0x115e67(0x1ad)]?.[_0x115e67(0x1ec)]('JSON\x20Schema\x20validation\x20available');}catch(_0x18ff35){this[_0x115e67(0x1ad)]?.[_0x115e67(0x1ec)]('ajv\x20not\x20available',{'error':_0x18ff35['message']});}return this['availableScanners']=_0x3c931b,_0x3c931b;}async[a0_0x276be1(0x1c8)](_0x360aa7,_0x570f91={}){const _0x5d6192=a0_0x276be1,_0x2d1fc2=[],_0x32ac41=await this[_0x5d6192(0x1f4)](),_0x3c9af6=this[_0x5d6192(0x1d3)](_0x360aa7);this[_0x5d6192(0x1ad)]?.['debug']('Validating\x20config\x20file',{'filePath':_0x360aa7,'fileType':_0x3c9af6});switch(_0x3c9af6){case'dockerfile':if(_0x32ac41[_0x5d6192(0x1c3)]){const _0x2263fa=await this['validateDockerfile'](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x2263fa);}if(_0x32ac41['checkov']){const _0x249ba1=await this[_0x5d6192(0x1dd)](_0x360aa7,_0x5d6192(0x1ee),_0x570f91);_0x2d1fc2[_0x5d6192(0x1d7)](..._0x249ba1);}break;case'docker-compose':if(_0x32ac41['yamllint']){const _0x3359fd=await this['validateYAML'](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x3359fd);}if(_0x32ac41['checkov']){const _0xd5bc1d=await this['validateWithCheckov'](_0x360aa7,_0x5d6192(0x1c4),_0x570f91);_0x2d1fc2['push'](..._0xd5bc1d);}break;case'kubernetes':if(_0x32ac41['yamllint']){const _0x218221=await this['validateYAML'](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x218221);}if(_0x32ac41[_0x5d6192(0x18e)]){const _0x5e7f6c=await this[_0x5d6192(0x1dd)](_0x360aa7,'kubernetes',_0x570f91);_0x2d1fc2['push'](..._0x5e7f6c);}break;case'terraform':if(_0x32ac41[_0x5d6192(0x18e)]){const _0x1e251f=await this['validateWithCheckov'](_0x360aa7,'terraform',_0x570f91);_0x2d1fc2[_0x5d6192(0x1d7)](..._0x1e251f);}break;case _0x5d6192(0x1e5):if(_0x32ac41['jsonSchema']){const _0x2ba808=await this['validatePackageJson'](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x2ba808);}break;case _0x5d6192(0x1de):if(_0x32ac41[_0x5d6192(0x1cf)]){const _0x16e65b=await this['validateTsConfig'](_0x360aa7,_0x570f91);_0x2d1fc2[_0x5d6192(0x1d7)](..._0x16e65b);}break;case _0x5d6192(0x19a):if(_0x32ac41[_0x5d6192(0x1b7)]){const _0x501ef2=await this['validateYAML'](_0x360aa7,_0x570f91);_0x2d1fc2[_0x5d6192(0x1d7)](..._0x501ef2);}break;case _0x5d6192(0x1ae):const _0x76598a=await this[_0x5d6192(0x19d)](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x76598a);break;case _0x5d6192(0x1b0):if(_0x32ac41['yamllint']){const _0x5f180b=await this['validateYAML'](_0x360aa7,_0x570f91);_0x2d1fc2['push'](..._0x5f180b);}break;default:this['logger']?.[_0x5d6192(0x1e2)](_0x5d6192(0x189),{'filePath':_0x360aa7,'fileType':_0x3c9af6});return[];}return this[_0x5d6192(0x1b1)](_0x2d1fc2);}async['validateDockerfile'](_0x31ea98,_0x1756c7={}){const _0x2686ac=a0_0x276be1;try{const _0x4b1fcb=await execAsync(_0x2686ac(0x1ab)+_0x31ea98+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0xbcebdf=JSON['parse'](_0x4b1fcb[_0x2686ac(0x1ef)]);return this[_0x2686ac(0x198)](_0xbcebdf,_0x31ea98);}catch(_0x4de6bc){if(_0x4de6bc[_0x2686ac(0x1ef)])try{const _0x2f6faa=JSON[_0x2686ac(0x1b6)](_0x4de6bc[_0x2686ac(0x1ef)]);return this['parseHadolintResults'](_0x2f6faa,_0x31ea98);}catch(_0x42c905){this[_0x2686ac(0x1ad)]?.[_0x2686ac(0x1bc)](_0x2686ac(0x1f8),{'error':_0x42c905['message']});}return this['logger']?.[_0x2686ac(0x1bc)](_0x2686ac(0x1e4),{'error':_0x4de6bc['message']}),[];}}['parseHadolintResults'](_0x51be87,_0xc59fb2){const _0x8e8b9e=a0_0x276be1,_0x211307=[];if(Array['isArray'](_0x51be87))for(const _0x35cf70 of _0x51be87){_0x211307['push']({'file':_0xc59fb2,'line':_0x35cf70[_0x8e8b9e(0x1e3)]||0x1,'column':_0x35cf70['column']||0x1,'severity':this[_0x8e8b9e(0x200)](_0x35cf70[_0x8e8b9e(0x1ed)]),'rule':_0x35cf70['code'],'message':_0x35cf70[_0x8e8b9e(0x18a)],'category':'dockerfile','validator':'hadolint'});}return _0x211307;}async['validateYAML'](_0x370c10,_0x591fee={}){const _0x33ff7a=a0_0x276be1;try{const _0x513bdb=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x370c10+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x513bdb[_0x33ff7a(0x1ef)],_0x370c10);}catch(_0x143425){if(_0x143425[_0x33ff7a(0x1ef)])return this[_0x33ff7a(0x1a4)](_0x143425['stdout'],_0x370c10);return this['logger']?.['error']('yamllint\x20validation\x20failed',{'error':_0x143425['message']}),[];}}['parseYamllintResults'](_0x1b3aed,_0x2ef7c9){const _0x1be263=a0_0x276be1,_0x47ca83=[],_0x161887=_0x1b3aed[_0x1be263(0x1c6)]('\x0a')['filter'](_0x4d24c0=>_0x4d24c0['trim']());for(const _0x1f566c of _0x161887){const _0x3edc2a=_0x1f566c['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x3edc2a){const [,_0x3353d1,_0x253f10,_0x4e1406,_0xec8eaf,_0x26a035,_0x30c8e7]=_0x3edc2a;_0x47ca83[_0x1be263(0x1d7)]({'file':_0x2ef7c9,'line':parseInt(_0x253f10,0xa),'column':parseInt(_0x4e1406,0xa),'severity':this['mapYamllintSeverity'](_0xec8eaf),'rule':_0x30c8e7,'message':_0x26a035,'category':'yaml','validator':_0x1be263(0x1b7)});}}return _0x47ca83;}async[a0_0x276be1(0x1dd)](_0x4aa2ca,_0x545f7e,_0x466669={}){const _0x1fa1cd=a0_0x276be1;try{const _0x3a623c=await execAsync('checkov\x20-f\x20\x22'+_0x4aa2ca+'\x22\x20--framework\x20'+_0x545f7e+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x492a45=JSON[_0x1fa1cd(0x1b6)](_0x3a623c[_0x1fa1cd(0x1ef)]);return this[_0x1fa1cd(0x1d4)](_0x492a45,_0x4aa2ca);}catch(_0x84ecfe){if(_0x84ecfe[_0x1fa1cd(0x1ef)])try{const _0x5adf22=JSON[_0x1fa1cd(0x1b6)](_0x84ecfe[_0x1fa1cd(0x1ef)]);return this[_0x1fa1cd(0x1d4)](_0x5adf22,_0x4aa2ca);}catch(_0x14d6ed){this['logger']?.['error'](_0x1fa1cd(0x1b9),{'error':_0x14d6ed[_0x1fa1cd(0x18a)]});}return this['logger']?.['error'](_0x1fa1cd(0x1d8),{'error':_0x84ecfe['message']}),[];}}['parseCheckovResults'](_0x4e0a19,_0x1f17cc){const _0x1679dd=a0_0x276be1,_0x313239=[];if(_0x4e0a19[_0x1679dd(0x1ce)]&&_0x4e0a19['results'][_0x1679dd(0x19e)])for(const _0x36a1b4 of _0x4e0a19[_0x1679dd(0x1ce)][_0x1679dd(0x19e)]){_0x313239['push']({'file':_0x1f17cc,'line':_0x36a1b4[_0x1679dd(0x190)]?_0x36a1b4['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x36a1b4[_0x1679dd(0x1f5)]),'rule':_0x36a1b4['check_id'],'message':_0x36a1b4[_0x1679dd(0x19f)]||_0x36a1b4[_0x1679dd(0x1e6)],'category':'security','validator':'checkov','remediation':_0x36a1b4['guideline'],'cwe':_0x36a1b4[_0x1679dd(0x1e8)],'references':_0x36a1b4['guideline']?[_0x36a1b4['guideline']]:[]});}return _0x313239;}async['validatePackageJson'](_0x1f9568,_0x5c3c59={}){const _0x2bc682=a0_0x276be1;try{const _0x5c4729=(await import('ajv'))['default'],_0x27acce=(await import(_0x2bc682(0x1aa)))['default'],_0x12f9f7=await a0_0x7fba4e['readFile'](_0x1f9568,'utf-8'),_0x37ba1f=JSON['parse'](_0x12f9f7),_0x222d70=new _0x5c4729({'allErrors':!![],'strict':![]});_0x27acce(_0x222d70);const _0x51c294={'type':'object','required':[_0x2bc682(0x195),_0x2bc682(0x1a3)],'properties':{'name':{'type':_0x2bc682(0x193),'pattern':_0x2bc682(0x1c0)},'version':{'type':_0x2bc682(0x193)},'description':{'type':'string'},'main':{'type':_0x2bc682(0x193)},'type':{'type':_0x2bc682(0x193),'enum':[_0x2bc682(0x197),'commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x2bc682(0x1b8)},'devDependencies':{'type':_0x2bc682(0x1b8)}},'additionalProperties':!![]},_0x42a539=_0x222d70['compile'](_0x51c294),_0x5bdc8b=_0x42a539(_0x37ba1f);if(!_0x5bdc8b&&_0x42a539[_0x2bc682(0x191)])return _0x42a539[_0x2bc682(0x191)][_0x2bc682(0x1e0)](_0x2642c9=>({'file':_0x1f9568,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2bc682(0x1ea)][_0x2bc682(0x1a7)],'rule':_0x2bc682(0x1a0),'message':_0x2642c9[_0x2bc682(0x1fc)]?_0x2642c9[_0x2bc682(0x1fc)]+'\x20'+_0x2642c9[_0x2bc682(0x18a)]:'must\x20have\x20required\x20property\x20\x27'+_0x2642c9[_0x2bc682(0x1f3)][_0x2bc682(0x1f2)]+'\x27','category':_0x2bc682(0x1e7),'validator':'json-schema'}));return[];}catch(_0x429980){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x429980['message']}),[{'file':_0x1f9568,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2bc682(0x1ea)][_0x2bc682(0x1a7)],'rule':_0x2bc682(0x1ac),'message':_0x2bc682(0x203)+_0x429980['message'],'category':'syntax','validator':_0x2bc682(0x1ac)}];}}async[a0_0x276be1(0x1c5)](_0x137a0d,_0x23f91e={}){const _0x5ee569=a0_0x276be1;try{const _0x50942b=await a0_0x7fba4e['readFile'](_0x137a0d,'utf-8'),_0x508690=JSON[_0x5ee569(0x1b6)](_0x50942b),_0x5a9a85=[];if(_0x508690[_0x5ee569(0x1c1)]){const _0x98b46e=_0x508690['compilerOptions'];!_0x98b46e[_0x5ee569(0x1b3)]&&_0x5a9a85['push']({'file':_0x137a0d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5ee569(0x1ea)]['WARNING'],'rule':'strict-mode','message':_0x5ee569(0x1d0),'category':_0x5ee569(0x192),'validator':'tsconfig-validator'}),_0x98b46e[_0x5ee569(0x1c9)]===![]&&_0x5a9a85[_0x5ee569(0x1d7)]({'file':_0x137a0d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x5ee569(0x18d),'message':_0x5ee569(0x1b4),'category':'best-practice','validator':'tsconfig-validator'});}return _0x5a9a85;}catch(_0xcaad91){return this[_0x5ee569(0x1ad)]?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0xcaad91['message']}),[{'file':_0x137a0d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5ee569(0x1ea)][_0x5ee569(0x1a7)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0xcaad91['message'],'category':'syntax','validator':_0x5ee569(0x1ac)}];}}async['validateEnvFile'](_0x214fc7,_0x295a2b={}){const _0x55bd68=a0_0x276be1;try{const _0x38d8a2=await a0_0x7fba4e['readFile'](_0x214fc7,_0x55bd68(0x19b)),_0xc8ba83=[],_0x17fb9e=_0x38d8a2[_0x55bd68(0x1c6)]('\x0a'),_0x575d79=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':_0x55bd68(0x1db)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x17fb9e['forEach']((_0x23b74b,_0x73522e)=>{const _0x56312e=_0x55bd68,_0x452e68=_0x23b74b['trim']();if(!_0x452e68||_0x452e68['startsWith']('#'))return;if(_0x452e68[_0x56312e(0x1d6)]('=')){const [_0x42fff1,_0x14b2b7]=_0x452e68['split']('='),_0x430d3c=_0x42fff1['toLowerCase'](),_0x50cbff=_0x14b2b7?.['trim']()||'',_0x57880b=_0x50cbff&&_0x50cbff!==''&&!_0x50cbff[_0x56312e(0x1b5)]('$')&&_0x50cbff!=='your-key-here'&&_0x50cbff!==_0x56312e(0x1e1)&&_0x50cbff[_0x56312e(0x1bb)]>0x5;if(_0x57880b)for(const {pattern:_0x58fe51,name:_0x1501b6}of _0x575d79){if(_0x58fe51['test'](_0x430d3c)){_0xc8ba83[_0x56312e(0x1d7)]({'file':_0x214fc7,'line':_0x73522e+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x1501b6+_0x56312e(0x194),'category':'security','validator':_0x56312e(0x1a1),'remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0xc8ba83;}catch(_0x4c3750){return this['logger']?.['error'](_0x55bd68(0x201),{'error':_0x4c3750[_0x55bd68(0x18a)]}),[];}}['detectFileType'](_0x13b218){const _0x37eefc=a0_0x276be1,_0x5a4dcc=a0_0x839cc0['basename'](_0x13b218)[_0x37eefc(0x1af)](),_0x2f097a=a0_0x839cc0['dirname'](_0x13b218);if(_0x5a4dcc==='dockerfile')return'dockerfile';if(_0x5a4dcc===_0x37eefc(0x1d1)||_0x5a4dcc===_0x37eefc(0x1bf))return _0x37eefc(0x1cc);if(_0x5a4dcc==='package.json')return _0x37eefc(0x1e5);if(_0x5a4dcc==='tsconfig.json')return'tsconfig.json';if(_0x5a4dcc===_0x37eefc(0x1f9)||_0x5a4dcc[_0x37eefc(0x1dc)]('.env'))return'env';if(_0x2f097a['includes']('.github/workflows'))return'github-actions';if(_0x2f097a['includes']('kubernetes')||_0x2f097a[_0x37eefc(0x1d6)](_0x37eefc(0x1d9)))return'kubernetes';const _0x5dca84=a0_0x839cc0['extname'](_0x13b218)[_0x37eefc(0x1af)]();if(_0x5dca84==='.tf'||_0x5dca84==='.tfvars')return _0x37eefc(0x1da);if(_0x5dca84===_0x37eefc(0x1cb)||_0x5dca84===_0x37eefc(0x1df))return'yaml';if(_0x5dca84===_0x37eefc(0x1ca))return'json';return'unknown';}[a0_0x276be1(0x1b1)](_0x141e0a){const _0x45498a=a0_0x276be1;return _0x141e0a[_0x45498a(0x1e0)](_0x41f31a=>({'file':_0x41f31a[_0x45498a(0x1c7)],'line':_0x41f31a['line']||0x1,'column':_0x41f31a[_0x45498a(0x1eb)]||0x1,'severity':_0x41f31a[_0x45498a(0x1a6)]||STATIC_ANALYSIS[_0x45498a(0x1ea)]['WARNING'],'rule':_0x41f31a[_0x45498a(0x19c)]||_0x45498a(0x1a5),'message':_0x41f31a[_0x45498a(0x18a)]||'Validation\x20issue\x20detected','category':_0x41f31a['category']||'validation','validator':_0x41f31a['validator'],'cwe':_0x41f31a['cwe']||null,'remediation':_0x41f31a['remediation']||null,'references':_0x41f31a['references']||[]}));}['mapHadolintSeverity'](_0x1698d6){const _0x37f7fd=a0_0x276be1,_0x18d9a6={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS[_0x37f7fd(0x1ea)]['INFO']};return _0x18d9a6[_0x1698d6?.['toLowerCase']()]||STATIC_ANALYSIS[_0x37f7fd(0x1ea)][_0x37f7fd(0x199)];}['mapYamllintSeverity'](_0x35cce8){const _0x4ca710=a0_0x276be1,_0x3ced5b={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x4ca710(0x1ea)][_0x4ca710(0x199)]};return _0x3ced5b[_0x35cce8?.[_0x4ca710(0x1af)]()]||STATIC_ANALYSIS['SEVERITY'][_0x4ca710(0x199)];}[a0_0x276be1(0x1a8)](_0x576277){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async['getValidatorStatus'](){const _0x399796=a0_0x276be1,_0x33f6e6=await this[_0x399796(0x1f4)]();return{'validators':_0x33f6e6,'recommendations':this['getInstallRecommendations'](_0x33f6e6)};}[a0_0x276be1(0x202)](_0x5dc3f8){const _0xf81e2e=a0_0x276be1,_0x704c5d=[];return!_0x5dc3f8[_0xf81e2e(0x18e)]&&_0x704c5d[_0xf81e2e(0x1d7)]({'validator':_0xf81e2e(0x18e),'reason':_0xf81e2e(0x1f1),'install':_0xf81e2e(0x1fa),'priority':'high'}),!_0x5dc3f8[_0xf81e2e(0x1c3)]&&_0x704c5d['push']({'validator':'hadolint','reason':_0xf81e2e(0x196),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x5dc3f8[_0xf81e2e(0x1b7)]&&_0x704c5d['push']({'validator':_0xf81e2e(0x1b7),'reason':_0xf81e2e(0x1bd),'install':'pip\x20install\x20yamllint','priority':_0xf81e2e(0x1fd)}),!_0x5dc3f8[_0xf81e2e(0x1cf)]&&_0x704c5d[_0xf81e2e(0x1d7)]({'validator':_0xf81e2e(0x1fe),'reason':_0xf81e2e(0x1b2),'install':_0xf81e2e(0x18f),'priority':'medium'}),_0x704c5d;}}export default ConfigValidator;
|
|
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;
|