@ gui-chat- plugin/ mindmap (英语)
用于 GUI Chat 应用程序的互动心智图插件. 为集思广益和思想组织制作视觉心智图.
特征
- 创建带有中心想法和分支节点的思维图
- 交互添加、删除和连接节点
- 带有再平衡功能的自动放出
- 导出到 PNG 和 PDF
- Vue 和 React 支持
安装
yarn add @gui-chat-plugin/mindmap gui-chat-protocol
gui-chat-protocol是一个对等的依赖性——与插件一起安装;主机应用程序提供运行时间,这个插件只宣布相容范围.
使用量
Vue 整合
// In src/tools/index.ts
import MindMapPlugin from "@gui-chat-plugin/mindmap/vue";
const pluginList = [
// ... other plugins
MindMapPlugin,
];
// In src/main.ts
import "@gui-chat-plugin/mindmap/style.css";
反应集成
import MindMapPlugin from "@gui-chat-plugin/mindmap/react";
import "@gui-chat-plugin/mindmap/style.css";
仅使用核心
import { executeMindMap, TOOL_DEFINITION } from "@gui-chat-plugin/mindmap";
// Create a mind map
const result = await executeMindMap(context, {
action: "create",
title: "Project Ideas",
centralIdea: "New Product",
ideas: ["Feature A", "Feature B", "Feature C"],
});
// Nest `ideas` to build every level in one call — the only way to get a
// multi-level map on hosts that keep no mind map state between calls
const tree = await executeMindMap(context, {
action: "create",
title: "Revenue",
centralIdea: "Revenue",
ideas: [
{ text: "Marketing", children: [{ text: "SNS", children: [{ text: "X" }] }, { text: "Ads" }] },
"Sales",
],
});
context 也许 null 编号 : undefined ——没有客户端状态的东道主(an
MCP/服务器桥)可以调用 executeMindMap 没有上下文。 行动
需要一个已有的地图然后查看 existingMap 在坐标中,返回一个
如果无需要编辑,则会出现错误.
API 密码
心电图
// A branch: a plain label, or a label with nested branches (any depth)
type IdeaInput = string | { text: string; children?: IdeaInput[] };
interface MindMapArgs {
action: "create" | "add_node" | "delete_node" | "connect" | "update" | "rebalance";
title?: string; // Title of the mind map
centralIdea?: string; // Central idea for new mind map
ideas?: IdeaInput[]; // Branches of the central idea, nestable
parentNodeId?: string; // Parent node for add_node — node ID or label text
newIdea?: string; // New idea text for add_node
nodeIdToDelete?: string; // Node to delete — node ID or label text
fromNodeId?: string; // Source node for connection — node ID or label text
toNodeId?: string; // Target node for connection — node ID or label text
connectionLabel?: string; // Label for connection
}
节点引用要么接受生成的节点ID,要么接受节点的标签. A 类 标签以不区分大小写方式匹配:先准确的文本,然后是子字符串。 如果是 匹配任何内容——或几个节点——调用返回错误结果列表 地图的标签,并留下地图未被更改.
行动
| 行动 | 说明 |
|---|---|
create | 创建一个带有中心思想和分支的新思维图(已删除) ideas 构建整个等级体系) |
add_node | 将新节点添加为已存在的节点的子节点 |
delete_node | 删除节点及其子 |
connect | 在两个节点之间创建连接 |
update | 更新已有的心智图 |
rebalance | 改进布局的自动安排节点 |
测试提示
尝试这些提示测试插件 :
- "创造关于项目规划的心灵地图"
- "在心灵地图上添加关于营销的新想法"
- "连接设计开发节点"
发展
# Install dependencies
yarn install
# Run Vue demo
yarn dev
# Run React demo
yarn dev:react
# Build
yarn build
# Lint
yarn lint
# Test
yarn test
许可证
麻省理工学院
相关
- 协议规格 : gui-chat-protocol (英语)
- 使用本协议的参考执行: 穆尔莫克 • 妇女 穆尔莫聊天