rulesync 3.22.1 → 3.23.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/README.md CHANGED
@@ -460,6 +460,25 @@ When enabling modular-mcp, each MCP server must have a `description` field. Exam
460
460
  }
461
461
  ```
462
462
 
463
+ You can also configure `exposed` to exclude specific MCP servers from modular-mcp. It is optional and default to `false`. If you specify `exposed: true`, the MCP server is always loaded in the initial context.
464
+
465
+ ```diff
466
+ // .rulesync/mcp.json
467
+ {
468
+ "mcpServers": {
469
+ "context7": {
470
+ + "exposed": true,
471
+ "type": "stdio",
472
+ "command": "npx",
473
+ "args": [
474
+ "-y",
475
+ "@upstash/context7-mcp"
476
+ ],
477
+ "env": {}
478
+ }
479
+ }
480
+ ```
481
+
463
482
  To demonstrate the effect of modular-mcp, please see the following example:
464
483
 
465
484
  <details>
package/dist/index.cjs CHANGED
@@ -46,10 +46,7 @@ function isZodErrorLike(error) {
46
46
  }
47
47
  function formatError(error) {
48
48
  if (error instanceof import_zod.ZodError || isZodErrorLike(error)) {
49
- return error.issues.map((issue) => {
50
- const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
51
- return `${path2}${issue.message}`;
52
- }).join("; ");
49
+ return `Zod raw error: ${JSON.stringify(error.issues)}`;
53
50
  }
54
51
  if (error instanceof Error) {
55
52
  return `${error.name}: ${error.message}`;
@@ -584,7 +581,6 @@ var AiFile = class {
584
581
  relativeDirPath,
585
582
  relativeFilePath,
586
583
  fileContent,
587
- validate = true,
588
584
  global = false
589
585
  }) {
590
586
  this.baseDir = baseDir;
@@ -592,12 +588,6 @@ var AiFile = class {
592
588
  this.relativeFilePath = relativeFilePath;
593
589
  this.fileContent = fileContent;
594
590
  this.global = global;
595
- if (validate) {
596
- const result = this.validate();
597
- if (!result.success) {
598
- throw result.error;
599
- }
600
- }
601
591
  }
602
592
  static async fromFile(_params) {
603
593
  throw new Error("Please implement this method in the subclass.");
@@ -2714,7 +2704,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2714
2704
  };
2715
2705
 
2716
2706
  // src/features/mcp/mcp-processor.ts
2717
- var import_mini13 = require("zod/mini");
2707
+ var import_mini15 = require("zod/mini");
2718
2708
 
2719
2709
  // src/features/mcp/amazonqcli-mcp.ts
2720
2710
  var import_node_path28 = require("path");
@@ -2722,9 +2712,11 @@ var import_node_path28 = require("path");
2722
2712
  // src/features/mcp/rulesync-mcp.ts
2723
2713
  var import_node_path27 = require("path");
2724
2714
  var import_object = require("es-toolkit/object");
2715
+ var import_mini13 = require("zod/mini");
2716
+
2717
+ // src/types/mcp.ts
2725
2718
  var import_mini12 = require("zod/mini");
2726
- var McpTransportTypeSchema = import_mini12.z.enum(["stdio", "sse", "http"]);
2727
- var McpServerBaseSchema = import_mini12.z.object({
2719
+ var McpServerSchema = import_mini12.z.object({
2728
2720
  type: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
2729
2721
  command: import_mini12.z.optional(import_mini12.z.union([import_mini12.z.string(), import_mini12.z.array(import_mini12.z.string())])),
2730
2722
  args: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
@@ -2736,23 +2728,30 @@ var McpServerBaseSchema = import_mini12.z.object({
2736
2728
  timeout: import_mini12.z.optional(import_mini12.z.number()),
2737
2729
  trust: import_mini12.z.optional(import_mini12.z.boolean()),
2738
2730
  cwd: import_mini12.z.optional(import_mini12.z.string()),
2739
- transport: import_mini12.z.optional(McpTransportTypeSchema),
2731
+ transport: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
2740
2732
  alwaysAllow: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2741
2733
  tools: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2742
2734
  kiroAutoApprove: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2743
2735
  kiroAutoBlock: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2744
2736
  headers: import_mini12.z.optional(import_mini12.z.record(import_mini12.z.string(), import_mini12.z.string()))
2745
2737
  });
2746
- var ModularMcpServerSchema = import_mini12.z.extend(McpServerBaseSchema, {
2747
- description: import_mini12.z.string().check(import_mini12.z.minLength(1))
2748
- });
2749
- var ModularMcpServersSchema = import_mini12.z.record(import_mini12.z.string(), ModularMcpServerSchema);
2750
- var RulesyncMcpServersSchema = import_mini12.z.extend(McpServerBaseSchema, {
2751
- description: import_mini12.z.optional(import_mini12.z.string()),
2752
- targets: import_mini12.z.optional(RulesyncTargetsSchema)
2753
- });
2754
- var RulesyncMcpConfigSchema = import_mini12.z.object({
2755
- mcpServers: import_mini12.z.record(import_mini12.z.string(), RulesyncMcpServersSchema)
2738
+ var McpServersSchema = import_mini12.z.record(import_mini12.z.string(), McpServerSchema);
2739
+
2740
+ // src/features/mcp/rulesync-mcp.ts
2741
+ var RulesyncMcpServerSchema = import_mini13.z.union([
2742
+ import_mini13.z.extend(McpServerSchema, {
2743
+ targets: import_mini13.z.optional(RulesyncTargetsSchema),
2744
+ description: import_mini13.z.optional(import_mini13.z.string()),
2745
+ exposed: import_mini13.z.optional(import_mini13.z.literal(false))
2746
+ }),
2747
+ import_mini13.z.extend(McpServerSchema, {
2748
+ targets: import_mini13.z.optional(RulesyncTargetsSchema),
2749
+ description: import_mini13.z.undefined(),
2750
+ exposed: import_mini13.z.literal(true)
2751
+ })
2752
+ ]);
2753
+ var RulesyncMcpConfigSchema = import_mini13.z.object({
2754
+ mcpServers: import_mini13.z.record(import_mini13.z.string(), RulesyncMcpServerSchema)
2756
2755
  });
2757
2756
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2758
2757
  json;
@@ -2781,16 +2780,9 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2781
2780
  };
2782
2781
  }
2783
2782
  validate() {
2784
- if (this.modularMcp) {
2785
- const result = ModularMcpServersSchema.safeParse(this.json.mcpServers);
2786
- if (!result.success) {
2787
- return {
2788
- success: false,
2789
- error: new Error(
2790
- `Invalid MCP server configuration for modular-mcp: ${formatError(result.error)}`
2791
- )
2792
- };
2793
- }
2783
+ const result = RulesyncMcpConfigSchema.safeParse(this.json);
2784
+ if (!result.success) {
2785
+ return { success: false, error: result.error };
2794
2786
  }
2795
2787
  return { success: true, error: null };
2796
2788
  }
@@ -2841,26 +2833,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2841
2833
  modularMcp
2842
2834
  });
2843
2835
  }
2844
- getJson({ modularMcp = false } = {}) {
2845
- if (modularMcp) {
2846
- return this.json;
2847
- }
2848
- if (!this.json || typeof this.json !== "object") {
2849
- return this.json;
2850
- }
2851
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2852
- return this.json;
2853
- }
2854
- const mcpServersWithoutDescription = Object.fromEntries(
2855
- Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
2836
+ getExposedMcpServers() {
2837
+ return Object.fromEntries(
2838
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
2856
2839
  serverName,
2857
- (0, import_object.omit)(serverConfig, ["description"])
2840
+ (0, import_object.omit)(serverConfig, ["targets", "description", "exposed"])
2858
2841
  ])
2859
2842
  );
2860
- return {
2861
- ...this.json,
2862
- mcpServers: mcpServersWithoutDescription
2863
- };
2843
+ }
2844
+ getModularizedMcpServers() {
2845
+ return Object.fromEntries(
2846
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
2847
+ serverName,
2848
+ // description is required for modular-mcp servers
2849
+ (0, import_object.omit)(serverConfig, ["targets", "exposed"])
2850
+ ])
2851
+ );
2852
+ }
2853
+ getJson() {
2854
+ return this.json;
2864
2855
  }
2865
2856
  };
2866
2857
 
@@ -2964,6 +2955,14 @@ var import_node_path30 = require("path");
2964
2955
 
2965
2956
  // src/features/mcp/modular-mcp.ts
2966
2957
  var import_node_path29 = require("path");
2958
+ var import_mini14 = require("zod/mini");
2959
+ var ModularMcpServerSchema = import_mini14.z.extend(McpServerSchema, {
2960
+ description: import_mini14.z.string()
2961
+ // Required for modular-mcp
2962
+ });
2963
+ var ModularMcpConfigSchema = import_mini14.z.object({
2964
+ mcpServers: import_mini14.z.record(import_mini14.z.string(), ModularMcpServerSchema)
2965
+ });
2967
2966
  var ModularMcp = class _ModularMcp extends AiFile {
2968
2967
  json;
2969
2968
  constructor(params) {
@@ -3035,7 +3034,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
3035
3034
  global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
3036
3035
  );
3037
3036
  const modularMcpJson = {
3038
- mcpServers: rulesyncMcp.getJson({ modularMcp: true }).mcpServers
3037
+ mcpServers: rulesyncMcp.getModularizedMcpServers()
3039
3038
  };
3040
3039
  return new _ModularMcp({
3041
3040
  baseDir,
@@ -3046,6 +3045,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
3046
3045
  });
3047
3046
  }
3048
3047
  validate() {
3048
+ const result = ModularMcpConfigSchema.safeParse(this.json);
3049
+ if (!result.success) {
3050
+ return { success: false, error: result.error };
3051
+ }
3049
3052
  return { success: true, error: null };
3050
3053
  }
3051
3054
  };
@@ -3107,12 +3110,16 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3107
3110
  const json = JSON.parse(fileContent);
3108
3111
  const mcpJson = modularMcp ? {
3109
3112
  ...json,
3110
- mcpServers: global ? ModularMcp.getMcpServers({
3111
- baseDir,
3112
- global: true,
3113
- relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3114
- }) : ModularMcp.getMcpServers({ baseDir, global: false })
3115
- } : { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3113
+ mcpServers: {
3114
+ ...global ? ModularMcp.getMcpServers({
3115
+ baseDir,
3116
+ global: true,
3117
+ relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3118
+ }) : ModularMcp.getMcpServers({ baseDir, global: false }),
3119
+ // Merge exposed servers
3120
+ ...rulesyncMcp.getExposedMcpServers()
3121
+ }
3122
+ } : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
3116
3123
  return new _ClaudecodeMcp({
3117
3124
  baseDir,
3118
3125
  relativeDirPath: paths.relativeDirPath,
@@ -3248,7 +3255,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3248
3255
  smolToml.stringify({})
3249
3256
  );
3250
3257
  const configToml = smolToml.parse(configTomlFileContent);
3251
- const mcpServers = rulesyncMcp.getJson({ modularMcp: false }).mcpServers;
3258
+ const mcpServers = rulesyncMcp.getJson().mcpServers;
3252
3259
  const filteredMcpServers = this.removeEmptyEntries(mcpServers);
3253
3260
  configToml["mcp_servers"] = filteredMcpServers;
3254
3261
  return new _CodexcliMcp({
@@ -3380,7 +3387,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3380
3387
  rulesyncMcp,
3381
3388
  validate = true
3382
3389
  }) {
3383
- const json = rulesyncMcp.getJson({ modularMcp: false });
3390
+ const json = rulesyncMcp.getJson();
3384
3391
  const cursorConfig = {
3385
3392
  mcpServers: json.mcpServers || {}
3386
3393
  };
@@ -3462,7 +3469,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3462
3469
  JSON.stringify({ mcpServers: {} }, null, 2)
3463
3470
  );
3464
3471
  const json = JSON.parse(fileContent);
3465
- const newJson = { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3472
+ const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
3466
3473
  return new _GeminiCliMcp({
3467
3474
  baseDir,
3468
3475
  relativeDirPath: paths.relativeDirPath,
@@ -3549,7 +3556,7 @@ var mcpProcessorToolTargets = [
3549
3556
  "geminicli",
3550
3557
  "roo"
3551
3558
  ];
3552
- var McpProcessorToolTargetSchema = import_mini13.z.enum(
3559
+ var McpProcessorToolTargetSchema = import_mini15.z.enum(
3553
3560
  // codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
3554
3561
  mcpProcessorToolTargets.concat("codexcli")
3555
3562
  );
@@ -3788,14 +3795,14 @@ var McpProcessor = class extends FeatureProcessor {
3788
3795
  // src/features/rules/rules-processor.ts
3789
3796
  var import_node_path66 = require("path");
3790
3797
  var import_fast_xml_parser = require("fast-xml-parser");
3791
- var import_mini22 = require("zod/mini");
3798
+ var import_mini24 = require("zod/mini");
3792
3799
 
3793
3800
  // src/features/subagents/agentsmd-subagent.ts
3794
3801
  var import_node_path38 = require("path");
3795
3802
 
3796
3803
  // src/features/subagents/simulated-subagent.ts
3797
3804
  var import_node_path37 = require("path");
3798
- var import_mini14 = require("zod/mini");
3805
+ var import_mini16 = require("zod/mini");
3799
3806
 
3800
3807
  // src/features/subagents/tool-subagent.ts
3801
3808
  var ToolSubagent = class extends ToolFile {
@@ -3830,9 +3837,9 @@ var ToolSubagent = class extends ToolFile {
3830
3837
  };
3831
3838
 
3832
3839
  // src/features/subagents/simulated-subagent.ts
3833
- var SimulatedSubagentFrontmatterSchema = import_mini14.z.object({
3834
- name: import_mini14.z.string(),
3835
- description: import_mini14.z.string()
3840
+ var SimulatedSubagentFrontmatterSchema = import_mini16.z.object({
3841
+ name: import_mini16.z.string(),
3842
+ description: import_mini16.z.string()
3836
3843
  });
3837
3844
  var SimulatedSubagent = class extends ToolSubagent {
3838
3845
  frontmatter;
@@ -4066,22 +4073,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4066
4073
 
4067
4074
  // src/features/subagents/subagents-processor.ts
4068
4075
  var import_node_path46 = require("path");
4069
- var import_mini17 = require("zod/mini");
4076
+ var import_mini19 = require("zod/mini");
4070
4077
 
4071
4078
  // src/features/subagents/claudecode-subagent.ts
4072
4079
  var import_node_path45 = require("path");
4073
- var import_mini16 = require("zod/mini");
4080
+ var import_mini18 = require("zod/mini");
4074
4081
 
4075
4082
  // src/features/subagents/rulesync-subagent.ts
4076
4083
  var import_node_path44 = require("path");
4077
- var import_mini15 = require("zod/mini");
4078
- var RulesyncSubagentModelSchema = import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]);
4079
- var RulesyncSubagentFrontmatterSchema = import_mini15.z.object({
4084
+ var import_mini17 = require("zod/mini");
4085
+ var RulesyncSubagentModelSchema = import_mini17.z.enum(["opus", "sonnet", "haiku", "inherit"]);
4086
+ var RulesyncSubagentFrontmatterSchema = import_mini17.z.object({
4080
4087
  targets: RulesyncTargetsSchema,
4081
- name: import_mini15.z.string(),
4082
- description: import_mini15.z.string(),
4083
- claudecode: import_mini15.z.optional(
4084
- import_mini15.z.object({
4088
+ name: import_mini17.z.string(),
4089
+ description: import_mini17.z.string(),
4090
+ claudecode: import_mini17.z.optional(
4091
+ import_mini17.z.object({
4085
4092
  model: RulesyncSubagentModelSchema
4086
4093
  })
4087
4094
  )
@@ -4155,10 +4162,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4155
4162
  };
4156
4163
 
4157
4164
  // src/features/subagents/claudecode-subagent.ts
4158
- var ClaudecodeSubagentFrontmatterSchema = import_mini16.z.object({
4159
- name: import_mini16.z.string(),
4160
- description: import_mini16.z.string(),
4161
- model: import_mini16.z.optional(import_mini16.z.enum(["opus", "sonnet", "haiku", "inherit"]))
4165
+ var ClaudecodeSubagentFrontmatterSchema = import_mini18.z.object({
4166
+ name: import_mini18.z.string(),
4167
+ description: import_mini18.z.string(),
4168
+ model: import_mini18.z.optional(import_mini18.z.enum(["opus", "sonnet", "haiku", "inherit"]))
4162
4169
  });
4163
4170
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4164
4171
  frontmatter;
@@ -4302,7 +4309,7 @@ var subagentsProcessorToolTargetsSimulated = [
4302
4309
  "roo"
4303
4310
  ];
4304
4311
  var subagentsProcessorToolTargetsGlobal = ["claudecode"];
4305
- var SubagentsProcessorToolTargetSchema = import_mini17.z.enum(subagentsProcessorToolTargets);
4312
+ var SubagentsProcessorToolTargetSchema = import_mini19.z.enum(subagentsProcessorToolTargets);
4306
4313
  var SubagentsProcessor = class extends FeatureProcessor {
4307
4314
  toolTarget;
4308
4315
  global;
@@ -4587,23 +4594,23 @@ var import_node_path48 = require("path");
4587
4594
 
4588
4595
  // src/features/rules/rulesync-rule.ts
4589
4596
  var import_node_path47 = require("path");
4590
- var import_mini18 = require("zod/mini");
4591
- var RulesyncRuleFrontmatterSchema = import_mini18.z.object({
4592
- root: import_mini18.z.optional(import_mini18.z.optional(import_mini18.z.boolean())),
4593
- targets: import_mini18.z.optional(RulesyncTargetsSchema),
4594
- description: import_mini18.z.optional(import_mini18.z.string()),
4595
- globs: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
4596
- agentsmd: import_mini18.z.optional(
4597
- import_mini18.z.object({
4597
+ var import_mini20 = require("zod/mini");
4598
+ var RulesyncRuleFrontmatterSchema = import_mini20.z.object({
4599
+ root: import_mini20.z.optional(import_mini20.z.optional(import_mini20.z.boolean())),
4600
+ targets: import_mini20.z.optional(RulesyncTargetsSchema),
4601
+ description: import_mini20.z.optional(import_mini20.z.string()),
4602
+ globs: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
4603
+ agentsmd: import_mini20.z.optional(
4604
+ import_mini20.z.object({
4598
4605
  // @example "path/to/subproject"
4599
- subprojectPath: import_mini18.z.optional(import_mini18.z.string())
4606
+ subprojectPath: import_mini20.z.optional(import_mini20.z.string())
4600
4607
  })
4601
4608
  ),
4602
- cursor: import_mini18.z.optional(
4603
- import_mini18.z.object({
4604
- alwaysApply: import_mini18.z.optional(import_mini18.z.boolean()),
4605
- description: import_mini18.z.optional(import_mini18.z.string()),
4606
- globs: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
4609
+ cursor: import_mini20.z.optional(
4610
+ import_mini20.z.object({
4611
+ alwaysApply: import_mini20.z.optional(import_mini20.z.boolean()),
4612
+ description: import_mini20.z.optional(import_mini20.z.string()),
4613
+ globs: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
4607
4614
  })
4608
4615
  )
4609
4616
  });
@@ -5195,9 +5202,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5195
5202
 
5196
5203
  // src/features/rules/cline-rule.ts
5197
5204
  var import_node_path54 = require("path");
5198
- var import_mini19 = require("zod/mini");
5199
- var ClineRuleFrontmatterSchema = import_mini19.z.object({
5200
- description: import_mini19.z.string()
5205
+ var import_mini21 = require("zod/mini");
5206
+ var ClineRuleFrontmatterSchema = import_mini21.z.object({
5207
+ description: import_mini21.z.string()
5201
5208
  });
5202
5209
  var ClineRule = class _ClineRule extends ToolRule {
5203
5210
  static getSettablePaths() {
@@ -5344,10 +5351,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5344
5351
 
5345
5352
  // src/features/rules/copilot-rule.ts
5346
5353
  var import_node_path56 = require("path");
5347
- var import_mini20 = require("zod/mini");
5348
- var CopilotRuleFrontmatterSchema = import_mini20.z.object({
5349
- description: import_mini20.z.optional(import_mini20.z.string()),
5350
- applyTo: import_mini20.z.optional(import_mini20.z.string())
5354
+ var import_mini22 = require("zod/mini");
5355
+ var CopilotRuleFrontmatterSchema = import_mini22.z.object({
5356
+ description: import_mini22.z.optional(import_mini22.z.string()),
5357
+ applyTo: import_mini22.z.optional(import_mini22.z.string())
5351
5358
  });
5352
5359
  var CopilotRule = class _CopilotRule extends ToolRule {
5353
5360
  frontmatter;
@@ -5514,11 +5521,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5514
5521
 
5515
5522
  // src/features/rules/cursor-rule.ts
5516
5523
  var import_node_path57 = require("path");
5517
- var import_mini21 = require("zod/mini");
5518
- var CursorRuleFrontmatterSchema = import_mini21.z.object({
5519
- description: import_mini21.z.optional(import_mini21.z.string()),
5520
- globs: import_mini21.z.optional(import_mini21.z.string()),
5521
- alwaysApply: import_mini21.z.optional(import_mini21.z.boolean())
5524
+ var import_mini23 = require("zod/mini");
5525
+ var CursorRuleFrontmatterSchema = import_mini23.z.object({
5526
+ description: import_mini23.z.optional(import_mini23.z.string()),
5527
+ globs: import_mini23.z.optional(import_mini23.z.string()),
5528
+ alwaysApply: import_mini23.z.optional(import_mini23.z.boolean())
5522
5529
  });
5523
5530
  var CursorRule = class _CursorRule extends ToolRule {
5524
5531
  frontmatter;
@@ -6234,7 +6241,7 @@ var rulesProcessorToolTargets = [
6234
6241
  "warp",
6235
6242
  "windsurf"
6236
6243
  ];
6237
- var RulesProcessorToolTargetSchema = import_mini22.z.enum(rulesProcessorToolTargets);
6244
+ var RulesProcessorToolTargetSchema = import_mini24.z.enum(rulesProcessorToolTargets);
6238
6245
  var rulesProcessorToolTargetsGlobal = [
6239
6246
  "claudecode",
6240
6247
  "codexcli",
@@ -7730,7 +7737,7 @@ var import_fastmcp = require("fastmcp");
7730
7737
 
7731
7738
  // src/mcp/commands.ts
7732
7739
  var import_node_path69 = require("path");
7733
- var import_mini23 = require("zod/mini");
7740
+ var import_mini25 = require("zod/mini");
7734
7741
  var maxCommandSizeBytes = 1024 * 1024;
7735
7742
  var maxCommandsCount = 1e3;
7736
7743
  async function listCommands() {
@@ -7849,17 +7856,17 @@ async function deleteCommand({ relativePathFromCwd }) {
7849
7856
  }
7850
7857
  }
7851
7858
  var commandToolSchemas = {
7852
- listCommands: import_mini23.z.object({}),
7853
- getCommand: import_mini23.z.object({
7854
- relativePathFromCwd: import_mini23.z.string()
7859
+ listCommands: import_mini25.z.object({}),
7860
+ getCommand: import_mini25.z.object({
7861
+ relativePathFromCwd: import_mini25.z.string()
7855
7862
  }),
7856
- putCommand: import_mini23.z.object({
7857
- relativePathFromCwd: import_mini23.z.string(),
7863
+ putCommand: import_mini25.z.object({
7864
+ relativePathFromCwd: import_mini25.z.string(),
7858
7865
  frontmatter: RulesyncCommandFrontmatterSchema,
7859
- body: import_mini23.z.string()
7866
+ body: import_mini25.z.string()
7860
7867
  }),
7861
- deleteCommand: import_mini23.z.object({
7862
- relativePathFromCwd: import_mini23.z.string()
7868
+ deleteCommand: import_mini25.z.object({
7869
+ relativePathFromCwd: import_mini25.z.string()
7863
7870
  })
7864
7871
  };
7865
7872
  var commandTools = {
@@ -7908,7 +7915,7 @@ var commandTools = {
7908
7915
 
7909
7916
  // src/mcp/ignore.ts
7910
7917
  var import_node_path70 = require("path");
7911
- var import_mini24 = require("zod/mini");
7918
+ var import_mini26 = require("zod/mini");
7912
7919
  var maxIgnoreFileSizeBytes = 100 * 1024;
7913
7920
  async function getIgnoreFile() {
7914
7921
  const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
@@ -7959,11 +7966,11 @@ async function deleteIgnoreFile() {
7959
7966
  }
7960
7967
  }
7961
7968
  var ignoreToolSchemas = {
7962
- getIgnoreFile: import_mini24.z.object({}),
7963
- putIgnoreFile: import_mini24.z.object({
7964
- content: import_mini24.z.string()
7969
+ getIgnoreFile: import_mini26.z.object({}),
7970
+ putIgnoreFile: import_mini26.z.object({
7971
+ content: import_mini26.z.string()
7965
7972
  }),
7966
- deleteIgnoreFile: import_mini24.z.object({})
7973
+ deleteIgnoreFile: import_mini26.z.object({})
7967
7974
  };
7968
7975
  var ignoreTools = {
7969
7976
  getIgnoreFile: {
@@ -7997,7 +8004,7 @@ var ignoreTools = {
7997
8004
 
7998
8005
  // src/mcp/mcp.ts
7999
8006
  var import_node_path71 = require("path");
8000
- var import_mini25 = require("zod/mini");
8007
+ var import_mini27 = require("zod/mini");
8001
8008
  var maxMcpSizeBytes = 1024 * 1024;
8002
8009
  async function getMcpFile() {
8003
8010
  try {
@@ -8085,11 +8092,11 @@ async function deleteMcpFile() {
8085
8092
  }
8086
8093
  }
8087
8094
  var mcpToolSchemas = {
8088
- getMcpFile: import_mini25.z.object({}),
8089
- putMcpFile: import_mini25.z.object({
8090
- content: import_mini25.z.string()
8095
+ getMcpFile: import_mini27.z.object({}),
8096
+ putMcpFile: import_mini27.z.object({
8097
+ content: import_mini27.z.string()
8091
8098
  }),
8092
- deleteMcpFile: import_mini25.z.object({})
8099
+ deleteMcpFile: import_mini27.z.object({})
8093
8100
  };
8094
8101
  var mcpTools = {
8095
8102
  getMcpFile: {
@@ -8123,7 +8130,7 @@ var mcpTools = {
8123
8130
 
8124
8131
  // src/mcp/rules.ts
8125
8132
  var import_node_path72 = require("path");
8126
- var import_mini26 = require("zod/mini");
8133
+ var import_mini28 = require("zod/mini");
8127
8134
  var maxRuleSizeBytes = 1024 * 1024;
8128
8135
  var maxRulesCount = 1e3;
8129
8136
  async function listRules() {
@@ -8242,17 +8249,17 @@ async function deleteRule({ relativePathFromCwd }) {
8242
8249
  }
8243
8250
  }
8244
8251
  var ruleToolSchemas = {
8245
- listRules: import_mini26.z.object({}),
8246
- getRule: import_mini26.z.object({
8247
- relativePathFromCwd: import_mini26.z.string()
8252
+ listRules: import_mini28.z.object({}),
8253
+ getRule: import_mini28.z.object({
8254
+ relativePathFromCwd: import_mini28.z.string()
8248
8255
  }),
8249
- putRule: import_mini26.z.object({
8250
- relativePathFromCwd: import_mini26.z.string(),
8256
+ putRule: import_mini28.z.object({
8257
+ relativePathFromCwd: import_mini28.z.string(),
8251
8258
  frontmatter: RulesyncRuleFrontmatterSchema,
8252
- body: import_mini26.z.string()
8259
+ body: import_mini28.z.string()
8253
8260
  }),
8254
- deleteRule: import_mini26.z.object({
8255
- relativePathFromCwd: import_mini26.z.string()
8261
+ deleteRule: import_mini28.z.object({
8262
+ relativePathFromCwd: import_mini28.z.string()
8256
8263
  })
8257
8264
  };
8258
8265
  var ruleTools = {
@@ -8301,7 +8308,7 @@ var ruleTools = {
8301
8308
 
8302
8309
  // src/mcp/subagents.ts
8303
8310
  var import_node_path73 = require("path");
8304
- var import_mini27 = require("zod/mini");
8311
+ var import_mini29 = require("zod/mini");
8305
8312
  var maxSubagentSizeBytes = 1024 * 1024;
8306
8313
  var maxSubagentsCount = 1e3;
8307
8314
  async function listSubagents() {
@@ -8425,17 +8432,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
8425
8432
  }
8426
8433
  }
8427
8434
  var subagentToolSchemas = {
8428
- listSubagents: import_mini27.z.object({}),
8429
- getSubagent: import_mini27.z.object({
8430
- relativePathFromCwd: import_mini27.z.string()
8435
+ listSubagents: import_mini29.z.object({}),
8436
+ getSubagent: import_mini29.z.object({
8437
+ relativePathFromCwd: import_mini29.z.string()
8431
8438
  }),
8432
- putSubagent: import_mini27.z.object({
8433
- relativePathFromCwd: import_mini27.z.string(),
8439
+ putSubagent: import_mini29.z.object({
8440
+ relativePathFromCwd: import_mini29.z.string(),
8434
8441
  frontmatter: RulesyncSubagentFrontmatterSchema,
8435
- body: import_mini27.z.string()
8442
+ body: import_mini29.z.string()
8436
8443
  }),
8437
- deleteSubagent: import_mini27.z.object({
8438
- relativePathFromCwd: import_mini27.z.string()
8444
+ deleteSubagent: import_mini29.z.object({
8445
+ relativePathFromCwd: import_mini29.z.string()
8439
8446
  })
8440
8447
  };
8441
8448
  var subagentTools = {
@@ -8515,7 +8522,7 @@ async function mcpCommand({ version }) {
8515
8522
  }
8516
8523
 
8517
8524
  // src/cli/index.ts
8518
- var getVersion = () => "3.22.1";
8525
+ var getVersion = () => "3.23.2";
8519
8526
  var main = async () => {
8520
8527
  const program = new import_commander.Command();
8521
8528
  const version = getVersion();
package/dist/index.js CHANGED
@@ -23,10 +23,7 @@ function isZodErrorLike(error) {
23
23
  }
24
24
  function formatError(error) {
25
25
  if (error instanceof ZodError || isZodErrorLike(error)) {
26
- return error.issues.map((issue) => {
27
- const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
28
- return `${path2}${issue.message}`;
29
- }).join("; ");
26
+ return `Zod raw error: ${JSON.stringify(error.issues)}`;
30
27
  }
31
28
  if (error instanceof Error) {
32
29
  return `${error.name}: ${error.message}`;
@@ -561,7 +558,6 @@ var AiFile = class {
561
558
  relativeDirPath,
562
559
  relativeFilePath,
563
560
  fileContent,
564
- validate = true,
565
561
  global = false
566
562
  }) {
567
563
  this.baseDir = baseDir;
@@ -569,12 +565,6 @@ var AiFile = class {
569
565
  this.relativeFilePath = relativeFilePath;
570
566
  this.fileContent = fileContent;
571
567
  this.global = global;
572
- if (validate) {
573
- const result = this.validate();
574
- if (!result.success) {
575
- throw result.error;
576
- }
577
- }
578
568
  }
579
569
  static async fromFile(_params) {
580
570
  throw new Error("Please implement this method in the subclass.");
@@ -2691,7 +2681,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2691
2681
  };
2692
2682
 
2693
2683
  // src/features/mcp/mcp-processor.ts
2694
- import { z as z13 } from "zod/mini";
2684
+ import { z as z15 } from "zod/mini";
2695
2685
 
2696
2686
  // src/features/mcp/amazonqcli-mcp.ts
2697
2687
  import { join as join26 } from "path";
@@ -2699,9 +2689,11 @@ import { join as join26 } from "path";
2699
2689
  // src/features/mcp/rulesync-mcp.ts
2700
2690
  import { join as join25 } from "path";
2701
2691
  import { omit } from "es-toolkit/object";
2692
+ import { z as z13 } from "zod/mini";
2693
+
2694
+ // src/types/mcp.ts
2702
2695
  import { z as z12 } from "zod/mini";
2703
- var McpTransportTypeSchema = z12.enum(["stdio", "sse", "http"]);
2704
- var McpServerBaseSchema = z12.object({
2696
+ var McpServerSchema = z12.object({
2705
2697
  type: z12.optional(z12.enum(["stdio", "sse", "http"])),
2706
2698
  command: z12.optional(z12.union([z12.string(), z12.array(z12.string())])),
2707
2699
  args: z12.optional(z12.array(z12.string())),
@@ -2713,23 +2705,30 @@ var McpServerBaseSchema = z12.object({
2713
2705
  timeout: z12.optional(z12.number()),
2714
2706
  trust: z12.optional(z12.boolean()),
2715
2707
  cwd: z12.optional(z12.string()),
2716
- transport: z12.optional(McpTransportTypeSchema),
2708
+ transport: z12.optional(z12.enum(["stdio", "sse", "http"])),
2717
2709
  alwaysAllow: z12.optional(z12.array(z12.string())),
2718
2710
  tools: z12.optional(z12.array(z12.string())),
2719
2711
  kiroAutoApprove: z12.optional(z12.array(z12.string())),
2720
2712
  kiroAutoBlock: z12.optional(z12.array(z12.string())),
2721
2713
  headers: z12.optional(z12.record(z12.string(), z12.string()))
2722
2714
  });
2723
- var ModularMcpServerSchema = z12.extend(McpServerBaseSchema, {
2724
- description: z12.string().check(z12.minLength(1))
2725
- });
2726
- var ModularMcpServersSchema = z12.record(z12.string(), ModularMcpServerSchema);
2727
- var RulesyncMcpServersSchema = z12.extend(McpServerBaseSchema, {
2728
- description: z12.optional(z12.string()),
2729
- targets: z12.optional(RulesyncTargetsSchema)
2730
- });
2731
- var RulesyncMcpConfigSchema = z12.object({
2732
- mcpServers: z12.record(z12.string(), RulesyncMcpServersSchema)
2715
+ var McpServersSchema = z12.record(z12.string(), McpServerSchema);
2716
+
2717
+ // src/features/mcp/rulesync-mcp.ts
2718
+ var RulesyncMcpServerSchema = z13.union([
2719
+ z13.extend(McpServerSchema, {
2720
+ targets: z13.optional(RulesyncTargetsSchema),
2721
+ description: z13.optional(z13.string()),
2722
+ exposed: z13.optional(z13.literal(false))
2723
+ }),
2724
+ z13.extend(McpServerSchema, {
2725
+ targets: z13.optional(RulesyncTargetsSchema),
2726
+ description: z13.undefined(),
2727
+ exposed: z13.literal(true)
2728
+ })
2729
+ ]);
2730
+ var RulesyncMcpConfigSchema = z13.object({
2731
+ mcpServers: z13.record(z13.string(), RulesyncMcpServerSchema)
2733
2732
  });
2734
2733
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2735
2734
  json;
@@ -2758,16 +2757,9 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2758
2757
  };
2759
2758
  }
2760
2759
  validate() {
2761
- if (this.modularMcp) {
2762
- const result = ModularMcpServersSchema.safeParse(this.json.mcpServers);
2763
- if (!result.success) {
2764
- return {
2765
- success: false,
2766
- error: new Error(
2767
- `Invalid MCP server configuration for modular-mcp: ${formatError(result.error)}`
2768
- )
2769
- };
2770
- }
2760
+ const result = RulesyncMcpConfigSchema.safeParse(this.json);
2761
+ if (!result.success) {
2762
+ return { success: false, error: result.error };
2771
2763
  }
2772
2764
  return { success: true, error: null };
2773
2765
  }
@@ -2818,26 +2810,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2818
2810
  modularMcp
2819
2811
  });
2820
2812
  }
2821
- getJson({ modularMcp = false } = {}) {
2822
- if (modularMcp) {
2823
- return this.json;
2824
- }
2825
- if (!this.json || typeof this.json !== "object") {
2826
- return this.json;
2827
- }
2828
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2829
- return this.json;
2830
- }
2831
- const mcpServersWithoutDescription = Object.fromEntries(
2832
- Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
2813
+ getExposedMcpServers() {
2814
+ return Object.fromEntries(
2815
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
2833
2816
  serverName,
2834
- omit(serverConfig, ["description"])
2817
+ omit(serverConfig, ["targets", "description", "exposed"])
2835
2818
  ])
2836
2819
  );
2837
- return {
2838
- ...this.json,
2839
- mcpServers: mcpServersWithoutDescription
2840
- };
2820
+ }
2821
+ getModularizedMcpServers() {
2822
+ return Object.fromEntries(
2823
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
2824
+ serverName,
2825
+ // description is required for modular-mcp servers
2826
+ omit(serverConfig, ["targets", "exposed"])
2827
+ ])
2828
+ );
2829
+ }
2830
+ getJson() {
2831
+ return this.json;
2841
2832
  }
2842
2833
  };
2843
2834
 
@@ -2941,6 +2932,14 @@ import { join as join28 } from "path";
2941
2932
 
2942
2933
  // src/features/mcp/modular-mcp.ts
2943
2934
  import { join as join27 } from "path";
2935
+ import { z as z14 } from "zod/mini";
2936
+ var ModularMcpServerSchema = z14.extend(McpServerSchema, {
2937
+ description: z14.string()
2938
+ // Required for modular-mcp
2939
+ });
2940
+ var ModularMcpConfigSchema = z14.object({
2941
+ mcpServers: z14.record(z14.string(), ModularMcpServerSchema)
2942
+ });
2944
2943
  var ModularMcp = class _ModularMcp extends AiFile {
2945
2944
  json;
2946
2945
  constructor(params) {
@@ -3012,7 +3011,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
3012
3011
  global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
3013
3012
  );
3014
3013
  const modularMcpJson = {
3015
- mcpServers: rulesyncMcp.getJson({ modularMcp: true }).mcpServers
3014
+ mcpServers: rulesyncMcp.getModularizedMcpServers()
3016
3015
  };
3017
3016
  return new _ModularMcp({
3018
3017
  baseDir,
@@ -3023,6 +3022,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
3023
3022
  });
3024
3023
  }
3025
3024
  validate() {
3025
+ const result = ModularMcpConfigSchema.safeParse(this.json);
3026
+ if (!result.success) {
3027
+ return { success: false, error: result.error };
3028
+ }
3026
3029
  return { success: true, error: null };
3027
3030
  }
3028
3031
  };
@@ -3084,12 +3087,16 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3084
3087
  const json = JSON.parse(fileContent);
3085
3088
  const mcpJson = modularMcp ? {
3086
3089
  ...json,
3087
- mcpServers: global ? ModularMcp.getMcpServers({
3088
- baseDir,
3089
- global: true,
3090
- relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3091
- }) : ModularMcp.getMcpServers({ baseDir, global: false })
3092
- } : { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3090
+ mcpServers: {
3091
+ ...global ? ModularMcp.getMcpServers({
3092
+ baseDir,
3093
+ global: true,
3094
+ relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3095
+ }) : ModularMcp.getMcpServers({ baseDir, global: false }),
3096
+ // Merge exposed servers
3097
+ ...rulesyncMcp.getExposedMcpServers()
3098
+ }
3099
+ } : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
3093
3100
  return new _ClaudecodeMcp({
3094
3101
  baseDir,
3095
3102
  relativeDirPath: paths.relativeDirPath,
@@ -3225,7 +3232,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3225
3232
  smolToml.stringify({})
3226
3233
  );
3227
3234
  const configToml = smolToml.parse(configTomlFileContent);
3228
- const mcpServers = rulesyncMcp.getJson({ modularMcp: false }).mcpServers;
3235
+ const mcpServers = rulesyncMcp.getJson().mcpServers;
3229
3236
  const filteredMcpServers = this.removeEmptyEntries(mcpServers);
3230
3237
  configToml["mcp_servers"] = filteredMcpServers;
3231
3238
  return new _CodexcliMcp({
@@ -3357,7 +3364,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3357
3364
  rulesyncMcp,
3358
3365
  validate = true
3359
3366
  }) {
3360
- const json = rulesyncMcp.getJson({ modularMcp: false });
3367
+ const json = rulesyncMcp.getJson();
3361
3368
  const cursorConfig = {
3362
3369
  mcpServers: json.mcpServers || {}
3363
3370
  };
@@ -3439,7 +3446,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3439
3446
  JSON.stringify({ mcpServers: {} }, null, 2)
3440
3447
  );
3441
3448
  const json = JSON.parse(fileContent);
3442
- const newJson = { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3449
+ const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
3443
3450
  return new _GeminiCliMcp({
3444
3451
  baseDir,
3445
3452
  relativeDirPath: paths.relativeDirPath,
@@ -3526,7 +3533,7 @@ var mcpProcessorToolTargets = [
3526
3533
  "geminicli",
3527
3534
  "roo"
3528
3535
  ];
3529
- var McpProcessorToolTargetSchema = z13.enum(
3536
+ var McpProcessorToolTargetSchema = z15.enum(
3530
3537
  // codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
3531
3538
  mcpProcessorToolTargets.concat("codexcli")
3532
3539
  );
@@ -3765,14 +3772,14 @@ var McpProcessor = class extends FeatureProcessor {
3765
3772
  // src/features/rules/rules-processor.ts
3766
3773
  import { basename as basename17, join as join64 } from "path";
3767
3774
  import { XMLBuilder } from "fast-xml-parser";
3768
- import { z as z22 } from "zod/mini";
3775
+ import { z as z24 } from "zod/mini";
3769
3776
 
3770
3777
  // src/features/subagents/agentsmd-subagent.ts
3771
3778
  import { join as join36 } from "path";
3772
3779
 
3773
3780
  // src/features/subagents/simulated-subagent.ts
3774
3781
  import { basename as basename12, join as join35 } from "path";
3775
- import { z as z14 } from "zod/mini";
3782
+ import { z as z16 } from "zod/mini";
3776
3783
 
3777
3784
  // src/features/subagents/tool-subagent.ts
3778
3785
  var ToolSubagent = class extends ToolFile {
@@ -3807,9 +3814,9 @@ var ToolSubagent = class extends ToolFile {
3807
3814
  };
3808
3815
 
3809
3816
  // src/features/subagents/simulated-subagent.ts
3810
- var SimulatedSubagentFrontmatterSchema = z14.object({
3811
- name: z14.string(),
3812
- description: z14.string()
3817
+ var SimulatedSubagentFrontmatterSchema = z16.object({
3818
+ name: z16.string(),
3819
+ description: z16.string()
3813
3820
  });
3814
3821
  var SimulatedSubagent = class extends ToolSubagent {
3815
3822
  frontmatter;
@@ -4043,22 +4050,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4043
4050
 
4044
4051
  // src/features/subagents/subagents-processor.ts
4045
4052
  import { basename as basename14, join as join44 } from "path";
4046
- import { z as z17 } from "zod/mini";
4053
+ import { z as z19 } from "zod/mini";
4047
4054
 
4048
4055
  // src/features/subagents/claudecode-subagent.ts
4049
4056
  import { join as join43 } from "path";
4050
- import { z as z16 } from "zod/mini";
4057
+ import { z as z18 } from "zod/mini";
4051
4058
 
4052
4059
  // src/features/subagents/rulesync-subagent.ts
4053
4060
  import { basename as basename13, join as join42 } from "path";
4054
- import { z as z15 } from "zod/mini";
4055
- var RulesyncSubagentModelSchema = z15.enum(["opus", "sonnet", "haiku", "inherit"]);
4056
- var RulesyncSubagentFrontmatterSchema = z15.object({
4061
+ import { z as z17 } from "zod/mini";
4062
+ var RulesyncSubagentModelSchema = z17.enum(["opus", "sonnet", "haiku", "inherit"]);
4063
+ var RulesyncSubagentFrontmatterSchema = z17.object({
4057
4064
  targets: RulesyncTargetsSchema,
4058
- name: z15.string(),
4059
- description: z15.string(),
4060
- claudecode: z15.optional(
4061
- z15.object({
4065
+ name: z17.string(),
4066
+ description: z17.string(),
4067
+ claudecode: z17.optional(
4068
+ z17.object({
4062
4069
  model: RulesyncSubagentModelSchema
4063
4070
  })
4064
4071
  )
@@ -4132,10 +4139,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4132
4139
  };
4133
4140
 
4134
4141
  // src/features/subagents/claudecode-subagent.ts
4135
- var ClaudecodeSubagentFrontmatterSchema = z16.object({
4136
- name: z16.string(),
4137
- description: z16.string(),
4138
- model: z16.optional(z16.enum(["opus", "sonnet", "haiku", "inherit"]))
4142
+ var ClaudecodeSubagentFrontmatterSchema = z18.object({
4143
+ name: z18.string(),
4144
+ description: z18.string(),
4145
+ model: z18.optional(z18.enum(["opus", "sonnet", "haiku", "inherit"]))
4139
4146
  });
4140
4147
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4141
4148
  frontmatter;
@@ -4279,7 +4286,7 @@ var subagentsProcessorToolTargetsSimulated = [
4279
4286
  "roo"
4280
4287
  ];
4281
4288
  var subagentsProcessorToolTargetsGlobal = ["claudecode"];
4282
- var SubagentsProcessorToolTargetSchema = z17.enum(subagentsProcessorToolTargets);
4289
+ var SubagentsProcessorToolTargetSchema = z19.enum(subagentsProcessorToolTargets);
4283
4290
  var SubagentsProcessor = class extends FeatureProcessor {
4284
4291
  toolTarget;
4285
4292
  global;
@@ -4564,23 +4571,23 @@ import { join as join46 } from "path";
4564
4571
 
4565
4572
  // src/features/rules/rulesync-rule.ts
4566
4573
  import { basename as basename15, join as join45 } from "path";
4567
- import { z as z18 } from "zod/mini";
4568
- var RulesyncRuleFrontmatterSchema = z18.object({
4569
- root: z18.optional(z18.optional(z18.boolean())),
4570
- targets: z18.optional(RulesyncTargetsSchema),
4571
- description: z18.optional(z18.string()),
4572
- globs: z18.optional(z18.array(z18.string())),
4573
- agentsmd: z18.optional(
4574
- z18.object({
4574
+ import { z as z20 } from "zod/mini";
4575
+ var RulesyncRuleFrontmatterSchema = z20.object({
4576
+ root: z20.optional(z20.optional(z20.boolean())),
4577
+ targets: z20.optional(RulesyncTargetsSchema),
4578
+ description: z20.optional(z20.string()),
4579
+ globs: z20.optional(z20.array(z20.string())),
4580
+ agentsmd: z20.optional(
4581
+ z20.object({
4575
4582
  // @example "path/to/subproject"
4576
- subprojectPath: z18.optional(z18.string())
4583
+ subprojectPath: z20.optional(z20.string())
4577
4584
  })
4578
4585
  ),
4579
- cursor: z18.optional(
4580
- z18.object({
4581
- alwaysApply: z18.optional(z18.boolean()),
4582
- description: z18.optional(z18.string()),
4583
- globs: z18.optional(z18.array(z18.string()))
4586
+ cursor: z20.optional(
4587
+ z20.object({
4588
+ alwaysApply: z20.optional(z20.boolean()),
4589
+ description: z20.optional(z20.string()),
4590
+ globs: z20.optional(z20.array(z20.string()))
4584
4591
  })
4585
4592
  )
4586
4593
  });
@@ -5172,9 +5179,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5172
5179
 
5173
5180
  // src/features/rules/cline-rule.ts
5174
5181
  import { join as join52 } from "path";
5175
- import { z as z19 } from "zod/mini";
5176
- var ClineRuleFrontmatterSchema = z19.object({
5177
- description: z19.string()
5182
+ import { z as z21 } from "zod/mini";
5183
+ var ClineRuleFrontmatterSchema = z21.object({
5184
+ description: z21.string()
5178
5185
  });
5179
5186
  var ClineRule = class _ClineRule extends ToolRule {
5180
5187
  static getSettablePaths() {
@@ -5321,10 +5328,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5321
5328
 
5322
5329
  // src/features/rules/copilot-rule.ts
5323
5330
  import { join as join54 } from "path";
5324
- import { z as z20 } from "zod/mini";
5325
- var CopilotRuleFrontmatterSchema = z20.object({
5326
- description: z20.optional(z20.string()),
5327
- applyTo: z20.optional(z20.string())
5331
+ import { z as z22 } from "zod/mini";
5332
+ var CopilotRuleFrontmatterSchema = z22.object({
5333
+ description: z22.optional(z22.string()),
5334
+ applyTo: z22.optional(z22.string())
5328
5335
  });
5329
5336
  var CopilotRule = class _CopilotRule extends ToolRule {
5330
5337
  frontmatter;
@@ -5491,11 +5498,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5491
5498
 
5492
5499
  // src/features/rules/cursor-rule.ts
5493
5500
  import { basename as basename16, join as join55 } from "path";
5494
- import { z as z21 } from "zod/mini";
5495
- var CursorRuleFrontmatterSchema = z21.object({
5496
- description: z21.optional(z21.string()),
5497
- globs: z21.optional(z21.string()),
5498
- alwaysApply: z21.optional(z21.boolean())
5501
+ import { z as z23 } from "zod/mini";
5502
+ var CursorRuleFrontmatterSchema = z23.object({
5503
+ description: z23.optional(z23.string()),
5504
+ globs: z23.optional(z23.string()),
5505
+ alwaysApply: z23.optional(z23.boolean())
5499
5506
  });
5500
5507
  var CursorRule = class _CursorRule extends ToolRule {
5501
5508
  frontmatter;
@@ -6211,7 +6218,7 @@ var rulesProcessorToolTargets = [
6211
6218
  "warp",
6212
6219
  "windsurf"
6213
6220
  ];
6214
- var RulesProcessorToolTargetSchema = z22.enum(rulesProcessorToolTargets);
6221
+ var RulesProcessorToolTargetSchema = z24.enum(rulesProcessorToolTargets);
6215
6222
  var rulesProcessorToolTargetsGlobal = [
6216
6223
  "claudecode",
6217
6224
  "codexcli",
@@ -7707,7 +7714,7 @@ import { FastMCP } from "fastmcp";
7707
7714
 
7708
7715
  // src/mcp/commands.ts
7709
7716
  import { basename as basename18, join as join67 } from "path";
7710
- import { z as z23 } from "zod/mini";
7717
+ import { z as z25 } from "zod/mini";
7711
7718
  var maxCommandSizeBytes = 1024 * 1024;
7712
7719
  var maxCommandsCount = 1e3;
7713
7720
  async function listCommands() {
@@ -7826,17 +7833,17 @@ async function deleteCommand({ relativePathFromCwd }) {
7826
7833
  }
7827
7834
  }
7828
7835
  var commandToolSchemas = {
7829
- listCommands: z23.object({}),
7830
- getCommand: z23.object({
7831
- relativePathFromCwd: z23.string()
7836
+ listCommands: z25.object({}),
7837
+ getCommand: z25.object({
7838
+ relativePathFromCwd: z25.string()
7832
7839
  }),
7833
- putCommand: z23.object({
7834
- relativePathFromCwd: z23.string(),
7840
+ putCommand: z25.object({
7841
+ relativePathFromCwd: z25.string(),
7835
7842
  frontmatter: RulesyncCommandFrontmatterSchema,
7836
- body: z23.string()
7843
+ body: z25.string()
7837
7844
  }),
7838
- deleteCommand: z23.object({
7839
- relativePathFromCwd: z23.string()
7845
+ deleteCommand: z25.object({
7846
+ relativePathFromCwd: z25.string()
7840
7847
  })
7841
7848
  };
7842
7849
  var commandTools = {
@@ -7885,7 +7892,7 @@ var commandTools = {
7885
7892
 
7886
7893
  // src/mcp/ignore.ts
7887
7894
  import { join as join68 } from "path";
7888
- import { z as z24 } from "zod/mini";
7895
+ import { z as z26 } from "zod/mini";
7889
7896
  var maxIgnoreFileSizeBytes = 100 * 1024;
7890
7897
  async function getIgnoreFile() {
7891
7898
  const ignoreFilePath = join68(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
@@ -7936,11 +7943,11 @@ async function deleteIgnoreFile() {
7936
7943
  }
7937
7944
  }
7938
7945
  var ignoreToolSchemas = {
7939
- getIgnoreFile: z24.object({}),
7940
- putIgnoreFile: z24.object({
7941
- content: z24.string()
7946
+ getIgnoreFile: z26.object({}),
7947
+ putIgnoreFile: z26.object({
7948
+ content: z26.string()
7942
7949
  }),
7943
- deleteIgnoreFile: z24.object({})
7950
+ deleteIgnoreFile: z26.object({})
7944
7951
  };
7945
7952
  var ignoreTools = {
7946
7953
  getIgnoreFile: {
@@ -7974,7 +7981,7 @@ var ignoreTools = {
7974
7981
 
7975
7982
  // src/mcp/mcp.ts
7976
7983
  import { join as join69 } from "path";
7977
- import { z as z25 } from "zod/mini";
7984
+ import { z as z27 } from "zod/mini";
7978
7985
  var maxMcpSizeBytes = 1024 * 1024;
7979
7986
  async function getMcpFile() {
7980
7987
  try {
@@ -8062,11 +8069,11 @@ async function deleteMcpFile() {
8062
8069
  }
8063
8070
  }
8064
8071
  var mcpToolSchemas = {
8065
- getMcpFile: z25.object({}),
8066
- putMcpFile: z25.object({
8067
- content: z25.string()
8072
+ getMcpFile: z27.object({}),
8073
+ putMcpFile: z27.object({
8074
+ content: z27.string()
8068
8075
  }),
8069
- deleteMcpFile: z25.object({})
8076
+ deleteMcpFile: z27.object({})
8070
8077
  };
8071
8078
  var mcpTools = {
8072
8079
  getMcpFile: {
@@ -8100,7 +8107,7 @@ var mcpTools = {
8100
8107
 
8101
8108
  // src/mcp/rules.ts
8102
8109
  import { basename as basename19, join as join70 } from "path";
8103
- import { z as z26 } from "zod/mini";
8110
+ import { z as z28 } from "zod/mini";
8104
8111
  var maxRuleSizeBytes = 1024 * 1024;
8105
8112
  var maxRulesCount = 1e3;
8106
8113
  async function listRules() {
@@ -8219,17 +8226,17 @@ async function deleteRule({ relativePathFromCwd }) {
8219
8226
  }
8220
8227
  }
8221
8228
  var ruleToolSchemas = {
8222
- listRules: z26.object({}),
8223
- getRule: z26.object({
8224
- relativePathFromCwd: z26.string()
8229
+ listRules: z28.object({}),
8230
+ getRule: z28.object({
8231
+ relativePathFromCwd: z28.string()
8225
8232
  }),
8226
- putRule: z26.object({
8227
- relativePathFromCwd: z26.string(),
8233
+ putRule: z28.object({
8234
+ relativePathFromCwd: z28.string(),
8228
8235
  frontmatter: RulesyncRuleFrontmatterSchema,
8229
- body: z26.string()
8236
+ body: z28.string()
8230
8237
  }),
8231
- deleteRule: z26.object({
8232
- relativePathFromCwd: z26.string()
8238
+ deleteRule: z28.object({
8239
+ relativePathFromCwd: z28.string()
8233
8240
  })
8234
8241
  };
8235
8242
  var ruleTools = {
@@ -8278,7 +8285,7 @@ var ruleTools = {
8278
8285
 
8279
8286
  // src/mcp/subagents.ts
8280
8287
  import { basename as basename20, join as join71 } from "path";
8281
- import { z as z27 } from "zod/mini";
8288
+ import { z as z29 } from "zod/mini";
8282
8289
  var maxSubagentSizeBytes = 1024 * 1024;
8283
8290
  var maxSubagentsCount = 1e3;
8284
8291
  async function listSubagents() {
@@ -8402,17 +8409,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
8402
8409
  }
8403
8410
  }
8404
8411
  var subagentToolSchemas = {
8405
- listSubagents: z27.object({}),
8406
- getSubagent: z27.object({
8407
- relativePathFromCwd: z27.string()
8412
+ listSubagents: z29.object({}),
8413
+ getSubagent: z29.object({
8414
+ relativePathFromCwd: z29.string()
8408
8415
  }),
8409
- putSubagent: z27.object({
8410
- relativePathFromCwd: z27.string(),
8416
+ putSubagent: z29.object({
8417
+ relativePathFromCwd: z29.string(),
8411
8418
  frontmatter: RulesyncSubagentFrontmatterSchema,
8412
- body: z27.string()
8419
+ body: z29.string()
8413
8420
  }),
8414
- deleteSubagent: z27.object({
8415
- relativePathFromCwd: z27.string()
8421
+ deleteSubagent: z29.object({
8422
+ relativePathFromCwd: z29.string()
8416
8423
  })
8417
8424
  };
8418
8425
  var subagentTools = {
@@ -8492,7 +8499,7 @@ async function mcpCommand({ version }) {
8492
8499
  }
8493
8500
 
8494
8501
  // src/cli/index.ts
8495
- var getVersion = () => "3.22.1";
8502
+ var getVersion = () => "3.23.2";
8496
8503
  var main = async () => {
8497
8504
  const program = new Command();
8498
8505
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "3.22.1",
3
+ "version": "3.23.2",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",