完善二期清单

This commit is contained in:
Azmat@qq.com
2026-08-18 14:11:05 +08:00
parent d1ecb52125
commit dfe94a923e
55 changed files with 1754 additions and 137 deletions
+19
View File
@@ -37,6 +37,7 @@ import type {
Product,
Project,
RechargeResult,
ScriptTemplate,
ScriptVersion,
Team,
TeamMember,
@@ -258,6 +259,7 @@ export const api = {
createProduct(payload: {
title?: string;
brand?: string;
business_type?: string;
category?: string;
target_audience?: string;
description?: string;
@@ -342,6 +344,23 @@ export const api = {
{ method: "POST", body: formData }
);
},
// ── 套路模板(5.1 存 / 5.2 换商品重跑)· 团队隔离 ──
// 存模板只抽套路不抽文案:后端从这版脚本抽镜数/每镜作用/节奏/商品露出/转化写法。
saveProjectAsTemplate(projectId: string, payload: { name: string; script_version_id?: string }) {
return request<ScriptTemplate>(`/api/projects/${projectId}/save-as-template/`, {
method: "POST",
body: JSON.stringify(payload),
});
},
listScriptTemplates() {
return request<Paginated<ScriptTemplate>>("/api/script-templates/");
},
renameScriptTemplate(id: string, name: string) {
return request<ScriptTemplate>(`/api/script-templates/${id}/`, { method: "PATCH", body: JSON.stringify({ name }) });
},
deleteScriptTemplate(id: string) {
return request<void>(`/api/script-templates/${id}/`, { method: "DELETE" });
},
// 对话式脚本 agent · 流式(SSE)。逐帧回调 onEvent:tool(工具卡)/delta(思考前言)/draft/saved/done/error。
// 用 fetch + ReadableStream 消费 text/event-stream(EventSource 只支持 GET,这里要 POST 带 body)。
async agentScriptStream(