@xiaohhhh1/canvas-agent 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-instructions.md +1 -1
- package/dist/server/mcp.js +1 -1
- package/dist/workflow/manager.js +3 -3
- package/package.json +1 -1
package/agent-instructions.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
## 流程 C:脚本分镜到视频
|
|
16
16
|
|
|
17
17
|
- 用户要求打开带货任务时,调用 `open_flow_c_website`,不要输出或询问 Local URL、连接令牌。
|
|
18
|
-
- 网站把脚本任务交给本机 Codex 后,使用 `flow_c_get_script_task` 读取完整、服务器持久化的任务,再用 `flow_c_submit_script_chunk` 每次回传 1–
|
|
18
|
+
- 网站把脚本任务交给本机 Codex 后,使用 `flow_c_get_script_task` 读取完整、服务器持久化的任务,再用 `flow_c_submit_script_chunk` 每次回传 1–30 条。不要要求用户复制 JSON、选择交接文件或把短期令牌发到聊天中。
|
|
19
19
|
- 大批量脚本按本机助手指定的序号分段创作;批量大小不能成为降低质量、缩短脚本或套用模板的理由。每条都必须独立构思、符合目标市场自然语言习惯、保持紧凑但清晰可说完的 10 秒节奏。
|
|
20
20
|
- 写脚本和回传草案不创建付费任务。只有客户在网站审阅并确认费用后,中心服务才可开始故事板和视频生成。
|
|
21
21
|
|
package/dist/server/mcp.js
CHANGED
|
@@ -22,7 +22,7 @@ function registerWorkflowTools(server, config) {
|
|
|
22
22
|
inputSchema: { handoffId: z.string().uuid().describe("网站创建的脚本交接 ID") },
|
|
23
23
|
}, async ({ handoffId }) => workflowTool(config, `/agent/workflow/script-handoffs/${encodeURIComponent(handoffId)}/task`, { method: "GET" }));
|
|
24
24
|
server.registerTool("flow_c_submit_script_chunk", {
|
|
25
|
-
description: "把本段独立完成的 Flow C 高质量脚本持久化回传给网站。每次 1–
|
|
25
|
+
description: "把本段独立完成的 Flow C 高质量脚本持久化回传给网站。每次 1–30 条;成功后再创作下一段。",
|
|
26
26
|
inputSchema: {
|
|
27
27
|
handoffId: z.string().uuid().describe("脚本交接 ID"),
|
|
28
28
|
jobs: z.array(z.object({
|
package/dist/workflow/manager.js
CHANGED
|
@@ -10,7 +10,7 @@ import { CONFIG_DIR, ensureSiteWorkspace } from "../config.js";
|
|
|
10
10
|
import { logger } from "../utils/logger.js";
|
|
11
11
|
import { windowsPowerShellExecutable } from "../utils/windows.js";
|
|
12
12
|
const STATE_FILE = path.join(CONFIG_DIR, "workflow-state.json");
|
|
13
|
-
const SCRIPT_CHUNK_SIZE =
|
|
13
|
+
const SCRIPT_CHUNK_SIZE = 30;
|
|
14
14
|
const DOWNLOAD_POLL_MS = 10_000;
|
|
15
15
|
/** 本机持久化的 Flow C 控制器:脚本交给本机 Codex,视频直接落盘。 */
|
|
16
16
|
export class WorkflowManager {
|
|
@@ -84,8 +84,8 @@ export class WorkflowManager {
|
|
|
84
84
|
/** MCP 分段回传脚本,中心接口再次执行数量、产品索引和脚本完整性校验。 */
|
|
85
85
|
async submitScriptChunk(idValue, jobsValue) {
|
|
86
86
|
const record = this.scriptRecord(workflowId(idValue, "脚本交接 ID"));
|
|
87
|
-
if (!Array.isArray(jobsValue) || !jobsValue.length || jobsValue.length >
|
|
88
|
-
throw new Error(
|
|
87
|
+
if (!Array.isArray(jobsValue) || !jobsValue.length || jobsValue.length > SCRIPT_CHUNK_SIZE)
|
|
88
|
+
throw new Error(`每段必须包含 1–${SCRIPT_CHUNK_SIZE} 条脚本`);
|
|
89
89
|
const jobs = jobsValue;
|
|
90
90
|
const data = await commerceJson(`${record.apiBase}/workflow-script-handoffs/${encodeURIComponent(record.id)}/draft-chunks`, record.accessToken, "x-workflow-handoff-token", { method: "POST", body: JSON.stringify({ jobs }) });
|
|
91
91
|
const accepted = new Set(record.receivedOrdinals);
|