@loxia-labs/loxia-autopilot-one 1.0.5 → 1.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 (120) hide show
  1. package/README.md +1 -1
  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/src/analyzers/CSSAnalyzer.js +1 -1
  9. package/src/analyzers/ConfigValidator.js +1 -1
  10. package/src/analyzers/ESLintAnalyzer.js +1 -1
  11. package/src/analyzers/JavaScriptAnalyzer.js +1 -1
  12. package/src/analyzers/PrettierFormatter.js +1 -1
  13. package/src/analyzers/PythonAnalyzer.js +1 -1
  14. package/src/analyzers/SecurityAnalyzer.js +1 -1
  15. package/src/analyzers/TypeScriptAnalyzer.js +1 -1
  16. package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
  17. package/src/analyzers/codeCloneDetector/detector.js +1 -1
  18. package/src/analyzers/codeCloneDetector/index.js +1 -1
  19. package/src/analyzers/codeCloneDetector/parser.js +1 -1
  20. package/src/analyzers/codeCloneDetector/reporter.js +1 -1
  21. package/src/analyzers/codeCloneDetector/scanner.js +1 -1
  22. package/src/core/agentPool.js +1 -1
  23. package/src/core/agentScheduler.js +1 -1
  24. package/src/core/contextManager.js +1 -1
  25. package/src/core/messageProcessor.js +1 -1
  26. package/src/core/orchestrator.js +1 -1
  27. package/src/core/stateManager.js +1 -1
  28. package/src/index.js +1 -1
  29. package/src/interfaces/cli.js +1 -1
  30. package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
  31. package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
  32. package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
  33. package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
  34. package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
  35. package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
  36. package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
  37. package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
  38. package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
  39. package/src/interfaces/terminal/api/apiClient.js +1 -1
  40. package/src/interfaces/terminal/api/messageRouter.js +1 -1
  41. package/src/interfaces/terminal/api/session.js +1 -1
  42. package/src/interfaces/terminal/api/websocket.js +1 -1
  43. package/src/interfaces/terminal/components/AgentCreator.js +1 -1
  44. package/src/interfaces/terminal/components/AgentEditor.js +1 -1
  45. package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
  46. package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
  47. package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
  48. package/src/interfaces/terminal/components/Header.js +1 -1
  49. package/src/interfaces/terminal/components/HelpPanel.js +1 -1
  50. package/src/interfaces/terminal/components/InputBox.js +1 -1
  51. package/src/interfaces/terminal/components/Layout.js +1 -1
  52. package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
  53. package/src/interfaces/terminal/components/MessageList.js +1 -1
  54. package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
  55. package/src/interfaces/terminal/components/SearchPanel.js +1 -1
  56. package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
  57. package/src/interfaces/terminal/components/StatusBar.js +1 -1
  58. package/src/interfaces/terminal/components/TextInput.js +1 -1
  59. package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
  60. package/src/interfaces/terminal/config/constants.js +1 -1
  61. package/src/interfaces/terminal/index.js +1 -1
  62. package/src/interfaces/terminal/state/useAgentControl.js +1 -1
  63. package/src/interfaces/terminal/state/useAgents.js +1 -1
  64. package/src/interfaces/terminal/state/useConnection.js +1 -1
  65. package/src/interfaces/terminal/state/useMessages.js +1 -1
  66. package/src/interfaces/terminal/state/useTools.js +1 -1
  67. package/src/interfaces/terminal/utils/debugLogger.js +1 -1
  68. package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
  69. package/src/interfaces/terminal/utils/theme.js +1 -1
  70. package/src/interfaces/webServer.js +1 -1
  71. package/src/modules/fileExplorer/controller.js +1 -1
  72. package/src/modules/fileExplorer/index.js +1 -1
  73. package/src/modules/fileExplorer/middleware.js +1 -1
  74. package/src/modules/fileExplorer/routes.js +1 -1
  75. package/src/services/aiService.js +1 -1
  76. package/src/services/apiKeyManager.js +1 -1
  77. package/src/services/benchmarkService.js +1 -1
  78. package/src/services/budgetService.js +1 -1
  79. package/src/services/contextInjectionService.js +1 -1
  80. package/src/services/conversationCompactionService.js +1 -1
  81. package/src/services/errorHandler.js +1 -1
  82. package/src/services/fileAttachmentService.js +1 -1
  83. package/src/services/modelRouterService.js +1 -1
  84. package/src/services/modelsService.js +1 -1
  85. package/src/services/qualityInspector.js +1 -1
  86. package/src/services/tokenCountingService.js +1 -1
  87. package/src/tools/agentCommunicationTool.js +1 -1
  88. package/src/tools/agentDelayTool.js +1 -1
  89. package/src/tools/asyncToolManager.js +1 -1
  90. package/src/tools/baseTool.js +1 -1
  91. package/src/tools/browserTool.js +1 -1
  92. package/src/tools/cloneDetectionTool.js +1 -1
  93. package/src/tools/dependencyResolverTool.js +1 -1
  94. package/src/tools/fileContentReplaceTool.js +1 -1
  95. package/src/tools/fileSystemTool.js +1 -1
  96. package/src/tools/fileTreeTool.js +1 -1
  97. package/src/tools/imageTool.js +1 -1
  98. package/src/tools/importAnalyzerTool.js +1 -1
  99. package/src/tools/jobDoneTool.js +1 -1
  100. package/src/tools/seekTool.js +1 -1
  101. package/src/tools/staticAnalysisTool.js +1 -1
  102. package/src/tools/taskManagerTool.js +1 -1
  103. package/src/tools/terminalTool.js +1 -1
  104. package/src/tools/webTool.js +1 -1
  105. package/src/types/agent.js +1 -1
  106. package/src/types/contextReference.js +1 -1
  107. package/src/types/conversation.js +1 -1
  108. package/src/types/toolCommand.js +1 -1
  109. package/src/utilities/attachmentValidator.js +1 -1
  110. package/src/utilities/configManager.js +1 -1
  111. package/src/utilities/constants.js +1 -1
  112. package/src/utilities/directoryAccessManager.js +1 -1
  113. package/src/utilities/fileProcessor.js +1 -1
  114. package/src/utilities/logger.js +1 -1
  115. package/src/utilities/tagParser.js +1 -1
  116. package/src/utilities/toolConstants.js +1 -1
  117. package/web-ui/build/index.html +2 -2
  118. package/web-ui/build/static/{index-lCBai6dX.js → index-CX8ZfpGw.js} +113 -60
  119. package/web-ui/build/static/index-Dwg_JrlO.css +1 -0
  120. package/web-ui/build/static/index-CClD1090.css +0 -1
package/README.md CHANGED
@@ -99,7 +99,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
99
99
 
100
100
  ```bash
101
101
  loxia --version
102
- # Should display: Loxia Autopilot One v1.0.5
102
+ # Should display: Loxia Autopilot One v1.0.6
103
103
  ```
104
104
 
105
105
  ### 4. Create an API Key
package/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x26ffb9=a0_0x2479;(function(_0xd822b,_0x180529){const _0x582988=a0_0x2479,_0x3d866f=_0xd822b();while(!![]){try{const _0x26d81a=-parseInt(_0x582988(0x175))/0x1*(parseInt(_0x582988(0x15b))/0x2)+-parseInt(_0x582988(0x17d))/0x3+parseInt(_0x582988(0x150))/0x4+-parseInt(_0x582988(0x17e))/0x5*(-parseInt(_0x582988(0x165))/0x6)+-parseInt(_0x582988(0x154))/0x7+-parseInt(_0x582988(0x18e))/0x8+-parseInt(_0x582988(0x180))/0x9*(-parseInt(_0x582988(0x17f))/0xa);if(_0x26d81a===_0x180529)break;else _0x3d866f['push'](_0x3d866f['shift']());}catch(_0x23e1a3){_0x3d866f['push'](_0x3d866f['shift']());}}}(a0_0x29b8,0xcdc49));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x1100c6 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x26ffb9(0x179),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x26ffb9(0x14d)][a0_0x26ffb9(0x185)](0x2),command=args[0x0]&&!args[0x0][a0_0x26ffb9(0x169)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args['includes']('--help')||args[a0_0x26ffb9(0x186)]('-h'),'version':args['includes'](a0_0x26ffb9(0x15f))||args[a0_0x26ffb9(0x186)]('-v')};for(let i=0x0;i<args[a0_0x26ffb9(0x17c)];i++){args[i]===a0_0x26ffb9(0x166)&&args[i+0x1]&&(flags[a0_0x26ffb9(0x182)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x26ffb9(0x15c)&&args[i+0x1]&&(flags[a0_0x26ffb9(0x173)]=args[i+0x1]);}const port=flags[a0_0x26ffb9(0x182)]||DEFAULT_PORT,host=flags[a0_0x26ffb9(0x173)]||DEFAULT_HOST,serverUrl=a0_0x26ffb9(0x172)+host+':'+port;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x26ffb9(0x18c)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x26ffb9(0x188)));console[a0_0x26ffb9(0x160)]('Loxia\x20Autopilot\x20One\x20v'+pkg['version']),process[a0_0x26ffb9(0x156)](0x0);}function a0_0x29b8(){const _0x1f256a=['2TqnjjM','\x20manually.','\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\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:\x20','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','localhost','inherit','message','length','2993970WdyyDA','2255OVXHjD','9194490RiOGGi','9TBNiXm','statusCode','port','get','Starting\x20Terminal\x20UI...\x0a','slice','includes','ceil','utf8','Server\x20is\x20running\x20at\x20','SIGINT','Error:','package.json','\x0aLoxia\x20Autopilot\x20One\x20v','6750120zbuBUU','\x0aPlease\x20start\x20the\x20server\x20first:','pid','parse','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','SIGTERM','loxia-terminal.js','argv','version',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','6691212egZfyv','Unknown\x20command:\x20','web','help','4441843yPLbnD','Please\x20open\x20manually:\x20','exit','LOXIA_HOST','unref','catch','ignore','27646TLQaye','--host','destroy','open\x20\x22','--version','log','darwin','node','\x0aShutting\x20down\x20server...','\x0aOpening\x20Web\x20UI\x20at\x20','10038JiCWUi','--port','kill','Starting\x20Loxia\x20server\x20in\x20background...','startsWith','error','index.js','src','setTimeout','Could\x20not\x20open\x20browser\x20automatically.','xdg-open\x20\x22','Waiting\x20for\x20server\x20to\x20start...','Server\x20running\x20at\x20','http://','host','toString'];a0_0x29b8=function(){return _0x1f256a;};return a0_0x29b8();}if(flags[a0_0x26ffb9(0x153)]||!command){const pkgPath=join(__dirname,'..',a0_0x26ffb9(0x18c)),pkg=JSON[a0_0x26ffb9(0x149)](readFileSync(pkgPath,'utf8'));console[a0_0x26ffb9(0x160)](a0_0x26ffb9(0x18d)+pkg[a0_0x26ffb9(0x14e)]+a0_0x26ffb9(0x177)+DEFAULT_PORT+a0_0x26ffb9(0x14f)+DEFAULT_HOST+')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\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\x20custom\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\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a'),process[a0_0x26ffb9(0x156)](0x0);}async function checkServerRunning(_0x19b402,_0x3d2ed4,_0x5c8a52=0x1){for(let _0x16b4bf=0x0;_0x16b4bf<_0x5c8a52;_0x16b4bf++){const _0x4a07ee=await new Promise(_0x186d1a=>{const _0x26c4c6=a0_0x2479,_0x56d0f8=a0_0x1100c6[_0x26c4c6(0x183)](_0x26c4c6(0x172)+_0x19b402+':'+_0x3d2ed4+'/api/health',_0x55f30e=>{const _0x4482e9=_0x26c4c6;_0x186d1a(_0x55f30e[_0x4482e9(0x181)]===0xc8);});_0x56d0f8['on'](_0x26c4c6(0x16a),()=>_0x186d1a(![])),_0x56d0f8[_0x26c4c6(0x16d)](0x7d0,()=>{const _0x2bd103=_0x26c4c6;_0x56d0f8[_0x2bd103(0x15d)](),_0x186d1a(![]);});});if(_0x4a07ee)return!![];_0x16b4bf<_0x5c8a52-0x1&&await new Promise(_0x1d5471=>setTimeout(_0x1d5471,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0xe5a63a,_0xe65496,_0x4d75cd=SERVER_STARTUP_TIMEOUT){const _0x43bea4=a0_0x26ffb9,_0x5473b6=Math[_0x43bea4(0x187)](_0x4d75cd/SERVER_CHECK_INTERVAL);return checkServerRunning(_0xe5a63a,_0xe65496,_0x5473b6);}function a0_0x2479(_0x5d70f9,_0x520bc3){_0x5d70f9=_0x5d70f9-0x148;const _0x29b8c2=a0_0x29b8();let _0x247968=_0x29b8c2[_0x5d70f9];return _0x247968;}function openBrowser(_0x568ffa){const _0x297a78=a0_0x26ffb9,_0x4e3d38=process['platform'];let _0x2c5ffb;if(_0x4e3d38===_0x297a78(0x161))_0x2c5ffb=_0x297a78(0x15e)+_0x568ffa+'\x22';else _0x4e3d38==='win32'?_0x2c5ffb='start\x20\x22\x22\x20\x22'+_0x568ffa+'\x22':_0x2c5ffb=_0x297a78(0x16f)+_0x568ffa+'\x22';exec(_0x2c5ffb,_0x3b1eb4=>{const _0x4df78b=_0x297a78;_0x3b1eb4&&(console['log'](_0x4df78b(0x16e)),console[_0x4df78b(0x160)](_0x4df78b(0x155)+_0x568ffa));});}function startServer(_0x427113=![]){const _0x48f704=a0_0x26ffb9,_0x4fb730={...process['env'],'LOXIA_PORT':port['toString'](),'PORT':port['toString']()};flags[_0x48f704(0x173)]&&(_0x4fb730[_0x48f704(0x157)]=flags[_0x48f704(0x173)]);const _0xd665a4=join(__dirname,'..',_0x48f704(0x16c),_0x48f704(0x16b)),_0x782bb9=spawn(_0x48f704(0x162),[_0xd665a4],{'cwd':join(__dirname,'..'),'env':_0x4fb730,'stdio':_0x427113?[_0x48f704(0x15a),_0x48f704(0x15a),'ignore']:_0x48f704(0x17a),'detached':_0x427113});return _0x427113&&_0x782bb9[_0x48f704(0x158)](),_0x782bb9;}function startTerminalUI(){const _0x1e21bb=a0_0x26ffb9,_0x5a1b21=join(__dirname,_0x1e21bb(0x14c)),_0x4d5d51={...process['env'],'LOXIA_PORT':port[_0x1e21bb(0x174)](),'LOXIA_HOST':host},_0x7ed804=spawn(_0x1e21bb(0x162),[_0x5a1b21],{'cwd':join(__dirname,'..'),'env':_0x4d5d51,'stdio':'inherit'});return _0x7ed804;}const commands={'web':async()=>{const _0x4c3e01=a0_0x26ffb9;console[_0x4c3e01(0x160)]('Starting\x20Loxia\x20server...\x0a');const _0x4bb916=startServer(![]);console[_0x4c3e01(0x160)](_0x4c3e01(0x170));const _0x4c9f07=await waitForServer(host,port);_0x4c9f07?(console[_0x4c3e01(0x160)](_0x4c3e01(0x164)+serverUrl),openBrowser(serverUrl)):console[_0x4c3e01(0x160)](_0x4c3e01(0x178)+serverUrl+_0x4c3e01(0x176)),process['on'](_0x4c3e01(0x18a),()=>_0x4bb916[_0x4c3e01(0x167)](_0x4c3e01(0x18a))),process['on'](_0x4c3e01(0x14b),()=>_0x4bb916[_0x4c3e01(0x167)](_0x4c3e01(0x14b))),_0x4bb916['on'](_0x4c3e01(0x156),_0x394452=>process[_0x4c3e01(0x156)](_0x394452||0x0));},'plus-web':async()=>{const _0x3eb2a4=a0_0x26ffb9;await commands[_0x3eb2a4(0x152)]();},'terminal':async()=>{const _0x502636=a0_0x26ffb9;console['log']('Checking\x20if\x20server\x20is\x20running...');const _0x225f46=await checkServerRunning(host,port);!_0x225f46&&(console[_0x502636(0x16a)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console[_0x502636(0x16a)](_0x502636(0x18f)),console[_0x502636(0x16a)]('\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI'),console[_0x502636(0x16a)](_0x502636(0x14a)),process[_0x502636(0x156)](0x1));console[_0x502636(0x160)](_0x502636(0x189)+serverUrl),console[_0x502636(0x160)](_0x502636(0x184));const _0x5c6022=startTerminalUI();process['on'](_0x502636(0x18a),()=>_0x5c6022[_0x502636(0x167)](_0x502636(0x18a))),process['on'](_0x502636(0x14b),()=>_0x5c6022['kill'](_0x502636(0x14b))),_0x5c6022['on'](_0x502636(0x156),_0x5b61cc=>process[_0x502636(0x156)](_0x5b61cc||0x0));},'plus-terminal':async()=>{const _0x25d692=a0_0x26ffb9;console['log'](_0x25d692(0x168));const _0x51a100=startServer(!![]),_0x49248f=await waitForServer(host,port);!_0x49248f&&(console[_0x25d692(0x16a)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process['exit'](0x1));console[_0x25d692(0x160)](_0x25d692(0x171)+serverUrl),console['log'](_0x25d692(0x184));const _0x1b1aeb=startTerminalUI();_0x1b1aeb['on'](_0x25d692(0x156),_0x1e8ac2=>{const _0x5b1ff4=_0x25d692;console['log'](_0x5b1ff4(0x163));try{process[_0x5b1ff4(0x167)](_0x51a100[_0x5b1ff4(0x148)],_0x5b1ff4(0x14b));}catch(_0x35ef1f){}process[_0x5b1ff4(0x156)](_0x1e8ac2||0x0);}),process['on'](_0x25d692(0x18a),()=>{const _0x5adec4=_0x25d692;_0x1b1aeb['kill'](_0x5adec4(0x18a));}),process['on'](_0x25d692(0x14b),()=>{const _0x197ae8=_0x25d692;_0x1b1aeb['kill'](_0x197ae8(0x14b));});}};commands[command]?commands[command]()[a0_0x26ffb9(0x159)](_0x2e45e5=>{const _0x2c9c70=a0_0x26ffb9;console['error'](_0x2c9c70(0x18b),_0x2e45e5[_0x2c9c70(0x17b)]),process['exit'](0x1);}):(console['error'](a0_0x26ffb9(0x151)+command),console[a0_0x26ffb9(0x16a)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x26ffb9(0x156)](0x1));
3
+ const a0_0x2abc56=a0_0x5574;function a0_0x5574(_0x4dc9e3,_0x110161){_0x4dc9e3=_0x4dc9e3-0x154;const _0x1d869c=a0_0x1d86();let _0x55742a=_0x1d869c[_0x4dc9e3];return _0x55742a;}(function(_0x2eb2a2,_0x3d2eb5){const _0x553227=a0_0x5574,_0x2d3063=_0x2eb2a2();while(!![]){try{const _0x575059=parseInt(_0x553227(0x198))/0x1+parseInt(_0x553227(0x18f))/0x2*(-parseInt(_0x553227(0x17e))/0x3)+parseInt(_0x553227(0x187))/0x4*(-parseInt(_0x553227(0x16e))/0x5)+-parseInt(_0x553227(0x15c))/0x6*(-parseInt(_0x553227(0x17d))/0x7)+parseInt(_0x553227(0x193))/0x8*(-parseInt(_0x553227(0x170))/0x9)+parseInt(_0x553227(0x181))/0xa+parseInt(_0x553227(0x177))/0xb;if(_0x575059===_0x3d2eb5)break;else _0x2d3063['push'](_0x2d3063['shift']());}catch(_0x29d1d9){_0x2d3063['push'](_0x2d3063['shift']());}}}(a0_0x1d86,0x3b130));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x3cab67 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x2abc56(0x186),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x2abc56(0x160)][a0_0x2abc56(0x197)](0x2),command=args[0x0]&&!args[0x0][a0_0x2abc56(0x179)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x2abc56(0x17f)](a0_0x2abc56(0x174))||args['includes']('-h'),'version':args[a0_0x2abc56(0x17f)](a0_0x2abc56(0x175))||args[a0_0x2abc56(0x17f)]('-v')};for(let i=0x0;i<args['length'];i++){args[i]==='--port'&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x2abc56(0x196)&&args[i+0x1]&&(flags[a0_0x2abc56(0x159)]=args[i+0x1]);}const port=flags['port']||DEFAULT_PORT,host=flags[a0_0x2abc56(0x159)]||DEFAULT_HOST,serverUrl='http://'+host+':'+port;if(flags[a0_0x2abc56(0x18e)]){const pkgPath=join(__dirname,'..',a0_0x2abc56(0x173)),pkg=JSON[a0_0x2abc56(0x18b)](readFileSync(pkgPath,a0_0x2abc56(0x178)));console['log'](a0_0x2abc56(0x169)+pkg[a0_0x2abc56(0x18e)]),process[a0_0x2abc56(0x162)](0x0);}if(flags[a0_0x2abc56(0x192)]||!command){const pkgPath=join(__dirname,'..',a0_0x2abc56(0x173)),pkg=JSON[a0_0x2abc56(0x18b)](readFileSync(pkgPath,a0_0x2abc56(0x178)));console[a0_0x2abc56(0x15d)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x2abc56(0x18e)]+'\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\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:\x20'+DEFAULT_PORT+')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20'+DEFAULT_HOST+')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\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\x20custom\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\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a'),process['exit'](0x0);}async function checkServerRunning(_0x5dd5a1,_0x191de6,_0x1e2ee3=0x1){for(let _0x5aecf5=0x0;_0x5aecf5<_0x1e2ee3;_0x5aecf5++){const _0x8baf4d=await new Promise(_0x16de19=>{const _0x5da16e=a0_0x5574,_0x245db7=a0_0x3cab67[_0x5da16e(0x155)](_0x5da16e(0x19a)+_0x5dd5a1+':'+_0x191de6+'/api/health',_0x226f66=>{const _0x59c422=_0x5da16e;_0x16de19(_0x226f66[_0x59c422(0x165)]===0xc8);});_0x245db7['on'](_0x5da16e(0x15a),()=>_0x16de19(![])),_0x245db7[_0x5da16e(0x16d)](0x7d0,()=>{const _0x83dfae=_0x5da16e;_0x245db7[_0x83dfae(0x199)](),_0x16de19(![]);});});if(_0x8baf4d)return!![];_0x5aecf5<_0x1e2ee3-0x1&&await new Promise(_0x140566=>setTimeout(_0x140566,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x2ce936,_0x51940e,_0x636833=SERVER_STARTUP_TIMEOUT){const _0x1695b3=a0_0x2abc56,_0x1a28ac=Math[_0x1695b3(0x184)](_0x636833/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x2ce936,_0x51940e,_0x1a28ac);}function openBrowser(_0x25379c){const _0x320292=a0_0x2abc56,_0x4e6184=process[_0x320292(0x188)];let _0x80ee51;if(_0x4e6184===_0x320292(0x16b))_0x80ee51='open\x20\x22'+_0x25379c+'\x22';else _0x4e6184===_0x320292(0x194)?_0x80ee51='start\x20\x22\x22\x20\x22'+_0x25379c+'\x22':_0x80ee51=_0x320292(0x18c)+_0x25379c+'\x22';exec(_0x80ee51,_0x51d9a7=>{const _0x581f14=_0x320292;_0x51d9a7&&(console[_0x581f14(0x15d)](_0x581f14(0x15e)),console[_0x581f14(0x15d)](_0x581f14(0x171)+_0x25379c));});}function startServer(_0x232fcc=![]){const _0xfe6aeb=a0_0x2abc56,_0x3bdc16={...process[_0xfe6aeb(0x17a)],'LOXIA_PORT':port[_0xfe6aeb(0x176)](),'PORT':port[_0xfe6aeb(0x176)]()};flags['host']&&(_0x3bdc16[_0xfe6aeb(0x180)]=flags[_0xfe6aeb(0x159)]);const _0xdf1cdd=join(__dirname,'..',_0xfe6aeb(0x156),_0xfe6aeb(0x189)),_0x36ee62=spawn(_0xfe6aeb(0x164),[_0xdf1cdd],{'cwd':join(__dirname,'..'),'env':_0x3bdc16,'stdio':_0x232fcc?[_0xfe6aeb(0x191),_0xfe6aeb(0x191),_0xfe6aeb(0x191)]:_0xfe6aeb(0x16a),'detached':_0x232fcc});return _0x232fcc&&_0x36ee62['unref'](),_0x36ee62;}function startTerminalUI(){const _0x58f78c=a0_0x2abc56,_0x19737e=join(__dirname,_0x58f78c(0x182)),_0x3bc351={...process[_0x58f78c(0x17a)],'LOXIA_PORT':port[_0x58f78c(0x176)](),'LOXIA_HOST':host},_0x2354ef=spawn(_0x58f78c(0x164),[_0x19737e],{'cwd':join(__dirname,'..'),'env':_0x3bc351,'stdio':_0x58f78c(0x16a)});return _0x2354ef;}const commands={'web':async()=>{const _0x56075c=a0_0x2abc56;console[_0x56075c(0x15d)](_0x56075c(0x157));const _0x46fbcc=startServer(![]);console[_0x56075c(0x15d)](_0x56075c(0x18a));const _0xcc7ca=await waitForServer(host,port);_0xcc7ca?(console[_0x56075c(0x15d)](_0x56075c(0x16c)+serverUrl),openBrowser(serverUrl)):console[_0x56075c(0x15d)](_0x56075c(0x16f)+serverUrl+_0x56075c(0x18d)),process['on'](_0x56075c(0x161),()=>_0x46fbcc[_0x56075c(0x166)](_0x56075c(0x161))),process['on'](_0x56075c(0x19b),()=>_0x46fbcc['kill'](_0x56075c(0x19b))),_0x46fbcc['on'](_0x56075c(0x162),_0x593604=>process[_0x56075c(0x162)](_0x593604||0x0));},'plus-web':async()=>{const _0x2a7e7f=a0_0x2abc56;await commands[_0x2a7e7f(0x195)]();},'terminal':async()=>{const _0x3be28d=a0_0x2abc56;console[_0x3be28d(0x15d)](_0x3be28d(0x172));const _0x231624=await checkServerRunning(host,port);!_0x231624&&(console[_0x3be28d(0x15a)](_0x3be28d(0x185)+serverUrl),console[_0x3be28d(0x15a)]('\x0aPlease\x20start\x20the\x20server\x20first:'),console[_0x3be28d(0x15a)](_0x3be28d(0x168)),console[_0x3be28d(0x15a)]('\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a'),process[_0x3be28d(0x162)](0x1));console[_0x3be28d(0x15d)]('Server\x20is\x20running\x20at\x20'+serverUrl),console[_0x3be28d(0x15d)](_0x3be28d(0x17c));const _0xdd692e=startTerminalUI();process['on'](_0x3be28d(0x161),()=>_0xdd692e[_0x3be28d(0x166)](_0x3be28d(0x161))),process['on'](_0x3be28d(0x19b),()=>_0xdd692e['kill']('SIGTERM')),_0xdd692e['on']('exit',_0x205308=>process['exit'](_0x205308||0x0));},'plus-terminal':async()=>{const _0xf6b68b=a0_0x2abc56;console[_0xf6b68b(0x15d)](_0xf6b68b(0x167));const _0x12bc0b=startServer(!![]),_0x1e7e91=await waitForServer(host,port);!_0x1e7e91&&(console[_0xf6b68b(0x15a)](_0xf6b68b(0x163)),process[_0xf6b68b(0x162)](0x1));console[_0xf6b68b(0x15d)](_0xf6b68b(0x183)+serverUrl),console[_0xf6b68b(0x15d)]('Starting\x20Terminal\x20UI...\x0a');const _0x56a543=startTerminalUI();_0x56a543['on'](_0xf6b68b(0x162),_0x2b4012=>{const _0x371f76=_0xf6b68b;console[_0x371f76(0x15d)]('\x0aShutting\x20down\x20server...');try{process['kill'](_0x12bc0b[_0x371f76(0x158)],_0x371f76(0x19b));}catch(_0x1dbd7c){}process[_0x371f76(0x162)](_0x2b4012||0x0);}),process['on']('SIGINT',()=>{const _0x3f5b67=_0xf6b68b;_0x56a543[_0x3f5b67(0x166)](_0x3f5b67(0x161));}),process['on'](_0xf6b68b(0x19b),()=>{const _0x5271ee=_0xf6b68b;_0x56a543[_0x5271ee(0x166)](_0x5271ee(0x19b));});}};commands[command]?commands[command]()[a0_0x2abc56(0x15b)](_0x5e551c=>{const _0x387d43=a0_0x2abc56;console[_0x387d43(0x15a)](_0x387d43(0x190),_0x5e551c[_0x387d43(0x17b)]),process[_0x387d43(0x162)](0x1);}):(console['error'](a0_0x2abc56(0x154)+command),console[a0_0x2abc56(0x15a)](a0_0x2abc56(0x15f)),process['exit'](0x1));function a0_0x1d86(){const _0x1422fa=['SIGINT','exit','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','node','statusCode','kill','Starting\x20Loxia\x20server\x20in\x20background...','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','Loxia\x20Autopilot\x20One\x20v','inherit','darwin','\x0aOpening\x20Web\x20UI\x20at\x20','setTimeout','86665yDnlfv','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','4327839okHvgX','Please\x20open\x20manually:\x20','Checking\x20if\x20server\x20is\x20running...','package.json','--help','--version','toString','6850349aojlsH','utf8','startsWith','env','message','Starting\x20Terminal\x20UI...\x0a','45899CdeYYL','26493MJmmow','includes','LOXIA_HOST','678450TFUbgk','loxia-terminal.js','Server\x20running\x20at\x20','ceil','\x0aServer\x20is\x20not\x20running\x20at\x20','localhost','28pdGtNw','platform','index.js','Waiting\x20for\x20server\x20to\x20start...','parse','xdg-open\x20\x22','\x20manually.','version','32oyrFTK','Error:','ignore','help','8ZMWqUX','win32','web','--host','slice','124380joixMz','destroy','http://','SIGTERM','Unknown\x20command:\x20','get','src','Starting\x20Loxia\x20server...\x0a','pid','host','error','catch','156AClHEO','log','Could\x20not\x20open\x20browser\x20automatically.','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','argv'];a0_0x1d86=function(){return _0x1422fa;};return a0_0x1d86();}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x590d(){const _0x28b8ec=['6130pRTcTr','connect','--host','🚀\x20Starting\x20Loxia\x20server...','ignore','now','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','pipe','✓\x20Server\x20started\x20at\x20','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','../src/interfaces/terminal/index.js','join','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','Server\x20startup\x20timeout','2565218xVCfKU','2804169aOxmzu','LOXIA_HOST','...','error','✗\x20Server\x20is\x20not\x20running','message','exit','✓\x20Server\x20is\x20already\x20running\x20at\x20','LOXIA_PORT','12949570mNrZKk','setTimeout','toString','env','timeout','--port','slice','975848mkROTM','localhost','99lCgAhc','Failed\x20to\x20start\x20server:','data','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','stdout','💡\x20Troubleshooting:','36SinPOC','argv','log','bin/cli.js','220373CYMdNa','web','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','5588OZykwI','Socket','750512hzFlGa','dirname','destroy'];a0_0x590d=function(){return _0x28b8ec;};return a0_0x590d();}const a0_0x597a8=a0_0x3292;(function(_0x5d4e1d,_0x4c1362){const _0x5333df=a0_0x3292,_0x152d3e=_0x5d4e1d();while(!![]){try{const _0x448804=parseInt(_0x5333df(0x153))/0x1+parseInt(_0x5333df(0x169))/0x2+parseInt(_0x5333df(0x16a))/0x3+-parseInt(_0x5333df(0x156))/0x4*(-parseInt(_0x5333df(0x15b))/0x5)+parseInt(_0x5333df(0x183))/0x6*(-parseInt(_0x5333df(0x158))/0x7)+-parseInt(_0x5333df(0x17a))/0x8*(parseInt(_0x5333df(0x17c))/0x9)+-parseInt(_0x5333df(0x173))/0xa;if(_0x448804===_0x4c1362)break;else _0x152d3e['push'](_0x152d3e['shift']());}catch(_0x16b9e6){_0x152d3e['push'](_0x152d3e['shift']());}}}(a0_0x590d,0xd47ef));function a0_0x3292(_0x2ca414,_0x563d75){_0x2ca414=_0x2ca414-0x150;const _0x590d65=a0_0x590d();let _0x329240=_0x590d65[_0x2ca414];return _0x329240;}import{spawn}from'child_process';import a0_0x1c800a from'net';import a0_0x29baf7 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x29baf7[a0_0x597a8(0x159)](__filename),projectRoot=a0_0x29baf7[a0_0x597a8(0x159)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x597a8(0x17b),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x431351,_0x334e21){return new Promise(_0x20ee15=>{const _0x3c3f2d=a0_0x3292,_0xe301bb=new a0_0x1c800a[(_0x3c3f2d(0x157))]();_0xe301bb[_0x3c3f2d(0x174)](0x7d0),_0xe301bb['on'](_0x3c3f2d(0x15c),()=>{const _0x4a2bba=_0x3c3f2d;_0xe301bb[_0x4a2bba(0x15a)](),_0x20ee15(!![]);}),_0xe301bb['on'](_0x3c3f2d(0x177),()=>{const _0x49abd7=_0x3c3f2d;_0xe301bb[_0x49abd7(0x15a)](),_0x20ee15(![]);}),_0xe301bb['on'](_0x3c3f2d(0x16d),()=>{const _0x75fa73=_0x3c3f2d;_0xe301bb[_0x75fa73(0x15a)](),_0x20ee15(![]);}),_0xe301bb[_0x3c3f2d(0x15c)](_0x334e21,_0x431351);});}async function startServer(_0x4122c4,_0x25aa73){const _0xf8c38c=a0_0x597a8;return console[_0xf8c38c(0x151)](_0xf8c38c(0x15e)),new Promise((_0x48ad51,_0x210530)=>{const _0x571709=_0xf8c38c,_0x335c56=spawn('node',[a0_0x29baf7[_0x571709(0x166)](projectRoot,_0x571709(0x152)),'--ui',_0x571709(0x154),_0x571709(0x15d),_0x4122c4,_0x571709(0x178),_0x25aa73[_0x571709(0x175)]()],{'detached':![],'stdio':[_0x571709(0x15f),_0x571709(0x162),_0x571709(0x162)]});_0x335c56[_0x571709(0x181)]['on']('data',()=>{}),_0x335c56['stderr']['on'](_0x571709(0x17e),()=>{}),_0x335c56['on'](_0x571709(0x16d),_0x5bd4a7=>{const _0x1406cb=_0x571709;console['error'](_0x1406cb(0x17d),_0x5bd4a7[_0x1406cb(0x16f)]),_0x210530(_0x5bd4a7);});const _0x3ee40b=Date[_0x571709(0x160)](),_0x716744=setInterval(async()=>{const _0x31af32=_0x571709,_0x33a37c=await isServerRunning(_0x4122c4,_0x25aa73);if(_0x33a37c)clearInterval(_0x716744),console[_0x31af32(0x151)](_0x31af32(0x163)+_0x4122c4+':'+_0x25aa73),_0x48ad51();else Date[_0x31af32(0x160)]()-_0x3ee40b>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x716744),_0x335c56['kill'](),_0x210530(new Error(_0x31af32(0x168))));},0x1f4);});}async function main(){const _0x30f168=a0_0x597a8;try{console[_0x30f168(0x151)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x30f168(0x151)](_0x30f168(0x167)),console[_0x30f168(0x151)](_0x30f168(0x155)),console[_0x30f168(0x151)]('');const _0x40e929=process[_0x30f168(0x150)][_0x30f168(0x179)](0x2);let _0x3765b3=DEFAULT_HOST,_0x72ae0f=DEFAULT_PORT;for(let _0x288f64=0x0;_0x288f64<_0x40e929['length'];_0x288f64++){if(_0x40e929[_0x288f64]===_0x30f168(0x15d)&&_0x40e929[_0x288f64+0x1])_0x3765b3=_0x40e929[_0x288f64+0x1],_0x288f64++;else _0x40e929[_0x288f64]===_0x30f168(0x178)&&_0x40e929[_0x288f64+0x1]&&(_0x72ae0f=parseInt(_0x40e929[_0x288f64+0x1],0xa),_0x288f64++);}console[_0x30f168(0x151)](_0x30f168(0x180)+_0x3765b3+':'+_0x72ae0f+_0x30f168(0x16c));const _0x3cd721=await isServerRunning(_0x3765b3,_0x72ae0f);!_0x3cd721?(console[_0x30f168(0x151)](_0x30f168(0x16e)),await startServer(_0x3765b3,_0x72ae0f)):console[_0x30f168(0x151)](_0x30f168(0x171)+_0x3765b3+':'+_0x72ae0f),console[_0x30f168(0x151)](''),console[_0x30f168(0x151)]('🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'),console[_0x30f168(0x151)](''),await new Promise(_0x1c2348=>setTimeout(_0x1c2348,0x1f4)),process['env'][_0x30f168(0x16b)]=_0x3765b3,process[_0x30f168(0x176)][_0x30f168(0x172)]=_0x72ae0f[_0x30f168(0x175)](),await import(_0x30f168(0x165));}catch(_0x1eaf8e){console[_0x30f168(0x16d)](''),console[_0x30f168(0x16d)](_0x30f168(0x17f)),console[_0x30f168(0x16d)]('\x20\x20',_0x1eaf8e[_0x30f168(0x16f)]),console[_0x30f168(0x16d)](''),console[_0x30f168(0x16d)](_0x30f168(0x182)),console[_0x30f168(0x16d)](_0x30f168(0x161)),console['error'](_0x30f168(0x164)),console[_0x30f168(0x16d)]('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console['error'](''),process[_0x30f168(0x170)](0x1);}}main();
3
+ const a0_0x4e850b=a0_0x9d8f;(function(_0x8480bc,_0x59db32){const _0x437d35=a0_0x9d8f,_0x253e27=_0x8480bc();while(!![]){try{const _0x1069cf=-parseInt(_0x437d35(0x117))/0x1*(-parseInt(_0x437d35(0x148))/0x2)+-parseInt(_0x437d35(0x11a))/0x3*(parseInt(_0x437d35(0x132))/0x4)+-parseInt(_0x437d35(0x12d))/0x5+parseInt(_0x437d35(0x12a))/0x6*(parseInt(_0x437d35(0x11f))/0x7)+-parseInt(_0x437d35(0x119))/0x8*(parseInt(_0x437d35(0x115))/0x9)+-parseInt(_0x437d35(0x149))/0xa*(-parseInt(_0x437d35(0x142))/0xb)+parseInt(_0x437d35(0x137))/0xc;if(_0x1069cf===_0x59db32)break;else _0x253e27['push'](_0x253e27['shift']());}catch(_0x1063aa){_0x253e27['push'](_0x253e27['shift']());}}}(a0_0x495f,0xee3df));import{spawn}from'child_process';import a0_0x2f75a7 from'net';function a0_0x9d8f(_0x2de049,_0x165d18){_0x2de049=_0x2de049-0x115;const _0x495fd0=a0_0x495f();let _0x9d8fe0=_0x495fd0[_0x2de049];return _0x9d8fe0;}function a0_0x495f(){const _0x5b5aca=['error','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','LOXIA_HOST','stderr','destroy','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','248743buLgRq','now','--host','setTimeout','--port','connect','62ZjukKa','30jEsaoP','1655523hGjCZA','dirname','41803ooDGQZ','join','72zzLutE','418383ugSmQA','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','LOXIA_PORT','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','bin/cli.js','7IUdidy','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','exit','message','✗\x20Server\x20is\x20not\x20running','timeout','node','...','log','✓\x20Server\x20is\x20already\x20running\x20at\x20','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','7432098Rggoxx','web','length','1212530lMqGdh','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','slice','🚀\x20Starting\x20Loxia\x20server...','pipe','28QawvOl','✓\x20Server\x20started\x20at\x20','data','toString','Failed\x20to\x20start\x20server:','14972160EGghxB','env','Socket','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','argv'];a0_0x495f=function(){return _0x5b5aca;};return a0_0x495f();}import a0_0x2a0f77 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x2a0f77[a0_0x4e850b(0x116)](__filename),projectRoot=a0_0x2a0f77[a0_0x4e850b(0x116)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x3336b4,_0x2ad8f9){return new Promise(_0x34a330=>{const _0x270046=a0_0x9d8f,_0x3aa8c1=new a0_0x2f75a7[(_0x270046(0x139))]();_0x3aa8c1[_0x270046(0x145)](0x7d0),_0x3aa8c1['on']('connect',()=>{const _0x52722f=_0x270046;_0x3aa8c1[_0x52722f(0x140)](),_0x34a330(!![]);}),_0x3aa8c1['on'](_0x270046(0x124),()=>{const _0x5572ba=_0x270046;_0x3aa8c1[_0x5572ba(0x140)](),_0x34a330(![]);}),_0x3aa8c1['on'](_0x270046(0x13c),()=>{_0x3aa8c1['destroy'](),_0x34a330(![]);}),_0x3aa8c1[_0x270046(0x147)](_0x2ad8f9,_0x3336b4);});}async function startServer(_0x4f486a,_0x3dadbc){const _0x9e8bde=a0_0x4e850b;return console[_0x9e8bde(0x127)](_0x9e8bde(0x130)),new Promise((_0x14b156,_0x552edc)=>{const _0x2e0a2f=_0x9e8bde,_0x59675a=spawn(_0x2e0a2f(0x125),[a0_0x2a0f77[_0x2e0a2f(0x118)](projectRoot,_0x2e0a2f(0x11e)),'--ui',_0x2e0a2f(0x12b),'--host',_0x4f486a,_0x2e0a2f(0x146),_0x3dadbc[_0x2e0a2f(0x135)]()],{'detached':![],'stdio':['ignore',_0x2e0a2f(0x131),'pipe']});_0x59675a['stdout']['on']('data',()=>{}),_0x59675a[_0x2e0a2f(0x13f)]['on'](_0x2e0a2f(0x134),()=>{}),_0x59675a['on'](_0x2e0a2f(0x13c),_0x58d3ba=>{const _0x1ebd40=_0x2e0a2f;console[_0x1ebd40(0x13c)](_0x1ebd40(0x136),_0x58d3ba['message']),_0x552edc(_0x58d3ba);});const _0x51a40b=Date[_0x2e0a2f(0x143)](),_0x3e88c3=setInterval(async()=>{const _0x1461e8=_0x2e0a2f,_0x3aac3d=await isServerRunning(_0x4f486a,_0x3dadbc);if(_0x3aac3d)clearInterval(_0x3e88c3),console[_0x1461e8(0x127)](_0x1461e8(0x133)+_0x4f486a+':'+_0x3dadbc),_0x14b156();else Date[_0x1461e8(0x143)]()-_0x51a40b>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x3e88c3),_0x59675a['kill'](),_0x552edc(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x143002=a0_0x4e850b;try{console[_0x143002(0x127)](_0x143002(0x11d)),console[_0x143002(0x127)](_0x143002(0x120)),console[_0x143002(0x127)](_0x143002(0x11d)),console[_0x143002(0x127)]('');const _0x268a89=process[_0x143002(0x13b)][_0x143002(0x12f)](0x2);let _0x1f2a96=DEFAULT_HOST,_0x58e90b=DEFAULT_PORT;for(let _0x5df5b3=0x0;_0x5df5b3<_0x268a89[_0x143002(0x12c)];_0x5df5b3++){if(_0x268a89[_0x5df5b3]===_0x143002(0x144)&&_0x268a89[_0x5df5b3+0x1])_0x1f2a96=_0x268a89[_0x5df5b3+0x1],_0x5df5b3++;else _0x268a89[_0x5df5b3]===_0x143002(0x146)&&_0x268a89[_0x5df5b3+0x1]&&(_0x58e90b=parseInt(_0x268a89[_0x5df5b3+0x1],0xa),_0x5df5b3++);}console[_0x143002(0x127)](_0x143002(0x13d)+_0x1f2a96+':'+_0x58e90b+_0x143002(0x126));const _0x266eab=await isServerRunning(_0x1f2a96,_0x58e90b);!_0x266eab?(console[_0x143002(0x127)](_0x143002(0x123)),await startServer(_0x1f2a96,_0x58e90b)):console[_0x143002(0x127)](_0x143002(0x128)+_0x1f2a96+':'+_0x58e90b),console[_0x143002(0x127)](''),console[_0x143002(0x127)](_0x143002(0x141)),console[_0x143002(0x127)](''),await new Promise(_0x3d230f=>setTimeout(_0x3d230f,0x1f4)),process[_0x143002(0x138)][_0x143002(0x13e)]=_0x1f2a96,process[_0x143002(0x138)][_0x143002(0x11c)]=_0x58e90b[_0x143002(0x135)](),await import('../src/interfaces/terminal/index.js');}catch(_0x58e7e9){console[_0x143002(0x13c)](''),console[_0x143002(0x13c)](_0x143002(0x12e)),console['error']('\x20\x20',_0x58e7e9[_0x143002(0x122)]),console[_0x143002(0x13c)](''),console['error']('💡\x20Troubleshooting:'),console[_0x143002(0x13c)](_0x143002(0x11b)),console['error'](_0x143002(0x13a)),console[_0x143002(0x13c)](_0x143002(0x129)),console[_0x143002(0x13c)](''),process[_0x143002(0x121)](0x1);}}main();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x324cbc=a0_0x1c0e;(function(_0x85e984,_0x4822d6){const _0x3f28c9=a0_0x1c0e,_0x177afe=_0x85e984();while(!![]){try{const _0x7e334e=parseInt(_0x3f28c9(0x12c))/0x1*(parseInt(_0x3f28c9(0x114))/0x2)+-parseInt(_0x3f28c9(0x132))/0x3+-parseInt(_0x3f28c9(0x113))/0x4+parseInt(_0x3f28c9(0x11a))/0x5+-parseInt(_0x3f28c9(0x127))/0x6*(-parseInt(_0x3f28c9(0x125))/0x7)+parseInt(_0x3f28c9(0x118))/0x8+-parseInt(_0x3f28c9(0x121))/0x9;if(_0x7e334e===_0x4822d6)break;else _0x177afe['push'](_0x177afe['shift']());}catch(_0x59c761){_0x177afe['push'](_0x177afe['shift']());}}}(a0_0x4617,0x456bc));function a0_0x1c0e(_0x58b36f,_0x24a03e){_0x58b36f=_0x58b36f-0x113;const _0x46173c=a0_0x4617();let _0x1c0eb3=_0x46173c[_0x58b36f];return _0x1c0eb3;}function a0_0x4617(){const _0x16188e=['274hmJMbW','LOXIA_PORT','host','port','2452896JboWBP','\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','2392675ttpkVd','LOXIA_HOST','--host','env','log','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','exit','3975642ntcxmq','Connecting\x20to:\x20','length','waitUntilExit','1373365vqIkhW','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','6hvSlqh','isTTY','\x20\x20-\x20Some\x20CI/CD\x20environments','argv','catch','97AFTrUR','error','--help','slice','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','431703LiFsuv','stdin','498576pfSRrM'];a0_0x4617=function(){return _0x16188e;};return a0_0x4617();}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x324cbc(0x12a)][a0_0x324cbc(0x12f)](0x2),options={'host':'localhost','port':0x1f90};for(let i=0x0;i<args[a0_0x324cbc(0x123)];i++){const arg=args[i];if(arg===a0_0x324cbc(0x11c)||arg==='-h')options[a0_0x324cbc(0x116)]=args[++i];else{if(arg==='--port'||arg==='-p')options[a0_0x324cbc(0x117)]=parseInt(args[++i],0xa);else arg===a0_0x324cbc(0x12e)&&(console['log'](a0_0x324cbc(0x119)),process[a0_0x324cbc(0x120)](0x0));}}process[a0_0x324cbc(0x11d)]['LOXIA_HOST']&&(options[a0_0x324cbc(0x116)]=process['env'][a0_0x324cbc(0x11b)]);process[a0_0x324cbc(0x11d)][a0_0x324cbc(0x115)]&&(options[a0_0x324cbc(0x117)]=parseInt(process['env']['LOXIA_PORT'],0xa));!process[a0_0x324cbc(0x133)][a0_0x324cbc(0x128)]&&(console['error'](a0_0x324cbc(0x126)),console[a0_0x324cbc(0x12d)](''),console['error']('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x324cbc(0x12d)](a0_0x324cbc(0x131)),console['error'](a0_0x324cbc(0x130)),console['error'](a0_0x324cbc(0x11f)),console[a0_0x324cbc(0x12d)](a0_0x324cbc(0x129)),console[a0_0x324cbc(0x12d)](''),console[a0_0x324cbc(0x12d)]('Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:'),console[a0_0x324cbc(0x12d)]('\x20\x20npm\x20run\x20terminal-ui'),console[a0_0x324cbc(0x12d)](''),console[a0_0x324cbc(0x12d)]('Or\x20use\x20the\x20web\x20UI\x20instead:'),console[a0_0x324cbc(0x12d)]('\x20\x20npm\x20start'),process[a0_0x324cbc(0x120)](0x1));console[a0_0x324cbc(0x11e)]('Starting\x20Loxia\x20Terminal\x20UI...'),console[a0_0x324cbc(0x11e)](a0_0x324cbc(0x122)+options[a0_0x324cbc(0x116)]+':'+options[a0_0x324cbc(0x117)]),console[a0_0x324cbc(0x11e)]('Press\x20Ctrl+C\x20to\x20exit\x0a');const instance=startTerminalUI(options);instance[a0_0x324cbc(0x124)]()['then'](()=>{console['log']('\x0aTerminal\x20UI\x20exited'),process['exit'](0x0);})[a0_0x324cbc(0x12b)](_0x5d5560=>{const _0x271f06=a0_0x324cbc;console['error']('\x0aTerminal\x20UI\x20error:',_0x5d5560),process[_0x271f06(0x120)](0x1);});
3
+ const a0_0xff4462=a0_0x2fd9;(function(_0x48918d,_0x5afe01){const _0x5c27ff=a0_0x2fd9,_0x263f51=_0x48918d();while(!![]){try{const _0x1cbec9=parseInt(_0x5c27ff(0x197))/0x1*(-parseInt(_0x5c27ff(0x189))/0x2)+parseInt(_0x5c27ff(0x195))/0x3+parseInt(_0x5c27ff(0x18a))/0x4+-parseInt(_0x5c27ff(0x188))/0x5+parseInt(_0x5c27ff(0x17f))/0x6+-parseInt(_0x5c27ff(0x18f))/0x7*(parseInt(_0x5c27ff(0x183))/0x8)+parseInt(_0x5c27ff(0x19c))/0x9;if(_0x1cbec9===_0x5afe01)break;else _0x263f51['push'](_0x263f51['shift']());}catch(_0x10a417){_0x263f51['push'](_0x263f51['shift']());}}}(a0_0x5974,0x3c6ab));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0xff4462(0x1a1)][a0_0xff4462(0x187)](0x2),options={'host':'localhost','port':0x1f90};function a0_0x2fd9(_0x3a1686,_0x4a4959){_0x3a1686=_0x3a1686-0x17a;const _0x597417=a0_0x5974();let _0x2fd90e=_0x597417[_0x3a1686];return _0x2fd90e;}function a0_0x5974(){const _0x5c9eea=['\x20\x20npm\x20run\x20terminal-ui','The\x20terminal\x20UI\x20cannot\x20run\x20in:','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','log','2137429oaypDU','\x0aTerminal\x20UI\x20error:','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','--port','host','port','92712qwTMjQ','error','1UeuDYX','--host','Or\x20use\x20the\x20web\x20UI\x20instead:','\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','Starting\x20Loxia\x20Terminal\x20UI...','4854717rLMmmH','--help','isTTY','exit','length','argv','Connecting\x20to:\x20','stdin','waitUntilExit','catch','\x20\x20-\x20Some\x20CI/CD\x20environments','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','2101278osAApP','LOXIA_HOST','then','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','8ZDkeyz','LOXIA_PORT','env','Press\x20Ctrl+C\x20to\x20exit\x0a','slice','1899690qYchTD','798782mPGMeY','1646452BviSgB'];a0_0x5974=function(){return _0x5c9eea;};return a0_0x5974();}for(let i=0x0;i<args[a0_0xff4462(0x1a0)];i++){const arg=args[i];if(arg===a0_0xff4462(0x198)||arg==='-h')options[a0_0xff4462(0x193)]=args[++i];else{if(arg===a0_0xff4462(0x192)||arg==='-p')options[a0_0xff4462(0x194)]=parseInt(args[++i],0xa);else arg===a0_0xff4462(0x19d)&&(console['log'](a0_0xff4462(0x19a)),process[a0_0xff4462(0x19f)](0x0));}}process[a0_0xff4462(0x185)][a0_0xff4462(0x180)]&&(options['host']=process[a0_0xff4462(0x185)][a0_0xff4462(0x180)]);process[a0_0xff4462(0x185)][a0_0xff4462(0x184)]&&(options[a0_0xff4462(0x194)]=parseInt(process['env'][a0_0xff4462(0x184)],0xa));!process[a0_0xff4462(0x17a)][a0_0xff4462(0x19e)]&&(console[a0_0xff4462(0x196)](a0_0xff4462(0x191)),console[a0_0xff4462(0x196)](''),console[a0_0xff4462(0x196)](a0_0xff4462(0x18c)),console[a0_0xff4462(0x196)](a0_0xff4462(0x18d)),console['error'](a0_0xff4462(0x17e)),console[a0_0xff4462(0x196)](a0_0xff4462(0x182)),console[a0_0xff4462(0x196)](a0_0xff4462(0x17d)),console[a0_0xff4462(0x196)](''),console[a0_0xff4462(0x196)]('Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:'),console['error'](a0_0xff4462(0x18b)),console[a0_0xff4462(0x196)](''),console[a0_0xff4462(0x196)](a0_0xff4462(0x199)),console[a0_0xff4462(0x196)]('\x20\x20npm\x20start'),process[a0_0xff4462(0x19f)](0x1));console[a0_0xff4462(0x18e)](a0_0xff4462(0x19b)),console[a0_0xff4462(0x18e)](a0_0xff4462(0x1a2)+options['host']+':'+options['port']),console[a0_0xff4462(0x18e)](a0_0xff4462(0x186));const instance=startTerminalUI(options);instance[a0_0xff4462(0x17b)]()[a0_0xff4462(0x181)](()=>{const _0x4ef69c=a0_0xff4462;console[_0x4ef69c(0x18e)]('\x0aTerminal\x20UI\x20exited'),process[_0x4ef69c(0x19f)](0x0);})[a0_0xff4462(0x17c)](_0x1fd63d=>{const _0x4149c6=a0_0xff4462;console[_0x4149c6(0x196)](_0x4149c6(0x190),_0x1fd63d),process[_0x4149c6(0x19f)](0x1);});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x30bd90=a0_0x1637;(function(_0x1c3d03,_0x2c2eb7){const _0xc9b422=a0_0x1637,_0x44f6c4=_0x1c3d03();while(!![]){try{const _0x37150f=parseInt(_0xc9b422(0x1ce))/0x1+-parseInt(_0xc9b422(0x1b7))/0x2+parseInt(_0xc9b422(0x1a2))/0x3+-parseInt(_0xc9b422(0x1ba))/0x4*(-parseInt(_0xc9b422(0x1c3))/0x5)+-parseInt(_0xc9b422(0x1ad))/0x6+-parseInt(_0xc9b422(0x1d1))/0x7+-parseInt(_0xc9b422(0x1b5))/0x8*(-parseInt(_0xc9b422(0x1a7))/0x9);if(_0x37150f===_0x2c2eb7)break;else _0x44f6c4['push'](_0x44f6c4['shift']());}catch(_0x294ce4){_0x44f6c4['push'](_0x44f6c4['shift']());}}}(a0_0x3e92,0x39dee));import{spawn}from'child_process';import{fileURLToPath}from'url';function a0_0x1637(_0x568003,_0x5ab689){_0x568003=_0x568003-0x19f;const _0x3e92d1=a0_0x3e92();let _0x1637b3=_0x3e92d1[_0x568003];return _0x1637b3;}import{dirname,join}from'path';import a0_0x497fdc from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env'][a0_0x30bd90(0x1b6)]||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x56f617=0xa,_0x18a67c=0x1f4){const _0xa2ea3c=a0_0x30bd90;for(let _0x479b9c=0x0;_0x479b9c<_0x56f617;_0x479b9c++){try{return await new Promise((_0x14ce61,_0x5f1dbe)=>{const _0x2fbe90=a0_0x1637,_0xa803f=a0_0x497fdc[_0x2fbe90(0x1b3)](_0x2fbe90(0x1af)+SERVER_PORT+'/health',_0x36b95f=>{const _0xbce4c1=_0x2fbe90;_0x36b95f['statusCode']===0xc8?_0x14ce61():_0x5f1dbe(new Error(_0xbce4c1(0x1c7)+_0x36b95f[_0xbce4c1(0x1cc)]));});_0xa803f['on'](_0x2fbe90(0x1b9),_0x5f1dbe),_0xa803f[_0x2fbe90(0x1a4)](0x3e8,()=>{const _0x1a7648=_0x2fbe90;_0xa803f[_0x1a7648(0x1bc)](),_0x5f1dbe(new Error(_0x1a7648(0x1d2)));});}),console[_0xa2ea3c(0x1cf)](_0xa2ea3c(0x1cb)),!![];}catch(_0x156e00){_0x479b9c<_0x56f617-0x1&&await new Promise(_0xf70640=>setTimeout(_0xf70640,_0x18a67c));}}return console[_0xa2ea3c(0x1cf)]('⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...'),![];}async function startServer(){return new Promise(_0x16a436=>{const _0x5b6f05=a0_0x1637;console['log'](_0x5b6f05(0x1b4));const _0x2b0821=join(rootDir,_0x5b6f05(0x1bf),_0x5b6f05(0x1ca));serverProcess=spawn(_0x5b6f05(0x1c9),[_0x2b0821],{'cwd':rootDir,'env':{...process[_0x5b6f05(0x1a8)]},'stdio':[_0x5b6f05(0x1a1),_0x5b6f05(0x1a9),_0x5b6f05(0x1a9)],'detached':![]}),serverProcess[_0x5b6f05(0x1a3)]['on']('data',_0x44e768=>{const _0x295bfb=_0x5b6f05,_0x140d5d=_0x44e768[_0x295bfb(0x1b8)]()[_0x295bfb(0x1c5)]();_0x140d5d&&console[_0x295bfb(0x1cf)](_0x295bfb(0x1ab)+_0x140d5d);}),serverProcess[_0x5b6f05(0x1bb)]['on'](_0x5b6f05(0x1d0),_0x4d3fd5=>{const _0x292417=_0x5b6f05,_0x2a120a=_0x4d3fd5[_0x292417(0x1b8)]()[_0x292417(0x1c5)]();_0x2a120a&&!_0x2a120a['includes']('ExperimentalWarning')&&console['error'](_0x292417(0x1b0)+_0x2a120a);}),serverProcess['on'](_0x5b6f05(0x1b9),_0x2fd4bb=>{const _0x4b2571=_0x5b6f05;console['error'](_0x4b2571(0x1b2),_0x2fd4bb[_0x4b2571(0x1c6)]),process['exit'](0x1);}),serverProcess['on'](_0x5b6f05(0x1aa),(_0x3993ee,_0x4a06d4)=>{const _0x18b544=_0x5b6f05;_0x3993ee!==null&&_0x3993ee!==0x0&&(console[_0x18b544(0x1b9)](_0x18b544(0x1cd)+_0x3993ee),process[_0x18b544(0x1aa)](_0x3993ee));}),setTimeout(_0x16a436,STARTUP_WAIT);});}async function startTerminalUI(){const _0x40847c=a0_0x30bd90;console[_0x40847c(0x1cf)](_0x40847c(0x1c1)),console[_0x40847c(0x1cf)]('');const _0x57a478=join(rootDir,_0x40847c(0x1c4),'loxia-terminal.js'),_0xee790a=spawn('node',[_0x57a478],{'cwd':rootDir,'env':{...process[_0x40847c(0x1a8)]},'stdio':_0x40847c(0x1a6)});return _0xee790a['on']('error',_0x2bf173=>{const _0x17a00b=_0x40847c;console[_0x17a00b(0x1b9)](_0x17a00b(0x1c2),_0x2bf173[_0x17a00b(0x1c6)]),cleanup(),process[_0x17a00b(0x1aa)](0x1);}),_0xee790a['on']('exit',_0x94c138=>{const _0x1cd988=_0x40847c;console[_0x1cd988(0x1cf)](_0x1cd988(0x1c0)),cleanup(),process[_0x1cd988(0x1aa)](_0x94c138||0x0);}),_0xee790a;}function cleanup(){const _0x4eace4=a0_0x30bd90;serverProcess&&!serverProcess[_0x4eace4(0x1be)]&&(console[_0x4eace4(0x1cf)](_0x4eace4(0x1c8)),serverProcess['kill'](_0x4eace4(0x1a0)),setTimeout(()=>{const _0xe46bc2=_0x4eace4;!serverProcess[_0xe46bc2(0x1be)]&&serverProcess['kill'](_0xe46bc2(0x1bd));},0x1388));}process['on']('SIGINT',()=>{const _0x4667a5=a0_0x30bd90;console[_0x4667a5(0x1cf)](_0x4667a5(0x1a5)),cleanup(),process[_0x4667a5(0x1aa)](0x0);}),process['on'](a0_0x30bd90(0x1a0),()=>{const _0xb4fee1=a0_0x30bd90;console[_0xb4fee1(0x1cf)]('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x30bd90(0x1aa),()=>{cleanup();});function a0_0x3e92(){const _0xf9a5d9=['1537878USmWQA','╚════════════════════════════════════════════════╝','http://localhost:','[SERVER\x20ERROR]\x20','Error\x20during\x20startup:','Failed\x20to\x20start\x20server:','get','🚀\x20Starting\x20Loxia\x20server...','5704DdNgQD','PORT','77852HtTwyr','toString','error','158252NQnSaF','stderr','destroy','SIGKILL','killed','src','\x0a👋\x20Terminal\x20UI\x20closed.','🖥️\x20\x20Starting\x20Terminal\x20UI...','Failed\x20to\x20start\x20Terminal\x20UI:','45bKemgu','bin','trim','message','Server\x20returned\x20','🛑\x20Stopping\x20server...','node','index.js','✅\x20Server\x20is\x20ready!','statusCode','Server\x20exited\x20with\x20code\x20','458317hSWqYO','log','data','3152394AEGztO','Timeout','╔════════════════════════════════════════════════╗','SIGTERM','ignore','76905QUcKai','stdout','setTimeout','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','inherit','1800WFgGOF','env','pipe','exit','[SERVER]\x20','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'];a0_0x3e92=function(){return _0xf9a5d9;};return a0_0x3e92();}async function main(){const _0x978a9=a0_0x30bd90;console[_0x978a9(0x1cf)](_0x978a9(0x19f)),console[_0x978a9(0x1cf)](_0x978a9(0x1ac)),console[_0x978a9(0x1cf)](_0x978a9(0x1ae)),console[_0x978a9(0x1cf)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x575159){console[_0x978a9(0x1b9)](_0x978a9(0x1b1),_0x575159[_0x978a9(0x1c6)]),cleanup(),process[_0x978a9(0x1aa)](0x1);}}main();
3
+ const a0_0x5c4b23=a0_0x2b5f;(function(_0x255279,_0x51eda7){const _0x39d590=a0_0x2b5f,_0x3f7a99=_0x255279();while(!![]){try{const _0x4d6ad7=-parseInt(_0x39d590(0x18e))/0x1*(-parseInt(_0x39d590(0x176))/0x2)+parseInt(_0x39d590(0x198))/0x3+parseInt(_0x39d590(0x172))/0x4*(-parseInt(_0x39d590(0x17b))/0x5)+-parseInt(_0x39d590(0x185))/0x6*(-parseInt(_0x39d590(0x1a0))/0x7)+-parseInt(_0x39d590(0x174))/0x8+-parseInt(_0x39d590(0x1a2))/0x9+-parseInt(_0x39d590(0x18f))/0xa*(parseInt(_0x39d590(0x18b))/0xb);if(_0x4d6ad7===_0x51eda7)break;else _0x3f7a99['push'](_0x3f7a99['shift']());}catch(_0x5ac190){_0x3f7a99['push'](_0x3f7a99['shift']());}}}(a0_0x5912,0x9c77c));import{spawn}from'child_process';function a0_0x2b5f(_0x1faf70,_0x5c0780){_0x1faf70=_0x1faf70-0x16e;const _0x591241=a0_0x5912();let _0x2b5f8c=_0x591241[_0x1faf70];return _0x2b5f8c;}import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x492670 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env'][a0_0x5c4b23(0x19e)]||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x2933a6=0xa,_0x317290=0x1f4){const _0x1a6d23=a0_0x5c4b23;for(let _0xe51ffa=0x0;_0xe51ffa<_0x2933a6;_0xe51ffa++){try{return await new Promise((_0x7d5a28,_0x86caf4)=>{const _0xad59fc=a0_0x2b5f,_0x45687f=a0_0x492670[_0xad59fc(0x188)](_0xad59fc(0x1a1)+SERVER_PORT+'/health',_0xb3f44=>{const _0x1b900d=_0xad59fc;_0xb3f44[_0x1b900d(0x18d)]===0xc8?_0x7d5a28():_0x86caf4(new Error(_0x1b900d(0x186)+_0xb3f44['statusCode']));});_0x45687f['on'](_0xad59fc(0x177),_0x86caf4),_0x45687f[_0xad59fc(0x19a)](0x3e8,()=>{_0x45687f['destroy'](),_0x86caf4(new Error('Timeout'));});}),console[_0x1a6d23(0x183)](_0x1a6d23(0x180)),!![];}catch(_0x532f18){_0xe51ffa<_0x2933a6-0x1&&await new Promise(_0xd6af9f=>setTimeout(_0xd6af9f,_0x317290));}}return console[_0x1a6d23(0x183)](_0x1a6d23(0x170)),![];}async function startServer(){return new Promise(_0x144807=>{const _0x2761b4=a0_0x2b5f;console['log'](_0x2761b4(0x18c));const _0xe789aa=join(rootDir,_0x2761b4(0x17e),_0x2761b4(0x182));serverProcess=spawn(_0x2761b4(0x171),[_0xe789aa],{'cwd':rootDir,'env':{...process[_0x2761b4(0x19f)]},'stdio':['ignore',_0x2761b4(0x175),_0x2761b4(0x175)],'detached':![]}),serverProcess[_0x2761b4(0x184)]['on'](_0x2761b4(0x17f),_0x3cf444=>{const _0x54a433=_0x2761b4,_0x428b25=_0x3cf444[_0x54a433(0x191)]()[_0x54a433(0x19b)]();_0x428b25&&console[_0x54a433(0x183)](_0x54a433(0x195)+_0x428b25);}),serverProcess[_0x2761b4(0x173)]['on'](_0x2761b4(0x17f),_0x491057=>{const _0x3d60f6=_0x2761b4,_0xeb930=_0x491057[_0x3d60f6(0x191)]()[_0x3d60f6(0x19b)]();_0xeb930&&!_0xeb930[_0x3d60f6(0x199)](_0x3d60f6(0x18a))&&console['error'](_0x3d60f6(0x17a)+_0xeb930);}),serverProcess['on'](_0x2761b4(0x177),_0x3530a4=>{const _0xcfb878=_0x2761b4;console[_0xcfb878(0x177)](_0xcfb878(0x197),_0x3530a4[_0xcfb878(0x17c)]),process[_0xcfb878(0x189)](0x1);}),serverProcess['on'](_0x2761b4(0x189),(_0x2fc614,_0x6b789)=>{const _0x6123d0=_0x2761b4;_0x2fc614!==null&&_0x2fc614!==0x0&&(console[_0x6123d0(0x177)](_0x6123d0(0x187)+_0x2fc614),process[_0x6123d0(0x189)](_0x2fc614));}),setTimeout(_0x144807,STARTUP_WAIT);});}async function startTerminalUI(){const _0x5aa366=a0_0x5c4b23;console['log'](_0x5aa366(0x196)),console[_0x5aa366(0x183)]('');const _0x2dd182=join(rootDir,'bin','loxia-terminal.js'),_0x478954=spawn(_0x5aa366(0x171),[_0x2dd182],{'cwd':rootDir,'env':{...process[_0x5aa366(0x19f)]},'stdio':'inherit'});return _0x478954['on']('error',_0x1644ce=>{const _0x19edf8=_0x5aa366;console[_0x19edf8(0x177)](_0x19edf8(0x178),_0x1644ce[_0x19edf8(0x17c)]),cleanup(),process[_0x19edf8(0x189)](0x1);}),_0x478954['on'](_0x5aa366(0x189),_0x431bf3=>{const _0x3a26c1=_0x5aa366;console['log'](_0x3a26c1(0x193)),cleanup(),process['exit'](_0x431bf3||0x0);}),_0x478954;}function cleanup(){const _0x1fee85=a0_0x5c4b23;serverProcess&&!serverProcess[_0x1fee85(0x190)]&&(console[_0x1fee85(0x183)](_0x1fee85(0x179)),serverProcess[_0x1fee85(0x194)](_0x1fee85(0x17d)),setTimeout(()=>{const _0x15e3c5=_0x1fee85;!serverProcess['killed']&&serverProcess['kill'](_0x15e3c5(0x181));},0x1388));}process['on'](a0_0x5c4b23(0x16e),()=>{const _0x150bce=a0_0x5c4b23;console['log'](_0x150bce(0x19c)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x5c4b23(0x17d),()=>{const _0x283f08=a0_0x5c4b23;console[_0x283f08(0x183)]('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process[_0x283f08(0x189)](0x0);}),process['on']('exit',()=>{cleanup();});async function main(){const _0x4384f4=a0_0x5c4b23;console[_0x4384f4(0x183)](_0x4384f4(0x16f)),console[_0x4384f4(0x183)]('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console[_0x4384f4(0x183)](_0x4384f4(0x19d)),console[_0x4384f4(0x183)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x36d2bb){console[_0x4384f4(0x177)](_0x4384f4(0x192),_0x36d2bb['message']),cleanup(),process[_0x4384f4(0x189)](0x1);}}main();function a0_0x5912(){const _0x10755f=['src','data','✅\x20Server\x20is\x20ready!','SIGKILL','index.js','log','stdout','216WKnGlx','Server\x20returned\x20','Server\x20exited\x20with\x20code\x20','get','exit','ExperimentalWarning','7512978sRLujh','🚀\x20Starting\x20Loxia\x20server...','statusCode','1oQfcIL','20VRUduL','killed','toString','Error\x20during\x20startup:','\x0a👋\x20Terminal\x20UI\x20closed.','kill','[SERVER]\x20','🖥️\x20\x20Starting\x20Terminal\x20UI...','Failed\x20to\x20start\x20server:','3458967vGctDk','includes','setTimeout','trim','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','╚════════════════════════════════════════════════╝','PORT','env','170534fGGlTu','http://localhost:','6099696RcxFlC','SIGINT','╔════════════════════════════════════════════════╗','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','node','20iOEyFW','stderr','2914584JHvFlZ','pipe','2429658Vpsmmg','error','Failed\x20to\x20start\x20Terminal\x20UI:','🛑\x20Stopping\x20server...','[SERVER\x20ERROR]\x20','195895LjnCCZ','message','SIGTERM'];a0_0x5912=function(){return _0x10755f;};return a0_0x5912();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "1.0.5",
3
+ "version": "1.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_0x1d159b=a0_0x2484;(function(_0x16a2d3,_0x36508e){const _0x1d9b6b=a0_0x2484,_0x3c9fca=_0x16a2d3();while(!![]){try{const _0xc0120=-parseInt(_0x1d9b6b(0xea))/0x1+parseInt(_0x1d9b6b(0x100))/0x2+-parseInt(_0x1d9b6b(0xcf))/0x3*(-parseInt(_0x1d9b6b(0x103))/0x4)+-parseInt(_0x1d9b6b(0xf1))/0x5*(parseInt(_0x1d9b6b(0x108))/0x6)+-parseInt(_0x1d9b6b(0xd7))/0x7*(-parseInt(_0x1d9b6b(0xe7))/0x8)+parseInt(_0x1d9b6b(0x10a))/0x9+-parseInt(_0x1d9b6b(0xce))/0xa*(parseInt(_0x1d9b6b(0xfc))/0xb);if(_0xc0120===_0x36508e)break;else _0x3c9fca['push'](_0x3c9fca['shift']());}catch(_0x23e10c){_0x3c9fca['push'](_0x3c9fca['shift']());}}}(a0_0x2116,0x3403c));function a0_0x2116(){const _0x1a2d20=['192322pdHRIF','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','1027204CCIEJq','\x20\x20\x20Location:\x20','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20-m\x20pip\x20show\x20','6RdYQZb','get','2687976LMDDLR','.scanners','startsWith','location','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','semgrep','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','statusCode','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','error','platform','close','5540FByeDp','3EUahrh','yamllint','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','https','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','\x20\x20\x20pip\x20install\x20semgrep\x0a','Failed\x20to\x20download:\x20HTTP\x20','python','749IjgTPr','pipe','═══════════════════════════════════════════════════════════\x0a','\x20\x20\x20✅\x20Python\x20found:\x20','join','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','pip-audit','promises','═══════════════════════════════════════════════════════════','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','🐍\x20Checking\x20Python\x20scanners...','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','python\x20--version','finish','log','21208apIobo','then','🔍\x20Installing\x20Semgrep...','3974TeWVib','message','\x20\x20\x20Installing\x20','\x20\x20\x20✅\x20','\x20\x20Installing\x20Security\x20Scanners','\x20installed\x20successfully','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','511045LfbfVc','url','semgrep\x20--version','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','v1.55.0','node_modules','stdout','exit','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','trim','12232SXCaTD','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','dirname','...'];a0_0x2116=function(){return _0x1a2d20;};return a0_0x2116();}import{exec}from'child_process';import{promisify}from'util';import a0_0x3b027f from'https';import a0_0x397531 from'http';import a0_0x8223b5 from'fs';import a0_0x573003 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_0x573003[a0_0x1d159b(0xfe)](__filename),SCANNER_DIR=a0_0x573003[a0_0x1d159b(0xdb)](__dirname,'..',a0_0x1d159b(0xf6),a0_0x1d159b(0x10b)),SEMGREP_VERSION=a0_0x1d159b(0xf5);console[a0_0x1d159b(0xe6)](a0_0x1d159b(0xe0)),console[a0_0x1d159b(0xe6)](a0_0x1d159b(0xee)),console[a0_0x1d159b(0xe6)](a0_0x1d159b(0xd9));async function installScanners(){const _0x8953ff=a0_0x1d159b;await a0_0x8223b5[_0x8953ff(0xdf)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x8953ff(0xe6)]('\x0a═══════════════════════════════════════════════════════════'),console[_0x8953ff(0xe6)]('\x20\x20Installation\x20Complete'),console[_0x8953ff(0xe6)](_0x8953ff(0xd9));}async function checkESLintSecurity(){const _0x2c2cc6=a0_0x1d159b;console['log'](_0x2c2cc6(0x110));try{await import('eslint-plugin-security'),console[_0x2c2cc6(0xe6)](_0x2c2cc6(0xd3));}catch(_0x2ceb0e){console['log'](_0x2c2cc6(0x106)),console[_0x2c2cc6(0xe6)](_0x2c2cc6(0xf0));}}async function installSemgrep(){const _0x38b9a9=a0_0x1d159b;console[_0x38b9a9(0xe6)](_0x38b9a9(0xe9));const _0x4accb7=process[_0x38b9a9(0xcc)],_0x23fa45=process['arch'];try{const _0xcb0fa4=await execAsync(_0x38b9a9(0xf3),{'timeout':0x1388});console['log'](_0x38b9a9(0xd1)+_0xcb0fa4[_0x38b9a9(0xf7)][_0x38b9a9(0xfb)]()),console['log'](_0x38b9a9(0x113));return;}catch(_0x59cba3){console['log'](_0x38b9a9(0xfa));}const _0x39a13e=getSemgrepBinaryInfo(_0x4accb7,_0x23fa45);if(!_0x39a13e){console['log'](_0x38b9a9(0x111)+_0x4accb7+'-'+_0x23fa45),console[_0x38b9a9(0xe6)](_0x38b9a9(0xdd));return;}try{const _0x159fcc=a0_0x573003[_0x38b9a9(0xdb)](SCANNER_DIR,'semgrep');console[_0x38b9a9(0xe6)]('\x20\x20\x20Downloading\x20from\x20'+_0x39a13e[_0x38b9a9(0xf2)]+_0x38b9a9(0xff)),await downloadFile(_0x39a13e['url'],_0x159fcc),await a0_0x8223b5[_0x38b9a9(0xdf)]['chmod'](_0x159fcc,0x1ed),console[_0x38b9a9(0xe6)](_0x38b9a9(0xf9)),console[_0x38b9a9(0xe6)](_0x38b9a9(0x104)+_0x159fcc+'\x0a'),console['log'](_0x38b9a9(0x105)),console['log'](_0x38b9a9(0xd4));}catch(_0x2f304e){console['log']('\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20'+_0x2f304e[_0x38b9a9(0xeb)]),console[_0x38b9a9(0xe6)](_0x38b9a9(0xfd));}}function getSemgrepBinaryInfo(_0xd4aa66,_0x256a38){return null;}async function installPythonScanners(){const _0x2b16bd=a0_0x1d159b;console['log'](_0x2b16bd(0xe2));let _0x3b0e8f=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x3b0e8f='python3';}catch(_0xa1d3cd){try{await execAsync(_0x2b16bd(0xe4),{'timeout':0x1388}),_0x3b0e8f=_0x2b16bd(0xd6);}catch(_0x2cf2e8){console[_0x2b16bd(0xe6)](_0x2b16bd(0xe3)),console[_0x2b16bd(0xe6)](_0x2b16bd(0xf4)),console[_0x2b16bd(0xe6)](_0x2b16bd(0x10e));return;}}console['log'](_0x2b16bd(0xda)+_0x3b0e8f),await installViaPip(_0x2b16bd(0x10f),_0x3b0e8f),await installViaPip('bandit',_0x3b0e8f),await installViaPip(_0x2b16bd(0xde),_0x3b0e8f),await installViaPip('checkov',_0x3b0e8f),await installViaPip(_0x2b16bd(0xd0),_0x3b0e8f),console[_0x2b16bd(0xe6)]('');}async function installViaPip(_0x3ba79f,_0x152e02){const _0x55e3ba=a0_0x1d159b;try{const _0x1e7c8f=await execAsync(_0x152e02+_0x55e3ba(0x107)+_0x3ba79f,{'timeout':0x1388});return console[_0x55e3ba(0xe6)](_0x55e3ba(0xed)+_0x3ba79f+'\x20already\x20installed'),!![];}catch(_0x200db7){console['log'](_0x55e3ba(0xec)+_0x3ba79f+_0x55e3ba(0xff));try{return await execAsync(_0x152e02+'\x20-m\x20pip\x20install\x20--user\x20'+_0x3ba79f,{'timeout':0xea60}),console[_0x55e3ba(0xe6)](_0x55e3ba(0xed)+_0x3ba79f+_0x55e3ba(0xef)),!![];}catch(_0x58ed59){return console[_0x55e3ba(0xe6)](_0x55e3ba(0x102)+_0x3ba79f+':\x20'+_0x58ed59[_0x55e3ba(0xeb)]),console['log'](_0x55e3ba(0xdc)+_0x3ba79f),![];}}}async function downloadFile(_0x2a1a6e,_0x1b9692){return new Promise((_0x555722,_0x2f16b2)=>{const _0x89ec5a=a0_0x2484,_0x43c9e0=_0x2a1a6e[_0x89ec5a(0x10c)](_0x89ec5a(0xd2))?a0_0x3b027f:a0_0x397531;_0x43c9e0[_0x89ec5a(0x109)](_0x2a1a6e,_0x4d9eb9=>{const _0x5375be=_0x89ec5a;if(_0x4d9eb9[_0x5375be(0x112)]===0x12e||_0x4d9eb9[_0x5375be(0x112)]===0x12d){downloadFile(_0x4d9eb9['headers'][_0x5375be(0x10d)],_0x1b9692)[_0x5375be(0xe8)](_0x555722)['catch'](_0x2f16b2);return;}if(_0x4d9eb9[_0x5375be(0x112)]!==0xc8){_0x2f16b2(new Error(_0x5375be(0xd5)+_0x4d9eb9[_0x5375be(0x112)]));return;}const _0x44e5c3=createWriteStream(_0x1b9692);_0x4d9eb9[_0x5375be(0xd8)](_0x44e5c3),_0x44e5c3['on'](_0x5375be(0xe5),()=>{const _0x1eb7d0=_0x5375be;_0x44e5c3[_0x1eb7d0(0xcd)](),_0x555722();}),_0x44e5c3['on'](_0x5375be(0xcb),_0x48b435=>{a0_0x8223b5['unlink'](_0x1b9692,()=>{}),_0x2f16b2(_0x48b435);});})['on'](_0x89ec5a(0xcb),_0x2f16b2);});}function a0_0x2484(_0x411c83,_0x289072){_0x411c83=_0x411c83-0xcb;const _0x211641=a0_0x2116();let _0x2484b9=_0x211641[_0x411c83];return _0x2484b9;}installScanners()['catch'](_0x36f92b=>{const _0x5064b8=a0_0x1d159b;console[_0x5064b8(0xcb)]('❌\x20Installation\x20failed:',_0x36f92b[_0x5064b8(0xeb)]),console[_0x5064b8(0xcb)]('\x0aYou\x20can\x20manually\x20install\x20scanners:'),console[_0x5064b8(0xcb)](_0x5064b8(0xe1)),console[_0x5064b8(0xcb)](_0x5064b8(0x101)),process[_0x5064b8(0xf8)](0x0);});
2
+ function a0_0x502f(){const _0x23c45d=['\x20\x20\x20Location:\x20','488RTFrbk','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','❌\x20Installation\x20failed:','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','pip-audit','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20-m\x20pip\x20install\x20--user\x20','🐍\x20Checking\x20Python\x20scanners...','\x20\x20\x20Downloading\x20from\x20','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','error','semgrep','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','yamllint','log','14kTznbk','close','pipe','═══════════════════════════════════════════════════════════\x0a','bandit','711333ZudhZG','python3\x20--version','...','url','stdout','.scanners','join','message','\x20installed\x20successfully','\x20\x20\x20✅\x20Python\x20found:\x20','catch','\x20\x20Installing\x20Security\x20Scanners','8189960zHiMJq','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','headers','20545mRbHXG','7fATTKZ','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','\x0a═══════════════════════════════════════════════════════════','Failed\x20to\x20download:\x20HTTP\x20','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','984112SgSGho','\x20\x20\x20✅\x20','checkov','location','\x20-m\x20pip\x20show\x20','44310THvLTP','python3','semgrep\x20--version','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','statusCode','551682dlaUkT','chmod','═══════════════════════════════════════════════════════════','\x20\x20\x20Installing\x20','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','finish','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','🔍\x20Installing\x20Semgrep...','11GkNnUD','29289VzHUYN','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','https','unlink','exit','python','startsWith','mkdir','get'];a0_0x502f=function(){return _0x23c45d;};return a0_0x502f();}const a0_0x129c01=a0_0x1a99;(function(_0xb89910,_0x4ee367){const _0x176553=a0_0x1a99,_0x87c948=_0xb89910();while(!![]){try{const _0x576578=parseInt(_0x176553(0x87))/0x1+parseInt(_0x176553(0xac))/0x2*(parseInt(_0x176553(0x90))/0x3)+-parseInt(_0x176553(0x9a))/0x4*(-parseInt(_0x176553(0xc0))/0x5)+-parseInt(_0x176553(0x81))/0x6*(-parseInt(_0x176553(0xc1))/0x7)+parseInt(_0x176553(0xc6))/0x8+-parseInt(_0x176553(0xb1))/0x9+-parseInt(_0x176553(0xbd))/0xa*(parseInt(_0x176553(0x8f))/0xb);if(_0x576578===_0x4ee367)break;else _0x87c948['push'](_0x87c948['shift']());}catch(_0x198b99){_0x87c948['push'](_0x87c948['shift']());}}}(a0_0x502f,0x56597));import{exec}from'child_process';import{promisify}from'util';import a0_0x485850 from'https';import a0_0x4df76f from'http';import a0_0x3b9ac5 from'fs';import a0_0x589fbb 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_0x589fbb['dirname'](__filename),SCANNER_DIR=a0_0x589fbb[a0_0x129c01(0xb7)](__dirname,'..','node_modules',a0_0x129c01(0xb6)),SEMGREP_VERSION='v1.55.0';console[a0_0x129c01(0xab)](a0_0x129c01(0x89)),console[a0_0x129c01(0xab)](a0_0x129c01(0xbc)),console['log'](a0_0x129c01(0xaf));async function installScanners(){const _0x26109b=a0_0x129c01;await a0_0x3b9ac5['promises'][_0x26109b(0x97)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x26109b(0xab)](_0x26109b(0xc3)),console[_0x26109b(0xab)]('\x20\x20Installation\x20Complete'),console['log'](_0x26109b(0xaf));}async function checkESLintSecurity(){const _0x306115=a0_0x129c01;console[_0x306115(0xab)](_0x306115(0x84));try{await import('eslint-plugin-security'),console[_0x306115(0xab)](_0x306115(0xa9));}catch(_0x5e6d79){console[_0x306115(0xab)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x306115(0xab)](_0x306115(0x85));}}async function installSemgrep(){const _0x2ceefe=a0_0x129c01;console[_0x2ceefe(0xab)](_0x2ceefe(0x8e));const _0x351147=process['platform'],_0x2d13ed=process['arch'];try{const _0x549e07=await execAsync(_0x2ceefe(0x83),{'timeout':0x1388});console[_0x2ceefe(0xab)](_0x2ceefe(0x9b)+_0x549e07[_0x2ceefe(0xb5)]['trim']()),console['log'](_0x2ceefe(0x91));return;}catch(_0x7de870){console[_0x2ceefe(0xab)](_0x2ceefe(0x9c));}const _0x381bc7=getSemgrepBinaryInfo(_0x351147,_0x2d13ed);if(!_0x381bc7){console[_0x2ceefe(0xab)](_0x2ceefe(0xa5)+_0x351147+'-'+_0x2d13ed),console['log'](_0x2ceefe(0xc2));return;}try{const _0x14ba91=a0_0x589fbb['join'](SCANNER_DIR,_0x2ceefe(0xa7));console[_0x2ceefe(0xab)](_0x2ceefe(0xa4)+_0x381bc7[_0x2ceefe(0xb4)]+_0x2ceefe(0xb3)),await downloadFile(_0x381bc7['url'],_0x14ba91),await a0_0x3b9ac5['promises'][_0x2ceefe(0x88)](_0x14ba91,0x1ed),console[_0x2ceefe(0xab)](_0x2ceefe(0x8d)),console[_0x2ceefe(0xab)](_0x2ceefe(0x99)+_0x14ba91+'\x0a'),console[_0x2ceefe(0xab)]('\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'),console[_0x2ceefe(0xab)]('\x20\x20\x20pip\x20install\x20semgrep\x0a');}catch(_0x2cc3d5){console[_0x2ceefe(0xab)](_0x2ceefe(0xa8)+_0x2cc3d5[_0x2ceefe(0xb8)]),console['log']('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0x5185cd,_0x4d03cf){return null;}async function installPythonScanners(){const _0x1f4432=a0_0x129c01;console['log'](_0x1f4432(0xa3));let _0x2be45b=null;try{await execAsync(_0x1f4432(0xb2),{'timeout':0x1388}),_0x2be45b=_0x1f4432(0x82);}catch(_0xa2d998){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x2be45b=_0x1f4432(0x95);}catch(_0x2928cf){console[_0x1f4432(0xab)](_0x1f4432(0xc5)),console[_0x1f4432(0xab)](_0x1f4432(0x9e)),console[_0x1f4432(0xab)](_0x1f4432(0x8b));return;}}console[_0x1f4432(0xab)](_0x1f4432(0xba)+_0x2be45b),await installViaPip(_0x1f4432(0xa7),_0x2be45b),await installViaPip(_0x1f4432(0xb0),_0x2be45b),await installViaPip(_0x1f4432(0xa0),_0x2be45b),await installViaPip(_0x1f4432(0xc8),_0x2be45b),await installViaPip(_0x1f4432(0xaa),_0x2be45b),console[_0x1f4432(0xab)]('');}async function installViaPip(_0x5c54c6,_0x314b0c){const _0x14a1ca=a0_0x129c01;try{const _0x2beac2=await execAsync(_0x314b0c+_0x14a1ca(0x80)+_0x5c54c6,{'timeout':0x1388});return console[_0x14a1ca(0xab)](_0x14a1ca(0xc7)+_0x5c54c6+'\x20already\x20installed'),!![];}catch(_0x501f57){console['log'](_0x14a1ca(0x8a)+_0x5c54c6+_0x14a1ca(0xb3));try{return await execAsync(_0x314b0c+_0x14a1ca(0xa2)+_0x5c54c6,{'timeout':0xea60}),console[_0x14a1ca(0xab)](_0x14a1ca(0xc7)+_0x5c54c6+_0x14a1ca(0xb9)),!![];}catch(_0x99a406){return console[_0x14a1ca(0xab)](_0x14a1ca(0x9f)+_0x5c54c6+':\x20'+_0x99a406[_0x14a1ca(0xb8)]),console[_0x14a1ca(0xab)](_0x14a1ca(0xbe)+_0x5c54c6),![];}}}function a0_0x1a99(_0x3426ed,_0x598957){_0x3426ed=_0x3426ed-0x7f;const _0x502f95=a0_0x502f();let _0x1a9915=_0x502f95[_0x3426ed];return _0x1a9915;}async function downloadFile(_0x2d6d31,_0x4c9ffb){return new Promise((_0x4ab9c1,_0x5aec5f)=>{const _0x54f0fc=a0_0x1a99,_0x44c875=_0x2d6d31[_0x54f0fc(0x96)](_0x54f0fc(0x92))?a0_0x485850:a0_0x4df76f;_0x44c875[_0x54f0fc(0x98)](_0x2d6d31,_0x5f0138=>{const _0xc243d9=_0x54f0fc;if(_0x5f0138[_0xc243d9(0x86)]===0x12e||_0x5f0138['statusCode']===0x12d){downloadFile(_0x5f0138[_0xc243d9(0xbf)][_0xc243d9(0x7f)],_0x4c9ffb)['then'](_0x4ab9c1)[_0xc243d9(0xbb)](_0x5aec5f);return;}if(_0x5f0138['statusCode']!==0xc8){_0x5aec5f(new Error(_0xc243d9(0xc4)+_0x5f0138[_0xc243d9(0x86)]));return;}const _0x2156a1=createWriteStream(_0x4c9ffb);_0x5f0138[_0xc243d9(0xae)](_0x2156a1),_0x2156a1['on'](_0xc243d9(0x8c),()=>{const _0x202d6c=_0xc243d9;_0x2156a1[_0x202d6c(0xad)](),_0x4ab9c1();}),_0x2156a1['on']('error',_0x46db60=>{const _0x2100d5=_0xc243d9;a0_0x3b9ac5[_0x2100d5(0x93)](_0x4c9ffb,()=>{}),_0x5aec5f(_0x46db60);});})['on'](_0x54f0fc(0xa6),_0x5aec5f);});}installScanners()['catch'](_0x56d082=>{const _0x119c02=a0_0x129c01;console[_0x119c02(0xa6)](_0x119c02(0x9d),_0x56d082[_0x119c02(0xb8)]),console[_0x119c02(0xa6)]('\x0aYou\x20can\x20manually\x20install\x20scanners:'),console[_0x119c02(0xa6)](_0x119c02(0xa1)),console['error']('\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit'),process[_0x119c02(0x94)](0x0);});
@@ -1 +1 @@
1
- function a0_0x4aa3(_0x361574,_0x3f6ca7){_0x361574=_0x361574-0x1d2;const _0x473809=a0_0x4738();let _0x4aa340=_0x473809[_0x361574];if(a0_0x4aa3['KJMuIq']===undefined){var _0x28fd12=function(_0x31779a){const _0x100f71='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x57853b='',_0x7d9970='';for(let _0x41212e=0x0,_0x4cfede,_0x52aaa1,_0x127f56=0x0;_0x52aaa1=_0x31779a['charAt'](_0x127f56++);~_0x52aaa1&&(_0x4cfede=_0x41212e%0x4?_0x4cfede*0x40+_0x52aaa1:_0x52aaa1,_0x41212e++%0x4)?_0x57853b+=String['fromCharCode'](0xff&_0x4cfede>>(-0x2*_0x41212e&0x6)):0x0){_0x52aaa1=_0x100f71['indexOf'](_0x52aaa1);}for(let _0xd3c318=0x0,_0x295574=_0x57853b['length'];_0xd3c318<_0x295574;_0xd3c318++){_0x7d9970+='%'+('00'+_0x57853b['charCodeAt'](_0xd3c318)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x7d9970);};a0_0x4aa3['FAyeDE']=_0x28fd12,a0_0x4aa3['ekWwyK']={},a0_0x4aa3['KJMuIq']=!![];}const _0x2a7c5f=_0x473809[0x0],_0x125d40=_0x361574+_0x2a7c5f,_0x4132ec=a0_0x4aa3['ekWwyK'][_0x125d40];return!_0x4132ec?(_0x4aa340=a0_0x4aa3['FAyeDE'](_0x4aa340),a0_0x4aa3['ekWwyK'][_0x125d40]=_0x4aa340):_0x4aa340=_0x4132ec,_0x4aa340;}const a0_0x256eec=a0_0x4aa3;(function(_0x4f6064,_0x3b2251){const _0x3c99ca=a0_0x4aa3,_0x1d83ad=_0x4f6064();while(!![]){try{const _0xc6729a=parseInt(_0x3c99ca(0x1fd))/0x1+parseInt(_0x3c99ca(0x1e1))/0x2+-parseInt(_0x3c99ca(0x1e4))/0x3+-parseInt(_0x3c99ca(0x1e2))/0x4*(parseInt(_0x3c99ca(0x1f7))/0x5)+parseInt(_0x3c99ca(0x1e3))/0x6*(-parseInt(_0x3c99ca(0x1f1))/0x7)+-parseInt(_0x3c99ca(0x1e5))/0x8+parseInt(_0x3c99ca(0x1df))/0x9;if(_0xc6729a===_0x3b2251)break;else _0x1d83ad['push'](_0x1d83ad['shift']());}catch(_0x57ed9a){_0x1d83ad['push'](_0x1d83ad['shift']());}}}(a0_0x4738,0x9bdc6));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x57853b=null){const _0x53f88b=a0_0x4aa3;this['logger']=_0x57853b,this[_0x53f88b(0x1ea)]=null,this[_0x53f88b(0x203)]=null,this['postcssScss']=null,this['postcssLess']=null;}async['analyze'](_0x7d9970,_0x41212e,_0x4cfede={}){const _0x387b7d=a0_0x4aa3;try{const _0x52aaa1=[],_0x127f56=this['detectLanguage'](_0x7d9970),_0xd3c318=await this['checkSyntax'](_0x7d9970,_0x41212e,_0x127f56);_0x52aaa1[_0x387b7d(0x210)](..._0xd3c318);if(_0xd3c318['length']===0x0){const _0x295574=await this[_0x387b7d(0x1ee)](_0x7d9970,_0x41212e,_0x127f56);_0x52aaa1[_0x387b7d(0x210)](..._0x295574);}return this['logger']?.[_0x387b7d(0x1fc)]('CSS\x20analysis\x20completed',{'file':_0x7d9970,'language':_0x127f56,'totalDiagnostics':_0x52aaa1['length'],'errors':_0x52aaa1['filter'](_0x843180=>_0x843180[_0x387b7d(0x1eb)]===STATIC_ANALYSIS['SEVERITY'][_0x387b7d(0x20b)])[_0x387b7d(0x1ef)],'warnings':_0x52aaa1[_0x387b7d(0x1dc)](_0x51ed1e=>_0x51ed1e['severity']===STATIC_ANALYSIS[_0x387b7d(0x1db)]['WARNING'])['length']}),_0x52aaa1;}catch(_0x55cee5){return this[_0x387b7d(0x1f8)]?.['error'](_0x387b7d(0x1e7),{'file':_0x7d9970,'error':_0x55cee5[_0x387b7d(0x1f3)]}),[];}}async[a0_0x256eec(0x212)](_0x410c04,_0x3a881b,_0x4c6332){const _0xf6a347=a0_0x256eec,_0x543d0c=[];try{if(!this[_0xf6a347(0x203)]){const _0x4d1495=await import('postcss');this['postcss']=_0x4d1495[_0xf6a347(0x1fe)];}let _0x2d8430=null;if(_0x4c6332==='scss'){if(!this[_0xf6a347(0x20c)]){const _0x49a1dd=await import('postcss-scss');this[_0xf6a347(0x20c)]=_0x49a1dd['default'];}_0x2d8430=this['postcssScss'];}else{if(_0x4c6332==='less'){if(!this[_0xf6a347(0x1e6)]){const _0x36eaad=await import(_0xf6a347(0x211));this['postcssLess']=_0x36eaad[_0xf6a347(0x1fe)];}_0x2d8430=this[_0xf6a347(0x1e6)];}}const _0x1d233b=this[_0xf6a347(0x203)]()['process'](_0x3a881b,{'from':_0x410c04,'syntax':_0x2d8430}),_0x48da2e=_0x1d233b[_0xf6a347(0x1d7)];this[_0xf6a347(0x1f8)]?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0x410c04});}catch(_0x4a3f07){const _0x530d34=this[_0xf6a347(0x208)](_0x4a3f07,_0x410c04);_0x530d34&&_0x543d0c['push'](_0x530d34);}return _0x543d0c;}async['lintStyles'](_0x4bdf67,_0x5c7fb7,_0x3fbd76){const _0x5745c0=a0_0x256eec,_0x51ee66=[];try{if(!this['stylelint']){const _0x2374ae=await import(_0x5745c0(0x1ea));this['stylelint']=_0x2374ae['default'];}const _0x289e8c={'extends':['stylelint-config-standard'],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':['/^custom-/',_0x5745c0(0x209)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x3fbd76===_0x5745c0(0x1f5)?[!![],{'ignoreAtRules':[_0x5745c0(0x1e9),_0x5745c0(0x20d),'extend','if',_0x5745c0(0x1f6),'for',_0x5745c0(0x1f0),_0x5745c0(0x204),'function','return','content','use','forward']}]:_0x3fbd76===_0x5745c0(0x1d3)?[!![],{'ignoreAtRules':[_0x5745c0(0x201)]}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':'lower'},'customSyntax':_0x3fbd76==='scss'?_0x5745c0(0x1e8):_0x3fbd76==='less'?'postcss-less':undefined},_0x1a054a=await this['stylelint']['lint']({'code':_0x5c7fb7,'codeFilename':_0x4bdf67,'config':_0x289e8c});if(_0x1a054a[_0x5745c0(0x206)]&&_0x1a054a[_0x5745c0(0x206)][_0x5745c0(0x1ef)]>0x0){const _0x40f137=_0x1a054a['results'][0x0];if(_0x40f137['warnings'])for(const _0x1fffa5 of _0x40f137[_0x5745c0(0x1ff)]){_0x51ee66['push']({'file':_0x4bdf67,'line':_0x1fffa5[_0x5745c0(0x1e0)]||0x1,'column':_0x1fffa5['column']||0x1,'severity':_0x1fffa5['severity']===_0x5745c0(0x207)?STATIC_ANALYSIS[_0x5745c0(0x1db)][_0x5745c0(0x20b)]:STATIC_ANALYSIS[_0x5745c0(0x1db)][_0x5745c0(0x205)],'rule':_0x1fffa5[_0x5745c0(0x1fb)]||_0x5745c0(0x20e),'message':_0x1fffa5['text'],'category':this['categorizeStylelintRule'](_0x1fffa5['rule']),'fixable':![],'source':_0x5745c0(0x1ea)});}}}catch(_0x2e86fa){this[_0x5745c0(0x1f8)]?.['warn'](_0x5745c0(0x1fa),{'file':_0x4bdf67,'error':_0x2e86fa[_0x5745c0(0x1f3)]});}return _0x51ee66;}[a0_0x256eec(0x208)](_0x49a0f6,_0x3bbcb4){const _0x4be0ed=a0_0x256eec;return{'file':_0x3bbcb4,'line':_0x49a0f6[_0x4be0ed(0x1e0)]||0x1,'column':_0x49a0f6[_0x4be0ed(0x20a)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x49a0f6['name']||_0x4be0ed(0x1ec),'message':_0x49a0f6[_0x4be0ed(0x1d8)]||_0x49a0f6['message'],'category':STATIC_ANALYSIS[_0x4be0ed(0x202)][_0x4be0ed(0x1d5)],'fixable':![],'source':'postcss','code':_0x49a0f6[_0x4be0ed(0x1d4)]||undefined};}['categorizeStylelintRule'](_0x55e96d){const _0x521056=a0_0x256eec;if(!_0x55e96d)return STATIC_ANALYSIS[_0x521056(0x202)][_0x521056(0x1d2)];const _0x54f201=_0x55e96d['toLowerCase']();if(_0x54f201[_0x521056(0x1de)](_0x521056(0x1ed))||_0x54f201['includes'](_0x521056(0x20f))||_0x54f201['includes'](_0x521056(0x1f9))||_0x54f201[_0x521056(0x1de)]('syntax'))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x54f201['includes']('performance')||_0x54f201['includes'](_0x521056(0x200)))return STATIC_ANALYSIS[_0x521056(0x202)]['PERFORMANCE'];if(_0x54f201['includes'](_0x521056(0x1d9))||_0x54f201['includes']('recommended'))return STATIC_ANALYSIS[_0x521056(0x202)]['BEST_PRACTICE'];return STATIC_ANALYSIS['CATEGORY'][_0x521056(0x1d2)];}['detectLanguage'](_0x28d950){const _0x437077=a0_0x256eec,_0x5d7ad2=_0x28d950['toLowerCase']();if(_0x5d7ad2['endsWith']('.scss')||_0x5d7ad2['endsWith'](_0x437077(0x1da)))return'scss';if(_0x5d7ad2[_0x437077(0x1d6)](_0x437077(0x1f2)))return _0x437077(0x1d3);return'css';}[a0_0x256eec(0x1dd)](){const _0x2eda3b=a0_0x256eec;return['.css',_0x2eda3b(0x1f4),_0x2eda3b(0x1da),'.less'];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;function a0_0x4738(){const _0x1a23e1=['zw5KC1DPDgG','CM9VDa','CMvHC29U','yMvZDc1WCMfJDgLJzq','lNnHC3m','u0vwrvjjvfK','zMLSDgvY','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','Aw5JBhvKzxm','mtuYnta4mZnSt0TLrMi','BgLUzq','mJm2otC4mLzMr0f2DW','ntj3uLzTCxm','ntiYnKLsquDhsq','mZCWodm5m2TlC1D3uq','ndaYntuZnKHlEg9suW','Cg9ZDgnZC0XLC3m','q1ntigfUywX5C2LZigzHAwXLza','Cg9ZDgnZCY1Zy3nZ','BwL4Aw4','C3r5BgvSAw50','C2v2zxjPDhK','q3nZu3LUDgf4rxjYB3i','BM8TAw52ywXPza','BgLUDfn0EwXLCW','BgvUz3rO','zwfJAa','mZmXmuDdteLuyG','lMXLC3m','BwvZC2fNzq','lNnJC3m','C2nZCW','zwXZzq','ndC2nZi1uMv2BNbg','Bg9Nz2vY','BM8Tzw1WDhK','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','CNvSzq','zgvIDwC','mte0otC2owDUCKv3Cq','zgvMyxvSDa','D2fYBMLUz3m','B3b0Aw1PEMu','CgX1z2LU','q0furuDpuLK','Cg9ZDgnZCW','D2HPBgu','v0fstKLorW','CMvZDwX0CW','zxjYB3i','zM9YBwf0ug9ZDentu0vYCM9Y','BMCTzgvLCa','y29SDw1U','rvjst1i','Cg9ZDgnZC1nJC3m','Aw5JBhvKzq','Dw5RBM93BG','BM8TDw5RBM93BG','ChvZAa','Cg9ZDgnZCY1SzxnZ','y2HLy2TtEw50yxG','u1rzteu','BgvZCW','C291CMnL','u1Lovefy'];a0_0x4738=function(){return _0x1a23e1;};return a0_0x4738();}
1
+ const a0_0x11a127=a0_0x4601;(function(_0xef98f1,_0x1ab223){const _0x268098=a0_0x4601,_0x3aa0aa=_0xef98f1();while(!![]){try{const _0x3780c1=parseInt(_0x268098(0xb7))/0x1+-parseInt(_0x268098(0x9c))/0x2+parseInt(_0x268098(0xab))/0x3+-parseInt(_0x268098(0xca))/0x4*(-parseInt(_0x268098(0xad))/0x5)+-parseInt(_0x268098(0xc9))/0x6+-parseInt(_0x268098(0xb5))/0x7*(-parseInt(_0x268098(0xa0))/0x8)+-parseInt(_0x268098(0xb4))/0x9;if(_0x3780c1===_0x1ab223)break;else _0x3aa0aa['push'](_0x3aa0aa['shift']());}catch(_0x1e8a0d){_0x3aa0aa['push'](_0x3aa0aa['shift']());}}}(a0_0x31cf,0xd28a1));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x31cf(){const _0x2b1cf0=['ChvZAa','Dg9mB3DLCKnHC2u','CMvHC29U','Cg9ZDgnZC1nJC3m','y29SDw1U','zxH0zw5K','D2fYBMLUz3m','mtC5otm3mgzlAMvwtW','neDlDfHMBq','zNvUy3rPB24','Dw5RBM93BG','v0fstKLorW','BgLUDfn0EwXLCW','Dgv4Da','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','BwvZC2fNzq','Aw5JBhvKzq','u1Lovefy','rvjst1i','Aw5JBhvKzxm','u1rzteu','lMnZCW','Cg9ZDgnZCW','Cg9ZDgnZCY1SzxnZ','mtiZndy1nLj1CxvztG','Bg9Nz2vY','y2HLy2TtEw50yxG','lMXLC3m','ndCYALzhuwfS','CMvJB21Tzw5Kzwq','zwfJAa','CMv0DxjU','Bg93zxi','yw5HBhL6zq','Cg9ZDgnZCY1Zy3nZ','l15JDxn0B20TlW','zM9YBwf0ug9ZDentu0vYCM9Y','BgvUz3rO','BM8TAw52ywXPza','ndy5mJmZnNLrANDHwa','BgvZCW','ndy2oteYnufdzhfXAG','lNnJC3m','q0furuDpuLK','u0vwrvjjvfK','zM9Y','Cg9ZDgnZC0XLC3m','zMLSDgvY','mtmXmZeWmdL3DuT6Bwq','odi4mJrvswjKz3G','uevsrK9stufoq0u','ndi1nJHywwfMB1C','C3r5BgvSAw50','C2v2zxjPDhK','CgvYzM9YBwfUy2u','D2fYBG','BMCTzgvLCa','C2nZCW','qKvtvf9quKfdveLdrq','C291CMnL','CMvZDwX0CW','zgvIDwC'];a0_0x31cf=function(){return _0x2b1cf0;};return a0_0x31cf();}function a0_0x4601(_0x3ca8d0,_0x38e0bd){_0x3ca8d0=_0x3ca8d0-0x8e;const _0x31cfea=a0_0x31cf();let _0x4601f7=_0x31cfea[_0x3ca8d0];if(a0_0x4601['TDwzSn']===undefined){var _0x1fd2b5=function(_0xb9e9eb){const _0xc1b107='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5798cc='',_0xbb3bb6='';for(let _0x3ec6f6=0x0,_0x247648,_0x3987ae,_0x12597b=0x0;_0x3987ae=_0xb9e9eb['charAt'](_0x12597b++);~_0x3987ae&&(_0x247648=_0x3ec6f6%0x4?_0x247648*0x40+_0x3987ae:_0x3987ae,_0x3ec6f6++%0x4)?_0x5798cc+=String['fromCharCode'](0xff&_0x247648>>(-0x2*_0x3ec6f6&0x6)):0x0){_0x3987ae=_0xc1b107['indexOf'](_0x3987ae);}for(let _0x19c405=0x0,_0x557922=_0x5798cc['length'];_0x19c405<_0x557922;_0x19c405++){_0xbb3bb6+='%'+('00'+_0x5798cc['charCodeAt'](_0x19c405)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xbb3bb6);};a0_0x4601['pdlZwn']=_0x1fd2b5,a0_0x4601['FPDFos']={},a0_0x4601['TDwzSn']=!![];}const _0x27ab76=_0x31cfea[0x0],_0x1d6493=_0x3ca8d0+_0x27ab76,_0x498714=a0_0x4601['FPDFos'][_0x1d6493];return!_0x498714?(_0x4601f7=a0_0x4601['pdlZwn'](_0x4601f7),a0_0x4601['FPDFos'][_0x1d6493]=_0x4601f7):_0x4601f7=_0x498714,_0x4601f7;}class CSSAnalyzer{constructor(_0x5798cc=null){const _0x49aaf6=a0_0x4601;this['logger']=_0x5798cc,this[_0x49aaf6(0xb8)]=null,this['postcss']=null,this[_0x49aaf6(0xc5)]=null,this['postcssLess']=null;}async[a0_0x11a127(0xa5)](_0xbb3bb6,_0x3ec6f6,_0x247648={}){const _0x161ea2=a0_0x11a127;try{const _0x3987ae=[],_0x12597b=this['detectLanguage'](_0xbb3bb6),_0x19c405=await this['checkSyntax'](_0xbb3bb6,_0x3ec6f6,_0x12597b);_0x3987ae[_0x161ea2(0xc2)](..._0x19c405);if(_0x19c405[_0x161ea2(0xa9)]===0x0){const _0x557922=await this[_0x161ea2(0x90)](_0xbb3bb6,_0x3ec6f6,_0x12597b);_0x3987ae['push'](..._0x557922);}return this['logger']?.[_0x161ea2(0xc1)]('CSS\x20analysis\x20completed',{'file':_0xbb3bb6,'language':_0x12597b,'totalDiagnostics':_0x3987ae[_0x161ea2(0xa9)],'errors':_0x3987ae[_0x161ea2(0xb3)](_0x1b6ddb=>_0x1b6ddb[_0x161ea2(0xb9)]===STATIC_ANALYSIS[_0x161ea2(0xb0)]['ERROR'])[_0x161ea2(0xa9)],'warnings':_0x3987ae[_0x161ea2(0xb3)](_0x5eed35=>_0x5eed35['severity']===STATIC_ANALYSIS['SEVERITY'][_0x161ea2(0x8f)])['length']}),_0x3987ae;}catch(_0x3b0254){return this['logger']?.['error']('CSS\x20analysis\x20failed',{'file':_0xbb3bb6,'error':_0x3b0254[_0x161ea2(0x93)]}),[];}}async[a0_0x11a127(0x9e)](_0x43ba7a,_0x880b94,_0x1e636b){const _0x44051f=a0_0x11a127,_0x3149b5=[];try{if(!this['postcss']){const _0x1a3408=await import('postcss');this[_0x44051f(0x9a)]=_0x1a3408['default'];}let _0x223e7a=null;if(_0x1e636b==='scss'){if(!this[_0x44051f(0xc5)]){const _0x80cf4f=await import('postcss-scss');this[_0x44051f(0xc5)]=_0x80cf4f['default'];}_0x223e7a=this['postcssScss'];}else{if(_0x1e636b===_0x44051f(0xac)){if(!this[_0x44051f(0xb2)]){const _0x3fa21b=await import(_0x44051f(0x9b));this[_0x44051f(0xb2)]=_0x3fa21b['default'];}_0x223e7a=this['postcssLess'];}}const _0x3a7123=this['postcss']()['process'](_0x880b94,{'from':_0x43ba7a,'syntax':_0x223e7a}),_0x581d24=_0x3a7123['root'];this[_0x44051f(0x9d)]?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0x43ba7a});}catch(_0x21c24e){const _0xd16bee=this[_0x44051f(0xa8)](_0x21c24e,_0x43ba7a);_0xd16bee&&_0x3149b5['push'](_0xd16bee);}return _0x3149b5;}async['lintStyles'](_0xfd8efa,_0x27ad66,_0x11c8b0){const _0x4a88c6=a0_0x11a127,_0x911d08=[];try{if(!this['stylelint']){const _0x2ca96c=await import('stylelint');this['stylelint']=_0x2ca96c['default'];}const _0xf6daa9={'extends':[_0x4a88c6(0x92)],'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':[_0x4a88c6(0xa7),_0x4a88c6(0xbc)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x11c8b0===_0x4a88c6(0xbd)?[!![],{'ignoreAtRules':['mixin',_0x4a88c6(0x94),_0x4a88c6(0xc7),'if','else',_0x4a88c6(0xb1),_0x4a88c6(0xa2),'while',_0x4a88c6(0xcb),_0x4a88c6(0xa3),'content','use','forward']}]:_0x11c8b0===_0x4a88c6(0xac)?[!![],{'ignoreAtRules':['plugin']}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':_0x4a88c6(0xa4)},'customSyntax':_0x11c8b0===_0x4a88c6(0xbd)?_0x4a88c6(0xa6):_0x11c8b0==='less'?_0x4a88c6(0x9b):undefined},_0x4fe50f=await this['stylelint']['lint']({'code':_0x27ad66,'codeFilename':_0xfd8efa,'config':_0xf6daa9});if(_0x4fe50f['results']&&_0x4fe50f[_0x4a88c6(0xc0)]['length']>0x0){const _0x46ede0=_0x4fe50f[_0x4a88c6(0xc0)][0x0];if(_0x46ede0['warnings'])for(const _0x460653 of _0x46ede0[_0x4a88c6(0xc8)]){_0x911d08[_0x4a88c6(0xc2)]({'file':_0xfd8efa,'line':_0x460653['line']||0x1,'column':_0x460653[_0x4a88c6(0xc6)]||0x1,'severity':_0x460653[_0x4a88c6(0xb9)]==='error'?STATIC_ANALYSIS['SEVERITY'][_0x4a88c6(0x96)]:STATIC_ANALYSIS['SEVERITY'][_0x4a88c6(0x8f)],'rule':_0x460653['rule']||_0x4a88c6(0x8e),'message':_0x460653[_0x4a88c6(0x91)],'category':this['categorizeStylelintRule'](_0x460653['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x5beb2d){this[_0x4a88c6(0x9d)]?.[_0x4a88c6(0xbb)]('Stylelint\x20analysis\x20failed',{'file':_0xfd8efa,'error':_0x5beb2d['message']});}return _0x911d08;}['formatPostCSSError'](_0x48c742,_0x241ca8){const _0x3fe28e=a0_0x11a127;return{'file':_0x241ca8,'line':_0x48c742['line']||0x1,'column':_0x48c742[_0x3fe28e(0xc6)]||0x1,'severity':STATIC_ANALYSIS[_0x3fe28e(0xb0)][_0x3fe28e(0x96)],'rule':_0x48c742['name']||'CssSyntaxError','message':_0x48c742[_0x3fe28e(0xc4)]||_0x48c742[_0x3fe28e(0x93)],'category':STATIC_ANALYSIS[_0x3fe28e(0xaf)][_0x3fe28e(0x95)],'fixable':![],'source':'postcss','code':_0x48c742[_0x3fe28e(0xbf)]||undefined};}['categorizeStylelintRule'](_0x3d8cb4){const _0x5cbab4=a0_0x11a127;if(!_0x3d8cb4)return STATIC_ANALYSIS['CATEGORY'][_0x5cbab4(0x98)];const _0x49c45c=_0x3d8cb4[_0x5cbab4(0xc3)]();if(_0x49c45c['includes'](_0x5cbab4(0xaa))||_0x49c45c[_0x5cbab4(0x97)]('no-unknown')||_0x49c45c['includes']('no-empty')||_0x49c45c[_0x5cbab4(0x97)]('syntax'))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x49c45c['includes'](_0x5cbab4(0xba))||_0x49c45c[_0x5cbab4(0x97)]('optimize'))return STATIC_ANALYSIS['CATEGORY'][_0x5cbab4(0xb6)];if(_0x49c45c['includes']('best-practice')||_0x49c45c[_0x5cbab4(0x97)](_0x5cbab4(0xa1)))return STATIC_ANALYSIS['CATEGORY'][_0x5cbab4(0xbe)];return STATIC_ANALYSIS['CATEGORY']['STYLE'];}['detectLanguage'](_0x2a0caa){const _0x27a80e=a0_0x11a127,_0x49fab3=_0x2a0caa['toLowerCase']();if(_0x49fab3['endsWith'](_0x27a80e(0xae))||_0x49fab3['endsWith']('.sass'))return _0x27a80e(0xbd);if(_0x49fab3['endsWith'](_0x27a80e(0x9f)))return'less';return'css';}['getSupportedExtensions'](){const _0x5050b7=a0_0x11a127;return[_0x5050b7(0x99),_0x5050b7(0xae),'.sass','.less'];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
@@ -1 +1 @@
1
- const a0_0x503b4b=a0_0x308a;(function(_0x5cd5de,_0x2f47e9){const _0x1daa3a=a0_0x308a,_0x1bc44b=_0x5cd5de();while(!![]){try{const _0x5241cf=-parseInt(_0x1daa3a(0x15d))/0x1*(-parseInt(_0x1daa3a(0x19d))/0x2)+-parseInt(_0x1daa3a(0x18c))/0x3+parseInt(_0x1daa3a(0x145))/0x4+parseInt(_0x1daa3a(0x15b))/0x5+parseInt(_0x1daa3a(0x180))/0x6+parseInt(_0x1daa3a(0x157))/0x7+-parseInt(_0x1daa3a(0x13b))/0x8;if(_0x5241cf===_0x2f47e9)break;else _0x1bc44b['push'](_0x1bc44b['shift']());}catch(_0x33b974){_0x1bc44b['push'](_0x1bc44b['shift']());}}}(a0_0x1eb4,0x1e591));function a0_0x1eb4(){const _0x4ab8b7=['DMfSAwrHDgLVBG','zgvMyxvSDa','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','C3rYAwn0lw1Vzgu','DMfSAwrHDgvuC0nVBMzPzW','zMfPBgvKx2nOzwnRCW','ANnVBLnJAgvTyq','lNrMDMfYCW','ANnVBI1WyxjZzq','AgfKB2XPBNqGzgv0zwn0zwq','y2HLy2TFy2XHC3m','mJuZnZG1t0PVz2nr','AgfKB2XPBNqGls12zxjZAw9U','lNrM','ANnVBI1Zy2HLBwe','otuXmJi1wwjAuxHy','BwfW','mtK5odD6sKvMEu8','zgv0zwn0rMLSzvr5Cgu','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','AgfYzgnVzgvKlxnLy3jLDa','su5gtW','zMLSzv9SAw5Lx3jHBMDL','Aw5JBhvKzxm','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','lMPZB24','ywP2','DhjPBq','ChjPDMf0zsbRzxK','AgfKB2XPBNq','DhnJB25MAwCUANnVBG','C3bSAxq','u0vwrvjjvfK','zg9JA2vYlwnVBxbVC2u','lNLHBwW','EwfTBa','rvjst1i','ChvZAa','Aw5ZDgfUy2vqyxrO','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','yxzHAwXHyMXLu2nHBM5LCNm','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','DgvYCMfMB3jT','v0fstKLorW','C3rKB3v0','C3rHCNrZv2L0Aa','Dg9Rzw4','zgvIDwC','DMfSAwrHDgvzqu1m','DMfSAwrHDgveB2nRzxjMAwXL','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','ntuWodyWq3bPC3bN','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','AgLNAa','zMLSzq','DxrMltG','Bg9Nz2vY','z3vPzgvSAw5L','Dw5RBM93BG','zgLYBMfTzq','y29SDw1U','C2v2zxjPDhK','ANnVBG','nteWmJe5t21RvxzJ','EwfTBgXPBNq','lMvUDG','y2HLy2TFBMfTzq','Bwf0y2G','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','BwfWq2HLy2TVDLnLDMvYAxr5','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','lNLTBa','EwfTBgXPBNqGls12zxjZAw9U','BM9YBwfSAxPLuMvZDwX0CW','BwfWwwfTBgXPBNrtzxzLCML0Eq','zw52','A3vIzxjUzxrLCW','CgfYC2vdAgvJA292uMvZDwX0CW','BgLUzq','CgfYC2u','mtbhDK9xAKi','y2HHBMDLBwu','y2HLy2TVDG','D2fYBG','CgfYC2viywrVBgLUDfjLC3vSDhm','Bw9KDwXL','DMfSAwrHDgvxAxrOq2HLy2TVDG','EwfTBgXPBNqGzgv0zwn0zwq','AxnbCNjHEq','CgfJA2fNzs5QC29U','B2jQzwn0','lMDPDgH1yI93B3jRzMXVD3m','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','DMvYC2LVBG','wufntcbMAwXLihzHBgLKyxrPB24','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','DgvZDa','DhnJB25MAwCTDMfSAwrHDg9Y','Ew91CI1RzxKTAgvYzq','q1jjveLdquW','BwvKAxvT','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','DMfSAwrHDgvfBNzgAwXL','Dg9mB3DLCKnHC2u','y2HLy2TFAwq','EwfTBgXPBNqGBM90igf2ywLSywjSzq','BwvZC2fNzq','mtC5mtGXnLvLr3rwDa','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','BwfWsgfKB2XPBNrtzxzLCML0Eq','z2L0AhvIlwfJDgLVBNm','y2HLy2TVDIaTzIaI','zg9JA2vYzMLSzq','zxjYB3i','BMfTzq','CgfYyw1Z','BgvUz3rO','ndaWndqWv2PyuhrA','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','zg9JA2vYlwnVBxbVC2uUEwfTBa','y2HLy2TVDIbKzxrLy3rLza','CgfYC2vzyw1SBgLUDfjLC3vSDhm','yMfZzw5HBwu','CgfZC3DVCMq'];a0_0x1eb4=function(){return _0x4ab8b7;};return a0_0x1eb4();}import{exec}from'child_process';function a0_0x308a(_0x4dcf18,_0x4098ca){_0x4dcf18=_0x4dcf18-0x121;const _0x1eb49e=a0_0x1eb4();let _0x308ae9=_0x1eb49e[_0x4dcf18];if(a0_0x308a['aMmhgO']===undefined){var _0x7f8c79=function(_0x1c5212){const _0x562ca9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x54f32e='',_0x4d3158='';for(let _0x43dfc5=0x0,_0x1e5691,_0x482910,_0x4548c6=0x0;_0x482910=_0x1c5212['charAt'](_0x4548c6++);~_0x482910&&(_0x1e5691=_0x43dfc5%0x4?_0x1e5691*0x40+_0x482910:_0x482910,_0x43dfc5++%0x4)?_0x54f32e+=String['fromCharCode'](0xff&_0x1e5691>>(-0x2*_0x43dfc5&0x6)):0x0){_0x482910=_0x562ca9['indexOf'](_0x482910);}for(let _0x5d5652=0x0,_0xf85ec9=_0x54f32e['length'];_0x5d5652<_0xf85ec9;_0x5d5652++){_0x4d3158+='%'+('00'+_0x54f32e['charCodeAt'](_0x5d5652)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d3158);};a0_0x308a['tgAWkK']=_0x7f8c79,a0_0x308a['rmebPW']={},a0_0x308a['aMmhgO']=!![];}const _0x3a5707=_0x1eb49e[0x0],_0x1aa0f0=_0x4dcf18+_0x3a5707,_0x5524b5=a0_0x308a['rmebPW'][_0x1aa0f0];return!_0x5524b5?(_0x308ae9=a0_0x308a['tgAWkK'](_0x308ae9),a0_0x308a['rmebPW'][_0x1aa0f0]=_0x308ae9):_0x308ae9=_0x5524b5,_0x308ae9;}import{promisify}from'util';import a0_0x54f32e from'path';import a0_0x4d3158 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x43dfc5=null){this['logger']=_0x43dfc5,this['availableScanners']=null,this['scannerCache']=new Map();}async[a0_0x503b4b(0x176)](){const _0xb0c4ee=a0_0x503b4b;if(this['availableScanners']!==null)return this['availableScanners'];const _0x1e5691={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x1e5691[_0xb0c4ee(0x122)]=!![],this[_0xb0c4ee(0x185)]?.[_0xb0c4ee(0x17c)](_0xb0c4ee(0x148));}catch(_0x482910){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x482910[_0xb0c4ee(0x13a)]});}try{await execAsync(_0xb0c4ee(0x158),{'timeout':0x1388}),_0x1e5691['hadolint']=!![],this[_0xb0c4ee(0x185)]?.[_0xb0c4ee(0x17c)](_0xb0c4ee(0x155));}catch(_0x4548c6){this[_0xb0c4ee(0x185)]?.[_0xb0c4ee(0x17c)]('hadolint\x20not\x20available',{'error':_0x4548c6['message']});}try{await execAsync(_0xb0c4ee(0x195),{'timeout':0x1388}),_0x1e5691['yamllint']=!![],this[_0xb0c4ee(0x185)]?.['debug'](_0xb0c4ee(0x127));}catch(_0x5d5652){this['logger']?.[_0xb0c4ee(0x17c)](_0xb0c4ee(0x139),{'error':_0x5d5652['message']});}try{await import(_0xb0c4ee(0x166)),_0x1e5691['jsonSchema']=!![],this[_0xb0c4ee(0x185)]?.[_0xb0c4ee(0x17c)](_0xb0c4ee(0x146));}catch(_0xf85ec9){this['logger']?.[_0xb0c4ee(0x17c)]('ajv\x20not\x20available',{'error':_0xf85ec9['message']});}return this[_0xb0c4ee(0x174)]=_0x1e5691,_0x1e5691;}async['validate'](_0x5372eb,_0x4178f4={}){const _0xf4f3b3=a0_0x503b4b,_0x4a169d=[],_0x11edc0=await this[_0xf4f3b3(0x176)](),_0x2fd004=this[_0xf4f3b3(0x15e)](_0x5372eb);this['logger']?.['debug'](_0xf4f3b3(0x193),{'filePath':_0x5372eb,'fileType':_0x2fd004});switch(_0x2fd004){case'dockerfile':if(_0x11edc0[_0xf4f3b3(0x169)]){const _0x568c45=await this['validateDockerfile'](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x568c45);}if(_0x11edc0['checkov']){const _0x296da7=await this[_0xf4f3b3(0x126)](_0x5372eb,_0xf4f3b3(0x140),_0x4178f4);_0x4a169d['push'](..._0x296da7);}break;case _0xf4f3b3(0x16d):if(_0x11edc0[_0xf4f3b3(0x18d)]){const _0x46cafb=await this[_0xf4f3b3(0x17d)](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x46cafb);}if(_0x11edc0[_0xf4f3b3(0x122)]){const _0x5178c4=await this['validateWithCheckov'](_0x5372eb,'docker_compose',_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x5178c4);}break;case _0xf4f3b3(0x199):if(_0x11edc0['yamllint']){const _0x29a0d5=await this['validateYAML'](_0x5372eb,_0x4178f4);_0x4a169d['push'](..._0x29a0d5);}if(_0x11edc0[_0xf4f3b3(0x122)]){const _0x5ae22c=await this['validateWithCheckov'](_0x5372eb,_0xf4f3b3(0x199),_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x5ae22c);}break;case _0xf4f3b3(0x177):if(_0x11edc0['checkov']){const _0x245884=await this[_0xf4f3b3(0x126)](_0x5372eb,'terraform',_0x4178f4);_0x4a169d['push'](..._0x245884);}break;case _0xf4f3b3(0x129):if(_0x11edc0[_0xf4f3b3(0x152)]){const _0x319e96=await this['validatePackageJson'](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x319e96);}break;case _0xf4f3b3(0x16a):if(_0x11edc0[_0xf4f3b3(0x152)]){const _0x4a202d=await this['validateTsConfig'](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x4a202d);}break;case'github-actions':if(_0x11edc0[_0xf4f3b3(0x18d)]){const _0x31a5ed=await this[_0xf4f3b3(0x17d)](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x31a5ed);}break;case _0xf4f3b3(0x198):const _0x5c470f=await this[_0xf4f3b3(0x136)](_0x5372eb,_0x4178f4);_0x4a169d['push'](..._0x5c470f);break;case _0xf4f3b3(0x16f):if(_0x11edc0['yamllint']){const _0x339d95=await this['validateYAML'](_0x5372eb,_0x4178f4);_0x4a169d[_0xf4f3b3(0x171)](..._0x339d95);}break;default:this[_0xf4f3b3(0x185)]?.[_0xf4f3b3(0x123)]('Unknown\x20config\x20file\x20type',{'filePath':_0x5372eb,'fileType':_0x2fd004});return[];}return this[_0xf4f3b3(0x196)](_0x4a169d);}async[a0_0x503b4b(0x17e)](_0x273225,_0x24b377={}){const _0xeb6fa9=a0_0x503b4b;try{const _0x1d968c=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x273225+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x1a6590=JSON[_0xeb6fa9(0x19c)](_0x1d968c[_0xeb6fa9(0x179)]);return this['parseHadolintResults'](_0x1a6590,_0x273225);}catch(_0x4b6b9b){if(_0x4b6b9b[_0xeb6fa9(0x179)])try{const _0x3e700e=JSON['parse'](_0x4b6b9b['stdout']);return this[_0xeb6fa9(0x124)](_0x3e700e,_0x273225);}catch(_0x1d4554){this[_0xeb6fa9(0x185)]?.['error'](_0xeb6fa9(0x12c),{'error':_0x1d4554['message']});}return this[_0xeb6fa9(0x185)]?.['error'](_0xeb6fa9(0x191),{'error':_0x4b6b9b['message']}),[];}}['parseHadolintResults'](_0x2e3d21,_0x1b5ecd){const _0x5b1468=a0_0x503b4b,_0x39964a=[];if(Array[_0x5b1468(0x128)](_0x2e3d21))for(const _0x14008b of _0x2e3d21){_0x39964a[_0x5b1468(0x171)]({'file':_0x1b5ecd,'line':_0x14008b[_0x5b1468(0x19b)]||0x1,'column':_0x14008b[_0x5b1468(0x189)]||0x1,'severity':this[_0x5b1468(0x13d)](_0x14008b['level']),'rule':_0x14008b['code'],'message':_0x14008b['message'],'category':_0x5b1468(0x140),'validator':'hadolint'});}return _0x39964a;}async[a0_0x503b4b(0x17d)](_0x2b1d9f,_0x6f62ef={}){const _0x1a6a9e=a0_0x503b4b;try{const _0x134025=await execAsync(_0x1a6a9e(0x13c)+_0x2b1d9f+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x1a6a9e(0x149)](_0x134025['stdout'],_0x2b1d9f);}catch(_0x2a7552){if(_0x2a7552['stdout'])return this[_0x1a6a9e(0x149)](_0x2a7552[_0x1a6a9e(0x179)],_0x2b1d9f);return this[_0x1a6a9e(0x185)]?.['error'](_0x1a6a9e(0x12f),{'error':_0x2a7552['message']}),[];}}[a0_0x503b4b(0x149)](_0x5731d7,_0x503830){const _0x492d1c=a0_0x503b4b,_0x5214b1=[],_0x150887=_0x5731d7['split']('\x0a')['filter'](_0x18f560=>_0x18f560[_0x492d1c(0x167)]());for(const _0x6aea68 of _0x150887){const _0x2672f9=_0x6aea68[_0x492d1c(0x190)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x2672f9){const [,_0x4086ab,_0x4ac10d,_0x2131c7,_0x18bfdd,_0x130656,_0x4872d1]=_0x2672f9;_0x5214b1['push']({'file':_0x503830,'line':parseInt(_0x4ac10d,0xa),'column':parseInt(_0x2131c7,0xa),'severity':this[_0x492d1c(0x197)](_0x18bfdd),'rule':_0x4872d1,'message':_0x130656,'category':_0x492d1c(0x16f),'validator':'yamllint'});}}return _0x5214b1;}async[a0_0x503b4b(0x126)](_0x5b506d,_0x570719,_0x53ca9d={}){const _0x3a7e7d=a0_0x503b4b;try{const _0x1eb403=await execAsync(_0x3a7e7d(0x13f)+_0x5b506d+'\x22\x20--framework\x20'+_0x570719+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0xc5e6f4=JSON[_0x3a7e7d(0x19c)](_0x1eb403['stdout']);return this[_0x3a7e7d(0x19a)](_0xc5e6f4,_0x5b506d);}catch(_0x17f3b6){if(_0x17f3b6['stdout'])try{const _0x1c1c62=JSON[_0x3a7e7d(0x19c)](_0x17f3b6['stdout']);return this[_0x3a7e7d(0x19a)](_0x1c1c62,_0x5b506d);}catch(_0x593f07){this['logger']?.['error'](_0x3a7e7d(0x14e),{'error':_0x593f07['message']});}return this['logger']?.['error']('checkov\x20validation\x20failed',{'error':_0x17f3b6['message']}),[];}}[a0_0x503b4b(0x19a)](_0x59ee68,_0x4314e5){const _0x44f259=a0_0x503b4b,_0x5e9c03=[];if(_0x59ee68['results']&&_0x59ee68['results'][_0x44f259(0x151)])for(const _0x5ec328 of _0x59ee68['results']['failed_checks']){_0x5e9c03['push']({'file':_0x4314e5,'line':_0x5ec328[_0x44f259(0x162)]?_0x5ec328['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x5ec328[_0x44f259(0x156)]),'rule':_0x5ec328[_0x44f259(0x138)],'message':_0x5ec328[_0x44f259(0x18f)]||_0x5ec328['check_id'],'category':'security','validator':'checkov','remediation':_0x5ec328['guideline'],'cwe':_0x5ec328['cwe'],'references':_0x5ec328[_0x44f259(0x186)]?[_0x5ec328[_0x44f259(0x186)]]:[]});}return _0x5e9c03;}async['validatePackageJson'](_0x5c0a2a,_0xf0c189={}){const _0x1e5066=a0_0x503b4b;try{const _0x1578f5=(await import(_0x1e5066(0x166)))[_0x1e5066(0x14d)],_0x45c797=(await import('ajv-formats'))['default'],_0x5bf7ca=await a0_0x4d3158['readFile'](_0x5c0a2a,_0x1e5066(0x184)),_0x4ebdbd=JSON[_0x1e5066(0x19c)](_0x5bf7ca),_0x534200=new _0x1578f5({'allErrors':!![],'strict':![]});_0x45c797(_0x534200);const _0x21b582={'type':'object','required':[_0x1e5066(0x142),_0x1e5066(0x12d)],'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':'string','enum':[_0x1e5066(0x125),'commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x1e5066(0x12a)},'devDependencies':{'type':_0x1e5066(0x12a)}},'additionalProperties':!![]},_0x2aef27=_0x534200['compile'](_0x21b582),_0x444c7c=_0x2aef27(_0x4ebdbd);if(!_0x444c7c&&_0x2aef27['errors'])return _0x2aef27['errors']['map'](_0x53d569=>({'file':_0x5c0a2a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1e5066(0x170)],'rule':'json-schema','message':_0x53d569[_0x1e5066(0x172)]?_0x53d569['instancePath']+'\x20'+_0x53d569['message']:'must\x20have\x20required\x20property\x20\x27'+_0x53d569[_0x1e5066(0x143)]['missingProperty']+'\x27','category':_0x1e5066(0x14c),'validator':_0x1e5066(0x15a)}));return[];}catch(_0x53f357){return this['logger']?.[_0x1e5066(0x141)](_0x1e5066(0x164),{'error':_0x53f357['message']}),[{'file':_0x5c0a2a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x1e5066(0x16c)][_0x1e5066(0x170)],'rule':_0x1e5066(0x154),'message':'Invalid\x20JSON:\x20'+_0x53f357['message'],'category':'syntax','validator':'json-parse'}];}}async[a0_0x503b4b(0x150)](_0x2d9462,_0x2c41df={}){const _0x4eb095=a0_0x503b4b;try{const _0x2ec2c5=await a0_0x4d3158['readFile'](_0x2d9462,'utf-8'),_0x4de39e=JSON[_0x4eb095(0x19c)](_0x2ec2c5),_0x4235a4=[];if(_0x4de39e['compilerOptions']){const _0x497954=_0x4de39e['compilerOptions'];!_0x497954['strict']&&_0x4235a4[_0x4eb095(0x171)]({'file':_0x2d9462,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4eb095(0x16c)][_0x4eb095(0x178)],'rule':_0x4eb095(0x14f),'message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'}),_0x497954['noImplicitAny']===![]&&_0x4235a4[_0x4eb095(0x171)]({'file':_0x2d9462,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'no-implicit-any','message':_0x4eb095(0x175),'category':'best-practice','validator':_0x4eb095(0x131)});}return _0x4235a4;}catch(_0x39ecdf){return this['logger']?.[_0x4eb095(0x141)]('tsconfig.json\x20validation\x20failed',{'error':_0x39ecdf[_0x4eb095(0x13a)]}),[{'file':_0x2d9462,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x4eb095(0x170)],'rule':_0x4eb095(0x154),'message':'Invalid\x20JSON:\x20'+_0x39ecdf['message'],'category':'syntax','validator':_0x4eb095(0x154)}];}}async['validateEnvFile'](_0x1358a8,_0x485258={}){const _0x255be4=a0_0x503b4b;try{const _0x49cc08=await a0_0x4d3158['readFile'](_0x1358a8,_0x255be4(0x184)),_0x3d580a=[],_0x2a4c60=_0x49cc08[_0x255be4(0x16b)]('\x0a'),_0x3c8b54=[{'pattern':/password|passwd|pwd/i,'name':_0x255be4(0x14b)},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':_0x255be4(0x17b)},{'pattern':/private[_-]?key/i,'name':_0x255be4(0x168)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x2a4c60['forEach']((_0x523ed9,_0x43cdad)=>{const _0x454232=_0x255be4,_0x2306a9=_0x523ed9[_0x454232(0x167)]();if(!_0x2306a9||_0x2306a9['startsWith']('#'))return;if(_0x2306a9[_0x454232(0x163)]('=')){const [_0x41e8e2,_0x42cc72]=_0x2306a9['split']('='),_0x14aea2=_0x41e8e2['toLowerCase'](),_0x2892f1=_0x42cc72?.[_0x454232(0x167)]()||'',_0x70d532=_0x2892f1&&_0x2892f1!==''&&!_0x2892f1[_0x454232(0x17a)]('$')&&_0x2892f1!==_0x454232(0x132)&&_0x2892f1!==_0x454232(0x121)&&_0x2892f1[_0x454232(0x144)]>0x5;if(_0x70d532)for(const {pattern:_0x3176f8,name:_0x3b424d}of _0x3c8b54){if(_0x3176f8[_0x454232(0x130)](_0x14aea2)){_0x3d580a['push']({'file':_0x1358a8,'line':_0x43cdad+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x454232(0x16c)][_0x454232(0x133)],'rule':_0x454232(0x160),'message':'Potential\x20hardcoded\x20'+_0x3b424d+'\x20detected\x20in\x20.env\x20file','category':'security','validator':'env-validator','remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x3d580a;}catch(_0x36d4a3){return this['logger']?.[_0x255be4(0x141)](_0x255be4(0x181),{'error':_0x36d4a3[_0x255be4(0x13a)]}),[];}}['detectFileType'](_0x4ebba6){const _0x3b4556=a0_0x503b4b,_0x32ae80=a0_0x54f32e[_0x3b4556(0x14a)](_0x4ebba6)[_0x3b4556(0x137)](),_0x2a76a4=a0_0x54f32e[_0x3b4556(0x188)](_0x4ebba6);if(_0x32ae80==='dockerfile')return _0x3b4556(0x140);if(_0x32ae80==='docker-compose.yml'||_0x32ae80===_0x3b4556(0x147))return'docker-compose';if(_0x32ae80==='package.json')return _0x3b4556(0x129);if(_0x32ae80==='tsconfig.json')return _0x3b4556(0x16a);if(_0x32ae80==='.env'||_0x32ae80['endsWith'](_0x3b4556(0x18e)))return'env';if(_0x2a76a4[_0x3b4556(0x163)](_0x3b4556(0x12b)))return _0x3b4556(0x13e);if(_0x2a76a4['includes'](_0x3b4556(0x199))||_0x2a76a4[_0x3b4556(0x163)]('k8s'))return _0x3b4556(0x199);const _0x395678=a0_0x54f32e['extname'](_0x4ebba6)[_0x3b4556(0x137)]();if(_0x395678===_0x3b4556(0x159)||_0x395678===_0x3b4556(0x153))return _0x3b4556(0x177);if(_0x395678===_0x3b4556(0x194)||_0x395678===_0x3b4556(0x16e))return _0x3b4556(0x16f);if(_0x395678===_0x3b4556(0x165))return _0x3b4556(0x18b);return'unknown';}[a0_0x503b4b(0x196)](_0x12ce4c){const _0x1a0b88=a0_0x503b4b;return _0x12ce4c[_0x1a0b88(0x15c)](_0x59e25f=>({'file':_0x59e25f[_0x1a0b88(0x183)],'line':_0x59e25f[_0x1a0b88(0x19b)]||0x1,'column':_0x59e25f['column']||0x1,'severity':_0x59e25f[_0x1a0b88(0x18a)]||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x59e25f['rule']||_0x1a0b88(0x187),'message':_0x59e25f['message']||_0x1a0b88(0x17f),'category':_0x59e25f['category']||_0x1a0b88(0x14c),'validator':_0x59e25f['validator'],'cwe':_0x59e25f['cwe']||null,'remediation':_0x59e25f['remediation']||null,'references':_0x59e25f['references']||[]}));}['mapHadolintSeverity'](_0x562c0d){const _0x1ba79e=a0_0x503b4b,_0x3543ea={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x1ba79e(0x16c)][_0x1ba79e(0x178)],'info':STATIC_ANALYSIS[_0x1ba79e(0x16c)][_0x1ba79e(0x161)],'style':STATIC_ANALYSIS[_0x1ba79e(0x16c)][_0x1ba79e(0x161)]};return _0x3543ea[_0x562c0d?.[_0x1ba79e(0x137)]()]||STATIC_ANALYSIS[_0x1ba79e(0x16c)][_0x1ba79e(0x178)];}[a0_0x503b4b(0x197)](_0x58795b){const _0x159e48=a0_0x503b4b,_0x173be4={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING']};return _0x173be4[_0x58795b?.[_0x159e48(0x137)]()]||STATIC_ANALYSIS[_0x159e48(0x16c)]['WARNING'];}[a0_0x503b4b(0x192)](_0x3677ab){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async['getValidatorStatus'](){const _0x1d99d5=a0_0x503b4b,_0x453ef8=await this['detectAvailableValidators']();return{'validators':_0x453ef8,'recommendations':this[_0x1d99d5(0x15f)](_0x453ef8)};}[a0_0x503b4b(0x15f)](_0x3a1d81){const _0x463555=a0_0x503b4b,_0x1293fe=[];return!_0x3a1d81['checkov']&&_0x1293fe[_0x463555(0x171)]({'validator':'checkov','reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':'pip\x20install\x20checkov','priority':_0x463555(0x182)}),!_0x3a1d81[_0x463555(0x169)]&&_0x1293fe[_0x463555(0x171)]({'validator':_0x463555(0x169),'reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':_0x463555(0x182)}),!_0x3a1d81['yamllint']&&_0x1293fe[_0x463555(0x171)]({'validator':_0x463555(0x18d),'reason':_0x463555(0x12e),'install':'pip\x20install\x20yamllint','priority':_0x463555(0x134)}),!_0x3a1d81['jsonSchema']&&_0x1293fe[_0x463555(0x171)]({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x463555(0x135),'install':_0x463555(0x173),'priority':'medium'}),_0x1293fe;}}export default ConfigValidator;
1
+ const a0_0xf3def9=a0_0x1376;(function(_0x573572,_0xb3fe98){const _0x1f7f6a=a0_0x1376,_0x48ba0e=_0x573572();while(!![]){try{const _0x3b5999=-parseInt(_0x1f7f6a(0x1e1))/0x1*(parseInt(_0x1f7f6a(0x1f0))/0x2)+parseInt(_0x1f7f6a(0x211))/0x3*(-parseInt(_0x1f7f6a(0x1ef))/0x4)+parseInt(_0x1f7f6a(0x1ee))/0x5+-parseInt(_0x1f7f6a(0x21c))/0x6*(parseInt(_0x1f7f6a(0x1da))/0x7)+parseInt(_0x1f7f6a(0x1e6))/0x8+parseInt(_0x1f7f6a(0x220))/0x9+parseInt(_0x1f7f6a(0x1d7))/0xa*(parseInt(_0x1f7f6a(0x1e3))/0xb);if(_0x3b5999===_0xb3fe98)break;else _0x48ba0e['push'](_0x48ba0e['shift']());}catch(_0x1ef57a){_0x48ba0e['push'](_0x48ba0e['shift']());}}}(a0_0x168b,0xefdea));import{exec}from'child_process';import{promisify}from'util';import a0_0x4007ff from'path';import a0_0x193cab from'fs/promises';function a0_0x168b(){const _0x20691a=['nJu4mZi2ngfytgfADW','DMfSAwrHDgvxAxrOq2HLy2TVDG','zgv0zwn0rMLSzvr5Cgu','zw52','DhjPBq','BwvZC2fNzq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','y3DL','ntm2oti2mefhwgTuqq','mZy4ognzzfPYAa','odu1mZu0u0jUANHw','zg9JA2vYx2nVBxbVC2u','A3vIzxjUzxrLCW','zMLSDgvY','BwfWq2HLy2TVDLnLDMvYAxr5','y29TCgLSzq','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','ANnVBLnJAgvTyq','Bg9Nz2vY','BM9jBxbSAwnPDefUEq','EwfTBgXPBNqGzgv0zwn0zwq','C3rYAwn0','C3bSAxq','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','Dw5RBM93BG','y2HLy2TFAwq','BgLUzq','sw52ywXPzcbku09ooIa','DhnJB25MAwCUANnVBG','zg9JA2vYzMLSzq','EwfTBa','C3rYAw5N','C2nHBM5LCKnHy2HL','DgvYCMfMB3jT','yxzHAwXHyMXLu2nHBM5LCNm','CgfJA2fNzs5QC29U','y2HLy2TVDIaTzIaI','DMfSAwrHDgveB2nRzxjMAwXL','CgfZC3DVCMq','ywP2ig5VDcbHDMfPBgfIBgu','yMfZzw5HBwu','BwfWwwfTBgXPBNrtzxzLCML0Eq','u0vwrvjjvfK','ndyYnMv2s2Lvsq','rvjst1i','CgfYC2u','ANnVBI1WyxjZzq','y29TCgLSzxjpChrPB25Z','DhnJB25MAwCTDMfSAwrHDg9Y','qvDtignYzwrLBNrPywXZ','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','su5gtW','Aw5JBhvKzxm','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','nLn6wgjrsa','B2jQzwn0','lMvUDG','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','mtyXotu1nZjPsKDks2q','BM9YBwfSAxPLuMvZDwX0CW','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','CMvHzezPBgu','CMvTzwrPyxrPB24','iIaTlwzYyw1LD29YAYa','lNLHBwW','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','Dg9mB3DLCKnHC2u','DMfSAwrHDgvqywnRywDLsNnVBG','zgvIDwC','DMfSAwrHDgvuC0nVBMzPzW','BgvUz3rO','zgLYBMfTzq','ANnVBG','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','AgfKB2XPBNqGBM90igf2ywLSywjSzq','y2HLy2TVDIbKzxrLy3rLza','BwfWsgfKB2XPBNrtzxzLCML0Eq','zxjYB3i','BwvKAxvT','CgfYC2vdAgvJA292uMvZDwX0CW','CMvZDwX0CW','AgfKB2XPBNq','BwfW','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','AZHZ','EwfTBgXPBNq','zMLSzv9SAw5Lx3jHBMDL','DMfSAwrHDgvzqu1m','y2f0zwDVCNK','C3rHCNrZv2L0Aa','zg9JA2vYlwnVBxbVC2uUEwfTBa','ChvZAa','DMfSAwrHDg9Y','BwLZC2LUz1bYB3bLCNr5','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','C3rKB3v0','AgfKB2XPBNqGls12zxjZAw9U','lNLTBa','C2vJDxjPDhK','z3vPzgvSAw5L','y29TBw9UANm','DMfSAwrHDgvfBNzgAwXL','zw5KC1DPDgG','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','DxrMltG','lNrMDMfYCW','mtaWsxHxDMDm','lNrM','ywP2','ody3mte1owPhq0XpEa','C3LUDgf4','CgfYC2vzyw1SBgLUDfjLC3vSDhm','CgfYC2viywrVBgLUDfjLC3vSDhm','C3rYAwn0lw1Vzgu','v0fstKLorW','zMfPBgvKx2nOzwnRCW','m2vMyvH6ta','q1jjveLdquW','mtm1mJCWm2fmDgThuq','y2HLy2TFBMfTzq','y2HLy2TVDG'];a0_0x168b=function(){return _0x20691a;};return a0_0x168b();}function a0_0x1376(_0x3d82a7,_0x4cd83a){_0x3d82a7=_0x3d82a7-0x1c4;const _0x168b6e=a0_0x168b();let _0x13764e=_0x168b6e[_0x3d82a7];if(a0_0x1376['wOjbHm']===undefined){var _0x372b50=function(_0x164abe){const _0x48213c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4007ff='',_0x193cab='';for(let _0x18e867=0x0,_0x12c9cb,_0x1c07c6,_0x4081ac=0x0;_0x1c07c6=_0x164abe['charAt'](_0x4081ac++);~_0x1c07c6&&(_0x12c9cb=_0x18e867%0x4?_0x12c9cb*0x40+_0x1c07c6:_0x1c07c6,_0x18e867++%0x4)?_0x4007ff+=String['fromCharCode'](0xff&_0x12c9cb>>(-0x2*_0x18e867&0x6)):0x0){_0x1c07c6=_0x48213c['indexOf'](_0x1c07c6);}for(let _0x4f4f47=0x0,_0x5e9558=_0x4007ff['length'];_0x4f4f47<_0x5e9558;_0x4f4f47++){_0x193cab+='%'+('00'+_0x4007ff['charCodeAt'](_0x4f4f47)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x193cab);};a0_0x1376['ptmlPP']=_0x372b50,a0_0x1376['sdvXUW']={},a0_0x1376['wOjbHm']=!![];}const _0x125263=_0x168b6e[0x0],_0x1eb906=_0x3d82a7+_0x125263,_0x23048d=a0_0x1376['sdvXUW'][_0x1eb906];return!_0x23048d?(_0x13764e=a0_0x1376['ptmlPP'](_0x13764e),a0_0x1376['sdvXUW'][_0x1eb906]=_0x13764e):_0x13764e=_0x23048d,_0x13764e;}import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x18e867=null){const _0x327c92=a0_0x1376;this[_0x327c92(0x1f8)]=_0x18e867,this[_0x327c92(0x208)]=null,this[_0x327c92(0x206)]=new Map();}async[a0_0xf3def9(0x21b)](){const _0x130291=a0_0xf3def9;if(this['availableScanners']!==null)return this['availableScanners'];const _0x12c9cb={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x12c9cb['checkov']=!![],this['logger']?.['debug'](_0x130291(0x231));}catch(_0x1c07c6){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x1c07c6['message']});}try{await execAsync(_0x130291(0x1cd),{'timeout':0x1388}),_0x12c9cb[_0x130291(0x237)]=!![],this['logger']?.[_0x130291(0x22a)]('hadolint\x20detected');}catch(_0x4081ac){this[_0x130291(0x1f8)]?.[_0x130291(0x22a)](_0x130291(0x230),{'error':_0x4081ac[_0x130291(0x1eb)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x12c9cb[_0x130291(0x23b)]=!![],this[_0x130291(0x1f8)]?.['debug'](_0x130291(0x1fa));}catch(_0x4f4f47){this[_0x130291(0x1f8)]?.[_0x130291(0x22a)]('yamllint\x20not\x20available',{'error':_0x4f4f47[_0x130291(0x1eb)]});}try{await import(_0x130291(0x1d9)),_0x12c9cb['jsonSchema']=!![],this['logger']?.['debug']('JSON\x20Schema\x20validation\x20available');}catch(_0x5e9558){this['logger']?.[_0x130291(0x22a)](_0x130291(0x20d),{'error':_0x5e9558['message']});}return this['availableScanners']=_0x12c9cb,_0x12c9cb;}async['validate'](_0x3c2fb8,_0x3f71aa={}){const _0x481c5b=a0_0xf3def9,_0x38b5bb=[],_0x7b0e94=await this['detectAvailableValidators'](),_0x11c446=this[_0x481c5b(0x1e8)](_0x3c2fb8);this['logger']?.['debug']('Validating\x20config\x20file',{'filePath':_0x3c2fb8,'fileType':_0x11c446});switch(_0x11c446){case _0x481c5b(0x203):if(_0x7b0e94['hadolint']){const _0x4a9429=await this[_0x481c5b(0x20b)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x4a9429);}if(_0x7b0e94[_0x481c5b(0x1e5)]){const _0x1afb46=await this['validateWithCheckov'](_0x3c2fb8,_0x481c5b(0x203),_0x3f71aa);_0x38b5bb['push'](..._0x1afb46);}break;case'docker-compose':if(_0x7b0e94[_0x481c5b(0x23b)]){const _0x3eaa8f=await this['validateYAML'](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x3eaa8f);}if(_0x7b0e94[_0x481c5b(0x1e5)]){const _0x18634d=await this[_0x481c5b(0x1e7)](_0x3c2fb8,_0x481c5b(0x1f1),_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x18634d);}break;case'kubernetes':if(_0x7b0e94['yamllint']){const _0x47c5b3=await this['validateYAML'](_0x3c2fb8,_0x3f71aa);_0x38b5bb['push'](..._0x47c5b3);}if(_0x7b0e94[_0x481c5b(0x1e5)]){const _0x3c90f1=await this['validateWithCheckov'](_0x3c2fb8,'kubernetes',_0x3f71aa);_0x38b5bb['push'](..._0x3c90f1);}break;case _0x481c5b(0x207):if(_0x7b0e94['checkov']){const _0xecf737=await this[_0x481c5b(0x1e7)](_0x3c2fb8,'terraform',_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0xecf737);}break;case'package.json':if(_0x7b0e94[_0x481c5b(0x1f7)]){const _0x2a418f=await this[_0x481c5b(0x229)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x2a418f);}break;case _0x481c5b(0x202):if(_0x7b0e94[_0x481c5b(0x1f7)]){const _0x4f8833=await this[_0x481c5b(0x22b)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x4f8833);}break;case'github-actions':if(_0x7b0e94['yamllint']){const _0x358782=await this[_0x481c5b(0x1c4)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x358782);}break;case _0x481c5b(0x1e9):const _0x204110=await this[_0x481c5b(0x1d2)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x204110);break;case'yaml':if(_0x7b0e94['yamllint']){const _0x546698=await this[_0x481c5b(0x1c4)](_0x3c2fb8,_0x3f71aa);_0x38b5bb[_0x481c5b(0x1c8)](..._0x546698);}break;default:this[_0x481c5b(0x1f8)]?.['warn'](_0x481c5b(0x239),{'filePath':_0x3c2fb8,'fileType':_0x11c446});return[];}return this[_0x481c5b(0x221)](_0x38b5bb);}async[a0_0xf3def9(0x20b)](_0x235856,_0x2ce11d={}){const _0x573e3b=a0_0xf3def9;try{const _0x5bee61=await execAsync(_0x573e3b(0x227)+_0x235856+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x4a526b=JSON['parse'](_0x5bee61['stdout']);return this['parseHadolintResults'](_0x4a526b,_0x235856);}catch(_0x4344dd){if(_0x4344dd[_0x573e3b(0x1cc)])try{const _0x73b63d=JSON[_0x573e3b(0x213)](_0x4344dd['stdout']);return this[_0x573e3b(0x1dd)](_0x73b63d,_0x235856);}catch(_0x150b5a){this[_0x573e3b(0x1f8)]?.['error']('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x150b5a['message']});}return this[_0x573e3b(0x1f8)]?.['error']('hadolint\x20validation\x20failed',{'error':_0x4344dd[_0x573e3b(0x1eb)]}),[];}}['parseHadolintResults'](_0x29b9e7,_0x499b13){const _0xfd8874=a0_0xf3def9,_0x2f7e53=[];if(Array['isArray'](_0x29b9e7))for(const _0x3f2d10 of _0x29b9e7){_0x2f7e53['push']({'file':_0x499b13,'line':_0x3f2d10['line']||0x1,'column':_0x3f2d10['column']||0x1,'severity':this['mapHadolintSeverity'](_0x3f2d10['level']),'rule':_0x3f2d10['code'],'message':_0x3f2d10['message'],'category':_0xfd8874(0x203),'validator':_0xfd8874(0x237)});}return _0x2f7e53;}async['validateYAML'](_0x2635ef,_0x3f6792={}){const _0x150632=a0_0xf3def9;try{const _0x149f8d=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x2635ef+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x150632(0x1dc)](_0x149f8d[_0x150632(0x1cc)],_0x2635ef);}catch(_0x3957cf){if(_0x3957cf[_0x150632(0x1cc)])return this['parseYamllintResults'](_0x3957cf[_0x150632(0x1cc)],_0x2635ef);return this[_0x150632(0x1f8)]?.[_0x150632(0x233)](_0x150632(0x222),{'error':_0x3957cf[_0x150632(0x1eb)]}),[];}}['parseYamllintResults'](_0x182b64,_0x3209f4){const _0x36f0e5=a0_0xf3def9,_0x2a11c3=[],_0x17ea6b=_0x182b64[_0x36f0e5(0x1fc)]('\x0a')[_0x36f0e5(0x1f3)](_0x46367f=>_0x46367f['trim']());for(const _0x465c1d of _0x17ea6b){const _0xde677f=_0x465c1d['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0xde677f){const [,_0x4fa9ac,_0x24c564,_0x257660,_0x16c08b,_0x167d2f,_0x20d332]=_0xde677f;_0x2a11c3[_0x36f0e5(0x1c8)]({'file':_0x3209f4,'line':parseInt(_0x24c564,0xa),'column':parseInt(_0x257660,0xa),'severity':this[_0x36f0e5(0x20f)](_0x16c08b),'rule':_0x20d332,'message':_0x167d2f,'category':_0x36f0e5(0x204),'validator':_0x36f0e5(0x23b)});}}return _0x2a11c3;}async['validateWithCheckov'](_0x25e24f,_0x3f7a42,_0x509733={}){const _0x42a5ee=a0_0xf3def9;try{const _0x3b9441=await execAsync(_0x42a5ee(0x20a)+_0x25e24f+_0x42a5ee(0x225)+_0x3f7a42+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x453f53=JSON['parse'](_0x3b9441[_0x42a5ee(0x1cc)]);return this['parseCheckovResults'](_0x453f53,_0x25e24f);}catch(_0x3db6be){if(_0x3db6be[_0x42a5ee(0x1cc)])try{const _0x680520=JSON['parse'](_0x3db6be[_0x42a5ee(0x1cc)]);return this[_0x42a5ee(0x235)](_0x680520,_0x25e24f);}catch(_0x50a396){this['logger']?.['error']('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x50a396['message']});}return this['logger']?.[_0x42a5ee(0x233)](_0x42a5ee(0x1f6),{'error':_0x3db6be[_0x42a5ee(0x1eb)]}),[];}}[a0_0xf3def9(0x235)](_0x50d7ba,_0x4dc7fb){const _0x747c5e=a0_0xf3def9,_0x481284=[];if(_0x50d7ba['results']&&_0x50d7ba[_0x747c5e(0x236)][_0x747c5e(0x1e0)])for(const _0x4fd8e9 of _0x50d7ba[_0x747c5e(0x236)]['failed_checks']){_0x481284['push']({'file':_0x4dc7fb,'line':_0x4fd8e9['file_line_range']?_0x4fd8e9[_0x747c5e(0x23c)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x4fd8e9['check_class']),'rule':_0x4fd8e9[_0x747c5e(0x1ff)],'message':_0x4fd8e9[_0x747c5e(0x1e4)]||_0x4fd8e9['check_id'],'category':_0x747c5e(0x1cf),'validator':'checkov','remediation':_0x4fd8e9[_0x747c5e(0x1d0)],'cwe':_0x4fd8e9[_0x747c5e(0x1ed)],'references':_0x4fd8e9['guideline']?[_0x4fd8e9['guideline']]:[]});}return _0x481284;}async['validatePackageJson'](_0x70c57f,_0x357be8={}){const _0xbce2b=a0_0xf3def9;try{const _0x141abf=(await import('ajv'))['default'],_0xcf289b=(await import('ajv-formats'))['default'],_0x509379=await a0_0x193cab['readFile'](_0x70c57f,'utf-8'),_0x21ae6c=JSON[_0xbce2b(0x213)](_0x509379),_0x5c56be=new _0x141abf({'allErrors':!![],'strict':![]});_0xcf289b(_0x5c56be);const _0x4802fb={'type':_0xbce2b(0x21d),'required':['name','version'],'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':_0xbce2b(0x205)},'type':{'type':_0xbce2b(0x205),'enum':['module',_0xbce2b(0x1d1)]},'scripts':{'type':'object'},'dependencies':{'type':_0xbce2b(0x21d)},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0x41536d=_0x5c56be[_0xbce2b(0x1f5)](_0x4802fb),_0x6bbe7a=_0x41536d(_0x21ae6c);if(!_0x6bbe7a&&_0x41536d['errors'])return _0x41536d['errors'][_0xbce2b(0x238)](_0x3c1e57=>({'file':_0x70c57f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0xbce2b(0x212)],'rule':'json-schema','message':_0x3c1e57['instancePath']?_0x3c1e57['instancePath']+'\x20'+_0x3c1e57['message']:_0xbce2b(0x1ec)+_0x3c1e57['params'][_0xbce2b(0x1ca)]+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x26c257){return this[_0xbce2b(0x1f8)]?.['error'](_0xbce2b(0x21f),{'error':_0x26c257['message']}),[{'file':_0x70c57f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xbce2b(0x210)][_0xbce2b(0x212)],'rule':_0xbce2b(0x214),'message':_0xbce2b(0x201)+_0x26c257[_0xbce2b(0x1eb)],'category':_0xbce2b(0x1db),'validator':'json-parse'}];}}async[a0_0xf3def9(0x22b)](_0x46532f,_0x1f5608={}){const _0x5962fe=a0_0xf3def9;try{const _0x14d0d0=await a0_0x193cab[_0x5962fe(0x223)](_0x46532f,_0x5962fe(0x1d5)),_0x32784c=JSON[_0x5962fe(0x213)](_0x14d0d0),_0x90441c=[];if(_0x32784c[_0x5962fe(0x215)]){const _0x296979=_0x32784c['compilerOptions'];!_0x296979[_0x5962fe(0x1fb)]&&_0x90441c[_0x5962fe(0x1c8)]({'file':_0x46532f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5962fe(0x210)]['WARNING'],'rule':_0x5962fe(0x1de),'message':_0x5962fe(0x1d4),'category':'best-practice','validator':_0x5962fe(0x216)}),_0x296979[_0x5962fe(0x1f9)]===![]&&_0x90441c['push']({'file':_0x46532f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x90441c;}catch(_0x1033ca){return this[_0x5962fe(0x1f8)]?.['error'](_0x5962fe(0x1fd),{'error':_0x1033ca[_0x5962fe(0x1eb)]}),[{'file':_0x46532f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5962fe(0x210)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x1033ca[_0x5962fe(0x1eb)],'category':'syntax','validator':'json-parse'}];}}async['validateEnvFile'](_0x5047b9,_0x16774e={}){const _0x2fc14e=a0_0xf3def9;try{const _0x564de7=await a0_0x193cab['readFile'](_0x5047b9,_0x2fc14e(0x1d5)),_0x558b65=[],_0x4e07eb=_0x564de7[_0x2fc14e(0x1fc)]('\x0a'),_0x10bcb7=[{'pattern':/password|passwd|pwd/i,'name':_0x2fc14e(0x20c)},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x2fc14e(0x217)}];return _0x4e07eb['forEach']((_0x1723d5,_0x14314a)=>{const _0x1d59c9=_0x2fc14e,_0x5340be=_0x1723d5['trim']();if(!_0x5340be||_0x5340be['startsWith']('#'))return;if(_0x5340be[_0x1d59c9(0x21a)]('=')){const [_0x2c865c,_0xafe81e]=_0x5340be['split']('='),_0x51c9b5=_0x2c865c['toLowerCase'](),_0x305aac=_0xafe81e?.[_0x1d59c9(0x1ea)]()||'',_0x3397ed=_0x305aac&&_0x305aac!==''&&!_0x305aac[_0x1d59c9(0x1c6)]('$')&&_0x305aac!=='your-key-here'&&_0x305aac!=='changeme'&&_0x305aac[_0x1d59c9(0x22c)]>0x5;if(_0x3397ed)for(const {pattern:_0x1f40cf,name:_0x25a064}of _0x10bcb7){if(_0x1f40cf['test'](_0x51c9b5)){_0x558b65['push']({'file':_0x5047b9,'line':_0x14314a+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x1d59c9(0x210)][_0x1d59c9(0x1e2)],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x25a064+'\x20detected\x20in\x20.env\x20file','category':_0x1d59c9(0x1cf),'validator':'env-validator','remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x558b65;}catch(_0x55bdba){return this['logger']?.[_0x2fc14e(0x233)]('.env\x20validation\x20failed',{'error':_0x55bdba['message']}),[];}}[a0_0xf3def9(0x1e8)](_0x11c1f2){const _0x373ef0=a0_0xf3def9,_0x111f49=a0_0x4007ff[_0x373ef0(0x20e)](_0x11c1f2)['toLowerCase'](),_0x360f37=a0_0x4007ff[_0x373ef0(0x22d)](_0x11c1f2);if(_0x111f49===_0x373ef0(0x203))return'dockerfile';if(_0x111f49==='docker-compose.yml'||_0x111f49===_0x373ef0(0x1c7))return'docker-compose';if(_0x111f49==='package.json')return _0x373ef0(0x209);if(_0x111f49===_0x373ef0(0x202))return'tsconfig.json';if(_0x111f49===_0x373ef0(0x21e)||_0x111f49[_0x373ef0(0x1d3)](_0x373ef0(0x21e)))return _0x373ef0(0x1e9);if(_0x360f37[_0x373ef0(0x21a)]('.github/workflows'))return'github-actions';if(_0x360f37[_0x373ef0(0x21a)](_0x373ef0(0x1f2))||_0x360f37[_0x373ef0(0x21a)](_0x373ef0(0x23a)))return'kubernetes';const _0x360720=a0_0x4007ff['extname'](_0x11c1f2)['toLowerCase']();if(_0x360720===_0x373ef0(0x1d8)||_0x360720===_0x373ef0(0x1d6))return _0x373ef0(0x207);if(_0x360720===_0x373ef0(0x1ce)||_0x360720===_0x373ef0(0x226))return'yaml';if(_0x360720==='.json')return _0x373ef0(0x22e);return _0x373ef0(0x1fe);}[a0_0xf3def9(0x221)](_0x2ffe1c){const _0x6262e7=a0_0xf3def9;return _0x2ffe1c['map'](_0x5c6344=>({'file':_0x5c6344['file'],'line':_0x5c6344[_0x6262e7(0x200)]||0x1,'column':_0x5c6344['column']||0x1,'severity':_0x5c6344['severity']||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x5c6344['rule']||'unknown','message':_0x5c6344[_0x6262e7(0x1eb)]||_0x6262e7(0x218),'category':_0x5c6344[_0x6262e7(0x1c5)]||'validation','validator':_0x5c6344[_0x6262e7(0x1c9)],'cwe':_0x5c6344['cwe']||null,'remediation':_0x5c6344[_0x6262e7(0x224)]||null,'references':_0x5c6344['references']||[]}));}[a0_0xf3def9(0x232)](_0x2767b6){const _0x452a35=a0_0xf3def9,_0x11423e={'error':STATIC_ANALYSIS['SEVERITY'][_0x452a35(0x212)],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS[_0x452a35(0x210)][_0x452a35(0x219)],'style':STATIC_ANALYSIS['SEVERITY'][_0x452a35(0x219)]};return _0x11423e[_0x2767b6?.['toLowerCase']()]||STATIC_ANALYSIS[_0x452a35(0x210)]['WARNING'];}['mapYamllintSeverity'](_0x31c342){const _0x237117=a0_0xf3def9,_0x528fa2={'error':STATIC_ANALYSIS['SEVERITY'][_0x237117(0x212)],'warning':STATIC_ANALYSIS[_0x237117(0x210)]['WARNING']};return _0x528fa2[_0x31c342?.[_0x237117(0x228)]()]||STATIC_ANALYSIS['SEVERITY'][_0x237117(0x1df)];}[a0_0xf3def9(0x1f4)](_0x15a465){const _0x39f95d=a0_0xf3def9;return STATIC_ANALYSIS[_0x39f95d(0x210)]['ERROR'];}async['getValidatorStatus'](){const _0x1e106f=await this['detectAvailableValidators']();return{'validators':_0x1e106f,'recommendations':this['getInstallRecommendations'](_0x1e106f)};}[a0_0xf3def9(0x22f)](_0x5b9c4e){const _0x3b8fd6=a0_0xf3def9,_0x37a811=[];return!_0x5b9c4e['checkov']&&_0x37a811[_0x3b8fd6(0x1c8)]({'validator':_0x3b8fd6(0x1e5),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':'pip\x20install\x20checkov','priority':'high'}),!_0x5b9c4e[_0x3b8fd6(0x237)]&&_0x37a811[_0x3b8fd6(0x1c8)]({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x5b9c4e['yamllint']&&_0x37a811[_0x3b8fd6(0x1c8)]({'validator':'yamllint','reason':'YAML\x20file\x20validation','install':'pip\x20install\x20yamllint','priority':_0x3b8fd6(0x234)}),!_0x5b9c4e[_0x3b8fd6(0x1f7)]&&_0x37a811['push']({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x3b8fd6(0x1cb),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x3b8fd6(0x234)}),_0x37a811;}}export default ConfigValidator;
@@ -1 +1 @@
1
- function a0_0x2bb6(){const _0x3a9b64=['C2vJDxjPDhK','mtiZnZjAvujIyLC','zML4ywjSzvDHCM5PBMDdB3vUDa','B2zM','q0furuDpuLK','CgvYzM9YBwfUy2u','mteXtuXtzKvA','lMnQCW','zMLSDgvY','CgfYC2vYt3b0Aw9UCW','ndyYmJm2nefJsgjzua','zxnSAw50oNjLy29TBwvUzgvK','rvjst1i','su1qt1ju','rvnmAw50igfUywX5C2LZigzHAwXLza','zgvIDwC','BwvZC2fNzxm','lMPZ','BgLUzq','zgvZy3jPyMvdAgfUz2vZ','mtqZmJi1nMzssgrPtG','rM91BMqGrvnmAw50ignVBMzPzW','BgvUz3rO','zM9YBwf0twvZC2fNzq','v0fstKLorW','ntu1ndy1ouXACNrwvW','D2fYBG','u0vdvvjjvfK','u0vwrvjjvfK','mJHKtLfAz0C','zxjYB3i','otm5txnusNbn','zxjYB3jdB3vUDa','y2f0zwDVCML6zvj1Bgu','ChvZAa','ywrKzwq','z2v0rvnmAw50sw5ZDgfUy2u','lMvZBgLUDhjJlMnQCW','Aw5JBhvKzxm','zgv0zwn0','CNvSzuLK','lMvZBgLUDhjJlMPZ','BM8TDMfY','CMvTB3zLza','C2v2zxjPDhK','C2v0DgLUz3m','Bg9Nz2vY','BwvZC2fNzq','C3bSAxq','mti2u091sM9x','u1rzteu','yMvZDc1WCMfJDgLJzxm','mZq0ogr0ENbfBG','lM1QCW','mte2nty3mejAq3vUBq','Bgf0zxn0','zML4ywjSzuvYCM9Yq291BNq','odm3mtC4mhDzuNLnrW','EhnZ','zwnTyuzLyxr1CMvZ','DNvL','C2LUz2XL','B3v0Chv0','z2v0rvnmAw50q29UzMLN','Bw9KAwzPzwq'];a0_0x2bb6=function(){return _0x3a9b64;};return a0_0x2bb6();}const a0_0x4ebec6=a0_0x4f08;(function(_0x31be27,_0x10228a){const _0x5c8677=a0_0x4f08,_0x54ec47=_0x31be27();while(!![]){try{const _0xe56c4c=parseInt(_0x5c8677(0xf6))/0x1*(parseInt(_0x5c8677(0xca))/0x2)+-parseInt(_0x5c8677(0xdd))/0x3*(parseInt(_0x5c8677(0xd8))/0x4)+parseInt(_0x5c8677(0xcf))/0x5+-parseInt(_0x5c8677(0xe1))/0x6+-parseInt(_0x5c8677(0xf4))/0x7*(-parseInt(_0x5c8677(0xeb))/0x8)+-parseInt(_0x5c8677(0xc7))/0x9*(parseInt(_0x5c8677(0xcc))/0xa)+-parseInt(_0x5c8677(0xf0))/0xb;if(_0xe56c4c===_0x10228a)break;else _0x54ec47['push'](_0x54ec47['shift']());}catch(_0xb278f){_0x54ec47['push'](_0x54ec47['shift']());}}}(a0_0x2bb6,0xf11ba));import{ESLint}from'eslint';import a0_0x31565f from'path';import a0_0x5f5bf8 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x4f08(_0x201a1a,_0x45a2db){_0x201a1a=_0x201a1a-0xba;const _0x2bb660=a0_0x2bb6();let _0x4f0889=_0x2bb660[_0x201a1a];if(a0_0x4f08['tRtIyI']===undefined){var _0x414c24=function(_0x5338a5){const _0x516408='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x31565f='',_0x5f5bf8='';for(let _0x2db136=0x0,_0x3d5f96,_0xf1be33,_0x4ffaec=0x0;_0xf1be33=_0x5338a5['charAt'](_0x4ffaec++);~_0xf1be33&&(_0x3d5f96=_0x2db136%0x4?_0x3d5f96*0x40+_0xf1be33:_0xf1be33,_0x2db136++%0x4)?_0x31565f+=String['fromCharCode'](0xff&_0x3d5f96>>(-0x2*_0x2db136&0x6)):0x0){_0xf1be33=_0x516408['indexOf'](_0xf1be33);}for(let _0x4f5d79=0x0,_0x54c088=_0x31565f['length'];_0x4f5d79<_0x54c088;_0x4f5d79++){_0x5f5bf8+='%'+('00'+_0x31565f['charCodeAt'](_0x4f5d79)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5f5bf8);};a0_0x4f08['MUmgNO']=_0x414c24,a0_0x4f08['HmwrAq']={},a0_0x4f08['tRtIyI']=!![];}const _0x131b7f=_0x2bb660[0x0],_0x6bbf82=_0x201a1a+_0x131b7f,_0x3dc828=a0_0x4f08['HmwrAq'][_0x6bbf82];return!_0x3dc828?(_0x4f0889=a0_0x4f08['MUmgNO'](_0x4f0889),a0_0x4f08['HmwrAq'][_0x6bbf82]=_0x4f0889):_0x4f0889=_0x3dc828,_0x4f0889;}class ESLintAnalyzer{constructor(_0x2db136=null){this['logger']=_0x2db136,this['eslintCache']=new Map();}async['analyze'](_0x3d5f96,_0xf1be33,_0x4ffaec={}){const _0xedbfc9=a0_0x4f08;try{const _0x4f5d79=await this[_0xedbfc9(0xba)](_0x4ffaec),_0x54c088=await _0x4f5d79['lintText'](_0xf1be33,{'filePath':_0x3d5f96,'warnIgnored':![]}),_0x1f7a82=[];if(_0x54c088&&_0x54c088[_0xedbfc9(0xed)]>0x0){const _0x46060e=_0x54c088[0x0];for(const _0x27b70a of _0x46060e[_0xedbfc9(0xe7)]){_0x1f7a82['push'](this[_0xedbfc9(0xee)](_0x27b70a,_0x3d5f96));}}return this['logger']?.[_0xedbfc9(0xe6)]('ESLint\x20analysis\x20completed',{'file':_0x3d5f96,'totalDiagnostics':_0x1f7a82['length'],'errors':_0x1f7a82['filter'](_0x4cd648=>_0x4cd648[_0xedbfc9(0xc2)]===STATIC_ANALYSIS[_0xedbfc9(0xf3)]['ERROR'])[_0xedbfc9(0xed)],'warnings':_0x1f7a82[_0xedbfc9(0xdf)](_0x210688=>_0x210688['severity']===STATIC_ANALYSIS[_0xedbfc9(0xf3)]['WARNING'])[_0xedbfc9(0xed)]}),_0x1f7a82;}catch(_0x513514){return this[_0xedbfc9(0xc4)]?.['error'](_0xedbfc9(0xe5),{'file':_0x3d5f96,'error':_0x513514['message']}),[];}}async['fix'](_0x4b9db8,_0x1333e1,_0x1bfe56={}){const _0x404cc6=a0_0x4f08;try{const _0x3f9bc3=await this['getESLintInstance']({..._0x1bfe56,'fix':!![]}),_0x48c7f6=await _0x3f9bc3['lintText'](_0x1333e1,{'filePath':_0x4b9db8,'warnIgnored':![]});if(_0x48c7f6&&_0x48c7f6[_0x404cc6(0xed)]>0x0){const _0x2e798f=_0x48c7f6[0x0];return{'fixed':_0x2e798f['output']!==undefined,'content':_0x2e798f[_0x404cc6(0xd4)]||_0x1333e1,'fixedCount':_0x2e798f[_0x404cc6(0xce)]+_0x2e798f['fixableWarningCount'],'remainingErrors':_0x2e798f[_0x404cc6(0xf7)]-_0x2e798f['fixableErrorCount'],'remainingWarnings':_0x2e798f['warningCount']-_0x2e798f[_0x404cc6(0xd9)],'changes':_0x2e798f['output']?this[_0x404cc6(0xea)](_0x1333e1,_0x2e798f[_0x404cc6(0xd4)]):[]};}return{'fixed':![],'content':_0x1333e1,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0xc7b654){this['logger']?.[_0x404cc6(0xf5)]('ESLint\x20fix\x20failed',{'file':_0x4b9db8,'error':_0xc7b654['message']});throw new Error('ESLint\x20fix\x20failed:\x20'+_0xc7b654['message']);}}async[a0_0x4ebec6(0xba)](_0x351a54={}){const _0x44858a=a0_0x4ebec6,{workingDir:_0x1c1288,fix:fix=![],framework:_0x19f7ae}=_0x351a54,_0x102124=await this[_0x44858a(0xd5)](_0x1c1288,_0x19f7ae),_0x1c9723=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x102124,'errorOnUnmatchedPattern':![]});return _0x1c9723;}async[a0_0x4ebec6(0xd5)](_0x2a66e7,_0x222244){const _0x3c25d5=a0_0x4ebec6,_0x394063={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':_0x3c25d5(0xcd),'sourceType':'module'},'rules':{'no-unused-vars':'warn','no-undef':_0x3c25d5(0xf5),'no-console':_0x3c25d5(0xda),'semi':['warn','always'],'quotes':[_0x3c25d5(0xf1),_0x3c25d5(0xd3),{'avoidEscape':!![]}]}};if(_0x222244==='react')_0x394063['extends']=[_0x3c25d5(0xe2)],_0x394063[_0x3c25d5(0xe0)][_0x3c25d5(0xd1)]={'jsx':!![]},_0x394063[_0x3c25d5(0xc3)]={'react':{'version':_0x3c25d5(0xbd)}};else _0x222244===_0x3c25d5(0xd2)?_0x394063['extends']=['eslint:recommended']:_0x394063['extends']=['eslint:recommended'];if(_0x2a66e7){const _0x2f73b8=[_0x3c25d5(0xbf),_0x3c25d5(0xbb),'.eslintrc.json','eslint.config.js'];for(const _0x46c262 of _0x2f73b8){try{const _0x57cde4=a0_0x31565f['join'](_0x2a66e7,_0x46c262);return await a0_0x5f5bf8['access'](_0x57cde4),this['logger']?.[_0x3c25d5(0xe6)](_0x3c25d5(0xec),{'configFile':_0x46c262}),{};}catch{}}}return _0x394063;}[a0_0x4ebec6(0xee)](_0x12f404,_0xf77199){const _0x5b6567=a0_0x4ebec6;return{'file':_0xf77199,'line':_0x12f404[_0x5b6567(0xe9)]||0x1,'column':_0x12f404['column']||0x1,'endLine':_0x12f404['endLine'],'endColumn':_0x12f404['endColumn'],'severity':_0x12f404['severity']===0x2?STATIC_ANALYSIS[_0x5b6567(0xf3)][_0x5b6567(0xe3)]:STATIC_ANALYSIS['SEVERITY'][_0x5b6567(0xef)],'rule':_0x12f404['ruleId']||'eslint','message':_0x12f404[_0x5b6567(0xc5)],'category':this['categorizeRule'](_0x12f404[_0x5b6567(0xbe)]),'fixable':_0x12f404['fix']!==undefined,'source':'eslint'};}[a0_0x4ebec6(0xf8)](_0x4d41c9){const _0x50c398=a0_0x4ebec6;if(!_0x4d41c9)return STATIC_ANALYSIS['CATEGORY']['STYLE'];if(_0x4d41c9[_0x50c398(0xbc)](_0x50c398(0xd7))||_0x4d41c9['includes'](_0x50c398(0xd0))||_0x4d41c9==='no-eval'||_0x4d41c9==='no-implied-eval')return STATIC_ANALYSIS[_0x50c398(0xdb)][_0x50c398(0xf2)];if(_0x4d41c9[_0x50c398(0xbc)](_0x50c398(0xdc))||_0x4d41c9==='no-await-in-loop'||_0x4d41c9==='prefer-promise-reject-errors')return STATIC_ANALYSIS[_0x50c398(0xdb)]['PERFORMANCE'];if(_0x4d41c9[_0x50c398(0xbc)]('import')||_0x4d41c9==='no-undef')return STATIC_ANALYSIS[_0x50c398(0xdb)][_0x50c398(0xe4)];if(_0x4d41c9['includes'](_0x50c398(0xc9))||_0x4d41c9==='no-unused-vars'||_0x4d41c9==='no-unreachable'||_0x4d41c9===_0x50c398(0xc0))return STATIC_ANALYSIS[_0x50c398(0xdb)]['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x50c398(0xdb)][_0x50c398(0xc8)];}['describeChanges'](_0x1739a5,_0x426edd){const _0x1cabf4=a0_0x4ebec6,_0x1c1129=[],_0x4f60bc=_0x1739a5['split']('\x0a'),_0x568feb=_0x426edd[_0x1cabf4(0xc6)]('\x0a'),_0xe3fbd8=Math['max'](_0x4f60bc[_0x1cabf4(0xed)],_0x568feb[_0x1cabf4(0xed)]);for(let _0x3563f2=0x0;_0x3563f2<_0xe3fbd8;_0x3563f2++){const _0x1ea2ee=_0x4f60bc[_0x3563f2]||'',_0x2cdc20=_0x568feb[_0x3563f2]||'';_0x1ea2ee!==_0x2cdc20&&_0x1c1129[_0x1cabf4(0xf9)]({'line':_0x3563f2+0x1,'type':_0x1ea2ee&&_0x2cdc20?_0x1cabf4(0xd6):_0x1ea2ee?_0x1cabf4(0xc1):_0x1cabf4(0xfa),'original':_0x1ea2ee,'fixed':_0x2cdc20});}return _0x1c1129;}['getSupportedExtensions'](){const _0x5aa4ed=a0_0x4ebec6;return[_0x5aa4ed(0xe8),'.jsx',_0x5aa4ed(0xcb),_0x5aa4ed(0xde)];}['supportsAutoFix'](){return!![];}}export default ESLintAnalyzer;
1
+ const a0_0x4b4ff0=a0_0x5e7b;function a0_0x5e7b(_0x3ab333,_0x529e0b){_0x3ab333=_0x3ab333-0xc2;const _0x1566ec=a0_0x1566();let _0x5e7b90=_0x1566ec[_0x3ab333];if(a0_0x5e7b['QgYWLr']===undefined){var _0xf1530e=function(_0x4cf2b8){const _0x1adec5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x31a891='',_0x582d49='';for(let _0x2f4dde=0x0,_0x532608,_0x218d1a,_0x3029e4=0x0;_0x218d1a=_0x4cf2b8['charAt'](_0x3029e4++);~_0x218d1a&&(_0x532608=_0x2f4dde%0x4?_0x532608*0x40+_0x218d1a:_0x218d1a,_0x2f4dde++%0x4)?_0x31a891+=String['fromCharCode'](0xff&_0x532608>>(-0x2*_0x2f4dde&0x6)):0x0){_0x218d1a=_0x1adec5['indexOf'](_0x218d1a);}for(let _0x1df401=0x0,_0x291165=_0x31a891['length'];_0x1df401<_0x291165;_0x1df401++){_0x582d49+='%'+('00'+_0x31a891['charCodeAt'](_0x1df401)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x582d49);};a0_0x5e7b['RKDtnK']=_0xf1530e,a0_0x5e7b['WmWmbe']={},a0_0x5e7b['QgYWLr']=!![];}const _0x280f23=_0x1566ec[0x0],_0xa6552f=_0x3ab333+_0x280f23,_0x328f53=a0_0x5e7b['WmWmbe'][_0xa6552f];return!_0x328f53?(_0x5e7b90=a0_0x5e7b['RKDtnK'](_0x5e7b90),a0_0x5e7b['WmWmbe'][_0xa6552f]=_0x5e7b90):_0x5e7b90=_0x328f53,_0x5e7b90;}(function(_0x3c5b9a,_0x40de4e){const _0x57872e=a0_0x5e7b,_0x201809=_0x3c5b9a();while(!![]){try{const _0xc53f57=-parseInt(_0x57872e(0xde))/0x1+parseInt(_0x57872e(0xd6))/0x2+-parseInt(_0x57872e(0xd0))/0x3+-parseInt(_0x57872e(0xf9))/0x4*(-parseInt(_0x57872e(0xc6))/0x5)+-parseInt(_0x57872e(0xeb))/0x6*(-parseInt(_0x57872e(0xc4))/0x7)+parseInt(_0x57872e(0x105))/0x8+-parseInt(_0x57872e(0xfa))/0x9;if(_0xc53f57===_0x40de4e)break;else _0x201809['push'](_0x201809['shift']());}catch(_0x3c6aab){_0x201809['push'](_0x201809['shift']());}}}(a0_0x1566,0xe9c86));function a0_0x1566(){const _0x393d39=['CgvYzM9YBwfUy2u','CgfYC2vYt3b0Aw9UCW','mteYmJCWmdHNs0POyLq','zML4ywjSzuvYCM9Yq291BNq','C2v2zxjPDhK','lMvZBgLUDhjJlMPZB24','z2v0rvnmAw50sw5ZDgfUy2u','AM9PBG','mtrrwvf4A1G','BM8TAw1WBgLLzc1LDMfS','mte4nte0nvDHufnKBG','Bg9Nz2vY','BwvZC2fNzq','zMLSDgvY','ChjLzMvYlxbYB21PC2uTCMvQzwn0lwvYCM9YCW','CMvHy3q','zxnSAw50q2fJAgu','u0vwrvjjvfK','C2v0DgLUz3m','q0furuDpuLK','nti3otK0mfz5u1nkAa','ChvZAa','qKvtvf9quKfdveLdrq','Bgf0zxn0','rvnmAw50igfUywX5C2LZignVBxbSzxrLza','C2vJDxjPDhK','mJm4mZq4me9iuhPHzG','BM8TDw5YzwfJAgfIBgu','zxjYB3i','zM9YBwf0twvZC2fNzq','u1rzteu','zxnSAw50','Bw9KDwXL','BwvZC2fNzxm','mtqZmJK3nvfNyLrqAW','Bwf4','zxH0zw5KCW','D2fYBMLUz0nVDw50','Bw9KAwzPzwq','zw5KtgLUzq','ywX3yxLZ','y29SDw1U','zML4ywjSzvDHCM5PBMDdB3vUDa','BgLUzq','C3vWCg9YDhnbDxrVrML4','BgvUz3rO','zxnSAw50lMnVBMzPzY5QCW','mtG4otq2nKHtqxHusG','lMPZ','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','z2v0rvnmAw50q29UzMLN','zw5Kq29SDw1U','Aw5JBhvKzxm','BM8TDMfY','u0vdvvjjvfK','CNvSzuLK','BM8TDw5Kzwy','su1qt1ju','lM1QCW','D2fYBG','zxnSAw50oNjLy29TBwvUzgvK','mJHzv0jdyMi','nJyWmJuWohHqA25fBW','B3v0Chv0','lMvZBgLUDhjJlMPZ','zxjYB3jdB3vUDa','lMnQCW','zML4','BgLUDfrLEhq','EhnZ','rvnmAw50igzPEcbMywLSzwq'];a0_0x1566=function(){return _0x393d39;};return a0_0x1566();}import{ESLint}from'eslint';import a0_0x31a891 from'path';import a0_0x582d49 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x2f4dde=null){const _0x44a8d6=a0_0x5e7b;this[_0x44a8d6(0xc7)]=_0x2f4dde,this[_0x44a8d6(0xcc)]=new Map();}async['analyze'](_0x532608,_0x218d1a,_0x3029e4={}){const _0x29c847=a0_0x5e7b;try{const _0x1df401=await this[_0x29c847(0xc2)](_0x3029e4),_0x291165=await _0x1df401['lintText'](_0x218d1a,{'filePath':_0x532608,'warnIgnored':![]}),_0x412e10=[];if(_0x291165&&_0x291165[_0x29c847(0xe9)]>0x0){const _0x1b1b27=_0x291165[0x0];for(const _0x9a3bc5 of _0x1b1b27[_0x29c847(0xdd)]){_0x412e10[_0x29c847(0xd1)](this['formatMessage'](_0x9a3bc5,_0x532608));}}return this['logger']?.['debug'](_0x29c847(0xd4),{'file':_0x532608,'totalDiagnostics':_0x412e10['length'],'errors':_0x412e10['filter'](_0x5a471c=>_0x5a471c['severity']===STATIC_ANALYSIS[_0x29c847(0xcd)]['ERROR'])['length'],'warnings':_0x412e10[_0x29c847(0xc9)](_0x4f1cb5=>_0x4f1cb5['severity']===STATIC_ANALYSIS[_0x29c847(0xcd)]['WARNING'])['length']}),_0x412e10;}catch(_0x1e6295){return this[_0x29c847(0xc7)]?.[_0x29c847(0xd8)]('ESLint\x20analysis\x20failed',{'file':_0x532608,'error':_0x1e6295[_0x29c847(0xc8)]}),[];}}async['fix'](_0x54f03b,_0x4a7669,_0x4c8bdc={}){const _0x400ba6=a0_0x5e7b;try{const _0x5c8128=await this['getESLintInstance']({..._0x4c8bdc,'fix':!![]}),_0x5281f8=await _0x5c8128[_0x400ba6(0x100)](_0x4a7669,{'filePath':_0x54f03b,'warnIgnored':![]});if(_0x5281f8&&_0x5281f8[_0x400ba6(0xe9)]>0x0){const _0x2bb7c2=_0x5281f8[0x0];return{'fixed':_0x2bb7c2[_0x400ba6(0xfb)]!==undefined,'content':_0x2bb7c2['output']||_0x4a7669,'fixedCount':_0x2bb7c2[_0x400ba6(0x106)]+_0x2bb7c2['fixableWarningCount'],'remainingErrors':_0x2bb7c2[_0x400ba6(0xfd)]-_0x2bb7c2['fixableErrorCount'],'remainingWarnings':_0x2bb7c2[_0x400ba6(0xe1)]-_0x2bb7c2[_0x400ba6(0xe6)],'changes':_0x2bb7c2[_0x400ba6(0xfb)]?this['describeChanges'](_0x4a7669,_0x2bb7c2[_0x400ba6(0xfb)]):[]};}return{'fixed':![],'content':_0x4a7669,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x3d7e83){this[_0x400ba6(0xc7)]?.['error'](_0x400ba6(0x102),{'file':_0x54f03b,'error':_0x3d7e83['message']});throw new Error('ESLint\x20fix\x20failed:\x20'+_0x3d7e83['message']);}}async['getESLintInstance'](_0x3cb819={}){const _0x3ea605=a0_0x5e7b,{workingDir:_0x3b4eb2,fix:fix=![],framework:_0x14f5f5}=_0x3cb819,_0x1bc138=await this[_0x3ea605(0xee)](_0x3b4eb2,_0x14f5f5),_0x54b691=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x1bc138,'errorOnUnmatchedPattern':![]});return _0x54b691;}async['getESLintConfig'](_0x26e3dc,_0x5ad9f6){const _0x3f3fd4=a0_0x5e7b,_0x58759f={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':_0x3f3fd4(0xd3),'sourceType':_0x3f3fd4(0xdc)},'rules':{'no-unused-vars':_0x3f3fd4(0xf7),'no-undef':_0x3f3fd4(0xd8),'no-console':'off','semi':[_0x3f3fd4(0xf7),_0x3f3fd4(0xe4)],'quotes':[_0x3f3fd4(0xf7),'single',{'avoidEscape':!![]}]}};if(_0x5ad9f6===_0x3f3fd4(0xcb))_0x58759f[_0x3f3fd4(0xe0)]=['eslint:recommended'],_0x58759f[_0x3f3fd4(0x104)]['ecmaFeatures']={'jsx':!![]},_0x58759f[_0x3f3fd4(0xce)]={'react':{'version':'detect'}};else _0x5ad9f6==='vue'?_0x58759f[_0x3f3fd4(0xe0)]=['eslint:recommended']:_0x58759f['extends']=[_0x3f3fd4(0xf8)];if(_0x26e3dc){const _0x1c5c70=[_0x3f3fd4(0xfc),'.eslintrc.cjs',_0x3f3fd4(0x108),_0x3f3fd4(0xea)];for(const _0x6a6c2 of _0x1c5c70){try{const _0x52944b=a0_0x31a891[_0x3f3fd4(0xc3)](_0x26e3dc,_0x6a6c2);return await a0_0x582d49['access'](_0x52944b),this['logger']?.['debug']('Found\x20ESLint\x20config',{'configFile':_0x6a6c2}),{};}catch{}}}return _0x58759f;}[a0_0x4b4ff0(0xd9)](_0x1d996e,_0x2e5160){const _0x1ce041=a0_0x4b4ff0;return{'file':_0x2e5160,'line':_0x1d996e[_0x1ce041(0xe7)]||0x1,'column':_0x1d996e[_0x1ce041(0xe5)]||0x1,'endLine':_0x1d996e[_0x1ce041(0xe3)],'endColumn':_0x1d996e[_0x1ce041(0xef)],'severity':_0x1d996e[_0x1ce041(0x107)]===0x2?STATIC_ANALYSIS['SEVERITY']['ERROR']:STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x1d996e['ruleId']||'eslint','message':_0x1d996e['message'],'category':this['categorizeRule'](_0x1d996e[_0x1ce041(0xf3)]),'fixable':_0x1d996e[_0x1ce041(0xff)]!==undefined,'source':_0x1ce041(0xdb)};}['categorizeRule'](_0x1b2b39){const _0x289d94=a0_0x4b4ff0;if(!_0x1b2b39)return STATIC_ANALYSIS['CATEGORY']['STYLE'];if(_0x1b2b39['includes'](_0x289d94(0xd5))||_0x1b2b39['includes'](_0x289d94(0x101))||_0x1b2b39==='no-eval'||_0x1b2b39===_0x289d94(0xc5))return STATIC_ANALYSIS[_0x289d94(0xcf)][_0x289d94(0xf2)];if(_0x1b2b39[_0x289d94(0xf0)](_0x289d94(0x103))||_0x1b2b39==='no-await-in-loop'||_0x1b2b39===_0x289d94(0xca))return STATIC_ANALYSIS[_0x289d94(0xcf)]['PERFORMANCE'];if(_0x1b2b39[_0x289d94(0xf0)]('import')||_0x1b2b39===_0x289d94(0xf4))return STATIC_ANALYSIS[_0x289d94(0xcf)][_0x289d94(0xf5)];if(_0x1b2b39['includes']('best-practices')||_0x1b2b39==='no-unused-vars'||_0x1b2b39===_0x289d94(0xd7)||_0x1b2b39===_0x289d94(0xf1))return STATIC_ANALYSIS[_0x289d94(0xcf)][_0x289d94(0xd2)];return STATIC_ANALYSIS['CATEGORY'][_0x289d94(0xda)];}['describeChanges'](_0x272164,_0xcfc401){const _0x2ce073=a0_0x4b4ff0,_0x5bdeca=[],_0x33b8be=_0x272164['split']('\x0a'),_0x963400=_0xcfc401['split']('\x0a'),_0x5af3e5=Math[_0x2ce073(0xdf)](_0x33b8be[_0x2ce073(0xe9)],_0x963400[_0x2ce073(0xe9)]);for(let _0x2630cc=0x0;_0x2630cc<_0x5af3e5;_0x2630cc++){const _0x43a335=_0x33b8be[_0x2630cc]||'',_0x46b9d9=_0x963400[_0x2630cc]||'';_0x43a335!==_0x46b9d9&&_0x5bdeca['push']({'line':_0x2630cc+0x1,'type':_0x43a335&&_0x46b9d9?_0x2ce073(0xe2):_0x43a335?'removed':'added','original':_0x43a335,'fixed':_0x46b9d9});}return _0x5bdeca;}[a0_0x4b4ff0(0xed)](){const _0xb456aa=a0_0x4b4ff0;return[_0xb456aa(0xec),'.jsx',_0xb456aa(0xf6),_0xb456aa(0xfe)];}[a0_0x4b4ff0(0xe8)](){return!![];}}export default ESLintAnalyzer;