feat: support uploaded images in debug voice preview

Allow paste/drag temporary image assets so vision turns work without a live camera frame.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xin Wang
2026-08-05 19:52:37 +08:00
co-authored by Cursor
parent 555c8f5fa6
commit e36ca308b8
16 changed files with 686 additions and 94 deletions
+24
View File
@@ -389,6 +389,30 @@ export const conversationsApi = {
request<{ ok: boolean }>(`/api/conversations/${id}`, { method: "DELETE" }),
};
// ---------- 调试会话临时图片 ----------
export type InputImageAsset = {
assetToken: string;
width: number;
height: number;
sizeBytes: number;
};
export const inputAssetsApi = {
uploadImage: (file: File) => {
const body = new FormData();
body.append("file", file);
return request<InputImageAsset>("/api/input-assets/image", {
method: "POST",
body,
});
},
remove: (assetToken: string) =>
request<{ ok: boolean }>(
`/api/input-assets/${encodeURIComponent(assetToken)}`,
{ method: "DELETE" },
),
};
// ---------- 工具 ----------
export type ToolStatus = "active" | "archived" | "draft";
export type ToolExecutionMode = "immediate" | "async";