mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
Merge branch 'pr/amDosion/60'
This commit is contained in:
34
DEV-LOG.md
34
DEV-LOG.md
@@ -1,5 +1,39 @@
|
||||
# DEV-LOG
|
||||
|
||||
## Enable Remote Control / BRIDGE_MODE (2026-04-03)
|
||||
|
||||
**PR**: [claude-code-best/claude-code#60](https://github.com/claude-code-best/claude-code/pull/60)
|
||||
|
||||
Remote Control 功能将本地 CLI 注册为 bridge 环境,生成可分享的 URL(`https://claude.ai/code/session_xxx`),允许从浏览器、手机或其他设备远程查看输出、发送消息、审批工具调用。
|
||||
|
||||
**改动文件:**
|
||||
|
||||
| 文件 | 变更 |
|
||||
|------|------|
|
||||
| `scripts/dev.ts` | `DEFAULT_FEATURES` 加入 `"BRIDGE_MODE"`,dev 模式默认启用 |
|
||||
| `src/bridge/peerSessions.ts` | stub → 完整实现:通过 bridge API 发送跨会话消息,含三层安全防护(trim + validateBridgeId 白名单 + encodeURIComponent) |
|
||||
| `src/bridge/webhookSanitizer.ts` | stub → 完整实现:正则 redact 8 类 secret(GitHub/Anthropic/AWS/npm/Slack token),先 redact 再截断,失败返回安全占位符 |
|
||||
| `src/entrypoints/sdk/controlTypes.ts` | 12 个 `any` stub → `z.infer<ReturnType<typeof XxxSchema>>` 从现有 Zod schema 推导类型 |
|
||||
| `src/hooks/useReplBridge.tsx` | `tengu_bridge_system_init` 默认值 `false` → `true`,使 app 端显示 "active" 而非卡在 "connecting" |
|
||||
|
||||
**关键设计决策:**
|
||||
|
||||
1. **不改现有代码逻辑** — 只补全 stub、修正默认值、开启编译开关
|
||||
2. **`tengu_bridge_system_init`** — Anthropic 通过 GrowthBook 给订阅用户推送 `true`,但我们的 build 收不到推送;改默认值是唯一不侵入其他代码的方案
|
||||
3. **`peerSessions.ts` 认证** — 使用 `getBridgeAccessToken()` 获取 OAuth Bearer token,与 `bridgeApi.ts`/`codeSessionApi.ts` 认证模式一致
|
||||
4. **`webhookSanitizer.ts` 安全** — fail-closed(出错返回 `[webhook content redacted due to sanitization error]`),不泄露原始内容
|
||||
|
||||
**验证结果:**
|
||||
|
||||
- `/remote-control` 命令可见且可用
|
||||
- CLI 连接 Anthropic CCR,生成可分享 URL
|
||||
- App 端(claude.ai/code)显示 "Remote Control active"
|
||||
- 手机端(Claude iOS app)通过 URL 连接,双向消息正常
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## GrowthBook 自定义服务器适配器 (2026-04-03)
|
||||
|
||||
GrowthBook 功能开关系统原为 Anthropic 内部构建设计,硬编码 SDK key 和 API 地址,外部构建因 `is1PEventLoggingEnabled()` 门控始终禁用。新增适配器模式,通过环境变量连接自定义 GrowthBook 服务器,无配置时所有 feature 读取返回代码默认值。
|
||||
|
||||
Reference in New Issue
Block a user