diff --git a/index.html b/index.html
index 3b3c5c4..d320da1 100644
--- a/index.html
+++ b/index.html
@@ -258,6 +258,7 @@
+
diff --git a/js/apiclient.js b/js/apiclient.js
index 94bd403..b29ab68 100644
--- a/js/apiclient.js
+++ b/js/apiclient.js
@@ -13,6 +13,7 @@ class APIClient {
this.promptFiles = {
canvas: 'prompts/canvas-prompt.txt',
swot: 'prompts/swot-prompt.txt',
+ thinksvg: 'prompts/thinksvg-prompt.txt',
echarts: 'prompts/echarts-prompt.txt',
mermaid: 'prompts/mermaid-prompt.txt',
onepage: 'prompts/onepage-prompt.txt'
@@ -20,6 +21,7 @@ class APIClient {
this.promptFallbacks = {
canvas: '你是一个专业的产品战略分析师,擅长创建产品画布。',
swot: '你是一个专业的商业战略分析师,擅长进行SWOT分析。',
+ thinksvg: '你是一名思维导图专家,擅长使用 SVG 生成清晰的思维导图。',
echarts:
'你是一个资深的数据可视化专家,精通将自然语言需求转化为 ECharts 配置对象,请输出结构化 JSON option。',
mermaid:
diff --git a/js/modules/thinksvg.js b/js/modules/thinksvg.js
new file mode 100644
index 0000000..a6fe297
--- /dev/null
+++ b/js/modules/thinksvg.js
@@ -0,0 +1,98 @@
+/**
+ * 思维导图模块
+ *
+ * 功能:基于用户输入生成 SVG 格式的思维导图
+ * 特性:
+ * - 支持多层级树形结构展示
+ * - 通过提示词引导 AI 生成布局和样式
+ * - 支持 SVG/PNG 导出
+ * - 历史记录持久化
+ */
+
+(function registerThinkSvgModule(global) {
+ 'use strict';
+
+ // 确保 ModuleRegistry 已初始化
+ if (!global.ModuleRegistry) {
+ throw new Error('ModuleRegistry 未初始化');
+ }
+
+ /**
+ * 解析 AI 响应,提取 SVG 内容
+ * @param {string} content - AI 返回的原始内容
+ * @returns {Object} 解析结果对象,包含 svgContent、beforeText、afterText 等字段
+ */
+ const parseResponse = (content) => Utils.parseSVGResponse(content);
+
+ // 注册思维导图模块
+ global.ModuleRegistry.register({
+ // 模块标识
+ id: 'thinksvg',
+
+ // 显示名称
+ label: '思维导图',
+
+ // 图标(使用 Phosphor Icons 的树形结构图标)
+ icon: 'ph:tree-structure-duotone',
+
+ // 渲染器类型
+ renderer: 'svg',
+
+ // 提示词键名(对应 prompts/thinksvg-prompt.txt)
+ promptKey: 'thinksvg',
+
+ // 本地存储命名空间
+ storageNamespace: 'module:thinksvg',
+
+ // 聊天配置
+ chat: {
+ // 输入框占位符
+ placeholder: '输入要梳理的主题或问题,我来生成思维导图…',
+
+ // 流式响应开始标记
+ streamStartToken: '```svg',
+
+ // 上下文窗口大小(保留最近 10 条消息)
+ contextWindow: 10
+ },
+
+ // 产物配置
+ artifact: {
+ // 产物类型
+ type: 'svg',
+
+ // 代码围栏标识
+ fence: 'svg',
+
+ // SVG 开始模式匹配
+ startPattern: /```(?:svg)?\s*
+
+```
\ No newline at end of file