feat(platform): Agent 能力 - 扩展画布读取与模型路由能力
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user