mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Three coordinated things:
1. Resolve the committed upstream/main merge conflicts. 94 files were
sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
by keeping HEAD everywhere — 540 conflict blocks.
2. Rewrite remaining OpenClaw text refs.
OPENCLAW → HANZO_BOT
OpenClaw → HanzoBot (PascalCase type identifiers)
openclaw → bot (codebase convention — botToken,
botUsername etc.; avoids invalid
hyphenated JS identifiers)
openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z] (compound)
ai.openclaw.x → ai.hanzo.bot.x (JVM package path)
3. Delete or rename openclaw-named file paths (116 of them). Dead
duplicates with a Bot-named canonical from the partial migration:
deleted. Otherwise renamed.
ai/openclaw/** → deleted (ai/hanzo/bot/** canonical)
Sources/OpenClaw*/ → deleted (Sources/Bot* canonical)
Tests/OpenClawIPCTests/ → deleted (Tests/BotIPCTests canonical)
OpenClawKit/ → deleted (BotKit canonical)
openclaw-tools.*.ts → deleted (bot-tools.*.ts canonical)
openclaw-root.ts etc. → deleted (bot-root.ts canonical)
types.openclaw.ts → deleted (types.bot.ts canonical)
extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
docs/start/openclaw.md → renamed hanzo-bot.md (+ zh-CN)
docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
scripts/.../openclaw-* → deleted (bot/hanzo-bot parallels)
openclaw.mjs → deleted (hanzo-bot.mjs is package.bin)
Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).
Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.
The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.
Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
3.4 KiB
3.4 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
`hanzo-bot update` 的 CLI 参考(相对安全的源码更新 + Gateway 网关自动重启) | update |
|
hanzo-bot update
安全更新 HanzoBot 并在 stable/beta/dev 渠道之间切换。
如果你通过 npm/pnpm 安装(全局安装,无 git 元数据),更新通过 更新 中的包管理器流程进行。
用法
hanzo-bot update
hanzo-bot update status
hanzo-bot update wizard
hanzo-bot update --channel beta
hanzo-bot update --channel dev
hanzo-bot update --tag beta
hanzo-bot update --no-restart
hanzo-bot update --json
hanzo-bot --update
选项
--no-restart:成功更新后跳过重启 Gateway 网关服务。--channel <stable|beta|dev>:设置更新渠道(git + npm;持久化到配置中)。--tag <dist-tag|version>:仅为本次更新覆盖 npm dist-tag 或版本。--json:打印机器可读的UpdateRunResultJSON。--timeout <seconds>:每步超时时间(默认 1200 秒)。
注意:降级需要确认,因为旧版本可能会破坏配置。
update status
显示当前更新渠道 + git 标签/分支/SHA(对于源码检出),以及更新可用性。
hanzo-bot update status
hanzo-bot update status --json
hanzo-bot update status --timeout 10
选项:
--json:打印机器可读的状态 JSON。--timeout <seconds>:检查超时时间(默认 3 秒)。
update wizard
交互式流程,用于选择更新渠道并确认是否在更新后重启 Gateway 网关(默认重启)。如果你选择 dev 但没有 git 检出,它会提供创建一个的选项。
工作原理
当你显式切换渠道(--channel ...)时,HanzoBot 也会保持安装方式一致:
dev→ 确保存在 git 检出(默认:~/hanzo-bot,可通过BOT_GIT_DIR覆盖),更新它,并从该检出安装全局 CLI。stable/beta→ 使用匹配的 dist-tag 从 npm 安装。
Git 检出流程
渠道:
stable:检出最新的非 beta 标签,然后构建 + doctor。beta:检出最新的-beta标签,然后构建 + doctor。dev:检出main,然后 fetch + rebase。
高层概述:
- 需要干净的工作树(无未提交的更改)。
- 切换到所选渠道(标签或分支)。
- 获取上游(仅 dev)。
- 仅 dev:在临时工作树中预检 lint + TypeScript 构建;如果最新提交失败,回退最多 10 个提交以找到最新的干净构建。
- Rebase 到所选提交(仅 dev)。
- 安装依赖(优先使用 pnpm;npm 作为备选)。
- 构建 + 构建控制界面。
- 运行
hanzo-bot doctor作为最终的"安全更新"检查。 - 将插件同步到当前渠道(dev 使用捆绑的扩展;stable/beta 使用 npm)并更新 npm 安装的插件。
--update 简写
hanzo-bot --update 会重写为 hanzo-bot update(便于 shell 和启动脚本使用)。