feat(agent): 创作能力 - 接通专业节点发现与插件执行基础

This commit is contained in:
王志伟
2026-09-08 20:56:57 +08:00
parent 88f4b9ccdf
commit f69535c93f
29 changed files with 617 additions and 88 deletions

View File

@@ -13,6 +13,12 @@ const FALLBACK_MIN_SIZE = { width: 220, height: 160 } as const;
/** 批量注册节点定义 */
export function registerNodeDefinitions(defs: CanvasNodeDefinition[], ownerId = "builtin") {
const ids = new Set<string>();
for (const def of defs) {
const owner = ownerByType.get(def.type);
if (ids.has(def.type) || (owner && owner !== ownerId)) throw new Error(`节点类型重复或归属冲突:${def.type}`);
ids.add(def.type);
}
for (const def of defs) {
definitions.set(def.type, def);
ownerByType.set(def.type, ownerId);