mindlink 2.0.0 → 2.0.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/dist/cli.js +50 -21
- package/dist/cli.js.map +1 -1
- package/dist/templates/hooks/claude-settings.json +0 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command as Command20 } from "commander";
|
|
|
6
6
|
import chalk20 from "chalk";
|
|
7
7
|
|
|
8
8
|
// src/utils/version.ts
|
|
9
|
-
var VERSION = "2.0.
|
|
9
|
+
var VERSION = "2.0.2";
|
|
10
10
|
|
|
11
11
|
// src/commands/init.ts
|
|
12
12
|
import { Command } from "commander";
|
|
@@ -371,12 +371,19 @@ Examples:
|
|
|
371
371
|
if (!existsSync2(hookDest)) {
|
|
372
372
|
mkdirSync2(dirname2(hookDest), { recursive: true });
|
|
373
373
|
const settings = JSON.parse(readFileSync2(join3(HOOKS_TEMPLATES_DIR, "claude-settings.json"), "utf8"));
|
|
374
|
-
settings.mcpServers = {
|
|
375
|
-
mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
376
|
-
};
|
|
377
374
|
writeFileSync2(hookDest, JSON.stringify(settings, null, 2));
|
|
378
375
|
restored.push(".claude/settings.json");
|
|
379
376
|
}
|
|
377
|
+
const mcpJsonDest = join3(projectPath, ".mcp.json");
|
|
378
|
+
if (!existsSync2(mcpJsonDest)) {
|
|
379
|
+
const mcpJson = {
|
|
380
|
+
mcpServers: {
|
|
381
|
+
mindlink: { type: "stdio", command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
writeFileSync2(mcpJsonDest, JSON.stringify(mcpJson, null, 2));
|
|
385
|
+
restored.push(".mcp.json");
|
|
386
|
+
}
|
|
380
387
|
}
|
|
381
388
|
const configPath = join3(brainDir, "config.json");
|
|
382
389
|
if (!existsSync2(configPath)) {
|
|
@@ -580,18 +587,25 @@ Examples:
|
|
|
580
587
|
if (!existsSync2(hookDest)) {
|
|
581
588
|
mkdirSync2(dirname2(hookDest), { recursive: true });
|
|
582
589
|
const settings = JSON.parse(readFileSync2(join3(HOOKS_TEMPLATES_DIR, "claude-settings.json"), "utf8"));
|
|
583
|
-
settings.mcpServers = {
|
|
584
|
-
mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
585
|
-
};
|
|
586
590
|
writeFileSync2(hookDest, JSON.stringify(settings, null, 2));
|
|
587
|
-
created.push(`.claude/settings.json${" ".repeat(14)} ${chalk2.dim("Claude Code hooks
|
|
591
|
+
created.push(`.claude/settings.json${" ".repeat(14)} ${chalk2.dim("Claude Code hooks")}`);
|
|
592
|
+
}
|
|
593
|
+
const mcpJsonDest = join3(projectPath, ".mcp.json");
|
|
594
|
+
if (!existsSync2(mcpJsonDest)) {
|
|
595
|
+
const mcpJson = {
|
|
596
|
+
mcpServers: {
|
|
597
|
+
mindlink: { type: "stdio", command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
writeFileSync2(mcpJsonDest, JSON.stringify(mcpJson, null, 2));
|
|
601
|
+
created.push(`.mcp.json${" ".repeat(24)} ${chalk2.dim("Claude Code MCP server")}`);
|
|
588
602
|
}
|
|
589
603
|
}
|
|
590
604
|
if (selectedAgents.includes("cursor")) {
|
|
591
605
|
const cursorMcpDest = join3(projectPath, ".cursor", "mcp.json");
|
|
592
606
|
if (!existsSync2(cursorMcpDest)) {
|
|
593
607
|
mkdirSync2(join3(projectPath, ".cursor"), { recursive: true });
|
|
594
|
-
const cursorMcp = { mcpServers: { mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } } } };
|
|
608
|
+
const cursorMcp = { mcpServers: { mindlink: { type: "stdio", command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } } } };
|
|
595
609
|
writeFileSync2(cursorMcpDest, JSON.stringify(cursorMcp, null, 2));
|
|
596
610
|
created.push(`.cursor/mcp.json${" ".repeat(20)} ${chalk2.dim("Cursor MCP server")}`);
|
|
597
611
|
}
|
|
@@ -609,7 +623,7 @@ Examples:
|
|
|
609
623
|
const copilotMcpDest = join3(projectPath, ".vscode", "mcp.json");
|
|
610
624
|
if (!existsSync2(copilotMcpDest)) {
|
|
611
625
|
mkdirSync2(join3(projectPath, ".vscode"), { recursive: true });
|
|
612
|
-
const copilotMcp = {
|
|
626
|
+
const copilotMcp = { servers: { mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } } } };
|
|
613
627
|
writeFileSync2(copilotMcpDest, JSON.stringify(copilotMcp, null, 2));
|
|
614
628
|
created.push(`.vscode/mcp.json${" ".repeat(19)} ${chalk2.dim("GitHub Copilot MCP server")}`);
|
|
615
629
|
}
|
|
@@ -1551,20 +1565,35 @@ Examples:
|
|
|
1551
1565
|
} catch {
|
|
1552
1566
|
}
|
|
1553
1567
|
}
|
|
1568
|
+
const { mcpServers: _removed, ...existingWithoutMcp } = existing;
|
|
1569
|
+
void _removed;
|
|
1554
1570
|
const merged = {
|
|
1555
|
-
...
|
|
1556
|
-
...existing,
|
|
1557
|
-
// Always refresh hooks and permissions from template
|
|
1571
|
+
...existingWithoutMcp,
|
|
1558
1572
|
hooks: template.hooks,
|
|
1559
|
-
permissions: template.permissions
|
|
1560
|
-
|
|
1573
|
+
permissions: template.permissions
|
|
1574
|
+
};
|
|
1575
|
+
writeFileSync6(hookDest, JSON.stringify(merged, null, 2));
|
|
1576
|
+
refreshed.push(".claude/settings.json");
|
|
1577
|
+
} catch {
|
|
1578
|
+
}
|
|
1579
|
+
const mcpJsonDest = join10(projectPath, ".mcp.json");
|
|
1580
|
+
try {
|
|
1581
|
+
let existing = {};
|
|
1582
|
+
if (existsSync9(mcpJsonDest)) {
|
|
1583
|
+
try {
|
|
1584
|
+
existing = JSON.parse(readFileSync9(mcpJsonDest, "utf8"));
|
|
1585
|
+
} catch {
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
const merged = {
|
|
1589
|
+
...existing,
|
|
1561
1590
|
mcpServers: {
|
|
1562
1591
|
...typeof existing.mcpServers === "object" && existing.mcpServers !== null ? existing.mcpServers : {},
|
|
1563
|
-
mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
1592
|
+
mindlink: { type: "stdio", command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
1564
1593
|
}
|
|
1565
1594
|
};
|
|
1566
|
-
writeFileSync6(
|
|
1567
|
-
refreshed.push(".
|
|
1595
|
+
writeFileSync6(mcpJsonDest, JSON.stringify(merged, null, 2));
|
|
1596
|
+
refreshed.push(".mcp.json");
|
|
1568
1597
|
} catch {
|
|
1569
1598
|
}
|
|
1570
1599
|
}
|
|
@@ -1583,7 +1612,7 @@ Examples:
|
|
|
1583
1612
|
...existing,
|
|
1584
1613
|
mcpServers: {
|
|
1585
1614
|
...typeof existing.mcpServers === "object" && existing.mcpServers !== null ? existing.mcpServers : {},
|
|
1586
|
-
mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
1615
|
+
mindlink: { type: "stdio", command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
1587
1616
|
}
|
|
1588
1617
|
};
|
|
1589
1618
|
writeFileSync6(cursorMcpDest, JSON.stringify(merged, null, 2));
|
|
@@ -1614,8 +1643,8 @@ Examples:
|
|
|
1614
1643
|
}
|
|
1615
1644
|
const merged = {
|
|
1616
1645
|
...existing,
|
|
1617
|
-
|
|
1618
|
-
...typeof existing.
|
|
1646
|
+
servers: {
|
|
1647
|
+
...typeof existing.servers === "object" && existing.servers !== null ? existing.servers : {},
|
|
1619
1648
|
mindlink: { command: "mindlink", args: ["mcp"], env: { MINDLINK_PROJECT_PATH: projectPath } }
|
|
1620
1649
|
}
|
|
1621
1650
|
};
|