Show metadata sections in node panel and preserve them during merge
- Render metadata.sections as labeled blocks in NodePanel sidebar - Fix memory_merge to carry forward metadata from merged nodes
This commit is contained in:
@@ -160,7 +160,9 @@ server.tool(
|
||||
const allTags = [...new Set(validNodes.flatMap(n => n.tags))];
|
||||
const mergedKind = (kind as NodeKind) ?? validNodes[0].kind;
|
||||
|
||||
const merged = await addNode({ kind: mergedKind, title, content, tags: allTags });
|
||||
// Merge metadata from all nodes (last wins for conflicting keys)
|
||||
const mergedMetadata = validNodes.reduce((acc, n) => ({ ...acc, ...n.metadata }), {} as Record<string, any>);
|
||||
const merged = await addNode({ kind: mergedKind, title, content, tags: allTags, metadata: mergedMetadata });
|
||||
const oldIds = new Set(validNodes.map(n => n.id));
|
||||
|
||||
// Relink edges from old nodes to merged node
|
||||
|
||||
Reference in New Issue
Block a user