feat(canvas): 云端 Agent 画布 - 支持分镜连接、脚本节点与资产关系持久化

This commit is contained in:
ddcat666
2026-10-04 02:21:36 +08:00
parent 76ca0fd247
commit e70430e3e2
10 changed files with 505 additions and 37 deletions

View File

@@ -93,8 +93,12 @@ func BuiltinRegistry() *Registry {
GoodFor: []string{"多镜头规划", "镜头连续性", "逐镜审查和微调", "逐镜生成图片或视频", "需要他人接手维护的内容"},
NotIdealFor: []string{"只有一个画面的快速试验", "一次性临时提示词", "仅需要阅读排版的普通文档"},
Tradeoffs: []string{"前期录入成本高于文本节点", "但能保留镜头级结构、资产关系和后续维护能力"},
Actions: []string{"read_rows", "append_row", "update_row", "remove_row", "generate_storyboard"},
Actions: []string{"read_rows", "append_row", "update_row", "remove_row", "generate_storyboard", "connect_assets", "update_node"},
InputKind: "text",
Connection: ConnectionPolicy{CanSource: true, CanTarget: true, AcceptedInputKinds: []string{"audio", "character", "image", "text", "video"}},
CanUpdate: true,
SummaryFields: []string{"storyboard"}, DetailFields: []string{"storyboard"}, ProjectionKind: "storyboard", ProjectionField: "storyboard",
PatchFields: titleAndPositionPatchFields(),
CreateMetadata: func(string) map[string]any {
return map[string]any{"status": "idle", "workflowKind": "script", "storyboard": map[string]any{"rows": []any{}, "visibleColumns": []any{"shotNumber", "durationSeconds", "videoMotionPrompt", "dialogue", "assets"}, "referenceNodeIds": []any{}}}
},
@@ -178,14 +182,11 @@ func generatedMediaSemantics(nodeType string) generatedMediaCapabilitySemantics
}
}
func editableNodeFields(contentPath, contentLabel, contentDescription string) map[string]PatchField {
func titleAndPositionPatchFields() map[string]PatchField {
fields := map[string]PatchField{
"title": {
Path: "title", Kind: patchKindString, Label: "节点名称", Order: 10, Description: "节点标题", MaxRunes: maxAgentNodeTitleRunes,
},
"content": {
Path: contentPath, Kind: patchKindString, Label: contentLabel, Order: 20, Description: contentDescription, MaxRunes: maxAgentNodeContentRunes,
},
}
for key, field := range positionPatchFields() {
fields[key] = field
@@ -193,6 +194,14 @@ func editableNodeFields(contentPath, contentLabel, contentDescription string) ma
return fields
}
func editableNodeFields(contentPath, contentLabel, contentDescription string) map[string]PatchField {
fields := titleAndPositionPatchFields()
fields["content"] = PatchField{
Path: contentPath, Kind: patchKindString, Label: contentLabel, Order: 20, Description: contentDescription, MaxRunes: maxAgentNodeContentRunes,
}
return fields
}
// positionPatchFields 是坐标字段:模型可以直接指定节点位置(微调),批量整理走 canvas_arrange_nodes。
// 坐标上限与整理侧的收敛范围一致,避免写进离谱的几何值。
func positionPatchFields() map[string]PatchField {