create-openclaw-bot 5.3.4 → 5.4.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/index.html CHANGED
@@ -171,7 +171,8 @@
171
171
  <span class="channel-card__badge badge--official">✅ Official</span>
172
172
  </div>
173
173
 
174
- <div class="channel-card" data-channel="telegram+zalo-personal" id="card-telegram-zalo-personal">
174
+ <!-- Combo mode (Telegram + Zalo Personal) — tạm ngưng, sẽ mở lại sau khi nghiên cứu xong -->
175
+ <div class="channel-card" data-channel="telegram+zalo-personal" id="card-telegram-zalo-personal" style="display:none">
175
176
  <div class="channel-card__icon" style="display:flex;gap:4px;align-items:center;">
176
177
  <img src="https://thesvg.org/icons/telegram/default.svg" alt="Telegram" width="24" height="24">
177
178
  <span style="font-size:12px;opacity:.5;">+</span>
@@ -0,0 +1,203 @@
1
+ # OpenClaw - Kien truc thu muc va secrets hien tai
2
+
3
+ Tai lieu nay mo ta dung behavior code hien tai cua wizard sau khi da dong bo lai native/docker va logic `.env`.
4
+
5
+ ## Pham vi ho tro hien tai
6
+
7
+ - Native: `win`, `macos`, `linux-desktop`, `vps`
8
+ - Docker: cung mot cau truc file cho moi OS, chi khac launcher script tai ve
9
+ - Channel ho tro:
10
+ - `telegram`
11
+ - `zalo-bot`
12
+ - `zalo-personal`
13
+ - Multi-bot: chi ap dung cho `telegram`
14
+ - Combo `telegram + zalo-*`: hien khong duoc wizard UI mo ra
15
+
16
+ ## Nguyen tac chung
17
+
18
+ - `OPENCLAW_HOME = {projectDir}/.openclaw`
19
+ - `OPENCLAW_STATE_DIR = {projectDir}/.openclaw`
20
+ - `DATA_DIR = {projectDir}/.9router`
21
+ - `agents.list[].agentDir` la duong dan relative theo `OPENCLAW_HOME`
22
+ - `agents.list[].workspace` cung la duong dan relative theo `OPENCLAW_HOME`
23
+ - Workspace luon dung format `workspace-{slug}`, ke ca single bot
24
+
25
+ ## Secrets va .env
26
+
27
+ ### Native
28
+
29
+ Native setup hien tai tao `{projectDir}/.env` va cac script native deu load file nay truoc khi chay `openclaw gateway run`.
30
+
31
+ `.env` trong native dung de luu:
32
+
33
+ - API key cua direct provider, vd `OPENAI_API_KEY`, `GEMINI_API_KEY`, ...
34
+ - channel token khi can:
35
+ - `TELEGRAM_BOT_TOKEN`
36
+ - `TELEGRAM_BOT_TOKEN_1..N` cho telegram multi-bot
37
+ - `ZALO_BOT_TOKEN` cho `zalo-bot`
38
+ - `TELEGRAM_GROUP_ID` neu user nhap group id
39
+ - env vars cua skills da chon
40
+
41
+ Luu y:
42
+
43
+ - `9router` khong can AI API key trong `.env`
44
+ - nhung neu channel la `telegram` hoac `zalo-bot` thi `.env` van co token channel
45
+ - `zalo-personal` khong dung bot token; login bang `openclaw channels login --channel zalouser --verbose`
46
+
47
+ ### Docker
48
+
49
+ Docker setup hien tai tao ca hai file:
50
+
51
+ - `{projectDir}/.env`
52
+ - `{projectDir}/docker/openclaw/.env`
53
+
54
+ Trong do:
55
+
56
+ - root `.env` la ban ghi secrets tai project root de user de theo doi/chinh sua
57
+ - `docker/openclaw/.env` la file duoc `docker compose` nap vao container
58
+
59
+ ## Provider auth
60
+
61
+ - Direct provider va provider local van co `.openclaw/auth-profiles.json`
62
+ - Per-agent `auth-profiles.json` duoc tao trong `.openclaw/agents/{slug}/agent/` khi khong dung `9router`
63
+ - Khi dung `9router`, khong tao root/per-agent `auth-profiles.json`
64
+ - Khi dung `9router`, provider endpoint duoc khai bao trong `.openclaw/openclaw.json -> models.providers.9router`
65
+
66
+ ## Cau truc chuan theo case
67
+
68
+ ### Case 1: Single bot
69
+
70
+ Ap dung cho:
71
+
72
+ - `telegram` single bot
73
+ - `zalo-bot`
74
+ - `zalo-personal`
75
+
76
+ ```text
77
+ {projectDir}/
78
+ |-- .env # native secrets; docker cung co ban root nay
79
+ |-- .openclaw/
80
+ | |-- openclaw.json
81
+ | |-- exec-approvals.json
82
+ | |-- auth-profiles.json # chi khi khong dung 9router
83
+ | |-- agents/
84
+ | | |-- {slug}.yaml
85
+ | | `-- {slug}/agent/
86
+ | | `-- auth-profiles.json # chi khi khong dung 9router
87
+ | `-- workspace-{slug}/
88
+ | |-- IDENTITY.md
89
+ | |-- SOUL.md
90
+ | |-- AGENTS.md
91
+ | |-- USER.md
92
+ | |-- TOOLS.md
93
+ | |-- MEMORY.md
94
+ | |-- browser-tool.js # neu bat browser
95
+ | `-- BROWSER.md # neu bat browser
96
+ |-- .9router/
97
+ | `-- 9router-smart-route-sync.js # chi khi provider = 9router
98
+ |-- start-bot.bat / start-bot.sh # chi native
99
+ |-- start-chrome-debug.bat/sh # neu bat browser va native
100
+ |-- uninstall-openclaw-*.bat/sh
101
+ `-- docker/
102
+ `-- openclaw/
103
+ |-- Dockerfile # chi docker mode
104
+ |-- docker-compose.yml # chi docker mode
105
+ `-- .env # chi docker mode
106
+ ```
107
+
108
+ ### Case 2: Telegram multi-bot
109
+
110
+ ```text
111
+ {projectDir}/
112
+ |-- .env
113
+ |-- .openclaw/
114
+ | |-- openclaw.json
115
+ | |-- exec-approvals.json
116
+ | |-- auth-profiles.json # chi khi khong dung 9router
117
+ | |-- agents/
118
+ | | |-- {bot1}.yaml
119
+ | | |-- {bot2}.yaml
120
+ | | |-- {bot1}/agent/auth-profiles.json # chi khi khong dung 9router
121
+ | | `-- {bot2}/agent/auth-profiles.json # chi khi khong dung 9router
122
+ | |-- workspace-{bot1}/
123
+ | | |-- IDENTITY.md
124
+ | | |-- SOUL.md
125
+ | | |-- AGENTS.md
126
+ | | |-- USER.md
127
+ | | |-- TOOLS.md
128
+ | | |-- MEMORY.md
129
+ | | |-- browser-tool.js # neu bat browser
130
+ | | `-- BROWSER.md # neu bat browser
131
+ | `-- workspace-{bot2}/
132
+ | |-- IDENTITY.md
133
+ | |-- SOUL.md
134
+ | |-- AGENTS.md
135
+ | |-- USER.md
136
+ | |-- TOOLS.md
137
+ | |-- MEMORY.md
138
+ | |-- browser-tool.js # neu bat browser
139
+ | `-- BROWSER.md # neu bat browser
140
+ |-- TELEGRAM-POST-INSTALL.md
141
+ |-- .9router/
142
+ | `-- 9router-smart-route-sync.js # chi khi provider = 9router
143
+ |-- start-bot.bat / start-bot.sh # chi native
144
+ |-- uninstall-openclaw-*.bat/sh
145
+ `-- docker/
146
+ `-- openclaw/
147
+ |-- Dockerfile # chi docker mode
148
+ |-- docker-compose.yml # chi docker mode
149
+ `-- .env # chi docker mode
150
+ ```
151
+
152
+ Ghi chu multi-bot:
153
+
154
+ - `openclaw.json` co `channels.telegram.accounts` cho tung bot
155
+ - moi workspace co `AGENTS.md` mo ta handoff/routing
156
+ - wizard hien khong tao file rieng `TEAM.md` hay `RELAY.md`
157
+ - noi dung team coordination da duoc nhap vao `AGENTS.md`
158
+ - noi dung security da duoc nhap vao `AGENTS.md`
159
+ - noi dung relay da duoc nhap vao `TOOLS.md`
160
+
161
+ ## Hanh vi theo channel
162
+
163
+ ### Telegram single
164
+
165
+ - co `TELEGRAM_BOT_TOKEN` trong `.env`
166
+ - native script load `.env` roi chay gateway
167
+ - docker dung `docker/openclaw/.env`
168
+
169
+ ### Telegram multi-bot
170
+
171
+ - co `TELEGRAM_BOT_TOKEN_1..N` va co the co `TELEGRAM_GROUP_ID` trong `.env`
172
+ - `openclaw.json` van co `channels.telegram.accounts` cho tung bot
173
+ - relay plugin `openclaw-telegram-multibot-relay` duoc bat
174
+
175
+ ### Zalo Bot API
176
+
177
+ - co `ZALO_BOT_TOKEN` trong `.env`
178
+ - code hien cung de san `ZALO_APP_ID` va `ZALO_APP_SECRET` placeholder
179
+ - native va docker deu can secrets nay
180
+
181
+ ### Zalo Personal
182
+
183
+ - khong co bot token trong `.env`
184
+ - native: script tu dong mo flow login `zalouser`
185
+ - docker: user chay lenh login sau khi container da len
186
+
187
+ ## Danh sach file khong nen tao
188
+
189
+ - khong tao `agents/` o project root
190
+ - khong tao `.openclaw/workspace` chung kieu cu
191
+ - khong tao `models.json` trong agent dir khi dung `9router`
192
+ - khong tao Docker artifacts trong native mode
193
+ - khong tao root/per-agent `auth-profiles.json` khi dung `9router`
194
+ - khong tao file rieng `TEAM.md` / `RELAY.md` trong wizard hien tai
195
+
196
+ ## Ket luan thuc te hien tai
197
+
198
+ Sau khi chinh code:
199
+
200
+ - logic tao thu muc `.openclaw`, `workspace-{slug}`, `auth-profiles.json` da dong bo hon giua native va docker
201
+ - native va docker deu co `.env` de ghi nhan secrets theo provider/channel
202
+ - 4 OS native deu load project `.env` truoc khi start gateway
203
+ - tai lieu nay mo ta code thuc te hien tai, khong mo ta combo modes dang tam ngung trong UI
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "create-openclaw-bot",
3
- "version": "5.3.4",
3
+ "version": "5.4.0",
4
4
  "description": "Interactive CLI installer for OpenClaw Bot",
5
5
  "main": "cli.js",
6
6
  "bin": {
7
7
  "create-openclaw-bot": "./cli.js"
8
8
  },
9
9
  "scripts": {
10
+ "build": "node build.mjs",
11
+ "dev": "node build.mjs --watch",
10
12
  "test": "node tests/smoke-cli-logic.mjs",
11
13
  "bump": "node bump-version.mjs"
12
14
  },