feat(platform): Agent 能力 - 扩展画布读取与模型路由能力

This commit is contained in:
ddcat666
2026-10-10 04:40:16 +08:00
parent 09f9b8e902
commit 508cad2b4e
17 changed files with 390 additions and 34 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"yingce/backend/internal/assets"
"yingce/backend/internal/canvas/capability"
"yingce/backend/internal/repository"
)
@@ -453,6 +454,16 @@ func cloudAgentProjectNodeFields(node, meta map[string]any, descriptor capabilit
if !ok || (key == "content" && descriptor.GenerationMode != "") {
continue
}
// Some older uploads persist only a resource URL in the text node. Do not
// expose that locator as if it were the novel/script正文; the model must
// call canvas_read_text, which authorizes and reads the owned resource.
if key == "content" {
if text, isString := value.(string); isString && assets.ResourceID(text) != "" {
projected["contentAvailable"] = true
projected["contentSource"] = "resource"
continue
}
}
if safe, truncated := cloudAgentSafeProjection(value, textLimit); safe != nil {
projected[key] = safe
if truncated {