rulesync 3.23.0 → 3.23.3

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.
Files changed (3) hide show
  1. package/dist/index.cjs +138 -145
  2. package/dist/index.js +138 -145
  3. package/package.json +1 -2
package/dist/index.cjs CHANGED
@@ -581,7 +581,6 @@ var AiFile = class {
581
581
  relativeDirPath,
582
582
  relativeFilePath,
583
583
  fileContent,
584
- validate = true,
585
584
  global = false
586
585
  }) {
587
586
  this.baseDir = baseDir;
@@ -589,12 +588,6 @@ var AiFile = class {
589
588
  this.relativeFilePath = relativeFilePath;
590
589
  this.fileContent = fileContent;
591
590
  this.global = global;
592
- if (validate) {
593
- const result = this.validate();
594
- if (!result.success) {
595
- throw result.error;
596
- }
597
- }
598
591
  }
599
592
  static async fromFile(_params) {
600
593
  throw new Error("Please implement this method in the subclass.");
@@ -2711,7 +2704,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2711
2704
  };
2712
2705
 
2713
2706
  // src/features/mcp/mcp-processor.ts
2714
- var import_mini13 = require("zod/mini");
2707
+ var import_mini15 = require("zod/mini");
2715
2708
 
2716
2709
  // src/features/mcp/amazonqcli-mcp.ts
2717
2710
  var import_node_path28 = require("path");
@@ -2719,9 +2712,11 @@ var import_node_path28 = require("path");
2719
2712
  // src/features/mcp/rulesync-mcp.ts
2720
2713
  var import_node_path27 = require("path");
2721
2714
  var import_object = require("es-toolkit/object");
2715
+ var import_mini13 = require("zod/mini");
2716
+
2717
+ // src/types/mcp.ts
2722
2718
  var import_mini12 = require("zod/mini");
2723
- var McpTransportTypeSchema = import_mini12.z.enum(["stdio", "sse", "http"]);
2724
- var McpServerBaseSchema = import_mini12.z.object({
2719
+ var McpServerSchema = import_mini12.z.object({
2725
2720
  type: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
2726
2721
  command: import_mini12.z.optional(import_mini12.z.union([import_mini12.z.string(), import_mini12.z.array(import_mini12.z.string())])),
2727
2722
  args: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
@@ -2733,27 +2728,30 @@ var McpServerBaseSchema = import_mini12.z.object({
2733
2728
  timeout: import_mini12.z.optional(import_mini12.z.number()),
2734
2729
  trust: import_mini12.z.optional(import_mini12.z.boolean()),
2735
2730
  cwd: import_mini12.z.optional(import_mini12.z.string()),
2736
- transport: import_mini12.z.optional(McpTransportTypeSchema),
2731
+ transport: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
2737
2732
  alwaysAllow: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2738
2733
  tools: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2739
2734
  kiroAutoApprove: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2740
2735
  kiroAutoBlock: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2741
2736
  headers: import_mini12.z.optional(import_mini12.z.record(import_mini12.z.string(), import_mini12.z.string()))
2742
2737
  });
2743
- var RulesyncMcpServersSchema = import_mini12.z.union([
2744
- import_mini12.z.extend(McpServerBaseSchema, {
2745
- targets: import_mini12.z.optional(RulesyncTargetsSchema),
2746
- description: import_mini12.z.optional(import_mini12.z.string()),
2747
- exposed: import_mini12.z.optional(import_mini12.z.literal(false))
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))
2748
2746
  }),
2749
- import_mini12.z.extend(McpServerBaseSchema, {
2750
- targets: import_mini12.z.optional(RulesyncTargetsSchema),
2751
- description: import_mini12.z.undefined(),
2752
- exposed: import_mini12.z.literal(true)
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)
2753
2751
  })
2754
2752
  ]);
2755
- var RulesyncMcpConfigSchema = import_mini12.z.object({
2756
- mcpServers: import_mini12.z.record(import_mini12.z.string(), RulesyncMcpServersSchema)
2753
+ var RulesyncMcpConfigSchema = import_mini13.z.object({
2754
+ mcpServers: import_mini13.z.record(import_mini13.z.string(), RulesyncMcpServerSchema)
2757
2755
  });
2758
2756
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2759
2757
  json;
@@ -2782,6 +2780,10 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2782
2780
  };
2783
2781
  }
2784
2782
  validate() {
2783
+ const result = RulesyncMcpConfigSchema.safeParse(this.json);
2784
+ if (!result.success) {
2785
+ return { success: false, error: result.error };
2786
+ }
2785
2787
  return { success: true, error: null };
2786
2788
  }
2787
2789
  static async fromFile({
@@ -2831,46 +2833,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2831
2833
  modularMcp
2832
2834
  });
2833
2835
  }
2834
- getExposedServers() {
2835
- if (!this.json || typeof this.json !== "object") {
2836
- return {};
2837
- }
2838
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2839
- return {};
2840
- }
2836
+ getExposedMcpServers() {
2841
2837
  return Object.fromEntries(
2842
- Object.entries(this.json.mcpServers).filter(([, serverConfig]) => serverConfig.exposed === true).map(([serverName, serverConfig]) => [
2838
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
2843
2839
  serverName,
2844
- (0, import_object.omit)(serverConfig, ["description", "exposed"])
2840
+ (0, import_object.omit)(serverConfig, ["targets", "description", "exposed"])
2845
2841
  ])
2846
2842
  );
2847
2843
  }
2848
- getJson({ modularMcp = false } = {}) {
2849
- if (!this.json || typeof this.json !== "object") {
2850
- return this.json;
2851
- }
2852
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2853
- return this.json;
2854
- }
2855
- if (modularMcp) {
2856
- const mcpServersForModularMcp = Object.fromEntries(
2857
- Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !serverConfig.exposed).map(([serverName, serverConfig]) => [serverName, (0, import_object.omit)(serverConfig, ["exposed"])])
2858
- );
2859
- return {
2860
- ...this.json,
2861
- mcpServers: mcpServersForModularMcp
2862
- };
2863
- }
2864
- const mcpServersWithoutDescription = Object.fromEntries(
2865
- Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
2844
+ getModularizedMcpServers() {
2845
+ return Object.fromEntries(
2846
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
2866
2847
  serverName,
2867
- (0, import_object.omit)(serverConfig, ["description", "exposed"])
2848
+ // description is required for modular-mcp servers
2849
+ (0, import_object.omit)(serverConfig, ["targets", "exposed"])
2868
2850
  ])
2869
2851
  );
2870
- return {
2871
- ...this.json,
2872
- mcpServers: mcpServersWithoutDescription
2873
- };
2852
+ }
2853
+ getJson() {
2854
+ return this.json;
2874
2855
  }
2875
2856
  };
2876
2857
 
@@ -2974,6 +2955,14 @@ var import_node_path30 = require("path");
2974
2955
 
2975
2956
  // src/features/mcp/modular-mcp.ts
2976
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
+ });
2977
2966
  var ModularMcp = class _ModularMcp extends AiFile {
2978
2967
  json;
2979
2968
  constructor(params) {
@@ -3045,7 +3034,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
3045
3034
  global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
3046
3035
  );
3047
3036
  const modularMcpJson = {
3048
- mcpServers: rulesyncMcp.getJson({ modularMcp: true }).mcpServers
3037
+ mcpServers: rulesyncMcp.getModularizedMcpServers()
3049
3038
  };
3050
3039
  return new _ModularMcp({
3051
3040
  baseDir,
@@ -3056,6 +3045,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
3056
3045
  });
3057
3046
  }
3058
3047
  validate() {
3048
+ const result = ModularMcpConfigSchema.safeParse(this.json);
3049
+ if (!result.success) {
3050
+ return { success: false, error: result.error };
3051
+ }
3059
3052
  return { success: true, error: null };
3060
3053
  }
3061
3054
  };
@@ -3124,9 +3117,9 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3124
3117
  relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3125
3118
  }) : ModularMcp.getMcpServers({ baseDir, global: false }),
3126
3119
  // Merge exposed servers
3127
- ...rulesyncMcp.getExposedServers()
3120
+ ...rulesyncMcp.getExposedMcpServers()
3128
3121
  }
3129
- } : { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3122
+ } : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
3130
3123
  return new _ClaudecodeMcp({
3131
3124
  baseDir,
3132
3125
  relativeDirPath: paths.relativeDirPath,
@@ -3262,7 +3255,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3262
3255
  smolToml.stringify({})
3263
3256
  );
3264
3257
  const configToml = smolToml.parse(configTomlFileContent);
3265
- const mcpServers = rulesyncMcp.getJson({ modularMcp: false }).mcpServers;
3258
+ const mcpServers = rulesyncMcp.getJson().mcpServers;
3266
3259
  const filteredMcpServers = this.removeEmptyEntries(mcpServers);
3267
3260
  configToml["mcp_servers"] = filteredMcpServers;
3268
3261
  return new _CodexcliMcp({
@@ -3394,7 +3387,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3394
3387
  rulesyncMcp,
3395
3388
  validate = true
3396
3389
  }) {
3397
- const json = rulesyncMcp.getJson({ modularMcp: false });
3390
+ const json = rulesyncMcp.getJson();
3398
3391
  const cursorConfig = {
3399
3392
  mcpServers: json.mcpServers || {}
3400
3393
  };
@@ -3476,7 +3469,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3476
3469
  JSON.stringify({ mcpServers: {} }, null, 2)
3477
3470
  );
3478
3471
  const json = JSON.parse(fileContent);
3479
- const newJson = { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3472
+ const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
3480
3473
  return new _GeminiCliMcp({
3481
3474
  baseDir,
3482
3475
  relativeDirPath: paths.relativeDirPath,
@@ -3563,7 +3556,7 @@ var mcpProcessorToolTargets = [
3563
3556
  "geminicli",
3564
3557
  "roo"
3565
3558
  ];
3566
- var McpProcessorToolTargetSchema = import_mini13.z.enum(
3559
+ var McpProcessorToolTargetSchema = import_mini15.z.enum(
3567
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
3568
3561
  mcpProcessorToolTargets.concat("codexcli")
3569
3562
  );
@@ -3802,14 +3795,14 @@ var McpProcessor = class extends FeatureProcessor {
3802
3795
  // src/features/rules/rules-processor.ts
3803
3796
  var import_node_path66 = require("path");
3804
3797
  var import_fast_xml_parser = require("fast-xml-parser");
3805
- var import_mini22 = require("zod/mini");
3798
+ var import_mini24 = require("zod/mini");
3806
3799
 
3807
3800
  // src/features/subagents/agentsmd-subagent.ts
3808
3801
  var import_node_path38 = require("path");
3809
3802
 
3810
3803
  // src/features/subagents/simulated-subagent.ts
3811
3804
  var import_node_path37 = require("path");
3812
- var import_mini14 = require("zod/mini");
3805
+ var import_mini16 = require("zod/mini");
3813
3806
 
3814
3807
  // src/features/subagents/tool-subagent.ts
3815
3808
  var ToolSubagent = class extends ToolFile {
@@ -3844,9 +3837,9 @@ var ToolSubagent = class extends ToolFile {
3844
3837
  };
3845
3838
 
3846
3839
  // src/features/subagents/simulated-subagent.ts
3847
- var SimulatedSubagentFrontmatterSchema = import_mini14.z.object({
3848
- name: import_mini14.z.string(),
3849
- description: import_mini14.z.string()
3840
+ var SimulatedSubagentFrontmatterSchema = import_mini16.z.object({
3841
+ name: import_mini16.z.string(),
3842
+ description: import_mini16.z.string()
3850
3843
  });
3851
3844
  var SimulatedSubagent = class extends ToolSubagent {
3852
3845
  frontmatter;
@@ -4080,22 +4073,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4080
4073
 
4081
4074
  // src/features/subagents/subagents-processor.ts
4082
4075
  var import_node_path46 = require("path");
4083
- var import_mini17 = require("zod/mini");
4076
+ var import_mini19 = require("zod/mini");
4084
4077
 
4085
4078
  // src/features/subagents/claudecode-subagent.ts
4086
4079
  var import_node_path45 = require("path");
4087
- var import_mini16 = require("zod/mini");
4080
+ var import_mini18 = require("zod/mini");
4088
4081
 
4089
4082
  // src/features/subagents/rulesync-subagent.ts
4090
4083
  var import_node_path44 = require("path");
4091
- var import_mini15 = require("zod/mini");
4092
- var RulesyncSubagentModelSchema = import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]);
4093
- 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({
4094
4087
  targets: RulesyncTargetsSchema,
4095
- name: import_mini15.z.string(),
4096
- description: import_mini15.z.string(),
4097
- claudecode: import_mini15.z.optional(
4098
- 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({
4099
4092
  model: RulesyncSubagentModelSchema
4100
4093
  })
4101
4094
  )
@@ -4169,10 +4162,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4169
4162
  };
4170
4163
 
4171
4164
  // src/features/subagents/claudecode-subagent.ts
4172
- var ClaudecodeSubagentFrontmatterSchema = import_mini16.z.object({
4173
- name: import_mini16.z.string(),
4174
- description: import_mini16.z.string(),
4175
- 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"]))
4176
4169
  });
4177
4170
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4178
4171
  frontmatter;
@@ -4316,7 +4309,7 @@ var subagentsProcessorToolTargetsSimulated = [
4316
4309
  "roo"
4317
4310
  ];
4318
4311
  var subagentsProcessorToolTargetsGlobal = ["claudecode"];
4319
- var SubagentsProcessorToolTargetSchema = import_mini17.z.enum(subagentsProcessorToolTargets);
4312
+ var SubagentsProcessorToolTargetSchema = import_mini19.z.enum(subagentsProcessorToolTargets);
4320
4313
  var SubagentsProcessor = class extends FeatureProcessor {
4321
4314
  toolTarget;
4322
4315
  global;
@@ -4601,23 +4594,23 @@ var import_node_path48 = require("path");
4601
4594
 
4602
4595
  // src/features/rules/rulesync-rule.ts
4603
4596
  var import_node_path47 = require("path");
4604
- var import_mini18 = require("zod/mini");
4605
- var RulesyncRuleFrontmatterSchema = import_mini18.z.object({
4606
- root: import_mini18.z.optional(import_mini18.z.optional(import_mini18.z.boolean())),
4607
- targets: import_mini18.z.optional(RulesyncTargetsSchema),
4608
- description: import_mini18.z.optional(import_mini18.z.string()),
4609
- globs: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
4610
- agentsmd: import_mini18.z.optional(
4611
- 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({
4612
4605
  // @example "path/to/subproject"
4613
- subprojectPath: import_mini18.z.optional(import_mini18.z.string())
4606
+ subprojectPath: import_mini20.z.optional(import_mini20.z.string())
4614
4607
  })
4615
4608
  ),
4616
- cursor: import_mini18.z.optional(
4617
- import_mini18.z.object({
4618
- alwaysApply: import_mini18.z.optional(import_mini18.z.boolean()),
4619
- description: import_mini18.z.optional(import_mini18.z.string()),
4620
- 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()))
4621
4614
  })
4622
4615
  )
4623
4616
  });
@@ -5209,9 +5202,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5209
5202
 
5210
5203
  // src/features/rules/cline-rule.ts
5211
5204
  var import_node_path54 = require("path");
5212
- var import_mini19 = require("zod/mini");
5213
- var ClineRuleFrontmatterSchema = import_mini19.z.object({
5214
- 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()
5215
5208
  });
5216
5209
  var ClineRule = class _ClineRule extends ToolRule {
5217
5210
  static getSettablePaths() {
@@ -5358,10 +5351,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5358
5351
 
5359
5352
  // src/features/rules/copilot-rule.ts
5360
5353
  var import_node_path56 = require("path");
5361
- var import_mini20 = require("zod/mini");
5362
- var CopilotRuleFrontmatterSchema = import_mini20.z.object({
5363
- description: import_mini20.z.optional(import_mini20.z.string()),
5364
- 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())
5365
5358
  });
5366
5359
  var CopilotRule = class _CopilotRule extends ToolRule {
5367
5360
  frontmatter;
@@ -5528,11 +5521,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5528
5521
 
5529
5522
  // src/features/rules/cursor-rule.ts
5530
5523
  var import_node_path57 = require("path");
5531
- var import_mini21 = require("zod/mini");
5532
- var CursorRuleFrontmatterSchema = import_mini21.z.object({
5533
- description: import_mini21.z.optional(import_mini21.z.string()),
5534
- globs: import_mini21.z.optional(import_mini21.z.string()),
5535
- 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())
5536
5529
  });
5537
5530
  var CursorRule = class _CursorRule extends ToolRule {
5538
5531
  frontmatter;
@@ -6248,7 +6241,7 @@ var rulesProcessorToolTargets = [
6248
6241
  "warp",
6249
6242
  "windsurf"
6250
6243
  ];
6251
- var RulesProcessorToolTargetSchema = import_mini22.z.enum(rulesProcessorToolTargets);
6244
+ var RulesProcessorToolTargetSchema = import_mini24.z.enum(rulesProcessorToolTargets);
6252
6245
  var rulesProcessorToolTargetsGlobal = [
6253
6246
  "claudecode",
6254
6247
  "codexcli",
@@ -7744,7 +7737,7 @@ var import_fastmcp = require("fastmcp");
7744
7737
 
7745
7738
  // src/mcp/commands.ts
7746
7739
  var import_node_path69 = require("path");
7747
- var import_mini23 = require("zod/mini");
7740
+ var import_mini25 = require("zod/mini");
7748
7741
  var maxCommandSizeBytes = 1024 * 1024;
7749
7742
  var maxCommandsCount = 1e3;
7750
7743
  async function listCommands() {
@@ -7863,17 +7856,17 @@ async function deleteCommand({ relativePathFromCwd }) {
7863
7856
  }
7864
7857
  }
7865
7858
  var commandToolSchemas = {
7866
- listCommands: import_mini23.z.object({}),
7867
- getCommand: import_mini23.z.object({
7868
- relativePathFromCwd: import_mini23.z.string()
7859
+ listCommands: import_mini25.z.object({}),
7860
+ getCommand: import_mini25.z.object({
7861
+ relativePathFromCwd: import_mini25.z.string()
7869
7862
  }),
7870
- putCommand: import_mini23.z.object({
7871
- relativePathFromCwd: import_mini23.z.string(),
7863
+ putCommand: import_mini25.z.object({
7864
+ relativePathFromCwd: import_mini25.z.string(),
7872
7865
  frontmatter: RulesyncCommandFrontmatterSchema,
7873
- body: import_mini23.z.string()
7866
+ body: import_mini25.z.string()
7874
7867
  }),
7875
- deleteCommand: import_mini23.z.object({
7876
- relativePathFromCwd: import_mini23.z.string()
7868
+ deleteCommand: import_mini25.z.object({
7869
+ relativePathFromCwd: import_mini25.z.string()
7877
7870
  })
7878
7871
  };
7879
7872
  var commandTools = {
@@ -7922,7 +7915,7 @@ var commandTools = {
7922
7915
 
7923
7916
  // src/mcp/ignore.ts
7924
7917
  var import_node_path70 = require("path");
7925
- var import_mini24 = require("zod/mini");
7918
+ var import_mini26 = require("zod/mini");
7926
7919
  var maxIgnoreFileSizeBytes = 100 * 1024;
7927
7920
  async function getIgnoreFile() {
7928
7921
  const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
@@ -7973,11 +7966,11 @@ async function deleteIgnoreFile() {
7973
7966
  }
7974
7967
  }
7975
7968
  var ignoreToolSchemas = {
7976
- getIgnoreFile: import_mini24.z.object({}),
7977
- putIgnoreFile: import_mini24.z.object({
7978
- content: import_mini24.z.string()
7969
+ getIgnoreFile: import_mini26.z.object({}),
7970
+ putIgnoreFile: import_mini26.z.object({
7971
+ content: import_mini26.z.string()
7979
7972
  }),
7980
- deleteIgnoreFile: import_mini24.z.object({})
7973
+ deleteIgnoreFile: import_mini26.z.object({})
7981
7974
  };
7982
7975
  var ignoreTools = {
7983
7976
  getIgnoreFile: {
@@ -8011,7 +8004,7 @@ var ignoreTools = {
8011
8004
 
8012
8005
  // src/mcp/mcp.ts
8013
8006
  var import_node_path71 = require("path");
8014
- var import_mini25 = require("zod/mini");
8007
+ var import_mini27 = require("zod/mini");
8015
8008
  var maxMcpSizeBytes = 1024 * 1024;
8016
8009
  async function getMcpFile() {
8017
8010
  try {
@@ -8099,11 +8092,11 @@ async function deleteMcpFile() {
8099
8092
  }
8100
8093
  }
8101
8094
  var mcpToolSchemas = {
8102
- getMcpFile: import_mini25.z.object({}),
8103
- putMcpFile: import_mini25.z.object({
8104
- content: import_mini25.z.string()
8095
+ getMcpFile: import_mini27.z.object({}),
8096
+ putMcpFile: import_mini27.z.object({
8097
+ content: import_mini27.z.string()
8105
8098
  }),
8106
- deleteMcpFile: import_mini25.z.object({})
8099
+ deleteMcpFile: import_mini27.z.object({})
8107
8100
  };
8108
8101
  var mcpTools = {
8109
8102
  getMcpFile: {
@@ -8137,7 +8130,7 @@ var mcpTools = {
8137
8130
 
8138
8131
  // src/mcp/rules.ts
8139
8132
  var import_node_path72 = require("path");
8140
- var import_mini26 = require("zod/mini");
8133
+ var import_mini28 = require("zod/mini");
8141
8134
  var maxRuleSizeBytes = 1024 * 1024;
8142
8135
  var maxRulesCount = 1e3;
8143
8136
  async function listRules() {
@@ -8256,17 +8249,17 @@ async function deleteRule({ relativePathFromCwd }) {
8256
8249
  }
8257
8250
  }
8258
8251
  var ruleToolSchemas = {
8259
- listRules: import_mini26.z.object({}),
8260
- getRule: import_mini26.z.object({
8261
- relativePathFromCwd: import_mini26.z.string()
8252
+ listRules: import_mini28.z.object({}),
8253
+ getRule: import_mini28.z.object({
8254
+ relativePathFromCwd: import_mini28.z.string()
8262
8255
  }),
8263
- putRule: import_mini26.z.object({
8264
- relativePathFromCwd: import_mini26.z.string(),
8256
+ putRule: import_mini28.z.object({
8257
+ relativePathFromCwd: import_mini28.z.string(),
8265
8258
  frontmatter: RulesyncRuleFrontmatterSchema,
8266
- body: import_mini26.z.string()
8259
+ body: import_mini28.z.string()
8267
8260
  }),
8268
- deleteRule: import_mini26.z.object({
8269
- relativePathFromCwd: import_mini26.z.string()
8261
+ deleteRule: import_mini28.z.object({
8262
+ relativePathFromCwd: import_mini28.z.string()
8270
8263
  })
8271
8264
  };
8272
8265
  var ruleTools = {
@@ -8315,7 +8308,7 @@ var ruleTools = {
8315
8308
 
8316
8309
  // src/mcp/subagents.ts
8317
8310
  var import_node_path73 = require("path");
8318
- var import_mini27 = require("zod/mini");
8311
+ var import_mini29 = require("zod/mini");
8319
8312
  var maxSubagentSizeBytes = 1024 * 1024;
8320
8313
  var maxSubagentsCount = 1e3;
8321
8314
  async function listSubagents() {
@@ -8439,17 +8432,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
8439
8432
  }
8440
8433
  }
8441
8434
  var subagentToolSchemas = {
8442
- listSubagents: import_mini27.z.object({}),
8443
- getSubagent: import_mini27.z.object({
8444
- relativePathFromCwd: import_mini27.z.string()
8435
+ listSubagents: import_mini29.z.object({}),
8436
+ getSubagent: import_mini29.z.object({
8437
+ relativePathFromCwd: import_mini29.z.string()
8445
8438
  }),
8446
- putSubagent: import_mini27.z.object({
8447
- relativePathFromCwd: import_mini27.z.string(),
8439
+ putSubagent: import_mini29.z.object({
8440
+ relativePathFromCwd: import_mini29.z.string(),
8448
8441
  frontmatter: RulesyncSubagentFrontmatterSchema,
8449
- body: import_mini27.z.string()
8442
+ body: import_mini29.z.string()
8450
8443
  }),
8451
- deleteSubagent: import_mini27.z.object({
8452
- relativePathFromCwd: import_mini27.z.string()
8444
+ deleteSubagent: import_mini29.z.object({
8445
+ relativePathFromCwd: import_mini29.z.string()
8453
8446
  })
8454
8447
  };
8455
8448
  var subagentTools = {
@@ -8529,7 +8522,7 @@ async function mcpCommand({ version }) {
8529
8522
  }
8530
8523
 
8531
8524
  // src/cli/index.ts
8532
- var getVersion = () => "3.23.0";
8525
+ var getVersion = () => "3.23.3";
8533
8526
  var main = async () => {
8534
8527
  const program = new import_commander.Command();
8535
8528
  const version = getVersion();
package/dist/index.js CHANGED
@@ -558,7 +558,6 @@ var AiFile = class {
558
558
  relativeDirPath,
559
559
  relativeFilePath,
560
560
  fileContent,
561
- validate = true,
562
561
  global = false
563
562
  }) {
564
563
  this.baseDir = baseDir;
@@ -566,12 +565,6 @@ var AiFile = class {
566
565
  this.relativeFilePath = relativeFilePath;
567
566
  this.fileContent = fileContent;
568
567
  this.global = global;
569
- if (validate) {
570
- const result = this.validate();
571
- if (!result.success) {
572
- throw result.error;
573
- }
574
- }
575
568
  }
576
569
  static async fromFile(_params) {
577
570
  throw new Error("Please implement this method in the subclass.");
@@ -2688,7 +2681,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2688
2681
  };
2689
2682
 
2690
2683
  // src/features/mcp/mcp-processor.ts
2691
- import { z as z13 } from "zod/mini";
2684
+ import { z as z15 } from "zod/mini";
2692
2685
 
2693
2686
  // src/features/mcp/amazonqcli-mcp.ts
2694
2687
  import { join as join26 } from "path";
@@ -2696,9 +2689,11 @@ import { join as join26 } from "path";
2696
2689
  // src/features/mcp/rulesync-mcp.ts
2697
2690
  import { join as join25 } from "path";
2698
2691
  import { omit } from "es-toolkit/object";
2692
+ import { z as z13 } from "zod/mini";
2693
+
2694
+ // src/types/mcp.ts
2699
2695
  import { z as z12 } from "zod/mini";
2700
- var McpTransportTypeSchema = z12.enum(["stdio", "sse", "http"]);
2701
- var McpServerBaseSchema = z12.object({
2696
+ var McpServerSchema = z12.object({
2702
2697
  type: z12.optional(z12.enum(["stdio", "sse", "http"])),
2703
2698
  command: z12.optional(z12.union([z12.string(), z12.array(z12.string())])),
2704
2699
  args: z12.optional(z12.array(z12.string())),
@@ -2710,27 +2705,30 @@ var McpServerBaseSchema = z12.object({
2710
2705
  timeout: z12.optional(z12.number()),
2711
2706
  trust: z12.optional(z12.boolean()),
2712
2707
  cwd: z12.optional(z12.string()),
2713
- transport: z12.optional(McpTransportTypeSchema),
2708
+ transport: z12.optional(z12.enum(["stdio", "sse", "http"])),
2714
2709
  alwaysAllow: z12.optional(z12.array(z12.string())),
2715
2710
  tools: z12.optional(z12.array(z12.string())),
2716
2711
  kiroAutoApprove: z12.optional(z12.array(z12.string())),
2717
2712
  kiroAutoBlock: z12.optional(z12.array(z12.string())),
2718
2713
  headers: z12.optional(z12.record(z12.string(), z12.string()))
2719
2714
  });
2720
- var RulesyncMcpServersSchema = z12.union([
2721
- z12.extend(McpServerBaseSchema, {
2722
- targets: z12.optional(RulesyncTargetsSchema),
2723
- description: z12.optional(z12.string()),
2724
- exposed: z12.optional(z12.literal(false))
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))
2725
2723
  }),
2726
- z12.extend(McpServerBaseSchema, {
2727
- targets: z12.optional(RulesyncTargetsSchema),
2728
- description: z12.undefined(),
2729
- exposed: z12.literal(true)
2724
+ z13.extend(McpServerSchema, {
2725
+ targets: z13.optional(RulesyncTargetsSchema),
2726
+ description: z13.undefined(),
2727
+ exposed: z13.literal(true)
2730
2728
  })
2731
2729
  ]);
2732
- var RulesyncMcpConfigSchema = z12.object({
2733
- mcpServers: z12.record(z12.string(), RulesyncMcpServersSchema)
2730
+ var RulesyncMcpConfigSchema = z13.object({
2731
+ mcpServers: z13.record(z13.string(), RulesyncMcpServerSchema)
2734
2732
  });
2735
2733
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2736
2734
  json;
@@ -2759,6 +2757,10 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2759
2757
  };
2760
2758
  }
2761
2759
  validate() {
2760
+ const result = RulesyncMcpConfigSchema.safeParse(this.json);
2761
+ if (!result.success) {
2762
+ return { success: false, error: result.error };
2763
+ }
2762
2764
  return { success: true, error: null };
2763
2765
  }
2764
2766
  static async fromFile({
@@ -2808,46 +2810,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2808
2810
  modularMcp
2809
2811
  });
2810
2812
  }
2811
- getExposedServers() {
2812
- if (!this.json || typeof this.json !== "object") {
2813
- return {};
2814
- }
2815
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2816
- return {};
2817
- }
2813
+ getExposedMcpServers() {
2818
2814
  return Object.fromEntries(
2819
- Object.entries(this.json.mcpServers).filter(([, serverConfig]) => serverConfig.exposed === true).map(([serverName, serverConfig]) => [
2815
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
2820
2816
  serverName,
2821
- omit(serverConfig, ["description", "exposed"])
2817
+ omit(serverConfig, ["targets", "description", "exposed"])
2822
2818
  ])
2823
2819
  );
2824
2820
  }
2825
- getJson({ modularMcp = false } = {}) {
2826
- if (!this.json || typeof this.json !== "object") {
2827
- return this.json;
2828
- }
2829
- if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
2830
- return this.json;
2831
- }
2832
- if (modularMcp) {
2833
- const mcpServersForModularMcp = Object.fromEntries(
2834
- Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !serverConfig.exposed).map(([serverName, serverConfig]) => [serverName, omit(serverConfig, ["exposed"])])
2835
- );
2836
- return {
2837
- ...this.json,
2838
- mcpServers: mcpServersForModularMcp
2839
- };
2840
- }
2841
- const mcpServersWithoutDescription = Object.fromEntries(
2842
- Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
2821
+ getModularizedMcpServers() {
2822
+ return Object.fromEntries(
2823
+ Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
2843
2824
  serverName,
2844
- omit(serverConfig, ["description", "exposed"])
2825
+ // description is required for modular-mcp servers
2826
+ omit(serverConfig, ["targets", "exposed"])
2845
2827
  ])
2846
2828
  );
2847
- return {
2848
- ...this.json,
2849
- mcpServers: mcpServersWithoutDescription
2850
- };
2829
+ }
2830
+ getJson() {
2831
+ return this.json;
2851
2832
  }
2852
2833
  };
2853
2834
 
@@ -2951,6 +2932,14 @@ import { join as join28 } from "path";
2951
2932
 
2952
2933
  // src/features/mcp/modular-mcp.ts
2953
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
+ });
2954
2943
  var ModularMcp = class _ModularMcp extends AiFile {
2955
2944
  json;
2956
2945
  constructor(params) {
@@ -3022,7 +3011,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
3022
3011
  global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
3023
3012
  );
3024
3013
  const modularMcpJson = {
3025
- mcpServers: rulesyncMcp.getJson({ modularMcp: true }).mcpServers
3014
+ mcpServers: rulesyncMcp.getModularizedMcpServers()
3026
3015
  };
3027
3016
  return new _ModularMcp({
3028
3017
  baseDir,
@@ -3033,6 +3022,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
3033
3022
  });
3034
3023
  }
3035
3024
  validate() {
3025
+ const result = ModularMcpConfigSchema.safeParse(this.json);
3026
+ if (!result.success) {
3027
+ return { success: false, error: result.error };
3028
+ }
3036
3029
  return { success: true, error: null };
3037
3030
  }
3038
3031
  };
@@ -3101,9 +3094,9 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3101
3094
  relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
3102
3095
  }) : ModularMcp.getMcpServers({ baseDir, global: false }),
3103
3096
  // Merge exposed servers
3104
- ...rulesyncMcp.getExposedServers()
3097
+ ...rulesyncMcp.getExposedMcpServers()
3105
3098
  }
3106
- } : { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3099
+ } : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
3107
3100
  return new _ClaudecodeMcp({
3108
3101
  baseDir,
3109
3102
  relativeDirPath: paths.relativeDirPath,
@@ -3239,7 +3232,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3239
3232
  smolToml.stringify({})
3240
3233
  );
3241
3234
  const configToml = smolToml.parse(configTomlFileContent);
3242
- const mcpServers = rulesyncMcp.getJson({ modularMcp: false }).mcpServers;
3235
+ const mcpServers = rulesyncMcp.getJson().mcpServers;
3243
3236
  const filteredMcpServers = this.removeEmptyEntries(mcpServers);
3244
3237
  configToml["mcp_servers"] = filteredMcpServers;
3245
3238
  return new _CodexcliMcp({
@@ -3371,7 +3364,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3371
3364
  rulesyncMcp,
3372
3365
  validate = true
3373
3366
  }) {
3374
- const json = rulesyncMcp.getJson({ modularMcp: false });
3367
+ const json = rulesyncMcp.getJson();
3375
3368
  const cursorConfig = {
3376
3369
  mcpServers: json.mcpServers || {}
3377
3370
  };
@@ -3453,7 +3446,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3453
3446
  JSON.stringify({ mcpServers: {} }, null, 2)
3454
3447
  );
3455
3448
  const json = JSON.parse(fileContent);
3456
- const newJson = { ...json, mcpServers: rulesyncMcp.getJson({ modularMcp: false }).mcpServers };
3449
+ const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
3457
3450
  return new _GeminiCliMcp({
3458
3451
  baseDir,
3459
3452
  relativeDirPath: paths.relativeDirPath,
@@ -3540,7 +3533,7 @@ var mcpProcessorToolTargets = [
3540
3533
  "geminicli",
3541
3534
  "roo"
3542
3535
  ];
3543
- var McpProcessorToolTargetSchema = z13.enum(
3536
+ var McpProcessorToolTargetSchema = z15.enum(
3544
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
3545
3538
  mcpProcessorToolTargets.concat("codexcli")
3546
3539
  );
@@ -3779,14 +3772,14 @@ var McpProcessor = class extends FeatureProcessor {
3779
3772
  // src/features/rules/rules-processor.ts
3780
3773
  import { basename as basename17, join as join64 } from "path";
3781
3774
  import { XMLBuilder } from "fast-xml-parser";
3782
- import { z as z22 } from "zod/mini";
3775
+ import { z as z24 } from "zod/mini";
3783
3776
 
3784
3777
  // src/features/subagents/agentsmd-subagent.ts
3785
3778
  import { join as join36 } from "path";
3786
3779
 
3787
3780
  // src/features/subagents/simulated-subagent.ts
3788
3781
  import { basename as basename12, join as join35 } from "path";
3789
- import { z as z14 } from "zod/mini";
3782
+ import { z as z16 } from "zod/mini";
3790
3783
 
3791
3784
  // src/features/subagents/tool-subagent.ts
3792
3785
  var ToolSubagent = class extends ToolFile {
@@ -3821,9 +3814,9 @@ var ToolSubagent = class extends ToolFile {
3821
3814
  };
3822
3815
 
3823
3816
  // src/features/subagents/simulated-subagent.ts
3824
- var SimulatedSubagentFrontmatterSchema = z14.object({
3825
- name: z14.string(),
3826
- description: z14.string()
3817
+ var SimulatedSubagentFrontmatterSchema = z16.object({
3818
+ name: z16.string(),
3819
+ description: z16.string()
3827
3820
  });
3828
3821
  var SimulatedSubagent = class extends ToolSubagent {
3829
3822
  frontmatter;
@@ -4057,22 +4050,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4057
4050
 
4058
4051
  // src/features/subagents/subagents-processor.ts
4059
4052
  import { basename as basename14, join as join44 } from "path";
4060
- import { z as z17 } from "zod/mini";
4053
+ import { z as z19 } from "zod/mini";
4061
4054
 
4062
4055
  // src/features/subagents/claudecode-subagent.ts
4063
4056
  import { join as join43 } from "path";
4064
- import { z as z16 } from "zod/mini";
4057
+ import { z as z18 } from "zod/mini";
4065
4058
 
4066
4059
  // src/features/subagents/rulesync-subagent.ts
4067
4060
  import { basename as basename13, join as join42 } from "path";
4068
- import { z as z15 } from "zod/mini";
4069
- var RulesyncSubagentModelSchema = z15.enum(["opus", "sonnet", "haiku", "inherit"]);
4070
- 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({
4071
4064
  targets: RulesyncTargetsSchema,
4072
- name: z15.string(),
4073
- description: z15.string(),
4074
- claudecode: z15.optional(
4075
- z15.object({
4065
+ name: z17.string(),
4066
+ description: z17.string(),
4067
+ claudecode: z17.optional(
4068
+ z17.object({
4076
4069
  model: RulesyncSubagentModelSchema
4077
4070
  })
4078
4071
  )
@@ -4146,10 +4139,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4146
4139
  };
4147
4140
 
4148
4141
  // src/features/subagents/claudecode-subagent.ts
4149
- var ClaudecodeSubagentFrontmatterSchema = z16.object({
4150
- name: z16.string(),
4151
- description: z16.string(),
4152
- 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"]))
4153
4146
  });
4154
4147
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4155
4148
  frontmatter;
@@ -4293,7 +4286,7 @@ var subagentsProcessorToolTargetsSimulated = [
4293
4286
  "roo"
4294
4287
  ];
4295
4288
  var subagentsProcessorToolTargetsGlobal = ["claudecode"];
4296
- var SubagentsProcessorToolTargetSchema = z17.enum(subagentsProcessorToolTargets);
4289
+ var SubagentsProcessorToolTargetSchema = z19.enum(subagentsProcessorToolTargets);
4297
4290
  var SubagentsProcessor = class extends FeatureProcessor {
4298
4291
  toolTarget;
4299
4292
  global;
@@ -4578,23 +4571,23 @@ import { join as join46 } from "path";
4578
4571
 
4579
4572
  // src/features/rules/rulesync-rule.ts
4580
4573
  import { basename as basename15, join as join45 } from "path";
4581
- import { z as z18 } from "zod/mini";
4582
- var RulesyncRuleFrontmatterSchema = z18.object({
4583
- root: z18.optional(z18.optional(z18.boolean())),
4584
- targets: z18.optional(RulesyncTargetsSchema),
4585
- description: z18.optional(z18.string()),
4586
- globs: z18.optional(z18.array(z18.string())),
4587
- agentsmd: z18.optional(
4588
- 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({
4589
4582
  // @example "path/to/subproject"
4590
- subprojectPath: z18.optional(z18.string())
4583
+ subprojectPath: z20.optional(z20.string())
4591
4584
  })
4592
4585
  ),
4593
- cursor: z18.optional(
4594
- z18.object({
4595
- alwaysApply: z18.optional(z18.boolean()),
4596
- description: z18.optional(z18.string()),
4597
- 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()))
4598
4591
  })
4599
4592
  )
4600
4593
  });
@@ -5186,9 +5179,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5186
5179
 
5187
5180
  // src/features/rules/cline-rule.ts
5188
5181
  import { join as join52 } from "path";
5189
- import { z as z19 } from "zod/mini";
5190
- var ClineRuleFrontmatterSchema = z19.object({
5191
- description: z19.string()
5182
+ import { z as z21 } from "zod/mini";
5183
+ var ClineRuleFrontmatterSchema = z21.object({
5184
+ description: z21.string()
5192
5185
  });
5193
5186
  var ClineRule = class _ClineRule extends ToolRule {
5194
5187
  static getSettablePaths() {
@@ -5335,10 +5328,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5335
5328
 
5336
5329
  // src/features/rules/copilot-rule.ts
5337
5330
  import { join as join54 } from "path";
5338
- import { z as z20 } from "zod/mini";
5339
- var CopilotRuleFrontmatterSchema = z20.object({
5340
- description: z20.optional(z20.string()),
5341
- 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())
5342
5335
  });
5343
5336
  var CopilotRule = class _CopilotRule extends ToolRule {
5344
5337
  frontmatter;
@@ -5505,11 +5498,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5505
5498
 
5506
5499
  // src/features/rules/cursor-rule.ts
5507
5500
  import { basename as basename16, join as join55 } from "path";
5508
- import { z as z21 } from "zod/mini";
5509
- var CursorRuleFrontmatterSchema = z21.object({
5510
- description: z21.optional(z21.string()),
5511
- globs: z21.optional(z21.string()),
5512
- 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())
5513
5506
  });
5514
5507
  var CursorRule = class _CursorRule extends ToolRule {
5515
5508
  frontmatter;
@@ -6225,7 +6218,7 @@ var rulesProcessorToolTargets = [
6225
6218
  "warp",
6226
6219
  "windsurf"
6227
6220
  ];
6228
- var RulesProcessorToolTargetSchema = z22.enum(rulesProcessorToolTargets);
6221
+ var RulesProcessorToolTargetSchema = z24.enum(rulesProcessorToolTargets);
6229
6222
  var rulesProcessorToolTargetsGlobal = [
6230
6223
  "claudecode",
6231
6224
  "codexcli",
@@ -7721,7 +7714,7 @@ import { FastMCP } from "fastmcp";
7721
7714
 
7722
7715
  // src/mcp/commands.ts
7723
7716
  import { basename as basename18, join as join67 } from "path";
7724
- import { z as z23 } from "zod/mini";
7717
+ import { z as z25 } from "zod/mini";
7725
7718
  var maxCommandSizeBytes = 1024 * 1024;
7726
7719
  var maxCommandsCount = 1e3;
7727
7720
  async function listCommands() {
@@ -7840,17 +7833,17 @@ async function deleteCommand({ relativePathFromCwd }) {
7840
7833
  }
7841
7834
  }
7842
7835
  var commandToolSchemas = {
7843
- listCommands: z23.object({}),
7844
- getCommand: z23.object({
7845
- relativePathFromCwd: z23.string()
7836
+ listCommands: z25.object({}),
7837
+ getCommand: z25.object({
7838
+ relativePathFromCwd: z25.string()
7846
7839
  }),
7847
- putCommand: z23.object({
7848
- relativePathFromCwd: z23.string(),
7840
+ putCommand: z25.object({
7841
+ relativePathFromCwd: z25.string(),
7849
7842
  frontmatter: RulesyncCommandFrontmatterSchema,
7850
- body: z23.string()
7843
+ body: z25.string()
7851
7844
  }),
7852
- deleteCommand: z23.object({
7853
- relativePathFromCwd: z23.string()
7845
+ deleteCommand: z25.object({
7846
+ relativePathFromCwd: z25.string()
7854
7847
  })
7855
7848
  };
7856
7849
  var commandTools = {
@@ -7899,7 +7892,7 @@ var commandTools = {
7899
7892
 
7900
7893
  // src/mcp/ignore.ts
7901
7894
  import { join as join68 } from "path";
7902
- import { z as z24 } from "zod/mini";
7895
+ import { z as z26 } from "zod/mini";
7903
7896
  var maxIgnoreFileSizeBytes = 100 * 1024;
7904
7897
  async function getIgnoreFile() {
7905
7898
  const ignoreFilePath = join68(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
@@ -7950,11 +7943,11 @@ async function deleteIgnoreFile() {
7950
7943
  }
7951
7944
  }
7952
7945
  var ignoreToolSchemas = {
7953
- getIgnoreFile: z24.object({}),
7954
- putIgnoreFile: z24.object({
7955
- content: z24.string()
7946
+ getIgnoreFile: z26.object({}),
7947
+ putIgnoreFile: z26.object({
7948
+ content: z26.string()
7956
7949
  }),
7957
- deleteIgnoreFile: z24.object({})
7950
+ deleteIgnoreFile: z26.object({})
7958
7951
  };
7959
7952
  var ignoreTools = {
7960
7953
  getIgnoreFile: {
@@ -7988,7 +7981,7 @@ var ignoreTools = {
7988
7981
 
7989
7982
  // src/mcp/mcp.ts
7990
7983
  import { join as join69 } from "path";
7991
- import { z as z25 } from "zod/mini";
7984
+ import { z as z27 } from "zod/mini";
7992
7985
  var maxMcpSizeBytes = 1024 * 1024;
7993
7986
  async function getMcpFile() {
7994
7987
  try {
@@ -8076,11 +8069,11 @@ async function deleteMcpFile() {
8076
8069
  }
8077
8070
  }
8078
8071
  var mcpToolSchemas = {
8079
- getMcpFile: z25.object({}),
8080
- putMcpFile: z25.object({
8081
- content: z25.string()
8072
+ getMcpFile: z27.object({}),
8073
+ putMcpFile: z27.object({
8074
+ content: z27.string()
8082
8075
  }),
8083
- deleteMcpFile: z25.object({})
8076
+ deleteMcpFile: z27.object({})
8084
8077
  };
8085
8078
  var mcpTools = {
8086
8079
  getMcpFile: {
@@ -8114,7 +8107,7 @@ var mcpTools = {
8114
8107
 
8115
8108
  // src/mcp/rules.ts
8116
8109
  import { basename as basename19, join as join70 } from "path";
8117
- import { z as z26 } from "zod/mini";
8110
+ import { z as z28 } from "zod/mini";
8118
8111
  var maxRuleSizeBytes = 1024 * 1024;
8119
8112
  var maxRulesCount = 1e3;
8120
8113
  async function listRules() {
@@ -8233,17 +8226,17 @@ async function deleteRule({ relativePathFromCwd }) {
8233
8226
  }
8234
8227
  }
8235
8228
  var ruleToolSchemas = {
8236
- listRules: z26.object({}),
8237
- getRule: z26.object({
8238
- relativePathFromCwd: z26.string()
8229
+ listRules: z28.object({}),
8230
+ getRule: z28.object({
8231
+ relativePathFromCwd: z28.string()
8239
8232
  }),
8240
- putRule: z26.object({
8241
- relativePathFromCwd: z26.string(),
8233
+ putRule: z28.object({
8234
+ relativePathFromCwd: z28.string(),
8242
8235
  frontmatter: RulesyncRuleFrontmatterSchema,
8243
- body: z26.string()
8236
+ body: z28.string()
8244
8237
  }),
8245
- deleteRule: z26.object({
8246
- relativePathFromCwd: z26.string()
8238
+ deleteRule: z28.object({
8239
+ relativePathFromCwd: z28.string()
8247
8240
  })
8248
8241
  };
8249
8242
  var ruleTools = {
@@ -8292,7 +8285,7 @@ var ruleTools = {
8292
8285
 
8293
8286
  // src/mcp/subagents.ts
8294
8287
  import { basename as basename20, join as join71 } from "path";
8295
- import { z as z27 } from "zod/mini";
8288
+ import { z as z29 } from "zod/mini";
8296
8289
  var maxSubagentSizeBytes = 1024 * 1024;
8297
8290
  var maxSubagentsCount = 1e3;
8298
8291
  async function listSubagents() {
@@ -8416,17 +8409,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
8416
8409
  }
8417
8410
  }
8418
8411
  var subagentToolSchemas = {
8419
- listSubagents: z27.object({}),
8420
- getSubagent: z27.object({
8421
- relativePathFromCwd: z27.string()
8412
+ listSubagents: z29.object({}),
8413
+ getSubagent: z29.object({
8414
+ relativePathFromCwd: z29.string()
8422
8415
  }),
8423
- putSubagent: z27.object({
8424
- relativePathFromCwd: z27.string(),
8416
+ putSubagent: z29.object({
8417
+ relativePathFromCwd: z29.string(),
8425
8418
  frontmatter: RulesyncSubagentFrontmatterSchema,
8426
- body: z27.string()
8419
+ body: z29.string()
8427
8420
  }),
8428
- deleteSubagent: z27.object({
8429
- relativePathFromCwd: z27.string()
8421
+ deleteSubagent: z29.object({
8422
+ relativePathFromCwd: z29.string()
8430
8423
  })
8431
8424
  };
8432
8425
  var subagentTools = {
@@ -8506,7 +8499,7 @@ async function mcpCommand({ version }) {
8506
8499
  }
8507
8500
 
8508
8501
  // src/cli/index.ts
8509
- var getVersion = () => "3.23.0";
8502
+ var getVersion = () => "3.23.3";
8510
8503
  var main = async () => {
8511
8504
  const program = new Command();
8512
8505
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "3.23.0",
3
+ "version": "3.23.3",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -36,7 +36,6 @@
36
36
  "pre-commit": "pnpm exec lint-staged"
37
37
  },
38
38
  "dependencies": {
39
- "@kimuson/modular-mcp": "0.0.5",
40
39
  "@modelcontextprotocol/sdk": "1.21.2",
41
40
  "chokidar": "4.0.3",
42
41
  "commander": "14.0.2",