aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-aiassist.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-13 06:00:33 +0200
committerAgando <roduccomm@gmail.com>2026-06-13 06:00:33 +0200
commit764128fbf5c5516eb26700ca3cf2f1ad523c48bd (patch)
treeaa5d736107b55703a40a6f6701f44e7597cc710c /modules/core/module-aiassist.js
parent76e26bb6f16e35bffbf76896957bb9753241833c (diff)
auto: 2026-06-13_06:00 changes
Diffstat (limited to 'modules/core/module-aiassist.js')
-rw-r--r--modules/core/module-aiassist.js8
1 files changed, 4 insertions, 4 deletions
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':