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.
2.9 KiB
2.9 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
为在 HanzoBot macOS 应用上工作的开发者提供的设置指南 | macOS 开发设置 |
|
macOS 开发者设置
本指南涵盖从源代码构建和运行 HanzoBot macOS 应用程序的必要步骤。
前置条件
在构建应用之前,确保你已安装以下内容:
- Xcode 26.2+:Swift 开发所需。
- Node.js 22+ & pnpm:Gateway 网关、CLI 和打包脚本所需。
1. 安装依赖
安装项目范围的依赖:
pnpm install
2. 构建和打包应用
要构建 macOS 应用并将其打包到 dist/HanzoBot.app,运行:
./scripts/package-mac-app.sh
如果你没有 Apple Developer ID 证书,脚本将自动使用 ad-hoc 签名(-)。
有关开发运行模式、签名标志和 Team ID 故障排除,请参阅 macOS 应用 README: https://github.com/hanzo-bot/hanzo-bot/blob/main/apps/macos/README.md
注意:Ad-hoc 签名的应用可能会触发安全提示。如果应用立即崩溃并显示"Abort trap 6",请参阅故障排除部分。
3. 安装 CLI
macOS 应用期望全局安装 hanzo-bot CLI 来管理后台任务。
安装方法(推荐):
- 打开 HanzoBot 应用。
- 转到 General 设置标签页。
- 点击 "Install CLI"。
或者,手动安装:
npm install -g hanzo-bot@<version>
故障排除
构建失败:工具链或 SDK 不匹配
macOS 应用构建期望最新的 macOS SDK 和 Swift 6.2 工具链。
系统依赖(必需):
- 软件更新中可用的最新 macOS 版本(Xcode 26.2 SDK 所需)
- Xcode 26.2(Swift 6.2 工具链)
检查:
xcodebuild -version
xcrun swift --version
如果版本不匹配,更新 macOS/Xcode 并重新运行构建。
授予权限时应用崩溃
如果在尝试允许语音识别或麦克风访问时应用崩溃,可能是由于 TCC 缓存损坏或签名不匹配。
修复:
- 重置 TCC 权限:
tccutil reset All bot.molt.mac.debug - 如果这不起作用,在
scripts/package-mac-app.sh中临时更改BUNDLE_ID以强制 macOS 从"全新状态"开始。
Gateway 网关无限期"Starting..."
如果 Gateway 网关状态一直停留在"Starting...",检查是否有僵尸进程占用端口:
hanzo-bot gateway status
hanzo-bot gateway stop
# 如果你没有使用 LaunchAgent(开发模式/手动运行),找到监听器:
lsof -nP -iTCP:18789 -sTCP:LISTEN
如果手动运行占用了端口,停止该进程(Ctrl+C)。作为最后手段,杀死你找到的 PID。