create-openclaw-bot 5.4.2 → 5.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog (English)
2
2
 
3
+ ## [5.5.0] — 2026-04-15
4
+
5
+ ### 📄 Scaffold-Based Workspace Docs & OpenClaw 2026.4.14
6
+
7
+ - **Scaffold-based generation** — Both Wizard and CLI now call shared scaffold builders from `scaffold-gen.js` instead of inline code, ensuring consistent workspace doc generation across all platforms and modes.
8
+ - **Modular workspace docs** — Multi-bot (Telegram relay) deployments now generate `TEAM.md` (team roster & coordination rules) and `RELAY.md` (relay playbook) as separate files. Single-bot deployments do not create these files.
9
+ - **Full security rules everywhere** — All generated `AGENTS.md` files now include the complete 4-section security ruleset (File System, API Key, Crypto Wallet, Docker) regardless of OS, deployment mode, or channel type.
10
+ - **Removed `.yaml` agent file generation** — OpenClaw Core reads configuration exclusively from `openclaw.json → agents.list`. Orphaned `.yaml` agent files are no longer generated by any flow.
11
+ - **Anti-hallucination handoff rules** — Relay-variant `AGENTS.md` now mandates tool-first `react` actions (👍 for every incoming message) and explicitly forbids LLM refusal of cross-agent handoffs.
12
+ - **OpenClaw bumped to 2026.4.14** — Includes the new experimental Dreaming memory consolidation system, active-memory recall improvements, Telegram approval button deadlock fix, WebSocket keepalive stability, and idempotency key fix for dreaming narrative jobs.
13
+
3
14
 
4
15
  ## [5.4.2] — 2026-04-14
5
16
 
package/CHANGELOG.vi.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog (Tiếng Việt)
2
2
 
3
+ ## [5.5.0] — 2026-04-15
4
+
5
+ ### 📄 Tái Cấu Trúc Workspace Docs & OpenClaw 2026.4.14
6
+
7
+ - **Scaffold-based generation** — Cả Wizard lẫn CLI giờ gọi chung scaffold builders từ `scaffold-gen.js` thay vì viết inline, đảm bảo workspace docs đồng nhất trên mọi nền tảng và chế độ cài đặt.
8
+ - **Tách file workspace docs** — Triển khai multi-bot (Telegram relay) giờ sinh `TEAM.md` (roster đội + quy tắc phối hợp) và `RELAY.md` (sổ tay chuyển tiếp) thành file riêng. Single-bot không tạo các file này.
9
+ - **Quy tắc bảo mật đầy đủ mọi nơi** — Tất cả `AGENTS.md` giờ có đủ 4 section bảo mật (File hệ thống, API Key, Ví Crypto, Docker) bất kể OS, chế độ cài đặt hay kênh chat.
10
+ - **Xóa file `.yaml` agent** — OpenClaw Core chỉ đọc config từ `openclaw.json → agents.list`. File `.yaml` orphan không còn được sinh ra.
11
+ - **Chống ảo giác handoff** — `AGENTS.md` variant relay bắt buộc `react` action (👍 mỗi tin nhắn đến) và cấm từ chối chuyển tiếp giữa các agent.
12
+ - **Nâng OpenClaw lên 2026.4.14** — Bao gồm hệ thống Dreaming (thử nghiệm), cải thiện active-memory, sửa deadlock nút approve Telegram, ổn định WebSocket keepalive.
13
+
3
14
 
4
15
  ## [5.4.2] — 2026-04-14
5
16
 
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # 🦞 OpenClaw Setup
4
4
 
5
5
  <p align="center">
6
- <a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.4.2-0EA5E9?style=for-the-badge" alt="Version 5.4.2" /></a>
6
+ <a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.5.0-0EA5E9?style=for-the-badge" alt="Version 5.5.0" /></a>
7
7
  <a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
8
8
  <a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
9
9
  <a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
@@ -24,21 +24,23 @@ An interactive **CLI tool** and **Setup Wizard** to deploy your own free AI Bot
24
24
 
25
25
  ---
26
26
 
27
- ## 🆕 What's new in v5.4.2
27
+ ## 🆕 What's new in v5.5.0
28
+
29
+ - 📦 **OpenClaw 2026.4.14** — Bumped from 2026.4.5. Includes the new experimental Dreaming memory system, active-memory improvements, Telegram approval button deadlock fix, and WebSocket keepalive stability.
30
+ - 📄 **Modular workspace docs** — Multi-bot deployments now generate `TEAM.md` (team roster & coordination) and `RELAY.md` (relay playbook) as separate files, giving clearer separation of concerns.
31
+ - 🔐 **Full security rules everywhere** — All `AGENTS.md` files now include the complete 4-section security ruleset (File System, API Key, Crypto Wallet, Docker) regardless of OS, mode, or channel.
32
+ - 🗑️ **Removed `.yaml` agent files** — OpenClaw Core reads config exclusively from `openclaw.json`. Orphaned `.yaml` files are no longer generated.
33
+ - 🤖 **Anti-hallucination handoff** — Relay-variant `AGENTS.md` now mandates tool-first `react` actions and forbids LLM refusal of cross-agent handoffs.
34
+ - 🏗️ **Scaffold-based generation** — Both Wizard and CLI now call shared scaffold builders from `scaffold-gen.js`, ensuring consistent doc generation across all platforms.
35
+
36
+ <details>
37
+ <summary><b>Previous: What's new in v5.5.0</b></summary>
28
38
 
29
39
  - 🏗️ **Multi-bot architecture refactored** — All duplicate flags (`isTelegramMultiBot`, `isSharedMultiBot`, `isMultiBotWizard`) merged into a single `isMultiBot`. Generated `agentDir` paths now correctly point to `.openclaw/agents/{slug}/agent` relative to `OPENCLAW_HOME`.
30
40
  - 🗑️ **Telegram + Zalo combo channel removed** — Combo mode has been deprecated and removed from both the Web Wizard and CLI. It will be redesigned in a future release.
31
41
  - 🤝 **Cross-workspace rules in `AGENTS.md`** — In multi-bot mode, each bot's `AGENTS.md` now includes a dedicated section describing which sibling workspace paths may be read and what write restrictions apply.
32
42
  - 🧹 **Cleaner config generation** — Per-agent `auth-profiles.json` is no longer created for 9Router/proxy setups. Native scripts no longer generate `.env` files; credentials are managed via `openclaw channels login`.
33
43
 
34
- <details>
35
- <summary><b>Previous: What's new in v5.3.5</b></summary>
36
-
37
- - 🐛 **Fix: Telegram token input missing in combo channel** — When selecting "Telegram + Zalo Personal", the wizard now shows the Telegram Bot Token input field AND the Zalo Personal warning side by side.
38
- - 🐛 **Fix: Next button stuck on step 4 for combo** — Validation now correctly requires a Telegram token before enabling "Generate Configs" in combo mode.
39
- - 🐛 **Fix: Windows Docker script crashes with "docker not recognized"** — The generated `.ps1` now uses `Get-Command` to locate Docker, checks that Docker Desktop is running, and calls it via `&` operator — works even when Docker isn't in the default PowerShell PATH.
40
- - 🐛 **Fix: Zalo QR login instructions missing for combo in Windows script** — Post-install notes now show the `docker compose exec` login command when the combo channel is selected.
41
-
42
44
  </details>
43
45
 
44
46
  ---
package/README.vi.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # 🦞 OpenClaw Setup
4
4
 
5
5
  <p align="center">
6
- <a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.4.2-0EA5E9?style=for-the-badge" alt="Version 5.4.2" /></a>
6
+ <a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.5.0-0EA5E9?style=for-the-badge" alt="Version 5.5.0" /></a>
7
7
  <a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
8
8
  <a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
9
9
  <a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
@@ -24,21 +24,23 @@ Công cụ **CLI tương tác** và **Setup Wizard** để tự triển khai Bot
24
24
 
25
25
  ---
26
26
 
27
- ## 🆕 Có gì mới trong v5.4.2
27
+ ## 🆕 Có gì mới trong v5.5.0
28
+
29
+ - 📦 **OpenClaw 2026.4.14** — Nâng từ 2026.4.5. Bao gồm hệ thống Dreaming (thử nghiệm), cải thiện active-memory, sửa deadlock nút approve Telegram, ổn định WebSocket keepalive.
30
+ - 📄 **Tách file workspace docs** — Multi-bot giờ sinh `TEAM.md` (roster đội + phối hợp) và `RELAY.md` (sổ tay chuyển tiếp) thành file riêng, rõ ràng hơn.
31
+ - 🔐 **Quy tắc bảo mật đầy đủ mọi nơi** — Tất cả `AGENTS.md` giờ có đủ 4 section bảo mật (File hệ thống, API Key, Ví Crypto, Docker) bất kể OS, mode hay kênh.
32
+ - 🗑️ **Xóa file `.yaml` agent** — OpenClaw Core chỉ đọc từ `openclaw.json`. File `.yaml` orphan không còn được sinh ra.
33
+ - 🤖 **Chống ảo giác handoff** — `AGENTS.md` relay bắt buộc `react` action và cấm từ chối chuyển tiếp giữa các agent.
34
+ - 🏗️ **Scaffold-based generation** — Cả Wizard lẫn CLI gọi chung scaffold builders, đồng nhất trên mọi platform.
35
+
36
+ <details>
37
+ <summary><b>Trước đó: Có gì mới ở v5.5.0</b></summary>
28
38
 
29
39
  - 🏗️ **Tái cấu trúc kiến trúc multi-bot** — Các flag `isTelegramMultiBot`, `isSharedMultiBot`, `isMultiBotWizard` được gộp thành một biến `isMultiBot` duy nhất. Đường dẫn `agentDir` trong `openclaw.json` được tạo ra nay đúng chuẩn `.openclaw/agents/{slug}/agent` (tương đối với `OPENCLAW_HOME`).
30
40
  - 🗑️ **Xóa hoàn toàn kênh combo Telegram + Zalo** — Combo mode đã được gỡ bỏ khỏi cả Web Wizard lẫn CLI. Sẽ được thiết kế lại trong bản phát hành sau.
31
41
  - 🤝 **Quy tắc cross-workspace trong `AGENTS.md`** — Ở chế độ multi-bot, `AGENTS.md` của mỗi bot có thêm mục liệt kê đường dẫn workspace của các bot anh em và quy tắc phối hợp.
32
42
  - 🧹 **Config sạch hơn** — Không còn tạo `auth-profiles.json` per-agent cho 9Router; không còn tạo `.env` cho native scripts; không còn tạo `models.json` per-agent cho Ollama.
33
43
 
34
- <details>
35
- <summary><b>Trước đó: Có gì mới ở v5.3.5</b></summary>
36
-
37
- - 🐛 **Fix: Lỗi Syntax MEMORY.md trong Workspace Zalo** — Patch TOOLS.md trước đó được chèn sai vị trí, gây `SyntaxError` trên `setup.js`. Đã sửa.
38
- - 🐟 **Cải tiến: Script gỡ cài đặt nằm trong thư mục project** — Tất cả 4 OS native + Docker ZIP đều có `uninstall-*.{bat,sh}` ngay trong thư mục project sau khi setup xong.
39
- - 🐛 **Fix: Windows Docker script crashes với "docker not recognized"** — File `.ps1` được tạo giờ dùng `Get-Command` để tìm Docker, kiểm tra Docker Desktop đang chạy, và gọi lệnh qua toán tử `&` — hoạt động kể cả khi Docker không có trong PATH mặc định của PowerShell.
40
- - 🐛 **Fix: Thiếu hướng dẫn login Zalo QR cho combo trong script Windows** — Phần hướng dẫn sau cài đặt giờ hiển thị lệnh `docker compose exec` login khi chọn combo channel.
41
-
42
44
  </details>
43
45
 
44
46
  ---
@@ -111,7 +113,7 @@ Chạy trong terminal → làm theo hướng dẫn → script khởi động đ
111
113
  2. Mở repo này làm workspace
112
114
  3. Paste vào chat:
113
115
  ```
114
- Đọc SETUP.md và cài đặt OpenClaw v5.4.2 cho tôi.
116
+ Đọc SETUP.md và cài đặt OpenClaw v5.5.0 cho tôi.
115
117
  Bot token của tôi là X. Dùng 9Router (không cần API key).
116
118
  Thư mục project: <ĐƯỜNG_DẪN_CỦA_BẠN>
117
119
  ```
package/old_v510.js ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-openclaw-bot",
3
- "version": "5.4.2",
3
+ "version": "5.5.0",
4
4
  "description": "Interactive CLI installer for OpenClaw Bot",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -0,0 +1,164 @@
1
+ // @ts-nocheck
2
+ /* eslint-disable no-undef, no-unused-vars */
3
+ /**
4
+ * @fileoverview Part of the OpenClaw Setup Wizard IIFE bundle.
5
+ * This file is concatenated (not imported) — globals are shared via setup.js IIFE scope.
6
+ * Do NOT add import/export statements. Edit, then run: node build.mjs
7
+ *
8
+ * @global {object} state - Wizard UI state
9
+ * @global {object} PROVIDERS - AI provider registry
10
+ * @global {Array} SKILLS - Available skills
11
+ * @global {Array} PLUGINS - Available plugins
12
+ * @global {object} CHANNELS - Channel definitions
13
+ * @global {boolean} isVi - Vietnamese language mode
14
+ * @global {object} provider - Current primary provider config
15
+ * @global {boolean} isMultiBot - Multi-bot mode flag
16
+ * @global {boolean} hasBrowser - Browser plugin selected
17
+ * @global {boolean} is9Router - 9Router proxy mode
18
+ * @global {string} projectDir - Output project directory path
19
+ * @global {Function} getGatewayAllowedOrigins
20
+ */
21
+ // ========== Channel definitions ==========
22
+ const CHANNELS = {
23
+ telegram: {
24
+ name: 'Telegram',
25
+ envKeys: [],
26
+ envExtra: 'TELEGRAM_BOT_TOKEN=<your_bot_token>',
27
+ credSteps: [
28
+ { textVi: 'Mở Telegram → tìm <a href="https://t.me/BotFather" target="_blank">@BotFather</a> → gửi <code>/newbot</code> → đặt tên bot → copy token', textEn: 'Open Telegram → find <a href="https://t.me/BotFather" target="_blank">@BotFather</a> → send <code>/newbot</code> → name bot → copy token' },
29
+ ],
30
+ channelConfig: {
31
+ telegram: {
32
+ enabled: true,
33
+ dmPolicy: 'open',
34
+ allowFrom: ['*'],
35
+ groupPolicy: 'allowlist',
36
+ streaming: 'partial',
37
+ },
38
+ },
39
+ pluginInstall: '',
40
+ },
41
+ 'zalo-bot': {
42
+ name: 'Zalo Bot API',
43
+ envKeys: [],
44
+ envExtra: 'ZALO_BOT_TOKEN=<your_zalo_bot_token>',
45
+ credSteps: [
46
+ { textVi: '<span style="color: #fbbf24; font-weight: 500;">⚠️ LƯU Ý: Bot OA Zalo đòi hỏi bạn phải thiết lập Webhook Public (qua VPS/ngrok có HTTPS). Hãy cân nhắc dùng Zalo Personal nếu bạn chưa có Webhook.</span>', textEn: '<span style="color: #fbbf24; font-weight: 500;">⚠️ NOTE: Zalo OA Bot requires setting up a Public Webhook (using VPS/ngrok with HTTPS). Consider using Zalo Personal if you do not have a webhook.</span>' },
47
+ { textVi: 'Vào <a href="https://developers.zalo.me" target="_blank">Zalo Bot Platform</a> → Tạo bot mới → copy Bot Token', textEn: 'Go to <a href="https://developers.zalo.me" target="_blank">Zalo Bot Platform</a> → Create new bot → copy Bot Token' },
48
+ ],
49
+ channelConfig: {
50
+ zalo: {
51
+ enabled: true,
52
+ },
53
+ },
54
+ pluginInstall: '',
55
+ },
56
+ // 'telegram+zalo-personal' — Combo mode tạm ngưng, nghiên cứu thêm.
57
+ 'zalo-personal': {
58
+ name: 'Zalo Personal',
59
+ envKeys: [],
60
+ envExtra: '',
61
+ credSteps: [
62
+ { textVi: '⚠️ Zalo Personal dùng <strong>unofficial API (zca-js)</strong> — chỉ nên dùng tài khoản phụ', textEn: '⚠️ Zalo Personal uses <strong>unofficial API (zca-js)</strong> — use an alternate account' },
63
+ { textVi: 'Native setup sẽ tự chạy login và copy QR về thư mục project. Nếu cần chạy lại thủ công, dùng <code>openclaw channels login --channel zalouser --verbose</code>.', textEn: 'Native setup now auto-runs the login flow and copies the QR into the project folder. If needed, rerun it manually with <code>openclaw channels login --channel zalouser --verbose</code>.' },
64
+ ],
65
+ channelConfig: {
66
+ zalouser: {
67
+ enabled: true,
68
+ accounts: {
69
+ default: {
70
+ dmPolicy: 'open',
71
+ allowFrom: ['*'],
72
+ groupPolicy: 'allowlist',
73
+ },
74
+ },
75
+ dmPolicy: 'open',
76
+ groupPolicy: 'allowlist',
77
+ },
78
+ },
79
+ pluginInstall: '@openclaw/zalouser',
80
+ },
81
+ };
82
+
83
+ // ========== Default system prompts ==========
84
+ const DEFAULT_PROMPTS = {
85
+ vi: `Bạn là {BOT_NAME}, {BOT_DESC}.
86
+
87
+ ## Tính cách
88
+ - Thân thiện, hữu ích
89
+ - Trả lời bằng tiếng Việt
90
+ - Giọng văn tự nhiên, gần gũi
91
+
92
+ ## Quy tắc
93
+ - Trả lời ngắn gọn, súc tích
94
+ - Hỏi lại khi chưa rõ yêu cầu`,
95
+ en: `You are {BOT_NAME}, {BOT_DESC}.
96
+
97
+ ## Personality
98
+ - Friendly and helpful
99
+ - Reply in English
100
+ - Natural, conversational tone
101
+
102
+ ## Rules
103
+ - Keep answers concise
104
+ - Ask for clarification when needed`,
105
+ };
106
+
107
+ // ========== Default Security Rules ==========
108
+ const DEFAULT_SECURITY_RULES = {
109
+ vi: `## 🔐 Quy Tắc Bảo Mật — BẮT BUỘC
110
+
111
+ ### File & thư mục hệ thống
112
+ - ❌ KHÔNG đọc, sao chép, hoặc truy cập bất kỳ file nào ngoài thư mục project
113
+ - ❌ KHÔNG quét hoặc liệt kê các thư mục hệ thống: Documents, Desktop, Downloads, AppData
114
+ - ❌ KHÔNG truy cập registry, system32, hoặc Program Files
115
+ - ❌ KHÔNG cài đặt phần mềm, driver, hoặc service ngoài Docker
116
+ - ✅ CHỈ làm việc trong thư mục project
117
+
118
+ ### API key & credentials
119
+ - ❌ KHÔNG BAO GIỜ hiển thị API key, token, hoặc mật khẩu trong chat
120
+ - ❌ KHÔNG viết API key trực tiếp vào mã nguồn
121
+ - ❌ KHÔNG commit file credentials lên Git
122
+ - ✅ LUÔN lưu credentials trong file .env riêng
123
+ - ✅ LUÔN dùng biến môi trường thay vì hardcode
124
+
125
+ ### Ví crypto & tài sản số
126
+ - ❌ TUYỆT ĐỐI KHÔNG truy cập, đọc, hoặc quét các thư mục ví crypto
127
+ - ❌ KHÔNG quét clipboard (có thể chứa seed phrases)
128
+ - ❌ KHÔNG truy cập browser profile, cookie, hoặc mật khẩu đã lưu
129
+ - ❌ KHÔNG cài đặt npm package lạ (chỉ openclaw và plugin chính thức)
130
+
131
+ ### Docker
132
+ - ✅ Chỉ mount đúng thư mục cần thiết (config + workspace)
133
+ - ❌ KHÔNG mount nguyên ổ đĩa (C:/ hoặc D:/)
134
+ - ❌ KHÔNG chạy container với --privileged
135
+ - ✅ Giới hạn port expose (chỉ 38789)`,
136
+ en: `## 🔐 Security Rules — MANDATORY
137
+
138
+ ### System files & directories
139
+ - ❌ DO NOT read, copy, or access any file outside the project folder
140
+ - ❌ DO NOT scan or list system directories: Documents, Desktop, Downloads, AppData
141
+ - ❌ DO NOT access the registry, system32, or Program Files
142
+ - ❌ DO NOT install software, drivers, or services outside Docker
143
+ - ✅ ONLY work within the project folder
144
+
145
+ ### API keys & credentials
146
+ - ❌ NEVER display API keys, tokens, or passwords in chat
147
+ - ❌ DO NOT write API keys directly into source code
148
+ - ❌ DO NOT commit credential files to Git
149
+ - ✅ ALWAYS store credentials in a separate .env file
150
+ - ✅ ALWAYS use environment variables instead of hardcoding
151
+
152
+ ### Crypto wallets & digital assets
153
+ - ❌ ABSOLUTELY DO NOT access, read, or scan crypto wallet directories
154
+ - ❌ DO NOT scan the clipboard (may contain seed phrases)
155
+ - ❌ DO NOT access browser profiles, cookies, or saved passwords
156
+ - ❌ DO NOT install unknown npm packages (only openclaw and official plugins)
157
+
158
+ ### Docker
159
+ - ✅ Only mount required directories (config + workspace)
160
+ - ❌ DO NOT mount entire drives (C:/ or D:/)
161
+ - ❌ DO NOT run containers with --privileged
162
+ - ✅ Limit exposed ports (only 38789)`,
163
+ };
164
+
@@ -0,0 +1,80 @@
1
+ // @ts-nocheck
2
+ /* eslint-disable no-undef, no-unused-vars */
3
+ /**
4
+ * @fileoverview Part of the OpenClaw Setup Wizard IIFE bundle.
5
+ * This file is concatenated (not imported) — globals are shared via setup.js IIFE scope.
6
+ * Do NOT add import/export statements. Edit, then run: node build.mjs
7
+ *
8
+ * @global {object} state - Wizard UI state
9
+ * @global {object} PROVIDERS - AI provider registry
10
+ * @global {Array} SKILLS - Available skills
11
+ * @global {Array} PLUGINS - Available plugins
12
+ * @global {object} CHANNELS - Channel definitions
13
+ * @global {boolean} isVi - Vietnamese language mode
14
+ * @global {object} provider - Current primary provider config
15
+ * @global {boolean} isMultiBot - Multi-bot mode flag
16
+ * @global {boolean} hasBrowser - Browser plugin selected
17
+ * @global {boolean} is9Router - 9Router proxy mode
18
+ * @global {string} projectDir - Output project directory path
19
+ * @global {Function} getGatewayAllowedOrigins
20
+ */
21
+ // ========== CDN Logo URLs (thesvg.org) ==========
22
+ const SVG_CDN = 'https://thesvg.org/icons';
23
+ const LOGO = {
24
+ gemini: `${SVG_CDN}/google-gemini/default.svg`,
25
+ anthropic: `${SVG_CDN}/anthropic/light.svg`,
26
+ openai: `${SVG_CDN}/openai/light.svg`,
27
+ openrouter: `${SVG_CDN}/openrouter/light.svg`,
28
+ ollama: `${SVG_CDN}/ollama/light.svg`,
29
+ '9router': null, // Uses emoji icon 🔀 instead of SVG
30
+ };
31
+
32
+ // Language flag icons (inline SVG circles with flag colors)
33
+ const FLAG_ICONS = {
34
+ vi: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#DA251D"/><polygon points="10,4 11.5,8.5 16,8.5 12.3,11.2 13.8,15.7 10,13 6.2,15.7 7.7,11.2 4,8.5 8.5,8.5" fill="#FFFF00"/></svg>`,
35
+ en: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#012169"/><path d="M0 0L20 20M20 0L0 20" stroke="white" stroke-width="3"/><path d="M0 0L20 20M20 0L0 20" stroke="#C8102E" stroke-width="1.5"/><path d="M10 0V20M0 10H20" stroke="white" stroke-width="5"/><path d="M10 0V20M0 10H20" stroke="#C8102E" stroke-width="3"/></svg>`,
36
+ };
37
+
38
+ // ========== State ==========
39
+ const state = {
40
+ currentStep: 1,
41
+ totalSteps: 5,
42
+ channel: null,
43
+ deployMode: 'docker', // 'docker' | 'native'
44
+ nativeOs: 'win', // 'win' | 'linux' | 'vps' | 'linux-desktop'
45
+ config: {
46
+ botName: '',
47
+ description: '',
48
+ emoji: '🤖',
49
+ provider: 'google',
50
+ model: 'google/gemini-2.5-flash',
51
+ language: 'vi',
52
+ systemPrompt: '',
53
+ userInfo: '',
54
+ securityRules: '',
55
+ plugins: [],
56
+ skills: [],
57
+ // Persisted credential inputs (Bug 1+2 fix)
58
+ botToken: '',
59
+ apiKey: '',
60
+ projectPath: '',
61
+ },
62
+ };
63
+
64
+ // Runtime packages installed alongside openclaw in native and Docker flows.
65
+ const openClawRuntimePackages = globalThis.__openclawCommon?.OPENCLAW_RUNTIME_PACKAGES
66
+ || 'grammy @grammyjs/runner @grammyjs/transformer-throttler @buape/carbon @larksuiteoapi/node-sdk @slack/web-api';
67
+
68
+ function getGatewayAllowedOrigins(port) {
69
+ const normalizedPort = Number(port) || 18791;
70
+ const origins = new Set([
71
+ `http://localhost:${normalizedPort}`,
72
+ `http://127.0.0.1:${normalizedPort}`,
73
+ `http://0.0.0.0:${normalizedPort}`,
74
+ ]);
75
+ const currentHost = (window.location && window.location.hostname) ? window.location.hostname.trim() : '';
76
+ if (currentHost) {
77
+ origins.add(`http://${currentHost}:${normalizedPort}`);
78
+ }
79
+ return Array.from(origins);
80
+ }
@@ -0,0 +1,73 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * setup/data/index.js — Shared data for CLI + Wizard
4
+ *
5
+ * Provides CLI-compatible views of PROVIDERS, SKILLS, CHANNELS, and OLLAMA_MODELS.
6
+ * The wizard uses these via IIFE concatenation (providers.js, skills.js, channels.js).
7
+ * The CLI imports this file directly via createRequire.
8
+ *
9
+ * Structure deliberately kept flat & forward-compatible:
10
+ * - PROVIDERS: { [key]: { name, icon, envKey?, isProxy?, isLocal? } }
11
+ * - SKILLS: [{ value, name, slug? }]
12
+ * - CHANNELS: { [key]: { name, type, icon } }
13
+ * - OLLAMA_MODELS: [{ id, name, reasoning, input, cost, contextWindow, maxTokens }]
14
+ */
15
+ (function (root) {
16
+ // ── CLI-facing PROVIDERS (display + config metadata) ──────────────────────────
17
+ // Keep in sync with setup/data/providers.js model IDs
18
+ const PROVIDERS = {
19
+ '9router': { name: '9Router Proxy (Khuyên dùng)', icon: '🔀', isProxy: true },
20
+ 'openai': { name: 'OpenAI (ChatGPT)', icon: '🧠', envKey: 'OPENAI_API_KEY' },
21
+ 'ollama': { name: 'Local Ollama', icon: '🏠', isLocal: true },
22
+ 'google': { name: 'Google (Gemini)', icon: '⚡', envKey: 'GEMINI_API_KEY' },
23
+ 'anthropic': { name: 'Anthropic (Claude)', icon: '🦄', envKey: 'ANTHROPIC_API_KEY' },
24
+ 'xai': { name: 'xAI (Grok)', icon: '✖️', envKey: 'XAI_API_KEY' },
25
+ 'groq': { name: 'Groq (LPU)', icon: '🏎️', envKey: 'GROQ_API_KEY' },
26
+ 'openrouter':{ name: 'OpenRouter', icon: '🌐', envKey: 'OPENROUTER_API_KEY' },
27
+ };
28
+
29
+ // ── CLI-facing SKILLS (value = selection key, slug = ClawHub package name) ────
30
+ // Keep in sync with setup/data/skills.js skill IDs
31
+ const SKILLS = [
32
+ { value: 'browser', name: '🌐 Browser Automation (Playwright) (⭐ Khuyên dùng)', slug: null },
33
+ { value: 'memory', name: '🧠 Long-term Memory (⭐ Khuyên dùng)', slug: 'memory' },
34
+ { value: 'scheduler', name: '⏰ Native Cron Scheduler (⭐ Khuyên dùng)', slug: null },
35
+ { value: 'rag', name: '📚 RAG / Knowledge Base', slug: 'rag' },
36
+ { value: 'image-gen', name: '🎨 Image Generation (DALL·E / Flux)', slug: 'image-gen' },
37
+ { value: 'code-interpreter', name: '💻 Code Interpreter (Python/JS)', slug: 'code-interpreter' },
38
+ { value: 'email', name: '📧 Email Assistant', slug: 'email-assistant' },
39
+ { value: 'tts', name: '🔊 Text-To-Speech (OpenAI/ElevenLabs)', slug: 'tts' },
40
+ { value: 'web-search', name: '🔍 Web Search', slug: 'web-search' },
41
+ ];
42
+
43
+ // ── CLI-facing CHANNELS ───────────────────────────────────────────────────────
44
+ // Keep in sync with setup/data/channels.js channel keys
45
+ const CHANNELS = {
46
+ 'telegram': { name: 'Telegram', type: 'telegram', icon: '🤖' },
47
+ 'zalo-bot': { name: 'Zalo OA (Bot Platform)', type: 'zalo-bot', icon: '🔑' },
48
+ 'zalo-personal': { name: 'Zalo Personal (Quét QR)', type: 'zalo-personal', icon: '📱' },
49
+ };
50
+
51
+ // ── Ollama model definitions (single source of truth for all config JSON writes) ──
52
+ // Used in: models.json per-agent, openclaw.json models.providers.ollama
53
+ const OLLAMA_MODELS = [
54
+ { id: 'gemma4:e2b', name: 'Gemma 4 E2B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
55
+ { id: 'gemma4:e4b', name: 'Gemma 4 E4B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
56
+ { id: 'gemma4:26b', name: 'Gemma 4 26B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
57
+ { id: 'gemma4:31b', name: 'Gemma 4 31B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
58
+ { id: 'qwen3:8b', name: 'Qwen 3 8B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
59
+ { id: 'deepseek-r1:8b', name: 'DeepSeek R1 8B', reasoning: true, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 64000, maxTokens: 8192 },
60
+ { id: 'llama3.3:8b', name: 'Llama 3.3 8B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
61
+ { id: 'gemma3:12b', name: 'Gemma 3 12B', reasoning: false, input: ['text'], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 8192 },
62
+ ];
63
+
64
+ // ── Node.js export (for CLI via createRequire) ────────────────────────────────
65
+ if (typeof module !== 'undefined' && module.exports) {
66
+ module.exports = { PROVIDERS, SKILLS, CHANNELS, OLLAMA_MODELS };
67
+ }
68
+
69
+ // ── Browser global (future use if wizard imports this directly) ───────────────
70
+ if (typeof root !== 'undefined') {
71
+ root.__openclawData = { PROVIDERS, SKILLS, CHANNELS, OLLAMA_MODELS };
72
+ }
73
+ })(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : {}));
@@ -0,0 +1,60 @@
1
+ // @ts-nocheck
2
+ /* eslint-disable no-undef, no-unused-vars */
3
+ /**
4
+ * @fileoverview Part of the OpenClaw Setup Wizard IIFE bundle.
5
+ * This file is concatenated (not imported) — globals are shared via setup.js IIFE scope.
6
+ * Do NOT add import/export statements. Edit, then run: node build.mjs
7
+ *
8
+ * @global {object} state - Wizard UI state
9
+ * @global {object} PROVIDERS - AI provider registry
10
+ * @global {Array} SKILLS - Available skills
11
+ * @global {Array} PLUGINS - Available plugins
12
+ * @global {object} CHANNELS - Channel definitions
13
+ * @global {boolean} isVi - Vietnamese language mode
14
+ * @global {object} provider - Current primary provider config
15
+ * @global {boolean} isMultiBot - Multi-bot mode flag
16
+ * @global {boolean} hasBrowser - Browser plugin selected
17
+ * @global {boolean} is9Router - 9Router proxy mode
18
+ * @global {string} projectDir - Output project directory path
19
+ * @global {Function} getGatewayAllowedOrigins
20
+ */
21
+ // ========== Available Plugins (npm packages — runtime/channel extensions) ==========
22
+ const PLUGINS = [
23
+ {
24
+ id: 'telegram-multibot-relay',
25
+ name: 'Telegram Multi-Bot Relay',
26
+ icon: '🤝',
27
+ descVi: 'Điều phối nhiều bot Telegram trong cùng group — tự động khi chọn nhiều bot', descEn: 'Coordinate multiple Telegram bots in one group — auto-selected with multi-bot',
28
+ package: 'openclaw-telegram-multibot-relay',
29
+ hidden: true, // hidden in UI, auto-selected programmatically
30
+ },
31
+ {
32
+ id: 'voice-call',
33
+ name: 'Voice Call',
34
+ icon: '📞',
35
+ descVi: 'Gọi thoại AI qua điện thoại', descEn: 'AI voice calls via phone',
36
+ package: '@openclaw/voice-call',
37
+ },
38
+ {
39
+ id: 'matrix',
40
+ name: 'Matrix Chat',
41
+ icon: '💬',
42
+ descVi: 'Kết nối thêm kênh Matrix/Element', descEn: 'Connect to Matrix/Element channels',
43
+ package: '@openclaw/matrix',
44
+ },
45
+ {
46
+ id: 'msteams',
47
+ name: 'MS Teams',
48
+ icon: '🏢',
49
+ descVi: 'Kết nối Microsoft Teams', descEn: 'Connect Microsoft Teams',
50
+ package: '@openclaw/msteams',
51
+ },
52
+ {
53
+ id: 'nostr',
54
+ name: 'Nostr',
55
+ icon: '🟣',
56
+ descVi: 'Kết nối mạng xã hội Nostr', descEn: 'Connect Nostr social network',
57
+ package: '@openclaw/nostr',
58
+ },
59
+ ];
60
+