From 764128fbf5c5516eb26700ca3cf2f1ad523c48bd Mon Sep 17 00:00:00 2001 From: Agando Date: Sat, 13 Jun 2026 06:00:33 +0200 Subject: auto: 2026-06-13_06:00 changes --- modules/core/module-aiassist.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/core/module-aiassist.js') diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index 5a0c389..5273678 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -1836,11 +1836,11 @@ buildSystemPrompt() { if (!mindmap) return JSON.stringify({ error: 'MindmapModule not loaded' }); const topic = a.topic || 'Mindmap'; const children = a.children || ''; - mindmap.root = null; const args = topic.split(' '); mindmap._new(args); - if (!mindmap.root) return JSON.stringify({ error: 'Failed to create root' }); - const rootId = mindmap.root.id; + const cur = mindmap._ensureMindmap(); + if (!cur) return JSON.stringify({ error: 'Failed to create mindmap' }); + const rootId = cur.root.id; const added = []; if (children) { const childNames = children.split(',').map(c => c.trim()).filter(Boolean); @@ -1850,7 +1850,7 @@ buildSystemPrompt() { } } mindmap._svg([]); - return JSON.stringify({ success: true, topic, children: added.length ? added : 'none', nodes: mindmap._countNodes(mindmap.root), rendered: 'inline SVG in terminal' }); + return JSON.stringify({ success: true, topic, children: added.length ? added : 'none', nodes: mindmap._countNodes(cur.root), rendered: 'inline SVG in terminal' }); } case 'view_module': case 'edit_module': -- cgit v1.2.3