Skip to content

接入官方 Claude Code 双端工作台,支持自定义底栏与 PWA 启动优化 - #9

Merged
bighamx merged 20 commits into
bighamx:masterfrom
leftxp:codex/claude-code-integration
Nov 12, 2026
Merged

bighamx merged 20 commits into
bighamx:masterfrom
leftxp:codex/claude-code-integration

Conversation

@leftxp

@leftxp leftxp commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

功能

通过官方 Claude Agent SDK,将本机 Claude Code 接入 Web 和 Android 主 App 共用的会话工作台。终端创建的会话可查看和续聊,历史按消息、思考、工具记录投影,避免把原始源码和事件日志直接堆到聊天中。

  • 支持流式回复、附件、工具审批与原生建议规则、页面内问题回答、插话/停止、分叉/撤回编辑、模型及权限设置。
  • 电脑占用会话时阻止写入;接管需确认进程及其状态,并校验状态变化。断线或结果未知时保留投递回执,不自动重放。
  • 使用官方结构化 usage 控制接口读取订阅额度,无用户提示词或模型调用;并发合并、短期缓存,失败时保留并标记上次结果。
  • Web / Android 底栏改为前五项加固定“更多”,支持调整顺序与溢出收纳。Android 提供长按拖动、边缘滚动、前五项标识和预览,编辑按钮放在更多页顶部。
  • PWA 提供公共缓存启动页、实际资源加载进度、离线提示和重试,保留深链接,不缓存私有页面。
  • 可选 -PclaudeTrial=true 使用独立测试包名;默认正式包名不变。

已合入最新 master(11bdf64),保留上游 Material 3、资源热修改失效和文件交互修复;继续遵守手机工具等 App 专属能力边界。补充修复移动文件页动画导致操作栏短暂覆盖底栏,以及浅色更多菜单文字与编辑按钮布局。

安装

服务账户需安装并登录官方 Claude Code、Node.js 20+,在桥接目录执行 npm ci --omit=dev --omit=optional。SDK 固定为 0.3.322,接口协议 v2。配置、功能和权限边界见 Claude 接入说明。

验证

  • .NET 8 WebApplication 构建通过,AgentContracts(含资源版本热修改契约)通过。
  • 52 项 Node 回归通过:Claude 桥接/额度、导航、上下文菜单、视口与远程文件/全屏。
  • Android Claude / 导航相关单测、Full Release 构建与 Lint 通过(0 errors,48 warnings),测试包名和签名已核对。
  • Chrome 完整 Razor/Vue 页面回归通过:Claude 共用工作台、导航排序/PWA、桌面与 320–430px 手机宽度、深浅主题、键盘模拟和文件菜单;业务接口使用隔离数据与模拟响应,截图已检查。
  • 既有 macOS UpdaterReadiness 用例存在平台夹具断言失败(将非 Linux 视为 IIS,提前返回另一错误);未将其算作通过。浏览器模拟不替代手机真机及 Windows/Linux 实机验证。

本 PR 不包含 APK、用户配置、数据库或凭据。

leftxp and others added 20 commits November 10, 2026 21:18
Rebuild the Claude Code integration on the /api/codex contract so the Web
workspace serves Codex, Hermes and Claude from one shell.

Bridge (Node, official Agent SDK):
- split into history/state/runs/sessions modules; state is written only on
  transitions, live events stay in an in-memory ring with SSE resume
- list and continue every native session; fork, rename, pin, delete,
  rewind via resumeSessionAt, model/effort and permission mode per session
- steer through streaming input, graceful interrupt() stop, native
  permission suggestions, inline AskUserQuestion answers
- failures before start are retryable; unknown results block the session
  until explicitly acknowledged and are never replayed
- detect sessions held by desktop Claude processes (own SDK children
  excluded) and take over by gracefully ending the confirmed process

Host:
- no redirected stdio, interactive-session launch on Windows services,
  idle-only upgrades, Claude tasks block server updates
- setup card, attachments, storage management and run registry for Claude

Web: remove the standalone Claude page; new monochrome Claude icon.
Android still uses the old screen and is not compatible yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If resolveSettings fails, the custom-endpoint guard no longer lets the run
through. When custom endpoints are not allowed, the spawned CLI also gets
ANTHROPIC_BASE_URL pinned to the official API. Bridge version 3 so the
running worker is replaced once idle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot show the old square

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phone session lists get one card per session with tighter line spacing;
desktop cards drop the fixed height. Claude list rows now carry
context_used/context_window like Codex and Hermes, cached per transcript
revision. Bridge version 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…came busy

The client sends the status the user confirmed; the bridge re-reads it just
before signalling and refuses if an idle holder has started a task. The
banner refreshes after a refusal. Bridge version 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bighamx
bighamx merged commit 9a2a722 into bighamx:master Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants