feat: KOOK自动获取bot身份 + action/narration剥出气泡 + 渠道配置表单回填
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

agent-116 KOOK token即用+自动获取:
- kook/identity.go: Connect 调 GET /user/me 拿 bot 身份(bot_id/bot_username/bot_nickname), 失败容错
- 渠道列表 enrichAccountsWithBot 附 bot 身份; base_url空用默认/receive_mode默认ws(只填token可跑)

agent-117 action/narration 剥出气泡(主人需求: 动作/旁白不进气泡,按位置上/下):
- parseContent.splitBubble(content)->{body,head,tail}: body=纯文本(去标签), head=开头/中间action/narr(气泡上), tail=结尾(气泡下)
- renderContent 只渲染text(去内联灰斜体); chat.tsx BubbleNotes 泡外 *动作/旁白* 灰斜体小字(气泡外依附), SplitChatBubble 先剥splitBubble再splitParagraphs(body), <p>/\n\n/毛玻璃/SourceLabel不破坏
- 注: 非chat mode renderContent 现在丢弃action/narr(可接受)

Channels 配置表单回填(修save后输入框空):
- openConfig 从 data.accounts[0].config 回填 token(掩码提示)/base_url/平台字段/黑白名单/限流, 不再硬清空
全仓 build/vet/test绿+前端build绿
This commit is contained in:
Aska committed 2026-09-07 15:31:14 +08:00
1 parent bdd9d752e1
commit 65091f6497
15 files changed
+571 -83

No files matched your search

+7
View File
@@ -143,6 +143,9 @@ func TestConnect_GatewayDeliversEvent(t *testing.T) {
case gatewayPath:
wsURL := "ws://" + strings.TrimPrefix(srv.URL, "http://") + "/ws"
kookOK(w, map[string]any{"url": wsURL})
case userMePath:
// Connect resolves the bot identity via user/me (best-effort).
kookOK(w, map[string]any{"id": "bot-1", "username": "bot", "nickname": "Bot"})
case "/ws":
conn, err := wsUpgrader.Upgrade(w, r, nil)
if err != nil {
@@ -217,4 +220,8 @@ func TestConnect_GatewayDeliversEvent(t *testing.T) {
if sid := a.currentSession(); sid != "sess-123" {
t.Errorf("currentSession = %q, want sess-123", sid)
}
// Connect fetched the bot identity via user/me (best-effort).
if id, _, nickname := a.BotIdentity(); id != "bot-1" || nickname != "Bot" {
t.Errorf("BotIdentity = %q/%q, want bot-1/Bot", id, nickname)
}
}