abm1click-openclaw 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +163 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1788 -0
- package/dist/pages/dashboard.html +991 -0
- package/dist/pages/error.html +164 -0
- package/dist/pages/success.html +143 -0
- package/dist/pages/waiting.html +127 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ABM — AI Business Master (https://abmedu.vn)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# OneClick OpenClaw Launcher
|
|
2
|
+
|
|
3
|
+
> **1 lệnh duy nhất** để cài đặt và cấu hình 9Router + OpenClaw — từ zero đến production-ready.
|
|
4
|
+
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](./test)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://nodejs.org/)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚡ Quick Start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Cài đặt toàn bộ (1 lệnh)
|
|
16
|
+
npx oneclick-openclaw install
|
|
17
|
+
|
|
18
|
+
# Hoặc global install
|
|
19
|
+
npm install -g oneclick-openclaw
|
|
20
|
+
oneclick-openclaw install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Chỉ cần 1 lệnh — hệ thống sẽ tự động:
|
|
24
|
+
1. Kiểm tra môi trường (Node, npm, ports)
|
|
25
|
+
2. Cài đặt & khởi động 9Router gateway
|
|
26
|
+
3. Xác thực Google OAuth
|
|
27
|
+
4. Cấu hình OpenClaw CLI
|
|
28
|
+
5. Chạy smoke test end-to-end
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 📋 CLI Commands
|
|
33
|
+
|
|
34
|
+
| Lệnh | Mô tả |
|
|
35
|
+
|-------|--------|
|
|
36
|
+
| `oneclick-openclaw install` | Cài đặt đầy đủ 14-step pipeline |
|
|
37
|
+
| `oneclick-openclaw resume` | Tiếp tục từ checkpoint (sau lỗi) |
|
|
38
|
+
| `oneclick-openclaw doctor` | Kiểm tra sức khỏe hệ thống |
|
|
39
|
+
| `oneclick-openclaw dashboard` | Mở web dashboard (port 20199) |
|
|
40
|
+
| `oneclick-openclaw auth google` | Xác thực lại Google OAuth |
|
|
41
|
+
| `oneclick-openclaw logs` | Xem log cài đặt |
|
|
42
|
+
| `oneclick-openclaw reset` | Xóa toàn bộ state, bắt đầu lại |
|
|
43
|
+
| `oneclick-openclaw uninstall` | Gỡ cài đặt hoàn toàn |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 🏗️ Architecture
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
┌──────────────────────┐
|
|
51
|
+
│ CLI (Commander.js) │
|
|
52
|
+
│ 8 commands │
|
|
53
|
+
└──────────┬───────────┘
|
|
54
|
+
│
|
|
55
|
+
┌──────────▼───────────┐
|
|
56
|
+
│ State Machine │
|
|
57
|
+
│ 14 steps │
|
|
58
|
+
│ Idempotent │
|
|
59
|
+
│ Resumable │
|
|
60
|
+
└──────────┬───────────┘
|
|
61
|
+
│
|
|
62
|
+
┌────────────────┼────────────────┐
|
|
63
|
+
│ │ │
|
|
64
|
+
┌─────────▼──────┐ ┌──────▼───────┐ ┌──────▼───────┐
|
|
65
|
+
│ 9Router │ │ OpenClaw │ │ Config │
|
|
66
|
+
│ Adapter │ │ Adapter │ │ Adapter │
|
|
67
|
+
│ (Gateway API) │ │ (CLI tool) │ │ (JSON merge)│
|
|
68
|
+
└────────────────┘ └──────────────┘ └──────────────┘
|
|
69
|
+
|
|
70
|
+
┌────────────────────────────────────────────────────┐
|
|
71
|
+
│ Web Dashboard (ABMedu Style) │
|
|
72
|
+
│ Real-time state | Service monitor | Pipeline view │
|
|
73
|
+
└────────────────────────────────────────────────────┘
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🎨 Dashboard
|
|
79
|
+
|
|
80
|
+
Web dashboard tại `http://127.0.0.1:20199/dashboard`:
|
|
81
|
+
|
|
82
|
+
- **Hero section**: Tổng quan hệ thống
|
|
83
|
+
- **4 stat cards**: 9Router, OpenClaw, Auth, Smoke Test
|
|
84
|
+
- **Service Monitor**: Trạng thái dịch vụ real-time
|
|
85
|
+
- **Install Pipeline**: 14-step progress tracker
|
|
86
|
+
- **Quick Actions**: 6 nút hành động nhanh
|
|
87
|
+
- **Auto-refresh**: Cập nhật mỗi 5 giây
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
oneclick-openclaw dashboard
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 🔧 Development
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Install dependencies
|
|
99
|
+
npm install
|
|
100
|
+
|
|
101
|
+
# Type check
|
|
102
|
+
npm run lint
|
|
103
|
+
|
|
104
|
+
# Run tests
|
|
105
|
+
npm test
|
|
106
|
+
|
|
107
|
+
# Development mode
|
|
108
|
+
npm run dev -- install
|
|
109
|
+
|
|
110
|
+
# Production build
|
|
111
|
+
npm run build
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Project Structure
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
src/
|
|
118
|
+
├── cli.ts # CLI entrypoint (8 commands)
|
|
119
|
+
├── constants.ts # Configuration constants
|
|
120
|
+
├── types/contracts.ts # TypeScript interfaces
|
|
121
|
+
├── adapters/ # External system adapters
|
|
122
|
+
│ ├── nineRouterAdapter.ts
|
|
123
|
+
│ ├── openClawAdapter.ts
|
|
124
|
+
│ └── configAdapter.ts
|
|
125
|
+
├── state/ # State machine + persistence
|
|
126
|
+
│ ├── machine.ts
|
|
127
|
+
│ ├── store.ts
|
|
128
|
+
│ └── transitions.ts
|
|
129
|
+
├── steps/ # 14 step handlers
|
|
130
|
+
├── process/ # Process management (spawn, ports, health)
|
|
131
|
+
├── utils/ # Utilities (logger, retry, fs, crypto)
|
|
132
|
+
└── web/ # Dashboard + auth pages
|
|
133
|
+
├── server.ts
|
|
134
|
+
└── pages/ (4 HTML files)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🔒 Security
|
|
140
|
+
|
|
141
|
+
- **API key encryption**: AES-256-GCM trong state file
|
|
142
|
+
- **Secret redaction**: Tự động ẩn keys trong logs
|
|
143
|
+
- **Local-only server**: Bind `127.0.0.1` (không expose)
|
|
144
|
+
- **Atomic writes**: State file không bị corrupt
|
|
145
|
+
- **Backup trước patch**: Config backup tự động
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🩺 Troubleshooting
|
|
150
|
+
|
|
151
|
+
| Vấn đề | Giải pháp |
|
|
152
|
+
|---------|-----------|
|
|
153
|
+
| Port 20128 đã dùng | `oneclick-openclaw reset` rồi thử lại |
|
|
154
|
+
| OAuth timeout | `oneclick-openclaw auth google` |
|
|
155
|
+
| Config sai | `oneclick-openclaw doctor` để kiểm tra |
|
|
156
|
+
| Muốn làm lại | `oneclick-openclaw reset && oneclick-openclaw install` |
|
|
157
|
+
| Xem chi tiết lỗi | `oneclick-openclaw logs` |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 📄 License
|
|
162
|
+
|
|
163
|
+
MIT © [ABM — AI Business Master](https://abmedu.vn)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|