rulesync 0.58.0 → 0.60.0
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/{chunk-7UBF4OLN.js → chunk-2TFEIJOG.js} +1 -1
- package/dist/{chunk-OA473EXZ.js → chunk-55OU7KJU.js} +1 -1
- package/dist/{chunk-VNT6AHHO.js → chunk-5BYJMDCI.js} +1 -1
- package/dist/{chunk-WAX2UANS.js → chunk-7Q5JNJJW.js} +1 -1
- package/dist/{chunk-VKNCBVZF.js → chunk-GJ3NMGAT.js} +1 -1
- package/dist/{chunk-W2WU253H.js → chunk-QP2BI4DF.js} +1 -1
- package/dist/{chunk-J3TBR5EP.js → chunk-YGX4XO3M.js} +2 -2
- package/dist/{chunk-7E4U4YAB.js → chunk-ZOVBWPWK.js} +1 -1
- package/dist/{claudecode-VVI2PTKI.js → claudecode-W56JJONQ.js} +2 -2
- package/dist/{cline-BJLFSLEB.js → cline-SEVFH54V.js} +2 -2
- package/dist/{codexcli-LKWQB3V3.js → codexcli-Q34DZAEO.js} +2 -2
- package/dist/{cursor-2BVUO64T.js → cursor-PT2RUL4U.js} +2 -2
- package/dist/{geminicli-5YFMKRFL.js → geminicli-AUNY2MDS.js} +2 -2
- package/dist/index.cjs +431 -135
- package/dist/index.js +81 -167
- package/dist/{junie-5TDJPUXX.js → junie-YL5UL6FE.js} +2 -2
- package/dist/{windsurf-PXDRIQ76.js → windsurf-RLTNFHLL.js} +2 -2
- package/package.json +3 -1
- package/README.ja.md +0 -930
package/dist/index.js
CHANGED
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
generateAugmentcodeMcp
|
|
16
|
-
} from "./chunk-YTU3SCQO.js";
|
|
17
|
-
import {
|
|
18
|
-
generateClaudeMcp
|
|
19
|
-
} from "./chunk-VKNCBVZF.js";
|
|
20
|
-
import {
|
|
21
|
-
generateClineMcp
|
|
22
|
-
} from "./chunk-W2WU253H.js";
|
|
23
|
-
import {
|
|
24
|
-
generateCodexMcp
|
|
25
|
-
} from "./chunk-7UBF4OLN.js";
|
|
26
|
-
import {
|
|
27
|
-
generateCopilotMcp
|
|
28
|
-
} from "./chunk-KUGTKMNW.js";
|
|
29
|
-
import {
|
|
30
|
-
generateCursorMcp
|
|
31
|
-
} from "./chunk-OA473EXZ.js";
|
|
32
|
-
import {
|
|
33
|
-
generateGeminiCliMcp
|
|
34
|
-
} from "./chunk-WAX2UANS.js";
|
|
35
|
-
import "./chunk-J3TBR5EP.js";
|
|
2
|
+
import "./chunk-5BYJMDCI.js";
|
|
3
|
+
import "./chunk-LXTA7DBA.js";
|
|
4
|
+
import "./chunk-PCATT4UZ.js";
|
|
5
|
+
import "./chunk-ZOVBWPWK.js";
|
|
6
|
+
import "./chunk-YTU3SCQO.js";
|
|
7
|
+
import "./chunk-GJ3NMGAT.js";
|
|
8
|
+
import "./chunk-QP2BI4DF.js";
|
|
9
|
+
import "./chunk-2TFEIJOG.js";
|
|
10
|
+
import "./chunk-KUGTKMNW.js";
|
|
11
|
+
import "./chunk-55OU7KJU.js";
|
|
12
|
+
import "./chunk-7Q5JNJJW.js";
|
|
13
|
+
import "./chunk-YGX4XO3M.js";
|
|
36
14
|
import {
|
|
37
15
|
ALL_TOOL_TARGETS,
|
|
38
16
|
RulesyncTargetsSchema,
|
|
@@ -2549,125 +2527,51 @@ function parseMcpConfig(projectRoot) {
|
|
|
2549
2527
|
}
|
|
2550
2528
|
|
|
2551
2529
|
// src/core/mcp-generator.ts
|
|
2552
|
-
async function
|
|
2553
|
-
const
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
path: path4.join(targetRoot, ".codex", "mcp-config.json"),
|
|
2593
|
-
generate: () => generateCodexMcp(config)
|
|
2594
|
-
},
|
|
2595
|
-
{
|
|
2596
|
-
tool: "gemini-project",
|
|
2597
|
-
path: path4.join(targetRoot, ".gemini", "settings.json"),
|
|
2598
|
-
generate: () => generateGeminiCliMcp(config)
|
|
2599
|
-
},
|
|
2600
|
-
{
|
|
2601
|
-
tool: "junie-project",
|
|
2602
|
-
path: path4.join(targetRoot, ".junie", "mcp-config.json"),
|
|
2603
|
-
generate: () => generateJunieMcp(config)
|
|
2604
|
-
},
|
|
2605
|
-
{
|
|
2606
|
-
tool: "kiro-project",
|
|
2607
|
-
path: path4.join(targetRoot, ".kiro", "mcp.json"),
|
|
2608
|
-
generate: () => generateKiroMcp(config)
|
|
2609
|
-
},
|
|
2610
|
-
{
|
|
2611
|
-
tool: "roo-project",
|
|
2612
|
-
path: path4.join(targetRoot, ".roo", "mcp.json"),
|
|
2613
|
-
generate: () => generateRooMcp(config)
|
|
2614
|
-
},
|
|
2615
|
-
{
|
|
2616
|
-
tool: "windsurf-project",
|
|
2617
|
-
path: path4.join(targetRoot, "mcp_config.json"),
|
|
2618
|
-
generate: () => generateWindsurfMcp(config)
|
|
2619
|
-
}
|
|
2620
|
-
];
|
|
2621
|
-
const filteredGenerators = targetTools ? generators.filter((g) => {
|
|
2622
|
-
const baseTool = g.tool.split("-")[0];
|
|
2623
|
-
if (!isToolTarget(baseTool)) {
|
|
2624
|
-
return false;
|
|
2625
|
-
}
|
|
2626
|
-
if (baseTool === "augmentcode") {
|
|
2627
|
-
return targetTools.includes("augmentcode") || targetTools.includes("augmentcode-legacy");
|
|
2628
|
-
}
|
|
2629
|
-
return targetTools.includes(baseTool);
|
|
2630
|
-
}) : generators;
|
|
2631
|
-
for (const generator of filteredGenerators) {
|
|
2632
|
-
try {
|
|
2633
|
-
const content = generator.generate();
|
|
2634
|
-
const parsed = JSON.parse(content);
|
|
2635
|
-
if (generator.tool.includes("augmentcode") || generator.tool.includes("claude") || generator.tool.includes("cline") || generator.tool.includes("codexcli") || generator.tool.includes("cursor") || generator.tool.includes("gemini") || generator.tool.includes("junie") || generator.tool.includes("kiro") || generator.tool.includes("roo") || generator.tool.includes("windsurf")) {
|
|
2636
|
-
if (!parsed.mcpServers || Object.keys(parsed.mcpServers).length === 0) {
|
|
2637
|
-
results.push({
|
|
2638
|
-
tool: generator.tool,
|
|
2639
|
-
path: generator.path,
|
|
2640
|
-
status: "skipped"
|
|
2641
|
-
});
|
|
2642
|
-
continue;
|
|
2643
|
-
}
|
|
2644
|
-
} else if (generator.tool.includes("copilot")) {
|
|
2645
|
-
const key = generator.tool.includes("codingAgent") ? "mcpServers" : "servers";
|
|
2646
|
-
if (!parsed[key] || Object.keys(parsed[key]).length === 0) {
|
|
2647
|
-
results.push({
|
|
2648
|
-
tool: generator.tool,
|
|
2649
|
-
path: generator.path,
|
|
2650
|
-
status: "skipped"
|
|
2651
|
-
});
|
|
2652
|
-
continue;
|
|
2530
|
+
async function generateMcpConfigurations(mcpConfig, baseDir, targetTools) {
|
|
2531
|
+
const outputs = [];
|
|
2532
|
+
const toolMap = {
|
|
2533
|
+
augmentcode: async (servers, dir) => (await import("./augmentcode-HIZIQG2W.js")).generateAugmentcodeMcpConfiguration(
|
|
2534
|
+
servers,
|
|
2535
|
+
dir
|
|
2536
|
+
),
|
|
2537
|
+
"augmentcode-legacy": async (servers, dir) => (await import("./augmentcode-HIZIQG2W.js")).generateAugmentcodeMcpConfiguration(
|
|
2538
|
+
servers,
|
|
2539
|
+
dir
|
|
2540
|
+
),
|
|
2541
|
+
claudecode: async (servers, dir) => (await import("./claudecode-W56JJONQ.js")).generateClaudeMcpConfiguration(
|
|
2542
|
+
servers,
|
|
2543
|
+
dir
|
|
2544
|
+
),
|
|
2545
|
+
copilot: async (servers, dir) => (await import("./copilot-MOR3HHJX.js")).generateCopilotMcpConfiguration(servers, dir),
|
|
2546
|
+
cursor: async (servers, dir) => (await import("./cursor-PT2RUL4U.js")).generateCursorMcpConfiguration(servers, dir),
|
|
2547
|
+
cline: async (servers, dir) => (await import("./cline-SEVFH54V.js")).generateClineMcpConfiguration(servers, dir),
|
|
2548
|
+
codexcli: async (servers, dir) => (await import("./codexcli-Q34DZAEO.js")).generateCodexMcpConfiguration(servers, dir),
|
|
2549
|
+
roo: async (servers, dir) => (await import("./roo-L3QTTIPO.js")).generateRooMcpConfiguration(servers, dir),
|
|
2550
|
+
geminicli: async (servers, dir) => (await import("./geminicli-AUNY2MDS.js")).generateGeminiCliMcpConfiguration(
|
|
2551
|
+
servers,
|
|
2552
|
+
dir
|
|
2553
|
+
),
|
|
2554
|
+
kiro: async (servers, dir) => (await import("./kiro-YDHXY2MA.js")).generateKiroMcpConfiguration(servers, dir),
|
|
2555
|
+
junie: async (servers, dir) => (await import("./junie-YL5UL6FE.js")).generateJunieMcpConfiguration(servers, dir),
|
|
2556
|
+
windsurf: async (servers, dir) => (await import("./windsurf-RLTNFHLL.js")).generateWindsurfMcpConfiguration(
|
|
2557
|
+
servers,
|
|
2558
|
+
dir
|
|
2559
|
+
)
|
|
2560
|
+
};
|
|
2561
|
+
const tools = targetTools || Object.keys(toolMap).filter(isToolTarget);
|
|
2562
|
+
const seenPaths = /* @__PURE__ */ new Set();
|
|
2563
|
+
for (const tool of tools) {
|
|
2564
|
+
if (tool in toolMap) {
|
|
2565
|
+
const results = await toolMap[tool](mcpConfig.mcpServers || {}, baseDir);
|
|
2566
|
+
for (const result of results) {
|
|
2567
|
+
if (!seenPaths.has(result.filepath)) {
|
|
2568
|
+
seenPaths.add(result.filepath);
|
|
2569
|
+
outputs.push({ ...result, tool });
|
|
2653
2570
|
}
|
|
2654
2571
|
}
|
|
2655
|
-
await writeFileContent(generator.path, content);
|
|
2656
|
-
results.push({
|
|
2657
|
-
tool: generator.tool,
|
|
2658
|
-
path: generator.path,
|
|
2659
|
-
status: "success"
|
|
2660
|
-
});
|
|
2661
|
-
} catch (error) {
|
|
2662
|
-
results.push({
|
|
2663
|
-
tool: generator.tool,
|
|
2664
|
-
path: generator.path,
|
|
2665
|
-
status: "error",
|
|
2666
|
-
error: error instanceof Error ? error.message : String(error)
|
|
2667
|
-
});
|
|
2668
2572
|
}
|
|
2669
2573
|
}
|
|
2670
|
-
return
|
|
2574
|
+
return outputs;
|
|
2671
2575
|
}
|
|
2672
2576
|
|
|
2673
2577
|
// src/cli/commands/generate.ts
|
|
@@ -2812,25 +2716,35 @@ Generating configurations for base directory: ${baseDir}`);
|
|
|
2812
2716
|
}
|
|
2813
2717
|
let totalMcpOutputs = 0;
|
|
2814
2718
|
for (const baseDir of baseDirs) {
|
|
2815
|
-
|
|
2816
|
-
process.cwd()
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
console.log(`No MCP configuration found for ${baseDir}`);
|
|
2719
|
+
try {
|
|
2720
|
+
const mcpConfig = parseMcpConfig(process.cwd());
|
|
2721
|
+
if (!mcpConfig || !mcpConfig.mcpServers || Object.keys(mcpConfig.mcpServers).length === 0) {
|
|
2722
|
+
if (config.verbose) {
|
|
2723
|
+
console.log(`No MCP configuration found for ${baseDir}`);
|
|
2724
|
+
}
|
|
2725
|
+
continue;
|
|
2823
2726
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2727
|
+
const mcpResults = await generateMcpConfigurations(
|
|
2728
|
+
mcpConfig,
|
|
2729
|
+
baseDir === process.cwd() ? "." : baseDir,
|
|
2730
|
+
config.defaultTargets
|
|
2731
|
+
);
|
|
2732
|
+
if (mcpResults.length === 0) {
|
|
2733
|
+
if (config.verbose) {
|
|
2734
|
+
console.log(`No MCP configurations generated for ${baseDir}`);
|
|
2735
|
+
}
|
|
2736
|
+
continue;
|
|
2737
|
+
}
|
|
2738
|
+
for (const result of mcpResults) {
|
|
2739
|
+
await writeFileContent(result.filepath, result.content);
|
|
2740
|
+
console.log(`\u2705 Generated ${result.tool} MCP configuration: ${result.filepath}`);
|
|
2829
2741
|
totalMcpOutputs++;
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
console.
|
|
2742
|
+
}
|
|
2743
|
+
} catch (error) {
|
|
2744
|
+
if (config.verbose) {
|
|
2745
|
+
console.error(
|
|
2746
|
+
`\u274C Failed to generate MCP configurations: ${error instanceof Error ? error.message : String(error)}`
|
|
2747
|
+
);
|
|
2834
2748
|
}
|
|
2835
2749
|
}
|
|
2836
2750
|
}
|
|
@@ -4192,7 +4106,7 @@ async function watchCommand() {
|
|
|
4192
4106
|
|
|
4193
4107
|
// src/cli/index.ts
|
|
4194
4108
|
var program = new Command();
|
|
4195
|
-
program.name("rulesync").description("Unified AI rules management CLI tool").version("0.
|
|
4109
|
+
program.name("rulesync").description("Unified AI rules management CLI tool").version("0.60.0");
|
|
4196
4110
|
program.command("init").description("Initialize rulesync in current directory").action(initCommand);
|
|
4197
4111
|
program.command("add <filename>").description("Add a new rule file").action(addCommand);
|
|
4198
4112
|
program.command("gitignore").description("Add generated files to .gitignore").action(gitignoreCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulesync",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"eslint-plugin-no-type-assertion": "1.3.0",
|
|
61
61
|
"eslint-plugin-oxlint": "1.11.2",
|
|
62
62
|
"eslint-plugin-zod-import": "0.3.0",
|
|
63
|
+
"knip": "5.62.0",
|
|
63
64
|
"lint-staged": "16.1.5",
|
|
64
65
|
"o3-search-mcp": "0.0.7",
|
|
65
66
|
"oxlint": "1.11.2",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"eslint:fix": "eslint . --fix --max-warnings 0 --cache",
|
|
90
91
|
"fix": "pnpm run bcheck:fix && pnpm run oxlint:fix && pnpm run eslint:fix",
|
|
91
92
|
"generate": "pnpm run dev generate",
|
|
93
|
+
"knip": "knip",
|
|
92
94
|
"oxlint": "oxlint . --max-warnings 0",
|
|
93
95
|
"oxlint:fix": "oxlint . --fix --max-warnings 0",
|
|
94
96
|
"secretlint": "secretlint --secretlintignore .gitignore \"**/*\"",
|