@loxia-labs/loxia-autopilot-one 1.0.1 → 1.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 +44 -54
- package/bin/cli.js +1 -115
- package/bin/loxia-terminal-v2.js +3 -0
- package/bin/loxia-terminal.js +3 -0
- package/bin/start-with-terminal.js +3 -0
- package/package.json +14 -15
- package/scripts/install-scanners.js +1 -235
- package/src/analyzers/CSSAnalyzer.js +1 -297
- package/src/analyzers/ConfigValidator.js +1 -690
- package/src/analyzers/ESLintAnalyzer.js +1 -320
- package/src/analyzers/JavaScriptAnalyzer.js +1 -261
- package/src/analyzers/PrettierFormatter.js +1 -247
- package/src/analyzers/PythonAnalyzer.js +1 -266
- package/src/analyzers/SecurityAnalyzer.js +1 -729
- package/src/analyzers/TypeScriptAnalyzer.js +1 -247
- package/src/analyzers/codeCloneDetector/analyzer.js +1 -344
- package/src/analyzers/codeCloneDetector/detector.js +1 -203
- package/src/analyzers/codeCloneDetector/index.js +1 -160
- package/src/analyzers/codeCloneDetector/parser.js +1 -199
- package/src/analyzers/codeCloneDetector/reporter.js +1 -148
- package/src/analyzers/codeCloneDetector/scanner.js +1 -59
- package/src/core/agentPool.js +1 -1474
- package/src/core/agentScheduler.js +1 -2147
- package/src/core/contextManager.js +1 -709
- package/src/core/messageProcessor.js +1 -732
- package/src/core/orchestrator.js +1 -548
- package/src/core/stateManager.js +1 -877
- package/src/index.js +1 -631
- package/src/interfaces/cli.js +1 -549
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -0
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -0
- package/src/interfaces/terminal/api/apiClient.js +1 -0
- package/src/interfaces/terminal/api/messageRouter.js +1 -0
- package/src/interfaces/terminal/api/session.js +1 -0
- package/src/interfaces/terminal/api/websocket.js +1 -0
- package/src/interfaces/terminal/components/AgentCreator.js +1 -0
- package/src/interfaces/terminal/components/AgentEditor.js +1 -0
- package/src/interfaces/terminal/components/AgentSwitcher.js +1 -0
- package/src/interfaces/terminal/components/ErrorBoundary.js +1 -0
- package/src/interfaces/terminal/components/ErrorPanel.js +1 -0
- package/src/interfaces/terminal/components/Header.js +1 -0
- package/src/interfaces/terminal/components/HelpPanel.js +1 -0
- package/src/interfaces/terminal/components/InputBox.js +1 -0
- package/src/interfaces/terminal/components/Layout.js +1 -0
- package/src/interfaces/terminal/components/LoadingSpinner.js +1 -0
- package/src/interfaces/terminal/components/MessageList.js +1 -0
- package/src/interfaces/terminal/components/MultilineTextInput.js +1 -0
- package/src/interfaces/terminal/components/SearchPanel.js +1 -0
- package/src/interfaces/terminal/components/SettingsPanel.js +1 -0
- package/src/interfaces/terminal/components/StatusBar.js +1 -0
- package/src/interfaces/terminal/components/TextInput.js +1 -0
- package/src/interfaces/terminal/config/agentEditorConstants.js +1 -0
- package/src/interfaces/terminal/config/constants.js +1 -0
- package/src/interfaces/terminal/index.js +1 -0
- package/src/interfaces/terminal/state/useAgentControl.js +1 -0
- package/src/interfaces/terminal/state/useAgents.js +1 -0
- package/src/interfaces/terminal/state/useConnection.js +1 -0
- package/src/interfaces/terminal/state/useMessages.js +1 -0
- package/src/interfaces/terminal/state/useTools.js +1 -0
- package/src/interfaces/terminal/utils/debugLogger.js +1 -0
- package/src/interfaces/terminal/utils/settingsStorage.js +1 -0
- package/src/interfaces/terminal/utils/theme.js +1 -0
- package/src/interfaces/webServer.js +1 -2162
- package/src/modules/fileExplorer/controller.js +1 -280
- package/src/modules/fileExplorer/index.js +1 -37
- package/src/modules/fileExplorer/middleware.js +1 -92
- package/src/modules/fileExplorer/routes.js +1 -125
- package/src/modules/fileExplorer/types.js +1 -44
- package/src/services/aiService.js +1 -1232
- package/src/services/apiKeyManager.js +1 -164
- package/src/services/benchmarkService.js +1 -366
- package/src/services/budgetService.js +1 -539
- package/src/services/contextInjectionService.js +1 -247
- package/src/services/conversationCompactionService.js +1 -637
- package/src/services/errorHandler.js +1 -810
- package/src/services/fileAttachmentService.js +1 -544
- package/src/services/modelRouterService.js +1 -366
- package/src/services/modelsService.js +1 -322
- package/src/services/qualityInspector.js +1 -796
- package/src/services/tokenCountingService.js +1 -536
- package/src/tools/agentCommunicationTool.js +1 -1344
- package/src/tools/agentDelayTool.js +1 -485
- package/src/tools/asyncToolManager.js +1 -604
- package/src/tools/baseTool.js +1 -800
- package/src/tools/browserTool.js +1 -920
- package/src/tools/cloneDetectionTool.js +1 -621
- package/src/tools/dependencyResolverTool.js +1 -1215
- package/src/tools/fileContentReplaceTool.js +1 -875
- package/src/tools/fileSystemTool.js +1 -1107
- package/src/tools/fileTreeTool.js +1 -853
- package/src/tools/imageTool.js +1 -901
- package/src/tools/importAnalyzerTool.js +1 -1060
- package/src/tools/jobDoneTool.js +1 -248
- package/src/tools/seekTool.js +1 -956
- package/src/tools/staticAnalysisTool.js +1 -1778
- package/src/tools/taskManagerTool.js +1 -2873
- package/src/tools/terminalTool.js +1 -2304
- package/src/tools/webTool.js +1 -1430
- package/src/types/agent.js +1 -519
- package/src/types/contextReference.js +1 -972
- package/src/types/conversation.js +1 -730
- package/src/types/toolCommand.js +1 -747
- package/src/utilities/attachmentValidator.js +1 -292
- package/src/utilities/configManager.js +1 -582
- package/src/utilities/constants.js +1 -722
- package/src/utilities/directoryAccessManager.js +1 -535
- package/src/utilities/fileProcessor.js +1 -307
- package/src/utilities/logger.js +1 -436
- package/src/utilities/tagParser.js +1 -1246
- package/src/utilities/toolConstants.js +1 -317
- package/web-ui/build/index.html +2 -2
- package/web-ui/build/static/{index-Dy2bYbOa.css → index-CClD1090.css} +1 -1
- package/web-ui/build/static/{index-CjkkcnFA.js → index-lCBai6dX.js} +66 -67
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
**Autonomous AI Agent System for Software Development**
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/loxia-autopilot-one)
|
|
8
|
-
[](https://nodejs.org)
|
|
7
|
+
[](https://www.npmjs.com/package/@loxia-labs/loxia-autopilot-one)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
[](CONTRIBUTING.md)
|
|
11
11
|
|
|
@@ -85,55 +85,60 @@ Loxia Autopilot One is a **production-ready autonomous AI agent system** that em
|
|
|
85
85
|
|
|
86
86
|
## 🚀 Quick Start
|
|
87
87
|
|
|
88
|
-
###
|
|
88
|
+
### 1. Create an Account
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
- Active subscription or valid license
|
|
92
|
-
- Authentication credentials from [loxia.ai](https://loxia.ai)
|
|
90
|
+
Register at **[autopilot.loxia.ai](https://autopilot.loxia.ai)** to get started.
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### Installation
|
|
92
|
+
### 2. Install the Package
|
|
97
93
|
|
|
98
94
|
```bash
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
npm install -g @loxia-labs/loxia-autopilot-one
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 3. Verify Installation
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
loxia
|
|
100
|
+
```bash
|
|
101
|
+
loxia --version
|
|
102
|
+
# Should display: Loxia Autopilot One v1.0.3
|
|
104
103
|
```
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
### 4. Create an API Key
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
1. Sign in at [autopilot.loxia.ai](https://autopilot.loxia.ai)
|
|
108
|
+
2. Navigate to [API Keys](https://autopilot.loxia.ai/api-keys)
|
|
109
|
+
3. Create a new API key and copy it
|
|
109
110
|
|
|
110
|
-
###
|
|
111
|
+
### 5. Launch & Configure
|
|
111
112
|
|
|
113
|
+
#### Option A: Web UI
|
|
112
114
|
```bash
|
|
113
|
-
loxia
|
|
114
|
-
loxia --no-web # CLI only
|
|
115
|
-
loxia --web-only # Web UI server only
|
|
116
|
-
loxia --port 3000 # Custom port
|
|
117
|
-
loxia --host 0.0.0.0 # Custom host binding
|
|
118
|
-
loxia --help # Show all options
|
|
115
|
+
loxia web
|
|
119
116
|
```
|
|
117
|
+
This starts the server and opens the Web UI in your browser. Go to **Settings** and paste your API key.
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
#### Option B: Terminal UI
|
|
120
|
+
```bash
|
|
121
|
+
loxia plus-terminal
|
|
122
|
+
```
|
|
123
|
+
This starts the server + Terminal UI. Press `Ctrl+,` to open Settings, paste your API key. Press `Alt+H` for help.
|
|
122
124
|
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
loxia> /create DevAssistant
|
|
126
|
-
```
|
|
125
|
+
### 6. Start Using Loxia
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
```
|
|
127
|
+
1. **Create an agent** using the interface
|
|
128
|
+
2. **Send a message** to start interacting
|
|
129
|
+
3. **Enjoy** autonomous AI assistance!
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
### CLI Reference
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
loxia web # Start server + open Web UI in browser
|
|
135
|
+
loxia terminal # Start Terminal UI (server must be running)
|
|
136
|
+
loxia plus-terminal # Start server + Terminal UI together
|
|
137
|
+
loxia plus-web # Alias for 'web'
|
|
138
|
+
loxia --port 3000 # Use custom port (works with any command)
|
|
139
|
+
loxia --version # Show version
|
|
140
|
+
loxia --help # Show all options
|
|
141
|
+
```
|
|
137
142
|
|
|
138
143
|
---
|
|
139
144
|
|
|
@@ -363,7 +368,7 @@ Loxia automatically compacts long conversations to stay within token limits:
|
|
|
363
368
|
|
|
364
369
|
## 🛣️ Roadmap
|
|
365
370
|
|
|
366
|
-
### Current Version (1.0.
|
|
371
|
+
### Current Version (1.0.3)
|
|
367
372
|
|
|
368
373
|
- ✅ Multi-agent orchestration
|
|
369
374
|
- ✅ 18+ specialized tools
|
|
@@ -432,8 +437,8 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
|
|
|
432
437
|
|
|
433
438
|
### Subscription & Access
|
|
434
439
|
|
|
435
|
-
- **Registration**: Sign up at [loxia.ai
|
|
436
|
-
- **Authentication**: Software requires valid
|
|
440
|
+
- **Registration**: Sign up at [autopilot.loxia.ai](https://autopilot.loxia.ai)
|
|
441
|
+
- **Authentication**: Software requires valid API key to operate
|
|
437
442
|
- **Verification**: Periodic authentication checks with licensing server
|
|
438
443
|
- **Expiration**: Access ends when subscription expires (renewable)
|
|
439
444
|
|
|
@@ -478,26 +483,11 @@ LOXIA_LOG_LEVEL=debug loxia
|
|
|
478
483
|
npm cache clean --force
|
|
479
484
|
|
|
480
485
|
# Reinstall
|
|
481
|
-
npm install -g loxia-autopilot-one --force
|
|
486
|
+
npm install -g @loxia-labs/loxia-autopilot-one --force
|
|
482
487
|
```
|
|
483
488
|
|
|
484
489
|
---
|
|
485
490
|
|
|
486
|
-
## 🌟 Acknowledgments
|
|
487
|
-
|
|
488
|
-
Built with love using:
|
|
489
|
-
|
|
490
|
-
- [Node.js](https://nodejs.org/) - Runtime environment
|
|
491
|
-
- [Express](https://expressjs.com/) - Web server framework
|
|
492
|
-
- [React](https://reactjs.org/) - UI framework
|
|
493
|
-
- [Puppeteer](https://pptr.dev/) - Browser automation
|
|
494
|
-
- [TailwindCSS](https://tailwindcss.com/) - Styling
|
|
495
|
-
- [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) - Real-time communication
|
|
496
|
-
|
|
497
|
-
Special thanks to the open-source community for the amazing tools and libraries that make this project possible.
|
|
498
|
-
|
|
499
|
-
---
|
|
500
|
-
|
|
501
491
|
<div align="center">
|
|
502
492
|
|
|
503
493
|
**Made with ❤️ by the Loxia team**
|
package/bin/cli.js
CHANGED
|
@@ -1,117 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Loxia Autopilot One - CLI Entry Point
|
|
5
|
-
*
|
|
6
|
-
* This is the executable entry point for the `loxia` command.
|
|
7
|
-
* It parses CLI arguments and launches the system with appropriate configuration.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
import { dirname, join } from 'path';
|
|
12
|
-
import { spawn } from 'child_process';
|
|
13
|
-
import { readFileSync } from 'fs';
|
|
14
|
-
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const __dirname = dirname(__filename);
|
|
17
|
-
|
|
18
|
-
// Parse CLI arguments
|
|
19
|
-
const args = process.argv.slice(2);
|
|
20
|
-
const flags = {
|
|
21
|
-
noWeb: args.includes('--no-web'),
|
|
22
|
-
webOnly: args.includes('--web-only'),
|
|
23
|
-
port: null,
|
|
24
|
-
host: null,
|
|
25
|
-
help: args.includes('--help') || args.includes('-h'),
|
|
26
|
-
version: args.includes('--version') || args.includes('-v')
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Extract port and host if provided
|
|
30
|
-
for (let i = 0; i < args.length; i++) {
|
|
31
|
-
if (args[i] === '--port' && args[i + 1]) {
|
|
32
|
-
flags.port = parseInt(args[i + 1], 10);
|
|
33
|
-
}
|
|
34
|
-
if (args[i] === '--host' && args[i + 1]) {
|
|
35
|
-
flags.host = args[i + 1];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Show version
|
|
40
|
-
if (flags.version) {
|
|
41
|
-
const pkgPath = join(__dirname, '..', 'package.json');
|
|
42
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
43
|
-
console.log(`Loxia Autopilot One v${pkg.version}`);
|
|
44
|
-
process.exit(0);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Show help
|
|
48
|
-
if (flags.help) {
|
|
49
|
-
console.log(`
|
|
50
|
-
Loxia Autopilot One - AI Agent System
|
|
51
|
-
|
|
52
|
-
Usage:
|
|
53
|
-
loxia [options]
|
|
54
|
-
|
|
55
|
-
Options:
|
|
56
|
-
--no-web Start CLI only (disable Web UI)
|
|
57
|
-
--web-only Start Web UI server only (no interactive CLI)
|
|
58
|
-
--port <number> Specify port for Web UI (default: 8080)
|
|
59
|
-
--host <host> Specify host for Web UI (default: 0.0.0.0)
|
|
60
|
-
-h, --help Show this help message
|
|
61
|
-
-v, --version Show version number
|
|
62
|
-
|
|
63
|
-
Examples:
|
|
64
|
-
loxia # Start with CLI and Web UI
|
|
65
|
-
loxia --no-web # Start CLI only
|
|
66
|
-
loxia --web-only # Start Web UI server only
|
|
67
|
-
loxia --port 3000 # Use custom port
|
|
68
|
-
loxia --host localhost # Use custom host
|
|
69
|
-
|
|
70
|
-
Documentation:
|
|
71
|
-
https://github.com/loxia-ai/autopilot-one
|
|
72
|
-
|
|
73
|
-
`);
|
|
74
|
-
process.exit(0);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Set environment variables based on flags
|
|
78
|
-
const env = { ...process.env };
|
|
79
|
-
|
|
80
|
-
if (flags.noWeb) {
|
|
81
|
-
env.LOXIA_DISABLE_WEB = 'true';
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (flags.webOnly) {
|
|
85
|
-
env.LOXIA_WEB_ONLY = 'true';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (flags.port) {
|
|
89
|
-
env.LOXIA_PORT = flags.port.toString();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (flags.host) {
|
|
93
|
-
env.LOXIA_HOST = flags.host;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Launch the main application
|
|
97
|
-
const mainScript = join(__dirname, '..', 'src', 'index.js');
|
|
98
|
-
|
|
99
|
-
const child = spawn('node', [mainScript], {
|
|
100
|
-
stdio: 'inherit',
|
|
101
|
-
env,
|
|
102
|
-
cwd: join(__dirname, '..')
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Forward signals
|
|
106
|
-
process.on('SIGINT', () => {
|
|
107
|
-
child.kill('SIGINT');
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
process.on('SIGTERM', () => {
|
|
111
|
-
child.kill('SIGTERM');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// Exit with same code as child process
|
|
115
|
-
child.on('exit', (code) => {
|
|
116
|
-
process.exit(code || 0);
|
|
117
|
-
});
|
|
3
|
+
const a0_0x492338=a0_0x49db;(function(_0x167f21,_0x308583){const _0x3d2206=a0_0x49db,_0x4ef4c8=_0x167f21();while(!![]){try{const _0x2b2a81=-parseInt(_0x3d2206(0xb9))/0x1*(-parseInt(_0x3d2206(0xa5))/0x2)+parseInt(_0x3d2206(0xc9))/0x3*(-parseInt(_0x3d2206(0xba))/0x4)+-parseInt(_0x3d2206(0xb2))/0x5*(-parseInt(_0x3d2206(0x95))/0x6)+-parseInt(_0x3d2206(0xa8))/0x7*(parseInt(_0x3d2206(0xbf))/0x8)+parseInt(_0x3d2206(0xa2))/0x9+-parseInt(_0x3d2206(0xc4))/0xa+parseInt(_0x3d2206(0xad))/0xb;if(_0x2b2a81===_0x308583)break;else _0x4ef4c8['push'](_0x4ef4c8['shift']());}catch(_0x334588){_0x4ef4c8['push'](_0x4ef4c8['shift']());}}}(a0_0xcebc,0x85ca9));import{fileURLToPath}from'url';import{dirname,join}from'path';function a0_0xcebc(){const _0x565fcf=['argv','7815230JjafYS','Loxia\x20Autopilot\x20One\x20v','--host','unref','message','461331nIFRVl','length','--help','Server\x20running\x20at\x20','Starting\x20Terminal\x20UI...\x0a','setTimeout',')\x0a\x20\x20--host\x20<host>\x20\x20\x20\x20\x20Specify\x20host\x20(default:\x20','utf8','\x0aServer\x20may\x20still\x20be\x20starting.\x20Open\x20','http://','port','ceil','darwin','toString','\x0aServer\x20is\x20not\x20running\x20at\x20','destroy','--port','\x0aPlease\x20start\x20the\x20server\x20first:','--version','parse','ignore','1554684yCNCVz','src','start\x20\x22\x22\x20\x22','Waiting\x20for\x20server\x20to\x20start...','platform','get','Error:','env','host','win32','SIGTERM','exit','open\x20\x22','947394bNYQrc','\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Web\x20UI','version','27554HLSbZv','Checking\x20if\x20server\x20is\x20running...','package.json','70PPsOzD','xdg-open\x20\x22','LOXIA_HOST','Starting\x20Loxia\x20server\x20in\x20background...','web','14525731CniZFl','localhost','inherit','includes','SIGINT','5EcOEdY','kill','\x20\x20loxia\x20plus-terminal\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a','log','\x0aOpening\x20Web\x20UI\x20at\x20','error','Starting\x20Loxia\x20server...\x0a','34VODEBi','4bCeQKV','index.js','Server\x20is\x20running\x20at\x20','\x0aShutting\x20down\x20server...','\x0aServer\x20failed\x20to\x20start.\x20Please\x20check\x20logs.','536008iHaCeG','catch','\x20-\x20AI\x20Agent\x20System\x0a\x0aUsage:\x0a\x20\x20loxia\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Start\x20server\x20+\x20open\x20Web\x20UI\x20in\x20browser\x0a\x20\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20Start\x20Terminal\x20UI\x20(server\x20must\x20be\x20running)\x0a\x20\x20plus-web\x20\x20\x20\x20\x20\x20\x20\x20Alias\x20for\x20\x27web\x27\x0a\x20\x20plus-terminal\x20\x20\x20Start\x20server\x20+\x20Terminal\x20UI\x20together\x0a\x0aOptions:\x0a\x20\x20--port\x20<number>\x20\x20\x20Specify\x20port\x20(default:\x20','statusCode'];a0_0xcebc=function(){return _0x565fcf;};return a0_0xcebc();}import{spawn,exec}from'child_process';import{readFileSync}from'fs';import a0_0x3656e4 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),DEFAULT_PORT=0x1f90,DEFAULT_HOST=a0_0x492338(0xae),SERVER_STARTUP_TIMEOUT=0x3a98,SERVER_CHECK_INTERVAL=0x1f4,args=process[a0_0x492338(0xc3)]['slice'](0x2),command=args[0x0]&&!args[0x0]['startsWith']('--')?args[0x0]:null,flags={'port':null,'host':null,'help':args[a0_0x492338(0xb0)](a0_0x492338(0xcb))||args['includes']('-h'),'version':args[a0_0x492338(0xb0)](a0_0x492338(0xdb))||args[a0_0x492338(0xb0)]('-v')};for(let i=0x0;i<args[a0_0x492338(0xca)];i++){args[i]===a0_0x492338(0xd9)&&args[i+0x1]&&(flags[a0_0x492338(0xd3)]=parseInt(args[i+0x1],0xa)),args[i]===a0_0x492338(0xc6)&&args[i+0x1]&&(flags[a0_0x492338(0x9d)]=args[i+0x1]);}const port=flags[a0_0x492338(0xd3)]||DEFAULT_PORT,host=flags['host']||DEFAULT_HOST,serverUrl=a0_0x492338(0xd2)+host+':'+port;function a0_0x49db(_0x215c34,_0x330d43){_0x215c34=_0x215c34-0x93;const _0xcebc03=a0_0xcebc();let _0x49db4b=_0xcebc03[_0x215c34];return _0x49db4b;}if(flags['version']){const pkgPath=join(__dirname,'..',a0_0x492338(0xa7)),pkg=JSON['parse'](readFileSync(pkgPath,a0_0x492338(0xd0)));console[a0_0x492338(0xb5)](a0_0x492338(0xc5)+pkg[a0_0x492338(0xa4)]),process[a0_0x492338(0xa0)](0x0);}if(flags['help']||!command){const pkgPath=join(__dirname,'..',a0_0x492338(0xa7)),pkg=JSON[a0_0x492338(0x93)](readFileSync(pkgPath,'utf8'));console[a0_0x492338(0xb5)]('\x0aLoxia\x20Autopilot\x20One\x20v'+pkg[a0_0x492338(0xa4)]+a0_0x492338(0xc1)+DEFAULT_PORT+a0_0x492338(0xcf)+DEFAULT_HOST+')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Show\x20version\x20number\x0a\x0aExamples:\x0a\x20\x20loxia\x20web\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20open\x20browser\x0a\x20\x20loxia\x20terminal\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Connect\x20Terminal\x20UI\x20to\x20running\x20server\x0a\x20\x20loxia\x20plus-terminal\x20\x20\x20\x20\x20\x20#\x20Start\x20server\x20+\x20Terminal\x20UI\x0a\x20\x20loxia\x20web\x20--port\x203000\x20\x20\x20\x20#\x20Use\x20custom\x20port\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Run\x20\x27loxia\x20web\x27\x20to\x20start\x20with\x20Web\x20UI\x0a\x20\x202.\x20Or\x20run\x20\x27loxia\x20plus-terminal\x27\x20for\x20Terminal\x20UI\x20experience\x0a\x0aDocumentation:\x0a\x20\x20https://autopilot.loxia.ai\x0a\x0a'),process[a0_0x492338(0xa0)](0x0);}async function checkServerRunning(_0x2c56df,_0x4dbe06,_0x397bfe=0x1){for(let _0x5c1542=0x0;_0x5c1542<_0x397bfe;_0x5c1542++){const _0x5116dc=await new Promise(_0x1b4700=>{const _0x5a9594=a0_0x49db,_0xa6b477=a0_0x3656e4[_0x5a9594(0x9a)]('http://'+_0x2c56df+':'+_0x4dbe06+'/api/health',_0x4c92d4=>{const _0x323b86=_0x5a9594;_0x1b4700(_0x4c92d4[_0x323b86(0xc2)]===0xc8);});_0xa6b477['on'](_0x5a9594(0xb7),()=>_0x1b4700(![])),_0xa6b477[_0x5a9594(0xce)](0x7d0,()=>{const _0x57b17d=_0x5a9594;_0xa6b477[_0x57b17d(0xd8)](),_0x1b4700(![]);});});if(_0x5116dc)return!![];_0x5c1542<_0x397bfe-0x1&&await new Promise(_0x180b97=>setTimeout(_0x180b97,SERVER_CHECK_INTERVAL));}return![];}async function waitForServer(_0x423761,_0x31a991,_0x265b9c=SERVER_STARTUP_TIMEOUT){const _0x240a17=a0_0x492338,_0x73969a=Math[_0x240a17(0xd4)](_0x265b9c/SERVER_CHECK_INTERVAL);return checkServerRunning(_0x423761,_0x31a991,_0x73969a);}function openBrowser(_0x32622a){const _0x35d70a=a0_0x492338,_0x2c763e=process[_0x35d70a(0x99)];let _0x586647;if(_0x2c763e===_0x35d70a(0xd5))_0x586647=_0x35d70a(0xa1)+_0x32622a+'\x22';else _0x2c763e===_0x35d70a(0x9e)?_0x586647=_0x35d70a(0x97)+_0x32622a+'\x22':_0x586647=_0x35d70a(0xa9)+_0x32622a+'\x22';exec(_0x586647,_0x3d6bbb=>{const _0xe787a4=_0x35d70a;_0x3d6bbb&&(console[_0xe787a4(0xb5)]('Could\x20not\x20open\x20browser\x20automatically.'),console['log']('Please\x20open\x20manually:\x20'+_0x32622a));});}function startServer(_0x84d5e2=![]){const _0x38e80b=a0_0x492338,_0xe8546d={...process[_0x38e80b(0x9c)],'LOXIA_PORT':port[_0x38e80b(0xd6)](),'PORT':port[_0x38e80b(0xd6)]()};flags[_0x38e80b(0x9d)]&&(_0xe8546d[_0x38e80b(0xaa)]=flags['host']);const _0x52851b=join(__dirname,'..',_0x38e80b(0x96),_0x38e80b(0xbb)),_0x111ecc=spawn('node',[_0x52851b],{'cwd':join(__dirname,'..'),'env':_0xe8546d,'stdio':_0x84d5e2?[_0x38e80b(0x94),'ignore','ignore']:'inherit','detached':_0x84d5e2});return _0x84d5e2&&_0x111ecc[_0x38e80b(0xc7)](),_0x111ecc;}function startTerminalUI(){const _0x433b36=a0_0x492338,_0x2b76f3=join(__dirname,'loxia-terminal.js'),_0x32a06d={...process[_0x433b36(0x9c)],'LOXIA_PORT':port[_0x433b36(0xd6)](),'LOXIA_HOST':host},_0x330b7e=spawn('node',[_0x2b76f3],{'cwd':join(__dirname,'..'),'env':_0x32a06d,'stdio':_0x433b36(0xaf)});return _0x330b7e;}const commands={'web':async()=>{const _0x45a25e=a0_0x492338;console[_0x45a25e(0xb5)](_0x45a25e(0xb8));const _0x13c327=startServer(![]);console[_0x45a25e(0xb5)](_0x45a25e(0x98));const _0x1d8296=await waitForServer(host,port);_0x1d8296?(console[_0x45a25e(0xb5)](_0x45a25e(0xb6)+serverUrl),openBrowser(serverUrl)):console[_0x45a25e(0xb5)](_0x45a25e(0xd1)+serverUrl+'\x20manually.'),process['on'](_0x45a25e(0xb1),()=>_0x13c327[_0x45a25e(0xb3)]('SIGINT')),process['on']('SIGTERM',()=>_0x13c327['kill'](_0x45a25e(0x9f))),_0x13c327['on'](_0x45a25e(0xa0),_0x1dd5ba=>process[_0x45a25e(0xa0)](_0x1dd5ba||0x0));},'plus-web':async()=>{const _0xd20af6=a0_0x492338;await commands[_0xd20af6(0xac)]();},'terminal':async()=>{const _0x1ec4af=a0_0x492338;console[_0x1ec4af(0xb5)](_0x1ec4af(0xa6));const _0x1b0f27=await checkServerRunning(host,port);!_0x1b0f27&&(console[_0x1ec4af(0xb7)](_0x1ec4af(0xd7)+serverUrl),console['error'](_0x1ec4af(0xda)),console[_0x1ec4af(0xb7)](_0x1ec4af(0xa3)),console[_0x1ec4af(0xb7)](_0x1ec4af(0xb4)),process[_0x1ec4af(0xa0)](0x1));console[_0x1ec4af(0xb5)](_0x1ec4af(0xbc)+serverUrl),console['log'](_0x1ec4af(0xcd));const _0x21ebd9=startTerminalUI();process['on'](_0x1ec4af(0xb1),()=>_0x21ebd9[_0x1ec4af(0xb3)](_0x1ec4af(0xb1))),process['on']('SIGTERM',()=>_0x21ebd9[_0x1ec4af(0xb3)](_0x1ec4af(0x9f))),_0x21ebd9['on'](_0x1ec4af(0xa0),_0x839c8f=>process[_0x1ec4af(0xa0)](_0x839c8f||0x0));},'plus-terminal':async()=>{const _0x2e2d92=a0_0x492338;console[_0x2e2d92(0xb5)](_0x2e2d92(0xab));const _0x4e6b63=startServer(!![]),_0x31d499=await waitForServer(host,port);!_0x31d499&&(console[_0x2e2d92(0xb7)](_0x2e2d92(0xbe)),process[_0x2e2d92(0xa0)](0x1));console['log'](_0x2e2d92(0xcc)+serverUrl),console[_0x2e2d92(0xb5)](_0x2e2d92(0xcd));const _0x4af4c0=startTerminalUI();_0x4af4c0['on'](_0x2e2d92(0xa0),_0x227e77=>{const _0xb78bd3=_0x2e2d92;console['log'](_0xb78bd3(0xbd));try{process['kill'](_0x4e6b63['pid'],_0xb78bd3(0x9f));}catch(_0x11c2e0){}process[_0xb78bd3(0xa0)](_0x227e77||0x0);}),process['on'](_0x2e2d92(0xb1),()=>{const _0x204eec=_0x2e2d92;_0x4af4c0[_0x204eec(0xb3)](_0x204eec(0xb1));}),process['on'](_0x2e2d92(0x9f),()=>{const _0x4c8d30=_0x2e2d92;_0x4af4c0[_0x4c8d30(0xb3)]('SIGTERM');});}};commands[command]?commands[command]()[a0_0x492338(0xc0)](_0xab8138=>{const _0x241a13=a0_0x492338;console['error'](_0x241a13(0x9b),_0xab8138[_0x241a13(0xc8)]),process['exit'](0x1);}):(console['error']('Unknown\x20command:\x20'+command),console[a0_0x492338(0xb7)]('Run\x20\x22loxia\x20--help\x22\x20for\x20usage\x20information.'),process[a0_0x492338(0xa0)](0x1));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const a0_0x1c342f=a0_0x43f9;function a0_0x4ef6(){const _0x25b6ff=['6RWgHbQ','LOXIA_HOST','argv','toString','length','web','🎨\x20Launching\x20Ink-based\x20Terminal\x20UI...','843uDDfvl','ignore','✓\x20Server\x20is\x20already\x20running\x20at\x20','12IoSGhz','timeout','destroy','join','💡\x20Troubleshooting:','40361222Csjibq','stdout','dirname','Socket','--port','log','message','kill','pipe','1720YKfzrU','--host','slice','../src/interfaces/terminal/index.js','setTimeout','--ui','6026015Gqqrhi','920PXEqrl','...','\x20\x20\x202.\x20Try\x20running\x20the\x20server\x20manually:\x20node\x20bin/cli.js','error','7610967wdwTZy','node','env','LOXIA_PORT','now','🔍\x20Checking\x20if\x20server\x20is\x20running\x20at\x20','✗\x20Server\x20is\x20not\x20running','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','data','stderr','🚀\x20Starting\x20Loxia\x20server...','❌\x20Failed\x20to\x20start\x20Terminal\x20UI:','2649wxIziW','4604hOqmWt','35379EOiRgT','6087700BPSftN','Failed\x20to\x20start\x20server:'];a0_0x4ef6=function(){return _0x25b6ff;};return a0_0x4ef6();}(function(_0x4c13d8,_0x11a6eb){const _0x41ad82=a0_0x43f9,_0x3666e4=_0x4c13d8();while(!![]){try{const _0x15cdc=parseInt(_0x41ad82(0x158))/0x1*(-parseInt(_0x41ad82(0x135))/0x2)+-parseInt(_0x41ad82(0x14c))/0x3*(parseInt(_0x41ad82(0x14d))/0x4)+parseInt(_0x41ad82(0x13b))/0x5*(-parseInt(_0x41ad82(0x151))/0x6)+parseInt(_0x41ad82(0x140))/0x7+-parseInt(_0x41ad82(0x13c))/0x8*(parseInt(_0x41ad82(0x14e))/0x9)+-parseInt(_0x41ad82(0x14f))/0xa+-parseInt(_0x41ad82(0x12c))/0xb*(-parseInt(_0x41ad82(0x15b))/0xc);if(_0x15cdc===_0x11a6eb)break;else _0x3666e4['push'](_0x3666e4['shift']());}catch(_0x407e48){_0x3666e4['push'](_0x3666e4['shift']());}}}(a0_0x4ef6,0xb6e4c));import{spawn}from'child_process';import a0_0x4a2071 from'net';import a0_0xc5ae5e from'path';import{fileURLToPath}from'url';function a0_0x43f9(_0x5bdc67,_0x33a1e3){_0x5bdc67=_0x5bdc67-0x12a;const _0x4ef695=a0_0x4ef6();let _0x43f9ef=_0x4ef695[_0x5bdc67];return _0x43f9ef;}const __filename=fileURLToPath(import.meta.url),__dirname=a0_0xc5ae5e[a0_0x1c342f(0x12e)](__filename),projectRoot=a0_0xc5ae5e['dirname'](__dirname),DEFAULT_PORT=0x1f90,DEFAULT_HOST='localhost',SERVER_STARTUP_TIMEOUT=0x2710;async function isServerRunning(_0x24c626,_0x5a2baa){return new Promise(_0x6b22bd=>{const _0x27cf2e=a0_0x43f9,_0x278851=new a0_0x4a2071[(_0x27cf2e(0x12f))]();_0x278851[_0x27cf2e(0x139)](0x7d0),_0x278851['on']('connect',()=>{const _0x36336a=_0x27cf2e;_0x278851[_0x36336a(0x15d)](),_0x6b22bd(!![]);}),_0x278851['on'](_0x27cf2e(0x15c),()=>{const _0x2beebf=_0x27cf2e;_0x278851[_0x2beebf(0x15d)](),_0x6b22bd(![]);}),_0x278851['on']('error',()=>{const _0x345ae2=_0x27cf2e;_0x278851[_0x345ae2(0x15d)](),_0x6b22bd(![]);}),_0x278851['connect'](_0x5a2baa,_0x24c626);});}async function startServer(_0xc03f04,_0x1cfb44){const _0x37f85c=a0_0x1c342f;return console[_0x37f85c(0x131)](_0x37f85c(0x14a)),new Promise((_0x3514cd,_0x1c39c2)=>{const _0x574e8c=_0x37f85c,_0x37c1ba=spawn(_0x574e8c(0x141),[a0_0xc5ae5e[_0x574e8c(0x12a)](projectRoot,'bin/cli.js'),_0x574e8c(0x13a),_0x574e8c(0x156),_0x574e8c(0x136),_0xc03f04,_0x574e8c(0x130),_0x1cfb44[_0x574e8c(0x154)]()],{'detached':![],'stdio':[_0x574e8c(0x159),'pipe',_0x574e8c(0x134)]});_0x37c1ba[_0x574e8c(0x12d)]['on'](_0x574e8c(0x148),()=>{}),_0x37c1ba[_0x574e8c(0x149)]['on'](_0x574e8c(0x148),()=>{}),_0x37c1ba['on'](_0x574e8c(0x13f),_0x37a84e=>{const _0x1ff08e=_0x574e8c;console[_0x1ff08e(0x13f)](_0x1ff08e(0x150),_0x37a84e['message']),_0x1c39c2(_0x37a84e);});const _0x5d78fa=Date[_0x574e8c(0x144)](),_0x1b26fe=setInterval(async()=>{const _0x45e5a4=_0x574e8c,_0x2264af=await isServerRunning(_0xc03f04,_0x1cfb44);if(_0x2264af)clearInterval(_0x1b26fe),console['log']('✓\x20Server\x20started\x20at\x20'+_0xc03f04+':'+_0x1cfb44),_0x3514cd();else Date['now']()-_0x5d78fa>SERVER_STARTUP_TIMEOUT&&(clearInterval(_0x1b26fe),_0x37c1ba[_0x45e5a4(0x133)](),_0x1c39c2(new Error('Server\x20startup\x20timeout')));},0x1f4);});}async function main(){const _0x1f9c0d=a0_0x1c342f;try{console[_0x1f9c0d(0x131)](_0x1f9c0d(0x147)),console['log']('\x20\x20Loxia\x20Autopilot\x20One\x20-\x20Terminal\x20UI'),console[_0x1f9c0d(0x131)](_0x1f9c0d(0x147)),console['log']('');const _0x46552c=process[_0x1f9c0d(0x153)][_0x1f9c0d(0x137)](0x2);let _0x43f1c3=DEFAULT_HOST,_0x31312e=DEFAULT_PORT;for(let _0x3b99e8=0x0;_0x3b99e8<_0x46552c[_0x1f9c0d(0x155)];_0x3b99e8++){if(_0x46552c[_0x3b99e8]===_0x1f9c0d(0x136)&&_0x46552c[_0x3b99e8+0x1])_0x43f1c3=_0x46552c[_0x3b99e8+0x1],_0x3b99e8++;else _0x46552c[_0x3b99e8]===_0x1f9c0d(0x130)&&_0x46552c[_0x3b99e8+0x1]&&(_0x31312e=parseInt(_0x46552c[_0x3b99e8+0x1],0xa),_0x3b99e8++);}console['log'](_0x1f9c0d(0x145)+_0x43f1c3+':'+_0x31312e+_0x1f9c0d(0x13d));const _0x4fa8d2=await isServerRunning(_0x43f1c3,_0x31312e);!_0x4fa8d2?(console[_0x1f9c0d(0x131)](_0x1f9c0d(0x146)),await startServer(_0x43f1c3,_0x31312e)):console[_0x1f9c0d(0x131)](_0x1f9c0d(0x15a)+_0x43f1c3+':'+_0x31312e),console[_0x1f9c0d(0x131)](''),console['log'](_0x1f9c0d(0x157)),console[_0x1f9c0d(0x131)](''),await new Promise(_0x56f566=>setTimeout(_0x56f566,0x1f4)),process[_0x1f9c0d(0x142)][_0x1f9c0d(0x152)]=_0x43f1c3,process[_0x1f9c0d(0x142)][_0x1f9c0d(0x143)]=_0x31312e[_0x1f9c0d(0x154)](),await import(_0x1f9c0d(0x138));}catch(_0x32b5c8){console[_0x1f9c0d(0x13f)](''),console[_0x1f9c0d(0x13f)](_0x1f9c0d(0x14b)),console['error']('\x20\x20',_0x32b5c8[_0x1f9c0d(0x132)]),console['error'](''),console['error'](_0x1f9c0d(0x12b)),console[_0x1f9c0d(0x13f)]('\x20\x20\x201.\x20Make\x20sure\x20no\x20other\x20process\x20is\x20using\x20port\x208080'),console[_0x1f9c0d(0x13f)](_0x1f9c0d(0x13e)),console['error']('\x20\x20\x203.\x20Check\x20logs\x20for\x20more\x20details'),console[_0x1f9c0d(0x13f)](''),process['exit'](0x1);}}main();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const a0_0x27de10=a0_0x19ad;(function(_0x383437,_0x1d2a8f){const _0x1f3f4f=a0_0x19ad,_0x4b71f4=_0x383437();while(!![]){try{const _0x2790d9=-parseInt(_0x1f3f4f(0x1b8))/0x1*(parseInt(_0x1f3f4f(0x1b9))/0x2)+parseInt(_0x1f3f4f(0x1c4))/0x3+-parseInt(_0x1f3f4f(0x1b0))/0x4*(parseInt(_0x1f3f4f(0x1c3))/0x5)+parseInt(_0x1f3f4f(0x1ce))/0x6*(parseInt(_0x1f3f4f(0x1b2))/0x7)+parseInt(_0x1f3f4f(0x1bb))/0x8+parseInt(_0x1f3f4f(0x1c2))/0x9*(-parseInt(_0x1f3f4f(0x1ca))/0xa)+parseInt(_0x1f3f4f(0x1be))/0xb*(-parseInt(_0x1f3f4f(0x1b3))/0xc);if(_0x2790d9===_0x1d2a8f)break;else _0x4b71f4['push'](_0x4b71f4['shift']());}catch(_0x50e7dd){_0x4b71f4['push'](_0x4b71f4['shift']());}}}(a0_0x23d3,0xdbf44));function a0_0x19ad(_0x2f5f4a,_0x57183c){_0x2f5f4a=_0x2f5f4a-0x1ac;const _0x23d326=a0_0x23d3();let _0x19ad3d=_0x23d326[_0x2f5f4a];return _0x19ad3d;}import{startTerminalUI}from'../src/interfaces/terminal/index.js';const args=process[a0_0x27de10(0x1b1)][a0_0x27de10(0x1b5)](0x2),options={'host':a0_0x27de10(0x1c5),'port':0x1f90};function a0_0x23d3(){const _0x34b0d9=['exit','log','90599qdYrIz','6XIMNqH','waitUntilExit','5117464smTZNB','Connecting\x20to:\x20','\x20\x20-\x20Piped\x20environments\x20(e.g.,\x20|\x20head,\x20|\x20grep)','11AZfktH','ERROR:\x20Terminal\x20UI\x20requires\x20an\x20interactive\x20terminal\x20(TTY).','Press\x20Ctrl+C\x20to\x20exit\x0a','port','20394XrxRLk','226595DGbgAD','3477186ZWxIET','localhost','error','host','then','\x20\x20npm\x20start','230AdSGUE','LOXIA_HOST','\x20\x20-\x20Background\x20processes\x20(e.g.,\x20&\x20at\x20the\x20end)','\x20\x20npm\x20run\x20terminal-ui','1908VQEIij','length','LOXIA_PORT','isTTY','--help','Or\x20use\x20the\x20web\x20UI\x20instead:','The\x20terminal\x20UI\x20cannot\x20run\x20in:','--host','\x20\x20-\x20Redirected\x20output\x20(e.g.,\x20>\x20file.txt,\x202>&1\x20|\x20...)','Please\x20run\x20this\x20command\x20in\x20a\x20real\x20terminal\x20without\x20pipes\x20or\x20redirection:','\x20\x20-\x20Some\x20CI/CD\x20environments','Starting\x20Loxia\x20Terminal\x20UI...','28qmLccX','argv','35161xKNvbS','22247748RtMlmI','env','slice'];a0_0x23d3=function(){return _0x34b0d9;};return a0_0x23d3();}for(let i=0x0;i<args[a0_0x27de10(0x1cf)];i++){const arg=args[i];if(arg===a0_0x27de10(0x1d5)||arg==='-h')options[a0_0x27de10(0x1c7)]=args[++i];else{if(arg==='--port'||arg==='-p')options[a0_0x27de10(0x1c1)]=parseInt(args[++i],0xa);else arg===a0_0x27de10(0x1d2)&&(console[a0_0x27de10(0x1b7)]('\x0aLoxia\x20Terminal\x20UI\x0a\x0aUsage:\x0a\x20\x20loxia-terminal\x20[options]\x0a\x0aOptions:\x0a\x20\x20--host,\x20-h\x20<host>\x20\x20\x20\x20Backend\x20host\x20(default:\x20localhost)\x0a\x20\x20--port,\x20-p\x20<port>\x20\x20\x20\x20Backend\x20port\x20(default:\x208080)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aEnvironment\x20Variables:\x0a\x20\x20LOXIA_HOST\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20host\x0a\x20\x20LOXIA_PORT\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Backend\x20port\x0a\x0aExamples:\x0a\x20\x20loxia-terminal\x0a\x20\x20loxia-terminal\x20--host\x20192.168.1.100\x20--port\x203000\x0a\x20\x20LOXIA_HOST=api.example.com\x20LOXIA_PORT=443\x20loxia-terminal\x0a'),process['exit'](0x0));}}process['env'][a0_0x27de10(0x1cb)]&&(options['host']=process['env'][a0_0x27de10(0x1cb)]);process['env'][a0_0x27de10(0x1d0)]&&(options[a0_0x27de10(0x1c1)]=parseInt(process[a0_0x27de10(0x1b4)][a0_0x27de10(0x1d0)],0xa));!process['stdin'][a0_0x27de10(0x1d1)]&&(console['error'](a0_0x27de10(0x1bf)),console[a0_0x27de10(0x1c6)](''),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1d4)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1bd)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1ac)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1cc)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1ae)),console['error'](''),console['error'](a0_0x27de10(0x1ad)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1cd)),console[a0_0x27de10(0x1c6)](''),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1d3)),console[a0_0x27de10(0x1c6)](a0_0x27de10(0x1c9)),process[a0_0x27de10(0x1b6)](0x1));console[a0_0x27de10(0x1b7)](a0_0x27de10(0x1af)),console[a0_0x27de10(0x1b7)](a0_0x27de10(0x1bc)+options[a0_0x27de10(0x1c7)]+':'+options[a0_0x27de10(0x1c1)]),console['log'](a0_0x27de10(0x1c0));const instance=startTerminalUI(options);instance[a0_0x27de10(0x1ba)]()[a0_0x27de10(0x1c8)](()=>{const _0x566653=a0_0x27de10;console[_0x566653(0x1b7)]('\x0aTerminal\x20UI\x20exited'),process[_0x566653(0x1b6)](0x0);})['catch'](_0x268176=>{console['error']('\x0aTerminal\x20UI\x20error:',_0x268176),process['exit'](0x1);});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const a0_0x3d57a8=a0_0x5679;(function(_0x6c6c0,_0x4b45b5){const _0x348ca6=a0_0x5679,_0x4ecab0=_0x6c6c0();while(!![]){try{const _0x2f04d0=parseInt(_0x348ca6(0x125))/0x1+parseInt(_0x348ca6(0x11e))/0x2*(parseInt(_0x348ca6(0x11c))/0x3)+parseInt(_0x348ca6(0x138))/0x4*(-parseInt(_0x348ca6(0x110))/0x5)+parseInt(_0x348ca6(0x10a))/0x6+parseInt(_0x348ca6(0x124))/0x7*(-parseInt(_0x348ca6(0x12f))/0x8)+parseInt(_0x348ca6(0x132))/0x9+-parseInt(_0x348ca6(0x135))/0xa*(parseInt(_0x348ca6(0x12c))/0xb);if(_0x2f04d0===_0x4b45b5)break;else _0x4ecab0['push'](_0x4ecab0['shift']());}catch(_0x3942ec){_0x4ecab0['push'](_0x4ecab0['shift']());}}}(a0_0xaf81,0x3a430));function a0_0xaf81(){const _0x4ab069=['node','9038eHPETh','setTimeout','pipe','Server\x20returned\x20','stderr','🛑\x20Stopping\x20server...','1645wkQRnW','73295ZQtVBL','get','Server\x20exited\x20with\x20code\x20','🚀\x20Starting\x20Loxia\x20server...','exit','kill','data','679844TokHwX','index.js','env','5224BxjeDQ','SIGTERM','[SERVER]\x20','3268278lbZPKW','\x0a⚠️\x20\x20Received\x20SIGTERM,\x20shutting\x20down...','http://localhost:','50MopaxB','✅\x20Server\x20is\x20ready!','/health','372644mtYShK','Failed\x20to\x20start\x20Terminal\x20UI:','SIGKILL','🖥️\x20\x20Starting\x20Terminal\x20UI...','Error\x20during\x20startup:','1817496MJAext','bin','Timeout','src','message','toString','20ArCxCm','ExperimentalWarning','statusCode','error','killed','╔════════════════════════════════════════════════╗','log','[SERVER\x20ERROR]\x20','║\x20\x20\x20Loxia\x20AI\x20Agents\x20-\x20Server\x20+\x20Terminal\x20UI\x20\x20\x20\x20\x20\x20║','ignore','loxia-terminal.js','⚠️\x20\x20Server\x20may\x20not\x20be\x20fully\x20ready,\x20but\x20continuing\x20anyway...','222uXMiSl'];a0_0xaf81=function(){return _0x4ab069;};return a0_0xaf81();}import{spawn}from'child_process';import{fileURLToPath}from'url';import{dirname,join}from'path';import a0_0x58e978 from'http';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),rootDir=join(__dirname,'..'),SERVER_PORT=process['env']['PORT']||0x1f90,STARTUP_WAIT=0x7d0;let serverProcess=null;function a0_0x5679(_0x10e6e1,_0x169292){_0x10e6e1=_0x10e6e1-0x10a;const _0xaf8146=a0_0xaf81();let _0x5679e2=_0xaf8146[_0x10e6e1];return _0x5679e2;}async function checkServerReady(_0x4f4d0e=0xa,_0x1b0719=0x1f4){const _0x4bb574=a0_0x5679;for(let _0x323e26=0x0;_0x323e26<_0x4f4d0e;_0x323e26++){try{return await new Promise((_0x1c4c9c,_0x2f596a)=>{const _0x278a21=a0_0x5679,_0x5415e9=a0_0x58e978[_0x278a21(0x126)](_0x278a21(0x134)+SERVER_PORT+_0x278a21(0x137),_0x2e2ecb=>{const _0xa87bca=_0x278a21;_0x2e2ecb['statusCode']===0xc8?_0x1c4c9c():_0x2f596a(new Error(_0xa87bca(0x121)+_0x2e2ecb[_0xa87bca(0x112)]));});_0x5415e9['on'](_0x278a21(0x113),_0x2f596a),_0x5415e9[_0x278a21(0x11f)](0x3e8,()=>{const _0x1cadb8=_0x278a21;_0x5415e9['destroy'](),_0x2f596a(new Error(_0x1cadb8(0x10c)));});}),console['log'](_0x4bb574(0x136)),!![];}catch(_0x4ec584){_0x323e26<_0x4f4d0e-0x1&&await new Promise(_0xa3c09f=>setTimeout(_0xa3c09f,_0x1b0719));}}return console[_0x4bb574(0x116)](_0x4bb574(0x11b)),![];}async function startServer(){return new Promise(_0x148d47=>{const _0x207c7f=a0_0x5679;console[_0x207c7f(0x116)](_0x207c7f(0x128));const _0x394389=join(rootDir,_0x207c7f(0x10d),_0x207c7f(0x12d));serverProcess=spawn(_0x207c7f(0x11d),[_0x394389],{'cwd':rootDir,'env':{...process['env']},'stdio':[_0x207c7f(0x119),_0x207c7f(0x120),_0x207c7f(0x120)],'detached':![]}),serverProcess['stdout']['on'](_0x207c7f(0x12b),_0x1de586=>{const _0x348080=_0x207c7f,_0xbf7953=_0x1de586['toString']()['trim']();_0xbf7953&&console[_0x348080(0x116)](_0x348080(0x131)+_0xbf7953);}),serverProcess[_0x207c7f(0x122)]['on'](_0x207c7f(0x12b),_0x5a3741=>{const _0x563bcf=_0x207c7f,_0x4beb9b=_0x5a3741[_0x563bcf(0x10f)]()['trim']();_0x4beb9b&&!_0x4beb9b['includes'](_0x563bcf(0x111))&&console[_0x563bcf(0x113)](_0x563bcf(0x117)+_0x4beb9b);}),serverProcess['on'](_0x207c7f(0x113),_0x313547=>{const _0x3c721c=_0x207c7f;console[_0x3c721c(0x113)]('Failed\x20to\x20start\x20server:',_0x313547[_0x3c721c(0x10e)]),process[_0x3c721c(0x129)](0x1);}),serverProcess['on'](_0x207c7f(0x129),(_0x54bb27,_0x256840)=>{const _0x2905d6=_0x207c7f;_0x54bb27!==null&&_0x54bb27!==0x0&&(console[_0x2905d6(0x113)](_0x2905d6(0x127)+_0x54bb27),process[_0x2905d6(0x129)](_0x54bb27));}),setTimeout(_0x148d47,STARTUP_WAIT);});}async function startTerminalUI(){const _0xb2fd15=a0_0x5679;console['log'](_0xb2fd15(0x13b)),console[_0xb2fd15(0x116)]('');const _0x471a18=join(rootDir,_0xb2fd15(0x10b),_0xb2fd15(0x11a)),_0x181828=spawn(_0xb2fd15(0x11d),[_0x471a18],{'cwd':rootDir,'env':{...process[_0xb2fd15(0x12e)]},'stdio':'inherit'});return _0x181828['on']('error',_0x341124=>{const _0x2c6c89=_0xb2fd15;console['error'](_0x2c6c89(0x139),_0x341124[_0x2c6c89(0x10e)]),cleanup(),process[_0x2c6c89(0x129)](0x1);}),_0x181828['on'](_0xb2fd15(0x129),_0x5aad2c=>{const _0x43049a=_0xb2fd15;console[_0x43049a(0x116)]('\x0a👋\x20Terminal\x20UI\x20closed.'),cleanup(),process[_0x43049a(0x129)](_0x5aad2c||0x0);}),_0x181828;}function cleanup(){const _0x332f77=a0_0x5679;serverProcess&&!serverProcess[_0x332f77(0x114)]&&(console[_0x332f77(0x116)](_0x332f77(0x123)),serverProcess[_0x332f77(0x12a)](_0x332f77(0x130)),setTimeout(()=>{const _0x577f0c=_0x332f77;!serverProcess[_0x577f0c(0x114)]&&serverProcess[_0x577f0c(0x12a)](_0x577f0c(0x13a));},0x1388));}process['on']('SIGINT',()=>{const _0x47bd1a=a0_0x5679;console[_0x47bd1a(0x116)]('\x0a⚠️\x20\x20Received\x20SIGINT,\x20shutting\x20down...'),cleanup(),process['exit'](0x0);}),process['on'](a0_0x3d57a8(0x130),()=>{const _0x18d957=a0_0x3d57a8;console[_0x18d957(0x116)](_0x18d957(0x133)),cleanup(),process[_0x18d957(0x129)](0x0);}),process['on']('exit',()=>{cleanup();});async function main(){const _0x300535=a0_0x3d57a8;console[_0x300535(0x116)](_0x300535(0x115)),console['log'](_0x300535(0x118)),console[_0x300535(0x116)]('╚════════════════════════════════════════════════╝'),console[_0x300535(0x116)]('');try{await startServer(),await checkServerReady(),await startTerminalUI(),await new Promise(()=>{});}catch(_0x468fcc){console['error'](_0x300535(0x13c),_0x468fcc[_0x300535(0x10e)]),cleanup(),process[_0x300535(0x129)](0x1);}}main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loxia-labs/loxia-autopilot-one",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Loxia AI Agents System - No-code/vibe-code/companion-coder platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node src/index.js",
|
|
12
12
|
"dev": "node --inspect src/index.js",
|
|
13
|
-
"
|
|
13
|
+
"terminal-ui": "node bin/loxia-terminal.js",
|
|
14
|
+
"terminal-ui-v2": "node bin/loxia-terminal-v2.js",
|
|
15
|
+
"start:terminal": "node bin/start-with-terminal.js",
|
|
16
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
14
17
|
"lint": "eslint src/",
|
|
15
18
|
"typecheck": "echo 'No TypeScript - skipping typecheck'",
|
|
16
|
-
"build": "npm run build:web-ui",
|
|
17
|
-
"build:web-ui": "cd web-ui && npm install && npm run build && cd ..",
|
|
18
19
|
"docs": "jsdoc -c jsdoc.config.json",
|
|
19
|
-
"postinstall": "node scripts/install-scanners.js"
|
|
20
|
-
"prepublishOnly": "npm run build"
|
|
20
|
+
"postinstall": "node scripts/install-scanners.js"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"ai",
|
|
@@ -44,8 +44,12 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/parser": "^7.28.5",
|
|
46
46
|
"@babel/traverse": "^7.28.5",
|
|
47
|
+
"blessed": "^0.1.81",
|
|
48
|
+
"blessed-contrib": "^4.11.0",
|
|
49
|
+
"chalk": "^5.6.2",
|
|
47
50
|
"express": "^4.18.2",
|
|
48
51
|
"glob": "^10.4.5",
|
|
52
|
+
"ink": "^5.2.1",
|
|
49
53
|
"node-fetch": "^3.3.2",
|
|
50
54
|
"pdf-parse": "^2.2.2",
|
|
51
55
|
"postcss": "^8.5.6",
|
|
@@ -53,22 +57,17 @@
|
|
|
53
57
|
"postcss-scss": "^4.0.9",
|
|
54
58
|
"prettier": "^3.6.2",
|
|
55
59
|
"puppeteer": "^24.25.0",
|
|
60
|
+
"react": "^18.3.1",
|
|
61
|
+
"strip-ansi": "^7.1.2",
|
|
56
62
|
"stylelint": "^16.25.0",
|
|
57
63
|
"stylelint-config-standard": "^39.0.1",
|
|
58
64
|
"tiktoken": "^1.0.15",
|
|
59
65
|
"typescript": "^5.9.3",
|
|
60
66
|
"ws": "^8.16.0"
|
|
61
67
|
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"ajv": "^8.17.1",
|
|
64
|
-
"ajv-formats": "^3.0.1",
|
|
65
|
-
"eslint": "^8.57.1",
|
|
66
|
-
"eslint-plugin-security": "^3.0.1",
|
|
67
|
-
"jest": "^29.7.0",
|
|
68
|
-
"jsdoc": "^4.0.2"
|
|
69
|
-
},
|
|
70
68
|
"jest": {
|
|
71
69
|
"testEnvironment": "node",
|
|
70
|
+
"transform": {},
|
|
72
71
|
"collectCoverageFrom": [
|
|
73
72
|
"src/**/*.js",
|
|
74
73
|
"!src/**/*.test.js"
|
|
@@ -91,4 +90,4 @@
|
|
|
91
90
|
"no-console": "off"
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
|
-
}
|
|
93
|
+
}
|