@loxia-labs/loxia-autopilot-one 1.0.16 → 1.0.18

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 (123) hide show
  1. package/README.md +5 -3
  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/agentActivityService.js +1 -1
  76. package/src/services/aiService.js +1 -1
  77. package/src/services/apiKeyManager.js +1 -1
  78. package/src/services/benchmarkService.js +1 -1
  79. package/src/services/budgetService.js +1 -1
  80. package/src/services/contextInjectionService.js +1 -1
  81. package/src/services/conversationCompactionService.js +1 -1
  82. package/src/services/errorHandler.js +1 -1
  83. package/src/services/fileAttachmentService.js +1 -1
  84. package/src/services/modelRouterService.js +1 -1
  85. package/src/services/modelsService.js +1 -1
  86. package/src/services/qualityInspector.js +1 -1
  87. package/src/services/tokenCountingService.js +1 -1
  88. package/src/tools/agentCommunicationTool.js +1 -1
  89. package/src/tools/agentDelayTool.js +1 -1
  90. package/src/tools/asyncToolManager.js +1 -1
  91. package/src/tools/baseTool.js +1 -1
  92. package/src/tools/browserTool.js +1 -1
  93. package/src/tools/cloneDetectionTool.js +1 -1
  94. package/src/tools/dependencyResolverTool.js +1 -1
  95. package/src/tools/fileContentReplaceTool.js +1 -1
  96. package/src/tools/fileSystemTool.js +1 -1
  97. package/src/tools/fileTreeTool.js +1 -1
  98. package/src/tools/imageTool.js +1 -1
  99. package/src/tools/importAnalyzerTool.js +1 -1
  100. package/src/tools/jobDoneTool.js +1 -1
  101. package/src/tools/seekTool.js +1 -1
  102. package/src/tools/staticAnalysisTool.js +1 -1
  103. package/src/tools/taskManagerTool.js +1 -1
  104. package/src/tools/terminalTool.js +1 -1
  105. package/src/tools/webTool.js +1 -1
  106. package/src/types/agent.js +1 -1
  107. package/src/types/contextReference.js +1 -1
  108. package/src/types/conversation.js +1 -1
  109. package/src/types/toolCommand.js +1 -1
  110. package/src/utilities/attachmentValidator.js +1 -1
  111. package/src/utilities/configManager.js +1 -1
  112. package/src/utilities/constants.js +1 -1
  113. package/src/utilities/directoryAccessManager.js +1 -1
  114. package/src/utilities/fileProcessor.js +1 -1
  115. package/src/utilities/logger.js +1 -1
  116. package/src/utilities/tagParser.js +1 -1
  117. package/src/utilities/toolConstants.js +1 -1
  118. package/src/utilities/userDataDir.js +1 -1
  119. package/web-ui/build/index.html +2 -2
  120. package/web-ui/build/static/index-Cb8CHAFw.css +1 -0
  121. package/web-ui/build/static/index-DL2-PyNX.js +367 -0
  122. package/web-ui/build/static/index-DFmFvOoy.css +0 -1
  123. package/web-ui/build/static/index-DOk0l6Kf.js +0 -348
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.16
102
+ # Should display: Loxia Autopilot One v1.0.18
103
103
  ```
104
104
 
105
105
  ### 4. Create an API Key
@@ -369,17 +369,19 @@ Loxia automatically compacts long conversations to stay within token limits:
369
369
 
370
370
  ## 🛣️ Roadmap
371
371
 
372
- ### Current Version (1.0.16)
372
+ ### Current Version (1.0.18)
373
373
 
374
374
  - ✅ Multi-agent orchestration
375
375
  - ✅ 18+ specialized tools
376
376
  - ✅ Web UI + CLI interfaces
377
- - ✅ Conversation compaction
377
+ - ✅ Conversation compaction with round-robin model selection
378
378
  - ✅ File attachments
379
379
  - ✅ Task management
380
380
  - ✅ Centralized agent activity service
381
381
  - ✅ Intelligent loop detection
382
382
  - ✅ Persistent user data across npm updates
383
+ - ✅ Version status display with update notifications
384
+ - ✅ Automatic token limit error recovery
383
385
 
384
386
  ### Upcoming Features
385
387
 
package/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x39f234=a0_0x41d2;(function(_0x294909,_0x9a1a64){const _0x30e7fa=a0_0x41d2,_0x445459=_0x294909();while(!![]){try{const _0x20b46d=-parseInt(_0x30e7fa(0x85))/0x1*(-parseInt(_0x30e7fa(0x89))/0x2)+-parseInt(_0x30e7fa(0xb7))/0x3+-parseInt(_0x30e7fa(0xa9))/0x4+-parseInt(_0x30e7fa(0x9a))/0x5+parseInt(_0x30e7fa(0xb3))/0x6+parseInt(_0x30e7fa(0x80))/0x7+parseInt(_0x30e7fa(0x82))/0x8*(parseInt(_0x30e7fa(0x84))/0x9);if(_0x20b46d===_0x9a1a64)break;else _0x445459['push'](_0x445459['shift']());}catch(_0x2db7ef){_0x445459['push'](_0x445459['shift']());}}}(a0_0xf343,0x33ec1));function a0_0xf343(){const _0x3fada6=['1767294WrSOSX','--port','help','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','1097547OZlMOj','\x0aOpening\x20Web\x20UI\x20at\x20','Server\x20is\x20running\x20at\x20','localhost','Loxia\x20Autopilot\x20One\x20v',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','http://','start\x20\x22\x22\x20\x22','kill','xdg-open\x20\x22','unref','index.js','toString','SIGINT','version','exit','catch','694050sPvLbq','/api/health','24NIOvMM','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','1838178xzStow','77759HwbhCU','parse','ceil','log','2rXOjHo','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','darwin','\x0aLoxia\x20Autopilot\x20One\x20v','port','Unknown\x20command:\x20','inherit','node','get','setTimeout','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','\x0aShutting\x20down\x20server...','message','SIGTERM','argv','host','Error:','1762535neRnEm','destroy','\x0aPlease\x20start\x20the\x20server\x20first:','Server\x20running\x20at\x20','win32','includes','\x20manually.','error','Checking\x20if\x20server\x20is\x20running...','env','\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','pid','Could\x20not\x20open\x20browser\x20automatically.','Please\x20open\x20manually:\x20','src','612620hokGGn','Starting\x20Loxia\x20server...\x0a','Waiting\x20for\x20server\x20to\x20start...','Starting\x20Loxia\x20server\x20in\x20background...','utf8','ignore','--version','loxia-terminal.js','package.json','--host'];a0_0xf343=function(){return _0x3fada6;};return a0_0xf343();}import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';function a0_0x41d2(_0x223c78,_0x14c880){_0x223c78=_0x223c78-0x7a;const _0xf34376=a0_0xf343();let _0x41d20c=_0xf34376[_0x223c78];return _0x41d20c;}import a0_0x60397a from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x39f234(0xba),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x39f234(0x97)]['slice'](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args['includes']('--help')||args[a0_0x39f234(0x9f)]('-h'),'version':args[a0_0x39f234(0x9f)](a0_0x39f234(0xaf))||args[a0_0x39f234(0x9f)]('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x39f234(0xb4)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x39f234(0xb2)&&args[i+0x1]&&(flags[a0_0x39f234(0x98)]=args[i+0x1]);}const port=flags[a0_0x39f234(0x8d)]||DEFAULT_PORT,host=flags[a0_0x39f234(0x98)]||DEFAULT_HOST,serverUrl=a0_0x39f234(0xbd)+host+':'+port;if(flags[a0_0x39f234(0x7d)]){const pkgPath=join(__dirname,'..',a0_0x39f234(0xb1)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x39f234(0xad)));console['log'](a0_0x39f234(0xbb)+pkg[a0_0x39f234(0x7d)]),process['exit'](0x0);}if(flags[a0_0x39f234(0xb5)]||!command){const pkgPath=join(__dirname,'..',a0_0x39f234(0xb1)),pkg=JSON[a0_0x39f234(0x86)](readFileSync(pkgPath,'utf8'));console[a0_0x39f234(0x88)](a0_0x39f234(0x8c)+pkg[a0_0x39f234(0x7d)]+a0_0x39f234(0xa4)+DEFAULT_PORT+a0_0x39f234(0xbc)+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_0x39f234(0x7e)](0x0);}async function checkServerRunning(_0x16446e,_0x3629a2,_0x3dd460=0x1){for(let _0x2afde3=0x0;_0x2afde3<_0x3dd460;_0x2afde3++){const _0x15d31b=await new Promise(_0x2c8781=>{const _0x361f2c=a0_0x41d2,_0x578f33=a0_0x60397a[_0x361f2c(0x91)](_0x361f2c(0xbd)+_0x16446e+':'+_0x3629a2+_0x361f2c(0x81),_0x1460a2=>{_0x2c8781(_0x1460a2['statusCode']===0xc8);});_0x578f33['on'](_0x361f2c(0xa1),()=>_0x2c8781(![])),_0x578f33[_0x361f2c(0x92)](0x7d0,()=>{const _0x196b1c=_0x361f2c;_0x578f33[_0x196b1c(0x9b)](),_0x2c8781(![]);});});if(_0x15d31b)return!![];_0x2afde3<_0x3dd460-0x1&&await new Promise(_0x3b91c3=>setTimeout(_0x3b91c3,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x291eff,_0x30b219,_0x1d3667=SERVER_STARTUP_TIMEOUT){const _0x2d2fc2=a0_0x39f234,_0x12c987=Math[_0x2d2fc2(0x87)](_0x1d3667/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x291eff,_0x30b219,_0x12c987);}function openBrowser(_0x85a3ef){const _0x3d6ae1=a0_0x39f234,_0x3400ca=process['platform'];let _0x478ed4;if(_0x3400ca===_0x3d6ae1(0x8b))_0x478ed4='open\x20\x22'+_0x85a3ef+'\x22';else _0x3400ca===_0x3d6ae1(0x9e)?_0x478ed4=_0x3d6ae1(0xbe)+_0x85a3ef+'\x22':_0x478ed4=_0x3d6ae1(0xc0)+_0x85a3ef+'\x22';exec(_0x478ed4,_0x1d2186=>{const _0xc9c303=_0x3d6ae1;_0x1d2186&&(console[_0xc9c303(0x88)](_0xc9c303(0xa6)),console[_0xc9c303(0x88)](_0xc9c303(0xa7)+_0x85a3ef));});}function startServer(_0x3f32f1=![]){const _0x14ae66=a0_0x39f234,_0x342481={...process['env'],'LOXIA_PORT':port[_0x14ae66(0x7b)](),'PORT':port[_0x14ae66(0x7b)]()};flags['host']&&(_0x342481['LOXIA_HOST']=flags[_0x14ae66(0x98)]);const _0x41898f=join(__dirname,'..',_0x14ae66(0xa8),_0x14ae66(0x7a)),_0x321ab2=spawn(_0x14ae66(0x90),[_0x41898f],{'cwd':join(__dirname,'..'),'env':_0x342481,'stdio':_0x3f32f1?['ignore',_0x14ae66(0xae),'ignore']:_0x14ae66(0x8f),'detached':_0x3f32f1});return _0x3f32f1&&_0x321ab2[_0x14ae66(0xc1)](),_0x321ab2;}function startTerminalUI(){const _0x5a8f43=a0_0x39f234,_0x3c55ea=join(__dirname,_0x5a8f43(0xb0)),_0x2167ff={...process[_0x5a8f43(0xa3)],'LOXIA_PORT':port['toString'](),'LOXIA_HOST':host},_0x2f01ab=spawn(_0x5a8f43(0x90),[_0x3c55ea],{'cwd':join(__dirname,'..'),'env':_0x2167ff,'stdio':'inherit'});return _0x2f01ab;}const commands={'web':async()=>{const _0x5caf89=a0_0x39f234;console[_0x5caf89(0x88)](_0x5caf89(0xaa));const _0x46cea7=startServer(![]);console[_0x5caf89(0x88)](_0x5caf89(0xab));const _0xa55345=await waitForServer(host,port);_0xa55345?(console[_0x5caf89(0x88)](_0x5caf89(0xb8)+serverUrl),openBrowser(serverUrl)):console[_0x5caf89(0x88)](_0x5caf89(0x93)+serverUrl+_0x5caf89(0xa0)),process['on'](_0x5caf89(0x7c),()=>_0x46cea7['kill'](_0x5caf89(0x7c))),process['on'](_0x5caf89(0x96),()=>_0x46cea7[_0x5caf89(0xbf)](_0x5caf89(0x96))),_0x46cea7['on'](_0x5caf89(0x7e),_0x4de8a2=>process[_0x5caf89(0x7e)](_0x4de8a2||0x0));},'plus-web':async()=>{await commands['web']();},'terminal':async()=>{const _0x5ecb72=a0_0x39f234;console['log'](_0x5ecb72(0xa2));const _0xf2b178=await checkServerRunning(host,port);!_0xf2b178&&(console[_0x5ecb72(0xa1)]('\x0aServer\x20is\x20not\x20running\x20at\x20'+serverUrl),console[_0x5ecb72(0xa1)](_0x5ecb72(0x9c)),console[_0x5ecb72(0xa1)](_0x5ecb72(0x83)),console[_0x5ecb72(0xa1)](_0x5ecb72(0xb6)),process[_0x5ecb72(0x7e)](0x1));console[_0x5ecb72(0x88)](_0x5ecb72(0xb9)+serverUrl),console[_0x5ecb72(0x88)]('Starting\x20Terminal\x20UI...\x0a');const _0x4ff7f9=startTerminalUI();process['on'](_0x5ecb72(0x7c),()=>_0x4ff7f9[_0x5ecb72(0xbf)](_0x5ecb72(0x7c))),process['on']('SIGTERM',()=>_0x4ff7f9[_0x5ecb72(0xbf)]('SIGTERM')),_0x4ff7f9['on']('exit',_0x4a1269=>process['exit'](_0x4a1269||0x0));},'plus-terminal':async()=>{const _0x402d63=a0_0x39f234;console[_0x402d63(0x88)](_0x402d63(0xac));const _0x1d9e19=startServer(!![]),_0x5d8e4d=await waitForServer(host,port);!_0x5d8e4d&&(console[_0x402d63(0xa1)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process['exit'](0x1));console[_0x402d63(0x88)](_0x402d63(0x9d)+serverUrl),console['log']('Starting\x20Terminal\x20UI...\x0a');const _0x2261bb=startTerminalUI();_0x2261bb['on']('exit',_0x348c98=>{const _0x385f17=_0x402d63;console[_0x385f17(0x88)](_0x385f17(0x94));try{process['kill'](_0x1d9e19[_0x385f17(0xa5)],_0x385f17(0x96));}catch(_0x109a29){}process[_0x385f17(0x7e)](_0x348c98||0x0);}),process['on'](_0x402d63(0x7c),()=>{const _0x241597=_0x402d63;_0x2261bb[_0x241597(0xbf)](_0x241597(0x7c));}),process['on'](_0x402d63(0x96),()=>{const _0x2c6c9c=_0x402d63;_0x2261bb[_0x2c6c9c(0xbf)](_0x2c6c9c(0x96));});}};commands[command]?commands[command]()[a0_0x39f234(0x7f)](_0x482ea0=>{const _0x38ed2f=a0_0x39f234;console[_0x38ed2f(0xa1)](_0x38ed2f(0x99),_0x482ea0[_0x38ed2f(0x95)]),process[_0x38ed2f(0x7e)](0x1);}):(console[a0_0x39f234(0xa1)](a0_0x39f234(0x8e)+command),console[a0_0x39f234(0xa1)](a0_0x39f234(0x8a)),process[a0_0x39f234(0x7e)](0x1));
3
+ const a0_0x17e29c=a0_0x4da5;(function(_0x36c68a,_0x1ff2ef){const _0x47a18c=a0_0x4da5,_0x79798e=_0x36c68a();while(!![]){try{const _0x486473=-parseInt(_0x47a18c(0x14a))/0x1+parseInt(_0x47a18c(0x124))/0x2+parseInt(_0x47a18c(0x144))/0x3+parseInt(_0x47a18c(0x15c))/0x4+parseInt(_0x47a18c(0x139))/0x5+-parseInt(_0x47a18c(0x13a))/0x6+-parseInt(_0x47a18c(0x135))/0x7*(parseInt(_0x47a18c(0x123))/0x8);if(_0x486473===_0x1ff2ef)break;else _0x79798e['push'](_0x79798e['shift']());}catch(_0x206354){_0x79798e['push'](_0x79798e['shift']());}}}(a0_0x579c,0xaf695));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x4ce4f1 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x17e29c(0x142),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process['argv'][a0_0x17e29c(0x156)](0x2),command=args[0x0]&&!args[0x0][a0_0x17e29c(0x149)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x17e29c(0x160)]('--help')||args[a0_0x17e29c(0x160)]('-h'),'version':args['includes'](a0_0x17e29c(0x132))||args[a0_0x17e29c(0x160)]('-v')};function a0_0x4da5(_0x409975,_0x591818){_0x409975=_0x409975-0x121;const _0x579c6d=a0_0x579c();let _0x4da5d4=_0x579c6d[_0x409975];return _0x4da5d4;}for(let i=0x0;i<args[a0_0x17e29c(0x12c)];i++){args[i]===a0_0x17e29c(0x12d)&&args[i+0x1]&&(flags[a0_0x17e29c(0x130)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x17e29c(0x14e)&&args[i+0x1]&&(flags[a0_0x17e29c(0x157)]=args[i+0x1]);}const port=flags[a0_0x17e29c(0x130)]||DEFAULT_PORT,host=flags[a0_0x17e29c(0x157)]||DEFAULT_HOST,serverUrl=a0_0x17e29c(0x154)+host+':'+port;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x17e29c(0x146)),pkg=JSON[a0_0x17e29c(0x133)](readFileSync(pkgPath,a0_0x17e29c(0x134)));console[a0_0x17e29c(0x167)](a0_0x17e29c(0x15f)+pkg['version']),process[a0_0x17e29c(0x169)](0x0);}if(flags['help']||!command){const pkgPath=join(__dirname,'..',a0_0x17e29c(0x146)),pkg=JSON[a0_0x17e29c(0x133)](readFileSync(pkgPath,a0_0x17e29c(0x134)));console[a0_0x17e29c(0x167)](a0_0x17e29c(0x143)+pkg[a0_0x17e29c(0x125)]+a0_0x17e29c(0x162)+DEFAULT_PORT+a0_0x17e29c(0x12f)+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_0x17e29c(0x169)](0x0);}async function checkServerRunning(_0x2692a1,_0x39bae7,_0x53cd21=0x1){for(let _0x5cb1bb=0x0;_0x5cb1bb<_0x53cd21;_0x5cb1bb++){const _0x42cc7f=await new Promise(_0x2bb33c=>{const _0x478dcc=a0_0x4da5,_0x23b566=a0_0x4ce4f1[_0x478dcc(0x127)](_0x478dcc(0x154)+_0x2692a1+':'+_0x39bae7+_0x478dcc(0x12e),_0x227794=>{const _0x3dc341=_0x478dcc;_0x2bb33c(_0x227794[_0x3dc341(0x13d)]===0xc8);});_0x23b566['on'](_0x478dcc(0x14f),()=>_0x2bb33c(![])),_0x23b566[_0x478dcc(0x164)](0x7d0,()=>{const _0x3afbb2=_0x478dcc;_0x23b566[_0x3afbb2(0x13c)](),_0x2bb33c(![]);});});if(_0x42cc7f)return!![];_0x5cb1bb<_0x53cd21-0x1&&await new Promise(_0x39201c=>setTimeout(_0x39201c,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x45660a,_0x24aed4,_0x291e5c=SERVER_STARTUP_TIMEOUT){const _0x4b6ee9=a0_0x17e29c,_0x5cb5be=Math[_0x4b6ee9(0x148)](_0x291e5c/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x45660a,_0x24aed4,_0x5cb5be);}function openBrowser(_0x1cc75e){const _0x53b815=a0_0x17e29c,_0x456ee2=process['platform'];let _0x315e94;if(_0x456ee2==='darwin')_0x315e94=_0x53b815(0x138)+_0x1cc75e+'\x22';else _0x456ee2===_0x53b815(0x141)?_0x315e94=_0x53b815(0x151)+_0x1cc75e+'\x22':_0x315e94=_0x53b815(0x166)+_0x1cc75e+'\x22';exec(_0x315e94,_0x54ee8e=>{const _0x443bf6=_0x53b815;_0x54ee8e&&(console[_0x443bf6(0x167)](_0x443bf6(0x161)),console[_0x443bf6(0x167)](_0x443bf6(0x136)+_0x1cc75e));});}function startServer(_0x184f9b=![]){const _0x36f1d5=a0_0x17e29c,_0x21a131={...process[_0x36f1d5(0x150)],'LOXIA_PORT':port[_0x36f1d5(0x163)](),'PORT':port['toString']()};flags['host']&&(_0x21a131[_0x36f1d5(0x13f)]=flags[_0x36f1d5(0x157)]);const _0x4f4b72=join(__dirname,'..',_0x36f1d5(0x145),_0x36f1d5(0x129)),_0x5efcf3=spawn(_0x36f1d5(0x15a),[_0x4f4b72],{'cwd':join(__dirname,'..'),'env':_0x21a131,'stdio':_0x184f9b?['ignore',_0x36f1d5(0x14d),_0x36f1d5(0x14d)]:_0x36f1d5(0x15b),'detached':_0x184f9b});return _0x184f9b&&_0x5efcf3[_0x36f1d5(0x147)](),_0x5efcf3;}function startTerminalUI(){const _0x2c6454=a0_0x17e29c,_0x2e3fcf=join(__dirname,_0x2c6454(0x131)),_0x22a0c5={...process[_0x2c6454(0x150)],'LOXIA_PORT':port[_0x2c6454(0x163)](),'LOXIA_HOST':host},_0x22c242=spawn(_0x2c6454(0x15a),[_0x2e3fcf],{'cwd':join(__dirname,'..'),'env':_0x22a0c5,'stdio':_0x2c6454(0x15b)});return _0x22c242;}function a0_0x579c(){const _0x3cdbe0=['1127ONLyEQ','Please\x20open\x20manually:\x20','Server\x20is\x20running\x20at\x20','open\x20\x22','3165875wUZZYV','3359808YEMXQw','Server\x20running\x20at\x20','destroy','statusCode','\x0aShutting\x20down\x20server...','LOXIA_HOST','SIGTERM','win32','localhost','\x0aLoxia\x20Autopilot\x20One\x20v','2300232nUosUU','src','package.json','unref','ceil','startsWith','1174173DEptse','Error:','Waiting\x20for\x20server\x20to\x20start...','ignore','--host','error','env','start\x20\x22\x22\x20\x22','Starting\x20Terminal\x20UI...\x0a','catch','http://','Starting\x20Loxia\x20server\x20in\x20background...','slice','host','Starting\x20Loxia\x20server...\x0a','\x0aPlease\x20start\x20the\x20server\x20first:','node','inherit','4251924sRPCXB','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','Loxia\x20Autopilot\x20One\x20v','includes','Could\x20not\x20open\x20browser\x20automatically.','\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','toString','setTimeout','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','xdg-open\x20\x22','log','SIGINT','exit','pid','kill','41744tfgyNe','1659648pTlIMh','version','\x0aServer\x20is\x20not\x20running\x20at\x20','get','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','index.js','Checking\x20if\x20server\x20is\x20running...','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','length','--port','/api/health',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','port','loxia-terminal.js','--version','parse','utf8'];a0_0x579c=function(){return _0x3cdbe0;};return a0_0x579c();}const commands={'web':async()=>{const _0x4048ef=a0_0x17e29c;console[_0x4048ef(0x167)](_0x4048ef(0x158));const _0x38d306=startServer(![]);console[_0x4048ef(0x167)](_0x4048ef(0x14c));const _0x2dbb94=await waitForServer(host,port);_0x2dbb94?(console[_0x4048ef(0x167)]('\x0aOpening\x20Web\x20UI\x20at\x20'+serverUrl),openBrowser(serverUrl)):console['log'](_0x4048ef(0x15d)+serverUrl+'\x20manually.'),process['on'](_0x4048ef(0x168),()=>_0x38d306[_0x4048ef(0x122)]('SIGINT')),process['on'](_0x4048ef(0x140),()=>_0x38d306[_0x4048ef(0x122)](_0x4048ef(0x140))),_0x38d306['on'](_0x4048ef(0x169),_0xec8d14=>process[_0x4048ef(0x169)](_0xec8d14||0x0));},'plus-web':async()=>{await commands['web']();},'terminal':async()=>{const _0x5ec065=a0_0x17e29c;console[_0x5ec065(0x167)](_0x5ec065(0x12a));const _0x53769d=await checkServerRunning(host,port);!_0x53769d&&(console['error'](_0x5ec065(0x126)+serverUrl),console[_0x5ec065(0x14f)](_0x5ec065(0x159)),console['error'](_0x5ec065(0x128)),console[_0x5ec065(0x14f)](_0x5ec065(0x165)),process[_0x5ec065(0x169)](0x1));console[_0x5ec065(0x167)](_0x5ec065(0x137)+serverUrl),console[_0x5ec065(0x167)](_0x5ec065(0x152));const _0x401f44=startTerminalUI();process['on']('SIGINT',()=>_0x401f44[_0x5ec065(0x122)]('SIGINT')),process['on'](_0x5ec065(0x140),()=>_0x401f44[_0x5ec065(0x122)](_0x5ec065(0x140))),_0x401f44['on']('exit',_0x2959e5=>process[_0x5ec065(0x169)](_0x2959e5||0x0));},'plus-terminal':async()=>{const _0x4cdd31=a0_0x17e29c;console[_0x4cdd31(0x167)](_0x4cdd31(0x155));const _0x14bc80=startServer(!![]),_0x41320a=await waitForServer(host,port);!_0x41320a&&(console[_0x4cdd31(0x14f)](_0x4cdd31(0x12b)),process['exit'](0x1));console[_0x4cdd31(0x167)](_0x4cdd31(0x13b)+serverUrl),console[_0x4cdd31(0x167)](_0x4cdd31(0x152));const _0x5aa800=startTerminalUI();_0x5aa800['on']('exit',_0x588ad2=>{const _0x4f6568=_0x4cdd31;console[_0x4f6568(0x167)](_0x4f6568(0x13e));try{process['kill'](_0x14bc80[_0x4f6568(0x121)],_0x4f6568(0x140));}catch(_0x594efe){}process[_0x4f6568(0x169)](_0x588ad2||0x0);}),process['on'](_0x4cdd31(0x168),()=>{const _0x521956=_0x4cdd31;_0x5aa800[_0x521956(0x122)](_0x521956(0x168));}),process['on']('SIGTERM',()=>{const _0x4dd42e=_0x4cdd31;_0x5aa800[_0x4dd42e(0x122)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x17e29c(0x153)](_0xe1d898=>{const _0x23cc14=a0_0x17e29c;console[_0x23cc14(0x14f)](_0x23cc14(0x14b),_0xe1d898['message']),process['exit'](0x1);}):(console[a0_0x17e29c(0x14f)]('Unknown\x20command:\x20'+command),console[a0_0x17e29c(0x14f)](a0_0x17e29c(0x15e)),process[a0_0x17e29c(0x169)](0x1));
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0xd1f1cb=a0_0x2980;function a0_0x2980(_0x3f212b,_0x27e9f1){_0x3f212b=_0x3f212b-0x1d7;const _0x3afe4b=a0_0x3afe();let _0x298051=_0x3afe4b[_0x3f212b];return _0x298051;}(function(_0x1d3d4e,_0x1e1604){const _0x687600=a0_0x2980,_0x2b8b9c=_0x1d3d4e();while(!![]){try{const _0x5f1e61=parseInt(_0x687600(0x1e2))/0x1+-parseInt(_0x687600(0x202))/0x2*(-parseInt(_0x687600(0x1de))/0x3)+-parseInt(_0x687600(0x1f3))/0x4*(parseInt(_0x687600(0x1ff))/0x5)+-parseInt(_0x687600(0x203))/0x6*(parseInt(_0x687600(0x1f9))/0x7)+-parseInt(_0x687600(0x1da))/0x8+-parseInt(_0x687600(0x1f0))/0x9*(-parseInt(_0x687600(0x1e7))/0xa)+-parseInt(_0x687600(0x208))/0xb*(-parseInt(_0x687600(0x1db))/0xc);if(_0x5f1e61===_0x1e1604)break;else _0x2b8b9c['push'](_0x2b8b9c['shift']());}catch(_0x2b0693){_0x2b8b9c['push'](_0x2b8b9c['shift']());}}}(a0_0x3afe,0x95d02));import{spawn}from'child_process';function a0_0x3afe(){const _0x3c7178=['argv','localhost','✓\x20Server\x20started\x20at\x20','--ui','ignore','destroy','5971077csWjWN','LOXIA_PORT','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','4531708UNrPsw','error','connect','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','Server\x20startup\x20timeout','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','2380588EDNdph','✓\x20Server\x20is\x20already\x20running\x20at\x20','data','env','timeout','🚀\x20Starting\x20Loxia\x20server...','5qnrhRR','dirname','join','669462emVYjd','12MzGEeH','Socket','exit','LOXIA_HOST','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','11JcCyya','bin/cli.js','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','now','slice','log','node','769256TeKvIs','974076vDrCCW','toString','--host','9eQEfDe','../src/interfaces/terminal/index.js','...','💡\x20Troubleshooting:','774067xieazA','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','pipe','web','message','10SRmkfI','setTimeout','--port'];a0_0x3afe=function(){return _0x3c7178;};return a0_0x3afe();}import a0_0x56ed8c from'net';import a0_0x1567f6 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x1567f6[a0_0xd1f1cb(0x200)](__filename),projectRoot=a0_0x1567f6[a0_0xd1f1cb(0x200)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0xd1f1cb(0x1eb),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0xd16d79,_0x3b104f){return new Promise(_0x178483=>{const _0x3c628a=a0_0x2980,_0xa63bdc=new a0_0x56ed8c[(_0x3c628a(0x204))]();_0xa63bdc[_0x3c628a(0x1e8)](0x7d0),_0xa63bdc['on'](_0x3c628a(0x1f5),()=>{const _0x5dd22a=_0x3c628a;_0xa63bdc[_0x5dd22a(0x1ef)](),_0x178483(!![]);}),_0xa63bdc['on'](_0x3c628a(0x1fd),()=>{const _0x473213=_0x3c628a;_0xa63bdc[_0x473213(0x1ef)](),_0x178483(![]);}),_0xa63bdc['on']('error',()=>{const _0x24a448=_0x3c628a;_0xa63bdc[_0x24a448(0x1ef)](),_0x178483(![]);}),_0xa63bdc['connect'](_0x3b104f,_0xd16d79);});}async function startServer(_0x32dece,_0x523896){const _0x3a0463=a0_0xd1f1cb;return console[_0x3a0463(0x1d8)](_0x3a0463(0x1fe)),new Promise((_0x10a899,_0x57beda)=>{const _0x51238a=_0x3a0463,_0xf94e8d=spawn(_0x51238a(0x1d9),[a0_0x1567f6[_0x51238a(0x201)](projectRoot,_0x51238a(0x209)),_0x51238a(0x1ed),_0x51238a(0x1e5),'--host',_0x32dece,'--port',_0x523896[_0x51238a(0x1dc)]()],{'detached':![],'stdio':[_0x51238a(0x1ee),_0x51238a(0x1e4),_0x51238a(0x1e4)]});_0xf94e8d['stdout']['on'](_0x51238a(0x1fb),()=>{}),_0xf94e8d['stderr']['on']('data',()=>{}),_0xf94e8d['on']('error',_0x253951=>{const _0x475300=_0x51238a;console[_0x475300(0x1f4)]('Failed\x20to\x20start\x20server:',_0x253951[_0x475300(0x1e6)]),_0x57beda(_0x253951);});const _0x2d6082=Date[_0x51238a(0x20c)](),_0x1b2f99=setInterval(async()=>{const _0x4657b3=_0x51238a,_0x2d2dfe=await isServerRunning(_0x32dece,_0x523896);if(_0x2d2dfe)clearInterval(_0x1b2f99),console[_0x4657b3(0x1d8)](_0x4657b3(0x1ec)+_0x32dece+':'+_0x523896),_0x10a899();else Date[_0x4657b3(0x20c)]()-_0x2d6082>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x1b2f99),_0xf94e8d['kill'](),_0x57beda(new Error(_0x4657b3(0x1f7))));},0x1f4);});}async function main(){const _0x3f321c=a0_0xd1f1cb;try{console[_0x3f321c(0x1d8)](_0x3f321c(0x1f8)),console[_0x3f321c(0x1d8)](_0x3f321c(0x1f2)),console[_0x3f321c(0x1d8)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['log']('');const _0x16f738=process[_0x3f321c(0x1ea)][_0x3f321c(0x1d7)](0x2);let _0x233e67=DEFAULT_HOST,_0x1d29a8=DEFAULT_PORT;for(let _0x1a1434=0x0;_0x1a1434<_0x16f738['length'];_0x1a1434++){if(_0x16f738[_0x1a1434]===_0x3f321c(0x1dd)&&_0x16f738[_0x1a1434+0x1])_0x233e67=_0x16f738[_0x1a1434+0x1],_0x1a1434++;else _0x16f738[_0x1a1434]===_0x3f321c(0x1e9)&&_0x16f738[_0x1a1434+0x1]&&(_0x1d29a8=parseInt(_0x16f738[_0x1a1434+0x1],0xa),_0x1a1434++);}console['log']('🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20'+_0x233e67+':'+_0x1d29a8+_0x3f321c(0x1e0));const _0x4bb02f=await isServerRunning(_0x233e67,_0x1d29a8);!_0x4bb02f?(console['log']('✗\x20Server\x20is\x20not\x20running'),await startServer(_0x233e67,_0x1d29a8)):console[_0x3f321c(0x1d8)](_0x3f321c(0x1fa)+_0x233e67+':'+_0x1d29a8),console['log'](''),console[_0x3f321c(0x1d8)](_0x3f321c(0x20b)),console[_0x3f321c(0x1d8)](''),await new Promise(_0x4570ef=>setTimeout(_0x4570ef,0x1f4)),process[_0x3f321c(0x1fc)][_0x3f321c(0x206)]=_0x233e67,process[_0x3f321c(0x1fc)][_0x3f321c(0x1f1)]=_0x1d29a8[_0x3f321c(0x1dc)](),await import(_0x3f321c(0x1df));}catch(_0x405196){console['error'](''),console[_0x3f321c(0x1f4)](_0x3f321c(0x20a)),console[_0x3f321c(0x1f4)]('\x20\x20',_0x405196[_0x3f321c(0x1e6)]),console[_0x3f321c(0x1f4)](''),console[_0x3f321c(0x1f4)](_0x3f321c(0x1e1)),console[_0x3f321c(0x1f4)](_0x3f321c(0x207)),console[_0x3f321c(0x1f4)](_0x3f321c(0x1e3)),console[_0x3f321c(0x1f4)](_0x3f321c(0x1f6)),console[_0x3f321c(0x1f4)](''),process[_0x3f321c(0x205)](0x1);}}main();
3
+ const a0_0x2cf118=a0_0x3b76;function a0_0x3b76(_0x4d9bee,_0xf0b11){_0x4d9bee=_0x4d9bee-0xaf;const _0x4b1ca4=a0_0x4b1c();let _0x3b7662=_0x4b1ca4[_0x4d9bee];return _0x3b7662;}(function(_0x7ed920,_0x2ea2c6){const _0x57d557=a0_0x3b76,_0x1653f9=_0x7ed920();while(!![]){try{const _0x5ec719=parseInt(_0x57d557(0xd8))/0x1+parseInt(_0x57d557(0xbf))/0x2*(parseInt(_0x57d557(0xb6))/0x3)+parseInt(_0x57d557(0xcf))/0x4+parseInt(_0x57d557(0xd2))/0x5*(-parseInt(_0x57d557(0xce))/0x6)+parseInt(_0x57d557(0xaf))/0x7*(-parseInt(_0x57d557(0xbe))/0x8)+parseInt(_0x57d557(0xb8))/0x9*(parseInt(_0x57d557(0xda))/0xa)+-parseInt(_0x57d557(0xc4))/0xb;if(_0x5ec719===_0x2ea2c6)break;else _0x1653f9['push'](_0x1653f9['shift']());}catch(_0x7c68e0){_0x1653f9['push'](_0x1653f9['shift']());}}}(a0_0x4b1c,0x7c63a));import{spawn}from'child_process';function a0_0x4b1c(){const _0x4650de=['node','localhost','--port','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','ignore','1220808NuaQjc','681670gJHnpD','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','error','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','../src/interfaces/terminal/index.js','13417283RxBxaJ','now','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','dirname','stderr','pipe','--ui','join','kill','Failed\x20to\x20start\x20server:','31386GdIPJc','824820hcjZZM','destroy','length','185HzCnyy','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','slice','stdout','✗\x20Server\x20is\x20not\x20running','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','806179bNGeeL','--host','762690koLkQz','Server\x20startup\x20timeout','env','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','message','💡\x20Troubleshooting:','7BvMDqh','🚀\x20Starting\x20Loxia\x20server...','timeout','log','LOXIA_PORT','data','...','6RVskqN','connect','45OUaxuD'];a0_0x4b1c=function(){return _0x4650de;};return a0_0x4b1c();}import a0_0x52991e from'net';import a0_0x379c42 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x379c42[a0_0x2cf118(0xc7)](__filename),projectRoot=a0_0x379c42[a0_0x2cf118(0xc7)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x2cf118(0xba),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x2601fa,_0x189d20){return new Promise(_0x3323ba=>{const _0x4c5281=a0_0x3b76,_0x2742ef=new a0_0x52991e['Socket']();_0x2742ef['setTimeout'](0x7d0),_0x2742ef['on'](_0x4c5281(0xb7),()=>{const _0x52bae7=_0x4c5281;_0x2742ef[_0x52bae7(0xd0)](),_0x3323ba(!![]);}),_0x2742ef['on'](_0x4c5281(0xb1),()=>{_0x2742ef['destroy'](),_0x3323ba(![]);}),_0x2742ef['on'](_0x4c5281(0xc1),()=>{const _0x33e579=_0x4c5281;_0x2742ef[_0x33e579(0xd0)](),_0x3323ba(![]);}),_0x2742ef[_0x4c5281(0xb7)](_0x189d20,_0x2601fa);});}async function startServer(_0x832155,_0x522127){const _0x5d8deb=a0_0x2cf118;return console[_0x5d8deb(0xb2)](_0x5d8deb(0xb0)),new Promise((_0xa711b8,_0x673d4d)=>{const _0x3ab309=_0x5d8deb,_0x339f90=spawn(_0x3ab309(0xb9),[a0_0x379c42[_0x3ab309(0xcb)](projectRoot,'bin/cli.js'),_0x3ab309(0xca),'web',_0x3ab309(0xd9),_0x832155,_0x3ab309(0xbb),_0x522127['toString']()],{'detached':![],'stdio':[_0x3ab309(0xbd),_0x3ab309(0xc9),_0x3ab309(0xc9)]});_0x339f90[_0x3ab309(0xd5)]['on'](_0x3ab309(0xb4),()=>{}),_0x339f90[_0x3ab309(0xc8)]['on'](_0x3ab309(0xb4),()=>{}),_0x339f90['on']('error',_0x328242=>{const _0x1e1efb=_0x3ab309;console[_0x1e1efb(0xc1)](_0x1e1efb(0xcd),_0x328242[_0x1e1efb(0xde)]),_0x673d4d(_0x328242);});const _0x4b6d69=Date[_0x3ab309(0xc5)](),_0xeed3e1=setInterval(async()=>{const _0x4a5eb9=_0x3ab309,_0x29b425=await isServerRunning(_0x832155,_0x522127);if(_0x29b425)clearInterval(_0xeed3e1),console[_0x4a5eb9(0xb2)]('✓\x20Server\x20started\x20at\x20'+_0x832155+':'+_0x522127),_0xa711b8();else Date[_0x4a5eb9(0xc5)]()-_0x4b6d69>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0xeed3e1),_0x339f90[_0x4a5eb9(0xcc)](),_0x673d4d(new Error(_0x4a5eb9(0xdb))));},0x1f4);});}async function main(){const _0x48e7af=a0_0x2cf118;try{console[_0x48e7af(0xb2)](_0x48e7af(0xd3)),console[_0x48e7af(0xb2)](_0x48e7af(0xd7)),console[_0x48e7af(0xb2)](_0x48e7af(0xd3)),console[_0x48e7af(0xb2)]('');const _0x4ea6d8=process['argv'][_0x48e7af(0xd4)](0x2);let _0x5b5507=DEFAULT_HOST,_0x5673b9=DEFAULT_PORT;for(let _0x57c2e4=0x0;_0x57c2e4<_0x4ea6d8[_0x48e7af(0xd1)];_0x57c2e4++){if(_0x4ea6d8[_0x57c2e4]==='--host'&&_0x4ea6d8[_0x57c2e4+0x1])_0x5b5507=_0x4ea6d8[_0x57c2e4+0x1],_0x57c2e4++;else _0x4ea6d8[_0x57c2e4]===_0x48e7af(0xbb)&&_0x4ea6d8[_0x57c2e4+0x1]&&(_0x5673b9=parseInt(_0x4ea6d8[_0x57c2e4+0x1],0xa),_0x57c2e4++);}console['log'](_0x48e7af(0xc2)+_0x5b5507+':'+_0x5673b9+_0x48e7af(0xb5));const _0xe19392=await isServerRunning(_0x5b5507,_0x5673b9);!_0xe19392?(console['log'](_0x48e7af(0xd6)),await startServer(_0x5b5507,_0x5673b9)):console[_0x48e7af(0xb2)]('✓\x20Server\x20is\x20already\x20running\x20at\x20'+_0x5b5507+':'+_0x5673b9),console[_0x48e7af(0xb2)](''),console[_0x48e7af(0xb2)](_0x48e7af(0xc6)),console[_0x48e7af(0xb2)](''),await new Promise(_0x6718ba=>setTimeout(_0x6718ba,0x1f4)),process[_0x48e7af(0xdc)]['LOXIA_HOST']=_0x5b5507,process['env'][_0x48e7af(0xb3)]=_0x5673b9['toString'](),await import(_0x48e7af(0xc3));}catch(_0x39ec28){console[_0x48e7af(0xc1)](''),console[_0x48e7af(0xc1)]('❌\x20Failed\x20to\x20start\x20Terminal\x20UI:'),console[_0x48e7af(0xc1)]('\x20\x20',_0x39ec28['message']),console[_0x48e7af(0xc1)](''),console[_0x48e7af(0xc1)](_0x48e7af(0xdf)),console[_0x48e7af(0xc1)](_0x48e7af(0xdd)),console[_0x48e7af(0xc1)](_0x48e7af(0xc0)),console[_0x48e7af(0xc1)](_0x48e7af(0xbc)),console[_0x48e7af(0xc1)](''),process['exit'](0x1);}}main();
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0xb3e3f8=a0_0x4a12;(function(_0x3e661e,_0x384452){const _0x436ee7=a0_0x4a12,_0x440116=_0x3e661e();while(!![]){try{const _0x21e5fb=parseInt(_0x436ee7(0x1a7))/0x1*(parseInt(_0x436ee7(0x1b3))/0x2)+parseInt(_0x436ee7(0x1c6))/0x3*(parseInt(_0x436ee7(0x1af))/0x4)+-parseInt(_0x436ee7(0x1a2))/0x5*(parseInt(_0x436ee7(0x1ba))/0x6)+-parseInt(_0x436ee7(0x1b1))/0x7*(-parseInt(_0x436ee7(0x1b6))/0x8)+-parseInt(_0x436ee7(0x1bd))/0x9*(parseInt(_0x436ee7(0x1a6))/0xa)+parseInt(_0x436ee7(0x1b7))/0xb+parseInt(_0x436ee7(0x1c0))/0xc*(-parseInt(_0x436ee7(0x1c4))/0xd);if(_0x21e5fb===_0x384452)break;else _0x440116['push'](_0x440116['shift']());}catch(_0x311208){_0x440116['push'](_0x440116['shift']());}}}(a0_0x1b8f,0xba381));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0xb3e3f8(0x1ab)][a0_0xb3e3f8(0x1be)](0x2),options={'host':'localhost','port':0x1f90};for(let i=0x0;i<args[a0_0xb3e3f8(0x1c3)];i++){const arg=args[i];if(arg===a0_0xb3e3f8(0x1c5)||arg==='-h')options['host']=args[++i];else{if(arg===a0_0xb3e3f8(0x1bc)||arg==='-p')options[a0_0xb3e3f8(0x1c8)]=parseInt(args[++i],0xa);else arg===a0_0xb3e3f8(0x1a5)&&(console[a0_0xb3e3f8(0x1c7)](a0_0xb3e3f8(0x1b9)),process[a0_0xb3e3f8(0x1a4)](0x0));}}process['env'][a0_0xb3e3f8(0x1c2)]&&(options['host']=process[a0_0xb3e3f8(0x1aa)][a0_0xb3e3f8(0x1c2)]);process[a0_0xb3e3f8(0x1aa)][a0_0xb3e3f8(0x1ad)]&&(options['port']=parseInt(process['env'][a0_0xb3e3f8(0x1ad)],0xa));function a0_0x4a12(_0xb528b9,_0x47542a){_0xb528b9=_0xb528b9-0x1a1;const _0x1b8f38=a0_0x1b8f();let _0x4a1205=_0x1b8f38[_0xb528b9];return _0x4a1205;}!process['stdin'][a0_0xb3e3f8(0x1a8)]&&(console[a0_0xb3e3f8(0x1bb)]('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console[a0_0xb3e3f8(0x1bb)](''),console[a0_0xb3e3f8(0x1bb)](a0_0xb3e3f8(0x1bf)),console['error'](a0_0xb3e3f8(0x1b8)),console[a0_0xb3e3f8(0x1bb)]('\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)'),console[a0_0xb3e3f8(0x1bb)](a0_0xb3e3f8(0x1a3)),console['error'](a0_0xb3e3f8(0x1ae)),console['error'](''),console[a0_0xb3e3f8(0x1bb)](a0_0xb3e3f8(0x1ac)),console['error'](a0_0xb3e3f8(0x1a1)),console['error'](''),console[a0_0xb3e3f8(0x1bb)](a0_0xb3e3f8(0x1c1)),console['error'](a0_0xb3e3f8(0x1b0)),process[a0_0xb3e3f8(0x1a4)](0x1));console['log'](a0_0xb3e3f8(0x1b5)),console[a0_0xb3e3f8(0x1c7)](a0_0xb3e3f8(0x1c9)+options['host']+':'+options[a0_0xb3e3f8(0x1c8)]),console[a0_0xb3e3f8(0x1c7)]('Press\x20Ctrl+C\x20to\x20exit\x0a');const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0xb3e3f8(0x1b4)](()=>{const _0x181bd5=a0_0xb3e3f8;console[_0x181bd5(0x1c7)](_0x181bd5(0x1a9)),process['exit'](0x0);})[a0_0xb3e3f8(0x1b2)](_0x1aed79=>{const _0x1645d4=a0_0xb3e3f8;console['error']('\x0aTerminal\x20UI\x20error:',_0x1aed79),process[_0x1645d4(0x1a4)](0x1);});function a0_0x1b8f(){const _0x1e0c9c=['4891964iycQqw','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','\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','4518834Coxvyk','error','--port','9828adZUjK','slice','The\x20terminal\x20UI\x20cannot\x20run\x20in:','69828TnKQLO','Or\x20use\x20the\x20web\x20UI\x20instead:','LOXIA_HOST','length','3211MEnAtg','--host','4228569XIdOMm','log','port','Connecting\x20to:\x20','\x20\x20npm\x20run\x20terminal-ui','5UzcsNu','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','exit','--help','11610xQMcqu','13094BCVsas','isTTY','\x0aTerminal\x20UI\x20exited','env','argv','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','LOXIA_PORT','\x20\x20-\x20Some\x20CI/CD\x20environments','4PrrqGy','\x20\x20npm\x20start','7NrnTnu','catch','148ySMnQY','then','Starting\x20Loxia\x20Terminal\x20UI...','11182352UggYPy'];a0_0x1b8f=function(){return _0x1e0c9c;};return a0_0x1b8f();}
3
+ const a0_0x4dd9fd=a0_0x3a1e;(function(_0x4996f,_0x2df47d){const _0x24f075=a0_0x3a1e,_0x14827f=_0x4996f();while(!![]){try{const _0x5eac02=parseInt(_0x24f075(0xcc))/0x1+-parseInt(_0x24f075(0xe5))/0x2+parseInt(_0x24f075(0xdb))/0x3*(parseInt(_0x24f075(0xcf))/0x4)+-parseInt(_0x24f075(0xe4))/0x5*(-parseInt(_0x24f075(0xda))/0x6)+-parseInt(_0x24f075(0xce))/0x7+parseInt(_0x24f075(0xe7))/0x8*(parseInt(_0x24f075(0xd8))/0x9)+-parseInt(_0x24f075(0xde))/0xa;if(_0x5eac02===_0x2df47d)break;else _0x14827f['push'](_0x14827f['shift']());}catch(_0x700f6c){_0x14827f['push'](_0x14827f['shift']());}}}(a0_0x3671,0x6f980));function a0_0x3a1e(_0x7e0635,_0x32bcaf){_0x7e0635=_0x7e0635-0xc2;const _0x367159=a0_0x3671();let _0x3a1e17=_0x367159[_0x7e0635];return _0x3a1e17;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x4dd9fd(0xe6)]['slice'](0x2),options={'host':a0_0x4dd9fd(0xdc),'port':0x1f90};for(let i=0x0;i<args[a0_0x4dd9fd(0xca)];i++){const arg=args[i];if(arg===a0_0x4dd9fd(0xc5)||arg==='-h')options[a0_0x4dd9fd(0xc7)]=args[++i];else{if(arg===a0_0x4dd9fd(0xcb)||arg==='-p')options[a0_0x4dd9fd(0xc6)]=parseInt(args[++i],0xa);else arg===a0_0x4dd9fd(0xc3)&&(console['log'](a0_0x4dd9fd(0xe0)),process['exit'](0x0));}}process[a0_0x4dd9fd(0xdf)][a0_0x4dd9fd(0xc8)]&&(options['host']=process['env'][a0_0x4dd9fd(0xc8)]);process['env'][a0_0x4dd9fd(0xd4)]&&(options[a0_0x4dd9fd(0xc6)]=parseInt(process[a0_0x4dd9fd(0xdf)][a0_0x4dd9fd(0xd4)],0xa));!process[a0_0x4dd9fd(0xe1)][a0_0x4dd9fd(0xc2)]&&(console[a0_0x4dd9fd(0xdd)]('ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).'),console[a0_0x4dd9fd(0xdd)](''),console[a0_0x4dd9fd(0xdd)](a0_0x4dd9fd(0xe2)),console['error'](a0_0x4dd9fd(0xd0)),console[a0_0x4dd9fd(0xdd)](a0_0x4dd9fd(0xd9)),console[a0_0x4dd9fd(0xdd)](a0_0x4dd9fd(0xc9)),console[a0_0x4dd9fd(0xdd)]('\x20\x20-\x20Some\x20CI/CD\x20environments'),console[a0_0x4dd9fd(0xdd)](''),console['error']('Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:'),console[a0_0x4dd9fd(0xdd)]('\x20\x20npm\x20run\x20terminal-ui'),console[a0_0x4dd9fd(0xdd)](''),console['error'](a0_0x4dd9fd(0xd2)),console[a0_0x4dd9fd(0xdd)]('\x20\x20npm\x20start'),process['exit'](0x1));console[a0_0x4dd9fd(0xd6)](a0_0x4dd9fd(0xe3)),console['log'](a0_0x4dd9fd(0xcd)+options[a0_0x4dd9fd(0xc7)]+':'+options['port']),console[a0_0x4dd9fd(0xd6)](a0_0x4dd9fd(0xd7));const instance=startTerminalUI(options);instance['waitUntilExit']()[a0_0x4dd9fd(0xd5)](()=>{const _0x4ed653=a0_0x4dd9fd;console[_0x4ed653(0xd6)](_0x4ed653(0xc4)),process[_0x4ed653(0xd1)](0x0);})['catch'](_0x38c5f8=>{const _0x27e2c8=a0_0x4dd9fd;console[_0x27e2c8(0xdd)](_0x27e2c8(0xd3),_0x38c5f8),process[_0x27e2c8(0xd1)](0x1);});function a0_0x3671(){const _0x2642ca=['\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','exit','Or\x20use\x20the\x20web\x20UI\x20instead:','\x0aTerminal\x20UI\x20error:','LOXIA_PORT','then','log','Press\x20Ctrl+C\x20to\x20exit\x0a','9qOHVfG','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','6xRwLxw','3hRTWbw','localhost','error','14590680syMieF','env','\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','stdin','The\x20terminal\x20UI\x20cannot\x20run\x20in:','Starting\x20Loxia\x20Terminal\x20UI...','4253290mQkgHu','1331396OXBgoa','argv','5655112fVaRWI','isTTY','--help','\x0aTerminal\x20UI\x20exited','--host','port','host','LOXIA_HOST','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','length','--port','719892uxAnSQ','Connecting\x20to:\x20','2417492REHQic','2599084SUrVUs'];a0_0x3671=function(){return _0x2642ca;};return a0_0x3671();}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const a0_0x2e7ca5=a0_0x5e6a;(function(_0x42544f,_0x123f15){const _0x4612ed=a0_0x5e6a,_0x2caae2=_0x42544f();while(!![]){try{const _0x1944fa=parseInt(_0x4612ed(0x10f))/0x1+parseInt(_0x4612ed(0xed))/0x2*(parseInt(_0x4612ed(0x110))/0x3)+-parseInt(_0x4612ed(0x11d))/0x4*(parseInt(_0x4612ed(0x106))/0x5)+parseInt(_0x4612ed(0x105))/0x6*(-parseInt(_0x4612ed(0x11a))/0x7)+parseInt(_0x4612ed(0x10e))/0x8+-parseInt(_0x4612ed(0xee))/0x9*(parseInt(_0x4612ed(0x112))/0xa)+-parseInt(_0x4612ed(0x103))/0xb;if(_0x1944fa===_0x123f15)break;else _0x2caae2['push'](_0x2caae2['shift']());}catch(_0x43d8b4){_0x2caae2['push'](_0x2caae2['shift']());}}}(a0_0x182e,0x284c8));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x5733fa from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process[a0_0x2e7ca5(0x100)][a0_0x2e7ca5(0xef)]||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x36f587=0xa,_0x430da6=0x1f4){const _0x514afa=a0_0x2e7ca5;for(let _0x2d3326=0x0;_0x2d3326<_0x36f587;_0x2d3326++){try{return await new Promise((_0x2c1eba,_0x4f73c2)=>{const _0x1fed6d=a0_0x5e6a,_0x212c39=a0_0x5733fa['get']('http://localhost:'+SERVER_PORT+'/health',_0x12eae2=>{const _0x16bfc1=a0_0x5e6a;_0x12eae2[_0x16bfc1(0x109)]===0xc8?_0x2c1eba():_0x4f73c2(new Error('Server\x20returned\x20'+_0x12eae2[_0x16bfc1(0x109)]));});_0x212c39['on']('error',_0x4f73c2),_0x212c39[_0x1fed6d(0x116)](0x3e8,()=>{const _0x5d182c=_0x1fed6d;_0x212c39[_0x5d182c(0x111)](),_0x4f73c2(new Error(_0x5d182c(0xfe)));});}),console[_0x514afa(0x10a)]('✅\x20Server\x20is\x20ready!'),!![];}catch(_0x471fcd){_0x2d3326<_0x36f587-0x1&&await new Promise(_0x17c5c3=>setTimeout(_0x17c5c3,_0x430da6));}}return console['log']('⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...'),![];}async function startServer(){return new Promise(_0x46654f=>{const _0x4c89ac=a0_0x5e6a;console[_0x4c89ac(0x10a)](_0x4c89ac(0x102));const _0x41ba7f=join(rootDir,_0x4c89ac(0x101),_0x4c89ac(0xf4));serverProcess=spawn(_0x4c89ac(0xf7),[_0x41ba7f],{'cwd':rootDir,'env':{...process[_0x4c89ac(0x100)]},'stdio':[_0x4c89ac(0xf6),_0x4c89ac(0xf2),_0x4c89ac(0xf2)],'detached':![]}),serverProcess[_0x4c89ac(0x108)]['on'](_0x4c89ac(0xf1),_0x1709b5=>{const _0x2b95c7=_0x4c89ac,_0x19d550=_0x1709b5[_0x2b95c7(0xfd)]()[_0x2b95c7(0x113)]();_0x19d550&&console[_0x2b95c7(0x10a)]('[SERVER]\x20'+_0x19d550);}),serverProcess['stderr']['on'](_0x4c89ac(0xf1),_0x2665ce=>{const _0x403964=_0x4c89ac,_0x350ba1=_0x2665ce[_0x403964(0xfd)]()[_0x403964(0x113)]();_0x350ba1&&!_0x350ba1[_0x403964(0xfa)](_0x403964(0x117))&&console[_0x403964(0xf3)](_0x403964(0xeb)+_0x350ba1);}),serverProcess['on'](_0x4c89ac(0xf3),_0x6a5b3a=>{const _0x410caa=_0x4c89ac;console['error'](_0x410caa(0x11c),_0x6a5b3a[_0x410caa(0x104)]),process[_0x410caa(0x118)](0x1);}),serverProcess['on'](_0x4c89ac(0x118),(_0x38510b,_0x4e0c29)=>{const _0x15f6b7=_0x4c89ac;_0x38510b!==null&&_0x38510b!==0x0&&(console['error'](_0x15f6b7(0xec)+_0x38510b),process[_0x15f6b7(0x118)](_0x38510b));}),setTimeout(_0x46654f,STARTUP_WAIT);});}async function startTerminalUI(){const _0x5e19db=a0_0x2e7ca5;console[_0x5e19db(0x10a)](_0x5e19db(0xf9)),console[_0x5e19db(0x10a)]('');const _0x3df00b=join(rootDir,'bin',_0x5e19db(0x10c)),_0x386539=spawn(_0x5e19db(0xf7),[_0x3df00b],{'cwd':rootDir,'env':{...process['env']},'stdio':_0x5e19db(0x114)});return _0x386539['on'](_0x5e19db(0xf3),_0x2680df=>{const _0x309d63=_0x5e19db;console[_0x309d63(0xf3)](_0x309d63(0x119),_0x2680df[_0x309d63(0x104)]),cleanup(),process[_0x309d63(0x118)](0x1);}),_0x386539['on'](_0x5e19db(0x118),_0x2e788f=>{const _0xeef511=_0x5e19db;console[_0xeef511(0x10a)](_0xeef511(0xff)),cleanup(),process[_0xeef511(0x118)](_0x2e788f||0x0);}),_0x386539;}function a0_0x5e6a(_0x8db2f9,_0x509dd7){_0x8db2f9=_0x8db2f9-0xea;const _0x182eff=a0_0x182e();let _0x5e6af5=_0x182eff[_0x8db2f9];return _0x5e6af5;}function cleanup(){const _0x14e255=a0_0x2e7ca5;serverProcess&&!serverProcess[_0x14e255(0x107)]&&(console[_0x14e255(0x10a)](_0x14e255(0x11b)),serverProcess[_0x14e255(0x10d)]('SIGTERM'),setTimeout(()=>{const _0x39b6ec=_0x14e255;!serverProcess['killed']&&serverProcess[_0x39b6ec(0x10d)](_0x39b6ec(0x115));},0x1388));}process['on']('SIGINT',()=>{const _0x4ae4c5=a0_0x2e7ca5;console['log'](_0x4ae4c5(0xf5)),cleanup(),process[_0x4ae4c5(0x118)](0x0);}),process['on'](a0_0x2e7ca5(0x10b),()=>{const _0x218906=a0_0x2e7ca5;console[_0x218906(0x10a)](_0x218906(0xf8)),cleanup(),process[_0x218906(0x118)](0x0);}),process['on'](a0_0x2e7ca5(0x118),()=>{cleanup();});function a0_0x182e(){const _0x434baa=['destroy','10tQepdZ','trim','inherit','SIGKILL','setTimeout','ExperimentalWarning','exit','Failed\x20to\x20start\x20Terminal\x20UI:','137179VStpaV','🛑\x20Stopping\x20server...','Failed\x20to\x20start\x20server:','20eBVZFq','Error\x20during\x20startup:','[SERVER\x20ERROR]\x20','Server\x20exited\x20with\x20code\x20','2AgYVwi','1664541SMTBHZ','PORT','╔════════════════════════════════════════════════╗','data','pipe','error','index.js','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','ignore','node','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','🖥️\x20\x20Starting\x20Terminal\x20UI...','includes','╚════════════════════════════════════════════════╝','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','toString','Timeout','\x0a👋\x20Terminal\x20UI\x20closed.','env','src','🚀\x20Starting\x20Loxia\x20server...','472472HyZBTg','message','42JwBfmo','91265Oufduj','killed','stdout','statusCode','log','SIGTERM','loxia-terminal.js','kill','1279256tDoBqF','217747hgMrlr','731265YdjRqt'];a0_0x182e=function(){return _0x434baa;};return a0_0x182e();}async function main(){const _0xdf861e=a0_0x2e7ca5;console[_0xdf861e(0x10a)](_0xdf861e(0xf0)),console['log'](_0xdf861e(0xfc)),console[_0xdf861e(0x10a)](_0xdf861e(0xfb)),console[_0xdf861e(0x10a)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x3e5150){console['error'](_0xdf861e(0xea),_0x3e5150[_0xdf861e(0x104)]),cleanup(),process[_0xdf861e(0x118)](0x1);}}main();
3
+ const a0_0x3da864=a0_0x5c33;(function(_0x5c4bc5,_0x245558){const _0x1e9e47=a0_0x5c33,_0x50c306=_0x5c4bc5();while(!![]){try{const _0x1196a9=-parseInt(_0x1e9e47(0x1a8))/0x1*(-parseInt(_0x1e9e47(0x1ae))/0x2)+-parseInt(_0x1e9e47(0x192))/0x3+parseInt(_0x1e9e47(0x1a4))/0x4*(-parseInt(_0x1e9e47(0x1a9))/0x5)+parseInt(_0x1e9e47(0x198))/0x6+-parseInt(_0x1e9e47(0x197))/0x7*(-parseInt(_0x1e9e47(0x19f))/0x8)+parseInt(_0x1e9e47(0x18a))/0x9+-parseInt(_0x1e9e47(0x18b))/0xa*(parseInt(_0x1e9e47(0x1b6))/0xb);if(_0x1196a9===_0x245558)break;else _0x50c306['push'](_0x50c306['shift']());}catch(_0x1c3b6b){_0x50c306['push'](_0x50c306['shift']());}}}(a0_0x5052,0x4a793));import{spawn}from'child_process';function a0_0x5c33(_0x292d91,_0xeb3aa){_0x292d91=_0x292d91-0x188;const _0x5052fa=a0_0x5052();let _0x5c3365=_0x5052fa[_0x292d91];return _0x5c3365;}import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x2f290b from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process[a0_0x3da864(0x18c)][a0_0x3da864(0x1af)]||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x57427e=0xa,_0x498ee7=0x1f4){const _0x5e3224=a0_0x3da864;for(let _0x51cf4b=0x0;_0x51cf4b<_0x57427e;_0x51cf4b++){try{return await new Promise((_0x5ac546,_0x3dc032)=>{const _0xa588ae=a0_0x5c33,_0x2612a3=a0_0x2f290b['get'](_0xa588ae(0x18f)+SERVER_PORT+_0xa588ae(0x1a6),_0x31a986=>{const _0x31153f=_0xa588ae;_0x31a986[_0x31153f(0x19d)]===0xc8?_0x5ac546():_0x3dc032(new Error(_0x31153f(0x1a0)+_0x31a986[_0x31153f(0x19d)]));});_0x2612a3['on'](_0xa588ae(0x1bc),_0x3dc032),_0x2612a3[_0xa588ae(0x1b1)](0x3e8,()=>{const _0x281390=_0xa588ae;_0x2612a3[_0x281390(0x188)](),_0x3dc032(new Error(_0x281390(0x19a)));});}),console[_0x5e3224(0x18e)](_0x5e3224(0x194)),!![];}catch(_0x2ec31b){_0x51cf4b<_0x57427e-0x1&&await new Promise(_0x39683b=>setTimeout(_0x39683b,_0x498ee7));}}return console[_0x5e3224(0x18e)]('⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...'),![];}async function startServer(){return new Promise(_0x341a12=>{const _0x3e56eb=a0_0x5c33;console['log'](_0x3e56eb(0x1a1));const _0x4859ca=join(rootDir,_0x3e56eb(0x1b4),_0x3e56eb(0x195));serverProcess=spawn(_0x3e56eb(0x1a5),[_0x4859ca],{'cwd':rootDir,'env':{...process['env']},'stdio':['ignore',_0x3e56eb(0x1ac),'pipe'],'detached':![]}),serverProcess[_0x3e56eb(0x1b9)]['on']('data',_0x54ab2b=>{const _0x3b6193=_0x3e56eb,_0x56ce0b=_0x54ab2b[_0x3b6193(0x1bb)]()[_0x3b6193(0x1ba)]();_0x56ce0b&&console[_0x3b6193(0x18e)](_0x3b6193(0x1a7)+_0x56ce0b);}),serverProcess[_0x3e56eb(0x19b)]['on']('data',_0x5bf5ad=>{const _0x42ec58=_0x3e56eb,_0x2163c7=_0x5bf5ad['toString']()['trim']();_0x2163c7&&!_0x2163c7[_0x42ec58(0x1b5)]('ExperimentalWarning')&&console[_0x42ec58(0x1bc)](_0x42ec58(0x191)+_0x2163c7);}),serverProcess['on']('error',_0x1631cd=>{const _0x1e10bf=_0x3e56eb;console[_0x1e10bf(0x1bc)]('Failed\x20to\x20start\x20server:',_0x1631cd[_0x1e10bf(0x1b7)]),process[_0x1e10bf(0x190)](0x1);}),serverProcess['on'](_0x3e56eb(0x190),(_0x4656a7,_0x8dde1f)=>{const _0x4a43d7=_0x3e56eb;_0x4656a7!==null&&_0x4656a7!==0x0&&(console[_0x4a43d7(0x1bc)]('Server\x20exited\x20with\x20code\x20'+_0x4656a7),process[_0x4a43d7(0x190)](_0x4656a7));}),setTimeout(_0x341a12,STARTUP_WAIT);});}async function startTerminalUI(){const _0x9a1898=a0_0x3da864;console[_0x9a1898(0x18e)](_0x9a1898(0x1b0)),console[_0x9a1898(0x18e)]('');const _0x48fb26=join(rootDir,_0x9a1898(0x199),_0x9a1898(0x1aa)),_0x86ca71=spawn(_0x9a1898(0x1a5),[_0x48fb26],{'cwd':rootDir,'env':{...process[_0x9a1898(0x18c)]},'stdio':'inherit'});return _0x86ca71['on']('error',_0x28b3f8=>{const _0x5d633d=_0x9a1898;console['error'](_0x5d633d(0x1ad),_0x28b3f8[_0x5d633d(0x1b7)]),cleanup(),process['exit'](0x1);}),_0x86ca71['on'](_0x9a1898(0x190),_0x5abfc2=>{const _0x336103=_0x9a1898;console[_0x336103(0x18e)](_0x336103(0x18d)),cleanup(),process[_0x336103(0x190)](_0x5abfc2||0x0);}),_0x86ca71;}function cleanup(){const _0x2993ed=a0_0x3da864;serverProcess&&!serverProcess[_0x2993ed(0x196)]&&(console['log'](_0x2993ed(0x193)),serverProcess['kill'](_0x2993ed(0x19e)),setTimeout(()=>{const _0x2c4623=_0x2993ed;!serverProcess['killed']&&serverProcess[_0x2c4623(0x189)]('SIGKILL');},0x1388));}function a0_0x5052(){const _0x175e8d=['toString','error','destroy','kill','1976958ymiUZW','365470JyyZnw','env','\x0a👋\x20Terminal\x20UI\x20closed.','log','http://localhost:','exit','[SERVER\x20ERROR]\x20','1676595aEwssK','🛑\x20Stopping\x20server...','✅\x20Server\x20is\x20ready!','index.js','killed','1559537DRuhpN','1106526DrbpaI','bin','Timeout','stderr','SIGINT','statusCode','SIGTERM','8HGThaw','Server\x20returned\x20','🚀\x20Starting\x20Loxia\x20server...','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','╔════════════════════════════════════════════════╗','8CZWnyS','node','/health','[SERVER]\x20','67JQPWRD','30530FXxEIu','loxia-terminal.js','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','pipe','Failed\x20to\x20start\x20Terminal\x20UI:','11804uOOlPR','PORT','🖥️\x20\x20Starting\x20Terminal\x20UI...','setTimeout','╚════════════════════════════════════════════════╝','Error\x20during\x20startup:','src','includes','44cCUNPQ','message','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','stdout','trim'];a0_0x5052=function(){return _0x175e8d;};return a0_0x5052();}process['on'](a0_0x3da864(0x19c),()=>{const _0x17bfba=a0_0x3da864;console[_0x17bfba(0x18e)](_0x17bfba(0x1ab)),cleanup(),process[_0x17bfba(0x190)](0x0);}),process['on'](a0_0x3da864(0x19e),()=>{const _0x18c2ed=a0_0x3da864;console[_0x18c2ed(0x18e)](_0x18c2ed(0x1a2)),cleanup(),process[_0x18c2ed(0x190)](0x0);}),process['on'](a0_0x3da864(0x190),()=>{cleanup();});async function main(){const _0x258839=a0_0x3da864;console['log'](_0x258839(0x1a3)),console['log'](_0x258839(0x1b8)),console[_0x258839(0x18e)](_0x258839(0x1b2)),console[_0x258839(0x18e)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x179e6b){console['error'](_0x258839(0x1b3),_0x179e6b[_0x258839(0x1b7)]),cleanup(),process[_0x258839(0x190)](0x1);}}main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loxia-labs/loxia-autopilot-one",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
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_0x194a4b=a0_0x370a;(function(_0x1024b5,_0x205b93){const _0x314615=a0_0x370a,_0x3d5b54=_0x1024b5();while(!![]){try{const _0x38b82f=parseInt(_0x314615(0xa2))/0x1+-parseInt(_0x314615(0xac))/0x2+-parseInt(_0x314615(0x88))/0x3*(-parseInt(_0x314615(0x90))/0x4)+-parseInt(_0x314615(0x85))/0x5+parseInt(_0x314615(0xa9))/0x6*(-parseInt(_0x314615(0x8e))/0x7)+-parseInt(_0x314615(0x9d))/0x8*(parseInt(_0x314615(0xa5))/0x9)+parseInt(_0x314615(0x9e))/0xa;if(_0x38b82f===_0x205b93)break;else _0x3d5b54['push'](_0x3d5b54['shift']());}catch(_0x67a804){_0x3d5b54['push'](_0x3d5b54['shift']());}}}(a0_0x88ab,0x3d595));import{exec}from'child_process';import{promisify}from'util';import a0_0x36bcff from'https';import a0_0x53e2c5 from'http';import a0_0x3d7aa2 from'fs';function a0_0x370a(_0x342455,_0x4be41e){_0x342455=_0x342455-0x6a;const _0x88aba4=a0_0x88ab();let _0x370a78=_0x88aba4[_0x342455];return _0x370a78;}import a0_0x256117 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_0x256117[a0_0x194a4b(0x75)](__filename),SCANNER_DIR=a0_0x256117[a0_0x194a4b(0x70)](__dirname,'..',a0_0x194a4b(0x73),'.scanners'),SEMGREP_VERSION=a0_0x194a4b(0x77);function a0_0x88ab(){const _0x2034cf=['exit','790756JgFqGM','\x20already\x20installed','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','yamllint','arch','semgrep\x20--version','close','\x20\x20\x20✅\x20','python\x20--version','catch','python3\x20--version','pip-audit','semgrep','8WnsTpx','8979140ahsytQ','finish','Failed\x20to\x20download:\x20HTTP\x20','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','399792kLOxVT','bandit','...','3655539cGwfqf','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','trim','6FsucuS','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','593034dnyFld','python3','statusCode','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','platform','chmod','\x20\x20Installation\x20Complete','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','stdout','https','unlink','pipe','\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20','join','\x20\x20\x20Location:\x20','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','node_modules','error','dirname','mkdir','v1.55.0','startsWith','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','log','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','═══════════════════════════════════════════════════════════\x0a','\x20-m\x20pip\x20show\x20','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','\x20-m\x20pip\x20install\x20--user\x20','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20\x20✅\x20Python\x20found:\x20','\x20\x20\x20Installing\x20','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','1719160DUrAzA','promises','═══════════════════════════════════════════════════════════','3rzVUqs','checkov','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','url','then','message','1383130EZCocH'];a0_0x88ab=function(){return _0x2034cf;};return a0_0x88ab();}console[a0_0x194a4b(0x7a)](a0_0x194a4b(0x87)),console[a0_0x194a4b(0x7a)]('\x20\x20Installing\x20Security\x20Scanners'),console[a0_0x194a4b(0x7a)]('═══════════════════════════════════════════════════════════\x0a');async function installScanners(){const _0x423357=a0_0x194a4b;await a0_0x3d7aa2[_0x423357(0x86)][_0x423357(0x76)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x423357(0x7a)]('\x0a═══════════════════════════════════════════════════════════'),console[_0x423357(0x7a)](_0x423357(0xb2)),console[_0x423357(0x7a)](_0x423357(0x7d));}async function checkESLintSecurity(){const _0x15ab18=a0_0x194a4b;console[_0x15ab18(0x7a)](_0x15ab18(0x81));try{await import('eslint-plugin-security'),console[_0x15ab18(0x7a)](_0x15ab18(0x7c));}catch(_0x58f0e0){console[_0x15ab18(0x7a)](_0x15ab18(0xa7)),console['log'](_0x15ab18(0x92));}}async function installSemgrep(){const _0xd38696=a0_0x194a4b;console['log']('🔍\x20Installing\x20Semgrep...');const _0x328cb3=process[_0xd38696(0xb0)],_0x4e8877=process[_0xd38696(0x94)];try{const _0x218773=await execAsync(_0xd38696(0x95),{'timeout':0x1388});console[_0xd38696(0x7a)](_0xd38696(0x7b)+_0x218773[_0xd38696(0x6b)][_0xd38696(0xa8)]()),console['log'](_0xd38696(0xa1));return;}catch(_0x579098){console[_0xd38696(0x7a)](_0xd38696(0x8a));}const _0x255bef=getSemgrepBinaryInfo(_0x328cb3,_0x4e8877);if(!_0x255bef){console[_0xd38696(0x7a)](_0xd38696(0x6f)+_0x328cb3+'-'+_0x4e8877),console['log']('\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a');return;}try{const _0x5c3696=a0_0x256117[_0xd38696(0x70)](SCANNER_DIR,_0xd38696(0x9c));console[_0xd38696(0x7a)]('\x20\x20\x20Downloading\x20from\x20'+_0x255bef[_0xd38696(0x8b)]+_0xd38696(0xa4)),await downloadFile(_0x255bef[_0xd38696(0x8b)],_0x5c3696),await a0_0x3d7aa2[_0xd38696(0x86)][_0xd38696(0xb1)](_0x5c3696,0x1ed),console[_0xd38696(0x7a)](_0xd38696(0x79)),console[_0xd38696(0x7a)](_0xd38696(0x71)+_0x5c3696+'\x0a'),console[_0xd38696(0x7a)](_0xd38696(0x7f)),console[_0xd38696(0x7a)]('\x20\x20\x20pip\x20install\x20semgrep\x0a');}catch(_0x5ba078){console[_0xd38696(0x7a)]('\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20'+_0x5ba078['message']),console['log'](_0xd38696(0x84));}}function getSemgrepBinaryInfo(_0x1e08a4,_0x4a39c5){return null;}async function installPythonScanners(){const _0x38d2ee=a0_0x194a4b;console[_0x38d2ee(0x7a)]('🐍\x20Checking\x20Python\x20scanners...');let _0x58b61d=null;try{await execAsync(_0x38d2ee(0x9a),{'timeout':0x1388}),_0x58b61d=_0x38d2ee(0xad);}catch(_0x3b9d7d){try{await execAsync(_0x38d2ee(0x98),{'timeout':0x1388}),_0x58b61d='python';}catch(_0x3d4ca8){console[_0x38d2ee(0x7a)]('\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners'),console[_0x38d2ee(0x7a)](_0x38d2ee(0xa6)),console[_0x38d2ee(0x7a)](_0x38d2ee(0x72));return;}}console[_0x38d2ee(0x7a)](_0x38d2ee(0x82)+_0x58b61d),await installViaPip('semgrep',_0x58b61d),await installViaPip(_0x38d2ee(0xa3),_0x58b61d),await installViaPip(_0x38d2ee(0x9b),_0x58b61d),await installViaPip(_0x38d2ee(0x89),_0x58b61d),await installViaPip(_0x38d2ee(0x93),_0x58b61d),console['log']('');}async function installViaPip(_0xf597be,_0x5cbc34){const _0x3ee9c9=a0_0x194a4b;try{const _0x66b809=await execAsync(_0x5cbc34+_0x3ee9c9(0x7e)+_0xf597be,{'timeout':0x1388});return console[_0x3ee9c9(0x7a)](_0x3ee9c9(0x97)+_0xf597be+_0x3ee9c9(0x91)),!![];}catch(_0x1c0de0){console[_0x3ee9c9(0x7a)](_0x3ee9c9(0x83)+_0xf597be+_0x3ee9c9(0xa4));try{return await execAsync(_0x5cbc34+_0x3ee9c9(0x80)+_0xf597be,{'timeout':0xea60}),console[_0x3ee9c9(0x7a)](_0x3ee9c9(0x97)+_0xf597be+'\x20installed\x20successfully'),!![];}catch(_0x24a876){return console[_0x3ee9c9(0x7a)](_0x3ee9c9(0xab)+_0xf597be+':\x20'+_0x24a876[_0x3ee9c9(0x8d)]),console[_0x3ee9c9(0x7a)](_0x3ee9c9(0xaa)+_0xf597be),![];}}}async function downloadFile(_0x143e63,_0x4994dd){return new Promise((_0x404cf3,_0x5c0880)=>{const _0x2ff29d=a0_0x370a,_0x1ff2f2=_0x143e63[_0x2ff29d(0x78)](_0x2ff29d(0x6c))?a0_0x36bcff:a0_0x53e2c5;_0x1ff2f2['get'](_0x143e63,_0x1d335d=>{const _0x269964=_0x2ff29d;if(_0x1d335d[_0x269964(0xae)]===0x12e||_0x1d335d[_0x269964(0xae)]===0x12d){downloadFile(_0x1d335d['headers']['location'],_0x4994dd)[_0x269964(0x8c)](_0x404cf3)[_0x269964(0x99)](_0x5c0880);return;}if(_0x1d335d[_0x269964(0xae)]!==0xc8){_0x5c0880(new Error(_0x269964(0xa0)+_0x1d335d[_0x269964(0xae)]));return;}const _0x221236=createWriteStream(_0x4994dd);_0x1d335d[_0x269964(0x6e)](_0x221236),_0x221236['on'](_0x269964(0x9f),()=>{const _0x8996eb=_0x269964;_0x221236[_0x8996eb(0x96)](),_0x404cf3();}),_0x221236['on'](_0x269964(0x74),_0x3f40c7=>{const _0x4c99f8=_0x269964;a0_0x3d7aa2[_0x4c99f8(0x6d)](_0x4994dd,()=>{}),_0x5c0880(_0x3f40c7);});})['on']('error',_0x5c0880);});}installScanners()['catch'](_0x52166a=>{const _0x38cf33=a0_0x194a4b;console['error']('❌\x20Installation\x20failed:',_0x52166a[_0x38cf33(0x8d)]),console[_0x38cf33(0x74)]('\x0aYou\x20can\x20manually\x20install\x20scanners:'),console[_0x38cf33(0x74)](_0x38cf33(0xaf)),console['error'](_0x38cf33(0x6a)),process[_0x38cf33(0x8f)](0x0);});
2
+ const a0_0x389d31=a0_0x184e;(function(_0x190f97,_0x40e3ef){const _0x149564=a0_0x184e,_0x392fa0=_0x190f97();while(!![]){try{const _0x22d520=parseInt(_0x149564(0xed))/0x1*(-parseInt(_0x149564(0xea))/0x2)+parseInt(_0x149564(0x104))/0x3*(-parseInt(_0x149564(0xe9))/0x4)+parseInt(_0x149564(0xef))/0x5*(-parseInt(_0x149564(0xd0))/0x6)+-parseInt(_0x149564(0xf8))/0x7+parseInt(_0x149564(0xd6))/0x8*(parseInt(_0x149564(0xdd))/0x9)+parseInt(_0x149564(0xfd))/0xa*(-parseInt(_0x149564(0xe5))/0xb)+-parseInt(_0x149564(0xfa))/0xc*(-parseInt(_0x149564(0x112))/0xd);if(_0x22d520===_0x40e3ef)break;else _0x392fa0['push'](_0x392fa0['shift']());}catch(_0x1fca07){_0x392fa0['push'](_0x392fa0['shift']());}}}(a0_0x3feb,0x5da68));import{exec}from'child_process';import{promisify}from'util';import a0_0x5b54b4 from'https';import a0_0x4f2fe3 from'http';import a0_0x47a92e from'fs';import a0_0x56ef16 from'path';import{fileURLToPath}from'url';function a0_0x184e(_0x3ae31e,_0x13ae83){_0x3ae31e=_0x3ae31e-0xc9;const _0x3feba1=a0_0x3feb();let _0x184e2a=_0x3feba1[_0x3ae31e];return _0x184e2a;}import{createWriteStream}from'fs';import{pipeline}from'stream/promises';const execAsync=promisify(exec),__filename=fileURLToPath(import.meta.url),__dirname=a0_0x56ef16[a0_0x389d31(0xcf)](__filename),SCANNER_DIR=a0_0x56ef16[a0_0x389d31(0x100)](__dirname,'..',a0_0x389d31(0xd1),a0_0x389d31(0xce)),SEMGREP_VERSION='v1.55.0';console['log']('═══════════════════════════════════════════════════════════'),console[a0_0x389d31(0xe3)](a0_0x389d31(0xeb)),console[a0_0x389d31(0xe3)]('═══════════════════════════════════════════════════════════\x0a');async function installScanners(){const _0x5a2f1e=a0_0x389d31;await a0_0x47a92e['promises'][_0x5a2f1e(0xee)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x5a2f1e(0xe3)](_0x5a2f1e(0x10d)),console[_0x5a2f1e(0xe3)](_0x5a2f1e(0xcd)),console[_0x5a2f1e(0xe3)](_0x5a2f1e(0xf0));}async function checkESLintSecurity(){const _0x377197=a0_0x389d31;console['log'](_0x377197(0xd4));try{await import(_0x377197(0xe7)),console[_0x377197(0xe3)]('\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a');}catch(_0x583f33){console[_0x377197(0xe3)](_0x377197(0xd9)),console[_0x377197(0xe3)](_0x377197(0xf5));}}async function installSemgrep(){const _0xf894f9=a0_0x389d31;console[_0xf894f9(0xe3)](_0xf894f9(0xf4));const _0x13e78e=process[_0xf894f9(0xd3)],_0x11e5b3=process['arch'];try{const _0x5563d8=await execAsync(_0xf894f9(0x10f),{'timeout':0x1388});console[_0xf894f9(0xe3)](_0xf894f9(0xdb)+_0x5563d8[_0xf894f9(0xff)]['trim']()),console[_0xf894f9(0xe3)](_0xf894f9(0xf1));return;}catch(_0x8ffd14){console[_0xf894f9(0xe3)]('\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...');}const _0x17cce5=getSemgrepBinaryInfo(_0x13e78e,_0x11e5b3);if(!_0x17cce5){console[_0xf894f9(0xe3)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x13e78e+'-'+_0x11e5b3),console[_0xf894f9(0xe3)](_0xf894f9(0xd5));return;}try{const _0x1c6563=a0_0x56ef16['join'](SCANNER_DIR,'semgrep');console[_0xf894f9(0xe3)]('\x20\x20\x20Downloading\x20from\x20'+_0x17cce5[_0xf894f9(0xfc)]+_0xf894f9(0x111)),await downloadFile(_0x17cce5['url'],_0x1c6563),await a0_0x47a92e[_0xf894f9(0x110)]['chmod'](_0x1c6563,0x1ed),console['log']('\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully'),console['log']('\x20\x20\x20Location:\x20'+_0x1c6563+'\x0a'),console[_0xf894f9(0xe3)](_0xf894f9(0xe2)),console['log'](_0xf894f9(0xd8));}catch(_0x2e6d54){console['log'](_0xf894f9(0x107)+_0x2e6d54[_0xf894f9(0x10e)]),console['log']('\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a');}}function getSemgrepBinaryInfo(_0x512186,_0x5e6243){return null;}async function installPythonScanners(){const _0x3dc3b2=a0_0x389d31;console['log'](_0x3dc3b2(0xec));let _0x29aa6c=null;try{await execAsync(_0x3dc3b2(0x114),{'timeout':0x1388}),_0x29aa6c=_0x3dc3b2(0x108);}catch(_0x1df1c8){try{await execAsync(_0x3dc3b2(0xe4),{'timeout':0x1388}),_0x29aa6c=_0x3dc3b2(0x10a);}catch(_0x19bb23){console[_0x3dc3b2(0xe3)](_0x3dc3b2(0xf9)),console['log'](_0x3dc3b2(0xca)),console[_0x3dc3b2(0xe3)](_0x3dc3b2(0xf6));return;}}console[_0x3dc3b2(0xe3)](_0x3dc3b2(0xd2)+_0x29aa6c),await installViaPip(_0x3dc3b2(0xfe),_0x29aa6c),await installViaPip(_0x3dc3b2(0xe1),_0x29aa6c),await installViaPip(_0x3dc3b2(0xd7),_0x29aa6c),await installViaPip(_0x3dc3b2(0x109),_0x29aa6c),await installViaPip(_0x3dc3b2(0x102),_0x29aa6c),console['log']('');}function a0_0x3feb(){const _0x3d98c9=['pip-audit','\x20\x20\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found','❌\x20Installation\x20failed:','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','pipe','48249yqGYfJ','finish','\x20installed\x20successfully','error','bandit','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:','log','python\x20--version','357225hIZRpm','\x20-m\x20pip\x20show\x20','eslint-plugin-security','\x20already\x20installed','2227076MXILbf','68Kmdojt','\x20\x20Installing\x20Security\x20Scanners','🐍\x20Checking\x20Python\x20scanners...','7262WJpdrq','mkdir','3699715yEfFXh','═══════════════════════════════════════════════════════════\x0a','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','close','Failed\x20to\x20download:\x20HTTP\x20','🔍\x20Installing\x20Semgrep...','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a','catch','699860bHfukW','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','41028CsTEsr','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','url','70HKxvNL','semgrep','stdout','join','headers','yamllint','location','3pLileH','\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','python3','checkov','python','https','\x20-m\x20pip\x20install\x20--user\x20','\x0a═══════════════════════════════════════════════════════════','message','semgrep\x20--version','promises','...','5902Ddsdjz','startsWith','python3\x20--version','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','statusCode','\x20\x20\x20✅\x20','\x20\x20Installation\x20Complete','.scanners','dirname','6yWkVeS','node_modules','\x20\x20\x20✅\x20Python\x20found:\x20','platform','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','1048qXEIPZ'];a0_0x3feb=function(){return _0x3d98c9;};return a0_0x3feb();}async function installViaPip(_0xb34f4e,_0x341442){const _0x44707c=a0_0x389d31;try{const _0x906571=await execAsync(_0x341442+_0x44707c(0xe6)+_0xb34f4e,{'timeout':0x1388});return console[_0x44707c(0xe3)](_0x44707c(0xcc)+_0xb34f4e+_0x44707c(0xe8)),!![];}catch(_0xad7e26){console['log']('\x20\x20\x20Installing\x20'+_0xb34f4e+_0x44707c(0x111));try{return await execAsync(_0x341442+_0x44707c(0x10c)+_0xb34f4e,{'timeout':0xea60}),console[_0x44707c(0xe3)]('\x20\x20\x20✅\x20'+_0xb34f4e+_0x44707c(0xdf)),!![];}catch(_0x5c6772){return console[_0x44707c(0xe3)](_0x44707c(0xc9)+_0xb34f4e+':\x20'+_0x5c6772[_0x44707c(0x10e)]),console[_0x44707c(0xe3)](_0x44707c(0x106)+_0xb34f4e),![];}}}async function downloadFile(_0x37601e,_0x233e65){return new Promise((_0x10ffbc,_0x4b4431)=>{const _0x2e2e2a=a0_0x184e,_0x1c709f=_0x37601e[_0x2e2e2a(0x113)](_0x2e2e2a(0x10b))?a0_0x5b54b4:a0_0x4f2fe3;_0x1c709f['get'](_0x37601e,_0x2c8ebb=>{const _0x3e51b2=_0x2e2e2a;if(_0x2c8ebb[_0x3e51b2(0xcb)]===0x12e||_0x2c8ebb[_0x3e51b2(0xcb)]===0x12d){downloadFile(_0x2c8ebb[_0x3e51b2(0x101)][_0x3e51b2(0x103)],_0x233e65)['then'](_0x10ffbc)[_0x3e51b2(0xf7)](_0x4b4431);return;}if(_0x2c8ebb[_0x3e51b2(0xcb)]!==0xc8){_0x4b4431(new Error(_0x3e51b2(0xf3)+_0x2c8ebb['statusCode']));return;}const _0x3a4fb5=createWriteStream(_0x233e65);_0x2c8ebb[_0x3e51b2(0xdc)](_0x3a4fb5),_0x3a4fb5['on'](_0x3e51b2(0xde),()=>{const _0x5513bb=_0x3e51b2;_0x3a4fb5[_0x5513bb(0xf2)](),_0x10ffbc();}),_0x3a4fb5['on']('error',_0xeaaabf=>{a0_0x47a92e['unlink'](_0x233e65,()=>{}),_0x4b4431(_0xeaaabf);});})['on'](_0x2e2e2a(0xe0),_0x4b4431);});}installScanners()[a0_0x389d31(0xf7)](_0x44552f=>{const _0x2e4339=a0_0x389d31;console[_0x2e4339(0xe0)](_0x2e4339(0xda),_0x44552f[_0x2e4339(0x10e)]),console['error']('\x0aYou\x20can\x20manually\x20install\x20scanners:'),console[_0x2e4339(0xe0)](_0x2e4339(0xfb)),console[_0x2e4339(0xe0)](_0x2e4339(0x105)),process['exit'](0x0);});
@@ -1 +1 @@
1
- const a0_0x372e71=a0_0x10c3;(function(_0x135c27,_0x47d7a7){const _0x5c013d=a0_0x10c3,_0x36c13f=_0x135c27();while(!![]){try{const _0x539c0f=-parseInt(_0x5c013d(0x19e))/0x1*(-parseInt(_0x5c013d(0x195))/0x2)+parseInt(_0x5c013d(0x19a))/0x3+-parseInt(_0x5c013d(0x1b4))/0x4+-parseInt(_0x5c013d(0x1b3))/0x5+-parseInt(_0x5c013d(0x1be))/0x6*(parseInt(_0x5c013d(0x17d))/0x7)+parseInt(_0x5c013d(0x1bd))/0x8*(-parseInt(_0x5c013d(0x187))/0x9)+-parseInt(_0x5c013d(0x182))/0xa*(-parseInt(_0x5c013d(0x1a0))/0xb);if(_0x539c0f===_0x47d7a7)break;else _0x36c13f['push'](_0x36c13f['shift']());}catch(_0x4da37c){_0x36c13f['push'](_0x36c13f['shift']());}}}(a0_0x5829,0xcbd12));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x5829(){const _0x9d610f=['ndi4nZbdt1Hbsw0','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','uevsrK9stufoq0u','Dgv4Da','zgvIDwC','otqXnhP1EfrhEq','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','D2fYBG','zgvMyxvSDa','D2HPBgu','Cg9ZDgnZCY1Zy3nZ','y29SDw1U','zw5KC1DPDgG','lMnZCW','Cg9ZDgnZCY1SzxnZ','zgv0zwn0tgfUz3vHz2u','y3nZ','ChvZAa','y2HLy2TtEw50yxG','neP0uejXvG','lMXLC3m','zwfJAa','q1ntigfUywX5C2LZigzHAwXLza','Aw5JBhvKzxm','ntaXodG1rhb6r1jf','v0fstKLorW','u1Lovefy','qKvtvf9quKfdveLdrq','mtGYnZC1zKXhAgfS','BgLUzq','nJG2nhnRrxPVBW','rvjst1i','Bg9Nz2vY','CgX1z2LU','Dw5RBM93BG','BgvUz3rO','y29UDgvUDa','CMvHC29U','BM8Tzw1WDhK','u0vwrvjjvfK','BwL4Aw4','CMvZDwX0CW','zM9YD2fYza','q0furuDpuLK','zg91yMXL','Cg9ZDgnZCW','DxnL','CMv0DxjU','BwvZC2fNzq','mta4otu0mfjWz2D5sq','ndiZmZe1nLDwyw9ZzG','C2v2zxjPDhK','Cg9ZDgnZC0XLC3m','CM9VDa','yMvZDc1WCMfJDgLJzq','lNnHC3m','zxH0zw5K','BgvZCW','C3LUDgf4','odmYogTgAu5Yyq','ndHrA0vmC2i','zMLSDgvY','C2nZCW','zxjYB3i','ChjVy2vZCW','Cg9ZDgnZC1nJC3m','zM9YBwf0ug9ZDentu0vYCM9Y','nZaXnezJAxPjDq','Dg9mB3DLCKnHC2u','BM8TDw5RBM93BG','BgLUDfn0EwXLCW','C3r5BgvSAw50'];a0_0x5829=function(){return _0x9d610f;};return a0_0x5829();}function a0_0x10c3(_0x5b7555,_0x54354e){_0x5b7555=_0x5b7555-0x17c;const _0x5829bb=a0_0x5829();let _0x10c34a=_0x5829bb[_0x5b7555];if(a0_0x10c3['UGBwVj']===undefined){var _0x296a01=function(_0x317a03){const _0x54f522='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x7e5b24='',_0x5cf612='';for(let _0x1b2b8b=0x0,_0x3bb191,_0x1b9fb1,_0x1668ea=0x0;_0x1b9fb1=_0x317a03['charAt'](_0x1668ea++);~_0x1b9fb1&&(_0x3bb191=_0x1b2b8b%0x4?_0x3bb191*0x40+_0x1b9fb1:_0x1b9fb1,_0x1b2b8b++%0x4)?_0x7e5b24+=String['fromCharCode'](0xff&_0x3bb191>>(-0x2*_0x1b2b8b&0x6)):0x0){_0x1b9fb1=_0x54f522['indexOf'](_0x1b9fb1);}for(let _0x2898b3=0x0,_0x25231b=_0x7e5b24['length'];_0x2898b3<_0x25231b;_0x2898b3++){_0x5cf612+='%'+('00'+_0x7e5b24['charCodeAt'](_0x2898b3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5cf612);};a0_0x10c3['lgCIIA']=_0x296a01,a0_0x10c3['meiCQI']={},a0_0x10c3['UGBwVj']=!![];}const _0x132688=_0x5829bb[0x0],_0x2e8cb9=_0x5b7555+_0x132688,_0x748a88=a0_0x10c3['meiCQI'][_0x2e8cb9];return!_0x748a88?(_0x10c34a=a0_0x10c3['lgCIIA'](_0x10c34a),a0_0x10c3['meiCQI'][_0x2e8cb9]=_0x10c34a):_0x10c34a=_0x748a88,_0x10c34a;}class CSSAnalyzer{constructor(_0x7e5b24=null){const _0x925114=a0_0x10c3;this[_0x925114(0x1a2)]=_0x7e5b24,this['stylelint']=null,this[_0x925114(0x1af)]=null,this[_0x925114(0x1c3)]=null,this[_0x925114(0x1b6)]=null;}async['analyze'](_0x5cf612,_0x1b2b8b,_0x3bb191={}){const _0x5ef623=a0_0x10c3;try{const _0x1b9fb1=[],_0x1668ea=this['detectLanguage'](_0x5cf612),_0x2898b3=await this['checkSyntax'](_0x5cf612,_0x1b2b8b,_0x1668ea);_0x1b9fb1[_0x5ef623(0x193)](..._0x2898b3);if(_0x2898b3['length']===0x0){const _0x25231b=await this[_0x5ef623(0x180)](_0x5cf612,_0x1b2b8b,_0x1668ea);_0x1b9fb1[_0x5ef623(0x193)](..._0x25231b);}return this[_0x5ef623(0x1a2)]?.[_0x5ef623(0x186)]('CSS\x20analysis\x20completed',{'file':_0x5cf612,'language':_0x1668ea,'totalDiagnostics':_0x1b9fb1[_0x5ef623(0x1a5)],'errors':_0x1b9fb1['filter'](_0x4eee75=>_0x4eee75['severity']===STATIC_ANALYSIS[_0x5ef623(0x1a9)][_0x5ef623(0x1a1)])[_0x5ef623(0x1a5)],'warnings':_0x1b9fb1[_0x5ef623(0x1bf)](_0x5eda4e=>_0x5eda4e['severity']===STATIC_ANALYSIS['SEVERITY']['WARNING'])['length']}),_0x1b9fb1;}catch(_0x2fa825){return this[_0x5ef623(0x1a2)]?.[_0x5ef623(0x1c1)](_0x5ef623(0x198),{'file':_0x5cf612,'error':_0x2fa825['message']}),[];}}async[a0_0x372e71(0x194)](_0x471cf6,_0x3e8e8a,_0xe6fff5){const _0x36c670=a0_0x372e71,_0x4e6ef3=[];try{if(!this['postcss']){const _0x4b0984=await import('postcss');this['postcss']=_0x4b0984['default'];}let _0x33f61c=null;if(_0xe6fff5===_0x36c670(0x1c0)){if(!this['postcssScss']){const _0x2f115b=await import(_0x36c670(0x18c));this[_0x36c670(0x1c3)]=_0x2f115b['default'];}_0x33f61c=this[_0x36c670(0x1c3)];}else{if(_0xe6fff5===_0x36c670(0x1bb)){if(!this[_0x36c670(0x1b6)]){const _0xf1350c=await import(_0x36c670(0x190));this['postcssLess']=_0xf1350c[_0x36c670(0x18a)];}_0x33f61c=this['postcssLess'];}}const _0x1ace8b=this['postcss']()[_0x36c670(0x1c2)](_0x3e8e8a,{'from':_0x471cf6,'syntax':_0x33f61c}),_0xa29d4d=_0x1ace8b[_0x36c670(0x1b7)];this['logger']?.['debug'](_0x36c670(0x183),{'file':_0x471cf6});}catch(_0x5903dc){const _0x4f0154=this[_0x36c670(0x17c)](_0x5903dc,_0x471cf6);_0x4f0154&&_0x4e6ef3['push'](_0x4f0154);}return _0x4e6ef3;}async['lintStyles'](_0x1c25e2,_0x48aa0e,_0x110113){const _0x359f17=a0_0x372e71,_0x60dbf3=[];try{if(!this[_0x359f17(0x181)]){const _0x243491=await import('stylelint');this['stylelint']=_0x243491['default'];}const _0x31b8e0={'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':_0x110113==='scss'?[!![],{'ignoreAtRules':[_0x359f17(0x1aa),'include',_0x359f17(0x1ba),'if','else','for',_0x359f17(0x197),_0x359f17(0x18b),'function',_0x359f17(0x1b1),_0x359f17(0x1a6),_0x359f17(0x1b0),_0x359f17(0x1ac)]}]:_0x110113==='less'?[!![],{'ignoreAtRules':[_0x359f17(0x1a3)]}]:!![],'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':_0x359f17(0x1ae),'selector-type-case':'lower'},'customSyntax':_0x110113==='scss'?'postcss-scss':_0x110113===_0x359f17(0x1bb)?_0x359f17(0x190):undefined},_0x431717=await this[_0x359f17(0x181)]['lint']({'code':_0x48aa0e,'codeFilename':_0x1c25e2,'config':_0x31b8e0});if(_0x431717['results']&&_0x431717[_0x359f17(0x1ab)]['length']>0x0){const _0x4bee90=_0x431717[_0x359f17(0x1ab)][0x0];if(_0x4bee90['warnings'])for(const _0x54231f of _0x4bee90['warnings']){_0x60dbf3[_0x359f17(0x193)]({'file':_0x1c25e2,'line':_0x54231f['line']||0x1,'column':_0x54231f[_0x359f17(0x18d)]||0x1,'severity':_0x54231f[_0x359f17(0x1b5)]==='error'?STATIC_ANALYSIS['SEVERITY']['ERROR']:STATIC_ANALYSIS['SEVERITY'][_0x359f17(0x19b)],'rule':_0x54231f['rule']||_0x359f17(0x1a4),'message':_0x54231f[_0x359f17(0x185)],'category':this['categorizeStylelintRule'](_0x54231f['rule']),'fixable':![],'source':_0x359f17(0x181)});}}}catch(_0x53e61f){this['logger']?.[_0x359f17(0x189)]('Stylelint\x20analysis\x20failed',{'file':_0x1c25e2,'error':_0x53e61f[_0x359f17(0x1b2)]});}return _0x60dbf3;}[a0_0x372e71(0x17c)](_0x2eb0f1,_0x3a6155){const _0x31896e=a0_0x372e71;return{'file':_0x3a6155,'line':_0x2eb0f1[_0x31896e(0x19f)]||0x1,'column':_0x2eb0f1['column']||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x31896e(0x1a1)],'rule':_0x2eb0f1['name']||'CssSyntaxError','message':_0x2eb0f1[_0x31896e(0x1a7)]||_0x2eb0f1[_0x31896e(0x1b2)],'category':STATIC_ANALYSIS[_0x31896e(0x1ad)][_0x31896e(0x19c)],'fixable':![],'source':_0x31896e(0x1af),'code':_0x2eb0f1['source']||undefined};}['categorizeStylelintRule'](_0x27d657){const _0x3aab3a=a0_0x372e71;if(!_0x27d657)return STATIC_ANALYSIS['CATEGORY']['STYLE'];const _0x19646c=_0x27d657[_0x3aab3a(0x17e)]();if(_0x19646c['includes']('no-invalid')||_0x19646c['includes'](_0x3aab3a(0x17f))||_0x19646c['includes'](_0x3aab3a(0x1a8))||_0x19646c['includes'](_0x3aab3a(0x1bc)))return STATIC_ANALYSIS[_0x3aab3a(0x1ad)][_0x3aab3a(0x19c)];if(_0x19646c['includes']('performance')||_0x19646c[_0x3aab3a(0x199)]('optimize'))return STATIC_ANALYSIS[_0x3aab3a(0x1ad)][_0x3aab3a(0x184)];if(_0x19646c['includes'](_0x3aab3a(0x1b8))||_0x19646c['includes']('recommended'))return STATIC_ANALYSIS['CATEGORY'][_0x3aab3a(0x19d)];return STATIC_ANALYSIS[_0x3aab3a(0x1ad)]['STYLE'];}[a0_0x372e71(0x191)](_0x500286){const _0x2e7934=a0_0x372e71,_0x5b29f6=_0x500286['toLowerCase']();if(_0x5b29f6[_0x2e7934(0x18e)]('.scss')||_0x5b29f6['endsWith'](_0x2e7934(0x1b9)))return'scss';if(_0x5b29f6[_0x2e7934(0x18e)](_0x2e7934(0x196)))return'less';return _0x2e7934(0x192);}[a0_0x372e71(0x188)](){const _0xd45cee=a0_0x372e71;return[_0xd45cee(0x18f),'.scss',_0xd45cee(0x1b9),_0xd45cee(0x196)];}['supportsAutoFix'](){return![];}}export default CSSAnalyzer;
1
+ const a0_0x135ca4=a0_0x4484;(function(_0x5979dd,_0x4bf512){const _0x5e1f64=a0_0x4484,_0x621a33=_0x5979dd();while(!![]){try{const _0x5a9e92=-parseInt(_0x5e1f64(0x105))/0x1+-parseInt(_0x5e1f64(0x12d))/0x2*(parseInt(_0x5e1f64(0x12b))/0x3)+-parseInt(_0x5e1f64(0x123))/0x4*(-parseInt(_0x5e1f64(0x117))/0x5)+parseInt(_0x5e1f64(0x10d))/0x6+parseInt(_0x5e1f64(0x13c))/0x7+-parseInt(_0x5e1f64(0x10e))/0x8*(-parseInt(_0x5e1f64(0xfd))/0x9)+parseInt(_0x5e1f64(0x10f))/0xa;if(_0x5a9e92===_0x4bf512)break;else _0x621a33['push'](_0x621a33['shift']());}catch(_0x1981bc){_0x621a33['push'](_0x621a33['shift']());}}}(a0_0x512e,0xcc66e));function a0_0x4484(_0x562967,_0xb92561){_0x562967=_0x562967-0xfd;const _0x512eaf=a0_0x512e();let _0x4484f6=_0x512eaf[_0x562967];if(a0_0x4484['bBoDFy']===undefined){var _0x269231=function(_0x5da136){const _0x266df9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3cc5f7='',_0x2fcdb8='';for(let _0x57a87d=0x0,_0x2c5dc5,_0x2cb8af,_0xc825a1=0x0;_0x2cb8af=_0x5da136['charAt'](_0xc825a1++);~_0x2cb8af&&(_0x2c5dc5=_0x57a87d%0x4?_0x2c5dc5*0x40+_0x2cb8af:_0x2cb8af,_0x57a87d++%0x4)?_0x3cc5f7+=String['fromCharCode'](0xff&_0x2c5dc5>>(-0x2*_0x57a87d&0x6)):0x0){_0x2cb8af=_0x266df9['indexOf'](_0x2cb8af);}for(let _0xedcd67=0x0,_0x6bcf13=_0x3cc5f7['length'];_0xedcd67<_0x6bcf13;_0xedcd67++){_0x2fcdb8+='%'+('00'+_0x3cc5f7['charCodeAt'](_0xedcd67)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2fcdb8);};a0_0x4484['uBFlMT']=_0x269231,a0_0x4484['YAPOEx']={},a0_0x4484['bBoDFy']=!![];}const _0x3c02b0=_0x512eaf[0x0],_0x970fc5=_0x562967+_0x3c02b0,_0x2fbdbd=a0_0x4484['YAPOEx'][_0x970fc5];return!_0x2fbdbd?(_0x4484f6=a0_0x4484['uBFlMT'](_0x4484f6),a0_0x4484['YAPOEx'][_0x970fc5]=_0x4484f6):_0x4484f6=_0x2fbdbd,_0x4484f6;}import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x512e(){const _0x1fda9e=['CgvYzM9YBwfUy2u','zgv0zwn0tgfUz3vHz2u','lNnJC3m','Cg9ZDgnZCW','y29SDw1U','zM9YBwf0ug9ZDentu0vYCM9Y','Cg9ZDgnZC1nJC3m','ug9ZDentuYbZEw50yxGGy2HLy2SGCgfZC2vK','neDivuvszW','C3LUDgf4','ChvZAa','BwvZC2fNzq','BM8TAw52ywXPza','Cg9ZDgnZC0XLC3m','y3nZ','CgX1z2LU','mtmYmfzcuxrssW','zgvMyxvSDa','mtKYtgXfwfPT','ChjVy2vZCW','zNvUy3rPB24','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','zMLSDgvY','zxjYB3i','BgvZCW','u1Lovefy','Cg9ZDgnZCY1Zy3nZ','qKvtvf9quKfdveLdrq','BwL4Aw4','zgvIDwC','BgLUDa','DxnL','lMnZCW','ntC3oteZmgz6uenkra','Cg9ZDgnZCY1SzxnZ','C2nZCW','mZCWndq5Eg9cq1vX','Aw5JBhvKzxm','y29UDgvUDa','lMXLC3m','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','Bg9Nz2vY','BM8TDw5RBM93BG','BgLUDfn0EwXLCW','mtu3oty1nwXbCfjszW','CMvHC29U','q1ntigfUywX5C2LZigzHAwXLza','zw5KC1DPDgG','CMvJB21Tzw5Kzwq','BMCTzgvLCa','CMvZDwX0CW','CM9VDa','mtG5ndG3mKLnuMjPCa','mJa4yMTSugjg','mJqWnZq3mhHYwMHQqq','BMfTzq','y2HLy2TtEw50yxG','C3vWCg9YDhnbDxrVrML4','lNnHC3m','BgvUz3rO','C3r5BgvSAw50','u0vwrvjjvfK','mZm5ntbltgDQwfu','yw5HBhL6zq','uevsrK9stufoq0u','q0furuDpuLK'];a0_0x512e=function(){return _0x1fda9e;};return a0_0x512e();}class CSSAnalyzer{constructor(_0x3cc5f7=null){const _0x3a469c=a0_0x4484;this['logger']=_0x3cc5f7,this[_0x3a469c(0x115)]=null,this[_0x3a469c(0x11e)]=null,this[_0x3a469c(0x121)]=null,this['postcssLess']=null;}async[a0_0x135ca4(0x118)](_0x2fcdb8,_0x57a87d,_0x2c5dc5={}){const _0x3d12cd=a0_0x135ca4;try{const _0x2cb8af=[],_0xc825a1=this[_0x3d12cd(0x11c)](_0x2fcdb8),_0xedcd67=await this[_0x3d12cd(0x111)](_0x2fcdb8,_0x57a87d,_0xc825a1);_0x2cb8af[_0x3d12cd(0x125)](..._0xedcd67);if(_0xedcd67[_0x3d12cd(0x114)]===0x0){const _0x6bcf13=await this['lintStyles'](_0x2fcdb8,_0x57a87d,_0xc825a1);_0x2cb8af[_0x3d12cd(0x125)](..._0x6bcf13);}return this[_0x3d12cd(0x102)]?.['debug']('CSS\x20analysis\x20completed',{'file':_0x2fcdb8,'language':_0xc825a1,'totalDiagnostics':_0x2cb8af['length'],'errors':_0x2cb8af['filter'](_0x35639b=>_0x35639b['severity']===STATIC_ANALYSIS[_0x3d12cd(0x116)]['ERROR'])['length'],'warnings':_0x2cb8af[_0x3d12cd(0x131)](_0x2affcb=>_0x2affcb['severity']===STATIC_ANALYSIS['SEVERITY']['WARNING'])['length']}),_0x2cb8af;}catch(_0x426a51){return this[_0x3d12cd(0x102)]?.[_0x3d12cd(0x132)](_0x3d12cd(0x107),{'file':_0x2fcdb8,'error':_0x426a51[_0x3d12cd(0x126)]}),[];}}async[a0_0x135ca4(0x111)](_0x28530a,_0xbc5cb4,_0x3a2224){const _0x32e331=a0_0x135ca4,_0xb37413=[];try{if(!this['postcss']){const _0x3ab67a=await import(_0x32e331(0x11e));this[_0x32e331(0x11e)]=_0x3ab67a[_0x32e331(0x12c)];}let _0x163864=null;if(_0x3a2224==='scss'){if(!this['postcssScss']){const _0x5d33bb=await import(_0x32e331(0x135));this[_0x32e331(0x121)]=_0x5d33bb[_0x32e331(0x12c)];}_0x163864=this['postcssScss'];}else{if(_0x3a2224===_0x32e331(0x133)){if(!this['postcssLess']){const _0x4c8b39=await import(_0x32e331(0x13d));this['postcssLess']=_0x4c8b39[_0x32e331(0x12c)];}_0x163864=this[_0x32e331(0x128)];}}const _0x3d47da=this['postcss']()[_0x32e331(0x12e)](_0xbc5cb4,{'from':_0x28530a,'syntax':_0x163864}),_0xb72381=_0x3d47da[_0x32e331(0x10c)];this['logger']?.[_0x32e331(0x138)](_0x32e331(0x122),{'file':_0x28530a});}catch(_0x503e1f){const _0x12b920=this[_0x32e331(0x120)](_0x503e1f,_0x28530a);_0x12b920&&_0xb37413['push'](_0x12b920);}return _0xb37413;}async[a0_0x135ca4(0x104)](_0x8bde9d,_0x20c02c,_0x55ce38){const _0x55b839=a0_0x135ca4,_0x314a72=[];try{if(!this['stylelint']){const _0x2e7561=await import('stylelint');this[_0x55b839(0x115)]=_0x2e7561[_0x55b839(0x12c)];}const _0x47d1b1={'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-/',_0x55b839(0x10a)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0x55ce38===_0x55b839(0x13e)?[!![],{'ignoreAtRules':[_0x55b839(0x137),'include','extend','if','else','for','each','while',_0x55b839(0x12f),'return',_0x55b839(0xff),_0x55b839(0x13a),'forward']}]:_0x55ce38===_0x55b839(0x133)?[!![],{'ignoreAtRules':[_0x55b839(0x12a)]}]:!![],'comment-no-empty':!![],'no-duplicate-selectors':!![],'no-empty-source':null,'block-no-empty':!![],'declaration-block-no-shorthand-property-overrides':!![],'font-family-no-missing-generic-family-keyword':!![],'function-linear-gradient-no-nonstandard-direction':!![],'no-descending-specificity':null,'no-duplicate-at-import-rules':!![],'no-extra-semicolons':!![],'no-invalid-double-slash-comments':!![],'selector-pseudo-element-colon-notation':'double','selector-type-case':'lower'},'customSyntax':_0x55ce38===_0x55b839(0x13e)?_0x55b839(0x135):_0x55ce38===_0x55b839(0x133)?_0x55b839(0x13d):undefined},_0x420841=await this[_0x55b839(0x115)][_0x55b839(0x139)]({'code':_0x20c02c,'codeFilename':_0x8bde9d,'config':_0x47d1b1});if(_0x420841['results']&&_0x420841[_0x55b839(0x10b)]['length']>0x0){const _0xa5803=_0x420841[_0x55b839(0x10b)][0x0];if(_0xa5803['warnings'])for(const _0x2a97af of _0xa5803['warnings']){_0x314a72[_0x55b839(0x125)]({'file':_0x8bde9d,'line':_0x2a97af['line']||0x1,'column':_0x2a97af[_0x55b839(0x11f)]||0x1,'severity':_0x2a97af['severity']==='error'?STATIC_ANALYSIS[_0x55b839(0x116)]['ERROR']:STATIC_ANALYSIS[_0x55b839(0x116)]['WARNING'],'rule':_0x2a97af['rule']||'unknown','message':_0x2a97af['text'],'category':this['categorizeStylelintRule'](_0x2a97af['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x5f3373){this[_0x55b839(0x102)]?.['warn'](_0x55b839(0x101),{'file':_0x8bde9d,'error':_0x5f3373['message']});}return _0x314a72;}['formatPostCSSError'](_0x7fb618,_0x59f01a){const _0x33f121=a0_0x135ca4;return{'file':_0x59f01a,'line':_0x7fb618['line']||0x1,'column':_0x7fb618[_0x33f121(0x11f)]||0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x7fb618[_0x33f121(0x110)]||'CssSyntaxError','message':_0x7fb618[_0x33f121(0x106)]||_0x7fb618[_0x33f121(0x126)],'category':STATIC_ANALYSIS[_0x33f121(0x11a)][_0x33f121(0x134)],'fixable':![],'source':_0x33f121(0x11e),'code':_0x7fb618['source']||undefined};}[a0_0x135ca4(0x130)](_0x57decb){const _0x310e5c=a0_0x135ca4;if(!_0x57decb)return STATIC_ANALYSIS[_0x310e5c(0x11a)]['STYLE'];const _0x251818=_0x57decb['toLowerCase']();if(_0x251818['includes'](_0x310e5c(0x127))||_0x251818['includes'](_0x310e5c(0x103))||_0x251818['includes']('no-empty')||_0x251818['includes'](_0x310e5c(0x124)))return STATIC_ANALYSIS['CATEGORY']['SYNTAX'];if(_0x251818[_0x310e5c(0xfe)](_0x310e5c(0x11b))||_0x251818['includes']('optimize'))return STATIC_ANALYSIS[_0x310e5c(0x11a)][_0x310e5c(0x119)];if(_0x251818['includes']('best-practice')||_0x251818[_0x310e5c(0xfe)](_0x310e5c(0x109)))return STATIC_ANALYSIS[_0x310e5c(0x11a)][_0x310e5c(0x136)];return STATIC_ANALYSIS[_0x310e5c(0x11a)]['STYLE'];}['detectLanguage'](_0x55cffc){const _0x3fd48d=a0_0x135ca4,_0x501e25=_0x55cffc['toLowerCase']();if(_0x501e25[_0x3fd48d(0x108)](_0x3fd48d(0x11d))||_0x501e25['endsWith'](_0x3fd48d(0x113)))return _0x3fd48d(0x13e);if(_0x501e25['endsWith']('.less'))return _0x3fd48d(0x133);return _0x3fd48d(0x129);}['getSupportedExtensions'](){const _0x59bf48=a0_0x135ca4;return[_0x59bf48(0x13b),'.scss','.sass',_0x59bf48(0x100)];}[a0_0x135ca4(0x112)](){return![];}}export default CSSAnalyzer;
@@ -1 +1 @@
1
- const a0_0x2f7acc=a0_0x3537;function a0_0x3537(_0x203a3e,_0x9b3e6b){_0x203a3e=_0x203a3e-0x146;const _0x2bcdea=a0_0x2bcd();let _0x353793=_0x2bcdea[_0x203a3e];if(a0_0x3537['oBOlZT']===undefined){var _0x8a027e=function(_0x400481){const _0x3afaaa='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x183772='',_0x4ba8d4='';for(let _0x48befb=0x0,_0x512c5c,_0x2cedc1,_0x430322=0x0;_0x2cedc1=_0x400481['charAt'](_0x430322++);~_0x2cedc1&&(_0x512c5c=_0x48befb%0x4?_0x512c5c*0x40+_0x2cedc1:_0x2cedc1,_0x48befb++%0x4)?_0x183772+=String['fromCharCode'](0xff&_0x512c5c>>(-0x2*_0x48befb&0x6)):0x0){_0x2cedc1=_0x3afaaa['indexOf'](_0x2cedc1);}for(let _0x32c212=0x0,_0x5bac29=_0x183772['length'];_0x32c212<_0x5bac29;_0x32c212++){_0x4ba8d4+='%'+('00'+_0x183772['charCodeAt'](_0x32c212)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4ba8d4);};a0_0x3537['InXSGe']=_0x8a027e,a0_0x3537['RabcZE']={},a0_0x3537['oBOlZT']=!![];}const _0x5495be=_0x2bcdea[0x0],_0x5bbe14=_0x203a3e+_0x5495be,_0x5c1a9d=a0_0x3537['RabcZE'][_0x5bbe14];return!_0x5c1a9d?(_0x353793=a0_0x3537['InXSGe'](_0x353793),a0_0x3537['RabcZE'][_0x5bbe14]=_0x353793):_0x353793=_0x5c1a9d,_0x353793;}(function(_0x5ab226,_0x264364){const _0xd816e9=a0_0x3537,_0x188347=_0x5ab226();while(!![]){try{const _0x4a3554=parseInt(_0xd816e9(0x1b7))/0x1+parseInt(_0xd816e9(0x188))/0x2*(-parseInt(_0xd816e9(0x150))/0x3)+-parseInt(_0xd816e9(0x1b6))/0x4*(-parseInt(_0xd816e9(0x1ba))/0x5)+parseInt(_0xd816e9(0x1c2))/0x6*(parseInt(_0xd816e9(0x151))/0x7)+parseInt(_0xd816e9(0x17e))/0x8*(-parseInt(_0xd816e9(0x198))/0x9)+-parseInt(_0xd816e9(0x1bb))/0xa*(parseInt(_0xd816e9(0x19d))/0xb)+-parseInt(_0xd816e9(0x186))/0xc*(-parseInt(_0xd816e9(0x169))/0xd);if(_0x4a3554===_0x264364)break;else _0x188347['push'](_0x188347['shift']());}catch(_0x4ef85e){_0x188347['push'](_0x188347['shift']());}}}(a0_0x2bcd,0x5113a));import{exec}from'child_process';import{promisify}from'util';import a0_0x183772 from'path';import a0_0x4ba8d4 from'fs/promises';function a0_0x2bcd(){const _0x30f3d4=['CNvSzq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','DgvYCMfMB3jT','y2HLy2TVDG','C3rHCNrZv2L0Aa','DMfSAwrHDgvzqu1m','lMDPDgH1yI93B3jRzMXVD3m','BwfWsgfKB2XPBNrtzxzLCML0Eq','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','AgfKB2XPBNq','C3rYAwn0lw1Vzgu','zw5KC1DPDgG','CgfJA2fNzs5QC29U','DMfSAwrHDgvxAxrOq2HLy2TVDG','zxH0BMfTzq','ywP2icHku09oifnJAgvTysK','Bwf0y2G','mJuXmJa0uhL6vhPS','ntG2nJiWq0Tis05z','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','sw52ywXPzcbku09ooIa','mJvwuMP0Cfq','ntG0nZu0mefnC3DOAW','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','igrLDgvJDgvKigLUic5LBNyGzMLSzq','z2L0AhvIlwfJDgLVBNm','BwfWwwfTBgXPBNrtzxzLCML0Eq','CMvHzezPBgu','ANnVBG','nJCYndHOveLmDhG','BM9YBwfSAxPLuMvZDwX0CW','AgfKB2XPBNqGls12zxjZAw9U','y29SDw1U','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','DMfSAwrHDgvqywnRywDLsNnVBG','y2HLy2TFBMfTzq','DMfSAwrHDgvfBNzgAwXL','DhjPBq','yxzHAwXHyMXLu2nHBM5LCNm','m1vpthHTyW','mta1s0ndvNLw','ywP2','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','ANnVBLnJAgvTyq','zM9YrwfJAa','ChvZAa','EwfTBgXPBNq','DhnJB25MAwCTDMfSAwrHDg9Y','qvbjigTLEq','AxnbCNjHEq','zMLSDgvY','CgfYyw1Z','zw52','Bg9Nz2vY','BwvKAxvT','rvjst1i','BwLZC2LUz1bYB3bLCNr5','C2vJCMv0','C2nHBM5LCKnHy2HL','y29TCgLSzq','zg9JA2vYx2nVBxbVC2u','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','C3LUDgf4','DhnJB25MAwCUANnVBIb2ywXPzgf0Aw9UigzHAwXLza','nJa5nZb3rxzdzgS','ANnVBI1WyxjZzq','lNLTBa','C3rKB3v0','DMfSAwrHDgvuC0nVBMzPzW','zMLSzv9SAw5Lx3jHBMDL','z3vPzgvSAw5L','DMfSAwrHDgLVBG','DMfSAwrHDgveB2nRzxjMAwXL','C3rYAw5N','zgvIDwC','z2v0vMfSAwrHDg9Yu3rHDhvZ','lMvUDG','CgLWigLUC3rHBgWGEwfTBgXPBNq','BwvZC2fNzq','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','AgfKB2XPBNqGBM90igf2ywLSywjSzq','Dg9mB3DLCKnHC2u','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','Bw9KDwXL','D2fYBG','mte0otC1mMLcEMryrG','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','B2jQzwn0','y29TCgLSzxjpChrPB25Z','BwfW','u0vwrvjjvfK','BNbTigLUC3rHBgWGywP2igfQDI1MB3jTyxrZ','zxjYB3jZ','mtiXmLPzzwjfwG','Aw5ZDgfUy2vqyxrO','nJC2mZa2EwjRy0rM','C3bSAxq','CgfYC2u','wufntcbMAwXLihzHBgLKyxrPB24','A3vIzxjUzxrLCW','y2f0zwDVCNK','BM8TAw1WBgLJAxqTyw55','EwfTBgXPBNqGls12zxjZAw9U','DMvYC2LVBG','BMfTzq','BwfWq2HLy2TVDLnLDMvYAxr5','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','zxjYB3i','lMPZB24','CMvZDwX0CW','v0fstKLorW','mtH5rfHMqvu','DhnJB25MAwCUANnVBG','zg9JA2vYlwnVBxbVC2u','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','CMvTzwrPyxrPB24','mtfYwvPIueG','Aw5JBhvKzxm','zgv0zwn0rMLSzvr5Cgu','zg9JA2vYzMLSzq','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','CgfYC2viywrVBgLUDfjLC3vSDhm','Dw5RBM93BG','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0'];a0_0x2bcd=function(){return _0x30f3d4;};return a0_0x2bcd();}import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x48befb=null){const _0xabc34e=a0_0x3537;this['logger']=_0x48befb,this['availableScanners']=null,this[_0xabc34e(0x163)]=new Map();}async['detectAvailableValidators'](){const _0x450355=a0_0x3537;if(this[_0x450355(0x14f)]!==null)return this['availableScanners'];const _0x512c5c={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x512c5c[_0x450355(0x1a8)]=!![],this['logger']?.['debug']('checkov\x20detected');}catch(_0x2cedc1){this['logger']?.['debug']('checkov\x20not\x20available',{'error':_0x2cedc1['message']});}try{await execAsync(_0x450355(0x147),{'timeout':0x1388}),_0x512c5c['hadolint']=!![],this[_0x450355(0x15e)]?.[_0x450355(0x173)]('hadolint\x20detected');}catch(_0x430322){this['logger']?.['debug'](_0x450355(0x179),{'error':_0x430322['message']});}try{await execAsync(_0x450355(0x18f),{'timeout':0x1388}),_0x512c5c['yamllint']=!![],this['logger']?.[_0x450355(0x173)]('yamllint\x20detected');}catch(_0x32c212){this[_0x450355(0x15e)]?.[_0x450355(0x173)]('yamllint\x20not\x20available',{'error':_0x32c212[_0x450355(0x177)]});}try{await import('ajv'),_0x512c5c[_0x450355(0x154)]=!![],this['logger']?.['debug'](_0x450355(0x1ad));}catch(_0x5bac29){this['logger']?.[_0x450355(0x173)]('ajv\x20not\x20available',{'error':_0x5bac29[_0x450355(0x177)]});}return this['availableScanners']=_0x512c5c,_0x512c5c;}async['validate'](_0xecb0f1,_0x265035={}){const _0x1d95f4=a0_0x3537,_0xfa994c=[],_0x10f2b2=await this[_0x1d95f4(0x166)](),_0x51d3dc=this[_0x1d95f4(0x19f)](_0xecb0f1);this[_0x1d95f4(0x15e)]?.['debug']('Validating\x20config\x20file',{'filePath':_0xecb0f1,'fileType':_0x51d3dc});switch(_0x51d3dc){case _0x1d95f4(0x1a0):if(_0x10f2b2[_0x1d95f4(0x1ae)]){const _0xada549=await this['validateDockerfile'](_0xecb0f1,_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0xada549);}if(_0x10f2b2[_0x1d95f4(0x1a8)]){const _0x392a44=await this['validateWithCheckov'](_0xecb0f1,'dockerfile',_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x392a44);}break;case _0x1d95f4(0x19a):if(_0x10f2b2['yamllint']){const _0x41ad07=await this[_0x1d95f4(0x1aa)](_0xecb0f1,_0x265035);_0xfa994c['push'](..._0x41ad07);}if(_0x10f2b2['checkov']){const _0x3f9275=await this[_0x1d95f4(0x1b2)](_0xecb0f1,_0x1d95f4(0x165),_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x3f9275);}break;case _0x1d95f4(0x18c):if(_0x10f2b2[_0x1d95f4(0x157)]){const _0x32de61=await this['validateYAML'](_0xecb0f1,_0x265035);_0xfa994c['push'](..._0x32de61);}if(_0x10f2b2[_0x1d95f4(0x1a8)]){const _0x35504b=await this[_0x1d95f4(0x1b2)](_0xecb0f1,_0x1d95f4(0x18c),_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x35504b);}break;case _0x1d95f4(0x1a7):if(_0x10f2b2[_0x1d95f4(0x1a8)]){const _0x41d984=await this['validateWithCheckov'](_0xecb0f1,'terraform',_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x41d984);}break;case'package.json':if(_0x10f2b2['jsonSchema']){const _0x85e53=await this[_0x1d95f4(0x14b)](_0xecb0f1,_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x85e53);}break;case'tsconfig.json':if(_0x10f2b2[_0x1d95f4(0x154)]){const _0x22e828=await this['validateTsConfig'](_0xecb0f1,_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x22e828);}break;case _0x1d95f4(0x1be):if(_0x10f2b2['yamllint']){const _0x257a44=await this[_0x1d95f4(0x1aa)](_0xecb0f1,_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0x257a44);}break;case _0x1d95f4(0x15d):const _0x5b3312=await this[_0x1d95f4(0x14d)](_0xecb0f1,_0x265035);_0xfa994c['push'](..._0x5b3312);break;case'yaml':if(_0x10f2b2['yamllint']){const _0xe0479f=await this['validateYAML'](_0xecb0f1,_0x265035);_0xfa994c[_0x1d95f4(0x156)](..._0xe0479f);}break;default:this[_0x1d95f4(0x15e)]?.[_0x1d95f4(0x17d)](_0x1d95f4(0x17f),{'filePath':_0xecb0f1,'fileType':_0x51d3dc});return[];}return this['normalizeResults'](_0xfa994c);}async[a0_0x2f7acc(0x171)](_0x562220,_0x4bb4b2={}){const _0x5efab9=a0_0x2f7acc;try{const _0x169a59=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x562220+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x2b3c28=JSON[_0x5efab9(0x18a)](_0x169a59[_0x5efab9(0x16c)]);return this[_0x5efab9(0x1a2)](_0x2b3c28,_0x562220);}catch(_0x250ba2){if(_0x250ba2[_0x5efab9(0x16c)])try{const _0x12a287=JSON[_0x5efab9(0x18a)](_0x250ba2[_0x5efab9(0x16c)]);return this[_0x5efab9(0x1a2)](_0x12a287,_0x562220);}catch(_0x290be7){this['logger']?.['error'](_0x5efab9(0x1bc),{'error':_0x290be7[_0x5efab9(0x177)]});}return this['logger']?.['error'](_0x5efab9(0x149),{'error':_0x250ba2['message']}),[];}}['parseHadolintResults'](_0x5cfdfd,_0x51c877){const _0x134de7=a0_0x2f7acc,_0x2600db=[];if(Array[_0x134de7(0x15a)](_0x5cfdfd))for(const _0x1ccd90 of _0x5cfdfd){_0x2600db['push']({'file':_0x51c877,'line':_0x1ccd90['line']||0x1,'column':_0x1ccd90[_0x134de7(0x148)]||0x1,'severity':this['mapHadolintSeverity'](_0x1ccd90['level']),'rule':_0x1ccd90['code'],'message':_0x1ccd90['message'],'category':_0x134de7(0x1a0),'validator':_0x134de7(0x1ae)});}return _0x2600db;}async[a0_0x2f7acc(0x1aa)](_0x1d09a5,_0x45955d={}){const _0x35c628=a0_0x2f7acc;try{const _0x342226=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x1d09a5+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x342226['stdout'],_0x1d09a5);}catch(_0x4c547a){if(_0x4c547a['stdout'])return this[_0x35c628(0x1a6)](_0x4c547a['stdout'],_0x1d09a5);return this['logger']?.[_0x35c628(0x194)]('yamllint\x20validation\x20failed',{'error':_0x4c547a['message']}),[];}}['parseYamllintResults'](_0x4b1133,_0x4c9a60){const _0x232ab5=a0_0x2f7acc,_0x3472c7=[],_0x18015c=_0x4b1133['split']('\x0a')[_0x232ab5(0x15b)](_0x4ef46b=>_0x4ef46b['trim']());for(const _0xd67d5b of _0x18015c){const _0x6d1bbc=_0xd67d5b[_0x232ab5(0x1b5)](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x6d1bbc){const [,_0x24d937,_0x13b00c,_0x3e695c,_0x2f1297,_0x25abb3,_0x3b1fc4]=_0x6d1bbc;_0x3472c7[_0x232ab5(0x156)]({'file':_0x4c9a60,'line':parseInt(_0x13b00c,0xa),'column':parseInt(_0x3e695c,0xa),'severity':this['mapYamllintSeverity'](_0x2f1297),'rule':_0x3b1fc4,'message':_0x25abb3,'category':'yaml','validator':_0x232ab5(0x157)});}}return _0x3472c7;}async[a0_0x2f7acc(0x1b2)](_0x5c28c9,_0x87eca3,_0x1d595a={}){const _0x1f6092=a0_0x2f7acc;try{const _0x532b97=await execAsync('checkov\x20-f\x20\x22'+_0x5c28c9+'\x22\x20--framework\x20'+_0x87eca3+_0x1f6092(0x1a4),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x18acd4=JSON[_0x1f6092(0x18a)](_0x532b97[_0x1f6092(0x16c)]);return this['parseCheckovResults'](_0x18acd4,_0x5c28c9);}catch(_0x4cf8ab){if(_0x4cf8ab['stdout'])try{const _0x3efde9=JSON['parse'](_0x4cf8ab['stdout']);return this['parseCheckovResults'](_0x3efde9,_0x5c28c9);}catch(_0x561f6f){this[_0x1f6092(0x15e)]?.['error'](_0x1f6092(0x17b),{'error':_0x561f6f['message']});}return this[_0x1f6092(0x15e)]?.['error']('checkov\x20validation\x20failed',{'error':_0x4cf8ab[_0x1f6092(0x177)]}),[];}}['parseCheckovResults'](_0x1ccc11,_0x2cf896){const _0x4cb538=a0_0x2f7acc,_0x419997=[];if(_0x1ccc11['results']&&_0x1ccc11['results']['failed_checks'])for(const _0x270045 of _0x1ccc11[_0x4cb538(0x196)]['failed_checks']){_0x419997[_0x4cb538(0x156)]({'file':_0x2cf896,'line':_0x270045[_0x4cb538(0x16e)]?_0x270045[_0x4cb538(0x16e)][0x0]:0x1,'column':0x1,'severity':this[_0x4cb538(0x192)](_0x270045['check_class']),'rule':_0x270045['check_id'],'message':_0x270045[_0x4cb538(0x14c)]||_0x270045['check_id'],'category':'security','validator':'checkov','remediation':_0x270045[_0x4cb538(0x16f)],'cwe':_0x270045['cwe'],'references':_0x270045[_0x4cb538(0x16f)]?[_0x270045[_0x4cb538(0x16f)]]:[]});}return _0x419997;}async['validatePackageJson'](_0x1885a8,_0x3e5de1={}){const _0x36e6ed=a0_0x2f7acc;try{const _0x3d14d1=(await import(_0x36e6ed(0x152)))['default'],_0x3a8ef5=(await import('ajv-formats'))['default'],_0x1e736b=await a0_0x4ba8d4['readFile'](_0x1885a8,'utf-8'),_0x1b9cb8=JSON[_0x36e6ed(0x18a)](_0x1e736b),_0x339366=new _0x3d14d1({'allErrors':!![],'strict':![]});_0x3a8ef5(_0x339366);const _0x424836={'type':_0x36e6ed(0x180),'required':[_0x36e6ed(0x191),_0x36e6ed(0x190)],'properties':{'name':{'type':_0x36e6ed(0x172),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x36e6ed(0x172)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':'string','enum':[_0x36e6ed(0x17c),'commonjs']},'scripts':{'type':'object'},'dependencies':{'type':_0x36e6ed(0x180)},'devDependencies':{'type':'object'}},'additionalProperties':!![]},_0x6fe07c=_0x339366[_0x36e6ed(0x164)](_0x424836),_0x316a5c=_0x6fe07c(_0x1b9cb8);if(!_0x316a5c&&_0x6fe07c[_0x36e6ed(0x185)])return _0x6fe07c['errors'][_0x36e6ed(0x182)](_0x780645=>({'file':_0x1885a8,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x36e6ed(0x183)][_0x36e6ed(0x160)],'rule':'json-schema','message':_0x780645['instancePath']?_0x780645[_0x36e6ed(0x187)]+'\x20'+_0x780645['message']:_0x36e6ed(0x14a)+_0x780645[_0x36e6ed(0x15c)][_0x36e6ed(0x161)]+'\x27','category':'validation','validator':'json-schema'}));return[];}catch(_0x3ad624){return this[_0x36e6ed(0x15e)]?.['error'](_0x36e6ed(0x193),{'error':_0x3ad624[_0x36e6ed(0x177)]}),[{'file':_0x1885a8,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x36e6ed(0x183)][_0x36e6ed(0x160)],'rule':_0x36e6ed(0x16a),'message':_0x36e6ed(0x1b9)+_0x3ad624['message'],'category':_0x36e6ed(0x167),'validator':_0x36e6ed(0x16a)}];}}async[a0_0x2f7acc(0x16d)](_0x5e2d1a,_0x32a986={}){const _0x2d48ce=a0_0x2f7acc;try{const _0x19a5a0=await a0_0x4ba8d4[_0x2d48ce(0x1c0)](_0x5e2d1a,'utf-8'),_0x2fc7e7=JSON['parse'](_0x19a5a0),_0xc2e158=[];if(_0x2fc7e7['compilerOptions']){const _0x1c0e59=_0x2fc7e7[_0x2d48ce(0x181)];!_0x1c0e59['strict']&&_0xc2e158[_0x2d48ce(0x156)]({'file':_0x5e2d1a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x2d48ce(0x1af),'message':'Consider\x20enabling\x20\x22strict\x22\x20mode\x20for\x20better\x20type\x20safety','category':'best-practice','validator':_0x2d48ce(0x158)}),_0x1c0e59['noImplicitAny']===![]&&_0xc2e158[_0x2d48ce(0x156)]({'file':_0x5e2d1a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x2d48ce(0x18e),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':_0x2d48ce(0x158)});}return _0xc2e158;}catch(_0x43fca5){return this['logger']?.['error'](_0x2d48ce(0x168),{'error':_0x43fca5['message']}),[{'file':_0x5e2d1a,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x2d48ce(0x183)]['ERROR'],'rule':_0x2d48ce(0x16a),'message':_0x2d48ce(0x1b9)+_0x43fca5['message'],'category':_0x2d48ce(0x167),'validator':'json-parse'}];}}async[a0_0x2f7acc(0x14d)](_0x2287a7,_0x1aa7a3={}){const _0xeaac59=a0_0x2f7acc;try{const _0x4e81e1=await a0_0x4ba8d4[_0xeaac59(0x1c0)](_0x2287a7,'utf-8'),_0x3ec374=[],_0x480479=_0x4e81e1[_0xeaac59(0x189)]('\x0a'),_0x14931d=[{'pattern':/password|passwd|pwd/i,'name':'password'},{'pattern':/api[_-]?key/i,'name':_0xeaac59(0x159)},{'pattern':/secret/i,'name':_0xeaac59(0x162)},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':'private\x20key'},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x480479[_0xeaac59(0x155)]((_0x377ce8,_0xb63979)=>{const _0x4b3431=_0xeaac59,_0x9a7931=_0x377ce8[_0x4b3431(0x14e)]();if(!_0x9a7931||_0x9a7931['startsWith']('#'))return;if(_0x9a7931[_0x4b3431(0x19e)]('=')){const [_0x554967,_0x19a42a]=_0x9a7931[_0x4b3431(0x189)]('='),_0x1aa70d=_0x554967['toLowerCase'](),_0x1b6e69=_0x19a42a?.['trim']()||'',_0x53ec31=_0x1b6e69&&_0x1b6e69!==''&&!_0x1b6e69[_0x4b3431(0x1a9)]('$')&&_0x1b6e69!=='your-key-here'&&_0x1b6e69!=='changeme'&&_0x1b6e69['length']>0x5;if(_0x53ec31)for(const {pattern:_0x3aa69a,name:_0x197cef}of _0x14931d){if(_0x3aa69a['test'](_0x1aa70d)){_0x3ec374['push']({'file':_0x2287a7,'line':_0xb63979+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x197cef+_0x4b3431(0x1bd),'category':'security','validator':'env-validator','remediation':_0x4b3431(0x1a1)});break;}}}}),_0x3ec374;}catch(_0x5fc1ea){return this[_0xeaac59(0x15e)]?.[_0xeaac59(0x194)]('.env\x20validation\x20failed',{'error':_0x5fc1ea[_0xeaac59(0x177)]}),[];}}[a0_0x2f7acc(0x19f)](_0x4cc5f9){const _0x384d17=a0_0x2f7acc,_0xc8166f=a0_0x183772['basename'](_0x4cc5f9)[_0x384d17(0x17a)](),_0x4b85e0=a0_0x183772['dirname'](_0x4cc5f9);if(_0xc8166f===_0x384d17(0x1a0))return'dockerfile';if(_0xc8166f==='docker-compose.yml'||_0xc8166f==='docker-compose.yaml')return'docker-compose';if(_0xc8166f===_0x384d17(0x1b1))return _0x384d17(0x1b1);if(_0xc8166f===_0x384d17(0x199))return _0x384d17(0x199);if(_0xc8166f==='.env'||_0xc8166f[_0x384d17(0x1b0)](_0x384d17(0x175)))return'env';if(_0x4b85e0[_0x384d17(0x19e)](_0x384d17(0x1ab)))return'github-actions';if(_0x4b85e0['includes']('kubernetes')||_0x4b85e0[_0x384d17(0x19e)]('k8s'))return'kubernetes';const _0x58850c=a0_0x183772[_0x384d17(0x1b3)](_0x4cc5f9)['toLowerCase']();if(_0x58850c==='.tf'||_0x58850c==='.tfvars')return'terraform';if(_0x58850c===_0x384d17(0x16b)||_0x58850c==='.yaml')return'yaml';if(_0x58850c===_0x384d17(0x195))return _0x384d17(0x1c1);return _0x384d17(0x1a3);}[a0_0x2f7acc(0x146)](_0x590511){const _0x26e65c=a0_0x2f7acc;return _0x590511[_0x26e65c(0x182)](_0x27de0b=>({'file':_0x27de0b['file'],'line':_0x27de0b['line']||0x1,'column':_0x27de0b['column']||0x1,'severity':_0x27de0b['severity']||STATIC_ANALYSIS['SEVERITY'][_0x26e65c(0x197)],'rule':_0x27de0b[_0x26e65c(0x1a5)]||'unknown','message':_0x27de0b['message']||_0x26e65c(0x19b),'category':_0x27de0b[_0x26e65c(0x18d)]||_0x26e65c(0x170),'validator':_0x27de0b['validator'],'cwe':_0x27de0b['cwe']||null,'remediation':_0x27de0b[_0x26e65c(0x19c)]||null,'references':_0x27de0b['references']||[]}));}[a0_0x2f7acc(0x1ac)](_0x4424d7){const _0x28f399=a0_0x2f7acc,_0xca31bb={'error':STATIC_ANALYSIS[_0x28f399(0x183)]['ERROR'],'warning':STATIC_ANALYSIS[_0x28f399(0x183)][_0x28f399(0x197)],'info':STATIC_ANALYSIS['SEVERITY']['INFO'],'style':STATIC_ANALYSIS[_0x28f399(0x183)]['INFO']};return _0xca31bb[_0x4424d7?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}[a0_0x2f7acc(0x1bf)](_0x402e76){const _0xbc781f=a0_0x2f7acc,_0x438a98={'error':STATIC_ANALYSIS[_0xbc781f(0x183)]['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING']};return _0x438a98[_0x402e76?.[_0xbc781f(0x17a)]()]||STATIC_ANALYSIS['SEVERITY'][_0xbc781f(0x197)];}[a0_0x2f7acc(0x192)](_0x16c627){const _0x3b98c3=a0_0x2f7acc;return STATIC_ANALYSIS[_0x3b98c3(0x183)]['ERROR'];}async[a0_0x2f7acc(0x174)](){const _0x28dba6=a0_0x2f7acc,_0x47c8be=await this[_0x28dba6(0x166)]();return{'validators':_0x47c8be,'recommendations':this['getInstallRecommendations'](_0x47c8be)};}[a0_0x2f7acc(0x1b8)](_0x54403b){const _0x291775=a0_0x2f7acc,_0x5a1f8c=[];return!_0x54403b[_0x291775(0x1a8)]&&_0x5a1f8c[_0x291775(0x156)]({'validator':'checkov','reason':'Infrastructure\x20as\x20Code\x20security\x20scanning\x20(Docker,\x20Kubernetes,\x20Terraform)','install':'pip\x20install\x20checkov','priority':'high'}),!_0x54403b['hadolint']&&_0x5a1f8c['push']({'validator':'hadolint','reason':_0x291775(0x178),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x54403b[_0x291775(0x157)]&&_0x5a1f8c[_0x291775(0x156)]({'validator':_0x291775(0x157),'reason':_0x291775(0x18b),'install':_0x291775(0x176),'priority':_0x291775(0x15f)}),!_0x54403b['jsonSchema']&&_0x5a1f8c[_0x291775(0x156)]({'validator':_0x291775(0x1b4),'reason':_0x291775(0x153),'install':_0x291775(0x184),'priority':'medium'}),_0x5a1f8c;}}export default ConfigValidator;
1
+ function a0_0x2d11(_0x3b935c,_0x2f1fc9){_0x3b935c=_0x3b935c-0xbd;const _0x16c64a=a0_0x16c6();let _0x2d1160=_0x16c64a[_0x3b935c];if(a0_0x2d11['dpcqOi']===undefined){var _0x673de=function(_0x3c3a97){const _0x184aae='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x261839='',_0x2e4034='';for(let _0x8a0624=0x0,_0x20249c,_0x49bc61,_0x27a936=0x0;_0x49bc61=_0x3c3a97['charAt'](_0x27a936++);~_0x49bc61&&(_0x20249c=_0x8a0624%0x4?_0x20249c*0x40+_0x49bc61:_0x49bc61,_0x8a0624++%0x4)?_0x261839+=String['fromCharCode'](0xff&_0x20249c>>(-0x2*_0x8a0624&0x6)):0x0){_0x49bc61=_0x184aae['indexOf'](_0x49bc61);}for(let _0x56190d=0x0,_0x14281f=_0x261839['length'];_0x56190d<_0x14281f;_0x56190d++){_0x2e4034+='%'+('00'+_0x261839['charCodeAt'](_0x56190d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2e4034);};a0_0x2d11['CjmAar']=_0x673de,a0_0x2d11['YtNalB']={},a0_0x2d11['dpcqOi']=!![];}const _0x4f1e68=_0x16c64a[0x0],_0x35576d=_0x3b935c+_0x4f1e68,_0x350336=a0_0x2d11['YtNalB'][_0x35576d];return!_0x350336?(_0x2d1160=a0_0x2d11['CjmAar'](_0x2d1160),a0_0x2d11['YtNalB'][_0x35576d]=_0x2d1160):_0x2d1160=_0x350336,_0x2d1160;}const a0_0x495851=a0_0x2d11;function a0_0x16c6(){const _0x78736c=['rvjst1i','C3rHCNrZv2L0Aa','z3vPzgvSAw5L','CgfYC2u','AxnbCNjHEq','BMfTzq','q1jjveLdquW','CgfZC3DVCMq','y2f0zwDVCNK','zgvIDwC','DMfSAwrHDg9Y','B2jQzwn0','AgfKB2XPBNq','u0vwrvjjvfK','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','v0fstKLorW','Dg9mB3DLCKnHC2u','y2HLy2TVDIaTlxzLCNnPB24','C2v2zxjPDhK','lNrMDMfYCW','BwvZC2fNzq','y29TCgLSzq','Bgv2zwW','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','CNvSzq','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','y29TBw9UANm','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','C2vJDxjPDhK','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','C2vJCMv0','CgfYC2viywrVBgLUDfjLC3vSDhm','zg9JA2vYzMLSzq','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','y3DL','nNb1Avbcvq','y2HLy2TFAwq','EwfTBgXPBNqGBM90igf2ywLSywjSzq','mtmXodGWmuHtAgT3za','BM8TAw1WBgLJAxqTyw55','BwvKAxvT','nJbruM1WC28','lNrM','C3rKB3v0','EwfTBgXPBNq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','sw52ywXPzcbku09ooIa','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','mJDHturfrfe','yMvZDc1WCMfJDgLJzq','ANnVBI1WyxjZzq','DhnJB25MAwCUANnVBG','zg9JA2vYx2nVBxbVC2u','ChvZAa','otuXotq0vwXzsxzW','nKfXy1zQsG','EwfTBgXPBNqGzgv0zwn0zwq','CgfYC2vdAgvJA292uMvZDwX0CW','zxjYB3i','DMfSAwrHDgvfBNzgAwXL','zgvMyxvSDa','ANnVBI1Zy2HLBwe','DxrMltG','C3rYAwn0','su5gtW','wufntcbMAwXLihzHBgLKyxrPB24','y2HLy2TFy2XHC3m','BwfWwwfTBgXPBNrtzxzLCML0Eq','zg9JA2vYlwnVBxbVC2u','CgfYyw1Z','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','yxzHAwXHyMXLu2nHBM5LCNm','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','CgfJA2fNzs5QC29U','z2L0AhvIlwfJDgLVBNm','CMvZDwX0CW','DMfSAwrHDgvxAxrOq2HLy2TVDG','BwfWsgfKB2XPBNrtzxzLCML0Eq','C3rYAw5N','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','BM9jBxbSAwnPDefUEq','Bg9Nz2vY','DhjPBq','DgvYCMfMB3jT','y2HLy2TVDG','rMfPBgvKihrVihbHCNnLignOzwnRB3yGB3v0Chv0','Aw5ZDgfUy2vqyxrO','CMvTzwrPyxrPB24','D2fYBG','y2HLy2TVDIaTzIaI','EwfTBa','A3vIzxjUzxrLCW','DMfSAwrHDgvuC0nVBMzPzW','zMLSzq','y29SDw1U','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','BgLUzq','mJm5mdi2mNHiqMHnta','y29TCgLSzxjpChrPB25Z','DMfSAwrHDgvzqu1m','DMfSAwrHDgveB2nRzxjMAwXL','AgLNAa','Bw9KDwXL','CMvHzezPBgu','CgfYC2vzyw1SBgLUDfjLC3vSDhm','ChjPDMf0zsbRzxK','zw52lxzHBgLKyxrVCG','BgvUz3rO','ywP2','lNLHBwW','iIaTlwzYyw1LD29YAYa','DMfSAwrHDgLVBG','ywP2icHku09oifnJAgvTysK','mJC4mdCZnvHpBw1rzq','mtmYmtm2muDsr1LgyW','mtm2oteYm3foCw5Xrq','mtKZmJrPwgP0CfK','DgvZDa'];a0_0x16c6=function(){return _0x78736c;};return a0_0x16c6();}(function(_0x27ea0b,_0x5c07c5){const _0x5ebcae=a0_0x2d11,_0x5d8f07=_0x27ea0b();while(!![]){try{const _0x4a8ca2=parseInt(_0x5ebcae(0xc3))/0x1+-parseInt(_0x5ebcae(0x128))/0x2+parseInt(_0x5ebcae(0xea))/0x3*(parseInt(_0x5ebcae(0xc5))/0x4)+parseInt(_0x5ebcae(0xc2))/0x5*(parseInt(_0x5ebcae(0xfe))/0x6)+-parseInt(_0x5ebcae(0xc4))/0x7+parseInt(_0x5ebcae(0xfd))/0x8*(-parseInt(_0x5ebcae(0xf7))/0x9)+parseInt(_0x5ebcae(0xf0))/0xa*(parseInt(_0x5ebcae(0xed))/0xb);if(_0x4a8ca2===_0x5c07c5)break;else _0x5d8f07['push'](_0x5d8f07['shift']());}catch(_0x5eeed5){_0x5d8f07['push'](_0x5d8f07['shift']());}}}(a0_0x16c6,0xd1ac1));import{exec}from'child_process';import{promisify}from'util';import a0_0x261839 from'path';import a0_0x2e4034 from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x8a0624=null){const _0x362b82=a0_0x2d11;this[_0x362b82(0x118)]=_0x8a0624,this['availableScanners']=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x214b28=a0_0x2d11;if(this['availableScanners']!==null)return this[_0x214b28(0x10e)];const _0x20249c={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync(_0x214b28(0xd8),{'timeout':0x1388}),_0x20249c[_0x214b28(0x11b)]=!![],this['logger']?.[_0x214b28(0xd0)]('checkov\x20detected');}catch(_0x49bc61){this[_0x214b28(0x118)]?.['debug'](_0x214b28(0xd5),{'error':_0x49bc61['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x20249c[_0x214b28(0xd3)]=!![],this['logger']?.[_0x214b28(0xd0)]('hadolint\x20detected');}catch(_0x27a936){this['logger']?.['debug']('hadolint\x20not\x20available',{'error':_0x27a936[_0x214b28(0xdb)]});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0x20249c['yamllint']=!![],this[_0x214b28(0x118)]?.[_0x214b28(0xd0)](_0x214b28(0xff));}catch(_0x56190d){this[_0x214b28(0x118)]?.[_0x214b28(0xd0)](_0x214b28(0xec),{'error':_0x56190d['message']});}try{await import(_0x214b28(0xbd)),_0x20249c['jsonSchema']=!![],this[_0x214b28(0x118)]?.[_0x214b28(0xd0)]('JSON\x20Schema\x20validation\x20available');}catch(_0x14281f){this['logger']?.[_0x214b28(0xd0)]('ajv\x20not\x20available',{'error':_0x14281f['message']});}return this[_0x214b28(0x10e)]=_0x20249c,_0x20249c;}async['validate'](_0x5dcf82,_0x1f9484={}){const _0x3df534=a0_0x2d11,_0x23bd38=[],_0x309e78=await this[_0x3df534(0xf6)](),_0x1d868a=this['detectFileType'](_0x5dcf82);this[_0x3df534(0x118)]?.[_0x3df534(0xd0)]('Validating\x20config\x20file',{'filePath':_0x5dcf82,'fileType':_0x1d868a});switch(_0x1d868a){case'dockerfile':if(_0x309e78['hadolint']){const _0x99110f=await this[_0x3df534(0x12b)](_0x5dcf82,_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x99110f);}if(_0x309e78['checkov']){const _0x260fc2=await this['validateWithCheckov'](_0x5dcf82,'dockerfile',_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x260fc2);}break;case _0x3df534(0x10b):if(_0x309e78['yamllint']){const _0x15d70c=await this['validateYAML'](_0x5dcf82,_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x15d70c);}if(_0x309e78['checkov']){const _0x15ba67=await this[_0x3df534(0x113)](_0x5dcf82,_0x3df534(0xfb),_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x15ba67);}break;case _0x3df534(0x122):if(_0x309e78['yamllint']){const _0x5b0398=await this['validateYAML'](_0x5dcf82,_0x1f9484);_0x23bd38['push'](..._0x5b0398);}if(_0x309e78[_0x3df534(0x11b)]){const _0x7db949=await this['validateWithCheckov'](_0x5dcf82,'kubernetes',_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x7db949);}break;case _0x3df534(0x11a):if(_0x309e78[_0x3df534(0x11b)]){const _0x10025a=await this['validateWithCheckov'](_0x5dcf82,'terraform',_0x1f9484);_0x23bd38['push'](..._0x10025a);}break;case'package.json':if(_0x309e78['jsonSchema']){const _0x1da038=await this['validatePackageJson'](_0x5dcf82,_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x1da038);}break;case'tsconfig.json':if(_0x309e78['jsonSchema']){const _0x1af709=await this[_0x3df534(0x123)](_0x5dcf82,_0x1f9484);_0x23bd38['push'](..._0x1af709);}break;case _0x3df534(0x111):if(_0x309e78[_0x3df534(0xf3)]){const _0x226cd8=await this['validateYAML'](_0x5dcf82,_0x1f9484);_0x23bd38[_0x3df534(0xfc)](..._0x226cd8);}break;case'env':const _0x214968=await this[_0x3df534(0x102)](_0x5dcf82,_0x1f9484);_0x23bd38['push'](..._0x214968);break;case _0x3df534(0x121):if(_0x309e78[_0x3df534(0xf3)]){const _0xac0657=await this[_0x3df534(0x12a)](_0x5dcf82,_0x1f9484);_0x23bd38['push'](..._0xac0657);}break;default:this['logger']?.[_0x3df534(0x11f)](_0x3df534(0xe2),{'filePath':_0x5dcf82,'fileType':_0x1d868a});return[];}return this['normalizeResults'](_0x23bd38);}async[a0_0x495851(0x12b)](_0x3e9a2f,_0x2353b2={}){const _0xac8205=a0_0x495851;try{const _0x4a9c78=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x3e9a2f+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x2babf4=JSON['parse'](_0x4a9c78[_0xac8205(0xf2)]);return this[_0xac8205(0xe6)](_0x2babf4,_0x3e9a2f);}catch(_0x3ebbac){if(_0x3ebbac[_0xac8205(0xf2)])try{const _0x4a17d5=JSON[_0xac8205(0xca)](_0x3ebbac['stdout']);return this['parseHadolintResults'](_0x4a17d5,_0x3e9a2f);}catch(_0x142362){this['logger']?.['error'](_0xac8205(0x116),{'error':_0x142362['message']});}return this[_0xac8205(0x118)]?.[_0xac8205(0x101)]('hadolint\x20validation\x20failed',{'error':_0x3ebbac[_0xac8205(0xdb)]}),[];}}['parseHadolintResults'](_0x5c06a0,_0x3cbfe7){const _0x4a283a=a0_0x495851,_0x52ce=[];if(Array[_0x4a283a(0xcb)](_0x5c06a0))for(const _0x46327e of _0x5c06a0){_0x52ce[_0x4a283a(0xfc)]({'file':_0x3cbfe7,'line':_0x46327e['line']||0x1,'column':_0x46327e['column']||0x1,'severity':this['mapHadolintSeverity'](_0x46327e[_0x4a283a(0xdd)]),'rule':_0x46327e['code'],'message':_0x46327e['message'],'category':_0x4a283a(0xe7),'validator':_0x4a283a(0xd3)});}return _0x52ce;}async['validateYAML'](_0x374e22,_0x40cd76={}){const _0x518b2a=a0_0x495851;try{const _0x5e272d=await execAsync(_0x518b2a(0xe8)+_0x374e22+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this[_0x518b2a(0x12f)](_0x5e272d[_0x518b2a(0xf2)],_0x374e22);}catch(_0x423a95){if(_0x423a95['stdout'])return this['parseYamllintResults'](_0x423a95['stdout'],_0x374e22);return this['logger']?.[_0x518b2a(0x101)]('yamllint\x20validation\x20failed',{'error':_0x423a95['message']}),[];}}[a0_0x495851(0x12f)](_0x3a42dd,_0x302cc4){const _0xc750d2=a0_0x495851,_0x198688=[],_0x4c9a80=_0x3a42dd['split']('\x0a')['filter'](_0x387a74=>_0x387a74['trim']());for(const _0x12aa4f of _0x4c9a80){const _0x55e397=_0x12aa4f['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x55e397){const [,_0x31232a,_0x47718d,_0x32d677,_0x2add7d,_0x414e25,_0x379d50]=_0x55e397;_0x198688[_0xc750d2(0xfc)]({'file':_0x302cc4,'line':parseInt(_0x47718d,0xa),'column':parseInt(_0x32d677,0xa),'severity':this['mapYamllintSeverity'](_0x2add7d),'rule':_0x379d50,'message':_0x414e25,'category':_0xc750d2(0x121),'validator':_0xc750d2(0xf3)});}}return _0x198688;}async[a0_0x495851(0x113)](_0x256b40,_0x12bf0d,_0x4d6f8c={}){const _0x3f96b1=a0_0x495851;try{const _0x17e4f9=await execAsync(_0x3f96b1(0x120)+_0x256b40+_0x3f96b1(0xbf)+_0x12bf0d+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x26730f=JSON[_0x3f96b1(0xca)](_0x17e4f9[_0x3f96b1(0xf2)]);return this['parseCheckovResults'](_0x26730f,_0x256b40);}catch(_0x471899){if(_0x471899[_0x3f96b1(0xf2)])try{const _0x25a17e=JSON['parse'](_0x471899['stdout']);return this['parseCheckovResults'](_0x25a17e,_0x256b40);}catch(_0x44a11d){this['logger']?.['error'](_0x3f96b1(0x11c),{'error':_0x44a11d[_0x3f96b1(0xdb)]});}return this['logger']?.[_0x3f96b1(0x101)](_0x3f96b1(0xe4),{'error':_0x471899[_0x3f96b1(0xdb)]}),[];}}[a0_0x495851(0x100)](_0x44a526,_0x4220f7){const _0x2dee79=a0_0x495851,_0x25153c=[];if(_0x44a526['results']&&_0x44a526[_0x2dee79(0x112)]['failed_checks'])for(const _0x58af71 of _0x44a526[_0x2dee79(0x112)]['failed_checks']){_0x25153c[_0x2dee79(0xfc)]({'file':_0x4220f7,'line':_0x58af71['file_line_range']?_0x58af71['file_line_range'][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x58af71[_0x2dee79(0x109)]),'rule':_0x58af71['check_id'],'message':_0x58af71['check_name']||_0x58af71[_0x2dee79(0xeb)],'category':_0x2dee79(0xe3),'validator':_0x2dee79(0x11b),'remediation':_0x58af71[_0x2dee79(0xc9)],'cwe':_0x58af71[_0x2dee79(0xe9)],'references':_0x58af71['guideline']?[_0x58af71['guideline']]:[]});}return _0x25153c;}async['validatePackageJson'](_0x19354d,_0x2766b9={}){const _0x1944bb=a0_0x495851;try{const _0x132eed=(await import('ajv'))['default'],_0x4a5ec4=(await import('ajv-formats'))[_0x1944bb(0x103)],_0x425b13=await a0_0x2e4034[_0x1944bb(0x12e)](_0x19354d,'utf-8'),_0x558add=JSON[_0x1944bb(0xca)](_0x425b13),_0x49ee91=new _0x132eed({'allErrors':!![],'strict':![]});_0x4a5ec4(_0x49ee91);const _0x333f13={'type':_0x1944bb(0xd2),'required':[_0x1944bb(0xcc),'version'],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x1944bb(0x115)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':'string','enum':[_0x1944bb(0x12d),_0x1944bb(0xe1)]},'scripts':{'type':_0x1944bb(0xd2)},'dependencies':{'type':_0x1944bb(0xd2)},'devDependencies':{'type':_0x1944bb(0xd2)}},'additionalProperties':!![]},_0xf3d429=_0x49ee91[_0x1944bb(0xdc)](_0x333f13),_0x353e52=_0xf3d429(_0x558add);if(!_0x353e52&&_0xf3d429['errors'])return _0xf3d429['errors']['map'](_0x47ee08=>({'file':_0x19354d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':'json-schema','message':_0x47ee08[_0x1944bb(0x11d)]?_0x47ee08['instancePath']+'\x20'+_0x47ee08['message']:_0x1944bb(0xf4)+_0x47ee08[_0x1944bb(0x10c)]['missingProperty']+'\x27','category':_0x1944bb(0xc0),'validator':_0x1944bb(0x104)}));return[];}catch(_0x14eab1){return this['logger']?.[_0x1944bb(0x101)](_0x1944bb(0x126),{'error':_0x14eab1['message']}),[{'file':_0x19354d,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x1944bb(0xc7)],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x14eab1[_0x1944bb(0xdb)],'category':'syntax','validator':'json-parse'}];}}async['validateTsConfig'](_0x11f0bb,_0x385af1={}){const _0x4cf1d2=a0_0x495851;try{const _0x4daff4=await a0_0x2e4034['readFile'](_0x11f0bb,_0x4cf1d2(0x105)),_0x51aa3f=JSON[_0x4cf1d2(0xca)](_0x4daff4),_0x177988=[];if(_0x51aa3f[_0x4cf1d2(0x129)]){const _0x270d57=_0x51aa3f[_0x4cf1d2(0x129)];!_0x270d57[_0x4cf1d2(0x106)]&&_0x177988[_0x4cf1d2(0xfc)]({'file':_0x11f0bb,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':'strict-mode','message':_0x4cf1d2(0x10d),'category':'best-practice','validator':'tsconfig-validator'}),_0x270d57[_0x4cf1d2(0x117)]===![]&&_0x177988['push']({'file':_0x11f0bb,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x4cf1d2(0xee),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':_0x4cf1d2(0xf8),'validator':'tsconfig-validator'});}return _0x177988;}catch(_0x5db71a){return this[_0x4cf1d2(0x118)]?.[_0x4cf1d2(0x101)]('tsconfig.json\x20validation\x20failed',{'error':_0x5db71a[_0x4cf1d2(0xdb)]}),[{'file':_0x11f0bb,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x4cf1d2(0xf9),'message':_0x4cf1d2(0xf5)+_0x5db71a[_0x4cf1d2(0xdb)],'category':'syntax','validator':'json-parse'}];}}async['validateEnvFile'](_0x3f19c4,_0x364fcc={}){const _0x56caaa=a0_0x495851;try{const _0x2406b2=await a0_0x2e4034[_0x56caaa(0x12e)](_0x3f19c4,'utf-8'),_0x2e2c37=[],_0x40e7ae=_0x2406b2['split']('\x0a'),_0x587a48=[{'pattern':/password|passwd|pwd/i,'name':_0x56caaa(0xce)},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':_0x56caaa(0xe5)},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':_0x56caaa(0x130)},{'pattern':/aws[_-]?access/i,'name':'AWS\x20credentials'}];return _0x40e7ae['forEach']((_0x50ba2b,_0x4d7339)=>{const _0xc50be4=_0x56caaa,_0x4e30ba=_0x50ba2b[_0xc50be4(0x119)]();if(!_0x4e30ba||_0x4e30ba[_0xc50be4(0xc8)]('#'))return;if(_0x4e30ba['includes']('=')){const [_0x3ae033,_0xd72ee6]=_0x4e30ba['split']('='),_0x33e379=_0x3ae033[_0xc50be4(0xd7)](),_0x4dffbf=_0xd72ee6?.['trim']()||'',_0x35d4d9=_0x4dffbf&&_0x4dffbf!==''&&!_0x4dffbf[_0xc50be4(0xc8)]('$')&&_0x4dffbf!=='your-key-here'&&_0x4dffbf!=='changeme'&&_0x4dffbf[_0xc50be4(0x132)]>0x5;if(_0x35d4d9)for(const {pattern:_0x2b66ce,name:_0x568bfb}of _0x587a48){if(_0x2b66ce[_0xc50be4(0xc6)](_0x33e379)){_0x2e2c37['push']({'file':_0x3f19c4,'line':_0x4d7339+0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0xc50be4(0xcd)],'rule':'hardcoded-secret','message':'Potential\x20hardcoded\x20'+_0x568bfb+'\x20detected\x20in\x20.env\x20file','category':_0xc50be4(0xe3),'validator':_0xc50be4(0x131),'remediation':_0xc50be4(0xe0)});break;}}}}),_0x2e2c37;}catch(_0x2882aa){return this['logger']?.[_0x56caaa(0x101)]('.env\x20validation\x20failed',{'error':_0x2882aa[_0x56caaa(0xdb)]}),[];}}['detectFileType'](_0x11fad0){const _0x24746d=a0_0x495851,_0x199a4d=a0_0x261839['basename'](_0x11fad0)['toLowerCase'](),_0x4f26b0=a0_0x261839['dirname'](_0x11fad0);if(_0x199a4d==='dockerfile')return _0x24746d(0xe7);if(_0x199a4d==='docker-compose.yml'||_0x199a4d==='docker-compose.yaml')return'docker-compose';if(_0x199a4d===_0x24746d(0x110))return'package.json';if(_0x199a4d===_0x24746d(0xfa))return'tsconfig.json';if(_0x199a4d==='.env'||_0x199a4d['endsWith']('.env'))return'env';if(_0x4f26b0['includes']('.github/workflows'))return _0x24746d(0x111);if(_0x4f26b0['includes']('kubernetes')||_0x4f26b0['includes']('k8s'))return'kubernetes';const _0x1830c9=a0_0x261839['extname'](_0x11fad0)[_0x24746d(0xd7)]();if(_0x1830c9===_0x24746d(0xf1)||_0x1830c9===_0x24746d(0xda))return _0x24746d(0x11a);if(_0x1830c9==='.yml'||_0x1830c9===_0x24746d(0xbe))return'yaml';if(_0x1830c9==='.json')return'json';return'unknown';}['normalizeResults'](_0x4dab13){const _0xace169=a0_0x495851;return _0x4dab13['map'](_0x42f44d=>({'file':_0x42f44d[_0xace169(0x124)],'line':_0x42f44d[_0xace169(0x127)]||0x1,'column':_0x42f44d[_0xace169(0x125)]||0x1,'severity':_0x42f44d[_0xace169(0xd9)]||STATIC_ANALYSIS[_0xace169(0xd4)][_0xace169(0xd6)],'rule':_0x42f44d[_0xace169(0xdf)]||'unknown','message':_0x42f44d[_0xace169(0xdb)]||_0xace169(0xde),'category':_0x42f44d[_0xace169(0xcf)]||_0xace169(0xc0),'validator':_0x42f44d[_0xace169(0xd1)],'cwe':_0x42f44d[_0xace169(0xe9)]||null,'remediation':_0x42f44d[_0xace169(0x11e)]||null,'references':_0x42f44d['references']||[]}));}[a0_0x495851(0x114)](_0x57b47e){const _0x49ee16=a0_0x495851,_0x3f7b8c={'error':STATIC_ANALYSIS[_0x49ee16(0xd4)]['ERROR'],'warning':STATIC_ANALYSIS[_0x49ee16(0xd4)][_0x49ee16(0xd6)],'info':STATIC_ANALYSIS['SEVERITY'][_0x49ee16(0x107)],'style':STATIC_ANALYSIS['SEVERITY'][_0x49ee16(0x107)]};return _0x3f7b8c[_0x57b47e?.[_0x49ee16(0xd7)]()]||STATIC_ANALYSIS[_0x49ee16(0xd4)]['WARNING'];}[a0_0x495851(0x10a)](_0x2b4590){const _0x18399d=a0_0x495851,_0x3adffc={'error':STATIC_ANALYSIS[_0x18399d(0xd4)]['ERROR'],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING']};return _0x3adffc[_0x2b4590?.[_0x18399d(0xd7)]()]||STATIC_ANALYSIS[_0x18399d(0xd4)]['WARNING'];}['mapCheckovSeverity'](_0x16efc2){const _0x185b77=a0_0x495851;return STATIC_ANALYSIS[_0x185b77(0xd4)]['ERROR'];}async['getValidatorStatus'](){const _0x1ba7ed=await this['detectAvailableValidators']();return{'validators':_0x1ba7ed,'recommendations':this['getInstallRecommendations'](_0x1ba7ed)};}['getInstallRecommendations'](_0x1ebb9d){const _0x29b1c0=a0_0x495851,_0x1f31de=[];return!_0x1ebb9d['checkov']&&_0x1f31de[_0x29b1c0(0xfc)]({'validator':'checkov','reason':_0x29b1c0(0x10f),'install':'pip\x20install\x20checkov','priority':_0x29b1c0(0x12c)}),!_0x1ebb9d[_0x29b1c0(0xd3)]&&_0x1f31de[_0x29b1c0(0xfc)]({'validator':'hadolint','reason':'Dockerfile\x20linting\x20and\x20best\x20practices','install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x1ebb9d[_0x29b1c0(0xf3)]&&_0x1f31de['push']({'validator':_0x29b1c0(0xf3),'reason':_0x29b1c0(0x108),'install':'pip\x20install\x20yamllint','priority':_0x29b1c0(0xef)}),!_0x1ebb9d['jsonSchema']&&_0x1f31de['push']({'validator':_0x29b1c0(0xc1),'reason':'JSON\x20configuration\x20validation','install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x1f31de;}}export default ConfigValidator;