@loxia-labs/loxia-autopilot-one 1.9.2 → 2.0.2
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 +6 -5
- 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/fileContentReplaceTool.js +1 -1
- package/src/tools/fileSystemTool.js +1 -1
- package/src/tools/fileTreeTool.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/web-ui/build/index.html +2 -2
- package/web-ui/build/static/{index-gjdnhEg2.js → index-9lwuGbV1.js} +119 -119
- 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
|
|
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 (
|
|
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_0x23c4a1=a0_0x11b5;(function(_0x5c98f4,_0x4019bc){const _0x478f34=a0_0x11b5,_0x5091a7=_0x5c98f4();while(!![]){try{const _0x563123=parseInt(_0x478f34(0x1df))/0x1*(-parseInt(_0x478f34(0x1d4))/0x2)+parseInt(_0x478f34(0x1ff))/0x3+parseInt(_0x478f34(0x1b9))/0x4+parseInt(_0x478f34(0x1cb))/0x5*(parseInt(_0x478f34(0x1c9))/0x6)+parseInt(_0x478f34(0x1e6))/0x7*(-parseInt(_0x478f34(0x1d9))/0x8)+parseInt(_0x478f34(0x1d3))/0x9*(-parseInt(_0x478f34(0x1ca))/0xa)+parseInt(_0x478f34(0x1ec))/0xb;if(_0x563123===_0x4019bc)break;else _0x5091a7['push'](_0x5091a7['shift']());}catch(_0x2aefd4){_0x5091a7['push'](_0x5091a7['shift']());}}}(a0_0x42a7,0xcfa10));function a0_0x11b5(_0x1f5b88,_0x38bf50){_0x1f5b88=_0x1f5b88-0x1b8;const _0x42a7c4=a0_0x42a7();let _0x11b559=_0x42a7c4[_0x1f5b88];return _0x11b559;}import{fileURLToPath}from'url';function a0_0x42a7(){const _0x33c5d4=['\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only','parse','\x0aServer\x20registered\x20at\x20','message','4767ENdqyX','Could\x20not\x20open\x20browser\x20automatically.','now','pid','ignore','Waiting\x20for\x20server\x20to\x20start...','34386715CvSZLy','LOXIA_PORT','host','utf8',')\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','log','\x20but\x20not\x20responding.','version','help','win32','\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','\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal','cmd','Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.','destroy','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','startsWith','inherit','src','1440558JRNuDe','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','--help','setTimeout','package.json','platform','darwin','toString','Please\x20open\x20manually:\x20','web','Error:','\x20\x20API\x20Health:\x20\x20\x20','slice','Starting\x20Loxia\x20server\x20in\x20background...','Starting\x20Loxia\x20server...\x0a','getService','--version','5616220uDFfKI','includes','get','\x0a✓\x20Server\x20running\x20at\x20',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','ceil','exit','http://','SIGTERM','kill','backend','LOXIA_HOST','open','Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.','../src/services/portRegistry.js','\x0aPlease\x20start\x20the\x20server\x20first:','2364yUvfoc','1404860tulNiS','290GOypFt','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','unref','xdg-open','localhost','Server\x20discovered\x20at\x20','SIGINT','Loxia\x20Autopilot\x20One\x20v','99ZJAYTo','2cHhJHM','node','argv','/api/health\x0a','/api/health','19168MLrHhs','\x0aOpening\x20Web\x20UI\x20at\x20','error','--host','port','loxia-terminal.js','1005688ACEEUr','index.js','PORT'];a0_0x42a7=function(){return _0x33c5d4;};return a0_0x42a7();}import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x54ead5 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_0x23c4a1(0x1d6)][a0_0x23c4a1(0x20c)](0x2),command=args[0x0]&&!args[0x0][a0_0x23c4a1(0x1fc)]('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x23c4a1(0x1ba)](a0_0x23c4a1(0x202))||args[a0_0x23c4a1(0x1ba)]('-h'),'version':args['includes'](a0_0x23c4a1(0x1b8))||args['includes']('-v')};for(let i=0x0;i<args['length'];i++){args[i]==='--port'&&args[i+0x1]&&(flags['port']=parseInt(args[i+0x1],0xa)),args[i]===a0_0x23c4a1(0x1dc)&&args[i+0x1]&&(flags[a0_0x23c4a1(0x1ee)]=args[i+0x1]);}const explicitPort=flags[a0_0x23c4a1(0x1dd)],host=flags[a0_0x23c4a1(0x1ee)]||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x23c4a1(0x1e3)](readFileSync(pkgPath,a0_0x23c4a1(0x1ef)));console[a0_0x23c4a1(0x1f1)](a0_0x23c4a1(0x1d2)+pkg[a0_0x23c4a1(0x1f3)]),process['exit'](0x0);}if(flags[a0_0x23c4a1(0x1f4)]||!command){const pkgPath=join(__dirname,'..',a0_0x23c4a1(0x204)),pkg=JSON[a0_0x23c4a1(0x1e3)](readFileSync(pkgPath,a0_0x23c4a1(0x1ef)));console['log']('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg['version']+a0_0x23c4a1(0x1f6)+DEFAULT_PORT+a0_0x23c4a1(0x1bd)+DEFAULT_HOST+a0_0x23c4a1(0x1f0)),process['exit'](0x0);}async function getPortRegistry(){const _0x132bb6=a0_0x23c4a1,{getPortRegistry:_0x2bd7e6}=await import(_0x132bb6(0x1c7));return _0x2bd7e6();}async function discoverBackend(){const _0x3ebcfa=a0_0x23c4a1;try{const _0x4f40e0=await getPortRegistry();await _0x4f40e0['cleanupStaleEntries']();const _0x53ad5d=await _0x4f40e0[_0x3ebcfa(0x20f)](_0x3ebcfa(0x1c3));if(_0x53ad5d)return{'host':_0x53ad5d[_0x3ebcfa(0x1ee)]||_0x3ebcfa(0x1cf),'port':_0x53ad5d[_0x3ebcfa(0x1dd)],'pid':_0x53ad5d[_0x3ebcfa(0x1e9)]};return null;}catch(_0x29472d){return null;}}async function checkServerRunning(_0x2e9f79,_0x261089,_0x2b197e=0x1){for(let _0x3aed68=0x0;_0x3aed68<_0x2b197e;_0x3aed68++){const _0x378920=await new Promise(_0x2c0bea=>{const _0x2026ab=a0_0x11b5,_0x18e9ed=a0_0x54ead5[_0x2026ab(0x1bb)](_0x2026ab(0x1c0)+_0x2e9f79+':'+_0x261089+_0x2026ab(0x1d8),_0x202f9a=>{_0x2c0bea(_0x202f9a['statusCode']===0xc8);});_0x18e9ed['on'](_0x2026ab(0x1db),()=>_0x2c0bea(![])),_0x18e9ed[_0x2026ab(0x203)](0x7d0,()=>{const _0x3d262b=_0x2026ab;_0x18e9ed[_0x3d262b(0x1fa)](),_0x2c0bea(![]);});});if(_0x378920)return!![];_0x3aed68<_0x2b197e-0x1&&await new Promise(_0x8fb1be=>setTimeout(_0x8fb1be,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x296682=SERVER_STARTUP_TIMEOUT){const _0x443ac3=a0_0x23c4a1,_0x324f61=Date[_0x443ac3(0x1e8)]();while(Date[_0x443ac3(0x1e8)]()-_0x324f61<_0x296682){const _0x5aee42=await discoverBackend();if(_0x5aee42){const _0x46016e=await checkServerRunning(_0x5aee42[_0x443ac3(0x1ee)],_0x5aee42[_0x443ac3(0x1dd)]);if(_0x46016e)return _0x5aee42;}await new Promise(_0x40e1e4=>setTimeout(_0x40e1e4,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x5362a6,_0x212e10,_0x34f628=SERVER_STARTUP_TIMEOUT){const _0x587030=a0_0x23c4a1,_0x4c50c1=Math[_0x587030(0x1be)](_0x34f628/SERVER_CHECK_INTERVAL),_0x1ecefc=await checkServerRunning(_0x5362a6,_0x212e10,_0x4c50c1);return _0x1ecefc?{'host':_0x5362a6,'port':_0x212e10}:null;}function openBrowser(_0x3b6c43){const _0x19dc14=a0_0x23c4a1;let _0x3f5081,_0x34f161;if(process[_0x19dc14(0x205)]===_0x19dc14(0x206))_0x3f5081=_0x19dc14(0x1c5),_0x34f161=[_0x3b6c43];else process['platform']===_0x19dc14(0x1f5)?(_0x3f5081=_0x19dc14(0x1f8),_0x34f161=['/c','start','\x22\x22',_0x3b6c43]):(_0x3f5081=_0x19dc14(0x1ce),_0x34f161=[_0x3b6c43]);const _0xd042bb=spawn(_0x3f5081,_0x34f161,{'detached':!![],'stdio':_0x19dc14(0x1ea)});_0xd042bb[_0x19dc14(0x1cd)](),_0xd042bb['on'](_0x19dc14(0x1db),()=>{const _0x159511=_0x19dc14;console[_0x159511(0x1f1)](_0x159511(0x1e7)),console[_0x159511(0x1f1)](_0x159511(0x208)+_0x3b6c43);});}function startServer(_0x2c405d=![]){const _0x15b896=a0_0x23c4a1,_0xf8bef6={...process.env};explicitPort&&(_0xf8bef6[_0x15b896(0x1ed)]=explicitPort[_0x15b896(0x207)](),_0xf8bef6[_0x15b896(0x1e1)]=explicitPort[_0x15b896(0x207)]());flags[_0x15b896(0x1ee)]&&(_0xf8bef6[_0x15b896(0x1c4)]=flags[_0x15b896(0x1ee)]);const _0x9aa3d8=join(__dirname,'..',_0x15b896(0x1fe),_0x15b896(0x1e0)),_0x45f3e5=spawn(_0x15b896(0x1d5),[_0x9aa3d8],{'cwd':join(__dirname,'..'),'env':_0xf8bef6,'stdio':_0x2c405d?[_0x15b896(0x1ea),_0x15b896(0x1ea),_0x15b896(0x1ea)]:'inherit','detached':_0x2c405d});return _0x2c405d&&_0x45f3e5['unref'](),_0x45f3e5;}function startTerminalUIProcess(_0x810c5f,_0x19751f){const _0x160b9e=a0_0x23c4a1,_0x42df37=join(__dirname,_0x160b9e(0x1de)),_0xef34c0={...process.env,'LOXIA_PORT':_0x19751f[_0x160b9e(0x207)](),'LOXIA_HOST':_0x810c5f},_0x327ae1=spawn(_0x160b9e(0x1d5),[_0x42df37],{'cwd':join(__dirname,'..'),'env':_0xef34c0,'stdio':_0x160b9e(0x1fd)});return _0x327ae1;}const commands={'web':async()=>{const _0x953786=a0_0x23c4a1;console[_0x953786(0x1f1)]('Starting\x20Loxia\x20server...\x0a');const _0x44a8e6=startServer(![]);console[_0x953786(0x1f1)](_0x953786(0x1eb));let _0x214f90;explicitPort?_0x214f90=await waitForServerAtPort(host,explicitPort):_0x214f90=await waitForServerWithDiscovery();if(_0x214f90){const _0x4c945f=_0x953786(0x1c0)+_0x214f90[_0x953786(0x1ee)]+':'+_0x214f90[_0x953786(0x1dd)];console[_0x953786(0x1f1)](_0x953786(0x1da)+_0x4c945f),openBrowser(_0x4c945f);}else console[_0x953786(0x1f1)]('\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.');process['on']('SIGINT',()=>_0x44a8e6[_0x953786(0x1c2)](_0x953786(0x1d1))),process['on'](_0x953786(0x1c1),()=>_0x44a8e6['kill'](_0x953786(0x1c1))),_0x44a8e6['on'](_0x953786(0x1bf),_0xeb35f7=>process[_0x953786(0x1bf)](_0xeb35f7||0x0));},'plus-web':async()=>{const _0x54b1c0=a0_0x23c4a1;await commands[_0x54b1c0(0x209)]();},'serve':async()=>{const _0x516ad8=a0_0x23c4a1;console[_0x516ad8(0x1f1)](_0x516ad8(0x20e));const _0xfe1a42=startServer(![]);console[_0x516ad8(0x1f1)](_0x516ad8(0x1eb));let _0x4dca31;explicitPort?_0x4dca31=await waitForServerAtPort(host,explicitPort):_0x4dca31=await waitForServerWithDiscovery();if(_0x4dca31){const _0x108521=_0x516ad8(0x1c0)+_0x4dca31[_0x516ad8(0x1ee)]+':'+_0x4dca31['port'];console[_0x516ad8(0x1f1)](_0x516ad8(0x1bc)+_0x108521),console[_0x516ad8(0x1f1)]('\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20'+_0x108521),console[_0x516ad8(0x1f1)](_0x516ad8(0x1f7)),console['log'](_0x516ad8(0x20b)+_0x108521+_0x516ad8(0x1d7));}else console[_0x516ad8(0x1f1)]('\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.'),console['log'](_0x516ad8(0x1f9));process['on']('SIGINT',()=>_0xfe1a42[_0x516ad8(0x1c2)](_0x516ad8(0x1d1))),process['on']('SIGTERM',()=>_0xfe1a42['kill']('SIGTERM')),_0xfe1a42['on']('exit',_0x3e6c5c=>process[_0x516ad8(0x1bf)](_0x3e6c5c||0x0));},'terminal':async()=>{const _0x5a400a=a0_0x23c4a1;console[_0x5a400a(0x1f1)]('Looking\x20for\x20running\x20server...');let _0x3a4e5a=await discoverBackend();explicitPort&&(_0x3a4e5a={'host':host,'port':explicitPort});!_0x3a4e5a&&(console[_0x5a400a(0x1db)](_0x5a400a(0x1cc)),console[_0x5a400a(0x1db)](_0x5a400a(0x1c8)),console['error']('\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI'),console[_0x5a400a(0x1db)](_0x5a400a(0x1e2)),console[_0x5a400a(0x1db)](_0x5a400a(0x200)),process[_0x5a400a(0x1bf)](0x1));const _0x201bd3=await checkServerRunning(_0x3a4e5a[_0x5a400a(0x1ee)],_0x3a4e5a[_0x5a400a(0x1dd)]);!_0x201bd3&&(console['error'](_0x5a400a(0x1e4)+_0x3a4e5a['host']+':'+_0x3a4e5a[_0x5a400a(0x1dd)]+_0x5a400a(0x1f2)),console['error'](_0x5a400a(0x1fb)),process[_0x5a400a(0x1bf)](0x1));console['log'](_0x5a400a(0x1d0)+_0x3a4e5a[_0x5a400a(0x1ee)]+':'+_0x3a4e5a[_0x5a400a(0x1dd)]),console[_0x5a400a(0x1f1)]('Starting\x20Terminal\x20UI...\x0a');const _0x501afe=startTerminalUIProcess(_0x3a4e5a[_0x5a400a(0x1ee)],_0x3a4e5a[_0x5a400a(0x1dd)]);process['on']('SIGINT',()=>_0x501afe['kill'](_0x5a400a(0x1d1))),process['on'](_0x5a400a(0x1c1),()=>_0x501afe['kill'](_0x5a400a(0x1c1))),_0x501afe['on'](_0x5a400a(0x1bf),_0x2039fe=>process[_0x5a400a(0x1bf)](_0x2039fe||0x0));},'plus-terminal':async()=>{const _0x125ceb=a0_0x23c4a1;console[_0x125ceb(0x1f1)](_0x125ceb(0x20d));const _0x4a3b00=startServer(!![]);let _0xaaf08f;explicitPort?_0xaaf08f=await waitForServerAtPort(host,explicitPort):_0xaaf08f=await waitForServerWithDiscovery();!_0xaaf08f&&(console[_0x125ceb(0x1db)](_0x125ceb(0x201)),process[_0x125ceb(0x1bf)](0x1));console['log']('Server\x20running\x20at\x20http://'+_0xaaf08f[_0x125ceb(0x1ee)]+':'+_0xaaf08f[_0x125ceb(0x1dd)]),console['log']('Starting\x20Terminal\x20UI...\x0a');const _0x4bb328=startTerminalUIProcess(_0xaaf08f['host'],_0xaaf08f[_0x125ceb(0x1dd)]);_0x4bb328['on']('exit',_0x41d2f1=>{const _0xed73b0=_0x125ceb;console[_0xed73b0(0x1f1)]('\x0aShutting\x20down\x20server...');try{process[_0xed73b0(0x1c2)](_0x4a3b00['pid'],'SIGTERM');}catch(_0x394161){}process[_0xed73b0(0x1bf)](_0x41d2f1||0x0);}),process['on'](_0x125ceb(0x1d1),()=>{const _0x259d04=_0x125ceb;_0x4bb328[_0x259d04(0x1c2)](_0x259d04(0x1d1));}),process['on'](_0x125ceb(0x1c1),()=>{const _0x1c634e=_0x125ceb;_0x4bb328[_0x1c634e(0x1c2)](_0x1c634e(0x1c1));});}};commands[command]?commands[command]()['catch'](_0x1967fe=>{const _0x5c6c44=a0_0x23c4a1;console[_0x5c6c44(0x1db)](_0x5c6c44(0x20a),_0x1967fe[_0x5c6c44(0x1e5)]),process[_0x5c6c44(0x1bf)](0x1);}):(console[a0_0x23c4a1(0x1db)]('Unknown\x20command:\x20'+command),console[a0_0x23c4a1(0x1db)](a0_0x23c4a1(0x1c6)),process[a0_0x23c4a1(0x1bf)](0x1));
|
|
3
|
+
function a0_0x11bf(){const _0x44ce9c=['LOXIA_PORT','unref','ignore','utf8','help','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','\x0aServer\x20registered\x20at\x20','getService','cmd','\x0aOpening\x20Web\x20UI\x20at\x20','--port','darwin','statusCode','cleanupStaleEntries','2FiUDOZ','argv','includes','Error:','--host','\x0aNo\x20running\x20server\x20found\x20in\x20the\x20port\x20registry.','/api/health','\x0aServer\x20may\x20still\x20be\x20starting.\x20Check\x20the\x20port\x20registry\x20or\x20logs.','Unknown\x20command:\x20','host','503256aHVxqH','http://','catch','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','../src/services/portRegistry.js','3545050QBMpgu','open','loxia-terminal.js','PORT','parse','2801412SwoVlU','/api/health\x0a','platform','SIGTERM','SIGINT','package.json','Looking\x20for\x20running\x20server...','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','kill','exit','node','\x0aLoxia\x20Autopilot\x20One\x20v','1848161wTtXQO','Starting\x20Terminal\x20UI...\x0a',')\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','inherit','Server\x20discovered\x20at\x20','setTimeout','\x0aServer\x20started\x20but\x20may\x20still\x20be\x20initializing.','message',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','\x0aPlease\x20start\x20the\x20server\x20first:','8780778vWasLE','toString','localhost','backend','It\x20may\x20have\x20crashed.\x20Please\x20restart\x20it.','pid','Starting\x20Loxia\x20server\x20in\x20background...','\x0a\x20\x20Web\x20UI:\x20\x20\x20\x20\x20\x20\x20','LOXIA_HOST','Starting\x20Loxia\x20server...\x0a','web','index.js','log','24291776GpUxux','error','xdg-open','\x0a✓\x20Server\x20running\x20at\x20','version','port','3480432JWctzZ','Could\x20not\x20open\x20browser\x20automatically.'];a0_0x11bf=function(){return _0x44ce9c;};return a0_0x11bf();}const a0_0x2bfa4c=a0_0x4168;(function(_0x449e6a,_0x194cee){const _0x4c8db8=a0_0x4168,_0x2135a0=_0x449e6a();while(!![]){try{const _0xb895a8=parseInt(_0x4c8db8(0x214))/0x1*(-parseInt(_0x4c8db8(0x20a))/0x2)+parseInt(_0x4c8db8(0x1fa))/0x3+parseInt(_0x4c8db8(0x1d1))/0x4+parseInt(_0x4c8db8(0x219))/0x5+parseInt(_0x4c8db8(0x1e7))/0x6+parseInt(_0x4c8db8(0x1dd))/0x7+-parseInt(_0x4c8db8(0x1f4))/0x8;if(_0xb895a8===_0x194cee)break;else _0x2135a0['push'](_0x2135a0['shift']());}catch(_0x1712a7){_0x2135a0['push'](_0x2135a0['shift']());}}}(a0_0x11bf,0xb8e11));import{fileURLToPath}from'url';import{dirname,join}from'path';import{spawn}from'child_process';import{readFileSync}from'fs';import a0_0x2ad8e4 from'http';function a0_0x4168(_0x2a5d02,_0x476321){_0x2a5d02=_0x2a5d02-0x1cf;const _0x11bf46=a0_0x11bf();let _0x416807=_0x11bf46[_0x2a5d02];return _0x416807;}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_0x2bfa4c(0x20b)]['slice'](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x2bfa4c(0x20c)]('--help')||args[a0_0x2bfa4c(0x20c)]('-h'),'version':args[a0_0x2bfa4c(0x20c)]('--version')||args[a0_0x2bfa4c(0x20c)]('-v')};for(let i=0x0;i<args['length'];i++){args[i]===a0_0x2bfa4c(0x206)&&args[i+0x1]&&(flags[a0_0x2bfa4c(0x1f9)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x2bfa4c(0x20e)&&args[i+0x1]&&(flags['host']=args[i+0x1]);}const explicitPort=flags['port'],host=flags['host']||DEFAULT_HOST;if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x2bfa4c(0x1d6)),pkg=JSON[a0_0x2bfa4c(0x1d0)](readFileSync(pkgPath,a0_0x2bfa4c(0x1ff)));console['log']('Loxia\x20Autopilot\x20One\x20v'+pkg[a0_0x2bfa4c(0x1f8)]),process[a0_0x2bfa4c(0x1da)](0x0);}if(flags[a0_0x2bfa4c(0x200)]||!command){const pkgPath=join(__dirname,'..','package.json'),pkg=JSON[a0_0x2bfa4c(0x1d0)](readFileSync(pkgPath,a0_0x2bfa4c(0x1ff)));console['log'](a0_0x2bfa4c(0x1dc)+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+a0_0x2bfa4c(0x1e5)+DEFAULT_HOST+a0_0x2bfa4c(0x1df)),process[a0_0x2bfa4c(0x1da)](0x0);}async function getPortRegistry(){const _0x1ee3bf=a0_0x2bfa4c,{getPortRegistry:_0x350bbc}=await import(_0x1ee3bf(0x218));return _0x350bbc();}async function discoverBackend(){const _0x3951e9=a0_0x2bfa4c;try{const _0x15f972=await getPortRegistry();await _0x15f972[_0x3951e9(0x209)]();const _0xdbb2da=await _0x15f972[_0x3951e9(0x203)](_0x3951e9(0x1ea));if(_0xdbb2da)return{'host':_0xdbb2da['host']||_0x3951e9(0x1e9),'port':_0xdbb2da[_0x3951e9(0x1f9)],'pid':_0xdbb2da['pid']};return null;}catch(_0x366f04){return null;}}async function checkServerRunning(_0x3aa3f0,_0x12b2b0,_0x5497b8=0x1){for(let _0x3d3490=0x0;_0x3d3490<_0x5497b8;_0x3d3490++){const _0x597a57=await new Promise(_0x19f8ff=>{const _0x1e31fe=a0_0x4168,_0x430be9=a0_0x2ad8e4['get'](_0x1e31fe(0x215)+_0x3aa3f0+':'+_0x12b2b0+_0x1e31fe(0x210),_0x31b188=>{const _0xa90ddc=_0x1e31fe;_0x19f8ff(_0x31b188[_0xa90ddc(0x208)]===0xc8);});_0x430be9['on'](_0x1e31fe(0x1f5),()=>_0x19f8ff(![])),_0x430be9[_0x1e31fe(0x1e2)](0x7d0,()=>{_0x430be9['destroy'](),_0x19f8ff(![]);});});if(_0x597a57)return!![];_0x3d3490<_0x5497b8-0x1&&await new Promise(_0x5e9113=>setTimeout(_0x5e9113,SERVER_CHECK_INTERVAL));}return![];}async function waitForServerWithDiscovery(_0x370c78=SERVER_STARTUP_TIMEOUT){const _0x38778b=a0_0x2bfa4c,_0x27c905=Date['now']();while(Date['now']()-_0x27c905<_0x370c78){const _0x116ced=await discoverBackend();if(_0x116ced){const _0x472629=await checkServerRunning(_0x116ced[_0x38778b(0x213)],_0x116ced[_0x38778b(0x1f9)]);if(_0x472629)return _0x116ced;}await new Promise(_0x147277=>setTimeout(_0x147277,SERVER_CHECK_INTERVAL));}return null;}async function waitForServerAtPort(_0x181169,_0x2b6c8c,_0x4a38c0=SERVER_STARTUP_TIMEOUT){const _0x25f81a=Math['ceil'](_0x4a38c0/SERVER_CHECK_INTERVAL),_0x282605=await checkServerRunning(_0x181169,_0x2b6c8c,_0x25f81a);return _0x282605?{'host':_0x181169,'port':_0x2b6c8c}:null;}function openBrowser(_0x305397){const _0x15251b=a0_0x2bfa4c;let _0x8e08f2,_0x59d94e;if(process['platform']===_0x15251b(0x207))_0x8e08f2=_0x15251b(0x21a),_0x59d94e=[_0x305397];else process[_0x15251b(0x1d3)]==='win32'?(_0x8e08f2=_0x15251b(0x204),_0x59d94e=['/c','start','\x22\x22',_0x305397]):(_0x8e08f2=_0x15251b(0x1f6),_0x59d94e=[_0x305397]);const _0x379b10=spawn(_0x8e08f2,_0x59d94e,{'detached':!![],'stdio':'ignore'});_0x379b10['unref'](),_0x379b10['on']('error',()=>{const _0x56e0f9=_0x15251b;console['log'](_0x56e0f9(0x1fb)),console[_0x56e0f9(0x1f3)]('Please\x20open\x20manually:\x20'+_0x305397);});}function startServer(_0x4b71f8=![]){const _0x1b3715=a0_0x2bfa4c,_0x2c28b9={...process.env};explicitPort&&(_0x2c28b9[_0x1b3715(0x1fc)]=explicitPort['toString'](),_0x2c28b9[_0x1b3715(0x1cf)]=explicitPort[_0x1b3715(0x1e8)]());flags[_0x1b3715(0x213)]&&(_0x2c28b9[_0x1b3715(0x1ef)]=flags['host']);const _0x4dc578=join(__dirname,'..','src',_0x1b3715(0x1f2)),_0x58e1ac=spawn(_0x1b3715(0x1db),[_0x4dc578],{'cwd':join(__dirname,'..'),'env':_0x2c28b9,'stdio':_0x4b71f8?['ignore',_0x1b3715(0x1fe),_0x1b3715(0x1fe)]:_0x1b3715(0x1e0),'detached':_0x4b71f8});return _0x4b71f8&&_0x58e1ac[_0x1b3715(0x1fd)](),_0x58e1ac;}function startTerminalUIProcess(_0x3b204,_0x1c7bc6){const _0x3601d9=a0_0x2bfa4c,_0x2d0d27=join(__dirname,_0x3601d9(0x21b)),_0x3135f5={...process.env,'LOXIA_PORT':_0x1c7bc6['toString'](),'LOXIA_HOST':_0x3b204},_0x4540d0=spawn(_0x3601d9(0x1db),[_0x2d0d27],{'cwd':join(__dirname,'..'),'env':_0x3135f5,'stdio':_0x3601d9(0x1e0)});return _0x4540d0;}const commands={'web':async()=>{const _0x320ecf=a0_0x2bfa4c;console[_0x320ecf(0x1f3)](_0x320ecf(0x1f0));const _0x1793d1=startServer(![]);console[_0x320ecf(0x1f3)]('Waiting\x20for\x20server\x20to\x20start...');let _0x299391;explicitPort?_0x299391=await waitForServerAtPort(host,explicitPort):_0x299391=await waitForServerWithDiscovery();if(_0x299391){const _0x57ef80=_0x320ecf(0x215)+_0x299391[_0x320ecf(0x213)]+':'+_0x299391[_0x320ecf(0x1f9)];console[_0x320ecf(0x1f3)](_0x320ecf(0x205)+_0x57ef80),openBrowser(_0x57ef80);}else console[_0x320ecf(0x1f3)](_0x320ecf(0x211));process['on']('SIGINT',()=>_0x1793d1[_0x320ecf(0x1d9)](_0x320ecf(0x1d5))),process['on']('SIGTERM',()=>_0x1793d1['kill']('SIGTERM')),_0x1793d1['on'](_0x320ecf(0x1da),_0x12d33c=>process[_0x320ecf(0x1da)](_0x12d33c||0x0));},'plus-web':async()=>{const _0x455f0c=a0_0x2bfa4c;await commands[_0x455f0c(0x1f1)]();},'serve':async()=>{const _0x418c2a=a0_0x2bfa4c;console[_0x418c2a(0x1f3)](_0x418c2a(0x1f0));const _0x4cf04a=startServer(![]);console['log']('Waiting\x20for\x20server\x20to\x20start...');let _0x1bd023;explicitPort?_0x1bd023=await waitForServerAtPort(host,explicitPort):_0x1bd023=await waitForServerWithDiscovery();if(_0x1bd023){const _0x35621b=_0x418c2a(0x215)+_0x1bd023['host']+':'+_0x1bd023[_0x418c2a(0x1f9)];console[_0x418c2a(0x1f3)](_0x418c2a(0x1f7)+_0x35621b),console[_0x418c2a(0x1f3)](_0x418c2a(0x1ee)+_0x35621b),console[_0x418c2a(0x1f3)]('\x20\x20Terminal\x20UI:\x20\x20loxia\x20terminal'),console[_0x418c2a(0x1f3)]('\x20\x20API\x20Health:\x20\x20\x20'+_0x35621b+_0x418c2a(0x1d2));}else console['log'](_0x418c2a(0x1e3)),console[_0x418c2a(0x1f3)]('Run\x20\x27loxia\x20terminal\x27\x20to\x20connect\x20when\x20ready.');process['on'](_0x418c2a(0x1d5),()=>_0x4cf04a['kill'](_0x418c2a(0x1d5))),process['on']('SIGTERM',()=>_0x4cf04a[_0x418c2a(0x1d9)](_0x418c2a(0x1d4))),_0x4cf04a['on'](_0x418c2a(0x1da),_0x4af034=>process[_0x418c2a(0x1da)](_0x4af034||0x0));},'terminal':async()=>{const _0x5bf714=a0_0x2bfa4c;console[_0x5bf714(0x1f3)](_0x5bf714(0x1d7));let _0x47e7b6=await discoverBackend();explicitPort&&(_0x47e7b6={'host':host,'port':explicitPort});!_0x47e7b6&&(console[_0x5bf714(0x1f5)](_0x5bf714(0x20f)),console['error'](_0x5bf714(0x1e6)),console[_0x5bf714(0x1f5)](_0x5bf714(0x201)),console[_0x5bf714(0x1f5)]('\x20\x20loxia\x20serve\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20only'),console['error'](_0x5bf714(0x217)),process['exit'](0x1));const _0x25e350=await checkServerRunning(_0x47e7b6['host'],_0x47e7b6[_0x5bf714(0x1f9)]);!_0x25e350&&(console[_0x5bf714(0x1f5)](_0x5bf714(0x202)+_0x47e7b6['host']+':'+_0x47e7b6[_0x5bf714(0x1f9)]+'\x20but\x20not\x20responding.'),console[_0x5bf714(0x1f5)](_0x5bf714(0x1eb)),process['exit'](0x1));console['log'](_0x5bf714(0x1e1)+_0x47e7b6[_0x5bf714(0x213)]+':'+_0x47e7b6['port']),console[_0x5bf714(0x1f3)](_0x5bf714(0x1de));const _0x906e83=startTerminalUIProcess(_0x47e7b6[_0x5bf714(0x213)],_0x47e7b6['port']);process['on']('SIGINT',()=>_0x906e83[_0x5bf714(0x1d9)](_0x5bf714(0x1d5))),process['on'](_0x5bf714(0x1d4),()=>_0x906e83['kill']('SIGTERM')),_0x906e83['on'](_0x5bf714(0x1da),_0x52b960=>process['exit'](_0x52b960||0x0));},'plus-terminal':async()=>{const _0x2f3438=a0_0x2bfa4c;console[_0x2f3438(0x1f3)](_0x2f3438(0x1ed));const _0x5664ab=startServer(!![]);let _0x5d537d;explicitPort?_0x5d537d=await waitForServerAtPort(host,explicitPort):_0x5d537d=await waitForServerWithDiscovery();!_0x5d537d&&(console[_0x2f3438(0x1f5)](_0x2f3438(0x1d8)),process[_0x2f3438(0x1da)](0x1));console[_0x2f3438(0x1f3)]('Server\x20running\x20at\x20http://'+_0x5d537d['host']+':'+_0x5d537d['port']),console[_0x2f3438(0x1f3)]('Starting\x20Terminal\x20UI...\x0a');const _0x46056c=startTerminalUIProcess(_0x5d537d[_0x2f3438(0x213)],_0x5d537d[_0x2f3438(0x1f9)]);_0x46056c['on'](_0x2f3438(0x1da),_0x26541d=>{const _0x525f79=_0x2f3438;console['log']('\x0aShutting\x20down\x20server...');try{process[_0x525f79(0x1d9)](_0x5664ab[_0x525f79(0x1ec)],_0x525f79(0x1d4));}catch(_0x8e7ce0){}process['exit'](_0x26541d||0x0);}),process['on']('SIGINT',()=>{const _0x4b4b3b=_0x2f3438;_0x46056c[_0x4b4b3b(0x1d9)]('SIGINT');}),process['on'](_0x2f3438(0x1d4),()=>{const _0x4486d7=_0x2f3438;_0x46056c[_0x4486d7(0x1d9)](_0x4486d7(0x1d4));});}};commands[command]?commands[command]()[a0_0x2bfa4c(0x216)](_0x33f5a4=>{const _0x310a81=a0_0x2bfa4c;console[_0x310a81(0x1f5)](_0x310a81(0x20d),_0x33f5a4[_0x310a81(0x1e4)]),process[_0x310a81(0x1da)](0x1);}):(console[a0_0x2bfa4c(0x1f5)](a0_0x2bfa4c(0x212)+command),console['error']('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x2bfa4c(0x1da)](0x1));
|