# @gui-chat-plugin/mindmap 中文文档

规范地址：https://npmcn.com/package/%40gui-chat-plugin/mindmap/

版本：2\.1\.0
npm 元数据更新时间：2026-10-18T09:03:06.738Z
中文译文更新时间：2026-11-17T08:19:44.597Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40gui-chat-plugin/mindmap
原文对照：https://npmcn.com/package/%40gui-chat-plugin/mindmap/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.9 MB，35 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：1 个
- peer 依赖：vue ^3\.5\.0，react ^19\.2\.7，react-dom ^19\.2\.7，gui-chat-protocol ^2\.3\.0
- 首次发布：2026-01-24T22:37:40.505Z
- 最新版本发布：2026-10-18T09:03:06.490Z
- 近 30 天下载量：4979（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：12（近 12 个月 12 个）

## 中文简介

视觉集思广益交互式思维图插件Name

## 安装

```sh
npm install @gui-chat-plugin/mindmap
```

也可以使用：`pnpm add @gui-chat-plugin/mindmap`、`yarn add @gui-chat-plugin/mindmap`、`bun add @gui-chat-plugin/mindmap`

## README

# @ gui-chat- plugin/ mindmap (英语)

[![npm version](https://badge.fury.io/js/%40gui-chat-plugin%2Fmindmap.svg)](https://www.npmjs.com/package/@gui-chat-plugin/mindmap) [![scoria](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/receptron/GUIChatPluginMindMap/badges/scoria.json)](https://github.com/receptron/GUIChatPluginMindMap/actions/workflows/scoria.yml)

用于 GUI Chat 应用程序的互动心智图插件. 为集思广益和思想组织制作视觉心智图.

## 特征

-   创建带有中心想法和分支节点的思维图
-   交互添加、删除和连接节点
-   带有再平衡功能的自动放出
-   导出到 PNG 和 PDF
-   Vue 和 React 支持

## 安装

```bash
yarn add @gui-chat-plugin/mindmap gui-chat-protocol
```

> `gui-chat-protocol` 是一个对等的依赖性——与插件一起安装;主机应用程序提供运行时间,这个插件只宣布相容范围.

## 使用量

### Vue 整合

```typescript
// 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";
```

### 反应集成

```typescript
import MindMapPlugin from "@gui-chat-plugin/mindmap/react";
import "@gui-chat-plugin/mindmap/style.css";
```

### 仅使用核心

```typescript
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 密码

### 心电图

```typescript
// 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` | 改进布局的自动安排节点 |

## 测试提示

尝试这些提示测试插件 :

1.  "创造关于项目规划的心灵地图"
2.  "在心灵地图上添加关于营销的新想法"
3.  "连接设计开发节点"

## 发展

```bash
# 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 (英语)](https://github.com/receptron/gui-chat-protocol)
-   使用本协议的参考执行: [穆尔莫克](https://github.com/receptron/mulmoclaude) • 妇女 [穆尔莫聊天](https://github.com/receptron/MulmoChat)

## 常见问题

### @gui-chat-plugin/mindmap 是什么？

视觉集思广益交互式思维图插件Name

### 如何安装 @gui-chat-plugin/mindmap？

在项目目录运行 npm install @gui-chat-plugin/mindmap，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：gui-chat-protocol（^2\.3\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @gui-chat-plugin/mindmap 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @gui-chat-plugin/mindmap 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @gui-chat-plugin/mindmap 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @gui-chat-plugin/mindmap 可以商用吗？

@gui-chat-plugin/mindmap 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @gui-chat-plugin/mindmap 的下载量有多少？

根据 npm 官方下载统计，@gui-chat-plugin/mindmap 在 2026/10/17 – 2026/11/15 这 30 天内被下载 4,979 次，日均约 166 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @gui-chat-plugin/mindmap 还在维护吗？

最新版本 2\.1\.0 发布于 2026/10/18（30 天前）；至今共发布 12 个版本，其中过去 12 个月发布了 12 个；首次发布于 2026/01/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

