fix(canvas): 角色卡引用 - 修复三视图读取与本地图片生成

This commit is contained in:
yepwait committed 2026-09-30 11:47:00 +08:00
1 parent 74e7ebed8f
commit 6bbc2849dd
22 files changed
+686 -28

No files matched your search

+17 -6
View File
@@ -612,9 +612,13 @@ const (
func cloudAgentCanvasSummary(canvas *model.CanvasProject, focusNodeIDs ...string) (string, error) {
var payload struct {
Nodes []struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Metadata struct {
WorkflowKind string `json:"workflowKind"`
CharacterAssetID string `json:"characterAssetId"`
} `json:"metadata"`
} `json:"nodes"`
Connections []struct {
FromNodeID string `json:"fromNodeId"`
@@ -659,9 +663,13 @@ func cloudAgentCanvasSummary(canvas *model.CanvasProject, focusNodeIDs ...string
}
}
candidates := make([]struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Metadata struct {
WorkflowKind string `json:"workflowKind"`
CharacterAssetID string `json:"characterAssetId"`
} `json:"metadata"`
}, 0, len(payload.Nodes))
if len(focus) > 0 {
// Always retain explicitly selected nodes before neighbors when a highly
@@ -685,6 +693,9 @@ func cloudAgentCanvasSummary(canvas *model.CanvasProject, focusNodeIDs ...string
break
}
item := map[string]any{"id": truncateRunes(node.ID, 100), "type": truncateRunes(node.Type, 40), "title": truncateRunes(node.Title, 80)}
if node.Type == "text" && node.Metadata.WorkflowKind == "character" {
item["kind"] = "character"
}
if _, known := cloudAgentNodeCapabilityForType(node.Type); !known {
item["agentSupported"] = false
}