@loxia-labs/loxia-autopilot-one 1.0.4 → 1.0.5

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 (116) 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
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.3
102
+ # Should display: Loxia Autopilot One v1.0.5
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_0x2846be=a0_0x5882;(function(_0x2438b1,_0x536d84){const _0xa7367f=a0_0x5882,_0x388bf1=_0x2438b1();while(!![]){try{const _0x53c487=-parseInt(_0xa7367f(0xc3))/0x1*(-parseInt(_0xa7367f(0x9f))/0x2)+parseInt(_0xa7367f(0xc2))/0x3+parseInt(_0xa7367f(0xb1))/0x4+-parseInt(_0xa7367f(0xbd))/0x5+-parseInt(_0xa7367f(0x9e))/0x6*(parseInt(_0xa7367f(0xd3))/0x7)+parseInt(_0xa7367f(0xa4))/0x8*(parseInt(_0xa7367f(0xae))/0x9)+-parseInt(_0xa7367f(0xaa))/0xa;if(_0x53c487===_0x536d84)break;else _0x388bf1['push'](_0x388bf1['shift']());}catch(_0x2937a5){_0x388bf1['push'](_0x388bf1['shift']());}}}(a0_0x5391,0x76df0));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x5288c8 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x2846be(0xd7),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x2846be(0xb5)][a0_0x2846be(0xbc)](0x2),command=args[0x0]&&!args[0x0][a0_0x2846be(0xb6)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x2846be(0xa1)](a0_0x2846be(0x99))||args['includes']('-h'),'version':args[a0_0x2846be(0xa1)](a0_0x2846be(0xad))||args['includes']('-v')};for(let i=0x0;i<args[a0_0x2846be(0xd2)];i++){args[i]==='--port'&&args[i+0x1]&&(flags[a0_0x2846be(0xd4)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x2846be(0xbf)&&args[i+0x1]&&(flags[a0_0x2846be(0x9c)]=args[i+0x1]);}const port=flags[a0_0x2846be(0xd4)]||DEFAULT_PORT,host=flags['host']||DEFAULT_HOST,serverUrl='http://'+host+':'+port;if(flags[a0_0x2846be(0xd6)]){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x2846be(0xcb)](readFileSync(pkgPath,a0_0x2846be(0x9b)));console[a0_0x2846be(0xbb)](a0_0x2846be(0xcc)+pkg[a0_0x2846be(0xd6)]),process[a0_0x2846be(0xcf)](0x0);}if(flags[a0_0x2846be(0x9a)]||!command){const pkgPath=join(__dirname,'..',a0_0x2846be(0xa6)),pkg=JSON[a0_0x2846be(0xcb)](readFileSync(pkgPath,a0_0x2846be(0x9b)));console[a0_0x2846be(0xbb)](a0_0x2846be(0xc6)+pkg[a0_0x2846be(0xd6)]+'\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+a0_0x2846be(0xaf)+DEFAULT_HOST+a0_0x2846be(0xab)),process[a0_0x2846be(0xcf)](0x0);}async function checkServerRunning(_0x482eb8,_0x4bba8e,_0x35b70e=0x1){for(let _0x5bfe51=0x0;_0x5bfe51<_0x35b70e;_0x5bfe51++){const _0x136d8f=await new Promise(_0x35ee1f=>{const _0x309f1c=a0_0x5882,_0x1ee439=a0_0x5288c8[_0x309f1c(0xce)](_0x309f1c(0xb4)+_0x482eb8+':'+_0x4bba8e+_0x309f1c(0x9d),_0x541103=>{const _0x11d5e1=_0x309f1c;_0x35ee1f(_0x541103[_0x11d5e1(0xb9)]===0xc8);});_0x1ee439['on'](_0x309f1c(0xb8),()=>_0x35ee1f(![])),_0x1ee439[_0x309f1c(0xc7)](0x7d0,()=>{_0x1ee439['destroy'](),_0x35ee1f(![]);});});if(_0x136d8f)return!![];_0x5bfe51<_0x35b70e-0x1&&await new Promise(_0x261590=>setTimeout(_0x261590,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0xa557b5,_0x1e3df2,_0x5900c4=SERVER_STARTUP_TIMEOUT){const _0x5b9da9=a0_0x2846be,_0x362fbe=Math[_0x5b9da9(0x93)](_0x5900c4/SERVER_CHECK_INTERVAL);return checkServerRunning(_0xa557b5,_0x1e3df2,_0x362fbe);}function openBrowser(_0x34e544){const _0x22caab=a0_0x2846be,_0x1084a8=process[_0x22caab(0xa7)];let _0x25fccb;if(_0x1084a8==='darwin')_0x25fccb=_0x22caab(0xb0)+_0x34e544+'\x22';else _0x1084a8==='win32'?_0x25fccb='start\x20\x22\x22\x20\x22'+_0x34e544+'\x22':_0x25fccb=_0x22caab(0xa0)+_0x34e544+'\x22';exec(_0x25fccb,_0x39248a=>{const _0x1e4e36=_0x22caab;_0x39248a&&(console[_0x1e4e36(0xbb)](_0x1e4e36(0x95)),console['log'](_0x1e4e36(0xd5)+_0x34e544));});}function a0_0x5882(_0x27ee24,_0x54225a){_0x27ee24=_0x27ee24-0x93;const _0x5391cd=a0_0x5391();let _0x588248=_0x5391cd[_0x27ee24];return _0x588248;}function startServer(_0x3bf380=![]){const _0x18d825=a0_0x2846be,_0x2cf5f1={...process[_0x18d825(0xc4)],'LOXIA_PORT':port['toString'](),'PORT':port[_0x18d825(0x96)]()};flags[_0x18d825(0x9c)]&&(_0x2cf5f1[_0x18d825(0xa8)]=flags[_0x18d825(0x9c)]);const _0x3e19af=join(__dirname,'..',_0x18d825(0x94),_0x18d825(0xc8)),_0x5694fc=spawn(_0x18d825(0xc1),[_0x3e19af],{'cwd':join(__dirname,'..'),'env':_0x2cf5f1,'stdio':_0x3bf380?[_0x18d825(0xcd),_0x18d825(0xcd),'ignore']:_0x18d825(0xac),'detached':_0x3bf380});return _0x3bf380&&_0x5694fc['unref'](),_0x5694fc;}function startTerminalUI(){const _0x12c233=a0_0x2846be,_0x3efc46=join(__dirname,_0x12c233(0xd1)),_0x2e0eef={...process[_0x12c233(0xc4)],'LOXIA_PORT':port[_0x12c233(0x96)](),'LOXIA_HOST':host},_0x5557e5=spawn(_0x12c233(0xc1),[_0x3efc46],{'cwd':join(__dirname,'..'),'env':_0x2e0eef,'stdio':_0x12c233(0xac)});return _0x5557e5;}const commands={'web':async()=>{const _0xf510c1=a0_0x2846be;console[_0xf510c1(0xbb)](_0xf510c1(0xc0));const _0x565bb1=startServer(![]);console[_0xf510c1(0xbb)](_0xf510c1(0xba));const _0x1cd05d=await waitForServer(host,port);_0x1cd05d?(console[_0xf510c1(0xbb)]('\x0aOpening\x20Web\x20UI\x20at\x20'+serverUrl),openBrowser(serverUrl)):console['log']('\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20'+serverUrl+_0xf510c1(0x97)),process['on'](_0xf510c1(0xa9),()=>_0x565bb1[_0xf510c1(0x98)](_0xf510c1(0xa9))),process['on'](_0xf510c1(0xd8),()=>_0x565bb1[_0xf510c1(0x98)](_0xf510c1(0xd8))),_0x565bb1['on']('exit',_0x5191f0=>process[_0xf510c1(0xcf)](_0x5191f0||0x0));},'plus-web':async()=>{await commands['web']();},'terminal':async()=>{const _0x40002=a0_0x2846be;console['log'](_0x40002(0xa2));const _0x5e6757=await checkServerRunning(host,port);!_0x5e6757&&(console[_0x40002(0xb8)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console['error']('\x0aPlease\x20start\x20the\x20server\x20first:'),console['error'](_0x40002(0xc9)),console[_0x40002(0xb8)]('\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a'),process['exit'](0x1));console[_0x40002(0xbb)]('Server\x20is\x20running\x20at\x20'+serverUrl),console['log'](_0x40002(0xb2));const _0x23adf1=startTerminalUI();process['on'](_0x40002(0xa9),()=>_0x23adf1['kill']('SIGINT')),process['on']('SIGTERM',()=>_0x23adf1['kill'](_0x40002(0xd8))),_0x23adf1['on'](_0x40002(0xcf),_0x681ede=>process[_0x40002(0xcf)](_0x681ede||0x0));},'plus-terminal':async()=>{const _0x35c393=a0_0x2846be;console[_0x35c393(0xbb)](_0x35c393(0xc5));const _0x2660df=startServer(!![]),_0x2e8c46=await waitForServer(host,port);!_0x2e8c46&&(console[_0x35c393(0xb8)](_0x35c393(0xca)),process[_0x35c393(0xcf)](0x1));console[_0x35c393(0xbb)](_0x35c393(0xd0)+serverUrl),console[_0x35c393(0xbb)]('Starting\x20Terminal\x20UI...\x0a');const _0xf939b8=startTerminalUI();_0xf939b8['on']('exit',_0x581b99=>{const _0x27311a=_0x35c393;console[_0x27311a(0xbb)]('\x0aShutting\x20down\x20server...');try{process[_0x27311a(0x98)](_0x2660df['pid'],_0x27311a(0xd8));}catch(_0x47ad61){}process[_0x27311a(0xcf)](_0x581b99||0x0);}),process['on'](_0x35c393(0xa9),()=>{const _0x573e18=_0x35c393;_0xf939b8['kill'](_0x573e18(0xa9));}),process['on'](_0x35c393(0xd8),()=>{const _0x59cc0a=_0x35c393;_0xf939b8[_0x59cc0a(0x98)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x2846be(0xa5)](_0x2a978b=>{const _0x5b53ce=a0_0x2846be;console[_0x5b53ce(0xb8)](_0x5b53ce(0xb3),_0x2a978b[_0x5b53ce(0xb7)]),process[_0x5b53ce(0xcf)](0x1);}):(console[a0_0x2846be(0xb8)](a0_0x2846be(0xbe)+command),console[a0_0x2846be(0xb8)](a0_0x2846be(0xa3)),process[a0_0x2846be(0xcf)](0x1));function a0_0x5391(){const _0x400237=['1261253oLIEZC','port','Please\x20open\x20manually:\x20','version','localhost','SIGTERM','ceil','src','Could\x20not\x20open\x20browser\x20automatically.','toString','\x20manually.','kill','--help','help','utf8','host','/api/health','30iumBeC','68212nSryvx','xdg-open\x20\x22','includes','Checking\x20if\x20server\x20is\x20running...','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','7608Jjocvk','catch','package.json','platform','LOXIA_HOST','SIGINT','1863600midYka',')\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','inherit','--version','6210rKgRwn',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','open\x20\x22','1105888nBLiPY','Starting\x20Terminal\x20UI...\x0a','Error:','http://','argv','startsWith','message','error','statusCode','Waiting\x20for\x20server\x20to\x20start...','log','slice','362935pvxJCo','Unknown\x20command:\x20','--host','Starting\x20Loxia\x20server...\x0a','node','1119048GxiSsz','10NifobK','env','Starting\x20Loxia\x20server\x20in\x20background...','\x0aLoxia\x20Autopilot\x20One\x20v','setTimeout','index.js','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','parse','Loxia\x20Autopilot\x20One\x20v','ignore','get','exit','Server\x20running\x20at\x20','loxia-terminal.js','length'];a0_0x5391=function(){return _0x400237;};return a0_0x5391();}
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));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x1f3fc9=a0_0x388d;(function(_0x2a05f4,_0x4de26a){const _0x2ef324=a0_0x388d,_0x2238f3=_0x2a05f4();while(!![]){try{const _0x19e9b8=parseInt(_0x2ef324(0xe3))/0x1+-parseInt(_0x2ef324(0xbd))/0x2+-parseInt(_0x2ef324(0xc3))/0x3*(parseInt(_0x2ef324(0xe1))/0x4)+-parseInt(_0x2ef324(0xde))/0x5*(-parseInt(_0x2ef324(0xdd))/0x6)+parseInt(_0x2ef324(0xdb))/0x7*(-parseInt(_0x2ef324(0xca))/0x8)+parseInt(_0x2ef324(0xe4))/0x9*(-parseInt(_0x2ef324(0xec))/0xa)+parseInt(_0x2ef324(0xeb))/0xb;if(_0x19e9b8===_0x4de26a)break;else _0x2238f3['push'](_0x2238f3['shift']());}catch(_0xee91cc){_0x2238f3['push'](_0x2238f3['shift']());}}}(a0_0x53a4,0x43432));import{spawn}from'child_process';import a0_0x85aeed from'net';import a0_0x425cda from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x425cda[a0_0x1f3fc9(0xcf)](__filename),projectRoot=a0_0x425cda[a0_0x1f3fc9(0xcf)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x1c93d0,_0x1b6ffe){return new Promise(_0x511d8c=>{const _0x10c97b=a0_0x388d,_0x4ed916=new a0_0x85aeed[(_0x10c97b(0xc0))]();_0x4ed916[_0x10c97b(0xd2)](0x7d0),_0x4ed916['on'](_0x10c97b(0xd4),()=>{const _0x51fb0d=_0x10c97b;_0x4ed916[_0x51fb0d(0xbc)](),_0x511d8c(!![]);}),_0x4ed916['on'](_0x10c97b(0xc2),()=>{const _0x25c0f5=_0x10c97b;_0x4ed916[_0x25c0f5(0xbc)](),_0x511d8c(![]);}),_0x4ed916['on']('error',()=>{const _0x436179=_0x10c97b;_0x4ed916[_0x436179(0xbc)](),_0x511d8c(![]);}),_0x4ed916[_0x10c97b(0xd4)](_0x1b6ffe,_0x1c93d0);});}function a0_0x388d(_0x4595ef,_0x22dfec){_0x4595ef=_0x4595ef-0xba;const _0x53a43e=a0_0x53a4();let _0x388d0a=_0x53a43e[_0x4595ef];return _0x388d0a;}async function startServer(_0x2bcdc8,_0x9ed093){const _0x3aeca4=a0_0x1f3fc9;return console[_0x3aeca4(0xd0)](_0x3aeca4(0xbb)),new Promise((_0x51d74a,_0x1670d0)=>{const _0x28bcb7=_0x3aeca4,_0x2d29f6=spawn(_0x28bcb7(0xc1),[a0_0x425cda[_0x28bcb7(0xe7)](projectRoot,_0x28bcb7(0xd1)),'--ui',_0x28bcb7(0xcc),_0x28bcb7(0xe0),_0x2bcdc8,_0x28bcb7(0xd5),_0x9ed093[_0x28bcb7(0xd8)]()],{'detached':![],'stdio':[_0x28bcb7(0xd3),_0x28bcb7(0xc6),_0x28bcb7(0xc6)]});_0x2d29f6['stdout']['on']('data',()=>{}),_0x2d29f6[_0x28bcb7(0xc9)]['on'](_0x28bcb7(0xdf),()=>{}),_0x2d29f6['on'](_0x28bcb7(0xd7),_0x2faea9=>{const _0x561ca4=_0x28bcb7;console[_0x561ca4(0xd7)](_0x561ca4(0xce),_0x2faea9[_0x561ca4(0xcb)]),_0x1670d0(_0x2faea9);});const _0x2ec30a=Date[_0x28bcb7(0xe6)](),_0x7b451a=setInterval(async()=>{const _0x23d550=_0x28bcb7,_0x173f3d=await isServerRunning(_0x2bcdc8,_0x9ed093);if(_0x173f3d)clearInterval(_0x7b451a),console[_0x23d550(0xd0)]('✓\x20Server\x20started\x20at\x20'+_0x2bcdc8+':'+_0x9ed093),_0x51d74a();else Date[_0x23d550(0xe6)]()-_0x2ec30a>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x7b451a),_0x2d29f6[_0x23d550(0xe2)](),_0x1670d0(new Error(_0x23d550(0xe8))));},0x1f4);});}function a0_0x53a4(){const _0x403f5e=['../src/interfaces/terminal/index.js','12rcERtJ','17240FNrGQw','data','--host','4eQaaVM','kill','28440SMQOjy','1836747TGJqYC','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','now','join','Server\x20startup\x20timeout','LOXIA_HOST','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','13925131OeIXgK','10oUpxqy','exit','🚀\x20Starting\x20Loxia\x20server...','destroy','775672fFnhic','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','env','Socket','node','timeout','1118823HUPHal','argv','💡\x20Troubleshooting:','pipe','slice','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','stderr','487128wdzQWU','message','web','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','Failed\x20to\x20start\x20server:','dirname','log','bin/cli.js','setTimeout','ignore','connect','--port','...','error','toString','LOXIA_PORT','✗\x20Server\x20is\x20not\x20running','7WINjyw'];a0_0x53a4=function(){return _0x403f5e;};return a0_0x53a4();}async function main(){const _0x1e0586=a0_0x1f3fc9;try{console['log'](_0x1e0586(0xea)),console[_0x1e0586(0xd0)]('\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI'),console[_0x1e0586(0xd0)](_0x1e0586(0xea)),console[_0x1e0586(0xd0)]('');const _0xfb78c7=process[_0x1e0586(0xc4)][_0x1e0586(0xc7)](0x2);let _0x3b98e8=DEFAULT_HOST,_0x5e1c48=DEFAULT_PORT;for(let _0x52faf7=0x0;_0x52faf7<_0xfb78c7['length'];_0x52faf7++){if(_0xfb78c7[_0x52faf7]===_0x1e0586(0xe0)&&_0xfb78c7[_0x52faf7+0x1])_0x3b98e8=_0xfb78c7[_0x52faf7+0x1],_0x52faf7++;else _0xfb78c7[_0x52faf7]==='--port'&&_0xfb78c7[_0x52faf7+0x1]&&(_0x5e1c48=parseInt(_0xfb78c7[_0x52faf7+0x1],0xa),_0x52faf7++);}console[_0x1e0586(0xd0)]('🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20'+_0x3b98e8+':'+_0x5e1c48+_0x1e0586(0xd6));const _0x4cae8a=await isServerRunning(_0x3b98e8,_0x5e1c48);!_0x4cae8a?(console['log'](_0x1e0586(0xda)),await startServer(_0x3b98e8,_0x5e1c48)):console[_0x1e0586(0xd0)]('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x3b98e8+':'+_0x5e1c48),console[_0x1e0586(0xd0)](''),console[_0x1e0586(0xd0)](_0x1e0586(0xe5)),console[_0x1e0586(0xd0)](''),await new Promise(_0x3b54ce=>setTimeout(_0x3b54ce,0x1f4)),process[_0x1e0586(0xbf)][_0x1e0586(0xe9)]=_0x3b98e8,process[_0x1e0586(0xbf)][_0x1e0586(0xd9)]=_0x5e1c48[_0x1e0586(0xd8)](),await import(_0x1e0586(0xdc));}catch(_0x1663d7){console[_0x1e0586(0xd7)](''),console[_0x1e0586(0xd7)](_0x1e0586(0xbe)),console[_0x1e0586(0xd7)]('\x20\x20',_0x1663d7[_0x1e0586(0xcb)]),console[_0x1e0586(0xd7)](''),console[_0x1e0586(0xd7)](_0x1e0586(0xc5)),console['error']('\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'),console[_0x1e0586(0xd7)](_0x1e0586(0xcd)),console[_0x1e0586(0xd7)](_0x1e0586(0xc8)),console['error'](''),process[_0x1e0586(0xba)](0x1);}}main();
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();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x564356=a0_0x4496;function a0_0x42e9(){const _0x1708b3=['1020IXjKMT','isTTY','--port','catch','49671mRwDWT','host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','98186dZCgWs','1030755rUOOFB','1634952yOrbbM','3420906nYmbgA','\x20\x20npm\x20run\x20terminal-ui','error','638196jUFEZE','--help','LOXIA_PORT','7133784vbcAfR','\x20\x20-\x20Some\x20CI/CD\x20environments','waitUntilExit','length','localhost','\x0aTerminal\x20UI\x20exited','Or\x20use\x20the\x20web\x20UI\x20instead:','slice','1VCxfRr','log','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','Press\x20Ctrl+C\x20to\x20exit\x0a','\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','port','168NzwNJw','env','--host','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','exit','5kfMoaP'];a0_0x42e9=function(){return _0x1708b3;};return a0_0x42e9();}(function(_0x1b478f,_0x57e3b7){const _0x524175=a0_0x4496,_0x4ddbe7=_0x1b478f();while(!![]){try{const _0x52a25b=-parseInt(_0x524175(0xc8))/0x1*(parseInt(_0x524175(0xbd))/0x2)+-parseInt(_0x524175(0xb8))/0x3+parseInt(_0x524175(0xb9))/0x4+-parseInt(_0x524175(0xaf))/0x5*(-parseInt(_0x524175(0xba))/0x6)+parseInt(_0x524175(0xc0))/0x7+-parseInt(_0x524175(0xaa))/0x8*(-parseInt(_0x524175(0xb4))/0x9)+-parseInt(_0x524175(0xb0))/0xa*(parseInt(_0x524175(0xb7))/0xb);if(_0x52a25b===_0x57e3b7)break;else _0x4ddbe7['push'](_0x4ddbe7['shift']());}catch(_0x36b4ca){_0x4ddbe7['push'](_0x4ddbe7['shift']());}}}(a0_0x42e9,0x8405d));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process['argv'][a0_0x564356(0xc7)](0x2),options={'host':a0_0x564356(0xc4),'port':0x1f90};for(let i=0x0;i<args[a0_0x564356(0xc3)];i++){const arg=args[i];if(arg===a0_0x564356(0xac)||arg==='-h')options[a0_0x564356(0xb5)]=args[++i];else{if(arg===a0_0x564356(0xb2)||arg==='-p')options[a0_0x564356(0xa9)]=parseInt(args[++i],0xa);else arg===a0_0x564356(0xbe)&&(console[a0_0x564356(0xc9)](a0_0x564356(0xa8)),process[a0_0x564356(0xae)](0x0));}}process[a0_0x564356(0xab)]['LOXIA_HOST']&&(options[a0_0x564356(0xb5)]=process['env']['LOXIA_HOST']);process[a0_0x564356(0xab)][a0_0x564356(0xbf)]&&(options['port']=parseInt(process[a0_0x564356(0xab)]['LOXIA_PORT'],0xa));!process['stdin'][a0_0x564356(0xb1)]&&(console['error'](a0_0x564356(0xad)),console[a0_0x564356(0xbc)](''),console[a0_0x564356(0xbc)]('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x564356(0xbc)]('\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)'),console[a0_0x564356(0xbc)](a0_0x564356(0xb6)),console['error'](a0_0x564356(0xca)),console['error'](a0_0x564356(0xc1)),console['error'](''),console[a0_0x564356(0xbc)]('Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:'),console[a0_0x564356(0xbc)](a0_0x564356(0xbb)),console['error'](''),console['error'](a0_0x564356(0xc6)),console[a0_0x564356(0xbc)]('\x20\x20npm\x20start'),process['exit'](0x1));console[a0_0x564356(0xc9)]('Starting\x20Loxia\x20Terminal\x20UI...'),console[a0_0x564356(0xc9)]('Connecting\x20to:\x20'+options[a0_0x564356(0xb5)]+':'+options[a0_0x564356(0xa9)]),console[a0_0x564356(0xc9)](a0_0x564356(0xcb));function a0_0x4496(_0x545134,_0x3c488d){_0x545134=_0x545134-0xa8;const _0x42e98=a0_0x42e9();let _0x449696=_0x42e98[_0x545134];return _0x449696;}const instance=startTerminalUI(options);instance[a0_0x564356(0xc2)]()['then'](()=>{const _0x232533=a0_0x564356;console[_0x232533(0xc9)](_0x232533(0xc5)),process[_0x232533(0xae)](0x0);})[a0_0x564356(0xb3)](_0x2a0d48=>{const _0x46e606=a0_0x564356;console[_0x46e606(0xbc)]('\x0aTerminal\x20UI\x20error:',_0x2a0d48),process[_0x46e606(0xae)](0x1);});
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);});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x117b0f=a0_0x35d7;(function(_0x27bcd4,_0x48481f){const _0x5df5da=a0_0x35d7,_0x17327e=_0x27bcd4();while(!![]){try{const _0x25e536=parseInt(_0x5df5da(0x110))/0x1+-parseInt(_0x5df5da(0xef))/0x2*(-parseInt(_0x5df5da(0xec))/0x3)+-parseInt(_0x5df5da(0xea))/0x4*(-parseInt(_0x5df5da(0x109))/0x5)+-parseInt(_0x5df5da(0xfb))/0x6+parseInt(_0x5df5da(0xe2))/0x7+parseInt(_0x5df5da(0xf3))/0x8*(-parseInt(_0x5df5da(0xfc))/0x9)+-parseInt(_0x5df5da(0x101))/0xa;if(_0x25e536===_0x48481f)break;else _0x17327e['push'](_0x17327e['shift']());}catch(_0x21d97f){_0x17327e['push'](_0x17327e['shift']());}}}(a0_0x28b5,0x3c2a9));import{spawn}from'child_process';import{fileURLToPath}from'url';function a0_0x35d7(_0x1b3200,_0x359a67){_0x1b3200=_0x1b3200-0xe2;const _0x28b501=a0_0x28b5();let _0x35d74e=_0x28b501[_0x1b3200];return _0x35d74e;}import{dirname,join}from'path';import a0_0x17120e from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env'][a0_0x117b0f(0xfe)]||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x28044a=0xa,_0x547fbf=0x1f4){const _0x545e07=a0_0x117b0f;for(let _0x3335f2=0x0;_0x3335f2<_0x28044a;_0x3335f2++){try{return await new Promise((_0x2bbc78,_0x3c09d8)=>{const _0x2bc8f2=a0_0x35d7,_0x23d98b=a0_0x17120e[_0x2bc8f2(0x103)](_0x2bc8f2(0xee)+SERVER_PORT+_0x2bc8f2(0xe3),_0x230ca8=>{const _0x5b51e6=_0x2bc8f2;_0x230ca8['statusCode']===0xc8?_0x2bbc78():_0x3c09d8(new Error(_0x5b51e6(0xf1)+_0x230ca8[_0x5b51e6(0x10e)]));});_0x23d98b['on'](_0x2bc8f2(0x105),_0x3c09d8),_0x23d98b['setTimeout'](0x3e8,()=>{const _0xea3c9a=_0x2bc8f2;_0x23d98b[_0xea3c9a(0x113)](),_0x3c09d8(new Error('Timeout'));});}),console[_0x545e07(0x108)]('✅\x20Server\x20is\x20ready!'),!![];}catch(_0x586e65){_0x3335f2<_0x28044a-0x1&&await new Promise(_0x5e7452=>setTimeout(_0x5e7452,_0x547fbf));}}return console[_0x545e07(0x108)](_0x545e07(0x116)),![];}async function startServer(){return new Promise(_0x465e1e=>{const _0x44703c=a0_0x35d7;console[_0x44703c(0x108)](_0x44703c(0x100));const _0x5c6257=join(rootDir,'src',_0x44703c(0xed));serverProcess=spawn(_0x44703c(0xe4),[_0x5c6257],{'cwd':rootDir,'env':{...process['env']},'stdio':[_0x44703c(0xe8),_0x44703c(0xf4),_0x44703c(0xf4)],'detached':![]}),serverProcess[_0x44703c(0x10c)]['on'](_0x44703c(0xf6),_0x367e69=>{const _0x35a2c6=_0x44703c,_0x25f4c6=_0x367e69['toString']()[_0x35a2c6(0xf8)]();_0x25f4c6&&console[_0x35a2c6(0x108)](_0x35a2c6(0xf0)+_0x25f4c6);}),serverProcess[_0x44703c(0xff)]['on'](_0x44703c(0xf6),_0x54b085=>{const _0x137542=_0x44703c,_0x32cd7d=_0x54b085[_0x137542(0xe7)]()['trim']();_0x32cd7d&&!_0x32cd7d[_0x137542(0x107)](_0x137542(0xeb))&&console[_0x137542(0x105)]('[SERVER\x20ERROR]\x20'+_0x32cd7d);}),serverProcess['on'](_0x44703c(0x105),_0x3c399d=>{const _0x3f8a6b=_0x44703c;console[_0x3f8a6b(0x105)](_0x3f8a6b(0x10d),_0x3c399d[_0x3f8a6b(0xf5)]),process[_0x3f8a6b(0x112)](0x1);}),serverProcess['on'](_0x44703c(0x112),(_0x3c31ad,_0x2f9d1a)=>{const _0x4611c8=_0x44703c;_0x3c31ad!==null&&_0x3c31ad!==0x0&&(console['error'](_0x4611c8(0x102)+_0x3c31ad),process[_0x4611c8(0x112)](_0x3c31ad));}),setTimeout(_0x465e1e,STARTUP_WAIT);});}async function startTerminalUI(){const _0x5b613a=a0_0x117b0f;console[_0x5b613a(0x108)](_0x5b613a(0x106)),console[_0x5b613a(0x108)]('');const _0x8c300e=join(rootDir,_0x5b613a(0xf7),_0x5b613a(0x104)),_0x8217c9=spawn(_0x5b613a(0xe4),[_0x8c300e],{'cwd':rootDir,'env':{...process[_0x5b613a(0xf9)]},'stdio':'inherit'});return _0x8217c9['on'](_0x5b613a(0x105),_0x245aa5=>{const _0x1fa6d6=_0x5b613a;console[_0x1fa6d6(0x105)](_0x1fa6d6(0x111),_0x245aa5[_0x1fa6d6(0xf5)]),cleanup(),process[_0x1fa6d6(0x112)](0x1);}),_0x8217c9['on'](_0x5b613a(0x112),_0x13b909=>{const _0x4bbcf8=_0x5b613a;console['log'](_0x4bbcf8(0xfa)),cleanup(),process[_0x4bbcf8(0x112)](_0x13b909||0x0);}),_0x8217c9;}function cleanup(){const _0xea4549=a0_0x117b0f;serverProcess&&!serverProcess['killed']&&(console[_0xea4549(0x108)](_0xea4549(0x115)),serverProcess[_0xea4549(0x10f)](_0xea4549(0xe9)),setTimeout(()=>{const _0x2c687c=_0xea4549;!serverProcess[_0x2c687c(0xfd)]&&serverProcess[_0x2c687c(0x10f)](_0x2c687c(0x10a));},0x1388));}process['on'](a0_0x117b0f(0x114),()=>{const _0x3c5f9c=a0_0x117b0f;console[_0x3c5f9c(0x108)](_0x3c5f9c(0xf2)),cleanup(),process[_0x3c5f9c(0x112)](0x0);}),process['on'](a0_0x117b0f(0xe9),()=>{console['log']('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x117b0f(0x112),()=>{cleanup();});async function main(){const _0xb8f2f4=a0_0x117b0f;console[_0xb8f2f4(0x108)](_0xb8f2f4(0x10b)),console['log'](_0xb8f2f4(0xe5)),console[_0xb8f2f4(0x108)](_0xb8f2f4(0xe6)),console[_0xb8f2f4(0x108)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x1e082e){console[_0xb8f2f4(0x105)]('Error\x20during\x20startup:',_0x1e082e[_0xb8f2f4(0xf5)]),cleanup(),process[_0xb8f2f4(0x112)](0x1);}}main();function a0_0x28b5(){const _0xf849ec=['destroy','SIGINT','🛑\x20Stopping\x20server...','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','1949717eBoZqg','/health','node','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','╚════════════════════════════════════════════════╝','toString','ignore','SIGTERM','4wLCGUR','ExperimentalWarning','78MNXOqp','index.js','http://localhost:','35732WFeyRW','[SERVER]\x20','Server\x20returned\x20','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','16kvylCH','pipe','message','data','bin','trim','env','\x0a👋\x20Terminal\x20UI\x20closed.','549372ZULHrN','356571ZEdiOM','killed','PORT','stderr','🚀\x20Starting\x20Loxia\x20server...','9153840bDBSpz','Server\x20exited\x20with\x20code\x20','get','loxia-terminal.js','error','🖥️\x20\x20Starting\x20Terminal\x20UI...','includes','log','2213170jzozZK','SIGKILL','╔════════════════════════════════════════════════╗','stdout','Failed\x20to\x20start\x20server:','statusCode','kill','146944sDuNFp','Failed\x20to\x20start\x20Terminal\x20UI:','exit'];a0_0x28b5=function(){return _0xf849ec;};return a0_0x28b5();}
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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_0x570fe3=a0_0x5db4;(function(_0x47e640,_0x195092){const _0x37f2b9=a0_0x5db4,_0x4d1317=_0x47e640();while(!![]){try{const _0x281b76=parseInt(_0x37f2b9(0x20b))/0x1*(-parseInt(_0x37f2b9(0x217))/0x2)+parseInt(_0x37f2b9(0x225))/0x3+parseInt(_0x37f2b9(0x224))/0x4*(-parseInt(_0x37f2b9(0x1f7))/0x5)+parseInt(_0x37f2b9(0x1f3))/0x6*(-parseInt(_0x37f2b9(0x1df))/0x7)+-parseInt(_0x37f2b9(0x208))/0x8+parseInt(_0x37f2b9(0x1f4))/0x9+-parseInt(_0x37f2b9(0x20c))/0xa;if(_0x281b76===_0x195092)break;else _0x4d1317['push'](_0x4d1317['shift']());}catch(_0x34c577){_0x4d1317['push'](_0x4d1317['shift']());}}}(a0_0x34cb,0x43a6c));import{exec}from'child_process';import{promisify}from'util';import a0_0x3a3dea from'https';import a0_0x3bb35b from'http';import a0_0x4aa9b4 from'fs';import a0_0x5805e8 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_0x5805e8[a0_0x570fe3(0x1fe)](__filename),SCANNER_DIR=a0_0x5805e8[a0_0x570fe3(0x1e3)](__dirname,'..','node_modules','.scanners'),SEMGREP_VERSION=a0_0x570fe3(0x1fc);console[a0_0x570fe3(0x223)](a0_0x570fe3(0x1f8)),console[a0_0x570fe3(0x223)](a0_0x570fe3(0x1fa)),console[a0_0x570fe3(0x223)](a0_0x570fe3(0x222));function a0_0x5db4(_0x274527,_0x1161d5){_0x274527=_0x274527-0x1df;const _0x34cb5a=a0_0x34cb();let _0x5db4b4=_0x34cb5a[_0x274527];return _0x5db4b4;}async function installScanners(){const _0x5a3b1e=a0_0x570fe3;await a0_0x4aa9b4[_0x5a3b1e(0x1f0)][_0x5a3b1e(0x207)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log']('\x0a═══════════════════════════════════════════════════════════'),console[_0x5a3b1e(0x223)](_0x5a3b1e(0x1e1)),console[_0x5a3b1e(0x223)](_0x5a3b1e(0x222));}async function checkESLintSecurity(){const _0x94689c=a0_0x570fe3;console[_0x94689c(0x223)](_0x94689c(0x203));try{await import(_0x94689c(0x204)),console[_0x94689c(0x223)](_0x94689c(0x1e0));}catch(_0x1a1cef){console[_0x94689c(0x223)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x94689c(0x223)](_0x94689c(0x21b));}}async function installSemgrep(){const _0x40b25e=a0_0x570fe3;console[_0x40b25e(0x223)]('🔍\x20Installing\x20Semgrep...');const _0x2150ee=process[_0x40b25e(0x20d)],_0x49f217=process[_0x40b25e(0x213)];try{const _0x4d4658=await execAsync(_0x40b25e(0x206),{'timeout':0x1388});console[_0x40b25e(0x223)](_0x40b25e(0x1f5)+_0x4d4658[_0x40b25e(0x219)]['trim']()),console[_0x40b25e(0x223)]('\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a');return;}catch(_0x237db6){console[_0x40b25e(0x223)](_0x40b25e(0x228));}const _0x18cf18=getSemgrepBinaryInfo(_0x2150ee,_0x49f217);if(!_0x18cf18){console[_0x40b25e(0x223)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x2150ee+'-'+_0x49f217),console['log'](_0x40b25e(0x1f1));return;}try{const _0x1adfa6=a0_0x5805e8[_0x40b25e(0x1e3)](SCANNER_DIR,_0x40b25e(0x1ec));console[_0x40b25e(0x223)](_0x40b25e(0x20f)+_0x18cf18['url']+_0x40b25e(0x1ee)),await downloadFile(_0x18cf18['url'],_0x1adfa6),await a0_0x4aa9b4[_0x40b25e(0x1f0)][_0x40b25e(0x209)](_0x1adfa6,0x1ed),console[_0x40b25e(0x223)](_0x40b25e(0x200)),console['log'](_0x40b25e(0x1e7)+_0x1adfa6+'\x0a'),console['log'](_0x40b25e(0x1ea)),console['log'](_0x40b25e(0x215));}catch(_0x5e3cd2){console[_0x40b25e(0x223)](_0x40b25e(0x1fb)+_0x5e3cd2[_0x40b25e(0x214)]),console[_0x40b25e(0x223)](_0x40b25e(0x205));}}function a0_0x34cb(){const _0x40c04f=['yamllint','catch','\x20-m\x20pip\x20show\x20','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','═══════════════════════════════════════════════════════════\x0a','log','17356ZWLSDg','1385766PRgart','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','close','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','7xTQKwa','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','\x20\x20Installation\x20Complete','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','join','❌\x20Installation\x20failed:','startsWith','Failed\x20to\x20download:\x20HTTP\x20','\x20\x20\x20Location:\x20','python3','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','bandit','semgrep','\x0aYou\x20can\x20manually\x20install\x20scanners:','...','unlink','promises','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','\x20-m\x20pip\x20install\x20--user\x20','282432lXXpJO','2955357ixrIxp','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','error','220seyjHO','═══════════════════════════════════════════════════════════','finish','\x20\x20Installing\x20Security\x20Scanners','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','v1.55.0','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','dirname','\x20\x20\x20Installing\x20','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','get','\x20\x20\x20✅\x20','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','eslint-plugin-security','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','semgrep\x20--version','mkdir','1536496zuMzUQ','chmod','\x20installed\x20successfully','4682dUowCD','456890vgOdGw','platform','checkov','\x20\x20\x20Downloading\x20from\x20','🐍\x20Checking\x20Python\x20scanners...','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','pipe','arch','message','\x20\x20\x20pip\x20install\x20semgrep\x0a','then','16cvvpiO','exit','stdout','statusCode','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','https','location'];a0_0x34cb=function(){return _0x40c04f;};return a0_0x34cb();}function getSemgrepBinaryInfo(_0x5890fa,_0x115797){return null;}async function installPythonScanners(){const _0x25b35c=a0_0x570fe3;console[_0x25b35c(0x223)](_0x25b35c(0x210));let _0x215e37=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x215e37=_0x25b35c(0x1e8);}catch(_0x5acdee){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x215e37='python';}catch(_0x14f825){console[_0x25b35c(0x223)]('\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners'),console[_0x25b35c(0x223)](_0x25b35c(0x1fd)),console[_0x25b35c(0x223)](_0x25b35c(0x1e9));return;}}console[_0x25b35c(0x223)]('\x20\x20\x20✅\x20Python\x20found:\x20'+_0x215e37),await installViaPip(_0x25b35c(0x1ec),_0x215e37),await installViaPip(_0x25b35c(0x1eb),_0x215e37),await installViaPip('pip-audit',_0x215e37),await installViaPip(_0x25b35c(0x20e),_0x215e37),await installViaPip(_0x25b35c(0x21e),_0x215e37),console['log']('');}async function installViaPip(_0x42fb33,_0x3c85c1){const _0x295783=a0_0x570fe3;try{const _0xf43ca4=await execAsync(_0x3c85c1+_0x295783(0x220)+_0x42fb33,{'timeout':0x1388});return console['log'](_0x295783(0x202)+_0x42fb33+'\x20already\x20installed'),!![];}catch(_0x219b65){console['log'](_0x295783(0x1ff)+_0x42fb33+_0x295783(0x1ee));try{return await execAsync(_0x3c85c1+_0x295783(0x1f2)+_0x42fb33,{'timeout':0xea60}),console[_0x295783(0x223)](_0x295783(0x202)+_0x42fb33+_0x295783(0x20a)),!![];}catch(_0x50fced){return console[_0x295783(0x223)](_0x295783(0x211)+_0x42fb33+':\x20'+_0x50fced[_0x295783(0x214)]),console[_0x295783(0x223)](_0x295783(0x221)+_0x42fb33),![];}}}async function downloadFile(_0x408a77,_0x2e4133){return new Promise((_0x780847,_0x5a579d)=>{const _0xc9979a=a0_0x5db4,_0xc55ac8=_0x408a77[_0xc9979a(0x1e5)](_0xc9979a(0x21c))?a0_0x3a3dea:a0_0x3bb35b;_0xc55ac8[_0xc9979a(0x201)](_0x408a77,_0x125c43=>{const _0x2781b8=_0xc9979a;if(_0x125c43[_0x2781b8(0x21a)]===0x12e||_0x125c43[_0x2781b8(0x21a)]===0x12d){downloadFile(_0x125c43['headers'][_0x2781b8(0x21d)],_0x2e4133)[_0x2781b8(0x216)](_0x780847)[_0x2781b8(0x21f)](_0x5a579d);return;}if(_0x125c43['statusCode']!==0xc8){_0x5a579d(new Error(_0x2781b8(0x1e6)+_0x125c43[_0x2781b8(0x21a)]));return;}const _0x141344=createWriteStream(_0x2e4133);_0x125c43[_0x2781b8(0x212)](_0x141344),_0x141344['on'](_0x2781b8(0x1f9),()=>{const _0x544536=_0x2781b8;_0x141344[_0x544536(0x227)](),_0x780847();}),_0x141344['on']('error',_0x41121f=>{const _0x523975=_0x2781b8;a0_0x4aa9b4[_0x523975(0x1ef)](_0x2e4133,()=>{}),_0x5a579d(_0x41121f);});})['on'](_0xc9979a(0x1f6),_0x5a579d);});}installScanners()[a0_0x570fe3(0x21f)](_0x4711c1=>{const _0x2f649d=a0_0x570fe3;console[_0x2f649d(0x1f6)](_0x2f649d(0x1e4),_0x4711c1[_0x2f649d(0x214)]),console[_0x2f649d(0x1f6)](_0x2f649d(0x1ed)),console[_0x2f649d(0x1f6)](_0x2f649d(0x226)),console[_0x2f649d(0x1f6)](_0x2f649d(0x1e2)),process[_0x2f649d(0x218)](0x0);});
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);});
@@ -1 +1 @@
1
- const a0_0x3c1b62=a0_0x2137;(function(_0x182bac,_0x50c3ac){const _0x5a187c=a0_0x2137,_0x125a3e=_0x182bac();while(!![]){try{const _0x208023=parseInt(_0x5a187c(0x1df))/0x1+parseInt(_0x5a187c(0x1de))/0x2+-parseInt(_0x5a187c(0x1c8))/0x3*(-parseInt(_0x5a187c(0x1f7))/0x4)+parseInt(_0x5a187c(0x1f9))/0x5*(parseInt(_0x5a187c(0x1f5))/0x6)+parseInt(_0x5a187c(0x1ef))/0x7*(parseInt(_0x5a187c(0x1e4))/0x8)+-parseInt(_0x5a187c(0x1e8))/0x9+-parseInt(_0x5a187c(0x1f2))/0xa*(parseInt(_0x5a187c(0x1cf))/0xb);if(_0x208023===_0x50c3ac)break;else _0x125a3e['push'](_0x125a3e['shift']());}catch(_0x77e2d8){_0x125a3e['push'](_0x125a3e['shift']());}}}(a0_0x3f8b,0x436a7));function a0_0x3f8b(){const _0x143450=['u0vwrvjjvfK','zM9YBwf0ug9ZDentu0vYCM9Y','u1rzteu','yw5HBhL6zq','CNvSzq','BM8TAw52ywXPza','Bg9Nz2vY','B3b0Aw1PEMu','CMvHC29U','D2fYBMLUz3m','Cg9ZDgnZC1nJC3m','C2nZCW','Dg9mB3DLCKnHC2u','lNnHC3m','mZu0otaZru1XAgvt','Aw5JBhvKzxm','y29SDw1U','C3r5BgvSAw50','BgLUzq','CM9VDa','BgLUDfn0EwXLCW','nZu4ndKYovrQDLLyyq','q0furuDpuLK','lNnJC3m','zw5KC1DPDgG','BwvZC2fNzq','ChjVy2vZCW','qKvtvf9quKfdveLdrq','BM8TDw5RBM93BG','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','rvjst1i','CMvZDwX0CW','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','Bg93zxi','zwXZzq','mZm3nJqYCwzfC29p','mJCZoty0vMHYBNDY','zxH0zw5K','BgvUz3rO','y29UDgvUDa','C3vWCg9YDhnbDxrVrML4','mta5mZuYtNj3DKPQ','u1Lovefy','lMnZCW','uevsrK9stufoq0u','mZq4ndy4m3DZvK9dvG','zwfJAa','BgvZCW','C291CMnL','Cg9ZDgnZC0XLC3m','Cg9ZDgnZCY1SzxnZ','zgvMyxvSDa','mJe3tvHzturQ','Cg9ZDgnZCW','zgvIDwC','mtbPzxzwqu8','zg91yMXL','q3nZu3LUDgf4rxjYB3i','otK4otrXA05Iwgq','BgLUDa','ofjyr3fzDG','y2HLy2TtEw50yxG','nZvpBgfKr2G','ChvZAa','Dgv4Da','BM8Tzw1WDhK','v0fstKLorW','C3LUDgf4','zgv0zwn0tgfUz3vHz2u'];a0_0x3f8b=function(){return _0x143450;};return a0_0x3f8b();}import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x1e8679=null){const _0x820b16=a0_0x2137;this['logger']=_0x1e8679,this[_0x820b16(0x1cb)]=null,this['postcss']=null,this['postcssScss']=null,this[_0x820b16(0x1ec)]=null;}async[a0_0x3c1b62(0x1bd)](_0x584447,_0x26ae36,_0x36eee6={}){const _0x517cb1=a0_0x3c1b62;try{const _0x57a8a8=[],_0x7719b6=this['detectLanguage'](_0x584447),_0x597546=await this[_0x517cb1(0x1f8)](_0x584447,_0x26ae36,_0x7719b6);_0x57a8a8[_0x517cb1(0x1fa)](..._0x597546);if(_0x597546[_0x517cb1(0x1e1)]===0x0){const _0x36880d=await this[_0x517cb1(0x1ce)](_0x584447,_0x26ae36,_0x7719b6);_0x57a8a8['push'](..._0x36880d);}return this[_0x517cb1(0x1c0)]?.['debug']('CSS\x20analysis\x20completed',{'file':_0x584447,'language':_0x7719b6,'totalDiagnostics':_0x57a8a8['length'],'errors':_0x57a8a8['filter'](_0x40927a=>_0x40927a['severity']===STATIC_ANALYSIS[_0x517cb1(0x1ba)][_0x517cb1(0x1d8)])['length'],'warnings':_0x57a8a8['filter'](_0x366c99=>_0x366c99['severity']===STATIC_ANALYSIS[_0x517cb1(0x1ba)][_0x517cb1(0x1fd)])['length']}),_0x57a8a8;}catch(_0x135b9f){return this['logger']?.['error']('CSS\x20analysis\x20failed',{'file':_0x584447,'error':_0x135b9f[_0x517cb1(0x1d3)]}),[];}}async['checkSyntax'](_0x1fc2fb,_0x3fc4db,_0x2b8381){const _0x376f5f=a0_0x3c1b62,_0x514d2a=[];try{if(!this[_0x376f5f(0x1f0)]){const _0xf4ff1a=await import('postcss');this[_0x376f5f(0x1f0)]=_0xf4ff1a[_0x376f5f(0x1ee)];}let _0x43add2=null;if(_0x2b8381==='scss'){if(!this['postcssScss']){const _0x419505=await import('postcss-scss');this[_0x376f5f(0x1c4)]=_0x419505[_0x376f5f(0x1ee)];}_0x43add2=this[_0x376f5f(0x1c4)];}else{if(_0x2b8381===_0x376f5f(0x1ea)){if(!this['postcssLess']){const _0x1238ce=await import('postcss-less');this[_0x376f5f(0x1ec)]=_0x1238ce[_0x376f5f(0x1ee)];}_0x43add2=this['postcssLess'];}}const _0x1ea37b=this['postcss']()[_0x376f5f(0x1d4)](_0x3fc4db,{'from':_0x1fc2fb,'syntax':_0x43add2}),_0x480dc5=_0x1ea37b[_0x376f5f(0x1cd)];this[_0x376f5f(0x1c0)]?.[_0x376f5f(0x1f1)](_0x376f5f(0x1db),{'file':_0x1fc2fb});}catch(_0x367460){const _0x450923=this[_0x376f5f(0x1bb)](_0x367460,_0x1fc2fb);_0x450923&&_0x514d2a[_0x376f5f(0x1fa)](_0x450923);}return _0x514d2a;}async['lintStyles'](_0x4785d9,_0x48314a,_0x386709){const _0x1c14c9=a0_0x3c1b62,_0xd9e7d4=[];try{if(!this['stylelint']){const _0xff9dfb=await import('stylelint');this[_0x1c14c9(0x1cb)]=_0xff9dfb['default'];}const _0xe599a3={'extends':[_0x1c14c9(0x1da)],'rules':{'color-no-invalid-hex':!![],'font-family-no-duplicate-names':!![],'function-calc-no-invalid':!![],'string-no-newline':!![],'unit-no-unknown':!![],'property-no-unknown':!![],'declaration-block-no-duplicate-properties':!![],'selector-pseudo-class-no-unknown':!![],'selector-pseudo-element-no-unknown':!![],'selector-type-no-unknown':[!![],{'ignoreTypes':['/^custom-/','ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x386709===_0x1c14c9(0x1c5)?[!![],{'ignoreAtRules':['mixin','include',_0x1c14c9(0x1e0),'if',_0x1c14c9(0x1dd),'for',_0x1c14c9(0x1e9),'while','function','return',_0x1c14c9(0x1e2),'use','forward']}]:_0x386709===_0x1c14c9(0x1ea)?[!![],{'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':_0x1c14c9(0x1f3),'selector-type-case':_0x1c14c9(0x1dc)},'customSyntax':_0x386709==='scss'?'postcss-scss':_0x386709==='less'?_0x1c14c9(0x1ed):undefined},_0x167417=await this[_0x1c14c9(0x1cb)][_0x1c14c9(0x1f6)]({'code':_0x48314a,'codeFilename':_0x4785d9,'config':_0xe599a3});if(_0x167417[_0x1c14c9(0x1d9)]&&_0x167417[_0x1c14c9(0x1d9)][_0x1c14c9(0x1e1)]>0x0){const _0x65de78=_0x167417[_0x1c14c9(0x1d9)][0x0];if(_0x65de78[_0x1c14c9(0x1c3)])for(const _0x3bb61f of _0x65de78['warnings']){_0xd9e7d4[_0x1c14c9(0x1fa)]({'file':_0x4785d9,'line':_0x3bb61f[_0x1c14c9(0x1cc)]||0x1,'column':_0x3bb61f['column']||0x1,'severity':_0x3bb61f['severity']==='error'?STATIC_ANALYSIS[_0x1c14c9(0x1ba)]['ERROR']:STATIC_ANALYSIS['SEVERITY'][_0x1c14c9(0x1fd)],'rule':_0x3bb61f[_0x1c14c9(0x1be)]||'unknown','message':_0x3bb61f[_0x1c14c9(0x1fb)],'category':this[_0x1c14c9(0x1d7)](_0x3bb61f[_0x1c14c9(0x1be)]),'fixable':![],'source':'stylelint'});}}}catch(_0x1c0582){this['logger']?.['warn']('Stylelint\x20analysis\x20failed',{'file':_0x4785d9,'error':_0x1c0582['message']});}return _0xd9e7d4;}['formatPostCSSError'](_0x136ac6,_0x378624){const _0x200c1c=a0_0x3c1b62;return{'file':_0x378624,'line':_0x136ac6[_0x200c1c(0x1cc)]||0x1,'column':_0x136ac6[_0x200c1c(0x1ca)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x136ac6['name']||_0x200c1c(0x1f4),'message':_0x136ac6[_0x200c1c(0x1c2)]||_0x136ac6['message'],'category':STATIC_ANALYSIS['CATEGORY'][_0x200c1c(0x1e5)],'fixable':![],'source':_0x200c1c(0x1f0),'code':_0x136ac6[_0x200c1c(0x1eb)]||undefined};}[a0_0x3c1b62(0x1d7)](_0x55a969){const _0x5eaf48=a0_0x3c1b62;if(!_0x55a969)return STATIC_ANALYSIS['CATEGORY']['STYLE'];const _0x4de4bc=_0x55a969['toLowerCase']();if(_0x4de4bc['includes'](_0x5eaf48(0x1bf))||_0x4de4bc[_0x5eaf48(0x1c9)](_0x5eaf48(0x1d6))||_0x4de4bc['includes'](_0x5eaf48(0x1fc))||_0x4de4bc[_0x5eaf48(0x1c9)](_0x5eaf48(0x1fe)))return STATIC_ANALYSIS[_0x5eaf48(0x1d0)][_0x5eaf48(0x1e5)];if(_0x4de4bc['includes']('performance')||_0x4de4bc['includes'](_0x5eaf48(0x1c1)))return STATIC_ANALYSIS[_0x5eaf48(0x1d0)][_0x5eaf48(0x1e7)];if(_0x4de4bc['includes']('best-practice')||_0x4de4bc[_0x5eaf48(0x1c9)]('recommended'))return STATIC_ANALYSIS['CATEGORY'][_0x5eaf48(0x1d5)];return STATIC_ANALYSIS['CATEGORY'][_0x5eaf48(0x1bc)];}[a0_0x3c1b62(0x1ff)](_0x43167d){const _0x44072f=a0_0x3c1b62,_0x2fc7c3=_0x43167d[_0x44072f(0x1c6)]();if(_0x2fc7c3[_0x44072f(0x1d2)](_0x44072f(0x1d1))||_0x2fc7c3[_0x44072f(0x1d2)]('.sass'))return _0x44072f(0x1c5);if(_0x2fc7c3[_0x44072f(0x1d2)]('.less'))return'less';return'css';}['getSupportedExtensions'](){const _0x4f4279=a0_0x3c1b62;return[_0x4f4279(0x1e6),'.scss',_0x4f4279(0x1c7),'.less'];}[a0_0x3c1b62(0x1e3)](){return![];}}function a0_0x2137(_0x292efe,_0x7b7589){_0x292efe=_0x292efe-0x1ba;const _0x3f8bb6=a0_0x3f8b();let _0x21374d=_0x3f8bb6[_0x292efe];if(a0_0x2137['nTvEVs']===undefined){var _0x3c1455=function(_0x2aa1d4){const _0x4cf79b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1e8679='',_0x584447='';for(let _0x26ae36=0x0,_0x36eee6,_0x57a8a8,_0x7719b6=0x0;_0x57a8a8=_0x2aa1d4['charAt'](_0x7719b6++);~_0x57a8a8&&(_0x36eee6=_0x26ae36%0x4?_0x36eee6*0x40+_0x57a8a8:_0x57a8a8,_0x26ae36++%0x4)?_0x1e8679+=String['fromCharCode'](0xff&_0x36eee6>>(-0x2*_0x26ae36&0x6)):0x0){_0x57a8a8=_0x4cf79b['indexOf'](_0x57a8a8);}for(let _0x597546=0x0,_0x36880d=_0x1e8679['length'];_0x597546<_0x36880d;_0x597546++){_0x584447+='%'+('00'+_0x1e8679['charCodeAt'](_0x597546)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x584447);};a0_0x2137['CgeVBw']=_0x3c1455,a0_0x2137['kWgVYh']={},a0_0x2137['nTvEVs']=!![];}const _0x4caa06=_0x3f8bb6[0x0],_0x166c18=_0x292efe+_0x4caa06,_0x1b7423=a0_0x2137['kWgVYh'][_0x166c18];return!_0x1b7423?(_0x21374d=a0_0x2137['CgeVBw'](_0x21374d),a0_0x2137['kWgVYh'][_0x166c18]=_0x21374d):_0x21374d=_0x1b7423,_0x21374d;}export default CSSAnalyzer;
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 +1 @@
1
- const a0_0x586458=a0_0x5e58;(function(_0x35c3cd,_0x3c549e){const _0x3644b3=a0_0x5e58,_0x151018=_0x35c3cd();while(!![]){try{const _0x56dc0a=-parseInt(_0x3644b3(0x104))/0x1+parseInt(_0x3644b3(0x11f))/0x2+parseInt(_0x3644b3(0xcc))/0x3+parseInt(_0x3644b3(0xb3))/0x4*(parseInt(_0x3644b3(0xc0))/0x5)+parseInt(_0x3644b3(0x123))/0x6+parseInt(_0x3644b3(0xef))/0x7+-parseInt(_0x3644b3(0xd5))/0x8*(parseInt(_0x3644b3(0xc9))/0x9);if(_0x56dc0a===_0x3c549e)break;else _0x151018['push'](_0x151018['shift']());}catch(_0x45cef7){_0x151018['push'](_0x151018['shift']());}}}(a0_0x3982,0x99c19));function a0_0x5e58(_0x3353b0,_0x35e7fd){_0x3353b0=_0x3353b0-0xb1;const _0x39823a=a0_0x3982();let _0x5e584e=_0x39823a[_0x3353b0];if(a0_0x5e58['Vrotfd']===undefined){var _0x2b98d4=function(_0x4cb4f9){const _0x39b724='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x278bd0='',_0x2551d8='';for(let _0x45eaa1=0x0,_0x276455,_0x31c172,_0x3094d2=0x0;_0x31c172=_0x4cb4f9['charAt'](_0x3094d2++);~_0x31c172&&(_0x276455=_0x45eaa1%0x4?_0x276455*0x40+_0x31c172:_0x31c172,_0x45eaa1++%0x4)?_0x278bd0+=String['fromCharCode'](0xff&_0x276455>>(-0x2*_0x45eaa1&0x6)):0x0){_0x31c172=_0x39b724['indexOf'](_0x31c172);}for(let _0x1b895f=0x0,_0x46bed4=_0x278bd0['length'];_0x1b895f<_0x46bed4;_0x1b895f++){_0x2551d8+='%'+('00'+_0x278bd0['charCodeAt'](_0x1b895f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2551d8);};a0_0x5e58['kZNAMi']=_0x2b98d4,a0_0x5e58['pyFUaE']={},a0_0x5e58['Vrotfd']=!![];}const _0x2e447a=_0x39823a[0x0],_0xacbb97=_0x3353b0+_0x2e447a,_0x1d7a82=a0_0x5e58['pyFUaE'][_0xacbb97];return!_0x1d7a82?(_0x5e584e=a0_0x5e58['kZNAMi'](_0x5e584e),a0_0x5e58['pyFUaE'][_0xacbb97]=_0x5e584e):_0x5e584e=_0x1d7a82,_0x5e584e;}import{exec}from'child_process';import{promisify}from'util';import a0_0x278bd0 from'path';import a0_0x2551d8 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x45eaa1=null){const _0x3ff73a=a0_0x5e58;this[_0x3ff73a(0x114)]=_0x45eaa1,this['availableScanners']=null,this[_0x3ff73a(0xc3)]=new Map();}async['detectAvailableValidators'](){const _0x2cbeb2=a0_0x5e58;if(this[_0x2cbeb2(0xee)]!==null)return this['availableScanners'];const _0x276455={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x2cbeb2(0xdd),{'timeout':0x1388}),_0x276455[_0x2cbeb2(0xe4)]=!![],this['logger']?.[_0x2cbeb2(0xb7)]('checkov\x20detected');}catch(_0x31c172){this['logger']?.[_0x2cbeb2(0xb7)]('checkov\x20not\x20available',{'error':_0x31c172[_0x2cbeb2(0xf8)]});}try{await execAsync(_0x2cbeb2(0xc2),{'timeout':0x1388}),_0x276455[_0x2cbeb2(0xc8)]=!![],this['logger']?.['debug'](_0x2cbeb2(0xe9));}catch(_0x3094d2){this[_0x2cbeb2(0x114)]?.[_0x2cbeb2(0xb7)]('hadolint\x20not\x20available',{'error':_0x3094d2[_0x2cbeb2(0xf8)]});}try{await execAsync(_0x2cbeb2(0xe1),{'timeout':0x1388}),_0x276455['yamllint']=!![],this[_0x2cbeb2(0x114)]?.['debug'](_0x2cbeb2(0x110));}catch(_0x1b895f){this['logger']?.[_0x2cbeb2(0xb7)]('yamllint\x20not\x20available',{'error':_0x1b895f['message']});}try{await import(_0x2cbeb2(0xd6)),_0x276455[_0x2cbeb2(0xbe)]=!![],this['logger']?.['debug']('JSON\x20Schema\x20validation\x20available');}catch(_0x46bed4){this[_0x2cbeb2(0x114)]?.['debug']('ajv\x20not\x20available',{'error':_0x46bed4['message']});}return this['availableScanners']=_0x276455,_0x276455;}async['validate'](_0x2c8ffe,_0x581320={}){const _0x4dd8ea=a0_0x5e58,_0x26a8a7=[],_0x5ebced=await this['detectAvailableValidators'](),_0x53fb3e=this[_0x4dd8ea(0x10d)](_0x2c8ffe);this['logger']?.[_0x4dd8ea(0xb7)](_0x4dd8ea(0xd3),{'filePath':_0x2c8ffe,'fileType':_0x53fb3e});switch(_0x53fb3e){case'dockerfile':if(_0x5ebced[_0x4dd8ea(0xc8)]){const _0x2c6591=await this['validateDockerfile'](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x2c6591);}if(_0x5ebced['checkov']){const _0x192d3c=await this['validateWithCheckov'](_0x2c8ffe,_0x4dd8ea(0x116),_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x192d3c);}break;case _0x4dd8ea(0xfb):if(_0x5ebced[_0x4dd8ea(0xb9)]){const _0x3bb9a1=await this['validateYAML'](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x3bb9a1);}if(_0x5ebced['checkov']){const _0x2881de=await this[_0x4dd8ea(0x11c)](_0x2c8ffe,_0x4dd8ea(0xec),_0x581320);_0x26a8a7['push'](..._0x2881de);}break;case _0x4dd8ea(0xda):if(_0x5ebced['yamllint']){const _0x2b1f14=await this[_0x4dd8ea(0xbc)](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x2b1f14);}if(_0x5ebced[_0x4dd8ea(0xe4)]){const _0x131049=await this['validateWithCheckov'](_0x2c8ffe,_0x4dd8ea(0xda),_0x581320);_0x26a8a7['push'](..._0x131049);}break;case'terraform':if(_0x5ebced[_0x4dd8ea(0xe4)]){const _0x466df5=await this['validateWithCheckov'](_0x2c8ffe,_0x4dd8ea(0xe5),_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x466df5);}break;case'package.json':if(_0x5ebced[_0x4dd8ea(0xbe)]){const _0x4183a8=await this['validatePackageJson'](_0x2c8ffe,_0x581320);_0x26a8a7['push'](..._0x4183a8);}break;case'tsconfig.json':if(_0x5ebced[_0x4dd8ea(0xbe)]){const _0x119ddb=await this[_0x4dd8ea(0xde)](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x119ddb);}break;case'github-actions':if(_0x5ebced[_0x4dd8ea(0xb9)]){const _0x211789=await this[_0x4dd8ea(0xbc)](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x211789);}break;case'env':const _0x2c9863=await this['validateEnvFile'](_0x2c8ffe,_0x581320);_0x26a8a7[_0x4dd8ea(0x117)](..._0x2c9863);break;case'yaml':if(_0x5ebced[_0x4dd8ea(0xb9)]){const _0x54d14b=await this[_0x4dd8ea(0xbc)](_0x2c8ffe,_0x581320);_0x26a8a7['push'](..._0x54d14b);}break;default:this['logger']?.[_0x4dd8ea(0xf9)]('Unknown\x20config\x20file\x20type',{'filePath':_0x2c8ffe,'fileType':_0x53fb3e});return[];}return this['normalizeResults'](_0x26a8a7);}async['validateDockerfile'](_0x1a5460,_0x3821bd={}){const _0x98e1fd=a0_0x5e58;try{const _0x441077=await execAsync(_0x98e1fd(0x101)+_0x1a5460+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x387040=JSON[_0x98e1fd(0xf7)](_0x441077['stdout']);return this[_0x98e1fd(0xf1)](_0x387040,_0x1a5460);}catch(_0x384876){if(_0x384876['stdout'])try{const _0xdce353=JSON[_0x98e1fd(0xf7)](_0x384876['stdout']);return this[_0x98e1fd(0xf1)](_0xdce353,_0x1a5460);}catch(_0x364250){this['logger']?.[_0x98e1fd(0xbf)](_0x98e1fd(0xb8),{'error':_0x364250[_0x98e1fd(0xf8)]});}return this['logger']?.['error'](_0x98e1fd(0xf3),{'error':_0x384876[_0x98e1fd(0xf8)]}),[];}}['parseHadolintResults'](_0x1f32ce,_0x5440b3){const _0x338d94=a0_0x5e58,_0x526d6c=[];if(Array[_0x338d94(0xc1)](_0x1f32ce))for(const _0x51fe12 of _0x1f32ce){_0x526d6c[_0x338d94(0x117)]({'file':_0x5440b3,'line':_0x51fe12[_0x338d94(0xcd)]||0x1,'column':_0x51fe12[_0x338d94(0xdf)]||0x1,'severity':this['mapHadolintSeverity'](_0x51fe12[_0x338d94(0x121)]),'rule':_0x51fe12[_0x338d94(0xc6)],'message':_0x51fe12['message'],'category':'dockerfile','validator':_0x338d94(0xc8)});}return _0x526d6c;}async['validateYAML'](_0x4f6073,_0x2ac88c={}){const _0x1a36f6=a0_0x5e58;try{const _0x49b3b1=await execAsync(_0x1a36f6(0xbd)+_0x4f6073+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x1a36f6(0xf6)](_0x49b3b1['stdout'],_0x4f6073);}catch(_0x5c5e5b){if(_0x5c5e5b['stdout'])return this['parseYamllintResults'](_0x5c5e5b['stdout'],_0x4f6073);return this[_0x1a36f6(0x114)]?.['error']('yamllint\x20validation\x20failed',{'error':_0x5c5e5b['message']}),[];}}[a0_0x586458(0xf6)](_0x2dd4cd,_0x320049){const _0x5bb419=a0_0x586458,_0x1e8965=[],_0x17fcb4=_0x2dd4cd['split']('\x0a')['filter'](_0x86ef3e=>_0x86ef3e[_0x5bb419(0xf2)]());for(const _0x31e3b3 of _0x17fcb4){const _0x5744c8=_0x31e3b3[_0x5bb419(0xb1)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x5744c8){const [,_0x414391,_0x4f6f61,_0x2c4600,_0x3e2b7f,_0x32f189,_0x22c6bb]=_0x5744c8;_0x1e8965['push']({'file':_0x320049,'line':parseInt(_0x4f6f61,0xa),'column':parseInt(_0x2c4600,0xa),'severity':this['mapYamllintSeverity'](_0x3e2b7f),'rule':_0x22c6bb,'message':_0x32f189,'category':_0x5bb419(0xd2),'validator':'yamllint'});}}return _0x1e8965;}async['validateWithCheckov'](_0x3ae2de,_0x51f4b7,_0x25229e={}){const _0x279510=a0_0x586458;try{const _0x2d4455=await execAsync(_0x279510(0x11a)+_0x3ae2de+'\x22\x20--framework\x20'+_0x51f4b7+_0x279510(0xe2),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x41125b=JSON['parse'](_0x2d4455[_0x279510(0xeb)]);return this[_0x279510(0x120)](_0x41125b,_0x3ae2de);}catch(_0x557347){if(_0x557347['stdout'])try{const _0x54b49b=JSON['parse'](_0x557347['stdout']);return this[_0x279510(0x120)](_0x54b49b,_0x3ae2de);}catch(_0x1dca15){this['logger']?.[_0x279510(0xbf)]('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x1dca15['message']});}return this[_0x279510(0x114)]?.['error']('checkov\x20validation\x20failed',{'error':_0x557347[_0x279510(0xf8)]}),[];}}['parseCheckovResults'](_0x23afb8,_0x154a11){const _0x5d3893=a0_0x586458,_0x15f5b2=[];if(_0x23afb8[_0x5d3893(0xfe)]&&_0x23afb8['results'][_0x5d3893(0xb4)])for(const _0x2552d4 of _0x23afb8['results']['failed_checks']){_0x15f5b2[_0x5d3893(0x117)]({'file':_0x154a11,'line':_0x2552d4[_0x5d3893(0xd4)]?_0x2552d4['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x2552d4[_0x5d3893(0x11e)]),'rule':_0x2552d4[_0x5d3893(0x124)],'message':_0x2552d4['check_name']||_0x2552d4[_0x5d3893(0x124)],'category':'security','validator':_0x5d3893(0xe4),'remediation':_0x2552d4['guideline'],'cwe':_0x2552d4['cwe'],'references':_0x2552d4[_0x5d3893(0xb5)]?[_0x2552d4['guideline']]:[]});}return _0x15f5b2;}async[a0_0x586458(0x106)](_0x59a5de,_0x2205f6={}){const _0x599357=a0_0x586458;try{const _0x3e7ef6=(await import('ajv'))[_0x599357(0xfc)],_0x352c42=(await import(_0x599357(0xdb)))[_0x599357(0xfc)],_0x3366da=await a0_0x2551d8['readFile'](_0x59a5de,'utf-8'),_0x5ca12d=JSON[_0x599357(0xf7)](_0x3366da),_0x7c7171=new _0x3e7ef6({'allErrors':!![],'strict':![]});_0x352c42(_0x7c7171);const _0x1e4e57={'type':'object','required':['name','version'],'properties':{'name':{'type':_0x599357(0x11b),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':_0x599357(0x11b)},'main':{'type':'string'},'type':{'type':_0x599357(0x11b),'enum':['module','commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x599357(0x112)},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0x250206=_0x7c7171[_0x599357(0x107)](_0x1e4e57),_0x47e0ae=_0x250206(_0x5ca12d);if(!_0x47e0ae&&_0x250206['errors'])return _0x250206['errors']['map'](_0x7d432a=>({'file':_0x59a5de,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x599357(0x109)][_0x599357(0xc5)],'rule':_0x599357(0x118),'message':_0x7d432a['instancePath']?_0x7d432a[_0x599357(0xd7)]+'\x20'+_0x7d432a['message']:_0x599357(0xb6)+_0x7d432a[_0x599357(0x108)][_0x599357(0x10b)]+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x1d6da4){return this['logger']?.['error']('package.json\x20validation\x20failed',{'error':_0x1d6da4[_0x599357(0xf8)]}),[{'file':_0x59a5de,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x599357(0xc5)],'rule':_0x599357(0xbb),'message':'Invalid\x20JSON:\x20'+_0x1d6da4[_0x599357(0xf8)],'category':'syntax','validator':_0x599357(0xbb)}];}}async[a0_0x586458(0xde)](_0xb4ec7b,_0xd9e96a={}){const _0x374b7b=a0_0x586458;try{const _0x17d492=await a0_0x2551d8['readFile'](_0xb4ec7b,_0x374b7b(0xea)),_0x5df003=JSON['parse'](_0x17d492),_0x938cdb=[];if(_0x5df003[_0x374b7b(0xcb)]){const _0x28664e=_0x5df003[_0x374b7b(0xcb)];!_0x28664e['strict']&&_0x938cdb[_0x374b7b(0x117)]({'file':_0xb4ec7b,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x374b7b(0x109)]['WARNING'],'rule':'strict-mode','message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'}),_0x28664e['noImplicitAny']===![]&&_0x938cdb[_0x374b7b(0x117)]({'file':_0xb4ec7b,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x374b7b(0x109)]['WARNING'],'rule':_0x374b7b(0xd9),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x938cdb;}catch(_0x107f2d){return this[_0x374b7b(0x114)]?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0x107f2d['message']}),[{'file':_0xb4ec7b,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x374b7b(0xc5)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x107f2d['message'],'category':_0x374b7b(0xb2),'validator':'json-parse'}];}}async['validateEnvFile'](_0x44e354,_0x1adef2={}){const _0x20e14f=a0_0x586458;try{const _0x2ba652=await a0_0x2551d8[_0x20e14f(0xba)](_0x44e354,_0x20e14f(0xea)),_0x4c5eca=[],_0x16b553=_0x2ba652[_0x20e14f(0x119)]('\x0a'),_0x1ac4cd=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':_0x20e14f(0xd8)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x16b553[_0x20e14f(0xfa)]((_0x445543,_0x44be88)=>{const _0xe563b=_0x20e14f,_0x12c713=_0x445543[_0xe563b(0xf2)]();if(!_0x12c713||_0x12c713[_0xe563b(0xd0)]('#'))return;if(_0x12c713[_0xe563b(0x113)]('=')){const [_0x529fff,_0x34176]=_0x12c713['split']('='),_0x79c175=_0x529fff['toLowerCase'](),_0x20def7=_0x34176?.[_0xe563b(0xf2)]()||'',_0x2fe992=_0x20def7&&_0x20def7!==''&&!_0x20def7[_0xe563b(0xd0)]('$')&&_0x20def7!=='your-key-here'&&_0x20def7!=='changeme'&&_0x20def7[_0xe563b(0xf0)]>0x5;if(_0x2fe992)for(const {pattern:_0x53fdf6,name:_0x2692c5}of _0x1ac4cd){if(_0x53fdf6['test'](_0x79c175)){_0x4c5eca[_0xe563b(0x117)]({'file':_0x44e354,'line':_0x44be88+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xe563b(0x109)][_0xe563b(0xdc)],'rule':_0xe563b(0x10f),'message':_0xe563b(0x105)+_0x2692c5+'\x20detected\x20in\x20.env\x20file','category':_0xe563b(0x10e),'validator':'env-validator','remediation':_0xe563b(0x103)});break;}}}}),_0x4c5eca;}catch(_0x6e73f4){return this['logger']?.[_0x20e14f(0xbf)](_0x20e14f(0xed),{'error':_0x6e73f4['message']}),[];}}['detectFileType'](_0x887416){const _0x22cecb=a0_0x586458,_0x4100fe=a0_0x278bd0[_0x22cecb(0xe0)](_0x887416)['toLowerCase'](),_0x335a8c=a0_0x278bd0[_0x22cecb(0xf5)](_0x887416);if(_0x4100fe==='dockerfile')return'dockerfile';if(_0x4100fe===_0x22cecb(0xce)||_0x4100fe==='docker-compose.yaml')return _0x22cecb(0xfb);if(_0x4100fe==='package.json')return _0x22cecb(0xf4);if(_0x4100fe===_0x22cecb(0x100))return _0x22cecb(0x100);if(_0x4100fe===_0x22cecb(0x122)||_0x4100fe['endsWith'](_0x22cecb(0x122)))return'env';if(_0x335a8c[_0x22cecb(0x113)](_0x22cecb(0x11d)))return'github-actions';if(_0x335a8c[_0x22cecb(0x113)](_0x22cecb(0xda))||_0x335a8c[_0x22cecb(0x113)]('k8s'))return _0x22cecb(0xda);const _0x506dec=a0_0x278bd0['extname'](_0x887416)[_0x22cecb(0x102)]();if(_0x506dec==='.tf'||_0x506dec==='.tfvars')return'terraform';if(_0x506dec===_0x22cecb(0xc4)||_0x506dec===_0x22cecb(0xe8))return'yaml';if(_0x506dec===_0x22cecb(0x125))return'json';return'unknown';}['normalizeResults'](_0x1f9c26){const _0x5a3244=a0_0x586458;return _0x1f9c26[_0x5a3244(0x10a)](_0x3b48d1=>({'file':_0x3b48d1['file'],'line':_0x3b48d1['line']||0x1,'column':_0x3b48d1['column']||0x1,'severity':_0x3b48d1[_0x5a3244(0xfd)]||STATIC_ANALYSIS['SEVERITY'][_0x5a3244(0x111)],'rule':_0x3b48d1['rule']||'unknown','message':_0x3b48d1[_0x5a3244(0xf8)]||'Validation\x20issue\x20detected','category':_0x3b48d1['category']||'validation','validator':_0x3b48d1['validator'],'cwe':_0x3b48d1['cwe']||null,'remediation':_0x3b48d1['remediation']||null,'references':_0x3b48d1[_0x5a3244(0xca)]||[]}));}[a0_0x586458(0xe3)](_0x41d322){const _0x3cd5cd=a0_0x586458,_0x1820f5={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x3cd5cd(0x109)]['WARNING'],'info':STATIC_ANALYSIS[_0x3cd5cd(0x109)]['INFO'],'style':STATIC_ANALYSIS['SEVERITY'][_0x3cd5cd(0xe7)]};return _0x1820f5[_0x41d322?.[_0x3cd5cd(0x102)]()]||STATIC_ANALYSIS['SEVERITY'][_0x3cd5cd(0x111)];}['mapYamllintSeverity'](_0x578cb1){const _0x191604=a0_0x586458,_0x2dee29={'error':STATIC_ANALYSIS[_0x191604(0x109)]['ERROR'],'warning':STATIC_ANALYSIS[_0x191604(0x109)]['WARNING']};return _0x2dee29[_0x578cb1?.[_0x191604(0x102)]()]||STATIC_ANALYSIS[_0x191604(0x109)]['WARNING'];}['mapCheckovSeverity'](_0x4bd7fc){const _0x20ac25=a0_0x586458;return STATIC_ANALYSIS[_0x20ac25(0x109)][_0x20ac25(0xc5)];}async['getValidatorStatus'](){const _0x29111c=a0_0x586458,_0x5bea5d=await this[_0x29111c(0xe6)]();return{'validators':_0x5bea5d,'recommendations':this['getInstallRecommendations'](_0x5bea5d)};}[a0_0x586458(0xcf)](_0x4039fd){const _0x17ca34=a0_0x586458,_0x5b1c4b=[];return!_0x4039fd['checkov']&&_0x5b1c4b['push']({'validator':_0x17ca34(0xe4),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':_0x17ca34(0xff),'priority':'high'}),!_0x4039fd['hadolint']&&_0x5b1c4b['push']({'validator':_0x17ca34(0xc8),'reason':_0x17ca34(0x115),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x4039fd[_0x17ca34(0xb9)]&&_0x5b1c4b['push']({'validator':_0x17ca34(0xb9),'reason':_0x17ca34(0xc7),'install':'pip\x20install\x20yamllint','priority':_0x17ca34(0x10c)}),!_0x4039fd['jsonSchema']&&_0x5b1c4b[_0x17ca34(0x117)]({'validator':'ajv\x20(JSON\x20Schema)','reason':'JSON\x20configuration\x20validation','install':_0x17ca34(0xd1),'priority':_0x17ca34(0x10c)}),_0x5b1c4b;}}export default ConfigValidator;function a0_0x3982(){const _0x4bb5ce=['C2vJDxjPDhK','AgfYzgnVzgvKlxnLy3jLDa','EwfTBgXPBNqGzgv0zwn0zwq','v0fstKLorW','B2jQzwn0','Aw5JBhvKzxm','Bg9Nz2vY','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','zg9JA2vYzMLSzq','ChvZAa','ANnVBI1Zy2HLBwe','C3bSAxq','y2HLy2TVDIaTzIaI','C3rYAw5N','DMfSAwrHDgvxAxrOq2HLy2TVDG','lMDPDgH1yI93B3jRzMXVD3m','y2HLy2TFy2XHC3m','mJiWndKYmKrxCLrnua','CgfYC2vdAgvJA292uMvZDwX0CW','Bgv2zwW','lMvUDG','mta3mZy1mNzNDfH1vq','y2HLy2TFAwq','lMPZB24','Bwf0y2G','C3LUDgf4','nejiweLrsa','zMfPBgvKx2nOzwnRCW','z3vPzgvSAw5L','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','zgvIDwC','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','EwfTBgXPBNq','CMvHzezPBgu','ANnVBI1WyxjZzq','DMfSAwrHDgvzqu1m','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','ANnVBLnJAgvTyq','zxjYB3i','mZq5mJC1uM1zwLzJ','AxnbCNjHEq','AgfKB2XPBNqGls12zxjZAw9U','C2nHBM5LCKnHy2HL','lNLTBa','rvjst1i','y29Kzq','wufntcbMAwXLihzHBgLKyxrPB24','AgfKB2XPBNq','ntuYodDWtxfdD3a','CMvMzxjLBMnLCW','y29TCgLSzxjpChrPB25Z','nJy0nde2qwjeCK9m','BgLUzq','zg9JA2vYlwnVBxbVC2uUEw1S','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','C3rHCNrZv2L0Aa','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','EwfTBa','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','zMLSzv9SAw5Lx3jHBMDL','mty2nfn2rurlta','ywP2','Aw5ZDgfUy2vqyxrO','ChjPDMf0zsbRzxK','BM8TAw1WBgLJAxqTyw55','A3vIzxjUzxrLCW','ywP2lwzVCM1HDhm','q1jjveLdquW','y2HLy2TVDIaTlxzLCNnPB24','DMfSAwrHDgvuC0nVBMzPzW','y29SDw1U','yMfZzw5HBwu','EwfTBgXPBNqGls12zxjZAw9U','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','BwfWsgfKB2XPBNrtzxzLCML0Eq','y2HLy2TVDG','DgvYCMfMB3jT','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','su5gtW','lNLHBwW','AgfKB2XPBNqGzgv0zwn0zwq','DxrMltG','C3rKB3v0','zg9JA2vYx2nVBxbVC2u','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','yxzHAwXHyMXLu2nHBM5LCNm','ntu3mJm3ohDpvxfusW','BgvUz3rO','CgfYC2viywrVBgLUDfjLC3vSDhm','DhjPBq','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','CgfJA2fNzs5QC29U','zgLYBMfTzq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','CgfYC2u','BwvZC2fNzq','D2fYBG','zM9YrwfJAa','zg9JA2vYlwnVBxbVC2u','zgvMyxvSDa','C2v2zxjPDhK','CMvZDwX0CW','CgLWigLUC3rHBgWGy2HLy2TVDG','DhnJB25MAwCUANnVBG','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','Dg9mB3DLCKnHC2u','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','ndyXmJu1BKj3A0vL','ug90zw50AwfSigHHCMrJB2rLzca','DMfSAwrHDgvqywnRywDLsNnVBG','y29TCgLSzq','CgfYyw1Z','u0vwrvjjvfK','BwfW','BwLZC2LUz1bYB3bLCNr5','BwvKAxvT','zgv0zwn0rMLSzvr5Cgu'];a0_0x3982=function(){return _0x4bb5ce;};return a0_0x3982();}
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 +1 @@
1
- const a0_0x2c0877=a0_0x8d56;(function(_0x13b8fd,_0x5c0200){const _0x3dfffa=a0_0x8d56,_0xae9b3a=_0x13b8fd();while(!![]){try{const _0x1f5898=-parseInt(_0x3dfffa(0x1a1))/0x1*(-parseInt(_0x3dfffa(0x1a2))/0x2)+-parseInt(_0x3dfffa(0x1b2))/0x3+parseInt(_0x3dfffa(0x18b))/0x4+-parseInt(_0x3dfffa(0x187))/0x5+parseInt(_0x3dfffa(0x19c))/0x6+parseInt(_0x3dfffa(0x19a))/0x7+-parseInt(_0x3dfffa(0x177))/0x8;if(_0x1f5898===_0x5c0200)break;else _0xae9b3a['push'](_0xae9b3a['shift']());}catch(_0x2006e0){_0xae9b3a['push'](_0xae9b3a['shift']());}}}(a0_0x3d01,0x3a1d4));import{ESLint}from'eslint';import a0_0x8ec45d from'path';function a0_0x3d01(){const _0x1f182f=['u1rzteu','zxjYB3i','nJa5nZiZr1jtCML2','BM8TzxzHBa','rvnmAw50igfUywX5C2LZignVBxbSzxrLza','Bw9KAwzPzwq','BM8TDMfY','ywnJzxnZ','mtmZmdi1nK5PB2zHzq','lMnQCW','q0furuDpuLK','v0fstKLorW','ywX3yxLZ','uevsrK9stufoq0u','lMvZBgLUDhjJlMPZB24','y2f0zwDVCML6zvj1Bgu','rvnmAw50igzPEcbMywLSzwq','u0vdvvjjvfK','rvjst1i','BM8TAw1WBgLLzc1LDMfS','C2v2zxjPDhK','u0vwrvjjvfK','zM9YBwf0twvZC2fNzq','rM91BMqGrvnmAw50ignVBMzPzW','mtm4mJi0nuXuEuPuqq','AM9PBG','CNvSzuLK','Aw5JBhvKzxm','mtyZmduYne1JqwnUua','C2LUz2XL','zxnSAw50lMnVBMzPzY5QCW','Bwf4','BwvZC2fNzq','z2v0rvnmAw50sw5ZDgfUy2u','BgvUz3rO','C2v0DgLUz3m','ywrKzwq','zML4ywjSzuvYCM9Yq291BNq','zgv0zwn0','BgLUDfrLEhq','D2fYBG','rvnmAw50igzPEcbMywLSzwq6ia','zML4ywjSzvDHCM5PBMDdB3vUDa','mtaXntmYmNrTBLHKsa','zxH0zw5KCW','mtC2mJm5mLfZyuryrq','zxnSAw50oNjLy29TBwvUzgvK','zMLSDgvY','zw5Kq29SDw1U','BwvZC2fNzxm','odnfz1nlA08','ota2A29gzKLl','zwnTyuzLyxr1CMvZ','zML4','C3vWCg9YDhnbDxrVrML4','zxnSAw50q2fJAgu','lMPZEa','CMvHy3q','C2vJDxjPDhK','yw5HBhL6zq','qKvtvf9quKfdveLdrq','yMvZDc1WCMfJDgLJzxm','Bg9Nz2vY','zxnSAw50','zxjYB3jdB3vUDa'];a0_0x3d01=function(){return _0x1f182f;};return a0_0x3d01();}import a0_0x5a4115 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x3d70b3=null){const _0x3ae2e8=a0_0x8d56;this[_0x3ae2e8(0x1ad)]=_0x3d70b3,this[_0x3ae2e8(0x1a6)]=new Map();}async[a0_0x2c0877(0x1aa)](_0x92e208,_0x1022ac,_0x2b101a={}){const _0x202b33=a0_0x2c0877;try{const _0x2b9b9e=await this['getESLintInstance'](_0x2b101a),_0x431352=await _0x2b9b9e[_0x202b33(0x196)](_0x1022ac,{'filePath':_0x92e208,'warnIgnored':![]}),_0x3fc518=[];if(_0x431352&&_0x431352['length']>0x0){const _0x5e20e4=_0x431352[0x0];for(const _0x5dd528 of _0x5e20e4[_0x202b33(0x1a0)]){_0x3fc518['push'](this['formatMessage'](_0x5dd528,_0x92e208));}}return this['logger']?.['debug'](_0x202b33(0x1b4),{'file':_0x92e208,'totalDiagnostics':_0x3fc518['length'],'errors':_0x3fc518[_0x202b33(0x19e)](_0x4783ce=>_0x4783ce[_0x202b33(0x183)]===STATIC_ANALYSIS['SEVERITY'][_0x202b33(0x181)])['length'],'warnings':_0x3fc518[_0x202b33(0x19e)](_0xbf0564=>_0xbf0564['severity']===STATIC_ANALYSIS['SEVERITY'][_0x202b33(0x17a)])[_0x202b33(0x191)]}),_0x3fc518;}catch(_0x814040){return this['logger']?.['error']('ESLint\x20analysis\x20failed',{'file':_0x92e208,'error':_0x814040[_0x202b33(0x18f)]}),[];}}async[a0_0x2c0877(0x1a4)](_0x2a3a51,_0x2fab4a,_0x56e825={}){const _0x43728f=a0_0x2c0877;try{const _0x5dc4f2=await this['getESLintInstance']({..._0x56e825,'fix':!![]}),_0x22bb7f=await _0x5dc4f2[_0x43728f(0x196)](_0x2fab4a,{'filePath':_0x2a3a51,'warnIgnored':![]});if(_0x22bb7f&&_0x22bb7f[_0x43728f(0x191)]>0x0){const _0x3d8fa0=_0x22bb7f[0x0];return{'fixed':_0x3d8fa0['output']!==undefined,'content':_0x3d8fa0['output']||_0x2fab4a,'fixedCount':_0x3d8fa0['fixableErrorCount']+_0x3d8fa0['fixableWarningCount'],'remainingErrors':_0x3d8fa0[_0x43728f(0x1af)]-_0x3d8fa0[_0x43728f(0x194)],'remainingWarnings':_0x3d8fa0['warningCount']-_0x3d8fa0[_0x43728f(0x199)],'changes':_0x3d8fa0['output']?this['describeChanges'](_0x2fab4a,_0x3d8fa0['output']):[]};}return{'fixed':![],'content':_0x2fab4a,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x23bd22){this[_0x43728f(0x1ad)]?.[_0x43728f(0x1b1)](_0x43728f(0x17f),{'file':_0x2a3a51,'error':_0x23bd22['message']});throw new Error(_0x43728f(0x198)+_0x23bd22['message']);}}async[a0_0x2c0877(0x190)](_0x504db9={}){const {workingDir:_0x199311,fix:fix=![],framework:_0x534ccd}=_0x504db9,_0x5989b1=await this['getESLintConfig'](_0x199311,_0x534ccd),_0x343f58=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x5989b1,'errorOnUnmatchedPattern':![]});return _0x343f58;}async['getESLintConfig'](_0x5673be,_0x132fe4){const _0x130ad0=a0_0x2c0877,_0x370ca8={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':'latest','sourceType':'module'},'rules':{'no-unused-vars':'warn','no-undef':'error','no-console':'off','semi':[_0x130ad0(0x197),_0x130ad0(0x17b)],'quotes':['warn',_0x130ad0(0x18c),{'avoidEscape':!![]}]}};if(_0x132fe4===_0x130ad0(0x1a8))_0x370ca8['extends']=[_0x130ad0(0x19d)],_0x370ca8['parserOptions'][_0x130ad0(0x1a3)]={'jsx':!![]},_0x370ca8[_0x130ad0(0x192)]={'react':{'version':_0x130ad0(0x195)}};else _0x132fe4==='vue'?_0x370ca8[_0x130ad0(0x19b)]=['eslint:recommended']:_0x370ca8['extends']=[_0x130ad0(0x19d)];if(_0x5673be){const _0x4e1c13=['.eslintrc.js','.eslintrc.cjs',_0x130ad0(0x17d),_0x130ad0(0x18d)];for(const _0x4cf663 of _0x4e1c13){try{const _0x2d3d5=a0_0x8ec45d[_0x130ad0(0x188)](_0x5673be,_0x4cf663);return await a0_0x5a4115[_0x130ad0(0x176)](_0x2d3d5),this['logger']?.['debug'](_0x130ad0(0x186),{'configFile':_0x4cf663}),{};}catch{}}}return _0x370ca8;}[a0_0x2c0877(0x185)](_0x54dbda,_0x4528f4){const _0x169436=a0_0x2c0877;return{'file':_0x4528f4,'line':_0x54dbda['line']||0x1,'column':_0x54dbda['column']||0x1,'endLine':_0x54dbda['endLine'],'endColumn':_0x54dbda[_0x169436(0x19f)],'severity':_0x54dbda['severity']===0x2?STATIC_ANALYSIS[_0x169436(0x184)]['ERROR']:STATIC_ANALYSIS[_0x169436(0x184)]['WARNING'],'rule':_0x54dbda[_0x169436(0x189)]||'eslint','message':_0x54dbda[_0x169436(0x18f)],'category':this[_0x169436(0x17e)](_0x54dbda[_0x169436(0x189)]),'fixable':_0x54dbda['fix']!==undefined,'source':_0x169436(0x1ae)};}['categorizeRule'](_0x49ba85){const _0x251e66=a0_0x2c0877;if(!_0x49ba85)return STATIC_ANALYSIS[_0x251e66(0x179)][_0x251e66(0x1b0)];if(_0x49ba85['includes'](_0x251e66(0x1a9))||_0x49ba85['includes']('xss')||_0x49ba85===_0x251e66(0x1b3)||_0x49ba85===_0x251e66(0x182))return STATIC_ANALYSIS['CATEGORY'][_0x251e66(0x180)];if(_0x49ba85['includes']('performance')||_0x49ba85==='no-await-in-loop'||_0x49ba85==='prefer-promise-reject-errors')return STATIC_ANALYSIS[_0x251e66(0x179)][_0x251e66(0x17c)];if(_0x49ba85[_0x251e66(0x18a)]('import')||_0x49ba85==='no-undef')return STATIC_ANALYSIS['CATEGORY']['IMPORT'];if(_0x49ba85[_0x251e66(0x18a)](_0x251e66(0x1ac))||_0x49ba85==='no-unused-vars'||_0x49ba85==='no-unreachable'||_0x49ba85===_0x251e66(0x175))return STATIC_ANALYSIS['CATEGORY'][_0x251e66(0x1ab)];return STATIC_ANALYSIS[_0x251e66(0x179)][_0x251e66(0x1b0)];}['describeChanges'](_0x576617,_0x3ea0e7){const _0x44a2c9=a0_0x2c0877,_0x2657ef=[],_0x559f82=_0x576617['split']('\x0a'),_0x4bf76e=_0x3ea0e7['split']('\x0a'),_0x5bf60c=Math[_0x44a2c9(0x18e)](_0x559f82[_0x44a2c9(0x191)],_0x4bf76e[_0x44a2c9(0x191)]);for(let _0x1d061e=0x0;_0x1d061e<_0x5bf60c;_0x1d061e++){const _0x244097=_0x559f82[_0x1d061e]||'',_0x3da4f9=_0x4bf76e[_0x1d061e]||'';_0x244097!==_0x3da4f9&&_0x2657ef['push']({'line':_0x1d061e+0x1,'type':_0x244097&&_0x3da4f9?_0x44a2c9(0x174):_0x244097?'removed':_0x44a2c9(0x193),'original':_0x244097,'fixed':_0x3da4f9});}return _0x2657ef;}['getSupportedExtensions'](){const _0x41ee88=a0_0x2c0877;return['.js',_0x41ee88(0x1a7),'.mjs',_0x41ee88(0x178)];}[a0_0x2c0877(0x1a5)](){return!![];}}function a0_0x8d56(_0x15102e,_0x53a2c3){_0x15102e=_0x15102e-0x174;const _0x3d011d=a0_0x3d01();let _0x8d5600=_0x3d011d[_0x15102e];if(a0_0x8d56['RtdDfn']===undefined){var _0x4a5244=function(_0x7367f1){const _0x307821='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x8ec45d='',_0x5a4115='';for(let _0x3d70b3=0x0,_0x92e208,_0x1022ac,_0x2b101a=0x0;_0x1022ac=_0x7367f1['charAt'](_0x2b101a++);~_0x1022ac&&(_0x92e208=_0x3d70b3%0x4?_0x92e208*0x40+_0x1022ac:_0x1022ac,_0x3d70b3++%0x4)?_0x8ec45d+=String['fromCharCode'](0xff&_0x92e208>>(-0x2*_0x3d70b3&0x6)):0x0){_0x1022ac=_0x307821['indexOf'](_0x1022ac);}for(let _0x2b9b9e=0x0,_0x431352=_0x8ec45d['length'];_0x2b9b9e<_0x431352;_0x2b9b9e++){_0x5a4115+='%'+('00'+_0x8ec45d['charCodeAt'](_0x2b9b9e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5a4115);};a0_0x8d56['KvcBnK']=_0x4a5244,a0_0x8d56['RRXxBy']={},a0_0x8d56['RtdDfn']=!![];}const _0x4f19ba=_0x3d011d[0x0],_0x175d84=_0x15102e+_0x4f19ba,_0x292f14=a0_0x8d56['RRXxBy'][_0x175d84];return!_0x292f14?(_0x8d5600=a0_0x8d56['KvcBnK'](_0x8d5600),a0_0x8d56['RRXxBy'][_0x175d84]=_0x8d5600):_0x8d5600=_0x292f14,_0x8d5600;}export default ESLintAnalyzer;
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;