在 macOS Web UI 上, AhaKey hook handler 不响应 Hermes Agent 触发的 hook 事件
环境
- 设备: AhaKey-X1 (Vibecoding Keyboard), 键盘 505C (D4:6C:50:5C:F5:B3)
- 固件: 当前最新版 (AhaKey Studio 已安装并配对成功)
- 桌面客户端: AhaKey Studio.app + ahakeyconfig-agent LaunchAgent (macOS 15.7.5, Intel x86_64)
- 想要集成但当前不支持的 IDE: Hermes Agent (Nous Research, hermes-agent.nousresearch.com)
问题描述
AhaKey 官方 README 列出的 hook handler 只覆盖 4 个 IDE:
- ClaudeHookHandler
- CursorHookHandler
- CodexHookHandler
- KimiHookHandler
我正在用 Hermes Agent 作为主要 IDE, 它不在支持列表。在 Hermes 上:
- 拨杆审批: ✅ 能用 (走
ahakeyconfig-agent 的 socket 协议, 跟我们自己写的 daemon 通讯即可)
- OLED 推送: ✅ 能用 (gif 文件 + socket 协议)
- AI 灯效 / light bar 同步 Hermes LLM 状态: ❌ 不工作
- 按键触发 Hermes 命令: ❌ 不工作 (因为没 IDE hook 触发)
已尝试的解决方案
我尝试了通过 Hermes shell hook (~/.hermes/config.yaml hooks: 块) 推 socket state 命令到 ahakeyconfig-agent:
hooks:
pre_llm_call: # Hermes CLI 事件, Web UI 不触发
- command: "...handler.py"
pre_tool_call:
- command: "...handler.py"
...
结果:
- ✅ Hermes CLI (
hermes -z "...") 模式下 8 个事件全工作, 灯按 state 0-8 切换精细切灯效
- ❌ Hermes Web UI (localhost:8648) 模式下完全不工作 — gateway 只触发
pre_gateway_dispatch / gateway_platform_event / pre_command, 不触发任何 thinking/tool/done 状态 hook
根因分析
读了 protocol/docs/commands.md 之后, 我看到 0x90 AI state 命令的 high-level states 命名跟 Claude Code 完全一致:
- Notification
- PermissionRequest
- PostToolUse
- PreToolUse
- SessionStart
- Stop
- TaskCompleted
- UserPromptSubmit
- SessionEnd
但 Hermes 用的是完全不同的事件名 (pre_llm_call / pre_tool_call / post_llm_call / on_session_start / on_session_end 等), 且Web UI gateway 路径只调用 pre_gateway_dispatch 等少数 hook, 跟 Claude Code 的 hook 协议架构不兼容。
我的几个问题
- 是否计划增加 Hermes hook handler? 鉴于 Hermes Agent 在社区有相当用户量 (它有 MCP / Web UI / 飞书集成等, 跟 Cursor / Claude Code 类似定位)
- 是否考虑把 4 个 IDE 的 hook handler 抽象成一个通用接口? 这样其他人 (含我) 可以基于 SDK 自己实现 HermesHookHandler, 不需要等官方 PR
- Web UI / Gateway 这类"非 CLI 路径"的 hook 触发, 是否有官方文档说明哪些事件会被触发? 我目前只能从
gateway/run.py 里 grep invoke_hook 来定位, 没有公开文档
sdks/ 目录目前只有 typescript, 有 Python SDK 计划吗? 我现在所有 bridge 代码都是 Python (/tmp/ahakey.sock 协议 + Hermes hook handler)
BLE_tcp_bridge/ 我看到了 —— 这是给 Windows / Linux 用户绕开 native 客户端的方式吗? macOS native (SwiftUI + CoreBluetooth) 路径 + Python 桥是否推荐做这种跨平台桥?
建议
如果短期不增加 Hermes hook handler, 我希望至少:
- 官方
protocol/docs/ 增加一个**"hook event integration guide"** — 列出现在 4 个 hook handler 触发的事件列表 + 让第三方用户基于 SDK 自定义的方法
sdks/ 增加 Python SDK (socket 协议 + 0x90 state 命令封装 + light/OLED helper)
- 公开
ahakeyconfig-agent 的 完整 socket 协议 (我现在是 reverse-engine 出来的: {cmd: approval_status|permission|state, value: N})
这些可以让社区 (包括我) 自己写 Hermes hook handler + 其他 IDE 集成。
附: 我现在工作状态
- ✅ AhaKey Studio 安装 + BLE 配对 OK
- ✅ 拨杆审批走 socket 协议 (手动 daemon 实现)
- ✅ OLED 推送走 socket 协议 (gif 文件)
- ✅ CLI 模式 Hermes 灯效精细切
- ❌ Web UI / 飞书 / 其他 IDE hook 同步 — 等官方指引或 SDK
谢谢!
在 macOS Web UI 上, AhaKey hook handler 不响应 Hermes Agent 触发的 hook 事件
环境
问题描述
AhaKey 官方 README 列出的 hook handler 只覆盖 4 个 IDE:
我正在用 Hermes Agent 作为主要 IDE, 它不在支持列表。在 Hermes 上:
ahakeyconfig-agent的 socket 协议, 跟我们自己写的 daemon 通讯即可)已尝试的解决方案
我尝试了通过 Hermes shell hook (
~/.hermes/config.yaml hooks:块) 推 socketstate命令到ahakeyconfig-agent:结果:
hermes -z "...") 模式下 8 个事件全工作, 灯按 state 0-8 切换精细切灯效pre_gateway_dispatch/gateway_platform_event/pre_command, 不触发任何 thinking/tool/done 状态 hook根因分析
读了
protocol/docs/commands.md之后, 我看到 0x90 AI state 命令的 high-level states 命名跟 Claude Code 完全一致:但 Hermes 用的是完全不同的事件名 (
pre_llm_call/pre_tool_call/post_llm_call/on_session_start/on_session_end等), 且Web UI gateway 路径只调用pre_gateway_dispatch等少数 hook, 跟 Claude Code 的 hook 协议架构不兼容。我的几个问题
gateway/run.py里 grepinvoke_hook来定位, 没有公开文档sdks/目录目前只有 typescript, 有 Python SDK 计划吗? 我现在所有 bridge 代码都是 Python (/tmp/ahakey.sock协议 + Hermes hook handler)BLE_tcp_bridge/我看到了 —— 这是给 Windows / Linux 用户绕开 native 客户端的方式吗? macOS native (SwiftUI + CoreBluetooth) 路径 + Python 桥是否推荐做这种跨平台桥?建议
如果短期不增加 Hermes hook handler, 我希望至少:
protocol/docs/增加一个**"hook event integration guide"** — 列出现在 4 个 hook handler 触发的事件列表 + 让第三方用户基于 SDK 自定义的方法sdks/增加 Python SDK (socket 协议 + 0x90 state 命令封装 + light/OLED helper)ahakeyconfig-agent的 完整 socket 协议 (我现在是 reverse-engine 出来的:{cmd: approval_status|permission|state, value: N})这些可以让社区 (包括我) 自己写 Hermes hook handler + 其他 IDE 集成。
附: 我现在工作状态
谢谢!