rulesync 0.42.0 → 0.43.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
5
  // src/generators/mcp/copilot.ts
6
6
  function generateCopilotMcp(config, target) {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
- // src/generators/mcp/claude.ts
5
+ // src/generators/mcp/claudecode.ts
6
6
  function generateClaudeMcp(config) {
7
7
  const claudeSettings = {
8
8
  mcpServers: {}
9
9
  };
10
10
  const shouldInclude = (server) => {
11
- return shouldIncludeServer(server, "claude");
11
+ return shouldIncludeServer(server, "claudecode");
12
12
  };
13
13
  for (const [serverName, server] of Object.entries(config.mcpServers)) {
14
14
  if (!shouldInclude(server)) continue;
@@ -44,9 +44,11 @@ function generateClaudeMcpConfiguration(mcpServers, baseDir = "") {
44
44
  continue;
45
45
  }
46
46
  const { targets: _, transport, ...serverConfig } = server;
47
- const claudeServer = {
48
- ...serverConfig
49
- };
47
+ const claudeServer = serverConfig;
48
+ if (serverConfig.httpUrl !== void 0) {
49
+ claudeServer.url = serverConfig.httpUrl;
50
+ delete claudeServer.httpUrl;
51
+ }
50
52
  if (transport && transport !== "stdio") {
51
53
  claudeServer.transport = transport;
52
54
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
5
  // src/generators/mcp/roo.ts
6
6
  function generateRooMcp(config) {
@@ -61,11 +61,11 @@ function generateRooMcpConfiguration(mcpServers, baseDir = "") {
61
61
  continue;
62
62
  }
63
63
  const { targets: _targets, ...serverConfig } = serverObj;
64
- if (serverConfig.httpUrl && serverConfig.url) {
65
- serverConfig.url = serverConfig.httpUrl;
66
- delete serverConfig.httpUrl;
64
+ const rooServer = serverConfig;
65
+ if (serverConfig.httpUrl !== void 0 && serverConfig.url !== void 0) {
66
+ rooServer.url = serverConfig.httpUrl;
67
67
  }
68
- config.mcpServers[serverName] = serverConfig;
68
+ config.mcpServers[serverName] = rooServer;
69
69
  }
70
70
  return [
71
71
  {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
5
  // src/generators/mcp/geminicli.ts
6
6
  function generateGeminiCliMcp(config) {
@@ -0,0 +1,35 @@
1
+ // src/types/tool-targets.ts
2
+ import { z } from "zod/v4";
3
+ var ToolTargetSchema = z.enum([
4
+ "copilot",
5
+ "cursor",
6
+ "cline",
7
+ "claudecode",
8
+ "roo",
9
+ "geminicli"
10
+ ]);
11
+ var ToolTargetsSchema = z.array(ToolTargetSchema);
12
+ var WildcardTargetSchema = z.tuple([z.literal("*")]);
13
+ var RulesyncTargetsSchema = z.union([ToolTargetsSchema, WildcardTargetSchema]);
14
+
15
+ // src/utils/mcp-helpers.ts
16
+ function shouldIncludeServer(server, targetTool) {
17
+ if (!server.targets || server.targets.length === 0) {
18
+ return true;
19
+ }
20
+ const parsedTargets = RulesyncTargetsSchema.parse(server.targets);
21
+ if (parsedTargets.length === 1 && parsedTargets[0] === "*") {
22
+ return true;
23
+ }
24
+ const validatedTool = ToolTargetSchema.parse(targetTool);
25
+ for (const target of parsedTargets) {
26
+ if (target === validatedTool) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ }
32
+
33
+ export {
34
+ shouldIncludeServer
35
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
5
  // src/generators/mcp/cline.ts
6
6
  function generateClineMcp(config) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldIncludeServer
3
- } from "./chunk-6YNGMPAL.js";
3
+ } from "./chunk-THWXK5Z2.js";
4
4
 
5
5
  // src/generators/mcp/cursor.ts
6
6
  function generateCursorMcp(config) {
@@ -48,7 +48,12 @@ function generateCursorMcpConfiguration(mcpServers, baseDir = "") {
48
48
  continue;
49
49
  }
50
50
  const { targets: _targets, ...serverConfig } = serverObj;
51
- config.mcpServers[serverName] = serverConfig;
51
+ const cursorServer = serverConfig;
52
+ if (serverConfig.httpUrl !== void 0) {
53
+ cursorServer.url = serverConfig.httpUrl;
54
+ delete cursorServer.httpUrl;
55
+ }
56
+ config.mcpServers[serverName] = cursorServer;
52
57
  }
53
58
  return [
54
59
  {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateClaudeMcp,
3
3
  generateClaudeMcpConfiguration
4
- } from "./chunk-HMMPZV7X.js";
5
- import "./chunk-6YNGMPAL.js";
4
+ } from "./chunk-B3627VQY.js";
5
+ import "./chunk-THWXK5Z2.js";
6
6
  export {
7
7
  generateClaudeMcp,
8
8
  generateClaudeMcpConfiguration
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateClineMcp,
3
3
  generateClineMcpConfiguration
4
- } from "./chunk-X3FEMISQ.js";
5
- import "./chunk-6YNGMPAL.js";
4
+ } from "./chunk-XHRBWFGI.js";
5
+ import "./chunk-THWXK5Z2.js";
6
6
  export {
7
7
  generateClineMcp,
8
8
  generateClineMcpConfiguration
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateCopilotMcp,
3
3
  generateCopilotMcpConfiguration
4
- } from "./chunk-SXEFNT27.js";
5
- import "./chunk-6YNGMPAL.js";
4
+ } from "./chunk-2FR4Z37J.js";
5
+ import "./chunk-THWXK5Z2.js";
6
6
  export {
7
7
  generateCopilotMcp,
8
8
  generateCopilotMcpConfiguration
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateCursorMcp,
3
3
  generateCursorMcpConfiguration
4
- } from "./chunk-D3YGI36J.js";
5
- import "./chunk-6YNGMPAL.js";
4
+ } from "./chunk-ZMAL5LIX.js";
5
+ import "./chunk-THWXK5Z2.js";
6
6
  export {
7
7
  generateCursorMcp,
8
8
  generateCursorMcpConfiguration
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateGeminiCliMcp,
3
3
  generateGeminiCliMcpConfiguration
4
- } from "./chunk-2SPL7QTK.js";
5
- import "./chunk-6YNGMPAL.js";
4
+ } from "./chunk-TCK42GOL.js";
5
+ import "./chunk-THWXK5Z2.js";
6
6
  export {
7
7
  generateGeminiCliMcp,
8
8
  generateGeminiCliMcpConfiguration