@loxia-labs/loxia-autopilot-one 2.0.2 → 2.0.4

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.
Files changed (147) hide show
  1. package/bin/cli.js +1 -1
  2. package/bin/loxia-terminal-v2.js +1 -1
  3. package/bin/loxia-terminal.js +1 -1
  4. package/bin/start-with-terminal.js +1 -1
  5. package/package.json +9 -2
  6. package/scripts/install-scanners.js +1 -1
  7. package/scripts/watchdog.js +1 -1
  8. package/src/analyzers/CSSAnalyzer.js +1 -1
  9. package/src/analyzers/ConfigValidator.js +1 -1
  10. package/src/analyzers/ESLintAnalyzer.js +1 -1
  11. package/src/analyzers/JavaScriptAnalyzer.js +1 -1
  12. package/src/analyzers/PrettierFormatter.js +1 -1
  13. package/src/analyzers/PythonAnalyzer.js +1 -1
  14. package/src/analyzers/SecurityAnalyzer.js +1 -1
  15. package/src/analyzers/SparrowAnalyzer.js +1 -1
  16. package/src/analyzers/TypeScriptAnalyzer.js +1 -1
  17. package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
  18. package/src/analyzers/codeCloneDetector/detector.js +1 -1
  19. package/src/analyzers/codeCloneDetector/index.js +1 -1
  20. package/src/analyzers/codeCloneDetector/parser.js +1 -1
  21. package/src/analyzers/codeCloneDetector/reporter.js +1 -1
  22. package/src/analyzers/codeCloneDetector/scanner.js +1 -1
  23. package/src/core/agentPool.js +1 -1
  24. package/src/core/agentScheduler.js +1 -1
  25. package/src/core/contextManager.js +1 -1
  26. package/src/core/flowExecutor.js +1 -1
  27. package/src/core/messageProcessor.js +1 -1
  28. package/src/core/orchestrator.js +1 -1
  29. package/src/core/stateManager.js +1 -1
  30. package/src/index.js +1 -1
  31. package/src/interfaces/cli.js +1 -1
  32. package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
  33. package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
  34. package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
  35. package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
  36. package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
  37. package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
  38. package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
  39. package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
  40. package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
  41. package/src/interfaces/terminal/api/apiClient.js +1 -1
  42. package/src/interfaces/terminal/api/messageRouter.js +1 -1
  43. package/src/interfaces/terminal/api/session.js +1 -1
  44. package/src/interfaces/terminal/api/websocket.js +1 -1
  45. package/src/interfaces/terminal/components/AgentCreator.js +1 -1
  46. package/src/interfaces/terminal/components/AgentEditor.js +1 -1
  47. package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
  48. package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
  49. package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
  50. package/src/interfaces/terminal/components/Header.js +1 -1
  51. package/src/interfaces/terminal/components/HelpPanel.js +1 -1
  52. package/src/interfaces/terminal/components/InputBox.js +1 -1
  53. package/src/interfaces/terminal/components/Layout.js +1 -1
  54. package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
  55. package/src/interfaces/terminal/components/MessageList.js +1 -1
  56. package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
  57. package/src/interfaces/terminal/components/SearchPanel.js +1 -1
  58. package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
  59. package/src/interfaces/terminal/components/StatusBar.js +1 -1
  60. package/src/interfaces/terminal/components/TextInput.js +1 -1
  61. package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
  62. package/src/interfaces/terminal/config/constants.js +1 -1
  63. package/src/interfaces/terminal/index.js +1 -1
  64. package/src/interfaces/terminal/state/useAgentControl.js +1 -1
  65. package/src/interfaces/terminal/state/useAgents.js +1 -1
  66. package/src/interfaces/terminal/state/useConnection.js +1 -1
  67. package/src/interfaces/terminal/state/useMessages.js +1 -1
  68. package/src/interfaces/terminal/state/useTools.js +1 -1
  69. package/src/interfaces/terminal/utils/debugLogger.js +1 -1
  70. package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
  71. package/src/interfaces/terminal/utils/theme.js +1 -1
  72. package/src/interfaces/webServer.js +1 -1
  73. package/src/modules/fileExplorer/controller.js +1 -1
  74. package/src/modules/fileExplorer/index.js +1 -1
  75. package/src/modules/fileExplorer/middleware.js +1 -1
  76. package/src/modules/fileExplorer/routes.js +1 -1
  77. package/src/services/agentActivityService.js +1 -1
  78. package/src/services/aiService.js +1 -1
  79. package/src/services/apiKeyManager.js +1 -1
  80. package/src/services/benchmarkService.js +1 -1
  81. package/src/services/budgetService.js +1 -1
  82. package/src/services/contextInjectionService.js +1 -1
  83. package/src/services/conversationCompactionService.js +1 -1
  84. package/src/services/credentialVault.js +1 -1
  85. package/src/services/errorHandler.js +1 -1
  86. package/src/services/fileAttachmentService.js +1 -1
  87. package/src/services/flowContextService.js +1 -1
  88. package/src/services/memoryService.js +1 -1
  89. package/src/services/modelRouterService.js +1 -1
  90. package/src/services/modelsService.js +1 -1
  91. package/src/services/portRegistry.js +1 -1
  92. package/src/services/portTracker.js +1 -1
  93. package/src/services/projectDetector.js +1 -1
  94. package/src/services/promptService.js +1 -1
  95. package/src/services/qualityInspector.js +1 -1
  96. package/src/services/serviceRegistry.js +1 -1
  97. package/src/services/tokenCountingService.js +1 -1
  98. package/src/services/visualEditorBridge.js +1 -1
  99. package/src/services/visualEditorServer.js +1 -1
  100. package/src/tools/agentCommunicationTool.js +1 -1
  101. package/src/tools/agentDelayTool.js +1 -1
  102. package/src/tools/asyncToolManager.js +1 -1
  103. package/src/tools/baseTool.js +1 -1
  104. package/src/tools/browserTool.js +1 -1
  105. package/src/tools/cloneDetectionTool.js +1 -1
  106. package/src/tools/dependencyResolverTool.js +1 -1
  107. package/src/tools/docxTool.js +1 -0
  108. package/src/tools/excelTool.js +1 -0
  109. package/src/tools/fileContentReplaceTool.js +1 -1
  110. package/src/tools/fileSystemTool.js +1 -1
  111. package/src/tools/fileTreeTool.js +1 -1
  112. package/src/tools/helpTool.js +1 -0
  113. package/src/tools/imageTool.js +1 -1
  114. package/src/tools/importAnalyzerTool.js +1 -1
  115. package/src/tools/jobDoneTool.js +1 -1
  116. package/src/tools/memoryTool.js +1 -1
  117. package/src/tools/pdfTool.js +1 -1
  118. package/src/tools/seekTool.js +1 -1
  119. package/src/tools/staticAnalysisTool.js +1 -1
  120. package/src/tools/taskManagerTool.js +1 -1
  121. package/src/tools/terminalTool.js +1 -1
  122. package/src/tools/userPromptTool.js +1 -1
  123. package/src/tools/videoTool.js +1 -1
  124. package/src/tools/visualEditorTool.js +1 -1
  125. package/src/tools/webTool.js +1 -1
  126. package/src/types/agent.js +1 -1
  127. package/src/types/contextReference.js +1 -1
  128. package/src/types/conversation.js +1 -1
  129. package/src/types/toolCommand.js +1 -1
  130. package/src/utilities/attachmentValidator.js +1 -1
  131. package/src/utilities/browserStealth.js +1 -1
  132. package/src/utilities/configManager.js +1 -1
  133. package/src/utilities/constants.js +1 -1
  134. package/src/utilities/directoryAccessManager.js +1 -1
  135. package/src/utilities/fileProcessor.js +1 -1
  136. package/src/utilities/humanBehavior.js +1 -1
  137. package/src/utilities/jsonRepair.js +1 -1
  138. package/src/utilities/logger.js +1 -1
  139. package/src/utilities/platformUtils.js +1 -1
  140. package/src/utilities/platformUtils.test.js +1 -1
  141. package/src/utilities/stealthConstants.js +1 -1
  142. package/src/utilities/structuredFileValidator.js +1 -1
  143. package/src/utilities/tagParser.js +1 -1
  144. package/src/utilities/toolConstants.js +1 -1
  145. package/src/utilities/userDataDir.js +1 -1
  146. package/web-ui/build/index.html +1 -1
  147. package/web-ui/build/static/{index-9lwuGbV1.js → index-BoJVEi2s.js} +80 -80
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_0x28fff5=a0_0x121f;(function(_0x1ba806,_0x4fc59d){const _0x5b2c14=a0_0x121f,_0x494198=_0x1ba806();while(!![]){try{const _0x535985=parseInt(_0x5b2c14(0xff))/0x1+parseInt(_0x5b2c14(0xfb))/0x2+-parseInt(_0x5b2c14(0xdc))/0x3+-parseInt(_0x5b2c14(0xeb))/0x4+parseInt(_0x5b2c14(0xf5))/0x5*(parseInt(_0x5b2c14(0x100))/0x6)+parseInt(_0x5b2c14(0xcc))/0x7+-parseInt(_0x5b2c14(0xd6))/0x8*(parseInt(_0x5b2c14(0xe2))/0x9);if(_0x535985===_0x4fc59d)break;else _0x494198['push'](_0x494198['shift']());}catch(_0x55d31e){_0x494198['push'](_0x494198['shift']());}}}(a0_0xeed5,0x64621));import{fileURLToPath}from'url';function a0_0x121f(_0x4e925c,_0x5c0f9e){_0x4e925c=_0x4e925c-0xc2;const _0xeed5a2=a0_0xeed5();let _0x121f46=_0xeed5a2[_0x4e925c];return _0x121f46;}function a0_0xeed5(){const _0x496e54=['package.json','unref','src','LOXIA_HOST',')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\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','\x0a✓\x20Server\x20running\x20at\x20','Unknown\x20command:\x20','loxia-terminal.js','statusCode','length','includes','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','web','kill','index.js',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','Error:','\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','4165665DUQVsh','Server\x20discovered\x20at\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','argv','destroy','log','ignore','\x20but\x20not\x20responding.','\x0aLoxia\x20Autopilot\x20One\x20v','127.0.0.1','16fIcKTc','inherit','\x0aServer\x20registered\x20at\x20','darwin','\x0aPlease\x20start\x20the\x20server\x20first:','node','494469DRsRbP','SIGINT','now','startsWith','cmd','http://','3597138CHaqMo','SIGTERM','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','ceil','platform','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','--version','get','Server\x20running\x20at\x20http://','240308HHLpJY','version','PORT','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','Loxia\x20Autopilot\x20One\x20v','error','win32','exit','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','host','1128995UghUIh','start','xdg-open','utf8','localhost','/api/health','47788ctVtDc','\x0aShutting\x20down\x20server...','backend','port','590645YOLQak','6WOnrvZ','Waiting\x20for\x20server\x20to\x20start...','cleanupStaleEntries','--help','message','\x20\x20API\x20Health:\x20\x20\x20','--port','toString','slice','Looking\x20for\x20running\x20server...','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','Starting\x20Loxia\x20server...\x0a','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','Starting\x20Terminal\x20UI...\x0a','getService','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','pid'];a0_0xeed5=function(){return _0x496e54;};return a0_0xeed5();}import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x398be7 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x28fff5(0xd5),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x28fff5(0xcf)][a0_0x28fff5(0x108)](0x2),command=args[0x0]&&!args[0x0][a0_0x28fff5(0xdf)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x28fff5(0xc4)](a0_0x28fff5(0x103))||args['includes']('-h'),'version':args['includes'](a0_0x28fff5(0xe8))||args[a0_0x28fff5(0xc4)]('-v')};for(let i=0x0;i<args[a0_0x28fff5(0xc3)];i++){args[i]===a0_0x28fff5(0x106)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]==='--host'&&args[i+0x1]&&(flags[a0_0x28fff5(0xf4)]=args[i+0x1]);}const explicitPort=flags[a0_0x28fff5(0xfe)],host=flags[a0_0x28fff5(0xf4)]||DEFAULT_HOST;if(flags[a0_0x28fff5(0xec)]){const pkgPath=join(__dirname,'..',a0_0x28fff5(0x111)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x28fff5(0xf8)));console[a0_0x28fff5(0xd1)](a0_0x28fff5(0xef)+pkg[a0_0x28fff5(0xec)]),process['exit'](0x0);}if(flags['help']||!command){const pkgPath=join(__dirname,'..',a0_0x28fff5(0x111)),pkg=JSON['parse'](readFileSync(pkgPath,'utf8'));console[a0_0x28fff5(0xd1)](a0_0x28fff5(0xd4)+pkg[a0_0x28fff5(0xec)]+a0_0x28fff5(0xcb)+DEFAULT_PORT+a0_0x28fff5(0xc9)+DEFAULT_HOST+a0_0x28fff5(0x115)),process[a0_0x28fff5(0xf2)](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x314863}=await import('../src/services/portRegistry.js');return _0x314863();}async function discoverBackend(){const _0x3921f9=a0_0x28fff5;try{const _0x34391d=await getPortRegistry();await _0x34391d[_0x3921f9(0x102)]();const _0x51a924=await _0x34391d[_0x3921f9(0x10e)](_0x3921f9(0xfd));if(_0x51a924)return{'host':_0x51a924[_0x3921f9(0xf4)]||_0x3921f9(0xf9),'port':_0x51a924[_0x3921f9(0xfe)],'pid':_0x51a924[_0x3921f9(0x110)]};return null;}catch(_0x2b0cc4){return null;}}async function checkServerRunning(_0x58eb84,_0x41c8cc,_0x1273c4=0x1){for(let _0x4935a4=0x0;_0x4935a4<_0x1273c4;_0x4935a4++){const _0x39587d=await new Promise(_0x53de52=>{const _0x43fd84=a0_0x121f,_0x37ac1b=a0_0x398be7[_0x43fd84(0xe9)]('http://'+_0x58eb84+':'+_0x41c8cc+_0x43fd84(0xfa),_0x48d178=>{const _0x49313c=_0x43fd84;_0x53de52(_0x48d178[_0x49313c(0xc2)]===0xc8);});_0x37ac1b['on'](_0x43fd84(0xf0),()=>_0x53de52(![])),_0x37ac1b['setTimeout'](0x7d0,()=>{const _0x7fd836=_0x43fd84;_0x37ac1b[_0x7fd836(0xd0)](),_0x53de52(![]);});});if(_0x39587d)return!![];_0x4935a4<_0x1273c4-0x1&&await new Promise(_0x5a91b4=>setTimeout(_0x5a91b4,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x19f1a1=SERVER_STARTUP_TIMEOUT){const _0x2bb70e=a0_0x28fff5,_0x262682=Date['now']();while(Date[_0x2bb70e(0xde)]()-_0x262682<_0x19f1a1){const _0x51f540=await discoverBackend();if(_0x51f540){const _0x17a27b=await checkServerRunning(_0x51f540[_0x2bb70e(0xf4)],_0x51f540[_0x2bb70e(0xfe)]);if(_0x17a27b)return _0x51f540;}await new Promise(_0x5592f9=>setTimeout(_0x5592f9,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x21134e,_0x2a5f75,_0x384ae4=SERVER_STARTUP_TIMEOUT){const _0x2737a3=a0_0x28fff5,_0x41191f=Math[_0x2737a3(0xe5)](_0x384ae4/SERVER_CHECK_INTERVAL),_0x2a4221=await checkServerRunning(_0x21134e,_0x2a5f75,_0x41191f);return _0x2a4221?{'host':_0x21134e,'port':_0x2a5f75}:null;}function openBrowser(_0x193cb2){const _0x4d12a4=a0_0x28fff5;let _0x5eab38,_0x1db5e0;if(process['platform']===_0x4d12a4(0xd9))_0x5eab38='open',_0x1db5e0=[_0x193cb2];else process[_0x4d12a4(0xe6)]===_0x4d12a4(0xf1)?(_0x5eab38=_0x4d12a4(0xe0),_0x1db5e0=['/c',_0x4d12a4(0xf6),'\x22\x22',_0x193cb2]):(_0x5eab38=_0x4d12a4(0xf7),_0x1db5e0=[_0x193cb2]);const _0x574471=spawn(_0x5eab38,_0x1db5e0,{'detached':!![],'stdio':'ignore'});_0x574471[_0x4d12a4(0x112)](),_0x574471['on'](_0x4d12a4(0xf0),()=>{const _0x4cd4ac=_0x4d12a4;console[_0x4cd4ac(0xd1)]('Could\x20not\x20open\x20browser\x20automatically.'),console[_0x4cd4ac(0xd1)]('Please\x20open\x20manually:\x20'+_0x193cb2);});}function startServer(_0x13fbde=![]){const _0x1a1f2c=a0_0x28fff5,_0x24ec26={...process.env};explicitPort&&(_0x24ec26['LOXIA_PORT']=explicitPort[_0x1a1f2c(0x107)](),_0x24ec26[_0x1a1f2c(0xed)]=explicitPort['toString']());flags['host']&&(_0x24ec26[_0x1a1f2c(0x114)]=flags[_0x1a1f2c(0xf4)]);const _0x471a07=join(__dirname,'..',_0x1a1f2c(0x113),_0x1a1f2c(0xc8)),_0x4866fa=spawn(_0x1a1f2c(0xdb),[_0x471a07],{'cwd':join(__dirname,'..'),'env':_0x24ec26,'stdio':_0x13fbde?[_0x1a1f2c(0xd2),'ignore',_0x1a1f2c(0xd2)]:_0x1a1f2c(0xd7),'detached':_0x13fbde});return _0x13fbde&&_0x4866fa[_0x1a1f2c(0x112)](),_0x4866fa;}function startTerminalUIProcess(_0x22a3c2,_0x3510c9){const _0x37277a=a0_0x28fff5,_0x5ea08b=join(__dirname,_0x37277a(0x118)),_0x4887f3={...process.env,'LOXIA_PORT':_0x3510c9[_0x37277a(0x107)](),'LOXIA_HOST':_0x22a3c2},_0x914ce=spawn(_0x37277a(0xdb),[_0x5ea08b],{'cwd':join(__dirname,'..'),'env':_0x4887f3,'stdio':_0x37277a(0xd7)});return _0x914ce;}const commands={'web':async()=>{const _0x5003d2=a0_0x28fff5;console[_0x5003d2(0xd1)](_0x5003d2(0x10b));const _0x18b385=startServer(![]);console[_0x5003d2(0xd1)]('Waiting\x20for\x20server\x20to\x20start...');let _0x9b3df4;explicitPort?_0x9b3df4=await waitForServerAtPort(host,explicitPort):_0x9b3df4=await waitForServerWithDiscovery();if(_0x9b3df4){const _0x36622c=_0x5003d2(0xe1)+_0x9b3df4[_0x5003d2(0xf4)]+':'+_0x9b3df4[_0x5003d2(0xfe)];console['log']('\x0aOpening\x20Web\x20UI\x20at\x20'+_0x36622c),openBrowser(_0x36622c);}else console['log']('\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.');process['on'](_0x5003d2(0xdd),()=>_0x18b385[_0x5003d2(0xc7)](_0x5003d2(0xdd))),process['on'](_0x5003d2(0xe3),()=>_0x18b385[_0x5003d2(0xc7)](_0x5003d2(0xe3))),_0x18b385['on'](_0x5003d2(0xf2),_0x55b532=>process[_0x5003d2(0xf2)](_0x55b532||0x0));},'plus-web':async()=>{const _0x5d9982=a0_0x28fff5;await commands[_0x5d9982(0xc6)]();},'serve':async()=>{const _0x435396=a0_0x28fff5;console[_0x435396(0xd1)](_0x435396(0x10b));const _0x15b9f7=startServer(![]);console[_0x435396(0xd1)](_0x435396(0x101));let _0x504923;explicitPort?_0x504923=await waitForServerAtPort(host,explicitPort):_0x504923=await waitForServerWithDiscovery();if(_0x504923){const _0x30d4a0='http://'+_0x504923['host']+':'+_0x504923[_0x435396(0xfe)];console[_0x435396(0xd1)](_0x435396(0x116)+_0x30d4a0),console['log']('\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'+_0x30d4a0),console[_0x435396(0xd1)](_0x435396(0x10f)),console['log'](_0x435396(0x105)+_0x30d4a0+'/api/health\x0a');}else console['log'](_0x435396(0xe4)),console[_0x435396(0xd1)]('Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.');process['on']('SIGINT',()=>_0x15b9f7[_0x435396(0xc7)](_0x435396(0xdd))),process['on'](_0x435396(0xe3),()=>_0x15b9f7[_0x435396(0xc7)](_0x435396(0xe3))),_0x15b9f7['on'](_0x435396(0xf2),_0x564667=>process['exit'](_0x564667||0x0));},'terminal':async()=>{const _0xd18747=a0_0x28fff5;console[_0xd18747(0xd1)](_0xd18747(0x109));let _0x36b9eb=await discoverBackend();explicitPort&&(_0x36b9eb={'host':host,'port':explicitPort});!_0x36b9eb&&(console['error'](_0xd18747(0xc5)),console['error'](_0xd18747(0xda)),console['error'](_0xd18747(0xee)),console[_0xd18747(0xf0)](_0xd18747(0xe7)),console['error'](_0xd18747(0x10a)),process[_0xd18747(0xf2)](0x1));const _0x2fdc3d=await checkServerRunning(_0x36b9eb[_0xd18747(0xf4)],_0x36b9eb[_0xd18747(0xfe)]);!_0x2fdc3d&&(console[_0xd18747(0xf0)](_0xd18747(0xd8)+_0x36b9eb[_0xd18747(0xf4)]+':'+_0x36b9eb[_0xd18747(0xfe)]+_0xd18747(0xd3)),console['error'](_0xd18747(0x10c)),process['exit'](0x1));console['log'](_0xd18747(0xcd)+_0x36b9eb[_0xd18747(0xf4)]+':'+_0x36b9eb[_0xd18747(0xfe)]),console[_0xd18747(0xd1)](_0xd18747(0x10d));const _0x39b13d=startTerminalUIProcess(_0x36b9eb['host'],_0x36b9eb[_0xd18747(0xfe)]);process['on'](_0xd18747(0xdd),()=>_0x39b13d[_0xd18747(0xc7)](_0xd18747(0xdd))),process['on'](_0xd18747(0xe3),()=>_0x39b13d[_0xd18747(0xc7)](_0xd18747(0xe3))),_0x39b13d['on'](_0xd18747(0xf2),_0x561973=>process[_0xd18747(0xf2)](_0x561973||0x0));},'plus-terminal':async()=>{const _0x56481a=a0_0x28fff5;console[_0x56481a(0xd1)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x5358c4=startServer(!![]);let _0x35b7fc;explicitPort?_0x35b7fc=await waitForServerAtPort(host,explicitPort):_0x35b7fc=await waitForServerWithDiscovery();!_0x35b7fc&&(console['error'](_0x56481a(0xf3)),process['exit'](0x1));console[_0x56481a(0xd1)](_0x56481a(0xea)+_0x35b7fc[_0x56481a(0xf4)]+':'+_0x35b7fc[_0x56481a(0xfe)]),console['log'](_0x56481a(0x10d));const _0xb5c835=startTerminalUIProcess(_0x35b7fc[_0x56481a(0xf4)],_0x35b7fc[_0x56481a(0xfe)]);_0xb5c835['on'](_0x56481a(0xf2),_0x5f4024=>{const _0x3c9d4a=_0x56481a;console[_0x3c9d4a(0xd1)](_0x3c9d4a(0xfc));try{process[_0x3c9d4a(0xc7)](_0x5358c4[_0x3c9d4a(0x110)],'SIGTERM');}catch(_0x2a1e59){}process[_0x3c9d4a(0xf2)](_0x5f4024||0x0);}),process['on'](_0x56481a(0xdd),()=>{const _0x26b80e=_0x56481a;_0xb5c835[_0x26b80e(0xc7)](_0x26b80e(0xdd));}),process['on'](_0x56481a(0xe3),()=>{const _0x3b32d6=_0x56481a;_0xb5c835['kill'](_0x3b32d6(0xe3));});}};commands[command]?commands[command]()['catch'](_0x1becdf=>{const _0x59ddc1=a0_0x28fff5;console[_0x59ddc1(0xf0)](_0x59ddc1(0xca),_0x1becdf[_0x59ddc1(0x104)]),process[_0x59ddc1(0xf2)](0x1);}):(console[a0_0x28fff5(0xf0)](a0_0x28fff5(0x117)+command),console[a0_0x28fff5(0xf0)](a0_0x28fff5(0xce)),process['exit'](0x1));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x2ad988=a0_0x554c;(function(_0x1deec8,_0x4305b6){const _0xe71ee9=a0_0x554c,_0x5a0699=_0x1deec8();while(!![]){try{const _0x268dc6=parseInt(_0xe71ee9(0x110))/0x1+-parseInt(_0xe71ee9(0x11e))/0x2+parseInt(_0xe71ee9(0x113))/0x3+-parseInt(_0xe71ee9(0x126))/0x4+parseInt(_0xe71ee9(0x102))/0x5+-parseInt(_0xe71ee9(0x11a))/0x6+parseInt(_0xe71ee9(0x104))/0x7;if(_0x268dc6===_0x4305b6)break;else _0x5a0699['push'](_0x5a0699['shift']());}catch(_0x58c138){_0x5a0699['push'](_0x5a0699['shift']());}}}(a0_0x1eac,0x279b7));import{spawn}from'child_process';import a0_0x541484 from'net';function a0_0x554c(_0x6722ec,_0x4b8ec7){_0x6722ec=_0x6722ec-0xff;const _0x1eac97=a0_0x1eac();let _0x554c0d=_0x1eac97[_0x6722ec];return _0x554c0d;}import a0_0x2011a0 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x2011a0[a0_0x2ad988(0x108)](__filename),projectRoot=a0_0x2011a0['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x2ad988(0x122),SERVER_STARTUP_TIMEOUT=0x2710;function a0_0x1eac(){const _0x3c502b=['--port','213800FLoFET','message','--ui','277017LlCxwe','node','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','../src/interfaces/terminal/index.js','web','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','701022stVcQR','data','stderr','length','377458CMKeup','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','Failed\x20to\x20start\x20server:','ignore','localhost','setTimeout','✓\x20Server\x20is\x20already\x20running\x20at\x20','Server\x20startup\x20timeout','259112QZMkfq','join','toString','pipe','error','🚀\x20Starting\x20Loxia\x20server...','29440LtIKoS','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','1543836BJJfJh','💡\x20Troubleshooting:','destroy','log','dirname','✗\x20Server\x20is\x20not\x20running','now','--host','exit','connect','kill'];a0_0x1eac=function(){return _0x3c502b;};return a0_0x1eac();}async function isServerRunning(_0x304da4,_0x2fc55c){return new Promise(_0x442e58=>{const _0x3dda75=a0_0x554c,_0x1ff5d4=new a0_0x541484['Socket']();_0x1ff5d4[_0x3dda75(0x123)](0x7d0),_0x1ff5d4['on']('connect',()=>{_0x1ff5d4['destroy'](),_0x442e58(!![]);}),_0x1ff5d4['on']('timeout',()=>{const _0xd4c707=_0x3dda75;_0x1ff5d4[_0xd4c707(0x106)](),_0x442e58(![]);}),_0x1ff5d4['on'](_0x3dda75(0x100),()=>{const _0x472462=_0x3dda75;_0x1ff5d4[_0x472462(0x106)](),_0x442e58(![]);}),_0x1ff5d4[_0x3dda75(0x10d)](_0x2fc55c,_0x304da4);});}async function startServer(_0x58a982,_0x42b91b){const _0xd81ee9=a0_0x2ad988;return console['log'](_0xd81ee9(0x101)),new Promise((_0x279c1f,_0x2d9d16)=>{const _0x16ee2e=_0xd81ee9,_0x149183=spawn(_0x16ee2e(0x114),[a0_0x2011a0[_0x16ee2e(0x127)](projectRoot,'bin/cli.js'),_0x16ee2e(0x112),_0x16ee2e(0x117),_0x16ee2e(0x10b),_0x58a982,_0x16ee2e(0x10f),_0x42b91b[_0x16ee2e(0x128)]()],{'detached':![],'stdio':[_0x16ee2e(0x121),_0x16ee2e(0xff),_0x16ee2e(0xff)]});_0x149183['stdout']['on'](_0x16ee2e(0x11b),()=>{}),_0x149183[_0x16ee2e(0x11c)]['on'](_0x16ee2e(0x11b),()=>{}),_0x149183['on']('error',_0x1aee64=>{const _0x2ded02=_0x16ee2e;console[_0x2ded02(0x100)](_0x2ded02(0x120),_0x1aee64[_0x2ded02(0x111)]),_0x2d9d16(_0x1aee64);});const _0x4c4af7=Date['now'](),_0x29acb7=setInterval(async()=>{const _0x24f2a9=_0x16ee2e,_0x4c53a8=await isServerRunning(_0x58a982,_0x42b91b);if(_0x4c53a8)clearInterval(_0x29acb7),console[_0x24f2a9(0x107)]('✓\x20Server\x20started\x20at\x20'+_0x58a982+':'+_0x42b91b),_0x279c1f();else Date[_0x24f2a9(0x10a)]()-_0x4c4af7>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x29acb7),_0x149183[_0x24f2a9(0x10e)](),_0x2d9d16(new Error(_0x24f2a9(0x125))));},0x1f4);});}async function main(){const _0x1cf33b=a0_0x2ad988;try{console[_0x1cf33b(0x107)](_0x1cf33b(0x11f)),console[_0x1cf33b(0x107)](_0x1cf33b(0x119)),console['log'](_0x1cf33b(0x11f)),console[_0x1cf33b(0x107)]('');const _0x72ccb1=process['argv']['slice'](0x2);let _0x537ea0=DEFAULT_HOST,_0xc020b7=DEFAULT_PORT;for(let _0x5eac2f=0x0;_0x5eac2f<_0x72ccb1[_0x1cf33b(0x11d)];_0x5eac2f++){if(_0x72ccb1[_0x5eac2f]===_0x1cf33b(0x10b)&&_0x72ccb1[_0x5eac2f+0x1])_0x537ea0=_0x72ccb1[_0x5eac2f+0x1],_0x5eac2f++;else _0x72ccb1[_0x5eac2f]===_0x1cf33b(0x10f)&&_0x72ccb1[_0x5eac2f+0x1]&&(_0xc020b7=parseInt(_0x72ccb1[_0x5eac2f+0x1],0xa),_0x5eac2f++);}console[_0x1cf33b(0x107)](_0x1cf33b(0x103)+_0x537ea0+':'+_0xc020b7+'...');const _0x4d9c57=await isServerRunning(_0x537ea0,_0xc020b7);!_0x4d9c57?(console[_0x1cf33b(0x107)](_0x1cf33b(0x109)),await startServer(_0x537ea0,_0xc020b7)):console[_0x1cf33b(0x107)](_0x1cf33b(0x124)+_0x537ea0+':'+_0xc020b7),console[_0x1cf33b(0x107)](''),console['log']('🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'),console[_0x1cf33b(0x107)](''),await new Promise(_0x574059=>setTimeout(_0x574059,0x1f4)),process.env.LOXIA_HOST=_0x537ea0,process.env.LOXIA_PORT=_0xc020b7[_0x1cf33b(0x128)](),await import(_0x1cf33b(0x116));}catch(_0x4ee29b){console['error'](''),console[_0x1cf33b(0x100)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console[_0x1cf33b(0x100)]('\x20\x20',_0x4ee29b[_0x1cf33b(0x111)]),console['error'](''),console['error'](_0x1cf33b(0x105)),console['error'](_0x1cf33b(0x118)),console['error']('\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js'),console[_0x1cf33b(0x100)](_0x1cf33b(0x115)),console[_0x1cf33b(0x100)](''),process[_0x1cf33b(0x10c)](0x1);}}main();
3
+ const a0_0x1a6b25=a0_0x3173;(function(_0x591e48,_0x284758){const _0x256fdf=a0_0x3173,_0x5f4a48=_0x591e48();while(!![]){try{const _0x117042=parseInt(_0x256fdf(0x13c))/0x1*(parseInt(_0x256fdf(0x14b))/0x2)+-parseInt(_0x256fdf(0x133))/0x3*(parseInt(_0x256fdf(0x11e))/0x4)+-parseInt(_0x256fdf(0x147))/0x5*(-parseInt(_0x256fdf(0x143))/0x6)+parseInt(_0x256fdf(0x13f))/0x7+parseInt(_0x256fdf(0x127))/0x8+-parseInt(_0x256fdf(0x12b))/0x9+parseInt(_0x256fdf(0x134))/0xa;if(_0x117042===_0x284758)break;else _0x5f4a48['push'](_0x5f4a48['shift']());}catch(_0x246b04){_0x5f4a48['push'](_0x5f4a48['shift']());}}}(a0_0x2221,0xb1e09));import{spawn}from'child_process';import a0_0x2109d2 from'net';import a0_0x504f9e from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x504f9e[a0_0x1a6b25(0x144)](__filename),projectRoot=a0_0x504f9e[a0_0x1a6b25(0x144)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x1a6b25(0x135),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x377176,_0x2edda6){return new Promise(_0x15fbd1=>{const _0xcd5da3=a0_0x3173,_0x406a18=new a0_0x2109d2[(_0xcd5da3(0x140))]();_0x406a18[_0xcd5da3(0x124)](0x7d0),_0x406a18['on']('connect',()=>{const _0x5a09dd=_0xcd5da3;_0x406a18[_0x5a09dd(0x11f)](),_0x15fbd1(!![]);}),_0x406a18['on'](_0xcd5da3(0x121),()=>{const _0x42a371=_0xcd5da3;_0x406a18[_0x42a371(0x11f)](),_0x15fbd1(![]);}),_0x406a18['on']('error',()=>{_0x406a18['destroy'](),_0x15fbd1(![]);}),_0x406a18[_0xcd5da3(0x139)](_0x2edda6,_0x377176);});}function a0_0x3173(_0x1621d7,_0x2a5bd4){_0x1621d7=_0x1621d7-0x11e;const _0x222119=a0_0x2221();let _0x317397=_0x222119[_0x1621d7];return _0x317397;}async function startServer(_0x5dcdac,_0x4d2374){const _0x13823a=a0_0x1a6b25;return console[_0x13823a(0x145)](_0x13823a(0x13b)),new Promise((_0x42e717,_0x3e4fff)=>{const _0x34caab=_0x13823a,_0x5c1b27=spawn('node',[a0_0x504f9e[_0x34caab(0x128)](projectRoot,'bin/cli.js'),_0x34caab(0x14a),_0x34caab(0x146),_0x34caab(0x129),_0x5dcdac,_0x34caab(0x126),_0x4d2374[_0x34caab(0x13e)]()],{'detached':![],'stdio':['ignore',_0x34caab(0x149),_0x34caab(0x149)]});_0x5c1b27[_0x34caab(0x142)]['on'](_0x34caab(0x137),()=>{}),_0x5c1b27['stderr']['on']('data',()=>{}),_0x5c1b27['on'](_0x34caab(0x131),_0x24cf85=>{const _0x3b3214=_0x34caab;console[_0x3b3214(0x131)](_0x3b3214(0x136),_0x24cf85[_0x3b3214(0x130)]),_0x3e4fff(_0x24cf85);});const _0x37d05d=Date[_0x34caab(0x132)](),_0x3670a0=setInterval(async()=>{const _0x25bf83=_0x34caab,_0x3b392d=await isServerRunning(_0x5dcdac,_0x4d2374);if(_0x3b392d)clearInterval(_0x3670a0),console[_0x25bf83(0x145)](_0x25bf83(0x12c)+_0x5dcdac+':'+_0x4d2374),_0x42e717();else Date[_0x25bf83(0x132)]()-_0x37d05d>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x3670a0),_0x5c1b27[_0x25bf83(0x12e)](),_0x3e4fff(new Error(_0x25bf83(0x122))));},0x1f4);});}async function main(){const _0x4f581f=a0_0x1a6b25;try{console['log'](_0x4f581f(0x125)),console[_0x4f581f(0x145)](_0x4f581f(0x12a)),console[_0x4f581f(0x145)](_0x4f581f(0x125)),console[_0x4f581f(0x145)]('');const _0x306891=process['argv'][_0x4f581f(0x13a)](0x2);let _0x49701d=DEFAULT_HOST,_0x6554c=DEFAULT_PORT;for(let _0xec5cf0=0x0;_0xec5cf0<_0x306891[_0x4f581f(0x138)];_0xec5cf0++){if(_0x306891[_0xec5cf0]===_0x4f581f(0x129)&&_0x306891[_0xec5cf0+0x1])_0x49701d=_0x306891[_0xec5cf0+0x1],_0xec5cf0++;else _0x306891[_0xec5cf0]===_0x4f581f(0x126)&&_0x306891[_0xec5cf0+0x1]&&(_0x6554c=parseInt(_0x306891[_0xec5cf0+0x1],0xa),_0xec5cf0++);}console[_0x4f581f(0x145)](_0x4f581f(0x14d)+_0x49701d+':'+_0x6554c+_0x4f581f(0x123));const _0x4d79f6=await isServerRunning(_0x49701d,_0x6554c);!_0x4d79f6?(console[_0x4f581f(0x145)](_0x4f581f(0x120)),await startServer(_0x49701d,_0x6554c)):console[_0x4f581f(0x145)](_0x4f581f(0x14c)+_0x49701d+':'+_0x6554c),console[_0x4f581f(0x145)](''),console['log'](_0x4f581f(0x141)),console[_0x4f581f(0x145)](''),await new Promise(_0x1b87d5=>setTimeout(_0x1b87d5,0x1f4)),process.env.LOXIA_HOST=_0x49701d,process.env.LOXIA_PORT=_0x6554c['toString'](),await import(_0x4f581f(0x148));}catch(_0xedc848){console[_0x4f581f(0x131)](''),console[_0x4f581f(0x131)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console['error']('\x20\x20',_0xedc848[_0x4f581f(0x130)]),console['error'](''),console[_0x4f581f(0x131)](_0x4f581f(0x12d)),console['error'](_0x4f581f(0x12f)),console['error'](_0x4f581f(0x13d)),console[_0x4f581f(0x131)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x4f581f(0x131)](''),process[_0x4f581f(0x14e)](0x1);}}main();function a0_0x2221(){const _0x86a2e2=['slice','🚀\x20Starting\x20Loxia\x20server...','1331961apwmIZ','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','toString','2431030ONnzyw','Socket','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','stdout','71892lGfkbp','dirname','log','web','5WajJDk','../src/interfaces/terminal/index.js','pipe','--ui','2YwnJti','✓\x20Server\x20is\x20already\x20running\x20at\x20','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','exit','4064OSBmpq','destroy','✗\x20Server\x20is\x20not\x20running','timeout','Server\x20startup\x20timeout','...','setTimeout','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','--port','4579920cPTKSZ','join','--host','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','6326721kxbFpR','✓\x20Server\x20started\x20at\x20','💡\x20Troubleshooting:','kill','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','message','error','now','2820cMiHRN','1228710aHhxhm','localhost','Failed\x20to\x20start\x20server:','data','length','connect'];a0_0x2221=function(){return _0x86a2e2;};return a0_0x2221();}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x39590e=a0_0x2b9b;(function(_0x36638b,_0x3fef8d){const _0x503da9=a0_0x2b9b,_0x1ea1e3=_0x36638b();while(!![]){try{const _0x2aa346=parseInt(_0x503da9(0x98))/0x1*(parseInt(_0x503da9(0x7e))/0x2)+-parseInt(_0x503da9(0x9a))/0x3+parseInt(_0x503da9(0x7c))/0x4+parseInt(_0x503da9(0x94))/0x5*(parseInt(_0x503da9(0x87))/0x6)+parseInt(_0x503da9(0x90))/0x7+parseInt(_0x503da9(0x86))/0x8+-parseInt(_0x503da9(0x8d))/0x9;if(_0x2aa346===_0x3fef8d)break;else _0x1ea1e3['push'](_0x1ea1e3['shift']());}catch(_0x58afc9){_0x1ea1e3['push'](_0x1ea1e3['shift']());}}}(a0_0x189e,0x4d441));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process['argv'][a0_0x39590e(0x9b)](0x2),options={'host':'localhost','port':0x1f90};for(let i=0x0;i<args['length'];i++){const arg=args[i];if(arg==='--host'||arg==='-h')options[a0_0x39590e(0x7a)]=args[++i];else{if(arg===a0_0x39590e(0x88)||arg==='-p')options[a0_0x39590e(0x80)]=parseInt(args[++i],0xa);else arg==='--help'&&(console['log']('\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a'),process[a0_0x39590e(0x96)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x39590e(0x7a)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options['port']=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0x39590e(0x8f)][a0_0x39590e(0x99)]&&(console['error'](a0_0x39590e(0x84)),console[a0_0x39590e(0x81)](''),console['error'](a0_0x39590e(0x8e)),console[a0_0x39590e(0x81)](a0_0x39590e(0x82)),console['error'](a0_0x39590e(0x95)),console[a0_0x39590e(0x81)]('\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)'),console['error'](a0_0x39590e(0x85)),console['error'](''),console[a0_0x39590e(0x81)](a0_0x39590e(0x8c)),console[a0_0x39590e(0x81)](a0_0x39590e(0x83)),console[a0_0x39590e(0x81)](''),console['error'](a0_0x39590e(0x7f)),console[a0_0x39590e(0x81)](a0_0x39590e(0x89)),process[a0_0x39590e(0x96)](0x1));function a0_0x189e(){const _0x1ca7de=['\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','\x20\x20npm\x20run\x20terminal-ui','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','\x20\x20-\x20Some\x20CI/CD\x20environments','2219600TiMavm','502974eqiBIz','--port','\x20\x20npm\x20start','\x0aTerminal\x20UI\x20exited','then','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','1104273bCSRpO','The\x20terminal\x20UI\x20cannot\x20run\x20in:','stdin','1402156JrcXJw','log','catch','Press\x20Ctrl+C\x20to\x20exit\x0a','5HBbRVT','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','exit','Starting\x20Loxia\x20Terminal\x20UI...','1173KQSBUL','isTTY','1755795nadHez','slice','host','\x0aTerminal\x20UI\x20error:','73156AhRlDz','Connecting\x20to:\x20','758lEqZTT','Or\x20use\x20the\x20web\x20UI\x20instead:','port','error'];a0_0x189e=function(){return _0x1ca7de;};return a0_0x189e();}console[a0_0x39590e(0x91)](a0_0x39590e(0x97)),console[a0_0x39590e(0x91)](a0_0x39590e(0x7d)+options['host']+':'+options[a0_0x39590e(0x80)]),console[a0_0x39590e(0x91)](a0_0x39590e(0x93));function a0_0x2b9b(_0x48f33f,_0x54130d){_0x48f33f=_0x48f33f-0x7a;const _0x189ec2=a0_0x189e();let _0x2b9b20=_0x189ec2[_0x48f33f];return _0x2b9b20;}const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x39590e(0x8b)](()=>{const _0x573a08=a0_0x39590e;console[_0x573a08(0x91)](_0x573a08(0x8a)),process[_0x573a08(0x96)](0x0);})[a0_0x39590e(0x92)](_0x246089=>{const _0x3a862=a0_0x39590e;console['error'](_0x3a862(0x7b),_0x246089),process[_0x3a862(0x96)](0x1);});
3
+ function a0_0x1cde(_0x16908c,_0x4af050){_0x16908c=_0x16908c-0x174;const _0x260e45=a0_0x260e();let _0x1cde70=_0x260e45[_0x16908c];return _0x1cde70;}const a0_0x23204e=a0_0x1cde;(function(_0x17e14e,_0x313578){const _0x1f772c=a0_0x1cde,_0x2c39e7=_0x17e14e();while(!![]){try{const _0x2b105a=-parseInt(_0x1f772c(0x192))/0x1+-parseInt(_0x1f772c(0x18d))/0x2*(-parseInt(_0x1f772c(0x193))/0x3)+parseInt(_0x1f772c(0x185))/0x4*(-parseInt(_0x1f772c(0x18a))/0x5)+parseInt(_0x1f772c(0x198))/0x6+parseInt(_0x1f772c(0x17a))/0x7*(parseInt(_0x1f772c(0x178))/0x8)+-parseInt(_0x1f772c(0x177))/0x9+parseInt(_0x1f772c(0x174))/0xa;if(_0x2b105a===_0x313578)break;else _0x2c39e7['push'](_0x2c39e7['shift']());}catch(_0x5b9a2b){_0x2c39e7['push'](_0x2c39e7['shift']());}}}(a0_0x260e,0xb4e04));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x23204e(0x176)]['slice'](0x2),options={'host':a0_0x23204e(0x189),'port':0x1f90};for(let i=0x0;i<args['length'];i++){const arg=args[i];if(arg===a0_0x23204e(0x18e)||arg==='-h')options[a0_0x23204e(0x17b)]=args[++i];else{if(arg===a0_0x23204e(0x17f)||arg==='-p')options[a0_0x23204e(0x17e)]=parseInt(args[++i],0xa);else arg===a0_0x23204e(0x18b)&&(console[a0_0x23204e(0x179)](a0_0x23204e(0x195)),process[a0_0x23204e(0x183)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x23204e(0x17b)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x23204e(0x17e)]=parseInt(process.env.LOXIA_PORT,0xa));!process['stdin']['isTTY']&&(console[a0_0x23204e(0x180)](a0_0x23204e(0x186)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x190)),console[a0_0x23204e(0x180)](a0_0x23204e(0x187)),console[a0_0x23204e(0x180)](a0_0x23204e(0x17c)),console['error'](a0_0x23204e(0x197)),console['error'](a0_0x23204e(0x184)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x196)),console['error'](a0_0x23204e(0x175)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x181)),console[a0_0x23204e(0x180)](a0_0x23204e(0x18c)),process['exit'](0x1));console[a0_0x23204e(0x179)](a0_0x23204e(0x188)),console[a0_0x23204e(0x179)](a0_0x23204e(0x194)+options['host']+':'+options['port']),console[a0_0x23204e(0x179)]('Press\x20Ctrl+C\x20to\x20exit\x0a');const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x23204e(0x17d)](()=>{const _0x56f5dc=a0_0x23204e;console[_0x56f5dc(0x179)](_0x56f5dc(0x182)),process['exit'](0x0);})[a0_0x23204e(0x191)](_0x209bca=>{const _0x103f8a=a0_0x23204e;console[_0x103f8a(0x180)](_0x103f8a(0x18f),_0x209bca),process['exit'](0x1);});function a0_0x260e(){const _0x29d714=['\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','Starting\x20Loxia\x20Terminal\x20UI...','localhost','600205vCrKde','--help','\x20\x20npm\x20start','64qmiUCV','--host','\x0aTerminal\x20UI\x20error:','The\x20terminal\x20UI\x20cannot\x20run\x20in:','catch','867333prmiDx','16392KeMDIG','Connecting\x20to:\x20','\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','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','5509554xmFsHr','8598190rzgLFB','\x20\x20npm\x20run\x20terminal-ui','argv','13179969UbmfBk','528YijLeF','log','144221YEHJoy','host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','then','port','--port','error','Or\x20use\x20the\x20web\x20UI\x20instead:','\x0aTerminal\x20UI\x20exited','exit','\x20\x20-\x20Some\x20CI/CD\x20environments','8HEpDfm','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'];a0_0x260e=function(){return _0x29d714;};return a0_0x260e();}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x40acea=a0_0x1b78;(function(_0x27bdc9,_0x4ed25c){const _0x3f5de2=a0_0x1b78,_0xd63f43=_0x27bdc9();while(!![]){try{const _0x59ea9c=parseInt(_0x3f5de2(0x132))/0x1*(parseInt(_0x3f5de2(0x113))/0x2)+-parseInt(_0x3f5de2(0x12f))/0x3*(parseInt(_0x3f5de2(0x13e))/0x4)+-parseInt(_0x3f5de2(0x11d))/0x5+parseInt(_0x3f5de2(0x143))/0x6*(parseInt(_0x3f5de2(0x12d))/0x7)+-parseInt(_0x3f5de2(0x11a))/0x8+parseInt(_0x3f5de2(0x13b))/0x9+-parseInt(_0x3f5de2(0x11e))/0xa;if(_0x59ea9c===_0x4ed25c)break;else _0xd63f43['push'](_0xd63f43['shift']());}catch(_0x15c13f){_0xd63f43['push'](_0xd63f43['shift']());}}}(a0_0x186a,0x7d783));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x103231 from'http';function a0_0x186a(){const _0x37836e=['\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','\x0a👋\x20Terminal\x20UI\x20closed.','error','SIGINT','src','stderr','log','306502kWGuow','Timeout','155637mQiuAd','pipe','statusCode','11742obMCwT','🛑\x20Stopping\x20server...','SIGTERM','message','index.js','╔════════════════════════════════════════════════╗','Failed\x20to\x20start\x20Terminal\x20UI:','node','trim','8834634WEzFQB','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','╚════════════════════════════════════════════════╝','4pqBCXA','destroy','get','🖥️\x20\x20Starting\x20Terminal\x20UI...','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','96KGcBco','includes','kill','data','174mmAdZv','ExperimentalWarning','bin','✅\x20Server\x20is\x20ready!','toString','Server\x20exited\x20with\x20code\x20','ignore','1063688RFfNbI','/health','exit','4589010cPxkRR','10871910RVcuEn','stdout','Server\x20returned\x20','[SERVER\x20ERROR]\x20','inherit','SIGKILL','🚀\x20Starting\x20Loxia\x20server...','setTimeout'];a0_0x186a=function(){return _0x37836e;};return a0_0x186a();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x131089=0xa,_0x1d7d67=0x1f4){const _0x31007e=a0_0x1b78;for(let _0x34b6de=0x0;_0x34b6de<_0x131089;_0x34b6de++){try{return await new Promise((_0x4fa433,_0x480509)=>{const _0xeff6f2=a0_0x1b78,_0x39b4a3=a0_0x103231[_0xeff6f2(0x140)]('http://localhost:'+SERVER_PORT+_0xeff6f2(0x11b),_0x59fba0=>{const _0x348867=_0xeff6f2;_0x59fba0[_0x348867(0x131)]===0xc8?_0x4fa433():_0x480509(new Error(_0x348867(0x120)+_0x59fba0[_0x348867(0x131)]));});_0x39b4a3['on']('error',_0x480509),_0x39b4a3[_0xeff6f2(0x125)](0x3e8,()=>{const _0x1bdb91=_0xeff6f2;_0x39b4a3[_0x1bdb91(0x13f)](),_0x480509(new Error(_0x1bdb91(0x12e)));});}),console['log'](_0x31007e(0x116)),!![];}catch(_0x1e262f){_0x34b6de<_0x131089-0x1&&await new Promise(_0x386f59=>setTimeout(_0x386f59,_0x1d7d67));}}return console[_0x31007e(0x12c)](_0x31007e(0x13c)),![];}async function startServer(){return new Promise(_0x116404=>{const _0x4b3736=a0_0x1b78;console[_0x4b3736(0x12c)](_0x4b3736(0x124));const _0x3aaabd=join(rootDir,_0x4b3736(0x12a),_0x4b3736(0x136));serverProcess=spawn(_0x4b3736(0x139),[_0x3aaabd],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x4b3736(0x119),_0x4b3736(0x130),'pipe'],'detached':![]}),serverProcess[_0x4b3736(0x11f)]['on'](_0x4b3736(0x112),_0x17203e=>{const _0xd54362=_0x4b3736,_0x1fade7=_0x17203e[_0xd54362(0x117)]()['trim']();_0x1fade7&&console[_0xd54362(0x12c)]('[SERVER]\x20'+_0x1fade7);}),serverProcess[_0x4b3736(0x12b)]['on'](_0x4b3736(0x112),_0x236476=>{const _0xf0100=_0x4b3736,_0x1d7f96=_0x236476[_0xf0100(0x117)]()[_0xf0100(0x13a)]();_0x1d7f96&&!_0x1d7f96[_0xf0100(0x144)](_0xf0100(0x114))&&console[_0xf0100(0x128)](_0xf0100(0x121)+_0x1d7f96);}),serverProcess['on']('error',_0x31fdde=>{const _0xc04e76=_0x4b3736;console[_0xc04e76(0x128)]('Failed\x20to\x20start\x20server:',_0x31fdde[_0xc04e76(0x135)]),process[_0xc04e76(0x11c)](0x1);}),serverProcess['on'](_0x4b3736(0x11c),(_0x5e2d15,_0x2f7f8a)=>{const _0xc052a2=_0x4b3736;_0x5e2d15!==null&&_0x5e2d15!==0x0&&(console[_0xc052a2(0x128)](_0xc052a2(0x118)+_0x5e2d15),process[_0xc052a2(0x11c)](_0x5e2d15));}),setTimeout(_0x116404,STARTUP_WAIT);});}async function startTerminalUI(){const _0x391b56=a0_0x1b78;console['log'](_0x391b56(0x141)),console[_0x391b56(0x12c)]('');const _0x28f112=join(rootDir,_0x391b56(0x115),'loxia-terminal.js'),_0x33ca80=spawn(_0x391b56(0x139),[_0x28f112],{'cwd':rootDir,'env':{...process.env},'stdio':_0x391b56(0x122)});return _0x33ca80['on']('error',_0x29da63=>{const _0x220375=_0x391b56;console[_0x220375(0x128)](_0x220375(0x138),_0x29da63[_0x220375(0x135)]),cleanup(),process[_0x220375(0x11c)](0x1);}),_0x33ca80['on']('exit',_0x55e4cd=>{const _0x396a37=_0x391b56;console[_0x396a37(0x12c)](_0x396a37(0x127)),cleanup(),process[_0x396a37(0x11c)](_0x55e4cd||0x0);}),_0x33ca80;}function a0_0x1b78(_0x58acb9,_0x1d1f11){_0x58acb9=_0x58acb9-0x112;const _0x186a11=a0_0x186a();let _0x1b788b=_0x186a11[_0x58acb9];return _0x1b788b;}function cleanup(){const _0x2d4fb4=a0_0x1b78;serverProcess&&!serverProcess['killed']&&(console['log'](_0x2d4fb4(0x133)),serverProcess[_0x2d4fb4(0x145)](_0x2d4fb4(0x134)),setTimeout(()=>{const _0x4f62bb=_0x2d4fb4;!serverProcess['killed']&&serverProcess['kill'](_0x4f62bb(0x123));},0x1388));}process['on'](a0_0x40acea(0x129),()=>{const _0x31c69f=a0_0x40acea;console[_0x31c69f(0x12c)](_0x31c69f(0x126)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x40acea(0x134),()=>{const _0x32e6d9=a0_0x40acea;console[_0x32e6d9(0x12c)](_0x32e6d9(0x142)),cleanup(),process[_0x32e6d9(0x11c)](0x0);}),process['on']('exit',()=>{cleanup();});async function main(){const _0x4cdc16=a0_0x40acea;console['log'](_0x4cdc16(0x137)),console['log']('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console['log'](_0x4cdc16(0x13d)),console[_0x4cdc16(0x12c)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x3041f9){console[_0x4cdc16(0x128)]('Error\x20during\x20startup:',_0x3041f9[_0x4cdc16(0x135)]),cleanup(),process[_0x4cdc16(0x11c)](0x1);}}main();
3
+ function a0_0x852a(_0x3a0236,_0xd88c98){_0x3a0236=_0x3a0236-0x9e;const _0x5155ef=a0_0x5155();let _0x852ad9=_0x5155ef[_0x3a0236];return _0x852ad9;}const a0_0x5f449d=a0_0x852a;(function(_0x29fb10,_0x393420){const _0x19932f=a0_0x852a,_0x59d028=_0x29fb10();while(!![]){try{const _0x4b7d1b=parseInt(_0x19932f(0xc8))/0x1*(-parseInt(_0x19932f(0xc5))/0x2)+-parseInt(_0x19932f(0xbf))/0x3*(parseInt(_0x19932f(0xcf))/0x4)+-parseInt(_0x19932f(0xb8))/0x5*(-parseInt(_0x19932f(0xd1))/0x6)+-parseInt(_0x19932f(0xba))/0x7*(-parseInt(_0x19932f(0xaa))/0x8)+-parseInt(_0x19932f(0xad))/0x9*(parseInt(_0x19932f(0xa3))/0xa)+-parseInt(_0x19932f(0xc2))/0xb+parseInt(_0x19932f(0xb3))/0xc;if(_0x4b7d1b===_0x393420)break;else _0x59d028['push'](_0x59d028['shift']());}catch(_0x1bad5d){_0x59d028['push'](_0x59d028['shift']());}}}(a0_0x5155,0xc0878));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x5459b9 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;function a0_0x5155(){const _0x4e7bd7=['message','784BbDjpD','inherit','killed','1654reGYpL','http://localhost:','data','get','╔════════════════════════════════════════════════╗','includes','bin','1889468saHayO','error','29982mrgGbV','Error\x20during\x20startup:','SIGINT','[SERVER\x20ERROR]\x20','destroy','loxia-terminal.js','50MpsWyN','Server\x20exited\x20with\x20code\x20','trim','Server\x20returned\x20','SIGTERM','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','8NzOssS','SIGKILL','log','1918827Dkgrtv','✅\x20Server\x20is\x20ready!','Timeout','ignore','pipe','Failed\x20to\x20start\x20Terminal\x20UI:','35144052mjAjkW','statusCode','toString','ExperimentalWarning','\x0a👋\x20Terminal\x20UI\x20closed.','1220gainny','stderr','7232981gtSdxd','index.js','/health','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','exit','9FKJpLJ','node','kill','13872518jkWzhE','src'];a0_0x5155=function(){return _0x4e7bd7;};return a0_0x5155();}async function checkServerReady(_0x276a40=0xa,_0x1fc259=0x1f4){const _0x2ebf42=a0_0x852a;for(let _0x12f2ad=0x0;_0x12f2ad<_0x276a40;_0x12f2ad++){try{return await new Promise((_0x263b4f,_0x387e68)=>{const _0x38a6b7=a0_0x852a,_0x40f342=a0_0x5459b9[_0x38a6b7(0xcb)](_0x38a6b7(0xc9)+SERVER_PORT+_0x38a6b7(0xbc),_0x2e5beb=>{const _0x5917cf=_0x38a6b7;_0x2e5beb[_0x5917cf(0xb4)]===0xc8?_0x263b4f():_0x387e68(new Error(_0x5917cf(0xa6)+_0x2e5beb[_0x5917cf(0xb4)]));});_0x40f342['on'](_0x38a6b7(0xd0),_0x387e68),_0x40f342['setTimeout'](0x3e8,()=>{const _0x3a13d7=_0x38a6b7;_0x40f342[_0x3a13d7(0xa1)](),_0x387e68(new Error(_0x3a13d7(0xaf)));});}),console[_0x2ebf42(0xac)](_0x2ebf42(0xae)),!![];}catch(_0x39af5a){_0x12f2ad<_0x276a40-0x1&&await new Promise(_0x424557=>setTimeout(_0x424557,_0x1fc259));}}return console['log'](_0x2ebf42(0xa9)),![];}async function startServer(){return new Promise(_0x1612b2=>{const _0x1effb2=a0_0x852a;console[_0x1effb2(0xac)]('🚀\x20Starting\x20Loxia\x20server...');const _0x4988dc=join(rootDir,_0x1effb2(0xc3),_0x1effb2(0xbb));serverProcess=spawn(_0x1effb2(0xc0),[_0x4988dc],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x1effb2(0xb0),'pipe',_0x1effb2(0xb1)],'detached':![]}),serverProcess['stdout']['on']('data',_0x3c6f71=>{const _0x5ab783=_0x1effb2,_0x460560=_0x3c6f71['toString']()[_0x5ab783(0xa5)]();_0x460560&&console[_0x5ab783(0xac)]('[SERVER]\x20'+_0x460560);}),serverProcess[_0x1effb2(0xb9)]['on'](_0x1effb2(0xca),_0x5df387=>{const _0x1f5055=_0x1effb2,_0x11a45a=_0x5df387[_0x1f5055(0xb5)]()['trim']();_0x11a45a&&!_0x11a45a[_0x1f5055(0xcd)](_0x1f5055(0xb6))&&console[_0x1f5055(0xd0)](_0x1f5055(0xa0)+_0x11a45a);}),serverProcess['on'](_0x1effb2(0xd0),_0x2986ae=>{const _0x25530d=_0x1effb2;console[_0x25530d(0xd0)]('Failed\x20to\x20start\x20server:',_0x2986ae['message']),process[_0x25530d(0xbe)](0x1);}),serverProcess['on'](_0x1effb2(0xbe),(_0x577276,_0x3451df)=>{const _0x14bec0=_0x1effb2;_0x577276!==null&&_0x577276!==0x0&&(console[_0x14bec0(0xd0)](_0x14bec0(0xa4)+_0x577276),process[_0x14bec0(0xbe)](_0x577276));}),setTimeout(_0x1612b2,STARTUP_WAIT);});}async function startTerminalUI(){const _0x34f704=a0_0x852a;console[_0x34f704(0xac)]('🖥️\x20\x20Starting\x20Terminal\x20UI...'),console[_0x34f704(0xac)]('');const _0x3630fa=join(rootDir,_0x34f704(0xce),_0x34f704(0xa2)),_0x34804a=spawn(_0x34f704(0xc0),[_0x3630fa],{'cwd':rootDir,'env':{...process.env},'stdio':_0x34f704(0xc6)});return _0x34804a['on']('error',_0x4e7d55=>{const _0x1e0c83=_0x34f704;console[_0x1e0c83(0xd0)](_0x1e0c83(0xb2),_0x4e7d55[_0x1e0c83(0xc4)]),cleanup(),process[_0x1e0c83(0xbe)](0x1);}),_0x34804a['on'](_0x34f704(0xbe),_0x106c77=>{const _0x11909c=_0x34f704;console[_0x11909c(0xac)](_0x11909c(0xb7)),cleanup(),process[_0x11909c(0xbe)](_0x106c77||0x0);}),_0x34804a;}function cleanup(){const _0x3e677e=a0_0x852a;serverProcess&&!serverProcess[_0x3e677e(0xc7)]&&(console[_0x3e677e(0xac)]('🛑\x20Stopping\x20server...'),serverProcess[_0x3e677e(0xc1)](_0x3e677e(0xa7)),setTimeout(()=>{const _0x476a47=_0x3e677e;!serverProcess['killed']&&serverProcess[_0x476a47(0xc1)](_0x476a47(0xab));},0x1388));}process['on'](a0_0x5f449d(0x9f),()=>{const _0x2dfd7f=a0_0x5f449d;console['log'](_0x2dfd7f(0xbd)),cleanup(),process['exit'](0x0);}),process['on']('SIGTERM',()=>{const _0x53cc10=a0_0x5f449d;console[_0x53cc10(0xac)](_0x53cc10(0xa8)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x5f449d(0xbe),()=>{cleanup();});async function main(){const _0x460e3c=a0_0x5f449d;console[_0x460e3c(0xac)](_0x460e3c(0xcc)),console[_0x460e3c(0xac)]('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console[_0x460e3c(0xac)]('╚════════════════════════════════════════════════╝'),console[_0x460e3c(0xac)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x25bba2){console['error'](_0x460e3c(0x9e),_0x25bba2[_0x460e3c(0xc4)]),cleanup(),process[_0x460e3c(0xbe)](0x1);}}main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
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 a0_0x2fa00b=a0_0x432a;(function(_0x3ea013,_0x4f2b39){const _0x4a7f15=a0_0x432a,_0x59c45b=_0x3ea013();while(!![]){try{const _0x33afad=parseInt(_0x4a7f15(0x138))/0x1+parseInt(_0x4a7f15(0x14c))/0x2*(-parseInt(_0x4a7f15(0x161))/0x3)+-parseInt(_0x4a7f15(0x135))/0x4*(-parseInt(_0x4a7f15(0x13a))/0x5)+parseInt(_0x4a7f15(0x150))/0x6+parseInt(_0x4a7f15(0x173))/0x7+parseInt(_0x4a7f15(0x164))/0x8*(parseInt(_0x4a7f15(0x13b))/0x9)+-parseInt(_0x4a7f15(0x15c))/0xa*(parseInt(_0x4a7f15(0x153))/0xb);if(_0x33afad===_0x4f2b39)break;else _0x59c45b['push'](_0x59c45b['shift']());}catch(_0x387ad1){_0x59c45b['push'](_0x59c45b['shift']());}}}(a0_0x13c6,0x9c0c4));import{exec}from'child_process';import{promisify}from'util';import a0_0x3f5907 from'https';import a0_0x217e22 from'http';import a0_0x1589bf from'fs';import a0_0x15c8ff 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_0x15c8ff[a0_0x2fa00b(0x16d)](__filename),SCANNER_DIR=a0_0x15c8ff[a0_0x2fa00b(0x144)](__dirname,'..',a0_0x2fa00b(0x13d),'.scanners'),SEMGREP_VERSION=a0_0x2fa00b(0x140);console[a0_0x2fa00b(0x170)](a0_0x2fa00b(0x16a)),console[a0_0x2fa00b(0x170)](a0_0x2fa00b(0x158)),console['log'](a0_0x2fa00b(0x139)+process[a0_0x2fa00b(0x16b)]+'\x20('+process[a0_0x2fa00b(0x141)]+')'),console[a0_0x2fa00b(0x170)](a0_0x2fa00b(0x14a));async function installScanners(){const _0xd7ffa3=a0_0x2fa00b;await a0_0x1589bf[_0xd7ffa3(0x13e)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log']('\x0a═══════════════════════════════════════════════════════════'),console['log'](_0xd7ffa3(0x13f)),console[_0xd7ffa3(0x170)](_0xd7ffa3(0x14a));}async function checkESLintSecurity(){const _0x123513=a0_0x2fa00b;console[_0x123513(0x170)](_0x123513(0x180));try{await import(_0x123513(0x165)),console[_0x123513(0x170)](_0x123513(0x16c));}catch(_0x3f9f7a){console[_0x123513(0x170)](_0x123513(0x133)),console[_0x123513(0x170)](_0x123513(0x132));}}async function installSemgrep(){const _0x3fac25=a0_0x2fa00b;console[_0x3fac25(0x170)](_0x3fac25(0x172));const _0x10f731=process[_0x3fac25(0x16b)],_0x47fe45=process[_0x3fac25(0x141)];try{const _0x1f4d0e=await execAsync('semgrep\x20--version',{'timeout':0x1388});console[_0x3fac25(0x170)](_0x3fac25(0x130)+_0x1f4d0e[_0x3fac25(0x148)][_0x3fac25(0x13c)]()),console[_0x3fac25(0x170)](_0x3fac25(0x162));return;}catch(_0x1e6939){console[_0x3fac25(0x170)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0x9af8b5=getSemgrepBinaryInfo(_0x10f731,_0x47fe45);if(!_0x9af8b5){console[_0x3fac25(0x170)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x10f731+'-'+_0x47fe45),console['log'](_0x3fac25(0x15d));return;}try{const _0x25c197=a0_0x15c8ff[_0x3fac25(0x144)](SCANNER_DIR,_0x3fac25(0x15f));console[_0x3fac25(0x170)](_0x3fac25(0x169)+_0x9af8b5[_0x3fac25(0x15e)]+_0x3fac25(0x17a)),await downloadFile(_0x9af8b5[_0x3fac25(0x15e)],_0x25c197),await a0_0x1589bf['promises'][_0x3fac25(0x131)](_0x25c197,0x1ed),console[_0x3fac25(0x170)](_0x3fac25(0x176)),console[_0x3fac25(0x170)](_0x3fac25(0x17e)+_0x25c197+'\x0a'),console[_0x3fac25(0x170)](_0x3fac25(0x174)),console['log'](_0x3fac25(0x14f));}catch(_0x230e23){console[_0x3fac25(0x170)](_0x3fac25(0x155)+_0x230e23['message']),console[_0x3fac25(0x170)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0x2b9efb,_0x349abd){return null;}async function installPythonScanners(){const _0x1414be=a0_0x2fa00b;console[_0x1414be(0x170)](_0x1414be(0x159));let _0x4ec3e5=null;try{await execAsync(_0x1414be(0x143),{'timeout':0x1388}),_0x4ec3e5=_0x1414be(0x14b);}catch(_0x29fcb2){try{await execAsync(_0x1414be(0x134),{'timeout':0x1388}),_0x4ec3e5=_0x1414be(0x163);}catch(_0x2e8e71){console[_0x1414be(0x170)](_0x1414be(0x15a)),console[_0x1414be(0x170)](_0x1414be(0x179)),console[_0x1414be(0x170)](_0x1414be(0x137));return;}}console['log'](_0x1414be(0x16f)+_0x4ec3e5),await installViaPip(_0x1414be(0x15f),_0x4ec3e5),await installViaPip(_0x1414be(0x146),_0x4ec3e5),await installViaPip(_0x1414be(0x177),_0x4ec3e5),await installViaPip(_0x1414be(0x17d),_0x4ec3e5),await installViaPip(_0x1414be(0x160),_0x4ec3e5),console[_0x1414be(0x170)]('');}async function isHomebrewPython(_0x2e02df){const _0x23f457=a0_0x2fa00b;try{const {stdout:_0x358045}=await execAsync(_0x2e02df+_0x23f457(0x16e),{'timeout':0x1388});return _0x358045[_0x23f457(0x14d)](_0x23f457(0x136))||_0x358045[_0x23f457(0x14d)](_0x23f457(0x168));}catch{return![];}}async function installViaPip(_0x2582e1,_0x2bd1d5){const _0x33cdc8=a0_0x2fa00b;try{const _0x260c93=await execAsync(_0x2bd1d5+_0x33cdc8(0x181)+_0x2582e1,{'timeout':0x1388});return console['log'](_0x33cdc8(0x166)+_0x2582e1+_0x33cdc8(0x17c)),!![];}catch(_0x4f4916){console[_0x33cdc8(0x170)]('\x20\x20\x20Installing\x20'+_0x2582e1+_0x33cdc8(0x17a));try{const _0x4facb5=await isHomebrewPython(_0x2bd1d5),_0x14db27=_0x4facb5?'':_0x33cdc8(0x175),_0x597751=(_0x2bd1d5+_0x33cdc8(0x17f)+_0x14db27+'\x20'+_0x2582e1)['replace'](/\s+/g,'\x20')[_0x33cdc8(0x13c)]();return await execAsync(_0x597751,{'timeout':0xea60}),console['log'](_0x33cdc8(0x166)+_0x2582e1+_0x33cdc8(0x142)),!![];}catch(_0x23841d){return console[_0x33cdc8(0x170)]('\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20'+_0x2582e1+':\x20'+_0x23841d[_0x33cdc8(0x145)]),console[_0x33cdc8(0x170)](_0x33cdc8(0x14e)+_0x2582e1),![];}}}function a0_0x13c6(){const _0x16bb3f=['python\x20--version','651292mdAoWW','/opt/homebrew','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','1161849PXyxcA','\x20\x20Platform:\x20','20KyEvQj','1503FGadYK','trim','node_modules','promises','\x20\x20Installation\x20Complete','v1.55.0','arch','\x20installed\x20successfully','python3\x20--version','join','message','bandit','\x0aYou\x20can\x20manually\x20install\x20scanners:','stdout','startsWith','═══════════════════════════════════════════════════════════\x0a','python3','14908yjartA','includes','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20pip\x20install\x20semgrep\x0a','2889960MfQrbH','get','exit','11QoTqip','❌\x20Installation\x20failed:','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','error','catch','\x20\x20Installing\x20Security\x20Scanners','🐍\x20Checking\x20Python\x20scanners...','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','finish','25191690iZQMiE','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','url','semgrep','yamllint','249SVUWTt','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','python','44024szfHJB','eslint-plugin-security','\x20\x20\x20✅\x20','statusCode','/usr/local/Cellar','\x20\x20\x20Downloading\x20from\x20','═══════════════════════════════════════════════════════════','platform','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','dirname','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20\x20\x20✅\x20Python\x20found:\x20','log','https','🔍\x20Installing\x20Semgrep...','3942547LxQeDF','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','--user','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','pip-audit','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','...','location','\x20already\x20installed','checkov','\x20\x20\x20Location:\x20','\x20-m\x20pip\x20install\x20','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20-m\x20pip\x20show\x20','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','chmod','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'];a0_0x13c6=function(){return _0x16bb3f;};return a0_0x13c6();}function a0_0x432a(_0x2b0e81,_0x6c495e){_0x2b0e81=_0x2b0e81-0x130;const _0x13c6f6=a0_0x13c6();let _0x432a93=_0x13c6f6[_0x2b0e81];return _0x432a93;}async function downloadFile(_0x2ccd96,_0x38fea4){return new Promise((_0x45fb45,_0xa240a5)=>{const _0x242fb6=a0_0x432a,_0x3482e1=_0x2ccd96[_0x242fb6(0x149)](_0x242fb6(0x171))?a0_0x3f5907:a0_0x217e22;_0x3482e1[_0x242fb6(0x151)](_0x2ccd96,_0x19db15=>{const _0x4ad649=_0x242fb6;if(_0x19db15[_0x4ad649(0x167)]===0x12e||_0x19db15['statusCode']===0x12d){downloadFile(_0x19db15['headers'][_0x4ad649(0x17b)],_0x38fea4)['then'](_0x45fb45)[_0x4ad649(0x157)](_0xa240a5);return;}if(_0x19db15[_0x4ad649(0x167)]!==0xc8){_0xa240a5(new Error('Failed\x20to\x20download:\x20HTTP\x20'+_0x19db15[_0x4ad649(0x167)]));return;}const _0x7eb054=createWriteStream(_0x38fea4);_0x19db15['pipe'](_0x7eb054),_0x7eb054['on'](_0x4ad649(0x15b),()=>{_0x7eb054['close'](),_0x45fb45();}),_0x7eb054['on'](_0x4ad649(0x156),_0x3f3fd7=>{a0_0x1589bf['unlink'](_0x38fea4,()=>{}),_0xa240a5(_0x3f3fd7);});})['on'](_0x242fb6(0x156),_0xa240a5);});}installScanners()[a0_0x2fa00b(0x157)](_0x129d0b=>{const _0x30ef24=a0_0x2fa00b;console[_0x30ef24(0x156)](_0x30ef24(0x154),_0x129d0b[_0x30ef24(0x145)]),console['error'](_0x30ef24(0x147)),console['error'](_0x30ef24(0x178)),console['error']('\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit'),process[_0x30ef24(0x152)](0x0);});
2
+ const a0_0xe1d980=a0_0xdba0;(function(_0x1776c8,_0x505671){const _0x54df35=a0_0xdba0,_0x4e1f0e=_0x1776c8();while(!![]){try{const _0x553b11=-parseInt(_0x54df35(0x1f9))/0x1+-parseInt(_0x54df35(0x216))/0x2+-parseInt(_0x54df35(0x215))/0x3+parseInt(_0x54df35(0x22a))/0x4+parseInt(_0x54df35(0x1f1))/0x5+-parseInt(_0x54df35(0x220))/0x6*(-parseInt(_0x54df35(0x219))/0x7)+parseInt(_0x54df35(0x1fa))/0x8*(parseInt(_0x54df35(0x229))/0x9);if(_0x553b11===_0x505671)break;else _0x4e1f0e['push'](_0x4e1f0e['shift']());}catch(_0x4227c2){_0x4e1f0e['push'](_0x4e1f0e['shift']());}}}(a0_0x18e4,0x35ad2));import{exec}from'child_process';function a0_0x18e4(){const _0x9c1b7a=['═══════════════════════════════════════════════════════════','includes','--user','platform','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','headers','\x0a═══════════════════════════════════════════════════════════','44073IwDdyL','265248gJiBoc','pipe','dirname','\x0aYou\x20can\x20manually\x20install\x20scanners:','message','url','═══════════════════════════════════════════════════════════\x0a','semgrep\x20--version','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','/opt/homebrew','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','log','v1.55.0','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','statusCode','\x20\x20Platform:\x20','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','pip-audit','yamllint','\x20already\x20installed','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','72275mQwLhP','stdout','join','checkov','trim','python3\x20--version','promises','location','197634ufHSjj','968aBCGWJ','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','https','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','semgrep','python3','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','❌\x20Installation\x20failed:','startsWith','\x20\x20\x20Downloading\x20from\x20','🐍\x20Checking\x20Python\x20scanners...','bandit','error','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20\x20pip\x20install\x20semgrep\x0a','exit','get','\x20\x20Installation\x20Complete','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','Failed\x20to\x20download:\x20HTTP\x20','node_modules','arch','eslint-plugin-security','967302dpogzK','231964PZKLZO','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','\x20\x20\x20✅\x20Python\x20found:\x20','319557fRHCDy','chmod','\x20installed\x20successfully','then','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','\x20\x20Installing\x20Security\x20Scanners','/usr/local/Cellar','24hSkzQl'];a0_0x18e4=function(){return _0x9c1b7a;};return a0_0x18e4();}import{promisify}from'util';function a0_0xdba0(_0x1c19d9,_0x549514){_0x1c19d9=_0x1c19d9-0x1ec;const _0x18e432=a0_0x18e4();let _0xdba04d=_0x18e432[_0x1c19d9];return _0xdba04d;}import a0_0x560669 from'https';import a0_0x54ea6f from'http';import a0_0x66471f from'fs';import a0_0x4cc32a 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_0x4cc32a[a0_0xe1d980(0x22c)](__filename),SCANNER_DIR=a0_0x4cc32a[a0_0xe1d980(0x1f3)](__dirname,'..',a0_0xe1d980(0x212),'.scanners'),SEMGREP_VERSION=a0_0xe1d980(0x236);console['log'](a0_0xe1d980(0x221)),console[a0_0xe1d980(0x235)](a0_0xe1d980(0x21e)),console['log'](a0_0xe1d980(0x239)+process[a0_0xe1d980(0x224)]+'\x20('+process['arch']+')'),console['log'](a0_0xe1d980(0x230));async function installScanners(){const _0x265b08=a0_0xe1d980;await a0_0x66471f[_0x265b08(0x1f7)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log'](_0x265b08(0x228)),console[_0x265b08(0x235)](_0x265b08(0x20e)),console[_0x265b08(0x235)](_0x265b08(0x230));}async function checkESLintSecurity(){const _0x2dc05d=a0_0xe1d980;console[_0x2dc05d(0x235)](_0x2dc05d(0x20f));try{await import(_0x2dc05d(0x214)),console[_0x2dc05d(0x235)](_0x2dc05d(0x202));}catch(_0x3bdbeb){console[_0x2dc05d(0x235)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x2dc05d(0x235)](_0x2dc05d(0x234));}}async function installSemgrep(){const _0x32e63d=a0_0xe1d980;console['log']('🔍\x20Installing\x20Semgrep...');const _0x1ec99a=process['platform'],_0x29a018=process[_0x32e63d(0x213)];try{const _0x28b576=await execAsync(_0x32e63d(0x231),{'timeout':0x1388});console[_0x32e63d(0x235)](_0x32e63d(0x217)+_0x28b576[_0x32e63d(0x1f2)][_0x32e63d(0x1f5)]()),console[_0x32e63d(0x235)](_0x32e63d(0x1ec));return;}catch(_0x3ba3fd){console[_0x32e63d(0x235)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0x1dea9f=getSemgrepBinaryInfo(_0x1ec99a,_0x29a018);if(!_0x1dea9f){console[_0x32e63d(0x235)](_0x32e63d(0x1ff)+_0x1ec99a+'-'+_0x29a018),console[_0x32e63d(0x235)](_0x32e63d(0x21d));return;}try{const _0x543e7c=a0_0x4cc32a['join'](SCANNER_DIR,'semgrep');console[_0x32e63d(0x235)](_0x32e63d(0x205)+_0x1dea9f[_0x32e63d(0x22f)]+'...'),await downloadFile(_0x1dea9f[_0x32e63d(0x22f)],_0x543e7c),await a0_0x66471f[_0x32e63d(0x1f7)][_0x32e63d(0x21a)](_0x543e7c,0x1ed),console[_0x32e63d(0x235)](_0x32e63d(0x209)),console['log']('\x20\x20\x20Location:\x20'+_0x543e7c+'\x0a'),console['log'](_0x32e63d(0x1fd)),console[_0x32e63d(0x235)](_0x32e63d(0x20b));}catch(_0x406ecb){console[_0x32e63d(0x235)](_0x32e63d(0x237)+_0x406ecb[_0x32e63d(0x22e)]),console[_0x32e63d(0x235)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0x274213,_0x38aacc){return null;}async function installPythonScanners(){const _0x1cec4a=a0_0xe1d980;console[_0x1cec4a(0x235)](_0x1cec4a(0x206));let _0x28941c=null;try{await execAsync(_0x1cec4a(0x1f6),{'timeout':0x1388}),_0x28941c=_0x1cec4a(0x201);}catch(_0x391a45){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x28941c='python';}catch(_0x3b5452){console[_0x1cec4a(0x235)](_0x1cec4a(0x232)),console[_0x1cec4a(0x235)](_0x1cec4a(0x1fe)),console['log'](_0x1cec4a(0x226));return;}}console[_0x1cec4a(0x235)](_0x1cec4a(0x218)+_0x28941c),await installViaPip(_0x1cec4a(0x200),_0x28941c),await installViaPip(_0x1cec4a(0x207),_0x28941c),await installViaPip(_0x1cec4a(0x1ed),_0x28941c),await installViaPip(_0x1cec4a(0x1f4),_0x28941c),await installViaPip(_0x1cec4a(0x1ee),_0x28941c),console[_0x1cec4a(0x235)]('');}async function isHomebrewPython(_0x213cda){const _0x2495f3=a0_0xe1d980;try{const {stdout:_0x28e832}=await execAsync(_0x213cda+_0x2495f3(0x225),{'timeout':0x1388});return _0x28e832[_0x2495f3(0x222)](_0x2495f3(0x233))||_0x28e832[_0x2495f3(0x222)](_0x2495f3(0x21f));}catch{return![];}}async function installViaPip(_0x47bd87,_0x5214ce){const _0x85f596=a0_0xe1d980;try{const _0x2eb2cb=await execAsync(_0x5214ce+'\x20-m\x20pip\x20show\x20'+_0x47bd87,{'timeout':0x1388});return console[_0x85f596(0x235)]('\x20\x20\x20✅\x20'+_0x47bd87+_0x85f596(0x1ef)),!![];}catch(_0x543ed3){console['log']('\x20\x20\x20Installing\x20'+_0x47bd87+'...');try{const _0x58b653=await isHomebrewPython(_0x5214ce),_0x23ec66=_0x58b653?'':_0x85f596(0x223),_0x2af1b9=(_0x5214ce+'\x20-m\x20pip\x20install\x20'+_0x23ec66+'\x20'+_0x47bd87)['replace'](/\s+/g,'\x20')[_0x85f596(0x1f5)]();return await execAsync(_0x2af1b9,{'timeout':0xea60}),console[_0x85f596(0x235)]('\x20\x20\x20✅\x20'+_0x47bd87+_0x85f596(0x21b)),!![];}catch(_0x2ea39f){return console[_0x85f596(0x235)](_0x85f596(0x1fb)+_0x47bd87+':\x20'+_0x2ea39f[_0x85f596(0x22e)]),console[_0x85f596(0x235)](_0x85f596(0x1f0)+_0x47bd87),![];}}}async function downloadFile(_0x5effd4,_0x4d3db8){return new Promise((_0xe061c4,_0x7120a2)=>{const _0x1bee71=a0_0xdba0,_0x316da5=_0x5effd4[_0x1bee71(0x204)](_0x1bee71(0x1fc))?a0_0x560669:a0_0x54ea6f;_0x316da5[_0x1bee71(0x20d)](_0x5effd4,_0x4b4c2c=>{const _0x3d509b=_0x1bee71;if(_0x4b4c2c[_0x3d509b(0x238)]===0x12e||_0x4b4c2c['statusCode']===0x12d){downloadFile(_0x4b4c2c[_0x3d509b(0x227)][_0x3d509b(0x1f8)],_0x4d3db8)[_0x3d509b(0x21c)](_0xe061c4)['catch'](_0x7120a2);return;}if(_0x4b4c2c[_0x3d509b(0x238)]!==0xc8){_0x7120a2(new Error(_0x3d509b(0x211)+_0x4b4c2c[_0x3d509b(0x238)]));return;}const _0x52e180=createWriteStream(_0x4d3db8);_0x4b4c2c[_0x3d509b(0x22b)](_0x52e180),_0x52e180['on']('finish',()=>{_0x52e180['close'](),_0xe061c4();}),_0x52e180['on'](_0x3d509b(0x208),_0x5bd715=>{a0_0x66471f['unlink'](_0x4d3db8,()=>{}),_0x7120a2(_0x5bd715);});})['on'](_0x1bee71(0x208),_0x7120a2);});}installScanners()['catch'](_0x1ad224=>{const _0x3074c5=a0_0xe1d980;console[_0x3074c5(0x208)](_0x3074c5(0x203),_0x1ad224[_0x3074c5(0x22e)]),console[_0x3074c5(0x208)](_0x3074c5(0x22d)),console[_0x3074c5(0x208)](_0x3074c5(0x210)),console[_0x3074c5(0x208)](_0x3074c5(0x20a)),process[_0x3074c5(0x20c)](0x0);});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x2678f9=a0_0x591a;(function(_0x35ad84,_0x5d4ebf){const _0x12e5b0=a0_0x591a,_0xe78048=_0x35ad84();while(!![]){try{const _0x418d13=-parseInt(_0x12e5b0(0x9b))/0x1*(-parseInt(_0x12e5b0(0x83))/0x2)+parseInt(_0x12e5b0(0x98))/0x3*(-parseInt(_0x12e5b0(0x88))/0x4)+parseInt(_0x12e5b0(0x79))/0x5+-parseInt(_0x12e5b0(0x85))/0x6*(parseInt(_0x12e5b0(0x8f))/0x7)+parseInt(_0x12e5b0(0x8d))/0x8+-parseInt(_0x12e5b0(0x77))/0x9*(-parseInt(_0x12e5b0(0x99))/0xa)+-parseInt(_0x12e5b0(0x84))/0xb;if(_0x418d13===_0x5d4ebf)break;else _0xe78048['push'](_0xe78048['shift']());}catch(_0x1c2f42){_0xe78048['push'](_0xe78048['shift']());}}}(a0_0x4255,0x976b4));const {spawn,execSync}=require(a0_0x2678f9(0x7d)),path=require(a0_0x2678f9(0x7f)),fs=require('fs'),logFile=path['join'](__dirname,a0_0x2678f9(0x87));function log(_0x1cbbf4){const _0x37a0c3=a0_0x2678f9,_0x41c3da=new Date()['toISOString'](),_0x54e27d='['+_0x41c3da+']\x20'+_0x1cbbf4+'\x0a';console[_0x37a0c3(0x73)](_0x1cbbf4);try{fs[_0x37a0c3(0x90)](logFile,_0x54e27d);}catch(_0x287754){}}log(a0_0x2678f9(0x7e));function parseArgs(){const _0x59df2f=a0_0x2678f9,_0x584838=process['argv']['slice'](0x2),_0x223240={'delay':0x1388,'command':_0x59df2f(0x82),'pid':null};for(let _0x474c78=0x0;_0x474c78<_0x584838[_0x59df2f(0x7a)];_0x474c78++){switch(_0x584838[_0x474c78]){case _0x59df2f(0x93):_0x223240[_0x59df2f(0x81)]=parseInt(_0x584838[++_0x474c78],0xa)||0x1388;break;case _0x59df2f(0x8b):_0x223240[_0x59df2f(0x8e)]=_0x584838[++_0x474c78]||'loxia\x20web';break;case _0x59df2f(0x96):_0x223240[_0x59df2f(0x95)]=parseInt(_0x584838[++_0x474c78],0xa)||null;break;}}return _0x223240;}function a0_0x4255(){const _0x26b424=['[Watchdog]\x20Parent\x20process\x20','--command','ignore','6259944KQibJT','command','8015833APAcqP','appendFileSync','[Watchdog]\x20Watchdog\x20exiting...','join','--delay','[Watchdog]\x20Waiting\x20','pid','--pid','catch','3QSQkGQ','18770IuUkdR','[Watchdog]\x20Executing:\x20','2ThWxCF','\x20has\x20terminated','message','win32','log','ms\x20before\x20restart...','[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20','exit','3951hymQwz','slice','4207705kfViUf','length','\x20still\x20running\x20after\x20','\x20to\x20exit...','child_process','[Watchdog]\x20Script\x20loaded','path','kill','delay','loxia\x20web','182482vnXdyk','7438255fWODRV','6eMYIAb','unref','watchdog.log','755932QhPTNt','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20'];a0_0x4255=function(){return _0x26b424;};return a0_0x4255();}function isProcessRunning(_0x175b74){const _0x4cdab6=a0_0x2678f9;try{return process[_0x4cdab6(0x80)](_0x175b74,0x0),!![];}catch(_0x21a31e){return![];}}async function waitForParentExit(_0x281af7,_0x26293b=0x7530){const _0x113dc1=a0_0x2678f9;if(!_0x281af7)return;const _0x32f4e=Date['now']();while(isProcessRunning(_0x281af7)){if(Date['now']()-_0x32f4e>_0x26293b){log(_0x113dc1(0x8a)+_0x281af7+_0x113dc1(0x7b)+_0x26293b+'ms,\x20proceeding\x20anyway');return;}await new Promise(_0x4c2064=>setTimeout(_0x4c2064,0x1f4));}log('[Watchdog]\x20Parent\x20process\x20'+_0x281af7+_0x113dc1(0x9c));}function a0_0x591a(_0x4f20a7,_0x599678){_0x4f20a7=_0x4f20a7-0x71;const _0x425532=a0_0x4255();let _0x591ae8=_0x425532[_0x4f20a7];return _0x591ae8;}async function main(){const _0x3d9c47=a0_0x2678f9,_0x120025=parseArgs();log('[Watchdog]\x20Started\x20with\x20options:',{'delay':_0x120025[_0x3d9c47(0x81)],'command':_0x120025['command'],'pid':_0x120025[_0x3d9c47(0x95)]});_0x120025['pid']&&(log(_0x3d9c47(0x89)+_0x120025[_0x3d9c47(0x95)]+_0x3d9c47(0x7c)),await waitForParentExit(_0x120025[_0x3d9c47(0x95)]));log(_0x3d9c47(0x94)+_0x120025[_0x3d9c47(0x81)]+_0x3d9c47(0x74)),await new Promise(_0x208c52=>setTimeout(_0x208c52,_0x120025[_0x3d9c47(0x81)]));const _0x2219d0=_0x120025[_0x3d9c47(0x8e)]['split']('\x20'),_0x13d283=_0x2219d0[0x0],_0xf1522=_0x2219d0[_0x3d9c47(0x78)](0x1);log(_0x3d9c47(0x9a)+_0x13d283+'\x20'+_0xf1522[_0x3d9c47(0x92)]('\x20'));const _0x214631=process['platform']===_0x3d9c47(0x72),_0x1aa8dc=spawn(_0x13d283,_0xf1522,{'detached':!![],'stdio':_0x3d9c47(0x8c),'shell':!![],'windowsHide':![]});_0x1aa8dc[_0x3d9c47(0x86)](),log(_0x3d9c47(0x75)+_0x1aa8dc[_0x3d9c47(0x95)]),log(_0x3d9c47(0x91)),setTimeout(()=>process[_0x3d9c47(0x76)](0x0),0x3e8);}main()[a0_0x2678f9(0x97)](_0x149c74=>{const _0x1af7f4=a0_0x2678f9;log('[Watchdog]\x20Error:\x20'+_0x149c74[_0x1af7f4(0x71)]),process[_0x1af7f4(0x76)](0x1);});
2
+ function a0_0x5e3b(){const _0x428527=['slice','win32','argv','147bYDwij','63SDFpiB','path','unref','toISOString','ms\x20before\x20restart...','message','--pid','\x20still\x20running\x20after\x20','join','ignore','5762580ZdMcLL','[Watchdog]\x20Parent\x20process\x20','command','pid','split','[Watchdog]\x20Error:\x20','963804tGoLCl','ms,\x20proceeding\x20anyway','\x20has\x20terminated','6198GaVMow','delay','334072FmTrLe','exit','948084djVikT','[Watchdog]\x20Executing:\x20','[Watchdog]\x20Started\x20with\x20options:','141293IsbGdZ','[Watchdog]\x20Waiting\x20','appendFileSync','4854510JYLlci','loxia\x20web','log','\x20to\x20exit...','catch','now','10opzgbQ','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','platform','--command'];a0_0x5e3b=function(){return _0x428527;};return a0_0x5e3b();}const a0_0x16a350=a0_0xfbf3;(function(_0x408048,_0x3fe22c){const _0x33746a=a0_0xfbf3,_0x3d6ae6=_0x408048();while(!![]){try{const _0x3839be=parseInt(_0x33746a(0xb8))/0x1+parseInt(_0x33746a(0xb1))/0x2*(parseInt(_0x33746a(0x9d))/0x3)+-parseInt(_0x33746a(0xae))/0x4*(-parseInt(_0x33746a(0xc1))/0x5)+-parseInt(_0x33746a(0xb5))/0x6+parseInt(_0x33746a(0x9e))/0x7*(-parseInt(_0x33746a(0xb3))/0x8)+-parseInt(_0x33746a(0xbb))/0x9+parseInt(_0x33746a(0xa8))/0xa;if(_0x3839be===_0x3fe22c)break;else _0x3d6ae6['push'](_0x3d6ae6['shift']());}catch(_0x4e55b4){_0x3d6ae6['push'](_0x3d6ae6['shift']());}}}(a0_0x5e3b,0x43e35));const {spawn,execSync}=require('child_process'),path=require(a0_0x16a350(0x9f)),fs=require('fs'),logFile=path[a0_0x16a350(0xa6)](__dirname,'watchdog.log');function log(_0x3b48e1){const _0x3163a6=a0_0x16a350,_0x247819=new Date()[_0x3163a6(0xa1)](),_0x24681f='['+_0x247819+']\x20'+_0x3b48e1+'\x0a';console[_0x3163a6(0xbd)](_0x3b48e1);try{fs[_0x3163a6(0xba)](logFile,_0x24681f);}catch(_0x1936f6){}}log('[Watchdog]\x20Script\x20loaded');function parseArgs(){const _0x1a2a83=a0_0x16a350,_0x29f297=process[_0x1a2a83(0x9c)][_0x1a2a83(0xc5)](0x2),_0x126ffe={'delay':0x1388,'command':_0x1a2a83(0xbc),'pid':null};for(let _0x56ae80=0x0;_0x56ae80<_0x29f297['length'];_0x56ae80++){switch(_0x29f297[_0x56ae80]){case'--delay':_0x126ffe[_0x1a2a83(0xb2)]=parseInt(_0x29f297[++_0x56ae80],0xa)||0x1388;break;case _0x1a2a83(0xc4):_0x126ffe[_0x1a2a83(0xaa)]=_0x29f297[++_0x56ae80]||_0x1a2a83(0xbc);break;case _0x1a2a83(0xa4):_0x126ffe[_0x1a2a83(0xab)]=parseInt(_0x29f297[++_0x56ae80],0xa)||null;break;}}return _0x126ffe;}function a0_0xfbf3(_0x6f8dd6,_0x2aa5c6){_0x6f8dd6=_0x6f8dd6-0x9c;const _0x5e3b14=a0_0x5e3b();let _0xfbf38d=_0x5e3b14[_0x6f8dd6];return _0xfbf38d;}function isProcessRunning(_0x4412e6){try{return process['kill'](_0x4412e6,0x0),!![];}catch(_0x5bd975){return![];}}async function waitForParentExit(_0x214a39,_0x57667d=0x7530){const _0x47a97d=a0_0x16a350;if(!_0x214a39)return;const _0x378218=Date[_0x47a97d(0xc0)]();while(isProcessRunning(_0x214a39)){if(Date['now']()-_0x378218>_0x57667d){log(_0x47a97d(0xa9)+_0x214a39+_0x47a97d(0xa5)+_0x57667d+_0x47a97d(0xaf));return;}await new Promise(_0x41273e=>setTimeout(_0x41273e,0x1f4));}log(_0x47a97d(0xa9)+_0x214a39+_0x47a97d(0xb0));}async function main(){const _0x327db8=a0_0x16a350,_0x1504a5=parseArgs();log(_0x327db8(0xb7),{'delay':_0x1504a5[_0x327db8(0xb2)],'command':_0x1504a5[_0x327db8(0xaa)],'pid':_0x1504a5[_0x327db8(0xab)]});_0x1504a5[_0x327db8(0xab)]&&(log(_0x327db8(0xc2)+_0x1504a5[_0x327db8(0xab)]+_0x327db8(0xbe)),await waitForParentExit(_0x1504a5[_0x327db8(0xab)]));log(_0x327db8(0xb9)+_0x1504a5[_0x327db8(0xb2)]+_0x327db8(0xa2)),await new Promise(_0x2caa62=>setTimeout(_0x2caa62,_0x1504a5[_0x327db8(0xb2)]));const _0x5b4d96=_0x1504a5[_0x327db8(0xaa)][_0x327db8(0xac)]('\x20'),_0x4326a8=_0x5b4d96[0x0],_0x24c8df=_0x5b4d96['slice'](0x1);log(_0x327db8(0xb6)+_0x4326a8+'\x20'+_0x24c8df[_0x327db8(0xa6)]('\x20'));const _0x336a4f=process[_0x327db8(0xc3)]===_0x327db8(0xc6),_0xe45af7=spawn(_0x4326a8,_0x24c8df,{'detached':!![],'stdio':_0x327db8(0xa7),'shell':!![],'windowsHide':![]});_0xe45af7[_0x327db8(0xa0)](),log('[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20'+_0xe45af7[_0x327db8(0xab)]),log('[Watchdog]\x20Watchdog\x20exiting...'),setTimeout(()=>process['exit'](0x0),0x3e8);}main()[a0_0x16a350(0xbf)](_0x2a796a=>{const _0x30efe6=a0_0x16a350;log(_0x30efe6(0xad)+_0x2a796a[_0x30efe6(0xa3)]),process[_0x30efe6(0xb4)](0x1);});
@@ -1 +1 @@
1
- const a0_0x135d06=a0_0x5f04;function a0_0x5f04(_0x58495a,_0x11d3f0){_0x58495a=_0x58495a-0xb0;const _0x1d5f74=a0_0x1d5f();let _0x5f0496=_0x1d5f74[_0x58495a];if(a0_0x5f04['JvFjJN']===undefined){var _0x573c89=function(_0x497f87){const _0x3145b1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x6193ac='',_0x222ec3='';for(let _0x4478d6=0x0,_0x5aac29,_0x420319,_0x39de54=0x0;_0x420319=_0x497f87['charAt'](_0x39de54++);~_0x420319&&(_0x5aac29=_0x4478d6%0x4?_0x5aac29*0x40+_0x420319:_0x420319,_0x4478d6++%0x4)?_0x6193ac+=String['fromCharCode'](0xff&_0x5aac29>>(-0x2*_0x4478d6&0x6)):0x0){_0x420319=_0x3145b1['indexOf'](_0x420319);}for(let _0x362c01=0x0,_0x4155fa=_0x6193ac['length'];_0x362c01<_0x4155fa;_0x362c01++){_0x222ec3+='%'+('00'+_0x6193ac['charCodeAt'](_0x362c01)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x222ec3);};a0_0x5f04['tCyhDr']=_0x573c89,a0_0x5f04['wexffH']={},a0_0x5f04['JvFjJN']=!![];}const _0x1355e9=_0x1d5f74[0x0],_0xbc62fe=_0x58495a+_0x1355e9,_0x6fb8e=a0_0x5f04['wexffH'][_0xbc62fe];return!_0x6fb8e?(_0x5f0496=a0_0x5f04['tCyhDr'](_0x5f0496),a0_0x5f04['wexffH'][_0xbc62fe]=_0x5f0496):_0x5f0496=_0x6fb8e,_0x5f0496;}(function(_0x4cfeb1,_0x3e6bd1){const _0x106c72=a0_0x5f04,_0x3489bd=_0x4cfeb1();while(!![]){try{const _0x3cc794=-parseInt(_0x106c72(0xdd))/0x1+parseInt(_0x106c72(0xc7))/0x2*(-parseInt(_0x106c72(0xbb))/0x3)+parseInt(_0x106c72(0xde))/0x4*(parseInt(_0x106c72(0xda))/0x5)+-parseInt(_0x106c72(0xe8))/0x6+-parseInt(_0x106c72(0xd1))/0x7*(-parseInt(_0x106c72(0xc1))/0x8)+-parseInt(_0x106c72(0xed))/0x9+parseInt(_0x106c72(0xd0))/0xa;if(_0x3cc794===_0x3e6bd1)break;else _0x3489bd['push'](_0x3489bd['shift']());}catch(_0x1526ad){_0x3489bd['push'](_0x3489bd['shift']());}}}(a0_0x1d5f,0x29cc5));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x6193ac=null){const _0xb9ed14=a0_0x5f04;this[_0xb9ed14(0xd7)]=_0x6193ac,this['stylelint']=null,this[_0xb9ed14(0xbf)]=null,this[_0xb9ed14(0xc3)]=null,this['postcssLess']=null;}async[a0_0x135d06(0xd9)](_0x222ec3,_0x4478d6,_0x5aac29={}){const _0x5a6a64=a0_0x135d06;try{const _0x420319=[],_0x39de54=this['detectLanguage'](_0x222ec3),_0x362c01=await this[_0x5a6a64(0xc4)](_0x222ec3,_0x4478d6,_0x39de54);_0x420319[_0x5a6a64(0xb9)](..._0x362c01);if(_0x362c01['length']===0x0){const _0x4155fa=await this[_0x5a6a64(0xb3)](_0x222ec3,_0x4478d6,_0x39de54);_0x420319[_0x5a6a64(0xb9)](..._0x4155fa);}return this['logger']?.[_0x5a6a64(0xd5)]('CSS\x20analysis\x20completed',{'file':_0x222ec3,'language':_0x39de54,'totalDiagnostics':_0x420319['length'],'errors':_0x420319['filter'](_0x3c8176=>_0x3c8176['severity']===STATIC_ANALYSIS['SEVERITY'][_0x5a6a64(0xb8)])[_0x5a6a64(0xc8)],'warnings':_0x420319['filter'](_0x32d418=>_0x32d418[_0x5a6a64(0xb0)]===STATIC_ANALYSIS['SEVERITY'][_0x5a6a64(0xdf)])['length']}),_0x420319;}catch(_0x12c3ed){return this['logger']?.['error']('CSS\x20analysis\x20failed',{'file':_0x222ec3,'error':_0x12c3ed[_0x5a6a64(0xe9)]}),[];}}async['checkSyntax'](_0x536d0b,_0x21bb68,_0x111b7d){const _0x2505e5=a0_0x135d06,_0x4887ed=[];try{if(!this['postcss']){const _0x3c8093=await import('postcss');this[_0x2505e5(0xbf)]=_0x3c8093['default'];}let _0xee0ce7=null;if(_0x111b7d===_0x2505e5(0xc2)){if(!this['postcssScss']){const _0x5f5aa7=await import(_0x2505e5(0xd2));this['postcssScss']=_0x5f5aa7[_0x2505e5(0xe4)];}_0xee0ce7=this[_0x2505e5(0xc3)];}else{if(_0x111b7d===_0x2505e5(0xd8)){if(!this[_0x2505e5(0xce)]){const _0x107706=await import(_0x2505e5(0xe0));this['postcssLess']=_0x107706['default'];}_0xee0ce7=this['postcssLess'];}}const _0xf20fad=this[_0x2505e5(0xbf)]()[_0x2505e5(0xe2)](_0x21bb68,{'from':_0x536d0b,'syntax':_0xee0ce7}),_0x1fd71f=_0xf20fad['root'];this['logger']?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0x536d0b});}catch(_0x38297b){const _0x10995a=this[_0x2505e5(0xcd)](_0x38297b,_0x536d0b);_0x10995a&&_0x4887ed['push'](_0x10995a);}return _0x4887ed;}async['lintStyles'](_0xc6f40b,_0x513afd,_0x3f8c30){const _0x1c9cdf=a0_0x135d06,_0x5e1a25=[];try{if(!this['stylelint']){const _0x2b96f5=await import('stylelint');this[_0x1c9cdf(0xe3)]=_0x2b96f5[_0x1c9cdf(0xe4)];}const _0x408ca4={'extends':['stylelint-config-standard'],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':['/^custom-/','ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x3f8c30==='scss'?[!![],{'ignoreAtRules':['mixin','include','extend','if',_0x1c9cdf(0xca),'for','each',_0x1c9cdf(0xc5),'function','return',_0x1c9cdf(0xb4),_0x1c9cdf(0xb5),_0x1c9cdf(0xee)]}]:_0x3f8c30==='less'?[!![],{'ignoreAtRules':[_0x1c9cdf(0xbe)]}]:!![],'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':_0x1c9cdf(0xb6),'selector-type-case':_0x1c9cdf(0xba)},'customSyntax':_0x3f8c30===_0x1c9cdf(0xc2)?_0x1c9cdf(0xd2):_0x3f8c30==='less'?_0x1c9cdf(0xe0):undefined},_0x370ad0=await this[_0x1c9cdf(0xe3)][_0x1c9cdf(0xc6)]({'code':_0x513afd,'codeFilename':_0xc6f40b,'config':_0x408ca4});if(_0x370ad0['results']&&_0x370ad0[_0x1c9cdf(0xdb)]['length']>0x0){const _0x2e0319=_0x370ad0['results'][0x0];if(_0x2e0319['warnings'])for(const _0x4e68ef of _0x2e0319['warnings']){_0x5e1a25['push']({'file':_0xc6f40b,'line':_0x4e68ef[_0x1c9cdf(0xc9)]||0x1,'column':_0x4e68ef[_0x1c9cdf(0xcf)]||0x1,'severity':_0x4e68ef['severity']==='error'?STATIC_ANALYSIS['SEVERITY'][_0x1c9cdf(0xb8)]:STATIC_ANALYSIS[_0x1c9cdf(0xb7)]['WARNING'],'rule':_0x4e68ef['rule']||_0x1c9cdf(0xb2),'message':_0x4e68ef[_0x1c9cdf(0xea)],'category':this['categorizeStylelintRule'](_0x4e68ef['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x5408b3){this['logger']?.[_0x1c9cdf(0xbd)]('Stylelint\x20analysis\x20failed',{'file':_0xc6f40b,'error':_0x5408b3['message']});}return _0x5e1a25;}[a0_0x135d06(0xcd)](_0x3f296c,_0x2548eb){const _0x2977e2=a0_0x135d06;return{'file':_0x2548eb,'line':_0x3f296c[_0x2977e2(0xc9)]||0x1,'column':_0x3f296c[_0x2977e2(0xcf)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x2977e2(0xb8)],'rule':_0x3f296c[_0x2977e2(0xc0)]||_0x2977e2(0xec),'message':_0x3f296c[_0x2977e2(0xe6)]||_0x3f296c[_0x2977e2(0xe9)],'category':STATIC_ANALYSIS[_0x2977e2(0xcb)]['SYNTAX'],'fixable':![],'source':_0x2977e2(0xbf),'code':_0x3f296c['source']||undefined};}['categorizeStylelintRule'](_0x540241){const _0x58fe6e=a0_0x135d06;if(!_0x540241)return STATIC_ANALYSIS['CATEGORY']['STYLE'];const _0x5a689f=_0x540241['toLowerCase']();if(_0x5a689f['includes']('no-invalid')||_0x5a689f['includes']('no-unknown')||_0x5a689f[_0x58fe6e(0xbc)](_0x58fe6e(0xe1))||_0x5a689f[_0x58fe6e(0xbc)](_0x58fe6e(0xdc)))return STATIC_ANALYSIS[_0x58fe6e(0xcb)]['SYNTAX'];if(_0x5a689f['includes']('performance')||_0x5a689f['includes']('optimize'))return STATIC_ANALYSIS['CATEGORY']['PERFORMANCE'];if(_0x5a689f[_0x58fe6e(0xbc)](_0x58fe6e(0xb1))||_0x5a689f[_0x58fe6e(0xbc)]('recommended'))return STATIC_ANALYSIS[_0x58fe6e(0xcb)]['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x58fe6e(0xcb)]['STYLE'];}[a0_0x135d06(0xd4)](_0x2c93ce){const _0x24db79=a0_0x135d06,_0x4e010f=_0x2c93ce['toLowerCase']();if(_0x4e010f['endsWith']('.scss')||_0x4e010f['endsWith'](_0x24db79(0xeb)))return _0x24db79(0xc2);if(_0x4e010f['endsWith'](_0x24db79(0xd3)))return'less';return _0x24db79(0xe7);}[a0_0x135d06(0xd6)](){const _0x68c689=a0_0x135d06;return[_0x68c689(0xcc),'.scss',_0x68c689(0xeb),'.less'];}[a0_0x135d06(0xe5)](){return![];}}export default CSSAnalyzer;function a0_0x1d5f(){const _0x27981b=['BMfTzq','nJa3nZy4uerYC2vR','C2nZCW','Cg9ZDgnZC1nJC3m','y2HLy2TtEw50yxG','D2HPBgu','BgLUDa','mtqYz09ozKrJ','BgvUz3rO','BgLUzq','zwXZzq','q0furuDpuLK','lMnZCW','zM9YBwf0ug9ZDentu0vYCM9Y','Cg9ZDgnZC0XLC3m','y29SDw1U','mJC3mdm1mhLOEg1yAG','mJHYzKTTEeq','Cg9ZDgnZCY1Zy3nZ','lMXLC3m','zgv0zwn0tgfUz3vHz2u','zgvIDwC','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','Bg9Nz2vY','BgvZCW','yw5HBhL6zq','mtu3mtC1r0rtqLfs','CMvZDwX0CW','C3LUDgf4','mJy0otC2rw1OEg5X','ohDJC0Pxuq','v0fstKLorW','Cg9ZDgnZCY1SzxnZ','BM8Tzw1WDhK','ChjVy2vZCW','C3r5BgvSAw50','zgvMyxvSDa','C3vWCg9YDhnbDxrVrML4','CMvHC29U','y3nZ','mZiZnJCWEeTYBuzv','BwvZC2fNzq','Dgv4Da','lNnHC3m','q3nZu3LUDgf4rxjYB3i','nte1odq0tM5Lz1HK','zM9YD2fYza','C2v2zxjPDhK','yMvZDc1WCMfJDgLJzq','Dw5RBM93BG','BgLUDfn0EwXLCW','y29UDgvUDa','DxnL','zg91yMXL','u0vwrvjjvfK','rvjst1i','ChvZAa','Bg93zxi','nda3mwjSseTvua','Aw5JBhvKzxm','D2fYBG','CgX1z2LU','Cg9ZDgnZCW'];a0_0x1d5f=function(){return _0x27981b;};return a0_0x1d5f();}
1
+ function a0_0x490b(_0x143adb,_0x195bd3){_0x143adb=_0x143adb-0x122;const _0x4e7a2c=a0_0x4e7a();let _0x490b74=_0x4e7a2c[_0x143adb];if(a0_0x490b['iTWiqF']===undefined){var _0x488037=function(_0x43e621){const _0x5cddbb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x391660='',_0x6dab52='';for(let _0x4f3faa=0x0,_0x49f72b,_0x4c7bb8,_0x8b9e45=0x0;_0x4c7bb8=_0x43e621['charAt'](_0x8b9e45++);~_0x4c7bb8&&(_0x49f72b=_0x4f3faa%0x4?_0x49f72b*0x40+_0x4c7bb8:_0x4c7bb8,_0x4f3faa++%0x4)?_0x391660+=String['fromCharCode'](0xff&_0x49f72b>>(-0x2*_0x4f3faa&0x6)):0x0){_0x4c7bb8=_0x5cddbb['indexOf'](_0x4c7bb8);}for(let _0x206fac=0x0,_0x55c3b3=_0x391660['length'];_0x206fac<_0x55c3b3;_0x206fac++){_0x6dab52+='%'+('00'+_0x391660['charCodeAt'](_0x206fac)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6dab52);};a0_0x490b['LKgKXM']=_0x488037,a0_0x490b['fdjfPb']={},a0_0x490b['iTWiqF']=!![];}const _0x103c46=_0x4e7a2c[0x0],_0x7b4e63=_0x143adb+_0x103c46,_0x143a5a=a0_0x490b['fdjfPb'][_0x7b4e63];return!_0x143a5a?(_0x490b74=a0_0x490b['LKgKXM'](_0x490b74),a0_0x490b['fdjfPb'][_0x7b4e63]=_0x490b74):_0x490b74=_0x143a5a,_0x490b74;}const a0_0x2d3683=a0_0x490b;function a0_0x4e7a(){const _0x3a29f2=['zM9Y','zgv0zwn0tgfUz3vHz2u','q0furuDpuLK','C2v2zxjPDhK','l15JDxn0B20TlW','zxjYB3i','zg91yMXL','BM8TAw52ywXPza','BgvUz3rO','Aw5JBhvKzxm','mty3m1zczvnRzq','Cg9ZDgnZCY1SzxnZ','q1ntigfUywX5C2LZigzHAwXLza','BgvZCW','mZyYnde3nfLoyLnuEG','yw5HBhL6zq','zM9YBwf0ug9ZDentu0vYCM9Y','u0vwrvjjvfK','Cg9ZDgnZCY1Zy3nZ','Dw5RBM93BG','BgLUzq','ntiYnJrQyKfsDuG','v0fstKLorW','rvjst1i','mZiZmZeZmvnsBfvzrW','zxH0zw5K','y29UDgvUDa','C3vWCg9YDhnbDxrVrML4','D2fYBMLUz3m','Cg9ZDgnZCW','Dgv4Da','C3r5BgvSAw50','ChvZAa','zMLSDgvY','zgvMyxvSDa','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','Cg9ZDgnZC0XLC3m','C2nZCW','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','CMvZDwX0CW','ChjVy2vZCW','Bg9Nz2vY','mteYmZu2nKXewfrYqq','Cg9ZDgnZC1nJC3m','ndbMuMTAtMu','ntqXnZG1tLvkuhHX','nJq4ogzkCMrYta','Dg9mB3DLCKnHC2u','zM9YD2fYza','q3nZu3LUDgf4rxjYB3i','nda5nwreCfHTsa','zgvIDwC','lMnZCW','y2HLy2TtEw50yxG','u1Lovefy','zwfJAa','zw5KC1DPDgG','CgX1z2LU','mZy5mdaWow50wuTpra','BgLUDfn0EwXLCW','BM8Tzw1WDhK','CNvSzq','BwvZC2fNzq','nMjRBNDwsG'];a0_0x4e7a=function(){return _0x3a29f2;};return a0_0x4e7a();}(function(_0xc0e69a,_0x2c1586){const _0x5f63eb=a0_0x490b,_0x3b9063=_0xc0e69a();while(!![]){try{const _0x576077=parseInt(_0x5f63eb(0x135))/0x1*(parseInt(_0x5f63eb(0x147))/0x2)+parseInt(_0x5f63eb(0x132))/0x3+parseInt(_0x5f63eb(0x136))/0x4*(-parseInt(_0x5f63eb(0x13a))/0x5)+-parseInt(_0x5f63eb(0x156))/0x6+parseInt(_0x5f63eb(0x152))/0x7*(parseInt(_0x5f63eb(0x15d))/0x8)+parseInt(_0x5f63eb(0x142))/0x9+-parseInt(_0x5f63eb(0x134))/0xa*(parseInt(_0x5f63eb(0x160))/0xb);if(_0x576077===_0x2c1586)break;else _0x3b9063['push'](_0x3b9063['shift']());}catch(_0x41fde1){_0x3b9063['push'](_0x3b9063['shift']());}}}(a0_0x4e7a,0xd2b9e));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x391660=null){const _0x532fcd=a0_0x490b;this[_0x532fcd(0x131)]=_0x391660,this['stylelint']=null,this[_0x532fcd(0x125)]=null,this[_0x532fcd(0x133)]=null,this['postcssLess']=null;}async[a0_0x2d3683(0x157)](_0x6dab52,_0x4f3faa,_0x49f72b={}){const _0x557067=a0_0x2d3683;try{const _0x4c7bb8=[],_0x8b9e45=this['detectLanguage'](_0x6dab52),_0x206fac=await this[_0x557067(0x13d)](_0x6dab52,_0x4f3faa,_0x8b9e45);_0x4c7bb8['push'](..._0x206fac);if(_0x206fac[_0x557067(0x150)]===0x0){const _0x55c3b3=await this['lintStyles'](_0x6dab52,_0x4f3faa,_0x8b9e45);_0x4c7bb8[_0x557067(0x128)](..._0x55c3b3);}return this[_0x557067(0x131)]?.[_0x557067(0x13b)]('CSS\x20analysis\x20completed',{'file':_0x6dab52,'language':_0x8b9e45,'totalDiagnostics':_0x4c7bb8[_0x557067(0x150)],'errors':_0x4c7bb8[_0x557067(0x129)](_0x1c8209=>_0x1c8209[_0x557067(0x14b)]===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x4c7bb8[_0x557067(0x129)](_0x4408b7=>_0x4408b7['severity']===STATIC_ANALYSIS['SEVERITY'][_0x557067(0x15e)])[_0x557067(0x150)]}),_0x4c7bb8;}catch(_0x5954c1){return this[_0x557067(0x131)]?.['error'](_0x557067(0x154),{'file':_0x6dab52,'error':_0x5954c1[_0x557067(0x146)]}),[];}}async[a0_0x2d3683(0x13d)](_0x4dca6b,_0x10b524,_0x14e7ae){const _0x10942b=a0_0x2d3683,_0x585616=[];try{if(!this[_0x10942b(0x125)]){const _0x24a452=await import(_0x10942b(0x125));this['postcss']=_0x24a452[_0x10942b(0x12a)];}let _0x182bf8=null;if(_0x14e7ae==='scss'){if(!this['postcssScss']){const _0x2b3a76=await import('postcss-scss');this['postcssScss']=_0x2b3a76['default'];}_0x182bf8=this[_0x10942b(0x133)];}else{if(_0x14e7ae==='less'){if(!this['postcssLess']){const _0x2add54=await import(_0x10942b(0x153));this[_0x10942b(0x12c)]=_0x2add54[_0x10942b(0x12a)];}_0x182bf8=this[_0x10942b(0x12c)];}}const _0x2ec3b8=this[_0x10942b(0x125)]()[_0x10942b(0x130)](_0x10b524,{'from':_0x4dca6b,'syntax':_0x182bf8}),_0x5d3885=_0x2ec3b8['root'];this['logger']?.[_0x10942b(0x13b)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x4dca6b});}catch(_0x1666f8){const _0x2c4a29=this['formatPostCSSError'](_0x1666f8,_0x4dca6b);_0x2c4a29&&_0x585616['push'](_0x2c4a29);}return _0x585616;}async[a0_0x2d3683(0x143)](_0x10e53e,_0x4a1fff,_0x10a1d1){const _0x42705a=a0_0x2d3683,_0x2ddf41=[];try{if(!this[_0x42705a(0x127)]){const _0x3b99a1=await import('stylelint');this['stylelint']=_0x3b99a1['default'];}const _0x4c16a5={'extends':[_0x42705a(0x12e)],'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':[_0x42705a(0x14c),'ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x10a1d1==='scss'?[!![],{'ignoreAtRules':['mixin','include',_0x42705a(0x161),'if','else',_0x42705a(0x148),_0x42705a(0x13f),'while','function','return',_0x42705a(0x122),'use',_0x42705a(0x138)]}]:_0x10a1d1===_0x42705a(0x155)?[!![],{'ignoreAtRules':[_0x42705a(0x141)]}]:!![],'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':_0x42705a(0x14e),'selector-type-case':'lower'},'customSyntax':_0x10a1d1==='scss'?_0x42705a(0x15a):_0x10a1d1==='less'?_0x42705a(0x153):undefined},_0x225e0e=await this['stylelint']['lint']({'code':_0x4a1fff,'codeFilename':_0x10e53e,'config':_0x4c16a5});if(_0x225e0e[_0x42705a(0x12f)]&&_0x225e0e['results'][_0x42705a(0x150)]>0x0){const _0x53a4dc=_0x225e0e['results'][0x0];if(_0x53a4dc[_0x42705a(0x124)])for(const _0x4d7b6d of _0x53a4dc['warnings']){_0x2ddf41[_0x42705a(0x128)]({'file':_0x10e53e,'line':_0x4d7b6d[_0x42705a(0x15c)]||0x1,'column':_0x4d7b6d['column']||0x1,'severity':_0x4d7b6d[_0x42705a(0x14b)]===_0x42705a(0x14d)?STATIC_ANALYSIS[_0x42705a(0x159)][_0x42705a(0x15f)]:STATIC_ANALYSIS[_0x42705a(0x159)][_0x42705a(0x15e)],'rule':_0x4d7b6d['rule']||_0x42705a(0x15b),'message':_0x4d7b6d[_0x42705a(0x126)],'category':this[_0x42705a(0x12b)](_0x4d7b6d[_0x42705a(0x145)]),'fixable':![],'source':'stylelint'});}}}catch(_0x3ca870){this['logger']?.['warn']('Stylelint\x20analysis\x20failed',{'file':_0x10e53e,'error':_0x3ca870['message']});}return _0x2ddf41;}[a0_0x2d3683(0x158)](_0x3b46eb,_0xc46b84){const _0x1f03d5=a0_0x2d3683;return{'file':_0xc46b84,'line':_0x3b46eb['line']||0x1,'column':_0x3b46eb['column']||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x3b46eb['name']||_0x1f03d5(0x139),'message':_0x3b46eb['reason']||_0x3b46eb['message'],'category':STATIC_ANALYSIS[_0x1f03d5(0x14a)]['SYNTAX'],'fixable':![],'source':_0x1f03d5(0x125),'code':_0x3b46eb['source']||undefined};}[a0_0x2d3683(0x12b)](_0x27dd9b){const _0x2789a2=a0_0x2d3683;if(!_0x27dd9b)return STATIC_ANALYSIS[_0x2789a2(0x14a)]['STYLE'];const _0x4fa650=_0x27dd9b[_0x2789a2(0x137)]();if(_0x4fa650['includes'](_0x2789a2(0x14f))||_0x4fa650['includes']('no-unknown')||_0x4fa650[_0x2789a2(0x151)](_0x2789a2(0x144))||_0x4fa650['includes']('syntax'))return STATIC_ANALYSIS[_0x2789a2(0x14a)][_0x2789a2(0x13e)];if(_0x4fa650[_0x2789a2(0x151)]('performance')||_0x4fa650['includes']('optimize'))return STATIC_ANALYSIS['CATEGORY']['PERFORMANCE'];if(_0x4fa650['includes']('best-practice')||_0x4fa650[_0x2789a2(0x151)]('recommended'))return STATIC_ANALYSIS[_0x2789a2(0x14a)]['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x2789a2(0x14a)]['STYLE'];}[a0_0x2d3683(0x149)](_0x2c676e){const _0x14d1ac=a0_0x2d3683,_0xf563c1=_0x2c676e['toLowerCase']();if(_0xf563c1['endsWith']('.scss')||_0xf563c1[_0x14d1ac(0x140)]('.sass'))return _0x14d1ac(0x12d);if(_0xf563c1[_0x14d1ac(0x140)]('.less'))return'less';return'css';}['getSupportedExtensions'](){const _0x48c4ae=a0_0x2d3683;return[_0x48c4ae(0x13c),'.scss','.sass','.less'];}[a0_0x2d3683(0x123)](){return![];}}export default CSSAnalyzer;
@@ -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
+ function a0_0x445f(_0x5e9a15,_0x36e80b){_0x5e9a15=_0x5e9a15-0x1e6;const _0x37cee3=a0_0x37ce();let _0x445f10=_0x37cee3[_0x5e9a15];if(a0_0x445f['rIjIvf']===undefined){var _0x506f18=function(_0x5ef6c1){const _0x1de4d8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3cc598='',_0xa8af1f='';for(let _0x2ba567=0x0,_0x44c8ee,_0xc72de4,_0x5b99=0x0;_0xc72de4=_0x5ef6c1['charAt'](_0x5b99++);~_0xc72de4&&(_0x44c8ee=_0x2ba567%0x4?_0x44c8ee*0x40+_0xc72de4:_0xc72de4,_0x2ba567++%0x4)?_0x3cc598+=String['fromCharCode'](0xff&_0x44c8ee>>(-0x2*_0x2ba567&0x6)):0x0){_0xc72de4=_0x1de4d8['indexOf'](_0xc72de4);}for(let _0x19d7f2=0x0,_0x524771=_0x3cc598['length'];_0x19d7f2<_0x524771;_0x19d7f2++){_0xa8af1f+='%'+('00'+_0x3cc598['charCodeAt'](_0x19d7f2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xa8af1f);};a0_0x445f['onrLgK']=_0x506f18,a0_0x445f['hNvXHL']={},a0_0x445f['rIjIvf']=!![];}const _0x5b4e44=_0x37cee3[0x0],_0x46e60a=_0x5e9a15+_0x5b4e44,_0x542858=a0_0x445f['hNvXHL'][_0x46e60a];return!_0x542858?(_0x445f10=a0_0x445f['onrLgK'](_0x445f10),a0_0x445f['hNvXHL'][_0x46e60a]=_0x445f10):_0x445f10=_0x542858,_0x445f10;}const a0_0x357114=a0_0x445f;(function(_0x34ba18,_0x51e985){const _0x51e9cd=a0_0x445f,_0x1fa6ec=_0x34ba18();while(!![]){try{const _0x331058=parseInt(_0x51e9cd(0x202))/0x1*(-parseInt(_0x51e9cd(0x249))/0x2)+-parseInt(_0x51e9cd(0x241))/0x3*(-parseInt(_0x51e9cd(0x1e7))/0x4)+parseInt(_0x51e9cd(0x200))/0x5+parseInt(_0x51e9cd(0x220))/0x6+parseInt(_0x51e9cd(0x203))/0x7*(-parseInt(_0x51e9cd(0x210))/0x8)+-parseInt(_0x51e9cd(0x22c))/0x9*(-parseInt(_0x51e9cd(0x25e))/0xa)+-parseInt(_0x51e9cd(0x1ec))/0xb*(parseInt(_0x51e9cd(0x1ef))/0xc);if(_0x331058===_0x51e985)break;else _0x1fa6ec['push'](_0x1fa6ec['shift']());}catch(_0x2a042b){_0x1fa6ec['push'](_0x1fa6ec['shift']());}}}(a0_0x37ce,0x96116));import{exec}from'child_process';import{promisify}from'util';import a0_0x3cc598 from'path';import a0_0xa8af1f from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x37ce(){const _0x6891d6=['ywP2','zg9JA2vYlwnVBxbVC2uUEwfTBa','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','Dg9mB3DLCKnHC2u','y2HLy2TVDIaTlxzLCNnPB24','CgfYC2vdAgvJA292uMvZDwX0CW','BwvKAxvT','y3DL','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','mtHqthnpt0K','AgfKB2XPBNqGls12zxjZAw9U','zxH0BMfTzq','zw5KC1DPDgG','BwfW','iIaTlwzYyw1LD29YAYa','BwfWq2HLy2TVDLnLDMvYAxr5','C3rKB3v0','DhjPBq','zgvMyxvSDa','BM9YBwfSAxPLuMvZDwX0CW','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','y29Kzq','C3rHCNrZv2L0Aa','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','y29TCgLSzxjpChrPB25Z','z2L0AhvIlwfJDgLVBNm','zg9JA2vYlwnVBxbVC2u','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','DMfSAwrHDgvfBNzgAwXL','otnirvflCuG','EwfTBgXPBNq','y2HLy2TVDG','DhnJB25MAwCTDMfSAwrHDg9Y','CgfYC2u','ywP2icHku09oifnJAgvTysK','y2HLy2TVDIbKzxrLy3rLza','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','nejNzxnAvG','Aw5ZDgfUy2vqyxrO','zg9JA2vYlwnVBxbVC2uUEw1S','wufntcbMAwXLihzHBgLKyxrPB24','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','C3LUDgf4','DMfSAwrHDgvxAxrOq2HLy2TVDG','Aw5JBhvKzxm','DMfSAwrHDgvqywnRywDLsNnVBG','lNrMDMfYCW','DMfSAwrHDgvuC0nVBMzPzW','BwfWsgfKB2XPBNrtzxzLCML0Eq','C3bSAxq','B2jQzwn0','DMfSAwrHDgu','y2HLy2TVDIaTzIaI','DhnJB25MAwCUANnVBG','C2vJCMv0','Dw5RBM93BG','ANnVBLnJAgvTyq','C3rYAw5N','mteXmJiWy25oCe5o','y2HLy2TFBMfTzq','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','Bwf0y2G','zxjYB3i','DMfSAwrHDg9Y','ANnVBI1Zy2HLBwe','BwfWwwfTBgXPBNrtzxzLCML0Eq','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','mtaYmti0vMrpuwni','A3vIzxjUzxrLCW','Bg9Nz2vY','C3rYAwn0','CgfYC2viywrVBgLUDfjLC3vSDhm','nZKXmti3n2DOreHSuW','su5gtW','CgLWigLUC3rHBgWGEwfTBgXPBNq','mtjpDNDOtfi','BgvUz3rO','AgfKB2XPBNq','CgfYyw1Z','ug90zw50AwfSigHHCMrJB2rLzca','ywP2lwzVCM1HDhm','zxjYB3jZ','DgvYCMfMB3jT','lNrM','DMvYC2LVBG','ChvZAa','CgfJA2fNzs5QC29U','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','DMfSAwrHDgLVBG','yMvZDc1WCMfJDgLJzq','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','yxzHAwXHyMXLu2nHBM5LCNm','ndi1nJy1mfneB2PrEq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','mZuWmZeXu3jhruLl','n0TpvKfLuq','rvjst1i','CMvTzwrPyxrPB24','CMvHzezPBgu','C2v2zxjPDhK','zMfPBgvKx2nOzwnRCW','zgvIDwC','BM9jBxbSAwnPDefUEq','EwfTBa','v0fstKLorW','zgv0zwn0rMLSzvr5Cgu','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','mZa5ndaWofPgtML3Cq','BwvZC2fNzq','CMvZDwX0CW','zw52lxzHBgLKyxrVCG','zgLYBMfTzq','DMfSAwrHDgvzqu1m','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','zw52','u0vwrvjjvfK','zg9JA2vYzMLSzq','z3vPzgvSAw5L','y2HHBMDLBwu','ANnVBI1WyxjZzq','qvDtignYzwrLBNrPywXZ','C2vJDxjPDhK','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','nduZnZmZogrAtLPtuW','yMfZzw5HBwu','DMfSAwrHDgveB2nRzxjMAwXL'];a0_0x37ce=function(){return _0x6891d6;};return a0_0x37ce();}const execAsync=promisify(exec);class ConfigValidator{constructor(_0x2ba567=null){const _0x11c664=a0_0x445f;this[_0x11c664(0x1e9)]=_0x2ba567,this[_0x11c664(0x1ff)]=null,this['scannerCache']=new Map();}async[a0_0x357114(0x24d)](){const _0x4c4fe7=a0_0x357114;if(this['availableScanners']!==null)return this[_0x4c4fe7(0x1ff)];const _0x44c8ee={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x4c4fe7(0x227),{'timeout':0x1388}),_0x44c8ee[_0x4c4fe7(0x243)]=!![],this[_0x4c4fe7(0x1e9)]?.['debug'](_0x4c4fe7(0x247));}catch(_0xc72de4){this['logger']?.[_0x4c4fe7(0x209)](_0x4c4fe7(0x23b),{'error':_0xc72de4[_0x4c4fe7(0x211)]});}try{await execAsync(_0x4c4fe7(0x22d),{'timeout':0x1388}),_0x44c8ee['hadolint']=!![],this['logger']?.[_0x4c4fe7(0x209)]('hadolint\x20detected');}catch(_0x5b99){this[_0x4c4fe7(0x1e9)]?.['debug']('hadolint\x20not\x20available',{'error':_0x5b99[_0x4c4fe7(0x211)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x44c8ee['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x19d7f2){this['logger']?.[_0x4c4fe7(0x209)]('yamllint\x20not\x20available',{'error':_0x19d7f2[_0x4c4fe7(0x211)]});}try{await import(_0x4c4fe7(0x223)),_0x44c8ee[_0x4c4fe7(0x25c)]=!![],this['logger']?.['debug'](_0x4c4fe7(0x238));}catch(_0x524771){this[_0x4c4fe7(0x1e9)]?.[_0x4c4fe7(0x209)]('ajv\x20not\x20available',{'error':_0x524771[_0x4c4fe7(0x211)]});}return this[_0x4c4fe7(0x1ff)]=_0x44c8ee,_0x44c8ee;}async[a0_0x357114(0x257)](_0xc7bdca,_0x2cddf5={}){const _0x322b76=a0_0x357114,_0x151955=[],_0x3fca87=await this['detectAvailableValidators'](),_0x50d62b=this['detectFileType'](_0xc7bdca);this[_0x322b76(0x1e9)]?.[_0x322b76(0x209)]('Validating\x20config\x20file',{'filePath':_0xc7bdca,'fileType':_0x50d62b});switch(_0x50d62b){case _0x322b76(0x219):if(_0x3fca87[_0x322b76(0x1f1)]){const _0x94f5f5=await this[_0x322b76(0x222)](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x94f5f5);}if(_0x3fca87[_0x322b76(0x243)]){const _0x5570ee=await this[_0x322b76(0x24f)](_0xc7bdca,'dockerfile',_0x2cddf5);_0x151955['push'](..._0x5570ee);}break;case _0x322b76(0x23e):if(_0x3fca87[_0x322b76(0x242)]){const _0x262fbc=await this[_0x322b76(0x215)](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x262fbc);}if(_0x3fca87[_0x322b76(0x243)]){const _0x4bfe33=await this['validateWithCheckov'](_0xc7bdca,'docker_compose',_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x4bfe33);}break;case'kubernetes':if(_0x3fca87[_0x322b76(0x242)]){const _0xd3f0f5=await this['validateYAML'](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xd3f0f5);}if(_0x3fca87['checkov']){const _0x39f867=await this['validateWithCheckov'](_0xc7bdca,_0x322b76(0x1e8),_0x2cddf5);_0x151955['push'](..._0x39f867);}break;case _0x322b76(0x1f6):if(_0x3fca87[_0x322b76(0x243)]){const _0x5a59eb=await this['validateWithCheckov'](_0xc7bdca,'terraform',_0x2cddf5);_0x151955['push'](..._0x5a59eb);}break;case _0x322b76(0x1fa):if(_0x3fca87[_0x322b76(0x25c)]){const _0x4fb5a3=await this[_0x322b76(0x251)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0x4fb5a3);}break;case'tsconfig.json':if(_0x3fca87['jsonSchema']){const _0xee9b06=await this[_0x322b76(0x253)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xee9b06);}break;case'github-actions':if(_0x3fca87[_0x322b76(0x242)]){const _0xc5ae3f=await this[_0x322b76(0x215)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xc5ae3f);}break;case'env':const _0x6df047=await this['validateEnvFile'](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0x6df047);break;case'yaml':if(_0x3fca87['yamllint']){const _0x4304d9=await this['validateYAML'](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x4304d9);}break;default:this['logger']?.['warn'](_0x322b76(0x23f),{'filePath':_0xc7bdca,'fileType':_0x50d62b});return[];}return this[_0x322b76(0x236)](_0x151955);}async[a0_0x357114(0x222)](_0x299844,_0x7b9b08={}){const _0x14bd93=a0_0x357114;try{const _0x92e72b=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x299844+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x5e5fc0=JSON['parse'](_0x92e72b['stdout']);return this[_0x14bd93(0x1eb)](_0x5e5fc0,_0x299844);}catch(_0x5520cd){if(_0x5520cd[_0x14bd93(0x233)])try{const _0x8b68b2=JSON[_0x14bd93(0x245)](_0x5520cd[_0x14bd93(0x233)]);return this[_0x14bd93(0x1eb)](_0x8b68b2,_0x299844);}catch(_0x47f908){this['logger']?.[_0x14bd93(0x262)]('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x47f908[_0x14bd93(0x211)]});}return this[_0x14bd93(0x1e9)]?.['error'](_0x14bd93(0x1fe),{'error':_0x5520cd[_0x14bd93(0x211)]}),[];}}[a0_0x357114(0x1eb)](_0x44b46c,_0x424791){const _0x4a9ce6=a0_0x357114,_0x1a7c68=[];if(Array['isArray'](_0x44b46c))for(const _0x3a0949 of _0x44b46c){_0x1a7c68['push']({'file':_0x424791,'line':_0x3a0949['line']||0x1,'column':_0x3a0949['column']||0x1,'severity':this['mapHadolintSeverity'](_0x3a0949['level']),'rule':_0x3a0949[_0x4a9ce6(0x239)],'message':_0x3a0949['message'],'category':'dockerfile','validator':_0x4a9ce6(0x1f1)});}return _0x1a7c68;}async[a0_0x357114(0x215)](_0x416508,_0x2a3f1a={}){const _0x4e376b=a0_0x357114;try{const _0xf4a5ae=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x416508+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x4e376b(0x201)](_0xf4a5ae[_0x4e376b(0x233)],_0x416508);}catch(_0x45beed){if(_0x45beed[_0x4e376b(0x233)])return this[_0x4e376b(0x201)](_0x45beed['stdout'],_0x416508);return this[_0x4e376b(0x1e9)]?.[_0x4e376b(0x262)](_0x4e376b(0x1e6),{'error':_0x45beed['message']}),[];}}['parseYamllintResults'](_0x1e29f6,_0x4f47f7){const _0xede58b=a0_0x357114,_0x155b51=[],_0x538b21=_0x1e29f6['split']('\x0a')['filter'](_0xdcbb9a=>_0xdcbb9a[_0xede58b(0x234)]());for(const _0x20ba80 of _0x538b21){const _0x3c2a6b=_0x20ba80[_0xede58b(0x261)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x3c2a6b){const [,_0x5213c1,_0x113c96,_0x4c50dc,_0x93f7dd,_0x2dde65,_0x470103]=_0x3c2a6b;_0x155b51['push']({'file':_0x4f47f7,'line':parseInt(_0x113c96,0xa),'column':parseInt(_0x4c50dc,0xa),'severity':this[_0xede58b(0x265)](_0x93f7dd),'rule':_0x470103,'message':_0x2dde65,'category':'yaml','validator':_0xede58b(0x242)});}}return _0x155b51;}async['validateWithCheckov'](_0x5d1af4,_0xf0cc90,_0x2674a4={}){const _0x29cf0f=a0_0x357114;try{const _0x2dff01=await execAsync(_0x29cf0f(0x258)+_0x5d1af4+_0x29cf0f(0x231)+_0xf0cc90+_0x29cf0f(0x248),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x354848=JSON[_0x29cf0f(0x245)](_0x2dff01['stdout']);return this[_0x29cf0f(0x228)](_0x354848,_0x5d1af4);}catch(_0x78e98e){if(_0x78e98e['stdout'])try{const _0x1b3176=JSON[_0x29cf0f(0x245)](_0x78e98e['stdout']);return this['parseCheckovResults'](_0x1b3176,_0x5d1af4);}catch(_0x5194ab){this['logger']?.['error'](_0x29cf0f(0x22b),{'error':_0x5194ab[_0x29cf0f(0x211)]});}return this['logger']?.[_0x29cf0f(0x262)]('checkov\x20validation\x20failed',{'error':_0x78e98e['message']}),[];}}['parseCheckovResults'](_0xbba814,_0x27d057){const _0x1a70dc=a0_0x357114,_0x4bda0d=[];if(_0xbba814[_0x1a70dc(0x212)]&&_0xbba814['results'][_0x1a70dc(0x208)])for(const _0x23f48a of _0xbba814[_0x1a70dc(0x212)][_0x1a70dc(0x208)]){_0x4bda0d['push']({'file':_0x27d057,'line':_0x23f48a['file_line_range']?_0x23f48a['file_line_range'][0x0]:0x1,'column':0x1,'severity':this[_0x1a70dc(0x232)](_0x23f48a['check_class']),'rule':_0x23f48a['check_id'],'message':_0x23f48a[_0x1a70dc(0x25f)]||_0x23f48a['check_id'],'category':_0x1a70dc(0x21e),'validator':_0x1a70dc(0x243),'remediation':_0x23f48a[_0x1a70dc(0x21a)],'cwe':_0x23f48a['cwe'],'references':_0x23f48a['guideline']?[_0x23f48a['guideline']]:[]});}return _0x4bda0d;}async[a0_0x357114(0x251)](_0x2f4101,_0x494d43={}){const _0x2916f0=a0_0x357114;try{const _0x6555c8=(await import('ajv'))[_0x2916f0(0x235)],_0x5ed3eb=(await import(_0x2916f0(0x1f4)))[_0x2916f0(0x235)],_0x5c2a07=await a0_0xa8af1f['readFile'](_0x2f4101,'utf-8'),_0x3a972a=JSON['parse'](_0x5c2a07),_0x9c4ff9=new _0x6555c8({'allErrors':!![],'strict':![]});_0x5ed3eb(_0x9c4ff9);const _0x16b388={'type':'object','required':['name',_0x2916f0(0x1f8)],'properties':{'name':{'type':_0x2916f0(0x25d),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':_0x2916f0(0x25d)},'main':{'type':'string'},'type':{'type':'string','enum':['module','commonjs']},'scripts':{'type':_0x2916f0(0x256)},'dependencies':{'type':'object'},'devDependencies':{'type':_0x2916f0(0x256)}},'additionalProperties':!![]},_0x19493e=_0x9c4ff9['compile'](_0x16b388),_0x505e77=_0x19493e(_0x3a972a);if(!_0x505e77&&_0x19493e['errors'])return _0x19493e[_0x2916f0(0x1f5)][_0x2916f0(0x230)](_0x18d8be=>({'file':_0x2f4101,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2916f0(0x218)][_0x2916f0(0x204)],'rule':_0x2916f0(0x264),'message':_0x18d8be['instancePath']?_0x18d8be[_0x2916f0(0x24a)]+'\x20'+_0x18d8be['message']:'must\x20have\x20required\x20property\x20\x27'+_0x18d8be[_0x2916f0(0x1f2)]['missingProperty']+'\x27','category':_0x2916f0(0x1fc),'validator':'json-schema'}));return[];}catch(_0x285775){return this[_0x2916f0(0x1e9)]?.['error'](_0x2916f0(0x20f),{'error':_0x285775[_0x2916f0(0x211)]}),[{'file':_0x2f4101,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2916f0(0x218)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x285775[_0x2916f0(0x211)],'category':'syntax','validator':_0x2916f0(0x21c)}];}}async[a0_0x357114(0x253)](_0x31321d,_0xa685ea={}){const _0x226b60=a0_0x357114;try{const _0x28b922=await a0_0xa8af1f[_0x226b60(0x206)](_0x31321d,'utf-8'),_0x54706a=JSON['parse'](_0x28b922),_0x138565=[];if(_0x54706a['compilerOptions']){const _0x5ca1bd=_0x54706a[_0x226b60(0x23c)];!_0x5ca1bd[_0x226b60(0x1ea)]&&_0x138565[_0x226b60(0x1f9)]({'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x226b60(0x218)][_0x226b60(0x20c)],'rule':'strict-mode','message':_0x226b60(0x225),'category':_0x226b60(0x1fd),'validator':'tsconfig-validator'}),_0x5ca1bd[_0x226b60(0x20a)]===![]&&_0x138565['push']({'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':_0x226b60(0x244)});}return _0x138565;}catch(_0x37c614){return this[_0x226b60(0x1e9)]?.[_0x226b60(0x262)]('tsconfig.json\x20validation\x20failed',{'error':_0x37c614['message']}),[{'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x226b60(0x204)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x37c614['message'],'category':_0x226b60(0x24e),'validator':'json-parse'}];}}async[a0_0x357114(0x240)](_0x47620d,_0x10096b={}){const _0x2c053d=a0_0x357114;try{const _0x2d5247=await a0_0xa8af1f['readFile'](_0x47620d,'utf-8'),_0x4a5c7f=[],_0xfa391e=_0x2d5247[_0x2c053d(0x255)]('\x0a'),_0x35c8c9=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':_0x2c053d(0x25a)},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x2c053d(0x21d)}];return _0xfa391e['forEach']((_0x4dafba,_0x39d221)=>{const _0xb5a835=_0x2c053d,_0xd92cdf=_0x4dafba[_0xb5a835(0x234)]();if(!_0xd92cdf||_0xd92cdf[_0xb5a835(0x23a)]('#'))return;if(_0xd92cdf['includes']('=')){const [_0x38af11,_0x3a97b1]=_0xd92cdf[_0xb5a835(0x255)]('='),_0x5db324=_0x38af11[_0xb5a835(0x226)](),_0x188b8b=_0x3a97b1?.[_0xb5a835(0x234)]()||'',_0x5a050e=_0x188b8b&&_0x188b8b!==''&&!_0x188b8b[_0xb5a835(0x23a)]('$')&&_0x188b8b!=='your-key-here'&&_0x188b8b!==_0xb5a835(0x21b)&&_0x188b8b[_0xb5a835(0x1f0)]>0x5;if(_0x5a050e)for(const {pattern:_0x14606d,name:_0x111852}of _0x35c8c9){if(_0x14606d['test'](_0x5db324)){_0x4a5c7f['push']({'file':_0x47620d,'line':_0x39d221+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xb5a835(0x218)]['CRITICAL'],'rule':'hardcoded-secret','message':_0xb5a835(0x1f3)+_0x111852+'\x20detected\x20in\x20.env\x20file','category':'security','validator':_0xb5a835(0x213),'remediation':_0xb5a835(0x1fb)});break;}}}}),_0x4a5c7f;}catch(_0x26993e){return this[_0x2c053d(0x1e9)]?.['error'](_0x2c053d(0x216),{'error':_0x26993e[_0x2c053d(0x211)]}),[];}}[a0_0x357114(0x20d)](_0x104fe2){const _0x3767e8=a0_0x357114,_0x544351=a0_0x3cc598[_0x3767e8(0x221)](_0x104fe2)[_0x3767e8(0x226)](),_0x1e04b2=a0_0x3cc598[_0x3767e8(0x214)](_0x104fe2);if(_0x544351==='dockerfile')return'dockerfile';if(_0x544351===_0x3767e8(0x24b)||_0x544351===_0x3767e8(0x224))return'docker-compose';if(_0x544351==='package.json')return _0x3767e8(0x1fa);if(_0x544351===_0x3767e8(0x259))return'tsconfig.json';if(_0x544351==='.env'||_0x544351[_0x3767e8(0x22f)]('.env'))return _0x3767e8(0x217);if(_0x1e04b2[_0x3767e8(0x250)]('.github/workflows'))return _0x3767e8(0x23d);if(_0x1e04b2[_0x3767e8(0x250)]('kubernetes')||_0x1e04b2[_0x3767e8(0x250)]('k8s'))return'kubernetes';const _0x5b374a=a0_0x3cc598[_0x3767e8(0x22e)](_0x104fe2)[_0x3767e8(0x226)]();if(_0x5b374a===_0x3767e8(0x1f7)||_0x5b374a===_0x3767e8(0x252))return'terraform';if(_0x5b374a==='.yml'||_0x5b374a==='.yaml')return _0x3767e8(0x20b);if(_0x5b374a==='.json')return'json';return'unknown';}[a0_0x357114(0x236)](_0x1a7cae){const _0x480392=a0_0x357114;return _0x1a7cae['map'](_0x37f721=>({'file':_0x37f721['file'],'line':_0x37f721['line']||0x1,'column':_0x37f721['column']||0x1,'severity':_0x37f721[_0x480392(0x207)]||STATIC_ANALYSIS[_0x480392(0x218)]['WARNING'],'rule':_0x37f721['rule']||_0x480392(0x25b),'message':_0x37f721[_0x480392(0x211)]||_0x480392(0x21f),'category':_0x37f721['category']||_0x480392(0x1fc),'validator':_0x37f721[_0x480392(0x263)],'cwe':_0x37f721[_0x480392(0x22a)]||null,'remediation':_0x37f721[_0x480392(0x205)]||null,'references':_0x37f721['references']||[]}));}[a0_0x357114(0x254)](_0x1b4da5){const _0x437e05=a0_0x357114,_0xb966bd={'error':STATIC_ANALYSIS[_0x437e05(0x218)]['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS[_0x437e05(0x218)][_0x437e05(0x1ed)],'style':STATIC_ANALYSIS[_0x437e05(0x218)][_0x437e05(0x1ed)]};return _0xb966bd[_0x1b4da5?.['toLowerCase']()]||STATIC_ANALYSIS[_0x437e05(0x218)]['WARNING'];}[a0_0x357114(0x265)](_0x273bc9){const _0x210bf5=a0_0x357114,_0x3c466a={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x210bf5(0x218)]['WARNING']};return _0x3c466a[_0x273bc9?.['toLowerCase']()]||STATIC_ANALYSIS[_0x210bf5(0x218)][_0x210bf5(0x20c)];}[a0_0x357114(0x232)](_0x5db6b7){const _0x5f3f31=a0_0x357114;return STATIC_ANALYSIS[_0x5f3f31(0x218)][_0x5f3f31(0x204)];}async['getValidatorStatus'](){const _0x2b024a=a0_0x357114,_0x102f9d=await this[_0x2b024a(0x24d)]();return{'validators':_0x102f9d,'recommendations':this['getInstallRecommendations'](_0x102f9d)};}[a0_0x357114(0x237)](_0x32248f){const _0x3f6821=a0_0x357114,_0x3abaf3=[];return!_0x32248f[_0x3f6821(0x243)]&&_0x3abaf3['push']({'validator':_0x3f6821(0x243),'reason':_0x3f6821(0x20e),'install':'pip\x20install\x20checkov','priority':'high'}),!_0x32248f['hadolint']&&_0x3abaf3['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x32248f['yamllint']&&_0x3abaf3[_0x3f6821(0x1f9)]({'validator':'yamllint','reason':_0x3f6821(0x24c),'install':_0x3f6821(0x1ee),'priority':_0x3f6821(0x229)}),!_0x32248f['jsonSchema']&&_0x3abaf3[_0x3f6821(0x1f9)]({'validator':_0x3f6821(0x246),'reason':_0x3f6821(0x260),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x3f6821(0x229)}),_0x3abaf3;}}export default ConfigValidator;