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:
2026-02-03 01:09:43 +01:00
parent af568f81c2
commit ef268ab0c7
2 changed files with 15 additions and 1 deletions

View File

@@ -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