inkmap-mcp 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Inkmap — Interactive Markdown Mind Map & MCP App
2
2
 
3
- **Inkmap(墨图)** opens and edits local `.md` / `.markmap.md` files as an interactive, two-way synced mind map — directly inside **Claude Desktop**, **OpenAI Codex Desktop**, **Google Antigravity**, **Cursor**, **Claude Code**, **VS Code**, or your **local browser** (macOS, Ubuntu/Linux, Windows).
3
+ **Inkmap(墨图)** opens and edits local `.md` / `.markmap.md` files as an interactive, two-way synced mind map — directly inside **DeepSeek Harness (`dsh-inkmap`)**, **Claude Desktop**, **OpenAI Codex Desktop**, **Google Antigravity**, **Cursor**, **Claude Code**, **VS Code**, or your **local browser** (macOS, Ubuntu/Linux, Windows).
4
4
 
5
5
  - **Two-way live sync**: Edit nodes on the mind map or let your AI agent rewrite the `.md` file — both stay in sync instantaneously without corrupting Markdown formatting, tables, code blocks, KaTeX math, or Mermaid diagrams.
6
6
  - **Native MCP App (`@modelcontextprotocol/ext-apps`)**: Renders the interactive mind map canvas (`ui://inkmap/markdown.html`) directly inside MCP App-enabled AI clients.
@@ -24,6 +24,7 @@ npx -y inkmap-mcp@latest install claude-code # Claude Code CLI
24
24
  npx -y inkmap-mcp@latest install antigravity # Google Antigravity
25
25
  npx -y inkmap-mcp@latest install codex # OpenAI Codex Desktop
26
26
  npx -y inkmap-mcp@latest install cursor # Cursor
27
+ npx -y inkmap-mcp@latest install deepseek # DeepSeek Harness (dsh-inkmap)
27
28
  ```
28
29
 
29
30
  Optionally pre-authorize workspace directories:
@@ -72,12 +73,16 @@ npx -y inkmap-mcp@latest notes.markmap.md
72
73
 
73
74
  ### 1. 一键自动安装到本机 AI 客户端(支持 Ubuntu / macOS / Windows)
74
75
 
75
- 无需手动下载压缩包或手改 JSON 路径,终端执行一行命令即可自动检测并配置本机已安装的 **Claude Desktop、Claude Code、Google Antigravity、OpenAI Codex、Cursor**:
76
+ 无需手动下载压缩包或手改 JSON 路径,终端执行一行命令即可自动检测并配置本机已安装的 **DeepSeek Harness (`dsh-inkmap`)、Claude Desktop、Claude Code、Google Antigravity、OpenAI Codex、Cursor**:
76
77
 
77
78
  ```bash
78
79
  npx -y inkmap-mcp@latest install
79
80
  ```
80
81
 
82
+ 在 **DeepSeek Harness** 中,你也可以直接在左侧 **「插件」** 页面:
83
+ - 点击右上角 **「+ 添加插件」** 输入 **`dsh-inkmap`** 一键安装;
84
+ - 或开启「实验性插件 -> 自定义插件索引」,添加索引源 **`https://zhiyuanv.com/dsh-index.json`**,在「发现」标签页搜索 **「思维导图」** 即可找到并安装 **Inkmap 思维导图**。
85
+
81
86
  也可以指定单个客户端或预设工作区目录:
82
87
 
83
88
  ```bash
@@ -634,7 +634,7 @@ function licenseService(storage, getOrigin, { loginOnly = false, host: defaultHo
634
634
  installId: id,
635
635
  host: hostName,
636
636
  os,
637
- version: "0.3.0",
637
+ version: "0.3.2",
638
638
  locale: clientLocale(),
639
639
  tier,
640
640
  events
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inkmap-codex",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Open Markdown as an editable mind map with Inkmap.",
5
5
  "requires_local_executor": true,
6
6
  "interface": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "inkmap-codex",
4
- "version": "0.3.0",
4
+ "version": "0.3.2",
5
5
  "description": "Open Markdown as an editable mind map with Inkmap.",
6
6
  "extensions": {
7
7
  "com.openai": {
@@ -0,0 +1,20 @@
1
+ # Inkmap — Markdown mind map & Mermaid editor for DeepSeek Harness
2
+
3
+ Render and edit local Markdown (`.md` / `.markmap.md`) files as interactive mind maps (Markmap) and Mermaid flowcharts directly inside the **DeepSeek Harness right sidebar**.
4
+
5
+ ## Highlights
6
+
7
+ - **One-click sidebar action**: When previewing any `.md` file in DeepSeek Harness, click **Inkmap** in the top-right document preview toolbar to open an interactive mind map tab beside the preview.
8
+ - **Real-time two-way Markdown sync**: Add, edit, reorder, or drag-and-drop nodes on the canvas and changes are written back to your local `.md` file immediately while preserving unmodified lines.
9
+ - **Full mind map keyboard shortcuts**: `Tab` (insert child), `Enter` (insert sibling), `Shift+Tab` (insert parent), `⌘↑` / `⌘↓` (move node), `⌘E` (edit node Markdown), `⌘S` (save immediately), and `Backspace` (delete).
10
+ - **Mermaid diagrams, LaTeX math & tables**: Native inline rendering of Mermaid flowcharts/sequence/state diagrams, KaTeX math formulas, and Markdown tables.
11
+ - **9 layouts, 4 themes & PNG/SVG export**: Switch between logical structure, mind map, org chart, catalog, timeline, and fishbone layouts with dark mode and high-resolution export.
12
+
13
+ ## Installation
14
+
15
+ - **In DeepSeek Harness**: Open **Plugins** -> Click **+ Add plugin** -> Enter `dsh-inkmap`.
16
+ - **One-line CLI installer**:
17
+ ```bash
18
+ npx -y inkmap-mcp@latest install
19
+ ```
20
+ - **Website**: https://zhiyuanv.com/software.html
@@ -0,0 +1,20 @@
1
+ # Inkmap 思维导图(DeepSeek Harness 原生插件)
2
+
3
+ 将工作区内的本地 Markdown (`.md` / `.markmap.md`) 文件直接在 **DeepSeek Harness 右侧分栏** 渲染为可交互、可双向编辑的思维导图(Markmap)与 Mermaid 流程图。
4
+
5
+ ## 核心特性
6
+
7
+ - **右侧栏一键打开**:在 DeepSeek Harness 中预览任意 `.md` 文件时,点击右上角工具栏的 **「Inkmap(用 Inkmap 打开)」** 按钮,即可在右侧并排打开可编辑思维导图。
8
+ - **Markdown ⇄ 思维导图双向实时同步**:在思维导图中增删改查或拖拽重组节点,底层 `.md` 源文件毫秒级自动写回,未修改段落原样保留。
9
+ - **全套思维导图快捷键**:支持 `Tab`(添加子节点)、`Enter`(添加同级节点)、`Shift+Tab`(添加父节点)、`⌘↑` / `⌘↓`(上下移动节点)、`⌘E`(编辑节点 Markdown)、`⌘S`(立即保存)、`Backspace`(删除节点)及双击内联编辑。
10
+ - **Mermaid 流程图 + LaTeX 数学公式 + Markdown 表格**:节点内原生渲染复杂流程图、状态图、时序图、数学公式与多列表格,支持独立弹窗无损缩放与源码实时编辑。
11
+ - **9 种专业结构与 4 套主题配色**:逻辑结构图、左右思维导图、组织结构图、目录组织图、时间轴、鱼骨图及深色护眼主题,支持一键导出高清 PNG 与矢量 SVG。
12
+
13
+ ## 安装方式
14
+
15
+ - **方式一(在 DeepSeek Harness 插件页安装)**:打开左侧「插件」-> 点击右上角「+ 添加插件」-> 输入 `dsh-inkmap` 回车即可安装并自动启用。
16
+ - **方式二(命令行一键安装全平台)**:
17
+ ```bash
18
+ npx -y inkmap-mcp@latest install
19
+ ```
20
+ - **官方网站**:https://zhiyuanv.com/software.html
@@ -0,0 +1,229 @@
1
+ window.__ModuleLoader__.load({ id: "dsh-inkmap", factory: require => { const module = { exports: {} }; const exports = module.exports;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/harness/src/client.mjs
21
+ var client_exports = {};
22
+ __export(client_exports, {
23
+ apply: () => apply,
24
+ inject: () => inject
25
+ });
26
+ module.exports = __toCommonJS(client_exports);
27
+ var import_react = require("react");
28
+
29
+ // packages/core/dist/product.js
30
+ var YUNFAN_BILLING_ORIGIN = "https://zhiyuanv.com";
31
+ function billingFlowUrl(raw, origin, mode, legacy = false) {
32
+ if (typeof raw !== "string")
33
+ throw new Error("Invalid Yunfan account link.");
34
+ const url = new URL(raw);
35
+ const base = mode === "restore" && !legacy ? "login" : "checkout";
36
+ if (url.protocol !== "https:" || url.origin !== origin || url.username || url.password || url.search || url.hash || !new RegExp(`^/billing/${base}/[0-9a-f]{32}$`).test(url.pathname)) {
37
+ throw new Error("Invalid Yunfan account link.");
38
+ }
39
+ return url.href;
40
+ }
41
+ var DAY_MS = 24 * 60 * 60 * 1e3;
42
+ var TRIAL_MS = 7 * DAY_MS;
43
+
44
+ // packages/harness/src/shared.mjs
45
+ var packageName = "dsh-inkmap";
46
+ var kind = "inkmap-markdown";
47
+ var actionSlot = "sidebar.right.tab.document.actions";
48
+ var bodySlot = "sidebar.right.pane.tab";
49
+ var route = "/inkmap-harness/session";
50
+ var prefix = "dsh-resource://file/session/";
51
+ function fileAddress(sessionId, absolutePath) {
52
+ const path = /^(?:[A-Z]:[\\/]|\\\\)/i.test(absolutePath) ? absolutePath.replaceAll("\\", "/") : absolutePath;
53
+ return prefix + encodeURIComponent(sessionId) + "/" + path.split("/").map(encodeURIComponent).join("/");
54
+ }
55
+ function selectedFile(address) {
56
+ if (typeof address !== "string" || !address.startsWith(prefix)) return;
57
+ try {
58
+ const [session, ...segments] = address.slice(prefix.length).split("/");
59
+ const sessionId = decodeURIComponent(session);
60
+ const path = segments.map(decodeURIComponent).join("/");
61
+ if (sessionId && /\.md$/i.test(path)) return { sessionId, path };
62
+ } catch {
63
+ }
64
+ }
65
+
66
+ // packages/harness/src/client.mjs
67
+ var inject = ["slots", "sidebarRight", "sidebarRightTabs"];
68
+ var zh = () => /^zh\b/i.test(document.documentElement.lang || navigator.language);
69
+ var label = () => zh() ? "\u7528 Inkmap \u6253\u5F00" : "Open in Inkmap";
70
+ var desktop = () => location.protocol === "dsh-app:" && location.hostname === "app";
71
+ var actionClass = "inkmap-harness-open";
72
+ var request = (method, body) => fetch(route, {
73
+ method,
74
+ headers: { "content-type": "application/json" },
75
+ body: JSON.stringify(body),
76
+ keepalive: method === "DELETE"
77
+ });
78
+ function apply(ctx) {
79
+ const sessions = /* @__PURE__ */ new Map();
80
+ function session(tab) {
81
+ if (sessions.has(tab.signal)) return sessions.get(tab.signal).opened;
82
+ if (tab.signal.aborted) return Promise.reject(new Error("Closed Inkmap tab"));
83
+ const opened = request("POST", { address: tab.contentId }).then(async (response) => {
84
+ if (!response.ok) throw new Error("Inkmap file is unavailable");
85
+ const data = await response.json();
86
+ if (typeof data.lease !== "string" || typeof data.url !== "string" || !/^http:\/\/127\.0\.0\.1:\d+\/s\/[a-f0-9]{48}\/$/.test(data.url)) {
87
+ throw new Error("Invalid Inkmap editor address");
88
+ }
89
+ return data;
90
+ });
91
+ void opened.catch(() => {
92
+ tab.signal.removeEventListener("abort", release);
93
+ sessions.delete(tab.signal);
94
+ });
95
+ function release() {
96
+ tab.signal.removeEventListener("abort", release);
97
+ sessions.delete(tab.signal);
98
+ void opened.then(({ lease }) => request("DELETE", { lease })).catch(() => {
99
+ });
100
+ }
101
+ sessions.set(tab.signal, { opened, release });
102
+ tab.signal.addEventListener("abort", release, { once: true });
103
+ return opened;
104
+ }
105
+ function OpenAction({ absolutePath }) {
106
+ if (typeof absolutePath !== "string" || !/\.md$/i.test(absolutePath) || !desktop() && !["127.0.0.1", "[::1]", "localhost"].includes(location.hostname)) return null;
107
+ return (0, import_react.createElement)("button", {
108
+ type: "button",
109
+ className: actionClass,
110
+ title: label(),
111
+ "aria-label": label(),
112
+ onClick(event) {
113
+ const sessionId = ctx.sidebarRight.mounted.getSnapshot();
114
+ if (!sessionId) return;
115
+ const target = ctx.sidebarRight.focusedTarget(event.currentTarget);
116
+ const paneId = target?.host === "dock" ? target.paneId : void 0;
117
+ ctx.sidebarRight.openResource(fileAddress(sessionId, absolutePath), { kind, paneId, preferNewPane: true });
118
+ }
119
+ }, (0, import_react.createElement)("svg", {
120
+ width: 15,
121
+ height: 15,
122
+ viewBox: "0 0 16 16",
123
+ fill: "none",
124
+ stroke: "currentColor",
125
+ strokeWidth: 1.3,
126
+ strokeLinecap: "round",
127
+ strokeLinejoin: "round",
128
+ "aria-hidden": true
129
+ }, (0, import_react.createElement)("path", { d: "M2 2.75h12v10.5H2zM7.5 2.75v10.5M10 8h2.5m-1.25-1.25v2.5" })), "Inkmap");
130
+ }
131
+ function EditorBody({ useTabInfo }) {
132
+ const { tab } = useTabInfo();
133
+ const [view, setView] = (0, import_react.useState)({});
134
+ const frame = (0, import_react.useRef)(null);
135
+ (0, import_react.useEffect)(() => {
136
+ let mounted = true;
137
+ void session(tab).then(
138
+ ({ url, lease }) => {
139
+ if (mounted) setView({ signal: tab.signal, url, lease });
140
+ },
141
+ () => {
142
+ if (mounted) setView({ signal: tab.signal, failed: true });
143
+ }
144
+ );
145
+ return () => {
146
+ mounted = false;
147
+ };
148
+ }, [tab.signal, tab.contentId]);
149
+ (0, import_react.useEffect)(() => {
150
+ if (!desktop() || view.signal !== tab.signal || !view.url) return;
151
+ const origin = new URL(view.url).origin;
152
+ let mounted = true;
153
+ async function openAccount(event) {
154
+ const { source, data } = event;
155
+ if (!source || source !== frame.current?.contentWindow || event.origin !== origin || data?.type !== "inkmap:open-account" || typeof data.id !== "string" || tab.signal.aborted) return;
156
+ let ok = false;
157
+ try {
158
+ const response = await request("POST", { lease: view.lease, action: "sign-in" });
159
+ if (!response.ok) throw new Error("Inkmap sign-in is unavailable");
160
+ const url = billingFlowUrl((await response.json()).url, YUNFAN_BILLING_ORIGIN, "restore");
161
+ if (!mounted || tab.signal.aborted) return;
162
+ window.open(url, "_blank", "noopener,noreferrer");
163
+ ok = true;
164
+ } catch {
165
+ }
166
+ if (mounted) source.postMessage({ type: "inkmap:open-account", id: data.id, ok }, origin);
167
+ }
168
+ window.addEventListener("message", openAccount);
169
+ return () => {
170
+ mounted = false;
171
+ window.removeEventListener("message", openAccount);
172
+ };
173
+ }, [tab.signal, view]);
174
+ if (view.signal !== tab.signal || !view.url) {
175
+ const failed = view.signal === tab.signal && view.failed;
176
+ const message = failed ? zh() ? "\u65E0\u6CD5\u6253\u5F00\u6B64\u6587\u4EF6\u3002\u8BF7\u9009\u62E9\u672C\u673A\u5DE5\u4F5C\u533A\u5185\u7684 Markdown \u6587\u4EF6\u3002" : "Could not open this file. Select a Markdown file in the local workspace." : zh() ? "\u6B63\u5728\u6253\u5F00 Inkmap\u2026" : "Opening Inkmap\u2026";
177
+ return (0, import_react.createElement)("p", { role: failed ? "alert" : "status", style: { padding: 16 } }, message);
178
+ }
179
+ return (0, import_react.createElement)("iframe", {
180
+ ref: frame,
181
+ src: desktop() ? `${view.url}?account-navigation=host` : view.url,
182
+ title: "Inkmap",
183
+ referrerPolicy: "no-referrer",
184
+ sandbox: "allow-scripts allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox",
185
+ style: { display: "block", width: "100%", height: "100%", border: 0 }
186
+ });
187
+ }
188
+ ctx.effect(() => ctx.sidebarRightTabs.register({
189
+ id: packageName,
190
+ kind,
191
+ canOpen: (address) => !!selectedFile(address),
192
+ title: () => "Inkmap",
193
+ keepMounted: true
194
+ }), "Inkmap sidebar tab");
195
+ ctx.effect(() => ctx.slots.inject(actionSlot, () => ctx.slots.register({
196
+ name: actionSlot,
197
+ id: packageName
198
+ }, OpenAction)), "Inkmap Markdown action");
199
+ ctx.effect(() => ctx.slots.inject(bodySlot, () => ctx.slots.register({
200
+ name: bodySlot,
201
+ key: packageName
202
+ }, EditorBody)), "Inkmap sidebar editor");
203
+ ctx.effect(() => {
204
+ const style = document.createElement("style");
205
+ style.textContent = `
206
+ .${actionClass} { display: inline-flex; align-items: center; gap: 5px; height: 26px;
207
+ padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: inherit;
208
+ font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
209
+ .${actionClass}:hover { background: var(--dsw-alias-interactive-bg-hover, #8882); }
210
+ .${actionClass}:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
211
+ `;
212
+ document.head.append(style);
213
+ return () => style.remove();
214
+ }, "Inkmap Markdown toolbar style");
215
+ ctx.effect(() => {
216
+ const releaseAll = () => {
217
+ for (const { release } of sessions.values()) release();
218
+ };
219
+ const pageHidden = (event) => {
220
+ if (!event.persisted) releaseAll();
221
+ };
222
+ window.addEventListener("pagehide", pageHidden);
223
+ return () => {
224
+ window.removeEventListener("pagehide", pageHidden);
225
+ releaseAll();
226
+ };
227
+ }, "Inkmap tab sessions");
228
+ }
229
+ return module.exports; } });
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: inkmap
3
+ name: dsh-inkmap