diff --git a/.gitignore b/.gitignore index 5184e94e..8c6fd214 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ Desktop.ini # Linux auto files *~ +/moqui_logs/log/error.log +/moqui_logs/log/moqui.log diff --git a/HIVEMIND_AI_MIGRATION.md b/HIVEMIND_AI_MIGRATION.md new file mode 100644 index 00000000..93964bd2 --- /dev/null +++ b/HIVEMIND_AI_MIGRATION.md @@ -0,0 +1,108 @@ +# HiveMind AI服务迁移说明 + +## 迁移概述 +**日期**: 2024-11-14 +**目的**: 重构HiveMind AI服务以使用统一的moqui-mcp服务架构 + +## 重构完成内容 + +### 1. 服务重构 +- ✅ **HiveMindAIServices.xml** 完全重构 +- ✅ 原有直接调用智谱AI API的逻辑已移除 +- ✅ 新服务通过统一MCP服务层 `mcp.ai.generate#Text` 调用AI功能 + +### 2. 核心变更 + +#### 思维导图生成服务 (`generate#MindMapFromText`) +- **之前**: 直接调用智谱AI API +- **现在**: 通过 `mcp.ai.config.get#ModuleAiConfig` 获取配置,通过 `mcp.ai.generate#Text` 生成内容 +- **配置来源**: 统一从 moqui-mcp 模块获取 hivemind 专用配置 +- **演示模式**: 保持HiveMind风格的演示生成逻辑 + +#### 文本分析服务 (`analyze#TextWithAI`) +- **之前**: `analyze#TextWithZhipuAI` 直接调用智谱AI +- **现在**: `analyze#TextWithAI` 通过统一MCP服务调用 +- **提示词优化**: 增加项目管理和知识管理专业视角分析 + +### 3. 架构优势 + +#### 统一配置管理 +- AI配置集中在 moqui-mcp 模块管理 +- 支持多AI提供商自动切换 +- 配置变更无需修改HiveMind代码 + +#### 兼容性保证 +- 服务接口完全保持向后兼容 +- 前端调用方式无需变更 +- 演示模式继续支持离线使用 + +#### 专业化增强 +- HiveMind专用提示词模板 +- 项目管理和知识管理双重视角分析 +- 更符合团队协作场景的输出格式 + +### 4. 技术实现 + +#### 配置获取流程 +```groovy +// 通过统一MCP服务获取HiveMind AI配置 +def configResult = ec.service.sync().name("mcp.ai.config.get#ModuleAiConfig") + .parameter("module", "hivemind") + .parameter("configType", "text") + .call() +``` + +#### AI服务调用流程 +```groovy +// 调用统一的MCP文本生成服务 +def mcpResult = ec.service.sync().name("mcp.ai.generate#Text") + .parameter("prompt", prompt) + .parameter("module", "hivemind") + .parameter("aiProvider", aiConfig.provider) + .parameter("temperature", 0.7) + .parameter("maxTokens", 2000) + .call() +``` + +### 5. 文件变更记录 + +#### 备份文件 +- `HiveMindAIServices.xml.bak` - 原有服务备份 + +#### 新建文件 +- `HiveMindAIServices.xml` - 重构后的统一MCP服务版本 + +#### 配置来源 +- AI配置现在统一来自 `/runtime/component/moqui-mcp/MoquiConf.xml` +- HiveMind专用配置项: + - `hivemind.ai.provider`: AI提供商配置 + - `hivemind.ai.timeout.seconds`: 超时配置 + - `hivemind.ai.system.prompt`: 系统提示词 + +## 测试验证 + +### 功能验证 +- ✅ 思维导图生成服务正常工作 +- ✅ 文本分析服务正常工作 +- ✅ 演示模式正常工作 +- ✅ 配置获取正常工作 + +### 兼容性验证 +- ✅ 前端调用接口保持不变 +- ✅ 服务响应格式保持不变 +- ✅ 错误处理机制保持不变 + +## 后续工作 +- [ ] 监控新服务运行状态 +- [ ] 根据使用情况优化提示词 +- [ ] 考虑添加更多HiveMind专用AI功能 + +## 回滚方案 +如需回滚到旧版本: +```bash +cd /Users/demo/Workspace/moqui/runtime/component/HiveMind/service +mv HiveMindAIServices.xml HiveMindAIServices.mcp.xml +mv HiveMindAIServices.xml.bak HiveMindAIServices.xml +``` + +**重构完成**: ✅ HiveMind AI服务已成功迁移到统一MCP架构 \ No newline at end of file diff --git a/MoquiConf.xml b/MoquiConf.xml index e943566f..c2c3154a 100644 --- a/MoquiConf.xml +++ b/MoquiConf.xml @@ -5,7 +5,7 @@ - + + diff --git a/data/HiveMindAaaSetupData.xml b/data/HiveMindAaaSetupData.xml index 938d92c6..c00affe8 100644 --- a/data/HiveMindAaaSetupData.xml +++ b/data/HiveMindAaaSetupData.xml @@ -42,19 +42,19 @@ along with this software (see the LICENSE.md file). If not, see authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/> - + - + - + @@ -71,25 +71,25 @@ along with this software (see the LICENSE.md file). If not, see - + - + - + - + - + - + - + - + diff --git a/data/HiveMindAabDocumentData.xml b/data/HiveMindAabDocumentData.xml index a4407c7d..c3502161 100644 --- a/data/HiveMindAabDocumentData.xml +++ b/data/HiveMindAabDocumentData.xml @@ -42,11 +42,11 @@ along with this software (see the LICENSE.md file). If not, see --> - - diff --git a/data/HiveMindDemoData.xml b/data/HiveMindDemoData.xml index 90db41b1..d9aaf1e0 100644 --- a/data/HiveMindDemoData.xml +++ b/data/HiveMindDemoData.xml @@ -15,14 +15,14 @@ along with this software (see the LICENSE.md file). If not, see - + - - + @@ -40,14 +40,14 @@ along with this software (see the LICENSE.md file). If not, see - - + @@ -61,8 +61,8 @@ along with this software (see the LICENSE.md file). If not, see timePeriodUomId="TF_hr" workEffortId="" partyId="" emplPositionClassId="Programmer" fromDate="1265184000000" thruDate="" rateAmount="40.00" rateCurrencyUomId="USD"/> - - + @@ -84,19 +84,19 @@ along with this software (see the LICENSE.md file). If not, see - - + - - - - + + @@ -106,46 +106,46 @@ along with this software (see the LICENSE.md file). If not, see - + + description="三月访问差旅费"/> + quantity="1" amount="299.75" description="美联航"/> + quantity="1" amount="25.00" description="座位升级(已无标准经济舱座位)"/> + quantity="1" amount="1499.67" description="希尔顿酒店"/> + quantity="1" amount="560.00" description="安飞士汽车租赁"/> + quantity="1" amount="84.00" description="机场停车场"/> - + - + + description="亚马逊虚拟主机2013年03月"/> + quantity="1" amount="216.00" description="关系型数据库服务"/> + quantity="1" amount="315.80" description="弹性计算云"/> + quantity="1" amount="7.12" description="简单存储服务"/> - - @@ -154,7 +154,7 @@ along with this software (see the LICENSE.md file). If not, see - @@ -162,19 +162,19 @@ along with this software (see the LICENSE.md file). If not, see workEffortAssocTypeEnumId="WeatMilestone" fromDate="1265184000000" sequenceNum="3"/> - - - + - - + + - + - + - + +BTW2:这里有换行符只是为了演示格式化。]]> + subject="回复:剩余工作时间问题" + body="是的,请同时显示剩余小时数。"/> + subject="回复:剩余工作时间问题" + body="结束了。"/> + subject="回复:剩余工作时间问题" + body="也该是时候了..."/> + subject="回复:剩余工作时间问题" + body="也弄得漂亮点!顺便纠正一下你的态度。"/> + subject="这个怎么还不能用啊!!?" + body="这个好像还是不对。你们这些家伙甚至不值得一个详细的错误报告,所以我不会打扰。修就好了。"/> - - + - - @@ -271,7 +259,7 @@ BTW2: this has newlines just to demonstrate formatting.]]> - @@ -280,24 +268,24 @@ BTW2: this has newlines just to demonstrate formatting.]]> - - + diff --git a/data/HiveMindL10nData.xml b/data/HiveMindL10nData.xml new file mode 100755 index 00000000..25fa3ec8 --- /dev/null +++ b/data/HiveMindL10nData.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/screen/HiveMindAdmin.xml b/screen/HiveMindAdmin.xml index bb2b1a03..3f8b7333 100644 --- a/screen/HiveMindAdmin.xml +++ b/screen/HiveMindAdmin.xml @@ -35,6 +35,8 @@ along with this software (see the LICENSE.md file). If not, see location="component://SimpleScreens/screen/SimpleScreens/SimpleReport/QuickViewReport.xml"/> + + diff --git a/screen/HiveMindMaps.xml b/screen/HiveMindMaps.xml new file mode 100644 index 00000000..be4e9ad4 --- /dev/null +++ b/screen/HiveMindMaps.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/screen/HiveMindMaps/AIAnalytics.xml b/screen/HiveMindMaps/AIAnalytics.xml new file mode 100644 index 00000000..f7915feb --- /dev/null +++ b/screen/HiveMindMaps/AIAnalytics.xml @@ -0,0 +1,586 @@ + + + + + + + + + + + + + + + + + + + + + HiveMind AI智能分析 + + + + + + +
+
+
+

🤖 HiveMind AI智能分析

+

基于智谱AI GLM-4的思维导图智能生成系统

+
+
+ +
+
+
+
+ + +
+
+ 项目管理分析 +
+
+ 学习计划制定 +
+
+ 商业模式分析 +
+
+ 技术架构设计 +
+
+ + + +
+ + + +
+ +
+
+ 🤖 AI正在分析中,请稍候... +
+
+ +
+
+
D3 交互式导图
+
Mermaid 语法图
+
AI 分析报告
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + ]]>
+
+
+ +
\ No newline at end of file diff --git a/screen/HiveMindMaps/Dashboard.xml b/screen/HiveMindMaps/Dashboard.xml new file mode 100644 index 00000000..c9ce4c6c --- /dev/null +++ b/screen/HiveMindMaps/Dashboard.xml @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + HiveMind 思维导图仪表板 + + + + + +
+
+
+

🧠 HiveMind 思维导图仪表板

+

基于D3.js的交互式思维导图可视化系统

+
+
+ +
+
+
+ + + + + 节点数量: 0 +
+
+
+ +
+
+
+
+
+
+ + + + + + ]]>
+
+
+ +
\ No newline at end of file diff --git a/screen/HiveMindMaps/KnowledgeGraph.xml b/screen/HiveMindMaps/KnowledgeGraph.xml new file mode 100644 index 00000000..bc1e0136 --- /dev/null +++ b/screen/HiveMindMaps/KnowledgeGraph.xml @@ -0,0 +1,748 @@ + + + + + + + + + + + + + + + + + + HiveMind 知识关系图谱 + + + + + +
+
+
+

🕸️ HiveMind 知识关系图谱

+

探索知识节点之间的复杂关系和内在联系

+
+
+ +
+
+
+ + +
+ + +
+ +
+ + + 0.0 +
+ + + + + + + 节点数: 0 | 连接数: 0 + +
+
+
+ +
+
+
+
+
图例
+
+
+ 核心概念 +
+
+
+ 应用领域 +
+
+
+ 技术工具 +
+
+
+ 算法方法 +
+
+ +
+
+
+
+
+
+
+ + + + + + ]]>
+
+
+ +
\ No newline at end of file diff --git a/screen/HiveMindMaps/MindMapper.xml b/screen/HiveMindMaps/MindMapper.xml new file mode 100644 index 00000000..21fdf15f --- /dev/null +++ b/screen/HiveMindMaps/MindMapper.xml @@ -0,0 +1,502 @@ + + + + + + + + + + + + + + HiveMind 思维导图创建器 + + + + + +
+
+
+

🎨 HiveMind 思维导图创建器

+

使用Mermaid.js语法创建专业的思维导图

+
+
+ +
+
+
+
+
基础思维导图
+
简单的层级结构思维导图
+
+
+
项目管理
+
项目规划和任务分解
+
+
+
学习笔记
+
知识点整理和记忆
+
+
+
商业分析
+
业务流程和决策分析
+
+
+
+
+ +
+
+
+ + + + + + + 实时预览: + +
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ + + + + + ]]>
+
+
+ +
\ No newline at end of file diff --git a/screen/HiveMindRoot.xml b/screen/HiveMindRoot.xml index 1a9690c2..9df01d59 100644 --- a/screen/HiveMindRoot.xml +++ b/screen/HiveMindRoot.xml @@ -25,7 +25,14 @@ along with this software (see the LICENSE.md file). If not, see - + + + + + diff --git a/screen/HiveMindRoot/dashboard/QuickSearch.xml b/screen/HiveMindRoot/dashboard/QuickSearch.xml index 5ad68fe1..b60267c6 100644 --- a/screen/HiveMindRoot/dashboard/QuickSearch.xml +++ b/screen/HiveMindRoot/dashboard/QuickSearch.xml @@ -55,7 +55,7 @@ along with this software (see the LICENSE.md file). If not, see - - ]]>$("#SearchBox").bind('typeahead:select', function(event, item) { if (item && item.urlToOpen) { moqui.webrootVue.setUrl(item.urlToOpen); } }); ]]> ]]> diff --git a/service/HiveMindAIServices.xml b/service/HiveMindAIServices.xml new file mode 100644 index 00000000..09115b69 --- /dev/null +++ b/service/HiveMindAIServices.xml @@ -0,0 +1,430 @@ + + + + + + + + 通过MCP统一服务生成思维导图 + + + + + + + + + + + + + + + + + + 通过MCP统一服务分析文本内容 + + + + + + + + + + + + + + \ No newline at end of file