@loxia-labs/loxia-autopilot-one 2.0.0 → 2.0.3
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 +123 -255
- 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 +9 -2
- 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 -0
- package/src/tools/excelTool.js +1 -0
- 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 -0
- 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/web-ui/build/index.html +2 -2
- package/web-ui/build/static/{index-CbQvXGHE.js → index-B5f---1N.js} +121 -121
- package/web-ui/build/static/index-ewlrW3xd.css +1 -0
- package/web-ui/build/static/index-CWfjdxno.css +0 -1
package/README.md
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Loxia Autopilot One
|
|
4
4
|
|
|
5
5
|
**Autonomous AI Agent System for Software Development**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@loxia-labs/loxia-autopilot-one)
|
|
8
8
|
[](https://nodejs.org)
|
|
9
9
|
[](./LICENSE)
|
|
10
|
-
[](CONTRIBUTING.md)
|
|
11
10
|
|
|
12
|
-
**[Quick Start](#-quick-start)**
|
|
11
|
+
**[Quick Start](#-quick-start)** | **[Features](#-features)** | **[Documentation](#-documentation)** | **[Tools](#-ai-powered-tools)** | **[Web UI](#-web-interface)**
|
|
13
12
|
|
|
14
13
|
</div>
|
|
15
14
|
|
|
16
15
|
---
|
|
17
16
|
|
|
18
|
-
##
|
|
17
|
+
## What is Loxia Autopilot One?
|
|
19
18
|
|
|
20
19
|
Loxia Autopilot One is a **production-ready autonomous AI agent system** that empowers developers with intelligent coding assistance. It combines the power of multiple AI models with a comprehensive toolkit for software development, code analysis, and automation.
|
|
21
20
|
|
|
22
21
|
### Why Loxia?
|
|
23
22
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
23
|
+
- **Multi-Agent Orchestration** - Run multiple AI agents simultaneously with isolated workspaces
|
|
24
|
+
- **Rich Tool Ecosystem** - 18+ specialized tools for development, analysis, and automation
|
|
25
|
+
- **Dual Interface** - Modern Web UI + powerful CLI for any workflow
|
|
26
|
+
- **Real-Time Monitoring** - Track agent activity, costs, and performance
|
|
27
|
+
- **Persistent State** - Resume conversations and continue work across sessions
|
|
28
|
+
- **Secure by Design** - Agent isolation, resource limits, and security scanning
|
|
30
29
|
|
|
31
30
|
---
|
|
32
31
|
|
|
33
|
-
##
|
|
32
|
+
## Features
|
|
34
33
|
|
|
35
34
|
### Core Capabilities
|
|
36
35
|
|
|
@@ -38,7 +37,7 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
38
37
|
<tr>
|
|
39
38
|
<td width="50%">
|
|
40
39
|
|
|
41
|
-
####
|
|
40
|
+
#### Intelligent Agent System
|
|
42
41
|
- Multi-agent conversation orchestration
|
|
43
42
|
- Automatic model selection and routing
|
|
44
43
|
- Task-based agent specialization
|
|
@@ -48,7 +47,7 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
48
47
|
</td>
|
|
49
48
|
<td width="50%">
|
|
50
49
|
|
|
51
|
-
####
|
|
50
|
+
#### Professional Tooling
|
|
52
51
|
- Terminal command execution
|
|
53
52
|
- File system operations
|
|
54
53
|
- Web browsing and scraping
|
|
@@ -60,7 +59,7 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
60
59
|
<tr>
|
|
61
60
|
<td width="50%">
|
|
62
61
|
|
|
63
|
-
####
|
|
62
|
+
#### Development Features
|
|
64
63
|
- Import/export analysis
|
|
65
64
|
- Dependency resolution
|
|
66
65
|
- Static code analysis
|
|
@@ -70,7 +69,7 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
70
69
|
</td>
|
|
71
70
|
<td width="50%">
|
|
72
71
|
|
|
73
|
-
####
|
|
72
|
+
#### Smart Assistance
|
|
74
73
|
- Context-aware responses
|
|
75
74
|
- File attachments in chat
|
|
76
75
|
- Conversation compaction
|
|
@@ -83,7 +82,7 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
83
82
|
|
|
84
83
|
---
|
|
85
84
|
|
|
86
|
-
##
|
|
85
|
+
## Quick Start
|
|
87
86
|
|
|
88
87
|
### 1. Create an Account
|
|
89
88
|
|
|
@@ -99,7 +98,7 @@ npm install -g @loxia-labs/loxia-autopilot-one
|
|
|
99
98
|
|
|
100
99
|
```bash
|
|
101
100
|
loxia --version
|
|
102
|
-
# Should display: Loxia Autopilot One v2.0.
|
|
101
|
+
# Should display: Loxia Autopilot One v2.0.2
|
|
103
102
|
```
|
|
104
103
|
|
|
105
104
|
### 4. Create an API Key
|
|
@@ -142,28 +141,24 @@ loxia --help # Show all options
|
|
|
142
141
|
|
|
143
142
|
---
|
|
144
143
|
|
|
145
|
-
##
|
|
144
|
+
## Web Interface
|
|
146
145
|
|
|
147
146
|
The modern Web UI provides an intuitive interface for managing agents and conversations:
|
|
148
147
|
|
|
149
148
|
### Key Features
|
|
150
149
|
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
### Web UI Screenshots
|
|
161
|
-
|
|
162
|
-
*Coming soon - the interface provides a clean, modern experience for interacting with AI agents*
|
|
150
|
+
- **Chat Interface** - Clean, responsive chat with markdown support
|
|
151
|
+
- **File Attachments** - Drag and drop files into conversations
|
|
152
|
+
- **Agent Management** - Create, switch, and manage multiple agents
|
|
153
|
+
- **Real-Time Updates** - Live agent status and output streaming
|
|
154
|
+
- **Model Selection** - Switch between AI models on the fly
|
|
155
|
+
- **Task Tracking** - Visual task lists with progress indicators
|
|
156
|
+
- **Search & Filter** - Find conversations and messages quickly
|
|
157
|
+
- **Modern UI** - Built with React, TailwindCSS, and WebSockets
|
|
163
158
|
|
|
164
159
|
---
|
|
165
160
|
|
|
166
|
-
##
|
|
161
|
+
## AI-Powered Tools
|
|
167
162
|
|
|
168
163
|
Loxia comes with 18+ specialized tools that agents can use autonomously:
|
|
169
164
|
|
|
@@ -171,97 +166,85 @@ Loxia comes with 18+ specialized tools that agents can use autonomously:
|
|
|
171
166
|
|
|
172
167
|
| Tool | Description | Key Features |
|
|
173
168
|
|------|-------------|--------------|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
169
|
+
| **Terminal** | Execute shell commands | Background processes, stdin input, prompt detection |
|
|
170
|
+
| **File System** | File operations | Create, read, update, delete files and directories |
|
|
171
|
+
| **Browser** | Web automation | Headless browsing, screenshots, scraping with Puppeteer |
|
|
172
|
+
| **Seek** | Code search | Pattern matching, multi-directory support |
|
|
173
|
+
| **File Tree** | Directory visualization | Tree structure generation, filtering |
|
|
179
174
|
|
|
180
175
|
### Analysis Tools
|
|
181
176
|
|
|
182
177
|
| Tool | Description | Key Features |
|
|
183
178
|
|------|-------------|--------------|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
179
|
+
| **Import Analyzer** | Import/export analysis | ES6, CommonJS, circular dependencies, unused exports |
|
|
180
|
+
| **Dependency Resolver** | Dependency management | Semantic versioning, conflict detection, upgrade paths |
|
|
181
|
+
| **Static Analysis** | Code quality | ESLint, Prettier, TypeScript, Stylelint integration |
|
|
182
|
+
| **Clone Detection** | Code duplication | AST-based analysis, similarity scoring |
|
|
183
|
+
| **Security Scanner** | Security audits | npm audit, dependency vulnerabilities, deployment checks |
|
|
189
184
|
|
|
190
185
|
### AI & Automation Tools
|
|
191
186
|
|
|
192
187
|
| Tool | Description | Key Features |
|
|
193
188
|
|------|-------------|--------------|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
189
|
+
| **Image Generator** | AI image creation | Flux Pro support, high-quality outputs |
|
|
190
|
+
| **Video Generator** | AI video creation | Azure OpenAI Sora integration, async processing |
|
|
191
|
+
| **Task Manager** | Task tracking | Todo lists, progress tracking, agent synchronization |
|
|
192
|
+
| **Web Tool** | HTTP requests | GET, POST, API testing, webhook debugging |
|
|
193
|
+
| **File Content Replace** | Bulk replacements | Pattern-based, multi-file, preview changes |
|
|
194
|
+
| **Agent Communication** | Inter-agent messaging | Task delegation, collaborative workflows |
|
|
200
195
|
|
|
201
196
|
### System Tools
|
|
202
197
|
|
|
203
198
|
| Tool | Description | Key Features |
|
|
204
199
|
|------|-------------|--------------|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
200
|
+
| **Agent Delay** | Pause agent execution | Timed delays, background operation support |
|
|
201
|
+
| **Job Done** | Task completion | Mark autonomous work complete, exit to chat mode |
|
|
202
|
+
| **Async Tool Manager** | Background task handling | Long-running operations, status tracking |
|
|
203
|
+
| **Loop Detection** | Repetition prevention | Sliding window analysis, automatic termination |
|
|
209
204
|
|
|
210
205
|
---
|
|
211
206
|
|
|
212
|
-
##
|
|
207
|
+
## System Requirements
|
|
213
208
|
|
|
214
|
-
- **Node.js**: >=
|
|
209
|
+
- **Node.js**: >= 20.0.0 (20.x LTS recommended)
|
|
215
210
|
- **npm**: >= 7.0.0
|
|
216
211
|
- **Operating System**: Windows, macOS (Intel & Apple Silicon), Linux
|
|
217
212
|
- **Memory**: 2GB minimum, 4GB+ recommended
|
|
218
213
|
- **Disk Space**: 500MB for package and dependencies
|
|
219
214
|
- **Shell**: bash, zsh (macOS default), PowerShell, cmd
|
|
220
215
|
|
|
221
|
-
### Optional Dependencies
|
|
222
|
-
|
|
223
|
-
For full functionality, install these tools:
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# Security scanning
|
|
227
|
-
npm install -g eslint prettier typescript stylelint
|
|
228
|
-
|
|
229
|
-
# For development
|
|
230
|
-
npm install -g nodemon jest
|
|
231
|
-
```
|
|
232
|
-
|
|
233
216
|
---
|
|
234
217
|
|
|
235
|
-
##
|
|
218
|
+
## Architecture
|
|
236
219
|
|
|
237
220
|
### High-Level Overview
|
|
238
221
|
|
|
239
222
|
```
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
223
|
+
+--------------------------------------------------+
|
|
224
|
+
| Client Interfaces |
|
|
225
|
+
| +-------------+ +-------------------------+ |
|
|
226
|
+
| | Web UI | | CLI Interface | |
|
|
227
|
+
| | (React) | | (Interactive Shell) | |
|
|
228
|
+
| +-------------+ +-------------------------+ |
|
|
229
|
+
+------------------------+-------------------------+
|
|
230
|
+
| WebSocket / IPC
|
|
231
|
+
+-------------v--------------+
|
|
232
|
+
| Orchestrator Service |
|
|
233
|
+
| (Request Coordination) |
|
|
234
|
+
+---------+--------+--------+
|
|
235
|
+
| |
|
|
236
|
+
+----------v--+ +--v--------------+
|
|
237
|
+
| Agent Pool | | AI Service |
|
|
238
|
+
| - Lifecycle | | - Model Router |
|
|
239
|
+
| - Scheduling| | - Backend API |
|
|
240
|
+
+------+------+ +-----------------+
|
|
241
|
+
|
|
|
242
|
+
+------v--------------------------+
|
|
243
|
+
| Message Processor |
|
|
244
|
+
| - Tool Registry |
|
|
245
|
+
| - Command Extraction |
|
|
246
|
+
| - Execution Engine |
|
|
247
|
+
+----------------------------------+
|
|
265
248
|
```
|
|
266
249
|
|
|
267
250
|
### Key Components
|
|
@@ -275,146 +258,74 @@ npm install -g nodemon jest
|
|
|
275
258
|
|
|
276
259
|
---
|
|
277
260
|
|
|
278
|
-
##
|
|
261
|
+
## Documentation
|
|
279
262
|
|
|
280
263
|
### For Users
|
|
281
264
|
|
|
282
265
|
- **[Installation Guide](./INSTALLATION.md)** - Detailed installation and setup
|
|
283
|
-
- **[
|
|
284
|
-
- **[
|
|
285
|
-
- **[Configuration](./docs/CONFIGURATION.md)** - Environment variables and settings
|
|
266
|
+
- **[Tool Documentation](./docs/CREATING_TOOLS.md)** - How to use and create tools
|
|
267
|
+
- **[Architecture Docs](./docs/README.md)** - Interactive architecture diagrams
|
|
286
268
|
|
|
287
269
|
### For Developers
|
|
288
270
|
|
|
289
|
-
- **[Architecture Overview](./docs/
|
|
290
|
-
- **[API
|
|
271
|
+
- **[Architecture Overview](./docs/architecture/)** - System design and components
|
|
272
|
+
- **[API Agent Capabilities](./docs/API-AGENT-CAPABILITIES.md)** - Agent API reference
|
|
291
273
|
- **[Creating Tools](./docs/CREATING_TOOLS.md)** - Build custom tools
|
|
292
|
-
- **[Contributing Guide](./CONTRIBUTING.md)** - How to contribute
|
|
293
274
|
|
|
294
275
|
---
|
|
295
276
|
|
|
296
|
-
##
|
|
277
|
+
## Security & Privacy
|
|
297
278
|
|
|
298
279
|
### Built-In Security Features
|
|
299
280
|
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
281
|
+
- **Agent Isolation** - Each agent has isolated workspace and permissions
|
|
282
|
+
- **Resource Limits** - Prevents resource exhaustion (CPU, memory, commands)
|
|
283
|
+
- **Path Validation** - Prevents directory traversal attacks
|
|
284
|
+
- **Command Sanitization** - Protects against command injection
|
|
285
|
+
- **Security Scanning** - Built-in vulnerability detection
|
|
286
|
+
- **Audit Logging** - Comprehensive activity logs
|
|
306
287
|
|
|
307
288
|
### Privacy
|
|
308
289
|
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
- ✅ **Secure Communication** - Authentication data protected during transmission
|
|
315
|
-
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
## 🎯 Use Cases
|
|
319
|
-
|
|
320
|
-
### Software Development
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
✓ Code refactoring and modernization
|
|
324
|
-
✓ Dependency updates and conflict resolution
|
|
325
|
-
✓ Test generation and debugging
|
|
326
|
-
✓ Documentation generation
|
|
327
|
-
✓ Code review automation
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
### Project Analysis
|
|
331
|
-
|
|
332
|
-
```
|
|
333
|
-
✓ Import/export dependency mapping
|
|
334
|
-
✓ Circular dependency detection
|
|
335
|
-
✓ Code duplication analysis
|
|
336
|
-
✓ Security vulnerability scanning
|
|
337
|
-
✓ Code quality assessment
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### Automation
|
|
341
|
-
|
|
342
|
-
```
|
|
343
|
-
✓ Build and deployment scripts
|
|
344
|
-
✓ Batch file operations
|
|
345
|
-
✓ API testing and monitoring
|
|
346
|
-
✓ Web scraping and data collection
|
|
347
|
-
✓ Image generation workflows
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
---
|
|
351
|
-
|
|
352
|
-
## 📊 Performance
|
|
353
|
-
|
|
354
|
-
### Benchmarks
|
|
355
|
-
|
|
356
|
-
- **Agent Response Time**: < 2s for simple queries
|
|
357
|
-
- **Tool Execution**: < 100ms overhead per tool
|
|
358
|
-
- **Memory Usage**: ~150-300MB per agent
|
|
359
|
-
- **Concurrent Agents**: Up to 10 agents per instance
|
|
360
|
-
- **Message Processing**: 1000+ messages/second
|
|
361
|
-
- **Chat Scrolling**: 60fps with 1000+ messages (virtualized rendering)
|
|
362
|
-
|
|
363
|
-
### Conversation Compaction
|
|
364
|
-
|
|
365
|
-
Loxia automatically compacts long conversations to stay within token limits:
|
|
366
|
-
|
|
367
|
-
- **Intelligent Summarization** - Preserves context while reducing tokens
|
|
368
|
-
- **Configurable Strategies** - Aggressive or balanced compaction
|
|
369
|
-
- **Index Tracking** - References original message ranges for retrieval
|
|
290
|
+
- **Authentication Only** - Only credential verification communicates with servers
|
|
291
|
+
- **Local-First** - All work data stays on your machine
|
|
292
|
+
- **No Usage Telemetry** - No tracking or analytics of your work
|
|
293
|
+
- **State Control** - Full control over conversation history
|
|
294
|
+
- **Easy Cleanup** - Delete state directory to remove all local data
|
|
370
295
|
|
|
371
296
|
---
|
|
372
297
|
|
|
373
|
-
##
|
|
298
|
+
## Roadmap
|
|
374
299
|
|
|
375
|
-
### Current Version (2.0.
|
|
300
|
+
### Current Version (2.0.2)
|
|
376
301
|
|
|
377
|
-
-
|
|
378
|
-
-
|
|
379
|
-
-
|
|
380
|
-
- ✅ **Flow conversation clearing** - Agents start with fresh context on each flow run
|
|
381
|
-
- ✅ **Awaiting user input scheduling** - Agents block on credentials/prompts without disappearing from other agents' radar
|
|
382
|
-
- ✅ **Inter-agent reply defaults** - `requiresReply` defaults to true for reliable agent-to-agent conversations
|
|
383
|
-
- ✅ **Flow execution fixes** - Progress indicators, completion detection, node count accuracy
|
|
302
|
+
- Compaction system rewrite: response-data-based token counting, multi-pass summarization
|
|
303
|
+
- SSE stream parser fix for token usage tracking
|
|
304
|
+
- Compaction UI indicator auto-cleanup
|
|
384
305
|
|
|
385
306
|
### Previous Versions
|
|
386
307
|
|
|
387
|
-
-
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
-
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
- ✅ Structured file validation and security scanning
|
|
308
|
+
- v2.0.0: System port protection, UI responsiveness fixes, model error handling
|
|
309
|
+
- v1.9.x: Port registry fix, startup timeout fix, agent creation UX, flow agent visibility
|
|
310
|
+
- v1.8.0: Teams, agent duplication, flow execution, awaiting user input scheduling
|
|
311
|
+
- v1.6.x: JSON repair, filesystem hardening, streaming abort, stop button visibility
|
|
312
|
+
- v1.5.0: Dynamic version display, tool builtin delay, compaction indicator redesign
|
|
313
|
+
- v1.4.x: Parallel agent processing, streaming response display, smart auto-scroll
|
|
314
|
+
- v1.3.x: Binary distribution, video tool (Sora), PDF tool, API key persistence
|
|
315
|
+
- v1.2.x: Full macOS compatibility, help modal, keyboard shortcuts
|
|
316
|
+
- v1.1.x: Multi-agent orchestration, 18+ tools, conversation compaction
|
|
397
317
|
|
|
398
318
|
### Upcoming Features
|
|
399
319
|
|
|
400
|
-
-
|
|
401
|
-
-
|
|
402
|
-
-
|
|
403
|
-
- 🔄 **Voice Interface** - Speech-to-text integration
|
|
320
|
+
- **VSCode Extension** - Native IDE integration
|
|
321
|
+
- **Plugin System** - Custom tool marketplace
|
|
322
|
+
- **Cloud Sync** - Optional cloud backup (opt-in)
|
|
404
323
|
|
|
405
324
|
---
|
|
406
325
|
|
|
407
|
-
##
|
|
408
|
-
|
|
409
|
-
We welcome contributions! Here's how you can help:
|
|
326
|
+
## Contributing
|
|
410
327
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
- 🐛 **Report Bugs** - Open an issue with reproduction steps
|
|
414
|
-
- 💡 **Suggest Features** - Share ideas for improvements
|
|
415
|
-
- 📝 **Improve Documentation** - Fix typos, add examples
|
|
416
|
-
- 🔧 **Build Tools** - Create new tools for the ecosystem
|
|
417
|
-
- 🎨 **UI/UX** - Enhance the Web interface
|
|
328
|
+
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
418
329
|
|
|
419
330
|
### Development Setup
|
|
420
331
|
|
|
@@ -433,46 +344,26 @@ cd web-ui && npm install && npm run build && cd ..
|
|
|
433
344
|
npm run dev
|
|
434
345
|
```
|
|
435
346
|
|
|
436
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
|
|
437
|
-
|
|
438
347
|
---
|
|
439
348
|
|
|
440
|
-
##
|
|
349
|
+
## License
|
|
441
350
|
|
|
442
351
|
**Commercial License** - see [LICENSE](./LICENSE) file for complete terms.
|
|
443
352
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
- ✅ **Modify Configuration** - Customize settings and configuration files
|
|
449
|
-
- ❌ **No Free Use** - Requires active subscription or valid license
|
|
450
|
-
- ❌ **No Credential Sharing** - Personal credentials cannot be shared
|
|
451
|
-
- ❌ **No Redistribution** - Cannot resell, redistribute, or sublicense
|
|
452
|
-
- ❌ **No Reverse Engineering** - Code is obfuscated and protected
|
|
453
|
-
- ❌ **No Derivative Products** - Cannot create competing products
|
|
454
|
-
|
|
455
|
-
### Subscription & Access
|
|
456
|
-
|
|
457
|
-
- **Registration**: Sign up at [autopilot.loxia.ai](https://autopilot.loxia.ai)
|
|
458
|
-
- **Authentication**: Software requires valid API key to operate
|
|
459
|
-
- **Verification**: Periodic authentication checks with licensing server
|
|
460
|
-
- **Expiration**: Access ends when subscription expires (renewable)
|
|
461
|
-
|
|
462
|
-
**Copyright © 2025-2026 Loxia AI. All rights reserved.**
|
|
353
|
+
- **Authentication Required** - Valid subscription or license needed to use
|
|
354
|
+
- **Commercial Use** - Use in your own projects and services (with active subscription)
|
|
355
|
+
- **No Free Use** - Requires active subscription or valid license
|
|
356
|
+
- **No Redistribution** - Cannot resell, redistribute, or sublicense
|
|
463
357
|
|
|
464
|
-
|
|
358
|
+
**Copyright (c) 2025-2026 Loxia AI. All rights reserved.**
|
|
465
359
|
|
|
466
360
|
---
|
|
467
361
|
|
|
468
|
-
##
|
|
362
|
+
## Support
|
|
469
363
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
-
|
|
473
|
-
- 💬 **Discussions**: [GitHub Discussions](https://github.com/loxia-ai/autopilot-cli-v10/discussions)
|
|
474
|
-
- 🐛 **Bug Reports**: [GitHub Issues](https://github.com/loxia-ai/autopilot-cli-v10/issues)
|
|
475
|
-
- 📧 **Email**: support@loxia.ai
|
|
364
|
+
- **Documentation**: Check the [docs](./docs/) directory
|
|
365
|
+
- **Bug Reports**: [GitHub Issues](https://github.com/loxia-ai/autopilot-cli-v10/issues)
|
|
366
|
+
- **Email**: support@loxia.ai
|
|
476
367
|
|
|
477
368
|
### Troubleshooting
|
|
478
369
|
|
|
@@ -505,44 +396,21 @@ npm install -g @loxia-labs/loxia-autopilot-one --force
|
|
|
505
396
|
|
|
506
397
|
**macOS Installation**
|
|
507
398
|
|
|
508
|
-
On macOS,
|
|
509
|
-
```bash
|
|
510
|
-
sudo npm install -g @loxia-labs/loxia-autopilot-one
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
Or better, configure npm to use a user-writable directory:
|
|
399
|
+
On macOS, configure npm to use a user-writable directory:
|
|
514
400
|
```bash
|
|
515
|
-
# Create a directory for global packages
|
|
516
401
|
mkdir ~/.npm-global
|
|
517
|
-
|
|
518
|
-
# Configure npm to use it
|
|
519
402
|
npm config set prefix '~/.npm-global'
|
|
520
|
-
|
|
521
|
-
# Add to your shell (zsh is default on macOS)
|
|
522
403
|
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
|
|
523
404
|
source ~/.zshrc
|
|
524
|
-
|
|
525
|
-
# Now install without sudo
|
|
526
405
|
npm install -g @loxia-labs/loxia-autopilot-one
|
|
527
406
|
```
|
|
528
407
|
|
|
529
|
-
**macOS Python Scanners**
|
|
530
|
-
|
|
531
|
-
If using Homebrew Python, security scanner installation will automatically detect it:
|
|
532
|
-
```bash
|
|
533
|
-
# Verify with
|
|
534
|
-
which python3
|
|
535
|
-
# Should show /opt/homebrew/bin/python3 (Apple Silicon) or /usr/local/bin/python3 (Intel)
|
|
536
|
-
```
|
|
537
|
-
|
|
538
408
|
---
|
|
539
409
|
|
|
540
410
|
<div align="center">
|
|
541
411
|
|
|
542
|
-
**Made with
|
|
543
|
-
|
|
544
|
-
[Website](https://loxia.ai) • [Twitter](https://twitter.com/loxia_ai) • [Discord](https://discord.gg/loxia)
|
|
412
|
+
**Made with care by the Loxia team**
|
|
545
413
|
|
|
546
|
-
|
|
414
|
+
[Website](https://loxia.ai) | [Twitter](https://twitter.com/loxia_ai)
|
|
547
415
|
|
|
548
416
|
</div>
|
package/bin/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const a0_0x35c427=a0_0x2379;(function(_0xff1a9e,_0x3dfeb2){const _0x434d81=a0_0x2379,_0x1f64fe=_0xff1a9e();while(!![]){try{const _0x5b696d=-parseInt(_0x434d81(0xb5))/0x1*(-parseInt(_0x434d81(0x7e))/0x2)+-parseInt(_0x434d81(0xb6))/0x3*(-parseInt(_0x434d81(0xc5))/0x4)+parseInt(_0x434d81(0xb2))/0x5*(-parseInt(_0x434d81(0xa7))/0x6)+-parseInt(_0x434d81(0x97))/0x7*(parseInt(_0x434d81(0x83))/0x8)+parseInt(_0x434d81(0xb4))/0x9*(parseInt(_0x434d81(0x9b))/0xa)+parseInt(_0x434d81(0xa9))/0xb+-parseInt(_0x434d81(0x95))/0xc;if(_0x5b696d===_0x3dfeb2)break;else _0x1f64fe['push'](_0x1f64fe['shift']());}catch(_0x253180){_0x1f64fe['push'](_0x1f64fe['shift']());}}}(a0_0x4df0,0xb7919));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x8519d1 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x35c427(0x84),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x35c427(0xb1)][a0_0x35c427(0xba)](0x2),command=args[0x0]&&!args[0x0][a0_0x35c427(0xa4)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x35c427(0xbc)]('--help')||args['includes']('-h'),'version':args['includes']('--version')||args[a0_0x35c427(0xbc)]('-v')};for(let i=0x0;i<args[a0_0x35c427(0xb9)];i++){args[i]==='--port'&&args[i+0x1]&&(flags[a0_0x35c427(0x7c)]=parseInt(args[i+0x1],0xa)),args[i]==='--host'&&args[i+0x1]&&(flags[a0_0x35c427(0x80)]=args[i+0x1]);}const explicitPort=flags[a0_0x35c427(0x7c)],host=flags[a0_0x35c427(0x80)]||DEFAULT_HOST;if(flags[a0_0x35c427(0x8f)]){const pkgPath=join(__dirname,'..',a0_0x35c427(0x7b)),pkg=JSON[a0_0x35c427(0xbf)](readFileSync(pkgPath,'utf8'));console['log'](a0_0x35c427(0x79)+pkg['version']),process[a0_0x35c427(0x99)](0x0);}if(flags[a0_0x35c427(0x8a)]||!command){const pkgPath=join(__dirname,'..',a0_0x35c427(0x7b)),pkg=JSON[a0_0x35c427(0xbf)](readFileSync(pkgPath,a0_0x35c427(0x82)));console[a0_0x35c427(0xa8)](a0_0x35c427(0x98)+pkg['version']+'\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+')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20'+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_0x35c427(0x99)](0x0);}async function getPortRegistry(){const _0x31aefb=a0_0x35c427,{getPortRegistry:_0x7a0c78}=await import(_0x31aefb(0x72));return _0x7a0c78();}async function discoverBackend(){const _0x1a6cc5=a0_0x35c427;try{const _0x204e52=await getPortRegistry();await _0x204e52['cleanupStaleEntries']();const _0x3c7b55=await _0x204e52[_0x1a6cc5(0x90)](_0x1a6cc5(0x81));if(_0x3c7b55)return{'host':_0x3c7b55['host']||_0x1a6cc5(0xb8),'port':_0x3c7b55[_0x1a6cc5(0x7c)],'pid':_0x3c7b55[_0x1a6cc5(0x9a)]};return null;}catch(_0xea7858){return null;}}async function checkServerRunning(_0x13f86e,_0xcc6be8,_0x3254fd=0x1){for(let _0x1743ec=0x0;_0x1743ec<_0x3254fd;_0x1743ec++){const _0x45129f=await new Promise(_0x183b87=>{const _0x327e42=a0_0x2379,_0x13030a=a0_0x8519d1[_0x327e42(0xab)](_0x327e42(0x96)+_0x13f86e+':'+_0xcc6be8+_0x327e42(0x75),_0x1f1278=>{_0x183b87(_0x1f1278['statusCode']===0xc8);});_0x13030a['on'](_0x327e42(0xb0),()=>_0x183b87(![])),_0x13030a[_0x327e42(0xaa)](0x7d0,()=>{const _0x242e2c=_0x327e42;_0x13030a[_0x242e2c(0x7a)](),_0x183b87(![]);});});if(_0x45129f)return!![];_0x1743ec<_0x3254fd-0x1&&await new Promise(_0x47e6c0=>setTimeout(_0x47e6c0,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0xb0067=SERVER_STARTUP_TIMEOUT){const _0x31c970=a0_0x35c427,_0x2b7490=Date[_0x31c970(0x8c)]();while(Date[_0x31c970(0x8c)]()-_0x2b7490<_0xb0067){const _0x4162da=await discoverBackend();if(_0x4162da){const _0x555c79=await checkServerRunning(_0x4162da[_0x31c970(0x80)],_0x4162da[_0x31c970(0x7c)]);if(_0x555c79)return _0x4162da;}await new Promise(_0x57b72b=>setTimeout(_0x57b72b,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x2d5aff,_0x3887af,_0x43ef9a=SERVER_STARTUP_TIMEOUT){const _0x36e80a=a0_0x35c427,_0x1ec869=Math[_0x36e80a(0x74)](_0x43ef9a/SERVER_CHECK_INTERVAL),_0x2e8dc8=await checkServerRunning(_0x2d5aff,_0x3887af,_0x1ec869);return _0x2e8dc8?{'host':_0x2d5aff,'port':_0x3887af}:null;}function a0_0x2379(_0x3bfea3,_0x13bc64){_0x3bfea3=_0x3bfea3-0x72;const _0x4df0aa=a0_0x4df0();let _0x23792d=_0x4df0aa[_0x3bfea3];return _0x23792d;}function a0_0x4df0(){const _0x2071fc=['Server\x20discovered\x20at\x20','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','Please\x20open\x20manually:\x20','error','argv','70805JeopgY','SIGTERM','2164257okUiAh','298409yKEJYi','15lyfGSG','Waiting\x20for\x20server\x20to\x20start...','localhost','length','slice','Could\x20not\x20open\x20browser\x20automatically.','includes','ignore','Starting\x20Loxia\x20server\x20in\x20background...','parse','SIGINT','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','Unknown\x20command:\x20','\x20\x20API\x20Health:\x20\x20\x20','loxia-terminal.js','1176236DInGGA','../src/services/portRegistry.js','platform','ceil','/api/health','LOXIA_PORT','PORT','Starting\x20Terminal\x20UI...\x0a','Loxia\x20Autopilot\x20One\x20v','destroy','package.json','port','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','6SoaCxo','src','host','backend','utf8','8VynPve','127.0.0.1','win32','\x20but\x20not\x20responding.','kill','LOXIA_HOST','\x0aShutting\x20down\x20server...','help','node','now','cmd','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','version','getService','\x0aPlease\x20start\x20the\x20server\x20first:','\x0a✓\x20Server\x20running\x20at\x20','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','open','17177676hYuBeV','http://','2315551ObFzFF','\x0aLoxia\x20Autopilot\x20One\x20v','exit','pid','20tRTsMX','unref','inherit','web','catch','\x0aOpening\x20Web\x20UI\x20at\x20','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','message','startsWith','start','toString','144EyfqnH','log','83149xFIDUZ','setTimeout','get','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'];a0_0x4df0=function(){return _0x2071fc;};return a0_0x4df0();}function openBrowser(_0x589205){const _0x377d35=a0_0x35c427;let _0x1bfc40,_0x53acde;if(process[_0x377d35(0x73)]==='darwin')_0x1bfc40=_0x377d35(0x94),_0x53acde=[_0x589205];else process[_0x377d35(0x73)]===_0x377d35(0x85)?(_0x1bfc40=_0x377d35(0x8d),_0x53acde=['/c',_0x377d35(0xa5),'\x22\x22',_0x589205]):(_0x1bfc40='xdg-open',_0x53acde=[_0x589205]);const _0x515381=spawn(_0x1bfc40,_0x53acde,{'detached':!![],'stdio':_0x377d35(0xbd)});_0x515381['unref'](),_0x515381['on'](_0x377d35(0xb0),()=>{const _0x28160b=_0x377d35;console[_0x28160b(0xa8)](_0x28160b(0xbb)),console[_0x28160b(0xa8)](_0x28160b(0xaf)+_0x589205);});}function startServer(_0xe4a269=![]){const _0x874e8e=a0_0x35c427,_0x2a2472={...process.env};explicitPort&&(_0x2a2472[_0x874e8e(0x76)]=explicitPort[_0x874e8e(0xa6)](),_0x2a2472[_0x874e8e(0x77)]=explicitPort[_0x874e8e(0xa6)]());flags[_0x874e8e(0x80)]&&(_0x2a2472[_0x874e8e(0x88)]=flags[_0x874e8e(0x80)]);const _0x589e7c=join(__dirname,'..',_0x874e8e(0x7f),'index.js'),_0x52bfad=spawn(_0x874e8e(0x8b),[_0x589e7c],{'cwd':join(__dirname,'..'),'env':_0x2a2472,'stdio':_0xe4a269?['ignore',_0x874e8e(0xbd),_0x874e8e(0xbd)]:_0x874e8e(0x9d),'detached':_0xe4a269});return _0xe4a269&&_0x52bfad[_0x874e8e(0x9c)](),_0x52bfad;}function startTerminalUIProcess(_0x41af68,_0x3142d5){const _0x313a17=a0_0x35c427,_0xad3c6a=join(__dirname,_0x313a17(0xc4)),_0x368f6f={...process.env,'LOXIA_PORT':_0x3142d5[_0x313a17(0xa6)](),'LOXIA_HOST':_0x41af68},_0x2cd247=spawn('node',[_0xad3c6a],{'cwd':join(__dirname,'..'),'env':_0x368f6f,'stdio':'inherit'});return _0x2cd247;}const commands={'web':async()=>{const _0x3f51a2=a0_0x35c427;console['log']('Starting\x20Loxia\x20server...\x0a');const _0x4c3d0c=startServer(![]);console[_0x3f51a2(0xa8)]('Waiting\x20for\x20server\x20to\x20start...');let _0x53c347;explicitPort?_0x53c347=await waitForServerAtPort(host,explicitPort):_0x53c347=await waitForServerWithDiscovery();if(_0x53c347){const _0xbc090=_0x3f51a2(0x96)+_0x53c347[_0x3f51a2(0x80)]+':'+_0x53c347['port'];console['log'](_0x3f51a2(0xa0)+_0xbc090),openBrowser(_0xbc090);}else console['log'](_0x3f51a2(0x93));process['on'](_0x3f51a2(0xc0),()=>_0x4c3d0c[_0x3f51a2(0x87)](_0x3f51a2(0xc0))),process['on'](_0x3f51a2(0xb3),()=>_0x4c3d0c['kill']('SIGTERM')),_0x4c3d0c['on'](_0x3f51a2(0x99),_0x5bd82a=>process['exit'](_0x5bd82a||0x0));},'plus-web':async()=>{const _0x5146e2=a0_0x35c427;await commands[_0x5146e2(0x9e)]();},'serve':async()=>{const _0x54c01b=a0_0x35c427;console[_0x54c01b(0xa8)]('Starting\x20Loxia\x20server...\x0a');const _0x33ac17=startServer(![]);console[_0x54c01b(0xa8)](_0x54c01b(0xb7));let _0x45b070;explicitPort?_0x45b070=await waitForServerAtPort(host,explicitPort):_0x45b070=await waitForServerWithDiscovery();if(_0x45b070){const _0x2f4d24='http://'+_0x45b070[_0x54c01b(0x80)]+':'+_0x45b070[_0x54c01b(0x7c)];console[_0x54c01b(0xa8)](_0x54c01b(0x92)+_0x2f4d24),console[_0x54c01b(0xa8)](_0x54c01b(0xac)+_0x2f4d24),console[_0x54c01b(0xa8)](_0x54c01b(0xa1)),console[_0x54c01b(0xa8)](_0x54c01b(0xc3)+_0x2f4d24+'/api/health\x0a');}else console[_0x54c01b(0xa8)](_0x54c01b(0x8e)),console[_0x54c01b(0xa8)](_0x54c01b(0xa2));process['on']('SIGINT',()=>_0x33ac17[_0x54c01b(0x87)](_0x54c01b(0xc0))),process['on'](_0x54c01b(0xb3),()=>_0x33ac17[_0x54c01b(0x87)](_0x54c01b(0xb3))),_0x33ac17['on']('exit',_0x404ef9=>process[_0x54c01b(0x99)](_0x404ef9||0x0));},'terminal':async()=>{const _0x47ff6d=a0_0x35c427;console[_0x47ff6d(0xa8)]('Looking\x20for\x20running\x20server...');let _0xdc3226=await discoverBackend();explicitPort&&(_0xdc3226={'host':host,'port':explicitPort});!_0xdc3226&&(console['error']('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console[_0x47ff6d(0xb0)](_0x47ff6d(0x91)),console[_0x47ff6d(0xb0)]('\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI'),console[_0x47ff6d(0xb0)](_0x47ff6d(0xae)),console['error'](_0x47ff6d(0xc1)),process[_0x47ff6d(0x99)](0x1));const _0x487ca3=await checkServerRunning(_0xdc3226[_0x47ff6d(0x80)],_0xdc3226[_0x47ff6d(0x7c)]);!_0x487ca3&&(console[_0x47ff6d(0xb0)]('\x0aServer\x20registered\x20at\x20'+_0xdc3226[_0x47ff6d(0x80)]+':'+_0xdc3226[_0x47ff6d(0x7c)]+_0x47ff6d(0x86)),console['error'](_0x47ff6d(0x7d)),process[_0x47ff6d(0x99)](0x1));console[_0x47ff6d(0xa8)](_0x47ff6d(0xad)+_0xdc3226[_0x47ff6d(0x80)]+':'+_0xdc3226['port']),console[_0x47ff6d(0xa8)](_0x47ff6d(0x78));const _0x4a54ca=startTerminalUIProcess(_0xdc3226[_0x47ff6d(0x80)],_0xdc3226[_0x47ff6d(0x7c)]);process['on'](_0x47ff6d(0xc0),()=>_0x4a54ca[_0x47ff6d(0x87)](_0x47ff6d(0xc0))),process['on'](_0x47ff6d(0xb3),()=>_0x4a54ca['kill'](_0x47ff6d(0xb3))),_0x4a54ca['on'](_0x47ff6d(0x99),_0x32185a=>process[_0x47ff6d(0x99)](_0x32185a||0x0));},'plus-terminal':async()=>{const _0xf5c767=a0_0x35c427;console['log'](_0xf5c767(0xbe));const _0x163a17=startServer(!![]);let _0x3e6397;explicitPort?_0x3e6397=await waitForServerAtPort(host,explicitPort):_0x3e6397=await waitForServerWithDiscovery();!_0x3e6397&&(console[_0xf5c767(0xb0)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process[_0xf5c767(0x99)](0x1));console[_0xf5c767(0xa8)]('Server\x20running\x20at\x20http://'+_0x3e6397[_0xf5c767(0x80)]+':'+_0x3e6397[_0xf5c767(0x7c)]),console[_0xf5c767(0xa8)](_0xf5c767(0x78));const _0x6ac328=startTerminalUIProcess(_0x3e6397[_0xf5c767(0x80)],_0x3e6397[_0xf5c767(0x7c)]);_0x6ac328['on'](_0xf5c767(0x99),_0x1e40b6=>{const _0x219df4=_0xf5c767;console[_0x219df4(0xa8)](_0x219df4(0x89));try{process['kill'](_0x163a17[_0x219df4(0x9a)],_0x219df4(0xb3));}catch(_0x4c1273){}process[_0x219df4(0x99)](_0x1e40b6||0x0);}),process['on'](_0xf5c767(0xc0),()=>{const _0x2a8dbf=_0xf5c767;_0x6ac328[_0x2a8dbf(0x87)](_0x2a8dbf(0xc0));}),process['on']('SIGTERM',()=>{const _0x2b1a16=_0xf5c767;_0x6ac328[_0x2b1a16(0x87)](_0x2b1a16(0xb3));});}};commands[command]?commands[command]()[a0_0x35c427(0x9f)](_0xa40938=>{const _0x28b76d=a0_0x35c427;console[_0x28b76d(0xb0)]('Error:',_0xa40938[_0x28b76d(0xa3)]),process['exit'](0x1);}):(console['error'](a0_0x35c427(0xc2)+command),console[a0_0x35c427(0xb0)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x35c427(0x99)](0x1));
|
|
3
|
+
const a0_0x55b6c9=a0_0x5411;(function(_0x2a9365,_0xdd6ac8){const _0x6a1dcb=a0_0x5411,_0x3ef263=_0x2a9365();while(!![]){try{const _0x2c4f46=-parseInt(_0x6a1dcb(0x78))/0x1+parseInt(_0x6a1dcb(0xb0))/0x2+-parseInt(_0x6a1dcb(0x70))/0x3+-parseInt(_0x6a1dcb(0xbb))/0x4*(-parseInt(_0x6a1dcb(0x6e))/0x5)+parseInt(_0x6a1dcb(0xc1))/0x6*(-parseInt(_0x6a1dcb(0x83))/0x7)+parseInt(_0x6a1dcb(0x9b))/0x8+-parseInt(_0x6a1dcb(0xc0))/0x9*(-parseInt(_0x6a1dcb(0xb4))/0xa);if(_0x2c4f46===_0xdd6ac8)break;else _0x3ef263['push'](_0x3ef263['shift']());}catch(_0x1b7d52){_0x3ef263['push'](_0x3ef263['shift']());}}}(a0_0x584a,0x4a177));function a0_0x5411(_0xad9da5,_0x3b09c2){_0xad9da5=_0xad9da5-0x6d;const _0x584a48=a0_0x584a();let _0x5411f8=_0x584a48[_0xad9da5];return _0x5411f8;}import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x79ae3 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x55b6c9(0x94),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x55b6c9(0x72)][a0_0x55b6c9(0x97)](0x2),command=args[0x0]&&!args[0x0][a0_0x55b6c9(0xa9)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args['includes'](a0_0x55b6c9(0xb1))||args[a0_0x55b6c9(0xa5)]('-h'),'version':args[a0_0x55b6c9(0xa5)]('--version')||args['includes']('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x55b6c9(0xbd)&&args[i+0x1]&&(flags[a0_0x55b6c9(0x82)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x55b6c9(0x8a)&&args[i+0x1]&&(flags[a0_0x55b6c9(0xc5)]=args[i+0x1]);}const explicitPort=flags[a0_0x55b6c9(0x82)],host=flags[a0_0x55b6c9(0xc5)]||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x55b6c9(0xc3)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x55b6c9(0xc6)));console[a0_0x55b6c9(0xa0)](a0_0x55b6c9(0x9f)+pkg['version']),process[a0_0x55b6c9(0xa2)](0x0);}if(flags[a0_0x55b6c9(0x6d)]||!command){const pkgPath=join(__dirname,'..',a0_0x55b6c9(0xc3)),pkg=JSON[a0_0x55b6c9(0x8c)](readFileSync(pkgPath,a0_0x55b6c9(0xc6)));console[a0_0x55b6c9(0xa0)](a0_0x55b6c9(0xa6)+pkg[a0_0x55b6c9(0xc7)]+a0_0x55b6c9(0xbf)+DEFAULT_PORT+a0_0x55b6c9(0xba)+DEFAULT_HOST+a0_0x55b6c9(0x7f)),process[a0_0x55b6c9(0xa2)](0x0);}async function getPortRegistry(){const {getPortRegistry:_0x179478}=await import('../src/services/portRegistry.js');return _0x179478();}async function discoverBackend(){const _0x3ad5d8=a0_0x55b6c9;try{const _0x439112=await getPortRegistry();await _0x439112[_0x3ad5d8(0x7b)]();const _0xa5bda8=await _0x439112[_0x3ad5d8(0x77)](_0x3ad5d8(0xa8));if(_0xa5bda8)return{'host':_0xa5bda8['host']||_0x3ad5d8(0x7c),'port':_0xa5bda8[_0x3ad5d8(0x82)],'pid':_0xa5bda8[_0x3ad5d8(0x7e)]};return null;}catch(_0x4978f9){return null;}}function a0_0x584a(){const _0x4b93ab=['PORT','slice','kill','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','unref','1045104KqxHsQ','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','\x0aPlease\x20start\x20the\x20server\x20first:','Loxia\x20Autopilot\x20One\x20v','log','index.js','exit','Waiting\x20for\x20server\x20to\x20start...','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','includes','\x0aLoxia\x20Autopilot\x20One\x20v','win32','backend','startsWith','\x20\x20API\x20Health:\x20\x20\x20','\x0aOpening\x20Web\x20UI\x20at\x20','Server\x20running\x20at\x20http://','ignore','/api/health\x0a','start','619560qpfFiz','--help','\x0aShutting\x20down\x20server...','SIGINT','581680tDCJIp','inherit','ceil','\x0aServer\x20registered\x20at\x20','SIGTERM','Starting\x20Loxia\x20server...\x0a',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','1268116rHAFeq','now','--port','darwin','\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','36vEsUsv','564024jfKJOR','\x0a✓\x20Server\x20running\x20at\x20','package.json','Could\x20not\x20open\x20browser\x20automatically.','host','utf8','version','help','5crkzmp','src','1369986PCVGQo','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','argv','web','get','error','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','getService','135974uPwoyK','node','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','cleanupStaleEntries','localhost','Please\x20open\x20manually:\x20','pid',')\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','setTimeout','Starting\x20Terminal\x20UI...\x0a','port','7ivurAE','toString','Unknown\x20command:\x20','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','catch','LOXIA_HOST','LOXIA_PORT','--host','statusCode','parse','\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','Looking\x20for\x20running\x20server...','Starting\x20Loxia\x20server\x20in\x20background...','open','platform','http://','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','127.0.0.1','cmd'];a0_0x584a=function(){return _0x4b93ab;};return a0_0x584a();}async function checkServerRunning(_0x3e3c8b,_0x12123b,_0x14f45b=0x1){for(let _0x24debd=0x0;_0x24debd<_0x14f45b;_0x24debd++){const _0x128419=await new Promise(_0xe8bedc=>{const _0x2cf8f8=a0_0x5411,_0x10f895=a0_0x79ae3[_0x2cf8f8(0x74)](_0x2cf8f8(0x92)+_0x3e3c8b+':'+_0x12123b+'/api/health',_0x2ec930=>{const _0x2cbac2=_0x2cf8f8;_0xe8bedc(_0x2ec930[_0x2cbac2(0x8b)]===0xc8);});_0x10f895['on'](_0x2cf8f8(0x75),()=>_0xe8bedc(![])),_0x10f895[_0x2cf8f8(0x80)](0x7d0,()=>{_0x10f895['destroy'](),_0xe8bedc(![]);});});if(_0x128419)return!![];_0x24debd<_0x14f45b-0x1&&await new Promise(_0x16cef8=>setTimeout(_0x16cef8,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x2fe2fd=SERVER_STARTUP_TIMEOUT){const _0x4b6eba=a0_0x55b6c9,_0x15410d=Date[_0x4b6eba(0xbc)]();while(Date[_0x4b6eba(0xbc)]()-_0x15410d<_0x2fe2fd){const _0x2b016d=await discoverBackend();if(_0x2b016d){const _0xfa731b=await checkServerRunning(_0x2b016d['host'],_0x2b016d[_0x4b6eba(0x82)]);if(_0xfa731b)return _0x2b016d;}await new Promise(_0x251782=>setTimeout(_0x251782,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x4c2343,_0x57e8f1,_0x5f1fbc=SERVER_STARTUP_TIMEOUT){const _0x2ee7ff=a0_0x55b6c9,_0x56b383=Math[_0x2ee7ff(0xb6)](_0x5f1fbc/SERVER_CHECK_INTERVAL),_0x4ab25f=await checkServerRunning(_0x4c2343,_0x57e8f1,_0x56b383);return _0x4ab25f?{'host':_0x4c2343,'port':_0x57e8f1}:null;}function openBrowser(_0x223849){const _0x27a7fb=a0_0x55b6c9;let _0x34af75,_0x391c4e;if(process[_0x27a7fb(0x91)]===_0x27a7fb(0xbe))_0x34af75=_0x27a7fb(0x90),_0x391c4e=[_0x223849];else process[_0x27a7fb(0x91)]===_0x27a7fb(0xa7)?(_0x34af75=_0x27a7fb(0x95),_0x391c4e=['/c',_0x27a7fb(0xaf),'\x22\x22',_0x223849]):(_0x34af75='xdg-open',_0x391c4e=[_0x223849]);const _0x95d74d=spawn(_0x34af75,_0x391c4e,{'detached':!![],'stdio':_0x27a7fb(0xad)});_0x95d74d[_0x27a7fb(0x9a)](),_0x95d74d['on'](_0x27a7fb(0x75),()=>{const _0x13e2ef=_0x27a7fb;console[_0x13e2ef(0xa0)](_0x13e2ef(0xc4)),console[_0x13e2ef(0xa0)](_0x13e2ef(0x7d)+_0x223849);});}function startServer(_0x28fad2=![]){const _0xf22ae6=a0_0x55b6c9,_0x44e254={...process.env};explicitPort&&(_0x44e254[_0xf22ae6(0x89)]=explicitPort[_0xf22ae6(0x84)](),_0x44e254[_0xf22ae6(0x96)]=explicitPort[_0xf22ae6(0x84)]());flags[_0xf22ae6(0xc5)]&&(_0x44e254[_0xf22ae6(0x88)]=flags[_0xf22ae6(0xc5)]);const _0x265ad6=join(__dirname,'..',_0xf22ae6(0x6f),_0xf22ae6(0xa1)),_0x56fafa=spawn(_0xf22ae6(0x79),[_0x265ad6],{'cwd':join(__dirname,'..'),'env':_0x44e254,'stdio':_0x28fad2?[_0xf22ae6(0xad),_0xf22ae6(0xad),_0xf22ae6(0xad)]:'inherit','detached':_0x28fad2});return _0x28fad2&&_0x56fafa[_0xf22ae6(0x9a)](),_0x56fafa;}function startTerminalUIProcess(_0x346682,_0x3448e1){const _0x1c6a35=a0_0x55b6c9,_0xf01db=join(__dirname,'loxia-terminal.js'),_0x354a6e={...process.env,'LOXIA_PORT':_0x3448e1[_0x1c6a35(0x84)](),'LOXIA_HOST':_0x346682},_0x3b7085=spawn(_0x1c6a35(0x79),[_0xf01db],{'cwd':join(__dirname,'..'),'env':_0x354a6e,'stdio':_0x1c6a35(0xb5)});return _0x3b7085;}const commands={'web':async()=>{const _0x5cfa3b=a0_0x55b6c9;console[_0x5cfa3b(0xa0)]('Starting\x20Loxia\x20server...\x0a');const _0x489527=startServer(![]);console[_0x5cfa3b(0xa0)](_0x5cfa3b(0xa3));let _0xf668dc;explicitPort?_0xf668dc=await waitForServerAtPort(host,explicitPort):_0xf668dc=await waitForServerWithDiscovery();if(_0xf668dc){const _0x2179ab=_0x5cfa3b(0x92)+_0xf668dc[_0x5cfa3b(0xc5)]+':'+_0xf668dc['port'];console['log'](_0x5cfa3b(0xab)+_0x2179ab),openBrowser(_0x2179ab);}else console['log'](_0x5cfa3b(0x76));process['on'](_0x5cfa3b(0xb3),()=>_0x489527[_0x5cfa3b(0x98)](_0x5cfa3b(0xb3))),process['on'](_0x5cfa3b(0xb8),()=>_0x489527['kill']('SIGTERM')),_0x489527['on']('exit',_0x20f8eb=>process['exit'](_0x20f8eb||0x0));},'plus-web':async()=>{const _0x38c781=a0_0x55b6c9;await commands[_0x38c781(0x73)]();},'serve':async()=>{const _0x6f6341=a0_0x55b6c9;console[_0x6f6341(0xa0)](_0x6f6341(0xb9));const _0x4ba47a=startServer(![]);console['log'](_0x6f6341(0xa3));let _0x5d439e;explicitPort?_0x5d439e=await waitForServerAtPort(host,explicitPort):_0x5d439e=await waitForServerWithDiscovery();if(_0x5d439e){const _0x37241a=_0x6f6341(0x92)+_0x5d439e[_0x6f6341(0xc5)]+':'+_0x5d439e['port'];console[_0x6f6341(0xa0)](_0x6f6341(0xc2)+_0x37241a),console['log'](_0x6f6341(0x93)+_0x37241a),console[_0x6f6341(0xa0)](_0x6f6341(0x71)),console[_0x6f6341(0xa0)](_0x6f6341(0xaa)+_0x37241a+_0x6f6341(0xae));}else console['log'](_0x6f6341(0x9c)),console['log'](_0x6f6341(0x9d));process['on'](_0x6f6341(0xb3),()=>_0x4ba47a[_0x6f6341(0x98)](_0x6f6341(0xb3))),process['on'](_0x6f6341(0xb8),()=>_0x4ba47a[_0x6f6341(0x98)](_0x6f6341(0xb8))),_0x4ba47a['on'](_0x6f6341(0xa2),_0x2f7abe=>process[_0x6f6341(0xa2)](_0x2f7abe||0x0));},'terminal':async()=>{const _0x420081=a0_0x55b6c9;console[_0x420081(0xa0)](_0x420081(0x8e));let _0x9d75b9=await discoverBackend();explicitPort&&(_0x9d75b9={'host':host,'port':explicitPort});!_0x9d75b9&&(console[_0x420081(0x75)]('\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.'),console[_0x420081(0x75)](_0x420081(0x9e)),console['error'](_0x420081(0x7a)),console[_0x420081(0x75)](_0x420081(0x8d)),console[_0x420081(0x75)](_0x420081(0x86)),process[_0x420081(0xa2)](0x1));const _0x2602fe=await checkServerRunning(_0x9d75b9[_0x420081(0xc5)],_0x9d75b9[_0x420081(0x82)]);!_0x2602fe&&(console[_0x420081(0x75)](_0x420081(0xb7)+_0x9d75b9['host']+':'+_0x9d75b9[_0x420081(0x82)]+'\x20but\x20not\x20responding.'),console[_0x420081(0x75)](_0x420081(0x99)),process[_0x420081(0xa2)](0x1));console[_0x420081(0xa0)]('Server\x20discovered\x20at\x20'+_0x9d75b9[_0x420081(0xc5)]+':'+_0x9d75b9[_0x420081(0x82)]),console[_0x420081(0xa0)](_0x420081(0x81));const _0x347374=startTerminalUIProcess(_0x9d75b9[_0x420081(0xc5)],_0x9d75b9[_0x420081(0x82)]);process['on'](_0x420081(0xb3),()=>_0x347374[_0x420081(0x98)]('SIGINT')),process['on'](_0x420081(0xb8),()=>_0x347374[_0x420081(0x98)](_0x420081(0xb8))),_0x347374['on'](_0x420081(0xa2),_0x4b9879=>process['exit'](_0x4b9879||0x0));},'plus-terminal':async()=>{const _0x304cc5=a0_0x55b6c9;console[_0x304cc5(0xa0)](_0x304cc5(0x8f));const _0x489177=startServer(!![]);let _0x55942e;explicitPort?_0x55942e=await waitForServerAtPort(host,explicitPort):_0x55942e=await waitForServerWithDiscovery();!_0x55942e&&(console[_0x304cc5(0x75)]('\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.'),process['exit'](0x1));console['log'](_0x304cc5(0xac)+_0x55942e[_0x304cc5(0xc5)]+':'+_0x55942e[_0x304cc5(0x82)]),console[_0x304cc5(0xa0)](_0x304cc5(0x81));const _0x4ace15=startTerminalUIProcess(_0x55942e[_0x304cc5(0xc5)],_0x55942e[_0x304cc5(0x82)]);_0x4ace15['on']('exit',_0x4fa176=>{const _0x2ff6d5=_0x304cc5;console['log'](_0x2ff6d5(0xb2));try{process[_0x2ff6d5(0x98)](_0x489177[_0x2ff6d5(0x7e)],'SIGTERM');}catch(_0x33deeb){}process[_0x2ff6d5(0xa2)](_0x4fa176||0x0);}),process['on'](_0x304cc5(0xb3),()=>{const _0x542e94=_0x304cc5;_0x4ace15['kill'](_0x542e94(0xb3));}),process['on'](_0x304cc5(0xb8),()=>{const _0x49508f=_0x304cc5;_0x4ace15[_0x49508f(0x98)](_0x49508f(0xb8));});}};commands[command]?commands[command]()[a0_0x55b6c9(0x87)](_0x456520=>{const _0x4076a6=a0_0x55b6c9;console['error']('Error:',_0x456520['message']),process[_0x4076a6(0xa2)](0x1);}):(console[a0_0x55b6c9(0x75)](a0_0x55b6c9(0x85)+command),console[a0_0x55b6c9(0x75)](a0_0x55b6c9(0xa4)),process['exit'](0x1));
|