feat(agent): Agent 工作台 - 计划插话记忆、统一模型选择器并修复摘要与视频入库
将计划清单、运行中插话和个人记忆接入云端 Agent;全站模型选择器统一为左右二级菜单。画布摘要按预算截断不再整轮拒绝,首页视频未知宽高可入库。README 补充贡献者 morrow。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b6bae4f957
commit
6892732b06
80 files changed
+7361
-179
No files matched your search
@@ -57,3 +57,35 @@ describe("parseAssetRecord", () => {
|
||||
expect(() => parseAssetRecordList([{ ...completeImage, id: "bad", tags: undefined }])).toThrow(/素材 bad/);
|
||||
});
|
||||
});
|
||||
|
||||
const completeVideo = {
|
||||
id: "video-1",
|
||||
kind: "video",
|
||||
title: "生成视频",
|
||||
coverUrl: "https://example.com/a.mp4",
|
||||
tags: ["生成"],
|
||||
createdAt: "2026-08-29T00:00:00.000Z",
|
||||
updatedAt: "2026-08-29T00:00:00.000Z",
|
||||
data: { url: "https://example.com/a.mp4", width: 720, height: 1280, bytes: 1, mimeType: "video/mp4" },
|
||||
};
|
||||
|
||||
describe("parseAssetRecord 视频尺寸", () => {
|
||||
test("宽高未知(0)放行,视频照常入库", () => {
|
||||
const parsed = parseAssetRecord({ ...completeVideo, data: { ...completeVideo.data, width: 0, height: 0 } });
|
||||
expect(parsed.kind).toBe("video");
|
||||
if (parsed.kind === "video") {
|
||||
expect(parsed.data.width).toBe(0);
|
||||
expect(parsed.data.height).toBe(0);
|
||||
}
|
||||
});
|
||||
|
||||
test("负数与非法值仍然拒", () => {
|
||||
expect(() => parseAssetRecord({ ...completeVideo, data: { ...completeVideo.data, width: -1 } })).toThrow(/width/);
|
||||
expect(() => parseAssetRecord({ ...completeVideo, data: { ...completeVideo.data, height: Number.NaN } })).toThrow(/height/);
|
||||
expect(() => parseAssetRecord({ ...completeVideo, data: { ...completeVideo.data, width: "720" } })).toThrow(/width/);
|
||||
});
|
||||
|
||||
test("图片不受影响:零尺寸仍然拒", () => {
|
||||
expect(() => parseAssetRecord({ ...completeImage, data: { ...completeImage.data, width: 0, height: 1 } })).toThrow(/width/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user