程序员阿江(Relakkes) 4ccda92cfe chore(adapters): snapshot pre-attachment WIP (permission card v2, handler serialization, markdown style)
Carries forward ~800 lines of in-flight work that existed in the working
tree before the IM-attachment branch was cut. Kept as a single isolated
commit so later attachment work has a clean diff baseline and so this
WIP can be cherry-picked back to main on its own merits.

Contents:
- ws-bridge: per-chat handler chain serialization; sendPermissionResponse
  now accepts optional `rule: 'always'` for persistent permits
- feishu/index.ts: permission card rewritten to Schema 2.0 with icon,
  cross-dir warning, and ♾️ 永久允许 button; optimizeMarkdownForFeishu
  applied to streaming card
- feishu/markdown-style.ts: new Feishu-specific markdown downgrader
- tests: corresponding bun:test coverage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:24:10 +08:00
..

Claude Code IM Adapters

当前目录只放 IM Adapter 运行时代码。

用户文档已经迁移到 docs/,并且以 Desktop Webapp 配置流程为准:

  • docs/im/index.md
  • docs/im/telegram.md
  • docs/im/feishu.md

当前方案摘要

当前真实链路是:

Desktop Webapp Settings
  -> /api/adapters
  -> ~/.claude/adapters.json
  -> adapters/<platform>/index.ts
  -> /api/sessions + /ws/:sessionId
  -> Claude Code session

注意两点:

  • IM 配置和配对都在 Desktop Webapp 的 Settings -> IM 接入
  • Webapp 不会自动启动 Adapter 进程,仍需手动运行 bun run telegrambun run feishu

快速启动

cd adapters
bun install
bun run telegram
# 或
bun run feishu

开发

运行测试

cd adapters
bun test
bun test common/
bun test telegram/
bun test feishu/

目录结构

adapters/
├── common/
├── telegram/
├── feishu/
├── package.json
├── tsconfig.json
└── README.md