mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +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.3 KiB
3.3 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
菜单栏状态逻辑及向用户展示的内容 | 菜单栏 |
|
菜单栏状态逻辑
显示内容
- 我们在菜单栏图标和菜单的第一行状态行中展示当前智能体的工作状态。
- 工作活跃时隐藏健康状态;当所有会话空闲时恢复显示。
- 菜单中的"节点"区块仅列出设备(通过
node.list配对的节点),不包括客户端/在线状态条目。 - 当提供商用量快照可用时,"用量"部分会显示在上下文下方。
状态模型
- 会话:事件携带
runId(每次运行)以及载荷中的sessionKey。"main" 会话的键为main;如果不存在,则回退到最近更新的会话。 - 优先级:main 始终优先。如果 main 处于活跃状态,立即显示其状态。如果 main 空闲,则显示最近活跃的非 main 会话。活动进行中不会来回切换;仅在当前会话进入空闲或 main 变为活跃时才切换。
- 活动类型:
job:高层命令执行(state: started|streaming|done|error)。tool:phase: start|result,包含toolName和meta/args。
IconState 枚举(Swift)
idleworkingMain(ActivityKind)workingOther(ActivityKind)overridden(ActivityKind)(调试覆盖)
ActivityKind → 图标符号
exec→ 💻read→ 📄write→ ✍️edit→ 📝attach→ 📎- 默认 → 🛠️
视觉映射
idle:正常小动物图标。workingMain:带图标符号的徽章,完整色调,腿部"工作"动画。workingOther:带图标符号的徽章,柔和色调,无快跑动画。overridden:无论活动状态如何,使用所选的图标符号/色调。
状态行文本(菜单)
- 工作活跃时:
<会话角色> · <活动标签>- 示例:
Main · exec: pnpm test、Other · read: apps/macos/Sources/HanzoBot/AppState.swift。
- 示例:
- 空闲时:回退显示健康摘要。
事件接收
- 来源:控制渠道
agent事件(ControlChannel.handleAgentEvent)。 - 解析字段:
stream: "job",包含data.state用于启动/停止。stream: "tool",包含data.phase、name,可选meta/args。
- 标签:
exec:args.command的第一行。read/write:缩短的路径。edit:路径加上从meta/diff 计数推断的变更类型。- 回退:工具名称。
调试覆盖
- 设置 ▸ 调试 ▸ "图标覆盖" 选择器:
系统(自动)(默认)工作中:main(按工具类型)工作中:other(按工具类型)空闲
- 通过
@AppStorage("iconOverride")存储;映射到IconState.overridden。
测试清单
- 触发 main 会话任务:验证图标立即切换且状态行显示 main 标签。
- main 空闲时触发非 main 会话任务:图标/状态显示非 main;保持稳定直到完成。
- 在 other 活跃时启动 main:图标立即切换到 main。
- 快速连续工具调用:确保徽章不会闪烁(工具结果的 TTL 宽限期)。
- 所有会话空闲后健康行重新出现。