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.
- package/dist/index.cjs +426 -195
- package/dist/index.js +426 -195
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,98 +8,13 @@ import { Command } from "commander";
|
|
|
8
8
|
// src/constants/announcements.ts
|
|
9
9
|
var ANNOUNCEMENT = "".trim();
|
|
10
10
|
|
|
11
|
-
// src/types/
|
|
12
|
-
import { z as z2 } from "zod/mini";
|
|
13
|
-
|
|
14
|
-
// src/types/tool-targets.ts
|
|
11
|
+
// src/types/features.ts
|
|
15
12
|
import { z } from "zod/mini";
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"copilot",
|
|
22
|
-
"cursor",
|
|
23
|
-
"cline",
|
|
24
|
-
"claudecode",
|
|
25
|
-
"codexcli",
|
|
26
|
-
"opencode",
|
|
27
|
-
"qwencode",
|
|
28
|
-
"roo",
|
|
29
|
-
"geminicli",
|
|
30
|
-
"kiro",
|
|
31
|
-
"junie",
|
|
32
|
-
"warp",
|
|
33
|
-
"windsurf"
|
|
34
|
-
];
|
|
35
|
-
var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
|
|
36
|
-
var ToolTargetSchema = z.enum(ALL_TOOL_TARGETS);
|
|
37
|
-
var ToolTargetsSchema = z.array(ToolTargetSchema);
|
|
38
|
-
var RulesyncTargetsSchema = z.array(z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
|
|
39
|
-
|
|
40
|
-
// src/types/config-options.ts
|
|
41
|
-
var FEATURE_TYPES = ["rules", "commands", "mcp", "ignore", "subagents"];
|
|
42
|
-
var FeatureTypeSchema = z2.enum(FEATURE_TYPES);
|
|
43
|
-
var FeaturesSchema = z2.union([z2.array(FeatureTypeSchema), z2.literal("*")]);
|
|
44
|
-
var OutputPathsSchema = z2.object({
|
|
45
|
-
agentsmd: z2.optional(z2.string()),
|
|
46
|
-
amazonqcli: z2.optional(z2.string()),
|
|
47
|
-
augmentcode: z2.optional(z2.string()),
|
|
48
|
-
"augmentcode-legacy": z2.optional(z2.string()),
|
|
49
|
-
copilot: z2.optional(z2.string()),
|
|
50
|
-
cursor: z2.optional(z2.string()),
|
|
51
|
-
cline: z2.optional(z2.string()),
|
|
52
|
-
claudecode: z2.optional(z2.string()),
|
|
53
|
-
codexcli: z2.optional(z2.string()),
|
|
54
|
-
opencode: z2.optional(z2.string()),
|
|
55
|
-
qwencode: z2.optional(z2.string()),
|
|
56
|
-
roo: z2.optional(z2.string()),
|
|
57
|
-
geminicli: z2.optional(z2.string()),
|
|
58
|
-
kiro: z2.optional(z2.string()),
|
|
59
|
-
junie: z2.optional(z2.string()),
|
|
60
|
-
windsurf: z2.optional(z2.string())
|
|
61
|
-
});
|
|
62
|
-
var ConfigOptionsSchema = z2.object({
|
|
63
|
-
aiRulesDir: z2.optional(z2.string()),
|
|
64
|
-
outputPaths: z2.optional(OutputPathsSchema),
|
|
65
|
-
watchEnabled: z2.optional(z2.boolean()),
|
|
66
|
-
defaultTargets: z2.optional(ToolTargetsSchema),
|
|
67
|
-
targets: z2.optional(z2.array(ToolTargetSchema)),
|
|
68
|
-
exclude: z2.optional(z2.array(ToolTargetSchema)),
|
|
69
|
-
features: z2.optional(FeaturesSchema),
|
|
70
|
-
verbose: z2.optional(z2.boolean()),
|
|
71
|
-
delete: z2.optional(z2.boolean()),
|
|
72
|
-
baseDir: z2.optional(z2.union([z2.string(), z2.array(z2.string())])),
|
|
73
|
-
legacy: z2.optional(z2.boolean()),
|
|
74
|
-
watch: z2.optional(
|
|
75
|
-
z2.object({
|
|
76
|
-
enabled: z2.optional(z2.boolean()),
|
|
77
|
-
interval: z2.optional(z2.number()),
|
|
78
|
-
ignore: z2.optional(z2.array(z2.string()))
|
|
79
|
-
})
|
|
80
|
-
)
|
|
81
|
-
});
|
|
82
|
-
var MergedConfigSchema = z2.object({
|
|
83
|
-
aiRulesDir: z2.string(),
|
|
84
|
-
outputPaths: z2.record(ToolTargetSchema, z2.string()),
|
|
85
|
-
watchEnabled: z2.boolean(),
|
|
86
|
-
defaultTargets: ToolTargetsSchema,
|
|
87
|
-
targets: z2.optional(z2.array(ToolTargetSchema)),
|
|
88
|
-
exclude: z2.optional(z2.array(ToolTargetSchema)),
|
|
89
|
-
features: z2.optional(FeaturesSchema),
|
|
90
|
-
verbose: z2.optional(z2.boolean()),
|
|
91
|
-
delete: z2.optional(z2.boolean()),
|
|
92
|
-
baseDir: z2.optional(z2.union([z2.string(), z2.array(z2.string())])),
|
|
93
|
-
configPath: z2.optional(z2.string()),
|
|
94
|
-
legacy: z2.optional(z2.boolean()),
|
|
95
|
-
watch: z2.optional(
|
|
96
|
-
z2.object({
|
|
97
|
-
enabled: z2.optional(z2.boolean()),
|
|
98
|
-
interval: z2.optional(z2.number()),
|
|
99
|
-
ignore: z2.optional(z2.array(z2.string()))
|
|
100
|
-
})
|
|
101
|
-
)
|
|
102
|
-
});
|
|
13
|
+
var ALL_FEATURES = ["rules", "ignore", "mcp", "subagents", "commands"];
|
|
14
|
+
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
15
|
+
var FeatureSchema = z.enum(ALL_FEATURES);
|
|
16
|
+
var FeaturesSchema = z.array(FeatureSchema);
|
|
17
|
+
var RulesyncFeaturesSchema = z.array(z.enum(ALL_FEATURES_WITH_WILDCARD));
|
|
103
18
|
|
|
104
19
|
// src/utils/file.ts
|
|
105
20
|
import { globSync } from "fs";
|
|
@@ -407,6 +322,32 @@ var RulesyncFile = class extends AiFile {
|
|
|
407
322
|
}
|
|
408
323
|
};
|
|
409
324
|
|
|
325
|
+
// src/types/tool-targets.ts
|
|
326
|
+
import { z as z2 } from "zod/mini";
|
|
327
|
+
var ALL_TOOL_TARGETS = [
|
|
328
|
+
"agentsmd",
|
|
329
|
+
"amazonqcli",
|
|
330
|
+
"augmentcode",
|
|
331
|
+
"augmentcode-legacy",
|
|
332
|
+
"copilot",
|
|
333
|
+
"cursor",
|
|
334
|
+
"cline",
|
|
335
|
+
"claudecode",
|
|
336
|
+
"codexcli",
|
|
337
|
+
"opencode",
|
|
338
|
+
"qwencode",
|
|
339
|
+
"roo",
|
|
340
|
+
"geminicli",
|
|
341
|
+
"kiro",
|
|
342
|
+
"junie",
|
|
343
|
+
"warp",
|
|
344
|
+
"windsurf"
|
|
345
|
+
];
|
|
346
|
+
var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
|
|
347
|
+
var ToolTargetSchema = z2.enum(ALL_TOOL_TARGETS);
|
|
348
|
+
var ToolTargetsSchema = z2.array(ToolTargetSchema);
|
|
349
|
+
var RulesyncTargetsSchema = z2.array(z2.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
|
|
350
|
+
|
|
410
351
|
// src/commands/rulesync-command.ts
|
|
411
352
|
var RulesyncCommandFrontmatterSchema = z3.object({
|
|
412
353
|
targets: RulesyncTargetsSchema,
|
|
@@ -509,6 +450,39 @@ var ToolCommand = class extends AiFile {
|
|
|
509
450
|
static fromRulesyncCommand(_params) {
|
|
510
451
|
throw new Error("Please implement this method in the subclass.");
|
|
511
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* Check if this tool is targeted by a RulesyncCommand based on its targets field.
|
|
455
|
+
* Subclasses should override this to provide specific targeting logic.
|
|
456
|
+
*
|
|
457
|
+
* @param rulesyncCommand - The RulesyncCommand to check
|
|
458
|
+
* @returns True if this tool is targeted by the command
|
|
459
|
+
*/
|
|
460
|
+
static isTargetedByRulesyncCommand(_rulesyncCommand) {
|
|
461
|
+
throw new Error("Please implement this method in the subclass.");
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Default implementation for checking if a tool is targeted by a RulesyncCommand.
|
|
465
|
+
* Checks if the command's targets include the tool target or a wildcard.
|
|
466
|
+
*
|
|
467
|
+
* @param params - Parameters including the RulesyncCommand and tool target
|
|
468
|
+
* @returns True if the tool target is included in the command's targets
|
|
469
|
+
*/
|
|
470
|
+
static isTargetedByRulesyncCommandDefault({
|
|
471
|
+
rulesyncCommand,
|
|
472
|
+
toolTarget
|
|
473
|
+
}) {
|
|
474
|
+
const targets = rulesyncCommand.getFrontmatter().targets;
|
|
475
|
+
if (!targets) {
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
if (targets.includes("*")) {
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
if (targets.includes(toolTarget)) {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
512
486
|
};
|
|
513
487
|
|
|
514
488
|
// src/commands/claudecode-command.ts
|
|
@@ -589,6 +563,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
589
563
|
return { success: false, error: result.error };
|
|
590
564
|
}
|
|
591
565
|
}
|
|
566
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
567
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
568
|
+
rulesyncCommand,
|
|
569
|
+
toolTarget: "claudecode"
|
|
570
|
+
});
|
|
571
|
+
}
|
|
592
572
|
static async fromFile({
|
|
593
573
|
baseDir = ".",
|
|
594
574
|
relativeFilePath,
|
|
@@ -749,6 +729,12 @@ var CodexCliCommand = class _CodexCliCommand extends SimulatedCommand {
|
|
|
749
729
|
validate
|
|
750
730
|
});
|
|
751
731
|
}
|
|
732
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
733
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
734
|
+
rulesyncCommand,
|
|
735
|
+
toolTarget: "codexcli"
|
|
736
|
+
});
|
|
737
|
+
}
|
|
752
738
|
};
|
|
753
739
|
|
|
754
740
|
// src/commands/copilot-command.ts
|
|
@@ -793,6 +779,12 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
793
779
|
validate
|
|
794
780
|
});
|
|
795
781
|
}
|
|
782
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
783
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
784
|
+
rulesyncCommand,
|
|
785
|
+
toolTarget: "copilot"
|
|
786
|
+
});
|
|
787
|
+
}
|
|
796
788
|
};
|
|
797
789
|
|
|
798
790
|
// src/commands/cursor-command.ts
|
|
@@ -837,6 +829,12 @@ var CursorCommand = class _CursorCommand extends SimulatedCommand {
|
|
|
837
829
|
validate
|
|
838
830
|
});
|
|
839
831
|
}
|
|
832
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
833
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
834
|
+
rulesyncCommand,
|
|
835
|
+
toolTarget: "cursor"
|
|
836
|
+
});
|
|
837
|
+
}
|
|
840
838
|
};
|
|
841
839
|
|
|
842
840
|
// src/commands/geminicli-command.ts
|
|
@@ -873,17 +871,6 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
873
871
|
throw new Error(`Failed to parse TOML command file: ${error}`);
|
|
874
872
|
}
|
|
875
873
|
}
|
|
876
|
-
parseCommandFile(content) {
|
|
877
|
-
const parsed = this.parseTomlContent(content);
|
|
878
|
-
return {
|
|
879
|
-
filename: "unknown.toml",
|
|
880
|
-
filepath: "unknown.toml",
|
|
881
|
-
frontmatter: {
|
|
882
|
-
description: parsed.description
|
|
883
|
-
},
|
|
884
|
-
content: parsed.prompt
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
874
|
getBody() {
|
|
888
875
|
return this.body;
|
|
889
876
|
}
|
|
@@ -958,6 +945,12 @@ ${geminiFrontmatter.prompt}
|
|
|
958
945
|
return { success: false, error: error instanceof Error ? error : new Error(String(error)) };
|
|
959
946
|
}
|
|
960
947
|
}
|
|
948
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
949
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
950
|
+
rulesyncCommand,
|
|
951
|
+
toolTarget: "geminicli"
|
|
952
|
+
});
|
|
953
|
+
}
|
|
961
954
|
};
|
|
962
955
|
|
|
963
956
|
// src/commands/roo-command.ts
|
|
@@ -1043,6 +1036,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1043
1036
|
return { success: false, error: result.error };
|
|
1044
1037
|
}
|
|
1045
1038
|
}
|
|
1039
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1040
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
1041
|
+
rulesyncCommand,
|
|
1042
|
+
toolTarget: "roo"
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1046
1045
|
static async fromFile({
|
|
1047
1046
|
baseDir = ".",
|
|
1048
1047
|
relativeFilePath,
|
|
@@ -1094,31 +1093,49 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1094
1093
|
const toolCommands = rulesyncCommands.map((rulesyncCommand) => {
|
|
1095
1094
|
switch (this.toolTarget) {
|
|
1096
1095
|
case "claudecode":
|
|
1096
|
+
if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1097
|
+
return null;
|
|
1098
|
+
}
|
|
1097
1099
|
return ClaudecodeCommand.fromRulesyncCommand({
|
|
1098
1100
|
baseDir: this.baseDir,
|
|
1099
1101
|
rulesyncCommand
|
|
1100
1102
|
});
|
|
1101
1103
|
case "geminicli":
|
|
1104
|
+
if (!GeminiCliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1105
|
+
return null;
|
|
1106
|
+
}
|
|
1102
1107
|
return GeminiCliCommand.fromRulesyncCommand({
|
|
1103
1108
|
baseDir: this.baseDir,
|
|
1104
1109
|
rulesyncCommand
|
|
1105
1110
|
});
|
|
1106
1111
|
case "roo":
|
|
1112
|
+
if (!RooCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1113
|
+
return null;
|
|
1114
|
+
}
|
|
1107
1115
|
return RooCommand.fromRulesyncCommand({
|
|
1108
1116
|
baseDir: this.baseDir,
|
|
1109
1117
|
rulesyncCommand
|
|
1110
1118
|
});
|
|
1111
1119
|
case "copilot":
|
|
1120
|
+
if (!CopilotCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1121
|
+
return null;
|
|
1122
|
+
}
|
|
1112
1123
|
return CopilotCommand.fromRulesyncCommand({
|
|
1113
1124
|
baseDir: this.baseDir,
|
|
1114
1125
|
rulesyncCommand
|
|
1115
1126
|
});
|
|
1116
1127
|
case "cursor":
|
|
1128
|
+
if (!CursorCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1129
|
+
return null;
|
|
1130
|
+
}
|
|
1117
1131
|
return CursorCommand.fromRulesyncCommand({
|
|
1118
1132
|
baseDir: this.baseDir,
|
|
1119
1133
|
rulesyncCommand
|
|
1120
1134
|
});
|
|
1121
1135
|
case "codexcli":
|
|
1136
|
+
if (!CodexCliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1137
|
+
return null;
|
|
1138
|
+
}
|
|
1122
1139
|
return CodexCliCommand.fromRulesyncCommand({
|
|
1123
1140
|
baseDir: this.baseDir,
|
|
1124
1141
|
rulesyncCommand
|
|
@@ -1126,7 +1143,9 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1126
1143
|
default:
|
|
1127
1144
|
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
1128
1145
|
}
|
|
1129
|
-
})
|
|
1146
|
+
}).filter(
|
|
1147
|
+
(command) => command !== null
|
|
1148
|
+
);
|
|
1130
1149
|
return toolCommands;
|
|
1131
1150
|
}
|
|
1132
1151
|
async convertToolFilesToRulesyncFiles(toolFiles) {
|
|
@@ -1286,14 +1305,6 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1286
1305
|
// src/config/config-resolver.ts
|
|
1287
1306
|
import { loadConfig } from "c12";
|
|
1288
1307
|
|
|
1289
|
-
// src/types/features.ts
|
|
1290
|
-
import { z as z9 } from "zod/mini";
|
|
1291
|
-
var ALL_FEATURES = ["rules", "ignore", "mcp", "subagents", "commands"];
|
|
1292
|
-
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
1293
|
-
var FeatureSchema = z9.enum(ALL_FEATURES);
|
|
1294
|
-
var FeaturesSchema2 = z9.array(FeatureSchema);
|
|
1295
|
-
var RulesyncFeaturesSchema = z9.array(z9.enum(ALL_FEATURES_WITH_WILDCARD));
|
|
1296
|
-
|
|
1297
1308
|
// src/config/config.ts
|
|
1298
1309
|
var Config = class {
|
|
1299
1310
|
baseDirs;
|
|
@@ -1408,7 +1419,7 @@ var ConfigResolver = class {
|
|
|
1408
1419
|
};
|
|
1409
1420
|
|
|
1410
1421
|
// src/ignore/ignore-processor.ts
|
|
1411
|
-
import { z as
|
|
1422
|
+
import { z as z9 } from "zod/mini";
|
|
1412
1423
|
|
|
1413
1424
|
// src/ignore/amazonqcli-ignore.ts
|
|
1414
1425
|
import { join as join11 } from "path";
|
|
@@ -2020,7 +2031,7 @@ var ignoreProcessorToolTargets = [
|
|
|
2020
2031
|
"roo",
|
|
2021
2032
|
"windsurf"
|
|
2022
2033
|
];
|
|
2023
|
-
var IgnoreProcessorToolTargetSchema =
|
|
2034
|
+
var IgnoreProcessorToolTargetSchema = z9.enum(ignoreProcessorToolTargets);
|
|
2024
2035
|
var IgnoreProcessor = class extends FeatureProcessor {
|
|
2025
2036
|
toolTarget;
|
|
2026
2037
|
constructor({
|
|
@@ -2182,47 +2193,40 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2182
2193
|
};
|
|
2183
2194
|
|
|
2184
2195
|
// src/mcp/mcp-processor.ts
|
|
2185
|
-
import { z as
|
|
2196
|
+
import { z as z11 } from "zod/mini";
|
|
2186
2197
|
|
|
2187
2198
|
// src/mcp/amazonqcli-mcp.ts
|
|
2188
2199
|
import { join as join23 } from "path";
|
|
2189
2200
|
|
|
2190
2201
|
// src/mcp/rulesync-mcp.ts
|
|
2191
2202
|
import { join as join22 } from "path";
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
kiroAutoBlock: z11.optional(z11.array(z11.string())),
|
|
2213
|
-
headers: z11.optional(z11.record(z11.string(), z11.string()))
|
|
2214
|
-
});
|
|
2215
|
-
var RulesyncMcpServerSchema = z11.extend(McpServerBaseSchema, {
|
|
2216
|
-
targets: z11.optional(RulesyncTargetsSchema)
|
|
2203
|
+
import { z as z10 } from "zod/mini";
|
|
2204
|
+
var McpTransportTypeSchema = z10.enum(["stdio", "sse", "http"]);
|
|
2205
|
+
var McpServerBaseSchema = z10.object({
|
|
2206
|
+
type: z10.optional(z10.enum(["stdio", "sse", "http"])),
|
|
2207
|
+
command: z10.optional(z10.union([z10.string(), z10.array(z10.string())])),
|
|
2208
|
+
args: z10.optional(z10.array(z10.string())),
|
|
2209
|
+
url: z10.optional(z10.string()),
|
|
2210
|
+
httpUrl: z10.optional(z10.string()),
|
|
2211
|
+
env: z10.optional(z10.record(z10.string(), z10.string())),
|
|
2212
|
+
disabled: z10.optional(z10.boolean()),
|
|
2213
|
+
networkTimeout: z10.optional(z10.number()),
|
|
2214
|
+
timeout: z10.optional(z10.number()),
|
|
2215
|
+
trust: z10.optional(z10.boolean()),
|
|
2216
|
+
cwd: z10.optional(z10.string()),
|
|
2217
|
+
transport: z10.optional(McpTransportTypeSchema),
|
|
2218
|
+
alwaysAllow: z10.optional(z10.array(z10.string())),
|
|
2219
|
+
tools: z10.optional(z10.array(z10.string())),
|
|
2220
|
+
kiroAutoApprove: z10.optional(z10.array(z10.string())),
|
|
2221
|
+
kiroAutoBlock: z10.optional(z10.array(z10.string())),
|
|
2222
|
+
headers: z10.optional(z10.record(z10.string(), z10.string()))
|
|
2217
2223
|
});
|
|
2218
|
-
var
|
|
2219
|
-
|
|
2224
|
+
var RulesyncMcpServerSchema = z10.extend(McpServerBaseSchema, {
|
|
2225
|
+
targets: z10.optional(RulesyncTargetsSchema)
|
|
2220
2226
|
});
|
|
2221
|
-
var RulesyncMcpConfigSchema =
|
|
2222
|
-
mcpServers:
|
|
2227
|
+
var RulesyncMcpConfigSchema = z10.object({
|
|
2228
|
+
mcpServers: z10.record(z10.string(), RulesyncMcpServerSchema)
|
|
2223
2229
|
});
|
|
2224
|
-
|
|
2225
|
-
// src/mcp/rulesync-mcp.ts
|
|
2226
2230
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2227
2231
|
json;
|
|
2228
2232
|
constructor({ ...rest }) {
|
|
@@ -2614,7 +2618,7 @@ var mcpProcessorToolTargets = [
|
|
|
2614
2618
|
"cursor",
|
|
2615
2619
|
"roo"
|
|
2616
2620
|
];
|
|
2617
|
-
var McpProcessorToolTargetSchema =
|
|
2621
|
+
var McpProcessorToolTargetSchema = z11.enum(mcpProcessorToolTargets);
|
|
2618
2622
|
var McpProcessor = class extends FeatureProcessor {
|
|
2619
2623
|
toolTarget;
|
|
2620
2624
|
constructor({
|
|
@@ -2775,7 +2779,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2775
2779
|
// src/rules/rules-processor.ts
|
|
2776
2780
|
import { basename as basename14, join as join49 } from "path";
|
|
2777
2781
|
import { XMLBuilder } from "fast-xml-parser";
|
|
2778
|
-
import { z as
|
|
2782
|
+
import { z as z17 } from "zod/mini";
|
|
2779
2783
|
|
|
2780
2784
|
// src/constants/paths.ts
|
|
2781
2785
|
import { join as join29 } from "path";
|
|
@@ -2787,7 +2791,7 @@ var RULESYNC_SUBAGENTS_DIR = join29(".rulesync", "subagents");
|
|
|
2787
2791
|
|
|
2788
2792
|
// src/subagents/simulated-subagent.ts
|
|
2789
2793
|
import { basename as basename11, join as join30 } from "path";
|
|
2790
|
-
import { z as
|
|
2794
|
+
import { z as z12 } from "zod/mini";
|
|
2791
2795
|
|
|
2792
2796
|
// src/subagents/tool-subagent.ts
|
|
2793
2797
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -2800,12 +2804,31 @@ var ToolSubagent = class extends ToolFile {
|
|
|
2800
2804
|
static fromRulesyncSubagent(_params) {
|
|
2801
2805
|
throw new Error("Please implement this method in the subclass.");
|
|
2802
2806
|
}
|
|
2807
|
+
static isTargetedByRulesyncSubagent(_rulesyncSubagent) {
|
|
2808
|
+
throw new Error("Please implement this method in the subclass.");
|
|
2809
|
+
}
|
|
2810
|
+
static isTargetedByRulesyncSubagentDefault({
|
|
2811
|
+
rulesyncSubagent,
|
|
2812
|
+
toolTarget
|
|
2813
|
+
}) {
|
|
2814
|
+
const targets = rulesyncSubagent.getFrontmatter().targets;
|
|
2815
|
+
if (!targets) {
|
|
2816
|
+
return true;
|
|
2817
|
+
}
|
|
2818
|
+
if (targets.includes("*")) {
|
|
2819
|
+
return true;
|
|
2820
|
+
}
|
|
2821
|
+
if (targets.includes(toolTarget)) {
|
|
2822
|
+
return true;
|
|
2823
|
+
}
|
|
2824
|
+
return false;
|
|
2825
|
+
}
|
|
2803
2826
|
};
|
|
2804
2827
|
|
|
2805
2828
|
// src/subagents/simulated-subagent.ts
|
|
2806
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
2807
|
-
name:
|
|
2808
|
-
description:
|
|
2829
|
+
var SimulatedSubagentFrontmatterSchema = z12.object({
|
|
2830
|
+
name: z12.string(),
|
|
2831
|
+
description: z12.string()
|
|
2809
2832
|
});
|
|
2810
2833
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
2811
2834
|
frontmatter;
|
|
@@ -2902,6 +2925,12 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
2902
2925
|
const baseParams = this.fromRulesyncSubagentDefault(params);
|
|
2903
2926
|
return new _CodexCliSubagent(baseParams);
|
|
2904
2927
|
}
|
|
2928
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
2929
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
2930
|
+
rulesyncSubagent,
|
|
2931
|
+
toolTarget: "codexcli"
|
|
2932
|
+
});
|
|
2933
|
+
}
|
|
2905
2934
|
};
|
|
2906
2935
|
|
|
2907
2936
|
// src/subagents/copilot-subagent.ts
|
|
@@ -2919,6 +2948,12 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
|
2919
2948
|
const baseParams = this.fromRulesyncSubagentDefault(params);
|
|
2920
2949
|
return new _CopilotSubagent(baseParams);
|
|
2921
2950
|
}
|
|
2951
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
2952
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
2953
|
+
rulesyncSubagent,
|
|
2954
|
+
toolTarget: "copilot"
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2922
2957
|
};
|
|
2923
2958
|
|
|
2924
2959
|
// src/subagents/cursor-subagent.ts
|
|
@@ -2936,6 +2971,12 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
2936
2971
|
const baseParams = this.fromRulesyncSubagentDefault(params);
|
|
2937
2972
|
return new _CursorSubagent(baseParams);
|
|
2938
2973
|
}
|
|
2974
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
2975
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
2976
|
+
rulesyncSubagent,
|
|
2977
|
+
toolTarget: "cursor"
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2939
2980
|
};
|
|
2940
2981
|
|
|
2941
2982
|
// src/rules/agentsmd-rule.ts
|
|
@@ -2943,17 +2984,17 @@ import { join as join32 } from "path";
|
|
|
2943
2984
|
|
|
2944
2985
|
// src/rules/rulesync-rule.ts
|
|
2945
2986
|
import { basename as basename12, join as join31 } from "path";
|
|
2946
|
-
import { z as
|
|
2947
|
-
var RulesyncRuleFrontmatterSchema =
|
|
2948
|
-
root:
|
|
2949
|
-
targets:
|
|
2950
|
-
description:
|
|
2951
|
-
globs:
|
|
2952
|
-
cursor:
|
|
2953
|
-
|
|
2954
|
-
alwaysApply:
|
|
2955
|
-
description:
|
|
2956
|
-
globs:
|
|
2987
|
+
import { z as z13 } from "zod/mini";
|
|
2988
|
+
var RulesyncRuleFrontmatterSchema = z13.object({
|
|
2989
|
+
root: z13.optional(z13.optional(z13.boolean())),
|
|
2990
|
+
targets: z13.optional(RulesyncTargetsSchema),
|
|
2991
|
+
description: z13.optional(z13.string()),
|
|
2992
|
+
globs: z13.optional(z13.array(z13.string())),
|
|
2993
|
+
cursor: z13.optional(
|
|
2994
|
+
z13.object({
|
|
2995
|
+
alwaysApply: z13.optional(z13.boolean()),
|
|
2996
|
+
description: z13.optional(z13.string()),
|
|
2997
|
+
globs: z13.optional(z13.array(z13.string()))
|
|
2957
2998
|
})
|
|
2958
2999
|
)
|
|
2959
3000
|
});
|
|
@@ -3106,6 +3147,25 @@ var ToolRule = class extends ToolFile {
|
|
|
3106
3147
|
isRoot() {
|
|
3107
3148
|
return this.root;
|
|
3108
3149
|
}
|
|
3150
|
+
static isTargetedByRulesyncRule(_rulesyncRule) {
|
|
3151
|
+
throw new Error("Please implement this method in the subclass.");
|
|
3152
|
+
}
|
|
3153
|
+
static isTargetedByRulesyncRuleDefault({
|
|
3154
|
+
rulesyncRule,
|
|
3155
|
+
toolTarget
|
|
3156
|
+
}) {
|
|
3157
|
+
const targets = rulesyncRule.getFrontmatter().targets;
|
|
3158
|
+
if (!targets) {
|
|
3159
|
+
return true;
|
|
3160
|
+
}
|
|
3161
|
+
if (targets.includes("*")) {
|
|
3162
|
+
return true;
|
|
3163
|
+
}
|
|
3164
|
+
if (targets.includes(toolTarget)) {
|
|
3165
|
+
return true;
|
|
3166
|
+
}
|
|
3167
|
+
return false;
|
|
3168
|
+
}
|
|
3109
3169
|
};
|
|
3110
3170
|
|
|
3111
3171
|
// src/rules/agentsmd-rule.ts
|
|
@@ -3166,6 +3226,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3166
3226
|
validate() {
|
|
3167
3227
|
return { success: true, error: null };
|
|
3168
3228
|
}
|
|
3229
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3230
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3231
|
+
rulesyncRule,
|
|
3232
|
+
toolTarget: "agentsmd"
|
|
3233
|
+
});
|
|
3234
|
+
}
|
|
3169
3235
|
};
|
|
3170
3236
|
|
|
3171
3237
|
// src/rules/amazonqcli-rule.ts
|
|
@@ -3215,6 +3281,12 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3215
3281
|
validate() {
|
|
3216
3282
|
return { success: true, error: null };
|
|
3217
3283
|
}
|
|
3284
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3285
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3286
|
+
rulesyncRule,
|
|
3287
|
+
toolTarget: "amazonqcli"
|
|
3288
|
+
});
|
|
3289
|
+
}
|
|
3218
3290
|
};
|
|
3219
3291
|
|
|
3220
3292
|
// src/rules/augmentcode-legacy-rule.ts
|
|
@@ -3265,6 +3337,12 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3265
3337
|
validate() {
|
|
3266
3338
|
return { success: true, error: null };
|
|
3267
3339
|
}
|
|
3340
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3341
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3342
|
+
rulesyncRule,
|
|
3343
|
+
toolTarget: "augmentcode-legacy"
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3268
3346
|
static async fromFile({
|
|
3269
3347
|
baseDir = ".",
|
|
3270
3348
|
relativeFilePath,
|
|
@@ -3332,6 +3410,12 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3332
3410
|
validate() {
|
|
3333
3411
|
return { success: true, error: null };
|
|
3334
3412
|
}
|
|
3413
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3414
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3415
|
+
rulesyncRule,
|
|
3416
|
+
toolTarget: "augmentcode"
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3335
3419
|
};
|
|
3336
3420
|
|
|
3337
3421
|
// src/rules/claudecode-rule.ts
|
|
@@ -3386,13 +3470,19 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
3386
3470
|
validate() {
|
|
3387
3471
|
return { success: true, error: null };
|
|
3388
3472
|
}
|
|
3473
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3474
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3475
|
+
rulesyncRule,
|
|
3476
|
+
toolTarget: "claudecode"
|
|
3477
|
+
});
|
|
3478
|
+
}
|
|
3389
3479
|
};
|
|
3390
3480
|
|
|
3391
3481
|
// src/rules/cline-rule.ts
|
|
3392
3482
|
import { join as join37 } from "path";
|
|
3393
|
-
import { z as
|
|
3394
|
-
var ClineRuleFrontmatterSchema =
|
|
3395
|
-
description:
|
|
3483
|
+
import { z as z14 } from "zod/mini";
|
|
3484
|
+
var ClineRuleFrontmatterSchema = z14.object({
|
|
3485
|
+
description: z14.string()
|
|
3396
3486
|
});
|
|
3397
3487
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
3398
3488
|
static getSettablePaths() {
|
|
@@ -3422,6 +3512,12 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
3422
3512
|
validate() {
|
|
3423
3513
|
return { success: true, error: null };
|
|
3424
3514
|
}
|
|
3515
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3516
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3517
|
+
rulesyncRule,
|
|
3518
|
+
toolTarget: "cline"
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3425
3521
|
static async fromFile({
|
|
3426
3522
|
baseDir = ".",
|
|
3427
3523
|
relativeFilePath,
|
|
@@ -3492,14 +3588,20 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
3492
3588
|
validate() {
|
|
3493
3589
|
return { success: true, error: null };
|
|
3494
3590
|
}
|
|
3591
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3592
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3593
|
+
rulesyncRule,
|
|
3594
|
+
toolTarget: "codexcli"
|
|
3595
|
+
});
|
|
3596
|
+
}
|
|
3495
3597
|
};
|
|
3496
3598
|
|
|
3497
3599
|
// src/rules/copilot-rule.ts
|
|
3498
3600
|
import { join as join39 } from "path";
|
|
3499
|
-
import { z as
|
|
3500
|
-
var CopilotRuleFrontmatterSchema =
|
|
3501
|
-
description:
|
|
3502
|
-
applyTo:
|
|
3601
|
+
import { z as z15 } from "zod/mini";
|
|
3602
|
+
var CopilotRuleFrontmatterSchema = z15.object({
|
|
3603
|
+
description: z15.optional(z15.string()),
|
|
3604
|
+
applyTo: z15.optional(z15.string())
|
|
3503
3605
|
});
|
|
3504
3606
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
3505
3607
|
frontmatter;
|
|
@@ -3640,15 +3742,21 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
3640
3742
|
getBody() {
|
|
3641
3743
|
return this.body;
|
|
3642
3744
|
}
|
|
3745
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3746
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3747
|
+
rulesyncRule,
|
|
3748
|
+
toolTarget: "copilot"
|
|
3749
|
+
});
|
|
3750
|
+
}
|
|
3643
3751
|
};
|
|
3644
3752
|
|
|
3645
3753
|
// src/rules/cursor-rule.ts
|
|
3646
3754
|
import { basename as basename13, join as join40 } from "path";
|
|
3647
|
-
import { z as
|
|
3648
|
-
var CursorRuleFrontmatterSchema =
|
|
3649
|
-
description:
|
|
3650
|
-
globs:
|
|
3651
|
-
alwaysApply:
|
|
3755
|
+
import { z as z16 } from "zod/mini";
|
|
3756
|
+
var CursorRuleFrontmatterSchema = z16.object({
|
|
3757
|
+
description: z16.optional(z16.string()),
|
|
3758
|
+
globs: z16.optional(z16.string()),
|
|
3759
|
+
alwaysApply: z16.optional(z16.boolean())
|
|
3652
3760
|
});
|
|
3653
3761
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
3654
3762
|
frontmatter;
|
|
@@ -3808,6 +3916,12 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
3808
3916
|
getBody() {
|
|
3809
3917
|
return this.body;
|
|
3810
3918
|
}
|
|
3919
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3920
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3921
|
+
rulesyncRule,
|
|
3922
|
+
toolTarget: "cursor"
|
|
3923
|
+
});
|
|
3924
|
+
}
|
|
3811
3925
|
};
|
|
3812
3926
|
|
|
3813
3927
|
// src/rules/geminicli-rule.ts
|
|
@@ -3862,6 +3976,12 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
3862
3976
|
validate() {
|
|
3863
3977
|
return { success: true, error: null };
|
|
3864
3978
|
}
|
|
3979
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
3980
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
3981
|
+
rulesyncRule,
|
|
3982
|
+
toolTarget: "geminicli"
|
|
3983
|
+
});
|
|
3984
|
+
}
|
|
3865
3985
|
};
|
|
3866
3986
|
|
|
3867
3987
|
// src/rules/junie-rule.ts
|
|
@@ -3916,6 +4036,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
3916
4036
|
validate() {
|
|
3917
4037
|
return { success: true, error: null };
|
|
3918
4038
|
}
|
|
4039
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4040
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4041
|
+
rulesyncRule,
|
|
4042
|
+
toolTarget: "junie"
|
|
4043
|
+
});
|
|
4044
|
+
}
|
|
3919
4045
|
};
|
|
3920
4046
|
|
|
3921
4047
|
// src/rules/kiro-rule.ts
|
|
@@ -3965,6 +4091,12 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
3965
4091
|
validate() {
|
|
3966
4092
|
return { success: true, error: null };
|
|
3967
4093
|
}
|
|
4094
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4095
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4096
|
+
rulesyncRule,
|
|
4097
|
+
toolTarget: "kiro"
|
|
4098
|
+
});
|
|
4099
|
+
}
|
|
3968
4100
|
};
|
|
3969
4101
|
|
|
3970
4102
|
// src/rules/opencode-rule.ts
|
|
@@ -4019,6 +4151,12 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4019
4151
|
validate() {
|
|
4020
4152
|
return { success: true, error: null };
|
|
4021
4153
|
}
|
|
4154
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4155
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4156
|
+
rulesyncRule,
|
|
4157
|
+
toolTarget: "opencode"
|
|
4158
|
+
});
|
|
4159
|
+
}
|
|
4022
4160
|
};
|
|
4023
4161
|
|
|
4024
4162
|
// src/rules/qwencode-rule.ts
|
|
@@ -4070,6 +4208,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4070
4208
|
validate() {
|
|
4071
4209
|
return { success: true, error: null };
|
|
4072
4210
|
}
|
|
4211
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4212
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4213
|
+
rulesyncRule,
|
|
4214
|
+
toolTarget: "qwencode"
|
|
4215
|
+
});
|
|
4216
|
+
}
|
|
4073
4217
|
};
|
|
4074
4218
|
|
|
4075
4219
|
// src/rules/roo-rule.ts
|
|
@@ -4134,6 +4278,12 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4134
4278
|
validate() {
|
|
4135
4279
|
return { success: true, error: null };
|
|
4136
4280
|
}
|
|
4281
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4282
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4283
|
+
rulesyncRule,
|
|
4284
|
+
toolTarget: "roo"
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4137
4287
|
};
|
|
4138
4288
|
|
|
4139
4289
|
// src/rules/warp-rule.ts
|
|
@@ -4195,6 +4345,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4195
4345
|
validate() {
|
|
4196
4346
|
return { success: true, error: null };
|
|
4197
4347
|
}
|
|
4348
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4349
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4350
|
+
rulesyncRule,
|
|
4351
|
+
toolTarget: "warp"
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4198
4354
|
};
|
|
4199
4355
|
|
|
4200
4356
|
// src/rules/windsurf-rule.ts
|
|
@@ -4243,6 +4399,12 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
4243
4399
|
validate() {
|
|
4244
4400
|
return { success: true, error: null };
|
|
4245
4401
|
}
|
|
4402
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
4403
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
4404
|
+
rulesyncRule,
|
|
4405
|
+
toolTarget: "windsurf"
|
|
4406
|
+
});
|
|
4407
|
+
}
|
|
4246
4408
|
};
|
|
4247
4409
|
|
|
4248
4410
|
// src/rules/rules-processor.ts
|
|
@@ -4265,7 +4427,7 @@ var rulesProcessorToolTargets = [
|
|
|
4265
4427
|
"warp",
|
|
4266
4428
|
"windsurf"
|
|
4267
4429
|
];
|
|
4268
|
-
var RulesProcessorToolTargetSchema =
|
|
4430
|
+
var RulesProcessorToolTargetSchema = z17.enum(rulesProcessorToolTargets);
|
|
4269
4431
|
var RulesProcessor = class extends FeatureProcessor {
|
|
4270
4432
|
toolTarget;
|
|
4271
4433
|
simulateCommands;
|
|
@@ -4288,102 +4450,153 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
4288
4450
|
const toolRules = rulesyncRules.map((rulesyncRule) => {
|
|
4289
4451
|
switch (this.toolTarget) {
|
|
4290
4452
|
case "agentsmd":
|
|
4453
|
+
if (!AgentsMdRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4454
|
+
return null;
|
|
4455
|
+
}
|
|
4291
4456
|
return AgentsMdRule.fromRulesyncRule({
|
|
4292
4457
|
baseDir: this.baseDir,
|
|
4293
4458
|
rulesyncRule,
|
|
4294
4459
|
validate: true
|
|
4295
4460
|
});
|
|
4296
4461
|
case "amazonqcli":
|
|
4462
|
+
if (!AmazonQCliRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4463
|
+
return null;
|
|
4464
|
+
}
|
|
4297
4465
|
return AmazonQCliRule.fromRulesyncRule({
|
|
4298
4466
|
baseDir: this.baseDir,
|
|
4299
4467
|
rulesyncRule,
|
|
4300
4468
|
validate: true
|
|
4301
4469
|
});
|
|
4302
4470
|
case "augmentcode":
|
|
4471
|
+
if (!AugmentcodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4472
|
+
return null;
|
|
4473
|
+
}
|
|
4303
4474
|
return AugmentcodeRule.fromRulesyncRule({
|
|
4304
4475
|
baseDir: this.baseDir,
|
|
4305
4476
|
rulesyncRule,
|
|
4306
4477
|
validate: true
|
|
4307
4478
|
});
|
|
4308
4479
|
case "augmentcode-legacy":
|
|
4480
|
+
if (!AugmentcodeLegacyRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4481
|
+
return null;
|
|
4482
|
+
}
|
|
4309
4483
|
return AugmentcodeLegacyRule.fromRulesyncRule({
|
|
4310
4484
|
baseDir: this.baseDir,
|
|
4311
4485
|
rulesyncRule,
|
|
4312
4486
|
validate: true
|
|
4313
4487
|
});
|
|
4314
4488
|
case "claudecode":
|
|
4489
|
+
if (!ClaudecodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4490
|
+
return null;
|
|
4491
|
+
}
|
|
4315
4492
|
return ClaudecodeRule.fromRulesyncRule({
|
|
4316
4493
|
baseDir: this.baseDir,
|
|
4317
4494
|
rulesyncRule,
|
|
4318
4495
|
validate: true
|
|
4319
4496
|
});
|
|
4320
4497
|
case "cline":
|
|
4498
|
+
if (!ClineRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4499
|
+
return null;
|
|
4500
|
+
}
|
|
4321
4501
|
return ClineRule.fromRulesyncRule({
|
|
4322
4502
|
baseDir: this.baseDir,
|
|
4323
4503
|
rulesyncRule,
|
|
4324
4504
|
validate: true
|
|
4325
4505
|
});
|
|
4326
4506
|
case "codexcli":
|
|
4507
|
+
if (!CodexcliRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4508
|
+
return null;
|
|
4509
|
+
}
|
|
4327
4510
|
return CodexcliRule.fromRulesyncRule({
|
|
4328
4511
|
baseDir: this.baseDir,
|
|
4329
4512
|
rulesyncRule,
|
|
4330
4513
|
validate: true
|
|
4331
4514
|
});
|
|
4332
4515
|
case "copilot":
|
|
4516
|
+
if (!CopilotRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4517
|
+
return null;
|
|
4518
|
+
}
|
|
4333
4519
|
return CopilotRule.fromRulesyncRule({
|
|
4334
4520
|
baseDir: this.baseDir,
|
|
4335
4521
|
rulesyncRule,
|
|
4336
4522
|
validate: true
|
|
4337
4523
|
});
|
|
4338
4524
|
case "cursor":
|
|
4525
|
+
if (!CursorRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4526
|
+
return null;
|
|
4527
|
+
}
|
|
4339
4528
|
return CursorRule.fromRulesyncRule({
|
|
4340
4529
|
baseDir: this.baseDir,
|
|
4341
4530
|
rulesyncRule,
|
|
4342
4531
|
validate: true
|
|
4343
4532
|
});
|
|
4344
4533
|
case "geminicli":
|
|
4534
|
+
if (!GeminiCliRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4535
|
+
return null;
|
|
4536
|
+
}
|
|
4345
4537
|
return GeminiCliRule.fromRulesyncRule({
|
|
4346
4538
|
baseDir: this.baseDir,
|
|
4347
4539
|
rulesyncRule,
|
|
4348
4540
|
validate: true
|
|
4349
4541
|
});
|
|
4350
4542
|
case "junie":
|
|
4543
|
+
if (!JunieRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4544
|
+
return null;
|
|
4545
|
+
}
|
|
4351
4546
|
return JunieRule.fromRulesyncRule({
|
|
4352
4547
|
baseDir: this.baseDir,
|
|
4353
4548
|
rulesyncRule,
|
|
4354
4549
|
validate: true
|
|
4355
4550
|
});
|
|
4356
4551
|
case "kiro":
|
|
4552
|
+
if (!KiroRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4553
|
+
return null;
|
|
4554
|
+
}
|
|
4357
4555
|
return KiroRule.fromRulesyncRule({
|
|
4358
4556
|
baseDir: this.baseDir,
|
|
4359
4557
|
rulesyncRule,
|
|
4360
4558
|
validate: true
|
|
4361
4559
|
});
|
|
4362
4560
|
case "opencode":
|
|
4561
|
+
if (!OpenCodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4562
|
+
return null;
|
|
4563
|
+
}
|
|
4363
4564
|
return OpenCodeRule.fromRulesyncRule({
|
|
4364
4565
|
baseDir: this.baseDir,
|
|
4365
4566
|
rulesyncRule,
|
|
4366
4567
|
validate: true
|
|
4367
4568
|
});
|
|
4368
4569
|
case "qwencode":
|
|
4570
|
+
if (!QwencodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4571
|
+
return null;
|
|
4572
|
+
}
|
|
4369
4573
|
return QwencodeRule.fromRulesyncRule({
|
|
4370
4574
|
baseDir: this.baseDir,
|
|
4371
4575
|
rulesyncRule,
|
|
4372
4576
|
validate: true
|
|
4373
4577
|
});
|
|
4374
4578
|
case "roo":
|
|
4579
|
+
if (!RooRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4580
|
+
return null;
|
|
4581
|
+
}
|
|
4375
4582
|
return RooRule.fromRulesyncRule({
|
|
4376
4583
|
baseDir: this.baseDir,
|
|
4377
4584
|
rulesyncRule,
|
|
4378
4585
|
validate: true
|
|
4379
4586
|
});
|
|
4380
4587
|
case "warp":
|
|
4588
|
+
if (!WarpRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4589
|
+
return null;
|
|
4590
|
+
}
|
|
4381
4591
|
return WarpRule.fromRulesyncRule({
|
|
4382
4592
|
baseDir: this.baseDir,
|
|
4383
4593
|
rulesyncRule,
|
|
4384
4594
|
validate: true
|
|
4385
4595
|
});
|
|
4386
4596
|
case "windsurf":
|
|
4597
|
+
if (!WindsurfRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
4598
|
+
return null;
|
|
4599
|
+
}
|
|
4387
4600
|
return WindsurfRule.fromRulesyncRule({
|
|
4388
4601
|
baseDir: this.baseDir,
|
|
4389
4602
|
rulesyncRule,
|
|
@@ -4392,7 +4605,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
4392
4605
|
default:
|
|
4393
4606
|
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
4394
4607
|
}
|
|
4395
|
-
});
|
|
4608
|
+
}).filter((rule) => rule !== null);
|
|
4396
4609
|
if (this.toolTarget === "cursor" && (this.simulateCommands || this.simulateSubagents)) {
|
|
4397
4610
|
toolRules.push(
|
|
4398
4611
|
new CursorRule({
|
|
@@ -4982,22 +5195,22 @@ When users call a simulated subagent, it will look for the corresponding markdow
|
|
|
4982
5195
|
|
|
4983
5196
|
// src/subagents/subagents-processor.ts
|
|
4984
5197
|
import { basename as basename16, join as join52 } from "path";
|
|
4985
|
-
import { z as
|
|
5198
|
+
import { z as z20 } from "zod/mini";
|
|
4986
5199
|
|
|
4987
5200
|
// src/subagents/claudecode-subagent.ts
|
|
4988
5201
|
import { join as join51 } from "path";
|
|
4989
|
-
import { z as
|
|
5202
|
+
import { z as z19 } from "zod/mini";
|
|
4990
5203
|
|
|
4991
5204
|
// src/subagents/rulesync-subagent.ts
|
|
4992
5205
|
import { basename as basename15, join as join50 } from "path";
|
|
4993
|
-
import { z as
|
|
4994
|
-
var RulesyncSubagentModelSchema =
|
|
4995
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
5206
|
+
import { z as z18 } from "zod/mini";
|
|
5207
|
+
var RulesyncSubagentModelSchema = z18.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
5208
|
+
var RulesyncSubagentFrontmatterSchema = z18.object({
|
|
4996
5209
|
targets: RulesyncTargetsSchema,
|
|
4997
|
-
name:
|
|
4998
|
-
description:
|
|
4999
|
-
claudecode:
|
|
5000
|
-
|
|
5210
|
+
name: z18.string(),
|
|
5211
|
+
description: z18.string(),
|
|
5212
|
+
claudecode: z18.optional(
|
|
5213
|
+
z18.object({
|
|
5001
5214
|
model: RulesyncSubagentModelSchema
|
|
5002
5215
|
})
|
|
5003
5216
|
)
|
|
@@ -5062,10 +5275,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5062
5275
|
};
|
|
5063
5276
|
|
|
5064
5277
|
// src/subagents/claudecode-subagent.ts
|
|
5065
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
5066
|
-
name:
|
|
5067
|
-
description:
|
|
5068
|
-
model:
|
|
5278
|
+
var ClaudecodeSubagentFrontmatterSchema = z19.object({
|
|
5279
|
+
name: z19.string(),
|
|
5280
|
+
description: z19.string(),
|
|
5281
|
+
model: z19.optional(z19.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
5069
5282
|
});
|
|
5070
5283
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
5071
5284
|
frontmatter;
|
|
@@ -5150,6 +5363,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5150
5363
|
return { success: false, error: result.error };
|
|
5151
5364
|
}
|
|
5152
5365
|
}
|
|
5366
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
5367
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
5368
|
+
rulesyncSubagent,
|
|
5369
|
+
toolTarget: "claudecode"
|
|
5370
|
+
});
|
|
5371
|
+
}
|
|
5153
5372
|
static async fromFile({
|
|
5154
5373
|
baseDir = ".",
|
|
5155
5374
|
relativeFilePath,
|
|
@@ -5185,7 +5404,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
5185
5404
|
"cursor",
|
|
5186
5405
|
"codexcli"
|
|
5187
5406
|
];
|
|
5188
|
-
var SubagentsProcessorToolTargetSchema =
|
|
5407
|
+
var SubagentsProcessorToolTargetSchema = z20.enum(subagentsProcessorToolTargets);
|
|
5189
5408
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
5190
5409
|
toolTarget;
|
|
5191
5410
|
constructor({
|
|
@@ -5202,24 +5421,36 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5202
5421
|
const toolSubagents = rulesyncSubagents.map((rulesyncSubagent) => {
|
|
5203
5422
|
switch (this.toolTarget) {
|
|
5204
5423
|
case "claudecode":
|
|
5424
|
+
if (!ClaudecodeSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
5425
|
+
return null;
|
|
5426
|
+
}
|
|
5205
5427
|
return ClaudecodeSubagent.fromRulesyncSubagent({
|
|
5206
5428
|
baseDir: this.baseDir,
|
|
5207
5429
|
relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
|
|
5208
5430
|
rulesyncSubagent
|
|
5209
5431
|
});
|
|
5210
5432
|
case "copilot":
|
|
5433
|
+
if (!CopilotSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
5434
|
+
return null;
|
|
5435
|
+
}
|
|
5211
5436
|
return CopilotSubagent.fromRulesyncSubagent({
|
|
5212
5437
|
baseDir: this.baseDir,
|
|
5213
5438
|
relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
|
|
5214
5439
|
rulesyncSubagent
|
|
5215
5440
|
});
|
|
5216
5441
|
case "cursor":
|
|
5442
|
+
if (!CursorSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
5443
|
+
return null;
|
|
5444
|
+
}
|
|
5217
5445
|
return CursorSubagent.fromRulesyncSubagent({
|
|
5218
5446
|
baseDir: this.baseDir,
|
|
5219
5447
|
relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
|
|
5220
5448
|
rulesyncSubagent
|
|
5221
5449
|
});
|
|
5222
5450
|
case "codexcli":
|
|
5451
|
+
if (!CodexCliSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
5452
|
+
return null;
|
|
5453
|
+
}
|
|
5223
5454
|
return CodexCliSubagent.fromRulesyncSubagent({
|
|
5224
5455
|
baseDir: this.baseDir,
|
|
5225
5456
|
relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
|
|
@@ -5228,7 +5459,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5228
5459
|
default:
|
|
5229
5460
|
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
5230
5461
|
}
|
|
5231
|
-
});
|
|
5462
|
+
}).filter((subagent) => subagent !== null);
|
|
5232
5463
|
return toolSubagents;
|
|
5233
5464
|
}
|
|
5234
5465
|
async convertToolFilesToRulesyncFiles(toolFiles) {
|
|
@@ -5535,7 +5766,7 @@ async function generateCommand(options) {
|
|
|
5535
5766
|
const parts = [];
|
|
5536
5767
|
if (totalRulesOutputs > 0) parts.push(`${totalRulesOutputs} rules`);
|
|
5537
5768
|
if (totalIgnoreOutputs > 0) parts.push(`${totalIgnoreOutputs} ignore files`);
|
|
5538
|
-
if (totalMcpOutputs > 0) parts.push(`${totalMcpOutputs}
|
|
5769
|
+
if (totalMcpOutputs > 0) parts.push(`${totalMcpOutputs} MCP files`);
|
|
5539
5770
|
if (totalCommandOutputs > 0) parts.push(`${totalCommandOutputs} commands`);
|
|
5540
5771
|
if (totalSubagentOutputs > 0) parts.push(`${totalSubagentOutputs} subagents`);
|
|
5541
5772
|
logger.success(`\u{1F389} All done! Generated ${totalGenerated} file(s) total (${parts.join(" + ")})`);
|
|
@@ -5805,7 +6036,7 @@ var getVersion = async () => {
|
|
|
5805
6036
|
const packageJson = await readJsonFile(packageJsonPath);
|
|
5806
6037
|
return packageJson.version;
|
|
5807
6038
|
} catch {
|
|
5808
|
-
return "0.
|
|
6039
|
+
return "0.75.0";
|
|
5809
6040
|
}
|
|
5810
6041
|
};
|
|
5811
6042
|
var main = async () => {
|
|
@@ -5827,7 +6058,7 @@ var main = async () => {
|
|
|
5827
6058
|
}
|
|
5828
6059
|
).option(
|
|
5829
6060
|
"-f, --features <features>",
|
|
5830
|
-
`Comma-separated list of features to import (${
|
|
6061
|
+
`Comma-separated list of features to import (${ALL_FEATURES.join(",")}) or '*' for all`,
|
|
5831
6062
|
(value) => {
|
|
5832
6063
|
return value.split(",").map((f) => f.trim());
|
|
5833
6064
|
}
|
|
@@ -5852,7 +6083,7 @@ var main = async () => {
|
|
|
5852
6083
|
}
|
|
5853
6084
|
).option(
|
|
5854
6085
|
"-f, --features <features>",
|
|
5855
|
-
`Comma-separated list of features to generate (${
|
|
6086
|
+
`Comma-separated list of features to generate (${ALL_FEATURES.join(",")}) or '*' for all`,
|
|
5856
6087
|
(value) => {
|
|
5857
6088
|
return value.split(",").map((f) => f.trim());
|
|
5858
6089
|
}
|