rulesync 0.34.0 → 0.37.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/README.ja.md +95 -6
- package/README.md +95 -6
- package/dist/chunk-2BYTQ4LL.mjs +67 -0
- package/dist/chunk-2CDVII2R.mjs +62 -0
- package/dist/chunk-3GVVX3G5.mjs +78 -0
- package/dist/chunk-KZATM2CQ.mjs +65 -0
- package/dist/chunk-PBOKMNYU.mjs +67 -0
- package/dist/chunk-QQN5GTOV.mjs +56 -0
- package/dist/chunk-TKNVMYAC.mjs +78 -0
- package/dist/claude-2NLZ2CDE.mjs +9 -0
- package/dist/cline-HUXPTQP7.mjs +9 -0
- package/dist/copilot-376H5OXX.mjs +9 -0
- package/dist/cursor-XWLBQYWY.mjs +9 -0
- package/dist/geminicli-EREPFSDP.mjs +9 -0
- package/dist/index.js +1295 -224
- package/dist/index.mjs +955 -215
- package/dist/roo-YS23AEWJ.mjs +9 -0
- package/package.json +33 -12
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldIncludeServer
|
|
3
|
+
} from "./chunk-QQN5GTOV.mjs";
|
|
4
|
+
|
|
5
|
+
// src/generators/mcp/copilot.ts
|
|
6
|
+
function generateCopilotMcp(config, target) {
|
|
7
|
+
const servers = {};
|
|
8
|
+
const inputs = [];
|
|
9
|
+
const inputMap = /* @__PURE__ */ new Map();
|
|
10
|
+
for (const [serverName, server] of Object.entries(config.mcpServers)) {
|
|
11
|
+
if (!shouldIncludeServer(server, "copilot")) continue;
|
|
12
|
+
const copilotServer = {};
|
|
13
|
+
if (server.command) {
|
|
14
|
+
copilotServer.command = server.command;
|
|
15
|
+
if (server.args) copilotServer.args = server.args;
|
|
16
|
+
} else if (server.url || server.httpUrl) {
|
|
17
|
+
const url = server.httpUrl || server.url;
|
|
18
|
+
if (url) {
|
|
19
|
+
copilotServer.url = url;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (server.env) {
|
|
23
|
+
copilotServer.env = {};
|
|
24
|
+
for (const [key, value] of Object.entries(server.env)) {
|
|
25
|
+
if (target === "editor" && value.includes("SECRET")) {
|
|
26
|
+
const inputId = `${serverName}_${key}`;
|
|
27
|
+
inputMap.set(inputId, value);
|
|
28
|
+
copilotServer.env[key] = `\${input:${inputId}}`;
|
|
29
|
+
inputs.push({
|
|
30
|
+
id: inputId,
|
|
31
|
+
type: "password",
|
|
32
|
+
description: `${key} for ${serverName}`
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
copilotServer.env[key] = value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (server.tools) {
|
|
40
|
+
copilotServer.tools = server.tools;
|
|
41
|
+
} else if (server.alwaysAllow) {
|
|
42
|
+
copilotServer.tools = server.alwaysAllow;
|
|
43
|
+
}
|
|
44
|
+
servers[serverName] = copilotServer;
|
|
45
|
+
}
|
|
46
|
+
if (target === "codingAgent") {
|
|
47
|
+
const config2 = { mcpServers: servers };
|
|
48
|
+
return JSON.stringify(config2, null, 2);
|
|
49
|
+
} else {
|
|
50
|
+
const config2 = { servers };
|
|
51
|
+
if (inputs.length > 0) {
|
|
52
|
+
config2.inputs = inputs;
|
|
53
|
+
}
|
|
54
|
+
return JSON.stringify(config2, null, 2);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function generateCopilotMcpConfiguration(mcpServers, baseDir = "") {
|
|
58
|
+
const configs = [];
|
|
59
|
+
const rulesyncConfig = { mcpServers };
|
|
60
|
+
const editorContent = generateCopilotMcp(rulesyncConfig, "editor");
|
|
61
|
+
configs.push({
|
|
62
|
+
filepath: baseDir ? `${baseDir}/.vscode/mcp.json` : ".vscode/mcp.json",
|
|
63
|
+
content: `${editorContent}
|
|
64
|
+
`
|
|
65
|
+
});
|
|
66
|
+
const codingAgentContent = generateCopilotMcp(rulesyncConfig, "codingAgent");
|
|
67
|
+
configs.push({
|
|
68
|
+
filepath: baseDir ? `${baseDir}/.copilot/mcp.json` : ".copilot/mcp.json",
|
|
69
|
+
content: `${codingAgentContent}
|
|
70
|
+
`
|
|
71
|
+
});
|
|
72
|
+
return configs;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
generateCopilotMcp,
|
|
77
|
+
generateCopilotMcpConfiguration
|
|
78
|
+
};
|