接入创作工作台会话导出

创作 Agent 工作台在原生壳中消费 file.exportText 导出会话 Markdown

补充会话导出按钮门控、payload 和错误提示测试

更新宿主壳能力文档和共享决策记录
This commit is contained in:
2026-06-19 08:22:38 +08:00
parent 6d7da493b9
commit b88ed43aef
5 changed files with 426 additions and 10 deletions
@@ -2381,6 +2381,13 @@
- 影响范围:`src/components/creation-agent/CreationAgentWorkspace.tsx``src/services/host-bridge/hostBridge.ts`、Expo / Tauri HostBridge 文档。
- 验证方式:`npm run check:native-shells``npm run test -- src/components/creation-agent/CreationAgentWorkspace.test.tsx`、针对变更文件执行 ESLint、`npm run typecheck``npm run check:encoding``git diff --check`
## 2026-06-19 创作 Agent 会话导出接入原生壳文本导出
- 背景:Expo / Tauri 壳已经实现 `file.exportText`,但 H5 创作 Agent 工作台还没有消费该能力;原生壳内又禁止网页自动下载和 `<a download>` 直接落盘,需要通过受控 HostBridge 保存用户可带走的文本。
- 决策:创作 Agent 工作台在 `native_app` 且宿主声明 `file.exportText` 时显示“导出会话”图标按钮,把当前会话标题、摘要、进度、锚点、消息、流式回复和输入草稿组装为 `text/markdown`,并在 H5 侧按共享 5 MiB 上限计算 UTF-8 byte 后再调用 `exportHostTextFile()`。普通浏览器、小程序、旧壳或裁剪壳不展示该入口;宿主取消或 unsupported 不触发浏览器下载回退,错误统一显示在 composer 上方现有状态条。
- 影响范围:`src/components/creation-agent/CreationAgentWorkspace.tsx``src/services/host-bridge/hostBridge.ts`、Expo / Tauri HostBridge 文档。
- 验证方式:`npm run check:native-shells``npm run test -- src/components/creation-agent/CreationAgentWorkspace.test.tsx`、针对变更文件执行 ESLint、`npm run typecheck``npm run check:encoding``git diff --check`
## 2026-06-18 反馈凭证上传接入原生壳图片导入
- 背景:帮助与反馈页的上传凭证入口在原生壳内仍只能触发浏览器隐藏文件输入;Expo / Tauri 壳已具备受控 `file.importImage` 图片选择能力。