@loxia-labs/loxia-autopilot-one 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +267 -0
  2. package/README.md +509 -0
  3. package/bin/cli.js +117 -0
  4. package/package.json +94 -0
  5. package/scripts/install-scanners.js +236 -0
  6. package/src/analyzers/CSSAnalyzer.js +297 -0
  7. package/src/analyzers/ConfigValidator.js +690 -0
  8. package/src/analyzers/ESLintAnalyzer.js +320 -0
  9. package/src/analyzers/JavaScriptAnalyzer.js +261 -0
  10. package/src/analyzers/PrettierFormatter.js +247 -0
  11. package/src/analyzers/PythonAnalyzer.js +266 -0
  12. package/src/analyzers/SecurityAnalyzer.js +729 -0
  13. package/src/analyzers/TypeScriptAnalyzer.js +247 -0
  14. package/src/analyzers/codeCloneDetector/analyzer.js +344 -0
  15. package/src/analyzers/codeCloneDetector/detector.js +203 -0
  16. package/src/analyzers/codeCloneDetector/index.js +160 -0
  17. package/src/analyzers/codeCloneDetector/parser.js +199 -0
  18. package/src/analyzers/codeCloneDetector/reporter.js +148 -0
  19. package/src/analyzers/codeCloneDetector/scanner.js +59 -0
  20. package/src/core/agentPool.js +1474 -0
  21. package/src/core/agentScheduler.js +2147 -0
  22. package/src/core/contextManager.js +709 -0
  23. package/src/core/messageProcessor.js +732 -0
  24. package/src/core/orchestrator.js +548 -0
  25. package/src/core/stateManager.js +877 -0
  26. package/src/index.js +631 -0
  27. package/src/interfaces/cli.js +549 -0
  28. package/src/interfaces/webServer.js +2162 -0
  29. package/src/modules/fileExplorer/controller.js +280 -0
  30. package/src/modules/fileExplorer/index.js +37 -0
  31. package/src/modules/fileExplorer/middleware.js +92 -0
  32. package/src/modules/fileExplorer/routes.js +125 -0
  33. package/src/modules/fileExplorer/types.js +44 -0
  34. package/src/services/aiService.js +1232 -0
  35. package/src/services/apiKeyManager.js +164 -0
  36. package/src/services/benchmarkService.js +366 -0
  37. package/src/services/budgetService.js +539 -0
  38. package/src/services/contextInjectionService.js +247 -0
  39. package/src/services/conversationCompactionService.js +637 -0
  40. package/src/services/errorHandler.js +810 -0
  41. package/src/services/fileAttachmentService.js +544 -0
  42. package/src/services/modelRouterService.js +366 -0
  43. package/src/services/modelsService.js +322 -0
  44. package/src/services/qualityInspector.js +796 -0
  45. package/src/services/tokenCountingService.js +536 -0
  46. package/src/tools/agentCommunicationTool.js +1344 -0
  47. package/src/tools/agentDelayTool.js +485 -0
  48. package/src/tools/asyncToolManager.js +604 -0
  49. package/src/tools/baseTool.js +800 -0
  50. package/src/tools/browserTool.js +920 -0
  51. package/src/tools/cloneDetectionTool.js +621 -0
  52. package/src/tools/dependencyResolverTool.js +1215 -0
  53. package/src/tools/fileContentReplaceTool.js +875 -0
  54. package/src/tools/fileSystemTool.js +1107 -0
  55. package/src/tools/fileTreeTool.js +853 -0
  56. package/src/tools/imageTool.js +901 -0
  57. package/src/tools/importAnalyzerTool.js +1060 -0
  58. package/src/tools/jobDoneTool.js +248 -0
  59. package/src/tools/seekTool.js +956 -0
  60. package/src/tools/staticAnalysisTool.js +1778 -0
  61. package/src/tools/taskManagerTool.js +2873 -0
  62. package/src/tools/terminalTool.js +2304 -0
  63. package/src/tools/webTool.js +1430 -0
  64. package/src/types/agent.js +519 -0
  65. package/src/types/contextReference.js +972 -0
  66. package/src/types/conversation.js +730 -0
  67. package/src/types/toolCommand.js +747 -0
  68. package/src/utilities/attachmentValidator.js +292 -0
  69. package/src/utilities/configManager.js +582 -0
  70. package/src/utilities/constants.js +722 -0
  71. package/src/utilities/directoryAccessManager.js +535 -0
  72. package/src/utilities/fileProcessor.js +307 -0
  73. package/src/utilities/logger.js +436 -0
  74. package/src/utilities/tagParser.js +1246 -0
  75. package/src/utilities/toolConstants.js +317 -0
  76. package/web-ui/build/index.html +15 -0
  77. package/web-ui/build/logo.png +0 -0
  78. package/web-ui/build/logo2.png +0 -0
  79. package/web-ui/build/static/index-CjkkcnFA.js +344 -0
  80. package/web-ui/build/static/index-Dy2bYbOa.css +1 -0
package/README.md ADDED
@@ -0,0 +1,509 @@
1
+ <div align="center">
2
+
3
+ # 🚀 Loxia Autopilot One
4
+
5
+ **Autonomous AI Agent System for Software Development**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/loxia-autopilot-one.svg?style=flat-square)](https://www.npmjs.com/package/loxia-autopilot-one)
8
+ [![Node.js Version](https://img.shields.io/node/v/loxia-autopilot-one.svg?style=flat-square)](https://nodejs.org)
9
+ [![License: Commercial](https://img.shields.io/badge/License-Commercial-blue.svg?style=flat-square)](./LICENSE)
10
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
11
+
12
+ **[Quick Start](#-quick-start)** • **[Features](#-features)** • **[Documentation](#-documentation)** • **[Tools](#-ai-powered-tools)** • **[Web UI](#-web-interface)**
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## 🎯 What is Loxia Autopilot One?
19
+
20
+ 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
+
22
+ ### Why Loxia?
23
+
24
+ - 🤖 **Multi-Agent Orchestration** - Run multiple AI agents simultaneously with isolated workspaces
25
+ - 🔧 **Rich Tool Ecosystem** - 18+ specialized tools for development, analysis, and automation
26
+ - 🌐 **Dual Interface** - Modern Web UI + powerful CLI for any workflow
27
+ - 📊 **Real-Time Monitoring** - Track agent activity, costs, and performance
28
+ - 💾 **Persistent State** - Resume conversations and continue work across sessions
29
+ - 🔒 **Secure by Design** - Agent isolation, resource limits, and security scanning
30
+
31
+ ---
32
+
33
+ ## ✨ Features
34
+
35
+ ### Core Capabilities
36
+
37
+ <table>
38
+ <tr>
39
+ <td width="50%">
40
+
41
+ #### 🤖 **Intelligent Agent System**
42
+ - Multi-agent conversation orchestration
43
+ - Automatic model selection and routing
44
+ - Task-based agent specialization
45
+ - Inter-agent communication
46
+ - Background task management
47
+
48
+ </td>
49
+ <td width="50%">
50
+
51
+ #### 🛠️ **Professional Tooling**
52
+ - Terminal command execution
53
+ - File system operations
54
+ - Web browsing and scraping
55
+ - Image generation (DALL-E, Flux)
56
+ - Code analysis and refactoring
57
+
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td width="50%">
62
+
63
+ #### 📈 **Development Features**
64
+ - Import/export analysis
65
+ - Dependency resolution
66
+ - Static code analysis
67
+ - Clone detection
68
+ - Security scanning
69
+
70
+ </td>
71
+ <td width="50%">
72
+
73
+ #### 💡 **Smart Assistance**
74
+ - Context-aware responses
75
+ - File attachments in chat
76
+ - Conversation compaction
77
+ - Task management
78
+ - Progress tracking
79
+
80
+ </td>
81
+ </tr>
82
+ </table>
83
+
84
+ ---
85
+
86
+ ## 🚀 Quick Start
87
+
88
+ ### Prerequisites
89
+
90
+ **Registration Required**: Loxia Autopilot One requires authentication to use. You'll need:
91
+ - Active subscription or valid license
92
+ - Authentication credentials from [loxia.ai](https://loxia.ai)
93
+
94
+ **Not registered yet?** Visit [loxia.ai/register](https://loxia.ai/register) to create an account.
95
+
96
+ ### Installation
97
+
98
+ ```bash
99
+ # Install globally via npm
100
+ npm install -g loxia-autopilot-one
101
+
102
+ # Start Loxia (you'll be prompted for credentials)
103
+ loxia
104
+ ```
105
+
106
+ On first run, you'll be prompted to enter your authentication credentials.
107
+
108
+ The Web UI will automatically open at `http://localhost:8080`
109
+
110
+ ### CLI Options
111
+
112
+ ```bash
113
+ loxia # Start with Web UI + CLI
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
119
+ ```
120
+
121
+ ### First Steps
122
+
123
+ 1. **Create an Agent**
124
+ ```bash
125
+ loxia> /create DevAssistant
126
+ ```
127
+
128
+ 2. **Start a Conversation**
129
+ ```
130
+ loxia:DevAssistant> Analyze the imports in my project
131
+ ```
132
+
133
+ 3. **Use Tools**
134
+ ```
135
+ loxia:DevAssistant> Run npm test and fix any failures
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 🌐 Web Interface
141
+
142
+ The modern Web UI provides an intuitive interface for managing agents and conversations:
143
+
144
+ ### Key Features
145
+
146
+ - 💬 **Chat Interface** - Clean, responsive chat with markdown support
147
+ - 📁 **File Attachments** - Drag and drop files into conversations
148
+ - 🎛️ **Agent Management** - Create, switch, and manage multiple agents
149
+ - 📊 **Real-Time Updates** - Live agent status and output streaming
150
+ - 🎨 **Model Selection** - Switch between AI models on the fly
151
+ - 📝 **Task Tracking** - Visual task lists with progress indicators
152
+ - 🔍 **Search & Filter** - Find conversations and messages quickly
153
+ - 🌓 **Modern UI** - Built with React, TailwindCSS, and WebSockets
154
+
155
+ ### Web UI Screenshots
156
+
157
+ *Coming soon - the interface provides a clean, modern experience for interacting with AI agents*
158
+
159
+ ---
160
+
161
+ ## 🔧 AI-Powered Tools
162
+
163
+ Loxia comes with 18+ specialized tools that agents can use autonomously:
164
+
165
+ ### Development Tools
166
+
167
+ | Tool | Description | Key Features |
168
+ |------|-------------|--------------|
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 |
174
+
175
+ ### Analysis Tools
176
+
177
+ | Tool | Description | Key Features |
178
+ |------|-------------|--------------|
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 |
184
+
185
+ ### AI & Automation Tools
186
+
187
+ | Tool | Description | Key Features |
188
+ |------|-------------|--------------|
189
+ | 🖼️ **Image Generator** | AI image creation | DALL-E 3, Stable Diffusion, Flux support |
190
+ | 📝 **Task Manager** | Task tracking | Todo lists, progress tracking, agent synchronization |
191
+ | 📡 **Web Tool** | HTTP requests | GET, POST, API testing, webhook debugging |
192
+ | 🔄 **File Content Replace** | Bulk replacements | Pattern-based, multi-file, preview changes |
193
+ | 💬 **Agent Communication** | Inter-agent messaging | Task delegation, collaborative workflows |
194
+
195
+ ### System Tools
196
+
197
+ | Tool | Description | Key Features |
198
+ |------|-------------|--------------|
199
+ | ⏸️ **Agent Delay** | Pause agent execution | Timed delays, background operation support |
200
+ | ✅ **Job Done** | Task completion | Mark tasks complete, trigger workflows |
201
+ | 🔧 **Async Tool Manager** | Background task handling | Long-running operations, status tracking |
202
+
203
+ ---
204
+
205
+ ## 📋 System Requirements
206
+
207
+ - **Node.js**: >= 16.0.0 (18.x or 20.x LTS recommended)
208
+ - **npm**: >= 7.0.0
209
+ - **Operating System**: Windows, macOS, Linux
210
+ - **Memory**: 2GB minimum, 4GB+ recommended
211
+ - **Disk Space**: 500MB for package and dependencies
212
+
213
+ ### Optional Dependencies
214
+
215
+ For full functionality, install these tools:
216
+
217
+ ```bash
218
+ # Security scanning
219
+ npm install -g eslint prettier typescript stylelint
220
+
221
+ # For development
222
+ npm install -g nodemon jest
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 🏗️ Architecture
228
+
229
+ ### High-Level Overview
230
+
231
+ ```
232
+ ┌─────────────────────────────────────────────────┐
233
+ │ Client Interfaces │
234
+ │ ┌─────────────┐ ┌────────────────────────┐ │
235
+ │ │ Web UI │ │ CLI Interface │ │
236
+ │ │ (React) │ │ (Interactive Shell) │ │
237
+ │ └─────────────┘ └────────────────────────┘ │
238
+ └───────────────────┬─────────────────────────────┘
239
+ │ WebSocket / IPC
240
+ ┌───────────▼──────────────┐
241
+ │ Orchestrator Service │
242
+ │ (Request Coordination) │
243
+ └────────┬────────┬────────┘
244
+ │ │
245
+ ┌──────────▼──┐ ┌─▼──────────────┐
246
+ │ Agent Pool │ │ AI Service │
247
+ │ • Lifecycle │ │ • Model Router│
248
+ │ • Scheduling│ │ • Backend API │
249
+ └──────┬──────┘ └────────────────┘
250
+
251
+ ┌──────▼──────────────────────┐
252
+ │ Message Processor │
253
+ │ • Tool Registry │
254
+ │ • Command Extraction │
255
+ │ • Execution Engine │
256
+ └─────────────────────────────┘
257
+ ```
258
+
259
+ ### Key Components
260
+
261
+ - **Orchestrator**: Central coordination hub for all requests
262
+ - **Agent Pool**: Manages agent lifecycle, isolation, and communication
263
+ - **Message Processor**: Parses and executes tool commands from AI responses
264
+ - **AI Service**: Routes requests to appropriate AI backends
265
+ - **State Manager**: Persistent storage and session management
266
+ - **Tool Registry**: Extensible tool system with 18+ built-in tools
267
+
268
+ ---
269
+
270
+ ## 📖 Documentation
271
+
272
+ ### For Users
273
+
274
+ - **[Installation Guide](./INSTALLATION.md)** - Detailed installation and setup
275
+ - **[CLI Reference](./docs/CLI.md)** - Complete CLI command reference
276
+ - **[Tool Documentation](./docs/TOOLS.md)** - How to use each tool
277
+ - **[Configuration](./docs/CONFIGURATION.md)** - Environment variables and settings
278
+
279
+ ### For Developers
280
+
281
+ - **[Architecture Overview](./docs/ARCHITECTURE.md)** - System design and components
282
+ - **[API Reference](./docs/API.md)** - Backend API specification
283
+ - **[Creating Tools](./docs/CREATING_TOOLS.md)** - Build custom tools
284
+ - **[Contributing Guide](./CONTRIBUTING.md)** - How to contribute
285
+
286
+ ---
287
+
288
+ ## 🔐 Security & Privacy
289
+
290
+ ### Built-In Security Features
291
+
292
+ - ✅ **Agent Isolation** - Each agent has isolated workspace and permissions
293
+ - ✅ **Resource Limits** - Prevents resource exhaustion (CPU, memory, commands)
294
+ - ✅ **Path Validation** - Prevents directory traversal attacks
295
+ - ✅ **Command Sanitization** - Protects against command injection
296
+ - ✅ **Security Scanning** - Built-in vulnerability detection
297
+ - ✅ **Audit Logging** - Comprehensive activity logs
298
+
299
+ ### Privacy
300
+
301
+ - 🔐 **Authentication Only** - Only credential verification communicates with servers
302
+ - 🏠 **Local-First** - All work data stays on your machine
303
+ - 🔒 **No Usage Telemetry** - No tracking or analytics of your work
304
+ - 📝 **State Control** - Full control over conversation history
305
+ - 🗑️ **Easy Cleanup** - Delete state directory to remove all local data
306
+ - ✅ **Secure Communication** - Authentication data protected during transmission
307
+
308
+ ---
309
+
310
+ ## 🎯 Use Cases
311
+
312
+ ### Software Development
313
+
314
+ ```
315
+ ✓ Code refactoring and modernization
316
+ ✓ Dependency updates and conflict resolution
317
+ ✓ Test generation and debugging
318
+ ✓ Documentation generation
319
+ ✓ Code review automation
320
+ ```
321
+
322
+ ### Project Analysis
323
+
324
+ ```
325
+ ✓ Import/export dependency mapping
326
+ ✓ Circular dependency detection
327
+ ✓ Code duplication analysis
328
+ ✓ Security vulnerability scanning
329
+ ✓ Code quality assessment
330
+ ```
331
+
332
+ ### Automation
333
+
334
+ ```
335
+ ✓ Build and deployment scripts
336
+ ✓ Batch file operations
337
+ ✓ API testing and monitoring
338
+ ✓ Web scraping and data collection
339
+ ✓ Image generation workflows
340
+ ```
341
+
342
+ ---
343
+
344
+ ## 📊 Performance
345
+
346
+ ### Benchmarks
347
+
348
+ - **Agent Response Time**: < 2s for simple queries
349
+ - **Tool Execution**: < 100ms overhead per tool
350
+ - **Memory Usage**: ~150-300MB per agent
351
+ - **Concurrent Agents**: Up to 10 agents per instance
352
+ - **Message Processing**: 1000+ messages/second
353
+
354
+ ### Conversation Compaction
355
+
356
+ Loxia automatically compacts long conversations to stay within token limits:
357
+
358
+ - **Intelligent Summarization** - Preserves context while reducing tokens
359
+ - **Configurable Strategies** - Aggressive or balanced compaction
360
+ - **Index Tracking** - References original message ranges for retrieval
361
+
362
+ ---
363
+
364
+ ## 🛣️ Roadmap
365
+
366
+ ### Current Version (1.0.0)
367
+
368
+ - ✅ Multi-agent orchestration
369
+ - ✅ 18+ specialized tools
370
+ - ✅ Web UI + CLI interfaces
371
+ - ✅ Conversation compaction
372
+ - ✅ File attachments
373
+ - ✅ Task management
374
+
375
+ ### Upcoming Features
376
+
377
+ - 🔄 **VSCode Extension** - Native IDE integration
378
+ - 🔄 **Plugin System** - Custom tool marketplace
379
+ - 🔄 **Team Features** - Shared agents and workspaces
380
+ - 🔄 **Cloud Sync** - Optional cloud backup (opt-in)
381
+ - 🔄 **Voice Interface** - Speech-to-text integration
382
+
383
+ ---
384
+
385
+ ## 🤝 Contributing
386
+
387
+ We welcome contributions! Here's how you can help:
388
+
389
+ ### Ways to Contribute
390
+
391
+ - 🐛 **Report Bugs** - Open an issue with reproduction steps
392
+ - 💡 **Suggest Features** - Share ideas for improvements
393
+ - 📝 **Improve Documentation** - Fix typos, add examples
394
+ - 🔧 **Build Tools** - Create new tools for the ecosystem
395
+ - 🎨 **UI/UX** - Enhance the Web interface
396
+
397
+ ### Development Setup
398
+
399
+ ```bash
400
+ # Clone the repository
401
+ git clone https://github.com/loxia-ai/autopilot-cli-v10.git
402
+ cd autopilot-cli-v10
403
+
404
+ # Install dependencies
405
+ npm install
406
+
407
+ # Build Web UI
408
+ cd web-ui && npm install && npm run build && cd ..
409
+
410
+ # Start in development mode
411
+ npm run dev
412
+ ```
413
+
414
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
415
+
416
+ ---
417
+
418
+ ## 📜 License
419
+
420
+ **Commercial License** - see [LICENSE](./LICENSE) file for complete terms.
421
+
422
+ ### Key Terms
423
+
424
+ - 🔐 **Authentication Required** - Valid subscription or license needed to use
425
+ - ✅ **Commercial Use** - Use in your own projects and services (with active subscription)
426
+ - ✅ **Modify Configuration** - Customize settings and configuration files
427
+ - ❌ **No Free Use** - Requires active subscription or valid license
428
+ - ❌ **No Credential Sharing** - Personal credentials cannot be shared
429
+ - ❌ **No Redistribution** - Cannot resell, redistribute, or sublicense
430
+ - ❌ **No Reverse Engineering** - Code is obfuscated and protected
431
+ - ❌ **No Derivative Products** - Cannot create competing products
432
+
433
+ ### Subscription & Access
434
+
435
+ - **Registration**: Sign up at [loxia.ai/register](https://loxia.ai/register)
436
+ - **Authentication**: Software requires valid credentials to operate
437
+ - **Verification**: Periodic authentication checks with licensing server
438
+ - **Expiration**: Access ends when subscription expires (renewable)
439
+
440
+ **Copyright © 2025 Loxia AI. All rights reserved.**
441
+
442
+ By installing or using this software, you agree to the terms of the [LICENSE](./LICENSE).
443
+
444
+ ---
445
+
446
+ ## 🆘 Support
447
+
448
+ ### Getting Help
449
+
450
+ - 📖 **Documentation**: Check the [docs](./docs/) directory
451
+ - 💬 **Discussions**: [GitHub Discussions](https://github.com/loxia-ai/autopilot-cli-v10/discussions)
452
+ - 🐛 **Bug Reports**: [GitHub Issues](https://github.com/loxia-ai/autopilot-cli-v10/issues)
453
+ - 📧 **Email**: support@loxia.ai
454
+
455
+ ### Troubleshooting
456
+
457
+ **Web UI won't start?**
458
+ ```bash
459
+ # Check if port is in use
460
+ lsof -i :8080
461
+
462
+ # Use a different port
463
+ loxia --port 3000
464
+ ```
465
+
466
+ **Agent not responding?**
467
+ ```bash
468
+ # Check logs
469
+ cat .loxia-state/logs/system.log
470
+
471
+ # Restart with debug logging
472
+ LOXIA_LOG_LEVEL=debug loxia
473
+ ```
474
+
475
+ **Installation issues?**
476
+ ```bash
477
+ # Clear npm cache
478
+ npm cache clean --force
479
+
480
+ # Reinstall
481
+ npm install -g loxia-autopilot-one --force
482
+ ```
483
+
484
+ ---
485
+
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
+ <div align="center">
502
+
503
+ **Made with ❤️ by the Loxia team**
504
+
505
+ [Website](https://loxia.ai) • [Twitter](https://twitter.com/loxia_ai) • [Discord](https://discord.gg/loxia)
506
+
507
+ ⭐ **Star us on GitHub** if you find this project useful!
508
+
509
+ </div>
package/bin/cli.js ADDED
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
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
+ });