@loxia-labs/loxia-autopilot-one 1.0.3 → 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 +2 -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_0x492338=a0_0x49db;(function(_0x167f21,_0x308583){const _0x3d2206=a0_0x49db,_0x4ef4c8=_0x167f21();while(!![]){try{const _0x2b2a81=-parseInt(_0x3d2206(0xb9))/0x1*(-parseInt(_0x3d2206(0xa5))/0x2)+parseInt(_0x3d2206(0xc9))/0x3*(-parseInt(_0x3d2206(0xba))/0x4)+-parseInt(_0x3d2206(0xb2))/0x5*(-parseInt(_0x3d2206(0x95))/0x6)+-parseInt(_0x3d2206(0xa8))/0x7*(parseInt(_0x3d2206(0xbf))/0x8)+parseInt(_0x3d2206(0xa2))/0x9+-parseInt(_0x3d2206(0xc4))/0xa+parseInt(_0x3d2206(0xad))/0xb;if(_0x2b2a81===_0x308583)break;else _0x4ef4c8['push'](_0x4ef4c8['shift']());}catch(_0x334588){_0x4ef4c8['push'](_0x4ef4c8['shift']());}}}(a0_0xcebc,0x85ca9));import{fileURLToPath}from'url';import{dirname,join}from'path';function a0_0xcebc(){const _0x565fcf=['argv','7815230JjafYS','Loxia\x20Autopilot\x20One\x20v','--host','unref','message','461331nIFRVl','length','--help','Server\x20running\x20at\x20','Starting\x20Terminal\x20UI...\x0a','setTimeout',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','utf8','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','http://','port','ceil','darwin','toString','\x0aServer\x20is\x20not\x20running\x20at\x20','destroy','--port','\x0aPlease\x20start\x20the\x20server\x20first:','--version','parse','ignore','1554684yCNCVz','src','start\x20\x22\x22\x20\x22','Waiting\x20for\x20server\x20to\x20start...','platform','get','Error:','env','host','win32','SIGTERM','exit','open\x20\x22','947394bNYQrc','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','version','27554HLSbZv','Checking\x20if\x20server\x20is\x20running...','package.json','70PPsOzD','xdg-open\x20\x22','LOXIA_HOST','Starting\x20Loxia\x20server\x20in\x20background...','web','14525731CniZFl','localhost','inherit','includes','SIGINT','5EcOEdY','kill','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','log','\x0aOpening\x20Web\x20UI\x20at\x20','error','Starting\x20Loxia\x20server...\x0a','34VODEBi','4bCeQKV','index.js','Server\x20is\x20running\x20at\x20','\x0aShutting\x20down\x20server...','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','536008iHaCeG','catch','\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','statusCode'];a0_0xcebc=function(){return _0x565fcf;};return a0_0xcebc();}import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x3656e4 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x492338(0xae),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x492338(0xc3)]['slice'](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x492338(0xb0)](a0_0x492338(0xcb))||args['includes']('-h'),'version':args[a0_0x492338(0xb0)](a0_0x492338(0xdb))||args[a0_0x492338(0xb0)]('-v')};for(let i=0x0;i<args[a0_0x492338(0xca)];i++){args[i]===a0_0x492338(0xd9)&&args[i+0x1]&&(flags[a0_0x492338(0xd3)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x492338(0xc6)&&args[i+0x1]&&(flags[a0_0x492338(0x9d)]=args[i+0x1]);}const port=flags[a0_0x492338(0xd3)]||DEFAULT_PORT,host=flags['host']||DEFAULT_HOST,serverUrl=a0_0x492338(0xd2)+host+':'+port;function a0_0x49db(_0x215c34,_0x330d43){_0x215c34=_0x215c34-0x93;const _0xcebc03=a0_0xcebc();let _0x49db4b=_0xcebc03[_0x215c34];return _0x49db4b;}if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x492338(0xa7)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x492338(0xd0)));console[a0_0x492338(0xb5)](a0_0x492338(0xc5)+pkg[a0_0x492338(0xa4)]),process[a0_0x492338(0xa0)](0x0);}if(flags['help']||!command){const pkgPath=join(__dirname,'..',a0_0x492338(0xa7)),pkg=JSON[a0_0x492338(0x93)](readFileSync(pkgPath,'utf8'));console[a0_0x492338(0xb5)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x492338(0xa4)]+a0_0x492338(0xc1)+DEFAULT_PORT+a0_0x492338(0xcf)+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_0x492338(0xa0)](0x0);}async function checkServerRunning(_0x2c56df,_0x4dbe06,_0x397bfe=0x1){for(let _0x5c1542=0x0;_0x5c1542<_0x397bfe;_0x5c1542++){const _0x5116dc=await new Promise(_0x1b4700=>{const _0x5a9594=a0_0x49db,_0xa6b477=a0_0x3656e4[_0x5a9594(0x9a)]('http://'+_0x2c56df+':'+_0x4dbe06+'/api/health',_0x4c92d4=>{const _0x323b86=_0x5a9594;_0x1b4700(_0x4c92d4[_0x323b86(0xc2)]===0xc8);});_0xa6b477['on'](_0x5a9594(0xb7),()=>_0x1b4700(![])),_0xa6b477[_0x5a9594(0xce)](0x7d0,()=>{const _0x57b17d=_0x5a9594;_0xa6b477[_0x57b17d(0xd8)](),_0x1b4700(![]);});});if(_0x5116dc)return!![];_0x5c1542<_0x397bfe-0x1&&await new Promise(_0x180b97=>setTimeout(_0x180b97,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x423761,_0x31a991,_0x265b9c=SERVER_STARTUP_TIMEOUT){const _0x240a17=a0_0x492338,_0x73969a=Math[_0x240a17(0xd4)](_0x265b9c/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x423761,_0x31a991,_0x73969a);}function openBrowser(_0x32622a){const _0x35d70a=a0_0x492338,_0x2c763e=process[_0x35d70a(0x99)];let _0x586647;if(_0x2c763e===_0x35d70a(0xd5))_0x586647=_0x35d70a(0xa1)+_0x32622a+'\x22';else _0x2c763e===_0x35d70a(0x9e)?_0x586647=_0x35d70a(0x97)+_0x32622a+'\x22':_0x586647=_0x35d70a(0xa9)+_0x32622a+'\x22';exec(_0x586647,_0x3d6bbb=>{const _0xe787a4=_0x35d70a;_0x3d6bbb&&(console[_0xe787a4(0xb5)]('Could\x20not\x20open\x20browser\x20automatically.'),console['log']('Please\x20open\x20manually:\x20'+_0x32622a));});}function startServer(_0x84d5e2=![]){const _0x38e80b=a0_0x492338,_0xe8546d={...process[_0x38e80b(0x9c)],'LOXIA_PORT':port[_0x38e80b(0xd6)](),'PORT':port[_0x38e80b(0xd6)]()};flags[_0x38e80b(0x9d)]&&(_0xe8546d[_0x38e80b(0xaa)]=flags['host']);const _0x52851b=join(__dirname,'..',_0x38e80b(0x96),_0x38e80b(0xbb)),_0x111ecc=spawn('node',[_0x52851b],{'cwd':join(__dirname,'..'),'env':_0xe8546d,'stdio':_0x84d5e2?[_0x38e80b(0x94),'ignore','ignore']:'inherit','detached':_0x84d5e2});return _0x84d5e2&&_0x111ecc[_0x38e80b(0xc7)](),_0x111ecc;}function startTerminalUI(){const _0x433b36=a0_0x492338,_0x2b76f3=join(__dirname,'loxia-terminal.js'),_0x32a06d={...process[_0x433b36(0x9c)],'LOXIA_PORT':port[_0x433b36(0xd6)](),'LOXIA_HOST':host},_0x330b7e=spawn('node',[_0x2b76f3],{'cwd':join(__dirname,'..'),'env':_0x32a06d,'stdio':_0x433b36(0xaf)});return _0x330b7e;}const commands={'web':async()=>{const _0x45a25e=a0_0x492338;console[_0x45a25e(0xb5)](_0x45a25e(0xb8));const _0x13c327=startServer(![]);console[_0x45a25e(0xb5)](_0x45a25e(0x98));const _0x1d8296=await waitForServer(host,port);_0x1d8296?(console[_0x45a25e(0xb5)](_0x45a25e(0xb6)+serverUrl),openBrowser(serverUrl)):console[_0x45a25e(0xb5)](_0x45a25e(0xd1)+serverUrl+'\x20manually.'),process['on'](_0x45a25e(0xb1),()=>_0x13c327[_0x45a25e(0xb3)]('SIGINT')),process['on']('SIGTERM',()=>_0x13c327['kill'](_0x45a25e(0x9f))),_0x13c327['on'](_0x45a25e(0xa0),_0x1dd5ba=>process[_0x45a25e(0xa0)](_0x1dd5ba||0x0));},'plus-web':async()=>{const _0xd20af6=a0_0x492338;await commands[_0xd20af6(0xac)]();},'terminal':async()=>{const _0x1ec4af=a0_0x492338;console[_0x1ec4af(0xb5)](_0x1ec4af(0xa6));const _0x1b0f27=await checkServerRunning(host,port);!_0x1b0f27&&(console[_0x1ec4af(0xb7)](_0x1ec4af(0xd7)+serverUrl),console['error'](_0x1ec4af(0xda)),console[_0x1ec4af(0xb7)](_0x1ec4af(0xa3)),console[_0x1ec4af(0xb7)](_0x1ec4af(0xb4)),process[_0x1ec4af(0xa0)](0x1));console[_0x1ec4af(0xb5)](_0x1ec4af(0xbc)+serverUrl),console['log'](_0x1ec4af(0xcd));const _0x21ebd9=startTerminalUI();process['on'](_0x1ec4af(0xb1),()=>_0x21ebd9[_0x1ec4af(0xb3)](_0x1ec4af(0xb1))),process['on']('SIGTERM',()=>_0x21ebd9[_0x1ec4af(0xb3)](_0x1ec4af(0x9f))),_0x21ebd9['on'](_0x1ec4af(0xa0),_0x839c8f=>process[_0x1ec4af(0xa0)](_0x839c8f||0x0));},'plus-terminal':async()=>{const _0x2e2d92=a0_0x492338;console[_0x2e2d92(0xb5)](_0x2e2d92(0xab));const _0x4e6b63=startServer(!![]),_0x31d499=await waitForServer(host,port);!_0x31d499&&(console[_0x2e2d92(0xb7)](_0x2e2d92(0xbe)),process[_0x2e2d92(0xa0)](0x1));console['log'](_0x2e2d92(0xcc)+serverUrl),console[_0x2e2d92(0xb5)](_0x2e2d92(0xcd));const _0x4af4c0=startTerminalUI();_0x4af4c0['on'](_0x2e2d92(0xa0),_0x227e77=>{const _0xb78bd3=_0x2e2d92;console['log'](_0xb78bd3(0xbd));try{process['kill'](_0x4e6b63['pid'],_0xb78bd3(0x9f));}catch(_0x11c2e0){}process[_0xb78bd3(0xa0)](_0x227e77||0x0);}),process['on'](_0x2e2d92(0xb1),()=>{const _0x204eec=_0x2e2d92;_0x4af4c0[_0x204eec(0xb3)](_0x204eec(0xb1));}),process['on'](_0x2e2d92(0x9f),()=>{const _0x4c8d30=_0x2e2d92;_0x4af4c0[_0x4c8d30(0xb3)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x492338(0xc0)](_0xab8138=>{const _0x241a13=a0_0x492338;console['error'](_0x241a13(0x9b),_0xab8138[_0x241a13(0xc8)]),process['exit'](0x1);}):(console['error']('Unknown\x20command:\x20'+command),console[a0_0x492338(0xb7)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x492338(0xa0)](0x1));
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_0x1c342f=a0_0x43f9;function a0_0x4ef6(){const _0x25b6ff=['6RWgHbQ','LOXIA_HOST','argv','toString','length','web','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','843uDDfvl','ignore','✓\x20Server\x20is\x20already\x20running\x20at\x20','12IoSGhz','timeout','destroy','join','💡\x20Troubleshooting:','40361222Csjibq','stdout','dirname','Socket','--port','log','message','kill','pipe','1720YKfzrU','--host','slice','../src/interfaces/terminal/index.js','setTimeout','--ui','6026015Gqqrhi','920PXEqrl','...','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','error','7610967wdwTZy','node','env','LOXIA_PORT','now','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','✗\x20Server\x20is\x20not\x20running','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','data','stderr','🚀\x20Starting\x20Loxia\x20server...','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','2649wxIziW','4604hOqmWt','35379EOiRgT','6087700BPSftN','Failed\x20to\x20start\x20server:'];a0_0x4ef6=function(){return _0x25b6ff;};return a0_0x4ef6();}(function(_0x4c13d8,_0x11a6eb){const _0x41ad82=a0_0x43f9,_0x3666e4=_0x4c13d8();while(!![]){try{const _0x15cdc=parseInt(_0x41ad82(0x158))/0x1*(-parseInt(_0x41ad82(0x135))/0x2)+-parseInt(_0x41ad82(0x14c))/0x3*(parseInt(_0x41ad82(0x14d))/0x4)+parseInt(_0x41ad82(0x13b))/0x5*(-parseInt(_0x41ad82(0x151))/0x6)+parseInt(_0x41ad82(0x140))/0x7+-parseInt(_0x41ad82(0x13c))/0x8*(parseInt(_0x41ad82(0x14e))/0x9)+-parseInt(_0x41ad82(0x14f))/0xa+-parseInt(_0x41ad82(0x12c))/0xb*(-parseInt(_0x41ad82(0x15b))/0xc);if(_0x15cdc===_0x11a6eb)break;else _0x3666e4['push'](_0x3666e4['shift']());}catch(_0x407e48){_0x3666e4['push'](_0x3666e4['shift']());}}}(a0_0x4ef6,0xb6e4c));import{spawn}from'child_process';import a0_0x4a2071 from'net';import a0_0xc5ae5e from'path';import{fileURLToPath}from'url';function a0_0x43f9(_0x5bdc67,_0x33a1e3){_0x5bdc67=_0x5bdc67-0x12a;const _0x4ef695=a0_0x4ef6();let _0x43f9ef=_0x4ef695[_0x5bdc67];return _0x43f9ef;}const __filename=fileURLToPath(import.meta.url),__dirname=a0_0xc5ae5e[a0_0x1c342f(0x12e)](__filename),projectRoot=a0_0xc5ae5e['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x24c626,_0x5a2baa){return new Promise(_0x6b22bd=>{const _0x27cf2e=a0_0x43f9,_0x278851=new a0_0x4a2071[(_0x27cf2e(0x12f))]();_0x278851[_0x27cf2e(0x139)](0x7d0),_0x278851['on']('connect',()=>{const _0x36336a=_0x27cf2e;_0x278851[_0x36336a(0x15d)](),_0x6b22bd(!![]);}),_0x278851['on'](_0x27cf2e(0x15c),()=>{const _0x2beebf=_0x27cf2e;_0x278851[_0x2beebf(0x15d)](),_0x6b22bd(![]);}),_0x278851['on']('error',()=>{const _0x345ae2=_0x27cf2e;_0x278851[_0x345ae2(0x15d)](),_0x6b22bd(![]);}),_0x278851['connect'](_0x5a2baa,_0x24c626);});}async function startServer(_0xc03f04,_0x1cfb44){const _0x37f85c=a0_0x1c342f;return console[_0x37f85c(0x131)](_0x37f85c(0x14a)),new Promise((_0x3514cd,_0x1c39c2)=>{const _0x574e8c=_0x37f85c,_0x37c1ba=spawn(_0x574e8c(0x141),[a0_0xc5ae5e[_0x574e8c(0x12a)](projectRoot,'bin/cli.js'),_0x574e8c(0x13a),_0x574e8c(0x156),_0x574e8c(0x136),_0xc03f04,_0x574e8c(0x130),_0x1cfb44[_0x574e8c(0x154)]()],{'detached':![],'stdio':[_0x574e8c(0x159),'pipe',_0x574e8c(0x134)]});_0x37c1ba[_0x574e8c(0x12d)]['on'](_0x574e8c(0x148),()=>{}),_0x37c1ba[_0x574e8c(0x149)]['on'](_0x574e8c(0x148),()=>{}),_0x37c1ba['on'](_0x574e8c(0x13f),_0x37a84e=>{const _0x1ff08e=_0x574e8c;console[_0x1ff08e(0x13f)](_0x1ff08e(0x150),_0x37a84e['message']),_0x1c39c2(_0x37a84e);});const _0x5d78fa=Date[_0x574e8c(0x144)](),_0x1b26fe=setInterval(async()=>{const _0x45e5a4=_0x574e8c,_0x2264af=await isServerRunning(_0xc03f04,_0x1cfb44);if(_0x2264af)clearInterval(_0x1b26fe),console['log']('✓\x20Server\x20started\x20at\x20'+_0xc03f04+':'+_0x1cfb44),_0x3514cd();else Date['now']()-_0x5d78fa>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x1b26fe),_0x37c1ba[_0x45e5a4(0x133)](),_0x1c39c2(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x1f9c0d=a0_0x1c342f;try{console[_0x1f9c0d(0x131)](_0x1f9c0d(0x147)),console['log']('\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI'),console[_0x1f9c0d(0x131)](_0x1f9c0d(0x147)),console['log']('');const _0x46552c=process[_0x1f9c0d(0x153)][_0x1f9c0d(0x137)](0x2);let _0x43f1c3=DEFAULT_HOST,_0x31312e=DEFAULT_PORT;for(let _0x3b99e8=0x0;_0x3b99e8<_0x46552c[_0x1f9c0d(0x155)];_0x3b99e8++){if(_0x46552c[_0x3b99e8]===_0x1f9c0d(0x136)&&_0x46552c[_0x3b99e8+0x1])_0x43f1c3=_0x46552c[_0x3b99e8+0x1],_0x3b99e8++;else _0x46552c[_0x3b99e8]===_0x1f9c0d(0x130)&&_0x46552c[_0x3b99e8+0x1]&&(_0x31312e=parseInt(_0x46552c[_0x3b99e8+0x1],0xa),_0x3b99e8++);}console['log'](_0x1f9c0d(0x145)+_0x43f1c3+':'+_0x31312e+_0x1f9c0d(0x13d));const _0x4fa8d2=await isServerRunning(_0x43f1c3,_0x31312e);!_0x4fa8d2?(console[_0x1f9c0d(0x131)](_0x1f9c0d(0x146)),await startServer(_0x43f1c3,_0x31312e)):console[_0x1f9c0d(0x131)](_0x1f9c0d(0x15a)+_0x43f1c3+':'+_0x31312e),console[_0x1f9c0d(0x131)](''),console['log'](_0x1f9c0d(0x157)),console[_0x1f9c0d(0x131)](''),await new Promise(_0x56f566=>setTimeout(_0x56f566,0x1f4)),process[_0x1f9c0d(0x142)][_0x1f9c0d(0x152)]=_0x43f1c3,process[_0x1f9c0d(0x142)][_0x1f9c0d(0x143)]=_0x31312e[_0x1f9c0d(0x154)](),await import(_0x1f9c0d(0x138));}catch(_0x32b5c8){console[_0x1f9c0d(0x13f)](''),console[_0x1f9c0d(0x13f)](_0x1f9c0d(0x14b)),console['error']('\x20\x20',_0x32b5c8[_0x1f9c0d(0x132)]),console['error'](''),console['error'](_0x1f9c0d(0x12b)),console[_0x1f9c0d(0x13f)]('\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'),console[_0x1f9c0d(0x13f)](_0x1f9c0d(0x13e)),console['error']('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x1f9c0d(0x13f)](''),process['exit'](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_0x27de10=a0_0x19ad;(function(_0x383437,_0x1d2a8f){const _0x1f3f4f=a0_0x19ad,_0x4b71f4=_0x383437();while(!![]){try{const _0x2790d9=-parseInt(_0x1f3f4f(0x1b8))/0x1*(parseInt(_0x1f3f4f(0x1b9))/0x2)+parseInt(_0x1f3f4f(0x1c4))/0x3+-parseInt(_0x1f3f4f(0x1b0))/0x4*(parseInt(_0x1f3f4f(0x1c3))/0x5)+parseInt(_0x1f3f4f(0x1ce))/0x6*(parseInt(_0x1f3f4f(0x1b2))/0x7)+parseInt(_0x1f3f4f(0x1bb))/0x8+parseInt(_0x1f3f4f(0x1c2))/0x9*(-parseInt(_0x1f3f4f(0x1ca))/0xa)+parseInt(_0x1f3f4f(0x1be))/0xb*(-parseInt(_0x1f3f4f(0x1b3))/0xc);if(_0x2790d9===_0x1d2a8f)break;else _0x4b71f4['push'](_0x4b71f4['shift']());}catch(_0x50e7dd){_0x4b71f4['push'](_0x4b71f4['shift']());}}}(a0_0x23d3,0xdbf44));function a0_0x19ad(_0x2f5f4a,_0x57183c){_0x2f5f4a=_0x2f5f4a-0x1ac;const _0x23d326=a0_0x23d3();let _0x19ad3d=_0x23d326[_0x2f5f4a];return _0x19ad3d;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x27de10(0x1b1)][a0_0x27de10(0x1b5)](0x2),options={'host':a0_0x27de10(0x1c5),'port':0x1f90};function a0_0x23d3(){const _0x34b0d9=['exit','log','90599qdYrIz','6XIMNqH','waitUntilExit','5117464smTZNB','Connecting\x20to:\x20','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','11AZfktH','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','Press\x20Ctrl+C\x20to\x20exit\x0a','port','20394XrxRLk','226595DGbgAD','3477186ZWxIET','localhost','error','host','then','\x20\x20npm\x20start','230AdSGUE','LOXIA_HOST','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','\x20\x20npm\x20run\x20terminal-ui','1908VQEIij','length','LOXIA_PORT','isTTY','--help','Or\x20use\x20the\x20web\x20UI\x20instead:','The\x20terminal\x20UI\x20cannot\x20run\x20in:','--host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20-\x20Some\x20CI/CD\x20environments','Starting\x20Loxia\x20Terminal\x20UI...','28qmLccX','argv','35161xKNvbS','22247748RtMlmI','env','slice'];a0_0x23d3=function(){return _0x34b0d9;};return a0_0x23d3();}for(let i=0x0;i<args[a0_0x27de10(0x1cf)];i++){const arg=args[i];if(arg===a0_0x27de10(0x1d5)||arg==='-h')options[a0_0x27de10(0x1c7)]=args[++i];else{if(arg==='--port'||arg==='-p')options[a0_0x27de10(0x1c1)]=parseInt(args[++i],0xa);else arg===a0_0x27de10(0x1d2)&&(console[a0_0x27de10(0x1b7)]('\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a'),process['exit'](0x0));}}process['env'][a0_0x27de10(0x1cb)]&&(options['host']=process['env'][a0_0x27de10(0x1cb)]);process['env'][a0_0x27de10(0x1d0)]&&(options[a0_0x27de10(0x1c1)]=parseInt(process[a0_0x27de10(0x1b4)][a0_0x27de10(0x1d0)],0xa));!process['stdin'][a0_0x27de10(0x1d1)]&&(console['error'](a0_0x27de10(0x1bf)),console[a0_0x27de10(0x1c6)](''),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1d4)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1bd)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1ac)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1cc)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1ae)),console['error'](''),console['error'](a0_0x27de10(0x1ad)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1cd)),console[a0_0x27de10(0x1c6)](''),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1d3)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1c9)),process[a0_0x27de10(0x1b6)](0x1));console[a0_0x27de10(0x1b7)](a0_0x27de10(0x1af)),console[a0_0x27de10(0x1b7)](a0_0x27de10(0x1bc)+options[a0_0x27de10(0x1c7)]+':'+options[a0_0x27de10(0x1c1)]),console['log'](a0_0x27de10(0x1c0));const instance=startTerminalUI(options);instance[a0_0x27de10(0x1ba)]()[a0_0x27de10(0x1c8)](()=>{const _0x566653=a0_0x27de10;console[_0x566653(0x1b7)]('\x0aTerminal\x20UI\x20exited'),process[_0x566653(0x1b6)](0x0);})['catch'](_0x268176=>{console['error']('\x0aTerminal\x20UI\x20error:',_0x268176),process['exit'](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_0x3d57a8=a0_0x5679;(function(_0x6c6c0,_0x4b45b5){const _0x348ca6=a0_0x5679,_0x4ecab0=_0x6c6c0();while(!![]){try{const _0x2f04d0=parseInt(_0x348ca6(0x125))/0x1+parseInt(_0x348ca6(0x11e))/0x2*(parseInt(_0x348ca6(0x11c))/0x3)+parseInt(_0x348ca6(0x138))/0x4*(-parseInt(_0x348ca6(0x110))/0x5)+parseInt(_0x348ca6(0x10a))/0x6+parseInt(_0x348ca6(0x124))/0x7*(-parseInt(_0x348ca6(0x12f))/0x8)+parseInt(_0x348ca6(0x132))/0x9+-parseInt(_0x348ca6(0x135))/0xa*(parseInt(_0x348ca6(0x12c))/0xb);if(_0x2f04d0===_0x4b45b5)break;else _0x4ecab0['push'](_0x4ecab0['shift']());}catch(_0x3942ec){_0x4ecab0['push'](_0x4ecab0['shift']());}}}(a0_0xaf81,0x3a430));function a0_0xaf81(){const _0x4ab069=['node','9038eHPETh','setTimeout','pipe','Server\x20returned\x20','stderr','🛑\x20Stopping\x20server...','1645wkQRnW','73295ZQtVBL','get','Server\x20exited\x20with\x20code\x20','🚀\x20Starting\x20Loxia\x20server...','exit','kill','data','679844TokHwX','index.js','env','5224BxjeDQ','SIGTERM','[SERVER]\x20','3268278lbZPKW','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','http://localhost:','50MopaxB','✅\x20Server\x20is\x20ready!','/health','372644mtYShK','Failed\x20to\x20start\x20Terminal\x20UI:','SIGKILL','🖥️\x20\x20Starting\x20Terminal\x20UI...','Error\x20during\x20startup:','1817496MJAext','bin','Timeout','src','message','toString','20ArCxCm','ExperimentalWarning','statusCode','error','killed','╔════════════════════════════════════════════════╗','log','[SERVER\x20ERROR]\x20','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','ignore','loxia-terminal.js','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','222uXMiSl'];a0_0xaf81=function(){return _0x4ab069;};return a0_0xaf81();}import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x58e978 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env']['PORT']||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;function a0_0x5679(_0x10e6e1,_0x169292){_0x10e6e1=_0x10e6e1-0x10a;const _0xaf8146=a0_0xaf81();let _0x5679e2=_0xaf8146[_0x10e6e1];return _0x5679e2;}async function checkServerReady(_0x4f4d0e=0xa,_0x1b0719=0x1f4){const _0x4bb574=a0_0x5679;for(let _0x323e26=0x0;_0x323e26<_0x4f4d0e;_0x323e26++){try{return await new Promise((_0x1c4c9c,_0x2f596a)=>{const _0x278a21=a0_0x5679,_0x5415e9=a0_0x58e978[_0x278a21(0x126)](_0x278a21(0x134)+SERVER_PORT+_0x278a21(0x137),_0x2e2ecb=>{const _0xa87bca=_0x278a21;_0x2e2ecb['statusCode']===0xc8?_0x1c4c9c():_0x2f596a(new Error(_0xa87bca(0x121)+_0x2e2ecb[_0xa87bca(0x112)]));});_0x5415e9['on'](_0x278a21(0x113),_0x2f596a),_0x5415e9[_0x278a21(0x11f)](0x3e8,()=>{const _0x1cadb8=_0x278a21;_0x5415e9['destroy'](),_0x2f596a(new Error(_0x1cadb8(0x10c)));});}),console['log'](_0x4bb574(0x136)),!![];}catch(_0x4ec584){_0x323e26<_0x4f4d0e-0x1&&await new Promise(_0xa3c09f=>setTimeout(_0xa3c09f,_0x1b0719));}}return console[_0x4bb574(0x116)](_0x4bb574(0x11b)),![];}async function startServer(){return new Promise(_0x148d47=>{const _0x207c7f=a0_0x5679;console[_0x207c7f(0x116)](_0x207c7f(0x128));const _0x394389=join(rootDir,_0x207c7f(0x10d),_0x207c7f(0x12d));serverProcess=spawn(_0x207c7f(0x11d),[_0x394389],{'cwd':rootDir,'env':{...process['env']},'stdio':[_0x207c7f(0x119),_0x207c7f(0x120),_0x207c7f(0x120)],'detached':![]}),serverProcess['stdout']['on'](_0x207c7f(0x12b),_0x1de586=>{const _0x348080=_0x207c7f,_0xbf7953=_0x1de586['toString']()['trim']();_0xbf7953&&console[_0x348080(0x116)](_0x348080(0x131)+_0xbf7953);}),serverProcess[_0x207c7f(0x122)]['on'](_0x207c7f(0x12b),_0x5a3741=>{const _0x563bcf=_0x207c7f,_0x4beb9b=_0x5a3741[_0x563bcf(0x10f)]()['trim']();_0x4beb9b&&!_0x4beb9b['includes'](_0x563bcf(0x111))&&console[_0x563bcf(0x113)](_0x563bcf(0x117)+_0x4beb9b);}),serverProcess['on'](_0x207c7f(0x113),_0x313547=>{const _0x3c721c=_0x207c7f;console[_0x3c721c(0x113)]('Failed\x20to\x20start\x20server:',_0x313547[_0x3c721c(0x10e)]),process[_0x3c721c(0x129)](0x1);}),serverProcess['on'](_0x207c7f(0x129),(_0x54bb27,_0x256840)=>{const _0x2905d6=_0x207c7f;_0x54bb27!==null&&_0x54bb27!==0x0&&(console[_0x2905d6(0x113)](_0x2905d6(0x127)+_0x54bb27),process[_0x2905d6(0x129)](_0x54bb27));}),setTimeout(_0x148d47,STARTUP_WAIT);});}async function startTerminalUI(){const _0xb2fd15=a0_0x5679;console['log'](_0xb2fd15(0x13b)),console[_0xb2fd15(0x116)]('');const _0x471a18=join(rootDir,_0xb2fd15(0x10b),_0xb2fd15(0x11a)),_0x181828=spawn(_0xb2fd15(0x11d),[_0x471a18],{'cwd':rootDir,'env':{...process[_0xb2fd15(0x12e)]},'stdio':'inherit'});return _0x181828['on']('error',_0x341124=>{const _0x2c6c89=_0xb2fd15;console['error'](_0x2c6c89(0x139),_0x341124[_0x2c6c89(0x10e)]),cleanup(),process[_0x2c6c89(0x129)](0x1);}),_0x181828['on'](_0xb2fd15(0x129),_0x5aad2c=>{const _0x43049a=_0xb2fd15;console[_0x43049a(0x116)]('\x0a👋\x20Terminal\x20UI\x20closed.'),cleanup(),process[_0x43049a(0x129)](_0x5aad2c||0x0);}),_0x181828;}function cleanup(){const _0x332f77=a0_0x5679;serverProcess&&!serverProcess[_0x332f77(0x114)]&&(console[_0x332f77(0x116)](_0x332f77(0x123)),serverProcess[_0x332f77(0x12a)](_0x332f77(0x130)),setTimeout(()=>{const _0x577f0c=_0x332f77;!serverProcess[_0x577f0c(0x114)]&&serverProcess[_0x577f0c(0x12a)](_0x577f0c(0x13a));},0x1388));}process['on']('SIGINT',()=>{const _0x47bd1a=a0_0x5679;console[_0x47bd1a(0x116)]('\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x3d57a8(0x130),()=>{const _0x18d957=a0_0x3d57a8;console[_0x18d957(0x116)](_0x18d957(0x133)),cleanup(),process[_0x18d957(0x129)](0x0);}),process['on']('exit',()=>{cleanup();});async function main(){const _0x300535=a0_0x3d57a8;console[_0x300535(0x116)](_0x300535(0x115)),console['log'](_0x300535(0x118)),console[_0x300535(0x116)]('╚════════════════════════════════════════════════╝'),console[_0x300535(0x116)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x468fcc){console['error'](_0x300535(0x13c),_0x468fcc[_0x300535(0x10e)]),cleanup(),process[_0x300535(0x129)](0x1);}}main();
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.3",
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",
@@ -63,6 +63,7 @@
63
63
  "stylelint-config-standard": "^39.0.1",
64
64
  "tiktoken": "^1.0.15",
65
65
  "typescript": "^5.9.3",
66
+ "uuid": "^11.1.0",
66
67
  "ws": "^8.16.0"
67
68
  },
68
69
  "jest": {
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0xd91e0e=a0_0x3f52;(function(_0x4f74d1,_0x37b7eb){const _0x170bae=a0_0x3f52,_0x3478cb=_0x4f74d1();while(!![]){try{const _0x19876d=-parseInt(_0x170bae(0x197))/0x1*(-parseInt(_0x170bae(0x17a))/0x2)+-parseInt(_0x170bae(0x1b8))/0x3+-parseInt(_0x170bae(0x1a8))/0x4*(-parseInt(_0x170bae(0x19a))/0x5)+-parseInt(_0x170bae(0x18c))/0x6+parseInt(_0x170bae(0x194))/0x7+parseInt(_0x170bae(0x190))/0x8+parseInt(_0x170bae(0x17d))/0x9*(parseInt(_0x170bae(0x181))/0xa);if(_0x19876d===_0x37b7eb)break;else _0x3478cb['push'](_0x3478cb['shift']());}catch(_0x13b3a5){_0x3478cb['push'](_0x3478cb['shift']());}}}(a0_0x5542,0x98991));import{exec}from'child_process';import{promisify}from'util';import a0_0x1da570 from'https';import a0_0x36e13f from'http';import a0_0x3f26ce from'fs';import a0_0x4226c8 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_0x4226c8[a0_0xd91e0e(0x18e)](__filename),SCANNER_DIR=a0_0x4226c8[a0_0xd91e0e(0x1b2)](__dirname,'..',a0_0xd91e0e(0x195),a0_0xd91e0e(0x18a)),SEMGREP_VERSION=a0_0xd91e0e(0x1b1);function a0_0x3f52(_0xc2c20b,_0x5ed607){_0xc2c20b=_0xc2c20b-0x179;const _0x55422c=a0_0x5542();let _0x3f5223=_0x55422c[_0xc2c20b];return _0x3f5223;}console[a0_0xd91e0e(0x1af)](a0_0xd91e0e(0x17b)),console[a0_0xd91e0e(0x1af)]('\x20\x20Installing\x20Security\x20Scanners'),console[a0_0xd91e0e(0x1af)](a0_0xd91e0e(0x188));async function installScanners(){const _0x288d12=a0_0xd91e0e;await a0_0x3f26ce[_0x288d12(0x1a7)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console['log']('\x0a═══════════════════════════════════════════════════════════'),console[_0x288d12(0x1af)](_0x288d12(0x1c0)),console[_0x288d12(0x1af)](_0x288d12(0x188));}async function checkESLintSecurity(){const _0xb6beb9=a0_0xd91e0e;console[_0xb6beb9(0x1af)](_0xb6beb9(0x17c));try{await import(_0xb6beb9(0x18f)),console[_0xb6beb9(0x1af)]('\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a');}catch(_0x1c5980){console[_0xb6beb9(0x1af)](_0xb6beb9(0x1a5)),console[_0xb6beb9(0x1af)]('\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a');}}async function installSemgrep(){const _0x4abc82=a0_0xd91e0e;console[_0x4abc82(0x1af)](_0x4abc82(0x196));const _0x287f95=process[_0x4abc82(0x19f)],_0x38c66c=process['arch'];try{const _0x43ceb7=await execAsync(_0x4abc82(0x180),{'timeout':0x1388});console['log'](_0x4abc82(0x1a0)+_0x43ceb7['stdout']['trim']()),console['log'](_0x4abc82(0x1ae));return;}catch(_0xa9a255){console[_0x4abc82(0x1af)](_0x4abc82(0x19d));}const _0x440350=getSemgrepBinaryInfo(_0x287f95,_0x38c66c);if(!_0x440350){console[_0x4abc82(0x1af)](_0x4abc82(0x1ab)+_0x287f95+'-'+_0x38c66c),console[_0x4abc82(0x1af)](_0x4abc82(0x1b3));return;}try{const _0x5625ce=a0_0x4226c8['join'](SCANNER_DIR,_0x4abc82(0x184));console[_0x4abc82(0x1af)](_0x4abc82(0x1c1)+_0x440350['url']+_0x4abc82(0x186)),await downloadFile(_0x440350[_0x4abc82(0x1b4)],_0x5625ce),await a0_0x3f26ce[_0x4abc82(0x1a7)][_0x4abc82(0x1a4)](_0x5625ce,0x1ed),console[_0x4abc82(0x1af)]('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x4abc82(0x1af)](_0x4abc82(0x1b9)+_0x5625ce+'\x0a'),console['log']('\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'),console[_0x4abc82(0x1af)](_0x4abc82(0x187));}catch(_0x351e1c){console[_0x4abc82(0x1af)](_0x4abc82(0x1b0)+_0x351e1c[_0x4abc82(0x1b5)]),console[_0x4abc82(0x1af)](_0x4abc82(0x1bd));}}function getSemgrepBinaryInfo(_0x1384b2,_0x5789c2){return null;}function a0_0x5542(){const _0x43eeb2=['\x0aYou\x20can\x20manually\x20install\x20scanners:','location','895QCAkjx','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','error','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','platform','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','python3','get','pipe','chmod','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20installed\x20successfully','promises','11492NFtUdT','Failed\x20to\x20download:\x20HTTP\x20','https','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','headers','close','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','log','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','v1.55.0','join','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','url','message','pip-audit','statusCode','1676073QxhuQH','\x20\x20\x20Location:\x20','🐍\x20Checking\x20Python\x20scanners...','❌\x20Installation\x20failed:','catch','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','python\x20--version','\x20-m\x20pip\x20show\x20','\x20\x20Installation\x20Complete','\x20\x20\x20Downloading\x20from\x20','exit','2lVNxlb','═══════════════════════════════════════════════════════════','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','403659tJXvLH','\x20-m\x20pip\x20install\x20--user\x20','\x20already\x20installed','semgrep\x20--version','10ZiTVdm','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','python','semgrep','\x20\x20\x20✅\x20Python\x20found:\x20','...','\x20\x20\x20pip\x20install\x20semgrep\x0a','═══════════════════════════════════════════════════════════\x0a','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','.scanners','checkov','6972486QxWmEX','then','dirname','eslint-plugin-security','2818552TpduYQ','startsWith','\x20\x20\x20Installing\x20','\x20\x20\x20✅\x20','1703793VQkKgJ','node_modules','🔍\x20Installing\x20Semgrep...','1190977RYauCp'];a0_0x5542=function(){return _0x43eeb2;};return a0_0x5542();}async function installPythonScanners(){const _0x12c29a=a0_0xd91e0e;console[_0x12c29a(0x1af)](_0x12c29a(0x1ba));let _0x5bc52d=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x5bc52d=_0x12c29a(0x1a1);}catch(_0x2532f6){try{await execAsync(_0x12c29a(0x1be),{'timeout':0x1388}),_0x5bc52d=_0x12c29a(0x183);}catch(_0x4f8d2d){console[_0x12c29a(0x1af)]('\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners'),console[_0x12c29a(0x1af)](_0x12c29a(0x19e)),console[_0x12c29a(0x1af)]('\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a');return;}}console['log'](_0x12c29a(0x185)+_0x5bc52d),await installViaPip(_0x12c29a(0x184),_0x5bc52d),await installViaPip('bandit',_0x5bc52d),await installViaPip(_0x12c29a(0x1b6),_0x5bc52d),await installViaPip(_0x12c29a(0x18b),_0x5bc52d),await installViaPip('yamllint',_0x5bc52d),console[_0x12c29a(0x1af)]('');}async function installViaPip(_0x3a7825,_0x4a99bb){const _0x5237f3=a0_0xd91e0e;try{const _0xbc4779=await execAsync(_0x4a99bb+_0x5237f3(0x1bf)+_0x3a7825,{'timeout':0x1388});return console['log'](_0x5237f3(0x193)+_0x3a7825+_0x5237f3(0x17f)),!![];}catch(_0x547c1e){console[_0x5237f3(0x1af)](_0x5237f3(0x192)+_0x3a7825+_0x5237f3(0x186));try{return await execAsync(_0x4a99bb+_0x5237f3(0x17e)+_0x3a7825,{'timeout':0xea60}),console['log'](_0x5237f3(0x193)+_0x3a7825+_0x5237f3(0x1a6)),!![];}catch(_0x363d58){return console['log'](_0x5237f3(0x189)+_0x3a7825+':\x20'+_0x363d58[_0x5237f3(0x1b5)]),console[_0x5237f3(0x1af)](_0x5237f3(0x19b)+_0x3a7825),![];}}}async function downloadFile(_0x37a548,_0x53b753){return new Promise((_0x4d8a1c,_0x1a7776)=>{const _0x4efcc5=a0_0x3f52,_0x44d5da=_0x37a548[_0x4efcc5(0x191)](_0x4efcc5(0x1aa))?a0_0x1da570:a0_0x36e13f;_0x44d5da[_0x4efcc5(0x1a2)](_0x37a548,_0x32f2ec=>{const _0x5dfbe8=_0x4efcc5;if(_0x32f2ec[_0x5dfbe8(0x1b7)]===0x12e||_0x32f2ec[_0x5dfbe8(0x1b7)]===0x12d){downloadFile(_0x32f2ec[_0x5dfbe8(0x1ac)][_0x5dfbe8(0x199)],_0x53b753)[_0x5dfbe8(0x18d)](_0x4d8a1c)[_0x5dfbe8(0x1bc)](_0x1a7776);return;}if(_0x32f2ec[_0x5dfbe8(0x1b7)]!==0xc8){_0x1a7776(new Error(_0x5dfbe8(0x1a9)+_0x32f2ec['statusCode']));return;}const _0x1eda56=createWriteStream(_0x53b753);_0x32f2ec[_0x5dfbe8(0x1a3)](_0x1eda56),_0x1eda56['on']('finish',()=>{const _0x5e7716=_0x5dfbe8;_0x1eda56[_0x5e7716(0x1ad)](),_0x4d8a1c();}),_0x1eda56['on'](_0x5dfbe8(0x19c),_0x2ad452=>{a0_0x3f26ce['unlink'](_0x53b753,()=>{}),_0x1a7776(_0x2ad452);});})['on'](_0x4efcc5(0x19c),_0x1a7776);});}installScanners()['catch'](_0x57b03b=>{const _0x5bb91f=a0_0xd91e0e;console['error'](_0x5bb91f(0x1bb),_0x57b03b[_0x5bb91f(0x1b5)]),console[_0x5bb91f(0x19c)](_0x5bb91f(0x198)),console[_0x5bb91f(0x19c)](_0x5bb91f(0x182)),console[_0x5bb91f(0x19c)]('\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit'),process[_0x5bb91f(0x179)](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_0x5836a2=a0_0x54e1;function a0_0x549b(){const _0x2c46a4=['Cg9ZDgnZCY1SzxnZ','u1rzteu','C2nZCW','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','mtq0mteXmeHfu09psa','mtyYodi0ndb1DMfZBgW','D2HPBgu','BwL4Aw4','Cg9ZDgnZCY1Zy3nZ','BgvZCW','y29SDw1U','q0furuDpuLK','BMCTzgvLCa','Aw5JBhvKzq','CMvJB21Tzw5Kzwq','Cg9ZDgnZC1nJC3m','zMLSDgvY','Cg9ZDgnZC0XLC3m','u1Lovefy','BgLUzq','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','zM9YD2fYza','zw5KC1DPDgG','q3nZu3LUDgf4rxjYB3i','y3nZ','Bg9Nz2vY','zgvMyxvSDa','BgvUz3rO','CNvSzq','lMnZCW','y2HLy2TtEw50yxG','Aw5JBhvKzxm','ChjVy2vZCW','zxjYB3i','C2v2zxjPDhK','ntqZntu3Bfr1y3PA','nxrQsK13vW','ndy2mZa0ng9xDKvotq','D2fYBG','Cg9ZDgnZCW','CMvZDwX0CW','BgLUDfn0EwXLCW','q1ntigfUywX5C2LZigzHAwXLza','ntC0odG4CNHLuK9K','u0vwrvjjvfK','m0PQweHZsW','uevsrK9stufoq0u','ndiZodC3nK9Tr1Dtta','C3vWCg9YDhnbDxrVrML4','C3r5BgvSAw50lwnVBMzPzY1ZDgfUzgfYza','ntzTBM5ky2K','ndC4ntaYCM5qr2n2','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','D2fYBMLUz3m','Dgv4Da','rvjst1i','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','zgv0zwn0tgfUz3vHz2u','yw5HBhL6zq','ChvZAa','zgvIDwC','lMXLC3m','zxH0zw5K','C3r5BgvSAw50','zwXZzq','v0fstKLorW'];a0_0x549b=function(){return _0x2c46a4;};return a0_0x549b();}(function(_0x302181,_0x4f5f34){const _0x1c9d33=a0_0x54e1,_0x5ef55e=_0x302181();while(!![]){try{const _0x2616bc=-parseInt(_0x1c9d33(0x1df))/0x1+parseInt(_0x1c9d33(0x1ef))/0x2*(-parseInt(_0x1c9d33(0x1e9))/0x3)+-parseInt(_0x1c9d33(0x1eb))/0x4*(-parseInt(_0x1c9d33(0x1e0))/0x5)+-parseInt(_0x1c9d33(0x202))/0x6+parseInt(_0x1c9d33(0x1ee))/0x7*(-parseInt(_0x1c9d33(0x1e7))/0x8)+-parseInt(_0x1c9d33(0x1e1))/0x9+parseInt(_0x1c9d33(0x203))/0xa;if(_0x2616bc===_0x4f5f34)break;else _0x5ef55e['push'](_0x5ef55e['shift']());}catch(_0x2b5cb1){_0x5ef55e['push'](_0x5ef55e['shift']());}}}(a0_0x549b,0x8ba25));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x54e1(_0x1c5464,_0xd10c6c){_0x1c5464=_0x1c5464-0x1da;const _0x549b7e=a0_0x549b();let _0x54e1dc=_0x549b7e[_0x1c5464];if(a0_0x54e1['rwfuhz']===undefined){var _0x480d7f=function(_0x385933){const _0x3d9d97='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4102ce='',_0xd1c067='';for(let _0x23dc07=0x0,_0x1361df,_0x5a44b7,_0x19d97f=0x0;_0x5a44b7=_0x385933['charAt'](_0x19d97f++);~_0x5a44b7&&(_0x1361df=_0x23dc07%0x4?_0x1361df*0x40+_0x5a44b7:_0x5a44b7,_0x23dc07++%0x4)?_0x4102ce+=String['fromCharCode'](0xff&_0x1361df>>(-0x2*_0x23dc07&0x6)):0x0){_0x5a44b7=_0x3d9d97['indexOf'](_0x5a44b7);}for(let _0xb806ae=0x0,_0xb55b42=_0x4102ce['length'];_0xb806ae<_0xb55b42;_0xb806ae++){_0xd1c067+='%'+('00'+_0x4102ce['charCodeAt'](_0xb806ae)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xd1c067);};a0_0x54e1['zOzphd']=_0x480d7f,a0_0x54e1['iIPLaf']={},a0_0x54e1['rwfuhz']=!![];}const _0x381656=_0x549b7e[0x0],_0x5cc940=_0x1c5464+_0x381656,_0x5b0f9c=a0_0x54e1['iIPLaf'][_0x5cc940];return!_0x5b0f9c?(_0x54e1dc=a0_0x54e1['zOzphd'](_0x54e1dc),a0_0x54e1['iIPLaf'][_0x5cc940]=_0x54e1dc):_0x54e1dc=_0x5b0f9c,_0x54e1dc;}class CSSAnalyzer{constructor(_0x4102ce=null){const _0x437fa9=a0_0x54e1;this['logger']=_0x4102ce,this['stylelint']=null,this[_0x437fa9(0x1e3)]=null,this['postcssScss']=null,this[_0x437fa9(0x20f)]=null;}async[a0_0x5836a2(0x1f6)](_0xd1c067,_0x23dc07,_0x1361df={}){const _0x29d388=a0_0x5836a2;try{const _0x5a44b7=[],_0x19d97f=this[_0x29d388(0x1f5)](_0xd1c067),_0xb806ae=await this[_0x29d388(0x1da)](_0xd1c067,_0x23dc07,_0x19d97f);_0x5a44b7['push'](..._0xb806ae);if(_0xb806ae[_0x29d388(0x219)]===0x0){const _0xb55b42=await this['lintStyles'](_0xd1c067,_0x23dc07,_0x19d97f);_0x5a44b7['push'](..._0xb55b42);}return this[_0x29d388(0x217)]?.['debug']('CSS\x20analysis\x20completed',{'file':_0xd1c067,'language':_0x19d97f,'totalDiagnostics':_0x5a44b7[_0x29d388(0x219)],'errors':_0x5a44b7['filter'](_0x494380=>_0x494380[_0x29d388(0x1de)]===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x5a44b7[_0x29d388(0x20e)](_0x29811c=>_0x29811c[_0x29d388(0x1de)]===STATIC_ANALYSIS['SEVERITY'][_0x29d388(0x1fd)])['length']}),_0x5a44b7;}catch(_0x327adb){return this[_0x29d388(0x217)]?.['error'](_0x29d388(0x1e6),{'file':_0xd1c067,'error':_0x327adb['message']}),[];}}async[a0_0x5836a2(0x1da)](_0x32e7e4,_0x3dfcaa,_0x2354ca){const _0x3424ef=a0_0x5836a2,_0x51598d=[];try{if(!this[_0x3424ef(0x1e3)]){const _0xce7db4=await import('postcss');this['postcss']=_0xce7db4['default'];}let _0x542d36=null;if(_0x2354ca==='scss'){if(!this[_0x3424ef(0x20d)]){const _0x50f5e1=await import(_0x3424ef(0x206));this[_0x3424ef(0x20d)]=_0x50f5e1['default'];}_0x542d36=this[_0x3424ef(0x20d)];}else{if(_0x2354ca===_0x3424ef(0x207)){if(!this['postcssLess']){const _0x3f5d62=await import(_0x3424ef(0x1fe));this['postcssLess']=_0x3f5d62[_0x3424ef(0x218)];}_0x542d36=this[_0x3424ef(0x20f)];}}const _0x4d6893=this['postcss']()[_0x3424ef(0x1dc)](_0x3dfcaa,{'from':_0x32e7e4,'syntax':_0x542d36}),_0x53b381=_0x4d6893['root'];this['logger']?.[_0x3424ef(0x1f8)](_0x3424ef(0x212),{'file':_0x32e7e4});}catch(_0x1cf37d){const _0x23c958=this['formatPostCSSError'](_0x1cf37d,_0x32e7e4);_0x23c958&&_0x51598d[_0x3424ef(0x1f7)](_0x23c958);}return _0x51598d;}async[a0_0x5836a2(0x1e5)](_0x3cbc5c,_0x2f676c,_0x534d31){const _0x205257=a0_0x5836a2,_0x40bcec=[];try{if(!this['stylelint']){const _0x1e254b=await import('stylelint');this[_0x205257(0x1fb)]=_0x1e254b['default'];}const _0x3c8276={'extends':[_0x205257(0x1ed)],'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-/',_0x205257(0x20a)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x534d31===_0x205257(0x200)?[!![],{'ignoreAtRules':[_0x205257(0x205),_0x205257(0x20b),_0x205257(0x1fa),'if',_0x205257(0x1fc),'for','each',_0x205257(0x204),'function','return','content','use',_0x205257(0x213)]}]:_0x534d31===_0x205257(0x207)?[!![],{'ignoreAtRules':['plugin']}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':'lower'},'customSyntax':_0x534d31==='scss'?_0x205257(0x206):_0x534d31===_0x205257(0x207)?_0x205257(0x1fe):undefined},_0x205644=await this['stylelint']['lint']({'code':_0x2f676c,'codeFilename':_0x3cbc5c,'config':_0x3c8276});if(_0x205644['results']&&_0x205644[_0x205257(0x1e4)][_0x205257(0x219)]>0x0){const _0x1bb9b7=_0x205644['results'][0x0];if(_0x1bb9b7[_0x205257(0x1f1)])for(const _0x5ab2cb of _0x1bb9b7['warnings']){_0x40bcec['push']({'file':_0x3cbc5c,'line':_0x5ab2cb[_0x205257(0x211)]||0x1,'column':_0x5ab2cb[_0x205257(0x208)]||0x1,'severity':_0x5ab2cb['severity']===_0x205257(0x1dd)?STATIC_ANALYSIS['SEVERITY'][_0x205257(0x1f3)]:STATIC_ANALYSIS[_0x205257(0x1e8)]['WARNING'],'rule':_0x5ab2cb['rule']||'unknown','message':_0x5ab2cb[_0x205257(0x1f2)],'category':this['categorizeStylelintRule'](_0x5ab2cb[_0x205257(0x21a)]),'fixable':![],'source':_0x205257(0x1fb)});}}}catch(_0x2bd429){this['logger']?.[_0x205257(0x1e2)](_0x205257(0x1f0),{'file':_0x3cbc5c,'error':_0x2bd429['message']});}return _0x40bcec;}['formatPostCSSError'](_0x3e6834,_0x36a4bd){const _0x17febe=a0_0x5836a2;return{'file':_0x36a4bd,'line':_0x3e6834[_0x17febe(0x211)]||0x1,'column':_0x3e6834[_0x17febe(0x208)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x3e6834['name']||_0x17febe(0x215),'message':_0x3e6834['reason']||_0x3e6834['message'],'category':STATIC_ANALYSIS['CATEGORY']['SYNTAX'],'fixable':![],'source':_0x17febe(0x1e3),'code':_0x3e6834['source']||undefined};}[a0_0x5836a2(0x201)](_0x6e9d4f){const _0x4d6675=a0_0x5836a2;if(!_0x6e9d4f)return STATIC_ANALYSIS['CATEGORY'][_0x4d6675(0x1ff)];const _0x1fc636=_0x6e9d4f['toLowerCase']();if(_0x1fc636['includes']('no-invalid')||_0x1fc636['includes']('no-unknown')||_0x1fc636['includes']('no-empty')||_0x1fc636['includes']('syntax'))return STATIC_ANALYSIS['CATEGORY'][_0x4d6675(0x210)];if(_0x1fc636[_0x4d6675(0x1db)]('performance')||_0x1fc636[_0x4d6675(0x1db)]('optimize'))return STATIC_ANALYSIS['CATEGORY'][_0x4d6675(0x1ea)];if(_0x1fc636[_0x4d6675(0x1db)]('best-practice')||_0x1fc636[_0x4d6675(0x1db)](_0x4d6675(0x20c)))return STATIC_ANALYSIS['CATEGORY']['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x4d6675(0x209)]['STYLE'];}['detectLanguage'](_0x409716){const _0xefefa7=a0_0x5836a2,_0x2e1b2e=_0x409716['toLowerCase']();if(_0x2e1b2e[_0xefefa7(0x214)]('.scss')||_0x2e1b2e[_0xefefa7(0x214)]('.sass'))return'scss';if(_0x2e1b2e[_0xefefa7(0x214)]('.less'))return'less';return _0xefefa7(0x216);}[a0_0x5836a2(0x1f4)](){const _0x41c655=a0_0x5836a2;return[_0x41c655(0x21b),'.scss','.sass',_0x41c655(0x1f9)];}[a0_0x5836a2(0x1ec)](){return![];}}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_0x271c1c=a0_0x5021;(function(_0x150aa3,_0x483e44){const _0x3fd058=a0_0x5021,_0x35e91b=_0x150aa3();while(!![]){try{const _0x2eafc8=parseInt(_0x3fd058(0x131))/0x1+-parseInt(_0x3fd058(0x153))/0x2+parseInt(_0x3fd058(0x189))/0x3+-parseInt(_0x3fd058(0x161))/0x4*(parseInt(_0x3fd058(0x142))/0x5)+-parseInt(_0x3fd058(0x16f))/0x6+parseInt(_0x3fd058(0x19b))/0x7+parseInt(_0x3fd058(0x192))/0x8*(parseInt(_0x3fd058(0x134))/0x9);if(_0x2eafc8===_0x483e44)break;else _0x35e91b['push'](_0x35e91b['shift']());}catch(_0xbd959){_0x35e91b['push'](_0x35e91b['shift']());}}}(a0_0x4ada,0x83457));import{exec}from'child_process';import{promisify}from'util';function a0_0x4ada(){const _0x288d8b=['u0vwrvjjvfK','D2fYBG','nde4mdq2m21ct3D6CG','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','zxjYB3i','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','CgfJA2fNzs5QC29U','CgLWigLUC3rHBgWGEwfTBgXPBNq','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','y2HLy2TVDG','ANnVBI1Zy2HLBwe','lNLTBa','z2L0AhvIlwfJDgLVBNm','sw52ywXPzcbku09ooIa','AgfKB2XPBNq','zg9JA2vYzMLSzq','Aw5ZDgfUy2vqyxrO','C3rKB3v0','C3bSAxq','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','DMfSAwrHDgvzqu1m','nJC5nZmZrKPeAuLh','ANnVBI1WyxjZzq','CMvTzwrPyxrPB24','mtm3nJuYm3Dcq3HIta','ANnVBLnJAgvTyq','y2HLy2TFy2XHC3m','Ew91CI1RzxKTAgvYzq','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','ywP2','yxzHAwXHyMXLu2nHBM5LCNm','DhjPBq','ChvZAa','BwfWq2HLy2TVDLnLDMvYAxr5','Bg9Nz2vY','EwfTBa','zgvIDwC','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','mtGXodvNruTbrK0','ANnVBG','y29Kzq','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','DMfSAwrHDgvxAxrOq2HLy2TVDG','BwvZC2fNzq','zxjYB3jZ','DgvYCMfMB3jT','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','zgLYBMfTzq','v0fstKLorW','DhnJB25MAwCUANnVBG','ug90zw50AwfSigHHCMrJB2rLzca','AgfKB2XPBNqGBM90igf2ywLSywjSzq','BgLUzq','mtCWode2nfbkq0Xxva','zg9JA2vYlwnVBxbVC2uUEw1S','zMLSzq','y29TCgLSzq','C2vJDxjPDhK','DMfSAwrHDgLVBG','AgfYzgnVzgvKlxnLy3jLDa','CgfYC2vdAgvJA292uMvZDwX0CW','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','y2HHBMDLBwu','BgvUz3rO','DMfSAwrHDg9Y','AgLNAa','CMvHzezPBgu','odm2wMrrqvn1','DMfSAwrHDgvfBNzgAwXL','Dg9mB3DLCKnHC2u','CgfYyw1Z','yMvZDc1WCMfJDgLJzq','BwfWwwfTBgXPBNrtzxzLCML0Eq','A3vIzxjUzxrLCW','Bgv2zwW','lMDPDgH1yI93B3jRzMXVD3m','igrLDgvJDgvKigLUic5LBNyGzMLSzq','rvjst1i','Dw5RBM93BG','BwfWsgfKB2XPBNrtzxzLCML0Eq','CgfYC2viywrVBgLUDfjLC3vSDhm','mJmXmdC1mgzlswj4uG','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','BwLZC2LUz1bYB3bLCNr5','CgfYC2u','wufntcbMAwXLihzHBgLKyxrPB24','C2nHBM5LCKnHy2HL','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','ywP2icHku09oifnJAgvTysK','C2v2zxjPDhK','EwfTBgXPBNq','BwvKAxvT','DxrMltG','C3LUDgf4','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','y2HLy2TVDIaTlxzLCNnPB24','Aw5JBhvKzxm','EwfTBgXPBNqGzgv0zwn0zwq','BM9YBwfSAxPLuMvZDwX0CW','zMLSzv9SAw5Lx3jHBMDL','y2HLy2TFAwq','C3rYAwn0lw1Vzgu','C3rYAw5N','CgLWigLUC3rHBgWGy2HLy2TVDG','zMfPBgvKx2nOzwnRCW','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','C3rHCNrZv2L0Aa','mJqWmZCZmKrZCvv4uW','CNvSzq','qvDtignYzwrLBNrPywXZ','zgv0zwn0rMLSzvr5Cgu','lNrM','lNrMDMfYCW','zg9JA2vYlwnVBxbVC2u','CMvZDwX0CW','B2jQzwn0','mJr6CMjbsLK','z3vPzgvSAw5L','CgfYC2vzyw1SBgLUDfjLC3vSDhm','ywP2lwzVCM1HDhm','C3rYAwn0','lNLHBwW','zw52lxzHBgLKyxrVCG'];a0_0x4ada=function(){return _0x288d8b;};return a0_0x4ada();}import a0_0x93ea92 from'path';import a0_0x110e41 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x40cb36=null){const _0x56703c=a0_0x5021;this['logger']=_0x40cb36,this[_0x56703c(0x13a)]=null,this[_0x56703c(0x174)]=new Map();}async[a0_0x271c1c(0x124)](){const _0x1d5fa0=a0_0x271c1c;if(this['availableScanners']!==null)return this[_0x1d5fa0(0x13a)];const _0x55ed33={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x1d5fa0(0x17d),{'timeout':0x1388}),_0x55ed33['checkov']=!![],this[_0x1d5fa0(0x13e)]?.['debug']('checkov\x20detected');}catch(_0x1a6027){this[_0x1d5fa0(0x13e)]?.[_0x1d5fa0(0x140)]('checkov\x20not\x20available',{'error':_0x1a6027[_0x1d5fa0(0x148)]});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x55ed33[_0x1d5fa0(0x12a)]=!![],this[_0x1d5fa0(0x13e)]?.[_0x1d5fa0(0x140)]('hadolint\x20detected');}catch(_0x1e12ae){this['logger']?.['debug'](_0x1d5fa0(0x151),{'error':_0x1e12ae[_0x1d5fa0(0x148)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x55ed33[_0x1d5fa0(0x178)]=!![],this['logger']?.['debug'](_0x1d5fa0(0x17f));}catch(_0x3fac13){this['logger']?.['debug']('yamllint\x20not\x20available',{'error':_0x3fac13[_0x1d5fa0(0x148)]});}try{await import(_0x1d5fa0(0x139)),_0x55ed33['jsonSchema']=!![],this['logger']?.[_0x1d5fa0(0x140)]('JSON\x20Schema\x20validation\x20available');}catch(_0xb494e0){this['logger']?.['debug']('ajv\x20not\x20available',{'error':_0xb494e0[_0x1d5fa0(0x148)]});}return this[_0x1d5fa0(0x13a)]=_0x55ed33,_0x55ed33;}async['validate'](_0x188ab1,_0x563622={}){const _0x5c2ad7=a0_0x271c1c,_0x291894=[],_0x5d68eb=await this['detectAvailableValidators'](),_0x5bfd30=this[_0x5c2ad7(0x18c)](_0x188ab1);this['logger']?.[_0x5c2ad7(0x140)](_0x5c2ad7(0x145),{'filePath':_0x188ab1,'fileType':_0x5bfd30});switch(_0x5bfd30){case'dockerfile':if(_0x5d68eb['hadolint']){const _0x16f097=await this['validateDockerfile'](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x16f097);}if(_0x5d68eb['checkov']){const _0x49f71c=await this['validateWithCheckov'](_0x188ab1,'dockerfile',_0x563622);_0x291894['push'](..._0x49f71c);}break;case _0x5c2ad7(0x18f):if(_0x5d68eb[_0x5c2ad7(0x178)]){const _0x387b8d=await this[_0x5c2ad7(0x130)](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x387b8d);}if(_0x5d68eb[_0x5c2ad7(0x125)]){const _0x59ed27=await this['validateWithCheckov'](_0x188ab1,'docker_compose',_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x59ed27);}break;case _0x5c2ad7(0x167):if(_0x5d68eb['yamllint']){const _0x30fc38=await this[_0x5c2ad7(0x130)](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x30fc38);}if(_0x5d68eb['checkov']){const _0x1bc14e=await this[_0x5c2ad7(0x147)](_0x188ab1,_0x5c2ad7(0x167),_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x1bc14e);}break;case'terraform':if(_0x5d68eb['checkov']){const _0x3a2b32=await this[_0x5c2ad7(0x147)](_0x188ab1,'terraform',_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x3a2b32);}break;case _0x5c2ad7(0x122):if(_0x5d68eb[_0x5c2ad7(0x135)]){const _0x9ca265=await this['validatePackageJson'](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x9ca265);}break;case _0x5c2ad7(0x14f):if(_0x5d68eb['jsonSchema']){const _0x520947=await this['validateTsConfig'](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x520947);}break;case _0x5c2ad7(0x128):if(_0x5d68eb['yamllint']){const _0x38f97b=await this[_0x5c2ad7(0x130)](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x38f97b);}break;case'env':const _0x4fcc23=await this[_0x5c2ad7(0x162)](_0x188ab1,_0x563622);_0x291894['push'](..._0x4fcc23);break;case'yaml':if(_0x5d68eb[_0x5c2ad7(0x178)]){const _0x235ee0=await this[_0x5c2ad7(0x130)](_0x188ab1,_0x563622);_0x291894[_0x5c2ad7(0x13c)](..._0x235ee0);}break;default:this[_0x5c2ad7(0x13e)]?.[_0x5c2ad7(0x19a)]('Unknown\x20config\x20file\x20type',{'filePath':_0x188ab1,'fileType':_0x5bfd30});return[];}return this['normalizeResults'](_0x291894);}async['validateDockerfile'](_0x9577e3,_0x2394e3={}){const _0xd8a849=a0_0x271c1c;try{const _0x28b04f=await execAsync(_0xd8a849(0x14b)+_0x9577e3+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x248246=JSON[_0xd8a849(0x172)](_0x28b04f['stdout']);return this[_0xd8a849(0x16e)](_0x248246,_0x9577e3);}catch(_0x5f1360){if(_0x5f1360['stdout'])try{const _0x1e7d03=JSON[_0xd8a849(0x172)](_0x5f1360['stdout']);return this[_0xd8a849(0x16e)](_0x1e7d03,_0x9577e3);}catch(_0x5aa668){this[_0xd8a849(0x13e)]?.[_0xd8a849(0x19d)](_0xd8a849(0x170),{'error':_0x5aa668['message']});}return this[_0xd8a849(0x13e)]?.['error'](_0xd8a849(0x187),{'error':_0x5f1360['message']}),[];}}[a0_0x271c1c(0x16e)](_0x151185,_0x4cf6b1){const _0x59ed34=a0_0x271c1c,_0x578758=[];if(Array['isArray'](_0x151185))for(const _0x5b688f of _0x151185){_0x578758[_0x59ed34(0x13c)]({'file':_0x4cf6b1,'line':_0x5b688f[_0x59ed34(0x152)]||0x1,'column':_0x5b688f['column']||0x1,'severity':this[_0x59ed34(0x16d)](_0x5b688f[_0x59ed34(0x168)]),'rule':_0x5b688f[_0x59ed34(0x144)],'message':_0x5b688f[_0x59ed34(0x148)],'category':'dockerfile','validator':_0x59ed34(0x12a)});}return _0x578758;}async['validateYAML'](_0x290904,_0x2d8d3f={}){const _0x385f1e=a0_0x271c1c;try{const _0x245937=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x290904+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x385f1e(0x194)](_0x245937[_0x385f1e(0x12d)],_0x290904);}catch(_0x38ff87){if(_0x38ff87['stdout'])return this['parseYamllintResults'](_0x38ff87[_0x385f1e(0x12d)],_0x290904);return this['logger']?.[_0x385f1e(0x19d)](_0x385f1e(0x175),{'error':_0x38ff87[_0x385f1e(0x148)]}),[];}}['parseYamllintResults'](_0x2a0aa8,_0x20f3b4){const _0x4696a2=a0_0x271c1c,_0x4ca861=[],_0x3e36c3=_0x2a0aa8[_0x4696a2(0x12e)]('\x0a')['filter'](_0x4919b2=>_0x4919b2[_0x4696a2(0x13b)]());for(const _0x525979 of _0x3e36c3){const _0x57481a=_0x525979['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x57481a){const [,_0x4bdc0e,_0xa53462,_0x3dd132,_0x2a7a59,_0x43a980,_0x2594a7]=_0x57481a;_0x4ca861['push']({'file':_0x20f3b4,'line':parseInt(_0xa53462,0xa),'column':parseInt(_0x3dd132,0xa),'severity':this[_0x4696a2(0x166)](_0x2a7a59),'rule':_0x2594a7,'message':_0x43a980,'category':'yaml','validator':'yamllint'});}}return _0x4ca861;}async[a0_0x271c1c(0x147)](_0x48d896,_0x54ab1c,_0x289402={}){const _0x202575=a0_0x271c1c;try{const _0x41fee9=await execAsync('checkov\x20-f\x20\x22'+_0x48d896+'\x22\x20--framework\x20'+_0x54ab1c+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x554e8d=JSON[_0x202575(0x172)](_0x41fee9[_0x202575(0x12d)]);return this[_0x202575(0x15a)](_0x554e8d,_0x48d896);}catch(_0x8dcb7a){if(_0x8dcb7a['stdout'])try{const _0xf71fad=JSON[_0x202575(0x172)](_0x8dcb7a['stdout']);return this['parseCheckovResults'](_0xf71fad,_0x48d896);}catch(_0x8bbe2d){this['logger']?.[_0x202575(0x19d)](_0x202575(0x121),{'error':_0x8bbe2d[_0x202575(0x148)]});}return this[_0x202575(0x13e)]?.[_0x202575(0x19d)]('checkov\x20validation\x20failed',{'error':_0x8dcb7a[_0x202575(0x148)]}),[];}}[a0_0x271c1c(0x15a)](_0x4009dc,_0xe45095){const _0x11f162=a0_0x271c1c,_0x19125e=[];if(_0x4009dc['results']&&_0x4009dc['results'][_0x11f162(0x186)])for(const _0x2b627e of _0x4009dc[_0x11f162(0x190)][_0x11f162(0x186)]){_0x19125e[_0x11f162(0x13c)]({'file':_0xe45095,'line':_0x2b627e['file_line_range']?_0x2b627e[_0x11f162(0x181)][0x0]:0x1,'column':0x1,'severity':this[_0x11f162(0x13d)](_0x2b627e[_0x11f162(0x136)]),'rule':_0x2b627e['check_id'],'message':_0x2b627e['check_name']||_0x2b627e[_0x11f162(0x182)],'category':_0x11f162(0x157),'validator':'checkov','remediation':_0x2b627e[_0x11f162(0x193)],'cwe':_0x2b627e['cwe'],'references':_0x2b627e[_0x11f162(0x193)]?[_0x2b627e['guideline']]:[]});}return _0x19125e;}async['validatePackageJson'](_0x99a87f,_0x319cd9={}){const _0x4902b3=a0_0x271c1c;try{const _0x44ae93=(await import(_0x4902b3(0x139)))['default'],_0x27c9f=(await import(_0x4902b3(0x195)))['default'],_0x22a26e=await a0_0x110e41['readFile'](_0x99a87f,'utf-8'),_0x9caa7c=JSON[_0x4902b3(0x172)](_0x22a26e),_0x421efd=new _0x44ae93({'allErrors':!![],'strict':![]});_0x27c9f(_0x421efd);const _0x4a88bd={'type':'object','required':['name','version'],'properties':{'name':{'type':_0x4902b3(0x184),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':'string'},'description':{'type':'string'},'main':{'type':_0x4902b3(0x184)},'type':{'type':'string','enum':['module','commonjs']},'scripts':{'type':_0x4902b3(0x191)},'dependencies':{'type':'object'},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0x117cc3=_0x421efd[_0x4902b3(0x156)](_0x4a88bd),_0x1599e6=_0x117cc3(_0x9caa7c);if(!_0x1599e6&&_0x117cc3['errors'])return _0x117cc3[_0x4902b3(0x149)]['map'](_0x45bab5=>({'file':_0x99a87f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x4902b3(0x16b)],'rule':_0x4902b3(0x126),'message':_0x45bab5[_0x4902b3(0x12c)]?_0x45bab5['instancePath']+'\x20'+_0x45bab5[_0x4902b3(0x148)]:_0x4902b3(0x15b)+_0x45bab5[_0x4902b3(0x164)][_0x4902b3(0x171)]+'\x27','category':_0x4902b3(0x158),'validator':'json-schema'}));return[];}catch(_0x10fe52){return this[_0x4902b3(0x13e)]?.[_0x4902b3(0x19d)](_0x4902b3(0x19c),{'error':_0x10fe52['message']}),[{'file':_0x99a87f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4902b3(0x199)]['ERROR'],'rule':'json-parse','message':_0x4902b3(0x129)+_0x10fe52['message'],'category':_0x4902b3(0x17b),'validator':_0x4902b3(0x132)}];}}async['validateTsConfig'](_0x357c41,_0x41bc21={}){const _0x3e3687=a0_0x271c1c;try{const _0x4cebac=await a0_0x110e41[_0x3e3687(0x160)](_0x357c41,_0x3e3687(0x17a)),_0x30e347=JSON[_0x3e3687(0x172)](_0x4cebac),_0x1dbcdf=[];if(_0x30e347['compilerOptions']){const _0xbb4db1=_0x30e347['compilerOptions'];!_0xbb4db1[_0x3e3687(0x196)]&&_0x1dbcdf[_0x3e3687(0x13c)]({'file':_0x357c41,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x3e3687(0x183),'message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':_0x3e3687(0x165),'validator':'tsconfig-validator'}),_0xbb4db1['noImplicitAny']===![]&&_0x1dbcdf[_0x3e3687(0x13c)]({'file':_0x357c41,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x3e3687(0x14e)],'rule':'no-implicit-any','message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x1dbcdf;}catch(_0x254da7){return this[_0x3e3687(0x13e)]?.[_0x3e3687(0x19d)](_0x3e3687(0x17c),{'error':_0x254da7['message']}),[{'file':_0x357c41,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x3e3687(0x199)][_0x3e3687(0x16b)],'rule':_0x3e3687(0x132),'message':_0x3e3687(0x129)+_0x254da7[_0x3e3687(0x148)],'category':_0x3e3687(0x17b),'validator':'json-parse'}];}}async[a0_0x271c1c(0x162)](_0x159fcd,_0x44c65b={}){const _0x364880=a0_0x271c1c;try{const _0x3da7ca=await a0_0x110e41['readFile'](_0x159fcd,_0x364880(0x17a)),_0x2448d0=[],_0x2e9558=_0x3da7ca['split']('\x0a'),_0x5d904c=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x364880(0x18b)}];return _0x2e9558['forEach']((_0x10d18a,_0x4c0113)=>{const _0x2f1145=_0x364880,_0x1e221d=_0x10d18a[_0x2f1145(0x13b)]();if(!_0x1e221d||_0x1e221d['startsWith']('#'))return;if(_0x1e221d[_0x2f1145(0x17e)]('=')){const [_0x3e6bec,_0x54a176]=_0x1e221d[_0x2f1145(0x12e)]('='),_0x2c5db5=_0x3e6bec['toLowerCase'](),_0x305bd2=_0x54a176?.[_0x2f1145(0x13b)]()||'',_0x22f52a=_0x305bd2&&_0x305bd2!==''&&!_0x305bd2[_0x2f1145(0x188)]('$')&&_0x305bd2!==_0x2f1145(0x137)&&_0x305bd2!==_0x2f1145(0x15c)&&_0x305bd2[_0x2f1145(0x15d)]>0x5;if(_0x22f52a)for(const {pattern:_0x1c11eb,name:_0x52ba33}of _0x5d904c){if(_0x1c11eb['test'](_0x2c5db5)){_0x2448d0[_0x2f1145(0x13c)]({'file':_0x159fcd,'line':_0x4c0113+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2f1145(0x199)]['CRITICAL'],'rule':_0x2f1145(0x159),'message':_0x2f1145(0x150)+_0x52ba33+_0x2f1145(0x16a),'category':'security','validator':_0x2f1145(0x198),'remediation':_0x2f1145(0x138)});break;}}}}),_0x2448d0;}catch(_0x2b68ba){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x2b68ba['message']}),[];}}[a0_0x271c1c(0x18c)](_0x2a2f02){const _0x5e3951=a0_0x271c1c,_0x56546a=a0_0x93ea92['basename'](_0x2a2f02)[_0x5e3951(0x163)](),_0x5ecc41=a0_0x93ea92[_0x5e3951(0x14d)](_0x2a2f02);if(_0x56546a==='dockerfile')return _0x5e3951(0x12b);if(_0x56546a===_0x5e3951(0x154)||_0x56546a==='docker-compose.yaml')return'docker-compose';if(_0x56546a===_0x5e3951(0x122))return'package.json';if(_0x56546a==='tsconfig.json')return'tsconfig.json';if(_0x56546a==='.env'||_0x56546a['endsWith']('.env'))return'env';if(_0x5ecc41[_0x5e3951(0x17e)](_0x5e3951(0x169)))return _0x5e3951(0x128);if(_0x5ecc41[_0x5e3951(0x17e)]('kubernetes')||_0x5ecc41[_0x5e3951(0x17e)]('k8s'))return _0x5e3951(0x167);const _0x5e9b88=a0_0x93ea92['extname'](_0x2a2f02)[_0x5e3951(0x163)]();if(_0x5e9b88===_0x5e3951(0x18d)||_0x5e9b88===_0x5e3951(0x18e))return _0x5e3951(0x14a);if(_0x5e9b88===_0x5e3951(0x127)||_0x5e9b88===_0x5e3951(0x197))return _0x5e3951(0x13f);if(_0x5e9b88==='.json')return _0x5e3951(0x143);return _0x5e3951(0x16c);}[a0_0x271c1c(0x180)](_0x4b4264){const _0x7f6348=a0_0x271c1c;return _0x4b4264['map'](_0x2469f7=>({'file':_0x2469f7[_0x7f6348(0x155)],'line':_0x2469f7[_0x7f6348(0x152)]||0x1,'column':_0x2469f7['column']||0x1,'severity':_0x2469f7[_0x7f6348(0x177)]||STATIC_ANALYSIS['SEVERITY'][_0x7f6348(0x14e)],'rule':_0x2469f7[_0x7f6348(0x18a)]||_0x7f6348(0x16c),'message':_0x2469f7[_0x7f6348(0x148)]||_0x7f6348(0x146),'category':_0x2469f7['category']||_0x7f6348(0x158),'validator':_0x2469f7[_0x7f6348(0x15e)],'cwe':_0x2469f7['cwe']||null,'remediation':_0x2469f7[_0x7f6348(0x133)]||null,'references':_0x2469f7['references']||[]}));}['mapHadolintSeverity'](_0xc2cdbc){const _0x109218=a0_0x271c1c,_0x1e8ac4={'error':STATIC_ANALYSIS[_0x109218(0x199)]['ERROR'],'warning':STATIC_ANALYSIS[_0x109218(0x199)][_0x109218(0x14e)],'info':STATIC_ANALYSIS[_0x109218(0x199)]['INFO'],'style':STATIC_ANALYSIS['SEVERITY']['INFO']};return _0x1e8ac4[_0xc2cdbc?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapYamllintSeverity'](_0x2e9f96){const _0x5cfb55=a0_0x271c1c,_0x2a0b46={'error':STATIC_ANALYSIS[_0x5cfb55(0x199)][_0x5cfb55(0x16b)],'warning':STATIC_ANALYSIS[_0x5cfb55(0x199)]['WARNING']};return _0x2a0b46[_0x2e9f96?.[_0x5cfb55(0x163)]()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapCheckovSeverity'](_0x2565df){const _0x551de5=a0_0x271c1c;return STATIC_ANALYSIS['SEVERITY'][_0x551de5(0x16b)];}async['getValidatorStatus'](){const _0x52bd9f=a0_0x271c1c,_0x5512a8=await this[_0x52bd9f(0x124)]();return{'validators':_0x5512a8,'recommendations':this['getInstallRecommendations'](_0x5512a8)};}[a0_0x271c1c(0x141)](_0x235060){const _0x3cfe23=a0_0x271c1c,_0x2219a4=[];return!_0x235060[_0x3cfe23(0x125)]&&_0x2219a4['push']({'validator':_0x3cfe23(0x125),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':_0x3cfe23(0x185),'priority':_0x3cfe23(0x15f)}),!_0x235060[_0x3cfe23(0x12a)]&&_0x2219a4[_0x3cfe23(0x13c)]({'validator':_0x3cfe23(0x12a),'reason':_0x3cfe23(0x14c),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x235060[_0x3cfe23(0x178)]&&_0x2219a4[_0x3cfe23(0x13c)]({'validator':'yamllint','reason':_0x3cfe23(0x173),'install':_0x3cfe23(0x123),'priority':_0x3cfe23(0x179)}),!_0x235060['jsonSchema']&&_0x2219a4['push']({'validator':_0x3cfe23(0x176),'reason':_0x3cfe23(0x12f),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x2219a4;}}function a0_0x5021(_0x3396ca,_0x5c3ac4){_0x3396ca=_0x3396ca-0x121;const _0x4ada90=a0_0x4ada();let _0x50214b=_0x4ada90[_0x3396ca];if(a0_0x5021['VFySla']===undefined){var _0x1d674f=function(_0x3ef6a6){const _0x47f929='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x93ea92='',_0x110e41='';for(let _0x40cb36=0x0,_0x55ed33,_0x1a6027,_0x1e12ae=0x0;_0x1a6027=_0x3ef6a6['charAt'](_0x1e12ae++);~_0x1a6027&&(_0x55ed33=_0x40cb36%0x4?_0x55ed33*0x40+_0x1a6027:_0x1a6027,_0x40cb36++%0x4)?_0x93ea92+=String['fromCharCode'](0xff&_0x55ed33>>(-0x2*_0x40cb36&0x6)):0x0){_0x1a6027=_0x47f929['indexOf'](_0x1a6027);}for(let _0x3fac13=0x0,_0xb494e0=_0x93ea92['length'];_0x3fac13<_0xb494e0;_0x3fac13++){_0x110e41+='%'+('00'+_0x93ea92['charCodeAt'](_0x3fac13)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x110e41);};a0_0x5021['JqVOCZ']=_0x1d674f,a0_0x5021['eBVWXp']={},a0_0x5021['VFySla']=!![];}const _0x2ac695=_0x4ada90[0x0],_0x40356a=_0x3396ca+_0x2ac695,_0x471e62=a0_0x5021['eBVWXp'][_0x40356a];return!_0x471e62?(_0x50214b=a0_0x5021['JqVOCZ'](_0x50214b),a0_0x5021['eBVWXp'][_0x40356a]=_0x50214b):_0x50214b=_0x471e62,_0x50214b;}export default ConfigValidator;
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
- function a0_0x59db(){const _0x1f8d38=['Bw9KAwzPzwq','lMPZ','mZyZotG0ofHKs0fTvW','B2zM','y2f0zwDVCML6zvj1Bgu','BgvUz3rO','zM9YBwf0twvZC2fNzq','rvnmAw50igfUywX5C2LZigzHAwXLza','u0vwrvjjvfK','BwvZC2fNzq','mtaXmtG3mtbuu2fxzMW','mw9wz29YEq','C2LUz2XL','u1rzteu','zML4ywjSzuvYCM9Yq291BNq','lMvZBgLUDhjJlMnQCW','zxnSAw50','BgLUzq','zw5KtgLUzq','rvnmAw50igzPEcbMywLSzwq6ia','y29SDw1U','v0fstKLorW','D2fYBG','C2v2zxjPDhK','Aw5JBhvKzxm','DNvL','mJG2mdjXwgzpse4','nZzPqxrqzKK','EhnZ','BM8TAw1WBgLLzc1LDMfS','mtuYndnvu3DwCKK','zML4ywjSzvDHCM5PBMDdB3vUDa','zxjYB3i','C3bSAxq','Bw9KDwXL','BgLUDfrLEhq','uevsrK9stufoq0u','mtGXndKZmxHqBLvuyq','z2v0rvnmAw50sw5ZDgfUy2u','Bgf0zxn0','ChjLzMvYlxbYB21PC2uTCMvQzwn0lwvYCM9YCW','z2v0rvnmAw50q29UzMLN','q0furuDpuLK','zgvZy3jPyMvdAgfUz2vZ','mtG5tujMvw9t','mJqXnta0mg14vvnJCW','CNvSzuLK','rvjst1i','Bg9Nz2vY','nZy2ndy2yvfKv3zM','ywnJzxnZ','CgvYzM9YBwfUy2u','D2fYBMLUz0nVDw50','zgvIDwC','AM9PBG','su1qt1ju','ChvZAa','BwvZC2fNzxm'];a0_0x59db=function(){return _0x1f8d38;};return a0_0x59db();}const a0_0x3d73b8=a0_0x4edd;(function(_0x3cd62b,_0x39a271){const _0x5c9d04=a0_0x4edd,_0x1d1767=_0x3cd62b();while(!![]){try{const _0x198261=parseInt(_0x5c9d04(0x1c7))/0x1*(parseInt(_0x5c9d04(0x1b3))/0x2)+-parseInt(_0x5c9d04(0x1a0))/0x3*(parseInt(_0x5c9d04(0x19d))/0x4)+-parseInt(_0x5c9d04(0x1af))/0x5+parseInt(_0x5c9d04(0x19c))/0x6*(parseInt(_0x5c9d04(0x1ae))/0x7)+-parseInt(_0x5c9d04(0x1be))/0x8+-parseInt(_0x5c9d04(0x1a7))/0x9+parseInt(_0x5c9d04(0x1c6))/0xa;if(_0x198261===_0x39a271)break;else _0x1d1767['push'](_0x1d1767['shift']());}catch(_0xc3cd36){_0x1d1767['push'](_0x1d1767['shift']());}}}(a0_0x59db,0x4638a));import{ESLint}from'eslint';import a0_0x11cbaf from'path';function a0_0x4edd(_0x519aad,_0x24fb0a){_0x519aad=_0x519aad-0x19b;const _0x59dbe9=a0_0x59db();let _0x4eddda=_0x59dbe9[_0x519aad];if(a0_0x4edd['jBwMIm']===undefined){var _0x461126=function(_0x512250){const _0x4bf6a1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11cbaf='',_0xa75e8='';for(let _0x293df6=0x0,_0x2883b9,_0x5a205d,_0x52e105=0x0;_0x5a205d=_0x512250['charAt'](_0x52e105++);~_0x5a205d&&(_0x2883b9=_0x293df6%0x4?_0x2883b9*0x40+_0x5a205d:_0x5a205d,_0x293df6++%0x4)?_0x11cbaf+=String['fromCharCode'](0xff&_0x2883b9>>(-0x2*_0x293df6&0x6)):0x0){_0x5a205d=_0x4bf6a1['indexOf'](_0x5a205d);}for(let _0x29af81=0x0,_0x2c5573=_0x11cbaf['length'];_0x29af81<_0x2c5573;_0x29af81++){_0xa75e8+='%'+('00'+_0x11cbaf['charCodeAt'](_0x29af81)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xa75e8);};a0_0x4edd['UnqNYi']=_0x461126,a0_0x4edd['HrbnfB']={},a0_0x4edd['jBwMIm']=!![];}const _0x1e441b=_0x59dbe9[0x0],_0x43eaf4=_0x519aad+_0x1e441b,_0x102b2f=a0_0x4edd['HrbnfB'][_0x43eaf4];return!_0x102b2f?(_0x4eddda=a0_0x4edd['UnqNYi'](_0x4eddda),a0_0x4edd['HrbnfB'][_0x43eaf4]=_0x4eddda):_0x4eddda=_0x102b2f,_0x4eddda;}import a0_0xa75e8 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x293df6=null){const _0x348ff5=a0_0x4edd;this[_0x348ff5(0x1b2)]=_0x293df6,this['eslintCache']=new Map();}async['analyze'](_0x2883b9,_0x5a205d,_0x52e105={}){const _0x52aabc=a0_0x4edd;try{const _0x29af81=await this['getESLintInstance'](_0x52e105),_0x2c5573=await _0x29af81[_0x52aabc(0x1a5)](_0x5a205d,{'filePath':_0x2883b9,'warnIgnored':![]}),_0x2b5dec=[];if(_0x2c5573&&_0x2c5573['length']>0x0){const _0x31b0c9=_0x2c5573[0x0];for(const _0x540d38 of _0x31b0c9[_0x52aabc(0x1bb)]){_0x2b5dec['push'](this[_0x52aabc(0x1c2)](_0x540d38,_0x2883b9));}}return this[_0x52aabc(0x1b2)]?.[_0x52aabc(0x1b7)]('ESLint\x20analysis\x20completed',{'file':_0x2883b9,'totalDiagnostics':_0x2b5dec['length'],'errors':_0x2b5dec['filter'](_0x30eb4f=>_0x30eb4f[_0x52aabc(0x1d3)]===STATIC_ANALYSIS[_0x52aabc(0x1c4)][_0x52aabc(0x1b1)])[_0x52aabc(0x1c1)],'warnings':_0x2b5dec['filter'](_0x158139=>_0x158139[_0x52aabc(0x1d3)]===STATIC_ANALYSIS[_0x52aabc(0x1c4)]['WARNING'])[_0x52aabc(0x1c1)]}),_0x2b5dec;}catch(_0x2a7838){return this['logger']?.[_0x52aabc(0x1a2)](_0x52aabc(0x1c3),{'file':_0x2883b9,'error':_0x2a7838[_0x52aabc(0x1c5)]}),[];}}async['fix'](_0x504b57,_0x2a5a8c,_0x3a0e10={}){const _0x17fe40=a0_0x4edd;try{const _0x4e8124=await this[_0x17fe40(0x1a8)]({..._0x3a0e10,'fix':!![]}),_0x757de6=await _0x4e8124[_0x17fe40(0x1a5)](_0x2a5a8c,{'filePath':_0x504b57,'warnIgnored':![]});if(_0x757de6&&_0x757de6[_0x17fe40(0x1c1)]>0x0){const _0x5773dc=_0x757de6[0x0];return{'fixed':_0x5773dc['output']!==undefined,'content':_0x5773dc['output']||_0x2a5a8c,'fixedCount':_0x5773dc[_0x17fe40(0x1ca)]+_0x5773dc[_0x17fe40(0x1a1)],'remainingErrors':_0x5773dc['errorCount']-_0x5773dc[_0x17fe40(0x1ca)],'remainingWarnings':_0x5773dc[_0x17fe40(0x1b6)]-_0x5773dc['fixableWarningCount'],'changes':_0x5773dc['output']?this[_0x17fe40(0x1ad)](_0x2a5a8c,_0x5773dc['output']):[]};}return{'fixed':![],'content':_0x2a5a8c,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x1966d2){this['logger']?.[_0x17fe40(0x1a2)]('ESLint\x20fix\x20failed',{'file':_0x504b57,'error':_0x1966d2['message']});throw new Error(_0x17fe40(0x1cf)+_0x1966d2[_0x17fe40(0x1c5)]);}}async[a0_0x3d73b8(0x1a8)](_0x2fb71a={}){const _0x29b291=a0_0x3d73b8,{workingDir:_0x21dd00,fix:fix=![],framework:_0x3c8474}=_0x2fb71a,_0x40f5eb=await this[_0x29b291(0x1ab)](_0x21dd00,_0x3c8474),_0x52302d=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x40f5eb,'errorOnUnmatchedPattern':![]});return _0x52302d;}async[a0_0x3d73b8(0x1ab)](_0x2f02b7,_0x382ebd){const _0x49264f=a0_0x3d73b8,_0x336266={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':_0x49264f(0x1a9),'sourceType':_0x49264f(0x1a4)},'rules':{'no-unused-vars':_0x49264f(0x1d2),'no-undef':'error','no-console':_0x49264f(0x1bf),'semi':['warn','always'],'quotes':[_0x49264f(0x1d2),_0x49264f(0x1c8),{'avoidEscape':!![]}]}};if(_0x382ebd==='react')_0x336266['extends']=['eslint:recommended'],_0x336266['parserOptions']['ecmaFeatures']={'jsx':!![]},_0x336266['settings']={'react':{'version':'detect'}};else _0x382ebd===_0x49264f(0x19b)?_0x336266['extends']=['eslint:recommended']:_0x336266['extends']=['eslint:recommended'];if(_0x2f02b7){const _0x9dc53a=['.eslintrc.js',_0x49264f(0x1cb),'.eslintrc.json','eslint.config.js'];for(const _0x5b3061 of _0x9dc53a){try{const _0xc4a375=a0_0x11cbaf[_0x49264f(0x1b8)](_0x2f02b7,_0x5b3061);return await a0_0xa75e8[_0x49264f(0x1b4)](_0xc4a375),this['logger']?.[_0x49264f(0x1b7)]('Found\x20ESLint\x20config',{'configFile':_0x5b3061}),{};}catch{}}}return _0x336266;}['formatMessage'](_0x32acf0,_0x451480){const _0x1905ee=a0_0x3d73b8;return{'file':_0x451480,'line':_0x32acf0[_0x1905ee(0x1cd)]||0x1,'column':_0x32acf0[_0x1905ee(0x1d0)]||0x1,'endLine':_0x32acf0[_0x1905ee(0x1ce)],'endColumn':_0x32acf0['endColumn'],'severity':_0x32acf0['severity']===0x2?STATIC_ANALYSIS[_0x1905ee(0x1c4)][_0x1905ee(0x1b1)]:STATIC_ANALYSIS[_0x1905ee(0x1c4)][_0x1905ee(0x1d1)],'rule':_0x32acf0[_0x1905ee(0x1b0)]||'eslint','message':_0x32acf0[_0x1905ee(0x1c5)],'category':this['categorizeRule'](_0x32acf0['ruleId']),'fixable':_0x32acf0['fix']!==undefined,'source':_0x1905ee(0x1cc)};}[a0_0x3d73b8(0x1c0)](_0x56ed0c){const _0x21fbe5=a0_0x3d73b8;if(!_0x56ed0c)return STATIC_ANALYSIS[_0x21fbe5(0x1ac)][_0x21fbe5(0x1c9)];if(_0x56ed0c['includes']('security')||_0x56ed0c[_0x21fbe5(0x1d4)](_0x21fbe5(0x19e))||_0x56ed0c==='no-eval'||_0x56ed0c===_0x21fbe5(0x19f))return STATIC_ANALYSIS[_0x21fbe5(0x1ac)]['SECURITY'];if(_0x56ed0c[_0x21fbe5(0x1d4)](_0x21fbe5(0x1b5))||_0x56ed0c==='no-await-in-loop'||_0x56ed0c===_0x21fbe5(0x1aa))return STATIC_ANALYSIS['CATEGORY'][_0x21fbe5(0x1a6)];if(_0x56ed0c['includes']('import')||_0x56ed0c==='no-undef')return STATIC_ANALYSIS[_0x21fbe5(0x1ac)][_0x21fbe5(0x1b9)];if(_0x56ed0c['includes']('best-practices')||_0x56ed0c==='no-unused-vars'||_0x56ed0c==='no-unreachable'||_0x56ed0c==='no-var')return STATIC_ANALYSIS[_0x21fbe5(0x1ac)]['BEST_PRACTICE'];return STATIC_ANALYSIS[_0x21fbe5(0x1ac)]['STYLE'];}[a0_0x3d73b8(0x1ad)](_0xf16068,_0x5e957e){const _0x15ff5b=a0_0x3d73b8,_0x1c597e=[],_0x496840=_0xf16068['split']('\x0a'),_0x2c6f15=_0x5e957e[_0x15ff5b(0x1a3)]('\x0a'),_0x559a34=Math['max'](_0x496840[_0x15ff5b(0x1c1)],_0x2c6f15['length']);for(let _0x46e57c=0x0;_0x46e57c<_0x559a34;_0x46e57c++){const _0x68bbc5=_0x496840[_0x46e57c]||'',_0x4c2394=_0x2c6f15[_0x46e57c]||'';_0x68bbc5!==_0x4c2394&&_0x1c597e[_0x15ff5b(0x1ba)]({'line':_0x46e57c+0x1,'type':_0x68bbc5&&_0x4c2394?_0x15ff5b(0x1bc):_0x68bbc5?'removed':'added','original':_0x68bbc5,'fixed':_0x4c2394});}return _0x1c597e;}['getSupportedExtensions'](){const _0x1d7cd7=a0_0x3d73b8;return[_0x1d7cd7(0x1bd),'.jsx','.mjs','.cjs'];}['supportsAutoFix'](){return!![];}}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;