@loxia-labs/loxia-autopilot-one 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.js +1 -1
  3. package/bin/loxia-terminal-v2.js +1 -1
  4. package/bin/loxia-terminal.js +1 -1
  5. package/bin/start-with-terminal.js +1 -1
  6. package/package.json +1 -1
  7. package/scripts/install-scanners.js +1 -1
  8. package/src/analyzers/CSSAnalyzer.js +1 -1
  9. package/src/analyzers/ConfigValidator.js +1 -1
  10. package/src/analyzers/ESLintAnalyzer.js +1 -1
  11. package/src/analyzers/JavaScriptAnalyzer.js +1 -1
  12. package/src/analyzers/PrettierFormatter.js +1 -1
  13. package/src/analyzers/PythonAnalyzer.js +1 -1
  14. package/src/analyzers/SecurityAnalyzer.js +1 -1
  15. package/src/analyzers/TypeScriptAnalyzer.js +1 -1
  16. package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
  17. package/src/analyzers/codeCloneDetector/detector.js +1 -1
  18. package/src/analyzers/codeCloneDetector/index.js +1 -1
  19. package/src/analyzers/codeCloneDetector/parser.js +1 -1
  20. package/src/analyzers/codeCloneDetector/reporter.js +1 -1
  21. package/src/analyzers/codeCloneDetector/scanner.js +1 -1
  22. package/src/core/agentPool.js +1 -1
  23. package/src/core/agentScheduler.js +1 -1
  24. package/src/core/contextManager.js +1 -1
  25. package/src/core/messageProcessor.js +1 -1
  26. package/src/core/orchestrator.js +1 -1
  27. package/src/core/stateManager.js +1 -1
  28. package/src/index.js +1 -1
  29. package/src/interfaces/cli.js +1 -1
  30. package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
  31. package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
  32. package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
  33. package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
  34. package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
  35. package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
  36. package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
  37. package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
  38. package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
  39. package/src/interfaces/terminal/api/apiClient.js +1 -1
  40. package/src/interfaces/terminal/api/messageRouter.js +1 -1
  41. package/src/interfaces/terminal/api/session.js +1 -1
  42. package/src/interfaces/terminal/api/websocket.js +1 -1
  43. package/src/interfaces/terminal/components/AgentCreator.js +1 -1
  44. package/src/interfaces/terminal/components/AgentEditor.js +1 -1
  45. package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
  46. package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
  47. package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
  48. package/src/interfaces/terminal/components/Header.js +1 -1
  49. package/src/interfaces/terminal/components/HelpPanel.js +1 -1
  50. package/src/interfaces/terminal/components/InputBox.js +1 -1
  51. package/src/interfaces/terminal/components/Layout.js +1 -1
  52. package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
  53. package/src/interfaces/terminal/components/MessageList.js +1 -1
  54. package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
  55. package/src/interfaces/terminal/components/SearchPanel.js +1 -1
  56. package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
  57. package/src/interfaces/terminal/components/StatusBar.js +1 -1
  58. package/src/interfaces/terminal/components/TextInput.js +1 -1
  59. package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
  60. package/src/interfaces/terminal/config/constants.js +1 -1
  61. package/src/interfaces/terminal/index.js +1 -1
  62. package/src/interfaces/terminal/state/useAgentControl.js +1 -1
  63. package/src/interfaces/terminal/state/useAgents.js +1 -1
  64. package/src/interfaces/terminal/state/useConnection.js +1 -1
  65. package/src/interfaces/terminal/state/useMessages.js +1 -1
  66. package/src/interfaces/terminal/state/useTools.js +1 -1
  67. package/src/interfaces/terminal/utils/debugLogger.js +1 -1
  68. package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
  69. package/src/interfaces/terminal/utils/theme.js +1 -1
  70. package/src/interfaces/webServer.js +1 -1
  71. package/src/modules/fileExplorer/controller.js +1 -1
  72. package/src/modules/fileExplorer/index.js +1 -1
  73. package/src/modules/fileExplorer/middleware.js +1 -1
  74. package/src/modules/fileExplorer/routes.js +1 -1
  75. package/src/services/aiService.js +1 -1
  76. package/src/services/apiKeyManager.js +1 -1
  77. package/src/services/benchmarkService.js +1 -1
  78. package/src/services/budgetService.js +1 -1
  79. package/src/services/contextInjectionService.js +1 -1
  80. package/src/services/conversationCompactionService.js +1 -1
  81. package/src/services/errorHandler.js +1 -1
  82. package/src/services/fileAttachmentService.js +1 -1
  83. package/src/services/modelRouterService.js +1 -1
  84. package/src/services/modelsService.js +1 -1
  85. package/src/services/qualityInspector.js +1 -1
  86. package/src/services/tokenCountingService.js +1 -1
  87. package/src/tools/agentCommunicationTool.js +1 -1
  88. package/src/tools/agentDelayTool.js +1 -1
  89. package/src/tools/asyncToolManager.js +1 -1
  90. package/src/tools/baseTool.js +1 -1
  91. package/src/tools/browserTool.js +1 -1
  92. package/src/tools/cloneDetectionTool.js +1 -1
  93. package/src/tools/dependencyResolverTool.js +1 -1
  94. package/src/tools/fileContentReplaceTool.js +1 -1
  95. package/src/tools/fileSystemTool.js +1 -1
  96. package/src/tools/fileTreeTool.js +1 -1
  97. package/src/tools/imageTool.js +1 -1
  98. package/src/tools/importAnalyzerTool.js +1 -1
  99. package/src/tools/jobDoneTool.js +1 -1
  100. package/src/tools/seekTool.js +1 -1
  101. package/src/tools/staticAnalysisTool.js +1 -1
  102. package/src/tools/taskManagerTool.js +1 -1
  103. package/src/tools/terminalTool.js +1 -1
  104. package/src/tools/webTool.js +1 -1
  105. package/src/types/agent.js +1 -1
  106. package/src/types/contextReference.js +1 -1
  107. package/src/types/conversation.js +1 -1
  108. package/src/types/toolCommand.js +1 -1
  109. package/src/utilities/attachmentValidator.js +1 -1
  110. package/src/utilities/configManager.js +1 -1
  111. package/src/utilities/constants.js +1 -1
  112. package/src/utilities/directoryAccessManager.js +1 -1
  113. package/src/utilities/fileProcessor.js +1 -1
  114. package/src/utilities/logger.js +1 -1
  115. package/src/utilities/tagParser.js +1 -1
  116. package/src/utilities/toolConstants.js +1 -1
  117. package/web-ui/build/index.html +2 -2
  118. package/web-ui/build/static/{index-CoRE46V-.js → index-C5X7qBNF.js} +63 -63
  119. package/web-ui/build/static/index-g2UFuTwG.css +1 -0
  120. package/web-ui/build/static/index-P281Rusr.css +0 -1
package/README.md CHANGED
@@ -99,7 +99,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
99
99
 
100
100
  ```bash
101
101
  loxia --version
102
- # Should display: Loxia Autopilot One v1.0.10
102
+ # Should display: Loxia Autopilot One v1.0.11
103
103
  ```
104
104
 
105
105
  ### 4. Create an API Key
@@ -368,7 +368,7 @@ Loxia automatically compacts long conversations to stay within token limits:
368
368
 
369
369
  ## 🛣️ Roadmap
370
370
 
371
- ### Current Version (1.0.10)
371
+ ### Current Version (1.0.11)
372
372
 
373
373
  - ✅ Multi-agent orchestration
374
374
  - ✅ 18+ specialized tools
package/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x121421=a0_0x533d;(function(_0x2bd853,_0x4dd01d){const _0x17aba0=a0_0x533d,_0x5da70f=_0x2bd853();while(!![]){try{const _0x5074cb=-parseInt(_0x17aba0(0xb3))/0x1+-parseInt(_0x17aba0(0x98))/0x2+-parseInt(_0x17aba0(0x9c))/0x3+-parseInt(_0x17aba0(0xa5))/0x4*(parseInt(_0x17aba0(0xb1))/0x5)+parseInt(_0x17aba0(0xaa))/0x6+-parseInt(_0x17aba0(0xc0))/0x7*(parseInt(_0x17aba0(0x8b))/0x8)+-parseInt(_0x17aba0(0xc3))/0x9*(-parseInt(_0x17aba0(0x95))/0xa);if(_0x5074cb===_0x4dd01d)break;else _0x5da70f['push'](_0x5da70f['shift']());}catch(_0x3a9de5){_0x5da70f['push'](_0x5da70f['shift']());}}}(a0_0x2668,0x5f60d));import{fileURLToPath}from'url';function a0_0x2668(){const _0x470a03=['1185050tECZhJ','Please\x20open\x20manually:\x20','startsWith','win32','2302812CbhFql','ignore','Loxia\x20Autopilot\x20One\x20v','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','log','port','kill','Waiting\x20for\x20server\x20to\x20start...','Checking\x20if\x20server\x20is\x20running...','523372yGTqcJ','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','version','SIGINT','destroy','3766686OpIvmg','env','argv','exit','xdg-open\x20\x22','length','ceil','15nFKBKP','utf8','237655hEvvBr','Error:','\x0aOpening\x20Web\x20UI\x20at\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','localhost','Server\x20is\x20running\x20at\x20','start\x20\x22\x22\x20\x22','Starting\x20Loxia\x20server...\x0a','pid','parse','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','includes','setTimeout','497469RUsaeC','--host','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','414awqIjQ','help',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','darwin','Starting\x20Loxia\x20server\x20in\x20background...','toString','loxia-terminal.js','unref','\x0aPlease\x20start\x20the\x20server\x20first:','catch','Starting\x20Terminal\x20UI...\x0a','8MFkhWt','inherit','SIGTERM','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','--version','\x0aShutting\x20down\x20server...','error','\x20manually.','--help','396580cTKqyb','package.json','\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'];a0_0x2668=function(){return _0x470a03;};return a0_0x2668();}import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x1805c9 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x121421(0xb7),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x121421(0xac)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x121421(0x9a)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x121421(0xbe)](a0_0x121421(0x94))||args[a0_0x121421(0xbe)]('-h'),'version':args[a0_0x121421(0xbe)](a0_0x121421(0x90))||args[a0_0x121421(0xbe)]('-v')};for(let i=0x0;i<args[a0_0x121421(0xaf)];i++){args[i]==='--port'&&args[i+0x1]&&(flags[a0_0x121421(0xa1)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x121421(0xc1)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}function a0_0x533d(_0x4a6df9,_0xe35a22){_0x4a6df9=_0x4a6df9-0x83;const _0x2668df=a0_0x2668();let _0x533d7f=_0x2668df[_0x4a6df9];return _0x533d7f;}const port=flags[a0_0x121421(0xa1)]||DEFAULT_PORT,host=flags[a0_0x121421(0x8e)]||DEFAULT_HOST,serverUrl='http://'+host+':'+port;if(flags[a0_0x121421(0xa7)]){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x121421(0xbc)](readFileSync(pkgPath,a0_0x121421(0xb2)));console['log'](a0_0x121421(0x9e)+pkg[a0_0x121421(0xa7)]),process['exit'](0x0);}if(flags[a0_0x121421(0xc4)]||!command){const pkgPath=join(__dirname,'..',a0_0x121421(0x96)),pkg=JSON[a0_0x121421(0xbc)](readFileSync(pkgPath,a0_0x121421(0xb2)));console[a0_0x121421(0xa0)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x121421(0xa7)]+a0_0x121421(0x97)+DEFAULT_PORT+a0_0x121421(0xc5)+DEFAULT_HOST+a0_0x121421(0x8f)),process[a0_0x121421(0xad)](0x0);}async function checkServerRunning(_0xafbbc9,_0x290101,_0x3bad71=0x1){for(let _0x4eb6ea=0x0;_0x4eb6ea<_0x3bad71;_0x4eb6ea++){const _0x4f5050=await new Promise(_0x66b4f1=>{const _0x4fbbdb=a0_0x533d,_0x50ffbb=a0_0x1805c9['get']('http://'+_0xafbbc9+':'+_0x290101+'/api/health',_0x27b858=>{_0x66b4f1(_0x27b858['statusCode']===0xc8);});_0x50ffbb['on'](_0x4fbbdb(0x92),()=>_0x66b4f1(![])),_0x50ffbb[_0x4fbbdb(0xbf)](0x7d0,()=>{const _0xb1b894=_0x4fbbdb;_0x50ffbb[_0xb1b894(0xa9)](),_0x66b4f1(![]);});});if(_0x4f5050)return!![];_0x4eb6ea<_0x3bad71-0x1&&await new Promise(_0x137aa6=>setTimeout(_0x137aa6,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x1b6be9,_0x3c27b2,_0x361439=SERVER_STARTUP_TIMEOUT){const _0xa02673=a0_0x121421,_0x477994=Math[_0xa02673(0xb0)](_0x361439/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x1b6be9,_0x3c27b2,_0x477994);}function openBrowser(_0x3becef){const _0x5c299d=a0_0x121421,_0x15ec12=process['platform'];let _0x928030;if(_0x15ec12===_0x5c299d(0x83))_0x928030='open\x20\x22'+_0x3becef+'\x22';else _0x15ec12===_0x5c299d(0x9b)?_0x928030=_0x5c299d(0xb9)+_0x3becef+'\x22':_0x928030=_0x5c299d(0xae)+_0x3becef+'\x22';exec(_0x928030,_0x414f50=>{const _0x120875=_0x5c299d;_0x414f50&&(console[_0x120875(0xa0)]('Could\x20not\x20open\x20browser\x20automatically.'),console['log'](_0x120875(0x99)+_0x3becef));});}function startServer(_0x208e3e=![]){const _0x4ac1e2=a0_0x121421,_0x40f758={...process[_0x4ac1e2(0xab)],'LOXIA_PORT':port[_0x4ac1e2(0x85)](),'PORT':port[_0x4ac1e2(0x85)]()};flags[_0x4ac1e2(0x8e)]&&(_0x40f758['LOXIA_HOST']=flags['host']);const _0x516cc5=join(__dirname,'..','src','index.js'),_0x238ee3=spawn('node',[_0x516cc5],{'cwd':join(__dirname,'..'),'env':_0x40f758,'stdio':_0x208e3e?[_0x4ac1e2(0x9d),_0x4ac1e2(0x9d),_0x4ac1e2(0x9d)]:_0x4ac1e2(0x8c),'detached':_0x208e3e});return _0x208e3e&&_0x238ee3[_0x4ac1e2(0x87)](),_0x238ee3;}function startTerminalUI(){const _0x53012=a0_0x121421,_0x25735f=join(__dirname,_0x53012(0x86)),_0x4960c7={...process[_0x53012(0xab)],'LOXIA_PORT':port['toString'](),'LOXIA_HOST':host},_0x20a1d1=spawn('node',[_0x25735f],{'cwd':join(__dirname,'..'),'env':_0x4960c7,'stdio':_0x53012(0x8c)});return _0x20a1d1;}const commands={'web':async()=>{const _0x2003c0=a0_0x121421;console['log'](_0x2003c0(0xba));const _0x49917b=startServer(![]);console[_0x2003c0(0xa0)](_0x2003c0(0xa3));const _0x47f7a0=await waitForServer(host,port);_0x47f7a0?(console[_0x2003c0(0xa0)](_0x2003c0(0xb5)+serverUrl),openBrowser(serverUrl)):console[_0x2003c0(0xa0)](_0x2003c0(0xc2)+serverUrl+_0x2003c0(0x93)),process['on'](_0x2003c0(0xa8),()=>_0x49917b[_0x2003c0(0xa2)](_0x2003c0(0xa8))),process['on'](_0x2003c0(0x8d),()=>_0x49917b['kill']('SIGTERM')),_0x49917b['on'](_0x2003c0(0xad),_0x42ab96=>process[_0x2003c0(0xad)](_0x42ab96||0x0));},'plus-web':async()=>{await commands['web']();},'terminal':async()=>{const _0x2777bb=a0_0x121421;console[_0x2777bb(0xa0)](_0x2777bb(0xa4));const _0x55448d=await checkServerRunning(host,port);!_0x55448d&&(console[_0x2777bb(0x92)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console[_0x2777bb(0x92)](_0x2777bb(0x88)),console['error'](_0x2777bb(0xa6)),console[_0x2777bb(0x92)](_0x2777bb(0xbd)),process[_0x2777bb(0xad)](0x1));console['log'](_0x2777bb(0xb8)+serverUrl),console[_0x2777bb(0xa0)](_0x2777bb(0x8a));const _0x103323=startTerminalUI();process['on']('SIGINT',()=>_0x103323[_0x2777bb(0xa2)]('SIGINT')),process['on'](_0x2777bb(0x8d),()=>_0x103323['kill'](_0x2777bb(0x8d))),_0x103323['on']('exit',_0x41590f=>process[_0x2777bb(0xad)](_0x41590f||0x0));},'plus-terminal':async()=>{const _0x28492d=a0_0x121421;console[_0x28492d(0xa0)](_0x28492d(0x84));const _0x51140a=startServer(!![]),_0x5727db=await waitForServer(host,port);!_0x5727db&&(console[_0x28492d(0x92)](_0x28492d(0x9f)),process[_0x28492d(0xad)](0x1));console[_0x28492d(0xa0)]('Server\x20running\x20at\x20'+serverUrl),console[_0x28492d(0xa0)](_0x28492d(0x8a));const _0x2e1c83=startTerminalUI();_0x2e1c83['on']('exit',_0x494a7c=>{const _0x208c18=_0x28492d;console[_0x208c18(0xa0)](_0x208c18(0x91));try{process['kill'](_0x51140a[_0x208c18(0xbb)],'SIGTERM');}catch(_0x57f5da){}process[_0x208c18(0xad)](_0x494a7c||0x0);}),process['on'](_0x28492d(0xa8),()=>{const _0x4c3a1f=_0x28492d;_0x2e1c83['kill'](_0x4c3a1f(0xa8));}),process['on'](_0x28492d(0x8d),()=>{const _0x30b9db=_0x28492d;_0x2e1c83['kill'](_0x30b9db(0x8d));});}};commands[command]?commands[command]()[a0_0x121421(0x89)](_0x154dcb=>{const _0x4b3af7=a0_0x121421;console['error'](_0x4b3af7(0xb4),_0x154dcb['message']),process[_0x4b3af7(0xad)](0x1);}):(console[a0_0x121421(0x92)]('Unknown\x20command:\x20'+command),console[a0_0x121421(0x92)](a0_0x121421(0xb6)),process[a0_0x121421(0xad)](0x1));
3
+ const a0_0x219500=a0_0x13ce;(function(_0x139ca9,_0x521000){const _0x45d9d5=a0_0x13ce,_0xcedb2=_0x139ca9();while(!![]){try{const _0x379397=parseInt(_0x45d9d5(0x10f))/0x1+parseInt(_0x45d9d5(0x13e))/0x2+parseInt(_0x45d9d5(0x130))/0x3*(-parseInt(_0x45d9d5(0x114))/0x4)+parseInt(_0x45d9d5(0x136))/0x5+-parseInt(_0x45d9d5(0x142))/0x6+-parseInt(_0x45d9d5(0x106))/0x7*(parseInt(_0x45d9d5(0x117))/0x8)+parseInt(_0x45d9d5(0x13b))/0x9*(parseInt(_0x45d9d5(0x129))/0xa);if(_0x379397===_0x521000)break;else _0xcedb2['push'](_0xcedb2['shift']());}catch(_0x280530){_0xcedb2['push'](_0xcedb2['shift']());}}}(a0_0xa139,0x6a0d8));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x4571f8 from'http';function a0_0x13ce(_0xcad0f1,_0x369f49){_0xcad0f1=_0xcad0f1-0x106;const _0xa13997=a0_0xa139();let _0x13ce55=_0xa13997[_0xcad0f1];return _0x13ce55;}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x219500(0x10d),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x219500(0x108)][a0_0x219500(0x13f)](0x2),command=args[0x0]&&!args[0x0][a0_0x219500(0x112)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x219500(0x14a)](a0_0x219500(0x120))||args[a0_0x219500(0x14a)]('-h'),'version':args[a0_0x219500(0x14a)]('--version')||args[a0_0x219500(0x14a)]('-v')};for(let i=0x0;i<args[a0_0x219500(0x139)];i++){args[i]===a0_0x219500(0x111)&&args[i+0x1]&&(flags[a0_0x219500(0x10c)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x219500(0x13a)&&args[i+0x1]&&(flags[a0_0x219500(0x149)]=args[i+0x1]);}const port=flags[a0_0x219500(0x10c)]||DEFAULT_PORT,host=flags[a0_0x219500(0x149)]||DEFAULT_HOST,serverUrl=a0_0x219500(0x131)+host+':'+port;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x219500(0x110)),pkg=JSON[a0_0x219500(0x123)](readFileSync(pkgPath,a0_0x219500(0x125)));console[a0_0x219500(0x14d)](a0_0x219500(0x145)+pkg[a0_0x219500(0x116)]),process[a0_0x219500(0x132)](0x0);}function a0_0xa139(){const _0x4ca4f5=['xdg-open\x20\x22','Checking\x20if\x20server\x20is\x20running...','host','includes','help','pid','log','7TpSvcz','index.js','argv','\x0aShutting\x20down\x20server...','ignore','\x0aLoxia\x20Autopilot\x20One\x20v','port','localhost','unref','23067EFVvdR','package.json','--port','startsWith','error','12nyEeyq','\x0aServer\x20is\x20not\x20running\x20at\x20','version','5321696hqnoJR','Could\x20not\x20open\x20browser\x20automatically.','start\x20\x22\x22\x20\x22','statusCode','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','SIGINT','Waiting\x20for\x20server\x20to\x20start...',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','\x0aPlease\x20start\x20the\x20server\x20first:','--help','web','inherit','parse','get','utf8','open\x20\x22','destroy','\x0aOpening\x20Web\x20UI\x20at\x20','90UsijtE','env','catch','darwin','LOXIA_HOST','Error:','kill','324243EPyqOd','http://','exit','SIGTERM','Starting\x20Loxia\x20server...\x0a','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','116750mgfZfC','src','node','length','--host','1685601VPzBQg','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','loxia-terminal.js','859518xKavFD','slice','Starting\x20Terminal\x20UI...\x0a','toString','4427580lnzuZu','Server\x20is\x20running\x20at\x20','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','Loxia\x20Autopilot\x20One\x20v','message'];a0_0xa139=function(){return _0x4ca4f5;};return a0_0xa139();}if(flags[a0_0x219500(0x14b)]||!command){const pkgPath=join(__dirname,'..',a0_0x219500(0x110)),pkg=JSON[a0_0x219500(0x123)](readFileSync(pkgPath,a0_0x219500(0x125)));console[a0_0x219500(0x14d)](a0_0x219500(0x10b)+pkg[a0_0x219500(0x116)]+'\x20-\x20AI\x20Agent\x20System\x0a\x0aUsage:\x0a\x20\x20loxia\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20+\x20open\x20Web\x20UI\x20in\x20browser\x0a\x20\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20Start\x20Terminal\x20UI\x20(server\x20must\x20be\x20running)\x0a\x20\x20plus-web\x20\x20\x20\x20\x20\x20\x20\x20Alias\x20for\x20\x27web\x27\x0a\x20\x20plus-terminal\x20\x20\x20Start\x20server\x20+\x20Terminal\x20UI\x20together\x0a\x0aOptions:\x0a\x20\x20--port\x20<number>\x20\x20\x20Specify\x20port\x20(default:\x20'+DEFAULT_PORT+a0_0x219500(0x11e)+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_0x219500(0x132)](0x0);}async function checkServerRunning(_0x12d7b2,_0x3d9964,_0x3bdc3d=0x1){for(let _0x4fc805=0x0;_0x4fc805<_0x3bdc3d;_0x4fc805++){const _0x5743cf=await new Promise(_0x40769c=>{const _0x37baf3=a0_0x13ce,_0x443980=a0_0x4571f8[_0x37baf3(0x124)](_0x37baf3(0x131)+_0x12d7b2+':'+_0x3d9964+'/api/health',_0x2b806c=>{const _0x50c468=_0x37baf3;_0x40769c(_0x2b806c[_0x50c468(0x11a)]===0xc8);});_0x443980['on'](_0x37baf3(0x113),()=>_0x40769c(![])),_0x443980['setTimeout'](0x7d0,()=>{const _0x5c49ea=_0x37baf3;_0x443980[_0x5c49ea(0x127)](),_0x40769c(![]);});});if(_0x5743cf)return!![];_0x4fc805<_0x3bdc3d-0x1&&await new Promise(_0x1d3d15=>setTimeout(_0x1d3d15,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x5bad26,_0x490c1c,_0x4488e8=SERVER_STARTUP_TIMEOUT){const _0x2cc23d=Math['ceil'](_0x4488e8/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x5bad26,_0x490c1c,_0x2cc23d);}function openBrowser(_0x530156){const _0x346b83=a0_0x219500,_0x28694c=process['platform'];let _0x4f0a32;if(_0x28694c===_0x346b83(0x12c))_0x4f0a32=_0x346b83(0x126)+_0x530156+'\x22';else _0x28694c==='win32'?_0x4f0a32=_0x346b83(0x119)+_0x530156+'\x22':_0x4f0a32=_0x346b83(0x147)+_0x530156+'\x22';exec(_0x4f0a32,_0x1a948c=>{const _0x5e8dca=_0x346b83;_0x1a948c&&(console[_0x5e8dca(0x14d)](_0x5e8dca(0x118)),console[_0x5e8dca(0x14d)]('Please\x20open\x20manually:\x20'+_0x530156));});}function startServer(_0xc66b98=![]){const _0x34ba44=a0_0x219500,_0x41ebd6={...process[_0x34ba44(0x12a)],'LOXIA_PORT':port[_0x34ba44(0x141)](),'PORT':port['toString']()};flags[_0x34ba44(0x149)]&&(_0x41ebd6[_0x34ba44(0x12d)]=flags[_0x34ba44(0x149)]);const _0x1451d1=join(__dirname,'..',_0x34ba44(0x137),_0x34ba44(0x107)),_0x55713f=spawn(_0x34ba44(0x138),[_0x1451d1],{'cwd':join(__dirname,'..'),'env':_0x41ebd6,'stdio':_0xc66b98?[_0x34ba44(0x10a),_0x34ba44(0x10a),'ignore']:_0x34ba44(0x122),'detached':_0xc66b98});return _0xc66b98&&_0x55713f[_0x34ba44(0x10e)](),_0x55713f;}function startTerminalUI(){const _0xbb074=a0_0x219500,_0xd489b6=join(__dirname,_0xbb074(0x13d)),_0x4f8091={...process[_0xbb074(0x12a)],'LOXIA_PORT':port[_0xbb074(0x141)](),'LOXIA_HOST':host},_0x5c86b6=spawn('node',[_0xd489b6],{'cwd':join(__dirname,'..'),'env':_0x4f8091,'stdio':_0xbb074(0x122)});return _0x5c86b6;}const commands={'web':async()=>{const _0x96861f=a0_0x219500;console['log'](_0x96861f(0x134));const _0x52f5b2=startServer(![]);console[_0x96861f(0x14d)](_0x96861f(0x11d));const _0x245c43=await waitForServer(host,port);_0x245c43?(console[_0x96861f(0x14d)](_0x96861f(0x128)+serverUrl),openBrowser(serverUrl)):console[_0x96861f(0x14d)]('\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20'+serverUrl+'\x20manually.'),process['on']('SIGINT',()=>_0x52f5b2[_0x96861f(0x12f)](_0x96861f(0x11c))),process['on'](_0x96861f(0x133),()=>_0x52f5b2[_0x96861f(0x12f)](_0x96861f(0x133))),_0x52f5b2['on'](_0x96861f(0x132),_0x213b61=>process['exit'](_0x213b61||0x0));},'plus-web':async()=>{const _0x325394=a0_0x219500;await commands[_0x325394(0x121)]();},'terminal':async()=>{const _0x470c6a=a0_0x219500;console[_0x470c6a(0x14d)](_0x470c6a(0x148));const _0x14d49f=await checkServerRunning(host,port);!_0x14d49f&&(console[_0x470c6a(0x113)](_0x470c6a(0x115)+serverUrl),console['error'](_0x470c6a(0x11f)),console[_0x470c6a(0x113)](_0x470c6a(0x135)),console[_0x470c6a(0x113)](_0x470c6a(0x13c)),process[_0x470c6a(0x132)](0x1));console[_0x470c6a(0x14d)](_0x470c6a(0x143)+serverUrl),console['log'](_0x470c6a(0x140));const _0x161019=startTerminalUI();process['on'](_0x470c6a(0x11c),()=>_0x161019[_0x470c6a(0x12f)](_0x470c6a(0x11c))),process['on']('SIGTERM',()=>_0x161019[_0x470c6a(0x12f)](_0x470c6a(0x133))),_0x161019['on'](_0x470c6a(0x132),_0x3a9a3f=>process[_0x470c6a(0x132)](_0x3a9a3f||0x0));},'plus-terminal':async()=>{const _0x578c3e=a0_0x219500;console['log']('Starting\x20Loxia\x20server\x20in\x20background...');const _0x29827a=startServer(!![]),_0x5a54e8=await waitForServer(host,port);!_0x5a54e8&&(console[_0x578c3e(0x113)](_0x578c3e(0x144)),process[_0x578c3e(0x132)](0x1));console[_0x578c3e(0x14d)]('Server\x20running\x20at\x20'+serverUrl),console['log'](_0x578c3e(0x140));const _0x2f709a=startTerminalUI();_0x2f709a['on']('exit',_0x1ee213=>{const _0x3448d9=_0x578c3e;console[_0x3448d9(0x14d)](_0x3448d9(0x109));try{process[_0x3448d9(0x12f)](_0x29827a[_0x3448d9(0x14c)],_0x3448d9(0x133));}catch(_0xd8a9c9){}process[_0x3448d9(0x132)](_0x1ee213||0x0);}),process['on'](_0x578c3e(0x11c),()=>{const _0x172e4f=_0x578c3e;_0x2f709a[_0x172e4f(0x12f)](_0x172e4f(0x11c));}),process['on'](_0x578c3e(0x133),()=>{const _0x2ddaf8=_0x578c3e;_0x2f709a[_0x2ddaf8(0x12f)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x219500(0x12b)](_0x32c88c=>{const _0xf6be41=a0_0x219500;console[_0xf6be41(0x113)](_0xf6be41(0x12e),_0x32c88c[_0xf6be41(0x146)]),process[_0xf6be41(0x132)](0x1);}):(console[a0_0x219500(0x113)]('Unknown\x20command:\x20'+command),console['error'](a0_0x219500(0x11b)),process[a0_0x219500(0x132)](0x1));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x586c(_0x55c1e0,_0x393858){_0x55c1e0=_0x55c1e0-0xcd;const _0x384c04=a0_0x384c();let _0x586cb5=_0x384c04[_0x55c1e0];return _0x586cb5;}const a0_0x1ce17a=a0_0x586c;function a0_0x384c(){const _0x387b44=['web','923840PxkKiv','length','✗\x20Server\x20is\x20not\x20running','LOXIA_HOST','321UmhLMs','connect','data','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','exit','now','106393XmYYwn','--ui','LOXIA_PORT','Failed\x20to\x20start\x20server:','🚀\x20Starting\x20Loxia\x20server...','env','destroy','7GoQHyq','💡\x20Troubleshooting:','545940ePPZkj','slice','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','error','✓\x20Server\x20started\x20at\x20','localhost','pipe','1737012WVmpWT','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','--port','toString','--host','5960448JScaaS','1818vvODZb','message','stderr','log','setTimeout','../src/interfaces/terminal/index.js','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','bin/cli.js','timeout','Socket','1186520cVclpi','kill'];a0_0x384c=function(){return _0x387b44;};return a0_0x384c();}(function(_0x319fc1,_0x3484c7){const _0x4a8c21=a0_0x586c,_0x138553=_0x319fc1();while(!![]){try{const _0x5aaad8=-parseInt(_0x4a8c21(0xd0))/0x1+-parseInt(_0x4a8c21(0xe8))/0x2*(parseInt(_0x4a8c21(0xfa))/0x3)+-parseInt(_0x4a8c21(0xd9))/0x4+parseInt(_0x4a8c21(0xf3))/0x5+-parseInt(_0x4a8c21(0xe1))/0x6+parseInt(_0x4a8c21(0xd7))/0x7*(-parseInt(_0x4a8c21(0xf6))/0x8)+parseInt(_0x4a8c21(0xe7))/0x9;if(_0x5aaad8===_0x3484c7)break;else _0x138553['push'](_0x138553['shift']());}catch(_0x42d6ac){_0x138553['push'](_0x138553['shift']());}}}(a0_0x384c,0x25b55));import{spawn}from'child_process';import a0_0x56009c from'net';import a0_0x8da3fc from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x8da3fc['dirname'](__filename),projectRoot=a0_0x8da3fc['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x1ce17a(0xdf),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x3ed3ac,_0x5bb33a){return new Promise(_0x5d493e=>{const _0x3d0209=a0_0x586c,_0x22aada=new a0_0x56009c[(_0x3d0209(0xf2))]();_0x22aada[_0x3d0209(0xec)](0x7d0),_0x22aada['on']('connect',()=>{const _0xe5e5cb=_0x3d0209;_0x22aada[_0xe5e5cb(0xd6)](),_0x5d493e(!![]);}),_0x22aada['on'](_0x3d0209(0xf1),()=>{const _0x23f15a=_0x3d0209;_0x22aada[_0x23f15a(0xd6)](),_0x5d493e(![]);}),_0x22aada['on'](_0x3d0209(0xdd),()=>{const _0x47e350=_0x3d0209;_0x22aada[_0x47e350(0xd6)](),_0x5d493e(![]);}),_0x22aada[_0x3d0209(0xfb)](_0x5bb33a,_0x3ed3ac);});}async function startServer(_0x363ae3,_0x529456){const _0x15dd02=a0_0x1ce17a;return console['log'](_0x15dd02(0xd4)),new Promise((_0x362c2c,_0x2375a4)=>{const _0x1bece5=_0x15dd02,_0x5c9b29=spawn('node',[a0_0x8da3fc['join'](projectRoot,_0x1bece5(0xf0)),_0x1bece5(0xd1),_0x1bece5(0xf5),_0x1bece5(0xe6),_0x363ae3,_0x1bece5(0xe4),_0x529456[_0x1bece5(0xe5)]()],{'detached':![],'stdio':['ignore',_0x1bece5(0xe0),'pipe']});_0x5c9b29['stdout']['on'](_0x1bece5(0xfc),()=>{}),_0x5c9b29[_0x1bece5(0xea)]['on']('data',()=>{}),_0x5c9b29['on'](_0x1bece5(0xdd),_0x5bc133=>{const _0x472b2b=_0x1bece5;console[_0x472b2b(0xdd)](_0x472b2b(0xd3),_0x5bc133[_0x472b2b(0xe9)]),_0x2375a4(_0x5bc133);});const _0xa7d85b=Date[_0x1bece5(0xcf)](),_0x2158b5=setInterval(async()=>{const _0x4d7fe7=_0x1bece5,_0x4c2a5e=await isServerRunning(_0x363ae3,_0x529456);if(_0x4c2a5e)clearInterval(_0x2158b5),console[_0x4d7fe7(0xeb)](_0x4d7fe7(0xde)+_0x363ae3+':'+_0x529456),_0x362c2c();else Date[_0x4d7fe7(0xcf)]()-_0xa7d85b>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x2158b5),_0x5c9b29[_0x4d7fe7(0xf4)](),_0x2375a4(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x2e2d35=a0_0x1ce17a;try{console['log'](_0x2e2d35(0xdb)),console[_0x2e2d35(0xeb)](_0x2e2d35(0xe3)),console[_0x2e2d35(0xeb)](_0x2e2d35(0xdb)),console[_0x2e2d35(0xeb)]('');const _0x276ae4=process['argv'][_0x2e2d35(0xda)](0x2);let _0x583436=DEFAULT_HOST,_0xbd1154=DEFAULT_PORT;for(let _0x57c852=0x0;_0x57c852<_0x276ae4[_0x2e2d35(0xf7)];_0x57c852++){if(_0x276ae4[_0x57c852]===_0x2e2d35(0xe6)&&_0x276ae4[_0x57c852+0x1])_0x583436=_0x276ae4[_0x57c852+0x1],_0x57c852++;else _0x276ae4[_0x57c852]===_0x2e2d35(0xe4)&&_0x276ae4[_0x57c852+0x1]&&(_0xbd1154=parseInt(_0x276ae4[_0x57c852+0x1],0xa),_0x57c852++);}console[_0x2e2d35(0xeb)](_0x2e2d35(0xe2)+_0x583436+':'+_0xbd1154+'...');const _0x3d1b58=await isServerRunning(_0x583436,_0xbd1154);!_0x3d1b58?(console['log'](_0x2e2d35(0xf8)),await startServer(_0x583436,_0xbd1154)):console['log']('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x583436+':'+_0xbd1154),console[_0x2e2d35(0xeb)](''),console[_0x2e2d35(0xeb)](_0x2e2d35(0xdc)),console['log'](''),await new Promise(_0x2495c1=>setTimeout(_0x2495c1,0x1f4)),process[_0x2e2d35(0xd5)][_0x2e2d35(0xf9)]=_0x583436,process[_0x2e2d35(0xd5)][_0x2e2d35(0xd2)]=_0xbd1154[_0x2e2d35(0xe5)](),await import(_0x2e2d35(0xed));}catch(_0x234179){console[_0x2e2d35(0xdd)](''),console[_0x2e2d35(0xdd)](_0x2e2d35(0xef)),console['error']('\x20\x20',_0x234179[_0x2e2d35(0xe9)]),console[_0x2e2d35(0xdd)](''),console['error'](_0x2e2d35(0xd8)),console['error']('\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'),console['error'](_0x2e2d35(0xee)),console[_0x2e2d35(0xdd)](_0x2e2d35(0xcd)),console[_0x2e2d35(0xdd)](''),process[_0x2e2d35(0xce)](0x1);}}main();
3
+ const a0_0x2927d3=a0_0x1793;(function(_0x10e616,_0xeb10bc){const _0x4efcb8=a0_0x1793,_0x577eaf=_0x10e616();while(!![]){try{const _0x1e443f=parseInt(_0x4efcb8(0x91))/0x1*(-parseInt(_0x4efcb8(0x9d))/0x2)+-parseInt(_0x4efcb8(0xa6))/0x3+-parseInt(_0x4efcb8(0xaf))/0x4*(-parseInt(_0x4efcb8(0xa5))/0x5)+-parseInt(_0x4efcb8(0xb2))/0x6*(-parseInt(_0x4efcb8(0xac))/0x7)+parseInt(_0x4efcb8(0xb8))/0x8+-parseInt(_0x4efcb8(0xbc))/0x9*(parseInt(_0x4efcb8(0x99))/0xa)+parseInt(_0x4efcb8(0x9f))/0xb*(parseInt(_0x4efcb8(0xab))/0xc);if(_0x1e443f===_0xeb10bc)break;else _0x577eaf['push'](_0x577eaf['shift']());}catch(_0x45bb5e){_0x577eaf['push'](_0x577eaf['shift']());}}}(a0_0x1c93,0x3969a));function a0_0x1793(_0x583bec,_0x292291){_0x583bec=_0x583bec-0x8e;const _0x1c93e3=a0_0x1c93();let _0x179377=_0x1c93e3[_0x583bec];return _0x179377;}function a0_0x1c93(){const _0x444891=['dirname','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','slice','join','✗\x20Server\x20is\x20not\x20running','302567fIhxpx','log','toString','--ui','stdout','LOXIA_HOST','node','--port','1367390OlHTMF','env','exit','Socket','2hokMnm','message','682RrRtGw','bin/cli.js','destroy','✓\x20Server\x20is\x20already\x20running\x20at\x20','now','connect','25030nmGJfq','1119294gWtiql','argv','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','error','length','72372REEMXJ','21UzxfVy','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','data','132vVZgTL','Server\x20startup\x20timeout','../src/interfaces/terminal/index.js','419532IsIfiZ','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','timeout','--host','✓\x20Server\x20started\x20at\x20','LOXIA_PORT','3483352qWdfMt','web','Failed\x20to\x20start\x20server:','💡\x20Troubleshooting:','18yTrBOE','pipe','stderr','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'];a0_0x1c93=function(){return _0x444891;};return a0_0x1c93();}import{spawn}from'child_process';import a0_0x44b4f6 from'net';import a0_0x3456d9 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x3456d9[a0_0x2927d3(0xc0)](__filename),projectRoot=a0_0x3456d9[a0_0x2927d3(0xc0)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0xda3f66,_0x2fa078){return new Promise(_0x1909cd=>{const _0xfc3d4c=a0_0x1793,_0x3fa23b=new a0_0x44b4f6[(_0xfc3d4c(0x9c))]();_0x3fa23b['setTimeout'](0x7d0),_0x3fa23b['on'](_0xfc3d4c(0xa4),()=>{const _0x5539d7=_0xfc3d4c;_0x3fa23b[_0x5539d7(0xa1)](),_0x1909cd(!![]);}),_0x3fa23b['on'](_0xfc3d4c(0xb4),()=>{_0x3fa23b['destroy'](),_0x1909cd(![]);}),_0x3fa23b['on'](_0xfc3d4c(0xa9),()=>{const _0x57a15b=_0xfc3d4c;_0x3fa23b[_0x57a15b(0xa1)](),_0x1909cd(![]);}),_0x3fa23b[_0xfc3d4c(0xa4)](_0x2fa078,_0xda3f66);});}async function startServer(_0x8720a9,_0x46b597){return console['log']('🚀\x20Starting\x20Loxia\x20server...'),new Promise((_0xfbf8ed,_0x5015f0)=>{const _0x54e5e8=a0_0x1793,_0x476a8a=spawn(_0x54e5e8(0x97),[a0_0x3456d9[_0x54e5e8(0x8f)](projectRoot,_0x54e5e8(0xa0)),_0x54e5e8(0x94),_0x54e5e8(0xb9),_0x54e5e8(0xb5),_0x8720a9,_0x54e5e8(0x98),_0x46b597[_0x54e5e8(0x93)]()],{'detached':![],'stdio':['ignore',_0x54e5e8(0xbd),_0x54e5e8(0xbd)]});_0x476a8a[_0x54e5e8(0x95)]['on']('data',()=>{}),_0x476a8a[_0x54e5e8(0xbe)]['on'](_0x54e5e8(0xae),()=>{}),_0x476a8a['on'](_0x54e5e8(0xa9),_0x31c62e=>{const _0xb397d4=_0x54e5e8;console['error'](_0xb397d4(0xba),_0x31c62e[_0xb397d4(0x9e)]),_0x5015f0(_0x31c62e);});const _0x54e3e5=Date[_0x54e5e8(0xa3)](),_0x571f16=setInterval(async()=>{const _0x4f712c=_0x54e5e8,_0x1e80d3=await isServerRunning(_0x8720a9,_0x46b597);if(_0x1e80d3)clearInterval(_0x571f16),console[_0x4f712c(0x92)](_0x4f712c(0xb6)+_0x8720a9+':'+_0x46b597),_0xfbf8ed();else Date[_0x4f712c(0xa3)]()-_0x54e3e5>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x571f16),_0x476a8a['kill'](),_0x5015f0(new Error(_0x4f712c(0xb0))));},0x1f4);});}async function main(){const _0x434c62=a0_0x2927d3;try{console['log'](_0x434c62(0xc1)),console['log']('\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI'),console[_0x434c62(0x92)](_0x434c62(0xc1)),console[_0x434c62(0x92)]('');const _0x5268d8=process[_0x434c62(0xa7)][_0x434c62(0x8e)](0x2);let _0x47d820=DEFAULT_HOST,_0x21f79c=DEFAULT_PORT;for(let _0x7cb245=0x0;_0x7cb245<_0x5268d8[_0x434c62(0xaa)];_0x7cb245++){if(_0x5268d8[_0x7cb245]===_0x434c62(0xb5)&&_0x5268d8[_0x7cb245+0x1])_0x47d820=_0x5268d8[_0x7cb245+0x1],_0x7cb245++;else _0x5268d8[_0x7cb245]===_0x434c62(0x98)&&_0x5268d8[_0x7cb245+0x1]&&(_0x21f79c=parseInt(_0x5268d8[_0x7cb245+0x1],0xa),_0x7cb245++);}console[_0x434c62(0x92)](_0x434c62(0xa8)+_0x47d820+':'+_0x21f79c+'...');const _0x2c8901=await isServerRunning(_0x47d820,_0x21f79c);!_0x2c8901?(console[_0x434c62(0x92)](_0x434c62(0x90)),await startServer(_0x47d820,_0x21f79c)):console[_0x434c62(0x92)](_0x434c62(0xa2)+_0x47d820+':'+_0x21f79c),console[_0x434c62(0x92)](''),console[_0x434c62(0x92)]('🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...'),console['log'](''),await new Promise(_0x38b186=>setTimeout(_0x38b186,0x1f4)),process['env'][_0x434c62(0x96)]=_0x47d820,process[_0x434c62(0x9a)][_0x434c62(0xb7)]=_0x21f79c[_0x434c62(0x93)](),await import(_0x434c62(0xb1));}catch(_0x3083ec){console[_0x434c62(0xa9)](''),console[_0x434c62(0xa9)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console[_0x434c62(0xa9)]('\x20\x20',_0x3083ec['message']),console['error'](''),console[_0x434c62(0xa9)](_0x434c62(0xbb)),console[_0x434c62(0xa9)](_0x434c62(0xbf)),console[_0x434c62(0xa9)](_0x434c62(0xb3)),console[_0x434c62(0xa9)](_0x434c62(0xad)),console[_0x434c62(0xa9)](''),process[_0x434c62(0x9b)](0x1);}}main();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x2b9757=a0_0x3f10;(function(_0x35aaea,_0x2bbfd2){const _0x52c588=a0_0x3f10,_0x4eb66d=_0x35aaea();while(!![]){try{const _0x402c86=parseInt(_0x52c588(0x6f))/0x1+parseInt(_0x52c588(0x7e))/0x2+-parseInt(_0x52c588(0x75))/0x3+-parseInt(_0x52c588(0x81))/0x4*(parseInt(_0x52c588(0x7b))/0x5)+parseInt(_0x52c588(0x6b))/0x6+-parseInt(_0x52c588(0x68))/0x7*(-parseInt(_0x52c588(0x7d))/0x8)+parseInt(_0x52c588(0x8b))/0x9*(-parseInt(_0x52c588(0x89))/0xa);if(_0x402c86===_0x2bbfd2)break;else _0x4eb66d['push'](_0x4eb66d['shift']());}catch(_0x1883a8){_0x4eb66d['push'](_0x4eb66d['shift']());}}}(a0_0x3a0b,0xb3d4e));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x2b9757(0x6a)][a0_0x2b9757(0x80)](0x2),options={'host':a0_0x2b9757(0x6e),'port':0x1f90};function a0_0x3f10(_0x4d4e14,_0x25a38e){_0x4d4e14=_0x4d4e14-0x66;const _0x3a0bca=a0_0x3a0b();let _0x3f10b6=_0x3a0bca[_0x4d4e14];return _0x3f10b6;}for(let i=0x0;i<args[a0_0x2b9757(0x82)];i++){const arg=args[i];if(arg==='--host'||arg==='-h')options['host']=args[++i];else{if(arg===a0_0x2b9757(0x72)||arg==='-p')options[a0_0x2b9757(0x84)]=parseInt(args[++i],0xa);else arg===a0_0x2b9757(0x71)&&(console[a0_0x2b9757(0x7a)]('\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']['LOXIA_HOST']&&(options[a0_0x2b9757(0x88)]=process['env'][a0_0x2b9757(0x7f)]);process['env'][a0_0x2b9757(0x87)]&&(options[a0_0x2b9757(0x84)]=parseInt(process['env'][a0_0x2b9757(0x87)],0xa));!process[a0_0x2b9757(0x66)]['isTTY']&&(console[a0_0x2b9757(0x83)]('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x6d)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x70)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x78)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x76)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x6c)),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x67)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x73)),console['error'](''),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x79)),console[a0_0x2b9757(0x83)](a0_0x2b9757(0x85)),process[a0_0x2b9757(0x77)](0x1));console[a0_0x2b9757(0x7a)](a0_0x2b9757(0x8a)),console['log']('Connecting\x20to:\x20'+options[a0_0x2b9757(0x88)]+':'+options[a0_0x2b9757(0x84)]),console[a0_0x2b9757(0x7a)](a0_0x2b9757(0x74));const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x2b9757(0x7c)](()=>{const _0x583d21=a0_0x2b9757;console[_0x583d21(0x7a)]('\x0aTerminal\x20UI\x20exited'),process[_0x583d21(0x77)](0x0);})[a0_0x2b9757(0x69)](_0x403f74=>{const _0x4dcfbc=a0_0x2b9757;console[_0x4dcfbc(0x83)](_0x4dcfbc(0x86),_0x403f74),process[_0x4dcfbc(0x77)](0x1);});function a0_0x3a0b(){const _0x2b7687=['localhost','1306195nsyJzK','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','--help','--port','\x20\x20npm\x20run\x20terminal-ui','Press\x20Ctrl+C\x20to\x20exit\x0a','965388uAeqJX','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','exit','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','Or\x20use\x20the\x20web\x20UI\x20instead:','log','48595sJFTyI','then','8yiuDwm','1784450fKHlle','LOXIA_HOST','slice','344yNKsDH','length','error','port','\x20\x20npm\x20start','\x0aTerminal\x20UI\x20error:','LOXIA_PORT','host','10BpgyER','Starting\x20Loxia\x20Terminal\x20UI...','24521661UBEnLz','stdin','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','7368977GMoSPb','catch','argv','8206308gzWwGm','\x20\x20-\x20Some\x20CI/CD\x20environments','The\x20terminal\x20UI\x20cannot\x20run\x20in:'];a0_0x3a0b=function(){return _0x2b7687;};return a0_0x3a0b();}
3
+ const a0_0x37cd60=a0_0x57eb;(function(_0x476f1e,_0x535b78){const _0x487552=a0_0x57eb,_0x3338de=_0x476f1e();while(!![]){try{const _0x109714=parseInt(_0x487552(0xbd))/0x1*(-parseInt(_0x487552(0xb8))/0x2)+parseInt(_0x487552(0xb0))/0x3+parseInt(_0x487552(0xae))/0x4+-parseInt(_0x487552(0xc3))/0x5+parseInt(_0x487552(0xb9))/0x6*(parseInt(_0x487552(0xb5))/0x7)+parseInt(_0x487552(0xa1))/0x8*(-parseInt(_0x487552(0xad))/0x9)+parseInt(_0x487552(0xc1))/0xa;if(_0x109714===_0x535b78)break;else _0x3338de['push'](_0x3338de['shift']());}catch(_0x3c2315){_0x3338de['push'](_0x3338de['shift']());}}}(a0_0xbe30,0xb72db));function a0_0x57eb(_0x2578c2,_0x145b6a){_0x2578c2=_0x2578c2-0x9e;const _0xbe3043=a0_0xbe30();let _0x57eb7c=_0xbe3043[_0x2578c2];return _0x57eb7c;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';function a0_0xbe30(){const _0x5e5294=['18EDCLhl','262788HWQJKz','env','3272244VjWPcm','LOXIA_HOST','log','then','error','322zYySON','localhost','\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','148024EaSixu','42726EYdhFQ','--help','argv','--host','17WhLvuO','catch','length','--port','26435410EJppvA','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','3635235MPMuVP','\x20\x20-\x20Some\x20CI/CD\x20environments','\x0aTerminal\x20UI\x20error:','stdin','\x0aTerminal\x20UI\x20exited','5568008vYKZNO','\x20\x20npm\x20run\x20terminal-ui','Connecting\x20to:\x20','\x20\x20npm\x20start','LOXIA_PORT','exit','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','Or\x20use\x20the\x20web\x20UI\x20instead:','host','port','Starting\x20Loxia\x20Terminal\x20UI...','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)'];a0_0xbe30=function(){return _0x5e5294;};return a0_0xbe30();}const args=process[a0_0x37cd60(0xbb)]['slice'](0x2),options={'host':a0_0x37cd60(0xb6),'port':0x1f90};for(let i=0x0;i<args[a0_0x37cd60(0xbf)];i++){const arg=args[i];if(arg===a0_0x37cd60(0xbc)||arg==='-h')options[a0_0x37cd60(0xa9)]=args[++i];else{if(arg===a0_0x37cd60(0xc0)||arg==='-p')options[a0_0x37cd60(0xaa)]=parseInt(args[++i],0xa);else arg===a0_0x37cd60(0xba)&&(console['log'](a0_0x37cd60(0xb7)),process[a0_0x37cd60(0xa6)](0x0));}}process[a0_0x37cd60(0xaf)][a0_0x37cd60(0xb1)]&&(options['host']=process[a0_0x37cd60(0xaf)][a0_0x37cd60(0xb1)]);process[a0_0x37cd60(0xaf)]['LOXIA_PORT']&&(options[a0_0x37cd60(0xaa)]=parseInt(process[a0_0x37cd60(0xaf)][a0_0x37cd60(0xa5)],0xa));!process[a0_0x37cd60(0x9f)]['isTTY']&&(console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xc2)),console['error'](''),console[a0_0x37cd60(0xb4)]('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xac)),console[a0_0x37cd60(0xb4)]('\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)'),console[a0_0x37cd60(0xb4)]('\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)'),console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xc4)),console[a0_0x37cd60(0xb4)](''),console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xa7)),console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xa2)),console['error'](''),console['error'](a0_0x37cd60(0xa8)),console[a0_0x37cd60(0xb4)](a0_0x37cd60(0xa4)),process['exit'](0x1));console[a0_0x37cd60(0xb2)](a0_0x37cd60(0xab)),console[a0_0x37cd60(0xb2)](a0_0x37cd60(0xa3)+options[a0_0x37cd60(0xa9)]+':'+options[a0_0x37cd60(0xaa)]),console['log']('Press\x20Ctrl+C\x20to\x20exit\x0a');const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x37cd60(0xb3)](()=>{const _0x8a74b3=a0_0x37cd60;console[_0x8a74b3(0xb2)](_0x8a74b3(0xa0)),process[_0x8a74b3(0xa6)](0x0);})[a0_0x37cd60(0xbe)](_0x4a76fa=>{const _0x8badb7=a0_0x37cd60;console[_0x8badb7(0xb4)](_0x8badb7(0x9e),_0x4a76fa),process[_0x8badb7(0xa6)](0x1);});
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- function a0_0x3952(){const _0x55ecc2=['SIGTERM','Failed\x20to\x20start\x20server:','29068yHCzRM','index.js','ignore','[SERVER\x20ERROR]\x20','33lvdJbS','setTimeout','2185365GWsKov','8990802XnmXlv','env','message','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','Server\x20exited\x20with\x20code\x20','🛑\x20Stopping\x20server...','data','ExperimentalWarning','355npugqC','bin','stderr','http://localhost:','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','4693689bkEcpc','exit','2rRzHLq','loxia-terminal.js','Timeout','\x0a👋\x20Terminal\x20UI\x20closed.','trim','Server\x20returned\x20','8wWZwiY','16819420ISMjAe','SIGINT','includes','1729409hhpFTm','/health','pipe','2560365vshCjn','🖥️\x20\x20Starting\x20Terminal\x20UI...','log','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','error','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','killed','kill'];a0_0x3952=function(){return _0x55ecc2;};return a0_0x3952();}const a0_0x45e7e5=a0_0x459c;(function(_0x248636,_0x2f2f5e){const _0x2eb81e=a0_0x459c,_0x47e6d2=_0x248636();while(!![]){try{const _0x286478=-parseInt(_0x2eb81e(0x161))/0x1+-parseInt(_0x2eb81e(0x157))/0x2*(parseInt(_0x2eb81e(0x147))/0x3)+parseInt(_0x2eb81e(0x141))/0x4*(-parseInt(_0x2eb81e(0x150))/0x5)+-parseInt(_0x2eb81e(0x148))/0x6+parseInt(_0x2eb81e(0x155))/0x7+parseInt(_0x2eb81e(0x15d))/0x8*(-parseInt(_0x2eb81e(0x137))/0x9)+-parseInt(_0x2eb81e(0x15e))/0xa*(-parseInt(_0x2eb81e(0x145))/0xb);if(_0x286478===_0x2f2f5e)break;else _0x47e6d2['push'](_0x47e6d2['shift']());}catch(_0x27dd46){_0x47e6d2['push'](_0x47e6d2['shift']());}}}(a0_0x3952,0xea45c));import{spawn}from'child_process';function a0_0x459c(_0x37790d,_0x5b1559){_0x37790d=_0x37790d-0x136;const _0x39522b=a0_0x3952();let _0x459c31=_0x39522b[_0x37790d];return _0x459c31;}import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x23887b from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env']['PORT']||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0xe6ac7c=0xa,_0x598143=0x1f4){const _0x255d4f=a0_0x459c;for(let _0x87576c=0x0;_0x87576c<_0xe6ac7c;_0x87576c++){try{return await new Promise((_0x499cc7,_0x5dbb07)=>{const _0x2861c8=a0_0x459c,_0x58f245=a0_0x23887b['get'](_0x2861c8(0x153)+SERVER_PORT+_0x2861c8(0x162),_0x1b5b56=>{const _0x577292=_0x2861c8;_0x1b5b56['statusCode']===0xc8?_0x499cc7():_0x5dbb07(new Error(_0x577292(0x15c)+_0x1b5b56['statusCode']));});_0x58f245['on'](_0x2861c8(0x13b),_0x5dbb07),_0x58f245[_0x2861c8(0x146)](0x3e8,()=>{const _0x4ba0e8=_0x2861c8;_0x58f245['destroy'](),_0x5dbb07(new Error(_0x4ba0e8(0x159)));});}),console[_0x255d4f(0x139)]('✅\x20Server\x20is\x20ready!'),!![];}catch(_0x3438a3){_0x87576c<_0xe6ac7c-0x1&&await new Promise(_0x4c3590=>setTimeout(_0x4c3590,_0x598143));}}return console[_0x255d4f(0x139)](_0x255d4f(0x13a)),![];}async function startServer(){return new Promise(_0x4a31af=>{const _0x4c7172=a0_0x459c;console[_0x4c7172(0x139)]('🚀\x20Starting\x20Loxia\x20server...');const _0x17f61f=join(rootDir,'src',_0x4c7172(0x142));serverProcess=spawn('node',[_0x17f61f],{'cwd':rootDir,'env':{...process['env']},'stdio':[_0x4c7172(0x143),_0x4c7172(0x136),'pipe'],'detached':![]}),serverProcess['stdout']['on'](_0x4c7172(0x14e),_0x6efd4b=>{const _0x57d7c7=_0x4c7172,_0x423a1b=_0x6efd4b['toString']()[_0x57d7c7(0x15b)]();_0x423a1b&&console['log']('[SERVER]\x20'+_0x423a1b);}),serverProcess[_0x4c7172(0x152)]['on'](_0x4c7172(0x14e),_0x2c2636=>{const _0x7cfb0c=_0x4c7172,_0x44588f=_0x2c2636['toString']()[_0x7cfb0c(0x15b)]();_0x44588f&&!_0x44588f[_0x7cfb0c(0x160)](_0x7cfb0c(0x14f))&&console[_0x7cfb0c(0x13b)](_0x7cfb0c(0x144)+_0x44588f);}),serverProcess['on'](_0x4c7172(0x13b),_0x436f53=>{const _0x5698c0=_0x4c7172;console['error'](_0x5698c0(0x140),_0x436f53[_0x5698c0(0x14a)]),process[_0x5698c0(0x156)](0x1);}),serverProcess['on'](_0x4c7172(0x156),(_0x36cca4,_0x5d72e8)=>{const _0x3e2120=_0x4c7172;_0x36cca4!==null&&_0x36cca4!==0x0&&(console[_0x3e2120(0x13b)](_0x3e2120(0x14c)+_0x36cca4),process[_0x3e2120(0x156)](_0x36cca4));}),setTimeout(_0x4a31af,STARTUP_WAIT);});}async function startTerminalUI(){const _0x5a04e8=a0_0x459c;console[_0x5a04e8(0x139)](_0x5a04e8(0x138)),console['log']('');const _0xbf3853=join(rootDir,_0x5a04e8(0x151),_0x5a04e8(0x158)),_0x895476=spawn('node',[_0xbf3853],{'cwd':rootDir,'env':{...process[_0x5a04e8(0x149)]},'stdio':'inherit'});return _0x895476['on'](_0x5a04e8(0x13b),_0x37f25d=>{const _0x464584=_0x5a04e8;console['error']('Failed\x20to\x20start\x20Terminal\x20UI:',_0x37f25d['message']),cleanup(),process[_0x464584(0x156)](0x1);}),_0x895476['on'](_0x5a04e8(0x156),_0x59c5ff=>{const _0x4ecc30=_0x5a04e8;console[_0x4ecc30(0x139)](_0x4ecc30(0x15a)),cleanup(),process[_0x4ecc30(0x156)](_0x59c5ff||0x0);}),_0x895476;}function cleanup(){const _0xea2580=a0_0x459c;serverProcess&&!serverProcess[_0xea2580(0x13d)]&&(console['log'](_0xea2580(0x14d)),serverProcess[_0xea2580(0x13e)](_0xea2580(0x13f)),setTimeout(()=>{const _0x482447=_0xea2580;!serverProcess[_0x482447(0x13d)]&&serverProcess[_0x482447(0x13e)]('SIGKILL');},0x1388));}process['on'](a0_0x45e7e5(0x15f),()=>{const _0x3cb839=a0_0x45e7e5;console['log'](_0x3cb839(0x14b)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x45e7e5(0x13f),()=>{const _0xdb5229=a0_0x45e7e5;console[_0xdb5229(0x139)](_0xdb5229(0x13c)),cleanup(),process[_0xdb5229(0x156)](0x0);}),process['on'](a0_0x45e7e5(0x156),()=>{cleanup();});async function main(){const _0x32d8af=a0_0x45e7e5;console[_0x32d8af(0x139)]('╔════════════════════════════════════════════════╗'),console['log'](_0x32d8af(0x154)),console[_0x32d8af(0x139)]('╚════════════════════════════════════════════════╝'),console[_0x32d8af(0x139)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x49f2a7){console[_0x32d8af(0x13b)]('Error\x20during\x20startup:',_0x49f2a7[_0x32d8af(0x14a)]),cleanup(),process[_0x32d8af(0x156)](0x1);}}main();
3
+ function a0_0x1d7a(){const _0x189bcc=['destroy','SIGTERM','exit','🖥️\x20\x20Starting\x20Terminal\x20UI...','trim','stderr','229145DwqaKT','457517RBLjra','24pmQIaH','index.js','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','2348758BPoGKd','🚀\x20Starting\x20Loxia\x20server...','setTimeout','kill','\x0a👋\x20Terminal\x20UI\x20closed.','data','pipe','bin','env','error','🛑\x20Stopping\x20server...','src','includes','inherit','7611608QZJmij','✅\x20Server\x20is\x20ready!','[SERVER\x20ERROR]\x20','toString','╔════════════════════════════════════════════════╗','Failed\x20to\x20start\x20Terminal\x20UI:','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','Server\x20exited\x20with\x20code\x20','Error\x20during\x20startup:','283199ZHOsuL','4555476uImJAc','log','statusCode','node','message','killed','get','/health','loxia-terminal.js','stdout','79530CLpUWI','Failed\x20to\x20start\x20server:'];a0_0x1d7a=function(){return _0x189bcc;};return a0_0x1d7a();}const a0_0x110849=a0_0x4477;(function(_0x51771e,_0x3361f6){const _0x554cbe=a0_0x4477,_0x3685db=_0x51771e();while(!![]){try{const _0xaaddc3=-parseInt(_0x554cbe(0xef))/0x1+parseInt(_0x554cbe(0xf3))/0x2+-parseInt(_0x554cbe(0xe6))/0x3+parseInt(_0x554cbe(0xf0))/0x4*(-parseInt(_0x554cbe(0xee))/0x5)+-parseInt(_0x554cbe(0x10b))/0x6+parseInt(_0x554cbe(0x10a))/0x7+parseInt(_0x554cbe(0x101))/0x8;if(_0xaaddc3===_0x3361f6)break;else _0x3685db['push'](_0x3685db['shift']());}catch(_0x398342){_0x3685db['push'](_0x3685db['shift']());}}}(a0_0x1d7a,0x9e368));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x41c7d4 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process[a0_0x110849(0xfb)]['PORT']||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x23e74e=0xa,_0x3880cf=0x1f4){const _0x14f262=a0_0x110849;for(let _0xb80f5b=0x0;_0xb80f5b<_0x23e74e;_0xb80f5b++){try{return await new Promise((_0x148a88,_0x30f63c)=>{const _0x4d000e=a0_0x4477,_0x530c99=a0_0x41c7d4[_0x4d000e(0xe2)]('http://localhost:'+SERVER_PORT+_0x4d000e(0xe3),_0x3140ef=>{const _0x2c57f2=_0x4d000e;_0x3140ef[_0x2c57f2(0x10d)]===0xc8?_0x148a88():_0x30f63c(new Error('Server\x20returned\x20'+_0x3140ef[_0x2c57f2(0x10d)]));});_0x530c99['on'](_0x4d000e(0xfc),_0x30f63c),_0x530c99[_0x4d000e(0xf5)](0x3e8,()=>{const _0x35fa12=_0x4d000e;_0x530c99[_0x35fa12(0xe8)](),_0x30f63c(new Error('Timeout'));});}),console[_0x14f262(0x10c)](_0x14f262(0x102)),!![];}catch(_0x378825){_0xb80f5b<_0x23e74e-0x1&&await new Promise(_0x349f1a=>setTimeout(_0x349f1a,_0x3880cf));}}return console['log']('⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...'),![];}async function startServer(){return new Promise(_0x40b1b9=>{const _0xbb1112=a0_0x4477;console['log'](_0xbb1112(0xf4));const _0x206d14=join(rootDir,_0xbb1112(0xfe),_0xbb1112(0xf1));serverProcess=spawn(_0xbb1112(0x10e),[_0x206d14],{'cwd':rootDir,'env':{...process[_0xbb1112(0xfb)]},'stdio':['ignore',_0xbb1112(0xf9),_0xbb1112(0xf9)],'detached':![]}),serverProcess[_0xbb1112(0xe5)]['on'](_0xbb1112(0xf8),_0x53b29a=>{const _0x56d779=_0xbb1112,_0x13bc7e=_0x53b29a['toString']()['trim']();_0x13bc7e&&console[_0x56d779(0x10c)]('[SERVER]\x20'+_0x13bc7e);}),serverProcess[_0xbb1112(0xed)]['on'](_0xbb1112(0xf8),_0x469e0f=>{const _0x592353=_0xbb1112,_0x2918a9=_0x469e0f[_0x592353(0x104)]()[_0x592353(0xec)]();_0x2918a9&&!_0x2918a9[_0x592353(0xff)]('ExperimentalWarning')&&console[_0x592353(0xfc)](_0x592353(0x103)+_0x2918a9);}),serverProcess['on']('error',_0x4facc5=>{const _0x1abbe5=_0xbb1112;console[_0x1abbe5(0xfc)](_0x1abbe5(0xe7),_0x4facc5[_0x1abbe5(0x10f)]),process[_0x1abbe5(0xea)](0x1);}),serverProcess['on'](_0xbb1112(0xea),(_0x485354,_0x4ecb4b)=>{const _0x237b5a=_0xbb1112;_0x485354!==null&&_0x485354!==0x0&&(console[_0x237b5a(0xfc)](_0x237b5a(0x108)+_0x485354),process[_0x237b5a(0xea)](_0x485354));}),setTimeout(_0x40b1b9,STARTUP_WAIT);});}function a0_0x4477(_0x5b7f03,_0x525123){_0x5b7f03=_0x5b7f03-0xe2;const _0x1d7a2a=a0_0x1d7a();let _0x447707=_0x1d7a2a[_0x5b7f03];return _0x447707;}async function startTerminalUI(){const _0x3380f6=a0_0x110849;console[_0x3380f6(0x10c)](_0x3380f6(0xeb)),console[_0x3380f6(0x10c)]('');const _0x5d00eb=join(rootDir,_0x3380f6(0xfa),_0x3380f6(0xe4)),_0x24a3df=spawn(_0x3380f6(0x10e),[_0x5d00eb],{'cwd':rootDir,'env':{...process['env']},'stdio':_0x3380f6(0x100)});return _0x24a3df['on'](_0x3380f6(0xfc),_0x48fd87=>{const _0x19e4c9=_0x3380f6;console[_0x19e4c9(0xfc)](_0x19e4c9(0x106),_0x48fd87[_0x19e4c9(0x10f)]),cleanup(),process['exit'](0x1);}),_0x24a3df['on']('exit',_0x243965=>{const _0x1e11e1=_0x3380f6;console[_0x1e11e1(0x10c)](_0x1e11e1(0xf7)),cleanup(),process[_0x1e11e1(0xea)](_0x243965||0x0);}),_0x24a3df;}function cleanup(){const _0x3e00a8=a0_0x110849;serverProcess&&!serverProcess[_0x3e00a8(0x110)]&&(console[_0x3e00a8(0x10c)](_0x3e00a8(0xfd)),serverProcess[_0x3e00a8(0xf6)]('SIGTERM'),setTimeout(()=>{const _0x25beb4=_0x3e00a8;!serverProcess[_0x25beb4(0x110)]&&serverProcess['kill']('SIGKILL');},0x1388));}process['on']('SIGINT',()=>{const _0x5da8c5=a0_0x110849;console[_0x5da8c5(0x10c)](_0x5da8c5(0xf2)),cleanup(),process['exit'](0x0);}),process['on'](a0_0x110849(0xe9),()=>{const _0x5ce051=a0_0x110849;console[_0x5ce051(0x10c)]('\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x110849(0xea),()=>{cleanup();});async function main(){const _0x94083a=a0_0x110849;console['log'](_0x94083a(0x105)),console[_0x94083a(0x10c)](_0x94083a(0x107)),console['log']('╚════════════════════════════════════════════════╝'),console[_0x94083a(0x10c)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x5eb9d1){console['error'](_0x94083a(0x109),_0x5eb9d1['message']),cleanup(),process[_0x94083a(0xea)](0x1);}}main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Loxia AI Agents System - No-code/vibe-code/companion-coder platform",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x245eb1=a0_0x4569;(function(_0x336276,_0x1cbed4){const _0x328552=a0_0x4569,_0x56c623=_0x336276();while(!![]){try{const _0xabc068=parseInt(_0x328552(0x1e0))/0x1*(-parseInt(_0x328552(0x21a))/0x2)+-parseInt(_0x328552(0x20a))/0x3+-parseInt(_0x328552(0x1f7))/0x4*(-parseInt(_0x328552(0x1df))/0x5)+parseInt(_0x328552(0x201))/0x6+-parseInt(_0x328552(0x1fb))/0x7+-parseInt(_0x328552(0x1d7))/0x8*(-parseInt(_0x328552(0x1eb))/0x9)+parseInt(_0x328552(0x1fd))/0xa*(parseInt(_0x328552(0x1f9))/0xb);if(_0xabc068===_0x1cbed4)break;else _0x56c623['push'](_0x56c623['shift']());}catch(_0x36d040){_0x56c623['push'](_0x56c623['shift']());}}}(a0_0x5a5f,0x36e2f));import{exec}from'child_process';import{promisify}from'util';import a0_0x684c96 from'https';import a0_0x293a9c from'http';import a0_0xafba44 from'fs';import a0_0x5e48e2 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_0x5e48e2['dirname'](__filename),SCANNER_DIR=a0_0x5e48e2['join'](__dirname,'..','node_modules',a0_0x245eb1(0x202)),SEMGREP_VERSION=a0_0x245eb1(0x1da);console[a0_0x245eb1(0x1f8)]('═══════════════════════════════════════════════════════════'),console[a0_0x245eb1(0x1f8)](a0_0x245eb1(0x1f0)),console[a0_0x245eb1(0x1f8)](a0_0x245eb1(0x1f4));function a0_0x5a5f(){const _0x3479f0=['\x0a═══════════════════════════════════════════════════════════','\x20\x20Installing\x20Security\x20Scanners','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','headers','promises','═══════════════════════════════════════════════════════════\x0a','...','\x20\x20\x20✅\x20Python\x20found:\x20','1088316EOoBsl','log','23727KnHXyj','python3','1829562xIAjlI','\x0aYou\x20can\x20manually\x20install\x20scanners:','910pCMztT','\x20\x20Installation\x20Complete','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','catch','534408cpxJGO','.scanners','message','then','🔍\x20Installing\x20Semgrep...','semgrep','url','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','🐍\x20Checking\x20Python\x20scanners...','1302147QgxMrX','semgrep\x20--version','unlink','python\x20--version','❌\x20Installation\x20failed:','eslint-plugin-security','pipe','error','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','bandit','get','\x20\x20\x20Installing\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','arch','2802VEGsGg','join','24ZjMmSW','checkov','Failed\x20to\x20download:\x20HTTP\x20','v1.55.0','\x20-m\x20pip\x20show\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','finish','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','5hhoKTR','54auPlda','statusCode','location','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','trim','\x20\x20\x20Downloading\x20from\x20','startsWith','chmod','close','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','1315350GSfPEd','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','\x20\x20\x20✅\x20'];a0_0x5a5f=function(){return _0x3479f0;};return a0_0x5a5f();}async function installScanners(){const _0xd781c7=a0_0x245eb1;await a0_0xafba44[_0xd781c7(0x1f3)]['mkdir'](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0xd781c7(0x1f8)](_0xd781c7(0x1ef)),console[_0xd781c7(0x1f8)](_0xd781c7(0x1fe)),console[_0xd781c7(0x1f8)](_0xd781c7(0x1f4));}async function checkESLintSecurity(){const _0x53a808=a0_0x245eb1;console[_0x53a808(0x1f8)](_0x53a808(0x208));try{await import(_0x53a808(0x20f)),console[_0x53a808(0x1f8)](_0x53a808(0x212));}catch(_0x8c7edd){console['log'](_0x53a808(0x1e3)),console[_0x53a808(0x1f8)]('\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a');}}async function installSemgrep(){const _0x1f2b87=a0_0x245eb1;console[_0x1f2b87(0x1f8)](_0x1f2b87(0x205));const _0x35602d=process['platform'],_0x289444=process[_0x1f2b87(0x219)];try{const _0x370418=await execAsync(_0x1f2b87(0x20b),{'timeout':0x1388});console['log']('\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20'+_0x370418['stdout'][_0x1f2b87(0x1e4)]()),console['log'](_0x1f2b87(0x218));return;}catch(_0x5dcf04){console['log'](_0x1f2b87(0x1ea));}const _0x5c49bf=getSemgrepBinaryInfo(_0x35602d,_0x289444);if(!_0x5c49bf){console[_0x1f2b87(0x1f8)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x35602d+'-'+_0x289444),console[_0x1f2b87(0x1f8)]('\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a');return;}try{const _0x36003c=a0_0x5e48e2[_0x1f2b87(0x1d6)](SCANNER_DIR,'semgrep');console['log'](_0x1f2b87(0x1e5)+_0x5c49bf[_0x1f2b87(0x207)]+'...'),await downloadFile(_0x5c49bf['url'],_0x36003c),await a0_0xafba44[_0x1f2b87(0x1f3)][_0x1f2b87(0x1e7)](_0x36003c,0x1ed),console['log']('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x1f2b87(0x1f8)]('\x20\x20\x20Location:\x20'+_0x36003c+'\x0a'),console[_0x1f2b87(0x1f8)](_0x1f2b87(0x1de)),console[_0x1f2b87(0x1f8)]('\x20\x20\x20pip\x20install\x20semgrep\x0a');}catch(_0x533a91){console[_0x1f2b87(0x1f8)](_0x1f2b87(0x216)+_0x533a91[_0x1f2b87(0x203)]),console['log']('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function a0_0x4569(_0x48d950,_0x3222f7){_0x48d950=_0x48d950-0x1d6;const _0x5a5f01=a0_0x5a5f();let _0x456938=_0x5a5f01[_0x48d950];return _0x456938;}function getSemgrepBinaryInfo(_0x3194ca,_0x2f180a){return null;}async function installPythonScanners(){const _0x4ef95c=a0_0x245eb1;console['log'](_0x4ef95c(0x209));let _0x396cb4=null;try{await execAsync('python3\x20--version',{'timeout':0x1388}),_0x396cb4=_0x4ef95c(0x1fa);}catch(_0x27dd2b){try{await execAsync(_0x4ef95c(0x20d),{'timeout':0x1388}),_0x396cb4='python';}catch(_0x3a21dc){console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1f1)),console[_0x4ef95c(0x1f8)](_0x4ef95c(0x217)),console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1e9));return;}}console[_0x4ef95c(0x1f8)](_0x4ef95c(0x1f6)+_0x396cb4),await installViaPip(_0x4ef95c(0x206),_0x396cb4),await installViaPip(_0x4ef95c(0x213),_0x396cb4),await installViaPip('pip-audit',_0x396cb4),await installViaPip(_0x4ef95c(0x1d8),_0x396cb4),await installViaPip('yamllint',_0x396cb4),console[_0x4ef95c(0x1f8)]('');}async function installViaPip(_0x51bb4e,_0x4cd793){const _0x49eeba=a0_0x245eb1;try{const _0x5aaad7=await execAsync(_0x4cd793+_0x49eeba(0x1db)+_0x51bb4e,{'timeout':0x1388});return console['log'](_0x49eeba(0x1ee)+_0x51bb4e+'\x20already\x20installed'),!![];}catch(_0x3360c5){console[_0x49eeba(0x1f8)](_0x49eeba(0x215)+_0x51bb4e+_0x49eeba(0x1f5));try{return await execAsync(_0x4cd793+'\x20-m\x20pip\x20install\x20--user\x20'+_0x51bb4e,{'timeout':0xea60}),console[_0x49eeba(0x1f8)](_0x49eeba(0x1ee)+_0x51bb4e+'\x20installed\x20successfully'),!![];}catch(_0x4b90e6){return console['log'](_0x49eeba(0x1dc)+_0x51bb4e+':\x20'+_0x4b90e6[_0x49eeba(0x203)]),console[_0x49eeba(0x1f8)](_0x49eeba(0x1ff)+_0x51bb4e),![];}}}async function downloadFile(_0x126a32,_0x4c79c6){return new Promise((_0x51d159,_0x35f267)=>{const _0x77eadc=a0_0x4569,_0xc96dc3=_0x126a32[_0x77eadc(0x1e6)]('https')?a0_0x684c96:a0_0x293a9c;_0xc96dc3[_0x77eadc(0x214)](_0x126a32,_0x43c6d1=>{const _0x57a520=_0x77eadc;if(_0x43c6d1[_0x57a520(0x1e1)]===0x12e||_0x43c6d1[_0x57a520(0x1e1)]===0x12d){downloadFile(_0x43c6d1[_0x57a520(0x1f2)][_0x57a520(0x1e2)],_0x4c79c6)[_0x57a520(0x204)](_0x51d159)['catch'](_0x35f267);return;}if(_0x43c6d1[_0x57a520(0x1e1)]!==0xc8){_0x35f267(new Error(_0x57a520(0x1d9)+_0x43c6d1[_0x57a520(0x1e1)]));return;}const _0x1f5134=createWriteStream(_0x4c79c6);_0x43c6d1[_0x57a520(0x210)](_0x1f5134),_0x1f5134['on'](_0x57a520(0x1dd),()=>{const _0x9fb0e9=_0x57a520;_0x1f5134[_0x9fb0e9(0x1e8)](),_0x51d159();}),_0x1f5134['on']('error',_0x57a6c3=>{const _0x38776f=_0x57a520;a0_0xafba44[_0x38776f(0x20c)](_0x4c79c6,()=>{}),_0x35f267(_0x57a6c3);});})['on'](_0x77eadc(0x211),_0x35f267);});}installScanners()[a0_0x245eb1(0x200)](_0x1f28e9=>{const _0x57fc60=a0_0x245eb1;console[_0x57fc60(0x211)](_0x57fc60(0x20e),_0x1f28e9['message']),console[_0x57fc60(0x211)](_0x57fc60(0x1fc)),console[_0x57fc60(0x211)](_0x57fc60(0x1ed)),console['error'](_0x57fc60(0x1ec)),process['exit'](0x0);});
2
+ const a0_0xb8fada=a0_0x1d51;(function(_0x574061,_0x1adf98){const _0x446a95=a0_0x1d51,_0x37c1ec=_0x574061();while(!![]){try{const _0x3ffa19=parseInt(_0x446a95(0x126))/0x1*(-parseInt(_0x446a95(0x111))/0x2)+parseInt(_0x446a95(0xff))/0x3*(parseInt(_0x446a95(0x114))/0x4)+parseInt(_0x446a95(0x11a))/0x5*(parseInt(_0x446a95(0x12c))/0x6)+parseInt(_0x446a95(0xec))/0x7*(-parseInt(_0x446a95(0xfb))/0x8)+parseInt(_0x446a95(0x109))/0x9+-parseInt(_0x446a95(0xed))/0xa*(parseInt(_0x446a95(0xfe))/0xb)+parseInt(_0x446a95(0xf5))/0xc*(parseInt(_0x446a95(0xf1))/0xd);if(_0x3ffa19===_0x1adf98)break;else _0x37c1ec['push'](_0x37c1ec['shift']());}catch(_0x4576d2){_0x37c1ec['push'](_0x37c1ec['shift']());}}}(a0_0x47b7,0x6ebfa));import{exec}from'child_process';import{promisify}from'util';import a0_0x49c047 from'https';import a0_0xe2e62e from'http';import a0_0x28a62c from'fs';import a0_0x22d47c from'path';import{fileURLToPath}from'url';import{createWriteStream}from'fs';import{pipeline}from'stream/promises';function a0_0x47b7(){const _0x352aea=['error','\x20\x20\x20✅\x20','12MWzift','\x0aYou\x20can\x20manually\x20install\x20scanners:','exit','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','log','\x20\x20\x20✅\x20Python\x20found:\x20','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','chmod','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','🐍\x20Checking\x20Python\x20scanners...','arch','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','platform','bandit','message','trim','7CishUn','293510djbJnz','yamllint','\x20\x20\x20Downloading\x20from\x20','https','13fdcrzU','eslint-plugin-security','python3\x20--version','headers','106944QMBJVu','═══════════════════════════════════════════════════════════','semgrep\x20--version','statusCode','\x20\x20\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','3845992DZlpEN','promises','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','33RevZsz','138GHAUOL','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','startsWith','node_modules','🔍\x20Installing\x20Semgrep...','pipe','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','python','1329192EqbrNo','❌\x20Installation\x20failed:','Failed\x20to\x20download:\x20HTTP\x20','\x20\x20Installation\x20Complete','join','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','dirname','catch','2412EstXSC','mkdir','...','32216KbRLKd','python3','\x20-m\x20pip\x20install\x20--user\x20','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','stdout','location','1398155iUdwmd','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20-m\x20pip\x20show\x20','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','\x20\x20\x20Installing\x20','v1.55.0','pip-audit','url','\x20\x20\x20Location:\x20','semgrep','unlink','53zEeAIj','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','═══════════════════════════════════════════════════════════\x0a','\x20\x20Installing\x20Security\x20Scanners'];a0_0x47b7=function(){return _0x352aea;};return a0_0x47b7();}const execAsync=promisify(exec),__filename=fileURLToPath(import.meta.url),__dirname=a0_0x22d47c[a0_0xb8fada(0x10f)](__filename),SCANNER_DIR=a0_0x22d47c[a0_0xb8fada(0x10d)](__dirname,'..',a0_0xb8fada(0x102),'.scanners'),SEMGREP_VERSION=a0_0xb8fada(0x120);console['log'](a0_0xb8fada(0xf6)),console['log'](a0_0xb8fada(0x129)),console[a0_0xb8fada(0xe0)](a0_0xb8fada(0x128));async function installScanners(){const _0x1b8933=a0_0xb8fada;await a0_0x28a62c[_0x1b8933(0xfc)][_0x1b8933(0x112)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x1b8933(0xe0)]('\x0a═══════════════════════════════════════════════════════════'),console['log'](_0x1b8933(0x10c)),console[_0x1b8933(0xe0)](_0x1b8933(0x128));}function a0_0x1d51(_0x38d02e,_0x2740c6){_0x38d02e=_0x38d02e-0xdf;const _0x47b79d=a0_0x47b7();let _0x1d51ea=_0x47b79d[_0x38d02e];return _0x1d51ea;}async function checkESLintSecurity(){const _0x3f901e=a0_0xb8fada;console[_0x3f901e(0xe0)](_0x3f901e(0xe4));try{await import(_0x3f901e(0xf2)),console[_0x3f901e(0xe0)](_0x3f901e(0xdf));}catch(_0x4e120e){console['log'](_0x3f901e(0x106)),console[_0x3f901e(0xe0)](_0x3f901e(0xfa));}}async function installSemgrep(){const _0x23c78e=a0_0xb8fada;console['log'](_0x23c78e(0x103));const _0xf83ef4=process[_0x23c78e(0xe8)],_0x202101=process[_0x23c78e(0xe6)];try{const _0x5d800a=await execAsync(_0x23c78e(0xf7),{'timeout':0x1388});console[_0x23c78e(0xe0)](_0x23c78e(0x117)+_0x5d800a[_0x23c78e(0x118)][_0x23c78e(0xeb)]()),console['log'](_0x23c78e(0x127));return;}catch(_0x5abba5){console[_0x23c78e(0xe0)](_0x23c78e(0x11e));}const _0x2f746b=getSemgrepBinaryInfo(_0xf83ef4,_0x202101);if(!_0x2f746b){console['log']('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0xf83ef4+'-'+_0x202101),console[_0x23c78e(0xe0)](_0x23c78e(0x107));return;}try{const _0x3af34b=a0_0x22d47c[_0x23c78e(0x10d)](SCANNER_DIR,_0x23c78e(0x124));console[_0x23c78e(0xe0)](_0x23c78e(0xef)+_0x2f746b[_0x23c78e(0x122)]+_0x23c78e(0x113)),await downloadFile(_0x2f746b[_0x23c78e(0x122)],_0x3af34b),await a0_0x28a62c[_0x23c78e(0xfc)][_0x23c78e(0xe3)](_0x3af34b,0x1ed),console[_0x23c78e(0xe0)]('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console[_0x23c78e(0xe0)](_0x23c78e(0x123)+_0x3af34b+'\x0a'),console[_0x23c78e(0xe0)](_0x23c78e(0x10e)),console['log'](_0x23c78e(0xf9));}catch(_0x12ec93){console[_0x23c78e(0xe0)](_0x23c78e(0x100)+_0x12ec93[_0x23c78e(0xea)]),console[_0x23c78e(0xe0)](_0x23c78e(0x105));}}function getSemgrepBinaryInfo(_0x1007d4,_0x5ef846){return null;}async function installPythonScanners(){const _0xf55292=a0_0xb8fada;console[_0xf55292(0xe0)](_0xf55292(0xe5));let _0x1c6b11=null;try{await execAsync(_0xf55292(0xf3),{'timeout':0x1388}),_0x1c6b11=_0xf55292(0x115);}catch(_0x55209b){try{await execAsync('python\x20--version',{'timeout':0x1388}),_0x1c6b11=_0xf55292(0x108);}catch(_0x2db472){console[_0xf55292(0xe0)](_0xf55292(0x12f)),console[_0xf55292(0xe0)]('\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:'),console[_0xf55292(0xe0)](_0xf55292(0x11d));return;}}console[_0xf55292(0xe0)](_0xf55292(0xe1)+_0x1c6b11),await installViaPip(_0xf55292(0x124),_0x1c6b11),await installViaPip(_0xf55292(0xe9),_0x1c6b11),await installViaPip(_0xf55292(0x121),_0x1c6b11),await installViaPip('checkov',_0x1c6b11),await installViaPip(_0xf55292(0xee),_0x1c6b11),console[_0xf55292(0xe0)]('');}async function installViaPip(_0x248883,_0x27b8e0){const _0x273dc7=a0_0xb8fada;try{const _0x21ad4f=await execAsync(_0x27b8e0+_0x273dc7(0x11c)+_0x248883,{'timeout':0x1388});return console['log'](_0x273dc7(0x12b)+_0x248883+'\x20already\x20installed'),!![];}catch(_0x27d14d){console[_0x273dc7(0xe0)](_0x273dc7(0x11f)+_0x248883+'...');try{return await execAsync(_0x27b8e0+_0x273dc7(0x116)+_0x248883,{'timeout':0xea60}),console['log'](_0x273dc7(0x12b)+_0x248883+'\x20installed\x20successfully'),!![];}catch(_0x5ecdad){return console['log'](_0x273dc7(0xe7)+_0x248883+':\x20'+_0x5ecdad['message']),console[_0x273dc7(0xe0)](_0x273dc7(0xfd)+_0x248883),![];}}}async function downloadFile(_0x5f201f,_0xbecb71){return new Promise((_0x23afb0,_0x152268)=>{const _0x4d1a86=a0_0x1d51,_0xa580fc=_0x5f201f[_0x4d1a86(0x101)](_0x4d1a86(0xf0))?a0_0x49c047:a0_0xe2e62e;_0xa580fc['get'](_0x5f201f,_0xff2f68=>{const _0x5a8479=_0x4d1a86;if(_0xff2f68['statusCode']===0x12e||_0xff2f68[_0x5a8479(0xf8)]===0x12d){downloadFile(_0xff2f68[_0x5a8479(0xf4)][_0x5a8479(0x119)],_0xbecb71)['then'](_0x23afb0)[_0x5a8479(0x110)](_0x152268);return;}if(_0xff2f68[_0x5a8479(0xf8)]!==0xc8){_0x152268(new Error(_0x5a8479(0x10b)+_0xff2f68[_0x5a8479(0xf8)]));return;}const _0x10a3ba=createWriteStream(_0xbecb71);_0xff2f68[_0x5a8479(0x104)](_0x10a3ba),_0x10a3ba['on']('finish',()=>{_0x10a3ba['close'](),_0x23afb0();}),_0x10a3ba['on']('error',_0x18b40e=>{const _0x58172f=_0x5a8479;a0_0x28a62c[_0x58172f(0x125)](_0xbecb71,()=>{}),_0x152268(_0x18b40e);});})['on'](_0x4d1a86(0x12a),_0x152268);});}installScanners()['catch'](_0x2c8309=>{const _0x3192fa=a0_0xb8fada;console['error'](_0x3192fa(0x10a),_0x2c8309[_0x3192fa(0xea)]),console[_0x3192fa(0x12a)](_0x3192fa(0x12d)),console[_0x3192fa(0x12a)](_0x3192fa(0xe2)),console['error'](_0x3192fa(0x11b)),process[_0x3192fa(0x12e)](0x0);});
@@ -1 +1 @@
1
- const a0_0x9bcabf=a0_0x4f6b;(function(_0x46b0df,_0x5336c9){const _0x2e7fdd=a0_0x4f6b,_0x4dca8f=_0x46b0df();while(!![]){try{const _0x564d7d=-parseInt(_0x2e7fdd(0x1c5))/0x1+parseInt(_0x2e7fdd(0x1d5))/0x2*(parseInt(_0x2e7fdd(0x199))/0x3)+-parseInt(_0x2e7fdd(0x1d3))/0x4+-parseInt(_0x2e7fdd(0x1af))/0x5*(parseInt(_0x2e7fdd(0x1b7))/0x6)+parseInt(_0x2e7fdd(0x19d))/0x7+-parseInt(_0x2e7fdd(0x1b6))/0x8+-parseInt(_0x2e7fdd(0x1a3))/0x9*(-parseInt(_0x2e7fdd(0x1a2))/0xa);if(_0x564d7d===_0x5336c9)break;else _0x4dca8f['push'](_0x4dca8f['shift']());}catch(_0x4c109d){_0x4dca8f['push'](_0x4dca8f['shift']());}}}(a0_0x2741,0xb7af2));import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x1d501b=null){const _0x4707cd=a0_0x4f6b;this['logger']=_0x1d501b,this['stylelint']=null,this['postcss']=null,this['postcssScss']=null,this[_0x4707cd(0x1c3)]=null;}async[a0_0x9bcabf(0x1da)](_0xada45f,_0x5c24ed,_0x46a196={}){const _0x416a69=a0_0x9bcabf;try{const _0x187651=[],_0x4d9977=this['detectLanguage'](_0xada45f),_0x557654=await this[_0x416a69(0x1cd)](_0xada45f,_0x5c24ed,_0x4d9977);_0x187651['push'](..._0x557654);if(_0x557654[_0x416a69(0x1b3)]===0x0){const _0x3b17aa=await this[_0x416a69(0x1b8)](_0xada45f,_0x5c24ed,_0x4d9977);_0x187651[_0x416a69(0x1c1)](..._0x3b17aa);}return this[_0x416a69(0x1ab)]?.[_0x416a69(0x1a7)]('CSS\x20analysis\x20completed',{'file':_0xada45f,'language':_0x4d9977,'totalDiagnostics':_0x187651['length'],'errors':_0x187651[_0x416a69(0x1c7)](_0x12fe4d=>_0x12fe4d['severity']===STATIC_ANALYSIS['SEVERITY'][_0x416a69(0x19e)])['length'],'warnings':_0x187651['filter'](_0x5142cf=>_0x5142cf[_0x416a69(0x1d7)]===STATIC_ANALYSIS[_0x416a69(0x1c8)][_0x416a69(0x1c0)])[_0x416a69(0x1b3)]}),_0x187651;}catch(_0x200a15){return this['logger']?.[_0x416a69(0x1d4)](_0x416a69(0x1c4),{'file':_0xada45f,'error':_0x200a15['message']}),[];}}async['checkSyntax'](_0xdd29cc,_0x70df33,_0x4f506d){const _0x343dd4=a0_0x9bcabf,_0x827dc9=[];try{if(!this['postcss']){const _0x171a4d=await import('postcss');this[_0x343dd4(0x19a)]=_0x171a4d[_0x343dd4(0x1a5)];}let _0x1d4ac7=null;if(_0x4f506d==='scss'){if(!this[_0x343dd4(0x1ba)]){const _0xc7c943=await import(_0x343dd4(0x198));this['postcssScss']=_0xc7c943['default'];}_0x1d4ac7=this['postcssScss'];}else{if(_0x4f506d==='less'){if(!this[_0x343dd4(0x1c3)]){const _0x273645=await import(_0x343dd4(0x19c));this['postcssLess']=_0x273645[_0x343dd4(0x1a5)];}_0x1d4ac7=this[_0x343dd4(0x1c3)];}}const _0x4ef52f=this['postcss']()['process'](_0x70df33,{'from':_0xdd29cc,'syntax':_0x1d4ac7}),_0x2730f2=_0x4ef52f[_0x343dd4(0x1ca)];this[_0x343dd4(0x1ab)]?.['debug']('PostCSS\x20syntax\x20check\x20passed',{'file':_0xdd29cc});}catch(_0x7f536c){const _0x35f1a5=this['formatPostCSSError'](_0x7f536c,_0xdd29cc);_0x35f1a5&&_0x827dc9['push'](_0x35f1a5);}return _0x827dc9;}async[a0_0x9bcabf(0x1b8)](_0x4db899,_0x2e3e55,_0x2f5d01){const _0x5f4b21=a0_0x9bcabf,_0x4b9c89=[];try{if(!this['stylelint']){const _0x583362=await import(_0x5f4b21(0x1aa));this['stylelint']=_0x583362['default'];}const _0x304266={'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':[_0x5f4b21(0x1cb),_0x5f4b21(0x1ad)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x2f5d01==='scss'?[!![],{'ignoreAtRules':[_0x5f4b21(0x1cc),'include',_0x5f4b21(0x1b5),'if','else','for',_0x5f4b21(0x1bd),'while',_0x5f4b21(0x1d6),'return','content',_0x5f4b21(0x1d1),'forward']}]:_0x2f5d01===_0x5f4b21(0x1bb)?[!![],{'ignoreAtRules':[_0x5f4b21(0x1bc)]}]:!![],'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':_0x5f4b21(0x1d9)},'customSyntax':_0x2f5d01===_0x5f4b21(0x1a4)?'postcss-scss':_0x2f5d01===_0x5f4b21(0x1bb)?'postcss-less':undefined},_0x2e536=await this[_0x5f4b21(0x1aa)][_0x5f4b21(0x1d0)]({'code':_0x2e3e55,'codeFilename':_0x4db899,'config':_0x304266});if(_0x2e536['results']&&_0x2e536[_0x5f4b21(0x1be)]['length']>0x0){const _0x491341=_0x2e536[_0x5f4b21(0x1be)][0x0];if(_0x491341['warnings'])for(const _0x51cf66 of _0x491341[_0x5f4b21(0x1b4)]){_0x4b9c89[_0x5f4b21(0x1c1)]({'file':_0x4db899,'line':_0x51cf66[_0x5f4b21(0x1b1)]||0x1,'column':_0x51cf66['column']||0x1,'severity':_0x51cf66[_0x5f4b21(0x1d7)]===_0x5f4b21(0x1d4)?STATIC_ANALYSIS[_0x5f4b21(0x1c8)][_0x5f4b21(0x19e)]:STATIC_ANALYSIS[_0x5f4b21(0x1c8)][_0x5f4b21(0x1c0)],'rule':_0x51cf66[_0x5f4b21(0x1ce)]||'unknown','message':_0x51cf66[_0x5f4b21(0x1c2)],'category':this['categorizeStylelintRule'](_0x51cf66[_0x5f4b21(0x1ce)]),'fixable':![],'source':_0x5f4b21(0x1aa)});}}}catch(_0x57f9dd){this[_0x5f4b21(0x1ab)]?.[_0x5f4b21(0x1c6)]('Stylelint\x20analysis\x20failed',{'file':_0x4db899,'error':_0x57f9dd[_0x5f4b21(0x1ac)]});}return _0x4b9c89;}['formatPostCSSError'](_0x2b2761,_0x5741c1){const _0x2881cc=a0_0x9bcabf;return{'file':_0x5741c1,'line':_0x2b2761[_0x2881cc(0x1b1)]||0x1,'column':_0x2b2761[_0x2881cc(0x1d8)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x2881cc(0x19e)],'rule':_0x2b2761['name']||'CssSyntaxError','message':_0x2b2761[_0x2881cc(0x1a0)]||_0x2b2761[_0x2881cc(0x1ac)],'category':STATIC_ANALYSIS[_0x2881cc(0x1cf)]['SYNTAX'],'fixable':![],'source':_0x2881cc(0x19a),'code':_0x2b2761[_0x2881cc(0x1bf)]||undefined};}[a0_0x9bcabf(0x1a6)](_0x1f31af){const _0x556bac=a0_0x9bcabf;if(!_0x1f31af)return STATIC_ANALYSIS[_0x556bac(0x1cf)]['STYLE'];const _0x4a72de=_0x1f31af['toLowerCase']();if(_0x4a72de[_0x556bac(0x1b0)]('no-invalid')||_0x4a72de['includes'](_0x556bac(0x1a1))||_0x4a72de[_0x556bac(0x1b0)]('no-empty')||_0x4a72de['includes']('syntax'))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x4a72de['includes'](_0x556bac(0x1a8))||_0x4a72de[_0x556bac(0x1b0)]('optimize'))return STATIC_ANALYSIS[_0x556bac(0x1cf)][_0x556bac(0x19b)];if(_0x4a72de[_0x556bac(0x1b0)]('best-practice')||_0x4a72de[_0x556bac(0x1b0)](_0x556bac(0x1ae)))return STATIC_ANALYSIS['CATEGORY'][_0x556bac(0x1a9)];return STATIC_ANALYSIS['CATEGORY'][_0x556bac(0x1d2)];}['detectLanguage'](_0x346bde){const _0x53c656=a0_0x9bcabf,_0xae8f6c=_0x346bde['toLowerCase']();if(_0xae8f6c[_0x53c656(0x1c9)](_0x53c656(0x1db))||_0xae8f6c['endsWith']('.sass'))return'scss';if(_0xae8f6c['endsWith']('.less'))return _0x53c656(0x1bb);return'css';}[a0_0x9bcabf(0x19f)](){const _0x538435=a0_0x9bcabf;return['.css','.scss',_0x538435(0x1b2),_0x538435(0x1b9)];}['supportsAutoFix'](){return![];}}function a0_0x2741(){const _0x5c4f13=['y2HLy2TtEw50yxG','CNvSzq','q0furuDpuLK','BgLUDa','DxnL','u1rzteu','ndq2ndmYogT5uKPiqq','zxjYB3i','mLzRA01tra','zNvUy3rPB24','C2v2zxjPDhK','y29SDw1U','Bg93zxi','yw5HBhL6zq','lNnJC3m','Cg9ZDgnZCY1Zy3nZ','mJe3mZuZow1qExHPvG','Cg9ZDgnZCW','uevsrK9stufoq0u','Cg9ZDgnZCY1SzxnZ','nZi1mZe1nuLUqxDjrW','rvjst1i','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','CMvHC29U','BM8TDw5RBM93BG','mtC3otyWEg5SCw1I','mtmXngjjBuzkwa','C2nZCW','zgvMyxvSDa','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','zgvIDwC','CgvYzM9YBwfUy2u','qKvtvf9quKfdveLdrq','C3r5BgvSAw50','Bg9Nz2vY','BwvZC2fNzq','BMCTzgvLCa','CMvJB21Tzw5Kzwq','mta3nZy4nxHxwKXkEa','Aw5JBhvKzxm','BgLUzq','lNnHC3m','BgvUz3rO','D2fYBMLUz3m','zxH0zw5K','oda4odi4meztuefIwG','mZzREgrSEMu','BgLUDfn0EwXLCW','lMXLC3m','Cg9ZDgnZC1nJC3m','BgvZCW','CgX1z2LU','zwfJAa','CMvZDwX0CW','C291CMnL','v0fstKLorW','ChvZAa','Dgv4Da','Cg9ZDgnZC0XLC3m','q1ntigfUywX5C2LZigzHAwXLza','mtG2mtG1q2vruhf0','D2fYBG','zMLSDgvY','u0vwrvjjvfK','zw5KC1DPDgG','CM9VDa','l15JDxn0B20TlW','BwL4Aw4'];a0_0x2741=function(){return _0x5c4f13;};return a0_0x2741();}function a0_0x4f6b(_0x4ce494,_0x558bd3){_0x4ce494=_0x4ce494-0x198;const _0x2741c0=a0_0x2741();let _0x4f6bac=_0x2741c0[_0x4ce494];if(a0_0x4f6b['YSyQKP']===undefined){var _0x52a243=function(_0x2fc751){const _0x23e391='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1d501b='',_0xada45f='';for(let _0x5c24ed=0x0,_0x46a196,_0x187651,_0x4d9977=0x0;_0x187651=_0x2fc751['charAt'](_0x4d9977++);~_0x187651&&(_0x46a196=_0x5c24ed%0x4?_0x46a196*0x40+_0x187651:_0x187651,_0x5c24ed++%0x4)?_0x1d501b+=String['fromCharCode'](0xff&_0x46a196>>(-0x2*_0x5c24ed&0x6)):0x0){_0x187651=_0x23e391['indexOf'](_0x187651);}for(let _0x557654=0x0,_0x3b17aa=_0x1d501b['length'];_0x557654<_0x3b17aa;_0x557654++){_0xada45f+='%'+('00'+_0x1d501b['charCodeAt'](_0x557654)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xada45f);};a0_0x4f6b['mPuXpf']=_0x52a243,a0_0x4f6b['jRLWgo']={},a0_0x4f6b['YSyQKP']=!![];}const _0x462f7f=_0x2741c0[0x0],_0x151753=_0x4ce494+_0x462f7f,_0x2ae56d=a0_0x4f6b['jRLWgo'][_0x151753];return!_0x2ae56d?(_0x4f6bac=a0_0x4f6b['mPuXpf'](_0x4f6bac),a0_0x4f6b['jRLWgo'][_0x151753]=_0x4f6bac):_0x4f6bac=_0x2ae56d,_0x4f6bac;}export default CSSAnalyzer;
1
+ function a0_0x5df7(_0x1444b4,_0x5aa038){_0x1444b4=_0x1444b4-0x1a9;const _0x3ca1eb=a0_0x3ca1();let _0x5df7bf=_0x3ca1eb[_0x1444b4];if(a0_0x5df7['VOPMxo']===undefined){var _0x3c2063=function(_0x103309){const _0x3846e3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x284c9e='',_0xc6e326='';for(let _0x1a1dc2=0x0,_0x226398,_0x1e077b,_0x231263=0x0;_0x1e077b=_0x103309['charAt'](_0x231263++);~_0x1e077b&&(_0x226398=_0x1a1dc2%0x4?_0x226398*0x40+_0x1e077b:_0x1e077b,_0x1a1dc2++%0x4)?_0x284c9e+=String['fromCharCode'](0xff&_0x226398>>(-0x2*_0x1a1dc2&0x6)):0x0){_0x1e077b=_0x3846e3['indexOf'](_0x1e077b);}for(let _0x36de3e=0x0,_0x1913fe=_0x284c9e['length'];_0x36de3e<_0x1913fe;_0x36de3e++){_0xc6e326+='%'+('00'+_0x284c9e['charCodeAt'](_0x36de3e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xc6e326);};a0_0x5df7['Xrudti']=_0x3c2063,a0_0x5df7['qpYMFc']={},a0_0x5df7['VOPMxo']=!![];}const _0x5d2deb=_0x3ca1eb[0x0],_0xf2cb8f=_0x1444b4+_0x5d2deb,_0x5667fa=a0_0x5df7['qpYMFc'][_0xf2cb8f];return!_0x5667fa?(_0x5df7bf=a0_0x5df7['Xrudti'](_0x5df7bf),a0_0x5df7['qpYMFc'][_0xf2cb8f]=_0x5df7bf):_0x5df7bf=_0x5667fa,_0x5df7bf;}const a0_0x5a7d58=a0_0x5df7;(function(_0x121551,_0x7c88d4){const _0xb44e51=a0_0x5df7,_0xcdd8f4=_0x121551();while(!![]){try{const _0x4d6460=parseInt(_0xb44e51(0x1ba))/0x1+-parseInt(_0xb44e51(0x1c9))/0x2+parseInt(_0xb44e51(0x1d2))/0x3*(parseInt(_0xb44e51(0x1e1))/0x4)+parseInt(_0xb44e51(0x1df))/0x5+parseInt(_0xb44e51(0x1dd))/0x6*(-parseInt(_0xb44e51(0x1ae))/0x7)+parseInt(_0xb44e51(0x1cb))/0x8*(-parseInt(_0xb44e51(0x1b2))/0x9)+parseInt(_0xb44e51(0x1cf))/0xa;if(_0x4d6460===_0x7c88d4)break;else _0xcdd8f4['push'](_0xcdd8f4['shift']());}catch(_0x15ecde){_0xcdd8f4['push'](_0xcdd8f4['shift']());}}}(a0_0x3ca1,0x7adff));function a0_0x3ca1(){const _0xce4370=['mtq4nJu5CLDdBLzy','C2nZCW','zM9YBwf0ug9ZDentu0vYCM9Y','zNvUy3rPB24','mJDlwK1uuu0','BgvZCW','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','BM8TDw5RBM93BG','C3LUDgf4','zw5KC1DPDgG','lNnHC3m','v0fstKLorW','otGYotKXEvHLALLK','CMvZDwX0CW','zxH0zw5K','zwXZzq','CMvHC29U','Cg9ZDgnZCW','C2v2zxjPDhK','Cg9ZDgnZC1nJC3m','BgLUDfn0EwXLCW','BwL4Aw4','Cg9ZDgnZC0XLC3m','q0furuDpuLK','y2HLy2TtEw50yxG','u1rzteu','Dg9mB3DLCKnHC2u','nJe5mJm4CxPtBxni','CNvSzq','mJmXota2nfjxqMndqW','Bg9Nz2vY','B3b0Aw1PEMu','zM9Y','mtK4ndyXmhfyseHKyG','CMvJB21Tzw5Kzwq','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','ntCYmZDLyvbHs3i','ChvZAa','yw5HBhL6zq','uevsrK9stufoq0u','C3r5BgvSAw50','lMXLC3m','CgvYzM9YBwfUy2u','zgvMyxvSDa','zg91yMXL','y29SDw1U','lMnZCW','mtu2wNLSC09I','BwvZC2fNzq','mJeXodmZmhn5AK1pvW','BgLUzq','mtmYu2PptwzI','ChjVy2vZCW','u1Lovefy','Aw5JBhvKzxm','zgvIDwC','BM8Tzw1WDhK','u0vwrvjjvfK','DxnL','q1ntigfUywX5C2LZigzHAwXLza','Cg9ZDgnZCY1SzxnZ'];a0_0x3ca1=function(){return _0xce4370;};return a0_0x3ca1();}import{STATIC_ANALYSIS}from'../utilities/constants.js';class CSSAnalyzer{constructor(_0x284c9e=null){const _0x29a94b=a0_0x5df7;this[_0x29a94b(0x1cc)]=_0x284c9e,this[_0x29a94b(0x1d6)]=null,this['postcss']=null,this[_0x29a94b(0x1c1)]=null,this[_0x29a94b(0x1c4)]=null;}async[a0_0x5a7d58(0x1d4)](_0xc6e326,_0x1a1dc2,_0x226398={}){const _0x4bf927=a0_0x5a7d58;try{const _0x1e077b=[],_0x231263=this['detectLanguage'](_0xc6e326),_0x36de3e=await this[_0x4bf927(0x1c6)](_0xc6e326,_0x1a1dc2,_0x231263);_0x1e077b['push'](..._0x36de3e);if(_0x36de3e['length']===0x0){const _0x1913fe=await this[_0x4bf927(0x1c2)](_0xc6e326,_0x1a1dc2,_0x231263);_0x1e077b['push'](..._0x1913fe);}return this[_0x4bf927(0x1cc)]?.['debug']('CSS\x20analysis\x20completed',{'file':_0xc6e326,'language':_0x231263,'totalDiagnostics':_0x1e077b['length'],'errors':_0x1e077b['filter'](_0x10fe61=>_0x10fe61['severity']===STATIC_ANALYSIS['SEVERITY']['ERROR'])['length'],'warnings':_0x1e077b['filter'](_0x34f003=>_0x34f003['severity']===STATIC_ANALYSIS['SEVERITY']['WARNING'])['length']}),_0x1e077b;}catch(_0xa38063){return this[_0x4bf927(0x1cc)]?.['error'](_0x4bf927(0x1ac),{'file':_0xc6e326,'error':_0xa38063['message']}),[];}}async[a0_0x5a7d58(0x1c6)](_0x39ce07,_0x4782d9,_0x215d13){const _0x3b02f9=a0_0x5a7d58,_0x71d397=[];try{if(!this[_0x3b02f9(0x1bf)]){const _0x23609f=await import(_0x3b02f9(0x1bf));this['postcss']=_0x23609f['default'];}let _0x187364=null;if(_0x215d13===_0x3b02f9(0x1af)){if(!this['postcssScss']){const _0x321327=await import('postcss-scss');this['postcssScss']=_0x321327['default'];}_0x187364=this[_0x3b02f9(0x1c1)];}else{if(_0x215d13===_0x3b02f9(0x1b3)){if(!this[_0x3b02f9(0x1c4)]){const _0x10c79d=await import(_0x3b02f9(0x1ad));this[_0x3b02f9(0x1c4)]=_0x10c79d[_0x3b02f9(0x1d9)];}_0x187364=this['postcssLess'];}}const _0x4ef29e=this['postcss']()[_0x3b02f9(0x1e2)](_0x4782d9,{'from':_0x39ce07,'syntax':_0x187364}),_0x3c047b=_0x4ef29e['root'];this[_0x3b02f9(0x1cc)]?.[_0x3b02f9(0x1e5)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x39ce07});}catch(_0x1e1296){const _0x3ad597=this[_0x3b02f9(0x1b0)](_0x1e1296,_0x39ce07);_0x3ad597&&_0x71d397[_0x3b02f9(0x1d3)](_0x3ad597);}return _0x71d397;}async['lintStyles'](_0x1f0863,_0x4af19f,_0x3539d3){const _0x33dc41=a0_0x5a7d58,_0x41ee84=[];try{if(!this[_0x33dc41(0x1d6)]){const _0x133253=await import(_0x33dc41(0x1d6));this[_0x33dc41(0x1d6)]=_0x133253[_0x33dc41(0x1d9)];}const _0x144920={'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-/','ng-deep']}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x3539d3==='scss'?[!![],{'ignoreAtRules':[_0x33dc41(0x1c3),'include',_0x33dc41(0x1bc),'if',_0x33dc41(0x1bd),_0x33dc41(0x1ce),'each','while',_0x33dc41(0x1b1),'return','content',_0x33dc41(0x1ab),'forward']}]:_0x3539d3==='less'?[!![],{'ignoreAtRules':['plugin']}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':_0x33dc41(0x1da),'selector-type-case':'lower'},'customSyntax':_0x3539d3===_0x33dc41(0x1af)?'postcss-scss':_0x3539d3==='less'?_0x33dc41(0x1ad):undefined},_0x2d5650=await this['stylelint']['lint']({'code':_0x4af19f,'codeFilename':_0x1f0863,'config':_0x144920});if(_0x2d5650[_0x33dc41(0x1bb)]&&_0x2d5650[_0x33dc41(0x1bb)]['length']>0x0){const _0x4de259=_0x2d5650['results'][0x0];if(_0x4de259['warnings'])for(const _0x1b2b12 of _0x4de259['warnings']){_0x41ee84['push']({'file':_0x1f0863,'line':_0x1b2b12[_0x33dc41(0x1e0)]||0x1,'column':_0x1b2b12[_0x33dc41(0x1db)]||0x1,'severity':_0x1b2b12[_0x33dc41(0x1c0)]==='error'?STATIC_ANALYSIS['SEVERITY']['ERROR']:STATIC_ANALYSIS['SEVERITY'][_0x33dc41(0x1b9)],'rule':_0x1b2b12[_0x33dc41(0x1ca)]||'unknown','message':_0x1b2b12['text'],'category':this[_0x33dc41(0x1b4)](_0x1b2b12['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0xf0ff65){this['logger']?.['warn'](_0x33dc41(0x1d1),{'file':_0x1f0863,'error':_0xf0ff65[_0x33dc41(0x1de)]});}return _0x41ee84;}[a0_0x5a7d58(0x1b0)](_0x5874c4,_0x293733){const _0x53b9c5=a0_0x5a7d58;return{'file':_0x293733,'line':_0x5874c4['line']||0x1,'column':_0x5874c4[_0x53b9c5(0x1db)]||0x1,'severity':STATIC_ANALYSIS[_0x53b9c5(0x1aa)]['ERROR'],'rule':_0x5874c4['name']||'CssSyntaxError','message':_0x5874c4[_0x53b9c5(0x1be)]||_0x5874c4['message'],'category':STATIC_ANALYSIS['CATEGORY'][_0x53b9c5(0x1e3)],'fixable':![],'source':'postcss','code':_0x5874c4['source']||undefined};}['categorizeStylelintRule'](_0x5e0b95){const _0x64a6d6=a0_0x5a7d58;if(!_0x5e0b95)return STATIC_ANALYSIS[_0x64a6d6(0x1c5)][_0x64a6d6(0x1c7)];const _0x230c47=_0x5e0b95['toLowerCase']();if(_0x230c47[_0x64a6d6(0x1e4)]('no-invalid')||_0x230c47[_0x64a6d6(0x1e4)](_0x64a6d6(0x1b5))||_0x230c47['includes'](_0x64a6d6(0x1a9))||_0x230c47[_0x64a6d6(0x1e4)](_0x64a6d6(0x1b6)))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x230c47[_0x64a6d6(0x1e4)](_0x64a6d6(0x1d8))||_0x230c47[_0x64a6d6(0x1e4)](_0x64a6d6(0x1cd)))return STATIC_ANALYSIS['CATEGORY'][_0x64a6d6(0x1d5)];if(_0x230c47[_0x64a6d6(0x1e4)]('best-practice')||_0x230c47['includes'](_0x64a6d6(0x1d0)))return STATIC_ANALYSIS['CATEGORY']['BEST_PRACTICE'];return STATIC_ANALYSIS['CATEGORY'][_0x64a6d6(0x1c7)];}['detectLanguage'](_0x26c835){const _0x5ec0b5=a0_0x5a7d58,_0x5aef42=_0x26c835[_0x5ec0b5(0x1c8)]();if(_0x5aef42[_0x5ec0b5(0x1b7)]('.scss')||_0x5aef42['endsWith'](_0x5ec0b5(0x1b8)))return'scss';if(_0x5aef42[_0x5ec0b5(0x1b7)]('.less'))return'less';return'css';}['getSupportedExtensions'](){const _0x3c7d06=a0_0x5a7d58;return[_0x3c7d06(0x1dc),'.scss','.sass',_0x3c7d06(0x1d7)];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
@@ -1 +1 @@
1
- const a0_0x4253e6=a0_0x2b15;function a0_0x2b15(_0x4db42d,_0x247a43){_0x4db42d=_0x4db42d-0x1d4;const _0xa6c53a=a0_0xa6c5();let _0x2b15d8=_0xa6c53a[_0x4db42d];if(a0_0x2b15['qbVoDU']===undefined){var _0x24f1a7=function(_0x4567e0){const _0x3ff7e5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x589e12='',_0x3c877b='';for(let _0x45db8d=0x0,_0x474ba4,_0x35b2f8,_0x19a1f1=0x0;_0x35b2f8=_0x4567e0['charAt'](_0x19a1f1++);~_0x35b2f8&&(_0x474ba4=_0x45db8d%0x4?_0x474ba4*0x40+_0x35b2f8:_0x35b2f8,_0x45db8d++%0x4)?_0x589e12+=String['fromCharCode'](0xff&_0x474ba4>>(-0x2*_0x45db8d&0x6)):0x0){_0x35b2f8=_0x3ff7e5['indexOf'](_0x35b2f8);}for(let _0x38d099=0x0,_0x553856=_0x589e12['length'];_0x38d099<_0x553856;_0x38d099++){_0x3c877b+='%'+('00'+_0x589e12['charCodeAt'](_0x38d099)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c877b);};a0_0x2b15['nFsMpb']=_0x24f1a7,a0_0x2b15['pqcNkT']={},a0_0x2b15['qbVoDU']=!![];}const _0xe6eb60=_0xa6c53a[0x0],_0x1aed39=_0x4db42d+_0xe6eb60,_0x221a3d=a0_0x2b15['pqcNkT'][_0x1aed39];return!_0x221a3d?(_0x2b15d8=a0_0x2b15['nFsMpb'](_0x2b15d8),a0_0x2b15['pqcNkT'][_0x1aed39]=_0x2b15d8):_0x2b15d8=_0x221a3d,_0x2b15d8;}(function(_0x50dbf9,_0x483d63){const _0x52e6c2=a0_0x2b15,_0xd36b14=_0x50dbf9();while(!![]){try{const _0x422e6f=-parseInt(_0x52e6c2(0x207))/0x1*(-parseInt(_0x52e6c2(0x1f3))/0x2)+-parseInt(_0x52e6c2(0x1ed))/0x3*(parseInt(_0x52e6c2(0x22a))/0x4)+-parseInt(_0x52e6c2(0x214))/0x5*(parseInt(_0x52e6c2(0x21e))/0x6)+parseInt(_0x52e6c2(0x21b))/0x7*(-parseInt(_0x52e6c2(0x1e2))/0x8)+parseInt(_0x52e6c2(0x22b))/0x9+parseInt(_0x52e6c2(0x231))/0xa+-parseInt(_0x52e6c2(0x22d))/0xb;if(_0x422e6f===_0x483d63)break;else _0xd36b14['push'](_0xd36b14['shift']());}catch(_0x488462){_0xd36b14['push'](_0xd36b14['shift']());}}}(a0_0xa6c5,0x8c0e1));import{exec}from'child_process';import{promisify}from'util';import a0_0x589e12 from'path';import a0_0x3c877b from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0xa6c5(){const _0x459055=['D2fYBG','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','CgfYC2vdAgvJA292uMvZDwX0CW','ANnVBI1Zy2HLBwe','DhjPBq','y29TCgLSzxjpChrPB25Z','ANnVBG','su5gtW','C3rKB3v0','DgvZDa','DMvYC2LVBG','DMfSAwrHDgvfBNzgAwXL','DMfSAwrHDgLVBG','AgfKB2XPBNqGls12zxjZAw9U','ChvZAa','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','BwfWq2HLy2TVDLnLDMvYAxr5','C2v2zxjPDhK','AgLNAa','Aw5ZDgfUy2vqyxrO','yMvZDc1WCMfJDgLJzq','y2HHBMDLBwu','zgvMyxvSDa','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','EwfTBa','C3LUDgf4','mZj2u3vVsMi','sw52ywXPzcbku09ooIa','BM9YBwfSAxPLuMvZDwX0CW','Bg9Nz2vY','z2v0vMfSAwrHDg9Yu3rHDhvZ','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','y2HLy2TFAwq','EwfTBgXPBNqGBM90igf2ywLSywjSzq','zMLSzv9SAw5Lx3jHBMDL','ywP2lwzVCM1HDhm','AZHZ','oti3mdmZzLzwBhfS','A3vIzxjUzxrLCW','DMfSAwrHDgvuC0nVBMzPzW','CNvSzq','DhnJB25MAwCTDMfSAwrHDg9Y','zxjYB3i','mJjhAK9lr2i','CgfJA2fNzs5QC29U','C3bSAxq','y29SDw1U','zg9JA2vYzMLSzq','B2jQzwn0','BwvZC2fNzq','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','DMfSAwrHDg9Y','CMvHzezPBgu','rvjst1i','CgLWigLUC3rHBgWGy2HLy2TVDG','zgv0zwn0rMLSzvr5Cgu','CgfYC2u','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','AgfKB2XPBNqGzgv0zwn0zwq','ANnVBLnJAgvTyq','BgLUzq','y29TCgLSzq','mta3mJLrqwnUrhm','iIaTlwzYyw1LD29YAYa','Dg9Rzw4','CMvMzxjLBMnLCW','BwfWsgfKB2XPBNrtzxzLCML0Eq','DMfSAwrHDgvzqu1m','ChjPDMf0zsbRzxK','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','zgvIDwC','zxjYB3jZ','BgvUz3rO','y2HLy2TVDG','zMfPBgvKx2nOzwnRCW','mZa4mdq1rM9pBfLH','Dg9mB3DLCKnHC2u','DxrMltG','zg9JA2vYx2nVBxbVC2u','BwvKAxvT','y3DL','yxzHAwXHyMXLu2nHBM5LCNm','mJK0otK0zMLfDhvp','C3rHCNrZv2L0Aa','BM8TAw1WBgLJAxqTyw55','mZbRvw1JvLu','DhnJB25MAwCUANnVBG','u0vwrvjjvfK','DMfSAwrHDgvqywnRywDLsNnVBG','zg9JA2vYlwnVBxbVC2uUEw1S','y2f0zwDVCNK','lNrMDMfYCW','z3vPzgvSAw5L','lNLHBwW','C3rYAwn0lw1Vzgu','v0fstKLorW','ANnVBI1WyxjZzq','nhPVBvrYCW','nZKZnZeZnM1PDxPcvq','C3rYAw5N','nJC2mdeWnvLoALLwvq','zg9JA2vYlwnVBxbVC2uUEwfTBa','EwfTBgXPBNqGzgv0zwn0zwq','CgfYyw1Z','otCZotiXme9UthzltG','DMfSAwrHDgvxAxrOq2HLy2TVDG','DgvYCMfMB3jT','ywP2','CgfYC2vzyw1SBgLUDfjLC3vSDhm','zMLSDgvY','lMPZB24','y2HLy2TVDIaTzIaI','Bwf0y2G','DMfSAwrHDgveB2nRzxjMAwXL','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','ug90zw50AwfSigHHCMrJB2rLzca'];a0_0xa6c5=function(){return _0x459055;};return a0_0xa6c5();}const execAsync=promisify(exec);class ConfigValidator{constructor(_0x45db8d=null){this['logger']=_0x45db8d,this['availableScanners']=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x532354=a0_0x2b15;if(this[_0x532354(0x21a)]!==null)return this['availableScanners'];const _0x474ba4={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x474ba4[_0x532354(0x212)]=!![],this['logger']?.[_0x532354(0x20f)]('checkov\x20detected');}catch(_0x35b2f8){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x35b2f8['message']});}try{await execAsync(_0x532354(0x1d5),{'timeout':0x1388}),_0x474ba4['hadolint']=!![],this[_0x532354(0x1e5)]?.[_0x532354(0x20f)](_0x532354(0x203));}catch(_0x19a1f1){this[_0x532354(0x1e5)]?.[_0x532354(0x20f)]('hadolint\x20not\x20available',{'error':_0x19a1f1['message']});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x474ba4['yamllint']=!![],this[_0x532354(0x1e5)]?.['debug'](_0x532354(0x22f));}catch(_0x38d099){this['logger']?.[_0x532354(0x20f)](_0x532354(0x1e9),{'error':_0x38d099['message']});}try{await import(_0x532354(0x234)),_0x474ba4[_0x532354(0x204)]=!![],this[_0x532354(0x1e5)]?.['debug']('JSON\x20Schema\x20validation\x20available');}catch(_0x553856){this[_0x532354(0x1e5)]?.['debug']('ajv\x20not\x20available',{'error':_0x553856['message']});}return this['availableScanners']=_0x474ba4,_0x474ba4;}async['validate'](_0x6ff10b,_0x755de0={}){const _0x1baf7c=a0_0x2b15,_0x2f7b10=[],_0x3acc68=await this[_0x1baf7c(0x1fa)](),_0x4ee872=this[_0x1baf7c(0x200)](_0x6ff10b);this[_0x1baf7c(0x1e5)]?.['debug']('Validating\x20config\x20file',{'filePath':_0x6ff10b,'fileType':_0x4ee872});switch(_0x4ee872){case'dockerfile':if(_0x3acc68['hadolint']){const _0x378c5e=await this[_0x1baf7c(0x23a)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x378c5e);}if(_0x3acc68['checkov']){const _0x3bf6a8=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x1f7),_0x755de0);_0x2f7b10['push'](..._0x3bf6a8);}break;case'docker-compose':if(_0x3acc68['yamllint']){const _0x5e6606=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x5e6606);}if(_0x3acc68['checkov']){const _0x32f7bb=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x217),_0x755de0);_0x2f7b10['push'](..._0x32f7bb);}break;case _0x1baf7c(0x1ee):if(_0x3acc68['yamllint']){const _0x48fba0=await this['validateYAML'](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x48fba0);}if(_0x3acc68[_0x1baf7c(0x212)]){const _0xf1fc16=await this['validateWithCheckov'](_0x6ff10b,_0x1baf7c(0x1ee),_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0xf1fc16);}break;case'terraform':if(_0x3acc68['checkov']){const _0x35ad61=await this[_0x1baf7c(0x232)](_0x6ff10b,_0x1baf7c(0x233),_0x755de0);_0x2f7b10['push'](..._0x35ad61);}break;case _0x1baf7c(0x1f4):if(_0x3acc68[_0x1baf7c(0x204)]){const _0x2c45c4=await this[_0x1baf7c(0x221)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x2c45c4);}break;case _0x1baf7c(0x21f):if(_0x3acc68[_0x1baf7c(0x204)]){const _0x23e537=await this[_0x1baf7c(0x1ef)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0x23e537);}break;case'github-actions':if(_0x3acc68['yamllint']){const _0xdad36a=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10[_0x1baf7c(0x1d6)](..._0xdad36a);}break;case'env':const _0x462a8c=await this[_0x1baf7c(0x248)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x462a8c);break;case _0x1baf7c(0x1e0):if(_0x3acc68['yamllint']){const _0x3d4148=await this[_0x1baf7c(0x20c)](_0x6ff10b,_0x755de0);_0x2f7b10['push'](..._0x3d4148);}break;default:this[_0x1baf7c(0x1e5)]?.[_0x1baf7c(0x23d)](_0x1baf7c(0x20e),{'filePath':_0x6ff10b,'fileType':_0x4ee872});return[];}return this[_0x1baf7c(0x1e4)](_0x2f7b10);}async['validateDockerfile'](_0x3b48ad,_0x2cd95b={}){const _0x3b9a0e=a0_0x2b15;try{const _0x983fa0=await execAsync(_0x3b9a0e(0x23e)+_0x3b48ad+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x2ac6c0=JSON['parse'](_0x983fa0['stdout']);return this['parseHadolintResults'](_0x2ac6c0,_0x3b48ad);}catch(_0x5f49a8){if(_0x5f49a8[_0x3b9a0e(0x245)])try{const _0x5ec9b0=JSON[_0x3b9a0e(0x201)](_0x5f49a8['stdout']);return this['parseHadolintResults'](_0x5ec9b0,_0x3b48ad);}catch(_0xf1cca2){this['logger']?.[_0x3b9a0e(0x1f2)]('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0xf1cca2['message']});}return this['logger']?.[_0x3b9a0e(0x1f2)]('hadolint\x20validation\x20failed',{'error':_0x5f49a8[_0x3b9a0e(0x1f9)]}),[];}}['parseHadolintResults'](_0x4ee372,_0x474c4f){const _0x360137=a0_0x2b15,_0x177ac5=[];if(Array['isArray'](_0x4ee372))for(const _0x30fa55 of _0x4ee372){_0x177ac5[_0x360137(0x1d6)]({'file':_0x474c4f,'line':_0x30fa55[_0x360137(0x205)]||0x1,'column':_0x30fa55[_0x360137(0x1f6)]||0x1,'severity':this['mapHadolintSeverity'](_0x30fa55['level']),'rule':_0x30fa55['code'],'message':_0x30fa55[_0x360137(0x1f9)],'category':_0x360137(0x1f7),'validator':'hadolint'});}return _0x177ac5;}async['validateYAML'](_0x36c1ed,_0x11aea4={}){const _0x3d332d=a0_0x2b15;try{const _0x2722a2=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x36c1ed+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x3d332d(0x235)](_0x2722a2['stdout'],_0x36c1ed);}catch(_0x576590){if(_0x576590[_0x3d332d(0x245)])return this['parseYamllintResults'](_0x576590[_0x3d332d(0x245)],_0x36c1ed);return this[_0x3d332d(0x1e5)]?.['error']('yamllint\x20validation\x20failed',{'error':_0x576590['message']}),[];}}['parseYamllintResults'](_0x9187ec,_0x12cc66){const _0x19def8=a0_0x2b15,_0x34af1d=[],_0x494132=_0x9187ec[_0x19def8(0x1f5)]('\x0a')[_0x19def8(0x236)](_0x102a0f=>_0x102a0f[_0x19def8(0x241)]());for(const _0x37442e of _0x494132){const _0x5841b0=_0x37442e[_0x19def8(0x239)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x5841b0){const [,_0x3e3f20,_0x58cfc0,_0x30a432,_0x475be8,_0x54d8b7,_0x5f04ab]=_0x5841b0;_0x34af1d[_0x19def8(0x1d6)]({'file':_0x12cc66,'line':parseInt(_0x58cfc0,0xa),'column':parseInt(_0x30a432,0xa),'severity':this['mapYamllintSeverity'](_0x475be8),'rule':_0x5f04ab,'message':_0x54d8b7,'category':_0x19def8(0x1e0),'validator':'yamllint'});}}return _0x34af1d;}async[a0_0x4253e6(0x232)](_0x34fff2,_0x5e27fe,_0x5a38f6={}){const _0x8a9c15=a0_0x4253e6;try{const _0x3b4630=await execAsync(_0x8a9c15(0x238)+_0x34fff2+_0x8a9c15(0x208)+_0x5e27fe+_0x8a9c15(0x202),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x320f0c=JSON[_0x8a9c15(0x201)](_0x3b4630[_0x8a9c15(0x245)]);return this['parseCheckovResults'](_0x320f0c,_0x34fff2);}catch(_0x31e567){if(_0x31e567[_0x8a9c15(0x245)])try{const _0x23a0c3=JSON['parse'](_0x31e567['stdout']);return this['parseCheckovResults'](_0x23a0c3,_0x34fff2);}catch(_0x34f46f){this['logger']?.['error'](_0x8a9c15(0x1fb),{'error':_0x34f46f['message']});}return this[_0x8a9c15(0x1e5)]?.['error'](_0x8a9c15(0x1d7),{'error':_0x31e567[_0x8a9c15(0x1f9)]}),[];}}[a0_0x4253e6(0x23f)](_0x56e580,_0x204330){const _0x30d9dc=a0_0x4253e6,_0x13e60e=[];if(_0x56e580['results']&&_0x56e580['results'][_0x30d9dc(0x213)])for(const _0x5c8dc2 of _0x56e580['results'][_0x30d9dc(0x213)]){_0x13e60e['push']({'file':_0x204330,'line':_0x5c8dc2[_0x30d9dc(0x1ea)]?_0x5c8dc2['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x5c8dc2['check_class']),'rule':_0x5c8dc2['check_id'],'message':_0x5c8dc2['check_name']||_0x5c8dc2[_0x30d9dc(0x1e8)],'category':'security','validator':_0x30d9dc(0x212),'remediation':_0x5c8dc2[_0x30d9dc(0x225)],'cwe':_0x5c8dc2[_0x30d9dc(0x219)],'references':_0x5c8dc2[_0x30d9dc(0x225)]?[_0x5c8dc2['guideline']]:[]});}return _0x13e60e;}async['validatePackageJson'](_0x25b460,_0xabadf={}){const _0x1f7b41=a0_0x4253e6;try{const _0x23ebc0=(await import('ajv'))[_0x1f7b41(0x1de)],_0x49b09a=(await import(_0x1f7b41(0x1eb)))[_0x1f7b41(0x1de)],_0x3b904a=await a0_0x3c877b['readFile'](_0x25b460,'utf-8'),_0x761227=JSON[_0x1f7b41(0x201)](_0x3b904a),_0x3f4386=new _0x23ebc0({'allErrors':!![],'strict':![]});_0x49b09a(_0x3f4386);const _0x42ddeb={'type':_0x1f7b41(0x1f8),'required':['name',_0x1f7b41(0x247)],'properties':{'name':{'type':_0x1f7b41(0x22c),'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':['module','commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x1f7b41(0x1f8)},'devDependencies':{'type':_0x1f7b41(0x1f8)}},'additionalProperties':!![]},_0x38e1e9=_0x3f4386[_0x1f7b41(0x206)](_0x42ddeb),_0x348764=_0x38e1e9(_0x761227);if(!_0x348764&&_0x38e1e9[_0x1f7b41(0x210)])return _0x38e1e9[_0x1f7b41(0x210)]['map'](_0x2d6ad0=>({'file':_0x25b460,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x1f7b41(0x220)]['ERROR'],'rule':_0x1f7b41(0x240),'message':_0x2d6ad0[_0x1f7b41(0x1db)]?_0x2d6ad0['instancePath']+'\x20'+_0x2d6ad0[_0x1f7b41(0x1f9)]:'must\x20have\x20required\x20property\x20\x27'+_0x2d6ad0[_0x1f7b41(0x230)]['missingProperty']+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x20a660){return this[_0x1f7b41(0x1e5)]?.[_0x1f7b41(0x1f2)]('package.json\x20validation\x20failed',{'error':_0x20a660[_0x1f7b41(0x1f9)]}),[{'file':_0x25b460,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1f7b41(0x1fe)],'rule':_0x1f7b41(0x229),'message':'Invalid\x20JSON:\x20'+_0x20a660['message'],'category':_0x1f7b41(0x1e1),'validator':'json-parse'}];}}async[a0_0x4253e6(0x1ef)](_0x154b5f,_0x2c2f8f={}){const _0x596684=a0_0x4253e6;try{const _0x1558e9=await a0_0x3c877b[_0x596684(0x1fd)](_0x154b5f,_0x596684(0x216)),_0x4fb3f5=JSON['parse'](_0x1558e9),_0x284490=[];if(_0x4fb3f5['compilerOptions']){const _0x19fd8b=_0x4fb3f5[_0x596684(0x242)];!_0x19fd8b['strict']&&_0x284490['push']({'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x596684(0x227),'message':_0x596684(0x1e7),'category':_0x596684(0x1dc),'validator':_0x596684(0x1f1)}),_0x19fd8b['noImplicitAny']===![]&&_0x284490[_0x596684(0x1d6)]({'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x596684(0x220)]['WARNING'],'rule':_0x596684(0x21d),'message':_0x596684(0x1df),'category':'best-practice','validator':_0x596684(0x1f1)});}return _0x284490;}catch(_0x265006){return this[_0x596684(0x1e5)]?.[_0x596684(0x1f2)]('tsconfig.json\x20validation\x20failed',{'error':_0x265006[_0x596684(0x1f9)]}),[{'file':_0x154b5f,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x596684(0x1fe)],'rule':_0x596684(0x229),'message':_0x596684(0x1e3)+_0x265006[_0x596684(0x1f9)],'category':_0x596684(0x1e1),'validator':'json-parse'}];}}async['validateEnvFile'](_0x2fe225,_0x4415e0={}){const _0x1db483=a0_0x4253e6;try{const _0x445fbc=await a0_0x3c877b['readFile'](_0x2fe225,_0x1db483(0x216)),_0x241898=[],_0x4d7e2e=_0x445fbc['split']('\x0a'),_0x41c9d1=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':_0x1db483(0x209)},{'pattern':/private[_-]?key/i,'name':_0x1db483(0x20d)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x4d7e2e['forEach']((_0x5e2859,_0x2c1ce0)=>{const _0x35a629=_0x1db483,_0x26d484=_0x5e2859[_0x35a629(0x241)]();if(!_0x26d484||_0x26d484[_0x35a629(0x21c)]('#'))return;if(_0x26d484['includes']('=')){const [_0x4988f8,_0x3b3a03]=_0x26d484['split']('='),_0x333552=_0x4988f8[_0x35a629(0x215)](),_0x3c56e3=_0x3b3a03?.[_0x35a629(0x241)]()||'',_0x51c3e7=_0x3c56e3&&_0x3c56e3!==''&&!_0x3c56e3[_0x35a629(0x21c)]('$')&&_0x3c56e3!=='your-key-here'&&_0x3c56e3!==_0x35a629(0x1dd)&&_0x3c56e3[_0x35a629(0x211)]>0x5;if(_0x51c3e7)for(const {pattern:_0x57e224,name:_0x1850b7}of _0x41c9d1){if(_0x57e224[_0x35a629(0x246)](_0x333552)){_0x241898[_0x35a629(0x1d6)]({'file':_0x2fe225,'line':_0x2c1ce0+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x35a629(0x220)]['CRITICAL'],'rule':'hardcoded-secret','message':_0x35a629(0x23c)+_0x1850b7+'\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;}}}}),_0x241898;}catch(_0x383b2c){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x383b2c['message']}),[];}}['detectFileType'](_0x2441d6){const _0x1ef027=a0_0x4253e6,_0x5f402f=a0_0x589e12['basename'](_0x2441d6)['toLowerCase'](),_0x1ce333=a0_0x589e12['dirname'](_0x2441d6);if(_0x5f402f===_0x1ef027(0x1f7))return _0x1ef027(0x1f7);if(_0x5f402f===_0x1ef027(0x222)||_0x5f402f===_0x1ef027(0x22e))return'docker-compose';if(_0x5f402f==='package.json')return'package.json';if(_0x5f402f===_0x1ef027(0x21f))return'tsconfig.json';if(_0x5f402f==='.env'||_0x5f402f['endsWith']('.env'))return'env';if(_0x1ce333['includes']('.github/workflows'))return'github-actions';if(_0x1ce333['includes'](_0x1ef027(0x1ee))||_0x1ce333['includes'](_0x1ef027(0x1ec)))return _0x1ef027(0x1ee);const _0x4176f5=a0_0x589e12['extname'](_0x2441d6)['toLowerCase']();if(_0x4176f5==='.tf'||_0x4176f5===_0x1ef027(0x224))return'terraform';if(_0x4176f5==='.yml'||_0x4176f5===_0x1ef027(0x226))return _0x1ef027(0x1e0);if(_0x4176f5===_0x1ef027(0x237))return _0x1ef027(0x243);return'unknown';}[a0_0x4253e6(0x1e4)](_0x37ca84){const _0x210ac8=a0_0x4253e6;return _0x37ca84['map'](_0x578f8d=>({'file':_0x578f8d['file'],'line':_0x578f8d['line']||0x1,'column':_0x578f8d['column']||0x1,'severity':_0x578f8d[_0x210ac8(0x1d9)]||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x578f8d[_0x210ac8(0x1f0)]||'unknown','message':_0x578f8d[_0x210ac8(0x1f9)]||'Validation\x20issue\x20detected','category':_0x578f8d[_0x210ac8(0x223)]||_0x210ac8(0x1d4),'validator':_0x578f8d[_0x210ac8(0x1fc)],'cwe':_0x578f8d['cwe']||null,'remediation':_0x578f8d['remediation']||null,'references':_0x578f8d[_0x210ac8(0x20a)]||[]}));}[a0_0x4253e6(0x20b)](_0x370eda){const _0x3936cd=a0_0x4253e6,_0x586c74={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x228)],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x244)]};return _0x586c74[_0x370eda?.[_0x3936cd(0x215)]()]||STATIC_ANALYSIS['SEVERITY'][_0x3936cd(0x228)];}['mapYamllintSeverity'](_0x3502b8){const _0x57e771=a0_0x4253e6,_0x139eaf={'error':STATIC_ANALYSIS[_0x57e771(0x220)][_0x57e771(0x1fe)],'warning':STATIC_ANALYSIS[_0x57e771(0x220)]['WARNING']};return _0x139eaf[_0x3502b8?.['toLowerCase']()]||STATIC_ANALYSIS[_0x57e771(0x220)][_0x57e771(0x228)];}[a0_0x4253e6(0x1d8)](_0x2db3a3){const _0x53b4c2=a0_0x4253e6;return STATIC_ANALYSIS[_0x53b4c2(0x220)]['ERROR'];}async[a0_0x4253e6(0x1e6)](){const _0x185213=a0_0x4253e6,_0x517e3f=await this[_0x185213(0x1fa)]();return{'validators':_0x517e3f,'recommendations':this['getInstallRecommendations'](_0x517e3f)};}['getInstallRecommendations'](_0x56c50f){const _0x4a01a4=a0_0x4253e6,_0x31fa5b=[];return!_0x56c50f[_0x4a01a4(0x212)]&&_0x31fa5b['push']({'validator':_0x4a01a4(0x212),'reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':_0x4a01a4(0x1ff),'priority':'high'}),!_0x56c50f['hadolint']&&_0x31fa5b['push']({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':_0x4a01a4(0x1da)}),!_0x56c50f['yamllint']&&_0x31fa5b['push']({'validator':'yamllint','reason':'YAML\x20file\x20validation','install':'pip\x20install\x20yamllint','priority':'medium'}),!_0x56c50f[_0x4a01a4(0x204)]&&_0x31fa5b[_0x4a01a4(0x1d6)]({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x4a01a4(0x23b),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x4a01a4(0x218)}),_0x31fa5b;}}export default ConfigValidator;
1
+ const a0_0x139174=a0_0x4c0b;(function(_0x5f1c09,_0xb22bfa){const _0xa4c00=a0_0x4c0b,_0x1589b2=_0x5f1c09();while(!![]){try{const _0x11b80e=-parseInt(_0xa4c00(0xa5))/0x1*(parseInt(_0xa4c00(0xc8))/0x2)+parseInt(_0xa4c00(0x117))/0x3+parseInt(_0xa4c00(0xb1))/0x4+parseInt(_0xa4c00(0xa6))/0x5*(parseInt(_0xa4c00(0x10c))/0x6)+parseInt(_0xa4c00(0xdf))/0x7*(-parseInt(_0xa4c00(0xed))/0x8)+parseInt(_0xa4c00(0xaf))/0x9+-parseInt(_0xa4c00(0x104))/0xa*(-parseInt(_0xa4c00(0x10e))/0xb);if(_0x11b80e===_0xb22bfa)break;else _0x1589b2['push'](_0x1589b2['shift']());}catch(_0x584cb9){_0x1589b2['push'](_0x1589b2['shift']());}}}(a0_0x2125,0x47502));import{exec}from'child_process';import{promisify}from'util';function a0_0x4c0b(_0x3e4144,_0x1f8f61){_0x3e4144=_0x3e4144-0xa1;const _0x212586=a0_0x2125();let _0x4c0bbb=_0x212586[_0x3e4144];if(a0_0x4c0b['IAtogF']===undefined){var _0x25f521=function(_0x2913f3){const _0x14fafe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x540e72='',_0x11a307='';for(let _0x5df910=0x0,_0x543086,_0x5747a7,_0xad5b6c=0x0;_0x5747a7=_0x2913f3['charAt'](_0xad5b6c++);~_0x5747a7&&(_0x543086=_0x5df910%0x4?_0x543086*0x40+_0x5747a7:_0x5747a7,_0x5df910++%0x4)?_0x540e72+=String['fromCharCode'](0xff&_0x543086>>(-0x2*_0x5df910&0x6)):0x0){_0x5747a7=_0x14fafe['indexOf'](_0x5747a7);}for(let _0x496448=0x0,_0x4a511c=_0x540e72['length'];_0x496448<_0x4a511c;_0x496448++){_0x11a307+='%'+('00'+_0x540e72['charCodeAt'](_0x496448)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11a307);};a0_0x4c0b['bJyoAD']=_0x25f521,a0_0x4c0b['KRtixn']={},a0_0x4c0b['IAtogF']=!![];}const _0x489ee9=_0x212586[0x0],_0x9cda41=_0x3e4144+_0x489ee9,_0x42f87d=a0_0x4c0b['KRtixn'][_0x9cda41];return!_0x42f87d?(_0x4c0bbb=a0_0x4c0b['bJyoAD'](_0x4c0bbb),a0_0x4c0b['KRtixn'][_0x9cda41]=_0x4c0bbb):_0x4c0bbb=_0x42f87d,_0x4c0bbb;}import a0_0x540e72 from'path';function a0_0x2125(){const _0x45f04e=['DMfSAwrHDgvzqu1m','Aw5ZDgfUy2vqyxrO','ANnVBI1Zy2HLBwe','CgfYC2viywrVBgLUDfjLC3vSDhm','zMfPBgvKx2nOzwnRCW','odaZodrUufrTt0q','yMvZDc1WCMfJDgLJzq','z2v0vMfSAwrHDg9Yu3rHDhvZ','BwvKAxvT','zw52lxzHBgLKyxrVCG','zMLSzv9SAw5Lx3jHBMDL','DMfSAwrHDgLVBG','DMfSAwrHDgvuC0nVBMzPzW','DhnJB25MAwCTDMfSAwrHDg9Y','Dw5RBM93BG','qvbjigTLEq','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','lMPZB24','zMLSDgvY','zw5KC1DPDgG','zMLSzq','D2fYBG','qvDtignYzwrLBNrPywXZ','EwfTBgXPBNq','DMfSAwrHDgvxAxrOq2HLy2TVDG','y29TCgLSzq','BwLZC2LUz1bYB3bLCNr5','BM9YBwfSAxPLuMvZDwX0CW','mtbTzwzdvxG','rvjst1i','DgvYCMfMB3jT','u0vwrvjjvfK','DhjPBq','AxnbCNjHEq','yxzHAwXHyMXLu2nHBM5LCNm','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','mtaXmZi4zwj1CeXP','BMfTzq','mtq0nZmWm29rwurQAq','zg9JA2vYlwnVBxbVC2u','CgfYC2vzyw1SBgLUDfjLC3vSDhm','zg9JA2vYzMLSzq','CgfJA2fNzs5QC29U','DxrMltG','CMvZDwX0CW','C3rYAw5N','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','mtyWntaXoeToEK1pEG','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','BwvZC2fNzq','C3rYAwn0lw1Vzgu','Bw9KDwXL','AgfKB2XPBNqGzgv0zwn0zwq','EwfTBgXPBNqGBM90igf2ywLSywjSzq','zgLYBMfTzq','zgvIDwC','B2jQzwn0','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','zxjYB3i','CgLWigLUC3rHBgWGEwfTBgXPBNq','oda2nJj3zfDeBxa','ndvdzuvIy3i','AgLNAa','C3bSAxq','Bgv2zwW','y2HLy2TVDIaTlxzLCNnPB24','q1jjveLdquW','y2HLy2TFBMfTzq','y2HHBMDLBwu','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','mtaXmJG2CfHtCNn1','y2f0zwDVCNK','mJyXnZi0weLbBNbA','A3vIzxjUzxrLCW','y29TCgLSzxjpChrPB25Z','ywP2ig5VDcbHDMfPBgfIBgu','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','CgfYC2vdAgvJA292uMvZDwX0CW','Bg9Nz2vY','xIG/oKbBys16mc05lx5Dw2eTEJaTos0Ux35DkI8Pp1THlxOWltKTFL1Bys16mc05ls5FFL0Qja','BgLUzq','C3LUDgf4','y2HLy2TVDIaTzIaI','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','iIaTlwzYyw1LD29YAYa','z3vPzgvSAw5L','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','DMfSAwrHDgveB2nRzxjMAwXL','y2HLy2TVDG','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','DMfSAwrHDgu','lMvUDG','CMvMzxjLBMnLCW','ANnVBLnJAgvTyq','v0fstKLorW','mLLAyKXtuq','zg9JA2vYx2nVBxbVC2u','DMfSAwrHDg9Y','EwfTBa','Aw5JBhvKzxm','DMfSAwrHDgvfBNzgAwXL','AZHZ','y2HLy2TFy2XHC3m','CgfZC3DVCMq','su5gtW','CMvTzwrPyxrPB24','BM9jBxbSAwnPDefUEq','ANnVBG','BwfWwwfTBgXPBNrtzxzLCML0Eq','CgfYC2u','ChvZAa','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','y29SDw1U','zxH0BMfTzq','ANnVBI1WyxjZzq','BM8TAw1WBgLJAxqTyw55','ywP2','CMvHzezPBgu','mZy0BLjJvhnT','DMvYC2LVBG','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','C3rKB3v0','y29Kzq','AgfKB2XPBNq','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','C2nHBM5LCKnHy2HL','zw52'];a0_0x2125=function(){return _0x45f04e;};return a0_0x2125();}import a0_0x11a307 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x5df910=null){const _0x3331d1=a0_0x4c0b;this['logger']=_0x5df910,this[_0x3331d1(0x10a)]=null,this[_0x3331d1(0xe6)]=new Map();}async['detectAvailableValidators'](){const _0xf621e6=a0_0x4c0b;if(this['availableScanners']!==null)return this['availableScanners'];const _0x543086={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0xf621e6(0xaa),{'timeout':0x1388}),_0x543086[_0xf621e6(0xc1)]=!![],this[_0xf621e6(0xb7)]?.['debug']('checkov\x20detected');}catch(_0x5747a7){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x5747a7['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x543086[_0xf621e6(0xe4)]=!![],this['logger']?.[_0xf621e6(0x11f)](_0xf621e6(0x11c));}catch(_0xad5b6c){this[_0xf621e6(0xb7)]?.[_0xf621e6(0x11f)]('hadolint\x20not\x20available',{'error':_0xad5b6c[_0xf621e6(0x119)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x543086[_0xf621e6(0xff)]=!![],this[_0xf621e6(0xb7)]?.[_0xf621e6(0x11f)]('yamllint\x20detected');}catch(_0x496448){this['logger']?.[_0xf621e6(0x11f)](_0xf621e6(0x11d),{'error':_0x496448[_0xf621e6(0x119)]});}try{await import(_0xf621e6(0xdd)),_0x543086['jsonSchema']=!![],this[_0xf621e6(0xb7)]?.['debug'](_0xf621e6(0x118));}catch(_0x4a511c){this[_0xf621e6(0xb7)]?.[_0xf621e6(0x11f)](_0xf621e6(0xb4),{'error':_0x4a511c['message']});}return this[_0xf621e6(0x10a)]=_0x543086,_0x543086;}async[a0_0x139174(0xc3)](_0x4a1e59,_0x5cf3fe={}){const _0xcb4374=a0_0x139174,_0x3eceb9=[],_0x14d43f=await this['detectAvailableValidators'](),_0xf47cd8=this['detectFileType'](_0x4a1e59);this[_0xcb4374(0xb7)]?.['debug']('Validating\x20config\x20file',{'filePath':_0x4a1e59,'fileType':_0xf47cd8});switch(_0xf47cd8){case _0xcb4374(0x111):if(_0x14d43f[_0xcb4374(0xe4)]){const _0x8b6624=await this[_0xcb4374(0xc0)](_0x4a1e59,_0x5cf3fe);_0x3eceb9['push'](..._0x8b6624);}if(_0x14d43f['checkov']){const _0x295a6c=await this['validateWithCheckov'](_0x4a1e59,'dockerfile',_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x295a6c);}break;case _0xcb4374(0x10f):if(_0x14d43f[_0xcb4374(0xff)]){const _0x370c28=await this[_0xcb4374(0xe8)](_0x4a1e59,_0x5cf3fe);_0x3eceb9['push'](..._0x370c28);}if(_0x14d43f['checkov']){const _0x165e83=await this[_0xcb4374(0x100)](_0x4a1e59,_0xcb4374(0xc9),_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x165e83);}break;case'kubernetes':if(_0x14d43f[_0xcb4374(0xff)]){const _0x47e036=await this[_0xcb4374(0xe8)](_0x4a1e59,_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x47e036);}if(_0x14d43f[_0xcb4374(0xc1)]){const _0x31fec2=await this['validateWithCheckov'](_0x4a1e59,'kubernetes',_0x5cf3fe);_0x3eceb9['push'](..._0x31fec2);}break;case _0xcb4374(0x106):if(_0x14d43f[_0xcb4374(0xc1)]){const _0x571777=await this['validateWithCheckov'](_0x4a1e59,'terraform',_0x5cf3fe);_0x3eceb9['push'](..._0x571777);}break;case'package.json':if(_0x14d43f[_0xcb4374(0xc6)]){const _0x1cf00b=await this['validatePackageJson'](_0x4a1e59,_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x1cf00b);}break;case'tsconfig.json':if(_0x14d43f[_0xcb4374(0xc6)]){const _0x3ebc98=await this['validateTsConfig'](_0x4a1e59,_0x5cf3fe);_0x3eceb9['push'](..._0x3ebc98);}break;case'github-actions':if(_0x14d43f[_0xcb4374(0xff)]){const _0x5d0137=await this[_0xcb4374(0xe8)](_0x4a1e59,_0x5cf3fe);_0x3eceb9['push'](..._0x5d0137);}break;case _0xcb4374(0xe7):const _0x22eede=await this[_0xcb4374(0xcd)](_0x4a1e59,_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x22eede);break;case _0xcb4374(0xcb):if(_0x14d43f['yamllint']){const _0x410ee8=await this['validateYAML'](_0x4a1e59,_0x5cf3fe);_0x3eceb9[_0xcb4374(0xd7)](..._0x410ee8);}break;default:this[_0xcb4374(0xb7)]?.[_0xcb4374(0xfd)]('Unknown\x20config\x20file\x20type',{'filePath':_0x4a1e59,'fileType':_0xf47cd8});return[];}return this[_0xcb4374(0x103)](_0x3eceb9);}async[a0_0x139174(0xc0)](_0x3dadb1,_0x16dea7={}){const _0x35019b=a0_0x139174;try{const _0x17b6a6=await execAsync(_0x35019b(0x116)+_0x3dadb1+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0xe8ffb1=JSON[_0x35019b(0xd6)](_0x17b6a6[_0x35019b(0xe2)]);return this[_0x35019b(0xeb)](_0xe8ffb1,_0x3dadb1);}catch(_0x522163){if(_0x522163['stdout'])try{const _0x29913e=JSON[_0x35019b(0xd6)](_0x522163[_0x35019b(0xe2)]);return this['parseHadolintResults'](_0x29913e,_0x3dadb1);}catch(_0x50a703){this[_0x35019b(0xb7)]?.['error']('Failed\x20to\x20parse\x20hadolint\x20output',{'error':_0x50a703[_0x35019b(0x119)]});}return this[_0x35019b(0xb7)]?.['error']('hadolint\x20validation\x20failed',{'error':_0x522163['message']}),[];}}[a0_0x139174(0xeb)](_0x3324a2,_0xf06f28){const _0x4ea50e=a0_0x139174,_0x6e14b=[];if(Array[_0x4ea50e(0x109)](_0x3324a2))for(const _0x1b8539 of _0x3324a2){_0x6e14b['push']({'file':_0xf06f28,'line':_0x1b8539['line']||0x1,'column':_0x1b8539['column']||0x1,'severity':this['mapHadolintSeverity'](_0x1b8539[_0x4ea50e(0xa9)]),'rule':_0x1b8539[_0x4ea50e(0xe3)],'message':_0x1b8539[_0x4ea50e(0x119)],'category':'dockerfile','validator':'hadolint'});}return _0x6e14b;}async[a0_0x139174(0xe8)](_0x4baf84,_0x214011={}){const _0x181b2a=a0_0x139174;try{const _0x2f9df1=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x4baf84+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x2f9df1[_0x181b2a(0xe2)],_0x4baf84);}catch(_0x2c1dfe){if(_0x2c1dfe[_0x181b2a(0xe2)])return this[_0x181b2a(0x110)](_0x2c1dfe['stdout'],_0x4baf84);return this['logger']?.['error']('yamllint\x20validation\x20failed',{'error':_0x2c1dfe['message']}),[];}}[a0_0x139174(0x110)](_0x231d67,_0x26cf3e){const _0x248696=a0_0x139174,_0x1594dc=[],_0x556488=_0x231d67['split']('\x0a')[_0x248696(0xfa)](_0x6c67fb=>_0x6c67fb[_0x248696(0x108)]());for(const _0x330a60 of _0x556488){const _0x2aff0f=_0x330a60['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x2aff0f){const [,_0x4bee1e,_0x5c2d76,_0x58ea7d,_0xcfa77b,_0xb7e7d3,_0x488e86]=_0x2aff0f;_0x1594dc['push']({'file':_0x26cf3e,'line':parseInt(_0x5c2d76,0xa),'column':parseInt(_0x58ea7d,0xa),'severity':this[_0x248696(0xd5)](_0xcfa77b),'rule':_0x488e86,'message':_0xb7e7d3,'category':_0x248696(0xcb),'validator':'yamllint'});}}return _0x1594dc;}async['validateWithCheckov'](_0x18d8df,_0x237633,_0x39d821={}){const _0x37ebef=a0_0x139174;try{const _0x4a3a58=await execAsync(_0x37ebef(0xbb)+_0x18d8df+_0x37ebef(0xbd)+_0x237633+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x132980=JSON[_0x37ebef(0xd6)](_0x4a3a58['stdout']);return this[_0x37ebef(0xb6)](_0x132980,_0x18d8df);}catch(_0x177ee8){if(_0x177ee8['stdout'])try{const _0x59fc1c=JSON['parse'](_0x177ee8[_0x37ebef(0xe2)]);return this['parseCheckovResults'](_0x59fc1c,_0x18d8df);}catch(_0x50dc7c){this[_0x37ebef(0xb7)]?.[_0x37ebef(0xa3)](_0x37ebef(0x10b),{'error':_0x50dc7c['message']});}return this[_0x37ebef(0xb7)]?.[_0x37ebef(0xa3)](_0x37ebef(0xe1),{'error':_0x177ee8[_0x37ebef(0x119)]}),[];}}['parseCheckovResults'](_0x9b4ac5,_0x3424c6){const _0xf53fd2=a0_0x139174,_0x5c06bc=[];if(_0x9b4ac5['results']&&_0x9b4ac5[_0xf53fd2(0x114)][_0xf53fd2(0xec)])for(const _0x34267a of _0x9b4ac5[_0xf53fd2(0x114)]['failed_checks']){_0x5c06bc['push']({'file':_0x3424c6,'line':_0x34267a[_0xf53fd2(0xf2)]?_0x34267a[_0xf53fd2(0xf2)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x34267a[_0xf53fd2(0xcf)]),'rule':_0x34267a['check_id'],'message':_0x34267a[_0xf53fd2(0xac)]||_0x34267a['check_id'],'category':'security','validator':_0xf53fd2(0xc1),'remediation':_0x34267a['guideline'],'cwe':_0x34267a['cwe'],'references':_0x34267a['guideline']?[_0x34267a[_0xf53fd2(0xbe)]]:[]});}return _0x5c06bc;}async['validatePackageJson'](_0x666994,_0xe9feca={}){const _0x5e7203=a0_0x139174;try{const _0x55b227=(await import(_0x5e7203(0xdd)))['default'],_0x1788aa=(await import('ajv-formats'))['default'],_0x13bba2=await a0_0x11a307[_0x5e7203(0xde)](_0x666994,'utf-8'),_0x5dd2f6=JSON['parse'](_0x13bba2),_0x1fb457=new _0x55b227({'allErrors':!![],'strict':![]});_0x1788aa(_0x1fb457);const _0x1ca704={'type':_0x5e7203(0xa1),'required':[_0x5e7203(0x10d),_0x5e7203(0xe0)],'properties':{'name':{'type':_0x5e7203(0x115),'pattern':_0x5e7203(0xb8)},'version':{'type':_0x5e7203(0x115)},'description':{'type':_0x5e7203(0x115)},'main':{'type':'string'},'type':{'type':'string','enum':[_0x5e7203(0x11b),'commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x5e7203(0xa1)},'devDependencies':{'type':_0x5e7203(0xa1)}},'additionalProperties':!![]},_0x4df503=_0x1fb457[_0x5e7203(0x101)](_0x1ca704),_0x42341d=_0x4df503(_0x5dd2f6);if(!_0x42341d&&_0x4df503['errors'])return _0x4df503['errors']['map'](_0xbdc974=>({'file':_0x666994,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5e7203(0x107)]['ERROR'],'rule':_0x5e7203(0xea),'message':_0xbdc974[_0x5e7203(0xe9)]?_0xbdc974[_0x5e7203(0xe9)]+'\x20'+_0xbdc974[_0x5e7203(0x119)]:_0x5e7203(0xbc)+_0xbdc974['params'][_0x5e7203(0x102)]+'\x27','category':_0x5e7203(0xf3),'validator':_0x5e7203(0xea)}));return[];}catch(_0x4f80de){return this[_0x5e7203(0xb7)]?.[_0x5e7203(0xa3)]('package.json\x20validation\x20failed',{'error':_0x4f80de[_0x5e7203(0x119)]}),[{'file':_0x666994,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5e7203(0x107)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x4f80de[_0x5e7203(0x119)],'category':_0x5e7203(0xba),'validator':_0x5e7203(0xdb)}];}}async[a0_0x139174(0xf4)](_0x3ce75a,_0x18eba7={}){const _0x2fc977=a0_0x139174;try{const _0x116a72=await a0_0x11a307['readFile'](_0x3ce75a,'utf-8'),_0x6105dd=JSON['parse'](_0x116a72),_0x10b297=[];if(_0x6105dd['compilerOptions']){const _0x4a8883=_0x6105dd[_0x2fc977(0xb3)];!_0x4a8883['strict']&&_0x10b297['push']({'file':_0x3ce75a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2fc977(0x107)]['WARNING'],'rule':_0x2fc977(0x11a),'message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':_0x2fc977(0xee),'validator':'tsconfig-validator'}),_0x4a8883[_0x2fc977(0xd3)]===![]&&_0x10b297[_0x2fc977(0xd7)]({'file':_0x3ce75a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2fc977(0x107)]['WARNING'],'rule':_0x2fc977(0xdc),'message':_0x2fc977(0xf8),'category':'best-practice','validator':_0x2fc977(0xf5)});}return _0x10b297;}catch(_0x3223ac){return this[_0x2fc977(0xb7)]?.['error'](_0x2fc977(0xe5),{'error':_0x3223ac['message']}),[{'file':_0x3ce75a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x3223ac[_0x2fc977(0x119)],'category':'syntax','validator':'json-parse'}];}}async[a0_0x139174(0xcd)](_0x3683e7,_0x23905d={}){const _0x4abb6b=a0_0x139174;try{const _0x41aa08=await a0_0x11a307['readFile'](_0x3683e7,_0x4abb6b(0x113)),_0x567c10=[],_0x2f0d14=_0x41aa08[_0x4abb6b(0xa8)]('\x0a'),_0x2e496e=[{'pattern':/password|passwd|pwd/i,'name':_0x4abb6b(0xd0)},{'pattern':/api[_-]?key/i,'name':_0x4abb6b(0xf7)},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':_0x4abb6b(0xfe)}];return _0x2f0d14['forEach']((_0x8d4845,_0x1a5023)=>{const _0x52dbd6=_0x4abb6b,_0x572620=_0x8d4845['trim']();if(!_0x572620||_0x572620['startsWith']('#'))return;if(_0x572620[_0x52dbd6(0xcc)]('=')){const [_0x2e30a2,_0x209831]=_0x572620['split']('='),_0x3dfc84=_0x2e30a2['toLowerCase'](),_0x39cdbd=_0x209831?.['trim']()||'',_0x5cee4f=_0x39cdbd&&_0x39cdbd!==''&&!_0x39cdbd['startsWith']('$')&&_0x39cdbd!=='your-key-here'&&_0x39cdbd!==_0x52dbd6(0xad)&&_0x39cdbd['length']>0x5;if(_0x5cee4f)for(const {pattern:_0x5d1dfe,name:_0x4eb37a}of _0x2e496e){if(_0x5d1dfe['test'](_0x3dfc84)){_0x567c10[_0x52dbd6(0xd7)]({'file':_0x3683e7,'line':_0x1a5023+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x52dbd6(0xab)],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x4eb37a+'\x20detected\x20in\x20.env\x20file','category':'security','validator':_0x52dbd6(0xf1),'remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0x567c10;}catch(_0x2a7eb4){return this[_0x4abb6b(0xb7)]?.[_0x4abb6b(0xa3)]('.env\x20validation\x20failed',{'error':_0x2a7eb4[_0x4abb6b(0x119)]}),[];}}['detectFileType'](_0x2b8479){const _0x30622a=a0_0x139174,_0x5b195a=a0_0x540e72['basename'](_0x2b8479)['toLowerCase'](),_0x2394ff=a0_0x540e72[_0x30622a(0x11e)](_0x2b8479);if(_0x5b195a===_0x30622a(0x111))return'dockerfile';if(_0x5b195a==='docker-compose.yml'||_0x5b195a==='docker-compose.yaml')return'docker-compose';if(_0x5b195a===_0x30622a(0x112))return _0x30622a(0x112);if(_0x5b195a==='tsconfig.json')return'tsconfig.json';if(_0x5b195a==='.env'||_0x5b195a[_0x30622a(0xfb)](_0x30622a(0xc4)))return'env';if(_0x2394ff[_0x30622a(0xcc)]('.github/workflows'))return'github-actions';if(_0x2394ff['includes'](_0x30622a(0xb2))||_0x2394ff['includes'](_0x30622a(0xce)))return _0x30622a(0xb2);const _0x2f7dc1=a0_0x540e72[_0x30622a(0xda)](_0x2b8479)['toLowerCase']();if(_0x2f7dc1==='.tf'||_0x2f7dc1==='.tfvars')return'terraform';if(_0x2f7dc1==='.yml'||_0x2f7dc1==='.yaml')return'yaml';if(_0x2f7dc1===_0x30622a(0xf9))return _0x30622a(0xd4);return'unknown';}['normalizeResults'](_0x1c0acb){const _0x3b65dc=a0_0x139174;return _0x1c0acb['map'](_0x1eb77a=>({'file':_0x1eb77a[_0x3b65dc(0xfc)],'line':_0x1eb77a[_0x3b65dc(0xb9)]||0x1,'column':_0x1eb77a[_0x3b65dc(0xd9)]||0x1,'severity':_0x1eb77a['severity']||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x1eb77a['rule']||_0x3b65dc(0xf6),'message':_0x1eb77a['message']||_0x3b65dc(0xae),'category':_0x1eb77a[_0x3b65dc(0xb0)]||_0x3b65dc(0xf3),'validator':_0x1eb77a[_0x3b65dc(0xca)],'cwe':_0x1eb77a['cwe']||null,'remediation':_0x1eb77a[_0x3b65dc(0xd2)]||null,'references':_0x1eb77a[_0x3b65dc(0xc5)]||[]}));}['mapHadolintSeverity'](_0x25636b){const _0x489655=a0_0x139174,_0x599a03={'error':STATIC_ANALYSIS[_0x489655(0x107)]['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY'][_0x489655(0xc7)],'info':STATIC_ANALYSIS[_0x489655(0x107)][_0x489655(0xd1)],'style':STATIC_ANALYSIS[_0x489655(0x107)][_0x489655(0xd1)]};return _0x599a03[_0x25636b?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x489655(0xc7)];}['mapYamllintSeverity'](_0x412bef){const _0x4f48e7=a0_0x139174,_0x5dbf7d={'error':STATIC_ANALYSIS['SEVERITY'][_0x4f48e7(0x105)],'warning':STATIC_ANALYSIS[_0x4f48e7(0x107)]['WARNING']};return _0x5dbf7d[_0x412bef?.['toLowerCase']()]||STATIC_ANALYSIS[_0x4f48e7(0x107)]['WARNING'];}['mapCheckovSeverity'](_0x55c748){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async[a0_0x139174(0xef)](){const _0x543270=a0_0x139174,_0x335a65=await this[_0x543270(0xa2)]();return{'validators':_0x335a65,'recommendations':this[_0x543270(0xd8)](_0x335a65)};}[a0_0x139174(0xd8)](_0x34c020){const _0x22281b=a0_0x139174,_0x34acf6=[];return!_0x34c020[_0x22281b(0xc1)]&&_0x34acf6['push']({'validator':'checkov','reason':_0x22281b(0xc2),'install':'pip\x20install\x20checkov','priority':_0x22281b(0xa7)}),!_0x34c020[_0x22281b(0xe4)]&&_0x34acf6['push']({'validator':_0x22281b(0xe4),'reason':_0x22281b(0xb5),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x34c020['yamllint']&&_0x34acf6['push']({'validator':_0x22281b(0xff),'reason':'YAML\x20file\x20validation','install':_0x22281b(0xa4),'priority':'medium'}),!_0x34c020['jsonSchema']&&_0x34acf6['push']({'validator':'ajv\x20(JSON\x20Schema)','reason':'JSON\x20configuration\x20validation','install':_0x22281b(0xbf),'priority':_0x22281b(0xf0)}),_0x34acf6;}}export default ConfigValidator;
@@ -1 +1 @@
1
- const a0_0x291e45=a0_0x23d0;(function(_0x54b4bf,_0x3a9c3b){const _0x599c62=a0_0x23d0,_0x35ca68=_0x54b4bf();while(!![]){try{const _0x40d0b5=-parseInt(_0x599c62(0xf3))/0x1+-parseInt(_0x599c62(0xee))/0x2*(-parseInt(_0x599c62(0xca))/0x3)+parseInt(_0x599c62(0xde))/0x4*(parseInt(_0x599c62(0xec))/0x5)+parseInt(_0x599c62(0xc8))/0x6*(parseInt(_0x599c62(0xe5))/0x7)+-parseInt(_0x599c62(0xd8))/0x8+parseInt(_0x599c62(0xd9))/0x9*(parseInt(_0x599c62(0xe2))/0xa)+-parseInt(_0x599c62(0xfa))/0xb;if(_0x40d0b5===_0x3a9c3b)break;else _0x35ca68['push'](_0x35ca68['shift']());}catch(_0x438b26){_0x35ca68['push'](_0x35ca68['shift']());}}}(a0_0x37a0,0xbfe15));import{ESLint}from'eslint';import a0_0x4cccf8 from'path';import a0_0x4a7477 from'fs/promises';function a0_0x37a0(){const _0x221999=['D2fYBMLUz0nVDw50','u0vdvvjjvfK','ChjLzMvYlxbYB21PC2uTCMvQzwn0lwvYCM9YCW','BM8TDw5YzwfJAgfIBgu','ndq4nJj6DhDPtNO','zMLSDgvY','mtKWmJndBxzbrLa','v0fstKLorW','BwvZC2fNzq','CMvTB3zLza','Aw5JBhvKzxm','yMvZDc1WCMfJDgLJzxm','CgvYzM9YBwfUy2u','BM8TDw51C2vKlxzHCNm','Bw9KDwXL','u0vwrvjjvfK','lMvZBgLUDhjJlMPZ','Bg9Nz2vY','zwnTyuzLyxr1CMvZ','EhnZ','mtm5mteWneXWvwHOtG','mtq4otvKs0jLzxm','ChvZAa','BgvUz3rO','zxnSAw50oNjLy29TBwvUzgvK','BgLUDfrLEhq','nte4mZi0yLvHBgnJ','BwvZC2fNzxm','CNvSzuLK','z2v0rvnmAw50q29UzMLN','ndC5meLOshrABq','C2v0DgLUz3m','y29SDw1U','mZC4yMDPtMXe','CMvHy3q','zgvZy3jPyMvdAgfUz2vZ','zML4','rvnmAw50igfUywX5C2LZignVBxbSzxrLza','BM8TDMfY','zM9YBwf0twvZC2fNzq','mtvjtwLUtNC','AM9PBG','mZq4A2Xvrg1U','zML4ywjSzuvYCM9Yq291BNq','u1rzteu','yw5HBhL6zq','q0furuDpuLK','mteXmde4mgrnyM5RAW','C3bSAxq','C2v2zxjPDhK','zxjYB3i','C2LUz2XL','lMPZ','ywnJzxnZ','nJGWndi4mufQCxvnuG','rvjst1i','zML4ywjSzvDHCM5PBMDdB3vUDa','Bwf4','zxnSAw50','D2fYBG','B3v0Chv0','y2f0zwDVCML6zvj1Bgu','zxH0zw5KCW','z2v0rvnmAw50sw5ZDgfUy2u'];a0_0x37a0=function(){return _0x221999;};return a0_0x37a0();}function a0_0x23d0(_0x45d404,_0x48e4cc){_0x45d404=_0x45d404-0xc4;const _0x37a025=a0_0x37a0();let _0x23d0e0=_0x37a025[_0x45d404];if(a0_0x23d0['AvosjP']===undefined){var _0x3ada3e=function(_0x120c17){const _0x50cdd4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4cccf8='',_0x4a7477='';for(let _0x18a8bc=0x0,_0x357d8a,_0x1b1502,_0x364949=0x0;_0x1b1502=_0x120c17['charAt'](_0x364949++);~_0x1b1502&&(_0x357d8a=_0x18a8bc%0x4?_0x357d8a*0x40+_0x1b1502:_0x1b1502,_0x18a8bc++%0x4)?_0x4cccf8+=String['fromCharCode'](0xff&_0x357d8a>>(-0x2*_0x18a8bc&0x6)):0x0){_0x1b1502=_0x50cdd4['indexOf'](_0x1b1502);}for(let _0x452e42=0x0,_0xc21cf3=_0x4cccf8['length'];_0x452e42<_0xc21cf3;_0x452e42++){_0x4a7477+='%'+('00'+_0x4cccf8['charCodeAt'](_0x452e42)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a7477);};a0_0x23d0['CWTBWI']=_0x3ada3e,a0_0x23d0['bHelEU']={},a0_0x23d0['AvosjP']=!![];}const _0x4801a5=_0x37a025[0x0],_0x9400=_0x45d404+_0x4801a5,_0x12effc=a0_0x23d0['bHelEU'][_0x9400];return!_0x12effc?(_0x23d0e0=a0_0x23d0['CWTBWI'](_0x23d0e0),a0_0x23d0['bHelEU'][_0x9400]=_0x23d0e0):_0x23d0e0=_0x12effc,_0x23d0e0;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x18a8bc=null){const _0x4fdf94=a0_0x23d0;this[_0x4fdf94(0xd5)]=_0x18a8bc,this['eslintCache']=new Map();}async[a0_0x291e45(0xf1)](_0x357d8a,_0x1b1502,_0x364949={}){const _0x751b33=a0_0x291e45;try{const _0x452e42=await this[_0x751b33(0x103)](_0x364949),_0xc21cf3=await _0x452e42['lintText'](_0x1b1502,{'filePath':_0x357d8a,'warnIgnored':![]}),_0x2e01f3=[];if(_0xc21cf3&&_0xc21cf3['length']>0x0){const _0x192151=_0xc21cf3[0x0];for(const _0x332e91 of _0x192151[_0x751b33(0xdf)]){_0x2e01f3['push'](this['formatMessage'](_0x332e91,_0x357d8a));}}return this['logger']?.['debug'](_0x751b33(0xe9),{'file':_0x357d8a,'totalDiagnostics':_0x2e01f3['length'],'errors':_0x2e01f3[_0x751b33(0xc9)](_0x5aa48b=>_0x5aa48b[_0x751b33(0xf5)]===STATIC_ANALYSIS['SEVERITY'][_0x751b33(0xfb)])[_0x751b33(0xdb)],'warnings':_0x2e01f3[_0x751b33(0xc9)](_0x13ba25=>_0x13ba25[_0x751b33(0xf5)]===STATIC_ANALYSIS['SEVERITY'][_0x751b33(0xcb)])['length']}),_0x2e01f3;}catch(_0x12295b){return this['logger']?.['error']('ESLint\x20analysis\x20failed',{'file':_0x357d8a,'error':_0x12295b[_0x751b33(0xcc)]}),[];}}async['fix'](_0x1a8a00,_0x66256e,_0x5121e5={}){const _0x585029=a0_0x291e45;try{const _0x1915ee=await this['getESLintInstance']({..._0x5121e5,'fix':!![]}),_0x137a0e=await _0x1915ee[_0x585029(0xdd)](_0x66256e,{'filePath':_0x1a8a00,'warnIgnored':![]});if(_0x137a0e&&_0x137a0e[_0x585029(0xdb)]>0x0){const _0x58e2ae=_0x137a0e[0x0];return{'fixed':_0x58e2ae['output']!==undefined,'content':_0x58e2ae[_0x585029(0x100)]||_0x66256e,'fixedCount':_0x58e2ae['fixableErrorCount']+_0x58e2ae[_0x585029(0xfc)],'remainingErrors':_0x58e2ae['errorCount']-_0x58e2ae[_0x585029(0xef)],'remainingWarnings':_0x58e2ae[_0x585029(0xc4)]-_0x58e2ae['fixableWarningCount'],'changes':_0x58e2ae['output']?this[_0x585029(0xe7)](_0x66256e,_0x58e2ae['output']):[]};}return{'fixed':![],'content':_0x66256e,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x26e29c){this[_0x585029(0xd5)]?.['error']('ESLint\x20fix\x20failed',{'file':_0x1a8a00,'error':_0x26e29c[_0x585029(0xcc)]});throw new Error('ESLint\x20fix\x20failed:\x20'+_0x26e29c['message']);}}async['getESLintInstance'](_0x3db309={}){const _0x31ce26=a0_0x291e45,{workingDir:_0x171977,fix:fix=![],framework:_0x4961a8}=_0x3db309,_0x3325ad=await this[_0x31ce26(0xe1)](_0x171977,_0x4961a8),_0x376136=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x3325ad,'errorOnUnmatchedPattern':![]});return _0x376136;}async['getESLintConfig'](_0xf30da2,_0x2c6c1e){const _0x52b910=a0_0x291e45,_0x27369f={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':'latest','sourceType':_0x52b910(0xd2)},'rules':{'no-unused-vars':_0x52b910(0xff),'no-undef':_0x52b910(0xf6),'no-console':'off','semi':[_0x52b910(0xff),'always'],'quotes':['warn',_0x52b910(0xf7),{'avoidEscape':!![]}]}};if(_0x2c6c1e===_0x52b910(0xe6))_0x27369f['extends']=['eslint:recommended'],_0x27369f['parserOptions'][_0x52b910(0xd6)]={'jsx':!![]},_0x27369f[_0x52b910(0xe3)]={'react':{'version':'detect'}};else _0x2c6c1e==='vue'?_0x27369f['extends']=['eslint:recommended']:_0x27369f[_0x52b910(0x102)]=[_0x52b910(0xdc)];if(_0xf30da2){const _0x5a8857=[_0x52b910(0xd4),'.eslintrc.cjs','.eslintrc.json','eslint.config.js'];for(const _0xa16679 of _0x5a8857){try{const _0x3cf4d4=a0_0x4cccf8[_0x52b910(0xed)](_0xf30da2,_0xa16679);return await a0_0x4a7477[_0x52b910(0xf9)](_0x3cf4d4),this['logger']?.['debug']('Found\x20ESLint\x20config',{'configFile':_0xa16679}),{};}catch{}}}return _0x27369f;}[a0_0x291e45(0xeb)](_0x550d32,_0x554c05){const _0x5e41ee=a0_0x291e45;return{'file':_0x554c05,'line':_0x550d32['line']||0x1,'column':_0x550d32[_0x5e41ee(0xe4)]||0x1,'endLine':_0x550d32['endLine'],'endColumn':_0x550d32['endColumn'],'severity':_0x550d32[_0x5e41ee(0xf5)]===0x2?STATIC_ANALYSIS[_0x5e41ee(0xd3)][_0x5e41ee(0xfb)]:STATIC_ANALYSIS[_0x5e41ee(0xd3)]['WARNING'],'rule':_0x550d32[_0x5e41ee(0xe0)]||_0x5e41ee(0xfe),'message':_0x550d32[_0x5e41ee(0xcc)],'category':this[_0x5e41ee(0x101)](_0x550d32[_0x5e41ee(0xe0)]),'fixable':_0x550d32[_0x5e41ee(0xe8)]!==undefined,'source':'eslint'};}[a0_0x291e45(0x101)](_0x57a02c){const _0x47a3fd=a0_0x291e45;if(!_0x57a02c)return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['STYLE'];if(_0x57a02c[_0x47a3fd(0xce)]('security')||_0x57a02c['includes'](_0x47a3fd(0xd7))||_0x57a02c==='no-eval'||_0x57a02c==='no-implied-eval')return STATIC_ANALYSIS[_0x47a3fd(0xf2)][_0x47a3fd(0xc5)];if(_0x57a02c['includes'](_0x47a3fd(0xd0))||_0x57a02c==='no-await-in-loop'||_0x57a02c===_0x47a3fd(0xc6))return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['PERFORMANCE'];if(_0x57a02c[_0x47a3fd(0xce)]('import')||_0x57a02c==='no-undef')return STATIC_ANALYSIS['CATEGORY']['IMPORT'];if(_0x57a02c['includes'](_0x47a3fd(0xcf))||_0x57a02c===_0x47a3fd(0xd1)||_0x57a02c===_0x47a3fd(0xc7)||_0x57a02c===_0x47a3fd(0xea))return STATIC_ANALYSIS[_0x47a3fd(0xf2)]['BEST_PRACTICE'];return STATIC_ANALYSIS['CATEGORY'][_0x47a3fd(0xf0)];}['describeChanges'](_0x160372,_0x4caeae){const _0x4223c5=a0_0x291e45,_0xcbdff1=[],_0x3e16c3=_0x160372['split']('\x0a'),_0x592638=_0x4caeae[_0x4223c5(0xf4)]('\x0a'),_0x55ac8b=Math[_0x4223c5(0xfd)](_0x3e16c3[_0x4223c5(0xdb)],_0x592638['length']);for(let _0x3cb571=0x0;_0x3cb571<_0x55ac8b;_0x3cb571++){const _0x4565fb=_0x3e16c3[_0x3cb571]||'',_0x59bf4e=_0x592638[_0x3cb571]||'';_0x4565fb!==_0x59bf4e&&_0xcbdff1[_0x4223c5(0xda)]({'line':_0x3cb571+0x1,'type':_0x4565fb&&_0x59bf4e?'modified':_0x4565fb?_0x4223c5(0xcd):'added','original':_0x4565fb,'fixed':_0x59bf4e});}return _0xcbdff1;}['getSupportedExtensions'](){const _0x5f3e66=a0_0x291e45;return[_0x5f3e66(0xf8),'.jsx','.mjs','.cjs'];}['supportsAutoFix'](){return!![];}}export default ESLintAnalyzer;
1
+ const a0_0x9df61a=a0_0x1859;(function(_0x45c4f8,_0x38c354){const _0x160ed4=a0_0x1859,_0x20cf0c=_0x45c4f8();while(!![]){try{const _0x5dfbee=-parseInt(_0x160ed4(0x16e))/0x1+parseInt(_0x160ed4(0x18e))/0x2+parseInt(_0x160ed4(0x193))/0x3+-parseInt(_0x160ed4(0x169))/0x4+parseInt(_0x160ed4(0x199))/0x5+parseInt(_0x160ed4(0x1a6))/0x6*(-parseInt(_0x160ed4(0x1aa))/0x7)+parseInt(_0x160ed4(0x178))/0x8*(-parseInt(_0x160ed4(0x16a))/0x9);if(_0x5dfbee===_0x38c354)break;else _0x20cf0c['push'](_0x20cf0c['shift']());}catch(_0xf127ce){_0x20cf0c['push'](_0x20cf0c['shift']());}}}(a0_0x5f2d,0x1df59));import{ESLint}from'eslint';import a0_0x1c6311 from'path';import a0_0x2df0ad from'fs/promises';function a0_0x1859(_0xb02e58,_0x42757e){_0xb02e58=_0xb02e58-0x168;const _0x5f2dfc=a0_0x5f2d();let _0x1859d1=_0x5f2dfc[_0xb02e58];if(a0_0x1859['IHObNc']===undefined){var _0xbe864d=function(_0x32353c){const _0x583521='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1c6311='',_0x2df0ad='';for(let _0x4ac03d=0x0,_0x5adfbb,_0x554118,_0x3aad55=0x0;_0x554118=_0x32353c['charAt'](_0x3aad55++);~_0x554118&&(_0x5adfbb=_0x4ac03d%0x4?_0x5adfbb*0x40+_0x554118:_0x554118,_0x4ac03d++%0x4)?_0x1c6311+=String['fromCharCode'](0xff&_0x5adfbb>>(-0x2*_0x4ac03d&0x6)):0x0){_0x554118=_0x583521['indexOf'](_0x554118);}for(let _0x58c798=0x0,_0x4e6176=_0x1c6311['length'];_0x58c798<_0x4e6176;_0x58c798++){_0x2df0ad+='%'+('00'+_0x1c6311['charCodeAt'](_0x58c798)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2df0ad);};a0_0x1859['zyKjdR']=_0xbe864d,a0_0x1859['XCRuqq']={},a0_0x1859['IHObNc']=!![];}const _0x57c2be=_0x5f2dfc[0x0],_0x2a4567=_0xb02e58+_0x57c2be,_0x16878b=a0_0x1859['XCRuqq'][_0x2a4567];return!_0x16878b?(_0x1859d1=a0_0x1859['zyKjdR'](_0x1859d1),a0_0x1859['XCRuqq'][_0x2a4567]=_0x1859d1):_0x1859d1=_0x16878b,_0x1859d1;}import{STATIC_ANALYSIS}from'../utilities/constants.js';class ESLintAnalyzer{constructor(_0x4ac03d=null){const _0x39a143=a0_0x1859;this['logger']=_0x4ac03d,this[_0x39a143(0x171)]=new Map();}async[a0_0x9df61a(0x186)](_0x5adfbb,_0x554118,_0x3aad55={}){const _0x2c9107=a0_0x9df61a;try{const _0x58c798=await this[_0x2c9107(0x17b)](_0x3aad55),_0x4e6176=await _0x58c798[_0x2c9107(0x170)](_0x554118,{'filePath':_0x5adfbb,'warnIgnored':![]}),_0x36c013=[];if(_0x4e6176&&_0x4e6176['length']>0x0){const _0x9f9732=_0x4e6176[0x0];for(const _0x35863d of _0x9f9732['messages']){_0x36c013['push'](this['formatMessage'](_0x35863d,_0x5adfbb));}}return this['logger']?.['debug'](_0x2c9107(0x168),{'file':_0x5adfbb,'totalDiagnostics':_0x36c013[_0x2c9107(0x181)],'errors':_0x36c013['filter'](_0x30061f=>_0x30061f[_0x2c9107(0x18f)]===STATIC_ANALYSIS[_0x2c9107(0x187)][_0x2c9107(0x18d)])['length'],'warnings':_0x36c013[_0x2c9107(0x1a8)](_0x1f09e3=>_0x1f09e3[_0x2c9107(0x18f)]===STATIC_ANALYSIS[_0x2c9107(0x187)]['WARNING'])['length']}),_0x36c013;}catch(_0x3bf7a5){return this['logger']?.['error'](_0x2c9107(0x176),{'file':_0x5adfbb,'error':_0x3bf7a5['message']}),[];}}async[a0_0x9df61a(0x1a1)](_0x34c979,_0x306297,_0x13d293={}){const _0x3aee54=a0_0x9df61a;try{const _0x451182=await this['getESLintInstance']({..._0x13d293,'fix':!![]}),_0x13fab6=await _0x451182['lintText'](_0x306297,{'filePath':_0x34c979,'warnIgnored':![]});if(_0x13fab6&&_0x13fab6[_0x3aee54(0x181)]>0x0){const _0x2e2bd4=_0x13fab6[0x0];return{'fixed':_0x2e2bd4['output']!==undefined,'content':_0x2e2bd4[_0x3aee54(0x177)]||_0x306297,'fixedCount':_0x2e2bd4['fixableErrorCount']+_0x2e2bd4['fixableWarningCount'],'remainingErrors':_0x2e2bd4[_0x3aee54(0x195)]-_0x2e2bd4[_0x3aee54(0x188)],'remainingWarnings':_0x2e2bd4[_0x3aee54(0x17e)]-_0x2e2bd4['fixableWarningCount'],'changes':_0x2e2bd4[_0x3aee54(0x177)]?this['describeChanges'](_0x306297,_0x2e2bd4[_0x3aee54(0x177)]):[]};}return{'fixed':![],'content':_0x306297,'fixedCount':0x0,'remainingErrors':0x0,'remainingWarnings':0x0,'changes':[]};}catch(_0x2926f5){this['logger']?.[_0x3aee54(0x19a)](_0x3aee54(0x1a7),{'file':_0x34c979,'error':_0x2926f5[_0x3aee54(0x19b)]});throw new Error(_0x3aee54(0x19f)+_0x2926f5['message']);}}async[a0_0x9df61a(0x17b)](_0x3b6d31={}){const _0x128be7=a0_0x9df61a,{workingDir:_0x4ecf97,fix:fix=![],framework:_0x2dba4b}=_0x3b6d31,_0x35421b=await this[_0x128be7(0x189)](_0x4ecf97,_0x2dba4b),_0x281b79=new ESLint({'fix':fix,'useEslintrc':!![],'overrideConfig':_0x35421b,'errorOnUnmatchedPattern':![]});return _0x281b79;}async[a0_0x9df61a(0x189)](_0xe8ff3,_0x3ab787){const _0x42c36b=a0_0x9df61a,_0x3ff673={'env':{'browser':!![],'es2021':!![],'node':!![]},'parserOptions':{'ecmaVersion':_0x42c36b(0x172),'sourceType':'module'},'rules':{'no-unused-vars':'warn','no-undef':_0x42c36b(0x19a),'no-console':'off','semi':[_0x42c36b(0x1a2),_0x42c36b(0x184)],'quotes':[_0x42c36b(0x1a2),'single',{'avoidEscape':!![]}]}};if(_0x3ab787===_0x42c36b(0x18b))_0x3ff673[_0x42c36b(0x174)]=[_0x42c36b(0x182)],_0x3ff673[_0x42c36b(0x190)][_0x42c36b(0x19c)]={'jsx':!![]},_0x3ff673[_0x42c36b(0x191)]={'react':{'version':'detect'}};else _0x3ab787==='vue'?_0x3ff673['extends']=['eslint:recommended']:_0x3ff673['extends']=[_0x42c36b(0x182)];if(_0xe8ff3){const _0x485387=[_0x42c36b(0x1a4),_0x42c36b(0x17a),'.eslintrc.json',_0x42c36b(0x185)];for(const _0x13cd6a of _0x485387){try{const _0x548515=a0_0x1c6311[_0x42c36b(0x19d)](_0xe8ff3,_0x13cd6a);return await a0_0x2df0ad['access'](_0x548515),this['logger']?.['debug']('Found\x20ESLint\x20config',{'configFile':_0x13cd6a}),{};}catch{}}}return _0x3ff673;}['formatMessage'](_0x11da70,_0x4e6d58){const _0x972d50=a0_0x9df61a;return{'file':_0x4e6d58,'line':_0x11da70['line']||0x1,'column':_0x11da70[_0x972d50(0x194)]||0x1,'endLine':_0x11da70[_0x972d50(0x18c)],'endColumn':_0x11da70[_0x972d50(0x196)],'severity':_0x11da70['severity']===0x2?STATIC_ANALYSIS[_0x972d50(0x187)][_0x972d50(0x18d)]:STATIC_ANALYSIS['SEVERITY'][_0x972d50(0x16c)],'rule':_0x11da70['ruleId']||'eslint','message':_0x11da70[_0x972d50(0x19b)],'category':this['categorizeRule'](_0x11da70[_0x972d50(0x17f)]),'fixable':_0x11da70[_0x972d50(0x1a1)]!==undefined,'source':_0x972d50(0x198)};}[a0_0x9df61a(0x1a3)](_0x43c253){const _0x414509=a0_0x9df61a;if(!_0x43c253)return STATIC_ANALYSIS['CATEGORY']['STYLE'];if(_0x43c253['includes'](_0x414509(0x17c))||_0x43c253['includes']('xss')||_0x43c253===_0x414509(0x1ab)||_0x43c253==='no-implied-eval')return STATIC_ANALYSIS['CATEGORY'][_0x414509(0x19e)];if(_0x43c253[_0x414509(0x1a9)](_0x414509(0x173))||_0x43c253==='no-await-in-loop'||_0x43c253==='prefer-promise-reject-errors')return STATIC_ANALYSIS[_0x414509(0x17d)]['PERFORMANCE'];if(_0x43c253[_0x414509(0x1a9)]('import')||_0x43c253===_0x414509(0x18a))return STATIC_ANALYSIS[_0x414509(0x17d)]['IMPORT'];if(_0x43c253['includes']('best-practices')||_0x43c253===_0x414509(0x1a5)||_0x43c253==='no-unreachable'||_0x43c253===_0x414509(0x1a0))return STATIC_ANALYSIS['CATEGORY'][_0x414509(0x192)];return STATIC_ANALYSIS[_0x414509(0x17d)]['STYLE'];}[a0_0x9df61a(0x175)](_0x31e3ee,_0xe0c529){const _0x25d9a2=a0_0x9df61a,_0x497d59=[],_0x24b939=_0x31e3ee[_0x25d9a2(0x179)]('\x0a'),_0x3a7237=_0xe0c529['split']('\x0a'),_0x57a42f=Math['max'](_0x24b939[_0x25d9a2(0x181)],_0x3a7237[_0x25d9a2(0x181)]);for(let _0x27dc00=0x0;_0x27dc00<_0x57a42f;_0x27dc00++){const _0x10657d=_0x24b939[_0x27dc00]||'',_0x76159c=_0x3a7237[_0x27dc00]||'';_0x10657d!==_0x76159c&&_0x497d59[_0x25d9a2(0x197)]({'line':_0x27dc00+0x1,'type':_0x10657d&&_0x76159c?_0x25d9a2(0x1ac):_0x10657d?_0x25d9a2(0x16d):'added','original':_0x10657d,'fixed':_0x76159c});}return _0x497d59;}[a0_0x9df61a(0x16f)](){const _0x3a75e4=a0_0x9df61a;return[_0x3a75e4(0x183),'.jsx',_0x3a75e4(0x16b),'.cjs'];}[a0_0x9df61a(0x180)](){return!![];}}function a0_0x5f2d(){const _0x19a34a=['zw5Kq29SDw1U','ChvZAa','zxnSAw50','ode0odG1t09ZBvn6','zxjYB3i','BwvZC2fNzq','zwnTyuzLyxr1CMvZ','AM9PBG','u0vdvvjjvfK','rvnmAw50igzPEcbMywLSzwq6ia','BM8TDMfY','zML4','D2fYBG','y2f0zwDVCML6zvj1Bgu','lMvZBgLUDhjJlMPZ','BM8TDw51C2vKlxzHCNm','nNbiterLAW','rvnmAw50igzPEcbMywLSzwq','zMLSDgvY','Aw5JBhvKzxm','mtyYotyWn09pvezUtq','BM8TzxzHBa','Bw9KAwzPzwq','rvnmAw50igfUywX5C2LZignVBxbSzxrLza','mZuXmJKYDuHYwePU','mtHpzMnMwuC','lM1QCW','v0fstKLorW','CMvTB3zLza','mJq4ntrzzNDhruy','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','BgLUDfrLEhq','zxnSAw50q2fJAgu','Bgf0zxn0','CgvYzM9YBwfUy2u','zxH0zw5KCW','zgvZy3jPyMvdAgfUz2vZ','rvnmAw50igfUywX5C2LZigzHAwXLza','B3v0Chv0','mZK3ntyWz3DizMDm','C3bSAxq','lMvZBgLUDhjJlMnQCW','z2v0rvnmAw50sw5ZDgfUy2u','C2vJDxjPDhK','q0furuDpuLK','D2fYBMLUz0nVDw50','CNvSzuLK','C3vWCg9YDhnbDxrVrML4','BgvUz3rO','zxnSAw50oNjLy29TBwvUzgvK','lMPZ','ywX3yxLZ','zxnSAw50lMnVBMzPzY5QCW','yw5HBhL6zq','u0vwrvjjvfK','zML4ywjSzuvYCM9Yq291BNq','z2v0rvnmAw50q29UzMLN','BM8TDw5Kzwy','CMvHy3q','zw5KtgLUzq','rvjst1i','ndyZmdi4r2DVsNDs','C2v2zxjPDhK','CgfYC2vYt3b0Aw9UCW','C2v0DgLUz3m','qKvtvf9quKfdveLdrq','nte5mJCWvMvgEhLh','y29SDw1U','zxjYB3jdB3vUDa'];a0_0x5f2d=function(){return _0x19a34a;};return a0_0x5f2d();}export default ESLintAnalyzer;