@loxia-labs/loxia-autopilot-one 2.0.10 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +6 -5
  2. package/bin/cli.js +1 -1
  3. package/bin/loxia-terminal-v2.js +1 -1
  4. package/bin/loxia-terminal.js +1 -1
  5. package/bin/start-with-terminal.js +1 -1
  6. package/package.json +1 -1
  7. package/scripts/install-scanners.js +1 -1
  8. package/scripts/watchdog.js +1 -1
  9. package/src/analyzers/CSSAnalyzer.js +1 -1
  10. package/src/analyzers/ConfigValidator.js +1 -1
  11. package/src/analyzers/ESLintAnalyzer.js +1 -1
  12. package/src/analyzers/JavaScriptAnalyzer.js +1 -1
  13. package/src/analyzers/PrettierFormatter.js +1 -1
  14. package/src/analyzers/PythonAnalyzer.js +1 -1
  15. package/src/analyzers/SecurityAnalyzer.js +1 -1
  16. package/src/analyzers/SparrowAnalyzer.js +1 -1
  17. package/src/analyzers/TypeScriptAnalyzer.js +1 -1
  18. package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
  19. package/src/analyzers/codeCloneDetector/detector.js +1 -1
  20. package/src/analyzers/codeCloneDetector/index.js +1 -1
  21. package/src/analyzers/codeCloneDetector/parser.js +1 -1
  22. package/src/analyzers/codeCloneDetector/reporter.js +1 -1
  23. package/src/analyzers/codeCloneDetector/scanner.js +1 -1
  24. package/src/core/agentPool.js +1 -1
  25. package/src/core/agentScheduler.js +1 -1
  26. package/src/core/contextManager.js +1 -1
  27. package/src/core/flowExecutor.js +1 -1
  28. package/src/core/messageProcessor.js +1 -1
  29. package/src/core/orchestrator.js +1 -1
  30. package/src/core/stateManager.js +1 -1
  31. package/src/index.js +1 -1
  32. package/src/interfaces/cli.js +1 -1
  33. package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
  34. package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
  35. package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
  36. package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
  37. package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
  38. package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
  39. package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
  40. package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
  41. package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
  42. package/src/interfaces/terminal/api/apiClient.js +1 -1
  43. package/src/interfaces/terminal/api/messageRouter.js +1 -1
  44. package/src/interfaces/terminal/api/session.js +1 -1
  45. package/src/interfaces/terminal/api/websocket.js +1 -1
  46. package/src/interfaces/terminal/components/AgentCreator.js +1 -1
  47. package/src/interfaces/terminal/components/AgentEditor.js +1 -1
  48. package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
  49. package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
  50. package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
  51. package/src/interfaces/terminal/components/Header.js +1 -1
  52. package/src/interfaces/terminal/components/HelpPanel.js +1 -1
  53. package/src/interfaces/terminal/components/InputBox.js +1 -1
  54. package/src/interfaces/terminal/components/Layout.js +1 -1
  55. package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
  56. package/src/interfaces/terminal/components/MessageList.js +1 -1
  57. package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
  58. package/src/interfaces/terminal/components/SearchPanel.js +1 -1
  59. package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
  60. package/src/interfaces/terminal/components/StatusBar.js +1 -1
  61. package/src/interfaces/terminal/components/TextInput.js +1 -1
  62. package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
  63. package/src/interfaces/terminal/config/constants.js +1 -1
  64. package/src/interfaces/terminal/index.js +1 -1
  65. package/src/interfaces/terminal/state/useAgentControl.js +1 -1
  66. package/src/interfaces/terminal/state/useAgents.js +1 -1
  67. package/src/interfaces/terminal/state/useConnection.js +1 -1
  68. package/src/interfaces/terminal/state/useMessages.js +1 -1
  69. package/src/interfaces/terminal/state/useTools.js +1 -1
  70. package/src/interfaces/terminal/utils/debugLogger.js +1 -1
  71. package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
  72. package/src/interfaces/terminal/utils/theme.js +1 -1
  73. package/src/interfaces/webServer.js +1 -1
  74. package/src/modules/fileExplorer/controller.js +1 -1
  75. package/src/modules/fileExplorer/index.js +1 -1
  76. package/src/modules/fileExplorer/middleware.js +1 -1
  77. package/src/modules/fileExplorer/routes.js +1 -1
  78. package/src/services/agentActivityService.js +1 -1
  79. package/src/services/aiService.js +1 -1
  80. package/src/services/apiKeyManager.js +1 -1
  81. package/src/services/benchmarkService.js +1 -1
  82. package/src/services/budgetService.js +1 -1
  83. package/src/services/contextInjectionService.js +1 -1
  84. package/src/services/conversationCompactionService.js +1 -1
  85. package/src/services/credentialVault.js +1 -1
  86. package/src/services/errorHandler.js +1 -1
  87. package/src/services/fileAttachmentService.js +1 -1
  88. package/src/services/flowContextService.js +1 -1
  89. package/src/services/memoryService.js +1 -1
  90. package/src/services/modelRouterService.js +1 -1
  91. package/src/services/modelsService.js +1 -1
  92. package/src/services/portRegistry.js +1 -1
  93. package/src/services/portTracker.js +1 -1
  94. package/src/services/projectDetector.js +1 -1
  95. package/src/services/promptService.js +1 -1
  96. package/src/services/qualityInspector.js +1 -1
  97. package/src/services/serviceRegistry.js +1 -1
  98. package/src/services/tokenCountingService.js +1 -1
  99. package/src/services/visualEditorBridge.js +1 -1
  100. package/src/services/visualEditorServer.js +1 -1
  101. package/src/tools/agentCommunicationTool.js +1 -1
  102. package/src/tools/agentDelayTool.js +1 -1
  103. package/src/tools/asyncToolManager.js +1 -1
  104. package/src/tools/baseTool.js +1 -1
  105. package/src/tools/browserTool.js +1 -1
  106. package/src/tools/cloneDetectionTool.js +1 -1
  107. package/src/tools/dependencyResolverTool.js +1 -1
  108. package/src/tools/docxTool.js +1 -1
  109. package/src/tools/excelTool.js +1 -1
  110. package/src/tools/fileContentReplaceTool.js +1 -1
  111. package/src/tools/fileSystemTool.js +1 -1
  112. package/src/tools/fileTreeTool.js +1 -1
  113. package/src/tools/helpTool.js +1 -1
  114. package/src/tools/imageTool.js +1 -1
  115. package/src/tools/importAnalyzerTool.js +1 -1
  116. package/src/tools/jobDoneTool.js +1 -1
  117. package/src/tools/memoryTool.js +1 -1
  118. package/src/tools/pdfTool.js +1 -1
  119. package/src/tools/seekTool.js +1 -1
  120. package/src/tools/staticAnalysisTool.js +1 -1
  121. package/src/tools/taskManagerTool.js +1 -1
  122. package/src/tools/terminalTool.js +1 -1
  123. package/src/tools/userPromptTool.js +1 -1
  124. package/src/tools/videoTool.js +1 -1
  125. package/src/tools/visualEditorTool.js +1 -1
  126. package/src/tools/webTool.js +1 -1
  127. package/src/types/agent.js +1 -1
  128. package/src/types/contextReference.js +1 -1
  129. package/src/types/conversation.js +1 -1
  130. package/src/types/toolCommand.js +1 -1
  131. package/src/utilities/attachmentValidator.js +1 -1
  132. package/src/utilities/browserStealth.js +1 -1
  133. package/src/utilities/configManager.js +1 -1
  134. package/src/utilities/constants.js +1 -1
  135. package/src/utilities/directoryAccessManager.js +1 -1
  136. package/src/utilities/fileProcessor.js +1 -1
  137. package/src/utilities/humanBehavior.js +1 -1
  138. package/src/utilities/jsonRepair.js +1 -1
  139. package/src/utilities/logger.js +1 -1
  140. package/src/utilities/platformUtils.js +1 -1
  141. package/src/utilities/platformUtils.test.js +1 -1
  142. package/src/utilities/stealthConstants.js +1 -1
  143. package/src/utilities/structuredFileValidator.js +1 -1
  144. package/src/utilities/tagParser.js +1 -1
  145. package/src/utilities/toolConstants.js +1 -1
  146. package/src/utilities/userDataDir.js +1 -1
package/README.md CHANGED
@@ -98,7 +98,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
98
98
 
99
99
  ```bash
100
100
  loxia --version
101
- # Should display: Loxia Autopilot One v2.0.10
101
+ # Should display: Loxia Autopilot One v2.2.3
102
102
  ```
103
103
 
104
104
  ### 4. Create an API Key
@@ -297,13 +297,14 @@ Loxia comes with 18+ specialized tools that agents can use autonomously:
297
297
 
298
298
  ## Roadmap
299
299
 
300
- ### Current Version (2.0.10)
300
+ ### Current Version (2.2.3)
301
301
 
302
+ - Two-layer tool descriptions: compact index + on-demand full docs via Help tool
303
+ - Document creation tools: DOCX (Word) and Excel read/create support
304
+ - PDF creation: HTML to PDF via Puppeteer with full CSS support
305
+ - Tool result turn tracking: batched results grouped by turn with manifest headers
302
306
  - Unified `MAX_OUTPUT_TOKENS` constant (10,000) shared by aiService and compaction check
303
- - Max output tokens capped at 10,000 (was 4,000 fallback for dynamic models)
304
307
  - Compaction: preserve recent achievements, file paths, meaningful tool outcomes; 8K summary tokens
305
- - Tool invocation guidance: dependent calls must split across messages
306
- - CI publish fix: OIDC auth no longer interferes with npm install
307
308
 
308
309
  ### v2.0.6
309
310
  - Tool path sync: terminal `cd` now propagates to all tools (filesystem, seek, pdf, etc.)
package/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x267056=a0_0x1f46;(function(_0x5d196d,_0x5eb8bf){const _0x16bf9d=a0_0x1f46,_0x8fe513=_0x5d196d();while(!![]){try{const _0x1ba527=parseInt(_0x16bf9d(0x1e1))/0x1*(-parseInt(_0x16bf9d(0x1fc))/0x2)+-parseInt(_0x16bf9d(0x20b))/0x3*(-parseInt(_0x16bf9d(0x1c1))/0x4)+-parseInt(_0x16bf9d(0x1f6))/0x5*(parseInt(_0x16bf9d(0x1e9))/0x6)+parseInt(_0x16bf9d(0x1c4))/0x7*(-parseInt(_0x16bf9d(0x1ed))/0x8)+parseInt(_0x16bf9d(0x203))/0x9+parseInt(_0x16bf9d(0x204))/0xa*(-parseInt(_0x16bf9d(0x1d5))/0xb)+parseInt(_0x16bf9d(0x20f))/0xc;if(_0x1ba527===_0x5eb8bf)break;else _0x8fe513['push'](_0x8fe513['shift']());}catch(_0x44319b){_0x8fe513['push'](_0x8fe513['shift']());}}}(a0_0x40c8,0x48afe));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x1650c8 from'http';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_0x267056(0x208)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x267056(0x201)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x267056(0x1d7)]('--help')||args[a0_0x267056(0x1d7)]('-h'),'version':args[a0_0x267056(0x1d7)](a0_0x267056(0x1c6))||args[a0_0x267056(0x1d7)]('-v')};for(let i=0x0;i<args[a0_0x267056(0x1eb)];i++){args[i]===a0_0x267056(0x210)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x267056(0x1d0)&&args[i+0x1]&&(flags[a0_0x267056(0x212)]=args[i+0x1]);}const explicitPort=flags[a0_0x267056(0x1ff)],host=flags['host']||DEFAULT_HOST;if(flags[a0_0x267056(0x1db)]){const pkgPath=join(__dirname,'..',a0_0x267056(0x1e7)),pkg=JSON[a0_0x267056(0x1f1)](readFileSync(pkgPath,a0_0x267056(0x1f9)));console[a0_0x267056(0x1de)](a0_0x267056(0x1c2)+pkg['version']),process[a0_0x267056(0x1e0)](0x0);}if(flags[a0_0x267056(0x1c0)]||!command){const pkgPath=join(__dirname,'..',a0_0x267056(0x1e7)),pkg=JSON[a0_0x267056(0x1f1)](readFileSync(pkgPath,a0_0x267056(0x1f9)));console[a0_0x267056(0x1de)](a0_0x267056(0x20e)+pkg[a0_0x267056(0x1db)]+'\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_0x267056(0x209)+DEFAULT_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'),process['exit'](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x4539f7}=await import('../src/services/portRegistry.js');return _0x4539f7();}function a0_0x1f46(_0x490bda,_0x3418da){_0x490bda=_0x490bda-0x1c0;const _0x40c8ef=a0_0x40c8();let _0x1f463c=_0x40c8ef[_0x490bda];return _0x1f463c;}async function discoverBackend(){const _0x2826d9=a0_0x267056;try{const _0x4149c1=await getPortRegistry();await _0x4149c1[_0x2826d9(0x20c)]();const _0x209b6b=await _0x4149c1[_0x2826d9(0x211)](_0x2826d9(0x1f7));if(_0x209b6b)return{'host':_0x209b6b['host']||_0x2826d9(0x1d3),'port':_0x209b6b[_0x2826d9(0x1ff)],'pid':_0x209b6b[_0x2826d9(0x1df)]};return null;}catch(_0x1921a8){return null;}}function a0_0x40c8(){const _0x4d1a25=['Server\x20discovered\x20at\x20','889jMtwGE','Looking\x20for\x20running\x20server...','--version','platform','message','toString','error','\x0aPlease\x20start\x20the\x20server\x20first:','darwin','start','catch','Unknown\x20command:\x20','--host','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','destroy','localhost','index.js','2335421qgLhwE','open','includes','Error:','Please\x20open\x20manually:\x20','Waiting\x20for\x20server\x20to\x20start...','version','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','win32','log','pid','exit','119EITplk','\x0aServer\x20registered\x20at\x20','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','setTimeout','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','cmd','package.json','SIGTERM','48YJpKdg','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','length','\x20but\x20not\x20responding.','17224MfepvC','\x20\x20API\x20Health:\x20\x20\x20','/api/health\x0a','xdg-open','parse','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','kill','inherit','260060bmsfMt','backend','ignore','utf8','\x0aShutting\x20down\x20server...','loxia-terminal.js','5358kUZnfm','unref','\x0a✓\x20Server\x20running\x20at\x20','port','SIGINT','startsWith','now','275364dwUhoF','10HseCvZ','statusCode','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','Starting\x20Terminal\x20UI...\x0a','argv',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','LOXIA_HOST','6kweJxc','cleanupStaleEntries','Starting\x20Loxia\x20server...\x0a','\x0aLoxia\x20Autopilot\x20One\x20v','15115236AuTIgR','--port','getService','host','help','456332eHHXHr','Loxia\x20Autopilot\x20One\x20v'];a0_0x40c8=function(){return _0x4d1a25;};return a0_0x40c8();}async function checkServerRunning(_0x34ad01,_0x10d0b3,_0x3c9acf=0x1){for(let _0x32470f=0x0;_0x32470f<_0x3c9acf;_0x32470f++){const _0x53944c=await new Promise(_0x2bfbde=>{const _0x348ddf=a0_0x1f46,_0x533488=a0_0x1650c8['get']('http://'+_0x34ad01+':'+_0x10d0b3+'/api/health',_0x1dbd20=>{const _0x13cfd8=a0_0x1f46;_0x2bfbde(_0x1dbd20[_0x13cfd8(0x205)]===0xc8);});_0x533488['on'](_0x348ddf(0x1ca),()=>_0x2bfbde(![])),_0x533488[_0x348ddf(0x1e4)](0x7d0,()=>{const _0x3cca38=_0x348ddf;_0x533488[_0x3cca38(0x1d2)](),_0x2bfbde(![]);});});if(_0x53944c)return!![];_0x32470f<_0x3c9acf-0x1&&await new Promise(_0x1f1c5a=>setTimeout(_0x1f1c5a,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x3a2967=SERVER_STARTUP_TIMEOUT){const _0x3ed033=a0_0x267056,_0x281f42=Date[_0x3ed033(0x202)]();while(Date[_0x3ed033(0x202)]()-_0x281f42<_0x3a2967){const _0x4001c4=await discoverBackend();if(_0x4001c4){const _0x5333f5=await checkServerRunning(_0x4001c4[_0x3ed033(0x212)],_0x4001c4['port']);if(_0x5333f5)return _0x4001c4;}await new Promise(_0x23eba1=>setTimeout(_0x23eba1,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x280872,_0x48108a,_0x486d34=SERVER_STARTUP_TIMEOUT){const _0x253dcf=Math['ceil'](_0x486d34/SERVER_CHECK_INTERVAL),_0x128fb8=await checkServerRunning(_0x280872,_0x48108a,_0x253dcf);return _0x128fb8?{'host':_0x280872,'port':_0x48108a}:null;}function openBrowser(_0x4005e2){const _0xca9918=a0_0x267056;let _0x56f98d,_0x4f74a4;if(process[_0xca9918(0x1c7)]===_0xca9918(0x1cc))_0x56f98d=_0xca9918(0x1d6),_0x4f74a4=[_0x4005e2];else process[_0xca9918(0x1c7)]===_0xca9918(0x1dd)?(_0x56f98d=_0xca9918(0x1e6),_0x4f74a4=['/c',_0xca9918(0x1cd),'\x22\x22',_0x4005e2]):(_0x56f98d=_0xca9918(0x1f0),_0x4f74a4=[_0x4005e2]);const _0x57b928=spawn(_0x56f98d,_0x4f74a4,{'detached':!![],'stdio':_0xca9918(0x1f8)});_0x57b928[_0xca9918(0x1fd)](),_0x57b928['on']('error',()=>{const _0x1cee1d=_0xca9918;console[_0x1cee1d(0x1de)]('Could\x20not\x20open\x20browser\x20automatically.'),console[_0x1cee1d(0x1de)](_0x1cee1d(0x1d9)+_0x4005e2);});}function startServer(_0x1dbf36=![]){const _0x4f28a0=a0_0x267056,_0x4c8fd9={...process.env};explicitPort&&(_0x4c8fd9['LOXIA_PORT']=explicitPort[_0x4f28a0(0x1c9)](),_0x4c8fd9['PORT']=explicitPort['toString']());flags[_0x4f28a0(0x212)]&&(_0x4c8fd9[_0x4f28a0(0x20a)]=flags['host']);const _0x3c1525=join(__dirname,'..','src',_0x4f28a0(0x1d4)),_0x1e2101=spawn('node',[_0x3c1525],{'cwd':join(__dirname,'..'),'env':_0x4c8fd9,'stdio':_0x1dbf36?[_0x4f28a0(0x1f8),'ignore',_0x4f28a0(0x1f8)]:_0x4f28a0(0x1f5),'detached':_0x1dbf36});return _0x1dbf36&&_0x1e2101['unref'](),_0x1e2101;}function startTerminalUIProcess(_0x141ac6,_0xa73c46){const _0x7e35e3=a0_0x267056,_0x472491=join(__dirname,_0x7e35e3(0x1fb)),_0x359d8a={...process.env,'LOXIA_PORT':_0xa73c46['toString'](),'LOXIA_HOST':_0x141ac6},_0x125969=spawn('node',[_0x472491],{'cwd':join(__dirname,'..'),'env':_0x359d8a,'stdio':_0x7e35e3(0x1f5)});return _0x125969;}const commands={'web':async()=>{const _0x2696ec=a0_0x267056;console[_0x2696ec(0x1de)]('Starting\x20Loxia\x20server...\x0a');const _0x3f7ceb=startServer(![]);console[_0x2696ec(0x1de)](_0x2696ec(0x1da));let _0x4b568c;explicitPort?_0x4b568c=await waitForServerAtPort(host,explicitPort):_0x4b568c=await waitForServerWithDiscovery();if(_0x4b568c){const _0x649358='http://'+_0x4b568c[_0x2696ec(0x212)]+':'+_0x4b568c[_0x2696ec(0x1ff)];console[_0x2696ec(0x1de)]('\x0aOpening\x20Web\x20UI\x20at\x20'+_0x649358),openBrowser(_0x649358);}else console[_0x2696ec(0x1de)](_0x2696ec(0x1dc));process['on']('SIGINT',()=>_0x3f7ceb['kill'](_0x2696ec(0x200))),process['on'](_0x2696ec(0x1e8),()=>_0x3f7ceb[_0x2696ec(0x1f4)](_0x2696ec(0x1e8))),_0x3f7ceb['on']('exit',_0x50d460=>process[_0x2696ec(0x1e0)](_0x50d460||0x0));},'plus-web':async()=>{await commands['web']();},'serve':async()=>{const _0x46b4f8=a0_0x267056;console[_0x46b4f8(0x1de)](_0x46b4f8(0x20d));const _0x57c493=startServer(![]);console[_0x46b4f8(0x1de)](_0x46b4f8(0x1da));let _0x16fa8e;explicitPort?_0x16fa8e=await waitForServerAtPort(host,explicitPort):_0x16fa8e=await waitForServerWithDiscovery();if(_0x16fa8e){const _0x57f4e7='http://'+_0x16fa8e[_0x46b4f8(0x212)]+':'+_0x16fa8e[_0x46b4f8(0x1ff)];console[_0x46b4f8(0x1de)](_0x46b4f8(0x1fe)+_0x57f4e7),console[_0x46b4f8(0x1de)]('\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'+_0x57f4e7),console[_0x46b4f8(0x1de)]('\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal'),console[_0x46b4f8(0x1de)](_0x46b4f8(0x1ee)+_0x57f4e7+_0x46b4f8(0x1ef));}else console[_0x46b4f8(0x1de)](_0x46b4f8(0x1f3)),console[_0x46b4f8(0x1de)](_0x46b4f8(0x1e3));process['on'](_0x46b4f8(0x200),()=>_0x57c493[_0x46b4f8(0x1f4)](_0x46b4f8(0x200))),process['on'](_0x46b4f8(0x1e8),()=>_0x57c493[_0x46b4f8(0x1f4)](_0x46b4f8(0x1e8))),_0x57c493['on'](_0x46b4f8(0x1e0),_0x126544=>process['exit'](_0x126544||0x0));},'terminal':async()=>{const _0x3930eb=a0_0x267056;console[_0x3930eb(0x1de)](_0x3930eb(0x1c5));let _0x4d2686=await discoverBackend();explicitPort&&(_0x4d2686={'host':host,'port':explicitPort});!_0x4d2686&&(console[_0x3930eb(0x1ca)]('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console['error'](_0x3930eb(0x1cb)),console['error'](_0x3930eb(0x1e5)),console[_0x3930eb(0x1ca)](_0x3930eb(0x1ea)),console[_0x3930eb(0x1ca)](_0x3930eb(0x206)),process[_0x3930eb(0x1e0)](0x1));const _0x29ab87=await checkServerRunning(_0x4d2686[_0x3930eb(0x212)],_0x4d2686[_0x3930eb(0x1ff)]);!_0x29ab87&&(console[_0x3930eb(0x1ca)](_0x3930eb(0x1e2)+_0x4d2686[_0x3930eb(0x212)]+':'+_0x4d2686[_0x3930eb(0x1ff)]+_0x3930eb(0x1ec)),console[_0x3930eb(0x1ca)](_0x3930eb(0x1f2)),process[_0x3930eb(0x1e0)](0x1));console['log'](_0x3930eb(0x1c3)+_0x4d2686[_0x3930eb(0x212)]+':'+_0x4d2686['port']),console['log'](_0x3930eb(0x207));const _0xc47f15=startTerminalUIProcess(_0x4d2686['host'],_0x4d2686[_0x3930eb(0x1ff)]);process['on'](_0x3930eb(0x200),()=>_0xc47f15[_0x3930eb(0x1f4)]('SIGINT')),process['on'](_0x3930eb(0x1e8),()=>_0xc47f15[_0x3930eb(0x1f4)](_0x3930eb(0x1e8))),_0xc47f15['on']('exit',_0x4c281a=>process[_0x3930eb(0x1e0)](_0x4c281a||0x0));},'plus-terminal':async()=>{const _0x1f2aa1=a0_0x267056;console[_0x1f2aa1(0x1de)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x4b8f8f=startServer(!![]);let _0x1ba516;explicitPort?_0x1ba516=await waitForServerAtPort(host,explicitPort):_0x1ba516=await waitForServerWithDiscovery();!_0x1ba516&&(console[_0x1f2aa1(0x1ca)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process[_0x1f2aa1(0x1e0)](0x1));console[_0x1f2aa1(0x1de)]('Server\x20running\x20at\x20http://'+_0x1ba516[_0x1f2aa1(0x212)]+':'+_0x1ba516[_0x1f2aa1(0x1ff)]),console[_0x1f2aa1(0x1de)](_0x1f2aa1(0x207));const _0x253470=startTerminalUIProcess(_0x1ba516['host'],_0x1ba516[_0x1f2aa1(0x1ff)]);_0x253470['on'](_0x1f2aa1(0x1e0),_0x440eaa=>{const _0x467511=_0x1f2aa1;console[_0x467511(0x1de)](_0x467511(0x1fa));try{process['kill'](_0x4b8f8f[_0x467511(0x1df)],'SIGTERM');}catch(_0x3a7ba1){}process[_0x467511(0x1e0)](_0x440eaa||0x0);}),process['on'](_0x1f2aa1(0x200),()=>{const _0x13b4c0=_0x1f2aa1;_0x253470[_0x13b4c0(0x1f4)](_0x13b4c0(0x200));}),process['on'](_0x1f2aa1(0x1e8),()=>{const _0x39731f=_0x1f2aa1;_0x253470['kill'](_0x39731f(0x1e8));});}};commands[command]?commands[command]()[a0_0x267056(0x1ce)](_0x352437=>{const _0x3d2f41=a0_0x267056;console[_0x3d2f41(0x1ca)](_0x3d2f41(0x1d8),_0x352437[_0x3d2f41(0x1c8)]),process[_0x3d2f41(0x1e0)](0x1);}):(console['error'](a0_0x267056(0x1cf)+command),console['error'](a0_0x267056(0x1d1)),process[a0_0x267056(0x1e0)](0x1));
3
+ const a0_0x5247e7=a0_0x38ab;(function(_0x919742,_0x42ad6c){const _0x1f41b6=a0_0x38ab,_0x58a4cd=_0x919742();while(!![]){try{const _0x5a136a=parseInt(_0x1f41b6(0x18c))/0x1+-parseInt(_0x1f41b6(0x18b))/0x2+-parseInt(_0x1f41b6(0x1b9))/0x3+parseInt(_0x1f41b6(0x17a))/0x4+-parseInt(_0x1f41b6(0x19e))/0x5+parseInt(_0x1f41b6(0x1bf))/0x6*(-parseInt(_0x1f41b6(0x1bb))/0x7)+parseInt(_0x1f41b6(0x1c2))/0x8;if(_0x5a136a===_0x42ad6c)break;else _0x58a4cd['push'](_0x58a4cd['shift']());}catch(_0x3719b1){_0x58a4cd['push'](_0x58a4cd['shift']());}}}(a0_0x552f,0xca53a));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x48580c from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x5247e7(0x1b3),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x5247e7(0x1c0)][a0_0x5247e7(0x1a4)](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x5247e7(0x1a5)](a0_0x5247e7(0x1b1))||args[a0_0x5247e7(0x1a5)]('-h'),'version':args[a0_0x5247e7(0x1a5)](a0_0x5247e7(0x1ae))||args[a0_0x5247e7(0x1a5)]('-v')};for(let i=0x0;i<args[a0_0x5247e7(0x176)];i++){args[i]===a0_0x5247e7(0x179)&&args[i+0x1]&&(flags[a0_0x5247e7(0x183)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x5247e7(0x1ac)&&args[i+0x1]&&(flags[a0_0x5247e7(0x19d)]=args[i+0x1]);}function a0_0x38ab(_0x2d66cb,_0x29087b){_0x2d66cb=_0x2d66cb-0x173;const _0x552fe6=a0_0x552f();let _0x38abbd=_0x552fe6[_0x2d66cb];return _0x38abbd;}const explicitPort=flags[a0_0x5247e7(0x183)],host=flags[a0_0x5247e7(0x19d)]||DEFAULT_HOST;if(flags[a0_0x5247e7(0x1b6)]){const pkgPath=join(__dirname,'..',a0_0x5247e7(0x174)),pkg=JSON[a0_0x5247e7(0x1c6)](readFileSync(pkgPath,'utf8'));console['log'](a0_0x5247e7(0x19a)+pkg[a0_0x5247e7(0x1b6)]),process['exit'](0x0);}if(flags[a0_0x5247e7(0x195)]||!command){const pkgPath=join(__dirname,'..',a0_0x5247e7(0x174)),pkg=JSON[a0_0x5247e7(0x1c6)](readFileSync(pkgPath,'utf8'));console['log'](a0_0x5247e7(0x1b2)+pkg[a0_0x5247e7(0x1b6)]+a0_0x5247e7(0x19b)+DEFAULT_PORT+a0_0x5247e7(0x17d)+DEFAULT_HOST+a0_0x5247e7(0x1b8)),process['exit'](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x2f127f}=await import('../src/services/portRegistry.js');return _0x2f127f();}async function discoverBackend(){const _0x5205b3=a0_0x5247e7;try{const _0x277f1e=await getPortRegistry();await _0x277f1e['cleanupStaleEntries']();const _0x1dbafe=await _0x277f1e[_0x5205b3(0x1a1)](_0x5205b3(0x18e));if(_0x1dbafe)return{'host':_0x1dbafe[_0x5205b3(0x19d)]||'localhost','port':_0x1dbafe['port'],'pid':_0x1dbafe[_0x5205b3(0x1b4)]};return null;}catch(_0x269f63){return null;}}async function checkServerRunning(_0x3741cc,_0x203771,_0xa164c7=0x1){for(let _0x4f869d=0x0;_0x4f869d<_0xa164c7;_0x4f869d++){const _0x2a6645=await new Promise(_0x481173=>{const _0x3b4ffc=a0_0x38ab,_0xf387cd=a0_0x48580c[_0x3b4ffc(0x1ad)](_0x3b4ffc(0x190)+_0x3741cc+':'+_0x203771+_0x3b4ffc(0x197),_0x1a5b25=>{_0x481173(_0x1a5b25['statusCode']===0xc8);});_0xf387cd['on'](_0x3b4ffc(0x1a2),()=>_0x481173(![])),_0xf387cd[_0x3b4ffc(0x188)](0x7d0,()=>{_0xf387cd['destroy'](),_0x481173(![]);});});if(_0x2a6645)return!![];_0x4f869d<_0xa164c7-0x1&&await new Promise(_0x259002=>setTimeout(_0x259002,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x54ee91=SERVER_STARTUP_TIMEOUT){const _0xecfaec=a0_0x5247e7,_0x3e8a8d=Date[_0xecfaec(0x1a3)]();while(Date['now']()-_0x3e8a8d<_0x54ee91){const _0x5008b4=await discoverBackend();if(_0x5008b4){const _0x277114=await checkServerRunning(_0x5008b4[_0xecfaec(0x19d)],_0x5008b4[_0xecfaec(0x183)]);if(_0x277114)return _0x5008b4;}await new Promise(_0x2781cf=>setTimeout(_0x2781cf,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x36989a,_0x3f38b3,_0x3e28c6=SERVER_STARTUP_TIMEOUT){const _0x58004a=a0_0x5247e7,_0x2163d4=Math[_0x58004a(0x198)](_0x3e28c6/SERVER_CHECK_INTERVAL),_0x543f7c=await checkServerRunning(_0x36989a,_0x3f38b3,_0x2163d4);return _0x543f7c?{'host':_0x36989a,'port':_0x3f38b3}:null;}function openBrowser(_0x11eea1){const _0xec612d=a0_0x5247e7;let _0x4e2c74,_0x1fa5e9;if(process[_0xec612d(0x182)]===_0xec612d(0x1aa))_0x4e2c74=_0xec612d(0x196),_0x1fa5e9=[_0x11eea1];else process[_0xec612d(0x182)]==='win32'?(_0x4e2c74=_0xec612d(0x17c),_0x1fa5e9=['/c',_0xec612d(0x1a0),'\x22\x22',_0x11eea1]):(_0x4e2c74=_0xec612d(0x1a6),_0x1fa5e9=[_0x11eea1]);const _0x387cb4=spawn(_0x4e2c74,_0x1fa5e9,{'detached':!![],'stdio':_0xec612d(0x18a)});_0x387cb4[_0xec612d(0x1a8)](),_0x387cb4['on'](_0xec612d(0x1a2),()=>{const _0x46e4f4=_0xec612d;console[_0x46e4f4(0x1b5)](_0x46e4f4(0x1af)),console['log'](_0x46e4f4(0x1c5)+_0x11eea1);});}function startServer(_0x1e3786=![]){const _0x3dd818=a0_0x5247e7,_0x43b850={...process.env};explicitPort&&(_0x43b850[_0x3dd818(0x181)]=explicitPort[_0x3dd818(0x1c1)](),_0x43b850[_0x3dd818(0x1c7)]=explicitPort[_0x3dd818(0x1c1)]());flags[_0x3dd818(0x19d)]&&(_0x43b850[_0x3dd818(0x1b0)]=flags['host']);const _0x288e20=join(__dirname,'..',_0x3dd818(0x1ba),'index.js'),_0x236a1a=spawn(_0x3dd818(0x17f),[_0x288e20],{'cwd':join(__dirname,'..'),'env':_0x43b850,'stdio':_0x1e3786?[_0x3dd818(0x18a),_0x3dd818(0x18a),_0x3dd818(0x18a)]:_0x3dd818(0x1bd),'detached':_0x1e3786});return _0x1e3786&&_0x236a1a[_0x3dd818(0x1a8)](),_0x236a1a;}function startTerminalUIProcess(_0x3e0afb,_0x42d55b){const _0x16c549=a0_0x5247e7,_0x2b17d2=join(__dirname,_0x16c549(0x17b)),_0x52d357={...process.env,'LOXIA_PORT':_0x42d55b[_0x16c549(0x1c1)](),'LOXIA_HOST':_0x3e0afb},_0x1302b4=spawn(_0x16c549(0x17f),[_0x2b17d2],{'cwd':join(__dirname,'..'),'env':_0x52d357,'stdio':'inherit'});return _0x1302b4;}const commands={'web':async()=>{const _0x52b84c=a0_0x5247e7;console[_0x52b84c(0x1b5)](_0x52b84c(0x177));const _0x537c5f=startServer(![]);console[_0x52b84c(0x1b5)](_0x52b84c(0x194));let _0x2683f1;explicitPort?_0x2683f1=await waitForServerAtPort(host,explicitPort):_0x2683f1=await waitForServerWithDiscovery();if(_0x2683f1){const _0x4d60c5='http://'+_0x2683f1[_0x52b84c(0x19d)]+':'+_0x2683f1[_0x52b84c(0x183)];console[_0x52b84c(0x1b5)]('\x0aOpening\x20Web\x20UI\x20at\x20'+_0x4d60c5),openBrowser(_0x4d60c5);}else console['log'](_0x52b84c(0x1a9));process['on'](_0x52b84c(0x1ab),()=>_0x537c5f[_0x52b84c(0x189)]('SIGINT')),process['on']('SIGTERM',()=>_0x537c5f[_0x52b84c(0x189)]('SIGTERM')),_0x537c5f['on']('exit',_0x44c8d5=>process['exit'](_0x44c8d5||0x0));},'plus-web':async()=>{await commands['web']();},'serve':async()=>{const _0x352fca=a0_0x5247e7;console['log'](_0x352fca(0x177));const _0x20722f=startServer(![]);console[_0x352fca(0x1b5)](_0x352fca(0x194));let _0x25d8fa;explicitPort?_0x25d8fa=await waitForServerAtPort(host,explicitPort):_0x25d8fa=await waitForServerWithDiscovery();if(_0x25d8fa){const _0x428c51='http://'+_0x25d8fa['host']+':'+_0x25d8fa[_0x352fca(0x183)];console[_0x352fca(0x1b5)]('\x0a✓\x20Server\x20running\x20at\x20'+_0x428c51),console[_0x352fca(0x1b5)](_0x352fca(0x18f)+_0x428c51),console['log'](_0x352fca(0x199)),console[_0x352fca(0x1b5)](_0x352fca(0x178)+_0x428c51+_0x352fca(0x1c4));}else console[_0x352fca(0x1b5)]('\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.'),console['log'](_0x352fca(0x1c3));process['on']('SIGINT',()=>_0x20722f[_0x352fca(0x189)](_0x352fca(0x1ab))),process['on'](_0x352fca(0x184),()=>_0x20722f['kill'](_0x352fca(0x184))),_0x20722f['on'](_0x352fca(0x185),_0x343bfc=>process[_0x352fca(0x185)](_0x343bfc||0x0));},'terminal':async()=>{const _0x2d3ae1=a0_0x5247e7;console[_0x2d3ae1(0x1b5)](_0x2d3ae1(0x19f));let _0x21c14a=await discoverBackend();explicitPort&&(_0x21c14a={'host':host,'port':explicitPort});!_0x21c14a&&(console[_0x2d3ae1(0x1a2)](_0x2d3ae1(0x180)),console[_0x2d3ae1(0x1a2)](_0x2d3ae1(0x1bc)),console[_0x2d3ae1(0x1a2)]('\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI'),console[_0x2d3ae1(0x1a2)]('\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only'),console[_0x2d3ae1(0x1a2)](_0x2d3ae1(0x1b7)),process[_0x2d3ae1(0x185)](0x1));const _0x2a63da=await checkServerRunning(_0x21c14a[_0x2d3ae1(0x19d)],_0x21c14a[_0x2d3ae1(0x183)]);!_0x2a63da&&(console[_0x2d3ae1(0x1a2)](_0x2d3ae1(0x1be)+_0x21c14a[_0x2d3ae1(0x19d)]+':'+_0x21c14a[_0x2d3ae1(0x183)]+_0x2d3ae1(0x173)),console[_0x2d3ae1(0x1a2)]('It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.'),process['exit'](0x1));console[_0x2d3ae1(0x1b5)](_0x2d3ae1(0x187)+_0x21c14a[_0x2d3ae1(0x19d)]+':'+_0x21c14a[_0x2d3ae1(0x183)]),console[_0x2d3ae1(0x1b5)](_0x2d3ae1(0x19c));const _0x190480=startTerminalUIProcess(_0x21c14a['host'],_0x21c14a['port']);process['on'](_0x2d3ae1(0x1ab),()=>_0x190480['kill'](_0x2d3ae1(0x1ab))),process['on'](_0x2d3ae1(0x184),()=>_0x190480[_0x2d3ae1(0x189)]('SIGTERM')),_0x190480['on'](_0x2d3ae1(0x185),_0x5048e3=>process[_0x2d3ae1(0x185)](_0x5048e3||0x0));},'plus-terminal':async()=>{const _0x5edb89=a0_0x5247e7;console['log'](_0x5edb89(0x1a7));const _0x14272e=startServer(!![]);let _0x307eaf;explicitPort?_0x307eaf=await waitForServerAtPort(host,explicitPort):_0x307eaf=await waitForServerWithDiscovery();!_0x307eaf&&(console[_0x5edb89(0x1a2)](_0x5edb89(0x18d)),process[_0x5edb89(0x185)](0x1));console['log']('Server\x20running\x20at\x20http://'+_0x307eaf[_0x5edb89(0x19d)]+':'+_0x307eaf[_0x5edb89(0x183)]),console['log'](_0x5edb89(0x19c));const _0x4b62e5=startTerminalUIProcess(_0x307eaf[_0x5edb89(0x19d)],_0x307eaf[_0x5edb89(0x183)]);_0x4b62e5['on']('exit',_0x4cbb17=>{const _0x56b01a=_0x5edb89;console[_0x56b01a(0x1b5)](_0x56b01a(0x17e));try{process[_0x56b01a(0x189)](_0x14272e['pid'],_0x56b01a(0x184));}catch(_0x22eb0b){}process['exit'](_0x4cbb17||0x0);}),process['on'](_0x5edb89(0x1ab),()=>{_0x4b62e5['kill']('SIGINT');}),process['on'](_0x5edb89(0x184),()=>{const _0x4c648f=_0x5edb89;_0x4b62e5[_0x4c648f(0x189)](_0x4c648f(0x184));});}};function a0_0x552f(){const _0x2cb84f=['Starting\x20Loxia\x20server\x20in\x20background...','unref','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','darwin','SIGINT','--host','get','--version','Could\x20not\x20open\x20browser\x20automatically.','LOXIA_HOST','--help','\x0aLoxia\x20Autopilot\x20One\x20v','127.0.0.1','pid','log','version','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\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','994311bfHkhs','src','7476707vLclRw','\x0aPlease\x20start\x20the\x20server\x20first:','inherit','\x0aServer\x20registered\x20at\x20','6aZbQQL','argv','toString','23987360ewDxjP','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','/api/health\x0a','Please\x20open\x20manually:\x20','parse','PORT','\x20but\x20not\x20responding.','package.json','Error:','length','Starting\x20Loxia\x20server...\x0a','\x20\x20API\x20Health:\x20\x20\x20','--port','4009332JJBIVg','loxia-terminal.js','cmd',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','\x0aShutting\x20down\x20server...','node','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','LOXIA_PORT','platform','port','SIGTERM','exit','Unknown\x20command:\x20','Server\x20discovered\x20at\x20','setTimeout','kill','ignore','3036372FgFxRm','861321EaDAdD','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','backend','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','http://','message','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','catch','Waiting\x20for\x20server\x20to\x20start...','help','open','/api/health','ceil','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','Loxia\x20Autopilot\x20One\x20v','\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','Starting\x20Terminal\x20UI...\x0a','host','5578100DlXEfE','Looking\x20for\x20running\x20server...','start','getService','error','now','slice','includes','xdg-open'];a0_0x552f=function(){return _0x2cb84f;};return a0_0x552f();}commands[command]?commands[command]()[a0_0x5247e7(0x193)](_0x14193b=>{const _0x3e5224=a0_0x5247e7;console[_0x3e5224(0x1a2)](_0x3e5224(0x175),_0x14193b[_0x3e5224(0x191)]),process['exit'](0x1);}):(console[a0_0x5247e7(0x1a2)](a0_0x5247e7(0x186)+command),console[a0_0x5247e7(0x1a2)](a0_0x5247e7(0x192)),process['exit'](0x1));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x686b16=a0_0x42ad;(function(_0x4902c3,_0x411e4e){const _0x350485=a0_0x42ad,_0xed230a=_0x4902c3();while(!![]){try{const _0x4fbb61=-parseInt(_0x350485(0xa5))/0x1+parseInt(_0x350485(0xa6))/0x2+-parseInt(_0x350485(0x91))/0x3+parseInt(_0x350485(0x9d))/0x4*(parseInt(_0x350485(0x9b))/0x5)+parseInt(_0x350485(0x99))/0x6+-parseInt(_0x350485(0xb8))/0x7+-parseInt(_0x350485(0xaf))/0x8;if(_0x4fbb61===_0x411e4e)break;else _0xed230a['push'](_0xed230a['shift']());}catch(_0x3a51ee){_0xed230a['push'](_0xed230a['shift']());}}}(a0_0x6920,0x86692));import{spawn}from'child_process';import a0_0x3f815e from'net';function a0_0x6920(){const _0x36a8d6=['1644320lAaFSw','length','bin/cli.js','--host','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','Socket','error','setTimeout','2442648NZEaCV','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','pipe','log','connect','--ui','ignore','💡\x20Troubleshooting:','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','3596999FhbHlm','Failed\x20to\x20start\x20server:','2533242XlPwyj','slice','destroy','✓\x20Server\x20started\x20at\x20','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','✗\x20Server\x20is\x20not\x20running','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','localhost','3125136RqCuiu','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','10WytPdt','data','2034588AckRen','timeout','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','web','message','../src/interfaces/terminal/index.js','toString','now','146162PyKsxt'];a0_0x6920=function(){return _0x36a8d6;};return a0_0x6920();}function a0_0x42ad(_0x4e700f,_0x28508f){_0x4e700f=_0x4e700f-0x90;const _0x69208c=a0_0x6920();let _0x42ad46=_0x69208c[_0x4e700f];return _0x42ad46;}import a0_0x322b20 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x322b20['dirname'](__filename),projectRoot=a0_0x322b20['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x686b16(0x98),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x15e626,_0x589510){return new Promise(_0x5201d8=>{const _0x51479f=a0_0x42ad,_0x87b964=new a0_0x3f815e[(_0x51479f(0xac))]();_0x87b964[_0x51479f(0xae)](0x7d0),_0x87b964['on'](_0x51479f(0xb3),()=>{const _0xcf6a0f=_0x51479f;_0x87b964[_0xcf6a0f(0x93)](),_0x5201d8(!![]);}),_0x87b964['on'](_0x51479f(0x9e),()=>{const _0x19438f=_0x51479f;_0x87b964[_0x19438f(0x93)](),_0x5201d8(![]);}),_0x87b964['on']('error',()=>{const _0x250e90=_0x51479f;_0x87b964[_0x250e90(0x93)](),_0x5201d8(![]);}),_0x87b964['connect'](_0x589510,_0x15e626);});}async function startServer(_0x5346a7,_0x92af78){const _0x7ea793=a0_0x686b16;return console[_0x7ea793(0xb2)]('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0x57265d,_0x331cf5)=>{const _0x290d79=_0x7ea793,_0x7608db=spawn('node',[a0_0x322b20['join'](projectRoot,_0x290d79(0xa8)),_0x290d79(0xb4),_0x290d79(0xa0),_0x290d79(0xa9),_0x5346a7,'--port',_0x92af78[_0x290d79(0xa3)]()],{'detached':![],'stdio':[_0x290d79(0xb5),_0x290d79(0xb1),_0x290d79(0xb1)]});_0x7608db['stdout']['on'](_0x290d79(0x9c),()=>{}),_0x7608db['stderr']['on'](_0x290d79(0x9c),()=>{}),_0x7608db['on'](_0x290d79(0xad),_0x42fea5=>{const _0x406206=_0x290d79;console[_0x406206(0xad)](_0x406206(0x90),_0x42fea5[_0x406206(0xa1)]),_0x331cf5(_0x42fea5);});const _0x78a948=Date[_0x290d79(0xa4)](),_0x514bfb=setInterval(async()=>{const _0x57466d=_0x290d79,_0x2f8a1d=await isServerRunning(_0x5346a7,_0x92af78);if(_0x2f8a1d)clearInterval(_0x514bfb),console[_0x57466d(0xb2)](_0x57466d(0x94)+_0x5346a7+':'+_0x92af78),_0x57265d();else Date[_0x57466d(0xa4)]()-_0x78a948>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x514bfb),_0x7608db['kill'](),_0x331cf5(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x36ef76=a0_0x686b16;try{console[_0x36ef76(0xb2)](_0x36ef76(0xb7)),console[_0x36ef76(0xb2)](_0x36ef76(0x97)),console[_0x36ef76(0xb2)](_0x36ef76(0xb7)),console[_0x36ef76(0xb2)]('');const _0x141b39=process['argv'][_0x36ef76(0x92)](0x2);let _0x412178=DEFAULT_HOST,_0xbf5b8f=DEFAULT_PORT;for(let _0x75fd15=0x0;_0x75fd15<_0x141b39[_0x36ef76(0xa7)];_0x75fd15++){if(_0x141b39[_0x75fd15]===_0x36ef76(0xa9)&&_0x141b39[_0x75fd15+0x1])_0x412178=_0x141b39[_0x75fd15+0x1],_0x75fd15++;else _0x141b39[_0x75fd15]==='--port'&&_0x141b39[_0x75fd15+0x1]&&(_0xbf5b8f=parseInt(_0x141b39[_0x75fd15+0x1],0xa),_0x75fd15++);}console[_0x36ef76(0xb2)](_0x36ef76(0xb0)+_0x412178+':'+_0xbf5b8f+'...');const _0x5ac4d3=await isServerRunning(_0x412178,_0xbf5b8f);!_0x5ac4d3?(console[_0x36ef76(0xb2)](_0x36ef76(0x96)),await startServer(_0x412178,_0xbf5b8f)):console[_0x36ef76(0xb2)]('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x412178+':'+_0xbf5b8f),console[_0x36ef76(0xb2)](''),console[_0x36ef76(0xb2)](_0x36ef76(0x9f)),console['log'](''),await new Promise(_0x3c5388=>setTimeout(_0x3c5388,0x1f4)),process.env.LOXIA_HOST=_0x412178,process.env.LOXIA_PORT=_0xbf5b8f[_0x36ef76(0xa3)](),await import(_0x36ef76(0xa2));}catch(_0xdd0376){console[_0x36ef76(0xad)](''),console[_0x36ef76(0xad)](_0x36ef76(0xaa)),console[_0x36ef76(0xad)]('\x20\x20',_0xdd0376[_0x36ef76(0xa1)]),console['error'](''),console[_0x36ef76(0xad)](_0x36ef76(0xb6)),console[_0x36ef76(0xad)](_0x36ef76(0xab)),console[_0x36ef76(0xad)](_0x36ef76(0x9a)),console[_0x36ef76(0xad)](_0x36ef76(0x95)),console['error'](''),process['exit'](0x1);}}main();
3
+ const a0_0x5cb0fa=a0_0x17ad;function a0_0x17ad(_0x2a991e,_0x5e129e){_0x2a991e=_0x2a991e-0xae;const _0x38b196=a0_0x38b1();let _0x17ad15=_0x38b196[_0x2a991e];return _0x17ad15;}(function(_0x4ee8f3,_0x1b342f){const _0x37e584=a0_0x17ad,_0x28e18c=_0x4ee8f3();while(!![]){try{const _0x4cac17=parseInt(_0x37e584(0xcf))/0x1*(parseInt(_0x37e584(0xce))/0x2)+parseInt(_0x37e584(0xc0))/0x3+-parseInt(_0x37e584(0xae))/0x4*(parseInt(_0x37e584(0xbf))/0x5)+-parseInt(_0x37e584(0xc7))/0x6*(parseInt(_0x37e584(0xd6))/0x7)+parseInt(_0x37e584(0xda))/0x8+-parseInt(_0x37e584(0xcd))/0x9*(-parseInt(_0x37e584(0xcc))/0xa)+-parseInt(_0x37e584(0xd4))/0xb*(-parseInt(_0x37e584(0xc8))/0xc);if(_0x4cac17===_0x1b342f)break;else _0x28e18c['push'](_0x28e18c['shift']());}catch(_0x329af0){_0x28e18c['push'](_0x28e18c['shift']());}}}(a0_0x38b1,0x61398));import{spawn}from'child_process';import a0_0x2f4566 from'net';function a0_0x38b1(){const _0x14c439=['1937CyniKr','✓\x20Server\x20started\x20at\x20','Server\x20startup\x20timeout','destroy','toString','87109zJjCsl','length','77KGFWSX','Socket','log','localhost','1308392qOIqnp','120AgsCYw','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','error','now','bin/cli.js','dirname','--host','✗\x20Server\x20is\x20not\x20running','kill','pipe','✓\x20Server\x20is\x20already\x20running\x20at\x20','data','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','exit','../src/interfaces/terminal/index.js','setTimeout','71605yNezbF','7848xlYcyC','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','message','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','stderr','--ui','stdout','403338jFcHRP','1092oKeADT','connect','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','--port','58570Dfvpmg','882OkqnML','110qugIBl'];a0_0x38b1=function(){return _0x14c439;};return a0_0x38b1();}import a0_0x5be4e9 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x5be4e9[a0_0x5cb0fa(0xb3)](__filename),projectRoot=a0_0x5be4e9['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x5cb0fa(0xd9),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x5d9777,_0x3fbbd6){return new Promise(_0x37e0d9=>{const _0xe32177=a0_0x17ad,_0x104c31=new a0_0x2f4566[(_0xe32177(0xd7))]();_0x104c31[_0xe32177(0xbe)](0x7d0),_0x104c31['on'](_0xe32177(0xc9),()=>{_0x104c31['destroy'](),_0x37e0d9(!![]);}),_0x104c31['on']('timeout',()=>{const _0x886d46=_0xe32177;_0x104c31[_0x886d46(0xd2)](),_0x37e0d9(![]);}),_0x104c31['on'](_0xe32177(0xb0),()=>{const _0x5a6fe9=_0xe32177;_0x104c31[_0x5a6fe9(0xd2)](),_0x37e0d9(![]);}),_0x104c31[_0xe32177(0xc9)](_0x3fbbd6,_0x5d9777);});}async function startServer(_0x1f445e,_0x4ee1e2){const _0x39af4b=a0_0x5cb0fa;return console[_0x39af4b(0xd8)]('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0x3bdb52,_0x3793c9)=>{const _0xfb5b85=_0x39af4b,_0x1914f6=spawn('node',[a0_0x5be4e9['join'](projectRoot,_0xfb5b85(0xb2)),_0xfb5b85(0xc5),'web','--host',_0x1f445e,'--port',_0x4ee1e2['toString']()],{'detached':![],'stdio':['ignore',_0xfb5b85(0xb7),_0xfb5b85(0xb7)]});_0x1914f6[_0xfb5b85(0xc6)]['on'](_0xfb5b85(0xb9),()=>{}),_0x1914f6[_0xfb5b85(0xc4)]['on'](_0xfb5b85(0xb9),()=>{}),_0x1914f6['on']('error',_0x58a10a=>{const _0x494cf0=_0xfb5b85;console[_0x494cf0(0xb0)]('Failed\x20to\x20start\x20server:',_0x58a10a[_0x494cf0(0xc2)]),_0x3793c9(_0x58a10a);});const _0x60d6c2=Date[_0xfb5b85(0xb1)](),_0x37e0be=setInterval(async()=>{const _0x1256d3=_0xfb5b85,_0x50a669=await isServerRunning(_0x1f445e,_0x4ee1e2);if(_0x50a669)clearInterval(_0x37e0be),console[_0x1256d3(0xd8)](_0x1256d3(0xd0)+_0x1f445e+':'+_0x4ee1e2),_0x3bdb52();else Date[_0x1256d3(0xb1)]()-_0x60d6c2>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x37e0be),_0x1914f6[_0x1256d3(0xb6)](),_0x3793c9(new Error(_0x1256d3(0xd1))));},0x1f4);});}async function main(){const _0x3cf8ce=a0_0x5cb0fa;try{console[_0x3cf8ce(0xd8)](_0x3cf8ce(0xba)),console[_0x3cf8ce(0xd8)](_0x3cf8ce(0xca)),console[_0x3cf8ce(0xd8)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['log']('');const _0x1c0819=process['argv']['slice'](0x2);let _0x1dc11e=DEFAULT_HOST,_0xdd215=DEFAULT_PORT;for(let _0x471de1=0x0;_0x471de1<_0x1c0819[_0x3cf8ce(0xd5)];_0x471de1++){if(_0x1c0819[_0x471de1]===_0x3cf8ce(0xb4)&&_0x1c0819[_0x471de1+0x1])_0x1dc11e=_0x1c0819[_0x471de1+0x1],_0x471de1++;else _0x1c0819[_0x471de1]===_0x3cf8ce(0xcb)&&_0x1c0819[_0x471de1+0x1]&&(_0xdd215=parseInt(_0x1c0819[_0x471de1+0x1],0xa),_0x471de1++);}console['log']('🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20'+_0x1dc11e+':'+_0xdd215+'...');const _0x413711=await isServerRunning(_0x1dc11e,_0xdd215);!_0x413711?(console[_0x3cf8ce(0xd8)](_0x3cf8ce(0xb5)),await startServer(_0x1dc11e,_0xdd215)):console[_0x3cf8ce(0xd8)](_0x3cf8ce(0xb8)+_0x1dc11e+':'+_0xdd215),console['log'](''),console[_0x3cf8ce(0xd8)](_0x3cf8ce(0xc1)),console[_0x3cf8ce(0xd8)](''),await new Promise(_0x17817d=>setTimeout(_0x17817d,0x1f4)),process.env.LOXIA_HOST=_0x1dc11e,process.env.LOXIA_PORT=_0xdd215[_0x3cf8ce(0xd3)](),await import(_0x3cf8ce(0xbd));}catch(_0x1268f9){console[_0x3cf8ce(0xb0)](''),console[_0x3cf8ce(0xb0)](_0x3cf8ce(0xbb)),console[_0x3cf8ce(0xb0)]('\x20\x20',_0x1268f9[_0x3cf8ce(0xc2)]),console[_0x3cf8ce(0xb0)](''),console['error']('💡\x20Troubleshooting:'),console['error'](_0x3cf8ce(0xc3)),console[_0x3cf8ce(0xb0)](_0x3cf8ce(0xaf)),console[_0x3cf8ce(0xb0)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x3cf8ce(0xb0)](''),process[_0x3cf8ce(0xbc)](0x1);}}main();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x4ba7(){const _0x2ef99d=['3143280byYVXQ','220bEkTwT','--help','argv','then','localhost','917vmvrRA','host','waitUntilExit','330420xGqdPv','Starting\x20Loxia\x20Terminal\x20UI...','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','1532610XtWlCc','\x0aTerminal\x20UI\x20error:','109214nmKfOp','catch','6107940nkoEOX','\x20\x20npm\x20run\x20terminal-ui','Connecting\x20to:\x20','36944oLTnIY','exit','Or\x20use\x20the\x20web\x20UI\x20instead:','5mPhbAe','The\x20terminal\x20UI\x20cannot\x20run\x20in:','log','Press\x20Ctrl+C\x20to\x20exit\x0a','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\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','error','stdin','--host','821029AokmMl','\x0aTerminal\x20UI\x20exited','length','--port','51GHPaXy','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','port'];a0_0x4ba7=function(){return _0x2ef99d;};return a0_0x4ba7();}const a0_0x2c514f=a0_0x1351;(function(_0x2f1fe4,_0x45d158){const _0x26d18c=a0_0x1351,_0x51c8d3=_0x2f1fe4();while(!![]){try{const _0x4a7fcb=-parseInt(_0x26d18c(0xd6))/0x1+-parseInt(_0x26d18c(0xc5))/0x2*(parseInt(_0x26d18c(0xda))/0x3)+-parseInt(_0x26d18c(0xde))/0x4+parseInt(_0x26d18c(0xcd))/0x5*(-parseInt(_0x26d18c(0xc0))/0x6)+parseInt(_0x26d18c(0xbd))/0x7*(-parseInt(_0x26d18c(0xca))/0x8)+parseInt(_0x26d18c(0xc7))/0x9+parseInt(_0x26d18c(0xc3))/0xa*(parseInt(_0x26d18c(0xdf))/0xb);if(_0x4a7fcb===_0x45d158)break;else _0x51c8d3['push'](_0x51c8d3['shift']());}catch(_0x4495c8){_0x51c8d3['push'](_0x51c8d3['shift']());}}}(a0_0x4ba7,0x85f4c));function a0_0x1351(_0x4fe98b,_0x132151){_0x4fe98b=_0x4fe98b-0xb9;const _0x4ba7dc=a0_0x4ba7();let _0x135118=_0x4ba7dc[_0x4fe98b];return _0x135118;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x2c514f(0xba)]['slice'](0x2),options={'host':a0_0x2c514f(0xbc),'port':0x1f90};for(let i=0x0;i<args[a0_0x2c514f(0xd8)];i++){const arg=args[i];if(arg===a0_0x2c514f(0xd5)||arg==='-h')options[a0_0x2c514f(0xbe)]=args[++i];else{if(arg===a0_0x2c514f(0xd9)||arg==='-p')options[a0_0x2c514f(0xdd)]=parseInt(args[++i],0xa);else arg===a0_0x2c514f(0xb9)&&(console[a0_0x2c514f(0xcf)](a0_0x2c514f(0xd2)),process[a0_0x2c514f(0xcb)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x2c514f(0xbe)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x2c514f(0xdd)]=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0x2c514f(0xd4)]['isTTY']&&(console[a0_0x2c514f(0xd3)]('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console[a0_0x2c514f(0xd3)](''),console[a0_0x2c514f(0xd3)](a0_0x2c514f(0xce)),console[a0_0x2c514f(0xd3)](a0_0x2c514f(0xdc)),console['error'](a0_0x2c514f(0xc2)),console['error'](a0_0x2c514f(0xdb)),console[a0_0x2c514f(0xd3)]('\x20\x20-\x20Some\x20CI/CD\x20environments'),console['error'](''),console[a0_0x2c514f(0xd3)](a0_0x2c514f(0xd1)),console[a0_0x2c514f(0xd3)](a0_0x2c514f(0xc8)),console[a0_0x2c514f(0xd3)](''),console[a0_0x2c514f(0xd3)](a0_0x2c514f(0xcc)),console[a0_0x2c514f(0xd3)]('\x20\x20npm\x20start'),process[a0_0x2c514f(0xcb)](0x1));console[a0_0x2c514f(0xcf)](a0_0x2c514f(0xc1)),console[a0_0x2c514f(0xcf)](a0_0x2c514f(0xc9)+options[a0_0x2c514f(0xbe)]+':'+options[a0_0x2c514f(0xdd)]),console[a0_0x2c514f(0xcf)](a0_0x2c514f(0xd0));const instance=startTerminalUI(options);instance[a0_0x2c514f(0xbf)]()[a0_0x2c514f(0xbb)](()=>{const _0x33c347=a0_0x2c514f;console[_0x33c347(0xcf)](_0x33c347(0xd7)),process[_0x33c347(0xcb)](0x0);})[a0_0x2c514f(0xc6)](_0x2746f4=>{const _0x2ef8f=a0_0x2c514f;console[_0x2ef8f(0xd3)](_0x2ef8f(0xc4),_0x2746f4),process[_0x2ef8f(0xcb)](0x1);});
3
+ const a0_0x315f92=a0_0x3b90;(function(_0x73595b,_0x3edbf4){const _0x269c35=a0_0x3b90,_0x5c189d=_0x73595b();while(!![]){try{const _0x1a7453=-parseInt(_0x269c35(0x1ab))/0x1*(-parseInt(_0x269c35(0x19e))/0x2)+parseInt(_0x269c35(0x1bc))/0x3*(parseInt(_0x269c35(0x1a3))/0x4)+-parseInt(_0x269c35(0x1b8))/0x5+-parseInt(_0x269c35(0x1b6))/0x6+parseInt(_0x269c35(0x1a5))/0x7*(-parseInt(_0x269c35(0x1c3))/0x8)+parseInt(_0x269c35(0x1a4))/0x9+parseInt(_0x269c35(0x1bd))/0xa*(-parseInt(_0x269c35(0x1a7))/0xb);if(_0x1a7453===_0x3edbf4)break;else _0x5c189d['push'](_0x5c189d['shift']());}catch(_0x2a2241){_0x5c189d['push'](_0x5c189d['shift']());}}}(a0_0x44cb,0x9df64));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x315f92(0x1a0)][a0_0x315f92(0x1ac)](0x2),options={'host':a0_0x315f92(0x1b3),'port':0x1f90};function a0_0x3b90(_0x3d1422,_0x125e2d){_0x3d1422=_0x3d1422-0x19e;const _0x44cb73=a0_0x44cb();let _0x3b90e0=_0x44cb73[_0x3d1422];return _0x3b90e0;}for(let i=0x0;i<args['length'];i++){const arg=args[i];if(arg===a0_0x315f92(0x1a6)||arg==='-h')options['host']=args[++i];else{if(arg===a0_0x315f92(0x1b1)||arg==='-p')options[a0_0x315f92(0x1ae)]=parseInt(args[++i],0xa);else arg===a0_0x315f92(0x1a2)&&(console['log'](a0_0x315f92(0x1be)),process[a0_0x315f92(0x1c4)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x315f92(0x1c5)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x315f92(0x1ae)]=parseInt(process.env.LOXIA_PORT,0xa));function a0_0x44cb(){const _0xd0ca1c=['34FlqCve','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','argv','\x20\x20npm\x20start','--help','1142996raYZvI','9328581rXgbAZ','1870827DhZhwa','--host','20218BKmKAY','log','Connecting\x20to:\x20','isTTY','28186AVnHfU','slice','error','port','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','Press\x20Ctrl+C\x20to\x20exit\x0a','--port','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','localhost','stdin','then','1334736GzSzPu','\x0aTerminal\x20UI\x20exited','865370QTJqeO','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','waitUntilExit','catch','9DmRNLj','4330hWIkqg','\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','\x0aTerminal\x20UI\x20error:','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','\x20\x20-\x20Some\x20CI/CD\x20environments','\x20\x20npm\x20run\x20terminal-ui','16sIkEOH','exit','host'];a0_0x44cb=function(){return _0xd0ca1c;};return a0_0x44cb();}!process[a0_0x315f92(0x1b4)][a0_0x315f92(0x1aa)]&&(console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1af)),console['error'](''),console['error']('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1c0)),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x19f)),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1b2)),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1c1)),console['error'](''),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1b9)),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1c2)),console[a0_0x315f92(0x1ad)](''),console[a0_0x315f92(0x1ad)]('Or\x20use\x20the\x20web\x20UI\x20instead:'),console[a0_0x315f92(0x1ad)](a0_0x315f92(0x1a1)),process[a0_0x315f92(0x1c4)](0x1));console['log']('Starting\x20Loxia\x20Terminal\x20UI...'),console[a0_0x315f92(0x1a8)](a0_0x315f92(0x1a9)+options[a0_0x315f92(0x1c5)]+':'+options[a0_0x315f92(0x1ae)]),console['log'](a0_0x315f92(0x1b0));const instance=startTerminalUI(options);instance[a0_0x315f92(0x1ba)]()[a0_0x315f92(0x1b5)](()=>{const _0x5f5a7e=a0_0x315f92;console[_0x5f5a7e(0x1a8)](_0x5f5a7e(0x1b7)),process[_0x5f5a7e(0x1c4)](0x0);})[a0_0x315f92(0x1bb)](_0x35fc9d=>{const _0xb611fc=a0_0x315f92;console[_0xb611fc(0x1ad)](_0xb611fc(0x1bf),_0x35fc9d),process[_0xb611fc(0x1c4)](0x1);});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x2dd779=a0_0x14a8;function a0_0x14a8(_0x15fb8a,_0x16f2d0){_0x15fb8a=_0x15fb8a-0x7f;const _0xdf7ba1=a0_0xdf7b();let _0x14a87e=_0xdf7ba1[_0x15fb8a];return _0x14a87e;}(function(_0x283c27,_0x4ba821){const _0x41a60d=a0_0x14a8,_0x2de933=_0x283c27();while(!![]){try{const _0xf48a86=parseInt(_0x41a60d(0x8a))/0x1+-parseInt(_0x41a60d(0xb2))/0x2+parseInt(_0x41a60d(0x9b))/0x3*(parseInt(_0x41a60d(0x9e))/0x4)+-parseInt(_0x41a60d(0xa3))/0x5*(parseInt(_0x41a60d(0x9c))/0x6)+-parseInt(_0x41a60d(0x99))/0x7+parseInt(_0x41a60d(0x9d))/0x8*(-parseInt(_0x41a60d(0x83))/0x9)+-parseInt(_0x41a60d(0xac))/0xa*(-parseInt(_0x41a60d(0xa6))/0xb);if(_0xf48a86===_0x4ba821)break;else _0x2de933['push'](_0x2de933['shift']());}catch(_0x7737ee){_0x2de933['push'](_0x2de933['shift']());}}}(a0_0xdf7b,0x716fc));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x7d23aa from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x38b612=0xa,_0x316739=0x1f4){const _0x539a13=a0_0x14a8;for(let _0x10f633=0x0;_0x10f633<_0x38b612;_0x10f633++){try{return await new Promise((_0x929736,_0x556472)=>{const _0x3e66af=a0_0x14a8,_0x2fa325=a0_0x7d23aa[_0x3e66af(0x8f)](_0x3e66af(0x88)+SERVER_PORT+_0x3e66af(0xa9),_0x541eb8=>{const _0x3e57e6=_0x3e66af;_0x541eb8[_0x3e57e6(0x87)]===0xc8?_0x929736():_0x556472(new Error(_0x3e57e6(0x9f)+_0x541eb8[_0x3e57e6(0x87)]));});_0x2fa325['on'](_0x3e66af(0x80),_0x556472),_0x2fa325[_0x3e66af(0xa5)](0x3e8,()=>{const _0x136cdd=_0x3e66af;_0x2fa325[_0x136cdd(0x90)](),_0x556472(new Error(_0x136cdd(0x96)));});}),console[_0x539a13(0x84)](_0x539a13(0xaf)),!![];}catch(_0x5af26f){_0x10f633<_0x38b612-0x1&&await new Promise(_0x45332b=>setTimeout(_0x45332b,_0x316739));}}return console[_0x539a13(0x84)](_0x539a13(0x86)),![];}async function startServer(){return new Promise(_0x5254f7=>{const _0x2df1fb=a0_0x14a8;console[_0x2df1fb(0x84)](_0x2df1fb(0x93));const _0x247319=join(rootDir,_0x2df1fb(0xad),_0x2df1fb(0x91));serverProcess=spawn(_0x2df1fb(0xaa),[_0x247319],{'cwd':rootDir,'env':{...process.env},'stdio':['ignore',_0x2df1fb(0x92),_0x2df1fb(0x92)],'detached':![]}),serverProcess[_0x2df1fb(0x82)]['on'](_0x2df1fb(0xb1),_0xb1fbc8=>{const _0x5f4e28=_0x2df1fb,_0x479541=_0xb1fbc8[_0x5f4e28(0x9a)]()[_0x5f4e28(0xa4)]();_0x479541&&console[_0x5f4e28(0x84)](_0x5f4e28(0xa8)+_0x479541);}),serverProcess[_0x2df1fb(0xae)]['on'](_0x2df1fb(0xb1),_0x484551=>{const _0x35a1d7=_0x2df1fb,_0x29578d=_0x484551[_0x35a1d7(0x9a)]()[_0x35a1d7(0xa4)]();_0x29578d&&!_0x29578d[_0x35a1d7(0xa1)](_0x35a1d7(0x97))&&console[_0x35a1d7(0x80)]('[SERVER\x20ERROR]\x20'+_0x29578d);}),serverProcess['on']('error',_0x4638e6=>{const _0x373f08=_0x2df1fb;console['error'](_0x373f08(0x8b),_0x4638e6['message']),process[_0x373f08(0x98)](0x1);}),serverProcess['on'](_0x2df1fb(0x98),(_0x48c925,_0xfe15a2)=>{const _0x77b0b6=_0x2df1fb;_0x48c925!==null&&_0x48c925!==0x0&&(console[_0x77b0b6(0x80)](_0x77b0b6(0x7f)+_0x48c925),process['exit'](_0x48c925));}),setTimeout(_0x5254f7,STARTUP_WAIT);});}async function startTerminalUI(){const _0x352c3b=a0_0x14a8;console[_0x352c3b(0x84)]('🖥️\x20\x20Starting\x20Terminal\x20UI...'),console['log']('');const _0x333031=join(rootDir,'bin','loxia-terminal.js'),_0x235145=spawn(_0x352c3b(0xaa),[_0x333031],{'cwd':rootDir,'env':{...process.env},'stdio':_0x352c3b(0x94)});return _0x235145['on'](_0x352c3b(0x80),_0x16519d=>{const _0x56c56d=_0x352c3b;console[_0x56c56d(0x80)](_0x56c56d(0xa0),_0x16519d[_0x56c56d(0xab)]),cleanup(),process[_0x56c56d(0x98)](0x1);}),_0x235145['on'](_0x352c3b(0x98),_0x31a734=>{const _0x409f3c=_0x352c3b;console[_0x409f3c(0x84)](_0x409f3c(0x8c)),cleanup(),process[_0x409f3c(0x98)](_0x31a734||0x0);}),_0x235145;}function cleanup(){const _0xa8a1b7=a0_0x14a8;serverProcess&&!serverProcess[_0xa8a1b7(0xa7)]&&(console['log'](_0xa8a1b7(0x95)),serverProcess[_0xa8a1b7(0x8e)]('SIGTERM'),setTimeout(()=>{const _0x3c4ac9=_0xa8a1b7;!serverProcess[_0x3c4ac9(0xa7)]&&serverProcess[_0x3c4ac9(0x8e)](_0x3c4ac9(0xa2));},0x1388));}process['on']('SIGINT',()=>{const _0x57b431=a0_0x14a8;console[_0x57b431(0x84)]('\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...'),cleanup(),process[_0x57b431(0x98)](0x0);}),process['on'](a0_0x2dd779(0xb0),()=>{const _0x21d398=a0_0x2dd779;console[_0x21d398(0x84)](_0x21d398(0x85)),cleanup(),process[_0x21d398(0x98)](0x0);}),process['on'](a0_0x2dd779(0x98),()=>{cleanup();});function a0_0xdf7b(){const _0x6ddc8c=['Server\x20exited\x20with\x20code\x20','error','╔════════════════════════════════════════════════╗','stdout','2149353iEjePa','log','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','statusCode','http://localhost:','╚════════════════════════════════════════════════╝','280263KLeDlq','Failed\x20to\x20start\x20server:','\x0a👋\x20Terminal\x20UI\x20closed.','Error\x20during\x20startup:','kill','get','destroy','index.js','pipe','🚀\x20Starting\x20Loxia\x20server...','inherit','🛑\x20Stopping\x20server...','Timeout','ExperimentalWarning','exit','365680jdwWaK','toString','30bxZTnz','1302JaeUKK','16msupEH','206672NqezOL','Server\x20returned\x20','Failed\x20to\x20start\x20Terminal\x20UI:','includes','SIGKILL','5215gHbuQQ','trim','setTimeout','6028495VZOgfS','killed','[SERVER]\x20','/health','node','message','10ostTXH','src','stderr','✅\x20Server\x20is\x20ready!','SIGTERM','data','248294gPGAlq'];a0_0xdf7b=function(){return _0x6ddc8c;};return a0_0xdf7b();}async function main(){const _0x381327=a0_0x2dd779;console[_0x381327(0x84)](_0x381327(0x81)),console[_0x381327(0x84)]('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console[_0x381327(0x84)](_0x381327(0x89)),console['log']('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0xb4c50b){console[_0x381327(0x80)](_0x381327(0x8d),_0xb4c50b[_0x381327(0xab)]),cleanup(),process[_0x381327(0x98)](0x1);}}main();
3
+ const a0_0x3e4180=a0_0x27ec;(function(_0xa97087,_0x2c1556){const _0x3219ae=a0_0x27ec,_0x2b43f9=_0xa97087();while(!![]){try{const _0x3a8fe9=-parseInt(_0x3219ae(0xdc))/0x1+parseInt(_0x3219ae(0xc2))/0x2*(parseInt(_0x3219ae(0xd1))/0x3)+-parseInt(_0x3219ae(0xce))/0x4*(-parseInt(_0x3219ae(0xcf))/0x5)+-parseInt(_0x3219ae(0xbf))/0x6+-parseInt(_0x3219ae(0xc7))/0x7+parseInt(_0x3219ae(0xb8))/0x8+parseInt(_0x3219ae(0xb9))/0x9*(parseInt(_0x3219ae(0xba))/0xa);if(_0x3a8fe9===_0x2c1556)break;else _0x2b43f9['push'](_0x2b43f9['shift']());}catch(_0x10830a){_0x2b43f9['push'](_0x2b43f9['shift']());}}}(a0_0x1883,0x82cbf));import{spawn}from'child_process';import{fileURLToPath}from'url';function a0_0x27ec(_0x26a9fc,_0x3de0e2){_0x26a9fc=_0x26a9fc-0xae;const _0x1883c2=a0_0x1883();let _0x27ec26=_0x1883c2[_0x26a9fc];return _0x27ec26;}import{dirname,join}from'path';import a0_0x31b2c9 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x27833d=0xa,_0x1ff47d=0x1f4){const _0x1d6dd7=a0_0x27ec;for(let _0x4cfe55=0x0;_0x4cfe55<_0x27833d;_0x4cfe55++){try{return await new Promise((_0x9cd092,_0x9af876)=>{const _0x14fd1a=a0_0x27ec,_0x25f65b=a0_0x31b2c9[_0x14fd1a(0xb0)](_0x14fd1a(0xc4)+SERVER_PORT+_0x14fd1a(0xb1),_0x44d2e6=>{const _0x1bab48=_0x14fd1a;_0x44d2e6['statusCode']===0xc8?_0x9cd092():_0x9af876(new Error(_0x1bab48(0xd3)+_0x44d2e6['statusCode']));});_0x25f65b['on'](_0x14fd1a(0xb3),_0x9af876),_0x25f65b[_0x14fd1a(0xc0)](0x3e8,()=>{const _0x33f007=_0x14fd1a;_0x25f65b[_0x33f007(0xdb)](),_0x9af876(new Error(_0x33f007(0xb6)));});}),console[_0x1d6dd7(0xb5)]('✅\x20Server\x20is\x20ready!'),!![];}catch(_0x294f1c){_0x4cfe55<_0x27833d-0x1&&await new Promise(_0x599e4a=>setTimeout(_0x599e4a,_0x1ff47d));}}return console[_0x1d6dd7(0xb5)](_0x1d6dd7(0xb7)),![];}async function startServer(){return new Promise(_0x2a0fba=>{const _0x48b63d=a0_0x27ec;console[_0x48b63d(0xb5)](_0x48b63d(0xb4));const _0xefa707=join(rootDir,_0x48b63d(0xd8),_0x48b63d(0xca));serverProcess=spawn(_0x48b63d(0xd0),[_0xefa707],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x48b63d(0xc1),_0x48b63d(0xbc),_0x48b63d(0xbc)],'detached':![]}),serverProcess[_0x48b63d(0xd6)]['on'](_0x48b63d(0xcb),_0x4def54=>{const _0x424dd5=_0x48b63d,_0x1892e7=_0x4def54[_0x424dd5(0xc8)]()[_0x424dd5(0xbb)]();_0x1892e7&&console[_0x424dd5(0xb5)](_0x424dd5(0xd2)+_0x1892e7);}),serverProcess[_0x48b63d(0xc6)]['on'](_0x48b63d(0xcb),_0x390a16=>{const _0x123fa5=_0x48b63d,_0x390383=_0x390a16['toString']()[_0x123fa5(0xbb)]();_0x390383&&!_0x390383['includes'](_0x123fa5(0xc5))&&console[_0x123fa5(0xb3)](_0x123fa5(0xaf)+_0x390383);}),serverProcess['on'](_0x48b63d(0xb3),_0x75e68e=>{const _0x2bf5bd=_0x48b63d;console[_0x2bf5bd(0xb3)](_0x2bf5bd(0xd7),_0x75e68e[_0x2bf5bd(0xcd)]),process['exit'](0x1);}),serverProcess['on'](_0x48b63d(0xcc),(_0x14d54e,_0x3eef79)=>{const _0xa89205=_0x48b63d;_0x14d54e!==null&&_0x14d54e!==0x0&&(console['error'](_0xa89205(0xb2)+_0x14d54e),process[_0xa89205(0xcc)](_0x14d54e));}),setTimeout(_0x2a0fba,STARTUP_WAIT);});}async function startTerminalUI(){const _0xf7de7c=a0_0x27ec;console[_0xf7de7c(0xb5)](_0xf7de7c(0xd9)),console[_0xf7de7c(0xb5)]('');const _0x564022=join(rootDir,_0xf7de7c(0xc3),_0xf7de7c(0xdd)),_0x3c1002=spawn(_0xf7de7c(0xd0),[_0x564022],{'cwd':rootDir,'env':{...process.env},'stdio':_0xf7de7c(0xc9)});return _0x3c1002['on']('error',_0x3209ac=>{const _0x345493=_0xf7de7c;console[_0x345493(0xb3)]('Failed\x20to\x20start\x20Terminal\x20UI:',_0x3209ac[_0x345493(0xcd)]),cleanup(),process['exit'](0x1);}),_0x3c1002['on']('exit',_0x56ff7f=>{const _0x242ef2=_0xf7de7c;console[_0x242ef2(0xb5)]('\x0a👋\x20Terminal\x20UI\x20closed.'),cleanup(),process[_0x242ef2(0xcc)](_0x56ff7f||0x0);}),_0x3c1002;}function a0_0x1883(){const _0x3b4746=['/health','Server\x20exited\x20with\x20code\x20','error','🚀\x20Starting\x20Loxia\x20server...','log','Timeout','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','7339064meWUrp','9KbRayg','7939670JrgAql','trim','pipe','SIGTERM','kill','2655432GnoFId','setTimeout','ignore','6lxyoFP','bin','http://localhost:','ExperimentalWarning','stderr','6874749wLdKmd','toString','inherit','index.js','data','exit','message','4xWTFfV','4838195DVzXMT','node','341649NEsMgU','[SERVER]\x20','Server\x20returned\x20','SIGINT','killed','stdout','Failed\x20to\x20start\x20server:','src','🖥️\x20\x20Starting\x20Terminal\x20UI...','Error\x20during\x20startup:','destroy','1060216mjEmgE','loxia-terminal.js','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','SIGKILL','[SERVER\x20ERROR]\x20','get'];a0_0x1883=function(){return _0x3b4746;};return a0_0x1883();}function cleanup(){const _0x301d61=a0_0x27ec;serverProcess&&!serverProcess[_0x301d61(0xd5)]&&(console['log']('🛑\x20Stopping\x20server...'),serverProcess[_0x301d61(0xbe)](_0x301d61(0xbd)),setTimeout(()=>{const _0x4fa799=_0x301d61;!serverProcess[_0x4fa799(0xd5)]&&serverProcess[_0x4fa799(0xbe)](_0x4fa799(0xae));},0x1388));}process['on'](a0_0x3e4180(0xd4),()=>{const _0x3fd2f0=a0_0x3e4180;console[_0x3fd2f0(0xb5)]('\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x3e4180(0xbd),()=>{const _0x142d02=a0_0x3e4180;console['log']('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process[_0x142d02(0xcc)](0x0);}),process['on']('exit',()=>{cleanup();});async function main(){const _0x15a5ae=a0_0x3e4180;console['log']('╔════════════════════════════════════════════════╗'),console[_0x15a5ae(0xb5)](_0x15a5ae(0xde)),console[_0x15a5ae(0xb5)]('╚════════════════════════════════════════════════╝'),console[_0x15a5ae(0xb5)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x4b0aee){console[_0x15a5ae(0xb3)](_0x15a5ae(0xda),_0x4b0aee[_0x15a5ae(0xcd)]),cleanup(),process[_0x15a5ae(0xcc)](0x1);}}main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "2.0.10",
3
+ "version": "2.2.3",
4
4
  "description": "Loxia AI Agents System - No-code/vibe-code/companion-coder platform",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x3ec746=a0_0x5b9d;function a0_0x5b9d(_0x4265bb,_0x5815ab){_0x4265bb=_0x4265bb-0x139;const _0x430b1b=a0_0x430b();let _0x5b9dbb=_0x430b1b[_0x4265bb];return _0x5b9dbb;}(function(_0x2401b9,_0x1ae3dc){const _0x50327a=a0_0x5b9d,_0x3ecdda=_0x2401b9();while(!![]){try{const _0x41867c=-parseInt(_0x50327a(0x157))/0x1*(parseInt(_0x50327a(0x189))/0x2)+parseInt(_0x50327a(0x168))/0x3*(-parseInt(_0x50327a(0x13a))/0x4)+parseInt(_0x50327a(0x13e))/0x5+parseInt(_0x50327a(0x176))/0x6+parseInt(_0x50327a(0x153))/0x7*(-parseInt(_0x50327a(0x183))/0x8)+parseInt(_0x50327a(0x171))/0x9+-parseInt(_0x50327a(0x151))/0xa*(-parseInt(_0x50327a(0x15a))/0xb);if(_0x41867c===_0x1ae3dc)break;else _0x3ecdda['push'](_0x3ecdda['shift']());}catch(_0x176ebe){_0x3ecdda['push'](_0x3ecdda['shift']());}}}(a0_0x430b,0xa84d2));import{exec}from'child_process';import{promisify}from'util';import a0_0x2faaf1 from'https';import a0_0x75a46e from'http';function a0_0x430b(){const _0x196bdd=['headers','arch','Failed\x20to\x20download:\x20HTTP\x20','🐍\x20Checking\x20Python\x20scanners...','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20installed\x20successfully','\x20\x20\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','node_modules','exit','🔍\x20Installing\x20Semgrep...','8UKwKUz','\x20-m\x20pip\x20show\x20','https','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','\x0aYou\x20can\x20manually\x20install\x20scanners:','promises','2560358ECeoZc','dirname','--user','trim','url','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20-m\x20pip\x20install\x20','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','1578308Hqqnju','═══════════════════════════════════════════════════════════','\x20\x20Installing\x20Security\x20Scanners','platform','5778715JPRSJn','mkdir','message','replace','\x20\x20Installation\x20Complete','yamllint','catch','location','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','python','...','finish','error','pip-audit','includes','\x0a═══════════════════════════════════════════════════════════','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20already\x20installed','4644590ptrMjI','startsWith','7900186wyQQwg','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','❌\x20Installation\x20failed:','1ZBATtd','statusCode','eslint-plugin-security','33ApMQWo','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','then','bandit','unlink','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','semgrep','\x20\x20\x20Installing\x20','python3','.scanners','checkov','semgrep\x20--version','python3\x20--version','pipe','3IlbUnL','\x20\x20\x20Downloading\x20from\x20','close','chmod','log','stdout','═══════════════════════════════════════════════════════════\x0a','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','/opt/homebrew','5940171roBsYy','\x20\x20\x20✅\x20','v1.55.0','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','1701462ihjBYa','\x20\x20\x20✅\x20Python\x20found:\x20'];a0_0x430b=function(){return _0x196bdd;};return a0_0x430b();}import a0_0x5b7b56 from'fs';import a0_0x1dd599 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_0x1dd599[a0_0x3ec746(0x18a)](__filename),SCANNER_DIR=a0_0x1dd599['join'](__dirname,'..',a0_0x3ec746(0x180),a0_0x3ec746(0x163)),SEMGREP_VERSION=a0_0x3ec746(0x173);console['log'](a0_0x3ec746(0x13b)),console[a0_0x3ec746(0x16c)](a0_0x3ec746(0x13c)),console[a0_0x3ec746(0x16c)]('\x20\x20Platform:\x20'+process[a0_0x3ec746(0x13d)]+'\x20('+process[a0_0x3ec746(0x179)]+')'),console[a0_0x3ec746(0x16c)](a0_0x3ec746(0x16e));async function installScanners(){const _0x2f86fa=a0_0x3ec746;await a0_0x5b7b56[_0x2f86fa(0x188)][_0x2f86fa(0x13f)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log'](_0x2f86fa(0x14d)),console[_0x2f86fa(0x16c)](_0x2f86fa(0x142)),console[_0x2f86fa(0x16c)](_0x2f86fa(0x16e));}async function checkESLintSecurity(){const _0x4df3ff=a0_0x3ec746;console[_0x4df3ff(0x16c)](_0x4df3ff(0x139));try{await import(_0x4df3ff(0x159)),console[_0x4df3ff(0x16c)](_0x4df3ff(0x146));}catch(_0x1027c9){console[_0x4df3ff(0x16c)](_0x4df3ff(0x14e)),console[_0x4df3ff(0x16c)]('\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a');}}async function installSemgrep(){const _0x5eb24a=a0_0x3ec746;console['log'](_0x5eb24a(0x182));const _0x19ef20=process['platform'],_0x27bcbd=process[_0x5eb24a(0x179)];try{const _0x1b5ea9=await execAsync(_0x5eb24a(0x165),{'timeout':0x1388});console[_0x5eb24a(0x16c)](_0x5eb24a(0x175)+_0x1b5ea9[_0x5eb24a(0x16d)][_0x5eb24a(0x18c)]()),console[_0x5eb24a(0x16c)](_0x5eb24a(0x154));return;}catch(_0x19daa2){console['log'](_0x5eb24a(0x186));}const _0x4f2a86=getSemgrepBinaryInfo(_0x19ef20,_0x27bcbd);if(!_0x4f2a86){console[_0x5eb24a(0x16c)](_0x5eb24a(0x17f)+_0x19ef20+'-'+_0x27bcbd),console[_0x5eb24a(0x16c)](_0x5eb24a(0x16f));return;}try{const _0x49ec62=a0_0x1dd599['join'](SCANNER_DIR,'semgrep');console[_0x5eb24a(0x16c)](_0x5eb24a(0x169)+_0x4f2a86[_0x5eb24a(0x18d)]+'...'),await downloadFile(_0x4f2a86[_0x5eb24a(0x18d)],_0x49ec62),await a0_0x5b7b56['promises'][_0x5eb24a(0x16b)](_0x49ec62,0x1ed),console[_0x5eb24a(0x16c)](_0x5eb24a(0x174)),console[_0x5eb24a(0x16c)]('\x20\x20\x20Location:\x20'+_0x49ec62+'\x0a'),console[_0x5eb24a(0x16c)]('\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'),console[_0x5eb24a(0x16c)](_0x5eb24a(0x17e));}catch(_0x40c747){console['log'](_0x5eb24a(0x14f)+_0x40c747[_0x5eb24a(0x140)]),console[_0x5eb24a(0x16c)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0xc970b8,_0x9e1e3){return null;}async function installPythonScanners(){const _0x410f5e=a0_0x3ec746;console[_0x410f5e(0x16c)](_0x410f5e(0x17b));let _0x4aef03=null;try{await execAsync(_0x410f5e(0x166),{'timeout':0x1388}),_0x4aef03=_0x410f5e(0x162);}catch(_0x36eb99){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x4aef03=_0x410f5e(0x147);}catch(_0x23a6be){console[_0x410f5e(0x16c)](_0x410f5e(0x18f)),console[_0x410f5e(0x16c)]('\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:'),console[_0x410f5e(0x16c)](_0x410f5e(0x15b));return;}}console[_0x410f5e(0x16c)](_0x410f5e(0x177)+_0x4aef03),await installViaPip(_0x410f5e(0x160),_0x4aef03),await installViaPip(_0x410f5e(0x15d),_0x4aef03),await installViaPip(_0x410f5e(0x14b),_0x4aef03),await installViaPip(_0x410f5e(0x164),_0x4aef03),await installViaPip(_0x410f5e(0x143),_0x4aef03),console[_0x410f5e(0x16c)]('');}async function isHomebrewPython(_0x5606d2){const _0x248016=a0_0x3ec746;try{const {stdout:_0x2e315d}=await execAsync(_0x5606d2+_0x248016(0x190),{'timeout':0x1388});return _0x2e315d[_0x248016(0x14c)](_0x248016(0x170))||_0x2e315d[_0x248016(0x14c)]('/usr/local/Cellar');}catch{return![];}}async function installViaPip(_0x518d56,_0x31faaa){const _0x131e0a=a0_0x3ec746;try{const _0x66175b=await execAsync(_0x31faaa+_0x131e0a(0x184)+_0x518d56,{'timeout':0x1388});return console[_0x131e0a(0x16c)](_0x131e0a(0x172)+_0x518d56+_0x131e0a(0x150)),!![];}catch(_0x210db9){console[_0x131e0a(0x16c)](_0x131e0a(0x161)+_0x518d56+_0x131e0a(0x148));try{const _0x2a3a38=await isHomebrewPython(_0x31faaa),_0x4765c9=_0x2a3a38?'':_0x131e0a(0x18b),_0x41bce4=(_0x31faaa+_0x131e0a(0x191)+_0x4765c9+'\x20'+_0x518d56)[_0x131e0a(0x141)](/\s+/g,'\x20')[_0x131e0a(0x18c)]();return await execAsync(_0x41bce4,{'timeout':0xea60}),console[_0x131e0a(0x16c)]('\x20\x20\x20✅\x20'+_0x518d56+_0x131e0a(0x17d)),!![];}catch(_0x31aee1){return console['log'](_0x131e0a(0x155)+_0x518d56+':\x20'+_0x31aee1[_0x131e0a(0x140)]),console[_0x131e0a(0x16c)](_0x131e0a(0x18e)+_0x518d56),![];}}}async function downloadFile(_0x3fdcdb,_0x4e17d6){return new Promise((_0x4bf4c6,_0xcd9e17)=>{const _0x294061=a0_0x5b9d,_0x3f702a=_0x3fdcdb[_0x294061(0x152)](_0x294061(0x185))?a0_0x2faaf1:a0_0x75a46e;_0x3f702a['get'](_0x3fdcdb,_0x573929=>{const _0x21335e=_0x294061;if(_0x573929[_0x21335e(0x158)]===0x12e||_0x573929['statusCode']===0x12d){downloadFile(_0x573929[_0x21335e(0x178)][_0x21335e(0x145)],_0x4e17d6)[_0x21335e(0x15c)](_0x4bf4c6)[_0x21335e(0x144)](_0xcd9e17);return;}if(_0x573929[_0x21335e(0x158)]!==0xc8){_0xcd9e17(new Error(_0x21335e(0x17a)+_0x573929[_0x21335e(0x158)]));return;}const _0x2bfb4a=createWriteStream(_0x4e17d6);_0x573929[_0x21335e(0x167)](_0x2bfb4a),_0x2bfb4a['on'](_0x21335e(0x149),()=>{const _0x5c6e6a=_0x21335e;_0x2bfb4a[_0x5c6e6a(0x16a)](),_0x4bf4c6();}),_0x2bfb4a['on']('error',_0x4f3661=>{const _0x2767c2=_0x21335e;a0_0x5b7b56[_0x2767c2(0x15e)](_0x4e17d6,()=>{}),_0xcd9e17(_0x4f3661);});})['on'](_0x294061(0x14a),_0xcd9e17);});}installScanners()[a0_0x3ec746(0x144)](_0x516a73=>{const _0x5d515a=a0_0x3ec746;console[_0x5d515a(0x14a)](_0x5d515a(0x156),_0x516a73['message']),console[_0x5d515a(0x14a)](_0x5d515a(0x187)),console[_0x5d515a(0x14a)](_0x5d515a(0x15f)),console[_0x5d515a(0x14a)](_0x5d515a(0x17c)),process[_0x5d515a(0x181)](0x0);});
2
+ const a0_0x349ab7=a0_0x1adf;(function(_0x1e2fe8,_0x6e5270){const _0x1d73af=a0_0x1adf,_0x4a8d29=_0x1e2fe8();while(!![]){try{const _0x43fce2=-parseInt(_0x1d73af(0x122))/0x1+-parseInt(_0x1d73af(0x12c))/0x2*(parseInt(_0x1d73af(0x133))/0x3)+parseInt(_0x1d73af(0x136))/0x4+parseInt(_0x1d73af(0xf5))/0x5+-parseInt(_0x1d73af(0x10f))/0x6*(-parseInt(_0x1d73af(0xfc))/0x7)+-parseInt(_0x1d73af(0x103))/0x8+parseInt(_0x1d73af(0x128))/0x9;if(_0x43fce2===_0x6e5270)break;else _0x4a8d29['push'](_0x4a8d29['shift']());}catch(_0x24fef3){_0x4a8d29['push'](_0x4a8d29['shift']());}}}(a0_0x5cb1,0x85d89));import{exec}from'child_process';import{promisify}from'util';import a0_0x1b6b0f from'https';function a0_0x1adf(_0x44234a,_0x2e999f){_0x44234a=_0x44234a-0xf4;const _0x5cb1e6=a0_0x5cb1();let _0x1adfcb=_0x5cb1e6[_0x44234a];return _0x1adfcb;}import a0_0x31a7d7 from'http';import a0_0x3ff237 from'fs';function a0_0x5cb1(){const _0x2ac84f=['\x20\x20\x20✅\x20Python\x20found:\x20','url','8043ettVrX','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','semgrep\x20--version','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','/usr/local/Cellar','4196688ioahTv','═══════════════════════════════════════════════════════════','trim','checkov','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','eslint-plugin-security','exit','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','log','\x20\x20\x20✅\x20','═══════════════════════════════════════════════════════════\x0a','\x20-m\x20pip\x20install\x20','3786mOsdvQ','pip-audit','...','includes','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','message','\x0aYou\x20can\x20manually\x20install\x20scanners:','❌\x20Installation\x20failed:','\x20-m\x20pip\x20show\x20','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','yamllint','\x20already\x20installed','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','semgrep','startsWith','\x20\x20Platform:\x20','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','platform','62180tmFyMB','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','close','\x20\x20Installation\x20Complete','\x20installed\x20successfully','statusCode','6744708xLVnYw','join','\x20\x20\x20Location:\x20','get','416EUsfDb','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','headers','chmod','pipe','location','error','12588bquiYK','\x20\x20Installing\x20Security\x20Scanners','promises','899956ZIWphw','mkdir','finish','v1.55.0','\x20\x20\x20pip\x20install\x20semgrep\x0a','https','🐍\x20Checking\x20Python\x20scanners...','stdout','then','\x0a═══════════════════════════════════════════════════════════','.scanners','unlink','\x20\x20\x20Installing\x20','replace','1541735fYmOLh','Failed\x20to\x20download:\x20HTTP\x20','catch','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','arch'];a0_0x5cb1=function(){return _0x2ac84f;};return a0_0x5cb1();}import a0_0x81af8a 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_0x81af8a['dirname'](__filename),SCANNER_DIR=a0_0x81af8a[a0_0x349ab7(0x129)](__dirname,'..','node_modules',a0_0x349ab7(0x140)),SEMGREP_VERSION=a0_0x349ab7(0x139);console[a0_0x349ab7(0x10b)](a0_0x349ab7(0x104)),console[a0_0x349ab7(0x10b)](a0_0x349ab7(0x134)),console[a0_0x349ab7(0x10b)](a0_0x349ab7(0x11f)+process[a0_0x349ab7(0x121)]+'\x20('+process['arch']+')'),console[a0_0x349ab7(0x10b)](a0_0x349ab7(0x10d));async function installScanners(){const _0x2a9027=a0_0x349ab7;await a0_0x3ff237['promises'][_0x2a9027(0x137)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log'](_0x2a9027(0x13f)),console[_0x2a9027(0x10b)](_0x2a9027(0x125)),console[_0x2a9027(0x10b)](_0x2a9027(0x10d));}async function checkESLintSecurity(){const _0x1d2808=a0_0x349ab7;console['log'](_0x1d2808(0x101));try{await import(_0x1d2808(0x108)),console[_0x1d2808(0x10b)](_0x1d2808(0x123));}catch(_0x59198c){console[_0x1d2808(0x10b)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x1d2808(0x10b)](_0x1d2808(0xff));}}async function installSemgrep(){const _0x4b12b2=a0_0x349ab7;console['log']('🔍\x20Installing\x20Semgrep...');const _0x556d19=process['platform'],_0x507b62=process[_0x4b12b2(0xf9)];try{const _0x4a88e5=await execAsync(_0x4b12b2(0x100),{'timeout':0x1388});console['log'](_0x4b12b2(0xf8)+_0x4a88e5[_0x4b12b2(0x13d)]['trim']()),console['log'](_0x4b12b2(0x11c));return;}catch(_0x46db82){console[_0x4b12b2(0x10b)](_0x4b12b2(0xfe));}const _0x23790b=getSemgrepBinaryInfo(_0x556d19,_0x507b62);if(!_0x23790b){console[_0x4b12b2(0x10b)](_0x4b12b2(0x107)+_0x556d19+'-'+_0x507b62),console['log']('\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a');return;}try{const _0x1f4c28=a0_0x81af8a[_0x4b12b2(0x129)](SCANNER_DIR,_0x4b12b2(0x11d));console[_0x4b12b2(0x10b)]('\x20\x20\x20Downloading\x20from\x20'+_0x23790b['url']+'...'),await downloadFile(_0x23790b[_0x4b12b2(0xfb)],_0x1f4c28),await a0_0x3ff237[_0x4b12b2(0x135)][_0x4b12b2(0x12f)](_0x1f4c28,0x1ed),console['log'](_0x4b12b2(0x114)),console[_0x4b12b2(0x10b)](_0x4b12b2(0x12a)+_0x1f4c28+'\x0a'),console[_0x4b12b2(0x10b)]('\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'),console[_0x4b12b2(0x10b)](_0x4b12b2(0x13a));}catch(_0x5cc17b){console[_0x4b12b2(0x10b)]('\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20'+_0x5cc17b['message']),console[_0x4b12b2(0x10b)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0xd1fa09,_0x97e47d){return null;}async function installPythonScanners(){const _0x374358=a0_0x349ab7;console[_0x374358(0x10b)](_0x374358(0x13c));let _0x3112b6=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x3112b6='python3';}catch(_0x2e860c){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x3112b6='python';}catch(_0x2391cf){console[_0x374358(0x10b)](_0x374358(0x113)),console[_0x374358(0x10b)](_0x374358(0x120)),console[_0x374358(0x10b)]('\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a');return;}}console['log'](_0x374358(0xfa)+_0x3112b6),await installViaPip('semgrep',_0x3112b6),await installViaPip('bandit',_0x3112b6),await installViaPip(_0x374358(0x110),_0x3112b6),await installViaPip(_0x374358(0x106),_0x3112b6),await installViaPip(_0x374358(0x11a),_0x3112b6),console[_0x374358(0x10b)]('');}async function isHomebrewPython(_0x4a1ce4){const _0x191a88=a0_0x349ab7;try{const {stdout:_0x595eef}=await execAsync(_0x4a1ce4+_0x191a88(0x10a),{'timeout':0x1388});return _0x595eef[_0x191a88(0x112)]('/opt/homebrew')||_0x595eef[_0x191a88(0x112)](_0x191a88(0x102));}catch{return![];}}async function installViaPip(_0x53f58f,_0x49daa9){const _0x5e7e73=a0_0x349ab7;try{const _0x522caa=await execAsync(_0x49daa9+_0x5e7e73(0x118)+_0x53f58f,{'timeout':0x1388});return console[_0x5e7e73(0x10b)]('\x20\x20\x20✅\x20'+_0x53f58f+_0x5e7e73(0x11b)),!![];}catch(_0x224720){console[_0x5e7e73(0x10b)](_0x5e7e73(0x142)+_0x53f58f+_0x5e7e73(0x111));try{const _0xb0f3fc=await isHomebrewPython(_0x49daa9),_0x3b4ccc=_0xb0f3fc?'':'--user',_0x337c04=(_0x49daa9+_0x5e7e73(0x10e)+_0x3b4ccc+'\x20'+_0x53f58f)[_0x5e7e73(0xf4)](/\s+/g,'\x20')[_0x5e7e73(0x105)]();return await execAsync(_0x337c04,{'timeout':0xea60}),console[_0x5e7e73(0x10b)](_0x5e7e73(0x10c)+_0x53f58f+_0x5e7e73(0x126)),!![];}catch(_0x2984d2){return console[_0x5e7e73(0x10b)]('\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20'+_0x53f58f+':\x20'+_0x2984d2['message']),console[_0x5e7e73(0x10b)](_0x5e7e73(0xfd)+_0x53f58f),![];}}}async function downloadFile(_0x7b6632,_0x1339f9){return new Promise((_0x1d193d,_0x3da32c)=>{const _0x5cfe22=a0_0x1adf,_0x54f9c2=_0x7b6632[_0x5cfe22(0x11e)](_0x5cfe22(0x13b))?a0_0x1b6b0f:a0_0x31a7d7;_0x54f9c2[_0x5cfe22(0x12b)](_0x7b6632,_0x4f1d83=>{const _0x4b66ad=_0x5cfe22;if(_0x4f1d83[_0x4b66ad(0x127)]===0x12e||_0x4f1d83[_0x4b66ad(0x127)]===0x12d){downloadFile(_0x4f1d83[_0x4b66ad(0x12e)][_0x4b66ad(0x131)],_0x1339f9)[_0x4b66ad(0x13e)](_0x1d193d)[_0x4b66ad(0xf7)](_0x3da32c);return;}if(_0x4f1d83[_0x4b66ad(0x127)]!==0xc8){_0x3da32c(new Error(_0x4b66ad(0xf6)+_0x4f1d83['statusCode']));return;}const _0x1165cc=createWriteStream(_0x1339f9);_0x4f1d83[_0x4b66ad(0x130)](_0x1165cc),_0x1165cc['on'](_0x4b66ad(0x138),()=>{const _0x174d0e=_0x4b66ad;_0x1165cc[_0x174d0e(0x124)](),_0x1d193d();}),_0x1165cc['on']('error',_0x423ee2=>{const _0x3b740f=_0x4b66ad;a0_0x3ff237[_0x3b740f(0x141)](_0x1339f9,()=>{}),_0x3da32c(_0x423ee2);});})['on'](_0x5cfe22(0x132),_0x3da32c);});}installScanners()['catch'](_0x39755b=>{const _0x271764=a0_0x349ab7;console[_0x271764(0x132)](_0x271764(0x117),_0x39755b[_0x271764(0x115)]),console[_0x271764(0x132)](_0x271764(0x116)),console['error'](_0x271764(0x12d)),console['error'](_0x271764(0x119)),process[_0x271764(0x109)](0x0);});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function a0_0x4571(_0x237801,_0x3f0cf4){_0x237801=_0x237801-0x151;const _0x310c18=a0_0x310c();let _0x45716f=_0x310c18[_0x237801];return _0x45716f;}const a0_0xc1eab9=a0_0x4571;(function(_0x3a43b6,_0x48bb85){const _0x29b519=a0_0x4571,_0x59ff96=_0x3a43b6();while(!![]){try{const _0x4c2230=-parseInt(_0x29b519(0x175))/0x1+parseInt(_0x29b519(0x17a))/0x2*(parseInt(_0x29b519(0x174))/0x3)+parseInt(_0x29b519(0x16e))/0x4*(-parseInt(_0x29b519(0x154))/0x5)+parseInt(_0x29b519(0x155))/0x6*(parseInt(_0x29b519(0x15e))/0x7)+-parseInt(_0x29b519(0x162))/0x8+-parseInt(_0x29b519(0x171))/0x9*(parseInt(_0x29b519(0x173))/0xa)+parseInt(_0x29b519(0x15c))/0xb;if(_0x4c2230===_0x48bb85)break;else _0x59ff96['push'](_0x59ff96['shift']());}catch(_0x190716){_0x59ff96['push'](_0x59ff96['shift']());}}}(a0_0x310c,0x61c91));const {spawn,execSync}=require(a0_0xc1eab9(0x159)),path=require(a0_0xc1eab9(0x16b)),fs=require('fs'),logFile=path[a0_0xc1eab9(0x153)](__dirname,'watchdog.log');function log(_0x59f045){const _0x3032aa=a0_0xc1eab9,_0x2cdaf2=new Date()[_0x3032aa(0x160)](),_0xa00158='['+_0x2cdaf2+']\x20'+_0x59f045+'\x0a';console[_0x3032aa(0x16a)](_0x59f045);try{fs[_0x3032aa(0x15f)](logFile,_0xa00158);}catch(_0x5bf995){}}function a0_0x310c(){const _0x49737b=['900766wEbnaC','split','--pid','[Watchdog]\x20Parent\x20process\x20','join','1655zZhEhB','7212hwsubW','[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20','ms,\x20proceeding\x20anyway','win32','child_process','--delay','ms\x20before\x20restart...','7853340jQpSws','loxia\x20web','1729iawoBf','appendFileSync','toISOString','[Watchdog]\x20Watchdog\x20exiting...','1660592Hzyxcq','--command','slice','unref','delay','exit','[Watchdog]\x20Error:\x20','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','log','path','length','pid','7676QeKCUp','ignore','now','72VcUaCK','\x20still\x20running\x20after\x20','127290cTXrRQ','3TWnNJM','116093fHHsUS','argv','[Watchdog]\x20Waiting\x20','command','kill'];a0_0x310c=function(){return _0x49737b;};return a0_0x310c();}log('[Watchdog]\x20Script\x20loaded');function parseArgs(){const _0x45bdb3=a0_0xc1eab9,_0x248bdd=process[_0x45bdb3(0x176)][_0x45bdb3(0x164)](0x2),_0x448e7f={'delay':0x1388,'command':_0x45bdb3(0x15d),'pid':null};for(let _0x1acd9d=0x0;_0x1acd9d<_0x248bdd[_0x45bdb3(0x16c)];_0x1acd9d++){switch(_0x248bdd[_0x1acd9d]){case _0x45bdb3(0x15a):_0x448e7f['delay']=parseInt(_0x248bdd[++_0x1acd9d],0xa)||0x1388;break;case _0x45bdb3(0x163):_0x448e7f[_0x45bdb3(0x178)]=_0x248bdd[++_0x1acd9d]||'loxia\x20web';break;case _0x45bdb3(0x151):_0x448e7f[_0x45bdb3(0x16d)]=parseInt(_0x248bdd[++_0x1acd9d],0xa)||null;break;}}return _0x448e7f;}function isProcessRunning(_0x2d3ebb){const _0x33adf7=a0_0xc1eab9;try{return process[_0x33adf7(0x179)](_0x2d3ebb,0x0),!![];}catch(_0x57f5ac){return![];}}async function waitForParentExit(_0x83c97b,_0x48b642=0x7530){const _0x5d7b29=a0_0xc1eab9;if(!_0x83c97b)return;const _0x9f49c4=Date['now']();while(isProcessRunning(_0x83c97b)){if(Date[_0x5d7b29(0x170)]()-_0x9f49c4>_0x48b642){log('[Watchdog]\x20Parent\x20process\x20'+_0x83c97b+_0x5d7b29(0x172)+_0x48b642+_0x5d7b29(0x157));return;}await new Promise(_0x3c539a=>setTimeout(_0x3c539a,0x1f4));}log(_0x5d7b29(0x152)+_0x83c97b+'\x20has\x20terminated');}async function main(){const _0x11afb5=a0_0xc1eab9,_0x1d6558=parseArgs();log('[Watchdog]\x20Started\x20with\x20options:',{'delay':_0x1d6558[_0x11afb5(0x166)],'command':_0x1d6558['command'],'pid':_0x1d6558[_0x11afb5(0x16d)]});_0x1d6558['pid']&&(log(_0x11afb5(0x169)+_0x1d6558[_0x11afb5(0x16d)]+'\x20to\x20exit...'),await waitForParentExit(_0x1d6558[_0x11afb5(0x16d)]));log(_0x11afb5(0x177)+_0x1d6558['delay']+_0x11afb5(0x15b)),await new Promise(_0x24f6ed=>setTimeout(_0x24f6ed,_0x1d6558['delay']));const _0x76991e=_0x1d6558['command'][_0x11afb5(0x17b)]('\x20'),_0x1b9d99=_0x76991e[0x0],_0x4164b7=_0x76991e[_0x11afb5(0x164)](0x1);log('[Watchdog]\x20Executing:\x20'+_0x1b9d99+'\x20'+_0x4164b7[_0x11afb5(0x153)]('\x20'));const _0x457cb5=process['platform']===_0x11afb5(0x158),_0x514cdd=spawn(_0x1b9d99,_0x4164b7,{'detached':!![],'stdio':_0x11afb5(0x16f),'shell':!![],'windowsHide':![]});_0x514cdd[_0x11afb5(0x165)](),log(_0x11afb5(0x156)+_0x514cdd[_0x11afb5(0x16d)]),log(_0x11afb5(0x161)),setTimeout(()=>process[_0x11afb5(0x167)](0x0),0x3e8);}main()['catch'](_0x548c1a=>{const _0x54f359=a0_0xc1eab9;log(_0x54f359(0x168)+_0x548c1a['message']),process[_0x54f359(0x167)](0x1);});
2
+ const a0_0x56abcd=a0_0x3c9f;(function(_0x2f4d37,_0x32c510){const _0x4e7145=a0_0x3c9f,_0x2e8cef=_0x2f4d37();while(!![]){try{const _0x22ffcb=-parseInt(_0x4e7145(0x11b))/0x1*(parseInt(_0x4e7145(0x11c))/0x2)+parseInt(_0x4e7145(0x105))/0x3+-parseInt(_0x4e7145(0x107))/0x4+parseInt(_0x4e7145(0x106))/0x5*(-parseInt(_0x4e7145(0x10a))/0x6)+parseInt(_0x4e7145(0x10d))/0x7+-parseInt(_0x4e7145(0x10b))/0x8*(-parseInt(_0x4e7145(0x120))/0x9)+parseInt(_0x4e7145(0x10f))/0xa;if(_0x22ffcb===_0x32c510)break;else _0x2e8cef['push'](_0x2e8cef['shift']());}catch(_0x2f6d1e){_0x2e8cef['push'](_0x2e8cef['shift']());}}}(a0_0x4241,0xd848c));const {spawn,execSync}=require(a0_0x56abcd(0x101)),path=require(a0_0x56abcd(0x128)),fs=require('fs'),logFile=path['join'](__dirname,a0_0x56abcd(0x126));function log(_0x32174c){const _0x31e4a3=a0_0x56abcd,_0x30fc4a=new Date()[_0x31e4a3(0x118)](),_0x5d82a1='['+_0x30fc4a+']\x20'+_0x32174c+'\x0a';console[_0x31e4a3(0x11f)](_0x32174c);try{fs[_0x31e4a3(0x104)](logFile,_0x5d82a1);}catch(_0x5ee965){}}log('[Watchdog]\x20Script\x20loaded');function parseArgs(){const _0x512522=a0_0x56abcd,_0x508609=process['argv'][_0x512522(0x127)](0x2),_0x54ac7b={'delay':0x1388,'command':_0x512522(0x112),'pid':null};for(let _0x3dd409=0x0;_0x3dd409<_0x508609[_0x512522(0x125)];_0x3dd409++){switch(_0x508609[_0x3dd409]){case'--delay':_0x54ac7b['delay']=parseInt(_0x508609[++_0x3dd409],0xa)||0x1388;break;case _0x512522(0x123):_0x54ac7b[_0x512522(0x110)]=_0x508609[++_0x3dd409]||_0x512522(0x112);break;case _0x512522(0x116):_0x54ac7b['pid']=parseInt(_0x508609[++_0x3dd409],0xa)||null;break;}}return _0x54ac7b;}function isProcessRunning(_0x4ad1b7){try{return process['kill'](_0x4ad1b7,0x0),!![];}catch(_0x4a29f6){return![];}}async function waitForParentExit(_0x2bf62c,_0x44d7bc=0x7530){const _0x5ce495=a0_0x56abcd;if(!_0x2bf62c)return;const _0x3a9dbc=Date[_0x5ce495(0x115)]();while(isProcessRunning(_0x2bf62c)){if(Date[_0x5ce495(0x115)]()-_0x3a9dbc>_0x44d7bc){log(_0x5ce495(0x111)+_0x2bf62c+_0x5ce495(0x124)+_0x44d7bc+_0x5ce495(0x117));return;}await new Promise(_0x5ded50=>setTimeout(_0x5ded50,0x1f4));}log(_0x5ce495(0x111)+_0x2bf62c+'\x20has\x20terminated');}function a0_0x3c9f(_0x3be327,_0x7f65b9){_0x3be327=_0x3be327-0x101;const _0x4241ce=a0_0x4241();let _0x3c9fbf=_0x4241ce[_0x3be327];return _0x3c9fbf;}function a0_0x4241(){const _0x15ea94=['appendFileSync','2797944KxdTwk','5eVahUj','6693384FRJJuo','join','[Watchdog]\x20Executing:\x20','9869214MsMGez','8PeCsjI','[Watchdog]\x20Watchdog\x20exiting...','6508446GknnVx','[Watchdog]\x20Waiting\x20','32456940yCbKfw','command','[Watchdog]\x20Parent\x20process\x20','loxia\x20web','exit','[Watchdog]\x20Started\x20with\x20options:','now','--pid','ms,\x20proceeding\x20anyway','toISOString','win32','platform','6808LxAGVw','286LFLtnI','ignore','pid','log','625851FpMVFL','message','delay','--command','\x20still\x20running\x20after\x20','length','watchdog.log','slice','path','child_process','catch','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20'];a0_0x4241=function(){return _0x15ea94;};return a0_0x4241();}async function main(){const _0x5f0575=a0_0x56abcd,_0x2c1d0f=parseArgs();log(_0x5f0575(0x114),{'delay':_0x2c1d0f[_0x5f0575(0x122)],'command':_0x2c1d0f[_0x5f0575(0x110)],'pid':_0x2c1d0f[_0x5f0575(0x11e)]});_0x2c1d0f[_0x5f0575(0x11e)]&&(log(_0x5f0575(0x103)+_0x2c1d0f[_0x5f0575(0x11e)]+'\x20to\x20exit...'),await waitForParentExit(_0x2c1d0f[_0x5f0575(0x11e)]));log(_0x5f0575(0x10e)+_0x2c1d0f['delay']+'ms\x20before\x20restart...'),await new Promise(_0x29aa6e=>setTimeout(_0x29aa6e,_0x2c1d0f['delay']));const _0x3e2419=_0x2c1d0f['command']['split']('\x20'),_0x55e5f9=_0x3e2419[0x0],_0x2598f9=_0x3e2419[_0x5f0575(0x127)](0x1);log(_0x5f0575(0x109)+_0x55e5f9+'\x20'+_0x2598f9[_0x5f0575(0x108)]('\x20'));const _0x17deb3=process[_0x5f0575(0x11a)]===_0x5f0575(0x119),_0x179360=spawn(_0x55e5f9,_0x2598f9,{'detached':!![],'stdio':_0x5f0575(0x11d),'shell':!![],'windowsHide':![]});_0x179360['unref'](),log('[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20'+_0x179360[_0x5f0575(0x11e)]),log(_0x5f0575(0x10c)),setTimeout(()=>process[_0x5f0575(0x113)](0x0),0x3e8);}main()[a0_0x56abcd(0x102)](_0x1aed70=>{const _0x20d3d8=a0_0x56abcd;log('[Watchdog]\x20Error:\x20'+_0x1aed70[_0x20d3d8(0x121)]),process[_0x20d3d8(0x113)](0x1);});
@@ -1 +1 @@
1
- const a0_0x8392c3=a0_0x3e30;function a0_0x10d5(){const _0x44e7f3=['u0vwrvjjvfK','mJiXnJKZmJjdq0HQufG','C291CMnL','nLjTDwLWvG','zgv0zwn0tgfUz3vHz2u','y29UDgvUDa','lNnHC3m','CMv0DxjU','u1Lovefy','D2fYBMLUz3m','zNvUy3rPB24','Dg9mB3DLCKnHC2u','q3nZu3LUDgf4rxjYB3i','q0furuDpuLK','nJa4mdK5meHXwwvWAq','C3r5BgvSAw50','BgLUzq','mtiYodu1mgL0swHiAW','CNvSzq','y29SDw1U','nJG3mdi4oeXTrfbMDq','Cg9ZDgnZCY1SzxnZ','BM8Tzw1WDhK','m012shDxza','BMfTzq','l15JDxn0B20TlW','y3nZ','zM9YBwf0ug9ZDentu0vYCM9Y','C2nZCW','BM8TDw5RBM93BG','q1ntigfUywX5C2LZigzHAwXLza','zgvIDwC','CM9VDa','zw5KC1DPDgG','Bg9Nz2vY','mtCXndm4sgfACuH2','Cg9ZDgnZCY1Zy3nZ','Cg9ZDgnZCW','BwL4Aw4','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','Cg9ZDgnZC0XLC3m','u1rzteu','Aw5JBhvKzxm','zM9YD2fYza','C2v2zxjPDhK','BgLUDfn0EwXLCW','BMCTzgvLCa','zwXZzq','D2fYBG','BgvUz3rO','ndC3nZaYogXUDKTwBa','lMXLC3m','CMvJB21Tzw5Kzwq','yw5HBhL6zq','BgvZCW','ChvZAa','Cg9ZDgnZC1nJC3m','D2HPBgu','zg91yMXL','Dw5RBM93BG','lNnJC3m','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','qKvtvf9quKfdveLdrq','zgvMyxvSDa','v0fstKLorW','CMvZDwX0CW','nJGXnJi5mKzOzK9mAa','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','zxjYB3i'];a0_0x10d5=function(){return _0x44e7f3;};return a0_0x10d5();}(function(_0x114c0e,_0x4add5c){const _0x4714f7=a0_0x3e30,_0x107584=_0x114c0e();while(!![]){try{const _0x92c8e8=-parseInt(_0x4714f7(0x140))/0x1+parseInt(_0x4714f7(0x152))/0x2+-parseInt(_0x4714f7(0x146))/0x3*(-parseInt(_0x4714f7(0x161))/0x4)+parseInt(_0x4714f7(0x13d))/0x5*(parseInt(_0x4714f7(0x177))/0x6)+parseInt(_0x4714f7(0x171))/0x7+parseInt(_0x4714f7(0x143))/0x8+-parseInt(_0x4714f7(0x175))/0x9;if(_0x92c8e8===_0x4add5c)break;else _0x107584['push'](_0x107584['shift']());}catch(_0x424717){_0x107584['push'](_0x107584['shift']());}}}(a0_0x10d5,0x9b7ec));function a0_0x3e30(_0x3cd3b4,_0x53c8d8){_0x3cd3b4=_0x3cd3b4-0x138;const _0x10d543=a0_0x10d5();let _0x3e3016=_0x10d543[_0x3cd3b4];if(a0_0x3e30['pPzDLc']===undefined){var _0x466589=function(_0x242124){const _0x3bd43f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b2d61='',_0x23566d='';for(let _0x5beac2=0x0,_0x11dfc9,_0x5c6991,_0x529da3=0x0;_0x5c6991=_0x242124['charAt'](_0x529da3++);~_0x5c6991&&(_0x11dfc9=_0x5beac2%0x4?_0x11dfc9*0x40+_0x5c6991:_0x5c6991,_0x5beac2++%0x4)?_0x2b2d61+=String['fromCharCode'](0xff&_0x11dfc9>>(-0x2*_0x5beac2&0x6)):0x0){_0x5c6991=_0x3bd43f['indexOf'](_0x5c6991);}for(let _0x1799ab=0x0,_0x22c4a1=_0x2b2d61['length'];_0x1799ab<_0x22c4a1;_0x1799ab++){_0x23566d+='%'+('00'+_0x2b2d61['charCodeAt'](_0x1799ab)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x23566d);};a0_0x3e30['ovsBfu']=_0x466589,a0_0x3e30['wuuazu']={},a0_0x3e30['pPzDLc']=!![];}const _0x3e6e72=_0x10d543[0x0],_0x283d29=_0x3cd3b4+_0x3e6e72,_0x2c4f8f=a0_0x3e30['wuuazu'][_0x283d29];return!_0x2c4f8f?(_0x3e3016=a0_0x3e30['ovsBfu'](_0x3e3016),a0_0x3e30['wuuazu'][_0x283d29]=_0x3e3016):_0x3e3016=_0x2c4f8f,_0x3e3016;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x2b2d61=null){const _0x4aa334=a0_0x3e30;this['logger']=_0x2b2d61,this[_0x4aa334(0x13e)]=null,this[_0x4aa334(0x154)]=null,this['postcssScss']=null,this['postcssLess']=null;}async[a0_0x8392c3(0x164)](_0x23566d,_0x5beac2,_0x11dfc9={}){const _0x45dec7=a0_0x8392c3;try{const _0x5c6991=[],_0x529da3=this['detectLanguage'](_0x23566d),_0x1799ab=await this['checkSyntax'](_0x23566d,_0x5beac2,_0x529da3);_0x5c6991[_0x45dec7(0x166)](..._0x1799ab);if(_0x1799ab['length']===0x0){const _0x22c4a1=await this[_0x45dec7(0x15c)](_0x23566d,_0x5beac2,_0x529da3);_0x5c6991[_0x45dec7(0x166)](..._0x22c4a1);}return this[_0x45dec7(0x151)]?.[_0x45dec7(0x14e)]('CSS\x20analysis\x20completed',{'file':_0x23566d,'language':_0x529da3,'totalDiagnostics':_0x5c6991[_0x45dec7(0x160)],'errors':_0x5c6991['filter'](_0x1d9469=>_0x1d9469[_0x45dec7(0x15b)]===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x5c6991['filter'](_0x3772b8=>_0x3772b8['severity']===STATIC_ANALYSIS[_0x45dec7(0x174)][_0x45dec7(0x16f)])['length']}),_0x5c6991;}catch(_0x134000){return this[_0x45dec7(0x151)]?.['error'](_0x45dec7(0x14d),{'file':_0x23566d,'error':_0x134000['message']}),[];}}async['checkSyntax'](_0x5cdb90,_0x13f917,_0x5ef819){const _0x24ce51=a0_0x8392c3,_0x459595=[];try{if(!this['postcss']){const _0x3e83ba=await import(_0x24ce51(0x154));this['postcss']=_0x3e83ba['default'];}let _0x2f5c28=null;if(_0x5ef819==='scss'){if(!this[_0x24ce51(0x167)]){const _0x2d7885=await import(_0x24ce51(0x153));this[_0x24ce51(0x167)]=_0x2d7885['default'];}_0x2f5c28=this['postcssScss'];}else{if(_0x5ef819===_0x24ce51(0x165)){if(!this['postcssLess']){const _0x205582=await import('postcss-less');this[_0x24ce51(0x157)]=_0x205582[_0x24ce51(0x16e)];}_0x2f5c28=this[_0x24ce51(0x157)];}}const _0x50454e=this['postcss']()['process'](_0x13f917,{'from':_0x5cdb90,'syntax':_0x2f5c28}),_0x2f1315=_0x50454e[_0x24ce51(0x14f)];this['logger']?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0x5cdb90});}catch(_0x7ff4fb){const _0x31cd82=this[_0x24ce51(0x14a)](_0x7ff4fb,_0x5cdb90);_0x31cd82&&_0x459595[_0x24ce51(0x166)](_0x31cd82);}return _0x459595;}async[a0_0x8392c3(0x15c)](_0x3a357e,_0x1d65ec,_0x2e687b){const _0x2538e1=a0_0x8392c3,_0x7cc992=[];try{if(!this['stylelint']){const _0xf190ce=await import('stylelint');this[_0x2538e1(0x13e)]=_0xf190ce['default'];}const _0x4a115c={'extends':[_0x2538e1(0x172)],'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':[_0x2538e1(0x148),_0x2538e1(0x15d)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x2e687b==='scss'?[!![],{'ignoreAtRules':[_0x2538e1(0x155),'include','extend','if',_0x2538e1(0x15e),'for','each',_0x2538e1(0x168),_0x2538e1(0x139),_0x2538e1(0x17b),_0x2538e1(0x179),'use',_0x2538e1(0x15a)]}]:_0x2e687b==='less'?[!![],{'ignoreAtRules':['plugin']}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':_0x2538e1(0x169),'selector-type-case':'lower'},'customSyntax':_0x2e687b==='scss'?'postcss-scss':_0x2e687b==='less'?_0x2538e1(0x144):undefined},_0x2a53cf=await this['stylelint']['lint']({'code':_0x1d65ec,'codeFilename':_0x3a357e,'config':_0x4a115c});if(_0x2a53cf['results']&&_0x2a53cf['results'][_0x2538e1(0x160)]>0x0){const _0x374a25=_0x2a53cf[_0x2538e1(0x170)][0x0];if(_0x374a25['warnings'])for(const _0x4bb8da of _0x374a25[_0x2538e1(0x138)]){_0x7cc992[_0x2538e1(0x166)]({'file':_0x3a357e,'line':_0x4bb8da[_0x2538e1(0x13f)]||0x1,'column':_0x4bb8da['column']||0x1,'severity':_0x4bb8da[_0x2538e1(0x15b)]===_0x2538e1(0x173)?STATIC_ANALYSIS[_0x2538e1(0x174)]['ERROR']:STATIC_ANALYSIS['SEVERITY'][_0x2538e1(0x16f)],'rule':_0x4bb8da[_0x2538e1(0x141)]||_0x2538e1(0x16a),'message':_0x4bb8da['text'],'category':this[_0x2538e1(0x156)](_0x4bb8da['rule']),'fixable':![],'source':_0x2538e1(0x13e)});}}}catch(_0x11afa1){this[_0x2538e1(0x151)]?.[_0x2538e1(0x15f)](_0x2538e1(0x16c),{'file':_0x3a357e,'error':_0x11afa1['message']});}return _0x7cc992;}[a0_0x8392c3(0x14a)](_0x38d80d,_0x2bd7bd){const _0x3a335a=a0_0x8392c3;return{'file':_0x2bd7bd,'line':_0x38d80d['line']||0x1,'column':_0x38d80d[_0x3a335a(0x142)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x38d80d[_0x3a335a(0x147)]||_0x3a335a(0x13b),'message':_0x38d80d['reason']||_0x38d80d['message'],'category':STATIC_ANALYSIS[_0x3a335a(0x13c)][_0x3a335a(0x17c)],'fixable':![],'source':'postcss','code':_0x38d80d[_0x3a335a(0x176)]||undefined};}[a0_0x8392c3(0x156)](_0x103f82){const _0x39b713=a0_0x8392c3;if(!_0x103f82)return STATIC_ANALYSIS[_0x39b713(0x13c)][_0x39b713(0x158)];const _0x4dc7af=_0x103f82['toLowerCase']();if(_0x4dc7af[_0x39b713(0x159)]('no-invalid')||_0x4dc7af['includes'](_0x39b713(0x14c))||_0x4dc7af[_0x39b713(0x159)](_0x39b713(0x145))||_0x4dc7af[_0x39b713(0x159)]('syntax'))return STATIC_ANALYSIS['CATEGORY'][_0x39b713(0x17c)];if(_0x4dc7af[_0x39b713(0x159)]('performance')||_0x4dc7af[_0x39b713(0x159)]('optimize'))return STATIC_ANALYSIS[_0x39b713(0x13c)]['PERFORMANCE'];if(_0x4dc7af[_0x39b713(0x159)]('best-practice')||_0x4dc7af[_0x39b713(0x159)](_0x39b713(0x163)))return STATIC_ANALYSIS[_0x39b713(0x13c)][_0x39b713(0x16d)];return STATIC_ANALYSIS[_0x39b713(0x13c)]['STYLE'];}[a0_0x8392c3(0x178)](_0x148bbc){const _0x5c6f7d=a0_0x8392c3,_0x30b876=_0x148bbc[_0x5c6f7d(0x13a)]();if(_0x30b876['endsWith'](_0x5c6f7d(0x16b))||_0x30b876[_0x5c6f7d(0x150)](_0x5c6f7d(0x17a)))return _0x5c6f7d(0x14b);if(_0x30b876[_0x5c6f7d(0x150)]('.less'))return'less';return _0x5c6f7d(0x149);}['getSupportedExtensions'](){const _0x1d5643=a0_0x8392c3;return['.css',_0x1d5643(0x16b),'.sass',_0x1d5643(0x162)];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
1
+ function a0_0x5692(){const _0x13da56=['y2HLy2TtEw50yxG','nKj4z0LXDa','CMv0DxjU','y29SDw1U','CgvYzM9YBwfUy2u','rvjst1i','u1Lovefy','C2nZCW','BwvZC2fNzq','Cg9ZDgnZC1nJC3m','Cg9ZDgnZCY1SzxnZ','nJyZnJy0ognnCw1hrq','BgLUDfn0EwXLCW','Dgv4Da','Dw5RBM93BG','D2HPBgu','Dg9mB3DLCKnHC2u','mtaZntKYn3LSru9LqG','zwfJAa','l15JDxn0B20TlW','q0furuDpuLK','BM8TAw52ywXPza','ndiXmZuYuuP5C0Hh','nJK0nvvtwfzTCG','zM9Y','u0vwrvjjvfK','C3LUDgf4','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','CMvHC29U','Cg9ZDgnZCW','zgvIDwC','Cg9ZDgnZCY1Zy3nZ','BM8TDw5RBM93BG','yw5HBhL6zq','Aw5JBhvKzxm','y29UDgvUDa','C2v2zxjPDhK','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','q1ntigfUywX5C2LZignVBxbSzxrLza','BMfTzq','lNnHC3m','lMXLC3m','oty4ntu3zuPnBgrS','mtbtC25fCxm','zw5KC1DPDgG','BMCTzgvLCa','CMvZDwX0CW','mti2zvLrrLDh','ChvZAa','zgvMyxvSDa','odu0mJK0mu1izuvpsq','Bg93zxi','y3nZ','C291CMnL','BgvUz3rO','u1rzteu','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','zxjYB3i','zxH0zw5K','BgvZCW','D2fYBG','Cg9ZDgnZC0XLC3m','C3r5BgvSAw50','mtqWohjhwvn2Bq','v0fstKLorW','q1ntigfUywX5C2LZigzHAwXLza','BgLUzq','zwXZzq','Bg9Nz2vY','Aw5JBhvKzq','zM9YD2fYza','zgv0zwn0tgfUz3vHz2u','nJyYmty2sfffrLHw'];a0_0x5692=function(){return _0x13da56;};return a0_0x5692();}const a0_0x5adbc3=a0_0x2812;(function(_0x2666ba,_0x577d9d){const _0x59f9c2=a0_0x2812,_0x40d967=_0x2666ba();while(!![]){try{const _0x2b4deb=parseInt(_0x59f9c2(0x1d7))/0x1+-parseInt(_0x59f9c2(0x1f7))/0x2*(parseInt(_0x59f9c2(0x1f5))/0x3)+-parseInt(_0x59f9c2(0x1ec))/0x4*(parseInt(_0x59f9c2(0x1c4))/0x5)+parseInt(_0x59f9c2(0x1b8))/0x6+-parseInt(_0x59f9c2(0x1dc))/0x7*(parseInt(_0x59f9c2(0x1c3))/0x8)+-parseInt(_0x59f9c2(0x1be))/0x9+-parseInt(_0x59f9c2(0x1d8))/0xa*(-parseInt(_0x59f9c2(0x1df))/0xb);if(_0x2b4deb===_0x577d9d)break;else _0x40d967['push'](_0x40d967['shift']());}catch(_0x1a8f76){_0x40d967['push'](_0x40d967['shift']());}}}(a0_0x5692,0x9b881));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x2812(_0x55022e,_0x398eb0){_0x55022e=_0x55022e-0x1b0;const _0x569240=a0_0x5692();let _0x28127a=_0x569240[_0x55022e];if(a0_0x2812['VcoBIL']===undefined){var _0x59e927=function(_0x460852){const _0x330c7c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4e39c0='',_0x130172='';for(let _0x36285e=0x0,_0x503328,_0x22e298,_0x6d634d=0x0;_0x22e298=_0x460852['charAt'](_0x6d634d++);~_0x22e298&&(_0x503328=_0x36285e%0x4?_0x503328*0x40+_0x22e298:_0x22e298,_0x36285e++%0x4)?_0x4e39c0+=String['fromCharCode'](0xff&_0x503328>>(-0x2*_0x36285e&0x6)):0x0){_0x22e298=_0x330c7c['indexOf'](_0x22e298);}for(let _0xa7f2d4=0x0,_0x461960=_0x4e39c0['length'];_0xa7f2d4<_0x461960;_0xa7f2d4++){_0x130172+='%'+('00'+_0x4e39c0['charCodeAt'](_0xa7f2d4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x130172);};a0_0x2812['RRhMIF']=_0x59e927,a0_0x2812['TKKJxD']={},a0_0x2812['VcoBIL']=!![];}const _0x8e182a=_0x569240[0x0],_0x29c3ed=_0x55022e+_0x8e182a,_0x513b42=a0_0x2812['TKKJxD'][_0x29c3ed];return!_0x513b42?(_0x28127a=a0_0x2812['RRhMIF'](_0x28127a),a0_0x2812['TKKJxD'][_0x29c3ed]=_0x28127a):_0x28127a=_0x513b42,_0x28127a;}class CSSAnalyzer{constructor(_0x4e39c0=null){const _0x2f69bc=a0_0x2812;this['logger']=_0x4e39c0,this['stylelint']=null,this[_0x2f69bc(0x1ca)]=null,this['postcssScss']=null,this[_0x2f69bc(0x1ea)]=null;}async[a0_0x5adbc3(0x1ce)](_0x130172,_0x36285e,_0x503328={}){const _0x2815bd=a0_0x5adbc3;try{const _0x22e298=[],_0x6d634d=this['detectLanguage'](_0x130172),_0xa7f2d4=await this[_0x2815bd(0x1f6)](_0x130172,_0x36285e,_0x6d634d);_0x22e298[_0x2815bd(0x1dd)](..._0xa7f2d4);if(_0xa7f2d4['length']===0x0){const _0x461960=await this[_0x2815bd(0x1b9)](_0x130172,_0x36285e,_0x6d634d);_0x22e298['push'](..._0x461960);}return this['logger']?.['debug'](_0x2815bd(0x1d3),{'file':_0x130172,'language':_0x6d634d,'totalDiagnostics':_0x22e298['length'],'errors':_0x22e298['filter'](_0x28d8d0=>_0x28d8d0[_0x2815bd(0x1d1)]===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x22e298['filter'](_0x1674ac=>_0x1674ac[_0x2815bd(0x1d1)]===STATIC_ANALYSIS[_0x2815bd(0x1c6)][_0x2815bd(0x1ed)])['length']}),_0x22e298;}catch(_0x3b9131){return this[_0x2815bd(0x1f1)]?.['error'](_0x2815bd(0x1ee),{'file':_0x130172,'error':_0x3b9131[_0x2815bd(0x1b5)]}),[];}}async[a0_0x5adbc3(0x1f6)](_0x27f782,_0x222121,_0x484a08){const _0x2ca9f6=a0_0x5adbc3,_0x2ca538=[];try{if(!this[_0x2ca9f6(0x1ca)]){const _0x83ed31=await import(_0x2ca9f6(0x1ca));this['postcss']=_0x83ed31[_0x2ca9f6(0x1de)];}let _0x10f8d9=null;if(_0x484a08==='scss'){if(!this[_0x2ca9f6(0x1b6)]){const _0x57eb45=await import(_0x2ca9f6(0x1cc));this['postcssScss']=_0x57eb45['default'];}_0x10f8d9=this[_0x2ca9f6(0x1b6)];}else{if(_0x484a08===_0x2ca9f6(0x1e8)){if(!this['postcssLess']){const _0x56b493=await import('postcss-less');this['postcssLess']=_0x56b493['default'];}_0x10f8d9=this[_0x2ca9f6(0x1ea)];}}const _0x24d8dd=this[_0x2ca9f6(0x1ca)]()['process'](_0x222121,{'from':_0x27f782,'syntax':_0x10f8d9}),_0x76bbed=_0x24d8dd['root'];this['logger']?.[_0x2ca9f6(0x1cb)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x27f782});}catch(_0x18f15a){const _0x452bb2=this['formatPostCSSError'](_0x18f15a,_0x27f782);_0x452bb2&&_0x2ca538['push'](_0x452bb2);}return _0x2ca538;}async['lintStyles'](_0x5a30e1,_0xa2b185,_0x57e637){const _0x514e44=a0_0x5adbc3,_0x108bb8=[];try{if(!this[_0x514e44(0x1eb)]){const _0x14b4a0=await import(_0x514e44(0x1eb));this[_0x514e44(0x1eb)]=_0x14b4a0[_0x514e44(0x1de)];}const _0x265576={'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':[_0x514e44(0x1c0),_0x514e44(0x1da)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x57e637===_0x514e44(0x1b4)?[!![],{'ignoreAtRules':['mixin',_0x514e44(0x1f2),_0x514e44(0x1e7),'if',_0x514e44(0x1f0),_0x514e44(0x1c5),_0x514e44(0x1bf),_0x514e44(0x1bc),'function',_0x514e44(0x1f8),_0x514e44(0x1d0),'use',_0x514e44(0x1f3)]}]:_0x57e637==='less'?[!![],{'ignoreAtRules':['plugin']}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':_0x514e44(0x1e0)},'customSyntax':_0x57e637==='scss'?'postcss-scss':_0x57e637==='less'?_0x514e44(0x1b7):undefined},_0x2f0314=await this[_0x514e44(0x1eb)]['lint']({'code':_0xa2b185,'codeFilename':_0x5a30e1,'config':_0x265576});if(_0x2f0314[_0x514e44(0x1db)]&&_0x2f0314['results'][_0x514e44(0x1e3)]>0x0){const _0x443965=_0x2f0314['results'][0x0];if(_0x443965['warnings'])for(const _0x3da38a of _0x443965['warnings']){_0x108bb8[_0x514e44(0x1dd)]({'file':_0x5a30e1,'line':_0x3da38a[_0x514e44(0x1ef)]||0x1,'column':_0x3da38a[_0x514e44(0x1b0)]||0x1,'severity':_0x3da38a[_0x514e44(0x1d1)]===_0x514e44(0x1e6)?STATIC_ANALYSIS[_0x514e44(0x1c6)][_0x514e44(0x1b2)]:STATIC_ANALYSIS[_0x514e44(0x1c6)][_0x514e44(0x1ed)],'rule':_0x3da38a['rule']||_0x514e44(0x1bb),'message':_0x3da38a[_0x514e44(0x1ba)],'category':this['categorizeStylelintRule'](_0x3da38a['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x1c2cd6){this['logger']?.[_0x514e44(0x1e9)](_0x514e44(0x1d2),{'file':_0x5a30e1,'error':_0x1c2cd6[_0x514e44(0x1b5)]});}return _0x108bb8;}['formatPostCSSError'](_0x2aad5e,_0x1d4e3c){const _0x464660=a0_0x5adbc3;return{'file':_0x1d4e3c,'line':_0x2aad5e[_0x464660(0x1ef)]||0x1,'column':_0x2aad5e['column']||0x1,'severity':STATIC_ANALYSIS[_0x464660(0x1c6)][_0x464660(0x1b2)],'rule':_0x2aad5e[_0x464660(0x1d4)]||'CssSyntaxError','message':_0x2aad5e[_0x464660(0x1c9)]||_0x2aad5e['message'],'category':STATIC_ANALYSIS['CATEGORY'][_0x464660(0x1b3)],'fixable':![],'source':_0x464660(0x1ca),'code':_0x2aad5e[_0x464660(0x1e2)]||undefined};}[a0_0x5adbc3(0x1c8)](_0x4465a2){const _0x3177a5=a0_0x5adbc3;if(!_0x4465a2)return STATIC_ANALYSIS['CATEGORY'][_0x3177a5(0x1e4)];const _0x3b6ab1=_0x4465a2['toLowerCase']();if(_0x3b6ab1['includes'](_0x3177a5(0x1c2))||_0x3b6ab1['includes'](_0x3177a5(0x1cd))||_0x3b6ab1['includes']('no-empty')||_0x3b6ab1['includes'](_0x3177a5(0x1c7)))return STATIC_ANALYSIS[_0x3177a5(0x1c1)]['SYNTAX'];if(_0x3b6ab1[_0x3177a5(0x1cf)](_0x3177a5(0x1b1))||_0x3b6ab1['includes']('optimize'))return STATIC_ANALYSIS[_0x3177a5(0x1c1)]['PERFORMANCE'];if(_0x3b6ab1[_0x3177a5(0x1cf)]('best-practice')||_0x3b6ab1[_0x3177a5(0x1cf)]('recommended'))return STATIC_ANALYSIS['CATEGORY']['BEST_PRACTICE'];return STATIC_ANALYSIS['CATEGORY']['STYLE'];}[a0_0x5adbc3(0x1f4)](_0x2d91b){const _0x313108=a0_0x5adbc3,_0x27c54e=_0x2d91b[_0x313108(0x1bd)]();if(_0x27c54e[_0x313108(0x1d9)]('.scss')||_0x27c54e[_0x313108(0x1d9)](_0x313108(0x1d5)))return'scss';if(_0x27c54e[_0x313108(0x1d9)](_0x313108(0x1d6)))return'less';return _0x313108(0x1e1);}[a0_0x5adbc3(0x1e5)](){return['.css','.scss','.sass','.less'];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
@@ -1 +1 @@
1
- const a0_0x19775a=a0_0x26b6;(function(_0x5845b9,_0x465c85){const _0x1bb25a=a0_0x26b6,_0xe45e33=_0x5845b9();while(!![]){try{const _0x2e433d=parseInt(_0x1bb25a(0x120))/0x1*(parseInt(_0x1bb25a(0x14d))/0x2)+-parseInt(_0x1bb25a(0x168))/0x3*(parseInt(_0x1bb25a(0x14f))/0x4)+parseInt(_0x1bb25a(0x14b))/0x5+-parseInt(_0x1bb25a(0x148))/0x6+parseInt(_0x1bb25a(0x162))/0x7+-parseInt(_0x1bb25a(0x11e))/0x8+parseInt(_0x1bb25a(0x13f))/0x9;if(_0x2e433d===_0x465c85)break;else _0xe45e33['push'](_0xe45e33['shift']());}catch(_0x58b329){_0xe45e33['push'](_0xe45e33['shift']());}}}(a0_0x89a2,0x67266));function a0_0x89a2(){const _0x2e3fbe=['mZC0nZi4mNDcBNzSCq','BgLUzq','DMfSAwrHDgvuC0nVBMzPzW','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','BwLZC2LUz1bYB3bLCNr5','lNLTBa','nZuWmdnesxn5v2O','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','su5gtW','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','CgfYC2viywrVBgLUDfjLC3vSDhm','Ew91CI1RzxKTAgvYzq','Bw9KDwXL','zgLYBMfTzq','CgfYC2u','Bg9Nz2vY','y29Kzq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','DMfSAwrHDgLVBG','igrLDgvJDgvKigLUic5LBNyGzMLSzq','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','BM8TAw1WBgLJAxqTyw55','AgfKB2XPBNq','AZHZ','y2HLy2TFy2XHC3m','DhnJB25MAwCUANnVBG','EwfTBgXPBNqGls12zxjZAw9U','y3DL','DgvYCMfMB3jT','CgfZC3DVCMq','ANnVBLnJAgvTyq','ChjPDMf0zsbRzxK','zgvMyxvSDa','Bgv2zwW','y29TBw9UANm','zgvIDwC','qvbjigTLEq','BwvZC2fNzq','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','zMLSzq','C2vJCMv0','DMfSAwrHDgvzqu1m','DhjPBq','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','C3rKB3v0','DMfSAwrHDgvfBNzgAwXL','Dg9Rzw4','rvjst1i','C2vJDxjPDhK','BwfWsgfKB2XPBNrtzxzLCML0Eq','ANnVBG','DMfSAwrHDgvxAxrOq2HLy2TVDG','lMDPDgH1yI93B3jRzMXVD3m','DMfSAwrHDgu','B2jQzwn0','qvDtignYzwrLBNrPywXZ','DMfSAwrHDgveB2nRzxjMAwXL','y2HLy2TFBMfTzq','Aw5JBhvKzxm','BM9jBxbSAwnPDefUEq','ndy3nZqZmMLsB1nUuG','ANnVBI1Zy2HLBwe','mtnbqwXjANK','BwfWwwfTBgXPBNrtzxzLCML0Eq','DhnJB25MAwCTDMfSAwrHDg9Y','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','ANnVBI1WyxjZzq','z3vPzgvSAw5L','C3rYAw5N','y2HLy2TVDG','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','CgfJA2fNzs5QC29U','CMvMzxjLBMnLCW','AxnbCNjHEq','zMLSzv9SAw5Lx3jHBMDL','v0fstKLorW','ChvZAa','C3rHCNrZv2L0Aa','CMvZDwX0CW','zxjYB3jZ','DMfSAwrHDgvqywnRywDLsNnVBG','AgfYzgnVzgvKlxnLy3jLDa','Dg9mB3DLCKnHC2u','BMfTzq','D2fYBG','zgv0zwn0rMLSzvr5Cgu','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','wufntcbMAwXLihzHBgLKyxrPB24','ywP2lwzVCM1HDhm','zxH0BMfTzq','zw52','zMfPBgvKx2nOzwnRCW','yxzHAwXHyMXLu2nHBM5LCNm','mta2nJmYoxPeyu1vzq','Dw5RBM93BG','y29TCgLSzxjpChrPB25Z','ywP2icHku09oifnJAgvTysK','y2HLy2TVDIaTzIaI','zg9JA2vYzMLSzq','DxrMltG','BwfWq2HLy2TVDLnLDMvYAxr5','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','otaYmtm2qw9nCKPX','y2HLy2TFAwq','ug90zw50AwfSigHHCMrJB2rLzca','mJy2mty3meLtvMvnBG','u0vwrvjjvfK','ntmYotrUAw1st0O','Aw5ZDgfUy2vqyxrO','nJb5DMrJt3a','zg9JA2vYlwnVBxbVC2uUEw1S','EwfTBa','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','DMfSAwrHDg9Y','A3vIzxjUzxrLCW','ywP2','CMvHzezPBgu','zM9YrwfJAa','CgfYC2vdAgvJA292uMvZDwX0CW','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','zw52lxzHBgLKyxrVCG','C3bSAxq','zxjYB3i','z2L0AhvIlwfJDgLVBNm','CgLWigLUC3rHBgWGy2HLy2TVDG','EwfTBgXPBNq','yMfZzw5HBwu','DMvYC2LVBG'];a0_0x89a2=function(){return _0x2e3fbe;};return a0_0x89a2();}function a0_0x26b6(_0x575be0,_0x208d4a){_0x575be0=_0x575be0-0xee;const _0x89a213=a0_0x89a2();let _0x26b699=_0x89a213[_0x575be0];if(a0_0x26b6['UDQWeY']===undefined){var _0x2390c7=function(_0xcc3839){const _0x43f5c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5795c9='',_0x56294a='';for(let _0x265633=0x0,_0x15407f,_0xc055d2,_0x409112=0x0;_0xc055d2=_0xcc3839['charAt'](_0x409112++);~_0xc055d2&&(_0x15407f=_0x265633%0x4?_0x15407f*0x40+_0xc055d2:_0xc055d2,_0x265633++%0x4)?_0x5795c9+=String['fromCharCode'](0xff&_0x15407f>>(-0x2*_0x265633&0x6)):0x0){_0xc055d2=_0x43f5c9['indexOf'](_0xc055d2);}for(let _0x2dc7ae=0x0,_0x55809f=_0x5795c9['length'];_0x2dc7ae<_0x55809f;_0x2dc7ae++){_0x56294a+='%'+('00'+_0x5795c9['charCodeAt'](_0x2dc7ae)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56294a);};a0_0x26b6['DHSOFG']=_0x2390c7,a0_0x26b6['GJZyMR']={},a0_0x26b6['UDQWeY']=!![];}const _0x2897c8=_0x89a213[0x0],_0x59622a=_0x575be0+_0x2897c8,_0x139e32=a0_0x26b6['GJZyMR'][_0x59622a];return!_0x139e32?(_0x26b699=a0_0x26b6['DHSOFG'](_0x26b699),a0_0x26b6['GJZyMR'][_0x59622a]=_0x26b699):_0x26b699=_0x139e32,_0x26b699;}import{exec}from'child_process';import{promisify}from'util';import a0_0x5795c9 from'path';import a0_0x56294a from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x265633=null){const _0x3038aa=a0_0x26b6;this['logger']=_0x265633,this[_0x3038aa(0x13e)]=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x23dcbe=a0_0x26b6;if(this[_0x23dcbe(0x13e)]!==null)return this['availableScanners'];const _0x15407f={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x15407f[_0x23dcbe(0x127)]=!![],this[_0x23dcbe(0xf1)]?.['debug']('checkov\x20detected');}catch(_0xc055d2){this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)](_0x23dcbe(0x108),{'error':_0xc055d2['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x15407f[_0x23dcbe(0xf8)]=!![],this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)]('hadolint\x20detected');}catch(_0x409112){this['logger']?.['debug']('hadolint\x20not\x20available',{'error':_0x409112['message']});}try{await execAsync(_0x23dcbe(0xfc),{'timeout':0x1388}),_0x15407f['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x2dc7ae){this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)]('yamllint\x20not\x20available',{'error':_0x2dc7ae['message']});}try{await import('ajv'),_0x15407f[_0x23dcbe(0x100)]=!![],this['logger']?.['debug'](_0x23dcbe(0x159));}catch(_0x55809f){this['logger']?.['debug']('ajv\x20not\x20available',{'error':_0x55809f['message']});}return this['availableScanners']=_0x15407f,_0x15407f;}async[a0_0x19775a(0x117)](_0x2d0e6c,_0x1d54d2={}){const _0x540466=a0_0x19775a,_0x4b98f6=[],_0x52d656=await this['detectAvailableValidators'](),_0x21b786=this[_0x540466(0x137)](_0x2d0e6c);this['logger']?.[_0x540466(0x105)](_0x540466(0x152),{'filePath':_0x2d0e6c,'fileType':_0x21b786});switch(_0x21b786){case'dockerfile':if(_0x52d656[_0x540466(0xf8)]){const _0x432f39=await this['validateDockerfile'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x432f39);}if(_0x52d656[_0x540466(0x127)]){const _0x321234=await this['validateWithCheckov'](_0x2d0e6c,_0x540466(0x144),_0x1d54d2);_0x4b98f6['push'](..._0x321234);}break;case'docker-compose':if(_0x52d656[_0x540466(0x15f)]){const _0x43e1d2=await this['validateYAML'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x43e1d2);}if(_0x52d656['checkov']){const _0x2f60fc=await this[_0x540466(0x115)](_0x2d0e6c,'docker_compose',_0x1d54d2);_0x4b98f6['push'](..._0x2f60fc);}break;case'kubernetes':if(_0x52d656[_0x540466(0x15f)]){const _0x5514bd=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x5514bd);}if(_0x52d656['checkov']){const _0x6b3c9e=await this['validateWithCheckov'](_0x2d0e6c,_0x540466(0x154),_0x1d54d2);_0x4b98f6['push'](..._0x6b3c9e);}break;case'terraform':if(_0x52d656['checkov']){const _0x1c2c42=await this[_0x540466(0x115)](_0x2d0e6c,_0x540466(0xfe),_0x1d54d2);_0x4b98f6[_0x540466(0x12e)](..._0x1c2c42);}break;case'package.json':if(_0x52d656['jsonSchema']){const _0x59b8ed=await this['validatePackageJson'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x59b8ed);}break;case _0x540466(0xfb):if(_0x52d656[_0x540466(0x100)]){const _0x17c4af=await this['validateTsConfig'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x17c4af);}break;case'github-actions':if(_0x52d656['yamllint']){const _0x16ec43=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6[_0x540466(0x12e)](..._0x16ec43);}break;case'env':const _0x138af2=await this['validateEnvFile'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x138af2);break;case _0x540466(0x151):if(_0x52d656[_0x540466(0x15f)]){const _0x5b05a3=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x5b05a3);}break;default:this[_0x540466(0xf1)]?.[_0x540466(0x136)](_0x540466(0x169),{'filePath':_0x2d0e6c,'fileType':_0x21b786});return[];}return this['normalizeResults'](_0x4b98f6);}async[a0_0x19775a(0x11a)](_0x5b0eed,_0x4709d7={}){const _0x85f1fe=a0_0x19775a;try{const _0x1db061=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x5b0eed+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x59eec7=JSON['parse'](_0x1db061[_0x85f1fe(0x10e)]);return this[_0x85f1fe(0x16c)](_0x59eec7,_0x5b0eed);}catch(_0x168b4b){if(_0x168b4b['stdout'])try{const _0xa35be6=JSON['parse'](_0x168b4b[_0x85f1fe(0x10e)]);return this['parseHadolintResults'](_0xa35be6,_0x5b0eed);}catch(_0xc76ece){this['logger']?.['error'](_0x85f1fe(0x10d),{'error':_0xc76ece['message']});}return this[_0x85f1fe(0xf1)]?.['error']('hadolint\x20validation\x20failed',{'error':_0x168b4b['message']}),[];}}[a0_0x19775a(0x16c)](_0x522f2b,_0x3a0356){const _0x197bf6=a0_0x19775a,_0x2a0649=[];if(Array[_0x197bf6(0x12b)](_0x522f2b))for(const _0x584cd9 of _0x522f2b){_0x2a0649[_0x197bf6(0x12e)]({'file':_0x3a0356,'line':_0x584cd9['line']||0x1,'column':_0x584cd9['column']||0x1,'severity':this['mapHadolintSeverity'](_0x584cd9[_0x197bf6(0x103)]),'rule':_0x584cd9[_0x197bf6(0xf2)],'message':_0x584cd9[_0x197bf6(0x107)],'category':_0x197bf6(0x144),'validator':'hadolint'});}return _0x2a0649;}async[a0_0x19775a(0x10b)](_0x2074ac,_0x498d25={}){const _0x14b6c2=a0_0x19775a;try{const _0x40b2f3=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x2074ac+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x40b2f3[_0x14b6c2(0x10e)],_0x2074ac);}catch(_0x47a3fc){if(_0x47a3fc[_0x14b6c2(0x10e)])return this['parseYamllintResults'](_0x47a3fc['stdout'],_0x2074ac);return this[_0x14b6c2(0xf1)]?.[_0x14b6c2(0x15c)]('yamllint\x20validation\x20failed',{'error':_0x47a3fc['message']}),[];}}['parseYamllintResults'](_0x5891d4,_0x307715){const _0x1b3dcf=a0_0x19775a,_0x2c4562=[],_0x1fdf97=_0x5891d4['split']('\x0a')['filter'](_0x5d626c=>_0x5d626c[_0x1b3dcf(0x10c)]());for(const _0x2b1aa5 of _0x1fdf97){const _0x17cbaa=_0x2b1aa5['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x17cbaa){const [,_0x2bc444,_0xcfd02e,_0x5d03ec,_0x59fdf1,_0x2c284e,_0x4cb666]=_0x17cbaa;_0x2c4562['push']({'file':_0x307715,'line':parseInt(_0xcfd02e,0xa),'column':parseInt(_0x5d03ec,0xa),'severity':this['mapYamllintSeverity'](_0x59fdf1),'rule':_0x4cb666,'message':_0x2c284e,'category':_0x1b3dcf(0x151),'validator':'yamllint'});}}return _0x2c4562;}async['validateWithCheckov'](_0x4978d9,_0x1b1a70,_0x4787bb={}){const _0x40fbbb=a0_0x19775a;try{const _0x429f36=await execAsync(_0x40fbbb(0x143)+_0x4978d9+'\x22\x20--framework\x20'+_0x1b1a70+_0x40fbbb(0xf6),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x3f0cd2=JSON[_0x40fbbb(0xf0)](_0x429f36[_0x40fbbb(0x10e)]);return this['parseCheckovResults'](_0x3f0cd2,_0x4978d9);}catch(_0x46a288){if(_0x46a288['stdout'])try{const _0x57aaf4=JSON[_0x40fbbb(0xf0)](_0x46a288[_0x40fbbb(0x10e)]);return this['parseCheckovResults'](_0x57aaf4,_0x4978d9);}catch(_0x33c418){this[_0x40fbbb(0xf1)]?.[_0x40fbbb(0x15c)]('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x33c418['message']});}return this[_0x40fbbb(0xf1)]?.[_0x40fbbb(0x15c)](_0x40fbbb(0x16b),{'error':_0x46a288['message']}),[];}}[a0_0x19775a(0x158)](_0x879240,_0x46a02b){const _0x4b08ce=a0_0x19775a,_0x555945=[];if(_0x879240['results']&&_0x879240[_0x4b08ce(0x130)][_0x4b08ce(0x13d)])for(const _0x39d4dd of _0x879240['results']['failed_checks']){_0x555945[_0x4b08ce(0x12e)]({'file':_0x46a02b,'line':_0x39d4dd[_0x4b08ce(0x12c)]?_0x39d4dd[_0x4b08ce(0x12c)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x39d4dd[_0x4b08ce(0xfa)]),'rule':_0x39d4dd[_0x4b08ce(0x149)],'message':_0x39d4dd[_0x4b08ce(0x11b)]||_0x39d4dd['check_id'],'category':_0x4b08ce(0x112),'validator':'checkov','remediation':_0x39d4dd['guideline'],'cwe':_0x39d4dd[_0x4b08ce(0xfd)],'references':_0x39d4dd[_0x4b08ce(0x125)]?[_0x39d4dd['guideline']]:[]});}return _0x555945;}async[a0_0x19775a(0x132)](_0x25ad03,_0x4021ad={}){const _0x78488a=a0_0x19775a;try{const _0x3983a1=(await import(_0x78488a(0x155)))[_0x78488a(0x102)],_0x3c574f=(await import(_0x78488a(0x13a)))['default'],_0x394620=await a0_0x56294a['readFile'](_0x25ad03,_0x78488a(0x145)),_0xf784e8=JSON[_0x78488a(0xf0)](_0x394620),_0x52ae87=new _0x3983a1({'allErrors':!![],'strict':![]});_0x3c574f(_0x52ae87);const _0x347915={'type':_0x78488a(0x118),'required':[_0x78488a(0x135),_0x78488a(0x161)],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x78488a(0x126)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':'string','enum':[_0x78488a(0xee),_0x78488a(0x104)]},'scripts':{'type':_0x78488a(0x118)},'dependencies':{'type':'object'},'devDependencies':{'type':_0x78488a(0x118)}},'additionalProperties':!![]},_0x404693=_0x52ae87['compile'](_0x347915),_0x4db1b7=_0x404693(_0xf784e8);if(!_0x4db1b7&&_0x404693['errors'])return _0x404693[_0x78488a(0x131)]['map'](_0x4d74e7=>({'file':_0x25ad03,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x78488a(0x14c)]['ERROR'],'rule':'json-schema','message':_0x4d74e7['instancePath']?_0x4d74e7[_0x78488a(0x14e)]+'\x20'+_0x4d74e7['message']:_0x78488a(0xf3)+_0x4d74e7['params'][_0x78488a(0x166)]+'\x27','category':_0x78488a(0xf4),'validator':_0x78488a(0x11f)}));return[];}catch(_0x1aedf7){return this['logger']?.[_0x78488a(0x15c)](_0x78488a(0x147),{'error':_0x1aedf7[_0x78488a(0x107)]}),[{'file':_0x25ad03,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x78488a(0x111)],'rule':_0x78488a(0x124),'message':'Invalid\x20JSON:\x20'+_0x1aedf7[_0x78488a(0x107)],'category':'syntax','validator':_0x78488a(0x124)}];}}async[a0_0x19775a(0x164)](_0x182499,_0x2ded8e={}){const _0x203c94=a0_0x19775a;try{const _0x4ab1c1=await a0_0x56294a['readFile'](_0x182499,_0x203c94(0x145)),_0x4d2afc=JSON[_0x203c94(0xf0)](_0x4ab1c1),_0x34fb74=[];if(_0x4d2afc[_0x203c94(0x141)]){const _0x50123b=_0x4d2afc['compilerOptions'];!_0x50123b['strict']&&_0x34fb74['push']({'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)][_0x203c94(0x12d)],'rule':'strict-mode','message':_0x203c94(0x123),'category':'best-practice','validator':_0x203c94(0x122)}),_0x50123b[_0x203c94(0x11d)]===![]&&_0x34fb74[_0x203c94(0x12e)]({'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)][_0x203c94(0x12d)],'rule':_0x203c94(0xf7),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x34fb74;}catch(_0x234c6b){return this['logger']?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0x234c6b[_0x203c94(0x107)]}),[{'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x234c6b[_0x203c94(0x107)],'category':'syntax','validator':'json-parse'}];}}async[a0_0x19775a(0x10f)](_0x24e53a,_0x4074ee={}){const _0x46b127=a0_0x19775a;try{const _0x10ca84=await a0_0x56294a[_0x46b127(0x156)](_0x24e53a,'utf-8'),_0xb9f212=[],_0x6c5b52=_0x10ca84['split']('\x0a'),_0x53e4e2=[{'pattern':/password|passwd|pwd/i,'name':_0x46b127(0xff)},{'pattern':/api[_-]?key/i,'name':_0x46b127(0x106)},{'pattern':/secret/i,'name':_0x46b127(0x10a)},{'pattern':/token/i,'name':_0x46b127(0x110)},{'pattern':/private[_-]?key/i,'name':_0x46b127(0x101)},{'pattern':/aws[_-]?access/i,'name':_0x46b127(0x119)}];return _0x6c5b52[_0x46b127(0x157)]((_0x41405c,_0x353a37)=>{const _0x17f2ce=_0x46b127,_0x1b3e61=_0x41405c[_0x17f2ce(0x10c)]();if(!_0x1b3e61||_0x1b3e61[_0x17f2ce(0x12f)]('#'))return;if(_0x1b3e61[_0x17f2ce(0x11c)]('=')){const [_0x552555,_0x35bba1]=_0x1b3e61[_0x17f2ce(0x15b)]('='),_0x50140e=_0x552555[_0x17f2ce(0x134)](),_0x276c2c=_0x35bba1?.['trim']()||'',_0x4db490=_0x276c2c&&_0x276c2c!==''&&!_0x276c2c['startsWith']('$')&&_0x276c2c!==_0x17f2ce(0x16d)&&_0x276c2c!=='changeme'&&_0x276c2c['length']>0x5;if(_0x4db490)for(const {pattern:_0x3945a2,name:_0x27360e}of _0x53e4e2){if(_0x3945a2['test'](_0x50140e)){_0xb9f212['push']({'file':_0x24e53a,'line':_0x353a37+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x17f2ce(0x14c)]['CRITICAL'],'rule':_0x17f2ce(0x133),'message':_0x17f2ce(0x14a)+_0x27360e+_0x17f2ce(0xf5),'category':_0x17f2ce(0x112),'validator':_0x17f2ce(0x15a),'remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0xb9f212;}catch(_0x33b0b0){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x33b0b0['message']}),[];}}['detectFileType'](_0x3b91b3){const _0x4f4ff5=a0_0x19775a,_0x1f4b02=a0_0x5795c9[_0x4f4ff5(0x160)](_0x3b91b3)[_0x4f4ff5(0x134)](),_0x3cfad2=a0_0x5795c9[_0x4f4ff5(0xef)](_0x3b91b3);if(_0x1f4b02===_0x4f4ff5(0x144))return _0x4f4ff5(0x144);if(_0x1f4b02===_0x4f4ff5(0x150)||_0x1f4b02==='docker-compose.yaml')return'docker-compose';if(_0x1f4b02===_0x4f4ff5(0x129))return _0x4f4ff5(0x129);if(_0x1f4b02===_0x4f4ff5(0xfb))return'tsconfig.json';if(_0x1f4b02==='.env'||_0x1f4b02['endsWith']('.env'))return _0x4f4ff5(0x13c);if(_0x3cfad2[_0x4f4ff5(0x11c)](_0x4f4ff5(0x116)))return _0x4f4ff5(0x15d);if(_0x3cfad2[_0x4f4ff5(0x11c)]('kubernetes')||_0x3cfad2[_0x4f4ff5(0x11c)](_0x4f4ff5(0xf9)))return _0x4f4ff5(0x154);const _0x64b164=a0_0x5795c9[_0x4f4ff5(0x13b)](_0x3b91b3)['toLowerCase']();if(_0x64b164==='.tf'||_0x64b164==='.tfvars')return'terraform';if(_0x64b164===_0x4f4ff5(0x167)||_0x64b164==='.yaml')return'yaml';if(_0x64b164==='.json')return _0x4f4ff5(0x114);return'unknown';}['normalizeResults'](_0xad568){const _0x5149a6=a0_0x19775a;return _0xad568['map'](_0x92b669=>({'file':_0x92b669[_0x5149a6(0x109)],'line':_0x92b669[_0x5149a6(0x163)]||0x1,'column':_0x92b669['column']||0x1,'severity':_0x92b669['severity']||STATIC_ANALYSIS[_0x5149a6(0x14c)]['WARNING'],'rule':_0x92b669['rule']||_0x5149a6(0x140),'message':_0x92b669[_0x5149a6(0x107)]||'Validation\x20issue\x20detected','category':_0x92b669['category']||_0x5149a6(0xf4),'validator':_0x92b669[_0x5149a6(0x153)],'cwe':_0x92b669[_0x5149a6(0xfd)]||null,'remediation':_0x92b669['remediation']||null,'references':_0x92b669[_0x5149a6(0x12a)]||[]}));}[a0_0x19775a(0x113)](_0x24191c){const _0x157386=a0_0x19775a,_0x22ecd3={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x157386(0x14c)][_0x157386(0x12d)],'info':STATIC_ANALYSIS['SEVERITY'][_0x157386(0x16a)],'style':STATIC_ANALYSIS['SEVERITY']['INFO']};return _0x22ecd3[_0x24191c?.['toLowerCase']()]||STATIC_ANALYSIS[_0x157386(0x14c)]['WARNING'];}[a0_0x19775a(0x121)](_0x3ab98e){const _0x296861=a0_0x19775a,_0x1f8c2a={'error':STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x111)],'warning':STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x12d)]};return _0x1f8c2a[_0x3ab98e?.['toLowerCase']()]||STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x12d)];}[a0_0x19775a(0x146)](_0x247413){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async['getValidatorStatus'](){const _0x41bcd7=await this['detectAvailableValidators']();return{'validators':_0x41bcd7,'recommendations':this['getInstallRecommendations'](_0x41bcd7)};}[a0_0x19775a(0x138)](_0x52a890){const _0xd7ad44=a0_0x19775a,_0x143ab4=[];return!_0x52a890['checkov']&&_0x143ab4['push']({'validator':'checkov','reason':_0xd7ad44(0x165),'install':_0xd7ad44(0x15e),'priority':'high'}),!_0x52a890[_0xd7ad44(0xf8)]&&_0x143ab4[_0xd7ad44(0x12e)]({'validator':'hadolint','reason':_0xd7ad44(0x128),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x52a890['yamllint']&&_0x143ab4[_0xd7ad44(0x12e)]({'validator':_0xd7ad44(0x15f),'reason':_0xd7ad44(0x139),'install':'pip\x20install\x20yamllint','priority':'medium'}),!_0x52a890[_0xd7ad44(0x100)]&&_0x143ab4['push']({'validator':_0xd7ad44(0x142),'reason':'JSON\x20configuration\x20validation','install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x143ab4;}}export default ConfigValidator;
1
+ const a0_0x549427=a0_0x1677;(function(_0x21e095,_0x173280){const _0x1d3ce9=a0_0x1677,_0x415d21=_0x21e095();while(!![]){try{const _0x3fe653=-parseInt(_0x1d3ce9(0xfc))/0x1*(-parseInt(_0x1d3ce9(0xf5))/0x2)+-parseInt(_0x1d3ce9(0x115))/0x3+-parseInt(_0x1d3ce9(0x10f))/0x4*(-parseInt(_0x1d3ce9(0xe2))/0x5)+-parseInt(_0x1d3ce9(0xeb))/0x6*(parseInt(_0x1d3ce9(0x149))/0x7)+-parseInt(_0x1d3ce9(0x10b))/0x8*(-parseInt(_0x1d3ce9(0x159))/0x9)+-parseInt(_0x1d3ce9(0x133))/0xa+parseInt(_0x1d3ce9(0x124))/0xb;if(_0x3fe653===_0x173280)break;else _0x415d21['push'](_0x415d21['shift']());}catch(_0x47d136){_0x415d21['push'](_0x415d21['shift']());}}}(a0_0x56a5,0xa863f));function a0_0x1677(_0xa50bd5,_0x389dfa){_0xa50bd5=_0xa50bd5-0xe1;const _0x56a574=a0_0x56a5();let _0x1677b4=_0x56a574[_0xa50bd5];if(a0_0x1677['lehQay']===undefined){var _0x4eb4c8=function(_0x510006){const _0x5dc2c1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x8c5ef9='',_0x4293d8='';for(let _0x11f1a6=0x0,_0x725a05,_0x36b391,_0x50c646=0x0;_0x36b391=_0x510006['charAt'](_0x50c646++);~_0x36b391&&(_0x725a05=_0x11f1a6%0x4?_0x725a05*0x40+_0x36b391:_0x36b391,_0x11f1a6++%0x4)?_0x8c5ef9+=String['fromCharCode'](0xff&_0x725a05>>(-0x2*_0x11f1a6&0x6)):0x0){_0x36b391=_0x5dc2c1['indexOf'](_0x36b391);}for(let _0x79d8de=0x0,_0x1ec0f1=_0x8c5ef9['length'];_0x79d8de<_0x1ec0f1;_0x79d8de++){_0x4293d8+='%'+('00'+_0x8c5ef9['charCodeAt'](_0x79d8de)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4293d8);};a0_0x1677['epnDWj']=_0x4eb4c8,a0_0x1677['dyWMxW']={},a0_0x1677['lehQay']=!![];}const _0x33ffed=_0x56a574[0x0],_0x3cbf8a=_0xa50bd5+_0x33ffed,_0x5076ee=a0_0x1677['dyWMxW'][_0x3cbf8a];return!_0x5076ee?(_0x1677b4=a0_0x1677['epnDWj'](_0x1677b4),a0_0x1677['dyWMxW'][_0x3cbf8a]=_0x1677b4):_0x1677b4=_0x5076ee,_0x1677b4;}import{exec}from'child_process';import{promisify}from'util';import a0_0x8c5ef9 from'path';import a0_0x4293d8 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);function a0_0x56a5(){const _0xe8b352=['y2HLy2TVDIaTlxzLCNnPB24','y29Kzq','A3vIzxjUzxrLCW','C3rKB3v0','zg9JA2vYlwnVBxbVC2uUEw1S','yMvZDc1WCMfJDgLJzq','zxjYB3i','y29SDw1U','zg9JA2vYlwnVBxbVC2uUEwfTBa','mNblyMntDW','ywP2ig5VDcbHDMfPBgfIBgu','BMfTzq','xIG/oKbBys16mc05lx5Dw2eTEJaTos0Ux35DkI8Pp1THlxOWltKTFL1Bys16mc05ls5FFL0Qja','zMLSDgvY','Dg9mB3DLCKnHC2u','CMvMzxjLBMnLCW','mtq1ndnkA3LMAum','DMvYC2LVBG','C3bSAxq','zgv0zwn0rMLSzvr5Cgu','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','Aw5JBhvKzxm','B2jQzwn0','zw52','ywP2','zMfPBgvKx2nOzwnRCW','C3rYAw5N','y2HHBMDLBwu','sw52ywXPzcbku09ooIa','BwvKAxvT','z3vPzgvSAw5L','nJK2oeHxBMvNAW','ChvZAa','Dw5RBM93BG','BM9jBxbSAwnPDefUEq','mtmWnJKWmeLwzxz2vq','CgLWigLUC3rHBgWGEwfTBgXPBNq','y2f0zwDVCNK','C2v2zxjPDhK','rvjst1i','EwfTBgXPBNqGls12zxjZAw9U','mta0nZy0ogfXzhf0ra','AgfKB2XPBNq','EwfTBa','BM9YBwfSAxPLuMvZDwX0CW','Bg9Nz2vY','ywP2lwzVCM1HDhm','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','yxzHAwXHyMXLu2nHBM5LCNm','ug90zw50AwfSigHHCMrJB2rLzca','DMfSAwrHDgveB2nRzxjMAwXL','C3LUDgf4','z2v0vMfSAwrHDg9Yu3rHDhvZ','Aw5ZDgfUy2vqyxrO','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','mtGZmdK1ntv3tfbqAeu','su5gtW','CgfYC2viywrVBgLUDfjLC3vSDhm','zgLYBMfTzq','DMfSAwrHDgLVBG','ANnVBLnJAgvTyq','ANnVBI1WyxjZzq','v0fstKLorW','qvDtignYzwrLBNrPywXZ','y2HLy2TVDG','DMfSAwrHDgvxAxrOq2HLy2TVDG','zxH0BMfTzq','BM8TAw1WBgLJAxqTyw55','CMvZDwX0CW','AZHZ','mta0nJe5mtbqA3fXtg0','lMPZB24','y3DL','EwfTBgXPBNq','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','iIaTlwzYyw1LD29YAYa','DhnJB25MAwCUANnVBG','BwfW','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','DhjPBq','Ew91CI1RzxKTAgvYzq','y2HLy2TVDIaTzIaI','zw52lxzHBgLKyxrVCG','EwfTBgXPBNqGBM90igf2ywLSywjSzq','lNLTBa','DMfSAwrHDgvzqu1m','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','Bgv2zwW','AgLNAa','BwLZC2LUz1bYB3bLCNr5','zg9JA2vYzMLSzq','ntmYmtK4mw9XBNzmyW','C3rYAwn0','C2vJDxjPDhK','zxjYB3jZ','CgfYC2vdAgvJA292uMvZDwX0CW','BwfWsgfKB2XPBNrtzxzLCML0Eq','zgvIDwC','CgfYC2u','CgfJA2fNzs5QC29U','zg9JA2vYlwnVBxbVC2u','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','zMLSzv9SAw5Lx3jHBMDL','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','C3rYAwn0lw1Vzgu','C2nHBM5LCKnHy2HL','y29TBw9UANm','ody3nNDdAhLrAW','AgfKB2XPBNqGBM90igf2ywLSywjSzq','y2HLy2TFAwq','BwvZC2fNzq','nuPxENnbvW','CMvHzezPBgu','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','u0vwrvjjvfK','zgvMyxvSDa','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','lNrMDMfYCW','CgfYC2vzyw1SBgLUDfjLC3vSDhm','DhnJB25MAwCTDMfSAwrHDg9Y','nMPwwMTiDW'];a0_0x56a5=function(){return _0xe8b352;};return a0_0x56a5();}class ConfigValidator{constructor(_0x11f1a6=null){const _0x5b314b=a0_0x1677;this['logger']=_0x11f1a6,this[_0x5b314b(0x11c)]=null,this[_0x5b314b(0x157)]=new Map();}async[a0_0x549427(0xe7)](){const _0xe9befc=a0_0x549427;if(this['availableScanners']!==null)return this['availableScanners'];const _0x725a05={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0xe9befc(0xec),{'timeout':0x1388}),_0x725a05['checkov']=!![],this[_0xe9befc(0x119)]?.['debug']('checkov\x20detected');}catch(_0x36b391){this['logger']?.[_0xe9befc(0x14f)](_0xe9befc(0x153),{'error':_0x36b391['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x725a05[_0xe9befc(0x116)]=!![],this['logger']?.['debug']('hadolint\x20detected');}catch(_0x50c646){this['logger']?.['debug'](_0xe9befc(0x15a),{'error':_0x50c646['message']});}try{await execAsync(_0xe9befc(0x114),{'timeout':0x1388}),_0x725a05['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x79d8de){this['logger']?.['debug'](_0xe9befc(0x141),{'error':_0x79d8de[_0xe9befc(0xe1)]});}try{await import(_0xe9befc(0x104)),_0x725a05[_0xe9befc(0x129)]=!![],this['logger']?.[_0xe9befc(0x14f)](_0xe9befc(0x100));}catch(_0x1ec0f1){this[_0xe9befc(0x119)]?.['debug'](_0xe9befc(0xf6),{'error':_0x1ec0f1[_0xe9befc(0xe1)]});}return this[_0xe9befc(0x11c)]=_0x725a05,_0x725a05;}async['validate'](_0x4a6deb,_0x18d497={}){const _0x4ba762=a0_0x549427,_0x363b82=[],_0x262e03=await this[_0x4ba762(0xe7)](),_0x1d3727=this[_0x4ba762(0xff)](_0x4a6deb);this['logger']?.[_0x4ba762(0x14f)](_0x4ba762(0x122),{'filePath':_0x4a6deb,'fileType':_0x1d3727});switch(_0x1d3727){case'dockerfile':if(_0x262e03['hadolint']){const _0x59ecb1=await this[_0x4ba762(0x11e)](_0x4a6deb,_0x18d497);_0x363b82['push'](..._0x59ecb1);}if(_0x262e03[_0x4ba762(0x12d)]){const _0x5612af=await this['validateWithCheckov'](_0x4a6deb,'dockerfile',_0x18d497);_0x363b82['push'](..._0x5612af);}break;case _0x4ba762(0x152):if(_0x262e03[_0x4ba762(0x136)]){const _0x2320e9=await this[_0x4ba762(0x143)](_0x4a6deb,_0x18d497);_0x363b82[_0x4ba762(0x10c)](..._0x2320e9);}if(_0x262e03[_0x4ba762(0x12d)]){const _0xd0e798=await this[_0x4ba762(0x12e)](_0x4a6deb,'docker_compose',_0x18d497);_0x363b82['push'](..._0xd0e798);}break;case _0x4ba762(0xee):if(_0x262e03[_0x4ba762(0x136)]){const _0x15bda1=await this['validateYAML'](_0x4a6deb,_0x18d497);_0x363b82['push'](..._0x15bda1);}if(_0x262e03['checkov']){const _0x18b5c1=await this['validateWithCheckov'](_0x4a6deb,'kubernetes',_0x18d497);_0x363b82[_0x4ba762(0x10c)](..._0x18b5c1);}break;case'terraform':if(_0x262e03['checkov']){const _0x20034f=await this['validateWithCheckov'](_0x4a6deb,'terraform',_0x18d497);_0x363b82['push'](..._0x20034f);}break;case'package.json':if(_0x262e03[_0x4ba762(0x129)]){const _0x391af2=await this['validatePackageJson'](_0x4a6deb,_0x18d497);_0x363b82['push'](..._0x391af2);}break;case _0x4ba762(0x139):if(_0x262e03[_0x4ba762(0x129)]){const _0x4f0a79=await this['validateTsConfig'](_0x4a6deb,_0x18d497);_0x363b82[_0x4ba762(0x10c)](..._0x4f0a79);}break;case'github-actions':if(_0x262e03['yamllint']){const _0xe7615c=await this['validateYAML'](_0x4a6deb,_0x18d497);_0x363b82[_0x4ba762(0x10c)](..._0xe7615c);}break;case _0x4ba762(0x103):const _0x50c5fd=await this['validateEnvFile'](_0x4a6deb,_0x18d497);_0x363b82['push'](..._0x50c5fd);break;case'yaml':if(_0x262e03[_0x4ba762(0x136)]){const _0x597aa1=await this['validateYAML'](_0x4a6deb,_0x18d497);_0x363b82['push'](..._0x597aa1);}break;default:this['logger']?.['warn']('Unknown\x20config\x20file\x20type',{'filePath':_0x4a6deb,'fileType':_0x1d3727});return[];}return this[_0x4ba762(0x118)](_0x363b82);}async['validateDockerfile'](_0x226278,_0x45c464={}){const _0x591249=a0_0x549427;try{const _0x34afaf=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x226278+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x4a715b=JSON[_0x591249(0x150)](_0x34afaf['stdout']);return this[_0x591249(0x126)](_0x4a715b,_0x226278);}catch(_0x4f7ff6){if(_0x4f7ff6['stdout'])try{const _0x638abf=JSON['parse'](_0x4f7ff6[_0x591249(0xef)]);return this[_0x591249(0x126)](_0x638abf,_0x226278);}catch(_0x4aaaa3){this[_0x591249(0x119)]?.['error']('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x4aaaa3['message']});}return this['logger']?.[_0x591249(0xf2)]('hadolint\x20validation\x20failed',{'error':_0x4f7ff6[_0x591249(0xe1)]}),[];}}['parseHadolintResults'](_0x3a8b13,_0x4d7a0a){const _0x6d3f4d=a0_0x549427,_0x3a4141=[];if(Array['isArray'](_0x3a8b13))for(const _0x271e5f of _0x3a8b13){_0x3a4141['push']({'file':_0x4d7a0a,'line':_0x271e5f['line']||0x1,'column':_0x271e5f[_0x6d3f4d(0xf3)]||0x1,'severity':this['mapHadolintSeverity'](_0x271e5f[_0x6d3f4d(0x145)]),'rule':_0x271e5f[_0x6d3f4d(0xed)],'message':_0x271e5f['message'],'category':_0x6d3f4d(0x148),'validator':_0x6d3f4d(0x116)});}return _0x3a4141;}async[a0_0x549427(0x143)](_0x5cc01d,_0x24ccf4={}){const _0x2fe4c3=a0_0x549427;try{const _0x418151=await execAsync(_0x2fe4c3(0x11b)+_0x5cc01d+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x2fe4c3(0xe9)](_0x418151[_0x2fe4c3(0xef)],_0x5cc01d);}catch(_0x1994b6){if(_0x1994b6['stdout'])return this['parseYamllintResults'](_0x1994b6['stdout'],_0x5cc01d);return this['logger']?.['error']('yamllint\x20validation\x20failed',{'error':_0x1994b6[_0x2fe4c3(0xe1)]}),[];}}['parseYamllintResults'](_0x51d56f,_0x565bbc){const _0x554311=a0_0x549427,_0x5e201f=[],_0x13329e=_0x51d56f['split']('\x0a')[_0x554311(0xf9)](_0x4dd2a9=>_0x4dd2a9[_0x554311(0x13d)]());for(const _0x1d1df9 of _0x13329e){const _0x2f689f=_0x1d1df9['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x2f689f){const [,_0x5297b5,_0x5e1195,_0x2a6aec,_0x3a09f6,_0xcad7c8,_0xab4f9c]=_0x2f689f;_0x5e201f['push']({'file':_0x565bbc,'line':parseInt(_0x5e1195,0xa),'column':parseInt(_0x2a6aec,0xa),'severity':this['mapYamllintSeverity'](_0x3a09f6),'rule':_0xab4f9c,'message':_0xcad7c8,'category':_0x554311(0x117),'validator':_0x554311(0x136)});}}return _0x5e201f;}async['validateWithCheckov'](_0x343831,_0x59f66a,_0x1c5808={}){const _0x29adde=a0_0x549427;try{const _0x94cfdc=await execAsync(_0x29adde(0x13f)+_0x343831+_0x29adde(0x138)+_0x59f66a+_0x29adde(0x123),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x32b397=JSON['parse'](_0x94cfdc['stdout']);return this[_0x29adde(0x14d)](_0x32b397,_0x343831);}catch(_0x193bb9){if(_0x193bb9['stdout'])try{const _0x539ebc=JSON['parse'](_0x193bb9[_0x29adde(0xef)]);return this[_0x29adde(0x14d)](_0x539ebc,_0x343831);}catch(_0x17765c){this[_0x29adde(0x119)]?.['error']('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x17765c['message']});}return this['logger']?.[_0x29adde(0xf2)]('checkov\x20validation\x20failed',{'error':_0x193bb9['message']}),[];}}[a0_0x549427(0x14d)](_0x1a90be,_0x222099){const _0x53a42d=a0_0x549427,_0xc9a6c9=[];if(_0x1a90be[_0x53a42d(0x131)]&&_0x1a90be[_0x53a42d(0x131)][_0x53a42d(0x105)])for(const _0x361709 of _0x1a90be[_0x53a42d(0x131)]['failed_checks']){_0xc9a6c9[_0x53a42d(0x10c)]({'file':_0x222099,'line':_0x361709[_0x53a42d(0x154)]?_0x361709[_0x53a42d(0x154)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x361709['check_class']),'rule':_0x361709[_0x53a42d(0x15b)],'message':_0x361709['check_name']||_0x361709[_0x53a42d(0x15b)],'category':_0x53a42d(0x14b),'validator':_0x53a42d(0x12d),'remediation':_0x361709['guideline'],'cwe':_0x361709[_0x53a42d(0x135)],'references':_0x361709[_0x53a42d(0x10a)]?[_0x361709[_0x53a42d(0x10a)]]:[]});}return _0xc9a6c9;}async['validatePackageJson'](_0x694ed2,_0x1a4f5d={}){const _0x4debeb=a0_0x549427;try{const _0x12b27d=(await import('ajv'))['default'],_0x19e4e6=(await import(_0x4debeb(0x11a)))[_0x4debeb(0xe6)],_0x464d6c=await a0_0x4293d8['readFile'](_0x694ed2,'utf-8'),_0x3b48d6=JSON[_0x4debeb(0x150)](_0x464d6c),_0x4ba8be=new _0x12b27d({'allErrors':!![],'strict':![]});_0x19e4e6(_0x4ba8be);const _0x3696ab={'type':'object','required':[_0x4debeb(0xf7),_0x4debeb(0xfd)],'properties':{'name':{'type':'string','pattern':_0x4debeb(0xf8)},'version':{'type':_0x4debeb(0x106)},'description':{'type':_0x4debeb(0x106)},'main':{'type':_0x4debeb(0x106)},'type':{'type':'string','enum':['module',_0x4debeb(0x158)]},'scripts':{'type':'object'},'dependencies':{'type':_0x4debeb(0x102)},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0x21eeeb=_0x4ba8be['compile'](_0x3696ab),_0xfd3b28=_0x21eeeb(_0x3b48d6);if(!_0xfd3b28&&_0x21eeeb[_0x4debeb(0x14c)])return _0x21eeeb['errors']['map'](_0x34ee18=>({'file':_0x694ed2,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x4debeb(0x113)],'rule':'json-schema','message':_0x34ee18[_0x4debeb(0x121)]?_0x34ee18['instancePath']+'\x20'+_0x34ee18[_0x4debeb(0xe1)]:_0x4debeb(0x144)+_0x34ee18['params'][_0x4debeb(0x147)]+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x4fc2ca){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x4fc2ca[_0x4debeb(0xe1)]}),[{'file':_0x694ed2,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x4debeb(0x12a),'message':_0x4debeb(0x108)+_0x4fc2ca[_0x4debeb(0xe1)],'category':_0x4debeb(0x11f),'validator':'json-parse'}];}}async['validateTsConfig'](_0x22e24e,_0x34c2dd={}){const _0x18732c=a0_0x549427;try{const _0x514c90=await a0_0x4293d8[_0x18732c(0xe3)](_0x22e24e,'utf-8'),_0x38ec09=JSON[_0x18732c(0x150)](_0x514c90),_0x114a8f=[];if(_0x38ec09['compilerOptions']){const _0x244670=_0x38ec09['compilerOptions'];!_0x244670[_0x18732c(0x14a)]&&_0x114a8f['push']({'file':_0x22e24e,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x18732c(0x156),'message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'}),_0x244670[_0x18732c(0x10e)]===![]&&_0x114a8f[_0x18732c(0x10c)]({'file':_0x22e24e,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x18732c(0xe5)]['WARNING'],'rule':_0x18732c(0x130),'message':_0x18732c(0xe4),'category':_0x18732c(0xf1),'validator':_0x18732c(0xea)});}return _0x114a8f;}catch(_0x351672){return this['logger']?.[_0x18732c(0xf2)]('tsconfig.json\x20validation\x20failed',{'error':_0x351672[_0x18732c(0xe1)]}),[{'file':_0x22e24e,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x18732c(0xe5)]['ERROR'],'rule':'json-parse','message':_0x18732c(0x108)+_0x351672[_0x18732c(0xe1)],'category':_0x18732c(0x11f),'validator':_0x18732c(0x12a)}];}}async['validateEnvFile'](_0x477ddb,_0x1e69ce={}){const _0x1e999e=a0_0x549427;try{const _0x5ae706=await a0_0x4293d8['readFile'](_0x477ddb,'utf-8'),_0x4689a6=[],_0x309aa1=_0x5ae706[_0x1e999e(0xfe)]('\x0a'),_0x504677=[{'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':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x1e999e(0x12c)}];return _0x309aa1['forEach']((_0x1908c4,_0x4efde8)=>{const _0x477fa6=_0x1e999e,_0x1c98ae=_0x1908c4['trim']();if(!_0x1c98ae||_0x1c98ae['startsWith']('#'))return;if(_0x1c98ae[_0x477fa6(0x101)]('=')){const [_0xa003e8,_0x3d90ae]=_0x1c98ae[_0x477fa6(0xfe)]('='),_0xc67577=_0xa003e8[_0x477fa6(0xfa)](),_0x11cc87=_0x3d90ae?.['trim']()||'',_0x23df47=_0x11cc87&&_0x11cc87!==''&&!_0x11cc87['startsWith']('$')&&_0x11cc87!==_0x477fa6(0x13e)&&_0x11cc87!==_0x477fa6(0x107)&&_0x11cc87['length']>0x5;if(_0x23df47)for(const {pattern:_0x5a2cfd,name:_0x43aaab}of _0x504677){if(_0x5a2cfd['test'](_0xc67577)){_0x4689a6['push']({'file':_0x477ddb,'line':_0x4efde8+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'rule':'hardcoded-secret','message':_0x477fa6(0x11d)+_0x43aaab+'\x20detected\x20in\x20.env\x20file','category':'security','validator':_0x477fa6(0x140),'remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x4689a6;}catch(_0x549757){return this[_0x1e999e(0x119)]?.['error']('.env\x20validation\x20failed',{'error':_0x549757[_0x1e999e(0xe1)]}),[];}}[a0_0x549427(0xff)](_0x4e01b8){const _0x49e30c=a0_0x549427,_0x4febc0=a0_0x8c5ef9['basename'](_0x4e01b8)['toLowerCase'](),_0x38b71d=a0_0x8c5ef9[_0x49e30c(0x127)](_0x4e01b8);if(_0x4febc0==='dockerfile')return _0x49e30c(0x148);if(_0x4febc0===_0x49e30c(0xf0)||_0x4febc0===_0x49e30c(0xf4))return _0x49e30c(0x152);if(_0x4febc0==='package.json')return _0x49e30c(0x151);if(_0x4febc0===_0x49e30c(0x139))return'tsconfig.json';if(_0x4febc0==='.env'||_0x4febc0['endsWith']('.env'))return'env';if(_0x38b71d['includes']('.github/workflows'))return'github-actions';if(_0x38b71d['includes']('kubernetes')||_0x38b71d[_0x49e30c(0x101)](_0x49e30c(0x132)))return'kubernetes';const _0x9ce9c2=a0_0x8c5ef9[_0x49e30c(0x12f)](_0x4e01b8)[_0x49e30c(0xfa)]();if(_0x9ce9c2==='.tf'||_0x9ce9c2===_0x49e30c(0xe8))return'terraform';if(_0x9ce9c2===_0x49e30c(0x142)||_0x9ce9c2==='.yaml')return'yaml';if(_0x9ce9c2===_0x49e30c(0x134))return'json';return _0x49e30c(0x10d);}[a0_0x549427(0x118)](_0x427fa8){const _0x1d4a20=a0_0x549427;return _0x427fa8[_0x1d4a20(0x13a)](_0xe38bb7=>({'file':_0xe38bb7['file'],'line':_0xe38bb7['line']||0x1,'column':_0xe38bb7[_0x1d4a20(0xf3)]||0x1,'severity':_0xe38bb7[_0x1d4a20(0x112)]||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0xe38bb7['rule']||'unknown','message':_0xe38bb7[_0x1d4a20(0xe1)]||'Validation\x20issue\x20detected','category':_0xe38bb7[_0x1d4a20(0x111)]||_0x1d4a20(0x128),'validator':_0xe38bb7['validator'],'cwe':_0xe38bb7[_0x1d4a20(0x135)]||null,'remediation':_0xe38bb7['remediation']||null,'references':_0xe38bb7[_0x1d4a20(0xfb)]||[]}));}[a0_0x549427(0x14e)](_0x46d042){const _0x502f2c=a0_0x549427,_0x2b3c8b={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x502f2c(0xe5)][_0x502f2c(0x12b)],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS['SEVERITY'][_0x502f2c(0x125)]};return _0x2b3c8b[_0x46d042?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x502f2c(0x12b)];}['mapYamllintSeverity'](_0x208293){const _0x2bea01=a0_0x549427,_0x16a7d7={'error':STATIC_ANALYSIS[_0x2bea01(0xe5)]['ERROR'],'warning':STATIC_ANALYSIS[_0x2bea01(0xe5)][_0x2bea01(0x12b)]};return _0x16a7d7[_0x208293?.['toLowerCase']()]||STATIC_ANALYSIS[_0x2bea01(0xe5)][_0x2bea01(0x12b)];}['mapCheckovSeverity'](_0x556b0f){const _0x1e523d=a0_0x549427;return STATIC_ANALYSIS[_0x1e523d(0xe5)]['ERROR'];}async[a0_0x549427(0x120)](){const _0x4a4da2=a0_0x549427,_0x2570c7=await this[_0x4a4da2(0xe7)]();return{'validators':_0x2570c7,'recommendations':this[_0x4a4da2(0x13b)](_0x2570c7)};}[a0_0x549427(0x13b)](_0x5b12bb){const _0x2cb340=a0_0x549427,_0x214468=[];return!_0x5b12bb['checkov']&&_0x214468[_0x2cb340(0x10c)]({'validator':_0x2cb340(0x12d),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':'pip\x20install\x20checkov','priority':'high'}),!_0x5b12bb[_0x2cb340(0x116)]&&_0x214468[_0x2cb340(0x10c)]({'validator':'hadolint','reason':_0x2cb340(0x137),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':_0x2cb340(0x146)}),!_0x5b12bb['yamllint']&&_0x214468['push']({'validator':_0x2cb340(0x136),'reason':'YAML\x20file\x20validation','install':_0x2cb340(0x110),'priority':_0x2cb340(0x109)}),!_0x5b12bb[_0x2cb340(0x129)]&&_0x214468[_0x2cb340(0x10c)]({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x2cb340(0x13c),'install':_0x2cb340(0x155),'priority':'medium'}),_0x214468;}}export default ConfigValidator;