inkmap-mcp 0.2.4 → 0.2.6
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/dist/cli.cjs
CHANGED
|
@@ -38853,7 +38853,11 @@ function K3(Z, $, J, X) {
|
|
|
38853
38853
|
function N3(Z, $, J, X, V) {
|
|
38854
38854
|
return Z.registerResource($, J, { mimeType: p, ...X }, V);
|
|
38855
38855
|
}
|
|
38856
|
-
|
|
38856
|
+
function Y3(Z) {
|
|
38857
|
+
if (!Z) return;
|
|
38858
|
+
return Z.extensions?.[TQ];
|
|
38859
|
+
}
|
|
38860
|
+
var r, v, K, QQ, ZQ, $Q, I, P, w, JQ, Y, j, XQ, H, _, A, f, u, E, VQ, O, DQ, d, h, LQ, WQ, BQ, R, m, GQ, dQ, KQ, NQ, YQ, U, T, k, jQ, FQ, M, C, p, TQ;
|
|
38857
38861
|
var init_server4 = __esm({
|
|
38858
38862
|
"node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js"() {
|
|
38859
38863
|
init_protocol();
|
|
@@ -38945,6 +38949,7 @@ container holding the app. Specify either width or maxWidth, and either height o
|
|
|
38945
38949
|
M = external_exports.object({ protocolVersion: external_exports.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: ImplementationSchema.describe("Host application identification and version."), hostCapabilities: d.describe("Features and capabilities provided by the host."), hostContext: T.describe("Rich context about the host environment.") }).passthrough();
|
|
38946
38950
|
C = "ui/resourceUri";
|
|
38947
38951
|
p = "text/html;profile=mcp-app";
|
|
38952
|
+
TQ = "io.modelcontextprotocol/ui";
|
|
38948
38953
|
}
|
|
38949
38954
|
});
|
|
38950
38955
|
|
|
@@ -39430,6 +39435,12 @@ __export(codex_exports, {
|
|
|
39430
39435
|
createInkmapMcpServer: () => createInkmapMcpServer,
|
|
39431
39436
|
serveCodex: () => serveCodex
|
|
39432
39437
|
});
|
|
39438
|
+
function openSystemBrowser(url2) {
|
|
39439
|
+
if (process.env.INKMAP_NO_OPEN === "1")
|
|
39440
|
+
return;
|
|
39441
|
+
const [cmd, args] = process.platform === "darwin" ? ["open", [url2]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url2]] : ["xdg-open", [url2]];
|
|
39442
|
+
(0, import_node_child_process.spawn)(cmd, args, { stdio: "ignore", detached: true }).unref();
|
|
39443
|
+
}
|
|
39433
39444
|
async function createInkmapMcpServer(options = {}) {
|
|
39434
39445
|
const html = options.html ?? await (0, import_promises4.readFile)(HTML, "utf8").catch((error62) => {
|
|
39435
39446
|
if (error62.code === "ENOENT") {
|
|
@@ -39439,8 +39450,57 @@ async function createInkmapMcpServer(options = {}) {
|
|
|
39439
39450
|
});
|
|
39440
39451
|
const billingOrigin2 = options.billingOrigin ?? (() => process.env.INKMAP_BILLING_ORIGIN || YUNFAN_BILLING_ORIGIN);
|
|
39441
39452
|
const billing = licenseService(fileSessionStorage(), billingOrigin2, { loginOnly: true });
|
|
39453
|
+
let browserBilling;
|
|
39454
|
+
const fallbackEditors = /* @__PURE__ */ new Map();
|
|
39455
|
+
const ads = adFeed(PRODUCT.adFeedUrl);
|
|
39442
39456
|
const workspaces = createMcpWorkspaceManager();
|
|
39443
|
-
const server = new McpServer({ name: "inkmap", version: "0.2.
|
|
39457
|
+
const server = new McpServer({ name: "inkmap", version: "0.2.6" });
|
|
39458
|
+
function isAntigravityHost() {
|
|
39459
|
+
const clientName = server.server.getClientVersion()?.name ?? "";
|
|
39460
|
+
if (/antigravity/i.test(clientName))
|
|
39461
|
+
return true;
|
|
39462
|
+
if (/[/\\]plugins[/\\]inkmap[/\\]/.test(process.argv[1] ?? ""))
|
|
39463
|
+
return true;
|
|
39464
|
+
return false;
|
|
39465
|
+
}
|
|
39466
|
+
function hostSupportsEmbeddedUi() {
|
|
39467
|
+
if (Y3(server.server.getClientCapabilities()))
|
|
39468
|
+
return true;
|
|
39469
|
+
if (isAntigravityHost())
|
|
39470
|
+
return true;
|
|
39471
|
+
return false;
|
|
39472
|
+
}
|
|
39473
|
+
async function openFallbackBrowserEditor(filePath) {
|
|
39474
|
+
if (!(0, import_node_fs2.existsSync)(WEB_ROOT))
|
|
39475
|
+
return void 0;
|
|
39476
|
+
let pending = fallbackEditors.get(filePath);
|
|
39477
|
+
if (!pending) {
|
|
39478
|
+
browserBilling ??= licenseService(fileSessionStorage(), billingOrigin2);
|
|
39479
|
+
pending = (async () => {
|
|
39480
|
+
const source = await fileSource(filePath);
|
|
39481
|
+
return serve({
|
|
39482
|
+
source,
|
|
39483
|
+
webRoot: WEB_ROOT,
|
|
39484
|
+
port: 0,
|
|
39485
|
+
license: browserBilling,
|
|
39486
|
+
ads,
|
|
39487
|
+
sidebar: false
|
|
39488
|
+
});
|
|
39489
|
+
})();
|
|
39490
|
+
fallbackEditors.set(filePath, pending);
|
|
39491
|
+
pending.catch(() => fallbackEditors.delete(filePath));
|
|
39492
|
+
}
|
|
39493
|
+
const served = await pending;
|
|
39494
|
+
openSystemBrowser(served.url);
|
|
39495
|
+
return served.url;
|
|
39496
|
+
}
|
|
39497
|
+
async function disposeAll() {
|
|
39498
|
+
billing.dispose();
|
|
39499
|
+
browserBilling?.dispose();
|
|
39500
|
+
const editors = [...fallbackEditors.values()];
|
|
39501
|
+
fallbackEditors.clear();
|
|
39502
|
+
await Promise.allSettled(editors.map(async (p2) => (await p2).close()));
|
|
39503
|
+
}
|
|
39444
39504
|
N3(server, "Inkmap Markdown editor", UI, {
|
|
39445
39505
|
_meta: { ui: { prefersBorder: false } }
|
|
39446
39506
|
}, async () => ({
|
|
@@ -39458,7 +39518,7 @@ async function createInkmapMcpServer(options = {}) {
|
|
|
39458
39518
|
}, async () => ({ content: [] }));
|
|
39459
39519
|
K3(server, "inkmap_open", {
|
|
39460
39520
|
title: "Inkmap",
|
|
39461
|
-
description: "Open and edit a local Markdown (.md, .markmap.md) outline as an interactive Inkmap mind map
|
|
39521
|
+
description: "Open and edit a local Markdown (.md, .markmap.md) outline as an interactive Inkmap mind map.",
|
|
39462
39522
|
inputSchema: {
|
|
39463
39523
|
path: external_exports.string().optional().describe("Absolute or workspace-relative path to a .md or .markmap.md file. Omit to open the active or most recent Markdown outline."),
|
|
39464
39524
|
workspace: external_exports.string().optional().describe("Optional workspace root directory path.")
|
|
@@ -39478,8 +39538,12 @@ async function createInkmapMcpServer(options = {}) {
|
|
|
39478
39538
|
workspaces.open({ path, workspace, fromModel: true }),
|
|
39479
39539
|
billing.state()
|
|
39480
39540
|
]);
|
|
39541
|
+
let editorUrl;
|
|
39542
|
+
if (opened.currentFile && !hostSupportsEmbeddedUi()) {
|
|
39543
|
+
editorUrl = await openFallbackBrowserEditor(opened.currentFile).catch(() => void 0);
|
|
39544
|
+
}
|
|
39481
39545
|
const includeDoc = Buffer.byteLength(opened.doc.md, "utf8") <= INLINE_DOC_LIMIT;
|
|
39482
|
-
const summary = opened.currentFile ? `Opened ${opened.currentFile} in Inkmap mind map.` : "Opened Inkmap mind map panel.";
|
|
39546
|
+
const summary = editorUrl ? `Opened ${opened.currentFile} in Inkmap interactive mind map at ${editorUrl} (live two-way synced with your Markdown file).` : opened.currentFile ? `Opened ${opened.currentFile} in Inkmap mind map.` : "Opened Inkmap mind map panel.";
|
|
39483
39547
|
return {
|
|
39484
39548
|
content: [{ type: "text", text: summary }],
|
|
39485
39549
|
structuredContent: {
|
|
@@ -39489,6 +39553,7 @@ async function createInkmapMcpServer(options = {}) {
|
|
|
39489
39553
|
currentFileUri: opened.currentFileUri,
|
|
39490
39554
|
targetSeq: opened.targetSeq,
|
|
39491
39555
|
license: { ...license },
|
|
39556
|
+
...editorUrl && { editorUrl },
|
|
39492
39557
|
...includeDoc && { doc: opened.doc }
|
|
39493
39558
|
}
|
|
39494
39559
|
};
|
|
@@ -39589,28 +39654,35 @@ async function createInkmapMcpServer(options = {}) {
|
|
|
39589
39654
|
await billing.deactivate();
|
|
39590
39655
|
return { content: [] };
|
|
39591
39656
|
});
|
|
39592
|
-
return { server, billing, workspaces };
|
|
39657
|
+
return { server, billing, workspaces, dispose: disposeAll };
|
|
39593
39658
|
}
|
|
39594
39659
|
async function serveCodex() {
|
|
39595
|
-
const { server,
|
|
39660
|
+
const { server, dispose } = await createInkmapMcpServer();
|
|
39596
39661
|
const transport = new StdioServerTransport();
|
|
39597
|
-
server.server.onclose = () =>
|
|
39662
|
+
server.server.onclose = () => {
|
|
39663
|
+
void dispose();
|
|
39664
|
+
};
|
|
39598
39665
|
await server.connect(transport);
|
|
39599
39666
|
}
|
|
39600
|
-
var import_promises4, UI, HTML, INLINE_DOC_LIMIT, appOnly;
|
|
39667
|
+
var import_node_child_process, import_node_fs2, import_promises4, import_node_url2, UI, HTML, WEB_ROOT, INLINE_DOC_LIMIT, appOnly;
|
|
39601
39668
|
var init_codex = __esm({
|
|
39602
39669
|
"packages/cli/dist/codex.js"() {
|
|
39603
39670
|
"use strict";
|
|
39604
39671
|
init_mcp();
|
|
39605
39672
|
init_stdio2();
|
|
39606
39673
|
init_server4();
|
|
39674
|
+
import_node_child_process = require("node:child_process");
|
|
39675
|
+
import_node_fs2 = require("node:fs");
|
|
39607
39676
|
import_promises4 = require("node:fs/promises");
|
|
39677
|
+
import_node_url2 = require("node:url");
|
|
39608
39678
|
init_zod();
|
|
39609
39679
|
init_dist();
|
|
39610
39680
|
init_license();
|
|
39611
39681
|
init_mcp_files();
|
|
39682
|
+
init_server();
|
|
39612
39683
|
UI = "ui://inkmap/markdown.html";
|
|
39613
39684
|
HTML = new URL("./codex.html", inkmapModuleUrl);
|
|
39685
|
+
WEB_ROOT = (0, import_node_url2.fileURLToPath)(new URL("./web/", inkmapModuleUrl));
|
|
39614
39686
|
INLINE_DOC_LIMIT = 256 * 1024;
|
|
39615
39687
|
appOnly = { ui: { visibility: ["app"] } };
|
|
39616
39688
|
}
|
|
@@ -39665,14 +39737,14 @@ function getAntigravityConfigDir() {
|
|
|
39665
39737
|
}
|
|
39666
39738
|
function findCodexCommand() {
|
|
39667
39739
|
if (process.env.INKMAP_CODEX_BIN) {
|
|
39668
|
-
return (0,
|
|
39740
|
+
return (0, import_node_fs3.existsSync)(process.env.INKMAP_CODEX_BIN) ? process.env.INKMAP_CODEX_BIN : null;
|
|
39669
39741
|
}
|
|
39670
|
-
if ((0,
|
|
39742
|
+
if ((0, import_node_child_process2.spawnSync)("codex", ["--version"], { stdio: "ignore" }).status === 0)
|
|
39671
39743
|
return "codex";
|
|
39672
39744
|
if (process.platform === "darwin") {
|
|
39673
39745
|
for (const dir of ["/Applications", (0, import_node_path4.join)((0, import_node_os4.homedir)(), "Applications")]) {
|
|
39674
39746
|
const cmd = (0, import_node_path4.join)(dir, "ChatGPT.app/Contents/Resources/codex-cli/bin/codex");
|
|
39675
|
-
if ((0,
|
|
39747
|
+
if ((0, import_node_fs3.existsSync)(cmd))
|
|
39676
39748
|
return cmd;
|
|
39677
39749
|
}
|
|
39678
39750
|
}
|
|
@@ -39681,31 +39753,31 @@ function findCodexCommand() {
|
|
|
39681
39753
|
function detectInstalledTargets() {
|
|
39682
39754
|
const found = [];
|
|
39683
39755
|
const claudeDir = getClaudeDesktopDir();
|
|
39684
|
-
if ((0,
|
|
39756
|
+
if ((0, import_node_fs3.existsSync)(claudeDir) || process.platform === "darwin" && ((0, import_node_fs3.existsSync)("/Applications/Claude.app") || (0, import_node_fs3.existsSync)((0, import_node_path4.join)((0, import_node_os4.homedir)(), "Applications", "Claude.app")))) {
|
|
39685
39757
|
found.push("claude");
|
|
39686
39758
|
}
|
|
39687
39759
|
const claudeCodeCfg = getClaudeCodeConfigPath();
|
|
39688
|
-
if ((0,
|
|
39760
|
+
if ((0, import_node_fs3.existsSync)(claudeCodeCfg) || !process.env.INKMAP_ISOLATED_DETECT && (0, import_node_child_process2.spawnSync)("claude", ["--version"], { stdio: "ignore" }).status === 0) {
|
|
39689
39761
|
found.push("claude-code");
|
|
39690
39762
|
}
|
|
39691
|
-
if ((0,
|
|
39763
|
+
if ((0, import_node_fs3.existsSync)(getCursorDir())) {
|
|
39692
39764
|
found.push("cursor");
|
|
39693
39765
|
}
|
|
39694
39766
|
const agyDir = getAntigravityConfigDir();
|
|
39695
|
-
if ((0,
|
|
39767
|
+
if ((0, import_node_fs3.existsSync)(agyDir) || !process.env.ANTIGRAVITY_CONFIG_DIR && (0, import_node_fs3.existsSync)((0, import_node_path4.join)((0, import_node_os4.homedir)(), ".gemini", "antigravity"))) {
|
|
39696
39768
|
found.push("antigravity");
|
|
39697
39769
|
}
|
|
39698
39770
|
if (!process.env.INKMAP_ISOLATED_DETECT && findCodexCommand()) {
|
|
39699
39771
|
found.push("codex");
|
|
39700
|
-
} else if (process.env.INKMAP_CODEX_BIN && (0,
|
|
39772
|
+
} else if (process.env.INKMAP_CODEX_BIN && (0, import_node_fs3.existsSync)(process.env.INKMAP_CODEX_BIN)) {
|
|
39701
39773
|
found.push("codex");
|
|
39702
39774
|
}
|
|
39703
39775
|
return found;
|
|
39704
39776
|
}
|
|
39705
39777
|
function readJsonObject(filePath) {
|
|
39706
|
-
if (!(0,
|
|
39778
|
+
if (!(0, import_node_fs3.existsSync)(filePath))
|
|
39707
39779
|
return {};
|
|
39708
|
-
const raw = (0,
|
|
39780
|
+
const raw = (0, import_node_fs3.readFileSync)(filePath, "utf8").trim();
|
|
39709
39781
|
if (!raw)
|
|
39710
39782
|
return {};
|
|
39711
39783
|
let parsed;
|
|
@@ -39720,40 +39792,50 @@ function readJsonObject(filePath) {
|
|
|
39720
39792
|
return parsed;
|
|
39721
39793
|
}
|
|
39722
39794
|
function writeJsonAtomic(filePath, data) {
|
|
39723
|
-
(0,
|
|
39795
|
+
(0, import_node_fs3.mkdirSync)((0, import_node_path4.dirname)(filePath), { recursive: true });
|
|
39724
39796
|
const tmp = `${filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
39725
|
-
(0,
|
|
39726
|
-
(0,
|
|
39797
|
+
(0, import_node_fs3.writeFileSync)(tmp, JSON.stringify(data, null, 2) + "\n", "utf8");
|
|
39798
|
+
(0, import_node_fs3.renameSync)(tmp, filePath);
|
|
39727
39799
|
}
|
|
39728
39800
|
function stageStandaloneMcpApp() {
|
|
39729
39801
|
const appDir = (0, import_node_path4.join)(getInkmapHome(), "mcp-app");
|
|
39730
|
-
(0,
|
|
39802
|
+
(0, import_node_fs3.mkdirSync)(appDir, { recursive: true });
|
|
39731
39803
|
const bundledCli = (0, import_node_path4.join)(DIST_DIR, "cli.cjs");
|
|
39732
39804
|
const bundledHtml = (0, import_node_path4.join)(DIST_DIR, "codex.html");
|
|
39805
|
+
const bundledWeb = (0, import_node_path4.join)(DIST_DIR, "web");
|
|
39733
39806
|
const monorepoAntigravity = (0, import_node_path4.resolve)(PKG_ROOT, "..", "..", "dist", "sidebars", "inkmap-antigravity", "inkmap");
|
|
39734
|
-
if ((0,
|
|
39735
|
-
(0,
|
|
39736
|
-
(0,
|
|
39737
|
-
|
|
39807
|
+
if ((0, import_node_fs3.existsSync)(bundledCli) && (0, import_node_fs3.existsSync)(bundledHtml)) {
|
|
39808
|
+
(0, import_node_fs3.cpSync)(bundledCli, (0, import_node_path4.join)(appDir, "cli.cjs"));
|
|
39809
|
+
(0, import_node_fs3.cpSync)(bundledHtml, (0, import_node_path4.join)(appDir, "codex.html"));
|
|
39810
|
+
if ((0, import_node_fs3.existsSync)(bundledWeb)) {
|
|
39811
|
+
(0, import_node_fs3.rmSync)((0, import_node_path4.join)(appDir, "web"), { recursive: true, force: true });
|
|
39812
|
+
(0, import_node_fs3.cpSync)(bundledWeb, (0, import_node_path4.join)(appDir, "web"), { recursive: true });
|
|
39813
|
+
}
|
|
39814
|
+
(0, import_node_fs3.writeFileSync)((0, import_node_path4.join)(appDir, "server.cjs"), SERVER_WRAPPER, { mode: 493 });
|
|
39738
39815
|
for (const notice of ["LICENSE.md", "THIRD_PARTY_NOTICES.md"]) {
|
|
39739
39816
|
const src = (0, import_node_path4.join)(PKG_ROOT, notice);
|
|
39740
|
-
if ((0,
|
|
39741
|
-
(0,
|
|
39817
|
+
if ((0, import_node_fs3.existsSync)(src))
|
|
39818
|
+
(0, import_node_fs3.cpSync)(src, (0, import_node_path4.join)(appDir, notice));
|
|
39742
39819
|
}
|
|
39743
39820
|
return { serverScript: (0, import_node_path4.join)(appDir, "server.cjs"), appDir };
|
|
39744
39821
|
}
|
|
39745
|
-
if ((0,
|
|
39746
|
-
(0,
|
|
39747
|
-
(0,
|
|
39822
|
+
if ((0, import_node_fs3.existsSync)((0, import_node_path4.join)(monorepoAntigravity, "server.cjs")) && (0, import_node_fs3.existsSync)((0, import_node_path4.join)(monorepoAntigravity, "codex.html"))) {
|
|
39823
|
+
(0, import_node_fs3.cpSync)((0, import_node_path4.join)(monorepoAntigravity, "server.cjs"), (0, import_node_path4.join)(appDir, "server.cjs"));
|
|
39824
|
+
(0, import_node_fs3.cpSync)((0, import_node_path4.join)(monorepoAntigravity, "codex.html"), (0, import_node_path4.join)(appDir, "codex.html"));
|
|
39825
|
+
const sidecarWeb = (0, import_node_path4.join)(monorepoAntigravity, "sidecars", "inkmap", "web");
|
|
39826
|
+
if ((0, import_node_fs3.existsSync)(sidecarWeb)) {
|
|
39827
|
+
(0, import_node_fs3.rmSync)((0, import_node_path4.join)(appDir, "web"), { recursive: true, force: true });
|
|
39828
|
+
(0, import_node_fs3.cpSync)(sidecarWeb, (0, import_node_path4.join)(appDir, "web"), { recursive: true });
|
|
39829
|
+
}
|
|
39748
39830
|
for (const notice of ["LICENSE.md", "THIRD_PARTY_NOTICES.md"]) {
|
|
39749
39831
|
const src = (0, import_node_path4.join)(monorepoAntigravity, notice);
|
|
39750
|
-
if ((0,
|
|
39751
|
-
(0,
|
|
39832
|
+
if ((0, import_node_fs3.existsSync)(src))
|
|
39833
|
+
(0, import_node_fs3.cpSync)(src, (0, import_node_path4.join)(appDir, notice));
|
|
39752
39834
|
}
|
|
39753
39835
|
return { serverScript: (0, import_node_path4.join)(appDir, "server.cjs"), appDir };
|
|
39754
39836
|
}
|
|
39755
39837
|
const devBin = (0, import_node_path4.join)(PKG_ROOT, "bin", "inkmap.js");
|
|
39756
|
-
if ((0,
|
|
39838
|
+
if ((0, import_node_fs3.existsSync)(devBin) && (0, import_node_fs3.existsSync)(bundledHtml)) {
|
|
39757
39839
|
return { serverScript: devBin, appDir };
|
|
39758
39840
|
}
|
|
39759
39841
|
throw new Error("\u672A\u627E\u5230\u5DF2\u6784\u5EFA\u7684 MCP App \u8D44\u6E90\uFF08codex.html\uFF09\u3002/ Built MCP App assets are missing.");
|
|
@@ -39783,7 +39865,7 @@ function upsertMcpJsonConfig(filePath, serverScript, workspaces, withTypeStdio =
|
|
|
39783
39865
|
writeJsonAtomic(filePath, root);
|
|
39784
39866
|
}
|
|
39785
39867
|
function removeMcpJsonConfig(filePath) {
|
|
39786
|
-
if (!(0,
|
|
39868
|
+
if (!(0, import_node_fs3.existsSync)(filePath))
|
|
39787
39869
|
return false;
|
|
39788
39870
|
const root = readJsonObject(filePath);
|
|
39789
39871
|
if (!root.mcpServers || typeof root.mcpServers !== "object" || Array.isArray(root.mcpServers))
|
|
@@ -39821,23 +39903,23 @@ async function installAntigravityPlugin() {
|
|
|
39821
39903
|
const bundledHtml = (0, import_node_path4.join)(DIST_DIR, "codex.html");
|
|
39822
39904
|
const bundledWeb = (0, import_node_path4.join)(DIST_DIR, "web");
|
|
39823
39905
|
const monorepoAgy = (0, import_node_path4.resolve)(PKG_ROOT, "..", "..", "dist", "sidebars", "inkmap-antigravity", "inkmap");
|
|
39824
|
-
(0,
|
|
39825
|
-
(0,
|
|
39826
|
-
if ((0,
|
|
39827
|
-
(0,
|
|
39828
|
-
(0,
|
|
39829
|
-
(0,
|
|
39830
|
-
(0,
|
|
39831
|
-
if ((0,
|
|
39832
|
-
(0,
|
|
39906
|
+
(0, import_node_fs3.mkdirSync)(pluginsDir, { recursive: true });
|
|
39907
|
+
(0, import_node_fs3.rmSync)(destination, { recursive: true, force: true });
|
|
39908
|
+
if ((0, import_node_fs3.existsSync)((0, import_node_path4.join)(bundledAgy, "plugin.json")) && (0, import_node_fs3.existsSync)(bundledCli) && (0, import_node_fs3.existsSync)(bundledHtml)) {
|
|
39909
|
+
(0, import_node_fs3.cpSync)(bundledAgy, destination, { recursive: true });
|
|
39910
|
+
(0, import_node_fs3.cpSync)(bundledCli, (0, import_node_path4.join)(destination, "cli.cjs"));
|
|
39911
|
+
(0, import_node_fs3.cpSync)(bundledHtml, (0, import_node_path4.join)(destination, "codex.html"));
|
|
39912
|
+
(0, import_node_fs3.writeFileSync)((0, import_node_path4.join)(destination, "server.cjs"), SERVER_WRAPPER, { mode: 493 });
|
|
39913
|
+
if ((0, import_node_fs3.existsSync)(bundledWeb)) {
|
|
39914
|
+
(0, import_node_fs3.cpSync)(bundledWeb, (0, import_node_path4.join)(destination, "sidecars", "inkmap", "web"), { recursive: true });
|
|
39833
39915
|
}
|
|
39834
39916
|
for (const doc of ["LICENSE.md", "THIRD_PARTY_NOTICES.md", "README.md"]) {
|
|
39835
39917
|
const src = (0, import_node_path4.join)(PKG_ROOT, doc);
|
|
39836
|
-
if ((0,
|
|
39837
|
-
(0,
|
|
39918
|
+
if ((0, import_node_fs3.existsSync)(src))
|
|
39919
|
+
(0, import_node_fs3.cpSync)(src, (0, import_node_path4.join)(destination, doc));
|
|
39838
39920
|
}
|
|
39839
|
-
} else if ((0,
|
|
39840
|
-
(0,
|
|
39921
|
+
} else if ((0, import_node_fs3.existsSync)((0, import_node_path4.join)(monorepoAgy, "plugin.json"))) {
|
|
39922
|
+
(0, import_node_fs3.cpSync)(monorepoAgy, destination, { recursive: true });
|
|
39841
39923
|
} else {
|
|
39842
39924
|
throw new Error("\u672A\u627E\u5230 Antigravity \u63D2\u4EF6\u8D44\u6E90 / Antigravity plugin bundle not found.");
|
|
39843
39925
|
}
|
|
@@ -39854,33 +39936,33 @@ function installCodexPlugin() {
|
|
|
39854
39936
|
const bundledHtml = (0, import_node_path4.join)(DIST_DIR, "codex.html");
|
|
39855
39937
|
const monorepoCodexRoot = (0, import_node_path4.resolve)(PKG_ROOT, "..", "..", "dist", "sidebars");
|
|
39856
39938
|
const destination = (0, import_node_path4.join)(getInkmapHome(), "codex-marketplace");
|
|
39857
|
-
(0,
|
|
39858
|
-
const marketplaceRoot = (0,
|
|
39859
|
-
if ((0,
|
|
39860
|
-
(0,
|
|
39939
|
+
(0, import_node_fs3.mkdirSync)(destination, { recursive: true });
|
|
39940
|
+
const marketplaceRoot = (0, import_node_fs3.realpathSync)(destination);
|
|
39941
|
+
if ((0, import_node_fs3.existsSync)((0, import_node_path4.join)(bundledCodex, ".agents")) && (0, import_node_fs3.existsSync)(bundledCli) && (0, import_node_fs3.existsSync)(bundledHtml)) {
|
|
39942
|
+
(0, import_node_fs3.cpSync)(bundledCodex, marketplaceRoot, { recursive: true });
|
|
39861
39943
|
const pluginDir = (0, import_node_path4.join)(marketplaceRoot, "inkmap-codex");
|
|
39862
|
-
(0,
|
|
39863
|
-
(0,
|
|
39864
|
-
(0,
|
|
39944
|
+
(0, import_node_fs3.cpSync)(bundledCli, (0, import_node_path4.join)(pluginDir, "cli.cjs"));
|
|
39945
|
+
(0, import_node_fs3.cpSync)(bundledHtml, (0, import_node_path4.join)(pluginDir, "codex.html"));
|
|
39946
|
+
(0, import_node_fs3.writeFileSync)((0, import_node_path4.join)(pluginDir, "server.cjs"), SERVER_WRAPPER, { mode: 493 });
|
|
39865
39947
|
for (const doc of ["LICENSE.md", "THIRD_PARTY_NOTICES.md"]) {
|
|
39866
39948
|
const src = (0, import_node_path4.join)(PKG_ROOT, doc);
|
|
39867
|
-
if ((0,
|
|
39868
|
-
(0,
|
|
39949
|
+
if ((0, import_node_fs3.existsSync)(src))
|
|
39950
|
+
(0, import_node_fs3.cpSync)(src, (0, import_node_path4.join)(pluginDir, doc));
|
|
39869
39951
|
}
|
|
39870
|
-
} else if ((0,
|
|
39871
|
-
(0,
|
|
39872
|
-
(0,
|
|
39952
|
+
} else if ((0, import_node_fs3.existsSync)((0, import_node_path4.join)(monorepoCodexRoot, "inkmap-codex")) && (0, import_node_fs3.existsSync)((0, import_node_path4.join)(monorepoCodexRoot, ".agents"))) {
|
|
39953
|
+
(0, import_node_fs3.cpSync)((0, import_node_path4.join)(monorepoCodexRoot, ".agents"), (0, import_node_path4.join)(marketplaceRoot, ".agents"), { recursive: true });
|
|
39954
|
+
(0, import_node_fs3.cpSync)((0, import_node_path4.join)(monorepoCodexRoot, "inkmap-codex"), (0, import_node_path4.join)(marketplaceRoot, "inkmap-codex"), { recursive: true });
|
|
39873
39955
|
} else {
|
|
39874
39956
|
throw new Error("\u672A\u627E\u5230 Codex \u63D2\u4EF6\u8D44\u6E90 / Codex plugin bundle not found.");
|
|
39875
39957
|
}
|
|
39876
39958
|
const marketplaceName = "inkmap-local";
|
|
39877
|
-
const rawList = (0,
|
|
39959
|
+
const rawList = (0, import_node_child_process2.execFileSync)(codex, ["plugin", "marketplace", "list", "--json"], { encoding: "utf8" });
|
|
39878
39960
|
const { marketplaces = [] } = JSON.parse(rawList);
|
|
39879
39961
|
const existing = marketplaces.find((entry) => entry.name === marketplaceName);
|
|
39880
39962
|
if (!existing) {
|
|
39881
|
-
(0,
|
|
39963
|
+
(0, import_node_child_process2.execFileSync)(codex, ["plugin", "marketplace", "add", marketplaceRoot], { stdio: "pipe" });
|
|
39882
39964
|
}
|
|
39883
|
-
(0,
|
|
39965
|
+
(0, import_node_child_process2.execFileSync)(codex, ["plugin", "add", `inkmap-codex@${marketplaceName}`], { stdio: "pipe" });
|
|
39884
39966
|
return {
|
|
39885
39967
|
location: marketplaceRoot,
|
|
39886
39968
|
note: "\u91CD\u542F ChatGPT Desktop \u540E\uFF0C\u5728 Codex \u6A21\u5F0F\u70B9\u51FB .md \u6587\u4EF6\u6253\u5F00\u83DC\u5355\u9009\u62E9 Inkmap Mind Map"
|
|
@@ -39909,21 +39991,21 @@ async function runInstall(options = {}) {
|
|
|
39909
39991
|
result.removed.push({ target, location: cfg });
|
|
39910
39992
|
} else if (target === "antigravity") {
|
|
39911
39993
|
const dir = (0, import_node_path4.join)(getAntigravityConfigDir(), "plugins", "inkmap");
|
|
39912
|
-
if ((0,
|
|
39913
|
-
(0,
|
|
39994
|
+
if ((0, import_node_fs3.existsSync)(dir)) {
|
|
39995
|
+
(0, import_node_fs3.rmSync)(dir, { recursive: true, force: true });
|
|
39914
39996
|
await refreshAntigravityMcp();
|
|
39915
39997
|
result.removed.push({ target, location: dir });
|
|
39916
39998
|
}
|
|
39917
39999
|
} else if (target === "codex") {
|
|
39918
40000
|
const dir = (0, import_node_path4.join)(getInkmapHome(), "codex-marketplace");
|
|
39919
|
-
if ((0,
|
|
39920
|
-
(0,
|
|
40001
|
+
if ((0, import_node_fs3.existsSync)(dir)) {
|
|
40002
|
+
(0, import_node_fs3.rmSync)(dir, { recursive: true, force: true });
|
|
39921
40003
|
result.removed.push({ target, location: dir });
|
|
39922
40004
|
}
|
|
39923
40005
|
}
|
|
39924
40006
|
}
|
|
39925
40007
|
if (!explicitTargets) {
|
|
39926
|
-
(0,
|
|
40008
|
+
(0, import_node_fs3.rmSync)((0, import_node_path4.join)(getInkmapHome(), "mcp-app"), { recursive: true, force: true });
|
|
39927
40009
|
}
|
|
39928
40010
|
if (result.removed.length === 0) {
|
|
39929
40011
|
log("[inkmap] \u672A\u53D1\u73B0\u5DF2\u5B89\u88C5\u7684 Inkmap \u5BA2\u6237\u7AEF\u914D\u7F6E / No installed Inkmap client configs found.");
|
|
@@ -40051,16 +40133,16 @@ async function runInstallCli(argv, uninstall = false) {
|
|
|
40051
40133
|
uninstall
|
|
40052
40134
|
});
|
|
40053
40135
|
}
|
|
40054
|
-
var
|
|
40136
|
+
var import_node_child_process2, import_node_fs3, import_node_os4, import_node_path4, import_node_url3, DIST_DIR, PKG_ROOT, SERVER_WRAPPER;
|
|
40055
40137
|
var init_install = __esm({
|
|
40056
40138
|
"packages/cli/dist/install.js"() {
|
|
40057
40139
|
"use strict";
|
|
40058
|
-
|
|
40059
|
-
|
|
40140
|
+
import_node_child_process2 = require("node:child_process");
|
|
40141
|
+
import_node_fs3 = require("node:fs");
|
|
40060
40142
|
import_node_os4 = require("node:os");
|
|
40061
40143
|
import_node_path4 = require("node:path");
|
|
40062
|
-
|
|
40063
|
-
DIST_DIR = (0, import_node_path4.dirname)((0,
|
|
40144
|
+
import_node_url3 = require("node:url");
|
|
40145
|
+
DIST_DIR = (0, import_node_path4.dirname)((0, import_node_url3.fileURLToPath)(inkmapModuleUrl));
|
|
40064
40146
|
PKG_ROOT = (0, import_node_path4.resolve)(DIST_DIR, "..");
|
|
40065
40147
|
SERVER_WRAPPER = `#!/usr/bin/env node
|
|
40066
40148
|
"use strict";
|
|
@@ -40079,14 +40161,14 @@ __export(index_exports, {
|
|
|
40079
40161
|
main: () => main
|
|
40080
40162
|
});
|
|
40081
40163
|
module.exports = __toCommonJS(index_exports);
|
|
40082
|
-
var
|
|
40164
|
+
var import_node_child_process3 = require("node:child_process");
|
|
40083
40165
|
var import_node_path5 = require("node:path");
|
|
40084
|
-
var
|
|
40166
|
+
var import_node_url4 = require("node:url");
|
|
40085
40167
|
init_dist();
|
|
40086
40168
|
init_license();
|
|
40087
40169
|
init_server();
|
|
40088
|
-
var INKMAP_VERSION = "0.2.
|
|
40089
|
-
var
|
|
40170
|
+
var INKMAP_VERSION = "0.2.6";
|
|
40171
|
+
var WEB_ROOT2 = (0, import_node_url4.fileURLToPath)(new URL("./web/", inkmapModuleUrl));
|
|
40090
40172
|
var USAGE = `Inkmap v${INKMAP_VERSION} \u2014 Markdown \u4EA4\u4E92\u601D\u7EF4\u5BFC\u56FE\u7F16\u8F91\u5668 & MCP App
|
|
40091
40173
|
|
|
40092
40174
|
\u7528\u6CD5 / Usage\uFF1A
|
|
@@ -40100,7 +40182,7 @@ var USAGE = `Inkmap v${INKMAP_VERSION} \u2014 Markdown \u4EA4\u4E92\u601D\u7EF4\
|
|
|
40100
40182
|
\u5728\u672C\u5730\u6D4F\u89C8\u5668\u4E2D\u4EE5\u601D\u7EF4\u5BFC\u56FE\u6253\u5F00\u5E76\u5B9E\u65F6\u53CC\u5411\u7F16\u8F91 Markdown \u6587\u4EF6`;
|
|
40101
40183
|
function openBrowser(url2) {
|
|
40102
40184
|
const [cmd, args] = process.platform === "darwin" ? ["open", [url2]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url2]] : ["xdg-open", [url2]];
|
|
40103
|
-
(0,
|
|
40185
|
+
(0, import_node_child_process3.spawn)(cmd, args, { stdio: "ignore", detached: true }).unref();
|
|
40104
40186
|
}
|
|
40105
40187
|
function appendEnvWorkspaces(dirs) {
|
|
40106
40188
|
if (dirs.length === 0)
|
|
@@ -40186,7 +40268,7 @@ ${USAGE}`);
|
|
|
40186
40268
|
const license = licenseService(fileSessionStorage(), () => process.env.INKMAP_BILLING_ORIGIN || YUNFAN_BILLING_ORIGIN);
|
|
40187
40269
|
const served = await serve({
|
|
40188
40270
|
source: await fileSource(file2, log),
|
|
40189
|
-
webRoot:
|
|
40271
|
+
webRoot: WEB_ROOT2,
|
|
40190
40272
|
port: port ?? (sidebar ? 0 : void 0),
|
|
40191
40273
|
log,
|
|
40192
40274
|
license,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inkmap-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Interactive Markdown mind map editor & MCP App for Claude, Codex, Antigravity, Cursor, VS Code, and local browsers.",
|
|
5
|
-
"mcpName": "io.github.zhiyuanvision-lang/inkmap",
|
|
5
|
+
"mcpName": "io.github.zhiyuanvision-lang/inkmap-markdown-mindmap-markmap",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"homepage": "https://www.zhiyuanv.com/software.html",
|
|
8
8
|
"repository": {
|
package/server.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
-
"name": "io.github.zhiyuanvision-lang/inkmap",
|
|
3
|
+
"name": "io.github.zhiyuanvision-lang/inkmap-markdown-mindmap-markmap",
|
|
4
4
|
"title": "Inkmap Mind Map",
|
|
5
5
|
"description": "Interactive two-way Markdown mind map editor & MCP App for local .md and .markmap.md files.",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.6",
|
|
7
7
|
"websiteUrl": "https://www.zhiyuanv.com/software.html",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/zhiyuanvision-lang/InkMap",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "inkmap-mcp",
|
|
16
|
-
"version": "0.2.
|
|
16
|
+
"version": "0.2.6",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|