@loxia-labs/loxia-autopilot-one 2.0.10 → 2.2.0
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.
- package/README.md +6 -5
- package/bin/cli.js +1 -1
- package/bin/loxia-terminal-v2.js +1 -1
- package/bin/loxia-terminal.js +1 -1
- package/bin/start-with-terminal.js +1 -1
- package/package.json +1 -1
- package/scripts/install-scanners.js +1 -1
- package/scripts/watchdog.js +1 -1
- package/src/analyzers/CSSAnalyzer.js +1 -1
- package/src/analyzers/ConfigValidator.js +1 -1
- package/src/analyzers/ESLintAnalyzer.js +1 -1
- package/src/analyzers/JavaScriptAnalyzer.js +1 -1
- package/src/analyzers/PrettierFormatter.js +1 -1
- package/src/analyzers/PythonAnalyzer.js +1 -1
- package/src/analyzers/SecurityAnalyzer.js +1 -1
- package/src/analyzers/SparrowAnalyzer.js +1 -1
- package/src/analyzers/TypeScriptAnalyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/detector.js +1 -1
- package/src/analyzers/codeCloneDetector/index.js +1 -1
- package/src/analyzers/codeCloneDetector/parser.js +1 -1
- package/src/analyzers/codeCloneDetector/reporter.js +1 -1
- package/src/analyzers/codeCloneDetector/scanner.js +1 -1
- package/src/core/agentPool.js +1 -1
- package/src/core/agentScheduler.js +1 -1
- package/src/core/contextManager.js +1 -1
- package/src/core/flowExecutor.js +1 -1
- package/src/core/messageProcessor.js +1 -1
- package/src/core/orchestrator.js +1 -1
- package/src/core/stateManager.js +1 -1
- package/src/index.js +1 -1
- package/src/interfaces/cli.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
- package/src/interfaces/terminal/api/apiClient.js +1 -1
- package/src/interfaces/terminal/api/messageRouter.js +1 -1
- package/src/interfaces/terminal/api/session.js +1 -1
- package/src/interfaces/terminal/api/websocket.js +1 -1
- package/src/interfaces/terminal/components/AgentCreator.js +1 -1
- package/src/interfaces/terminal/components/AgentEditor.js +1 -1
- package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
- package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
- package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
- package/src/interfaces/terminal/components/Header.js +1 -1
- package/src/interfaces/terminal/components/HelpPanel.js +1 -1
- package/src/interfaces/terminal/components/InputBox.js +1 -1
- package/src/interfaces/terminal/components/Layout.js +1 -1
- package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
- package/src/interfaces/terminal/components/MessageList.js +1 -1
- package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
- package/src/interfaces/terminal/components/SearchPanel.js +1 -1
- package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
- package/src/interfaces/terminal/components/StatusBar.js +1 -1
- package/src/interfaces/terminal/components/TextInput.js +1 -1
- package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
- package/src/interfaces/terminal/config/constants.js +1 -1
- package/src/interfaces/terminal/index.js +1 -1
- package/src/interfaces/terminal/state/useAgentControl.js +1 -1
- package/src/interfaces/terminal/state/useAgents.js +1 -1
- package/src/interfaces/terminal/state/useConnection.js +1 -1
- package/src/interfaces/terminal/state/useMessages.js +1 -1
- package/src/interfaces/terminal/state/useTools.js +1 -1
- package/src/interfaces/terminal/utils/debugLogger.js +1 -1
- package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
- package/src/interfaces/terminal/utils/theme.js +1 -1
- package/src/interfaces/webServer.js +1 -1
- package/src/modules/fileExplorer/controller.js +1 -1
- package/src/modules/fileExplorer/index.js +1 -1
- package/src/modules/fileExplorer/middleware.js +1 -1
- package/src/modules/fileExplorer/routes.js +1 -1
- package/src/services/agentActivityService.js +1 -1
- package/src/services/aiService.js +1 -1
- package/src/services/apiKeyManager.js +1 -1
- package/src/services/benchmarkService.js +1 -1
- package/src/services/budgetService.js +1 -1
- package/src/services/contextInjectionService.js +1 -1
- package/src/services/conversationCompactionService.js +1 -1
- package/src/services/credentialVault.js +1 -1
- package/src/services/errorHandler.js +1 -1
- package/src/services/fileAttachmentService.js +1 -1
- package/src/services/flowContextService.js +1 -1
- package/src/services/memoryService.js +1 -1
- package/src/services/modelRouterService.js +1 -1
- package/src/services/modelsService.js +1 -1
- package/src/services/portRegistry.js +1 -1
- package/src/services/portTracker.js +1 -1
- package/src/services/projectDetector.js +1 -1
- package/src/services/promptService.js +1 -1
- package/src/services/qualityInspector.js +1 -1
- package/src/services/serviceRegistry.js +1 -1
- package/src/services/tokenCountingService.js +1 -1
- package/src/services/visualEditorBridge.js +1 -1
- package/src/services/visualEditorServer.js +1 -1
- package/src/tools/agentCommunicationTool.js +1 -1
- package/src/tools/agentDelayTool.js +1 -1
- package/src/tools/asyncToolManager.js +1 -1
- package/src/tools/baseTool.js +1 -1
- package/src/tools/browserTool.js +1 -1
- package/src/tools/cloneDetectionTool.js +1 -1
- package/src/tools/dependencyResolverTool.js +1 -1
- package/src/tools/docxTool.js +1 -1
- package/src/tools/excelTool.js +1 -1
- package/src/tools/fileContentReplaceTool.js +1 -1
- package/src/tools/fileSystemTool.js +1 -1
- package/src/tools/fileTreeTool.js +1 -1
- package/src/tools/helpTool.js +1 -1
- package/src/tools/imageTool.js +1 -1
- package/src/tools/importAnalyzerTool.js +1 -1
- package/src/tools/jobDoneTool.js +1 -1
- package/src/tools/memoryTool.js +1 -1
- package/src/tools/pdfTool.js +1 -1
- package/src/tools/seekTool.js +1 -1
- package/src/tools/staticAnalysisTool.js +1 -1
- package/src/tools/taskManagerTool.js +1 -1
- package/src/tools/terminalTool.js +1 -1
- package/src/tools/userPromptTool.js +1 -1
- package/src/tools/videoTool.js +1 -1
- package/src/tools/visualEditorTool.js +1 -1
- package/src/tools/webTool.js +1 -1
- package/src/types/agent.js +1 -1
- package/src/types/contextReference.js +1 -1
- package/src/types/conversation.js +1 -1
- package/src/types/toolCommand.js +1 -1
- package/src/utilities/attachmentValidator.js +1 -1
- package/src/utilities/browserStealth.js +1 -1
- package/src/utilities/configManager.js +1 -1
- package/src/utilities/constants.js +1 -1
- package/src/utilities/directoryAccessManager.js +1 -1
- package/src/utilities/fileProcessor.js +1 -1
- package/src/utilities/humanBehavior.js +1 -1
- package/src/utilities/jsonRepair.js +1 -1
- package/src/utilities/logger.js +1 -1
- package/src/utilities/platformUtils.js +1 -1
- package/src/utilities/platformUtils.test.js +1 -1
- package/src/utilities/stealthConstants.js +1 -1
- package/src/utilities/structuredFileValidator.js +1 -1
- package/src/utilities/tagParser.js +1 -1
- package/src/utilities/toolConstants.js +1 -1
- package/src/utilities/userDataDir.js +1 -1
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
|
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
100
|
loxia --version
|
|
101
|
-
# Should display: Loxia Autopilot One v2.0
|
|
101
|
+
# Should display: Loxia Autopilot One v2.2.0
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
### 4. Create an API Key
|
|
@@ -297,13 +297,14 @@ Loxia comes with 18+ specialized tools that agents can use autonomously:
|
|
|
297
297
|
|
|
298
298
|
## Roadmap
|
|
299
299
|
|
|
300
|
-
### Current Version (2.0
|
|
300
|
+
### Current Version (2.2.0)
|
|
301
301
|
|
|
302
|
+
- Two-layer tool descriptions: compact index + on-demand full docs via Help tool
|
|
303
|
+
- Document creation tools: DOCX (Word) and Excel read/create support
|
|
304
|
+
- PDF creation: HTML to PDF via Puppeteer with full CSS support
|
|
305
|
+
- Tool result turn tracking: batched results grouped by turn with manifest headers
|
|
302
306
|
- Unified `MAX_OUTPUT_TOKENS` constant (10,000) shared by aiService and compaction check
|
|
303
|
-
- Max output tokens capped at 10,000 (was 4,000 fallback for dynamic models)
|
|
304
307
|
- Compaction: preserve recent achievements, file paths, meaningful tool outcomes; 8K summary tokens
|
|
305
|
-
- Tool invocation guidance: dependent calls must split across messages
|
|
306
|
-
- CI publish fix: OIDC auth no longer interferes with npm install
|
|
307
308
|
|
|
308
309
|
### v2.0.6
|
|
309
310
|
- Tool path sync: terminal `cd` now propagates to all tools (filesystem, seek, pdf, etc.)
|
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const a0_0x267056=a0_0x1f46;(function(_0x5d196d,_0x5eb8bf){const _0x16bf9d=a0_0x1f46,_0x8fe513=_0x5d196d();while(!![]){try{const _0x1ba527=parseInt(_0x16bf9d(0x1e1))/0x1*(-parseInt(_0x16bf9d(0x1fc))/0x2)+-parseInt(_0x16bf9d(0x20b))/0x3*(-parseInt(_0x16bf9d(0x1c1))/0x4)+-parseInt(_0x16bf9d(0x1f6))/0x5*(parseInt(_0x16bf9d(0x1e9))/0x6)+parseInt(_0x16bf9d(0x1c4))/0x7*(-parseInt(_0x16bf9d(0x1ed))/0x8)+parseInt(_0x16bf9d(0x203))/0x9+parseInt(_0x16bf9d(0x204))/0xa*(-parseInt(_0x16bf9d(0x1d5))/0xb)+parseInt(_0x16bf9d(0x20f))/0xc;if(_0x1ba527===_0x5eb8bf)break;else _0x8fe513['push'](_0x8fe513['shift']());}catch(_0x44319b){_0x8fe513['push'](_0x8fe513['shift']());}}}(a0_0x40c8,0x48afe));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x1650c8 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST='127.0.0.1',SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x267056(0x208)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x267056(0x201)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x267056(0x1d7)]('--help')||args[a0_0x267056(0x1d7)]('-h'),'version':args[a0_0x267056(0x1d7)](a0_0x267056(0x1c6))||args[a0_0x267056(0x1d7)]('-v')};for(let i=0x0;i<args[a0_0x267056(0x1eb)];i++){args[i]===a0_0x267056(0x210)&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x267056(0x1d0)&&args[i+0x1]&&(flags[a0_0x267056(0x212)]=args[i+0x1]);}const explicitPort=flags[a0_0x267056(0x1ff)],host=flags['host']||DEFAULT_HOST;if(flags[a0_0x267056(0x1db)]){const pkgPath=join(__dirname,'..',a0_0x267056(0x1e7)),pkg=JSON[a0_0x267056(0x1f1)](readFileSync(pkgPath,a0_0x267056(0x1f9)));console[a0_0x267056(0x1de)](a0_0x267056(0x1c2)+pkg['version']),process[a0_0x267056(0x1e0)](0x0);}if(flags[a0_0x267056(0x1c0)]||!command){const pkgPath=join(__dirname,'..',a0_0x267056(0x1e7)),pkg=JSON[a0_0x267056(0x1f1)](readFileSync(pkgPath,a0_0x267056(0x1f9)));console[a0_0x267056(0x1de)](a0_0x267056(0x20e)+pkg[a0_0x267056(0x1db)]+'\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20only\x20(no\x20UI\x20opened)\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:\x20auto-select\x20starting\x20from\x20'+DEFAULT_PORT+a0_0x267056(0x209)+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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only\x20(headless)\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\x20specific\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\x20\x203.\x20Or\x20run\x20\x27loxia\x20serve\x27\x20for\x20headless\x20server\x20(connect\x20remotely)\x0a\x0aNote:\x20If\x20no\x20port\x20is\x20specified,\x20the\x20server\x20will\x20automatically\x20find\x0aan\x20available\x20port.\x20The\x20Terminal\x20UI\x20will\x20discover\x20the\x20server\x20port\x0aautomatically\x20from\x20the\x20port\x20registry.\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a'),process['exit'](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x4539f7}=await import('../src/services/portRegistry.js');return _0x4539f7();}function a0_0x1f46(_0x490bda,_0x3418da){_0x490bda=_0x490bda-0x1c0;const _0x40c8ef=a0_0x40c8();let _0x1f463c=_0x40c8ef[_0x490bda];return _0x1f463c;}async function discoverBackend(){const _0x2826d9=a0_0x267056;try{const _0x4149c1=await getPortRegistry();await _0x4149c1[_0x2826d9(0x20c)]();const _0x209b6b=await _0x4149c1[_0x2826d9(0x211)](_0x2826d9(0x1f7));if(_0x209b6b)return{'host':_0x209b6b['host']||_0x2826d9(0x1d3),'port':_0x209b6b[_0x2826d9(0x1ff)],'pid':_0x209b6b[_0x2826d9(0x1df)]};return null;}catch(_0x1921a8){return null;}}function a0_0x40c8(){const _0x4d1a25=['Server\x20discovered\x20at\x20','889jMtwGE','Looking\x20for\x20running\x20server...','--version','platform','message','toString','error','\x0aPlease\x20start\x20the\x20server\x20first:','darwin','start','catch','Unknown\x20command:\x20','--host','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','destroy','localhost','index.js','2335421qgLhwE','open','includes','Error:','Please\x20open\x20manually:\x20','Waiting\x20for\x20server\x20to\x20start...','version','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','win32','log','pid','exit','119EITplk','\x0aServer\x20registered\x20at\x20','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','setTimeout','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','cmd','package.json','SIGTERM','48YJpKdg','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','length','\x20but\x20not\x20responding.','17224MfepvC','\x20\x20API\x20Health:\x20\x20\x20','/api/health\x0a','xdg-open','parse','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','kill','inherit','260060bmsfMt','backend','ignore','utf8','\x0aShutting\x20down\x20server...','loxia-terminal.js','5358kUZnfm','unref','\x0a✓\x20Server\x20running\x20at\x20','port','SIGINT','startsWith','now','275364dwUhoF','10HseCvZ','statusCode','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','Starting\x20Terminal\x20UI...\x0a','argv',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','LOXIA_HOST','6kweJxc','cleanupStaleEntries','Starting\x20Loxia\x20server...\x0a','\x0aLoxia\x20Autopilot\x20One\x20v','15115236AuTIgR','--port','getService','host','help','456332eHHXHr','Loxia\x20Autopilot\x20One\x20v'];a0_0x40c8=function(){return _0x4d1a25;};return a0_0x40c8();}async function checkServerRunning(_0x34ad01,_0x10d0b3,_0x3c9acf=0x1){for(let _0x32470f=0x0;_0x32470f<_0x3c9acf;_0x32470f++){const _0x53944c=await new Promise(_0x2bfbde=>{const _0x348ddf=a0_0x1f46,_0x533488=a0_0x1650c8['get']('http://'+_0x34ad01+':'+_0x10d0b3+'/api/health',_0x1dbd20=>{const _0x13cfd8=a0_0x1f46;_0x2bfbde(_0x1dbd20[_0x13cfd8(0x205)]===0xc8);});_0x533488['on'](_0x348ddf(0x1ca),()=>_0x2bfbde(![])),_0x533488[_0x348ddf(0x1e4)](0x7d0,()=>{const _0x3cca38=_0x348ddf;_0x533488[_0x3cca38(0x1d2)](),_0x2bfbde(![]);});});if(_0x53944c)return!![];_0x32470f<_0x3c9acf-0x1&&await new Promise(_0x1f1c5a=>setTimeout(_0x1f1c5a,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x3a2967=SERVER_STARTUP_TIMEOUT){const _0x3ed033=a0_0x267056,_0x281f42=Date[_0x3ed033(0x202)]();while(Date[_0x3ed033(0x202)]()-_0x281f42<_0x3a2967){const _0x4001c4=await discoverBackend();if(_0x4001c4){const _0x5333f5=await checkServerRunning(_0x4001c4[_0x3ed033(0x212)],_0x4001c4['port']);if(_0x5333f5)return _0x4001c4;}await new Promise(_0x23eba1=>setTimeout(_0x23eba1,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x280872,_0x48108a,_0x486d34=SERVER_STARTUP_TIMEOUT){const _0x253dcf=Math['ceil'](_0x486d34/SERVER_CHECK_INTERVAL),_0x128fb8=await checkServerRunning(_0x280872,_0x48108a,_0x253dcf);return _0x128fb8?{'host':_0x280872,'port':_0x48108a}:null;}function openBrowser(_0x4005e2){const _0xca9918=a0_0x267056;let _0x56f98d,_0x4f74a4;if(process[_0xca9918(0x1c7)]===_0xca9918(0x1cc))_0x56f98d=_0xca9918(0x1d6),_0x4f74a4=[_0x4005e2];else process[_0xca9918(0x1c7)]===_0xca9918(0x1dd)?(_0x56f98d=_0xca9918(0x1e6),_0x4f74a4=['/c',_0xca9918(0x1cd),'\x22\x22',_0x4005e2]):(_0x56f98d=_0xca9918(0x1f0),_0x4f74a4=[_0x4005e2]);const _0x57b928=spawn(_0x56f98d,_0x4f74a4,{'detached':!![],'stdio':_0xca9918(0x1f8)});_0x57b928[_0xca9918(0x1fd)](),_0x57b928['on']('error',()=>{const _0x1cee1d=_0xca9918;console[_0x1cee1d(0x1de)]('Could\x20not\x20open\x20browser\x20automatically.'),console[_0x1cee1d(0x1de)](_0x1cee1d(0x1d9)+_0x4005e2);});}function startServer(_0x1dbf36=![]){const _0x4f28a0=a0_0x267056,_0x4c8fd9={...process.env};explicitPort&&(_0x4c8fd9['LOXIA_PORT']=explicitPort[_0x4f28a0(0x1c9)](),_0x4c8fd9['PORT']=explicitPort['toString']());flags[_0x4f28a0(0x212)]&&(_0x4c8fd9[_0x4f28a0(0x20a)]=flags['host']);const _0x3c1525=join(__dirname,'..','src',_0x4f28a0(0x1d4)),_0x1e2101=spawn('node',[_0x3c1525],{'cwd':join(__dirname,'..'),'env':_0x4c8fd9,'stdio':_0x1dbf36?[_0x4f28a0(0x1f8),'ignore',_0x4f28a0(0x1f8)]:_0x4f28a0(0x1f5),'detached':_0x1dbf36});return _0x1dbf36&&_0x1e2101['unref'](),_0x1e2101;}function startTerminalUIProcess(_0x141ac6,_0xa73c46){const _0x7e35e3=a0_0x267056,_0x472491=join(__dirname,_0x7e35e3(0x1fb)),_0x359d8a={...process.env,'LOXIA_PORT':_0xa73c46['toString'](),'LOXIA_HOST':_0x141ac6},_0x125969=spawn('node',[_0x472491],{'cwd':join(__dirname,'..'),'env':_0x359d8a,'stdio':_0x7e35e3(0x1f5)});return _0x125969;}const commands={'web':async()=>{const _0x2696ec=a0_0x267056;console[_0x2696ec(0x1de)]('Starting\x20Loxia\x20server...\x0a');const _0x3f7ceb=startServer(![]);console[_0x2696ec(0x1de)](_0x2696ec(0x1da));let _0x4b568c;explicitPort?_0x4b568c=await waitForServerAtPort(host,explicitPort):_0x4b568c=await waitForServerWithDiscovery();if(_0x4b568c){const _0x649358='http://'+_0x4b568c[_0x2696ec(0x212)]+':'+_0x4b568c[_0x2696ec(0x1ff)];console[_0x2696ec(0x1de)]('\x0aOpening\x20Web\x20UI\x20at\x20'+_0x649358),openBrowser(_0x649358);}else console[_0x2696ec(0x1de)](_0x2696ec(0x1dc));process['on']('SIGINT',()=>_0x3f7ceb['kill'](_0x2696ec(0x200))),process['on'](_0x2696ec(0x1e8),()=>_0x3f7ceb[_0x2696ec(0x1f4)](_0x2696ec(0x1e8))),_0x3f7ceb['on']('exit',_0x50d460=>process[_0x2696ec(0x1e0)](_0x50d460||0x0));},'plus-web':async()=>{await commands['web']();},'serve':async()=>{const _0x46b4f8=a0_0x267056;console[_0x46b4f8(0x1de)](_0x46b4f8(0x20d));const _0x57c493=startServer(![]);console[_0x46b4f8(0x1de)](_0x46b4f8(0x1da));let _0x16fa8e;explicitPort?_0x16fa8e=await waitForServerAtPort(host,explicitPort):_0x16fa8e=await waitForServerWithDiscovery();if(_0x16fa8e){const _0x57f4e7='http://'+_0x16fa8e[_0x46b4f8(0x212)]+':'+_0x16fa8e[_0x46b4f8(0x1ff)];console[_0x46b4f8(0x1de)](_0x46b4f8(0x1fe)+_0x57f4e7),console[_0x46b4f8(0x1de)]('\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'+_0x57f4e7),console[_0x46b4f8(0x1de)]('\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal'),console[_0x46b4f8(0x1de)](_0x46b4f8(0x1ee)+_0x57f4e7+_0x46b4f8(0x1ef));}else console[_0x46b4f8(0x1de)](_0x46b4f8(0x1f3)),console[_0x46b4f8(0x1de)](_0x46b4f8(0x1e3));process['on'](_0x46b4f8(0x200),()=>_0x57c493[_0x46b4f8(0x1f4)](_0x46b4f8(0x200))),process['on'](_0x46b4f8(0x1e8),()=>_0x57c493[_0x46b4f8(0x1f4)](_0x46b4f8(0x1e8))),_0x57c493['on'](_0x46b4f8(0x1e0),_0x126544=>process['exit'](_0x126544||0x0));},'terminal':async()=>{const _0x3930eb=a0_0x267056;console[_0x3930eb(0x1de)](_0x3930eb(0x1c5));let _0x4d2686=await discoverBackend();explicitPort&&(_0x4d2686={'host':host,'port':explicitPort});!_0x4d2686&&(console[_0x3930eb(0x1ca)]('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console['error'](_0x3930eb(0x1cb)),console['error'](_0x3930eb(0x1e5)),console[_0x3930eb(0x1ca)](_0x3930eb(0x1ea)),console[_0x3930eb(0x1ca)](_0x3930eb(0x206)),process[_0x3930eb(0x1e0)](0x1));const _0x29ab87=await checkServerRunning(_0x4d2686[_0x3930eb(0x212)],_0x4d2686[_0x3930eb(0x1ff)]);!_0x29ab87&&(console[_0x3930eb(0x1ca)](_0x3930eb(0x1e2)+_0x4d2686[_0x3930eb(0x212)]+':'+_0x4d2686[_0x3930eb(0x1ff)]+_0x3930eb(0x1ec)),console[_0x3930eb(0x1ca)](_0x3930eb(0x1f2)),process[_0x3930eb(0x1e0)](0x1));console['log'](_0x3930eb(0x1c3)+_0x4d2686[_0x3930eb(0x212)]+':'+_0x4d2686['port']),console['log'](_0x3930eb(0x207));const _0xc47f15=startTerminalUIProcess(_0x4d2686['host'],_0x4d2686[_0x3930eb(0x1ff)]);process['on'](_0x3930eb(0x200),()=>_0xc47f15[_0x3930eb(0x1f4)]('SIGINT')),process['on'](_0x3930eb(0x1e8),()=>_0xc47f15[_0x3930eb(0x1f4)](_0x3930eb(0x1e8))),_0xc47f15['on']('exit',_0x4c281a=>process[_0x3930eb(0x1e0)](_0x4c281a||0x0));},'plus-terminal':async()=>{const _0x1f2aa1=a0_0x267056;console[_0x1f2aa1(0x1de)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x4b8f8f=startServer(!![]);let _0x1ba516;explicitPort?_0x1ba516=await waitForServerAtPort(host,explicitPort):_0x1ba516=await waitForServerWithDiscovery();!_0x1ba516&&(console[_0x1f2aa1(0x1ca)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process[_0x1f2aa1(0x1e0)](0x1));console[_0x1f2aa1(0x1de)]('Server\x20running\x20at\x20http://'+_0x1ba516[_0x1f2aa1(0x212)]+':'+_0x1ba516[_0x1f2aa1(0x1ff)]),console[_0x1f2aa1(0x1de)](_0x1f2aa1(0x207));const _0x253470=startTerminalUIProcess(_0x1ba516['host'],_0x1ba516[_0x1f2aa1(0x1ff)]);_0x253470['on'](_0x1f2aa1(0x1e0),_0x440eaa=>{const _0x467511=_0x1f2aa1;console[_0x467511(0x1de)](_0x467511(0x1fa));try{process['kill'](_0x4b8f8f[_0x467511(0x1df)],'SIGTERM');}catch(_0x3a7ba1){}process[_0x467511(0x1e0)](_0x440eaa||0x0);}),process['on'](_0x1f2aa1(0x200),()=>{const _0x13b4c0=_0x1f2aa1;_0x253470[_0x13b4c0(0x1f4)](_0x13b4c0(0x200));}),process['on'](_0x1f2aa1(0x1e8),()=>{const _0x39731f=_0x1f2aa1;_0x253470['kill'](_0x39731f(0x1e8));});}};commands[command]?commands[command]()[a0_0x267056(0x1ce)](_0x352437=>{const _0x3d2f41=a0_0x267056;console[_0x3d2f41(0x1ca)](_0x3d2f41(0x1d8),_0x352437[_0x3d2f41(0x1c8)]),process[_0x3d2f41(0x1e0)](0x1);}):(console['error'](a0_0x267056(0x1cf)+command),console['error'](a0_0x267056(0x1d1)),process[a0_0x267056(0x1e0)](0x1));
|
|
3
|
+
const a0_0x2479d6=a0_0xd47f;(function(_0x2e70ba,_0x58887a){const _0x537084=a0_0xd47f,_0x26af91=_0x2e70ba();while(!![]){try{const _0x5e6732=-parseInt(_0x537084(0x1be))/0x1+-parseInt(_0x537084(0x1a8))/0x2+-parseInt(_0x537084(0x17a))/0x3*(-parseInt(_0x537084(0x19f))/0x4)+parseInt(_0x537084(0x1ac))/0x5+-parseInt(_0x537084(0x1b9))/0x6*(parseInt(_0x537084(0x19e))/0x7)+parseInt(_0x537084(0x1ae))/0x8*(parseInt(_0x537084(0x186))/0x9)+parseInt(_0x537084(0x19d))/0xa;if(_0x5e6732===_0x58887a)break;else _0x26af91['push'](_0x26af91['shift']());}catch(_0x105b50){_0x26af91['push'](_0x26af91['shift']());}}}(a0_0x32ba,0x89b1a));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x52db66 from'http';function a0_0x32ba(){const _0x36ec98=['toString','Starting\x20Loxia\x20server...\x0a','\x20but\x20not\x20responding.','Could\x20not\x20open\x20browser\x20automatically.','ignore','catch','unref','/api/health','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','exit','includes','statusCode','ceil','kill','utf8','length','7297410rfQPcO','14UkqWPB','151172kMGcKy','startsWith',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','inherit','LOXIA_PORT','Server\x20running\x20at\x20http://','http://','start','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','1455804xjxpKo','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','Looking\x20for\x20running\x20server...','message','5249615nCXhAO','get','7453256LdQyHj','src','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','log','platform','now','argv','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','\x0aServer\x20registered\x20at\x20','\x0a✓\x20Server\x20running\x20at\x20','index.js','2042280phKtJd','parse','host','web','win32','927630FkiMap','/api/health\x0a','--host','Please\x20open\x20manually:\x20','--help','--version','127.0.0.1','\x0aOpening\x20Web\x20UI\x20at\x20','cleanupStaleEntries','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','Starting\x20Terminal\x20UI...\x0a','setTimeout','cmd','LOXIA_HOST','pid','15ChuNjq','port','getService','destroy','Server\x20discovered\x20at\x20','help','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','loxia-terminal.js','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','localhost','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','Waiting\x20for\x20server\x20to\x20start...','9UwdfTN','backend','package.json','version','error','SIGINT','SIGTERM'];a0_0x32ba=function(){return _0x36ec98;};return a0_0x32ba();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x2479d6(0x171),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x2479d6(0x1b4)]['slice'](0x2),command=args[0x0]&&!args[0x0][a0_0x2479d6(0x1a0)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x2479d6(0x197)](a0_0x2479d6(0x16f))||args[a0_0x2479d6(0x197)]('-h'),'version':args[a0_0x2479d6(0x197)](a0_0x2479d6(0x170))||args[a0_0x2479d6(0x197)]('-v')};for(let i=0x0;i<args[a0_0x2479d6(0x19c)];i++){args[i]==='--port'&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x2479d6(0x1c0)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}const explicitPort=flags['port'],host=flags['host']||DEFAULT_HOST;if(flags[a0_0x2479d6(0x189)]){const pkgPath=join(__dirname,'..',a0_0x2479d6(0x188)),pkg=JSON[a0_0x2479d6(0x1ba)](readFileSync(pkgPath,a0_0x2479d6(0x19b)));console['log']('Loxia\x20Autopilot\x20One\x20v'+pkg[a0_0x2479d6(0x189)]),process[a0_0x2479d6(0x196)](0x0);}function a0_0xd47f(_0x28ba65,_0x389645){_0x28ba65=_0x28ba65-0x16e;const _0x32baa7=a0_0x32ba();let _0xd47f39=_0x32baa7[_0x28ba65];return _0xd47f39;}if(flags[a0_0x2479d6(0x17f)]||!command){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x2479d6(0x1ba)](readFileSync(pkgPath,a0_0x2479d6(0x19b)));console[a0_0x2479d6(0x1b1)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x2479d6(0x189)]+'\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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20only\x20(no\x20UI\x20opened)\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:\x20auto-select\x20starting\x20from\x20'+DEFAULT_PORT+a0_0x2479d6(0x1a1)+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\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only\x20(headless)\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\x20specific\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\x20\x203.\x20Or\x20run\x20\x27loxia\x20serve\x27\x20for\x20headless\x20server\x20(connect\x20remotely)\x0a\x0aNote:\x20If\x20no\x20port\x20is\x20specified,\x20the\x20server\x20will\x20automatically\x20find\x0aan\x20available\x20port.\x20The\x20Terminal\x20UI\x20will\x20discover\x20the\x20server\x20port\x0aautomatically\x20from\x20the\x20port\x20registry.\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a'),process[a0_0x2479d6(0x196)](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x2f4d70}=await import('../src/services/portRegistry.js');return _0x2f4d70();}async function discoverBackend(){const _0x4c3e93=a0_0x2479d6;try{const _0x372c9f=await getPortRegistry();await _0x372c9f[_0x4c3e93(0x173)]();const _0x3eabce=await _0x372c9f[_0x4c3e93(0x17c)](_0x4c3e93(0x187));if(_0x3eabce)return{'host':_0x3eabce[_0x4c3e93(0x1bb)]||_0x4c3e93(0x183),'port':_0x3eabce['port'],'pid':_0x3eabce[_0x4c3e93(0x179)]};return null;}catch(_0x531fee){return null;}}async function checkServerRunning(_0x513663,_0x4bc4ad,_0x2af02f=0x1){for(let _0x15b938=0x0;_0x15b938<_0x2af02f;_0x15b938++){const _0x5cd0fc=await new Promise(_0x35e461=>{const _0x20ad61=a0_0xd47f,_0xd0678f=a0_0x52db66[_0x20ad61(0x1ad)]('http://'+_0x513663+':'+_0x4bc4ad+_0x20ad61(0x194),_0x20340a=>{const _0x3bd14c=_0x20ad61;_0x35e461(_0x20340a[_0x3bd14c(0x198)]===0xc8);});_0xd0678f['on']('error',()=>_0x35e461(![])),_0xd0678f[_0x20ad61(0x176)](0x7d0,()=>{const _0xa416c6=_0x20ad61;_0xd0678f[_0xa416c6(0x17d)](),_0x35e461(![]);});});if(_0x5cd0fc)return!![];_0x15b938<_0x2af02f-0x1&&await new Promise(_0x3d835f=>setTimeout(_0x3d835f,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x393db7=SERVER_STARTUP_TIMEOUT){const _0x27bc4c=a0_0x2479d6,_0x554f6d=Date['now']();while(Date[_0x27bc4c(0x1b3)]()-_0x554f6d<_0x393db7){const _0x320c97=await discoverBackend();if(_0x320c97){const _0x2b4746=await checkServerRunning(_0x320c97[_0x27bc4c(0x1bb)],_0x320c97['port']);if(_0x2b4746)return _0x320c97;}await new Promise(_0x54095d=>setTimeout(_0x54095d,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x12ae3c,_0x26455e,_0x38e0f2=SERVER_STARTUP_TIMEOUT){const _0x4d36c2=a0_0x2479d6,_0x52c7f3=Math[_0x4d36c2(0x199)](_0x38e0f2/SERVER_CHECK_INTERVAL),_0xd08253=await checkServerRunning(_0x12ae3c,_0x26455e,_0x52c7f3);return _0xd08253?{'host':_0x12ae3c,'port':_0x26455e}:null;}function openBrowser(_0x4d50b7){const _0x1682ae=a0_0x2479d6;let _0x3d916c,_0xd68df6;if(process[_0x1682ae(0x1b2)]==='darwin')_0x3d916c='open',_0xd68df6=[_0x4d50b7];else process['platform']===_0x1682ae(0x1bd)?(_0x3d916c=_0x1682ae(0x177),_0xd68df6=['/c',_0x1682ae(0x1a6),'\x22\x22',_0x4d50b7]):(_0x3d916c='xdg-open',_0xd68df6=[_0x4d50b7]);const _0x5cd5ae=spawn(_0x3d916c,_0xd68df6,{'detached':!![],'stdio':_0x1682ae(0x191)});_0x5cd5ae[_0x1682ae(0x193)](),_0x5cd5ae['on'](_0x1682ae(0x18a),()=>{const _0x541be9=_0x1682ae;console[_0x541be9(0x1b1)](_0x541be9(0x190)),console[_0x541be9(0x1b1)](_0x541be9(0x16e)+_0x4d50b7);});}function startServer(_0x4e3af3=![]){const _0x544a74=a0_0x2479d6,_0x10866a={...process.env};explicitPort&&(_0x10866a[_0x544a74(0x1a3)]=explicitPort[_0x544a74(0x18d)](),_0x10866a['PORT']=explicitPort[_0x544a74(0x18d)]());flags[_0x544a74(0x1bb)]&&(_0x10866a[_0x544a74(0x178)]=flags[_0x544a74(0x1bb)]);const _0x446130=join(__dirname,'..',_0x544a74(0x1af),_0x544a74(0x1b8)),_0x5eca59=spawn('node',[_0x446130],{'cwd':join(__dirname,'..'),'env':_0x10866a,'stdio':_0x4e3af3?[_0x544a74(0x191),'ignore',_0x544a74(0x191)]:_0x544a74(0x1a2),'detached':_0x4e3af3});return _0x4e3af3&&_0x5eca59[_0x544a74(0x193)](),_0x5eca59;}function startTerminalUIProcess(_0x422ee4,_0x37389c){const _0x4bd792=a0_0x2479d6,_0x54828c=join(__dirname,_0x4bd792(0x181)),_0x2ba1e6={...process.env,'LOXIA_PORT':_0x37389c[_0x4bd792(0x18d)](),'LOXIA_HOST':_0x422ee4},_0x24a21b=spawn('node',[_0x54828c],{'cwd':join(__dirname,'..'),'env':_0x2ba1e6,'stdio':'inherit'});return _0x24a21b;}const commands={'web':async()=>{const _0x20b585=a0_0x2479d6;console[_0x20b585(0x1b1)](_0x20b585(0x18e));const _0x57ccf9=startServer(![]);console['log']('Waiting\x20for\x20server\x20to\x20start...');let _0x446aa4;explicitPort?_0x446aa4=await waitForServerAtPort(host,explicitPort):_0x446aa4=await waitForServerWithDiscovery();if(_0x446aa4){const _0x1055ba='http://'+_0x446aa4[_0x20b585(0x1bb)]+':'+_0x446aa4[_0x20b585(0x17b)];console['log'](_0x20b585(0x172)+_0x1055ba),openBrowser(_0x1055ba);}else console[_0x20b585(0x1b1)](_0x20b585(0x1a7));process['on']('SIGINT',()=>_0x57ccf9[_0x20b585(0x19a)](_0x20b585(0x18b))),process['on'](_0x20b585(0x18c),()=>_0x57ccf9[_0x20b585(0x19a)](_0x20b585(0x18c))),_0x57ccf9['on'](_0x20b585(0x196),_0x4acd6c=>process[_0x20b585(0x196)](_0x4acd6c||0x0));},'plus-web':async()=>{const _0x42fda3=a0_0x2479d6;await commands[_0x42fda3(0x1bc)]();},'serve':async()=>{const _0x262b51=a0_0x2479d6;console[_0x262b51(0x1b1)](_0x262b51(0x18e));const _0x450c83=startServer(![]);console['log'](_0x262b51(0x185));let _0x4b678c;explicitPort?_0x4b678c=await waitForServerAtPort(host,explicitPort):_0x4b678c=await waitForServerWithDiscovery();if(_0x4b678c){const _0x3840ef=_0x262b51(0x1a5)+_0x4b678c[_0x262b51(0x1bb)]+':'+_0x4b678c[_0x262b51(0x17b)];console[_0x262b51(0x1b1)](_0x262b51(0x1b7)+_0x3840ef),console[_0x262b51(0x1b1)](_0x262b51(0x1b5)+_0x3840ef),console[_0x262b51(0x1b1)]('\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal'),console['log']('\x20\x20API\x20Health:\x20\x20\x20'+_0x3840ef+_0x262b51(0x1bf));}else console[_0x262b51(0x1b1)]('\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.'),console[_0x262b51(0x1b1)](_0x262b51(0x184));process['on']('SIGINT',()=>_0x450c83['kill'](_0x262b51(0x18b))),process['on']('SIGTERM',()=>_0x450c83[_0x262b51(0x19a)](_0x262b51(0x18c))),_0x450c83['on'](_0x262b51(0x196),_0x159ae8=>process[_0x262b51(0x196)](_0x159ae8||0x0));},'terminal':async()=>{const _0x5bc1e9=a0_0x2479d6;console[_0x5bc1e9(0x1b1)](_0x5bc1e9(0x1aa));let _0x3c235a=await discoverBackend();explicitPort&&(_0x3c235a={'host':host,'port':explicitPort});!_0x3c235a&&(console[_0x5bc1e9(0x18a)]('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console['error']('\x0aPlease\x20start\x20the\x20server\x20first:'),console['error'](_0x5bc1e9(0x180)),console[_0x5bc1e9(0x18a)](_0x5bc1e9(0x1b0)),console[_0x5bc1e9(0x18a)](_0x5bc1e9(0x195)),process[_0x5bc1e9(0x196)](0x1));const _0x36c110=await checkServerRunning(_0x3c235a[_0x5bc1e9(0x1bb)],_0x3c235a[_0x5bc1e9(0x17b)]);!_0x36c110&&(console[_0x5bc1e9(0x18a)](_0x5bc1e9(0x1b6)+_0x3c235a[_0x5bc1e9(0x1bb)]+':'+_0x3c235a[_0x5bc1e9(0x17b)]+_0x5bc1e9(0x18f)),console['error'](_0x5bc1e9(0x182)),process[_0x5bc1e9(0x196)](0x1));console[_0x5bc1e9(0x1b1)](_0x5bc1e9(0x17e)+_0x3c235a[_0x5bc1e9(0x1bb)]+':'+_0x3c235a[_0x5bc1e9(0x17b)]),console[_0x5bc1e9(0x1b1)](_0x5bc1e9(0x175));const _0x43f3be=startTerminalUIProcess(_0x3c235a[_0x5bc1e9(0x1bb)],_0x3c235a['port']);process['on'](_0x5bc1e9(0x18b),()=>_0x43f3be[_0x5bc1e9(0x19a)](_0x5bc1e9(0x18b))),process['on'](_0x5bc1e9(0x18c),()=>_0x43f3be[_0x5bc1e9(0x19a)](_0x5bc1e9(0x18c))),_0x43f3be['on']('exit',_0x1524ef=>process[_0x5bc1e9(0x196)](_0x1524ef||0x0));},'plus-terminal':async()=>{const _0x2785e1=a0_0x2479d6;console[_0x2785e1(0x1b1)]('Starting\x20Loxia\x20server\x20in\x20background...');const _0x138bfe=startServer(!![]);let _0x4a1486;explicitPort?_0x4a1486=await waitForServerAtPort(host,explicitPort):_0x4a1486=await waitForServerWithDiscovery();!_0x4a1486&&(console[_0x2785e1(0x18a)](_0x2785e1(0x1a9)),process[_0x2785e1(0x196)](0x1));console['log'](_0x2785e1(0x1a4)+_0x4a1486['host']+':'+_0x4a1486[_0x2785e1(0x17b)]),console[_0x2785e1(0x1b1)](_0x2785e1(0x175));const _0x4b9636=startTerminalUIProcess(_0x4a1486[_0x2785e1(0x1bb)],_0x4a1486[_0x2785e1(0x17b)]);_0x4b9636['on'](_0x2785e1(0x196),_0x45b0d4=>{const _0x524084=_0x2785e1;console[_0x524084(0x1b1)]('\x0aShutting\x20down\x20server...');try{process[_0x524084(0x19a)](_0x138bfe[_0x524084(0x179)],_0x524084(0x18c));}catch(_0x1e39cc){}process[_0x524084(0x196)](_0x45b0d4||0x0);}),process['on']('SIGINT',()=>{const _0x3b5bd0=_0x2785e1;_0x4b9636[_0x3b5bd0(0x19a)](_0x3b5bd0(0x18b));}),process['on'](_0x2785e1(0x18c),()=>{const _0x5165d5=_0x2785e1;_0x4b9636['kill'](_0x5165d5(0x18c));});}};commands[command]?commands[command]()[a0_0x2479d6(0x192)](_0x2b45ed=>{const _0x3fd305=a0_0x2479d6;console[_0x3fd305(0x18a)]('Error:',_0x2b45ed[_0x3fd305(0x1ab)]),process[_0x3fd305(0x196)](0x1);}):(console[a0_0x2479d6(0x18a)]('Unknown\x20command:\x20'+command),console[a0_0x2479d6(0x18a)](a0_0x2479d6(0x174)),process[a0_0x2479d6(0x196)](0x1));
|
package/bin/loxia-terminal-v2.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
function a0_0x30c3(_0x50a457,_0x546a42){_0x50a457=_0x50a457-0xd7;const _0x2bffdb=a0_0x2bff();let _0x30c322=_0x2bffdb[_0x50a457];return _0x30c322;}const a0_0x4c3ade=a0_0x30c3;(function(_0xefe935,_0x1d7181){const _0x4ec009=a0_0x30c3,_0x48b5e7=_0xefe935();while(!![]){try{const _0x39974f=parseInt(_0x4ec009(0x100))/0x1*(parseInt(_0x4ec009(0xef))/0x2)+parseInt(_0x4ec009(0x108))/0x3+parseInt(_0x4ec009(0xfc))/0x4+parseInt(_0x4ec009(0xde))/0x5*(-parseInt(_0x4ec009(0xf8))/0x6)+parseInt(_0x4ec009(0xff))/0x7+-parseInt(_0x4ec009(0xec))/0x8*(-parseInt(_0x4ec009(0x101))/0x9)+-parseInt(_0x4ec009(0xf6))/0xa;if(_0x39974f===_0x1d7181)break;else _0x48b5e7['push'](_0x48b5e7['shift']());}catch(_0x4db232){_0x48b5e7['push'](_0x48b5e7['shift']());}}}(a0_0x2bff,0xcc467));import{spawn}from'child_process';import a0_0x471e40 from'net';import a0_0x427e64 from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=a0_0x427e64['dirname'](__filename),projectRoot=a0_0x427e64[a0_0x4c3ade(0xee)](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x4c3ade(0xdb),SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x271dac,_0x4977d3){return new Promise(_0x528f8a=>{const _0x5434b7=a0_0x30c3,_0x2aeaec=new a0_0x471e40[(_0x5434b7(0xe3))]();_0x2aeaec[_0x5434b7(0xe5)](0x7d0),_0x2aeaec['on'](_0x5434b7(0xeb),()=>{const _0x708d3=_0x5434b7;_0x2aeaec[_0x708d3(0xe6)](),_0x528f8a(!![]);}),_0x2aeaec['on'](_0x5434b7(0xe2),()=>{const _0x371582=_0x5434b7;_0x2aeaec[_0x371582(0xe6)](),_0x528f8a(![]);}),_0x2aeaec['on'](_0x5434b7(0xd8),()=>{const _0x2e76bb=_0x5434b7;_0x2aeaec[_0x2e76bb(0xe6)](),_0x528f8a(![]);}),_0x2aeaec[_0x5434b7(0xeb)](_0x4977d3,_0x271dac);});}async function startServer(_0x452ccd,_0x1bec77){const _0x1a73be=a0_0x4c3ade;return console[_0x1a73be(0xed)](_0x1a73be(0xf4)),new Promise((_0x287325,_0x37cf2a)=>{const _0x34659a=_0x1a73be,_0x302f04=spawn(_0x34659a(0x102),[a0_0x427e64['join'](projectRoot,'bin/cli.js'),'--ui',_0x34659a(0xf5),'--host',_0x452ccd,_0x34659a(0x105),_0x1bec77[_0x34659a(0xe0)]()],{'detached':![],'stdio':[_0x34659a(0xf7),_0x34659a(0xfb),'pipe']});_0x302f04[_0x34659a(0xdf)]['on'](_0x34659a(0xf1),()=>{}),_0x302f04[_0x34659a(0x107)]['on'](_0x34659a(0xf1),()=>{}),_0x302f04['on']('error',_0x49ba31=>{const _0x4a4a3b=_0x34659a;console[_0x4a4a3b(0xd8)]('Failed\x20to\x20start\x20server:',_0x49ba31['message']),_0x37cf2a(_0x49ba31);});const _0x3dc794=Date[_0x34659a(0xf3)](),_0xbe6be7=setInterval(async()=>{const _0x30a4a1=_0x34659a,_0x2b9415=await isServerRunning(_0x452ccd,_0x1bec77);if(_0x2b9415)clearInterval(_0xbe6be7),console[_0x30a4a1(0xed)](_0x30a4a1(0xd7)+_0x452ccd+':'+_0x1bec77),_0x287325();else Date['now']()-_0x3dc794>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0xbe6be7),_0x302f04['kill'](),_0x37cf2a(new Error(_0x30a4a1(0xea))));},0x1f4);});}function a0_0x2bff(){const _0x193d51=['Server\x20startup\x20timeout','connect','2512wGXgfX','log','dirname','328596tKSDFJ','message','data','argv','now','🚀\x20Starting\x20Loxia\x20server...','web','38928520cBFEdG','ignore','6sTHwKA','💡\x20Troubleshooting:','\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details','pipe','2769520vArdWU','✓\x20Server\x20is\x20already\x20running\x20at\x20','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','5865377OTnyrU','8MVYeGM','21753KtfDCB','node','\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080','\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI','--port','...','stderr','3470691bkPzvO','✓\x20Server\x20started\x20at\x20','error','exit','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','localhost','slice','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','154735axCDMG','stdout','toString','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','timeout','Socket','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','setTimeout','destroy','length','✗\x20Server\x20is\x20not\x20running','--host'];a0_0x2bff=function(){return _0x193d51;};return a0_0x2bff();}async function main(){const _0x11623e=a0_0x4c3ade;try{console[_0x11623e(0xed)](_0x11623e(0xdd)),console['log'](_0x11623e(0x104)),console[_0x11623e(0xed)](_0x11623e(0xdd)),console[_0x11623e(0xed)]('');const _0x5588f1=process[_0x11623e(0xf2)][_0x11623e(0xdc)](0x2);let _0x45ff22=DEFAULT_HOST,_0x5bf10d=DEFAULT_PORT;for(let _0x408c7c=0x0;_0x408c7c<_0x5588f1[_0x11623e(0xe7)];_0x408c7c++){if(_0x5588f1[_0x408c7c]===_0x11623e(0xe9)&&_0x5588f1[_0x408c7c+0x1])_0x45ff22=_0x5588f1[_0x408c7c+0x1],_0x408c7c++;else _0x5588f1[_0x408c7c]===_0x11623e(0x105)&&_0x5588f1[_0x408c7c+0x1]&&(_0x5bf10d=parseInt(_0x5588f1[_0x408c7c+0x1],0xa),_0x408c7c++);}console[_0x11623e(0xed)](_0x11623e(0xda)+_0x45ff22+':'+_0x5bf10d+_0x11623e(0x106));const _0x2a1f5a=await isServerRunning(_0x45ff22,_0x5bf10d);!_0x2a1f5a?(console[_0x11623e(0xed)](_0x11623e(0xe8)),await startServer(_0x45ff22,_0x5bf10d)):console[_0x11623e(0xed)](_0x11623e(0xfd)+_0x45ff22+':'+_0x5bf10d),console[_0x11623e(0xed)](''),console[_0x11623e(0xed)](_0x11623e(0xe4)),console[_0x11623e(0xed)](''),await new Promise(_0x47ab77=>setTimeout(_0x47ab77,0x1f4)),process.env.LOXIA_HOST=_0x45ff22,process.env.LOXIA_PORT=_0x5bf10d['toString'](),await import('../src/interfaces/terminal/index.js');}catch(_0x5150d7){console['error'](''),console[_0x11623e(0xd8)](_0x11623e(0xe1)),console['error']('\x20\x20',_0x5150d7[_0x11623e(0xf0)]),console[_0x11623e(0xd8)](''),console[_0x11623e(0xd8)](_0x11623e(0xf9)),console[_0x11623e(0xd8)](_0x11623e(0x103)),console[_0x11623e(0xd8)](_0x11623e(0xfe)),console[_0x11623e(0xd8)](_0x11623e(0xfa)),console['error'](''),process[_0x11623e(0xd9)](0x1);}}main();
|
package/bin/loxia-terminal.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function a0_0x554e(_0x1959df,_0x2ab1c7){_0x1959df=_0x1959df-0x78;const _0x4523e0=a0_0x4523();let _0x554e33=_0x4523e0[_0x1959df];return _0x554e33;}const a0_0x334f19=a0_0x554e;(function(_0x36c900,_0x4d6d9a){const _0x30e765=a0_0x554e,_0x19417f=_0x36c900();while(!![]){try{const _0x45f92a=parseInt(_0x30e765(0x9e))/0x1+parseInt(_0x30e765(0x93))/0x2*(parseInt(_0x30e765(0x96))/0x3)+-parseInt(_0x30e765(0x8f))/0x4+parseInt(_0x30e765(0x91))/0x5*(-parseInt(_0x30e765(0x8b))/0x6)+-parseInt(_0x30e765(0x99))/0x7*(-parseInt(_0x30e765(0x9d))/0x8)+-parseInt(_0x30e765(0x8a))/0x9*(-parseInt(_0x30e765(0x88))/0xa)+parseInt(_0x30e765(0x7c))/0xb;if(_0x45f92a===_0x4d6d9a)break;else _0x19417f['push'](_0x19417f['shift']());}catch(_0x30a0b0){_0x19417f['push'](_0x19417f['shift']());}}}(a0_0x4523,0xb6d40));import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x334f19(0x89)][a0_0x334f19(0x97)](0x2),options={'host':a0_0x334f19(0x7d),'port':0x1f90};for(let i=0x0;i<args[a0_0x334f19(0x9b)];i++){const arg=args[i];if(arg===a0_0x334f19(0x8c)||arg==='-h')options[a0_0x334f19(0x84)]=args[++i];else{if(arg===a0_0x334f19(0x8e)||arg==='-p')options[a0_0x334f19(0x7a)]=parseInt(args[++i],0xa);else arg===a0_0x334f19(0x78)&&(console['log']('\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a'),process[a0_0x334f19(0x90)](0x0));}}process.env.LOXIA_HOST&&(options[a0_0x334f19(0x84)]=process.env.LOXIA_HOST);process.env.LOXIA_PORT&&(options[a0_0x334f19(0x7a)]=parseInt(process.env.LOXIA_PORT,0xa));!process[a0_0x334f19(0x8d)][a0_0x334f19(0x86)]&&(console[a0_0x334f19(0x95)](a0_0x334f19(0x94)),console[a0_0x334f19(0x95)](''),console[a0_0x334f19(0x95)]('The\x20terminal\x20UI\x20cannot\x20run\x20in:'),console[a0_0x334f19(0x95)](a0_0x334f19(0x81)),console[a0_0x334f19(0x95)](a0_0x334f19(0x79)),console[a0_0x334f19(0x95)](a0_0x334f19(0x7b)),console[a0_0x334f19(0x95)](a0_0x334f19(0x7e)),console[a0_0x334f19(0x95)](''),console[a0_0x334f19(0x95)](a0_0x334f19(0x80)),console['error']('\x20\x20npm\x20run\x20terminal-ui'),console['error'](''),console[a0_0x334f19(0x95)]('Or\x20use\x20the\x20web\x20UI\x20instead:'),console[a0_0x334f19(0x95)]('\x20\x20npm\x20start'),process['exit'](0x1));console[a0_0x334f19(0x9a)](a0_0x334f19(0x9c)),console[a0_0x334f19(0x9a)](a0_0x334f19(0x83)+options['host']+':'+options[a0_0x334f19(0x7a)]),console[a0_0x334f19(0x9a)](a0_0x334f19(0x92));const instance=startTerminalUI(options);instance[a0_0x334f19(0x98)]()[a0_0x334f19(0x85)](()=>{const _0x1be76f=a0_0x334f19;console[_0x1be76f(0x9a)](_0x1be76f(0x87)),process[_0x1be76f(0x90)](0x0);})[a0_0x334f19(0x82)](_0x242f30=>{const _0x4168ae=a0_0x334f19;console[_0x4168ae(0x95)](_0x4168ae(0x7f),_0x242f30),process['exit'](0x1);});function a0_0x4523(){const _0x387d61=['then','isTTY','\x0aTerminal\x20UI\x20exited','30010beRKBz','argv','1449QqGUzZ','6049374erdFHo','--host','stdin','--port','4137120ebiFpv','exit','5eRhbKE','Press\x20Ctrl+C\x20to\x20exit\x0a','18pVySdR','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','error','364053jVTYQp','slice','waitUntilExit','7664377XjAVmT','log','length','Starting\x20Loxia\x20Terminal\x20UI...','8BlkBLT','98196WLbsGc','--help','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','port','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','252406BkDCXG','localhost','\x20\x20-\x20Some\x20CI/CD\x20environments','\x0aTerminal\x20UI\x20error:','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','catch','Connecting\x20to:\x20','host'];a0_0x4523=function(){return _0x387d61;};return a0_0x4523();}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const a0_0x1382c1=a0_0x1cb8;(function(_0x212ec8,_0x20cbad){const _0x3beaf0=a0_0x1cb8,_0x3e38ad=_0x212ec8();while(!![]){try{const _0xc99544=-parseInt(_0x3beaf0(0x1b8))/0x1*(-parseInt(_0x3beaf0(0x1aa))/0x2)+parseInt(_0x3beaf0(0x1b3))/0x3*(parseInt(_0x3beaf0(0x1bf))/0x4)+parseInt(_0x3beaf0(0x1a8))/0x5+parseInt(_0x3beaf0(0x1c0))/0x6*(parseInt(_0x3beaf0(0x19c))/0x7)+parseInt(_0x3beaf0(0x1a5))/0x8+parseInt(_0x3beaf0(0x1b6))/0x9*(parseInt(_0x3beaf0(0x19e))/0xa)+-parseInt(_0x3beaf0(0x19a))/0xb;if(_0xc99544===_0x20cbad)break;else _0x3e38ad['push'](_0x3e38ad['shift']());}catch(_0x4787dd){_0x3e38ad['push'](_0x3e38ad['shift']());}}}(a0_0x26f2,0x8c912));import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x2614ed from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process.env.PORT||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;async function checkServerReady(_0x1952a8=0xa,_0x31d911=0x1f4){const _0x507827=a0_0x1cb8;for(let _0x339a6d=0x0;_0x339a6d<_0x1952a8;_0x339a6d++){try{return await new Promise((_0x3b704b,_0x1d6ab9)=>{const _0x5a1a3b=a0_0x1cb8,_0x430cd3=a0_0x2614ed['get'](_0x5a1a3b(0x1bc)+SERVER_PORT+_0x5a1a3b(0x1ad),_0xddd87a=>{const _0x5a81eb=_0x5a1a3b;_0xddd87a['statusCode']===0xc8?_0x3b704b():_0x1d6ab9(new Error('Server\x20returned\x20'+_0xddd87a[_0x5a81eb(0x197)]));});_0x430cd3['on'](_0x5a1a3b(0x1bd),_0x1d6ab9),_0x430cd3['setTimeout'](0x3e8,()=>{const _0x1bcc79=_0x5a1a3b;_0x430cd3[_0x1bcc79(0x1a4)](),_0x1d6ab9(new Error('Timeout'));});}),console[_0x507827(0x1b0)](_0x507827(0x1a9)),!![];}catch(_0x239bca){_0x339a6d<_0x1952a8-0x1&&await new Promise(_0x390b3d=>setTimeout(_0x390b3d,_0x31d911));}}return console[_0x507827(0x1b0)](_0x507827(0x1bb)),![];}function a0_0x1cb8(_0x4776d4,_0x144f18){_0x4776d4=_0x4776d4-0x196;const _0x26f252=a0_0x26f2();let _0x1cb80a=_0x26f252[_0x4776d4];return _0x1cb80a;}async function startServer(){return new Promise(_0x59fe73=>{const _0x197c16=a0_0x1cb8;console[_0x197c16(0x1b0)]('🚀\x20Starting\x20Loxia\x20server...');const _0x4ce3c1=join(rootDir,'src','index.js');serverProcess=spawn(_0x197c16(0x1c1),[_0x4ce3c1],{'cwd':rootDir,'env':{...process.env},'stdio':['ignore',_0x197c16(0x19d),_0x197c16(0x19d)],'detached':![]}),serverProcess[_0x197c16(0x1a6)]['on'](_0x197c16(0x19b),_0x5ded5c=>{const _0x1f0f8d=_0x197c16,_0x2b6972=_0x5ded5c[_0x1f0f8d(0x1c2)]()[_0x1f0f8d(0x1b5)]();_0x2b6972&&console['log'](_0x1f0f8d(0x196)+_0x2b6972);}),serverProcess[_0x197c16(0x198)]['on'](_0x197c16(0x19b),_0x58f866=>{const _0x1fc9d4=_0x197c16,_0x111773=_0x58f866['toString']()[_0x1fc9d4(0x1b5)]();_0x111773&&!_0x111773[_0x1fc9d4(0x19f)](_0x1fc9d4(0x1a2))&&console[_0x1fc9d4(0x1bd)](_0x1fc9d4(0x1b1)+_0x111773);}),serverProcess['on']('error',_0x321035=>{const _0x24357a=_0x197c16;console[_0x24357a(0x1bd)]('Failed\x20to\x20start\x20server:',_0x321035[_0x24357a(0x1ae)]),process[_0x24357a(0x1a1)](0x1);}),serverProcess['on']('exit',(_0x41d6c2,_0x46245f)=>{const _0x5deacb=_0x197c16;_0x41d6c2!==null&&_0x41d6c2!==0x0&&(console[_0x5deacb(0x1bd)](_0x5deacb(0x1b7)+_0x41d6c2),process['exit'](_0x41d6c2));}),setTimeout(_0x59fe73,STARTUP_WAIT);});}async function startTerminalUI(){const _0x302969=a0_0x1cb8;console[_0x302969(0x1b0)](_0x302969(0x1b4)),console[_0x302969(0x1b0)]('');const _0x218cd9=join(rootDir,'bin','loxia-terminal.js'),_0x35b377=spawn(_0x302969(0x1c1),[_0x218cd9],{'cwd':rootDir,'env':{...process.env},'stdio':_0x302969(0x1af)});return _0x35b377['on'](_0x302969(0x1bd),_0x255f10=>{const _0x1f23e1=_0x302969;console[_0x1f23e1(0x1bd)]('Failed\x20to\x20start\x20Terminal\x20UI:',_0x255f10[_0x1f23e1(0x1ae)]),cleanup(),process['exit'](0x1);}),_0x35b377['on']('exit',_0x26d885=>{const _0xd0fde4=_0x302969;console[_0xd0fde4(0x1b0)](_0xd0fde4(0x1ab)),cleanup(),process[_0xd0fde4(0x1a1)](_0x26d885||0x0);}),_0x35b377;}function cleanup(){const _0x3b8e82=a0_0x1cb8;serverProcess&&!serverProcess[_0x3b8e82(0x1b2)]&&(console[_0x3b8e82(0x1b0)](_0x3b8e82(0x1ba)),serverProcess[_0x3b8e82(0x1a0)](_0x3b8e82(0x1c3)),setTimeout(()=>{const _0x12a138=_0x3b8e82;!serverProcess[_0x12a138(0x1b2)]&&serverProcess[_0x12a138(0x1a0)](_0x12a138(0x1be));},0x1388));}process['on'](a0_0x1382c1(0x1ac),()=>{const _0x15c1ba=a0_0x1382c1;console['log'](_0x15c1ba(0x1a7)),cleanup(),process[_0x15c1ba(0x1a1)](0x0);}),process['on'](a0_0x1382c1(0x1c3),()=>{const _0x2f17dc=a0_0x1382c1;console[_0x2f17dc(0x1b0)](_0x2f17dc(0x199)),cleanup(),process[_0x2f17dc(0x1a1)](0x0);}),process['on'](a0_0x1382c1(0x1a1),()=>{cleanup();});function a0_0x26f2(){const _0x206b73=['ExperimentalWarning','╔════════════════════════════════════════════════╗','destroy','6306456HHmGua','stdout','\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...','5108355VSzaBV','✅\x20Server\x20is\x20ready!','4chSdWF','\x0a👋\x20Terminal\x20UI\x20closed.','SIGINT','/health','message','inherit','log','[SERVER\x20ERROR]\x20','killed','3WexoSJ','🖥️\x20\x20Starting\x20Terminal\x20UI...','trim','4635WSGNBh','Server\x20exited\x20with\x20code\x20','64721PspyxD','╚════════════════════════════════════════════════╝','🛑\x20Stopping\x20server...','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','http://localhost:','error','SIGKILL','4181844OjsICn','12YRpJzt','node','toString','SIGTERM','Error\x20during\x20startup:','[SERVER]\x20','statusCode','stderr','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','42488127pocqQz','data','3248483isyEXO','pipe','10200KOqLNU','includes','kill','exit'];a0_0x26f2=function(){return _0x206b73;};return a0_0x26f2();}async function main(){const _0x4006e2=a0_0x1382c1;console[_0x4006e2(0x1b0)](_0x4006e2(0x1a3)),console[_0x4006e2(0x1b0)]('║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║'),console[_0x4006e2(0x1b0)](_0x4006e2(0x1b9)),console[_0x4006e2(0x1b0)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x5a4e84){console[_0x4006e2(0x1bd)](_0x4006e2(0x1c4),_0x5a4e84[_0x4006e2(0x1ae)]),cleanup(),process['exit'](0x1);}}main();
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x45e56b=a0_0x643e;(function(_0x1c1ad7,_0x57f4c0){const _0x579db2=a0_0x643e,_0x1c09e6=_0x1c1ad7();while(!![]){try{const _0x52af76=-parseInt(_0x579db2(0x118))/0x1+parseInt(_0x579db2(0x121))/0x2*(-parseInt(_0x579db2(0x101))/0x3)+-parseInt(_0x579db2(0x10a))/0x4*(parseInt(_0x579db2(0xf9))/0x5)+-parseInt(_0x579db2(0x127))/0x6*(parseInt(_0x579db2(0xfb))/0x7)+parseInt(_0x579db2(0x12b))/0x8*(-parseInt(_0x579db2(0xf6))/0x9)+parseInt(_0x579db2(0x108))/0xa*(parseInt(_0x579db2(0x11b))/0xb)+parseInt(_0x579db2(0x10e))/0xc;if(_0x52af76===_0x57f4c0)break;else _0x1c09e6['push'](_0x1c09e6['shift']());}catch(_0xaa6d79){_0x1c09e6['push'](_0x1c09e6['shift']());}}}(a0_0x415f,0x7a530));function a0_0x415f(){const _0x3d7438=['dirname','promises','❌\x20Installation\x20failed:','\x20\x20\x20⚠️\x20\x20Python\x20not\x20found\x20-\x20skipping\x20Python\x20scanners','375312GAmWlY','location','\x0aYou\x20can\x20manually\x20install\x20scanners:','\x20\x20\x20✅\x20Semgrep\x20already\x20installed:\x20','1489576RvIPiQ','\x20\x20\x20✅\x20eslint-plugin-security\x20is\x20installed\x0a','\x0a═══════════════════════════════════════════════════════════','📦\x20Checking\x20ESLint\x20Security\x20Plugin...','log','🔍\x20Installing\x20Semgrep...','mkdir','\x20\x20Installing\x20Security\x20Scanners','\x20\x20\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20Using\x20system-installed\x20Semgrep\x0a','\x20\x20\x20✅\x20Python\x20found:\x20','startsWith','eslint-plugin-security','\x20\x20\x20✅\x20Semgrep\x20installed\x20successfully','v1.55.0','trim','/opt/homebrew','url','exit','message','node_modules','chmod','\x20\x20Platform:\x20','\x20\x20\x20Installing\x20','pipe','\x20\x20\x20✅\x20','═══════════════════════════════════════════════════════════','statusCode','semgrep','--user','catch','pip-audit','\x20already\x20installed','9EMtUOM','stdout','═══════════════════════════════════════════════════════════\x0a','3533015ZPoqgU','python3\x20--version','21wkgClz','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20semgrep\x0a','\x20\x20\x20Run:\x20npm\x20install\x20--save-dev\x20eslint-plugin-security\x0a','...','\x20\x20\x20Location:\x20','then','1041699FOMoSx','platform','\x20\x20\x20Semgrep\x20not\x20found\x20in\x20PATH,\x20installing\x20standalone\x20binary...','.scanners','python\x20--version','headers','close','100XBbmle','arch','4hrDYfF','\x20\x20\x20You\x20can\x20install\x20manually:\x20pip\x20install\x20','python','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20','21839844kzXoji','/usr/local/Cellar','\x20\x20npm\x20install\x20--save-dev\x20eslint-plugin-security','includes','🐍\x20Checking\x20Python\x20scanners...','\x20\x20\x20To\x20enable\x20Python\x20scanning,\x20install\x20Python\x20and\x20run:','error','Failed\x20to\x20download:\x20HTTP\x20','python3','finish','316175ULGvMq','\x20-m\x20pip\x20show\x20','join','849365oMUZEj','unlink','\x20\x20\x20⚠️\x20\x20Failed\x20to\x20install\x20Semgrep:\x20','\x20\x20\x20Downloading\x20from\x20','bandit','\x20\x20\x20Please\x20install\x20manually:\x20https://semgrep.dev/docs/getting-started/\x0a','4hfrnLj','\x20\x20\x20Note:\x20To\x20use\x20system-wide,\x20add\x20to\x20PATH\x20or\x20install\x20globally:'];a0_0x415f=function(){return _0x3d7438;};return a0_0x415f();}import{exec}from'child_process';import{promisify}from'util';import a0_0x163145 from'https';import a0_0x2ee74f from'http';import a0_0x2c9f45 from'fs';import a0_0xf5c282 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_0xf5c282[a0_0x45e56b(0x123)](__filename),SCANNER_DIR=a0_0xf5c282['join'](__dirname,'..',a0_0x45e56b(0xe9),a0_0x45e56b(0x104)),SEMGREP_VERSION=a0_0x45e56b(0x139);console[a0_0x45e56b(0x12f)](a0_0x45e56b(0xef)),console[a0_0x45e56b(0x12f)](a0_0x45e56b(0x132)),console[a0_0x45e56b(0x12f)](a0_0x45e56b(0xeb)+process[a0_0x45e56b(0x102)]+'\x20('+process['arch']+')'),console['log'](a0_0x45e56b(0xf8));function a0_0x643e(_0x4ae9e5,_0x3f831c){_0x4ae9e5=_0x4ae9e5-0xe6;const _0x415f9f=a0_0x415f();let _0x643e21=_0x415f9f[_0x4ae9e5];return _0x643e21;}async function installScanners(){const _0x433366=a0_0x45e56b;await a0_0x2c9f45[_0x433366(0x124)][_0x433366(0x131)](SCANNER_DIR,{'recursive':!![]}),await checkESLintSecurity(),await installSemgrep(),await installPythonScanners(),console[_0x433366(0x12f)](_0x433366(0x12d)),console[_0x433366(0x12f)]('\x20\x20Installation\x20Complete'),console[_0x433366(0x12f)](_0x433366(0xf8));}async function checkESLintSecurity(){const _0x186b30=a0_0x45e56b;console[_0x186b30(0x12f)](_0x186b30(0x12e));try{await import(_0x186b30(0x137)),console[_0x186b30(0x12f)](_0x186b30(0x12c));}catch(_0xaf42ab){console[_0x186b30(0x12f)]('\x20\x20\x20⚠️\x20\x20eslint-plugin-security\x20not\x20found'),console[_0x186b30(0x12f)](_0x186b30(0xfd));}}async function installSemgrep(){const _0x23a9d0=a0_0x45e56b;console[_0x23a9d0(0x12f)](_0x23a9d0(0x130));const _0x42ab93=process[_0x23a9d0(0x102)],_0x2a9b15=process[_0x23a9d0(0x109)];try{const _0x11ec95=await execAsync('semgrep\x20--version',{'timeout':0x1388});console[_0x23a9d0(0x12f)](_0x23a9d0(0x12a)+_0x11ec95[_0x23a9d0(0xf7)][_0x23a9d0(0x13a)]()),console[_0x23a9d0(0x12f)](_0x23a9d0(0x134));return;}catch(_0x327afb){console[_0x23a9d0(0x12f)](_0x23a9d0(0x103));}const _0x2865de=getSemgrepBinaryInfo(_0x42ab93,_0x2a9b15);if(!_0x2865de){console[_0x23a9d0(0x12f)]('\x20\x20\x20⚠️\x20\x20No\x20Semgrep\x20binary\x20available\x20for\x20'+_0x42ab93+'-'+_0x2a9b15),console['log'](_0x23a9d0(0x120));return;}try{const _0x3eb7c5=a0_0xf5c282[_0x23a9d0(0x11a)](SCANNER_DIR,_0x23a9d0(0xf1));console['log'](_0x23a9d0(0x11e)+_0x2865de[_0x23a9d0(0xe6)]+_0x23a9d0(0xfe)),await downloadFile(_0x2865de[_0x23a9d0(0xe6)],_0x3eb7c5),await a0_0x2c9f45[_0x23a9d0(0x124)][_0x23a9d0(0xea)](_0x3eb7c5,0x1ed),console[_0x23a9d0(0x12f)](_0x23a9d0(0x138)),console[_0x23a9d0(0x12f)](_0x23a9d0(0xff)+_0x3eb7c5+'\x0a'),console['log'](_0x23a9d0(0x122)),console[_0x23a9d0(0x12f)](_0x23a9d0(0x133));}catch(_0x1312b0){console[_0x23a9d0(0x12f)](_0x23a9d0(0x11d)+_0x1312b0[_0x23a9d0(0xe8)]),console[_0x23a9d0(0x12f)](_0x23a9d0(0xfc));}}function getSemgrepBinaryInfo(_0x309c08,_0x4bb11e){return null;}async function installPythonScanners(){const _0x35b132=a0_0x45e56b;console['log'](_0x35b132(0x112));let _0x11bdf1=null;try{await execAsync(_0x35b132(0xfa),{'timeout':0x1388}),_0x11bdf1=_0x35b132(0x116);}catch(_0x106cc0){try{await execAsync(_0x35b132(0x105),{'timeout':0x1388}),_0x11bdf1=_0x35b132(0x10c);}catch(_0x26b4fd){console[_0x35b132(0x12f)](_0x35b132(0x126)),console[_0x35b132(0x12f)](_0x35b132(0x113)),console[_0x35b132(0x12f)]('\x20\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit\x20checkov\x20yamllint\x0a');return;}}console[_0x35b132(0x12f)](_0x35b132(0x135)+_0x11bdf1),await installViaPip(_0x35b132(0xf1),_0x11bdf1),await installViaPip(_0x35b132(0x11f),_0x11bdf1),await installViaPip(_0x35b132(0xf4),_0x11bdf1),await installViaPip('checkov',_0x11bdf1),await installViaPip('yamllint',_0x11bdf1),console[_0x35b132(0x12f)]('');}async function isHomebrewPython(_0x4c8923){const _0x501eee=a0_0x45e56b;try{const {stdout:_0x39c196}=await execAsync(_0x4c8923+'\x20-c\x20\x22import\x20sys;\x20print(sys.prefix)\x22',{'timeout':0x1388});return _0x39c196[_0x501eee(0x111)](_0x501eee(0x13b))||_0x39c196['includes'](_0x501eee(0x10f));}catch{return![];}}async function installViaPip(_0x576f4e,_0x120351){const _0x2db279=a0_0x45e56b;try{const _0x16c210=await execAsync(_0x120351+_0x2db279(0x119)+_0x576f4e,{'timeout':0x1388});return console[_0x2db279(0x12f)](_0x2db279(0xee)+_0x576f4e+_0x2db279(0xf5)),!![];}catch(_0x5170f7){console['log'](_0x2db279(0xec)+_0x576f4e+_0x2db279(0xfe));try{const _0x460bbb=await isHomebrewPython(_0x120351),_0x2fcb44=_0x460bbb?'':_0x2db279(0xf2),_0x282469=(_0x120351+'\x20-m\x20pip\x20install\x20'+_0x2fcb44+'\x20'+_0x576f4e)['replace'](/\s+/g,'\x20')[_0x2db279(0x13a)]();return await execAsync(_0x282469,{'timeout':0xea60}),console[_0x2db279(0x12f)](_0x2db279(0xee)+_0x576f4e+'\x20installed\x20successfully'),!![];}catch(_0x529a07){return console['log'](_0x2db279(0x10d)+_0x576f4e+':\x20'+_0x529a07['message']),console['log'](_0x2db279(0x10b)+_0x576f4e),![];}}}async function downloadFile(_0x5857a6,_0x4c77cf){return new Promise((_0x384288,_0x37728d)=>{const _0x36480b=a0_0x643e,_0x595899=_0x5857a6[_0x36480b(0x136)]('https')?a0_0x163145:a0_0x2ee74f;_0x595899['get'](_0x5857a6,_0x1b6532=>{const _0x375753=_0x36480b;if(_0x1b6532[_0x375753(0xf0)]===0x12e||_0x1b6532[_0x375753(0xf0)]===0x12d){downloadFile(_0x1b6532[_0x375753(0x106)][_0x375753(0x128)],_0x4c77cf)[_0x375753(0x100)](_0x384288)[_0x375753(0xf3)](_0x37728d);return;}if(_0x1b6532['statusCode']!==0xc8){_0x37728d(new Error(_0x375753(0x115)+_0x1b6532[_0x375753(0xf0)]));return;}const _0x2cf744=createWriteStream(_0x4c77cf);_0x1b6532[_0x375753(0xed)](_0x2cf744),_0x2cf744['on'](_0x375753(0x117),()=>{const _0x38a673=_0x375753;_0x2cf744[_0x38a673(0x107)](),_0x384288();}),_0x2cf744['on'](_0x375753(0x114),_0x58cd18=>{const _0x3f5897=_0x375753;a0_0x2c9f45[_0x3f5897(0x11c)](_0x4c77cf,()=>{}),_0x37728d(_0x58cd18);});})['on'](_0x36480b(0x114),_0x37728d);});}installScanners()[a0_0x45e56b(0xf3)](_0x5f317c=>{const _0x249bd5=a0_0x45e56b;console[_0x249bd5(0x114)](_0x249bd5(0x125),_0x5f317c['message']),console[_0x249bd5(0x114)](_0x249bd5(0x129)),console['error'](_0x249bd5(0x110)),console['error']('\x20\x20pip\x20install\x20semgrep\x20bandit\x20pip-audit'),process[_0x249bd5(0xe7)](0x0);});
|
package/scripts/watchdog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
const a0_0x4726bb=a0_0x1210;(function(_0x5125c9,_0x4dd2ff){const _0x5d37fa=a0_0x1210,_0x4492e0=_0x5125c9();while(!![]){try{const _0x2e6f1b=parseInt(_0x5d37fa(0x142))/0x1*(parseInt(_0x5d37fa(0x14b))/0x2)+parseInt(_0x5d37fa(0x151))/0x3+parseInt(_0x5d37fa(0x12b))/0x4*(-parseInt(_0x5d37fa(0x12c))/0x5)+-parseInt(_0x5d37fa(0x14a))/0x6+parseInt(_0x5d37fa(0x12e))/0x7*(-parseInt(_0x5d37fa(0x134))/0x8)+parseInt(_0x5d37fa(0x13a))/0x9*(parseInt(_0x5d37fa(0x159))/0xa)+parseInt(_0x5d37fa(0x128))/0xb*(parseInt(_0x5d37fa(0x130))/0xc);if(_0x2e6f1b===_0x4dd2ff)break;else _0x4492e0['push'](_0x4492e0['shift']());}catch(_0x44e0e7){_0x4492e0['push'](_0x4492e0['shift']());}}}(a0_0x5ddb,0x18952));const {spawn,execSync}=require(a0_0x4726bb(0x14e)),path=require(a0_0x4726bb(0x13e)),fs=require('fs'),logFile=path[a0_0x4726bb(0x13c)](__dirname,a0_0x4726bb(0x156));function log(_0x2c19f7){const _0x5acdfd=a0_0x4726bb,_0x2f4010=new Date()[_0x5acdfd(0x139)](),_0x23f408='['+_0x2f4010+']\x20'+_0x2c19f7+'\x0a';console[_0x5acdfd(0x12d)](_0x2c19f7);try{fs[_0x5acdfd(0x152)](logFile,_0x23f408);}catch(_0x38313){}}function a0_0x1210(_0x522f14,_0x53f1cc){_0x522f14=_0x522f14-0x128;const _0x5ddbd8=a0_0x5ddb();let _0x1210f5=_0x5ddbd8[_0x522f14];return _0x1210f5;}log(a0_0x4726bb(0x158));function a0_0x5ddb(){const _0x15fe28=['watchdog.log','pid','[Watchdog]\x20Script\x20loaded','1372130VFJbvB','674916HKXTDn','--delay','kill','4eejofO','88095gVuOLo','log','49RxRwuU','win32','12TsyXpc','now','slice','[Watchdog]\x20Executing:\x20','98248LHHuTh','\x20has\x20terminated','loxia\x20web','ignore','\x20to\x20exit...','toISOString','9FOSchW','catch','join','[Watchdog]\x20Loxia\x20restarted\x20with\x20PID\x20','path','delay','ms\x20before\x20restart...','[Watchdog]\x20Watchdog\x20exiting...','132716WkBhbQ','message','split','[Watchdog]\x20Started\x20with\x20options:','platform','exit','command','[Watchdog]\x20Waiting\x20for\x20parent\x20process\x20','882396dEhglX','2UqqSCt','[Watchdog]\x20Waiting\x20','\x20still\x20running\x20after\x20','child_process','--command','ms,\x20proceeding\x20anyway','60171lBsSjs','appendFileSync','unref','[Watchdog]\x20Error:\x20','length'];a0_0x5ddb=function(){return _0x15fe28;};return a0_0x5ddb();}function parseArgs(){const _0x5eb4db=a0_0x4726bb,_0x2e57fc=process['argv'][_0x5eb4db(0x132)](0x2),_0x5e0f10={'delay':0x1388,'command':_0x5eb4db(0x136),'pid':null};for(let _0x1fe79d=0x0;_0x1fe79d<_0x2e57fc[_0x5eb4db(0x155)];_0x1fe79d++){switch(_0x2e57fc[_0x1fe79d]){case _0x5eb4db(0x129):_0x5e0f10[_0x5eb4db(0x13f)]=parseInt(_0x2e57fc[++_0x1fe79d],0xa)||0x1388;break;case _0x5eb4db(0x14f):_0x5e0f10[_0x5eb4db(0x148)]=_0x2e57fc[++_0x1fe79d]||_0x5eb4db(0x136);break;case'--pid':_0x5e0f10[_0x5eb4db(0x157)]=parseInt(_0x2e57fc[++_0x1fe79d],0xa)||null;break;}}return _0x5e0f10;}function isProcessRunning(_0x34fd4e){const _0x291152=a0_0x4726bb;try{return process[_0x291152(0x12a)](_0x34fd4e,0x0),!![];}catch(_0x18106b){return![];}}async function waitForParentExit(_0x3bb953,_0x4c60a3=0x7530){const _0x170e03=a0_0x4726bb;if(!_0x3bb953)return;const _0xe0b8e9=Date['now']();while(isProcessRunning(_0x3bb953)){if(Date[_0x170e03(0x131)]()-_0xe0b8e9>_0x4c60a3){log('[Watchdog]\x20Parent\x20process\x20'+_0x3bb953+_0x170e03(0x14d)+_0x4c60a3+_0x170e03(0x150));return;}await new Promise(_0x4bd286=>setTimeout(_0x4bd286,0x1f4));}log('[Watchdog]\x20Parent\x20process\x20'+_0x3bb953+_0x170e03(0x135));}async function main(){const _0xefc322=a0_0x4726bb,_0x4f9970=parseArgs();log(_0xefc322(0x145),{'delay':_0x4f9970[_0xefc322(0x13f)],'command':_0x4f9970[_0xefc322(0x148)],'pid':_0x4f9970[_0xefc322(0x157)]});_0x4f9970[_0xefc322(0x157)]&&(log(_0xefc322(0x149)+_0x4f9970[_0xefc322(0x157)]+_0xefc322(0x138)),await waitForParentExit(_0x4f9970[_0xefc322(0x157)]));log(_0xefc322(0x14c)+_0x4f9970['delay']+_0xefc322(0x140)),await new Promise(_0x4b655a=>setTimeout(_0x4b655a,_0x4f9970[_0xefc322(0x13f)]));const _0x19e451=_0x4f9970[_0xefc322(0x148)][_0xefc322(0x144)]('\x20'),_0x13b74e=_0x19e451[0x0],_0x4bfe71=_0x19e451[_0xefc322(0x132)](0x1);log(_0xefc322(0x133)+_0x13b74e+'\x20'+_0x4bfe71[_0xefc322(0x13c)]('\x20'));const _0x48e141=process[_0xefc322(0x146)]===_0xefc322(0x12f),_0x2da422=spawn(_0x13b74e,_0x4bfe71,{'detached':!![],'stdio':_0xefc322(0x137),'shell':!![],'windowsHide':![]});_0x2da422[_0xefc322(0x153)](),log(_0xefc322(0x13d)+_0x2da422[_0xefc322(0x157)]),log(_0xefc322(0x141)),setTimeout(()=>process[_0xefc322(0x147)](0x0),0x3e8);}main()[a0_0x4726bb(0x13b)](_0x28813c=>{const _0x3510ff=a0_0x4726bb;log(_0x3510ff(0x154)+_0x28813c[_0x3510ff(0x143)]),process[_0x3510ff(0x147)](0x1);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x5f1c78=a0_0x535f;(function(_0x32ac6a,_0x3e1496){const _0x1d2959=a0_0x535f,_0x486f62=_0x32ac6a();while(!![]){try{const _0x1af107=parseInt(_0x1d2959(0x21e))/0x1*(-parseInt(_0x1d2959(0x1e7))/0x2)+parseInt(_0x1d2959(0x21c))/0x3*(-parseInt(_0x1d2959(0x222))/0x4)+parseInt(_0x1d2959(0x1e1))/0x5+parseInt(_0x1d2959(0x224))/0x6*(-parseInt(_0x1d2959(0x1f7))/0x7)+-parseInt(_0x1d2959(0x201))/0x8*(parseInt(_0x1d2959(0x1f0))/0x9)+-parseInt(_0x1d2959(0x1e5))/0xa+parseInt(_0x1d2959(0x21d))/0xb*(parseInt(_0x1d2959(0x1fe))/0xc);if(_0x1af107===_0x3e1496)break;else _0x486f62['push'](_0x486f62['shift']());}catch(_0xbf95c4){_0x486f62['push'](_0x486f62['shift']());}}}(a0_0x37e9,0x9299d));import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x535f(_0x1d2926,_0x52d731){_0x1d2926=_0x1d2926-0x1e1;const _0x37e9a7=a0_0x37e9();let _0x535f1e=_0x37e9a7[_0x1d2926];if(a0_0x535f['OgeNBc']===undefined){var _0x4a1f4e=function(_0x3aa07f){const _0x533396='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1673dc='',_0x1d7c86='';for(let _0x546f13=0x0,_0x331c7c,_0x2d8fcb,_0x5d2658=0x0;_0x2d8fcb=_0x3aa07f['charAt'](_0x5d2658++);~_0x2d8fcb&&(_0x331c7c=_0x546f13%0x4?_0x331c7c*0x40+_0x2d8fcb:_0x2d8fcb,_0x546f13++%0x4)?_0x1673dc+=String['fromCharCode'](0xff&_0x331c7c>>(-0x2*_0x546f13&0x6)):0x0){_0x2d8fcb=_0x533396['indexOf'](_0x2d8fcb);}for(let _0x3ab269=0x0,_0x14caf2=_0x1673dc['length'];_0x3ab269<_0x14caf2;_0x3ab269++){_0x1d7c86+='%'+('00'+_0x1673dc['charCodeAt'](_0x3ab269)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d7c86);};a0_0x535f['JuZFxL']=_0x4a1f4e,a0_0x535f['hSfKul']={},a0_0x535f['OgeNBc']=!![];}const _0x145885=_0x37e9a7[0x0],_0x2bc936=_0x1d2926+_0x145885,_0x32a1f0=a0_0x535f['hSfKul'][_0x2bc936];return!_0x32a1f0?(_0x535f1e=a0_0x535f['JuZFxL'](_0x535f1e),a0_0x535f['hSfKul'][_0x2bc936]=_0x535f1e):_0x535f1e=_0x32a1f0,_0x535f1e;}function a0_0x37e9(){const _0x50aa10=['q0furuDpuLK','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','zwXZzq','BgLUzq','CMv0DxjU','CM9VDa','zgvIDwC','Aw5JBhvKzq','mJfcCgXqvhO','ndK1C2DLzu5U','nJa5ntzmt3PMC0S','CMvZDwX0CW','Cg9ZDgnZC1nJC3m','y2f0zwDVCML6zvn0EwXLBgLUDfj1Bgu','nJa5nZy4C0TlD3P5','BM8TAw52ywXPza','ndu5odaXmef6whHHuW','u3r5BgvSAw50igfUywX5C2LZigzHAwXLza','rvjst1i','nteWotK5nxztDxrVva','Bg9Nz2vY','BgvUz3rO','CgX1z2LU','mtaWmJa1mgvbqvrUDG','y29SDw1U','mZj2ru9pvxC','Cg9ZDgnZCY1SzxnZ','C3vWCg9YDhnbDxrVrML4','zxjYB3i','C3LUDgf4','CMvJB21Tzw5Kzwq','BgvZCW','Cg9ZDgnZCW','DxnL','otm1mvLzvgjvDa','C2v2zxjPDhK','ChvZAa','BMCTzgvLCa','Dw5RBM93BG','zMLSDgvY','D2fYBG','n3nzqu9wrq','CNvSzq','zw5KC1DPDgG','y29UDgvUDa','Cg9ZDgnZC0XLC3m','lNnHC3m','ChjVy2vZCW','nJy0mtqWrxPcshrH','zgvMyxvSDa','zNvUy3rPB24','mJrWBungq1e','Bg93zxi','u0vwrvjjvfK','q1ntigfUywX5C2LZignVBxbSzxrLza','zM9YD2fYza','l15JDxn0B20TlW','lMXLC3m','C3r5BgvSAw50','zgv0zwn0tgfUz3vHz2u','C2nZCW','BMfTzq','u1rzteu','qKvtvf9quKfdveLdrq','Aw5JBhvKzxm','u1Lovefy','zM9Y','D2fYBMLUz3m','Dg9mB3DLCKnHC2u','zM9YBwf0ug9ZDentu0vYCM9Y'];a0_0x37e9=function(){return _0x50aa10;};return a0_0x37e9();}class CSSAnalyzer{constructor(_0x1673dc=null){const _0x2246e2=a0_0x535f;this[_0x2246e2(0x1e2)]=_0x1673dc,this[_0x2246e2(0x208)]=null,this['postcss']=null,this['postcssScss']=null,this[_0x2246e2(0x1fb)]=null;}async['analyze'](_0x1d7c86,_0x546f13,_0x331c7c={}){const _0x4f4012=a0_0x535f;try{const _0x2d8fcb=[],_0x5d2658=this[_0x4f4012(0x209)](_0x1d7c86),_0x3ab269=await this['checkSyntax'](_0x1d7c86,_0x546f13,_0x5d2658);_0x2d8fcb[_0x4f4012(0x1f2)](..._0x3ab269);if(_0x3ab269['length']===0x0){const _0x14caf2=await this['lintStyles'](_0x1d7c86,_0x546f13,_0x5d2658);_0x2d8fcb[_0x4f4012(0x1f2)](..._0x14caf2);}return this['logger']?.[_0x4f4012(0x21a)](_0x4f4012(0x204),{'file':_0x1d7c86,'language':_0x5d2658,'totalDiagnostics':_0x2d8fcb[_0x4f4012(0x1e3)],'errors':_0x2d8fcb[_0x4f4012(0x1f5)](_0x57b1b8=>_0x57b1b8['severity']===STATIC_ANALYSIS[_0x4f4012(0x203)][_0x4f4012(0x226)])['length'],'warnings':_0x2d8fcb['filter'](_0x192159=>_0x192159['severity']===STATIC_ANALYSIS['SEVERITY']['WARNING'])[_0x4f4012(0x1e3)]}),_0x2d8fcb;}catch(_0x42e656){return this[_0x4f4012(0x1e2)]?.[_0x4f4012(0x1ea)]('CSS\x20analysis\x20failed',{'file':_0x1d7c86,'error':_0x42e656['message']}),[];}}async['checkSyntax'](_0x1551c5,_0x1a3ccd,_0x9964d7){const _0x107144=a0_0x535f,_0x159ea9=[];try{if(!this['postcss']){const _0x1861b1=await import(_0x107144(0x1ee));this[_0x107144(0x1ee)]=_0x1861b1['default'];}let _0x1830ee=null;if(_0x9964d7==='scss'){if(!this['postcssScss']){const _0x442696=await import('postcss-scss');this[_0x107144(0x220)]=_0x442696['default'];}_0x1830ee=this[_0x107144(0x220)];}else{if(_0x9964d7===_0x107144(0x1ed)){if(!this['postcssLess']){const _0x541ea7=await import('postcss-less');this[_0x107144(0x1fb)]=_0x541ea7[_0x107144(0x1ff)];}_0x1830ee=this[_0x107144(0x1fb)];}}const _0xe53bdb=this['postcss']()[_0x107144(0x1fd)](_0x1a3ccd,{'from':_0x1551c5,'syntax':_0x1830ee}),_0x4f7ca5=_0xe53bdb[_0x107144(0x219)];this['logger']?.[_0x107144(0x21a)]('PostCSS\x20syntax\x20check\x20passed',{'file':_0x1551c5});}catch(_0x5350e8){const _0x11be4b=this[_0x107144(0x213)](_0x5350e8,_0x1551c5);_0x11be4b&&_0x159ea9[_0x107144(0x1f2)](_0x11be4b);}return _0x159ea9;}async['lintStyles'](_0x164ea5,_0x2600de,_0xf5c124){const _0x4e2319=a0_0x535f,_0x237c6e=[];try{if(!this['stylelint']){const _0x2f9804=await import(_0x4e2319(0x208));this[_0x4e2319(0x208)]=_0x2f9804[_0x4e2319(0x1ff)];}const _0x46a66b={'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':[_0x4e2319(0x206),_0x4e2319(0x1f3)]}],'media-feature-name-no-unknown':!![],'at-rule-no-unknown':_0xf5c124===_0x4e2319(0x20a)?[!![],{'ignoreAtRules':['mixin',_0x4e2319(0x21b),'extend','if',_0x4e2319(0x216),_0x4e2319(0x210),'each','while',_0x4e2319(0x200),_0x4e2319(0x218),_0x4e2319(0x1fa),_0x4e2319(0x1ef),_0x4e2319(0x205)]}]:_0xf5c124==='less'?[!![],{'ignoreAtRules':[_0x4e2319(0x1e4)]}]:!![],'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':_0x4e2319(0x202)},'customSyntax':_0xf5c124===_0x4e2319(0x20a)?'postcss-scss':_0xf5c124==='less'?_0x4e2319(0x1e8):undefined},_0x2ce12d=await this['stylelint']['lint']({'code':_0x2600de,'codeFilename':_0x164ea5,'config':_0x46a66b});if(_0x2ce12d[_0x4e2319(0x21f)]&&_0x2ce12d['results'][_0x4e2319(0x1e3)]>0x0){const _0xc52c2b=_0x2ce12d[_0x4e2319(0x21f)][0x0];if(_0xc52c2b['warnings'])for(const _0x38e79d of _0xc52c2b[_0x4e2319(0x211)]){_0x237c6e['push']({'file':_0x164ea5,'line':_0x38e79d[_0x4e2319(0x217)]||0x1,'column':_0x38e79d['column']||0x1,'severity':_0x38e79d[_0x4e2319(0x1f1)]===_0x4e2319(0x1ea)?STATIC_ANALYSIS[_0x4e2319(0x203)][_0x4e2319(0x226)]:STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x38e79d[_0x4e2319(0x1f8)]||_0x4e2319(0x1f4),'message':_0x38e79d['text'],'category':this[_0x4e2319(0x221)](_0x38e79d['rule']),'fixable':![],'source':'stylelint'});}}}catch(_0x136182){this[_0x4e2319(0x1e2)]?.[_0x4e2319(0x1f6)](_0x4e2319(0x225),{'file':_0x164ea5,'error':_0x136182['message']});}return _0x237c6e;}['formatPostCSSError'](_0x495f03,_0x43748a){const _0x32b33e=a0_0x535f;return{'file':_0x43748a,'line':_0x495f03[_0x32b33e(0x217)]||0x1,'column':_0x495f03[_0x32b33e(0x1e6)]||0x1,'severity':STATIC_ANALYSIS[_0x32b33e(0x203)][_0x32b33e(0x226)],'rule':_0x495f03[_0x32b33e(0x20b)]||'CssSyntaxError','message':_0x495f03['reason']||_0x495f03['message'],'category':STATIC_ANALYSIS['CATEGORY']['SYNTAX'],'fixable':![],'source':_0x32b33e(0x1ee),'code':_0x495f03['source']||undefined};}['categorizeStylelintRule'](_0x36cfbb){const _0x42477c=a0_0x535f;if(!_0x36cfbb)return STATIC_ANALYSIS[_0x42477c(0x214)]['STYLE'];const _0x29ffb0=_0x36cfbb[_0x42477c(0x212)]();if(_0x29ffb0['includes'](_0x42477c(0x223))||_0x29ffb0['includes']('no-unknown')||_0x29ffb0[_0x42477c(0x20e)]('no-empty')||_0x29ffb0[_0x42477c(0x20e)](_0x42477c(0x1eb)))return STATIC_ANALYSIS[_0x42477c(0x214)][_0x42477c(0x20f)];if(_0x29ffb0[_0x42477c(0x20e)]('performance')||_0x29ffb0[_0x42477c(0x20e)]('optimize'))return STATIC_ANALYSIS[_0x42477c(0x214)]['PERFORMANCE'];if(_0x29ffb0[_0x42477c(0x20e)]('best-practice')||_0x29ffb0[_0x42477c(0x20e)](_0x42477c(0x1ec)))return STATIC_ANALYSIS['CATEGORY'][_0x42477c(0x20d)];return STATIC_ANALYSIS[_0x42477c(0x214)][_0x42477c(0x20c)];}[a0_0x5f1c78(0x209)](_0x3d1ee0){const _0x25e7a3=a0_0x5f1c78,_0x19a6a4=_0x3d1ee0[_0x25e7a3(0x212)]();if(_0x19a6a4['endsWith']('.scss')||_0x19a6a4[_0x25e7a3(0x1f9)](_0x25e7a3(0x1fc)))return'scss';if(_0x19a6a4[_0x25e7a3(0x1f9)]('.less'))return _0x25e7a3(0x1ed);return'css';}[a0_0x5f1c78(0x215)](){const _0x1b98c8=a0_0x5f1c78;return['.css','.scss',_0x1b98c8(0x1fc),_0x1b98c8(0x207)];}[a0_0x5f1c78(0x1e9)](){return![];}}export default CSSAnalyzer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x19775a=a0_0x26b6;(function(_0x5845b9,_0x465c85){const _0x1bb25a=a0_0x26b6,_0xe45e33=_0x5845b9();while(!![]){try{const _0x2e433d=parseInt(_0x1bb25a(0x120))/0x1*(parseInt(_0x1bb25a(0x14d))/0x2)+-parseInt(_0x1bb25a(0x168))/0x3*(parseInt(_0x1bb25a(0x14f))/0x4)+parseInt(_0x1bb25a(0x14b))/0x5+-parseInt(_0x1bb25a(0x148))/0x6+parseInt(_0x1bb25a(0x162))/0x7+-parseInt(_0x1bb25a(0x11e))/0x8+parseInt(_0x1bb25a(0x13f))/0x9;if(_0x2e433d===_0x465c85)break;else _0xe45e33['push'](_0xe45e33['shift']());}catch(_0x58b329){_0xe45e33['push'](_0xe45e33['shift']());}}}(a0_0x89a2,0x67266));function a0_0x89a2(){const _0x2e3fbe=['mZC0nZi4mNDcBNzSCq','BgLUzq','DMfSAwrHDgvuC0nVBMzPzW','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','BwLZC2LUz1bYB3bLCNr5','lNLTBa','nZuWmdnesxn5v2O','vw5RBM93BIbJB25MAwCGzMLSzsb0ExbL','su5gtW','y2HLy2TVDIb2ywXPzgf0Aw9UigzHAwXLza','CgfYC2viywrVBgLUDfjLC3vSDhm','Ew91CI1RzxKTAgvYzq','Bw9KDwXL','zgLYBMfTzq','CgfYC2u','Bg9Nz2vY','y29Kzq','BxvZDcbOyxzLihjLCxvPCMvKihbYB3bLCNr5icC','DMfSAwrHDgLVBG','igrLDgvJDgvKigLUic5LBNyGzMLSzq','ic0TB3v0Chv0igPZB24Gls1JB21Wywn0','BM8TAw1WBgLJAxqTyw55','AgfKB2XPBNq','AZHZ','y2HLy2TFy2XHC3m','DhnJB25MAwCUANnVBG','EwfTBgXPBNqGls12zxjZAw9U','y3DL','DgvYCMfMB3jT','CgfZC3DVCMq','ANnVBLnJAgvTyq','ChjPDMf0zsbRzxK','zgvMyxvSDa','Bgv2zwW','y29TBw9UANm','zgvIDwC','qvbjigTLEq','BwvZC2fNzq','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','zMLSzq','C2vJCMv0','DMfSAwrHDgvzqu1m','DhjPBq','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','C3rKB3v0','DMfSAwrHDgvfBNzgAwXL','Dg9Rzw4','rvjst1i','C2vJDxjPDhK','BwfWsgfKB2XPBNrtzxzLCML0Eq','ANnVBG','DMfSAwrHDgvxAxrOq2HLy2TVDG','lMDPDgH1yI93B3jRzMXVD3m','DMfSAwrHDgu','B2jQzwn0','qvDtignYzwrLBNrPywXZ','DMfSAwrHDgveB2nRzxjMAwXL','y2HLy2TFBMfTzq','Aw5JBhvKzxm','BM9jBxbSAwnPDefUEq','ndy3nZqZmMLsB1nUuG','ANnVBI1Zy2HLBwe','mtnbqwXjANK','BwfWwwfTBgXPBNrtzxzLCML0Eq','DhnJB25MAwCTDMfSAwrHDg9Y','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','ANnVBI1WyxjZzq','z3vPzgvSAw5L','C3rYAw5N','y2HLy2TVDG','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','CgfJA2fNzs5QC29U','CMvMzxjLBMnLCW','AxnbCNjHEq','zMLSzv9SAw5Lx3jHBMDL','v0fstKLorW','ChvZAa','C3rHCNrZv2L0Aa','CMvZDwX0CW','zxjYB3jZ','DMfSAwrHDgvqywnRywDLsNnVBG','AgfYzgnVzgvKlxnLy3jLDa','Dg9mB3DLCKnHC2u','BMfTzq','D2fYBG','zgv0zwn0rMLSzvr5Cgu','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','wufntcbMAwXLihzHBgLKyxrPB24','ywP2lwzVCM1HDhm','zxH0BMfTzq','zw52','zMfPBgvKx2nOzwnRCW','yxzHAwXHyMXLu2nHBM5LCNm','mta2nJmYoxPeyu1vzq','Dw5RBM93BG','y29TCgLSzxjpChrPB25Z','ywP2icHku09oifnJAgvTysK','y2HLy2TVDIaTzIaI','zg9JA2vYzMLSzq','DxrMltG','BwfWq2HLy2TVDLnLDMvYAxr5','CgfJA2fNzs5QC29UihzHBgLKyxrPB24GzMfPBgvK','otaYmtm2qw9nCKPX','y2HLy2TFAwq','ug90zw50AwfSigHHCMrJB2rLzca','mJy2mty3meLtvMvnBG','u0vwrvjjvfK','ntmYotrUAw1st0O','Aw5ZDgfUy2vqyxrO','nJb5DMrJt3a','zg9JA2vYlwnVBxbVC2uUEw1S','EwfTBa','vMfSAwrHDgLUzYbJB25MAwCGzMLSzq','DMfSAwrHDg9Y','A3vIzxjUzxrLCW','ywP2','CMvHzezPBgu','zM9YrwfJAa','CgfYC2vdAgvJA292uMvZDwX0CW','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','zw52lxzHBgLKyxrVCG','C3bSAxq','zxjYB3i','z2L0AhvIlwfJDgLVBNm','CgLWigLUC3rHBgWGy2HLy2TVDG','EwfTBgXPBNq','yMfZzw5HBwu','DMvYC2LVBG'];a0_0x89a2=function(){return _0x2e3fbe;};return a0_0x89a2();}function a0_0x26b6(_0x575be0,_0x208d4a){_0x575be0=_0x575be0-0xee;const _0x89a213=a0_0x89a2();let _0x26b699=_0x89a213[_0x575be0];if(a0_0x26b6['UDQWeY']===undefined){var _0x2390c7=function(_0xcc3839){const _0x43f5c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5795c9='',_0x56294a='';for(let _0x265633=0x0,_0x15407f,_0xc055d2,_0x409112=0x0;_0xc055d2=_0xcc3839['charAt'](_0x409112++);~_0xc055d2&&(_0x15407f=_0x265633%0x4?_0x15407f*0x40+_0xc055d2:_0xc055d2,_0x265633++%0x4)?_0x5795c9+=String['fromCharCode'](0xff&_0x15407f>>(-0x2*_0x265633&0x6)):0x0){_0xc055d2=_0x43f5c9['indexOf'](_0xc055d2);}for(let _0x2dc7ae=0x0,_0x55809f=_0x5795c9['length'];_0x2dc7ae<_0x55809f;_0x2dc7ae++){_0x56294a+='%'+('00'+_0x5795c9['charCodeAt'](_0x2dc7ae)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56294a);};a0_0x26b6['DHSOFG']=_0x2390c7,a0_0x26b6['GJZyMR']={},a0_0x26b6['UDQWeY']=!![];}const _0x2897c8=_0x89a213[0x0],_0x59622a=_0x575be0+_0x2897c8,_0x139e32=a0_0x26b6['GJZyMR'][_0x59622a];return!_0x139e32?(_0x26b699=a0_0x26b6['DHSOFG'](_0x26b699),a0_0x26b6['GJZyMR'][_0x59622a]=_0x26b699):_0x26b699=_0x139e32,_0x26b699;}import{exec}from'child_process';import{promisify}from'util';import a0_0x5795c9 from'path';import a0_0x56294a from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x265633=null){const _0x3038aa=a0_0x26b6;this['logger']=_0x265633,this[_0x3038aa(0x13e)]=null,this['scannerCache']=new Map();}async['detectAvailableValidators'](){const _0x23dcbe=a0_0x26b6;if(this[_0x23dcbe(0x13e)]!==null)return this['availableScanners'];const _0x15407f={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0x15407f[_0x23dcbe(0x127)]=!![],this[_0x23dcbe(0xf1)]?.['debug']('checkov\x20detected');}catch(_0xc055d2){this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)](_0x23dcbe(0x108),{'error':_0xc055d2['message']});}try{await execAsync('hadolint\x20--version',{'timeout':0x1388}),_0x15407f[_0x23dcbe(0xf8)]=!![],this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)]('hadolint\x20detected');}catch(_0x409112){this['logger']?.['debug']('hadolint\x20not\x20available',{'error':_0x409112['message']});}try{await execAsync(_0x23dcbe(0xfc),{'timeout':0x1388}),_0x15407f['yamllint']=!![],this['logger']?.['debug']('yamllint\x20detected');}catch(_0x2dc7ae){this[_0x23dcbe(0xf1)]?.[_0x23dcbe(0x105)]('yamllint\x20not\x20available',{'error':_0x2dc7ae['message']});}try{await import('ajv'),_0x15407f[_0x23dcbe(0x100)]=!![],this['logger']?.['debug'](_0x23dcbe(0x159));}catch(_0x55809f){this['logger']?.['debug']('ajv\x20not\x20available',{'error':_0x55809f['message']});}return this['availableScanners']=_0x15407f,_0x15407f;}async[a0_0x19775a(0x117)](_0x2d0e6c,_0x1d54d2={}){const _0x540466=a0_0x19775a,_0x4b98f6=[],_0x52d656=await this['detectAvailableValidators'](),_0x21b786=this[_0x540466(0x137)](_0x2d0e6c);this['logger']?.[_0x540466(0x105)](_0x540466(0x152),{'filePath':_0x2d0e6c,'fileType':_0x21b786});switch(_0x21b786){case'dockerfile':if(_0x52d656[_0x540466(0xf8)]){const _0x432f39=await this['validateDockerfile'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x432f39);}if(_0x52d656[_0x540466(0x127)]){const _0x321234=await this['validateWithCheckov'](_0x2d0e6c,_0x540466(0x144),_0x1d54d2);_0x4b98f6['push'](..._0x321234);}break;case'docker-compose':if(_0x52d656[_0x540466(0x15f)]){const _0x43e1d2=await this['validateYAML'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x43e1d2);}if(_0x52d656['checkov']){const _0x2f60fc=await this[_0x540466(0x115)](_0x2d0e6c,'docker_compose',_0x1d54d2);_0x4b98f6['push'](..._0x2f60fc);}break;case'kubernetes':if(_0x52d656[_0x540466(0x15f)]){const _0x5514bd=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x5514bd);}if(_0x52d656['checkov']){const _0x6b3c9e=await this['validateWithCheckov'](_0x2d0e6c,_0x540466(0x154),_0x1d54d2);_0x4b98f6['push'](..._0x6b3c9e);}break;case'terraform':if(_0x52d656['checkov']){const _0x1c2c42=await this[_0x540466(0x115)](_0x2d0e6c,_0x540466(0xfe),_0x1d54d2);_0x4b98f6[_0x540466(0x12e)](..._0x1c2c42);}break;case'package.json':if(_0x52d656['jsonSchema']){const _0x59b8ed=await this['validatePackageJson'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x59b8ed);}break;case _0x540466(0xfb):if(_0x52d656[_0x540466(0x100)]){const _0x17c4af=await this['validateTsConfig'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x17c4af);}break;case'github-actions':if(_0x52d656['yamllint']){const _0x16ec43=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6[_0x540466(0x12e)](..._0x16ec43);}break;case'env':const _0x138af2=await this['validateEnvFile'](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x138af2);break;case _0x540466(0x151):if(_0x52d656[_0x540466(0x15f)]){const _0x5b05a3=await this[_0x540466(0x10b)](_0x2d0e6c,_0x1d54d2);_0x4b98f6['push'](..._0x5b05a3);}break;default:this[_0x540466(0xf1)]?.[_0x540466(0x136)](_0x540466(0x169),{'filePath':_0x2d0e6c,'fileType':_0x21b786});return[];}return this['normalizeResults'](_0x4b98f6);}async[a0_0x19775a(0x11a)](_0x5b0eed,_0x4709d7={}){const _0x85f1fe=a0_0x19775a;try{const _0x1db061=await execAsync('hadolint\x20--format\x20json\x20\x22'+_0x5b0eed+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x59eec7=JSON['parse'](_0x1db061[_0x85f1fe(0x10e)]);return this[_0x85f1fe(0x16c)](_0x59eec7,_0x5b0eed);}catch(_0x168b4b){if(_0x168b4b['stdout'])try{const _0xa35be6=JSON['parse'](_0x168b4b[_0x85f1fe(0x10e)]);return this['parseHadolintResults'](_0xa35be6,_0x5b0eed);}catch(_0xc76ece){this['logger']?.['error'](_0x85f1fe(0x10d),{'error':_0xc76ece['message']});}return this[_0x85f1fe(0xf1)]?.['error']('hadolint\x20validation\x20failed',{'error':_0x168b4b['message']}),[];}}[a0_0x19775a(0x16c)](_0x522f2b,_0x3a0356){const _0x197bf6=a0_0x19775a,_0x2a0649=[];if(Array[_0x197bf6(0x12b)](_0x522f2b))for(const _0x584cd9 of _0x522f2b){_0x2a0649[_0x197bf6(0x12e)]({'file':_0x3a0356,'line':_0x584cd9['line']||0x1,'column':_0x584cd9['column']||0x1,'severity':this['mapHadolintSeverity'](_0x584cd9[_0x197bf6(0x103)]),'rule':_0x584cd9[_0x197bf6(0xf2)],'message':_0x584cd9[_0x197bf6(0x107)],'category':_0x197bf6(0x144),'validator':'hadolint'});}return _0x2a0649;}async[a0_0x19775a(0x10b)](_0x2074ac,_0x498d25={}){const _0x14b6c2=a0_0x19775a;try{const _0x40b2f3=await execAsync('yamllint\x20-f\x20parsable\x20\x22'+_0x2074ac+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x40b2f3[_0x14b6c2(0x10e)],_0x2074ac);}catch(_0x47a3fc){if(_0x47a3fc[_0x14b6c2(0x10e)])return this['parseYamllintResults'](_0x47a3fc['stdout'],_0x2074ac);return this[_0x14b6c2(0xf1)]?.[_0x14b6c2(0x15c)]('yamllint\x20validation\x20failed',{'error':_0x47a3fc['message']}),[];}}['parseYamllintResults'](_0x5891d4,_0x307715){const _0x1b3dcf=a0_0x19775a,_0x2c4562=[],_0x1fdf97=_0x5891d4['split']('\x0a')['filter'](_0x5d626c=>_0x5d626c[_0x1b3dcf(0x10c)]());for(const _0x2b1aa5 of _0x1fdf97){const _0x17cbaa=_0x2b1aa5['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x17cbaa){const [,_0x2bc444,_0xcfd02e,_0x5d03ec,_0x59fdf1,_0x2c284e,_0x4cb666]=_0x17cbaa;_0x2c4562['push']({'file':_0x307715,'line':parseInt(_0xcfd02e,0xa),'column':parseInt(_0x5d03ec,0xa),'severity':this['mapYamllintSeverity'](_0x59fdf1),'rule':_0x4cb666,'message':_0x2c284e,'category':_0x1b3dcf(0x151),'validator':'yamllint'});}}return _0x2c4562;}async['validateWithCheckov'](_0x4978d9,_0x1b1a70,_0x4787bb={}){const _0x40fbbb=a0_0x19775a;try{const _0x429f36=await execAsync(_0x40fbbb(0x143)+_0x4978d9+'\x22\x20--framework\x20'+_0x1b1a70+_0x40fbbb(0xf6),{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x3f0cd2=JSON[_0x40fbbb(0xf0)](_0x429f36[_0x40fbbb(0x10e)]);return this['parseCheckovResults'](_0x3f0cd2,_0x4978d9);}catch(_0x46a288){if(_0x46a288['stdout'])try{const _0x57aaf4=JSON[_0x40fbbb(0xf0)](_0x46a288[_0x40fbbb(0x10e)]);return this['parseCheckovResults'](_0x57aaf4,_0x4978d9);}catch(_0x33c418){this[_0x40fbbb(0xf1)]?.[_0x40fbbb(0x15c)]('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x33c418['message']});}return this[_0x40fbbb(0xf1)]?.[_0x40fbbb(0x15c)](_0x40fbbb(0x16b),{'error':_0x46a288['message']}),[];}}[a0_0x19775a(0x158)](_0x879240,_0x46a02b){const _0x4b08ce=a0_0x19775a,_0x555945=[];if(_0x879240['results']&&_0x879240[_0x4b08ce(0x130)][_0x4b08ce(0x13d)])for(const _0x39d4dd of _0x879240['results']['failed_checks']){_0x555945[_0x4b08ce(0x12e)]({'file':_0x46a02b,'line':_0x39d4dd[_0x4b08ce(0x12c)]?_0x39d4dd[_0x4b08ce(0x12c)][0x0]:0x1,'column':0x1,'severity':this['mapCheckovSeverity'](_0x39d4dd[_0x4b08ce(0xfa)]),'rule':_0x39d4dd[_0x4b08ce(0x149)],'message':_0x39d4dd[_0x4b08ce(0x11b)]||_0x39d4dd['check_id'],'category':_0x4b08ce(0x112),'validator':'checkov','remediation':_0x39d4dd['guideline'],'cwe':_0x39d4dd[_0x4b08ce(0xfd)],'references':_0x39d4dd[_0x4b08ce(0x125)]?[_0x39d4dd['guideline']]:[]});}return _0x555945;}async[a0_0x19775a(0x132)](_0x25ad03,_0x4021ad={}){const _0x78488a=a0_0x19775a;try{const _0x3983a1=(await import(_0x78488a(0x155)))[_0x78488a(0x102)],_0x3c574f=(await import(_0x78488a(0x13a)))['default'],_0x394620=await a0_0x56294a['readFile'](_0x25ad03,_0x78488a(0x145)),_0xf784e8=JSON[_0x78488a(0xf0)](_0x394620),_0x52ae87=new _0x3983a1({'allErrors':!![],'strict':![]});_0x3c574f(_0x52ae87);const _0x347915={'type':_0x78488a(0x118),'required':[_0x78488a(0x135),_0x78488a(0x161)],'properties':{'name':{'type':'string','pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x78488a(0x126)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':'string','enum':[_0x78488a(0xee),_0x78488a(0x104)]},'scripts':{'type':_0x78488a(0x118)},'dependencies':{'type':'object'},'devDependencies':{'type':_0x78488a(0x118)}},'additionalProperties':!![]},_0x404693=_0x52ae87['compile'](_0x347915),_0x4db1b7=_0x404693(_0xf784e8);if(!_0x4db1b7&&_0x404693['errors'])return _0x404693[_0x78488a(0x131)]['map'](_0x4d74e7=>({'file':_0x25ad03,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x78488a(0x14c)]['ERROR'],'rule':'json-schema','message':_0x4d74e7['instancePath']?_0x4d74e7[_0x78488a(0x14e)]+'\x20'+_0x4d74e7['message']:_0x78488a(0xf3)+_0x4d74e7['params'][_0x78488a(0x166)]+'\x27','category':_0x78488a(0xf4),'validator':_0x78488a(0x11f)}));return[];}catch(_0x1aedf7){return this['logger']?.[_0x78488a(0x15c)](_0x78488a(0x147),{'error':_0x1aedf7[_0x78488a(0x107)]}),[{'file':_0x25ad03,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x78488a(0x111)],'rule':_0x78488a(0x124),'message':'Invalid\x20JSON:\x20'+_0x1aedf7[_0x78488a(0x107)],'category':'syntax','validator':_0x78488a(0x124)}];}}async[a0_0x19775a(0x164)](_0x182499,_0x2ded8e={}){const _0x203c94=a0_0x19775a;try{const _0x4ab1c1=await a0_0x56294a['readFile'](_0x182499,_0x203c94(0x145)),_0x4d2afc=JSON[_0x203c94(0xf0)](_0x4ab1c1),_0x34fb74=[];if(_0x4d2afc[_0x203c94(0x141)]){const _0x50123b=_0x4d2afc['compilerOptions'];!_0x50123b['strict']&&_0x34fb74['push']({'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)][_0x203c94(0x12d)],'rule':'strict-mode','message':_0x203c94(0x123),'category':'best-practice','validator':_0x203c94(0x122)}),_0x50123b[_0x203c94(0x11d)]===![]&&_0x34fb74[_0x203c94(0x12e)]({'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)][_0x203c94(0x12d)],'rule':_0x203c94(0xf7),'message':'Disabling\x20noImplicitAny\x20reduces\x20type\x20safety','category':'best-practice','validator':'tsconfig-validator'});}return _0x34fb74;}catch(_0x234c6b){return this['logger']?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0x234c6b[_0x203c94(0x107)]}),[{'file':_0x182499,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x203c94(0x14c)]['ERROR'],'rule':'json-parse','message':'Invalid\x20JSON:\x20'+_0x234c6b[_0x203c94(0x107)],'category':'syntax','validator':'json-parse'}];}}async[a0_0x19775a(0x10f)](_0x24e53a,_0x4074ee={}){const _0x46b127=a0_0x19775a;try{const _0x10ca84=await a0_0x56294a[_0x46b127(0x156)](_0x24e53a,'utf-8'),_0xb9f212=[],_0x6c5b52=_0x10ca84['split']('\x0a'),_0x53e4e2=[{'pattern':/password|passwd|pwd/i,'name':_0x46b127(0xff)},{'pattern':/api[_-]?key/i,'name':_0x46b127(0x106)},{'pattern':/secret/i,'name':_0x46b127(0x10a)},{'pattern':/token/i,'name':_0x46b127(0x110)},{'pattern':/private[_-]?key/i,'name':_0x46b127(0x101)},{'pattern':/aws[_-]?access/i,'name':_0x46b127(0x119)}];return _0x6c5b52[_0x46b127(0x157)]((_0x41405c,_0x353a37)=>{const _0x17f2ce=_0x46b127,_0x1b3e61=_0x41405c[_0x17f2ce(0x10c)]();if(!_0x1b3e61||_0x1b3e61[_0x17f2ce(0x12f)]('#'))return;if(_0x1b3e61[_0x17f2ce(0x11c)]('=')){const [_0x552555,_0x35bba1]=_0x1b3e61[_0x17f2ce(0x15b)]('='),_0x50140e=_0x552555[_0x17f2ce(0x134)](),_0x276c2c=_0x35bba1?.['trim']()||'',_0x4db490=_0x276c2c&&_0x276c2c!==''&&!_0x276c2c['startsWith']('$')&&_0x276c2c!==_0x17f2ce(0x16d)&&_0x276c2c!=='changeme'&&_0x276c2c['length']>0x5;if(_0x4db490)for(const {pattern:_0x3945a2,name:_0x27360e}of _0x53e4e2){if(_0x3945a2['test'](_0x50140e)){_0xb9f212['push']({'file':_0x24e53a,'line':_0x353a37+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x17f2ce(0x14c)]['CRITICAL'],'rule':_0x17f2ce(0x133),'message':_0x17f2ce(0x14a)+_0x27360e+_0x17f2ce(0xf5),'category':_0x17f2ce(0x112),'validator':_0x17f2ce(0x15a),'remediation':'Use\x20environment-specific\x20.env\x20files\x20and\x20add\x20.env\x20to\x20.gitignore'});break;}}}}),_0xb9f212;}catch(_0x33b0b0){return this['logger']?.['error']('.env\x20validation\x20failed',{'error':_0x33b0b0['message']}),[];}}['detectFileType'](_0x3b91b3){const _0x4f4ff5=a0_0x19775a,_0x1f4b02=a0_0x5795c9[_0x4f4ff5(0x160)](_0x3b91b3)[_0x4f4ff5(0x134)](),_0x3cfad2=a0_0x5795c9[_0x4f4ff5(0xef)](_0x3b91b3);if(_0x1f4b02===_0x4f4ff5(0x144))return _0x4f4ff5(0x144);if(_0x1f4b02===_0x4f4ff5(0x150)||_0x1f4b02==='docker-compose.yaml')return'docker-compose';if(_0x1f4b02===_0x4f4ff5(0x129))return _0x4f4ff5(0x129);if(_0x1f4b02===_0x4f4ff5(0xfb))return'tsconfig.json';if(_0x1f4b02==='.env'||_0x1f4b02['endsWith']('.env'))return _0x4f4ff5(0x13c);if(_0x3cfad2[_0x4f4ff5(0x11c)](_0x4f4ff5(0x116)))return _0x4f4ff5(0x15d);if(_0x3cfad2[_0x4f4ff5(0x11c)]('kubernetes')||_0x3cfad2[_0x4f4ff5(0x11c)](_0x4f4ff5(0xf9)))return _0x4f4ff5(0x154);const _0x64b164=a0_0x5795c9[_0x4f4ff5(0x13b)](_0x3b91b3)['toLowerCase']();if(_0x64b164==='.tf'||_0x64b164==='.tfvars')return'terraform';if(_0x64b164===_0x4f4ff5(0x167)||_0x64b164==='.yaml')return'yaml';if(_0x64b164==='.json')return _0x4f4ff5(0x114);return'unknown';}['normalizeResults'](_0xad568){const _0x5149a6=a0_0x19775a;return _0xad568['map'](_0x92b669=>({'file':_0x92b669[_0x5149a6(0x109)],'line':_0x92b669[_0x5149a6(0x163)]||0x1,'column':_0x92b669['column']||0x1,'severity':_0x92b669['severity']||STATIC_ANALYSIS[_0x5149a6(0x14c)]['WARNING'],'rule':_0x92b669['rule']||_0x5149a6(0x140),'message':_0x92b669[_0x5149a6(0x107)]||'Validation\x20issue\x20detected','category':_0x92b669['category']||_0x5149a6(0xf4),'validator':_0x92b669[_0x5149a6(0x153)],'cwe':_0x92b669[_0x5149a6(0xfd)]||null,'remediation':_0x92b669['remediation']||null,'references':_0x92b669[_0x5149a6(0x12a)]||[]}));}[a0_0x19775a(0x113)](_0x24191c){const _0x157386=a0_0x19775a,_0x22ecd3={'error':STATIC_ANALYSIS['SEVERITY']['ERROR'],'warning':STATIC_ANALYSIS[_0x157386(0x14c)][_0x157386(0x12d)],'info':STATIC_ANALYSIS['SEVERITY'][_0x157386(0x16a)],'style':STATIC_ANALYSIS['SEVERITY']['INFO']};return _0x22ecd3[_0x24191c?.['toLowerCase']()]||STATIC_ANALYSIS[_0x157386(0x14c)]['WARNING'];}[a0_0x19775a(0x121)](_0x3ab98e){const _0x296861=a0_0x19775a,_0x1f8c2a={'error':STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x111)],'warning':STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x12d)]};return _0x1f8c2a[_0x3ab98e?.['toLowerCase']()]||STATIC_ANALYSIS[_0x296861(0x14c)][_0x296861(0x12d)];}[a0_0x19775a(0x146)](_0x247413){return STATIC_ANALYSIS['SEVERITY']['ERROR'];}async['getValidatorStatus'](){const _0x41bcd7=await this['detectAvailableValidators']();return{'validators':_0x41bcd7,'recommendations':this['getInstallRecommendations'](_0x41bcd7)};}[a0_0x19775a(0x138)](_0x52a890){const _0xd7ad44=a0_0x19775a,_0x143ab4=[];return!_0x52a890['checkov']&&_0x143ab4['push']({'validator':'checkov','reason':_0xd7ad44(0x165),'install':_0xd7ad44(0x15e),'priority':'high'}),!_0x52a890[_0xd7ad44(0xf8)]&&_0x143ab4[_0xd7ad44(0x12e)]({'validator':'hadolint','reason':_0xd7ad44(0x128),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x52a890['yamllint']&&_0x143ab4[_0xd7ad44(0x12e)]({'validator':_0xd7ad44(0x15f),'reason':_0xd7ad44(0x139),'install':'pip\x20install\x20yamllint','priority':'medium'}),!_0x52a890[_0xd7ad44(0x100)]&&_0x143ab4['push']({'validator':_0xd7ad44(0x142),'reason':'JSON\x20configuration\x20validation','install':'npm\x20install\x20ajv\x20ajv-formats','priority':'medium'}),_0x143ab4;}}export default ConfigValidator;
|
|
1
|
+
const a0_0x111283=a0_0x8cd3;(function(_0x3c6d8a,_0x18c2db){const _0x13dbe8=a0_0x8cd3,_0x33e974=_0x3c6d8a();while(!![]){try{const _0x4d35b8=parseInt(_0x13dbe8(0x207))/0x1*(parseInt(_0x13dbe8(0x257))/0x2)+parseInt(_0x13dbe8(0x252))/0x3+parseInt(_0x13dbe8(0x25e))/0x4*(parseInt(_0x13dbe8(0x20c))/0x5)+-parseInt(_0x13dbe8(0x24b))/0x6+parseInt(_0x13dbe8(0x1ea))/0x7*(-parseInt(_0x13dbe8(0x1ee))/0x8)+-parseInt(_0x13dbe8(0x224))/0x9*(parseInt(_0x13dbe8(0x225))/0xa)+parseInt(_0x13dbe8(0x202))/0xb*(parseInt(_0x13dbe8(0x238))/0xc);if(_0x4d35b8===_0x18c2db)break;else _0x33e974['push'](_0x33e974['shift']());}catch(_0x41bc49){_0x33e974['push'](_0x33e974['shift']());}}}(a0_0x4411,0xf2534));import{exec}from'child_process';import{promisify}from'util';function a0_0x4411(){const _0x347a34=['y29TCgLSzq','su5gtW','y29Kzq','zgv0zwn0qxzHAwXHyMXLvMfSAwrHDg9YCW','ywP2','mJu1oduYouvMBwfHtq','y2HHBMDLBwu','rMfPBgvKihrVihbHCNnLigHHzg9SAw50ig91Dhb1Da','CgfYC2vdAgvJA292uMvZDwX0CW','sw52ywXPzcbku09ooIa','otC2odm4wNrIvLzY','u0vwrvjjvfK','CMvHzezPBgu','lNrMDMfYCW','zg9JA2vYlwnVBxbVC2u','CNvSzq','rg9JA2vYzMLSzsbSAw50Aw5NigfUzcbIzxn0ihbYywn0AwnLCW','ndruELPft3q','DhjPBq','C3rYAw5N','ChvZAa','ywP2ig5VDcbHDMfPBgfIBgu','Ew91CI1RzxKTAgvYzq','BM9YBwfSAxPLuMvZDwX0CW','DMfSAwrHDgu','lMvUDIb2ywXPzgf0Aw9UigzHAwXLza','B2jQzwn0','zMLSzv9SAw5Lx3jHBMDL','DgvYCMfMB3jT','A3vIzxjUzxrLCW','BwvZC2fNzq','zw52lxzHBgLKyxrVCG','Dw5RBM93BG','ntzNvwr3D1K','wufntcbMAwXLihzHBgLKyxrPB24','AZHZ','AgLNAa','nJmYmtC2uengCend','EwfTBa','AgfYzgnVzgvKlxnLy3jLDa','zgvIDwC','rgLZywjSAw5Nig5Vsw1WBgLJAxrbBNKGCMvKDwnLCYb0ExbLihnHzMv0Eq','CgfYC2u','lNLTBa','DMfSAwrHDgvfBNzgAwXL','y2f0zwDVCNK','Aw5JBhvKzxm','zgv0zwn0rMLSzvr5Cgu','sLnptIbJB25MAwD1CMf0Aw9UihzHBgLKyxrPB24','zxjYB3jZ','y2HLy2TVDG','zMfPBgvKx2nOzwnRCW','sw5MCMfZDhj1y3r1CMuGyxmGq29KzsbZzwn1CML0EsbZy2fUBMLUzYaOrg9JA2vYlcblDwjLCM5LDgvZlcbuzxjYywzVCM0P','zgvMyxvSDa','CgfYC2viywrVBgLUDfjLC3vSDhm','z2L0AhvIlwfJDgLVBNm','CgfJA2fNzs5QC29U','mZiZoda3BwX3Auj5','C2vJDxjPDhK','BwfWwwfTBgXPBNrtzxzLCML0Eq','y29SDw1U','C2nHBM5LCKnHy2HL','m01uq3HOra','Bg9Nz2vY','D2fYBG','ChjPDMf0zsbRzxK','BwLZC2LUz1bYB3bLCNr5','nZm3ndK1BhnPEeXR','DMfSAwrHDgvzqu1m','DxrMltG','BwfWq2HLy2TVDLnLDMvYAxr5','EwfTBgXPBNq','CMvMzxjLBMnLCW','lMDPDgH1yI93B3jRzMXVD3m','CgfZC3DVCMq','BwvKAxvT','ANnVBI1Zy2HLBwe','BwfWsgfKB2XPBNrtzxzLCML0Eq','EwfTBgXPBNqGzgv0zwn0zwq','DMfSAwrHDgvuC0nVBMzPzW','y3DL','AgfKB2XPBNq','y2HLy2TVDIbUB3qGyxzHAwXHyMXL','vxnLigvUDMLYB25Tzw50lxnWzwnPzMLJic5LBNyGzMLSzxmGyw5KigfKzcaUzw52ihrVic5NAxrPz25VCMu','BwfW','yxzHAwXHyMXLu2nHBM5LCNm','CgLWigLUC3rHBgWGEwfTBgXPBNq','EwfTBgXPBNqGDMfSAwrHDgLVBIbMywLSzwq','AxnbCNjHEq','CgfYC2vzyw1SBgLUDfjLC3vSDhm','DhnJB25MAwCUANnVBG','ote4wMDVww16','mty1ndeWtgjVCLLi','y2HLy2TVDIbKzxrLy3rLza','zxjYB3i','AgfKB2XPBNqGls12zxjZAw9U','C3rKB3v0','qvDtignYzwrLBNrPywXZ','lMvUDG','ywP2lwzVCM1HDhm','DMfSAwrHDgvxAxrOq2HLy2TVDG','rvjst1i','CMvZDwX0CW','zg9JA2vYlwnVBxbVC2uUEwfTBa','CMvTzwrPyxrPB24','vMfSAwrHDgLVBIbPC3n1zsbKzxrLy3rLza','zw52','DMfSAwrHDgLVBG','y2HLy2TFAwq','lMPZB24','z2v0vMfSAwrHDg9Yu3rHDhvZ','ndq0D2PrDxnP','v0fstKLorW','zMLSzq','Dg9mB3DLCKnHC2u','C3bSAxq','EwfTBgXPBNqGlwyGCgfYC2fIBguGiG','zg9JA2vYzMLSzq','z3vPzgvSAw5L','sLnptIbty2HLBweGDMfSAwrHDgLVBIbHDMfPBgfIBgu','igrLDgvJDgvKigLUic5LBNyGzMLSzq','Bw9KDwXL','q29UC2LKzxiGzw5HyMXPBMCGiNn0CMLJDciGBw9KzsbMB3iGyMv0DgvYihr5CguGC2fMzxr5','lNLHBwW','zw5KC1DPDgG','Bgv2zwW','ANnVBI1WyxjZzq','ANnVBLnJAgvTyq','AgfKB2XPBNqGls1MB3jTyxqGANnVBIaI','DhnJB25MAwCTDMfSAwrHDg9Y','mtaZmdCWmtzns0Lwyxa','AgfKB2XPBNqGDMfSAwrHDgLVBIbMywLSzwq'];a0_0x4411=function(){return _0x347a34;};return a0_0x4411();}import a0_0x160da0 from'path';import a0_0x300a1c from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class ConfigValidator{constructor(_0x1967e6=null){const _0x454e9c=a0_0x8cd3;this[_0x454e9c(0x208)]=_0x1967e6,this['availableScanners']=null,this[_0x454e9c(0x206)]=new Map();}async[a0_0x111283(0x250)](){const _0x22917a=a0_0x111283;if(this[_0x22917a(0x21e)]!==null)return this[_0x22917a(0x21e)];const _0xfb772d={'checkov':![],'hadolint':![],'yamllint':![],'jsonSchema':![]};try{await execAsync('checkov\x20--version',{'timeout':0x1388}),_0xfb772d['checkov']=!![],this[_0x22917a(0x208)]?.['debug'](_0x22917a(0x226));}catch(_0x4a55bc){this['logger']?.['debug'](_0x22917a(0x21b),{'error':_0x4a55bc[_0x22917a(0x1e7)]});}try{await execAsync(_0x22917a(0x228),{'timeout':0x1388}),_0xfb772d[_0x22917a(0x21a)]=!![],this[_0x22917a(0x208)]?.['debug']('hadolint\x20detected');}catch(_0xb555c){this[_0x22917a(0x208)]?.['debug']('hadolint\x20not\x20available',{'error':_0xb555c['message']});}try{await execAsync('yamllint\x20--version',{'timeout':0x1388}),_0xfb772d[_0x22917a(0x210)]=!![],this['logger']?.['debug'](_0x22917a(0x217));}catch(_0x43164f){this[_0x22917a(0x208)]?.['debug']('yamllint\x20not\x20available',{'error':_0x43164f['message']});}try{await import(_0x22917a(0x251)),_0xfb772d[_0x22917a(0x248)]=!![],this[_0x22917a(0x208)]?.[_0x22917a(0x1f1)](_0x22917a(0x240));}catch(_0xf8310e){this['logger']?.['debug'](_0x22917a(0x262),{'error':_0xf8310e['message']});}return this[_0x22917a(0x21e)]=_0xfb772d,_0xfb772d;}async[a0_0x111283(0x1e1)](_0x2f5733,_0x5cfbc0={}){const _0x23c4b1=a0_0x111283,_0x1e51e4=[],_0x5264f1=await this['detectAvailableValidators'](),_0x5c2e69=this[_0x23c4b1(0x1f8)](_0x2f5733);this[_0x23c4b1(0x208)]?.['debug']('Validating\x20config\x20file',{'filePath':_0x2f5733,'fileType':_0x5c2e69});switch(_0x5c2e69){case _0x23c4b1(0x23e):if(_0x5264f1['hadolint']){const _0x2f2c85=await this['validateDockerfile'](_0x2f5733,_0x5cfbc0);_0x1e51e4['push'](..._0x2f2c85);}if(_0x5264f1[_0x23c4b1(0x1fb)]){const _0x47491f=await this[_0x23c4b1(0x22d)](_0x2f5733,_0x23c4b1(0x23e),_0x5cfbc0);_0x1e51e4['push'](..._0x47491f);}break;case _0x23c4b1(0x25b):if(_0x5264f1['yamllint']){const _0x250e21=await this[_0x23c4b1(0x20d)](_0x2f5733,_0x5cfbc0);_0x1e51e4['push'](..._0x250e21);}if(_0x5264f1['checkov']){const _0x481fe5=await this[_0x23c4b1(0x22d)](_0x2f5733,'docker_compose',_0x5cfbc0);_0x1e51e4[_0x23c4b1(0x261)](..._0x481fe5);}break;case'kubernetes':if(_0x5264f1[_0x23c4b1(0x210)]){const _0x3d3b46=await this['validateYAML'](_0x2f5733,_0x5cfbc0);_0x1e51e4['push'](..._0x3d3b46);}if(_0x5264f1[_0x23c4b1(0x1fb)]){const _0xd4cab4=await this['validateWithCheckov'](_0x2f5733,'kubernetes',_0x5cfbc0);_0x1e51e4['push'](..._0xd4cab4);}break;case'terraform':if(_0x5264f1[_0x23c4b1(0x1fb)]){const _0x573003=await this['validateWithCheckov'](_0x2f5733,_0x23c4b1(0x1e5),_0x5cfbc0);_0x1e51e4[_0x23c4b1(0x261)](..._0x573003);}break;case _0x23c4b1(0x201):if(_0x5264f1[_0x23c4b1(0x248)]){const _0x53aa19=await this['validatePackageJson'](_0x2f5733,_0x5cfbc0);_0x1e51e4[_0x23c4b1(0x261)](..._0x53aa19);}break;case'tsconfig.json':if(_0x5264f1['jsonSchema']){const _0x4d03ba=await this[_0x23c4b1(0x218)](_0x2f5733,_0x5cfbc0);_0x1e51e4['push'](..._0x4d03ba);}break;case _0x23c4b1(0x200):if(_0x5264f1[_0x23c4b1(0x210)]){const _0x49d097=await this[_0x23c4b1(0x20d)](_0x2f5733,_0x5cfbc0);_0x1e51e4[_0x23c4b1(0x261)](..._0x49d097);}break;case'env':const _0x3dbda1=await this[_0x23c4b1(0x1f5)](_0x2f5733,_0x5cfbc0);_0x1e51e4[_0x23c4b1(0x261)](..._0x3dbda1);break;case _0x23c4b1(0x1ef):if(_0x5264f1['yamllint']){const _0x4d288b=await this['validateYAML'](_0x2f5733,_0x5cfbc0);_0x1e51e4['push'](..._0x4d288b);}break;default:this['logger']?.[_0x23c4b1(0x209)]('Unknown\x20config\x20file\x20type',{'filePath':_0x2f5733,'fileType':_0x5c2e69});return[];}return this['normalizeResults'](_0x1e51e4);}async['validateDockerfile'](_0xe7f73f,_0x20ffe2={}){const _0x46798b=a0_0x111283;try{const _0x5b879f=await execAsync(_0x46798b(0x249)+_0xe7f73f+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x1af36d=JSON['parse'](_0x5b879f[_0x46798b(0x229)]);return this['parseHadolintResults'](_0x1af36d,_0xe7f73f);}catch(_0x22a6bc){if(_0x22a6bc[_0x46798b(0x229)])try{const _0x4deab4=JSON[_0x46798b(0x1f3)](_0x22a6bc[_0x46798b(0x229)]);return this[_0x46798b(0x1ff)](_0x4deab4,_0xe7f73f);}catch(_0x556b03){this[_0x46798b(0x208)]?.[_0x46798b(0x227)](_0x46798b(0x254),{'error':_0x556b03[_0x46798b(0x1e7)]});}return this[_0x46798b(0x208)]?.[_0x46798b(0x227)](_0x46798b(0x24c),{'error':_0x22a6bc[_0x46798b(0x1e7)]}),[];}}[a0_0x111283(0x1ff)](_0x30b47c,_0x4f45a1){const _0x2007f2=a0_0x111283,_0x2d07b8=[];if(Array[_0x2007f2(0x221)](_0x30b47c))for(const _0x341063 of _0x30b47c){_0x2d07b8[_0x2007f2(0x261)]({'file':_0x4f45a1,'line':_0x341063['line']||0x1,'column':_0x341063[_0x2007f2(0x205)]||0x1,'severity':this[_0x2007f2(0x216)](_0x341063[_0x2007f2(0x246)]),'rule':_0x341063[_0x2007f2(0x24f)],'message':_0x341063[_0x2007f2(0x1e7)],'category':'dockerfile','validator':'hadolint'});}return _0x2d07b8;}async[a0_0x111283(0x20d)](_0x59acea,_0x3c9d15={}){const _0x298f98=a0_0x111283;try{const _0x8339c7=await execAsync(_0x298f98(0x23d)+_0x59acea+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530});return this['parseYamllintResults'](_0x8339c7[_0x298f98(0x229)],_0x59acea);}catch(_0x7289b2){if(_0x7289b2['stdout'])return this['parseYamllintResults'](_0x7289b2['stdout'],_0x59acea);return this['logger']?.[_0x298f98(0x227)](_0x298f98(0x220),{'error':_0x7289b2[_0x298f98(0x1e7)]}),[];}}[a0_0x111283(0x222)](_0x2ea61f,_0x443857){const _0x572698=a0_0x111283,_0x10f71e=[],_0x46956c=_0x2ea61f[_0x572698(0x23c)]('\x0a')['filter'](_0x2adb47=>_0x2adb47[_0x572698(0x25f)]());for(const _0x17915e of _0x46956c){const _0x36577f=_0x17915e['match'](/^(.+?):(\d+):(\d+):\s*\[(\w+)\]\s*(.+?)\s*\((.+?)\)/);if(_0x36577f){const [,_0x196141,_0x3d516a,_0x39c281,_0x1f8fad,_0x5d72f1,_0x425193]=_0x36577f;_0x10f71e[_0x572698(0x261)]({'file':_0x443857,'line':parseInt(_0x3d516a,0xa),'column':parseInt(_0x39c281,0xa),'severity':this[_0x572698(0x204)](_0x1f8fad),'rule':_0x425193,'message':_0x5d72f1,'category':_0x572698(0x1ef),'validator':_0x572698(0x210)});}}return _0x10f71e;}async['validateWithCheckov'](_0x41d84d,_0x3df78c,_0x45cde6={}){const _0x7248b3=a0_0x111283;try{const _0x394c82=await execAsync('checkov\x20-f\x20\x22'+_0x41d84d+'\x22\x20--framework\x20'+_0x3df78c+'\x20--output\x20json\x20--compact',{'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x14a4cb=JSON[_0x7248b3(0x1f3)](_0x394c82[_0x7248b3(0x229)]);return this['parseCheckovResults'](_0x14a4cb,_0x41d84d);}catch(_0x27311){if(_0x27311[_0x7248b3(0x229)])try{const _0x5663c0=JSON[_0x7248b3(0x1f3)](_0x27311['stdout']);return this[_0x7248b3(0x255)](_0x5663c0,_0x41d84d);}catch(_0x5de0f0){this[_0x7248b3(0x208)]?.['error']('Failed\x20to\x20parse\x20checkov\x20output',{'error':_0x5de0f0[_0x7248b3(0x1e7)]});}return this['logger']?.[_0x7248b3(0x227)]('checkov\x20validation\x20failed',{'error':_0x27311[_0x7248b3(0x1e7)]}),[];}}['parseCheckovResults'](_0x4db91f,_0x2d8448){const _0x305bc2=a0_0x111283,_0xb3b293=[];if(_0x4db91f[_0x305bc2(0x22f)]&&_0x4db91f['results'][_0x305bc2(0x1fc)])for(const _0x448a40 of _0x4db91f['results']['failed_checks']){_0xb3b293[_0x305bc2(0x261)]({'file':_0x2d8448,'line':_0x448a40['file_line_range']?_0x448a40[_0x305bc2(0x1e4)][0x0]:0x1,'column':0x1,'severity':this[_0x305bc2(0x20f)](_0x448a40['check_class']),'rule':_0x448a40[_0x305bc2(0x235)],'message':_0x448a40['check_name']||_0x448a40['check_id'],'category':_0x305bc2(0x203),'validator':_0x305bc2(0x1fb),'remediation':_0x448a40[_0x305bc2(0x23f)],'cwe':_0x448a40[_0x305bc2(0x219)],'references':_0x448a40[_0x305bc2(0x23f)]?[_0x448a40[_0x305bc2(0x23f)]]:[]});}return _0xb3b293;}async['validatePackageJson'](_0x193d2b,_0x121e6e={}){const _0x4bb89f=a0_0x111283;try{const _0x5d3046=(await import('ajv'))['default'],_0xccfa9d=(await import(_0x4bb89f(0x22c)))[_0x4bb89f(0x1fe)],_0x288713=await a0_0x300a1c['readFile'](_0x193d2b,_0x4bb89f(0x20e)),_0x59a341=JSON['parse'](_0x288713),_0x4f4da6=new _0x5d3046({'allErrors':!![],'strict':![]});_0xccfa9d(_0x4f4da6);const _0x1e8cb2={'type':'object','required':['name','version'],'properties':{'name':{'type':_0x4bb89f(0x260),'pattern':'^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'},'version':{'type':_0x4bb89f(0x260)},'description':{'type':'string'},'main':{'type':'string'},'type':{'type':_0x4bb89f(0x260),'enum':[_0x4bb89f(0x242),'commonjs']},'scripts':{'type':_0x4bb89f(0x1e3)},'dependencies':{'type':_0x4bb89f(0x1e3)},'devDependencies':{'type':_0x4bb89f(0x1e3)}},'additionalProperties':!![]},_0x1ed1eb=_0x4f4da6[_0x4bb89f(0x24d)](_0x1e8cb2),_0x39518a=_0x1ed1eb(_0x59a341);if(!_0x39518a&&_0x1ed1eb[_0x4bb89f(0x1fa)])return _0x1ed1eb['errors'][_0x4bb89f(0x21d)](_0x57b25d=>({'file':_0x193d2b,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x4bb89f(0x22e)],'rule':_0x4bb89f(0x215),'message':_0x57b25d['instancePath']?_0x57b25d['instancePath']+'\x20'+_0x57b25d[_0x4bb89f(0x1e7)]:'must\x20have\x20required\x20property\x20\x27'+_0x57b25d['params'][_0x4bb89f(0x20b)]+'\x27','category':'validation','validator':_0x4bb89f(0x215)}));return[];}catch(_0x21c2a8){return this['logger']?.[_0x4bb89f(0x227)]('package.json\x20validation\x20failed',{'error':_0x21c2a8['message']}),[{'file':_0x193d2b,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x4bb89f(0x258)][_0x4bb89f(0x22e)],'rule':'json-parse','message':_0x4bb89f(0x256)+_0x21c2a8['message'],'category':'syntax','validator':_0x4bb89f(0x247)}];}}async[a0_0x111283(0x218)](_0xeb39f7,_0x45fd03={}){const _0x5286b1=a0_0x111283;try{const _0x5340d8=await a0_0x300a1c[_0x5286b1(0x259)](_0xeb39f7,_0x5286b1(0x20e)),_0x44e9c8=JSON[_0x5286b1(0x1f3)](_0x5340d8),_0x4a8508=[];if(_0x44e9c8['compilerOptions']){const _0x47f651=_0x44e9c8['compilerOptions'];!_0x47f651['strict']&&_0x4a8508[_0x5286b1(0x261)]({'file':_0xeb39f7,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0x5286b1(0x258)][_0x5286b1(0x239)],'rule':'strict-mode','message':_0x5286b1(0x243),'category':'best-practice','validator':_0x5286b1(0x24a)}),_0x47f651['noImplicitAny']===![]&&_0x4a8508['push']({'file':_0xeb39f7,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x5286b1(0x239)],'rule':'no-implicit-any','message':_0x5286b1(0x1f2),'category':'best-practice','validator':_0x5286b1(0x24a)});}return _0x4a8508;}catch(_0xaffcf1){return this['logger']?.['error']('tsconfig.json\x20validation\x20failed',{'error':_0xaffcf1['message']}),[{'file':_0xeb39f7,'line':0x1,'column':0x1,'severity':STATIC_ANALYSIS['SEVERITY']['ERROR'],'rule':_0x5286b1(0x247),'message':_0x5286b1(0x256)+_0xaffcf1['message'],'category':'syntax','validator':_0x5286b1(0x247)}];}}async['validateEnvFile'](_0x522705,_0x5e2d26={}){const _0x345e79=a0_0x111283;try{const _0x5bc5c7=await a0_0x300a1c[_0x345e79(0x259)](_0x522705,_0x345e79(0x20e)),_0x3ebfd9=[],_0x5e6e11=_0x5bc5c7['split']('\x0a'),_0x5e740a=[{'pattern':/password|passwd|pwd/i,'name':_0x345e79(0x213)},{'pattern':/api[_-]?key/i,'name':'API\x20key'},{'pattern':/secret/i,'name':'secret'},{'pattern':/token/i,'name':'token'},{'pattern':/private[_-]?key/i,'name':_0x345e79(0x20a)},{'pattern':/aws[_-]?access/i,'name':_0x345e79(0x22a)}];return _0x5e6e11['forEach']((_0x198d41,_0x58ec4e)=>{const _0xeb92c8=_0x345e79,_0x1a2a07=_0x198d41['trim']();if(!_0x1a2a07||_0x1a2a07['startsWith']('#'))return;if(_0x1a2a07[_0xeb92c8(0x1f7)]('=')){const [_0x1f9884,_0x576c32]=_0x1a2a07[_0xeb92c8(0x23c)]('='),_0x290125=_0x1f9884['toLowerCase'](),_0x45afe6=_0x576c32?.[_0xeb92c8(0x25f)]()||'',_0x23ef0a=_0x45afe6&&_0x45afe6!==''&&!_0x45afe6['startsWith']('$')&&_0x45afe6!==_0xeb92c8(0x263)&&_0x45afe6!==_0xeb92c8(0x253)&&_0x45afe6['length']>0x5;if(_0x23ef0a)for(const {pattern:_0x34633c,name:_0x30e32d}of _0x5e740a){if(_0x34633c['test'](_0x290125)){_0x3ebfd9[_0xeb92c8(0x261)]({'file':_0x522705,'line':_0x58ec4e+0x1,'column':0x1,'severity':STATIC_ANALYSIS[_0xeb92c8(0x258)]['CRITICAL'],'rule':_0xeb92c8(0x1f0),'message':'Potential\x20hardcoded\x20'+_0x30e32d+_0xeb92c8(0x241),'category':'security','validator':_0xeb92c8(0x1e8),'remediation':_0xeb92c8(0x21c)});break;}}}}),_0x3ebfd9;}catch(_0x2c35a6){return this['logger']?.[_0x345e79(0x227)](_0x345e79(0x1e2),{'error':_0x2c35a6[_0x345e79(0x1e7)]}),[];}}[a0_0x111283(0x1f8)](_0x52d979){const _0x2cff89=a0_0x111283,_0x268495=a0_0x160da0['basename'](_0x52d979)[_0x2cff89(0x23b)](),_0x26427d=a0_0x160da0['dirname'](_0x52d979);if(_0x268495==='dockerfile')return'dockerfile';if(_0x268495==='docker-compose.yml'||_0x268495===_0x2cff89(0x230))return'docker-compose';if(_0x268495===_0x2cff89(0x201))return'package.json';if(_0x268495===_0x2cff89(0x223))return'tsconfig.json';if(_0x268495===_0x2cff89(0x22b)||_0x268495[_0x2cff89(0x245)](_0x2cff89(0x22b)))return _0x2cff89(0x233);if(_0x26427d['includes'](_0x2cff89(0x212)))return'github-actions';if(_0x26427d['includes']('kubernetes')||_0x26427d['includes'](_0x2cff89(0x1ec)))return _0x2cff89(0x1e6);const _0x5bf8b7=a0_0x160da0['extname'](_0x52d979)['toLowerCase']();if(_0x5bf8b7==='.tf'||_0x5bf8b7===_0x2cff89(0x25a))return'terraform';if(_0x5bf8b7===_0x2cff89(0x1f4)||_0x5bf8b7===_0x2cff89(0x244))return'yaml';if(_0x5bf8b7===_0x2cff89(0x236))return'json';return _0x2cff89(0x1e9);}[a0_0x111283(0x1e0)](_0xe4a50c){const _0x3efcd8=a0_0x111283;return _0xe4a50c[_0x3efcd8(0x21d)](_0x27474b=>({'file':_0x27474b[_0x3efcd8(0x23a)],'line':_0x27474b['line']||0x1,'column':_0x27474b['column']||0x1,'severity':_0x27474b['severity']||STATIC_ANALYSIS[_0x3efcd8(0x258)]['WARNING'],'rule':_0x27474b[_0x3efcd8(0x25c)]||'unknown','message':_0x27474b['message']||_0x3efcd8(0x232),'category':_0x27474b[_0x3efcd8(0x1f6)]||_0x3efcd8(0x234),'validator':_0x27474b['validator'],'cwe':_0x27474b[_0x3efcd8(0x219)]||null,'remediation':_0x27474b[_0x3efcd8(0x231)]||null,'references':_0x27474b[_0x3efcd8(0x211)]||[]}));}[a0_0x111283(0x216)](_0x3cd40a){const _0x52bf16=a0_0x111283,_0x1c6ec8={'error':STATIC_ANALYSIS['SEVERITY'][_0x52bf16(0x22e)],'warning':STATIC_ANALYSIS['SEVERITY']['WARNING'],'info':STATIC_ANALYSIS[_0x52bf16(0x258)][_0x52bf16(0x24e)],'style':STATIC_ANALYSIS[_0x52bf16(0x258)][_0x52bf16(0x24e)]};return _0x1c6ec8[_0x3cd40a?.[_0x52bf16(0x23b)]()]||STATIC_ANALYSIS[_0x52bf16(0x258)][_0x52bf16(0x239)];}[a0_0x111283(0x204)](_0xf497e){const _0x1db49f=a0_0x111283,_0x1d045d={'error':STATIC_ANALYSIS[_0x1db49f(0x258)][_0x1db49f(0x22e)],'warning':STATIC_ANALYSIS[_0x1db49f(0x258)]['WARNING']};return _0x1d045d[_0xf497e?.['toLowerCase']()]||STATIC_ANALYSIS[_0x1db49f(0x258)]['WARNING'];}[a0_0x111283(0x20f)](_0x22dba7){const _0x3ebb86=a0_0x111283;return STATIC_ANALYSIS[_0x3ebb86(0x258)][_0x3ebb86(0x22e)];}async[a0_0x111283(0x237)](){const _0x356144=await this['detectAvailableValidators']();return{'validators':_0x356144,'recommendations':this['getInstallRecommendations'](_0x356144)};}['getInstallRecommendations'](_0x204318){const _0x5a50ed=a0_0x111283,_0x271a1e=[];return!_0x204318['checkov']&&_0x271a1e[_0x5a50ed(0x261)]({'validator':_0x5a50ed(0x1fb),'reason':_0x5a50ed(0x1fd),'install':'pip\x20install\x20checkov','priority':_0x5a50ed(0x1ed)}),!_0x204318[_0x5a50ed(0x21a)]&&_0x271a1e[_0x5a50ed(0x261)]({'validator':'hadolint','reason':_0x5a50ed(0x25d),'install':'Download from https://github.com/hadolint/hadolint/releases','priority':'high'}),!_0x204318[_0x5a50ed(0x210)]&&_0x271a1e[_0x5a50ed(0x261)]({'validator':'yamllint','reason':_0x5a50ed(0x1eb),'install':_0x5a50ed(0x21f),'priority':_0x5a50ed(0x214)}),!_0x204318['jsonSchema']&&_0x271a1e[_0x5a50ed(0x261)]({'validator':'ajv\x20(JSON\x20Schema)','reason':_0x5a50ed(0x1f9),'install':'npm\x20install\x20ajv\x20ajv-formats','priority':_0x5a50ed(0x214)}),_0x271a1e;}}function a0_0x8cd3(_0x3e89c2,_0x5dcbfe){_0x3e89c2=_0x3e89c2-0x1e0;const _0x4411d4=a0_0x4411();let _0x8cd3b6=_0x4411d4[_0x3e89c2];if(a0_0x8cd3['ZzzvAj']===undefined){var _0x5233c3=function(_0x3d5dd2){const _0x170b96='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x160da0='',_0x300a1c='';for(let _0x1967e6=0x0,_0xfb772d,_0x4a55bc,_0xb555c=0x0;_0x4a55bc=_0x3d5dd2['charAt'](_0xb555c++);~_0x4a55bc&&(_0xfb772d=_0x1967e6%0x4?_0xfb772d*0x40+_0x4a55bc:_0x4a55bc,_0x1967e6++%0x4)?_0x160da0+=String['fromCharCode'](0xff&_0xfb772d>>(-0x2*_0x1967e6&0x6)):0x0){_0x4a55bc=_0x170b96['indexOf'](_0x4a55bc);}for(let _0x43164f=0x0,_0xf8310e=_0x160da0['length'];_0x43164f<_0xf8310e;_0x43164f++){_0x300a1c+='%'+('00'+_0x160da0['charCodeAt'](_0x43164f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x300a1c);};a0_0x8cd3['wgREgu']=_0x5233c3,a0_0x8cd3['EOlaon']={},a0_0x8cd3['ZzzvAj']=!![];}const _0x20d0e4=_0x4411d4[0x0],_0x207685=_0x3e89c2+_0x20d0e4,_0xa03b6c=a0_0x8cd3['EOlaon'][_0x207685];return!_0xa03b6c?(_0x8cd3b6=a0_0x8cd3['wgREgu'](_0x8cd3b6),a0_0x8cd3['EOlaon'][_0x207685]=_0x8cd3b6):_0x8cd3b6=_0xa03b6c,_0x8cd3b6;}export default ConfigValidator;
|