feat(frontend): 支持 Roundtable 写文件流式预览与消息流聚合展示

功能说明:\n- 为写文件工具链增加流式预览状态模型(in-flight、chunk 归并、已完成)\n- 在消息面板中支持 write_file 流式 artifact 的动态插入/更新与完成态呈现\n- 优化 artifact 详情页的文件名与来源显示,兼容流式生成中文件路径\n- 在 Roundtable 工作流 step2 流程中注入与监听 write_file 事件,支持多阶段消息统一展示\n- 补充单测覆盖:streaming-write-preview、write-file-in-flight、streaming-artifacts 等关键路径
This commit is contained in:
董宏凯 committed 2026-09-02 12:52:33 +08:00
1 parent 553f72604a
commit f5bf7897b9
11 files changed
+266 -44

No files matched your search

@@ -3,11 +3,29 @@ import test from "node:test";
import {
collectRoundtableDeliverablePaths,
mergeRoundtableStreamingToolArgs,
newestChangedRoundtableArtifact,
resolveRoundtableStreamingWritePreview,
roundtableArtifactDiskSnapshot,
} from "./streaming-artifacts";
test("roundtable keeps streamed file bytes when a compact progress step only carries path", () => {
assert.deepEqual(
mergeRoundtableStreamingToolArgs(
{ path: "/mnt/user-data/outputs/report.md", content: "# 已接收的报告" },
{ path: "/mnt/user-data/outputs/report.md" },
),
{ path: "/mnt/user-data/outputs/report.md", content: "# 已接收的报告" },
);
assert.deepEqual(
mergeRoundtableStreamingToolArgs(
{ content: "# 内容先到" },
{ path: "/mnt/user-data/outputs/report.md", content: "" },
),
{ path: "/mnt/user-data/outputs/report.md", content: "# 内容先到" },
);
});
test("roundtable opens a provisional Markdown preview when content arrives before path", () => {
assert.equal(
resolveRoundtableStreamingWritePreview("write_file", { content: "# 报告\n正文" }),