mindlink 2.0.0 → 2.0.1
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 +45 -16
- 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.1";
|
|
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,11 +587,18 @@ 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")) {
|
|
@@ -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
|
}
|