feat(platform): Agent 与媒体能力 - 完善角色卡、音频协议与任务恢复链路

This commit is contained in:
ddcat666 committed 2026-10-01 09:42:51 +08:00
1 parent a8f83fedd5
commit 5650da6d31
91 files changed
+3438 -380

No files matched your search

@@ -34,6 +34,14 @@ type PatchField struct {
MaxRunes int
}
// NodeVariant 表示同一底层节点类型按 metadata.workflowKind 标记出的独立能力,
// 例如 text + workflowKind=character 的角色卡。变体可被发现、读取、引用和连线,
// 但不是可直接创建的节点类型:add_node 的 nodeType 枚举和 Resolve 都不会返回变体。
type NodeVariant struct {
BaseType string
WorkflowKind string
}
// Descriptor is the server-owned canvas contract. Agent tools, creation,
// persistence and state projection all consume this registry; no caller owns a
// second node allow-list.
@@ -58,6 +66,7 @@ type Descriptor struct {
ProjectionField string
PatchFields map[string]PatchField
CreateMetadata func(content string) map[string]any
Variant *NodeVariant
}
func (d Descriptor) Metadata(content string) map[string]any {
@@ -170,6 +179,8 @@ func inputKindLabel(kind string) string {
return "视频"
case "audio":
return "音频"
case "character":
return "角色卡"
default:
return "文本"
}