feat(agent): 创作能力 - 接通专业节点发现与插件执行基础
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user