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

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 (148) hide show
  1. package/README.md +7 -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
  147. package/web-ui/build/index.html +1 -1
  148. package/web-ui/build/static/{index-BoJVEi2s.js → index-DZSa_5Fn.js} +105 -105
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.2
101
+ # Should display: Loxia Autopilot One v2.0.6
102
102
  ```
103
103
 
104
104
  ### 4. Create an API Key
@@ -297,14 +297,16 @@ Loxia comes with 18+ specialized tools that agents can use autonomously:
297
297
 
298
298
  ## Roadmap
299
299
 
300
- ### Current Version (2.0.2)
300
+ ### Current Version (2.0.6)
301
301
 
302
- - Compaction system rewrite: response-data-based token counting, multi-pass summarization
303
- - SSE stream parser fix for token usage tracking
304
- - Compaction UI indicator auto-cleanup
302
+ - Tool path sync: terminal `cd` now propagates to all tools (filesystem, seek, pdf, etc.)
303
+ - Streaming performance: chunk batching, incremental parser, reduced overscan
304
+ - WebSocket log suppression for high-frequency stream chunks
305
+ - Agent system prompt: tool result availability guidance for dependent vs independent calls
305
306
 
306
307
  ### Previous Versions
307
308
 
309
+ - v2.0.2: Compaction system rewrite, SSE stream parser fix, token usage tracking
308
310
  - v2.0.0: System port protection, UI responsiveness fixes, model error handling
309
311
  - v1.9.x: Port registry fix, startup timeout fix, agent creation UX, flow agent visibility
310
312
  - v1.8.0: Teams, agent duplication, flow execution, awaiting user input scheduling
package/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x28fff5=a0_0x121f;(function(_0x1ba806,_0x4fc59d){const _0x5b2c14=a0_0x121f,_0x494198=_0x1ba806();while(!![]){try{const _0x535985=parseInt(_0x5b2c14(0xff))/0x1+parseInt(_0x5b2c14(0xfb))/0x2+-parseInt(_0x5b2c14(0xdc))/0x3+-parseInt(_0x5b2c14(0xeb))/0x4+parseInt(_0x5b2c14(0xf5))/0x5*(parseInt(_0x5b2c14(0x100))/0x6)+parseInt(_0x5b2c14(0xcc))/0x7+-parseInt(_0x5b2c14(0xd6))/0x8*(parseInt(_0x5b2c14(0xe2))/0x9);if(_0x535985===_0x4fc59d)break;else _0x494198['push'](_0x494198['shift']());}catch(_0x55d31e){_0x494198['push'](_0x494198['shift']());}}}(a0_0xeed5,0x64621));import{fileURLToPath}from'url';function a0_0x121f(_0x4e925c,_0x5c0f9e){_0x4e925c=_0x4e925c-0xc2;const _0xeed5a2=a0_0xeed5();let _0x121f46=_0xeed5a2[_0x4e925c];return _0x121f46;}function a0_0xeed5(){const _0x496e54=['package.json','unref','src','LOXIA_HOST',')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only\x20(headless)\x0a\x20\x20loxia\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Connect\x20Terminal\x20UI\x20to\x20running\x20server\x0a\x20\x20loxia\x20plus-terminal\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a\x20\x20loxia\x20web\x20--port\x203000\x20\x20\x20\x20#\x20Use\x20specific\x20port\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Run\x20\x27loxia\x20web\x27\x20to\x20start\x20with\x20Web\x20UI\x0a\x20\x202.\x20Or\x20run\x20\x27loxia\x20plus-terminal\x27\x20for\x20Terminal\x20UI\x20experience\x0a\x20\x203.\x20Or\x20run\x20\x27loxia\x20serve\x27\x20for\x20headless\x20server\x20(connect\x20remotely)\x0a\x0aNote:\x20If\x20no\x20port\x20is\x20specified,\x20the\x20server\x20will\x20automatically\x20find\x0aan\x20available\x20port.\x20The\x20Terminal\x20UI\x20will\x20discover\x20the\x20server\x20port\x0aautomatically\x20from\x20the\x20port\x20registry.\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a','\x0a✓\x20Server\x20running\x20at\x20','Unknown\x20command:\x20','loxia-terminal.js','statusCode','length','includes','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','web','kill','index.js',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','Error:','\x20-\x20AI\x20Agent\x20System\x0a\x0aUsage:\x0a\x20\x20loxia\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20+\x20open\x20Web\x20UI\x20in\x20browser\x0a\x20\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20only\x20(no\x20UI\x20opened)\x0a\x20\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20Start\x20Terminal\x20UI\x20(server\x20must\x20be\x20running)\x0a\x20\x20plus-web\x20\x20\x20\x20\x20\x20\x20\x20Alias\x20for\x20\x27web\x27\x0a\x20\x20plus-terminal\x20\x20\x20Start\x20server\x20+\x20Terminal\x20UI\x20together\x0a\x0aOptions:\x0a\x20\x20--port\x20<number>\x20\x20\x20Specify\x20port\x20(default:\x20auto-select\x20starting\x20from\x20','4165665DUQVsh','Server\x20discovered\x20at\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','argv','destroy','log','ignore','\x20but\x20not\x20responding.','\x0aLoxia\x20Autopilot\x20One\x20v','127.0.0.1','16fIcKTc','inherit','\x0aServer\x20registered\x20at\x20','darwin','\x0aPlease\x20start\x20the\x20server\x20first:','node','494469DRsRbP','SIGINT','now','startsWith','cmd','http://','3597138CHaqMo','SIGTERM','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','ceil','platform','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','--version','get','Server\x20running\x20at\x20http://','240308HHLpJY','version','PORT','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','Loxia\x20Autopilot\x20One\x20v','error','win32','exit','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','host','1128995UghUIh','start','xdg-open','utf8','localhost','/api/health','47788ctVtDc','\x0aShutting\x20down\x20server...','backend','port','590645YOLQak','6WOnrvZ','Waiting\x20for\x20server\x20to\x20start...','cleanupStaleEntries','--help','message','\x20\x20API\x20Health:\x20\x20\x20','--port','toString','slice','Looking\x20for\x20running\x20server...','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','Starting\x20Loxia\x20server...\x0a','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','Starting\x20Terminal\x20UI...\x0a','getService','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','pid'];a0_0xeed5=function(){return _0x496e54;};return a0_0xeed5();}import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x398be7 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x28fff5(0xd5),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x28fff5(0xcf)][a0_0x28fff5(0x108)](0x2),command=args[0x0]&&!args[0x0][a0_0x28fff5(0xdf)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x28fff5(0xc4)](a0_0x28fff5(0x103))||args['includes']('-h'),'version':args['includes'](a0_0x28fff5(0xe8))||args[a0_0x28fff5(0xc4)]('-v')};for(let i=0x0;i<args[a0_0x28fff5(0xc3)];i++){args[i]===a0_0x28fff5(0x106)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]==='--host'&&args[i+0x1]&&(flags[a0_0x28fff5(0xf4)]=args[i+0x1]);}const explicitPort=flags[a0_0x28fff5(0xfe)],host=flags[a0_0x28fff5(0xf4)]||DEFAULT_HOST;if(flags[a0_0x28fff5(0xec)]){const pkgPath=join(__dirname,'..',a0_0x28fff5(0x111)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x28fff5(0xf8)));console[a0_0x28fff5(0xd1)](a0_0x28fff5(0xef)+pkg[a0_0x28fff5(0xec)]),process['exit'](0x0);}if(flags['help']||!command){const pkgPath=join(__dirname,'..',a0_0x28fff5(0x111)),pkg=JSON['parse'](readFileSync(pkgPath,'utf8'));console[a0_0x28fff5(0xd1)](a0_0x28fff5(0xd4)+pkg[a0_0x28fff5(0xec)]+a0_0x28fff5(0xcb)+DEFAULT_PORT+a0_0x28fff5(0xc9)+DEFAULT_HOST+a0_0x28fff5(0x115)),process[a0_0x28fff5(0xf2)](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x314863}=await import('../src/services/portRegistry.js');return _0x314863();}async function discoverBackend(){const _0x3921f9=a0_0x28fff5;try{const _0x34391d=await getPortRegistry();await _0x34391d[_0x3921f9(0x102)]();const _0x51a924=await _0x34391d[_0x3921f9(0x10e)](_0x3921f9(0xfd));if(_0x51a924)return{'host':_0x51a924[_0x3921f9(0xf4)]||_0x3921f9(0xf9),'port':_0x51a924[_0x3921f9(0xfe)],'pid':_0x51a924[_0x3921f9(0x110)]};return null;}catch(_0x2b0cc4){return null;}}async function checkServerRunning(_0x58eb84,_0x41c8cc,_0x1273c4=0x1){for(let _0x4935a4=0x0;_0x4935a4<_0x1273c4;_0x4935a4++){const _0x39587d=await new Promise(_0x53de52=>{const _0x43fd84=a0_0x121f,_0x37ac1b=a0_0x398be7[_0x43fd84(0xe9)]('http://'+_0x58eb84+':'+_0x41c8cc+_0x43fd84(0xfa),_0x48d178=>{const _0x49313c=_0x43fd84;_0x53de52(_0x48d178[_0x49313c(0xc2)]===0xc8);});_0x37ac1b['on'](_0x43fd84(0xf0),()=>_0x53de52(![])),_0x37ac1b['setTimeout'](0x7d0,()=>{const _0x7fd836=_0x43fd84;_0x37ac1b[_0x7fd836(0xd0)](),_0x53de52(![]);});});if(_0x39587d)return!![];_0x4935a4<_0x1273c4-0x1&&await new Promise(_0x5a91b4=>setTimeout(_0x5a91b4,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x19f1a1=SERVER_STARTUP_TIMEOUT){const _0x2bb70e=a0_0x28fff5,_0x262682=Date['now']();while(Date[_0x2bb70e(0xde)]()-_0x262682<_0x19f1a1){const _0x51f540=await discoverBackend();if(_0x51f540){const _0x17a27b=await checkServerRunning(_0x51f540[_0x2bb70e(0xf4)],_0x51f540[_0x2bb70e(0xfe)]);if(_0x17a27b)return _0x51f540;}await new Promise(_0x5592f9=>setTimeout(_0x5592f9,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x21134e,_0x2a5f75,_0x384ae4=SERVER_STARTUP_TIMEOUT){const _0x2737a3=a0_0x28fff5,_0x41191f=Math[_0x2737a3(0xe5)](_0x384ae4/SERVER_CHECK_INTERVAL),_0x2a4221=await checkServerRunning(_0x21134e,_0x2a5f75,_0x41191f);return _0x2a4221?{'host':_0x21134e,'port':_0x2a5f75}:null;}function openBrowser(_0x193cb2){const _0x4d12a4=a0_0x28fff5;let _0x5eab38,_0x1db5e0;if(process['platform']===_0x4d12a4(0xd9))_0x5eab38='open',_0x1db5e0=[_0x193cb2];else process[_0x4d12a4(0xe6)]===_0x4d12a4(0xf1)?(_0x5eab38=_0x4d12a4(0xe0),_0x1db5e0=['/c',_0x4d12a4(0xf6),'\x22\x22',_0x193cb2]):(_0x5eab38=_0x4d12a4(0xf7),_0x1db5e0=[_0x193cb2]);const _0x574471=spawn(_0x5eab38,_0x1db5e0,{'detached':!![],'stdio':'ignore'});_0x574471[_0x4d12a4(0x112)](),_0x574471['on'](_0x4d12a4(0xf0),()=>{const _0x4cd4ac=_0x4d12a4;console[_0x4cd4ac(0xd1)]('Could\x20not\x20open\x20browser\x20automatically.'),console[_0x4cd4ac(0xd1)]('Please\x20open\x20manually:\x20'+_0x193cb2);});}function startServer(_0x13fbde=![]){const _0x1a1f2c=a0_0x28fff5,_0x24ec26={...process.env};explicitPort&&(_0x24ec26['LOXIA_PORT']=explicitPort[_0x1a1f2c(0x107)](),_0x24ec26[_0x1a1f2c(0xed)]=explicitPort['toString']());flags['host']&&(_0x24ec26[_0x1a1f2c(0x114)]=flags[_0x1a1f2c(0xf4)]);const _0x471a07=join(__dirname,'..',_0x1a1f2c(0x113),_0x1a1f2c(0xc8)),_0x4866fa=spawn(_0x1a1f2c(0xdb),[_0x471a07],{'cwd':join(__dirname,'..'),'env':_0x24ec26,'stdio':_0x13fbde?[_0x1a1f2c(0xd2),'ignore',_0x1a1f2c(0xd2)]:_0x1a1f2c(0xd7),'detached':_0x13fbde});return _0x13fbde&&_0x4866fa[_0x1a1f2c(0x112)](),_0x4866fa;}function startTerminalUIProcess(_0x22a3c2,_0x3510c9){const _0x37277a=a0_0x28fff5,_0x5ea08b=join(__dirname,_0x37277a(0x118)),_0x4887f3={...process.env,'LOXIA_PORT':_0x3510c9[_0x37277a(0x107)](),'LOXIA_HOST':_0x22a3c2},_0x914ce=spawn(_0x37277a(0xdb),[_0x5ea08b],{'cwd':join(__dirname,'..'),'env':_0x4887f3,'stdio':_0x37277a(0xd7)});return _0x914ce;}const commands={'web':async()=>{const _0x5003d2=a0_0x28fff5;console[_0x5003d2(0xd1)](_0x5003d2(0x10b));const _0x18b385=startServer(![]);console[_0x5003d2(0xd1)]('Waiting\x20for\x20server\x20to\x20start...');let _0x9b3df4;explicitPort?_0x9b3df4=await waitForServerAtPort(host,explicitPort):_0x9b3df4=await waitForServerWithDiscovery();if(_0x9b3df4){const _0x36622c=_0x5003d2(0xe1)+_0x9b3df4[_0x5003d2(0xf4)]+':'+_0x9b3df4[_0x5003d2(0xfe)];console['log']('\x0aOpening\x20Web\x20UI\x20at\x20'+_0x36622c),openBrowser(_0x36622c);}else console['log']('\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.');process['on'](_0x5003d2(0xdd),()=>_0x18b385[_0x5003d2(0xc7)](_0x5003d2(0xdd))),process['on'](_0x5003d2(0xe3),()=>_0x18b385[_0x5003d2(0xc7)](_0x5003d2(0xe3))),_0x18b385['on'](_0x5003d2(0xf2),_0x55b532=>process[_0x5003d2(0xf2)](_0x55b532||0x0));},'plus-web':async()=>{const _0x5d9982=a0_0x28fff5;await commands[_0x5d9982(0xc6)]();},'serve':async()=>{const _0x435396=a0_0x28fff5;console[_0x435396(0xd1)](_0x435396(0x10b));const _0x15b9f7=startServer(![]);console[_0x435396(0xd1)](_0x435396(0x101));let _0x504923;explicitPort?_0x504923=await waitForServerAtPort(host,explicitPort):_0x504923=await waitForServerWithDiscovery();if(_0x504923){const _0x30d4a0='http://'+_0x504923['host']+':'+_0x504923[_0x435396(0xfe)];console[_0x435396(0xd1)](_0x435396(0x116)+_0x30d4a0),console['log']('\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'+_0x30d4a0),console[_0x435396(0xd1)](_0x435396(0x10f)),console['log'](_0x435396(0x105)+_0x30d4a0+'/api/health\x0a');}else console['log'](_0x435396(0xe4)),console[_0x435396(0xd1)]('Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.');process['on']('SIGINT',()=>_0x15b9f7[_0x435396(0xc7)](_0x435396(0xdd))),process['on'](_0x435396(0xe3),()=>_0x15b9f7[_0x435396(0xc7)](_0x435396(0xe3))),_0x15b9f7['on'](_0x435396(0xf2),_0x564667=>process['exit'](_0x564667||0x0));},'terminal':async()=>{const _0xd18747=a0_0x28fff5;console[_0xd18747(0xd1)](_0xd18747(0x109));let _0x36b9eb=await discoverBackend();explicitPort&&(_0x36b9eb={'host':host,'port':explicitPort});!_0x36b9eb&&(console['error'](_0xd18747(0xc5)),console['error'](_0xd18747(0xda)),console['error'](_0xd18747(0xee)),console[_0xd18747(0xf0)](_0xd18747(0xe7)),console['error'](_0xd18747(0x10a)),process[_0xd18747(0xf2)](0x1));const _0x2fdc3d=await checkServerRunning(_0x36b9eb[_0xd18747(0xf4)],_0x36b9eb[_0xd18747(0xfe)]);!_0x2fdc3d&&(console[_0xd18747(0xf0)](_0xd18747(0xd8)+_0x36b9eb[_0xd18747(0xf4)]+':'+_0x36b9eb[_0xd18747(0xfe)]+_0xd18747(0xd3)),console['error'](_0xd18747(0x10c)),process['exit'](0x1));console['log'](_0xd18747(0xcd)+_0x36b9eb[_0xd18747(0xf4)]+':'+_0x36b9eb[_0xd18747(0xfe)]),console[_0xd18747(0xd1)](_0xd18747(0x10d));const _0x39b13d=startTerminalUIProcess(_0x36b9eb['host'],_0x36b9eb[_0xd18747(0xfe)]);process['on'](_0xd18747(0xdd),()=>_0x39b13d[_0xd18747(0xc7)](_0xd18747(0xdd))),process['on'](_0xd18747(0xe3),()=>_0x39b13d[_0xd18747(0xc7)](_0xd18747(0xe3))),_0x39b13d['on'](_0xd18747(0xf2),_0x561973=>process[_0xd18747(0xf2)](_0x561973||0x0));},'plus-terminal':async()=>{const _0x56481a=a0_0x28fff5;console[_0x56481a(0xd1)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x5358c4=startServer(!![]);let _0x35b7fc;explicitPort?_0x35b7fc=await waitForServerAtPort(host,explicitPort):_0x35b7fc=await waitForServerWithDiscovery();!_0x35b7fc&&(console['error'](_0x56481a(0xf3)),process['exit'](0x1));console[_0x56481a(0xd1)](_0x56481a(0xea)+_0x35b7fc[_0x56481a(0xf4)]+':'+_0x35b7fc[_0x56481a(0xfe)]),console['log'](_0x56481a(0x10d));const _0xb5c835=startTerminalUIProcess(_0x35b7fc[_0x56481a(0xf4)],_0x35b7fc[_0x56481a(0xfe)]);_0xb5c835['on'](_0x56481a(0xf2),_0x5f4024=>{const _0x3c9d4a=_0x56481a;console[_0x3c9d4a(0xd1)](_0x3c9d4a(0xfc));try{process[_0x3c9d4a(0xc7)](_0x5358c4[_0x3c9d4a(0x110)],'SIGTERM');}catch(_0x2a1e59){}process[_0x3c9d4a(0xf2)](_0x5f4024||0x0);}),process['on'](_0x56481a(0xdd),()=>{const _0x26b80e=_0x56481a;_0xb5c835[_0x26b80e(0xc7)](_0x26b80e(0xdd));}),process['on'](_0x56481a(0xe3),()=>{const _0x3b32d6=_0x56481a;_0xb5c835['kill'](_0x3b32d6(0xe3));});}};commands[command]?commands[command]()['catch'](_0x1becdf=>{const _0x59ddc1=a0_0x28fff5;console[_0x59ddc1(0xf0)](_0x59ddc1(0xca),_0x1becdf[_0x59ddc1(0x104)]),process[_0x59ddc1(0xf2)](0x1);}):(console[a0_0x28fff5(0xf0)](a0_0x28fff5(0x117)+command),console[a0_0x28fff5(0xf0)](a0_0x28fff5(0xce)),process['exit'](0x1));
3
+ const a0_0x347fbb=a0_0x382e;(function(_0x354f3f,_0x424502){const _0x1bc565=a0_0x382e,_0xcbead3=_0x354f3f();while(!![]){try{const _0x26b7ba=parseInt(_0x1bc565(0x194))/0x1+-parseInt(_0x1bc565(0x1a8))/0x2*(-parseInt(_0x1bc565(0x189))/0x3)+parseInt(_0x1bc565(0x195))/0x4+parseInt(_0x1bc565(0x18c))/0x5*(-parseInt(_0x1bc565(0x1ae))/0x6)+-parseInt(_0x1bc565(0x1af))/0x7+-parseInt(_0x1bc565(0x190))/0x8*(-parseInt(_0x1bc565(0x165))/0x9)+-parseInt(_0x1bc565(0x182))/0xa;if(_0x26b7ba===_0x424502)break;else _0xcbead3['push'](_0xcbead3['shift']());}catch(_0x34c3d8){_0xcbead3['push'](_0xcbead3['shift']());}}}(a0_0x5594,0x703d7));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x2df1ed from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x347fbb(0x187),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x347fbb(0x1ad)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x347fbb(0x184)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x347fbb(0x191)](a0_0x347fbb(0x160))||args[a0_0x347fbb(0x191)]('-h'),'version':args[a0_0x347fbb(0x191)]('--version')||args[a0_0x347fbb(0x191)]('-v')};for(let i=0x0;i<args[a0_0x347fbb(0x175)];i++){args[i]===a0_0x347fbb(0x192)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]==='--host'&&args[i+0x1]&&(flags[a0_0x347fbb(0x188)]=args[i+0x1]);}const explicitPort=flags['port'],host=flags[a0_0x347fbb(0x188)]||DEFAULT_HOST;if(flags[a0_0x347fbb(0x193)]){const pkgPath=join(__dirname,'..',a0_0x347fbb(0x196)),pkg=JSON[a0_0x347fbb(0x1ac)](readFileSync(pkgPath,a0_0x347fbb(0x173)));console['log'](a0_0x347fbb(0x18b)+pkg[a0_0x347fbb(0x193)]),process[a0_0x347fbb(0x1a5)](0x0);}if(flags[a0_0x347fbb(0x19d)]||!command){const pkgPath=join(__dirname,'..',a0_0x347fbb(0x196)),pkg=JSON[a0_0x347fbb(0x1ac)](readFileSync(pkgPath,a0_0x347fbb(0x173)));console['log'](a0_0x347fbb(0x1a3)+pkg[a0_0x347fbb(0x193)]+'\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+')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20'+DEFAULT_HOST+a0_0x347fbb(0x1ab)),process[a0_0x347fbb(0x1a5)](0x0);}async function getPortRegistry(){const _0x206f78=a0_0x347fbb,{getPortRegistry:_0x5a44d7}=await import(_0x206f78(0x171));return _0x5a44d7();}async function discoverBackend(){const _0x3e02b5=a0_0x347fbb;try{const _0x523776=await getPortRegistry();await _0x523776['cleanupStaleEntries']();const _0x3649c5=await _0x523776[_0x3e02b5(0x162)](_0x3e02b5(0x183));if(_0x3649c5)return{'host':_0x3649c5[_0x3e02b5(0x188)]||'localhost','port':_0x3649c5[_0x3e02b5(0x17b)],'pid':_0x3649c5['pid']};return null;}catch(_0x10454c){return null;}}function a0_0x5594(){const _0x11f782=['LOXIA_HOST','setTimeout','\x0aLoxia\x20Autopilot\x20One\x20v','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','exit','node','get','103546pNlXmM','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.',')\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','parse','argv','4206veoPHG','4989509dXupLB','message','Starting\x20Loxia\x20server\x20in\x20background...','catch','ignore','--help','ceil','getService','Please\x20open\x20manually:\x20','log','1341nsZwVB','http://','\x20\x20API\x20Health:\x20\x20\x20','error','\x0aOpening\x20Web\x20UI\x20at\x20','\x0a✓\x20Server\x20running\x20at\x20','Waiting\x20for\x20server\x20to\x20start...','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','cmd','SIGINT','Unknown\x20command:\x20','../src/services/portRegistry.js','\x0aServer\x20registered\x20at\x20','utf8','/api/health\x0a','length','\x0aShutting\x20down\x20server...','Server\x20running\x20at\x20http://','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','loxia-terminal.js','port','Could\x20not\x20open\x20browser\x20automatically.','\x0aPlease\x20start\x20the\x20server\x20first:','/api/health','xdg-open','destroy','index.js','11432450wuLVHo','backend','startsWith','PORT','platform','127.0.0.1','host','48hBhATe','kill','Loxia\x20Autopilot\x20One\x20v','1990tvwWYs','Error:','LOXIA_PORT','src','32136WUnKlO','includes','--port','version','624985sHZzNh','2171516xyJuhc','package.json','toString','Starting\x20Loxia\x20server...\x0a','SIGTERM','open','\x20but\x20not\x20responding.','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','help','now','unref','start'];a0_0x5594=function(){return _0x11f782;};return a0_0x5594();}async function checkServerRunning(_0x5337c9,_0x2bd2fd,_0x47e509=0x1){for(let _0x2a5a58=0x0;_0x2a5a58<_0x47e509;_0x2a5a58++){const _0x2f345d=await new Promise(_0x53490d=>{const _0x4d92f2=a0_0x382e,_0x469bcc=a0_0x2df1ed[_0x4d92f2(0x1a7)]('http://'+_0x5337c9+':'+_0x2bd2fd+_0x4d92f2(0x17e),_0x4e8690=>{_0x53490d(_0x4e8690['statusCode']===0xc8);});_0x469bcc['on'](_0x4d92f2(0x168),()=>_0x53490d(![])),_0x469bcc[_0x4d92f2(0x1a2)](0x7d0,()=>{const _0x3d8002=_0x4d92f2;_0x469bcc[_0x3d8002(0x180)](),_0x53490d(![]);});});if(_0x2f345d)return!![];_0x2a5a58<_0x47e509-0x1&&await new Promise(_0x5f9ba=>setTimeout(_0x5f9ba,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x3704b2=SERVER_STARTUP_TIMEOUT){const _0x69c3d5=a0_0x347fbb,_0x9efc61=Date[_0x69c3d5(0x19e)]();while(Date['now']()-_0x9efc61<_0x3704b2){const _0x1c35d7=await discoverBackend();if(_0x1c35d7){const _0x32573e=await checkServerRunning(_0x1c35d7['host'],_0x1c35d7[_0x69c3d5(0x17b)]);if(_0x32573e)return _0x1c35d7;}await new Promise(_0x257ad6=>setTimeout(_0x257ad6,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x1ddb5a,_0xf7df0b,_0x589f3a=SERVER_STARTUP_TIMEOUT){const _0x280067=a0_0x347fbb,_0xd469fd=Math[_0x280067(0x161)](_0x589f3a/SERVER_CHECK_INTERVAL),_0x355aa6=await checkServerRunning(_0x1ddb5a,_0xf7df0b,_0xd469fd);return _0x355aa6?{'host':_0x1ddb5a,'port':_0xf7df0b}:null;}function a0_0x382e(_0x1fc000,_0x4222aa){_0x1fc000=_0x1fc000-0x15e;const _0x5594be=a0_0x5594();let _0x382e85=_0x5594be[_0x1fc000];return _0x382e85;}function openBrowser(_0x5c6510){const _0xe53796=a0_0x347fbb;let _0x4242b1,_0x4e946b;if(process[_0xe53796(0x186)]==='darwin')_0x4242b1=_0xe53796(0x19a),_0x4e946b=[_0x5c6510];else process[_0xe53796(0x186)]==='win32'?(_0x4242b1=_0xe53796(0x16e),_0x4e946b=['/c',_0xe53796(0x1a0),'\x22\x22',_0x5c6510]):(_0x4242b1=_0xe53796(0x17f),_0x4e946b=[_0x5c6510]);const _0x521263=spawn(_0x4242b1,_0x4e946b,{'detached':!![],'stdio':_0xe53796(0x15f)});_0x521263[_0xe53796(0x19f)](),_0x521263['on'](_0xe53796(0x168),()=>{const _0x12844b=_0xe53796;console[_0x12844b(0x164)](_0x12844b(0x17c)),console[_0x12844b(0x164)](_0x12844b(0x163)+_0x5c6510);});}function startServer(_0x4d1ece=![]){const _0x2dcb0f=a0_0x347fbb,_0x3f1b03={...process.env};explicitPort&&(_0x3f1b03[_0x2dcb0f(0x18e)]=explicitPort[_0x2dcb0f(0x197)](),_0x3f1b03[_0x2dcb0f(0x185)]=explicitPort[_0x2dcb0f(0x197)]());flags['host']&&(_0x3f1b03[_0x2dcb0f(0x1a1)]=flags[_0x2dcb0f(0x188)]);const _0x2736d1=join(__dirname,'..',_0x2dcb0f(0x18f),_0x2dcb0f(0x181)),_0x4bd09a=spawn(_0x2dcb0f(0x1a6),[_0x2736d1],{'cwd':join(__dirname,'..'),'env':_0x3f1b03,'stdio':_0x4d1ece?[_0x2dcb0f(0x15f),'ignore',_0x2dcb0f(0x15f)]:'inherit','detached':_0x4d1ece});return _0x4d1ece&&_0x4bd09a[_0x2dcb0f(0x19f)](),_0x4bd09a;}function startTerminalUIProcess(_0x4fa8f8,_0x42a2cb){const _0x1b39ed=a0_0x347fbb,_0x8b64fe=join(__dirname,_0x1b39ed(0x17a)),_0x1c4ee8={...process.env,'LOXIA_PORT':_0x42a2cb[_0x1b39ed(0x197)](),'LOXIA_HOST':_0x4fa8f8},_0x508967=spawn(_0x1b39ed(0x1a6),[_0x8b64fe],{'cwd':join(__dirname,'..'),'env':_0x1c4ee8,'stdio':'inherit'});return _0x508967;}const commands={'web':async()=>{const _0x13cd0f=a0_0x347fbb;console['log'](_0x13cd0f(0x198));const _0xe8f4cc=startServer(![]);console[_0x13cd0f(0x164)](_0x13cd0f(0x16b));let _0xa0b2ac;explicitPort?_0xa0b2ac=await waitForServerAtPort(host,explicitPort):_0xa0b2ac=await waitForServerWithDiscovery();if(_0xa0b2ac){const _0x5c5ac3=_0x13cd0f(0x166)+_0xa0b2ac['host']+':'+_0xa0b2ac[_0x13cd0f(0x17b)];console[_0x13cd0f(0x164)](_0x13cd0f(0x169)+_0x5c5ac3),openBrowser(_0x5c5ac3);}else console[_0x13cd0f(0x164)]('\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.');process['on']('SIGINT',()=>_0xe8f4cc[_0x13cd0f(0x18a)]('SIGINT')),process['on'](_0x13cd0f(0x199),()=>_0xe8f4cc[_0x13cd0f(0x18a)](_0x13cd0f(0x199))),_0xe8f4cc['on'](_0x13cd0f(0x1a5),_0x289cd3=>process[_0x13cd0f(0x1a5)](_0x289cd3||0x0));},'plus-web':async()=>{await commands['web']();},'serve':async()=>{const _0x16e0d1=a0_0x347fbb;console[_0x16e0d1(0x164)](_0x16e0d1(0x198));const _0x50fcd1=startServer(![]);console[_0x16e0d1(0x164)](_0x16e0d1(0x16b));let _0x319df3;explicitPort?_0x319df3=await waitForServerAtPort(host,explicitPort):_0x319df3=await waitForServerWithDiscovery();if(_0x319df3){const _0x1223c0=_0x16e0d1(0x166)+_0x319df3[_0x16e0d1(0x188)]+':'+_0x319df3[_0x16e0d1(0x17b)];console[_0x16e0d1(0x164)](_0x16e0d1(0x16a)+_0x1223c0),console[_0x16e0d1(0x164)](_0x16e0d1(0x16d)+_0x1223c0),console[_0x16e0d1(0x164)](_0x16e0d1(0x179)),console[_0x16e0d1(0x164)](_0x16e0d1(0x167)+_0x1223c0+_0x16e0d1(0x174));}else console[_0x16e0d1(0x164)]('\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.'),console[_0x16e0d1(0x164)](_0x16e0d1(0x16c));process['on'](_0x16e0d1(0x16f),()=>_0x50fcd1[_0x16e0d1(0x18a)]('SIGINT')),process['on'](_0x16e0d1(0x199),()=>_0x50fcd1[_0x16e0d1(0x18a)]('SIGTERM')),_0x50fcd1['on'](_0x16e0d1(0x1a5),_0x5b8609=>process[_0x16e0d1(0x1a5)](_0x5b8609||0x0));},'terminal':async()=>{const _0x514f35=a0_0x347fbb;console['log']('Looking\x20for\x20running\x20server...');let _0x328c47=await discoverBackend();explicitPort&&(_0x328c47={'host':host,'port':explicitPort});!_0x328c47&&(console['error'](_0x514f35(0x1a9)),console[_0x514f35(0x168)](_0x514f35(0x17d)),console[_0x514f35(0x168)](_0x514f35(0x1a4)),console[_0x514f35(0x168)]('\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only'),console['error'](_0x514f35(0x178)),process[_0x514f35(0x1a5)](0x1));const _0xa99c1a=await checkServerRunning(_0x328c47[_0x514f35(0x188)],_0x328c47[_0x514f35(0x17b)]);!_0xa99c1a&&(console[_0x514f35(0x168)](_0x514f35(0x172)+_0x328c47[_0x514f35(0x188)]+':'+_0x328c47[_0x514f35(0x17b)]+_0x514f35(0x19b)),console[_0x514f35(0x168)](_0x514f35(0x1aa)),process[_0x514f35(0x1a5)](0x1));console[_0x514f35(0x164)]('Server\x20discovered\x20at\x20'+_0x328c47[_0x514f35(0x188)]+':'+_0x328c47[_0x514f35(0x17b)]),console[_0x514f35(0x164)]('Starting\x20Terminal\x20UI...\x0a');const _0xcdd9bb=startTerminalUIProcess(_0x328c47['host'],_0x328c47[_0x514f35(0x17b)]);process['on'](_0x514f35(0x16f),()=>_0xcdd9bb[_0x514f35(0x18a)]('SIGINT')),process['on'](_0x514f35(0x199),()=>_0xcdd9bb['kill'](_0x514f35(0x199))),_0xcdd9bb['on']('exit',_0x15ea31=>process[_0x514f35(0x1a5)](_0x15ea31||0x0));},'plus-terminal':async()=>{const _0x1dff3e=a0_0x347fbb;console[_0x1dff3e(0x164)](_0x1dff3e(0x1b1));const _0x18b8e6=startServer(!![]);let _0x55d308;explicitPort?_0x55d308=await waitForServerAtPort(host,explicitPort):_0x55d308=await waitForServerWithDiscovery();!_0x55d308&&(console[_0x1dff3e(0x168)](_0x1dff3e(0x19c)),process[_0x1dff3e(0x1a5)](0x1));console[_0x1dff3e(0x164)](_0x1dff3e(0x177)+_0x55d308['host']+':'+_0x55d308['port']),console[_0x1dff3e(0x164)]('Starting\x20Terminal\x20UI...\x0a');const _0xf18fb0=startTerminalUIProcess(_0x55d308[_0x1dff3e(0x188)],_0x55d308['port']);_0xf18fb0['on']('exit',_0x2906e3=>{const _0x5ba302=_0x1dff3e;console[_0x5ba302(0x164)](_0x5ba302(0x176));try{process['kill'](_0x18b8e6['pid'],_0x5ba302(0x199));}catch(_0x4ed521){}process['exit'](_0x2906e3||0x0);}),process['on'](_0x1dff3e(0x16f),()=>{const _0x5be8c8=_0x1dff3e;_0xf18fb0[_0x5be8c8(0x18a)](_0x5be8c8(0x16f));}),process['on'](_0x1dff3e(0x199),()=>{const _0x4a9b7f=_0x1dff3e;_0xf18fb0['kill'](_0x4a9b7f(0x199));});}};commands[command]?commands[command]()[a0_0x347fbb(0x15e)](_0x292a85=>{const _0x1b4602=a0_0x347fbb;console[_0x1b4602(0x168)](_0x1b4602(0x18d),_0x292a85[_0x1b4602(0x1b0)]),process[_0x1b4602(0x1a5)](0x1);}):(console[a0_0x347fbb(0x168)](a0_0x347fbb(0x170)+command),console[a0_0x347fbb(0x168)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process['exit'](0x1));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x1a6b25=a0_0x3173;(function(_0x591e48,_0x284758){const _0x256fdf=a0_0x3173,_0x5f4a48=_0x591e48();while(!![]){try{const _0x117042=parseInt(_0x256fdf(0x13c))/0x1*(parseInt(_0x256fdf(0x14b))/0x2)+-parseInt(_0x256fdf(0x133))/0x3*(parseInt(_0x256fdf(0x11e))/0x4)+-parseInt(_0x256fdf(0x147))/0x5*(-parseInt(_0x256fdf(0x143))/0x6)+parseInt(_0x256fdf(0x13f))/0x7+parseInt(_0x256fdf(0x127))/0x8+-parseInt(_0x256fdf(0x12b))/0x9+parseInt(_0x256fdf(0x134))/0xa;if(_0x117042===_0x284758)break;else _0x5f4a48['push'](_0x5f4a48['shift']());}catch(_0x246b04){_0x5f4a48['push'](_0x5f4a48['shift']());}}}(a0_0x2221,0xb1e09));import{spawn}from'child_process';import a0_0x2109d2 from'net';import a0_0x504f9e from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x504f9e[a0_0x1a6b25(0x144)](__filename),projectRoot=a0_0x504f9e[a0_0x1a6b25(0x144)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x1a6b25(0x135),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x377176,_0x2edda6){return new Promise(_0x15fbd1=>{const _0xcd5da3=a0_0x3173,_0x406a18=new a0_0x2109d2[(_0xcd5da3(0x140))]();_0x406a18[_0xcd5da3(0x124)](0x7d0),_0x406a18['on']('connect',()=>{const _0x5a09dd=_0xcd5da3;_0x406a18[_0x5a09dd(0x11f)](),_0x15fbd1(!![]);}),_0x406a18['on'](_0xcd5da3(0x121),()=>{const _0x42a371=_0xcd5da3;_0x406a18[_0x42a371(0x11f)](),_0x15fbd1(![]);}),_0x406a18['on']('error',()=>{_0x406a18['destroy'](),_0x15fbd1(![]);}),_0x406a18[_0xcd5da3(0x139)](_0x2edda6,_0x377176);});}function a0_0x3173(_0x1621d7,_0x2a5bd4){_0x1621d7=_0x1621d7-0x11e;const _0x222119=a0_0x2221();let _0x317397=_0x222119[_0x1621d7];return _0x317397;}async function startServer(_0x5dcdac,_0x4d2374){const _0x13823a=a0_0x1a6b25;return console[_0x13823a(0x145)](_0x13823a(0x13b)),new Promise((_0x42e717,_0x3e4fff)=>{const _0x34caab=_0x13823a,_0x5c1b27=spawn('node',[a0_0x504f9e[_0x34caab(0x128)](projectRoot,'bin/cli.js'),_0x34caab(0x14a),_0x34caab(0x146),_0x34caab(0x129),_0x5dcdac,_0x34caab(0x126),_0x4d2374[_0x34caab(0x13e)]()],{'detached':![],'stdio':['ignore',_0x34caab(0x149),_0x34caab(0x149)]});_0x5c1b27[_0x34caab(0x142)]['on'](_0x34caab(0x137),()=>{}),_0x5c1b27['stderr']['on']('data',()=>{}),_0x5c1b27['on'](_0x34caab(0x131),_0x24cf85=>{const _0x3b3214=_0x34caab;console[_0x3b3214(0x131)](_0x3b3214(0x136),_0x24cf85[_0x3b3214(0x130)]),_0x3e4fff(_0x24cf85);});const _0x37d05d=Date[_0x34caab(0x132)](),_0x3670a0=setInterval(async()=>{const _0x25bf83=_0x34caab,_0x3b392d=await isServerRunning(_0x5dcdac,_0x4d2374);if(_0x3b392d)clearInterval(_0x3670a0),console[_0x25bf83(0x145)](_0x25bf83(0x12c)+_0x5dcdac+':'+_0x4d2374),_0x42e717();else Date[_0x25bf83(0x132)]()-_0x37d05d>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x3670a0),_0x5c1b27[_0x25bf83(0x12e)](),_0x3e4fff(new Error(_0x25bf83(0x122))));},0x1f4);});}async function main(){const _0x4f581f=a0_0x1a6b25;try{console['log'](_0x4f581f(0x125)),console[_0x4f581f(0x145)](_0x4f581f(0x12a)),console[_0x4f581f(0x145)](_0x4f581f(0x125)),console[_0x4f581f(0x145)]('');const _0x306891=process['argv'][_0x4f581f(0x13a)](0x2);let _0x49701d=DEFAULT_HOST,_0x6554c=DEFAULT_PORT;for(let _0xec5cf0=0x0;_0xec5cf0<_0x306891[_0x4f581f(0x138)];_0xec5cf0++){if(_0x306891[_0xec5cf0]===_0x4f581f(0x129)&&_0x306891[_0xec5cf0+0x1])_0x49701d=_0x306891[_0xec5cf0+0x1],_0xec5cf0++;else _0x306891[_0xec5cf0]===_0x4f581f(0x126)&&_0x306891[_0xec5cf0+0x1]&&(_0x6554c=parseInt(_0x306891[_0xec5cf0+0x1],0xa),_0xec5cf0++);}console[_0x4f581f(0x145)](_0x4f581f(0x14d)+_0x49701d+':'+_0x6554c+_0x4f581f(0x123));const _0x4d79f6=await isServerRunning(_0x49701d,_0x6554c);!_0x4d79f6?(console[_0x4f581f(0x145)](_0x4f581f(0x120)),await startServer(_0x49701d,_0x6554c)):console[_0x4f581f(0x145)](_0x4f581f(0x14c)+_0x49701d+':'+_0x6554c),console[_0x4f581f(0x145)](''),console['log'](_0x4f581f(0x141)),console[_0x4f581f(0x145)](''),await new Promise(_0x1b87d5=>setTimeout(_0x1b87d5,0x1f4)),process.env.LOXIA_HOST=_0x49701d,process.env.LOXIA_PORT=_0x6554c['toString'](),await import(_0x4f581f(0x148));}catch(_0xedc848){console[_0x4f581f(0x131)](''),console[_0x4f581f(0x131)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console['error']('\x20\x20',_0xedc848[_0x4f581f(0x130)]),console['error'](''),console[_0x4f581f(0x131)](_0x4f581f(0x12d)),console['error'](_0x4f581f(0x12f)),console['error'](_0x4f581f(0x13d)),console[_0x4f581f(0x131)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x4f581f(0x131)](''),process[_0x4f581f(0x14e)](0x1);}}main();function a0_0x2221(){const _0x86a2e2=['slice','🚀\x20Starting\x20Loxia\x20server...','1331961apwmIZ','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','toString','2431030ONnzyw','Socket','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','stdout','71892lGfkbp','dirname','log','web','5WajJDk','../src/interfaces/terminal/index.js','pipe','--ui','2YwnJti','✓\x20Server\x20is\x20already\x20running\x20at\x20','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','exit','4064OSBmpq','destroy','✗\x20Server\x20is\x20not\x20running','timeout','Server\x20startup\x20timeout','...','setTimeout','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','--port','4579920cPTKSZ','join','--host','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','6326721kxbFpR','✓\x20Server\x20started\x20at\x20','💡\x20Troubleshooting:','kill','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','message','error','now','2820cMiHRN','1228710aHhxhm','localhost','Failed\x20to\x20start\x20server:','data','length','connect'];a0_0x2221=function(){return _0x86a2e2;};return a0_0x2221();}
3
+ const a0_0x563781=a0_0x46e0;(function(_0x4e07a3,_0x2676c2){const _0x51a936=a0_0x46e0,_0x2ff948=_0x4e07a3();while(!![]){try{const _0xa4c9bb=-parseInt(_0x51a936(0x1c5))/0x1*(-parseInt(_0x51a936(0x1bf))/0x2)+-parseInt(_0x51a936(0x1c4))/0x3*(parseInt(_0x51a936(0x1bc))/0x4)+parseInt(_0x51a936(0x1d5))/0x5*(parseInt(_0x51a936(0x1c6))/0x6)+parseInt(_0x51a936(0x1b0))/0x7*(parseInt(_0x51a936(0x1d3))/0x8)+parseInt(_0x51a936(0x1a8))/0x9+-parseInt(_0x51a936(0x1ca))/0xa+-parseInt(_0x51a936(0x1aa))/0xb*(parseInt(_0x51a936(0x1a9))/0xc);if(_0xa4c9bb===_0x2676c2)break;else _0x2ff948['push'](_0x2ff948['shift']());}catch(_0x79b8ca){_0x2ff948['push'](_0x2ff948['shift']());}}}(a0_0x48f1,0xcc411));import{spawn}from'child_process';function a0_0x48f1(){const _0x36f85c=['--host','✗\x20Server\x20is\x20not\x20running','--port','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','dirname','web','error','join','✓\x20Server\x20started\x20at\x20','628clTThe','toString','Failed\x20to\x20start\x20server:','12lmRCtb','stderr','--ui','argv','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','16431iomVST','250321BBzqRL','132vLffln','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','connect','stdout','4098910AwGcEm','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','node','✓\x20Server\x20is\x20already\x20running\x20at\x20','data','slice','message','destroy','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','590584krpITO','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','31795mJLxod','6052887hYXbrw','1241484wdZAsv','132ssqJfJ','log','...','pipe','setTimeout','length','98OyHcGp','kill','ignore'];a0_0x48f1=function(){return _0x36f85c;};return a0_0x48f1();}import a0_0x31f7a1 from'net';import a0_0x441cd9 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x441cd9[a0_0x563781(0x1b7)](__filename),projectRoot=a0_0x441cd9[a0_0x563781(0x1b7)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x23d4e3,_0x15b710){return new Promise(_0x38d23d=>{const _0x310cc1=a0_0x46e0,_0x5559de=new a0_0x31f7a1['Socket']();_0x5559de[_0x310cc1(0x1ae)](0x7d0),_0x5559de['on']('connect',()=>{const _0x201789=_0x310cc1;_0x5559de[_0x201789(0x1d1)](),_0x38d23d(!![]);}),_0x5559de['on']('timeout',()=>{const _0x13ce73=_0x310cc1;_0x5559de[_0x13ce73(0x1d1)](),_0x38d23d(![]);}),_0x5559de['on']('error',()=>{const _0x4f4c2c=_0x310cc1;_0x5559de[_0x4f4c2c(0x1d1)](),_0x38d23d(![]);}),_0x5559de[_0x310cc1(0x1c8)](_0x15b710,_0x23d4e3);});}function a0_0x46e0(_0x105eef,_0x156c4b){_0x105eef=_0x105eef-0x1a8;const _0x48f17a=a0_0x48f1();let _0x46e0fa=_0x48f17a[_0x105eef];return _0x46e0fa;}async function startServer(_0x43e9cf,_0x539edc){const _0x5e5991=a0_0x563781;return console[_0x5e5991(0x1ab)]('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0x29a49a,_0x20c628)=>{const _0x11adf0=_0x5e5991,_0x5c3541=spawn(_0x11adf0(0x1cc),[a0_0x441cd9[_0x11adf0(0x1ba)](projectRoot,'bin/cli.js'),_0x11adf0(0x1c1),_0x11adf0(0x1b8),'--host',_0x43e9cf,_0x11adf0(0x1b5),_0x539edc[_0x11adf0(0x1bd)]()],{'detached':![],'stdio':[_0x11adf0(0x1b2),_0x11adf0(0x1ad),'pipe']});_0x5c3541[_0x11adf0(0x1c9)]['on'](_0x11adf0(0x1ce),()=>{}),_0x5c3541[_0x11adf0(0x1c0)]['on']('data',()=>{}),_0x5c3541['on'](_0x11adf0(0x1b9),_0x2f90ce=>{const _0x41be73=_0x11adf0;console[_0x41be73(0x1b9)](_0x41be73(0x1be),_0x2f90ce[_0x41be73(0x1d0)]),_0x20c628(_0x2f90ce);});const _0x50947d=Date['now'](),_0x416476=setInterval(async()=>{const _0x2fff6d=_0x11adf0,_0x2606a7=await isServerRunning(_0x43e9cf,_0x539edc);if(_0x2606a7)clearInterval(_0x416476),console[_0x2fff6d(0x1ab)](_0x2fff6d(0x1bb)+_0x43e9cf+':'+_0x539edc),_0x29a49a();else Date['now']()-_0x50947d>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x416476),_0x5c3541[_0x2fff6d(0x1b1)](),_0x20c628(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x4c663b=a0_0x563781;try{console['log'](_0x4c663b(0x1d2)),console[_0x4c663b(0x1ab)](_0x4c663b(0x1b6)),console[_0x4c663b(0x1ab)](_0x4c663b(0x1d2)),console['log']('');const _0x423b76=process[_0x4c663b(0x1c2)][_0x4c663b(0x1cf)](0x2);let _0x100ede=DEFAULT_HOST,_0xbfd9b6=DEFAULT_PORT;for(let _0x1ce3ff=0x0;_0x1ce3ff<_0x423b76[_0x4c663b(0x1af)];_0x1ce3ff++){if(_0x423b76[_0x1ce3ff]===_0x4c663b(0x1b3)&&_0x423b76[_0x1ce3ff+0x1])_0x100ede=_0x423b76[_0x1ce3ff+0x1],_0x1ce3ff++;else _0x423b76[_0x1ce3ff]===_0x4c663b(0x1b5)&&_0x423b76[_0x1ce3ff+0x1]&&(_0xbfd9b6=parseInt(_0x423b76[_0x1ce3ff+0x1],0xa),_0x1ce3ff++);}console[_0x4c663b(0x1ab)](_0x4c663b(0x1cb)+_0x100ede+':'+_0xbfd9b6+_0x4c663b(0x1ac));const _0x1a56fc=await isServerRunning(_0x100ede,_0xbfd9b6);!_0x1a56fc?(console[_0x4c663b(0x1ab)](_0x4c663b(0x1b4)),await startServer(_0x100ede,_0xbfd9b6)):console[_0x4c663b(0x1ab)](_0x4c663b(0x1cd)+_0x100ede+':'+_0xbfd9b6),console[_0x4c663b(0x1ab)](''),console[_0x4c663b(0x1ab)]('🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'),console[_0x4c663b(0x1ab)](''),await new Promise(_0x173168=>setTimeout(_0x173168,0x1f4)),process.env.LOXIA_HOST=_0x100ede,process.env.LOXIA_PORT=_0xbfd9b6['toString'](),await import('../src/interfaces/terminal/index.js');}catch(_0x3f614f){console[_0x4c663b(0x1b9)](''),console['error'](_0x4c663b(0x1c7)),console['error']('\x20\x20',_0x3f614f[_0x4c663b(0x1d0)]),console[_0x4c663b(0x1b9)](''),console['error']('💡\x20Troubleshooting:'),console['error'](_0x4c663b(0x1d4)),console[_0x4c663b(0x1b9)]('\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js'),console[_0x4c663b(0x1b9)](_0x4c663b(0x1c3)),console[_0x4c663b(0x1b9)](''),process['exit'](0x1);}}main();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x1cde(_0x16908c,_0x4af050){_0x16908c=_0x16908c-0x174;const _0x260e45=a0_0x260e();let _0x1cde70=_0x260e45[_0x16908c];return _0x1cde70;}const a0_0x23204e=a0_0x1cde;(function(_0x17e14e,_0x313578){const _0x1f772c=a0_0x1cde,_0x2c39e7=_0x17e14e();while(!![]){try{const _0x2b105a=-parseInt(_0x1f772c(0x192))/0x1+-parseInt(_0x1f772c(0x18d))/0x2*(-parseInt(_0x1f772c(0x193))/0x3)+parseInt(_0x1f772c(0x185))/0x4*(-parseInt(_0x1f772c(0x18a))/0x5)+parseInt(_0x1f772c(0x198))/0x6+parseInt(_0x1f772c(0x17a))/0x7*(parseInt(_0x1f772c(0x178))/0x8)+-parseInt(_0x1f772c(0x177))/0x9+parseInt(_0x1f772c(0x174))/0xa;if(_0x2b105a===_0x313578)break;else _0x2c39e7['push'](_0x2c39e7['shift']());}catch(_0x5b9a2b){_0x2c39e7['push'](_0x2c39e7['shift']());}}}(a0_0x260e,0xb4e04));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x23204e(0x176)]['slice'](0x2),options={'host':a0_0x23204e(0x189),'port':0x1f90};for(let i=0x0;i<args['length'];i++){const arg=args[i];if(arg===a0_0x23204e(0x18e)||arg==='-h')options[a0_0x23204e(0x17b)]=args[++i];else{if(arg===a0_0x23204e(0x17f)||arg==='-p')options[a0_0x23204e(0x17e)]=parseInt(args[++i],0xa);else arg===a0_0x23204e(0x18b)&&(console[a0_0x23204e(0x179)](a0_0x23204e(0x195)),process[a0_0x23204e(0x183)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x23204e(0x17b)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x23204e(0x17e)]=parseInt(process.env.LOXIA_PORT,0xa));!process['stdin']['isTTY']&&(console[a0_0x23204e(0x180)](a0_0x23204e(0x186)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x190)),console[a0_0x23204e(0x180)](a0_0x23204e(0x187)),console[a0_0x23204e(0x180)](a0_0x23204e(0x17c)),console['error'](a0_0x23204e(0x197)),console['error'](a0_0x23204e(0x184)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x196)),console['error'](a0_0x23204e(0x175)),console[a0_0x23204e(0x180)](''),console[a0_0x23204e(0x180)](a0_0x23204e(0x181)),console[a0_0x23204e(0x180)](a0_0x23204e(0x18c)),process['exit'](0x1));console[a0_0x23204e(0x179)](a0_0x23204e(0x188)),console[a0_0x23204e(0x179)](a0_0x23204e(0x194)+options['host']+':'+options['port']),console[a0_0x23204e(0x179)]('Press\x20Ctrl+C\x20to\x20exit\x0a');const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x23204e(0x17d)](()=>{const _0x56f5dc=a0_0x23204e;console[_0x56f5dc(0x179)](_0x56f5dc(0x182)),process['exit'](0x0);})[a0_0x23204e(0x191)](_0x209bca=>{const _0x103f8a=a0_0x23204e;console[_0x103f8a(0x180)](_0x103f8a(0x18f),_0x209bca),process['exit'](0x1);});function a0_0x260e(){const _0x29d714=['\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','Starting\x20Loxia\x20Terminal\x20UI...','localhost','600205vCrKde','--help','\x20\x20npm\x20start','64qmiUCV','--host','\x0aTerminal\x20UI\x20error:','The\x20terminal\x20UI\x20cannot\x20run\x20in:','catch','867333prmiDx','16392KeMDIG','Connecting\x20to:\x20','\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','5509554xmFsHr','8598190rzgLFB','\x20\x20npm\x20run\x20terminal-ui','argv','13179969UbmfBk','528YijLeF','log','144221YEHJoy','host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','then','port','--port','error','Or\x20use\x20the\x20web\x20UI\x20instead:','\x0aTerminal\x20UI\x20exited','exit','\x20\x20-\x20Some\x20CI/CD\x20environments','8HEpDfm','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'];a0_0x260e=function(){return _0x29d714;};return a0_0x260e();}
3
+ const a0_0x43a567=a0_0x4687;(function(_0x4b128a,_0x175ddf){const _0x343911=a0_0x4687,_0x38794d=_0x4b128a();while(!![]){try{const _0x45b2ba=parseInt(_0x343911(0x113))/0x1*(parseInt(_0x343911(0x12d))/0x2)+parseInt(_0x343911(0x119))/0x3+-parseInt(_0x343911(0x118))/0x4*(-parseInt(_0x343911(0x129))/0x5)+-parseInt(_0x343911(0x12f))/0x6*(-parseInt(_0x343911(0x11b))/0x7)+-parseInt(_0x343911(0x127))/0x8*(-parseInt(_0x343911(0x10f))/0x9)+-parseInt(_0x343911(0x12e))/0xa+-parseInt(_0x343911(0x121))/0xb;if(_0x45b2ba===_0x175ddf)break;else _0x38794d['push'](_0x38794d['shift']());}catch(_0x31bbce){_0x38794d['push'](_0x38794d['shift']());}}}(a0_0x412f,0x86218));function a0_0x4687(_0x57f1ef,_0x2a1d03){_0x57f1ef=_0x57f1ef-0x10e;const _0x412f44=a0_0x412f();let _0x468741=_0x412f44[_0x57f1ef];return _0x468741;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process['argv'][a0_0x43a567(0x131)](0x2),options={'host':a0_0x43a567(0x120),'port':0x1f90};for(let i=0x0;i<args[a0_0x43a567(0x124)];i++){const arg=args[i];if(arg===a0_0x43a567(0x11f)||arg==='-h')options[a0_0x43a567(0x11c)]=args[++i];else{if(arg===a0_0x43a567(0x111)||arg==='-p')options[a0_0x43a567(0x115)]=parseInt(args[++i],0xa);else arg==='--help'&&(console['log'](a0_0x43a567(0x130)),process[a0_0x43a567(0x112)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x43a567(0x11c)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x43a567(0x115)]=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0x43a567(0x122)][a0_0x43a567(0x10e)]&&(console['error'](a0_0x43a567(0x128)),console[a0_0x43a567(0x123)](''),console[a0_0x43a567(0x123)]('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x43a567(0x123)](a0_0x43a567(0x114)),console['error'](a0_0x43a567(0x11d)),console[a0_0x43a567(0x123)]('\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)'),console[a0_0x43a567(0x123)]('\x20\x20-\x20Some\x20CI/CD\x20environments'),console[a0_0x43a567(0x123)](''),console['error'](a0_0x43a567(0x110)),console[a0_0x43a567(0x123)]('\x20\x20npm\x20run\x20terminal-ui'),console[a0_0x43a567(0x123)](''),console[a0_0x43a567(0x123)](a0_0x43a567(0x12c)),console[a0_0x43a567(0x123)](a0_0x43a567(0x12a)),process[a0_0x43a567(0x112)](0x1));console[a0_0x43a567(0x117)](a0_0x43a567(0x11e)),console[a0_0x43a567(0x117)](a0_0x43a567(0x126)+options[a0_0x43a567(0x11c)]+':'+options[a0_0x43a567(0x115)]),console['log'](a0_0x43a567(0x125));function a0_0x412f(){const _0x193cbc=['log','79168QEYHeb','2283990WHUoJU','\x0aTerminal\x20UI\x20exited','6686029jpKvsv','host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','Starting\x20Loxia\x20Terminal\x20UI...','--host','localhost','31130176QcnRrh','stdin','error','length','Press\x20Ctrl+C\x20to\x20exit\x0a','Connecting\x20to:\x20','8EbvGsB','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','135CsdHos','\x20\x20npm\x20start','\x0aTerminal\x20UI\x20error:','Or\x20use\x20the\x20web\x20UI\x20instead:','2119402urKDor','704730DVMZVi','6HYFTXu','\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','slice','isTTY','1253943GLEpCf','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','--port','exit','1kFyeCF','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','port','waitUntilExit'];a0_0x412f=function(){return _0x193cbc;};return a0_0x412f();}const instance=startTerminalUI(options);instance[a0_0x43a567(0x116)]()['then'](()=>{const _0x1ff557=a0_0x43a567;console['log'](_0x1ff557(0x11a)),process[_0x1ff557(0x112)](0x0);})['catch'](_0x41abc4=>{const _0x3b5a21=a0_0x43a567;console[_0x3b5a21(0x123)](_0x3b5a21(0x12b),_0x41abc4),process[_0x3b5a21(0x112)](0x1);});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x852a(_0x3a0236,_0xd88c98){_0x3a0236=_0x3a0236-0x9e;const _0x5155ef=a0_0x5155();let _0x852ad9=_0x5155ef[_0x3a0236];return _0x852ad9;}const a0_0x5f449d=a0_0x852a;(function(_0x29fb10,_0x393420){const _0x19932f=a0_0x852a,_0x59d028=_0x29fb10();while(!![]){try{const _0x4b7d1b=parseInt(_0x19932f(0xc8))/0x1*(-parseInt(_0x19932f(0xc5))/0x2)+-parseInt(_0x19932f(0xbf))/0x3*(parseInt(_0x19932f(0xcf))/0x4)+-parseInt(_0x19932f(0xb8))/0x5*(-parseInt(_0x19932f(0xd1))/0x6)+-parseInt(_0x19932f(0xba))/0x7*(-parseInt(_0x19932f(0xaa))/0x8)+-parseInt(_0x19932f(0xad))/0x9*(parseInt(_0x19932f(0xa3))/0xa)+-parseInt(_0x19932f(0xc2))/0xb+parseInt(_0x19932f(0xb3))/0xc;if(_0x4b7d1b===_0x393420)break;else _0x59d028['push'](_0x59d028['shift']());}catch(_0x1bad5d){_0x59d028['push'](_0x59d028['shift']());}}}(a0_0x5155,0xc0878));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x5459b9 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;function a0_0x5155(){const _0x4e7bd7=['message','784BbDjpD','inherit','killed','1654reGYpL','http://localhost:','data','get','╔════════════════════════════════════════════════╗','includes','bin','1889468saHayO','error','29982mrgGbV','Error\x20during\x20startup:','SIGINT','[SERVER\x20ERROR]\x20','destroy','loxia-terminal.js','50MpsWyN','Server\x20exited\x20with\x20code\x20','trim','Server\x20returned\x20','SIGTERM','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','8NzOssS','SIGKILL','log','1918827Dkgrtv','✅\x20Server\x20is\x20ready!','Timeout','ignore','pipe','Failed\x20to\x20start\x20Terminal\x20UI:','35144052mjAjkW','statusCode','toString','ExperimentalWarning','\x0a👋\x20Terminal\x20UI\x20closed.','1220gainny','stderr','7232981gtSdxd','index.js','/health','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','exit','9FKJpLJ','node','kill','13872518jkWzhE','src'];a0_0x5155=function(){return _0x4e7bd7;};return a0_0x5155();}async function checkServerReady(_0x276a40=0xa,_0x1fc259=0x1f4){const _0x2ebf42=a0_0x852a;for(let _0x12f2ad=0x0;_0x12f2ad<_0x276a40;_0x12f2ad++){try{return await new Promise((_0x263b4f,_0x387e68)=>{const _0x38a6b7=a0_0x852a,_0x40f342=a0_0x5459b9[_0x38a6b7(0xcb)](_0x38a6b7(0xc9)+SERVER_PORT+_0x38a6b7(0xbc),_0x2e5beb=>{const _0x5917cf=_0x38a6b7;_0x2e5beb[_0x5917cf(0xb4)]===0xc8?_0x263b4f():_0x387e68(new Error(_0x5917cf(0xa6)+_0x2e5beb[_0x5917cf(0xb4)]));});_0x40f342['on'](_0x38a6b7(0xd0),_0x387e68),_0x40f342['setTimeout'](0x3e8,()=>{const _0x3a13d7=_0x38a6b7;_0x40f342[_0x3a13d7(0xa1)](),_0x387e68(new Error(_0x3a13d7(0xaf)));});}),console[_0x2ebf42(0xac)](_0x2ebf42(0xae)),!![];}catch(_0x39af5a){_0x12f2ad<_0x276a40-0x1&&await new Promise(_0x424557=>setTimeout(_0x424557,_0x1fc259));}}return console['log'](_0x2ebf42(0xa9)),![];}async function startServer(){return new Promise(_0x1612b2=>{const _0x1effb2=a0_0x852a;console[_0x1effb2(0xac)]('🚀\x20Starting\x20Loxia\x20server...');const _0x4988dc=join(rootDir,_0x1effb2(0xc3),_0x1effb2(0xbb));serverProcess=spawn(_0x1effb2(0xc0),[_0x4988dc],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x1effb2(0xb0),'pipe',_0x1effb2(0xb1)],'detached':![]}),serverProcess['stdout']['on']('data',_0x3c6f71=>{const _0x5ab783=_0x1effb2,_0x460560=_0x3c6f71['toString']()[_0x5ab783(0xa5)]();_0x460560&&console[_0x5ab783(0xac)]('[SERVER]\x20'+_0x460560);}),serverProcess[_0x1effb2(0xb9)]['on'](_0x1effb2(0xca),_0x5df387=>{const _0x1f5055=_0x1effb2,_0x11a45a=_0x5df387[_0x1f5055(0xb5)]()['trim']();_0x11a45a&&!_0x11a45a[_0x1f5055(0xcd)](_0x1f5055(0xb6))&&console[_0x1f5055(0xd0)](_0x1f5055(0xa0)+_0x11a45a);}),serverProcess['on'](_0x1effb2(0xd0),_0x2986ae=>{const _0x25530d=_0x1effb2;console[_0x25530d(0xd0)]('Failed\x20to\x20start\x20server:',_0x2986ae['message']),process[_0x25530d(0xbe)](0x1);}),serverProcess['on'](_0x1effb2(0xbe),(_0x577276,_0x3451df)=>{const _0x14bec0=_0x1effb2;_0x577276!==null&&_0x577276!==0x0&&(console[_0x14bec0(0xd0)](_0x14bec0(0xa4)+_0x577276),process[_0x14bec0(0xbe)](_0x577276));}),setTimeout(_0x1612b2,STARTUP_WAIT);});}async function startTerminalUI(){const _0x34f704=a0_0x852a;console[_0x34f704(0xac)]('🖥️\x20\x20Starting\x20Terminal\x20UI...'),console[_0x34f704(0xac)]('');const _0x3630fa=join(rootDir,_0x34f704(0xce),_0x34f704(0xa2)),_0x34804a=spawn(_0x34f704(0xc0),[_0x3630fa],{'cwd':rootDir,'env':{...process.env},'stdio':_0x34f704(0xc6)});return _0x34804a['on']('error',_0x4e7d55=>{const _0x1e0c83=_0x34f704;console[_0x1e0c83(0xd0)](_0x1e0c83(0xb2),_0x4e7d55[_0x1e0c83(0xc4)]),cleanup(),process[_0x1e0c83(0xbe)](0x1);}),_0x34804a['on'](_0x34f704(0xbe),_0x106c77=>{const _0x11909c=_0x34f704;console[_0x11909c(0xac)](_0x11909c(0xb7)),cleanup(),process[_0x11909c(0xbe)](_0x106c77||0x0);}),_0x34804a;}function cleanup(){const _0x3e677e=a0_0x852a;serverProcess&&!serverProcess[_0x3e677e(0xc7)]&&(console[_0x3e677e(0xac)]('🛑\x20Stopping\x20server...'),serverProcess[_0x3e677e(0xc1)](_0x3e677e(0xa7)),setTimeout(()=>{const _0x476a47=_0x3e677e;!serverProcess['killed']&&serverProcess[_0x476a47(0xc1)](_0x476a47(0xab));},0x1388));}process['on'](a0_0x5f449d(0x9f),()=>{const _0x2dfd7f=a0_0x5f449d;console['log'](_0x2dfd7f(0xbd)),cleanup(),process['exit'](0x0);}),process['on']('SIGTERM',()=>{const _0x53cc10=a0_0x5f449d;console[_0x53cc10(0xac)](_0x53cc10(0xa8)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x5f449d(0xbe),()=>{cleanup();});async function main(){const _0x460e3c=a0_0x5f449d;console[_0x460e3c(0xac)](_0x460e3c(0xcc)),console[_0x460e3c(0xac)]('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console[_0x460e3c(0xac)]('╚════════════════════════════════════════════════╝'),console[_0x460e3c(0xac)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x25bba2){console['error'](_0x460e3c(0x9e),_0x25bba2[_0x460e3c(0xc4)]),cleanup(),process[_0x460e3c(0xbe)](0x1);}}main();
3
+ const a0_0x2589d5=a0_0x15ff;(function(_0x4ae0a1,_0x3d167c){const _0x201ef5=a0_0x15ff,_0x4232d9=_0x4ae0a1();while(!![]){try{const _0x39924a=-parseInt(_0x201ef5(0xd5))/0x1*(parseInt(_0x201ef5(0xd1))/0x2)+-parseInt(_0x201ef5(0xdc))/0x3*(-parseInt(_0x201ef5(0xb7))/0x4)+parseInt(_0x201ef5(0xc3))/0x5+-parseInt(_0x201ef5(0xd8))/0x6+-parseInt(_0x201ef5(0xcd))/0x7+-parseInt(_0x201ef5(0xce))/0x8+parseInt(_0x201ef5(0xd3))/0x9;if(_0x39924a===_0x3d167c)break;else _0x4232d9['push'](_0x4232d9['shift']());}catch(_0x20296d){_0x4232d9['push'](_0x4232d9['shift']());}}}(a0_0x2205,0xa9853));function a0_0x15ff(_0x56c1b4,_0x5d23ff){_0x56c1b4=_0x56c1b4-0xae;const _0x220557=a0_0x2205();let _0x15ff7d=_0x220557[_0x56c1b4];return _0x15ff7d;}import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x55910b 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(_0xa0f51c=0xa,_0x2b8a37=0x1f4){const _0x5414d3=a0_0x15ff;for(let _0x987bfb=0x0;_0x987bfb<_0xa0f51c;_0x987bfb++){try{return await new Promise((_0x3b69aa,_0x56ed03)=>{const _0x3366da=a0_0x15ff,_0x5b3a6d=a0_0x55910b[_0x3366da(0xc1)](_0x3366da(0xc8)+SERVER_PORT+_0x3366da(0xb0),_0x1e39ef=>{const _0xb3718b=_0x3366da;_0x1e39ef[_0xb3718b(0xc0)]===0xc8?_0x3b69aa():_0x56ed03(new Error('Server\x20returned\x20'+_0x1e39ef[_0xb3718b(0xc0)]));});_0x5b3a6d['on']('error',_0x56ed03),_0x5b3a6d[_0x3366da(0xb3)](0x3e8,()=>{const _0x4bd704=_0x3366da;_0x5b3a6d[_0x4bd704(0xb5)](),_0x56ed03(new Error('Timeout'));});}),console[_0x5414d3(0xd7)](_0x5414d3(0xb4)),!![];}catch(_0xbf74e8){_0x987bfb<_0xa0f51c-0x1&&await new Promise(_0x31e987=>setTimeout(_0x31e987,_0x2b8a37));}}return console[_0x5414d3(0xd7)]('⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...'),![];}async function startServer(){return new Promise(_0x3fe1a0=>{const _0x150fa3=a0_0x15ff;console[_0x150fa3(0xd7)](_0x150fa3(0xde));const _0x335820=join(rootDir,_0x150fa3(0xaf),'index.js');serverProcess=spawn(_0x150fa3(0xc4),[_0x335820],{'cwd':rootDir,'env':{...process.env},'stdio':[_0x150fa3(0xbd),_0x150fa3(0xbc),_0x150fa3(0xbc)],'detached':![]}),serverProcess[_0x150fa3(0xdf)]['on'](_0x150fa3(0xb2),_0x2acef7=>{const _0x3ec0e9=_0x150fa3,_0x324e2a=_0x2acef7[_0x3ec0e9(0xd6)]()[_0x3ec0e9(0xd9)]();_0x324e2a&&console[_0x3ec0e9(0xd7)](_0x3ec0e9(0xda)+_0x324e2a);}),serverProcess[_0x150fa3(0xc2)]['on'](_0x150fa3(0xb2),_0x2fff07=>{const _0x56de25=_0x150fa3,_0x1d473a=_0x2fff07[_0x56de25(0xd6)]()['trim']();_0x1d473a&&!_0x1d473a[_0x56de25(0xbf)](_0x56de25(0xd2))&&console[_0x56de25(0xc9)](_0x56de25(0xcf)+_0x1d473a);}),serverProcess['on']('error',_0x27d782=>{const _0x4dce53=_0x150fa3;console[_0x4dce53(0xc9)](_0x4dce53(0xb9),_0x27d782[_0x4dce53(0xca)]),process[_0x4dce53(0xdb)](0x1);}),serverProcess['on'](_0x150fa3(0xdb),(_0x37fd44,_0x490ceb)=>{const _0x230d8a=_0x150fa3;_0x37fd44!==null&&_0x37fd44!==0x0&&(console[_0x230d8a(0xc9)]('Server\x20exited\x20with\x20code\x20'+_0x37fd44),process[_0x230d8a(0xdb)](_0x37fd44));}),setTimeout(_0x3fe1a0,STARTUP_WAIT);});}async function startTerminalUI(){const _0x1d7e65=a0_0x15ff;console[_0x1d7e65(0xd7)](_0x1d7e65(0xb6)),console['log']('');const _0x1a9ee5=join(rootDir,_0x1d7e65(0xc5),'loxia-terminal.js'),_0x1a1d30=spawn(_0x1d7e65(0xc4),[_0x1a9ee5],{'cwd':rootDir,'env':{...process.env},'stdio':_0x1d7e65(0xae)});return _0x1a1d30['on'](_0x1d7e65(0xc9),_0x183a25=>{const _0x45ef0e=_0x1d7e65;console[_0x45ef0e(0xc9)](_0x45ef0e(0xdd),_0x183a25[_0x45ef0e(0xca)]),cleanup(),process[_0x45ef0e(0xdb)](0x1);}),_0x1a1d30['on'](_0x1d7e65(0xdb),_0x138d6c=>{const _0x47ed49=_0x1d7e65;console[_0x47ed49(0xd7)](_0x47ed49(0xc6)),cleanup(),process[_0x47ed49(0xdb)](_0x138d6c||0x0);}),_0x1a1d30;}function cleanup(){const _0x3bc417=a0_0x15ff;serverProcess&&!serverProcess[_0x3bc417(0xb1)]&&(console[_0x3bc417(0xd7)](_0x3bc417(0xe0)),serverProcess['kill']('SIGTERM'),setTimeout(()=>{const _0x142c1e=_0x3bc417;!serverProcess[_0x142c1e(0xb1)]&&serverProcess['kill'](_0x142c1e(0xb8));},0x1388));}process['on'](a0_0x2589d5(0xbe),()=>{const _0x13c155=a0_0x2589d5;console[_0x13c155(0xd7)](_0x13c155(0xd4)),cleanup(),process[_0x13c155(0xdb)](0x0);}),process['on'](a0_0x2589d5(0xcc),()=>{const _0x23bcba=a0_0x2589d5;console['log'](_0x23bcba(0xc7)),cleanup(),process[_0x23bcba(0xdb)](0x0);}),process['on'](a0_0x2589d5(0xdb),()=>{cleanup();});async function main(){const _0x26984a=a0_0x2589d5;console[_0x26984a(0xd7)](_0x26984a(0xcb)),console[_0x26984a(0xd7)](_0x26984a(0xd0)),console[_0x26984a(0xd7)](_0x26984a(0xbb)),console['log']('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x2dd87e){console[_0x26984a(0xc9)](_0x26984a(0xba),_0x2dd87e[_0x26984a(0xca)]),cleanup(),process['exit'](0x1);}}main();function a0_0x2205(){const _0x147c4e=['killed','data','setTimeout','✅\x20Server\x20is\x20ready!','destroy','🖥️\x20\x20Starting\x20Terminal\x20UI...','2228zzIWms','SIGKILL','Failed\x20to\x20start\x20server:','Error\x20during\x20startup:','╚════════════════════════════════════════════════╝','pipe','ignore','SIGINT','includes','statusCode','get','stderr','2203815LcWXFn','node','bin','\x0a👋\x20Terminal\x20UI\x20closed.','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','http://localhost:','error','message','╔════════════════════════════════════════════════╗','SIGTERM','6425398sQGjww','1893056abMOKo','[SERVER\x20ERROR]\x20','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','398iQDIhB','ExperimentalWarning','27322713JiMocF','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','4468ajKwZA','toString','log','6473484BhZksS','trim','[SERVER]\x20','exit','1833PYaAmQ','Failed\x20to\x20start\x20Terminal\x20UI:','🚀\x20Starting\x20Loxia\x20server...','stdout','🛑\x20Stopping\x20server...','inherit','src','/health'];a0_0x2205=function(){return _0x147c4e;};return a0_0x2205();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
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_0xe1d980=a0_0xdba0;(function(_0x1776c8,_0x505671){const _0x54df35=a0_0xdba0,_0x4e1f0e=_0x1776c8();while(!![]){try{const _0x553b11=-parseInt(_0x54df35(0x1f9))/0x1+-parseInt(_0x54df35(0x216))/0x2+-parseInt(_0x54df35(0x215))/0x3+parseInt(_0x54df35(0x22a))/0x4+parseInt(_0x54df35(0x1f1))/0x5+-parseInt(_0x54df35(0x220))/0x6*(-parseInt(_0x54df35(0x219))/0x7)+parseInt(_0x54df35(0x1fa))/0x8*(parseInt(_0x54df35(0x229))/0x9);if(_0x553b11===_0x505671)break;else _0x4e1f0e['push'](_0x4e1f0e['shift']());}catch(_0x4227c2){_0x4e1f0e['push'](_0x4e1f0e['shift']());}}}(a0_0x18e4,0x35ad2));import{exec}from'child_process';function a0_0x18e4(){const _0x9c1b7a=['═══════════════════════════════════════════════════════════','includes','--user','platform','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','headers','\x0a═══════════════════════════════════════════════════════════','44073IwDdyL','265248gJiBoc','pipe','dirname','\x0aYou\x20can\x20manually\x20install\x20scanners:','message','url','═══════════════════════════════════════════════════════════\x0a','semgrep\x20--version','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','/opt/homebrew','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','log','v1.55.0','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','statusCode','\x20\x20Platform:\x20','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','pip-audit','yamllint','\x20already\x20installed','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','72275mQwLhP','stdout','join','checkov','trim','python3\x20--version','promises','location','197634ufHSjj','968aBCGWJ','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','https','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','semgrep','python3','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','❌\x20Installation\x20failed:','startsWith','\x20\x20\x20Downloading\x20from\x20','🐍\x20Checking\x20Python\x20scanners...','bandit','error','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20\x20pip\x20install\x20semgrep\x0a','exit','get','\x20\x20Installation\x20Complete','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','Failed\x20to\x20download:\x20HTTP\x20','node_modules','arch','eslint-plugin-security','967302dpogzK','231964PZKLZO','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','\x20\x20\x20✅\x20Python\x20found:\x20','319557fRHCDy','chmod','\x20installed\x20successfully','then','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','\x20\x20Installing\x20Security\x20Scanners','/usr/local/Cellar','24hSkzQl'];a0_0x18e4=function(){return _0x9c1b7a;};return a0_0x18e4();}import{promisify}from'util';function a0_0xdba0(_0x1c19d9,_0x549514){_0x1c19d9=_0x1c19d9-0x1ec;const _0x18e432=a0_0x18e4();let _0xdba04d=_0x18e432[_0x1c19d9];return _0xdba04d;}import a0_0x560669 from'https';import a0_0x54ea6f from'http';import a0_0x66471f from'fs';import a0_0x4cc32a from'path';import{fileURLToPath}from'url';import{createWriteStream}from'fs';import{pipeline}from'stream/promises';const execAsync=promisify(exec),__filename=fileURLToPath(import.meta.url),__dirname=a0_0x4cc32a[a0_0xe1d980(0x22c)](__filename),SCANNER_DIR=a0_0x4cc32a[a0_0xe1d980(0x1f3)](__dirname,'..',a0_0xe1d980(0x212),'.scanners'),SEMGREP_VERSION=a0_0xe1d980(0x236);console['log'](a0_0xe1d980(0x221)),console[a0_0xe1d980(0x235)](a0_0xe1d980(0x21e)),console['log'](a0_0xe1d980(0x239)+process[a0_0xe1d980(0x224)]+'\x20('+process['arch']+')'),console['log'](a0_0xe1d980(0x230));async function installScanners(){const _0x265b08=a0_0xe1d980;await a0_0x66471f[_0x265b08(0x1f7)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log'](_0x265b08(0x228)),console[_0x265b08(0x235)](_0x265b08(0x20e)),console[_0x265b08(0x235)](_0x265b08(0x230));}async function checkESLintSecurity(){const _0x2dc05d=a0_0xe1d980;console[_0x2dc05d(0x235)](_0x2dc05d(0x20f));try{await import(_0x2dc05d(0x214)),console[_0x2dc05d(0x235)](_0x2dc05d(0x202));}catch(_0x3bdbeb){console[_0x2dc05d(0x235)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x2dc05d(0x235)](_0x2dc05d(0x234));}}async function installSemgrep(){const _0x32e63d=a0_0xe1d980;console['log']('🔍\x20Installing\x20Semgrep...');const _0x1ec99a=process['platform'],_0x29a018=process[_0x32e63d(0x213)];try{const _0x28b576=await execAsync(_0x32e63d(0x231),{'timeout':0x1388});console[_0x32e63d(0x235)](_0x32e63d(0x217)+_0x28b576[_0x32e63d(0x1f2)][_0x32e63d(0x1f5)]()),console[_0x32e63d(0x235)](_0x32e63d(0x1ec));return;}catch(_0x3ba3fd){console[_0x32e63d(0x235)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0x1dea9f=getSemgrepBinaryInfo(_0x1ec99a,_0x29a018);if(!_0x1dea9f){console[_0x32e63d(0x235)](_0x32e63d(0x1ff)+_0x1ec99a+'-'+_0x29a018),console[_0x32e63d(0x235)](_0x32e63d(0x21d));return;}try{const _0x543e7c=a0_0x4cc32a['join'](SCANNER_DIR,'semgrep');console[_0x32e63d(0x235)](_0x32e63d(0x205)+_0x1dea9f[_0x32e63d(0x22f)]+'...'),await downloadFile(_0x1dea9f[_0x32e63d(0x22f)],_0x543e7c),await a0_0x66471f[_0x32e63d(0x1f7)][_0x32e63d(0x21a)](_0x543e7c,0x1ed),console[_0x32e63d(0x235)](_0x32e63d(0x209)),console['log']('\x20\x20\x20Location:\x20'+_0x543e7c+'\x0a'),console['log'](_0x32e63d(0x1fd)),console[_0x32e63d(0x235)](_0x32e63d(0x20b));}catch(_0x406ecb){console[_0x32e63d(0x235)](_0x32e63d(0x237)+_0x406ecb[_0x32e63d(0x22e)]),console[_0x32e63d(0x235)]('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0x274213,_0x38aacc){return null;}async function installPythonScanners(){const _0x1cec4a=a0_0xe1d980;console[_0x1cec4a(0x235)](_0x1cec4a(0x206));let _0x28941c=null;try{await execAsync(_0x1cec4a(0x1f6),{'timeout':0x1388}),_0x28941c=_0x1cec4a(0x201);}catch(_0x391a45){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x28941c='python';}catch(_0x3b5452){console[_0x1cec4a(0x235)](_0x1cec4a(0x232)),console[_0x1cec4a(0x235)](_0x1cec4a(0x1fe)),console['log'](_0x1cec4a(0x226));return;}}console[_0x1cec4a(0x235)](_0x1cec4a(0x218)+_0x28941c),await installViaPip(_0x1cec4a(0x200),_0x28941c),await installViaPip(_0x1cec4a(0x207),_0x28941c),await installViaPip(_0x1cec4a(0x1ed),_0x28941c),await installViaPip(_0x1cec4a(0x1f4),_0x28941c),await installViaPip(_0x1cec4a(0x1ee),_0x28941c),console[_0x1cec4a(0x235)]('');}async function isHomebrewPython(_0x213cda){const _0x2495f3=a0_0xe1d980;try{const {stdout:_0x28e832}=await execAsync(_0x213cda+_0x2495f3(0x225),{'timeout':0x1388});return _0x28e832[_0x2495f3(0x222)](_0x2495f3(0x233))||_0x28e832[_0x2495f3(0x222)](_0x2495f3(0x21f));}catch{return![];}}async function installViaPip(_0x47bd87,_0x5214ce){const _0x85f596=a0_0xe1d980;try{const _0x2eb2cb=await execAsync(_0x5214ce+'\x20-m\x20pip\x20show\x20'+_0x47bd87,{'timeout':0x1388});return console[_0x85f596(0x235)]('\x20\x20\x20✅\x20'+_0x47bd87+_0x85f596(0x1ef)),!![];}catch(_0x543ed3){console['log']('\x20\x20\x20Installing\x20'+_0x47bd87+'...');try{const _0x58b653=await isHomebrewPython(_0x5214ce),_0x23ec66=_0x58b653?'':_0x85f596(0x223),_0x2af1b9=(_0x5214ce+'\x20-m\x20pip\x20install\x20'+_0x23ec66+'\x20'+_0x47bd87)['replace'](/\s+/g,'\x20')[_0x85f596(0x1f5)]();return await execAsync(_0x2af1b9,{'timeout':0xea60}),console[_0x85f596(0x235)]('\x20\x20\x20✅\x20'+_0x47bd87+_0x85f596(0x21b)),!![];}catch(_0x2ea39f){return console[_0x85f596(0x235)](_0x85f596(0x1fb)+_0x47bd87+':\x20'+_0x2ea39f[_0x85f596(0x22e)]),console[_0x85f596(0x235)](_0x85f596(0x1f0)+_0x47bd87),![];}}}async function downloadFile(_0x5effd4,_0x4d3db8){return new Promise((_0xe061c4,_0x7120a2)=>{const _0x1bee71=a0_0xdba0,_0x316da5=_0x5effd4[_0x1bee71(0x204)](_0x1bee71(0x1fc))?a0_0x560669:a0_0x54ea6f;_0x316da5[_0x1bee71(0x20d)](_0x5effd4,_0x4b4c2c=>{const _0x3d509b=_0x1bee71;if(_0x4b4c2c[_0x3d509b(0x238)]===0x12e||_0x4b4c2c['statusCode']===0x12d){downloadFile(_0x4b4c2c[_0x3d509b(0x227)][_0x3d509b(0x1f8)],_0x4d3db8)[_0x3d509b(0x21c)](_0xe061c4)['catch'](_0x7120a2);return;}if(_0x4b4c2c[_0x3d509b(0x238)]!==0xc8){_0x7120a2(new Error(_0x3d509b(0x211)+_0x4b4c2c[_0x3d509b(0x238)]));return;}const _0x52e180=createWriteStream(_0x4d3db8);_0x4b4c2c[_0x3d509b(0x22b)](_0x52e180),_0x52e180['on']('finish',()=>{_0x52e180['close'](),_0xe061c4();}),_0x52e180['on'](_0x3d509b(0x208),_0x5bd715=>{a0_0x66471f['unlink'](_0x4d3db8,()=>{}),_0x7120a2(_0x5bd715);});})['on'](_0x1bee71(0x208),_0x7120a2);});}installScanners()['catch'](_0x1ad224=>{const _0x3074c5=a0_0xe1d980;console[_0x3074c5(0x208)](_0x3074c5(0x203),_0x1ad224[_0x3074c5(0x22e)]),console[_0x3074c5(0x208)](_0x3074c5(0x22d)),console[_0x3074c5(0x208)](_0x3074c5(0x210)),console[_0x3074c5(0x208)](_0x3074c5(0x20a)),process[_0x3074c5(0x20c)](0x0);});
2
+ const a0_0x59807b=a0_0x5a87;(function(_0x58d326,_0x220031){const _0xa8523c=a0_0x5a87,_0x195cbd=_0x58d326();while(!![]){try{const _0x17b978=parseInt(_0xa8523c(0x19b))/0x1*(parseInt(_0xa8523c(0x1c2))/0x2)+parseInt(_0xa8523c(0x1b1))/0x3*(parseInt(_0xa8523c(0x1e4))/0x4)+-parseInt(_0xa8523c(0x1ce))/0x5+-parseInt(_0xa8523c(0x1b6))/0x6*(parseInt(_0xa8523c(0x1e6))/0x7)+parseInt(_0xa8523c(0x1a9))/0x8*(parseInt(_0xa8523c(0x1ad))/0x9)+-parseInt(_0xa8523c(0x1ec))/0xa*(-parseInt(_0xa8523c(0x1e1))/0xb)+-parseInt(_0xa8523c(0x1d6))/0xc*(parseInt(_0xa8523c(0x1a6))/0xd);if(_0x17b978===_0x220031)break;else _0x195cbd['push'](_0x195cbd['shift']());}catch(_0x537855){_0x195cbd['push'](_0x195cbd['shift']());}}}(a0_0x20f4,0x92b95));function a0_0x20f4(){const _0x29bd38=['python','\x20installed\x20successfully','dirname','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','\x20\x20\x20✅\x20','arch','\x20\x20\x20Location:\x20','349921bscZDG','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20\x20Installing\x20Security\x20Scanners','68MvIAxl','═══════════════════════════════════════════════════════════','5332901rxMxQX','join','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','statusCode','log','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','130KkhnUM','\x20\x20Platform:\x20','python\x20--version','503999srbAvJ','unlink','catch','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','python3\x20--version','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','stdout','node_modules','\x20\x20\x20pip\x20install\x20semgrep\x0a','includes','--user','26078rQRkUl','\x0aYou\x20can\x20manually\x20install\x20scanners:','❌\x20Installation\x20failed:','8RJMVmt','semgrep','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','promises','10320246krVfCi','...','replace','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','68097oZnmTz','location','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','checkov','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','6sBnUhA','https','🔍\x20Installing\x20Semgrep...','trim','chmod','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','message','═══════════════════════════════════════════════════════════\x0a','then','Failed\x20to\x20download:\x20HTTP\x20','\x20already\x20installed','.scanners','2ymhDLC','close','error','🐍\x20Checking\x20Python\x20scanners...','\x20-m\x20pip\x20show\x20','semgrep\x20--version','v1.55.0','python3','pipe','\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','4924945FRjnua','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','platform','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20Downloading\x20from\x20','get','eslint-plugin-security','612MjiewJ','\x20\x20\x20✅\x20Python\x20found:\x20','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','url'];a0_0x20f4=function(){return _0x29bd38;};return a0_0x20f4();}import{exec}from'child_process';import{promisify}from'util';import a0_0x308df8 from'https';import a0_0x541c11 from'http';import a0_0x21af6e from'fs';import a0_0x3248f6 from'path';import{fileURLToPath}from'url';import{createWriteStream}from'fs';import{pipeline}from'stream/promises';function a0_0x5a87(_0x1a9a95,_0x4843d2){_0x1a9a95=_0x1a9a95-0x19b;const _0x20f495=a0_0x20f4();let _0x5a872e=_0x20f495[_0x1a9a95];return _0x5a872e;}const execAsync=promisify(exec),__filename=fileURLToPath(import.meta.url),__dirname=a0_0x3248f6[a0_0x59807b(0x1dc)](__filename),SCANNER_DIR=a0_0x3248f6[a0_0x59807b(0x1e7)](__dirname,'..',a0_0x59807b(0x1a2),a0_0x59807b(0x1c1)),SEMGREP_VERSION=a0_0x59807b(0x1c8);console[a0_0x59807b(0x1ea)](a0_0x59807b(0x1e5)),console[a0_0x59807b(0x1ea)](a0_0x59807b(0x1e3)),console['log'](a0_0x59807b(0x1ed)+process['platform']+'\x20('+process[a0_0x59807b(0x1df)]+')'),console[a0_0x59807b(0x1ea)]('═══════════════════════════════════════════════════════════\x0a');async function installScanners(){const _0x20a5f3=a0_0x59807b;await a0_0x21af6e['promises']['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x20a5f3(0x1ea)]('\x0a═══════════════════════════════════════════════════════════'),console['log']('\x20\x20Installation\x20Complete'),console['log'](_0x20a5f3(0x1bd));}async function checkESLintSecurity(){const _0x16ecfb=a0_0x59807b;console['log'](_0x16ecfb(0x1eb));try{await import(_0x16ecfb(0x1d5)),console[_0x16ecfb(0x1ea)](_0x16ecfb(0x1b0));}catch(_0xfe8750){console[_0x16ecfb(0x1ea)](_0x16ecfb(0x1cc)),console[_0x16ecfb(0x1ea)](_0x16ecfb(0x1a0));}}async function installSemgrep(){const _0x44eba8=a0_0x59807b;console[_0x44eba8(0x1ea)](_0x44eba8(0x1b8));const _0x4817eb=process[_0x44eba8(0x1d1)],_0x49a342=process[_0x44eba8(0x1df)];try{const _0x8e6eaa=await execAsync(_0x44eba8(0x1c7),{'timeout':0x1388});console[_0x44eba8(0x1ea)](_0x44eba8(0x1cf)+_0x8e6eaa[_0x44eba8(0x1a1)][_0x44eba8(0x1b9)]()),console[_0x44eba8(0x1ea)](_0x44eba8(0x1d0));return;}catch(_0x5c9249){console[_0x44eba8(0x1ea)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0x126597=getSemgrepBinaryInfo(_0x4817eb,_0x49a342);if(!_0x126597){console[_0x44eba8(0x1ea)](_0x44eba8(0x1dd)+_0x4817eb+'-'+_0x49a342),console[_0x44eba8(0x1ea)](_0x44eba8(0x1e8));return;}try{const _0x5e8ec8=a0_0x3248f6[_0x44eba8(0x1e7)](SCANNER_DIR,_0x44eba8(0x1aa));console[_0x44eba8(0x1ea)](_0x44eba8(0x1d3)+_0x126597[_0x44eba8(0x1d9)]+_0x44eba8(0x1ae)),await downloadFile(_0x126597[_0x44eba8(0x1d9)],_0x5e8ec8),await a0_0x21af6e[_0x44eba8(0x1ac)][_0x44eba8(0x1ba)](_0x5e8ec8,0x1ed),console[_0x44eba8(0x1ea)]('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x44eba8(0x1ea)](_0x44eba8(0x1e0)+_0x5e8ec8+'\x0a'),console[_0x44eba8(0x1ea)](_0x44eba8(0x1d8)),console['log'](_0x44eba8(0x1a3));}catch(_0x384b0f){console['log'](_0x44eba8(0x1e2)+_0x384b0f[_0x44eba8(0x1bc)]),console[_0x44eba8(0x1ea)](_0x44eba8(0x1b3));}}function getSemgrepBinaryInfo(_0x234435,_0x29648a){return null;}async function installPythonScanners(){const _0x2de610=a0_0x59807b;console[_0x2de610(0x1ea)](_0x2de610(0x1c5));let _0x2f04d8=null;try{await execAsync(_0x2de610(0x19f),{'timeout':0x1388}),_0x2f04d8=_0x2de610(0x1c9);}catch(_0x2c09ec){try{await execAsync(_0x2de610(0x1ee),{'timeout':0x1388}),_0x2f04d8=_0x2de610(0x1da);}catch(_0x4332ca){console[_0x2de610(0x1ea)](_0x2de610(0x1bb)),console[_0x2de610(0x1ea)](_0x2de610(0x19e)),console[_0x2de610(0x1ea)]('\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a');return;}}console[_0x2de610(0x1ea)](_0x2de610(0x1d7)+_0x2f04d8),await installViaPip(_0x2de610(0x1aa),_0x2f04d8),await installViaPip('bandit',_0x2f04d8),await installViaPip('pip-audit',_0x2f04d8),await installViaPip(_0x2de610(0x1b4),_0x2f04d8),await installViaPip('yamllint',_0x2f04d8),console['log']('');}async function isHomebrewPython(_0x1333e7){const _0x17c997=a0_0x59807b;try{const {stdout:_0x45bed6}=await execAsync(_0x1333e7+_0x17c997(0x1cb),{'timeout':0x1388});return _0x45bed6[_0x17c997(0x1a4)]('/opt/homebrew')||_0x45bed6[_0x17c997(0x1a4)]('/usr/local/Cellar');}catch{return![];}}async function installViaPip(_0x15aa2a,_0x589124){const _0x10562b=a0_0x59807b;try{const _0x1f28ac=await execAsync(_0x589124+_0x10562b(0x1c6)+_0x15aa2a,{'timeout':0x1388});return console[_0x10562b(0x1ea)]('\x20\x20\x20✅\x20'+_0x15aa2a+_0x10562b(0x1c0)),!![];}catch(_0xf958e6){console[_0x10562b(0x1ea)]('\x20\x20\x20Installing\x20'+_0x15aa2a+_0x10562b(0x1ae));try{const _0x489996=await isHomebrewPython(_0x589124),_0x5a13e9=_0x489996?'':_0x10562b(0x1a5),_0x1661b6=(_0x589124+'\x20-m\x20pip\x20install\x20'+_0x5a13e9+'\x20'+_0x15aa2a)[_0x10562b(0x1af)](/\s+/g,'\x20')[_0x10562b(0x1b9)]();return await execAsync(_0x1661b6,{'timeout':0xea60}),console[_0x10562b(0x1ea)](_0x10562b(0x1de)+_0x15aa2a+_0x10562b(0x1db)),!![];}catch(_0x2497f2){return console['log'](_0x10562b(0x1cd)+_0x15aa2a+':\x20'+_0x2497f2[_0x10562b(0x1bc)]),console['log'](_0x10562b(0x1d2)+_0x15aa2a),![];}}}async function downloadFile(_0x504253,_0x311a32){return new Promise((_0xfc2d48,_0x452fa1)=>{const _0x129fdb=a0_0x5a87,_0x3d4147=_0x504253['startsWith'](_0x129fdb(0x1b7))?a0_0x308df8:a0_0x541c11;_0x3d4147[_0x129fdb(0x1d4)](_0x504253,_0x1a6add=>{const _0xa78d95=_0x129fdb;if(_0x1a6add[_0xa78d95(0x1e9)]===0x12e||_0x1a6add[_0xa78d95(0x1e9)]===0x12d){downloadFile(_0x1a6add['headers'][_0xa78d95(0x1b2)],_0x311a32)[_0xa78d95(0x1be)](_0xfc2d48)[_0xa78d95(0x19d)](_0x452fa1);return;}if(_0x1a6add[_0xa78d95(0x1e9)]!==0xc8){_0x452fa1(new Error(_0xa78d95(0x1bf)+_0x1a6add[_0xa78d95(0x1e9)]));return;}const _0xeefeb2=createWriteStream(_0x311a32);_0x1a6add[_0xa78d95(0x1ca)](_0xeefeb2),_0xeefeb2['on']('finish',()=>{const _0x2324d2=_0xa78d95;_0xeefeb2[_0x2324d2(0x1c3)](),_0xfc2d48();}),_0xeefeb2['on'](_0xa78d95(0x1c4),_0x3bec62=>{const _0x3cf421=_0xa78d95;a0_0x21af6e[_0x3cf421(0x19c)](_0x311a32,()=>{}),_0x452fa1(_0x3bec62);});})['on']('error',_0x452fa1);});}installScanners()['catch'](_0x58a672=>{const _0x10d4b9=a0_0x59807b;console['error'](_0x10d4b9(0x1a8),_0x58a672['message']),console[_0x10d4b9(0x1c4)](_0x10d4b9(0x1a7)),console[_0x10d4b9(0x1c4)](_0x10d4b9(0x1ab)),console[_0x10d4b9(0x1c4)](_0x10d4b9(0x1b5)),process['exit'](0x0);});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function a0_0x5e3b(){const _0x428527=['slice','win32','argv','147bYDwij','63SDFpiB','path','unref','toISOString','ms\x20before\x20restart...','message','--pid','\x20still\x20running\x20after\x20','join','ignore','5762580ZdMcLL','[Watchdog]\x20Parent\x20process\x20','command','pid','split','[Watchdog]\x20Error:\x20','963804tGoLCl','ms,\x20proceeding\x20anyway','\x20has\x20terminated','6198GaVMow','delay','334072FmTrLe','exit','948084djVikT','[Watchdog]\x20Executing:\x20','[Watchdog]\x20Started\x20with\x20options:','141293IsbGdZ','[Watchdog]\x20Waiting\x20','appendFileSync','4854510JYLlci','loxia\x20web','log','\x20to\x20exit...','catch','now','10opzgbQ','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','platform','--command'];a0_0x5e3b=function(){return _0x428527;};return a0_0x5e3b();}const a0_0x16a350=a0_0xfbf3;(function(_0x408048,_0x3fe22c){const _0x33746a=a0_0xfbf3,_0x3d6ae6=_0x408048();while(!![]){try{const _0x3839be=parseInt(_0x33746a(0xb8))/0x1+parseInt(_0x33746a(0xb1))/0x2*(parseInt(_0x33746a(0x9d))/0x3)+-parseInt(_0x33746a(0xae))/0x4*(-parseInt(_0x33746a(0xc1))/0x5)+-parseInt(_0x33746a(0xb5))/0x6+parseInt(_0x33746a(0x9e))/0x7*(-parseInt(_0x33746a(0xb3))/0x8)+-parseInt(_0x33746a(0xbb))/0x9+parseInt(_0x33746a(0xa8))/0xa;if(_0x3839be===_0x3fe22c)break;else _0x3d6ae6['push'](_0x3d6ae6['shift']());}catch(_0x4e55b4){_0x3d6ae6['push'](_0x3d6ae6['shift']());}}}(a0_0x5e3b,0x43e35));const {spawn,execSync}=require('child_process'),path=require(a0_0x16a350(0x9f)),fs=require('fs'),logFile=path[a0_0x16a350(0xa6)](__dirname,'watchdog.log');function log(_0x3b48e1){const _0x3163a6=a0_0x16a350,_0x247819=new Date()[_0x3163a6(0xa1)](),_0x24681f='['+_0x247819+']\x20'+_0x3b48e1+'\x0a';console[_0x3163a6(0xbd)](_0x3b48e1);try{fs[_0x3163a6(0xba)](logFile,_0x24681f);}catch(_0x1936f6){}}log('[Watchdog]\x20Script\x20loaded');function parseArgs(){const _0x1a2a83=a0_0x16a350,_0x29f297=process[_0x1a2a83(0x9c)][_0x1a2a83(0xc5)](0x2),_0x126ffe={'delay':0x1388,'command':_0x1a2a83(0xbc),'pid':null};for(let _0x56ae80=0x0;_0x56ae80<_0x29f297['length'];_0x56ae80++){switch(_0x29f297[_0x56ae80]){case'--delay':_0x126ffe[_0x1a2a83(0xb2)]=parseInt(_0x29f297[++_0x56ae80],0xa)||0x1388;break;case _0x1a2a83(0xc4):_0x126ffe[_0x1a2a83(0xaa)]=_0x29f297[++_0x56ae80]||_0x1a2a83(0xbc);break;case _0x1a2a83(0xa4):_0x126ffe[_0x1a2a83(0xab)]=parseInt(_0x29f297[++_0x56ae80],0xa)||null;break;}}return _0x126ffe;}function a0_0xfbf3(_0x6f8dd6,_0x2aa5c6){_0x6f8dd6=_0x6f8dd6-0x9c;const _0x5e3b14=a0_0x5e3b();let _0xfbf38d=_0x5e3b14[_0x6f8dd6];return _0xfbf38d;}function isProcessRunning(_0x4412e6){try{return process['kill'](_0x4412e6,0x0),!![];}catch(_0x5bd975){return![];}}async function waitForParentExit(_0x214a39,_0x57667d=0x7530){const _0x47a97d=a0_0x16a350;if(!_0x214a39)return;const _0x378218=Date[_0x47a97d(0xc0)]();while(isProcessRunning(_0x214a39)){if(Date['now']()-_0x378218>_0x57667d){log(_0x47a97d(0xa9)+_0x214a39+_0x47a97d(0xa5)+_0x57667d+_0x47a97d(0xaf));return;}await new Promise(_0x41273e=>setTimeout(_0x41273e,0x1f4));}log(_0x47a97d(0xa9)+_0x214a39+_0x47a97d(0xb0));}async function main(){const _0x327db8=a0_0x16a350,_0x1504a5=parseArgs();log(_0x327db8(0xb7),{'delay':_0x1504a5[_0x327db8(0xb2)],'command':_0x1504a5[_0x327db8(0xaa)],'pid':_0x1504a5[_0x327db8(0xab)]});_0x1504a5[_0x327db8(0xab)]&&(log(_0x327db8(0xc2)+_0x1504a5[_0x327db8(0xab)]+_0x327db8(0xbe)),await waitForParentExit(_0x1504a5[_0x327db8(0xab)]));log(_0x327db8(0xb9)+_0x1504a5[_0x327db8(0xb2)]+_0x327db8(0xa2)),await new Promise(_0x2caa62=>setTimeout(_0x2caa62,_0x1504a5[_0x327db8(0xb2)]));const _0x5b4d96=_0x1504a5[_0x327db8(0xaa)][_0x327db8(0xac)]('\x20'),_0x4326a8=_0x5b4d96[0x0],_0x24c8df=_0x5b4d96['slice'](0x1);log(_0x327db8(0xb6)+_0x4326a8+'\x20'+_0x24c8df[_0x327db8(0xa6)]('\x20'));const _0x336a4f=process[_0x327db8(0xc3)]===_0x327db8(0xc6),_0xe45af7=spawn(_0x4326a8,_0x24c8df,{'detached':!![],'stdio':_0x327db8(0xa7),'shell':!![],'windowsHide':![]});_0xe45af7[_0x327db8(0xa0)](),log('[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20'+_0xe45af7[_0x327db8(0xab)]),log('[Watchdog]\x20Watchdog\x20exiting...'),setTimeout(()=>process['exit'](0x0),0x3e8);}main()[a0_0x16a350(0xbf)](_0x2a796a=>{const _0x30efe6=a0_0x16a350;log(_0x30efe6(0xad)+_0x2a796a[_0x30efe6(0xa3)]),process[_0x30efe6(0xb4)](0x1);});
2
+ const a0_0x59e339=a0_0xe18d;(function(_0x450ea5,_0x4bb1b2){const _0x446071=a0_0xe18d,_0x2bf3b3=_0x450ea5();while(!![]){try{const _0x4a6f97=parseInt(_0x446071(0x73))/0x1*(-parseInt(_0x446071(0x7b))/0x2)+-parseInt(_0x446071(0x8b))/0x3+parseInt(_0x446071(0x76))/0x4*(-parseInt(_0x446071(0x8c))/0x5)+-parseInt(_0x446071(0x86))/0x6+-parseInt(_0x446071(0x78))/0x7+parseInt(_0x446071(0x82))/0x8*(parseInt(_0x446071(0x8a))/0x9)+parseInt(_0x446071(0x70))/0xa;if(_0x4a6f97===_0x4bb1b2)break;else _0x2bf3b3['push'](_0x2bf3b3['shift']());}catch(_0x482c35){_0x2bf3b3['push'](_0x2bf3b3['shift']());}}}(a0_0x5c9c,0x4753a));const {spawn,execSync}=require(a0_0x59e339(0x8e)),path=require(a0_0x59e339(0x94)),fs=require('fs'),logFile=path[a0_0x59e339(0x93)](__dirname,a0_0x59e339(0x7c));function log(_0x52d9ca){const _0x44ba72=a0_0x59e339,_0x191201=new Date()[_0x44ba72(0x7d)](),_0x55382f='['+_0x191201+']\x20'+_0x52d9ca+'\x0a';console[_0x44ba72(0x90)](_0x52d9ca);try{fs['appendFileSync'](logFile,_0x55382f);}catch(_0x222e9e){}}log(a0_0x59e339(0x89));function a0_0x5c9c(){const _0x373c95=['\x20has\x20terminated','1289010JXhCue','--delay','slice','[Watchdog]\x20Script\x20loaded','9DlYxUo','899802TWKJmh','4615zryzhL','argv','child_process','ms,\x20proceeding\x20anyway','log','exit','ignore','join','path','--command','loxia\x20web','[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20','[Watchdog]\x20Parent\x20process\x20','17693320wLcrXp','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','delay','1DwvEcy','[Watchdog]\x20Error:\x20','\x20still\x20running\x20after\x20','2416ALUVOt','ms\x20before\x20restart...','3244318scXDBZ','[Watchdog]\x20Waiting\x20','split','178912ikSpqV','watchdog.log','toISOString','unref','platform','command','length','1184104dLcbFR','pid','[Watchdog]\x20Executing:\x20'];a0_0x5c9c=function(){return _0x373c95;};return a0_0x5c9c();}function parseArgs(){const _0x130077=a0_0x59e339,_0x233713=process[_0x130077(0x8d)][_0x130077(0x88)](0x2),_0x31f0f0={'delay':0x1388,'command':_0x130077(0x6d),'pid':null};for(let _0x5c7c4a=0x0;_0x5c7c4a<_0x233713[_0x130077(0x81)];_0x5c7c4a++){switch(_0x233713[_0x5c7c4a]){case _0x130077(0x87):_0x31f0f0[_0x130077(0x72)]=parseInt(_0x233713[++_0x5c7c4a],0xa)||0x1388;break;case _0x130077(0x95):_0x31f0f0[_0x130077(0x80)]=_0x233713[++_0x5c7c4a]||_0x130077(0x6d);break;case'--pid':_0x31f0f0[_0x130077(0x83)]=parseInt(_0x233713[++_0x5c7c4a],0xa)||null;break;}}return _0x31f0f0;}function isProcessRunning(_0xb77a45){try{return process['kill'](_0xb77a45,0x0),!![];}catch(_0x273291){return![];}}async function waitForParentExit(_0x2da092,_0x4a6f63=0x7530){const _0x477999=a0_0x59e339;if(!_0x2da092)return;const _0x4d2d37=Date['now']();while(isProcessRunning(_0x2da092)){if(Date['now']()-_0x4d2d37>_0x4a6f63){log(_0x477999(0x6f)+_0x2da092+_0x477999(0x75)+_0x4a6f63+_0x477999(0x8f));return;}await new Promise(_0x4498b4=>setTimeout(_0x4498b4,0x1f4));}log(_0x477999(0x6f)+_0x2da092+_0x477999(0x85));}function a0_0xe18d(_0x4f6c13,_0x36a124){_0x4f6c13=_0x4f6c13-0x6d;const _0x5c9c43=a0_0x5c9c();let _0xe18de2=_0x5c9c43[_0x4f6c13];return _0xe18de2;}async function main(){const _0x109e28=a0_0x59e339,_0x4e3f4c=parseArgs();log('[Watchdog]\x20Started\x20with\x20options:',{'delay':_0x4e3f4c[_0x109e28(0x72)],'command':_0x4e3f4c['command'],'pid':_0x4e3f4c['pid']});_0x4e3f4c[_0x109e28(0x83)]&&(log(_0x109e28(0x71)+_0x4e3f4c[_0x109e28(0x83)]+'\x20to\x20exit...'),await waitForParentExit(_0x4e3f4c[_0x109e28(0x83)]));log(_0x109e28(0x79)+_0x4e3f4c[_0x109e28(0x72)]+_0x109e28(0x77)),await new Promise(_0x4916d7=>setTimeout(_0x4916d7,_0x4e3f4c[_0x109e28(0x72)]));const _0x3cdac9=_0x4e3f4c['command'][_0x109e28(0x7a)]('\x20'),_0x48c25f=_0x3cdac9[0x0],_0x5d6f5c=_0x3cdac9[_0x109e28(0x88)](0x1);log(_0x109e28(0x84)+_0x48c25f+'\x20'+_0x5d6f5c[_0x109e28(0x93)]('\x20'));const _0x1252e4=process[_0x109e28(0x7f)]==='win32',_0x159310=spawn(_0x48c25f,_0x5d6f5c,{'detached':!![],'stdio':_0x109e28(0x92),'shell':!![],'windowsHide':![]});_0x159310[_0x109e28(0x7e)](),log(_0x109e28(0x6e)+_0x159310[_0x109e28(0x83)]),log('[Watchdog]\x20Watchdog\x20exiting...'),setTimeout(()=>process[_0x109e28(0x91)](0x0),0x3e8);}main()['catch'](_0x427773=>{const _0x171a8e=a0_0x59e339;log(_0x171a8e(0x74)+_0x427773['message']),process[_0x171a8e(0x91)](0x1);});
@@ -1 +1 @@
1
- function a0_0x490b(_0x143adb,_0x195bd3){_0x143adb=_0x143adb-0x122;const _0x4e7a2c=a0_0x4e7a();let _0x490b74=_0x4e7a2c[_0x143adb];if(a0_0x490b['iTWiqF']===undefined){var _0x488037=function(_0x43e621){const _0x5cddbb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x391660='',_0x6dab52='';for(let _0x4f3faa=0x0,_0x49f72b,_0x4c7bb8,_0x8b9e45=0x0;_0x4c7bb8=_0x43e621['charAt'](_0x8b9e45++);~_0x4c7bb8&&(_0x49f72b=_0x4f3faa%0x4?_0x49f72b*0x40+_0x4c7bb8:_0x4c7bb8,_0x4f3faa++%0x4)?_0x391660+=String['fromCharCode'](0xff&_0x49f72b>>(-0x2*_0x4f3faa&0x6)):0x0){_0x4c7bb8=_0x5cddbb['indexOf'](_0x4c7bb8);}for(let _0x206fac=0x0,_0x55c3b3=_0x391660['length'];_0x206fac<_0x55c3b3;_0x206fac++){_0x6dab52+='%'+('00'+_0x391660['charCodeAt'](_0x206fac)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6dab52);};a0_0x490b['LKgKXM']=_0x488037,a0_0x490b['fdjfPb']={},a0_0x490b['iTWiqF']=!![];}const _0x103c46=_0x4e7a2c[0x0],_0x7b4e63=_0x143adb+_0x103c46,_0x143a5a=a0_0x490b['fdjfPb'][_0x7b4e63];return!_0x143a5a?(_0x490b74=a0_0x490b['LKgKXM'](_0x490b74),a0_0x490b['fdjfPb'][_0x7b4e63]=_0x490b74):_0x490b74=_0x143a5a,_0x490b74;}const a0_0x2d3683=a0_0x490b;function a0_0x4e7a(){const _0x3a29f2=['zM9Y','zgv0zwn0tgfUz3vHz2u','q0furuDpuLK','C2v2zxjPDhK','l15JDxn0B20TlW','zxjYB3i','zg91yMXL','BM8TAw52ywXPza','BgvUz3rO','Aw5JBhvKzxm','mty3m1zczvnRzq','Cg9ZDgnZCY1SzxnZ','q1ntigfUywX5C2LZigzHAwXLza','BgvZCW','mZyYnde3nfLoyLnuEG','yw5HBhL6zq','zM9YBwf0ug9ZDentu0vYCM9Y','u0vwrvjjvfK','Cg9ZDgnZCY1Zy3nZ','Dw5RBM93BG','BgLUzq','ntiYnJrQyKfsDuG','v0fstKLorW','rvjst1i','mZiZmZeZmvnsBfvzrW','zxH0zw5K','y29UDgvUDa','C3vWCg9YDhnbDxrVrML4','D2fYBMLUz3m','Cg9ZDgnZCW','Dgv4Da','C3r5BgvSAw50','ChvZAa','zMLSDgvY','zgvMyxvSDa','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','Cg9ZDgnZC0XLC3m','C2nZCW','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','CMvZDwX0CW','ChjVy2vZCW','Bg9Nz2vY','mteYmZu2nKXewfrYqq','Cg9ZDgnZC1nJC3m','ndbMuMTAtMu','ntqXnZG1tLvkuhHX','nJq4ogzkCMrYta','Dg9mB3DLCKnHC2u','zM9YD2fYza','q3nZu3LUDgf4rxjYB3i','nda5nwreCfHTsa','zgvIDwC','lMnZCW','y2HLy2TtEw50yxG','u1Lovefy','zwfJAa','zw5KC1DPDgG','CgX1z2LU','mZy5mdaWow50wuTpra','BgLUDfn0EwXLCW','BM8Tzw1WDhK','CNvSzq','BwvZC2fNzq','nMjRBNDwsG'];a0_0x4e7a=function(){return _0x3a29f2;};return a0_0x4e7a();}(function(_0xc0e69a,_0x2c1586){const _0x5f63eb=a0_0x490b,_0x3b9063=_0xc0e69a();while(!![]){try{const _0x576077=parseInt(_0x5f63eb(0x135))/0x1*(parseInt(_0x5f63eb(0x147))/0x2)+parseInt(_0x5f63eb(0x132))/0x3+parseInt(_0x5f63eb(0x136))/0x4*(-parseInt(_0x5f63eb(0x13a))/0x5)+-parseInt(_0x5f63eb(0x156))/0x6+parseInt(_0x5f63eb(0x152))/0x7*(parseInt(_0x5f63eb(0x15d))/0x8)+parseInt(_0x5f63eb(0x142))/0x9+-parseInt(_0x5f63eb(0x134))/0xa*(parseInt(_0x5f63eb(0x160))/0xb);if(_0x576077===_0x2c1586)break;else _0x3b9063['push'](_0x3b9063['shift']());}catch(_0x41fde1){_0x3b9063['push'](_0x3b9063['shift']());}}}(a0_0x4e7a,0xd2b9e));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x391660=null){const _0x532fcd=a0_0x490b;this[_0x532fcd(0x131)]=_0x391660,this['stylelint']=null,this[_0x532fcd(0x125)]=null,this[_0x532fcd(0x133)]=null,this['postcssLess']=null;}async[a0_0x2d3683(0x157)](_0x6dab52,_0x4f3faa,_0x49f72b={}){const _0x557067=a0_0x2d3683;try{const _0x4c7bb8=[],_0x8b9e45=this['detectLanguage'](_0x6dab52),_0x206fac=await this[_0x557067(0x13d)](_0x6dab52,_0x4f3faa,_0x8b9e45);_0x4c7bb8['push'](..._0x206fac);if(_0x206fac[_0x557067(0x150)]===0x0){const _0x55c3b3=await this['lintStyles'](_0x6dab52,_0x4f3faa,_0x8b9e45);_0x4c7bb8[_0x557067(0x128)](..._0x55c3b3);}return this[_0x557067(0x131)]?.[_0x557067(0x13b)]('CSS\x20analysis\x20completed',{'file':_0x6dab52,'language':_0x8b9e45,'totalDiagnostics':_0x4c7bb8[_0x557067(0x150)],'errors':_0x4c7bb8[_0x557067(0x129)](_0x1c8209=>_0x1c8209[_0x557067(0x14b)]===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x4c7bb8[_0x557067(0x129)](_0x4408b7=>_0x4408b7['severity']===STATIC_ANALYSIS['SEVERITY'][_0x557067(0x15e)])[_0x557067(0x150)]}),_0x4c7bb8;}catch(_0x5954c1){return this[_0x557067(0x131)]?.['error'](_0x557067(0x154),{'file':_0x6dab52,'error':_0x5954c1[_0x557067(0x146)]}),[];}}async[a0_0x2d3683(0x13d)](_0x4dca6b,_0x10b524,_0x14e7ae){const _0x10942b=a0_0x2d3683,_0x585616=[];try{if(!this[_0x10942b(0x125)]){const _0x24a452=await import(_0x10942b(0x125));this['postcss']=_0x24a452[_0x10942b(0x12a)];}let _0x182bf8=null;if(_0x14e7ae==='scss'){if(!this['postcssScss']){const _0x2b3a76=await import('postcss-scss');this['postcssScss']=_0x2b3a76['default'];}_0x182bf8=this[_0x10942b(0x133)];}else{if(_0x14e7ae==='less'){if(!this['postcssLess']){const _0x2add54=await import(_0x10942b(0x153));this[_0x10942b(0x12c)]=_0x2add54[_0x10942b(0x12a)];}_0x182bf8=this[_0x10942b(0x12c)];}}const _0x2ec3b8=this[_0x10942b(0x125)]()[_0x10942b(0x130)](_0x10b524,{'from':_0x4dca6b,'syntax':_0x182bf8}),_0x5d3885=_0x2ec3b8['root'];this['logger']?.[_0x10942b(0x13b)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x4dca6b});}catch(_0x1666f8){const _0x2c4a29=this['formatPostCSSError'](_0x1666f8,_0x4dca6b);_0x2c4a29&&_0x585616['push'](_0x2c4a29);}return _0x585616;}async[a0_0x2d3683(0x143)](_0x10e53e,_0x4a1fff,_0x10a1d1){const _0x42705a=a0_0x2d3683,_0x2ddf41=[];try{if(!this[_0x42705a(0x127)]){const _0x3b99a1=await import('stylelint');this['stylelint']=_0x3b99a1['default'];}const _0x4c16a5={'extends':[_0x42705a(0x12e)],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':[_0x42705a(0x14c),'ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x10a1d1==='scss'?[!![],{'ignoreAtRules':['mixin','include',_0x42705a(0x161),'if','else',_0x42705a(0x148),_0x42705a(0x13f),'while','function','return',_0x42705a(0x122),'use',_0x42705a(0x138)]}]:_0x10a1d1===_0x42705a(0x155)?[!![],{'ignoreAtRules':[_0x42705a(0x141)]}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':_0x42705a(0x14e),'selector-type-case':'lower'},'customSyntax':_0x10a1d1==='scss'?_0x42705a(0x15a):_0x10a1d1==='less'?_0x42705a(0x153):undefined},_0x225e0e=await this['stylelint']['lint']({'code':_0x4a1fff,'codeFilename':_0x10e53e,'config':_0x4c16a5});if(_0x225e0e[_0x42705a(0x12f)]&&_0x225e0e['results'][_0x42705a(0x150)]>0x0){const _0x53a4dc=_0x225e0e['results'][0x0];if(_0x53a4dc[_0x42705a(0x124)])for(const _0x4d7b6d of _0x53a4dc['warnings']){_0x2ddf41[_0x42705a(0x128)]({'file':_0x10e53e,'line':_0x4d7b6d[_0x42705a(0x15c)]||0x1,'column':_0x4d7b6d['column']||0x1,'severity':_0x4d7b6d[_0x42705a(0x14b)]===_0x42705a(0x14d)?STATIC_ANALYSIS[_0x42705a(0x159)][_0x42705a(0x15f)]:STATIC_ANALYSIS[_0x42705a(0x159)][_0x42705a(0x15e)],'rule':_0x4d7b6d['rule']||_0x42705a(0x15b),'message':_0x4d7b6d[_0x42705a(0x126)],'category':this[_0x42705a(0x12b)](_0x4d7b6d[_0x42705a(0x145)]),'fixable':![],'source':'stylelint'});}}}catch(_0x3ca870){this['logger']?.['warn']('Stylelint\x20analysis\x20failed',{'file':_0x10e53e,'error':_0x3ca870['message']});}return _0x2ddf41;}[a0_0x2d3683(0x158)](_0x3b46eb,_0xc46b84){const _0x1f03d5=a0_0x2d3683;return{'file':_0xc46b84,'line':_0x3b46eb['line']||0x1,'column':_0x3b46eb['column']||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x3b46eb['name']||_0x1f03d5(0x139),'message':_0x3b46eb['reason']||_0x3b46eb['message'],'category':STATIC_ANALYSIS[_0x1f03d5(0x14a)]['SYNTAX'],'fixable':![],'source':_0x1f03d5(0x125),'code':_0x3b46eb['source']||undefined};}[a0_0x2d3683(0x12b)](_0x27dd9b){const _0x2789a2=a0_0x2d3683;if(!_0x27dd9b)return STATIC_ANALYSIS[_0x2789a2(0x14a)]['STYLE'];const _0x4fa650=_0x27dd9b[_0x2789a2(0x137)]();if(_0x4fa650['includes'](_0x2789a2(0x14f))||_0x4fa650['includes']('no-unknown')||_0x4fa650[_0x2789a2(0x151)](_0x2789a2(0x144))||_0x4fa650['includes']('syntax'))return STATIC_ANALYSIS[_0x2789a2(0x14a)][_0x2789a2(0x13e)];if(_0x4fa650[_0x2789a2(0x151)]('performance')||_0x4fa650['includes']('optimize'))return STATIC_ANALYSIS['CATEGORY']['PERFORMANCE'];if(_0x4fa650['includes']('best-practice')||_0x4fa650[_0x2789a2(0x151)]('recommended'))return STATIC_ANALYSIS[_0x2789a2(0x14a)]['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x2789a2(0x14a)]['STYLE'];}[a0_0x2d3683(0x149)](_0x2c676e){const _0x14d1ac=a0_0x2d3683,_0xf563c1=_0x2c676e['toLowerCase']();if(_0xf563c1['endsWith']('.scss')||_0xf563c1[_0x14d1ac(0x140)]('.sass'))return _0x14d1ac(0x12d);if(_0xf563c1[_0x14d1ac(0x140)]('.less'))return'less';return'css';}['getSupportedExtensions'](){const _0x48c4ae=a0_0x2d3683;return[_0x48c4ae(0x13c),'.scss','.sass','.less'];}[a0_0x2d3683(0x123)](){return![];}}export default CSSAnalyzer;
1
+ function a0_0xeb27(){const _0x34c55e=['lNnHC3m','qKvtvf9quKfdveLdrq','lMnZCW','zMLSDgvY','y29SDw1U','BwL4Aw4','zxjYB3i','yw5HBhL6zq','Cg9ZDgnZC0XLC3m','Bg9Nz2vY','CgvYzM9YBwfUy2u','zgv0zwn0tgfUz3vHz2u','CMv0DxjU','Cg9ZDgnZCY1SzxnZ','zM9Y','BgLUDa','zM9YBwf0ug9ZDentu0vYCM9Y','C3r5BgvSAw50','mtiYoda3nhfQrej4sW','DxnL','mtK0mdKXmhP3Afj3sW','nty3nJC4vLLRzun4','D2fYBMLUz3m','Cg9ZDgnZCY1Zy3nZ','zgvMyxvSDa','q0furuDpuLK','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','CNvSzq','zwfJAa','BwvZC2fNzq','Cg9ZDgnZC1nJC3m','D2HPBgu','ndK4wwLMy2Dx','q1ntigfUywX5C2LZigzHAwXLza','CMvJB21Tzw5Kzwq','D2fYBG','mZm3mZuXmMHouuPnAa','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','CMvHC29U','Dgv4Da','Bg93zxi','zg91yMXL','lMXLC3m','BgLUDfn0EwXLCW','Cg9ZDgnZCW','Aw5JBhvKzxm','u1rzteu','ChvZAa','C2nZCW','mtGZnZu3n3HLq0HTtG','BMCTzgvLCa','lNnJC3m','mZjgCeLVsK0','BM8Tzw1WDhK','BgLUzq','q1ntigfUywX5C2LZignVBxbSzxrLza','y2HLy2TtEw50yxG','nfPzvLDmzq','C2v2zxjPDhK','BgvZCW','Dw5RBM93BG','u0vwrvjjvfK','mZe1nZCYmK9tvKn1Aa','ntG5mtvyyM9WtKS','BgvUz3rO','C291CMnL','B3b0Aw1PEMu'];a0_0xeb27=function(){return _0x34c55e;};return a0_0xeb27();}function a0_0x4960(_0x434357,_0x4b7769){_0x434357=_0x434357-0x17e;const _0xeb27e=a0_0xeb27();let _0x49603d=_0xeb27e[_0x434357];if(a0_0x4960['QAkUSd']===undefined){var _0x3048f6=function(_0x2d03a5){const _0x5102fd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ded8a='',_0x3ae097='';for(let _0x12c347=0x0,_0x3b26ce,_0x4dfa72,_0x1e34f5=0x0;_0x4dfa72=_0x2d03a5['charAt'](_0x1e34f5++);~_0x4dfa72&&(_0x3b26ce=_0x12c347%0x4?_0x3b26ce*0x40+_0x4dfa72:_0x4dfa72,_0x12c347++%0x4)?_0x3ded8a+=String['fromCharCode'](0xff&_0x3b26ce>>(-0x2*_0x12c347&0x6)):0x0){_0x4dfa72=_0x5102fd['indexOf'](_0x4dfa72);}for(let _0x17271c=0x0,_0x34b0aa=_0x3ded8a['length'];_0x17271c<_0x34b0aa;_0x17271c++){_0x3ae097+='%'+('00'+_0x3ded8a['charCodeAt'](_0x17271c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3ae097);};a0_0x4960['GFfakY']=_0x3048f6,a0_0x4960['LhnssD']={},a0_0x4960['QAkUSd']=!![];}const _0xec0613=_0xeb27e[0x0],_0x496500=_0x434357+_0xec0613,_0x17e87b=a0_0x4960['LhnssD'][_0x496500];return!_0x17e87b?(_0x49603d=a0_0x4960['GFfakY'](_0x49603d),a0_0x4960['LhnssD'][_0x496500]=_0x49603d):_0x49603d=_0x17e87b,_0x49603d;}const a0_0x3e3436=a0_0x4960;(function(_0x19d880,_0x5d7cba){const _0x1a2e71=a0_0x4960,_0x796768=_0x19d880();while(!![]){try{const _0xded729=parseInt(_0x1a2e71(0x1b5))/0x1+-parseInt(_0x1a2e71(0x196))/0x2*(parseInt(_0x1a2e71(0x1b2))/0x3)+parseInt(_0x1a2e71(0x180))/0x4+parseInt(_0x1a2e71(0x19c))/0x5*(parseInt(_0x1a2e71(0x1c0))/0x6)+parseInt(_0x1a2e71(0x18e))/0x7*(-parseInt(_0x1a2e71(0x191))/0x8)+parseInt(_0x1a2e71(0x19b))/0x9+-parseInt(_0x1a2e71(0x1b4))/0xa;if(_0xded729===_0x5d7cba)break;else _0x796768['push'](_0x796768['shift']());}catch(_0x139e8e){_0x796768['push'](_0x796768['shift']());}}}(a0_0xeb27,0xa54bc));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x3ded8a=null){const _0x672f86=a0_0x4960;this['logger']=_0x3ded8a,this[_0x672f86(0x1b1)]=null,this['postcss']=null,this['postcssScss']=null,this['postcssLess']=null;}async[a0_0x3e3436(0x1a7)](_0x3ae097,_0x12c347,_0x3b26ce={}){const _0xc3ba8d=a0_0x3e3436;try{const _0x4dfa72=[],_0x1e34f5=this['detectLanguage'](_0x3ae097),_0x17271c=await this[_0xc3ba8d(0x195)](_0x3ae097,_0x12c347,_0x1e34f5);_0x4dfa72[_0xc3ba8d(0x18c)](..._0x17271c);if(_0x17271c['length']===0x0){const _0x34b0aa=await this[_0xc3ba8d(0x188)](_0x3ae097,_0x12c347,_0x1e34f5);_0x4dfa72[_0xc3ba8d(0x18c)](..._0x34b0aa);}return this[_0xc3ba8d(0x1a9)]?.['debug'](_0xc3ba8d(0x194),{'file':_0x3ae097,'language':_0x1e34f5,'totalDiagnostics':_0x4dfa72['length'],'errors':_0x4dfa72['filter'](_0x254c8c=>_0x254c8c['severity']===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x4dfa72[_0xc3ba8d(0x1a3)](_0x5adb1e=>_0x5adb1e[_0xc3ba8d(0x197)]===STATIC_ANALYSIS['SEVERITY']['WARNING'])[_0xc3ba8d(0x19d)]}),_0x4dfa72;}catch(_0x6fa557){return this['logger']?.['error'](_0xc3ba8d(0x1c1),{'file':_0x3ae097,'error':_0x6fa557[_0xc3ba8d(0x1bd)]}),[];}}async['checkSyntax'](_0x228534,_0x268d13,_0x45d337){const _0x44910d=a0_0x3e3436,_0x109b12=[];try{if(!this['postcss']){const _0x222a89=await import('postcss');this[_0x44910d(0x189)]=_0x222a89['default'];}let _0x1088d9=null;if(_0x45d337===_0x44910d(0x18d)){if(!this['postcssScss']){const _0x55a8db=await import('postcss-scss');this['postcssScss']=_0x55a8db[_0x44910d(0x1b8)];}_0x1088d9=this[_0x44910d(0x1be)];}else{if(_0x45d337===_0x44910d(0x198)){if(!this['postcssLess']){const _0x7ea9e4=await import(_0x44910d(0x1ad));this[_0x44910d(0x1a8)]=_0x7ea9e4['default'];}_0x1088d9=this['postcssLess'];}}const _0x179ba7=this[_0x44910d(0x189)]()['process'](_0x268d13,{'from':_0x228534,'syntax':_0x1088d9}),_0x52c6e4=_0x179ba7['root'];this['logger']?.['debug'](_0x44910d(0x181),{'file':_0x228534});}catch(_0x4b0c20){const _0x1d4c6c=this[_0x44910d(0x1b0)](_0x4b0c20,_0x228534);_0x1d4c6c&&_0x109b12[_0x44910d(0x18c)](_0x1d4c6c);}return _0x109b12;}async[a0_0x3e3436(0x188)](_0x53c743,_0x1090f3,_0x420940){const _0xc2f0b5=a0_0x3e3436,_0x380b9b=[];try{if(!this[_0xc2f0b5(0x1b1)]){const _0x3792fd=await import(_0xc2f0b5(0x1b1));this['stylelint']=_0x3792fd[_0xc2f0b5(0x1b8)];}const _0xc7ceef={'extends':[_0xc2f0b5(0x1ba)],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':['/^custom-/',_0xc2f0b5(0x18f)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x420940===_0xc2f0b5(0x18d)?[!![],{'ignoreAtRules':[_0xc2f0b5(0x1a5),'include','extend','if','else',_0xc2f0b5(0x1ae),_0xc2f0b5(0x1bc),_0xc2f0b5(0x1bf),'function',_0xc2f0b5(0x1ac),'content',_0xc2f0b5(0x1b3),'forward']}]:_0x420940==='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':_0xc2f0b5(0x186),'selector-type-case':_0xc2f0b5(0x185)},'customSyntax':_0x420940==='scss'?_0xc2f0b5(0x1b7):_0x420940==='less'?_0xc2f0b5(0x1ad):undefined},_0x14b671=await this[_0xc2f0b5(0x1b1)][_0xc2f0b5(0x1af)]({'code':_0x1090f3,'codeFilename':_0x53c743,'config':_0xc7ceef});if(_0x14b671['results']&&_0x14b671['results'][_0xc2f0b5(0x19d)]>0x0){const _0x453331=_0x14b671['results'][0x0];if(_0x453331[_0xc2f0b5(0x1b6)])for(const _0x4874fc of _0x453331[_0xc2f0b5(0x1b6)]){_0x380b9b[_0xc2f0b5(0x18c)]({'file':_0x53c743,'line':_0x4874fc[_0xc2f0b5(0x193)]||0x1,'column':_0x4874fc['column']||0x1,'severity':_0x4874fc[_0xc2f0b5(0x197)]===_0xc2f0b5(0x1a6)?STATIC_ANALYSIS['SEVERITY']['ERROR']:STATIC_ANALYSIS[_0xc2f0b5(0x19a)]['WARNING'],'rule':_0x4874fc[_0xc2f0b5(0x1bb)]||_0xc2f0b5(0x199),'message':_0x4874fc[_0xc2f0b5(0x184)],'category':this['categorizeStylelintRule'](_0x4874fc[_0xc2f0b5(0x1bb)]),'fixable':![],'source':_0xc2f0b5(0x1b1)});}}}catch(_0x4a691f){this[_0xc2f0b5(0x1a9)]?.[_0xc2f0b5(0x17f)](_0xc2f0b5(0x182),{'file':_0x53c743,'error':_0x4a691f[_0xc2f0b5(0x1bd)]});}return _0x380b9b;}['formatPostCSSError'](_0x380c4f,_0x1d7a5e){const _0x49ef40=a0_0x3e3436;return{'file':_0x1d7a5e,'line':_0x380c4f[_0x49ef40(0x193)]||0x1,'column':_0x380c4f[_0x49ef40(0x1a4)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x380c4f['name']||'CssSyntaxError','message':_0x380c4f[_0x49ef40(0x183)]||_0x380c4f[_0x49ef40(0x1bd)],'category':STATIC_ANALYSIS[_0x49ef40(0x1b9)]['SYNTAX'],'fixable':![],'source':'postcss','code':_0x380c4f[_0x49ef40(0x19e)]||undefined};}['categorizeStylelintRule'](_0x21eaa5){const _0x26362a=a0_0x3e3436;if(!_0x21eaa5)return STATIC_ANALYSIS[_0x26362a(0x1b9)][_0x26362a(0x18b)];const _0x535663=_0x21eaa5['toLowerCase']();if(_0x535663[_0x26362a(0x18a)]('no-invalid')||_0x535663['includes']('no-unknown')||_0x535663['includes'](_0x26362a(0x192))||_0x535663[_0x26362a(0x18a)]('syntax'))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x535663['includes'](_0x26362a(0x1aa))||_0x535663['includes'](_0x26362a(0x19f)))return STATIC_ANALYSIS[_0x26362a(0x1b9)]['PERFORMANCE'];if(_0x535663[_0x26362a(0x18a)]('best-practice')||_0x535663['includes'](_0x26362a(0x17e)))return STATIC_ANALYSIS['CATEGORY'][_0x26362a(0x1a1)];return STATIC_ANALYSIS['CATEGORY'][_0x26362a(0x18b)];}[a0_0x3e3436(0x1ab)](_0x587829){const _0x405c7c=a0_0x3e3436,_0x574a5b=_0x587829['toLowerCase']();if(_0x574a5b['endsWith'](_0x405c7c(0x190))||_0x574a5b['endsWith']('.sass'))return'scss';if(_0x574a5b['endsWith'](_0x405c7c(0x187)))return _0x405c7c(0x198);return'css';}['getSupportedExtensions'](){const _0x22f2ba=a0_0x3e3436;return[_0x22f2ba(0x1a2),'.scss',_0x22f2ba(0x1a0),_0x22f2ba(0x187)];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
@@ -1 +1 @@
1
- function a0_0x445f(_0x5e9a15,_0x36e80b){_0x5e9a15=_0x5e9a15-0x1e6;const _0x37cee3=a0_0x37ce();let _0x445f10=_0x37cee3[_0x5e9a15];if(a0_0x445f['rIjIvf']===undefined){var _0x506f18=function(_0x5ef6c1){const _0x1de4d8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3cc598='',_0xa8af1f='';for(let _0x2ba567=0x0,_0x44c8ee,_0xc72de4,_0x5b99=0x0;_0xc72de4=_0x5ef6c1['charAt'](_0x5b99++);~_0xc72de4&&(_0x44c8ee=_0x2ba567%0x4?_0x44c8ee*0x40+_0xc72de4:_0xc72de4,_0x2ba567++%0x4)?_0x3cc598+=String['fromCharCode'](0xff&_0x44c8ee>>(-0x2*_0x2ba567&0x6)):0x0){_0xc72de4=_0x1de4d8['indexOf'](_0xc72de4);}for(let _0x19d7f2=0x0,_0x524771=_0x3cc598['length'];_0x19d7f2<_0x524771;_0x19d7f2++){_0xa8af1f+='%'+('00'+_0x3cc598['charCodeAt'](_0x19d7f2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xa8af1f);};a0_0x445f['onrLgK']=_0x506f18,a0_0x445f['hNvXHL']={},a0_0x445f['rIjIvf']=!![];}const _0x5b4e44=_0x37cee3[0x0],_0x46e60a=_0x5e9a15+_0x5b4e44,_0x542858=a0_0x445f['hNvXHL'][_0x46e60a];return!_0x542858?(_0x445f10=a0_0x445f['onrLgK'](_0x445f10),a0_0x445f['hNvXHL'][_0x46e60a]=_0x445f10):_0x445f10=_0x542858,_0x445f10;}const a0_0x357114=a0_0x445f;(function(_0x34ba18,_0x51e985){const _0x51e9cd=a0_0x445f,_0x1fa6ec=_0x34ba18();while(!![]){try{const _0x331058=parseInt(_0x51e9cd(0x202))/0x1*(-parseInt(_0x51e9cd(0x249))/0x2)+-parseInt(_0x51e9cd(0x241))/0x3*(-parseInt(_0x51e9cd(0x1e7))/0x4)+parseInt(_0x51e9cd(0x200))/0x5+parseInt(_0x51e9cd(0x220))/0x6+parseInt(_0x51e9cd(0x203))/0x7*(-parseInt(_0x51e9cd(0x210))/0x8)+-parseInt(_0x51e9cd(0x22c))/0x9*(-parseInt(_0x51e9cd(0x25e))/0xa)+-parseInt(_0x51e9cd(0x1ec))/0xb*(parseInt(_0x51e9cd(0x1ef))/0xc);if(_0x331058===_0x51e985)break;else _0x1fa6ec['push'](_0x1fa6ec['shift']());}catch(_0x2a042b){_0x1fa6ec['push'](_0x1fa6ec['shift']());}}}(a0_0x37ce,0x96116));import{exec}from'child_process';import{promisify}from'util';import a0_0x3cc598 from'path';import a0_0xa8af1f from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x37ce(){const _0x6891d6=['ywP2','zg9JA2vYlwnVBxbVC2uUEwfTBa','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','Dg9mB3DLCKnHC2u','y2HLy2TVDIaTlxzLCNnPB24','CgfYC2vdAgvJA292uMvZDwX0CW','BwvKAxvT','y3DL','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','mtHqthnpt0K','AgfKB2XPBNqGls12zxjZAw9U','zxH0BMfTzq','zw5KC1DPDgG','BwfW','iIaTlwzYyw1LD29YAYa','BwfWq2HLy2TVDLnLDMvYAxr5','C3rKB3v0','DhjPBq','zgvMyxvSDa','BM9YBwfSAxPLuMvZDwX0CW','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','y29Kzq','C3rHCNrZv2L0Aa','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','y29TCgLSzxjpChrPB25Z','z2L0AhvIlwfJDgLVBNm','zg9JA2vYlwnVBxbVC2u','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','DMfSAwrHDgvfBNzgAwXL','otnirvflCuG','EwfTBgXPBNq','y2HLy2TVDG','DhnJB25MAwCTDMfSAwrHDg9Y','CgfYC2u','ywP2icHku09oifnJAgvTysK','y2HLy2TVDIbKzxrLy3rLza','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','nejNzxnAvG','Aw5ZDgfUy2vqyxrO','zg9JA2vYlwnVBxbVC2uUEw1S','wufntcbMAwXLihzHBgLKyxrPB24','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','C3LUDgf4','DMfSAwrHDgvxAxrOq2HLy2TVDG','Aw5JBhvKzxm','DMfSAwrHDgvqywnRywDLsNnVBG','lNrMDMfYCW','DMfSAwrHDgvuC0nVBMzPzW','BwfWsgfKB2XPBNrtzxzLCML0Eq','C3bSAxq','B2jQzwn0','DMfSAwrHDgu','y2HLy2TVDIaTzIaI','DhnJB25MAwCUANnVBG','C2vJCMv0','Dw5RBM93BG','ANnVBLnJAgvTyq','C3rYAw5N','mteXmJiWy25oCe5o','y2HLy2TFBMfTzq','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','Bwf0y2G','zxjYB3i','DMfSAwrHDg9Y','ANnVBI1Zy2HLBwe','BwfWwwfTBgXPBNrtzxzLCML0Eq','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','mtaYmti0vMrpuwni','A3vIzxjUzxrLCW','Bg9Nz2vY','C3rYAwn0','CgfYC2viywrVBgLUDfjLC3vSDhm','nZKXmti3n2DOreHSuW','su5gtW','CgLWigLUC3rHBgWGEwfTBgXPBNq','mtjpDNDOtfi','BgvUz3rO','AgfKB2XPBNq','CgfYyw1Z','ug90zw50AwfSigHHCMrJB2rLzca','ywP2lwzVCM1HDhm','zxjYB3jZ','DgvYCMfMB3jT','lNrM','DMvYC2LVBG','ChvZAa','CgfJA2fNzs5QC29U','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','DMfSAwrHDgLVBG','yMvZDc1WCMfJDgLJzq','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','yxzHAwXHyMXLu2nHBM5LCNm','ndi1nJy1mfneB2PrEq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','mZuWmZeXu3jhruLl','n0TpvKfLuq','rvjst1i','CMvTzwrPyxrPB24','CMvHzezPBgu','C2v2zxjPDhK','zMfPBgvKx2nOzwnRCW','zgvIDwC','BM9jBxbSAwnPDefUEq','EwfTBa','v0fstKLorW','zgv0zwn0rMLSzvr5Cgu','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','mZa5ndaWofPgtML3Cq','BwvZC2fNzq','CMvZDwX0CW','zw52lxzHBgLKyxrVCG','zgLYBMfTzq','DMfSAwrHDgvzqu1m','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','zw52','u0vwrvjjvfK','zg9JA2vYzMLSzq','z3vPzgvSAw5L','y2HHBMDLBwu','ANnVBI1WyxjZzq','qvDtignYzwrLBNrPywXZ','C2vJDxjPDhK','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','nduZnZmZogrAtLPtuW','yMfZzw5HBwu','DMfSAwrHDgveB2nRzxjMAwXL'];a0_0x37ce=function(){return _0x6891d6;};return a0_0x37ce();}const execAsync=promisify(exec);class ConfigValidator{constructor(_0x2ba567=null){const _0x11c664=a0_0x445f;this[_0x11c664(0x1e9)]=_0x2ba567,this[_0x11c664(0x1ff)]=null,this['scannerCache']=new Map();}async[a0_0x357114(0x24d)](){const _0x4c4fe7=a0_0x357114;if(this['availableScanners']!==null)return this[_0x4c4fe7(0x1ff)];const _0x44c8ee={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x4c4fe7(0x227),{'timeout':0x1388}),_0x44c8ee[_0x4c4fe7(0x243)]=!![],this[_0x4c4fe7(0x1e9)]?.['debug'](_0x4c4fe7(0x247));}catch(_0xc72de4){this['logger']?.[_0x4c4fe7(0x209)](_0x4c4fe7(0x23b),{'error':_0xc72de4[_0x4c4fe7(0x211)]});}try{await execAsync(_0x4c4fe7(0x22d),{'timeout':0x1388}),_0x44c8ee['hadolint']=!![],this['logger']?.[_0x4c4fe7(0x209)]('hadolint\x20detected');}catch(_0x5b99){this[_0x4c4fe7(0x1e9)]?.['debug']('hadolint\x20not\x20available',{'error':_0x5b99[_0x4c4fe7(0x211)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x44c8ee['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x19d7f2){this['logger']?.[_0x4c4fe7(0x209)]('yamllint\x20not\x20available',{'error':_0x19d7f2[_0x4c4fe7(0x211)]});}try{await import(_0x4c4fe7(0x223)),_0x44c8ee[_0x4c4fe7(0x25c)]=!![],this['logger']?.['debug'](_0x4c4fe7(0x238));}catch(_0x524771){this[_0x4c4fe7(0x1e9)]?.[_0x4c4fe7(0x209)]('ajv\x20not\x20available',{'error':_0x524771[_0x4c4fe7(0x211)]});}return this[_0x4c4fe7(0x1ff)]=_0x44c8ee,_0x44c8ee;}async[a0_0x357114(0x257)](_0xc7bdca,_0x2cddf5={}){const _0x322b76=a0_0x357114,_0x151955=[],_0x3fca87=await this['detectAvailableValidators'](),_0x50d62b=this['detectFileType'](_0xc7bdca);this[_0x322b76(0x1e9)]?.[_0x322b76(0x209)]('Validating\x20config\x20file',{'filePath':_0xc7bdca,'fileType':_0x50d62b});switch(_0x50d62b){case _0x322b76(0x219):if(_0x3fca87[_0x322b76(0x1f1)]){const _0x94f5f5=await this[_0x322b76(0x222)](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x94f5f5);}if(_0x3fca87[_0x322b76(0x243)]){const _0x5570ee=await this[_0x322b76(0x24f)](_0xc7bdca,'dockerfile',_0x2cddf5);_0x151955['push'](..._0x5570ee);}break;case _0x322b76(0x23e):if(_0x3fca87[_0x322b76(0x242)]){const _0x262fbc=await this[_0x322b76(0x215)](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x262fbc);}if(_0x3fca87[_0x322b76(0x243)]){const _0x4bfe33=await this['validateWithCheckov'](_0xc7bdca,'docker_compose',_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x4bfe33);}break;case'kubernetes':if(_0x3fca87[_0x322b76(0x242)]){const _0xd3f0f5=await this['validateYAML'](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xd3f0f5);}if(_0x3fca87['checkov']){const _0x39f867=await this['validateWithCheckov'](_0xc7bdca,_0x322b76(0x1e8),_0x2cddf5);_0x151955['push'](..._0x39f867);}break;case _0x322b76(0x1f6):if(_0x3fca87[_0x322b76(0x243)]){const _0x5a59eb=await this['validateWithCheckov'](_0xc7bdca,'terraform',_0x2cddf5);_0x151955['push'](..._0x5a59eb);}break;case _0x322b76(0x1fa):if(_0x3fca87[_0x322b76(0x25c)]){const _0x4fb5a3=await this[_0x322b76(0x251)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0x4fb5a3);}break;case'tsconfig.json':if(_0x3fca87['jsonSchema']){const _0xee9b06=await this[_0x322b76(0x253)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xee9b06);}break;case'github-actions':if(_0x3fca87[_0x322b76(0x242)]){const _0xc5ae3f=await this[_0x322b76(0x215)](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0xc5ae3f);}break;case'env':const _0x6df047=await this['validateEnvFile'](_0xc7bdca,_0x2cddf5);_0x151955['push'](..._0x6df047);break;case'yaml':if(_0x3fca87['yamllint']){const _0x4304d9=await this['validateYAML'](_0xc7bdca,_0x2cddf5);_0x151955[_0x322b76(0x1f9)](..._0x4304d9);}break;default:this['logger']?.['warn'](_0x322b76(0x23f),{'filePath':_0xc7bdca,'fileType':_0x50d62b});return[];}return this[_0x322b76(0x236)](_0x151955);}async[a0_0x357114(0x222)](_0x299844,_0x7b9b08={}){const _0x14bd93=a0_0x357114;try{const _0x92e72b=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x299844+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x5e5fc0=JSON['parse'](_0x92e72b['stdout']);return this[_0x14bd93(0x1eb)](_0x5e5fc0,_0x299844);}catch(_0x5520cd){if(_0x5520cd[_0x14bd93(0x233)])try{const _0x8b68b2=JSON[_0x14bd93(0x245)](_0x5520cd[_0x14bd93(0x233)]);return this[_0x14bd93(0x1eb)](_0x8b68b2,_0x299844);}catch(_0x47f908){this['logger']?.[_0x14bd93(0x262)]('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x47f908[_0x14bd93(0x211)]});}return this[_0x14bd93(0x1e9)]?.['error'](_0x14bd93(0x1fe),{'error':_0x5520cd[_0x14bd93(0x211)]}),[];}}[a0_0x357114(0x1eb)](_0x44b46c,_0x424791){const _0x4a9ce6=a0_0x357114,_0x1a7c68=[];if(Array['isArray'](_0x44b46c))for(const _0x3a0949 of _0x44b46c){_0x1a7c68['push']({'file':_0x424791,'line':_0x3a0949['line']||0x1,'column':_0x3a0949['column']||0x1,'severity':this['mapHadolintSeverity'](_0x3a0949['level']),'rule':_0x3a0949[_0x4a9ce6(0x239)],'message':_0x3a0949['message'],'category':'dockerfile','validator':_0x4a9ce6(0x1f1)});}return _0x1a7c68;}async[a0_0x357114(0x215)](_0x416508,_0x2a3f1a={}){const _0x4e376b=a0_0x357114;try{const _0xf4a5ae=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x416508+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x4e376b(0x201)](_0xf4a5ae[_0x4e376b(0x233)],_0x416508);}catch(_0x45beed){if(_0x45beed[_0x4e376b(0x233)])return this[_0x4e376b(0x201)](_0x45beed['stdout'],_0x416508);return this[_0x4e376b(0x1e9)]?.[_0x4e376b(0x262)](_0x4e376b(0x1e6),{'error':_0x45beed['message']}),[];}}['parseYamllintResults'](_0x1e29f6,_0x4f47f7){const _0xede58b=a0_0x357114,_0x155b51=[],_0x538b21=_0x1e29f6['split']('\x0a')['filter'](_0xdcbb9a=>_0xdcbb9a[_0xede58b(0x234)]());for(const _0x20ba80 of _0x538b21){const _0x3c2a6b=_0x20ba80[_0xede58b(0x261)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x3c2a6b){const [,_0x5213c1,_0x113c96,_0x4c50dc,_0x93f7dd,_0x2dde65,_0x470103]=_0x3c2a6b;_0x155b51['push']({'file':_0x4f47f7,'line':parseInt(_0x113c96,0xa),'column':parseInt(_0x4c50dc,0xa),'severity':this[_0xede58b(0x265)](_0x93f7dd),'rule':_0x470103,'message':_0x2dde65,'category':'yaml','validator':_0xede58b(0x242)});}}return _0x155b51;}async['validateWithCheckov'](_0x5d1af4,_0xf0cc90,_0x2674a4={}){const _0x29cf0f=a0_0x357114;try{const _0x2dff01=await execAsync(_0x29cf0f(0x258)+_0x5d1af4+_0x29cf0f(0x231)+_0xf0cc90+_0x29cf0f(0x248),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x354848=JSON[_0x29cf0f(0x245)](_0x2dff01['stdout']);return this[_0x29cf0f(0x228)](_0x354848,_0x5d1af4);}catch(_0x78e98e){if(_0x78e98e['stdout'])try{const _0x1b3176=JSON[_0x29cf0f(0x245)](_0x78e98e['stdout']);return this['parseCheckovResults'](_0x1b3176,_0x5d1af4);}catch(_0x5194ab){this['logger']?.['error'](_0x29cf0f(0x22b),{'error':_0x5194ab[_0x29cf0f(0x211)]});}return this['logger']?.[_0x29cf0f(0x262)]('checkov\x20validation\x20failed',{'error':_0x78e98e['message']}),[];}}['parseCheckovResults'](_0xbba814,_0x27d057){const _0x1a70dc=a0_0x357114,_0x4bda0d=[];if(_0xbba814[_0x1a70dc(0x212)]&&_0xbba814['results'][_0x1a70dc(0x208)])for(const _0x23f48a of _0xbba814[_0x1a70dc(0x212)][_0x1a70dc(0x208)]){_0x4bda0d['push']({'file':_0x27d057,'line':_0x23f48a['file_line_range']?_0x23f48a['file_line_range'][0x0]:0x1,'column':0x1,'severity':this[_0x1a70dc(0x232)](_0x23f48a['check_class']),'rule':_0x23f48a['check_id'],'message':_0x23f48a[_0x1a70dc(0x25f)]||_0x23f48a['check_id'],'category':_0x1a70dc(0x21e),'validator':_0x1a70dc(0x243),'remediation':_0x23f48a[_0x1a70dc(0x21a)],'cwe':_0x23f48a['cwe'],'references':_0x23f48a['guideline']?[_0x23f48a['guideline']]:[]});}return _0x4bda0d;}async[a0_0x357114(0x251)](_0x2f4101,_0x494d43={}){const _0x2916f0=a0_0x357114;try{const _0x6555c8=(await import('ajv'))[_0x2916f0(0x235)],_0x5ed3eb=(await import(_0x2916f0(0x1f4)))[_0x2916f0(0x235)],_0x5c2a07=await a0_0xa8af1f['readFile'](_0x2f4101,'utf-8'),_0x3a972a=JSON['parse'](_0x5c2a07),_0x9c4ff9=new _0x6555c8({'allErrors':!![],'strict':![]});_0x5ed3eb(_0x9c4ff9);const _0x16b388={'type':'object','required':['name',_0x2916f0(0x1f8)],'properties':{'name':{'type':_0x2916f0(0x25d),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':_0x2916f0(0x25d)},'main':{'type':'string'},'type':{'type':'string','enum':['module','commonjs']},'scripts':{'type':_0x2916f0(0x256)},'dependencies':{'type':'object'},'devDependencies':{'type':_0x2916f0(0x256)}},'additionalProperties':!![]},_0x19493e=_0x9c4ff9['compile'](_0x16b388),_0x505e77=_0x19493e(_0x3a972a);if(!_0x505e77&&_0x19493e['errors'])return _0x19493e[_0x2916f0(0x1f5)][_0x2916f0(0x230)](_0x18d8be=>({'file':_0x2f4101,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2916f0(0x218)][_0x2916f0(0x204)],'rule':_0x2916f0(0x264),'message':_0x18d8be['instancePath']?_0x18d8be[_0x2916f0(0x24a)]+'\x20'+_0x18d8be['message']:'must\x20have\x20required\x20property\x20\x27'+_0x18d8be[_0x2916f0(0x1f2)]['missingProperty']+'\x27','category':_0x2916f0(0x1fc),'validator':'json-schema'}));return[];}catch(_0x285775){return this[_0x2916f0(0x1e9)]?.['error'](_0x2916f0(0x20f),{'error':_0x285775[_0x2916f0(0x211)]}),[{'file':_0x2f4101,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2916f0(0x218)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x285775[_0x2916f0(0x211)],'category':'syntax','validator':_0x2916f0(0x21c)}];}}async[a0_0x357114(0x253)](_0x31321d,_0xa685ea={}){const _0x226b60=a0_0x357114;try{const _0x28b922=await a0_0xa8af1f[_0x226b60(0x206)](_0x31321d,'utf-8'),_0x54706a=JSON['parse'](_0x28b922),_0x138565=[];if(_0x54706a['compilerOptions']){const _0x5ca1bd=_0x54706a[_0x226b60(0x23c)];!_0x5ca1bd[_0x226b60(0x1ea)]&&_0x138565[_0x226b60(0x1f9)]({'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x226b60(0x218)][_0x226b60(0x20c)],'rule':'strict-mode','message':_0x226b60(0x225),'category':_0x226b60(0x1fd),'validator':'tsconfig-validator'}),_0x5ca1bd[_0x226b60(0x20a)]===![]&&_0x138565['push']({'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':_0x226b60(0x244)});}return _0x138565;}catch(_0x37c614){return this[_0x226b60(0x1e9)]?.[_0x226b60(0x262)]('tsconfig.json\x20validation\x20failed',{'error':_0x37c614['message']}),[{'file':_0x31321d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x226b60(0x204)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x37c614['message'],'category':_0x226b60(0x24e),'validator':'json-parse'}];}}async[a0_0x357114(0x240)](_0x47620d,_0x10096b={}){const _0x2c053d=a0_0x357114;try{const _0x2d5247=await a0_0xa8af1f['readFile'](_0x47620d,'utf-8'),_0x4a5c7f=[],_0xfa391e=_0x2d5247[_0x2c053d(0x255)]('\x0a'),_0x35c8c9=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':_0x2c053d(0x25a)},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x2c053d(0x21d)}];return _0xfa391e['forEach']((_0x4dafba,_0x39d221)=>{const _0xb5a835=_0x2c053d,_0xd92cdf=_0x4dafba[_0xb5a835(0x234)]();if(!_0xd92cdf||_0xd92cdf[_0xb5a835(0x23a)]('#'))return;if(_0xd92cdf['includes']('=')){const [_0x38af11,_0x3a97b1]=_0xd92cdf[_0xb5a835(0x255)]('='),_0x5db324=_0x38af11[_0xb5a835(0x226)](),_0x188b8b=_0x3a97b1?.[_0xb5a835(0x234)]()||'',_0x5a050e=_0x188b8b&&_0x188b8b!==''&&!_0x188b8b[_0xb5a835(0x23a)]('$')&&_0x188b8b!=='your-key-here'&&_0x188b8b!==_0xb5a835(0x21b)&&_0x188b8b[_0xb5a835(0x1f0)]>0x5;if(_0x5a050e)for(const {pattern:_0x14606d,name:_0x111852}of _0x35c8c9){if(_0x14606d['test'](_0x5db324)){_0x4a5c7f['push']({'file':_0x47620d,'line':_0x39d221+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xb5a835(0x218)]['CRITICAL'],'rule':'hardcoded-secret','message':_0xb5a835(0x1f3)+_0x111852+'\x20detected\x20in\x20.env\x20file','category':'security','validator':_0xb5a835(0x213),'remediation':_0xb5a835(0x1fb)});break;}}}}),_0x4a5c7f;}catch(_0x26993e){return this[_0x2c053d(0x1e9)]?.['error'](_0x2c053d(0x216),{'error':_0x26993e[_0x2c053d(0x211)]}),[];}}[a0_0x357114(0x20d)](_0x104fe2){const _0x3767e8=a0_0x357114,_0x544351=a0_0x3cc598[_0x3767e8(0x221)](_0x104fe2)[_0x3767e8(0x226)](),_0x1e04b2=a0_0x3cc598[_0x3767e8(0x214)](_0x104fe2);if(_0x544351==='dockerfile')return'dockerfile';if(_0x544351===_0x3767e8(0x24b)||_0x544351===_0x3767e8(0x224))return'docker-compose';if(_0x544351==='package.json')return _0x3767e8(0x1fa);if(_0x544351===_0x3767e8(0x259))return'tsconfig.json';if(_0x544351==='.env'||_0x544351[_0x3767e8(0x22f)]('.env'))return _0x3767e8(0x217);if(_0x1e04b2[_0x3767e8(0x250)]('.github/workflows'))return _0x3767e8(0x23d);if(_0x1e04b2[_0x3767e8(0x250)]('kubernetes')||_0x1e04b2[_0x3767e8(0x250)]('k8s'))return'kubernetes';const _0x5b374a=a0_0x3cc598[_0x3767e8(0x22e)](_0x104fe2)[_0x3767e8(0x226)]();if(_0x5b374a===_0x3767e8(0x1f7)||_0x5b374a===_0x3767e8(0x252))return'terraform';if(_0x5b374a==='.yml'||_0x5b374a==='.yaml')return _0x3767e8(0x20b);if(_0x5b374a==='.json')return'json';return'unknown';}[a0_0x357114(0x236)](_0x1a7cae){const _0x480392=a0_0x357114;return _0x1a7cae['map'](_0x37f721=>({'file':_0x37f721['file'],'line':_0x37f721['line']||0x1,'column':_0x37f721['column']||0x1,'severity':_0x37f721[_0x480392(0x207)]||STATIC_ANALYSIS[_0x480392(0x218)]['WARNING'],'rule':_0x37f721['rule']||_0x480392(0x25b),'message':_0x37f721[_0x480392(0x211)]||_0x480392(0x21f),'category':_0x37f721['category']||_0x480392(0x1fc),'validator':_0x37f721[_0x480392(0x263)],'cwe':_0x37f721[_0x480392(0x22a)]||null,'remediation':_0x37f721[_0x480392(0x205)]||null,'references':_0x37f721['references']||[]}));}[a0_0x357114(0x254)](_0x1b4da5){const _0x437e05=a0_0x357114,_0xb966bd={'error':STATIC_ANALYSIS[_0x437e05(0x218)]['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS[_0x437e05(0x218)][_0x437e05(0x1ed)],'style':STATIC_ANALYSIS[_0x437e05(0x218)][_0x437e05(0x1ed)]};return _0xb966bd[_0x1b4da5?.['toLowerCase']()]||STATIC_ANALYSIS[_0x437e05(0x218)]['WARNING'];}[a0_0x357114(0x265)](_0x273bc9){const _0x210bf5=a0_0x357114,_0x3c466a={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x210bf5(0x218)]['WARNING']};return _0x3c466a[_0x273bc9?.['toLowerCase']()]||STATIC_ANALYSIS[_0x210bf5(0x218)][_0x210bf5(0x20c)];}[a0_0x357114(0x232)](_0x5db6b7){const _0x5f3f31=a0_0x357114;return STATIC_ANALYSIS[_0x5f3f31(0x218)][_0x5f3f31(0x204)];}async['getValidatorStatus'](){const _0x2b024a=a0_0x357114,_0x102f9d=await this[_0x2b024a(0x24d)]();return{'validators':_0x102f9d,'recommendations':this['getInstallRecommendations'](_0x102f9d)};}[a0_0x357114(0x237)](_0x32248f){const _0x3f6821=a0_0x357114,_0x3abaf3=[];return!_0x32248f[_0x3f6821(0x243)]&&_0x3abaf3['push']({'validator':_0x3f6821(0x243),'reason':_0x3f6821(0x20e),'install':'pip\x20install\x20checkov','priority':'high'}),!_0x32248f['hadolint']&&_0x3abaf3['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x32248f['yamllint']&&_0x3abaf3[_0x3f6821(0x1f9)]({'validator':'yamllint','reason':_0x3f6821(0x24c),'install':_0x3f6821(0x1ee),'priority':_0x3f6821(0x229)}),!_0x32248f['jsonSchema']&&_0x3abaf3[_0x3f6821(0x1f9)]({'validator':_0x3f6821(0x246),'reason':_0x3f6821(0x260),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x3f6821(0x229)}),_0x3abaf3;}}export default ConfigValidator;
1
+ const a0_0x43f094=a0_0x38e9;(function(_0x1caf43,_0x154377){const _0x3e1497=a0_0x38e9,_0xbf6cd4=_0x1caf43();while(!![]){try{const _0x11784a=parseInt(_0x3e1497(0xfa))/0x1*(-parseInt(_0x3e1497(0x121))/0x2)+-parseInt(_0x3e1497(0xc9))/0x3*(parseInt(_0x3e1497(0xce))/0x4)+-parseInt(_0x3e1497(0xc6))/0x5*(-parseInt(_0x3e1497(0x137))/0x6)+-parseInt(_0x3e1497(0xd3))/0x7*(-parseInt(_0x3e1497(0x120))/0x8)+parseInt(_0x3e1497(0xc1))/0x9+parseInt(_0x3e1497(0x10c))/0xa+parseInt(_0x3e1497(0xfb))/0xb*(-parseInt(_0x3e1497(0x125))/0xc);if(_0x11784a===_0x154377)break;else _0xbf6cd4['push'](_0xbf6cd4['shift']());}catch(_0x5b7a99){_0xbf6cd4['push'](_0xbf6cd4['shift']());}}}(a0_0x126b,0x3dd0d));import{exec}from'child_process';function a0_0x38e9(_0x3a55b7,_0x49af43){_0x3a55b7=_0x3a55b7-0xbe;const _0x126b63=a0_0x126b();let _0x38e901=_0x126b63[_0x3a55b7];if(a0_0x38e9['ZzJsCB']===undefined){var _0x20c335=function(_0x4bec53){const _0x414cbc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4a4298='',_0x1c9f43='';for(let _0x4f772f=0x0,_0x519737,_0x1f229b,_0x39ca1e=0x0;_0x1f229b=_0x4bec53['charAt'](_0x39ca1e++);~_0x1f229b&&(_0x519737=_0x4f772f%0x4?_0x519737*0x40+_0x1f229b:_0x1f229b,_0x4f772f++%0x4)?_0x4a4298+=String['fromCharCode'](0xff&_0x519737>>(-0x2*_0x4f772f&0x6)):0x0){_0x1f229b=_0x414cbc['indexOf'](_0x1f229b);}for(let _0x3ae52c=0x0,_0x19436c=_0x4a4298['length'];_0x3ae52c<_0x19436c;_0x3ae52c++){_0x1c9f43+='%'+('00'+_0x4a4298['charCodeAt'](_0x3ae52c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c9f43);};a0_0x38e9['skVdtp']=_0x20c335,a0_0x38e9['nWswLY']={},a0_0x38e9['ZzJsCB']=!![];}const _0x1e8d8f=_0x126b63[0x0],_0x78dda3=_0x3a55b7+_0x1e8d8f,_0x2f5477=a0_0x38e9['nWswLY'][_0x78dda3];return!_0x2f5477?(_0x38e901=a0_0x38e9['skVdtp'](_0x38e901),a0_0x38e9['nWswLY'][_0x78dda3]=_0x38e901):_0x38e901=_0x2f5477,_0x38e901;}import{promisify}from'util';import a0_0x4a4298 from'path';function a0_0x126b(){const _0x22ad6d=['BwfW','lNrMDMfYCW','AgLNAa','CgfYC2vzyw1SBgLUDfjLC3vSDhm','lNrM','DMfSAwrHDgu','ChvZAa','z3vPzgvSAw5L','lMvUDG','zg9JA2vYzMLSzq','zgv0zwn0rMLSzvr5Cgu','y29SDw1U','DhjPBq','DMfSAwrHDgveB2nRzxjMAwXL','BM9jBxbSAwnPDefUEq','BgLUzq','DxrMltG','C2vJCMv0','DgvYCMfMB3jT','z2L0AhvIlwfJDgLVBNm','DMfSAwrHDgvzqu1m','EwfTBgXPBNqGls12zxjZAw9U','y2HLy2TVDIaTzIaI','Aw5ZDgfUy2vqyxrO','BwfWsgfKB2XPBNrtzxzLCML0Eq','C3rKB3v0','AgfKB2XPBNqGzgv0zwn0zwq','y2HLy2TFy2XHC3m','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','zMLSzv9SAw5Lx3jHBMDL','D2fYBG','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','BwfWwwfTBgXPBNrtzxzLCML0Eq','igrLDgvJDgvKigLUic5LBNyGzMLSzq','BwvZC2fNzq','muzSwNvtta','mtiXr0XcAeDK','wufntcbMAwXLihzHBgLKyxrPB24','BwfWq2HLy2TVDLnLDMvYAxr5','EwfTBgXPBNqGBM90igf2ywLSywjSzq','Dw5RBM93BG','y29TCgLSzq','C2vJDxjPDhK','BgvUz3rO','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','y2f0zwDVCNK','lNLHBwW','A3vIzxjUzxrLCW','C3rHCNrZv2L0Aa','zw52lxzHBgLKyxrVCG','ANnVBLnJAgvTyq','yxzHAwXHyMXLu2nHBM5LCNm','CgfYC2u','mZGXnZyXmer6sMn6tq','zMLSDgvY','DMvYC2LVBG','B2jQzwn0','C2v2zxjPDhK','y29Kzq','ANnVBI1WyxjZzq','y2HLy2TVDIbKzxrLy3rLza','BM9YBwfSAxPLuMvZDwX0CW','ANnVBG','C3LUDgf4','rvjst1i','yMfZzw5HBwu','Ew91CI1RzxKTAgvYzq','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','ywP2ig5VDcbHDMfPBgfIBgu','yMvZDc1WCMfJDgLJzq','DhnJB25MAwCUANnVBG','sw52ywXPzcbku09ooIa','zxH0BMfTzq','mtG0s1nyBMLq','mJyZmJK4sKPwAeP0','y29TCgLSzxjpChrPB25Z','zxjYB3i','y2HHBMDLBwu','ndi0mZq0rgHmCwXj','DMfSAwrHDgvuC0nVBMzPzW','lNLTBa','zg9JA2vYlwnVBxbVC2u','zgvMyxvSDa','Dg9mB3DLCKnHC2u','zM9YrwfJAa','u0vwrvjjvfK','AgfKB2XPBNq','y2HLy2TVDG','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','CgfYC2viywrVBgLUDfjLC3vSDhm','zxjYB3jZ','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','ChjPDMf0zsbRzxK','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','lMPZB24','nMv3Ae9stG','zMfPBgvKx2nOzwnRCW','q1jjveLdquW','CMvTzwrPyxrPB24','mtC2mtKZowTTvMPYCa','Bw9KDwXL','Bg9Nz2vY','EwfTBgXPBNq','ANnVBI1Zy2HLBwe','mty0nJiWmg5MAK51wa','DMfSAwrHDgvqywnRywDLsNnVBG','ywP2','mtmWmdCZmxD0rKTXCW','CMvZDwX0CW','Aw5JBhvKzxm','CMvMzxjLBMnLCW','C3rYAw5N','nhnOqMzJAG','DMfSAwrHDgvfBNzgAwXL','zgvIDwC','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','CMvHzezPBgu','ote0otDSEujmEhu','DMfSAwrHDgvxAxrOq2HLy2TVDG','EwfTBa','Dg9Rzw4'];a0_0x126b=function(){return _0x22ad6d;};return a0_0x126b();}import a0_0x1c9f43 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x4f772f=null){const _0x32ec8c=a0_0x38e9;this[_0x32ec8c(0xc3)]=_0x4f772f,this['availableScanners']=null,this['scannerCache']=new Map();}async[a0_0x43f094(0x135)](){const _0x2353a0=a0_0x43f094;if(this[_0x2353a0(0x10a)]!==null)return this['availableScanners'];const _0x519737={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x519737[_0x2353a0(0x12e)]=!![],this[_0x2353a0(0xc3)]?.['debug'](_0x2353a0(0x113));}catch(_0x1f229b){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x1f229b['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x519737['hadolint']=!![],this['logger']?.['debug'](_0x2353a0(0xf1));}catch(_0x39ca1e){this['logger']?.[_0x2353a0(0xd0)]('hadolint\x20not\x20available',{'error':_0x39ca1e[_0x2353a0(0xf9)]});}try{await execAsync(_0x2353a0(0xec),{'timeout':0x1388}),_0x519737['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x3ae52c){this['logger']?.['debug'](_0x2353a0(0xfe),{'error':_0x3ae52c[_0x2353a0(0xf9)]});}try{await import(_0x2353a0(0xc8)),_0x519737['jsonSchema']=!![],this[_0x2353a0(0xc3)]?.[_0x2353a0(0xd0)]('JSON\x20Schema\x20validation\x20available');}catch(_0x19436c){this['logger']?.[_0x2353a0(0xd0)](_0x2353a0(0x11b),{'error':_0x19436c[_0x2353a0(0xf9)]});}return this['availableScanners']=_0x519737,_0x519737;}async[a0_0x43f094(0xdc)](_0x18935,_0x51eae5={}){const _0x445ecf=a0_0x43f094,_0x140e2b=[],_0x54165e=await this[_0x445ecf(0x135)](),_0x51c614=this[_0x445ecf(0xe1)](_0x18935);this['logger']?.['debug']('Validating\x20config\x20file',{'filePath':_0x18935,'fileType':_0x51c614});switch(_0x51c614){case'dockerfile':if(_0x54165e['hadolint']){const _0x2541a7=await this[_0x445ecf(0xe4)](_0x18935,_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x2541a7);}if(_0x54165e[_0x445ecf(0x12e)]){const _0x265fa8=await this['validateWithCheckov'](_0x18935,_0x445ecf(0xe0),_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x265fa8);}break;case _0x445ecf(0x128):if(_0x54165e['yamllint']){const _0x3b6669=await this[_0x445ecf(0xeb)](_0x18935,_0x51eae5);_0x140e2b['push'](..._0x3b6669);}if(_0x54165e[_0x445ecf(0x12e)]){const _0x55d070=await this[_0x445ecf(0xd4)](_0x18935,'docker_compose',_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x55d070);}break;case'kubernetes':if(_0x54165e['yamllint']){const _0x52ef2d=await this['validateYAML'](_0x18935,_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x52ef2d);}if(_0x54165e[_0x445ecf(0x12e)]){const _0x12af82=await this[_0x445ecf(0xd4)](_0x18935,_0x445ecf(0x106),_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x12af82);}break;case'terraform':if(_0x54165e['checkov']){const _0x25c74f=await this['validateWithCheckov'](_0x18935,_0x445ecf(0xe9),_0x51eae5);_0x140e2b['push'](..._0x25c74f);}break;case'package.json':if(_0x54165e[_0x445ecf(0x109)]){const _0x39baa0=await this[_0x445ecf(0xc7)](_0x18935,_0x51eae5);_0x140e2b['push'](..._0x39baa0);}break;case _0x445ecf(0x11d):if(_0x54165e[_0x445ecf(0x109)]){const _0x36c604=await this['validateTsConfig'](_0x18935,_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x36c604);}break;case _0x445ecf(0xea):if(_0x54165e[_0x445ecf(0xc4)]){const _0x3bda00=await this[_0x445ecf(0xeb)](_0x18935,_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x3bda00);}break;case'env':const _0x36c149=await this[_0x445ecf(0xcf)](_0x18935,_0x51eae5);_0x140e2b[_0x445ecf(0xdd)](..._0x36c149);break;case'yaml':if(_0x54165e[_0x445ecf(0xc4)]){const _0xa4856e=await this[_0x445ecf(0xeb)](_0x18935,_0x51eae5);_0x140e2b['push'](..._0xa4856e);}break;default:this['logger']?.[_0x445ecf(0xf5)]('Unknown\x20config\x20file\x20type',{'filePath':_0x18935,'fileType':_0x51c614});return[];}return this['normalizeResults'](_0x140e2b);}async['validateDockerfile'](_0x191c4c,_0x11c47={}){const _0x18a7b4=a0_0x43f094;try{const _0x3bb5d2=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x191c4c+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x3349b4=JSON['parse'](_0x3bb5d2['stdout']);return this[_0x18a7b4(0x131)](_0x3349b4,_0x191c4c);}catch(_0x28e552){if(_0x28e552[_0x18a7b4(0xf0)])try{const _0x289e2a=JSON['parse'](_0x28e552[_0x18a7b4(0xf0)]);return this[_0x18a7b4(0x131)](_0x289e2a,_0x191c4c);}catch(_0x4c63bf){this['logger']?.['error']('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x4c63bf['message']});}return this[_0x18a7b4(0xc3)]?.['error'](_0x18a7b4(0x133),{'error':_0x28e552[_0x18a7b4(0xf9)]}),[];}}['parseHadolintResults'](_0x479a74,_0x444c4d){const _0x386efa=a0_0x43f094,_0x187371=[];if(Array['isArray'](_0x479a74))for(const _0x1399ce of _0x479a74){_0x187371['push']({'file':_0x444c4d,'line':_0x1399ce[_0x386efa(0xe6)]||0x1,'column':_0x1399ce[_0x386efa(0xe2)]||0x1,'severity':this['mapHadolintSeverity'](_0x1399ce['level']),'rule':_0x1399ce[_0x386efa(0x111)],'message':_0x1399ce['message'],'category':'dockerfile','validator':'hadolint'});}return _0x187371;}async['validateYAML'](_0x5686dd,_0x59db73={}){const _0x402408=a0_0x43f094;try{const _0x1910d6=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x5686dd+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x402408(0xda)](_0x1910d6['stdout'],_0x5686dd);}catch(_0x11dcc3){if(_0x11dcc3['stdout'])return this['parseYamllintResults'](_0x11dcc3[_0x402408(0xf0)],_0x5686dd);return this[_0x402408(0xc3)]?.[_0x402408(0x123)]('yamllint\x20validation\x20failed',{'error':_0x11dcc3[_0x402408(0xf9)]}),[];}}['parseYamllintResults'](_0x102eb4,_0x9b90e6){const _0x509284=a0_0x43f094,_0x28ef33=[],_0x7801a6=_0x102eb4['split']('\x0a')[_0x509284(0x10d)](_0x57cb10=>_0x57cb10['trim']());for(const _0x2886b4 of _0x7801a6){const _0x4f4a0c=_0x2886b4['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x4f4a0c){const [,_0x44537d,_0x10d897,_0x86f84d,_0x122ea0,_0x17cc70,_0x3d18b0]=_0x4f4a0c;_0x28ef33['push']({'file':_0x9b90e6,'line':parseInt(_0x10d897,0xa),'column':parseInt(_0x86f84d,0xa),'severity':this[_0x509284(0xf7)](_0x122ea0),'rule':_0x3d18b0,'message':_0x17cc70,'category':'yaml','validator':_0x509284(0xc4)});}}return _0x28ef33;}async[a0_0x43f094(0xd4)](_0x46aebe,_0x253ccf,_0x322bf2={}){const _0x4593de=a0_0x43f094;try{const _0x566250=await execAsync(_0x4593de(0xed)+_0x46aebe+'\x22\x20--framework\x20'+_0x253ccf+_0x4593de(0x12f),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x1d80f4=JSON['parse'](_0x566250['stdout']);return this['parseCheckovResults'](_0x1d80f4,_0x46aebe);}catch(_0x6adcf9){if(_0x6adcf9[_0x4593de(0xf0)])try{const _0x55852=JSON['parse'](_0x6adcf9[_0x4593de(0xf0)]);return this['parseCheckovResults'](_0x55852,_0x46aebe);}catch(_0x624c11){this[_0x4593de(0xc3)]?.[_0x4593de(0x123)](_0x4593de(0x11a),{'error':_0x624c11['message']});}return this['logger']?.['error']('checkov\x20validation\x20failed',{'error':_0x6adcf9['message']}),[];}}['parseCheckovResults'](_0xa35a86,_0x3eccf2){const _0x4de821=a0_0x43f094,_0x5a0dd2=[];if(_0xa35a86[_0x4de821(0xca)]&&_0xa35a86[_0x4de821(0xca)][_0x4de821(0xbe)])for(const _0x4837cd of _0xa35a86['results'][_0x4de821(0xbe)]){_0x5a0dd2[_0x4de821(0xdd)]({'file':_0x3eccf2,'line':_0x4837cd['file_line_range']?_0x4837cd[_0x4de821(0xf4)][0x0]:0x1,'column':0x1,'severity':this[_0x4de821(0xfd)](_0x4837cd[_0x4de821(0xf2)]),'rule':_0x4837cd['check_id'],'message':_0x4837cd['check_name']||_0x4837cd['check_id'],'category':'security','validator':_0x4de821(0x12e),'remediation':_0x4837cd['guideline'],'cwe':_0x4837cd['cwe'],'references':_0x4837cd[_0x4de821(0xde)]?[_0x4837cd[_0x4de821(0xde)]]:[]});}return _0x5a0dd2;}async[a0_0x43f094(0xc7)](_0x40ec95,_0x4c9afd={}){const _0x4fa1dc=a0_0x43f094;try{const _0x121afe=(await import(_0x4fa1dc(0xc8)))[_0x4fa1dc(0x129)],_0x1cadc5=(await import('ajv-formats'))['default'],_0x57e966=await a0_0x1c9f43['readFile'](_0x40ec95,_0x4fa1dc(0xe7)),_0x5277a5=JSON[_0x4fa1dc(0x10b)](_0x57e966),_0x51b0f5=new _0x121afe({'allErrors':!![],'strict':![]});_0x1cadc5(_0x51b0f5);const _0x1f782e={'type':_0x4fa1dc(0x10f),'required':['name',_0x4fa1dc(0x10e)],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':_0x4fa1dc(0xcd),'enum':[_0x4fa1dc(0xc2),'commonjs']},'scripts':{'type':'object'},'dependencies':{'type':'object'},'devDependencies':{'type':_0x4fa1dc(0x10f)}},'additionalProperties':!![]},_0x429460=_0x51b0f5[_0x4fa1dc(0x100)](_0x1f782e),_0x55a7bc=_0x429460(_0x5277a5);if(!_0x55a7bc&&_0x429460[_0x4fa1dc(0x132)])return _0x429460['errors'][_0x4fa1dc(0xd7)](_0x179239=>({'file':_0x40ec95,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4fa1dc(0x12c)][_0x4fa1dc(0x117)],'rule':'json-schema','message':_0x179239['instancePath']?_0x179239[_0x4fa1dc(0xee)]+'\x20'+_0x179239[_0x4fa1dc(0xf9)]:'must\x20have\x20required\x20property\x20\x27'+_0x179239['params']['missingProperty']+'\x27','category':'validation','validator':_0x4fa1dc(0xc5)}));return[];}catch(_0x20b764){return this[_0x4fa1dc(0xc3)]?.['error'](_0x4fa1dc(0xf3),{'error':_0x20b764[_0x4fa1dc(0xf9)]}),[{'file':_0x40ec95,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4fa1dc(0x12c)][_0x4fa1dc(0x117)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x20b764[_0x4fa1dc(0xf9)],'category':_0x4fa1dc(0x116),'validator':_0x4fa1dc(0x112)}];}}async[a0_0x43f094(0x126)](_0x5aa048,_0x3b836f={}){const _0x23f206=a0_0x43f094;try{const _0x2f36c5=await a0_0x1c9f43[_0x23f206(0xd2)](_0x5aa048,_0x23f206(0xe7)),_0x45912d=JSON['parse'](_0x2f36c5),_0x58e022=[];if(_0x45912d[_0x23f206(0x122)]){const _0x56d1d3=_0x45912d['compilerOptions'];!_0x56d1d3['strict']&&_0x58e022['push']({'file':_0x5aa048,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'strict-mode','message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':_0x23f206(0x11c),'validator':'tsconfig-validator'}),_0x56d1d3[_0x23f206(0xe5)]===![]&&_0x58e022['push']({'file':_0x5aa048,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'no-implicit-any','message':_0x23f206(0x130),'category':'best-practice','validator':'tsconfig-validator'});}return _0x58e022;}catch(_0x323a0a){return this['logger']?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0x323a0a[_0x23f206(0xf9)]}),[{'file':_0x5aa048,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x23f206(0x117)],'rule':'json-parse','message':_0x23f206(0x11e)+_0x323a0a[_0x23f206(0xf9)],'category':'syntax','validator':'json-parse'}];}}async['validateEnvFile'](_0x55d229,_0x1db149={}){const _0x53228f=a0_0x43f094;try{const _0x2fa886=await a0_0x1c9f43['readFile'](_0x55d229,_0x53228f(0xe7)),_0xc5cabf=[],_0x1013b9=_0x2fa886['split']('\x0a'),_0x936caf=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':_0x53228f(0xe8)},{'pattern':/token/i,'name':_0x53228f(0xd6)},{'pattern':/private[_-]?key/i,'name':_0x53228f(0x134)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x1013b9[_0x53228f(0x12b)]((_0x4c6142,_0x5eaa8f)=>{const _0x3337b7=_0x53228f,_0x1e8875=_0x4c6142[_0x3337b7(0xe3)]();if(!_0x1e8875||_0x1e8875['startsWith']('#'))return;if(_0x1e8875[_0x3337b7(0xcb)]('=')){const [_0x4342e8,_0x7055cb]=_0x1e8875['split']('='),_0x43bbd0=_0x4342e8[_0x3337b7(0x12a)](),_0x4961af=_0x7055cb?.['trim']()||'',_0x284579=_0x4961af&&_0x4961af!==''&&!_0x4961af[_0x3337b7(0x107)]('$')&&_0x4961af!==_0x3337b7(0x119)&&_0x4961af!==_0x3337b7(0x124)&&_0x4961af[_0x3337b7(0x102)]>0x5;if(_0x284579)for(const {pattern:_0x5ebd95,name:_0x54fa39}of _0x936caf){if(_0x5ebd95['test'](_0x43bbd0)){_0xc5cabf[_0x3337b7(0xdd)]({'file':_0x55d229,'line':_0x5eaa8f+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x3337b7(0x12c)][_0x3337b7(0xbf)],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x54fa39+_0x3337b7(0xf8),'category':_0x3337b7(0x101),'validator':_0x3337b7(0x108),'remediation':_0x3337b7(0xd1)});break;}}}}),_0xc5cabf;}catch(_0x4e8bf0){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x4e8bf0['message']}),[];}}[a0_0x43f094(0xe1)](_0xdd7123){const _0x557174=a0_0x43f094,_0x1b9cba=a0_0x4a4298[_0x557174(0x118)](_0xdd7123)[_0x557174(0x12a)](),_0x2b9e0a=a0_0x4a4298['dirname'](_0xdd7123);if(_0x1b9cba==='dockerfile')return _0x557174(0xe0);if(_0x1b9cba==='docker-compose.yml'||_0x1b9cba==='docker-compose.yaml')return'docker-compose';if(_0x1b9cba==='package.json')return'package.json';if(_0x1b9cba==='tsconfig.json')return'tsconfig.json';if(_0x1b9cba===_0x557174(0xdf)||_0x1b9cba['endsWith']('.env'))return'env';if(_0x2b9e0a['includes']('.github/workflows'))return'github-actions';if(_0x2b9e0a[_0x557174(0xcb)]('kubernetes')||_0x2b9e0a['includes']('k8s'))return _0x557174(0x106);const _0x137a85=a0_0x4a4298[_0x557174(0x11f)](_0xdd7123)[_0x557174(0x12a)]();if(_0x137a85===_0x557174(0xdb)||_0x137a85===_0x557174(0xd8))return _0x557174(0xe9);if(_0x137a85===_0x557174(0x127)||_0x137a85===_0x557174(0x105))return _0x557174(0xd5);if(_0x137a85===_0x557174(0x136))return _0x557174(0x115);return _0x557174(0xff);}[a0_0x43f094(0x114)](_0x1e170f){const _0x13be59=a0_0x43f094;return _0x1e170f[_0x13be59(0xd7)](_0x48f6c8=>({'file':_0x48f6c8['file'],'line':_0x48f6c8[_0x13be59(0xe6)]||0x1,'column':_0x48f6c8['column']||0x1,'severity':_0x48f6c8[_0x13be59(0x110)]||STATIC_ANALYSIS[_0x13be59(0x12c)]['WARNING'],'rule':_0x48f6c8['rule']||_0x13be59(0xff),'message':_0x48f6c8['message']||'Validation\x20issue\x20detected','category':_0x48f6c8[_0x13be59(0x104)]||'validation','validator':_0x48f6c8['validator'],'cwe':_0x48f6c8['cwe']||null,'remediation':_0x48f6c8[_0x13be59(0xc0)]||null,'references':_0x48f6c8[_0x13be59(0xcc)]||[]}));}[a0_0x43f094(0xef)](_0x55de63){const _0x22697b=a0_0x43f094,_0x37f356={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x22697b(0x12c)]['WARNING'],'info':STATIC_ANALYSIS[_0x22697b(0x12c)]['INFO'],'style':STATIC_ANALYSIS['SEVERITY']['INFO']};return _0x37f356[_0x55de63?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapYamllintSeverity'](_0x159a89){const _0x532f0d=a0_0x43f094,_0x1457fc={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x532f0d(0x12c)]['WARNING']};return _0x1457fc[_0x159a89?.['toLowerCase']()]||STATIC_ANALYSIS[_0x532f0d(0x12c)]['WARNING'];}[a0_0x43f094(0xfd)](_0x1112ce){const _0x4ef676=a0_0x43f094;return STATIC_ANALYSIS[_0x4ef676(0x12c)][_0x4ef676(0x117)];}async['getValidatorStatus'](){const _0x1a246a=await this['detectAvailableValidators']();return{'validators':_0x1a246a,'recommendations':this['getInstallRecommendations'](_0x1a246a)};}['getInstallRecommendations'](_0x2a2ced){const _0xedc979=a0_0x43f094,_0x183cd4=[];return!_0x2a2ced[_0xedc979(0x12e)]&&_0x183cd4['push']({'validator':_0xedc979(0x12e),'reason':_0xedc979(0xf6),'install':'pip\x20install\x20checkov','priority':_0xedc979(0xd9)}),!_0x2a2ced['hadolint']&&_0x183cd4['push']({'validator':_0xedc979(0x12d),'reason':_0xedc979(0x103),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x2a2ced['yamllint']&&_0x183cd4[_0xedc979(0xdd)]({'validator':'yamllint','reason':_0xedc979(0xfc),'install':'pip\x20install\x20yamllint','priority':'medium'}),!_0x2a2ced['jsonSchema']&&_0x183cd4[_0xedc979(0xdd)]({'validator':'ajv\x20(JSON\x20Schema)','reason':'JSON\x20configuration\x20validation','install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x183cd4;}}export default ConfigValidator;