rulesync 0.74.0 → 0.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +426 -195
  2. package/dist/index.js +426 -195
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -31,98 +31,13 @@ var import_commander = require("commander");
31
31
  // src/constants/announcements.ts
32
32
  var ANNOUNCEMENT = "".trim();
33
33
 
34
- // src/types/config-options.ts
35
- var import_mini2 = require("zod/mini");
36
-
37
- // src/types/tool-targets.ts
34
+ // src/types/features.ts
38
35
  var import_mini = require("zod/mini");
39
- var ALL_TOOL_TARGETS = [
40
- "agentsmd",
41
- "amazonqcli",
42
- "augmentcode",
43
- "augmentcode-legacy",
44
- "copilot",
45
- "cursor",
46
- "cline",
47
- "claudecode",
48
- "codexcli",
49
- "opencode",
50
- "qwencode",
51
- "roo",
52
- "geminicli",
53
- "kiro",
54
- "junie",
55
- "warp",
56
- "windsurf"
57
- ];
58
- var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
59
- var ToolTargetSchema = import_mini.z.enum(ALL_TOOL_TARGETS);
60
- var ToolTargetsSchema = import_mini.z.array(ToolTargetSchema);
61
- var RulesyncTargetsSchema = import_mini.z.array(import_mini.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
62
-
63
- // src/types/config-options.ts
64
- var FEATURE_TYPES = ["rules", "commands", "mcp", "ignore", "subagents"];
65
- var FeatureTypeSchema = import_mini2.z.enum(FEATURE_TYPES);
66
- var FeaturesSchema = import_mini2.z.union([import_mini2.z.array(FeatureTypeSchema), import_mini2.z.literal("*")]);
67
- var OutputPathsSchema = import_mini2.z.object({
68
- agentsmd: import_mini2.z.optional(import_mini2.z.string()),
69
- amazonqcli: import_mini2.z.optional(import_mini2.z.string()),
70
- augmentcode: import_mini2.z.optional(import_mini2.z.string()),
71
- "augmentcode-legacy": import_mini2.z.optional(import_mini2.z.string()),
72
- copilot: import_mini2.z.optional(import_mini2.z.string()),
73
- cursor: import_mini2.z.optional(import_mini2.z.string()),
74
- cline: import_mini2.z.optional(import_mini2.z.string()),
75
- claudecode: import_mini2.z.optional(import_mini2.z.string()),
76
- codexcli: import_mini2.z.optional(import_mini2.z.string()),
77
- opencode: import_mini2.z.optional(import_mini2.z.string()),
78
- qwencode: import_mini2.z.optional(import_mini2.z.string()),
79
- roo: import_mini2.z.optional(import_mini2.z.string()),
80
- geminicli: import_mini2.z.optional(import_mini2.z.string()),
81
- kiro: import_mini2.z.optional(import_mini2.z.string()),
82
- junie: import_mini2.z.optional(import_mini2.z.string()),
83
- windsurf: import_mini2.z.optional(import_mini2.z.string())
84
- });
85
- var ConfigOptionsSchema = import_mini2.z.object({
86
- aiRulesDir: import_mini2.z.optional(import_mini2.z.string()),
87
- outputPaths: import_mini2.z.optional(OutputPathsSchema),
88
- watchEnabled: import_mini2.z.optional(import_mini2.z.boolean()),
89
- defaultTargets: import_mini2.z.optional(ToolTargetsSchema),
90
- targets: import_mini2.z.optional(import_mini2.z.array(ToolTargetSchema)),
91
- exclude: import_mini2.z.optional(import_mini2.z.array(ToolTargetSchema)),
92
- features: import_mini2.z.optional(FeaturesSchema),
93
- verbose: import_mini2.z.optional(import_mini2.z.boolean()),
94
- delete: import_mini2.z.optional(import_mini2.z.boolean()),
95
- baseDir: import_mini2.z.optional(import_mini2.z.union([import_mini2.z.string(), import_mini2.z.array(import_mini2.z.string())])),
96
- legacy: import_mini2.z.optional(import_mini2.z.boolean()),
97
- watch: import_mini2.z.optional(
98
- import_mini2.z.object({
99
- enabled: import_mini2.z.optional(import_mini2.z.boolean()),
100
- interval: import_mini2.z.optional(import_mini2.z.number()),
101
- ignore: import_mini2.z.optional(import_mini2.z.array(import_mini2.z.string()))
102
- })
103
- )
104
- });
105
- var MergedConfigSchema = import_mini2.z.object({
106
- aiRulesDir: import_mini2.z.string(),
107
- outputPaths: import_mini2.z.record(ToolTargetSchema, import_mini2.z.string()),
108
- watchEnabled: import_mini2.z.boolean(),
109
- defaultTargets: ToolTargetsSchema,
110
- targets: import_mini2.z.optional(import_mini2.z.array(ToolTargetSchema)),
111
- exclude: import_mini2.z.optional(import_mini2.z.array(ToolTargetSchema)),
112
- features: import_mini2.z.optional(FeaturesSchema),
113
- verbose: import_mini2.z.optional(import_mini2.z.boolean()),
114
- delete: import_mini2.z.optional(import_mini2.z.boolean()),
115
- baseDir: import_mini2.z.optional(import_mini2.z.union([import_mini2.z.string(), import_mini2.z.array(import_mini2.z.string())])),
116
- configPath: import_mini2.z.optional(import_mini2.z.string()),
117
- legacy: import_mini2.z.optional(import_mini2.z.boolean()),
118
- watch: import_mini2.z.optional(
119
- import_mini2.z.object({
120
- enabled: import_mini2.z.optional(import_mini2.z.boolean()),
121
- interval: import_mini2.z.optional(import_mini2.z.number()),
122
- ignore: import_mini2.z.optional(import_mini2.z.array(import_mini2.z.string()))
123
- })
124
- )
125
- });
36
+ var ALL_FEATURES = ["rules", "ignore", "mcp", "subagents", "commands"];
37
+ var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
38
+ var FeatureSchema = import_mini.z.enum(ALL_FEATURES);
39
+ var FeaturesSchema = import_mini.z.array(FeatureSchema);
40
+ var RulesyncFeaturesSchema = import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD));
126
41
 
127
42
  // src/utils/file.ts
128
43
  var import_node_fs = require("fs");
@@ -430,6 +345,32 @@ var RulesyncFile = class extends AiFile {
430
345
  }
431
346
  };
432
347
 
348
+ // src/types/tool-targets.ts
349
+ var import_mini2 = require("zod/mini");
350
+ var ALL_TOOL_TARGETS = [
351
+ "agentsmd",
352
+ "amazonqcli",
353
+ "augmentcode",
354
+ "augmentcode-legacy",
355
+ "copilot",
356
+ "cursor",
357
+ "cline",
358
+ "claudecode",
359
+ "codexcli",
360
+ "opencode",
361
+ "qwencode",
362
+ "roo",
363
+ "geminicli",
364
+ "kiro",
365
+ "junie",
366
+ "warp",
367
+ "windsurf"
368
+ ];
369
+ var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
370
+ var ToolTargetSchema = import_mini2.z.enum(ALL_TOOL_TARGETS);
371
+ var ToolTargetsSchema = import_mini2.z.array(ToolTargetSchema);
372
+ var RulesyncTargetsSchema = import_mini2.z.array(import_mini2.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
373
+
433
374
  // src/commands/rulesync-command.ts
434
375
  var RulesyncCommandFrontmatterSchema = import_mini3.z.object({
435
376
  targets: RulesyncTargetsSchema,
@@ -532,6 +473,39 @@ var ToolCommand = class extends AiFile {
532
473
  static fromRulesyncCommand(_params) {
533
474
  throw new Error("Please implement this method in the subclass.");
534
475
  }
476
+ /**
477
+ * Check if this tool is targeted by a RulesyncCommand based on its targets field.
478
+ * Subclasses should override this to provide specific targeting logic.
479
+ *
480
+ * @param rulesyncCommand - The RulesyncCommand to check
481
+ * @returns True if this tool is targeted by the command
482
+ */
483
+ static isTargetedByRulesyncCommand(_rulesyncCommand) {
484
+ throw new Error("Please implement this method in the subclass.");
485
+ }
486
+ /**
487
+ * Default implementation for checking if a tool is targeted by a RulesyncCommand.
488
+ * Checks if the command's targets include the tool target or a wildcard.
489
+ *
490
+ * @param params - Parameters including the RulesyncCommand and tool target
491
+ * @returns True if the tool target is included in the command's targets
492
+ */
493
+ static isTargetedByRulesyncCommandDefault({
494
+ rulesyncCommand,
495
+ toolTarget
496
+ }) {
497
+ const targets = rulesyncCommand.getFrontmatter().targets;
498
+ if (!targets) {
499
+ return true;
500
+ }
501
+ if (targets.includes("*")) {
502
+ return true;
503
+ }
504
+ if (targets.includes(toolTarget)) {
505
+ return true;
506
+ }
507
+ return false;
508
+ }
535
509
  };
536
510
 
537
511
  // src/commands/claudecode-command.ts
@@ -612,6 +586,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
612
586
  return { success: false, error: result.error };
613
587
  }
614
588
  }
589
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
590
+ return this.isTargetedByRulesyncCommandDefault({
591
+ rulesyncCommand,
592
+ toolTarget: "claudecode"
593
+ });
594
+ }
615
595
  static async fromFile({
616
596
  baseDir = ".",
617
597
  relativeFilePath,
@@ -772,6 +752,12 @@ var CodexCliCommand = class _CodexCliCommand extends SimulatedCommand {
772
752
  validate
773
753
  });
774
754
  }
755
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
756
+ return this.isTargetedByRulesyncCommandDefault({
757
+ rulesyncCommand,
758
+ toolTarget: "codexcli"
759
+ });
760
+ }
775
761
  };
776
762
 
777
763
  // src/commands/copilot-command.ts
@@ -816,6 +802,12 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
816
802
  validate
817
803
  });
818
804
  }
805
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
806
+ return this.isTargetedByRulesyncCommandDefault({
807
+ rulesyncCommand,
808
+ toolTarget: "copilot"
809
+ });
810
+ }
819
811
  };
820
812
 
821
813
  // src/commands/cursor-command.ts
@@ -860,6 +852,12 @@ var CursorCommand = class _CursorCommand extends SimulatedCommand {
860
852
  validate
861
853
  });
862
854
  }
855
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
856
+ return this.isTargetedByRulesyncCommandDefault({
857
+ rulesyncCommand,
858
+ toolTarget: "cursor"
859
+ });
860
+ }
863
861
  };
864
862
 
865
863
  // src/commands/geminicli-command.ts
@@ -896,17 +894,6 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
896
894
  throw new Error(`Failed to parse TOML command file: ${error}`);
897
895
  }
898
896
  }
899
- parseCommandFile(content) {
900
- const parsed = this.parseTomlContent(content);
901
- return {
902
- filename: "unknown.toml",
903
- filepath: "unknown.toml",
904
- frontmatter: {
905
- description: parsed.description
906
- },
907
- content: parsed.prompt
908
- };
909
- }
910
897
  getBody() {
911
898
  return this.body;
912
899
  }
@@ -981,6 +968,12 @@ ${geminiFrontmatter.prompt}
981
968
  return { success: false, error: error instanceof Error ? error : new Error(String(error)) };
982
969
  }
983
970
  }
971
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
972
+ return this.isTargetedByRulesyncCommandDefault({
973
+ rulesyncCommand,
974
+ toolTarget: "geminicli"
975
+ });
976
+ }
984
977
  };
985
978
 
986
979
  // src/commands/roo-command.ts
@@ -1066,6 +1059,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
1066
1059
  return { success: false, error: result.error };
1067
1060
  }
1068
1061
  }
1062
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
1063
+ return this.isTargetedByRulesyncCommandDefault({
1064
+ rulesyncCommand,
1065
+ toolTarget: "roo"
1066
+ });
1067
+ }
1069
1068
  static async fromFile({
1070
1069
  baseDir = ".",
1071
1070
  relativeFilePath,
@@ -1117,31 +1116,49 @@ var CommandsProcessor = class extends FeatureProcessor {
1117
1116
  const toolCommands = rulesyncCommands.map((rulesyncCommand) => {
1118
1117
  switch (this.toolTarget) {
1119
1118
  case "claudecode":
1119
+ if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1120
+ return null;
1121
+ }
1120
1122
  return ClaudecodeCommand.fromRulesyncCommand({
1121
1123
  baseDir: this.baseDir,
1122
1124
  rulesyncCommand
1123
1125
  });
1124
1126
  case "geminicli":
1127
+ if (!GeminiCliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1128
+ return null;
1129
+ }
1125
1130
  return GeminiCliCommand.fromRulesyncCommand({
1126
1131
  baseDir: this.baseDir,
1127
1132
  rulesyncCommand
1128
1133
  });
1129
1134
  case "roo":
1135
+ if (!RooCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1136
+ return null;
1137
+ }
1130
1138
  return RooCommand.fromRulesyncCommand({
1131
1139
  baseDir: this.baseDir,
1132
1140
  rulesyncCommand
1133
1141
  });
1134
1142
  case "copilot":
1143
+ if (!CopilotCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1144
+ return null;
1145
+ }
1135
1146
  return CopilotCommand.fromRulesyncCommand({
1136
1147
  baseDir: this.baseDir,
1137
1148
  rulesyncCommand
1138
1149
  });
1139
1150
  case "cursor":
1151
+ if (!CursorCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1152
+ return null;
1153
+ }
1140
1154
  return CursorCommand.fromRulesyncCommand({
1141
1155
  baseDir: this.baseDir,
1142
1156
  rulesyncCommand
1143
1157
  });
1144
1158
  case "codexcli":
1159
+ if (!CodexCliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1160
+ return null;
1161
+ }
1145
1162
  return CodexCliCommand.fromRulesyncCommand({
1146
1163
  baseDir: this.baseDir,
1147
1164
  rulesyncCommand
@@ -1149,7 +1166,9 @@ var CommandsProcessor = class extends FeatureProcessor {
1149
1166
  default:
1150
1167
  throw new Error(`Unsupported tool target: ${this.toolTarget}`);
1151
1168
  }
1152
- });
1169
+ }).filter(
1170
+ (command) => command !== null
1171
+ );
1153
1172
  return toolCommands;
1154
1173
  }
1155
1174
  async convertToolFilesToRulesyncFiles(toolFiles) {
@@ -1309,14 +1328,6 @@ var CommandsProcessor = class extends FeatureProcessor {
1309
1328
  // src/config/config-resolver.ts
1310
1329
  var import_c12 = require("c12");
1311
1330
 
1312
- // src/types/features.ts
1313
- var import_mini9 = require("zod/mini");
1314
- var ALL_FEATURES = ["rules", "ignore", "mcp", "subagents", "commands"];
1315
- var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
1316
- var FeatureSchema = import_mini9.z.enum(ALL_FEATURES);
1317
- var FeaturesSchema2 = import_mini9.z.array(FeatureSchema);
1318
- var RulesyncFeaturesSchema = import_mini9.z.array(import_mini9.z.enum(ALL_FEATURES_WITH_WILDCARD));
1319
-
1320
1331
  // src/config/config.ts
1321
1332
  var Config = class {
1322
1333
  baseDirs;
@@ -1431,7 +1442,7 @@ var ConfigResolver = class {
1431
1442
  };
1432
1443
 
1433
1444
  // src/ignore/ignore-processor.ts
1434
- var import_mini10 = require("zod/mini");
1445
+ var import_mini9 = require("zod/mini");
1435
1446
 
1436
1447
  // src/ignore/amazonqcli-ignore.ts
1437
1448
  var import_node_path12 = require("path");
@@ -2043,7 +2054,7 @@ var ignoreProcessorToolTargets = [
2043
2054
  "roo",
2044
2055
  "windsurf"
2045
2056
  ];
2046
- var IgnoreProcessorToolTargetSchema = import_mini10.z.enum(ignoreProcessorToolTargets);
2057
+ var IgnoreProcessorToolTargetSchema = import_mini9.z.enum(ignoreProcessorToolTargets);
2047
2058
  var IgnoreProcessor = class extends FeatureProcessor {
2048
2059
  toolTarget;
2049
2060
  constructor({
@@ -2205,47 +2216,40 @@ var IgnoreProcessor = class extends FeatureProcessor {
2205
2216
  };
2206
2217
 
2207
2218
  // src/mcp/mcp-processor.ts
2208
- var import_mini12 = require("zod/mini");
2219
+ var import_mini11 = require("zod/mini");
2209
2220
 
2210
2221
  // src/mcp/amazonqcli-mcp.ts
2211
2222
  var import_node_path24 = require("path");
2212
2223
 
2213
2224
  // src/mcp/rulesync-mcp.ts
2214
2225
  var import_node_path23 = require("path");
2215
-
2216
- // src/types/mcp.ts
2217
- var import_mini11 = require("zod/mini");
2218
- var McpTransportTypeSchema = import_mini11.z.enum(["stdio", "sse", "http"]);
2219
- var McpServerBaseSchema = import_mini11.z.object({
2220
- type: import_mini11.z.optional(import_mini11.z.enum(["stdio", "sse", "http"])),
2221
- command: import_mini11.z.optional(import_mini11.z.union([import_mini11.z.string(), import_mini11.z.array(import_mini11.z.string())])),
2222
- args: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2223
- url: import_mini11.z.optional(import_mini11.z.string()),
2224
- httpUrl: import_mini11.z.optional(import_mini11.z.string()),
2225
- env: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string())),
2226
- disabled: import_mini11.z.optional(import_mini11.z.boolean()),
2227
- networkTimeout: import_mini11.z.optional(import_mini11.z.number()),
2228
- timeout: import_mini11.z.optional(import_mini11.z.number()),
2229
- trust: import_mini11.z.optional(import_mini11.z.boolean()),
2230
- cwd: import_mini11.z.optional(import_mini11.z.string()),
2231
- transport: import_mini11.z.optional(McpTransportTypeSchema),
2232
- alwaysAllow: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2233
- tools: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2234
- kiroAutoApprove: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2235
- kiroAutoBlock: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2236
- headers: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string()))
2237
- });
2238
- var RulesyncMcpServerSchema = import_mini11.z.extend(McpServerBaseSchema, {
2239
- targets: import_mini11.z.optional(RulesyncTargetsSchema)
2226
+ var import_mini10 = require("zod/mini");
2227
+ var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
2228
+ var McpServerBaseSchema = import_mini10.z.object({
2229
+ type: import_mini10.z.optional(import_mini10.z.enum(["stdio", "sse", "http"])),
2230
+ command: import_mini10.z.optional(import_mini10.z.union([import_mini10.z.string(), import_mini10.z.array(import_mini10.z.string())])),
2231
+ args: import_mini10.z.optional(import_mini10.z.array(import_mini10.z.string())),
2232
+ url: import_mini10.z.optional(import_mini10.z.string()),
2233
+ httpUrl: import_mini10.z.optional(import_mini10.z.string()),
2234
+ env: import_mini10.z.optional(import_mini10.z.record(import_mini10.z.string(), import_mini10.z.string())),
2235
+ disabled: import_mini10.z.optional(import_mini10.z.boolean()),
2236
+ networkTimeout: import_mini10.z.optional(import_mini10.z.number()),
2237
+ timeout: import_mini10.z.optional(import_mini10.z.number()),
2238
+ trust: import_mini10.z.optional(import_mini10.z.boolean()),
2239
+ cwd: import_mini10.z.optional(import_mini10.z.string()),
2240
+ transport: import_mini10.z.optional(McpTransportTypeSchema),
2241
+ alwaysAllow: import_mini10.z.optional(import_mini10.z.array(import_mini10.z.string())),
2242
+ tools: import_mini10.z.optional(import_mini10.z.array(import_mini10.z.string())),
2243
+ kiroAutoApprove: import_mini10.z.optional(import_mini10.z.array(import_mini10.z.string())),
2244
+ kiroAutoBlock: import_mini10.z.optional(import_mini10.z.array(import_mini10.z.string())),
2245
+ headers: import_mini10.z.optional(import_mini10.z.record(import_mini10.z.string(), import_mini10.z.string()))
2240
2246
  });
2241
- var McpConfigSchema = import_mini11.z.object({
2242
- mcpServers: import_mini11.z.record(import_mini11.z.string(), McpServerBaseSchema)
2247
+ var RulesyncMcpServerSchema = import_mini10.z.extend(McpServerBaseSchema, {
2248
+ targets: import_mini10.z.optional(RulesyncTargetsSchema)
2243
2249
  });
2244
- var RulesyncMcpConfigSchema = import_mini11.z.object({
2245
- mcpServers: import_mini11.z.record(import_mini11.z.string(), RulesyncMcpServerSchema)
2250
+ var RulesyncMcpConfigSchema = import_mini10.z.object({
2251
+ mcpServers: import_mini10.z.record(import_mini10.z.string(), RulesyncMcpServerSchema)
2246
2252
  });
2247
-
2248
- // src/mcp/rulesync-mcp.ts
2249
2253
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2250
2254
  json;
2251
2255
  constructor({ ...rest }) {
@@ -2637,7 +2641,7 @@ var mcpProcessorToolTargets = [
2637
2641
  "cursor",
2638
2642
  "roo"
2639
2643
  ];
2640
- var McpProcessorToolTargetSchema = import_mini12.z.enum(mcpProcessorToolTargets);
2644
+ var McpProcessorToolTargetSchema = import_mini11.z.enum(mcpProcessorToolTargets);
2641
2645
  var McpProcessor = class extends FeatureProcessor {
2642
2646
  toolTarget;
2643
2647
  constructor({
@@ -2798,7 +2802,7 @@ var McpProcessor = class extends FeatureProcessor {
2798
2802
  // src/rules/rules-processor.ts
2799
2803
  var import_node_path50 = require("path");
2800
2804
  var import_fast_xml_parser = require("fast-xml-parser");
2801
- var import_mini18 = require("zod/mini");
2805
+ var import_mini17 = require("zod/mini");
2802
2806
 
2803
2807
  // src/constants/paths.ts
2804
2808
  var import_node_path30 = require("path");
@@ -2810,7 +2814,7 @@ var RULESYNC_SUBAGENTS_DIR = (0, import_node_path30.join)(".rulesync", "subagent
2810
2814
 
2811
2815
  // src/subagents/simulated-subagent.ts
2812
2816
  var import_node_path31 = require("path");
2813
- var import_mini13 = require("zod/mini");
2817
+ var import_mini12 = require("zod/mini");
2814
2818
 
2815
2819
  // src/subagents/tool-subagent.ts
2816
2820
  var ToolSubagent = class extends ToolFile {
@@ -2823,12 +2827,31 @@ var ToolSubagent = class extends ToolFile {
2823
2827
  static fromRulesyncSubagent(_params) {
2824
2828
  throw new Error("Please implement this method in the subclass.");
2825
2829
  }
2830
+ static isTargetedByRulesyncSubagent(_rulesyncSubagent) {
2831
+ throw new Error("Please implement this method in the subclass.");
2832
+ }
2833
+ static isTargetedByRulesyncSubagentDefault({
2834
+ rulesyncSubagent,
2835
+ toolTarget
2836
+ }) {
2837
+ const targets = rulesyncSubagent.getFrontmatter().targets;
2838
+ if (!targets) {
2839
+ return true;
2840
+ }
2841
+ if (targets.includes("*")) {
2842
+ return true;
2843
+ }
2844
+ if (targets.includes(toolTarget)) {
2845
+ return true;
2846
+ }
2847
+ return false;
2848
+ }
2826
2849
  };
2827
2850
 
2828
2851
  // src/subagents/simulated-subagent.ts
2829
- var SimulatedSubagentFrontmatterSchema = import_mini13.z.object({
2830
- name: import_mini13.z.string(),
2831
- description: import_mini13.z.string()
2852
+ var SimulatedSubagentFrontmatterSchema = import_mini12.z.object({
2853
+ name: import_mini12.z.string(),
2854
+ description: import_mini12.z.string()
2832
2855
  });
2833
2856
  var SimulatedSubagent = class extends ToolSubagent {
2834
2857
  frontmatter;
@@ -2925,6 +2948,12 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
2925
2948
  const baseParams = this.fromRulesyncSubagentDefault(params);
2926
2949
  return new _CodexCliSubagent(baseParams);
2927
2950
  }
2951
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
2952
+ return this.isTargetedByRulesyncSubagentDefault({
2953
+ rulesyncSubagent,
2954
+ toolTarget: "codexcli"
2955
+ });
2956
+ }
2928
2957
  };
2929
2958
 
2930
2959
  // src/subagents/copilot-subagent.ts
@@ -2942,6 +2971,12 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
2942
2971
  const baseParams = this.fromRulesyncSubagentDefault(params);
2943
2972
  return new _CopilotSubagent(baseParams);
2944
2973
  }
2974
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
2975
+ return this.isTargetedByRulesyncSubagentDefault({
2976
+ rulesyncSubagent,
2977
+ toolTarget: "copilot"
2978
+ });
2979
+ }
2945
2980
  };
2946
2981
 
2947
2982
  // src/subagents/cursor-subagent.ts
@@ -2959,6 +2994,12 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
2959
2994
  const baseParams = this.fromRulesyncSubagentDefault(params);
2960
2995
  return new _CursorSubagent(baseParams);
2961
2996
  }
2997
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
2998
+ return this.isTargetedByRulesyncSubagentDefault({
2999
+ rulesyncSubagent,
3000
+ toolTarget: "cursor"
3001
+ });
3002
+ }
2962
3003
  };
2963
3004
 
2964
3005
  // src/rules/agentsmd-rule.ts
@@ -2966,17 +3007,17 @@ var import_node_path33 = require("path");
2966
3007
 
2967
3008
  // src/rules/rulesync-rule.ts
2968
3009
  var import_node_path32 = require("path");
2969
- var import_mini14 = require("zod/mini");
2970
- var RulesyncRuleFrontmatterSchema = import_mini14.z.object({
2971
- root: import_mini14.z.optional(import_mini14.z.optional(import_mini14.z.boolean())),
2972
- targets: import_mini14.z.optional(RulesyncTargetsSchema),
2973
- description: import_mini14.z.optional(import_mini14.z.string()),
2974
- globs: import_mini14.z.optional(import_mini14.z.array(import_mini14.z.string())),
2975
- cursor: import_mini14.z.optional(
2976
- import_mini14.z.object({
2977
- alwaysApply: import_mini14.z.optional(import_mini14.z.boolean()),
2978
- description: import_mini14.z.optional(import_mini14.z.string()),
2979
- globs: import_mini14.z.optional(import_mini14.z.array(import_mini14.z.string()))
3010
+ var import_mini13 = require("zod/mini");
3011
+ var RulesyncRuleFrontmatterSchema = import_mini13.z.object({
3012
+ root: import_mini13.z.optional(import_mini13.z.optional(import_mini13.z.boolean())),
3013
+ targets: import_mini13.z.optional(RulesyncTargetsSchema),
3014
+ description: import_mini13.z.optional(import_mini13.z.string()),
3015
+ globs: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
3016
+ cursor: import_mini13.z.optional(
3017
+ import_mini13.z.object({
3018
+ alwaysApply: import_mini13.z.optional(import_mini13.z.boolean()),
3019
+ description: import_mini13.z.optional(import_mini13.z.string()),
3020
+ globs: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string()))
2980
3021
  })
2981
3022
  )
2982
3023
  });
@@ -3129,6 +3170,25 @@ var ToolRule = class extends ToolFile {
3129
3170
  isRoot() {
3130
3171
  return this.root;
3131
3172
  }
3173
+ static isTargetedByRulesyncRule(_rulesyncRule) {
3174
+ throw new Error("Please implement this method in the subclass.");
3175
+ }
3176
+ static isTargetedByRulesyncRuleDefault({
3177
+ rulesyncRule,
3178
+ toolTarget
3179
+ }) {
3180
+ const targets = rulesyncRule.getFrontmatter().targets;
3181
+ if (!targets) {
3182
+ return true;
3183
+ }
3184
+ if (targets.includes("*")) {
3185
+ return true;
3186
+ }
3187
+ if (targets.includes(toolTarget)) {
3188
+ return true;
3189
+ }
3190
+ return false;
3191
+ }
3132
3192
  };
3133
3193
 
3134
3194
  // src/rules/agentsmd-rule.ts
@@ -3189,6 +3249,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
3189
3249
  validate() {
3190
3250
  return { success: true, error: null };
3191
3251
  }
3252
+ static isTargetedByRulesyncRule(rulesyncRule) {
3253
+ return this.isTargetedByRulesyncRuleDefault({
3254
+ rulesyncRule,
3255
+ toolTarget: "agentsmd"
3256
+ });
3257
+ }
3192
3258
  };
3193
3259
 
3194
3260
  // src/rules/amazonqcli-rule.ts
@@ -3238,6 +3304,12 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
3238
3304
  validate() {
3239
3305
  return { success: true, error: null };
3240
3306
  }
3307
+ static isTargetedByRulesyncRule(rulesyncRule) {
3308
+ return this.isTargetedByRulesyncRuleDefault({
3309
+ rulesyncRule,
3310
+ toolTarget: "amazonqcli"
3311
+ });
3312
+ }
3241
3313
  };
3242
3314
 
3243
3315
  // src/rules/augmentcode-legacy-rule.ts
@@ -3288,6 +3360,12 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
3288
3360
  validate() {
3289
3361
  return { success: true, error: null };
3290
3362
  }
3363
+ static isTargetedByRulesyncRule(rulesyncRule) {
3364
+ return this.isTargetedByRulesyncRuleDefault({
3365
+ rulesyncRule,
3366
+ toolTarget: "augmentcode-legacy"
3367
+ });
3368
+ }
3291
3369
  static async fromFile({
3292
3370
  baseDir = ".",
3293
3371
  relativeFilePath,
@@ -3355,6 +3433,12 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
3355
3433
  validate() {
3356
3434
  return { success: true, error: null };
3357
3435
  }
3436
+ static isTargetedByRulesyncRule(rulesyncRule) {
3437
+ return this.isTargetedByRulesyncRuleDefault({
3438
+ rulesyncRule,
3439
+ toolTarget: "augmentcode"
3440
+ });
3441
+ }
3358
3442
  };
3359
3443
 
3360
3444
  // src/rules/claudecode-rule.ts
@@ -3409,13 +3493,19 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
3409
3493
  validate() {
3410
3494
  return { success: true, error: null };
3411
3495
  }
3496
+ static isTargetedByRulesyncRule(rulesyncRule) {
3497
+ return this.isTargetedByRulesyncRuleDefault({
3498
+ rulesyncRule,
3499
+ toolTarget: "claudecode"
3500
+ });
3501
+ }
3412
3502
  };
3413
3503
 
3414
3504
  // src/rules/cline-rule.ts
3415
3505
  var import_node_path38 = require("path");
3416
- var import_mini15 = require("zod/mini");
3417
- var ClineRuleFrontmatterSchema = import_mini15.z.object({
3418
- description: import_mini15.z.string()
3506
+ var import_mini14 = require("zod/mini");
3507
+ var ClineRuleFrontmatterSchema = import_mini14.z.object({
3508
+ description: import_mini14.z.string()
3419
3509
  });
3420
3510
  var ClineRule = class _ClineRule extends ToolRule {
3421
3511
  static getSettablePaths() {
@@ -3445,6 +3535,12 @@ var ClineRule = class _ClineRule extends ToolRule {
3445
3535
  validate() {
3446
3536
  return { success: true, error: null };
3447
3537
  }
3538
+ static isTargetedByRulesyncRule(rulesyncRule) {
3539
+ return this.isTargetedByRulesyncRuleDefault({
3540
+ rulesyncRule,
3541
+ toolTarget: "cline"
3542
+ });
3543
+ }
3448
3544
  static async fromFile({
3449
3545
  baseDir = ".",
3450
3546
  relativeFilePath,
@@ -3515,14 +3611,20 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
3515
3611
  validate() {
3516
3612
  return { success: true, error: null };
3517
3613
  }
3614
+ static isTargetedByRulesyncRule(rulesyncRule) {
3615
+ return this.isTargetedByRulesyncRuleDefault({
3616
+ rulesyncRule,
3617
+ toolTarget: "codexcli"
3618
+ });
3619
+ }
3518
3620
  };
3519
3621
 
3520
3622
  // src/rules/copilot-rule.ts
3521
3623
  var import_node_path40 = require("path");
3522
- var import_mini16 = require("zod/mini");
3523
- var CopilotRuleFrontmatterSchema = import_mini16.z.object({
3524
- description: import_mini16.z.optional(import_mini16.z.string()),
3525
- applyTo: import_mini16.z.optional(import_mini16.z.string())
3624
+ var import_mini15 = require("zod/mini");
3625
+ var CopilotRuleFrontmatterSchema = import_mini15.z.object({
3626
+ description: import_mini15.z.optional(import_mini15.z.string()),
3627
+ applyTo: import_mini15.z.optional(import_mini15.z.string())
3526
3628
  });
3527
3629
  var CopilotRule = class _CopilotRule extends ToolRule {
3528
3630
  frontmatter;
@@ -3663,15 +3765,21 @@ var CopilotRule = class _CopilotRule extends ToolRule {
3663
3765
  getBody() {
3664
3766
  return this.body;
3665
3767
  }
3768
+ static isTargetedByRulesyncRule(rulesyncRule) {
3769
+ return this.isTargetedByRulesyncRuleDefault({
3770
+ rulesyncRule,
3771
+ toolTarget: "copilot"
3772
+ });
3773
+ }
3666
3774
  };
3667
3775
 
3668
3776
  // src/rules/cursor-rule.ts
3669
3777
  var import_node_path41 = require("path");
3670
- var import_mini17 = require("zod/mini");
3671
- var CursorRuleFrontmatterSchema = import_mini17.z.object({
3672
- description: import_mini17.z.optional(import_mini17.z.string()),
3673
- globs: import_mini17.z.optional(import_mini17.z.string()),
3674
- alwaysApply: import_mini17.z.optional(import_mini17.z.boolean())
3778
+ var import_mini16 = require("zod/mini");
3779
+ var CursorRuleFrontmatterSchema = import_mini16.z.object({
3780
+ description: import_mini16.z.optional(import_mini16.z.string()),
3781
+ globs: import_mini16.z.optional(import_mini16.z.string()),
3782
+ alwaysApply: import_mini16.z.optional(import_mini16.z.boolean())
3675
3783
  });
3676
3784
  var CursorRule = class _CursorRule extends ToolRule {
3677
3785
  frontmatter;
@@ -3831,6 +3939,12 @@ var CursorRule = class _CursorRule extends ToolRule {
3831
3939
  getBody() {
3832
3940
  return this.body;
3833
3941
  }
3942
+ static isTargetedByRulesyncRule(rulesyncRule) {
3943
+ return this.isTargetedByRulesyncRuleDefault({
3944
+ rulesyncRule,
3945
+ toolTarget: "cursor"
3946
+ });
3947
+ }
3834
3948
  };
3835
3949
 
3836
3950
  // src/rules/geminicli-rule.ts
@@ -3885,6 +3999,12 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
3885
3999
  validate() {
3886
4000
  return { success: true, error: null };
3887
4001
  }
4002
+ static isTargetedByRulesyncRule(rulesyncRule) {
4003
+ return this.isTargetedByRulesyncRuleDefault({
4004
+ rulesyncRule,
4005
+ toolTarget: "geminicli"
4006
+ });
4007
+ }
3888
4008
  };
3889
4009
 
3890
4010
  // src/rules/junie-rule.ts
@@ -3939,6 +4059,12 @@ var JunieRule = class _JunieRule extends ToolRule {
3939
4059
  validate() {
3940
4060
  return { success: true, error: null };
3941
4061
  }
4062
+ static isTargetedByRulesyncRule(rulesyncRule) {
4063
+ return this.isTargetedByRulesyncRuleDefault({
4064
+ rulesyncRule,
4065
+ toolTarget: "junie"
4066
+ });
4067
+ }
3942
4068
  };
3943
4069
 
3944
4070
  // src/rules/kiro-rule.ts
@@ -3988,6 +4114,12 @@ var KiroRule = class _KiroRule extends ToolRule {
3988
4114
  validate() {
3989
4115
  return { success: true, error: null };
3990
4116
  }
4117
+ static isTargetedByRulesyncRule(rulesyncRule) {
4118
+ return this.isTargetedByRulesyncRuleDefault({
4119
+ rulesyncRule,
4120
+ toolTarget: "kiro"
4121
+ });
4122
+ }
3991
4123
  };
3992
4124
 
3993
4125
  // src/rules/opencode-rule.ts
@@ -4042,6 +4174,12 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
4042
4174
  validate() {
4043
4175
  return { success: true, error: null };
4044
4176
  }
4177
+ static isTargetedByRulesyncRule(rulesyncRule) {
4178
+ return this.isTargetedByRulesyncRuleDefault({
4179
+ rulesyncRule,
4180
+ toolTarget: "opencode"
4181
+ });
4182
+ }
4045
4183
  };
4046
4184
 
4047
4185
  // src/rules/qwencode-rule.ts
@@ -4093,6 +4231,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
4093
4231
  validate() {
4094
4232
  return { success: true, error: null };
4095
4233
  }
4234
+ static isTargetedByRulesyncRule(rulesyncRule) {
4235
+ return this.isTargetedByRulesyncRuleDefault({
4236
+ rulesyncRule,
4237
+ toolTarget: "qwencode"
4238
+ });
4239
+ }
4096
4240
  };
4097
4241
 
4098
4242
  // src/rules/roo-rule.ts
@@ -4157,6 +4301,12 @@ var RooRule = class _RooRule extends ToolRule {
4157
4301
  validate() {
4158
4302
  return { success: true, error: null };
4159
4303
  }
4304
+ static isTargetedByRulesyncRule(rulesyncRule) {
4305
+ return this.isTargetedByRulesyncRuleDefault({
4306
+ rulesyncRule,
4307
+ toolTarget: "roo"
4308
+ });
4309
+ }
4160
4310
  };
4161
4311
 
4162
4312
  // src/rules/warp-rule.ts
@@ -4218,6 +4368,12 @@ var WarpRule = class _WarpRule extends ToolRule {
4218
4368
  validate() {
4219
4369
  return { success: true, error: null };
4220
4370
  }
4371
+ static isTargetedByRulesyncRule(rulesyncRule) {
4372
+ return this.isTargetedByRulesyncRuleDefault({
4373
+ rulesyncRule,
4374
+ toolTarget: "warp"
4375
+ });
4376
+ }
4221
4377
  };
4222
4378
 
4223
4379
  // src/rules/windsurf-rule.ts
@@ -4266,6 +4422,12 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
4266
4422
  validate() {
4267
4423
  return { success: true, error: null };
4268
4424
  }
4425
+ static isTargetedByRulesyncRule(rulesyncRule) {
4426
+ return this.isTargetedByRulesyncRuleDefault({
4427
+ rulesyncRule,
4428
+ toolTarget: "windsurf"
4429
+ });
4430
+ }
4269
4431
  };
4270
4432
 
4271
4433
  // src/rules/rules-processor.ts
@@ -4288,7 +4450,7 @@ var rulesProcessorToolTargets = [
4288
4450
  "warp",
4289
4451
  "windsurf"
4290
4452
  ];
4291
- var RulesProcessorToolTargetSchema = import_mini18.z.enum(rulesProcessorToolTargets);
4453
+ var RulesProcessorToolTargetSchema = import_mini17.z.enum(rulesProcessorToolTargets);
4292
4454
  var RulesProcessor = class extends FeatureProcessor {
4293
4455
  toolTarget;
4294
4456
  simulateCommands;
@@ -4311,102 +4473,153 @@ var RulesProcessor = class extends FeatureProcessor {
4311
4473
  const toolRules = rulesyncRules.map((rulesyncRule) => {
4312
4474
  switch (this.toolTarget) {
4313
4475
  case "agentsmd":
4476
+ if (!AgentsMdRule.isTargetedByRulesyncRule(rulesyncRule)) {
4477
+ return null;
4478
+ }
4314
4479
  return AgentsMdRule.fromRulesyncRule({
4315
4480
  baseDir: this.baseDir,
4316
4481
  rulesyncRule,
4317
4482
  validate: true
4318
4483
  });
4319
4484
  case "amazonqcli":
4485
+ if (!AmazonQCliRule.isTargetedByRulesyncRule(rulesyncRule)) {
4486
+ return null;
4487
+ }
4320
4488
  return AmazonQCliRule.fromRulesyncRule({
4321
4489
  baseDir: this.baseDir,
4322
4490
  rulesyncRule,
4323
4491
  validate: true
4324
4492
  });
4325
4493
  case "augmentcode":
4494
+ if (!AugmentcodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
4495
+ return null;
4496
+ }
4326
4497
  return AugmentcodeRule.fromRulesyncRule({
4327
4498
  baseDir: this.baseDir,
4328
4499
  rulesyncRule,
4329
4500
  validate: true
4330
4501
  });
4331
4502
  case "augmentcode-legacy":
4503
+ if (!AugmentcodeLegacyRule.isTargetedByRulesyncRule(rulesyncRule)) {
4504
+ return null;
4505
+ }
4332
4506
  return AugmentcodeLegacyRule.fromRulesyncRule({
4333
4507
  baseDir: this.baseDir,
4334
4508
  rulesyncRule,
4335
4509
  validate: true
4336
4510
  });
4337
4511
  case "claudecode":
4512
+ if (!ClaudecodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
4513
+ return null;
4514
+ }
4338
4515
  return ClaudecodeRule.fromRulesyncRule({
4339
4516
  baseDir: this.baseDir,
4340
4517
  rulesyncRule,
4341
4518
  validate: true
4342
4519
  });
4343
4520
  case "cline":
4521
+ if (!ClineRule.isTargetedByRulesyncRule(rulesyncRule)) {
4522
+ return null;
4523
+ }
4344
4524
  return ClineRule.fromRulesyncRule({
4345
4525
  baseDir: this.baseDir,
4346
4526
  rulesyncRule,
4347
4527
  validate: true
4348
4528
  });
4349
4529
  case "codexcli":
4530
+ if (!CodexcliRule.isTargetedByRulesyncRule(rulesyncRule)) {
4531
+ return null;
4532
+ }
4350
4533
  return CodexcliRule.fromRulesyncRule({
4351
4534
  baseDir: this.baseDir,
4352
4535
  rulesyncRule,
4353
4536
  validate: true
4354
4537
  });
4355
4538
  case "copilot":
4539
+ if (!CopilotRule.isTargetedByRulesyncRule(rulesyncRule)) {
4540
+ return null;
4541
+ }
4356
4542
  return CopilotRule.fromRulesyncRule({
4357
4543
  baseDir: this.baseDir,
4358
4544
  rulesyncRule,
4359
4545
  validate: true
4360
4546
  });
4361
4547
  case "cursor":
4548
+ if (!CursorRule.isTargetedByRulesyncRule(rulesyncRule)) {
4549
+ return null;
4550
+ }
4362
4551
  return CursorRule.fromRulesyncRule({
4363
4552
  baseDir: this.baseDir,
4364
4553
  rulesyncRule,
4365
4554
  validate: true
4366
4555
  });
4367
4556
  case "geminicli":
4557
+ if (!GeminiCliRule.isTargetedByRulesyncRule(rulesyncRule)) {
4558
+ return null;
4559
+ }
4368
4560
  return GeminiCliRule.fromRulesyncRule({
4369
4561
  baseDir: this.baseDir,
4370
4562
  rulesyncRule,
4371
4563
  validate: true
4372
4564
  });
4373
4565
  case "junie":
4566
+ if (!JunieRule.isTargetedByRulesyncRule(rulesyncRule)) {
4567
+ return null;
4568
+ }
4374
4569
  return JunieRule.fromRulesyncRule({
4375
4570
  baseDir: this.baseDir,
4376
4571
  rulesyncRule,
4377
4572
  validate: true
4378
4573
  });
4379
4574
  case "kiro":
4575
+ if (!KiroRule.isTargetedByRulesyncRule(rulesyncRule)) {
4576
+ return null;
4577
+ }
4380
4578
  return KiroRule.fromRulesyncRule({
4381
4579
  baseDir: this.baseDir,
4382
4580
  rulesyncRule,
4383
4581
  validate: true
4384
4582
  });
4385
4583
  case "opencode":
4584
+ if (!OpenCodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
4585
+ return null;
4586
+ }
4386
4587
  return OpenCodeRule.fromRulesyncRule({
4387
4588
  baseDir: this.baseDir,
4388
4589
  rulesyncRule,
4389
4590
  validate: true
4390
4591
  });
4391
4592
  case "qwencode":
4593
+ if (!QwencodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
4594
+ return null;
4595
+ }
4392
4596
  return QwencodeRule.fromRulesyncRule({
4393
4597
  baseDir: this.baseDir,
4394
4598
  rulesyncRule,
4395
4599
  validate: true
4396
4600
  });
4397
4601
  case "roo":
4602
+ if (!RooRule.isTargetedByRulesyncRule(rulesyncRule)) {
4603
+ return null;
4604
+ }
4398
4605
  return RooRule.fromRulesyncRule({
4399
4606
  baseDir: this.baseDir,
4400
4607
  rulesyncRule,
4401
4608
  validate: true
4402
4609
  });
4403
4610
  case "warp":
4611
+ if (!WarpRule.isTargetedByRulesyncRule(rulesyncRule)) {
4612
+ return null;
4613
+ }
4404
4614
  return WarpRule.fromRulesyncRule({
4405
4615
  baseDir: this.baseDir,
4406
4616
  rulesyncRule,
4407
4617
  validate: true
4408
4618
  });
4409
4619
  case "windsurf":
4620
+ if (!WindsurfRule.isTargetedByRulesyncRule(rulesyncRule)) {
4621
+ return null;
4622
+ }
4410
4623
  return WindsurfRule.fromRulesyncRule({
4411
4624
  baseDir: this.baseDir,
4412
4625
  rulesyncRule,
@@ -4415,7 +4628,7 @@ var RulesProcessor = class extends FeatureProcessor {
4415
4628
  default:
4416
4629
  throw new Error(`Unsupported tool target: ${this.toolTarget}`);
4417
4630
  }
4418
- });
4631
+ }).filter((rule) => rule !== null);
4419
4632
  if (this.toolTarget === "cursor" && (this.simulateCommands || this.simulateSubagents)) {
4420
4633
  toolRules.push(
4421
4634
  new CursorRule({
@@ -5005,22 +5218,22 @@ When users call a simulated subagent, it will look for the corresponding markdow
5005
5218
 
5006
5219
  // src/subagents/subagents-processor.ts
5007
5220
  var import_node_path53 = require("path");
5008
- var import_mini21 = require("zod/mini");
5221
+ var import_mini20 = require("zod/mini");
5009
5222
 
5010
5223
  // src/subagents/claudecode-subagent.ts
5011
5224
  var import_node_path52 = require("path");
5012
- var import_mini20 = require("zod/mini");
5225
+ var import_mini19 = require("zod/mini");
5013
5226
 
5014
5227
  // src/subagents/rulesync-subagent.ts
5015
5228
  var import_node_path51 = require("path");
5016
- var import_mini19 = require("zod/mini");
5017
- var RulesyncSubagentModelSchema = import_mini19.z.enum(["opus", "sonnet", "haiku", "inherit"]);
5018
- var RulesyncSubagentFrontmatterSchema = import_mini19.z.object({
5229
+ var import_mini18 = require("zod/mini");
5230
+ var RulesyncSubagentModelSchema = import_mini18.z.enum(["opus", "sonnet", "haiku", "inherit"]);
5231
+ var RulesyncSubagentFrontmatterSchema = import_mini18.z.object({
5019
5232
  targets: RulesyncTargetsSchema,
5020
- name: import_mini19.z.string(),
5021
- description: import_mini19.z.string(),
5022
- claudecode: import_mini19.z.optional(
5023
- import_mini19.z.object({
5233
+ name: import_mini18.z.string(),
5234
+ description: import_mini18.z.string(),
5235
+ claudecode: import_mini18.z.optional(
5236
+ import_mini18.z.object({
5024
5237
  model: RulesyncSubagentModelSchema
5025
5238
  })
5026
5239
  )
@@ -5085,10 +5298,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
5085
5298
  };
5086
5299
 
5087
5300
  // src/subagents/claudecode-subagent.ts
5088
- var ClaudecodeSubagentFrontmatterSchema = import_mini20.z.object({
5089
- name: import_mini20.z.string(),
5090
- description: import_mini20.z.string(),
5091
- model: import_mini20.z.optional(import_mini20.z.enum(["opus", "sonnet", "haiku", "inherit"]))
5301
+ var ClaudecodeSubagentFrontmatterSchema = import_mini19.z.object({
5302
+ name: import_mini19.z.string(),
5303
+ description: import_mini19.z.string(),
5304
+ model: import_mini19.z.optional(import_mini19.z.enum(["opus", "sonnet", "haiku", "inherit"]))
5092
5305
  });
5093
5306
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5094
5307
  frontmatter;
@@ -5173,6 +5386,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5173
5386
  return { success: false, error: result.error };
5174
5387
  }
5175
5388
  }
5389
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
5390
+ return this.isTargetedByRulesyncSubagentDefault({
5391
+ rulesyncSubagent,
5392
+ toolTarget: "claudecode"
5393
+ });
5394
+ }
5176
5395
  static async fromFile({
5177
5396
  baseDir = ".",
5178
5397
  relativeFilePath,
@@ -5208,7 +5427,7 @@ var subagentsProcessorToolTargetsSimulated = [
5208
5427
  "cursor",
5209
5428
  "codexcli"
5210
5429
  ];
5211
- var SubagentsProcessorToolTargetSchema = import_mini21.z.enum(subagentsProcessorToolTargets);
5430
+ var SubagentsProcessorToolTargetSchema = import_mini20.z.enum(subagentsProcessorToolTargets);
5212
5431
  var SubagentsProcessor = class extends FeatureProcessor {
5213
5432
  toolTarget;
5214
5433
  constructor({
@@ -5225,24 +5444,36 @@ var SubagentsProcessor = class extends FeatureProcessor {
5225
5444
  const toolSubagents = rulesyncSubagents.map((rulesyncSubagent) => {
5226
5445
  switch (this.toolTarget) {
5227
5446
  case "claudecode":
5447
+ if (!ClaudecodeSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
5448
+ return null;
5449
+ }
5228
5450
  return ClaudecodeSubagent.fromRulesyncSubagent({
5229
5451
  baseDir: this.baseDir,
5230
5452
  relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
5231
5453
  rulesyncSubagent
5232
5454
  });
5233
5455
  case "copilot":
5456
+ if (!CopilotSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
5457
+ return null;
5458
+ }
5234
5459
  return CopilotSubagent.fromRulesyncSubagent({
5235
5460
  baseDir: this.baseDir,
5236
5461
  relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
5237
5462
  rulesyncSubagent
5238
5463
  });
5239
5464
  case "cursor":
5465
+ if (!CursorSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
5466
+ return null;
5467
+ }
5240
5468
  return CursorSubagent.fromRulesyncSubagent({
5241
5469
  baseDir: this.baseDir,
5242
5470
  relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
5243
5471
  rulesyncSubagent
5244
5472
  });
5245
5473
  case "codexcli":
5474
+ if (!CodexCliSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
5475
+ return null;
5476
+ }
5246
5477
  return CodexCliSubagent.fromRulesyncSubagent({
5247
5478
  baseDir: this.baseDir,
5248
5479
  relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
@@ -5251,7 +5482,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
5251
5482
  default:
5252
5483
  throw new Error(`Unsupported tool target: ${this.toolTarget}`);
5253
5484
  }
5254
- });
5485
+ }).filter((subagent) => subagent !== null);
5255
5486
  return toolSubagents;
5256
5487
  }
5257
5488
  async convertToolFilesToRulesyncFiles(toolFiles) {
@@ -5558,7 +5789,7 @@ async function generateCommand(options) {
5558
5789
  const parts = [];
5559
5790
  if (totalRulesOutputs > 0) parts.push(`${totalRulesOutputs} rules`);
5560
5791
  if (totalIgnoreOutputs > 0) parts.push(`${totalIgnoreOutputs} ignore files`);
5561
- if (totalMcpOutputs > 0) parts.push(`${totalMcpOutputs} MCPs`);
5792
+ if (totalMcpOutputs > 0) parts.push(`${totalMcpOutputs} MCP files`);
5562
5793
  if (totalCommandOutputs > 0) parts.push(`${totalCommandOutputs} commands`);
5563
5794
  if (totalSubagentOutputs > 0) parts.push(`${totalSubagentOutputs} subagents`);
5564
5795
  logger.success(`\u{1F389} All done! Generated ${totalGenerated} file(s) total (${parts.join(" + ")})`);
@@ -5829,7 +6060,7 @@ var getVersion = async () => {
5829
6060
  const packageJson = await readJsonFile(packageJsonPath);
5830
6061
  return packageJson.version;
5831
6062
  } catch {
5832
- return "0.74.0";
6063
+ return "0.75.0";
5833
6064
  }
5834
6065
  };
5835
6066
  var main = async () => {
@@ -5851,7 +6082,7 @@ var main = async () => {
5851
6082
  }
5852
6083
  ).option(
5853
6084
  "-f, --features <features>",
5854
- `Comma-separated list of features to import (${FEATURE_TYPES.join(",")}) or '*' for all`,
6085
+ `Comma-separated list of features to import (${ALL_FEATURES.join(",")}) or '*' for all`,
5855
6086
  (value) => {
5856
6087
  return value.split(",").map((f) => f.trim());
5857
6088
  }
@@ -5876,7 +6107,7 @@ var main = async () => {
5876
6107
  }
5877
6108
  ).option(
5878
6109
  "-f, --features <features>",
5879
- `Comma-separated list of features to generate (${FEATURE_TYPES.join(",")}) or '*' for all`,
6110
+ `Comma-separated list of features to generate (${ALL_FEATURES.join(",")}) or '*' for all`,
5880
6111
  (value) => {
5881
6112
  return value.split(",").map((f) => f.trim());
5882
6113
  }