Skip to content

feat: add standalone Web/PWA with shared CH threads - #518

Draft
BytePioneer-AI wants to merge 73 commits into
mainfrom
draft/standalone-web-ui
Draft

BytePioneer-AI wants to merge 73 commits into
mainfrom
draft/standalone-web-ui

Conversation

@BytePioneer-AI

@BytePioneer-AI BytePioneer-AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

状态与范围

Draft:统一收口独立 Web/PWA、共享 Host 通道和界面,暂不请求合并。

主干尚无独立 Web 入口,因此本 PR 包含基础入口及后续共享会话/界面改动,而非单独的侧栏补丁。差异主体是筛选导入的 DSH 浏览器源码;保留来源和 MIT notices。

按用户要求,原 feat/standalone-web 的 Host 实时通道、原生图标与 Composer 命令菜单,与侧栏轻量化、全局置顶、既有 CI 修复统一到本分支 draft/standalone-web-ui。实际开发目录与 3181 预览现在使用同一分支;旧独立工作树仅保留 detached 备份,不再作为另一条开发线。没有回退或覆盖其中任一套功能。

实现

  • 一个仓库、Desktop/Web 两个入口,复用已有 Harness 插件及公共契约,不另建 Adapter 或 MappingStore/会话写入所有者。
  • 默认复用本地 CH Host 的认证客户端通道,事件驱动刷新 canonical Threads、消息、工具进展、配置、审批和提问;旧 Host/显式 CDP 模式保留兼容入口。断线不切换执行所有者,不自动重发结果未知的写操作。
  • 项目导航依据 GUI 项目与 Thread assignment,保留真实 cwd;外置 worktree 归所属项目,旧错误导航仅隐藏,不删除会话或目录。
  • 历史首屏最近 5 轮 full,较早历史按需分页;上滑加载、阅读锚点、去重和失败重试。目录只广播变化项,仍保留 10 秒目录/GUI 元数据查询。
  • 全局“置顶”分区:跨所有工作区统一显示在顶部,保留 Harness 身份与 GUI 顺序,项目内不重复,不改变归属。使用 Desktop 原生置顶服务;共享模式不另存 Web 置顶事实,失败保留确认状态、不自动重试。GUI 外部置顶变化沿用目录轮询同步。
  • 侧栏使用轻量 DSH 视觉、紧凑间距、静止标题、键盘/右键交互和手机触摸入口;展开项目始终显示蓝色打开文件夹。
  • 原生 Harness 图标展示保持,模型/权限使用原生目录;Composer 命令菜单、认证、PWA 基础与显式 standalone 模式保留。
  • 本地共享 Web 恢复图片粘贴/选择/拖放:将 PNG/JPEG/WebP/GIF 字节保存到 Web 数据目录,沿用 Desktop 的附件路径上下文交给 Harness;不修改 Codex 配置,不另造图片协议。预览从 Native Thread 路径引用重建,保留认证、同源、大小/尺寸限制及会话读取授权。现在补齐普通文件原始字节上传、原生路径转交和历史卡片;standalone 附件仍未开放。

本次统一后的验证

  • TypeScript/插件构建、Web UI 构建及自包含打包通过:36 客户端插件、17 Harness 插件。
  • Web 后端测试 66 项通过,包括置顶、实时通道并存、拒绝/未知结果、并发读取和本地数据保留。
  • Host 客户端通道和 Thread 分区定向测试 17 项通过。
  • 统一发行包的浏览器回归 10 项通过:桌面/触摸全局置顶、侧栏、双浏览器实时消息/审批与恢复、两模式 Composer 菜单、Harness 图标/主题。
  • 侧栏展示窗口单测 4 项通过;npm run lint(含边界检查)、仓库 typecheck、改动格式与 git diff --check 通过。
  • 首轮触摸布局断言读到了既有 200ms 行移动动画的中间帧;测试改为等待动画结束再测量,未修改产品动画,随后统一发行包的全部 10 项定向回归通过。
  • 真实认证 localhost 预览在 1280/390px 只读验证:顶部全局置顶顺序与 GUI external Threads 一致、无重复项目行、命令菜单保留、page errors 为 0。未改变真实置顶、发送模型消息或提交审批。
  • 更新仅重启 Web。认证、全部 Harness 包及 Desktop/Host ownership 校验保持不变;未重启 Desktop。

图片恢复追加验证

  • 当前 Web 后端 73 项通过(包括字节保存、原生路径转交、旧页/重启恢复、拒绝/未知结果、认证/同源和 48 MiB 请求上限)。
  • 图片桌面真实键盘粘贴、触摸尺寸文件选择 2 项通过;首轮测试发现 Chromium 会重编码剪贴板 PNG,修正测试为核对实际粘贴字节,未放宽产品校验。
  • 两模式 Composer 菜单 4 项通过;最新自包含包的图片及实时通道浏览器测试 3 项通过。
  • 发行测试 2 项通过,包括仓库外运行及新增 image-size MIT 许可保留;Web UI 构建、lint、根 typecheck 通过。
  • 实际 3181 已更新并核对图片选择、缩略图和移除;自动验收没有向真实 Harness 发送消息;随后用户手动确认了当前会话的图片同步。两端图片引用在真实 Web 读取接口也均已确认可读,不等于全部 Harness/Model 已验收。

以上不是同一轮全仓全量测试,也不等于所有真实 Harness/物理设备验收;根 typecheck 仍不覆盖全部迁入 UI TypeScript。

原生附件兼容与通用文件追加

  • 原生 Desktop 图片上下文和结构化 local/inline 图片分别投影为正文、缩略图与附件;不改 Codex 配置或原生附件存储,缺失图片显示不可用提示,不展开执行上下文。
  • 本地通用文件不限制 MIME/扩展名,也不设单文件大小、文件数量、消息总大小或待用回执数量上限;沿用 DSH 后台上传、进度和草稿保留,流式保存原始字节,只有当前 Session 的 opaque receipt 能用于发送。选择文件不创建 Native Thread;确认创建后只迁移内存回执归属。
  • 混合图片/文件只向原有 Host/Harness 提交文本路径。确认接受后退休回执,拒绝/结果未知保留字节且不自动重发;历史由原生路径恢复。字节不解压/转码/执行,不新增通用文件下载或 PDF/Office 预览。
  • 原生附件阶段定向后端 28 项、打包浏览器 9 项及发行 2 项通过。通用文件阶段定向后端 29 项、打包浏览器 11 项及发行 2 项通过;文本保留边界后另跑定向后端和最终包文件/图片 4 项浏览器回归,均通过。各次结果不合并成一次全仓测试。
  • 当前 Web UI 构建、lint/边界、根 typecheck、改动格式和 diff 检查通过。真实 3181 已核对认证页面和不限制文件类型的入口;通用文件发送/拒绝测试仅用隔离 Host,没有向真实 Harness 自动提交文件。
  • 运行版本、分支和此 Draft PR 对齐;仅重启 Web,认证、Native Harness artifacts 及 Desktop/Host ownership 保持。

本地普通文件取消配额

  • 按用户要求移除原有 64 MiB/20 个/128 MiB 以及 1024 份待用回执上限。浏览器 Blob、Uint8Array、流都走原始字节接口,不退回有容量限制的 JSON RPC;图片限制、安全路径、字节完整性、同源/认证、Session 授权和原生权限保持。实际磁盘/文件系统/浏览器/网络约束仍然存在。
  • 本轮 11 项定向后端/上传载体测试、最终打包 7 项浏览器测试通过,包括两个 65 MiB 文件、23 个文件、总量超过 128 MiB 的正常发送;另覆盖 1025 份待用回执、声明长度/分块 HTTP 上传和拒绝/结果未知的回归。5 项当前发行测试、UI 构建、typecheck、lint/边界、格式和 diff 检查通过。
  • 同一分支期间合入的独立 Host 生命周期改动完整保留;初次检查发现其 TS/native Launcher 产物尚未重编译,重建后发行检查通过,没有为文件限额任务修改其实现。当前 3181 部署只重启 Web,继续使用原有在线 Desktop-owned Host,认证和 Host/桌面所有权保持。
  • 已认证真实目录确认不再宣告普通文件配额,图片政策未变;大文件发送验证仍为隔离 Host,未向真实 Harness 自动提交文件。

已知边界 / Draft 后续事项

  • 共享范围仍为本地 external-owned Threads,不包含官方 Codex 或远程 Hosts。GUI 项目元数据和原生置顶依赖现有 Desktop CDP 服务形状。
  • 事件通道是绝对状态收敛,不是逐 token 重放协议;仅更新 Web 不会自动升级运行中的 CH Host。
  • 共享通用文件预览/下载、Steering、完整子会话/后台任务、原生移动端封装与真机后台/推送生命周期仍有边界。图片路径要求与 Host 共用本地文件系统,未接入远程/WSL 路径转换,不代表所有 Model 具备视觉能力。
  • 未实现正文虚拟列表或按需 Host 目录分页;未提供全局置顶区拖动排序。
  • 手机启动/过渡中曾观察到侧栏偏移;本次未声称修复既有竞态。
  • Codingns4DSH 仅为行为参考,没有复制其 GPL 插件代码。私有 Desktop 提取代码、参考下载、截图、日志、认证数据与 .work 均未提交。

细节见 docs/product/standalone-web.md、docs/architecture/host-client-channel.md、apps/web-ui/README.md 和 packages/web-server/README.md。

Add a dedicated Harness picker, session-specific native permissions and sidebar brand icons. Preserve native mode descriptions, risk flags and creation scope, and surface rejected switches.

Support isolated multi-Harness previews while continuing to exclude Pi and Codex. Cover desktop/mobile controls, persistence and distribution resources with focused tests.
Use the existing Desktop Host for canonical external Threads without starting another Adapter or Mapping Store. Group navigation by GUI project membership while preserving explicit Web workspaces.\n\nLoad the latest five Turns first, prefetch one older page, preserve rendering anchors, and reuse idle history. Keep model and permission discovery off the history display path. Add shared-host, pagination, concurrency and browser coverage.
Publish only changed CH catalog entries to prevent browser update storms. Load older history on upward scrolling with stable anchors and explicit failure retries.

Move the turn navigator into the left gutter with graduated markers, right-hand previews, pointer scrubbing, keyboard navigation and responsive visibility.

Add catalog, switching, automatic paging and navigation regressions. Validation: 50 unit, 15 browser and 2 distribution tests; build, typecheck, lint and formatting. One question-answer test timed out initially; focused and full unit reruns passed.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Add authenticated owner/App channels with bounded invalidation replay, authoritative snapshots, submission receipts and shared interaction arbitration. Preserve Desktop projection behavior and recover Web display generations after Host restart. Render plugin iconStyle consistently in sidebar and picker without Pi-specific overrides.

Validation: 149 focused Host/protocol tests; 58 Web backend tests; 19 browser tests; distribution checks; TypeScript, lint/boundaries and UI build. An initial parallel native-presentation test opened the old session's picker before navigation completed; it now waits for the new draft before interacting. Real preview checks were read-only; no live model submission or approval was performed. Frontend strict typecheck coverage remains limited to the existing repository configuration.
Remove the duplicate Host /model descriptor and preserve launcher state across unchanged focus tracking. Project transport attachment availability so unsupported uploads are not advertised.

Add shared/standalone menu regressions for desktop and mobile widths. Validated in the working tree: 58 backend tests, 23 browser tests, 4 packed-menu tests, existing typecheck, lint/boundaries, UI build, and read-only live checks. Full migrated frontend strict typechecking remains outside the current root configuration.
Keep official Codex outside external model-restore fixtures, arm scripted interaction responses before publishing, and use native paths in platform-sensitive tests.

Match private Node executable paths without rejecting host-runtime/node_modules source labels. Add immediate-response and package-validation regressions; retain the artifact allowlist and original timeouts.

Validated in a clean worktree with Node 22: npm ci, build:typescript, typecheck, lint/boundaries, format:check, and test:typescript (6481 Vitest tests plus 52 Web tests).
# Conflicts:
#	packages/update-manager/test/update-manager.test.ts
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.

1 participant