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.4 KiB
2.4 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
使用设备流从 HanzoBot 登录 GitHub Copilot | GitHub Copilot |
|
GitHub Copilot
什么是 GitHub Copilot?
GitHub Copilot 是 GitHub 的 AI 编程助手。它为你的 GitHub 账户和订阅计划提供 Copilot 模型的访问权限。HanzoBot 可以通过两种不同的方式将 Copilot 用作模型提供商。
在 HanzoBot 中使用 Copilot 的两种方式
1)内置 GitHub Copilot 提供商(github-copilot)
使用原生设备登录流程获取 GitHub 令牌,然后在 HanzoBot 运行时将其兑换为 Copilot API 令牌。这是默认且最简单的方式,因为它不需要 VS Code。
2)Copilot Proxy 插件(copilot-proxy)
使用 Copilot Proxy VS Code 扩展作为本地桥接。HanzoBot 与代理的 /v1 端点通信,并使用你在其中配置的模型列表。当你已经在 VS Code 中运行 Copilot Proxy 或需要通过它进行路由时,选择此方式。你必须启用该插件并保持 VS Code 扩展运行。
使用 GitHub Copilot 作为模型提供商(github-copilot)。登录命令运行 GitHub 设备流程,保存认证配置文件,并更新你的配置以使用该配置文件。
CLI 设置
hanzo-bot models auth login-github-copilot
系统会提示你访问一个 URL 并输入一次性代码。请保持终端打开直到流程完成。
可选参数
hanzo-bot models auth login-github-copilot --profile-id github-copilot:work
hanzo-bot models auth login-github-copilot --yes
设置默认模型
hanzo-bot models set github-copilot/gpt-4o
配置片段
{
agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } },
}
注意事项
- 需要交互式 TTY;请直接在终端中运行。
- Copilot 模型的可用性取决于你的订阅计划;如果某个模型被拒绝,请尝试其他 ID(例如
github-copilot/gpt-4.1)。 - 登录会将 GitHub 令牌存储在认证配置文件中,并在 HanzoBot 运行时将其兑换为 Copilot API 令牌。