rulesync 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +132 -29
- package/dist/index.js +132 -29
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -441,7 +441,9 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
441
441
|
if (rest.validate) {
|
|
442
442
|
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
443
443
|
if (!result.success) {
|
|
444
|
-
throw
|
|
444
|
+
throw new Error(
|
|
445
|
+
`Invalid frontmatter in ${(0, import_node_path3.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
446
|
+
);
|
|
445
447
|
}
|
|
446
448
|
}
|
|
447
449
|
super({
|
|
@@ -487,7 +489,12 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
487
489
|
if (result.success) {
|
|
488
490
|
return { success: true, error: null };
|
|
489
491
|
} else {
|
|
490
|
-
return {
|
|
492
|
+
return {
|
|
493
|
+
success: false,
|
|
494
|
+
error: new Error(
|
|
495
|
+
`Invalid frontmatter in ${(0, import_node_path3.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
496
|
+
)
|
|
497
|
+
};
|
|
491
498
|
}
|
|
492
499
|
}
|
|
493
500
|
static async fromFileDefault({
|
|
@@ -622,7 +629,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
622
629
|
if (rest.validate) {
|
|
623
630
|
const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
|
|
624
631
|
if (!result.success) {
|
|
625
|
-
throw
|
|
632
|
+
throw new Error(
|
|
633
|
+
`Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
634
|
+
);
|
|
626
635
|
}
|
|
627
636
|
}
|
|
628
637
|
super({
|
|
@@ -651,7 +660,12 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
651
660
|
if (result.success) {
|
|
652
661
|
return { success: true, error: null };
|
|
653
662
|
} else {
|
|
654
|
-
return {
|
|
663
|
+
return {
|
|
664
|
+
success: false,
|
|
665
|
+
error: new Error(
|
|
666
|
+
`Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
667
|
+
)
|
|
668
|
+
};
|
|
655
669
|
}
|
|
656
670
|
}
|
|
657
671
|
static async fromFile({
|
|
@@ -688,7 +702,9 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
688
702
|
if (rest.validate) {
|
|
689
703
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
690
704
|
if (!result.success) {
|
|
691
|
-
throw
|
|
705
|
+
throw new Error(
|
|
706
|
+
`Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
707
|
+
);
|
|
692
708
|
}
|
|
693
709
|
}
|
|
694
710
|
super({
|
|
@@ -760,7 +776,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
760
776
|
if (result.success) {
|
|
761
777
|
return { success: true, error: null };
|
|
762
778
|
} else {
|
|
763
|
-
return {
|
|
779
|
+
return {
|
|
780
|
+
success: false,
|
|
781
|
+
error: new Error(
|
|
782
|
+
`Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
783
|
+
)
|
|
784
|
+
};
|
|
764
785
|
}
|
|
765
786
|
}
|
|
766
787
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
@@ -1024,10 +1045,13 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1024
1045
|
parseTomlContent(content) {
|
|
1025
1046
|
try {
|
|
1026
1047
|
const parsed = (0, import_smol_toml.parse)(content);
|
|
1027
|
-
const
|
|
1048
|
+
const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
|
|
1049
|
+
if (!result.success) {
|
|
1050
|
+
throw new Error(`Invalid frontmatter in Gemini CLI command file: ${result.error.message}`);
|
|
1051
|
+
}
|
|
1028
1052
|
return {
|
|
1029
|
-
description:
|
|
1030
|
-
prompt:
|
|
1053
|
+
description: result.data.description || "",
|
|
1054
|
+
prompt: result.data.prompt
|
|
1031
1055
|
};
|
|
1032
1056
|
} catch (error) {
|
|
1033
1057
|
throw new Error(`Failed to parse TOML command file: ${error}`, { cause: error });
|
|
@@ -1135,7 +1159,9 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1135
1159
|
if (rest.validate) {
|
|
1136
1160
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1137
1161
|
if (!result.success) {
|
|
1138
|
-
throw
|
|
1162
|
+
throw new Error(
|
|
1163
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
1164
|
+
);
|
|
1139
1165
|
}
|
|
1140
1166
|
}
|
|
1141
1167
|
super({
|
|
@@ -1197,7 +1223,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1197
1223
|
if (result.success) {
|
|
1198
1224
|
return { success: true, error: null };
|
|
1199
1225
|
} else {
|
|
1200
|
-
return {
|
|
1226
|
+
return {
|
|
1227
|
+
success: false,
|
|
1228
|
+
error: new Error(
|
|
1229
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
1230
|
+
)
|
|
1231
|
+
};
|
|
1201
1232
|
}
|
|
1202
1233
|
}
|
|
1203
1234
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
@@ -1259,7 +1290,13 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1259
1290
|
global = false
|
|
1260
1291
|
}) {
|
|
1261
1292
|
super({ baseDir });
|
|
1262
|
-
|
|
1293
|
+
const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
|
|
1294
|
+
if (!result.success) {
|
|
1295
|
+
throw new Error(
|
|
1296
|
+
`Invalid tool target for CommandsProcessor: ${toolTarget}. ${result.error.message}`
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
this.toolTarget = result.data;
|
|
1263
1300
|
this.global = global;
|
|
1264
1301
|
}
|
|
1265
1302
|
async convertRulesyncFilesToToolFiles(rulesyncFiles) {
|
|
@@ -2344,7 +2381,13 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2344
2381
|
toolTarget
|
|
2345
2382
|
}) {
|
|
2346
2383
|
super({ baseDir });
|
|
2347
|
-
|
|
2384
|
+
const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
|
|
2385
|
+
if (!result.success) {
|
|
2386
|
+
throw new Error(
|
|
2387
|
+
`Invalid tool target for IgnoreProcessor: ${toolTarget}. ${result.error.message}`
|
|
2388
|
+
);
|
|
2389
|
+
}
|
|
2390
|
+
this.toolTarget = result.data;
|
|
2348
2391
|
}
|
|
2349
2392
|
async writeToolIgnoresFromRulesyncIgnores(rulesyncIgnores) {
|
|
2350
2393
|
const toolIgnores = await this.convertRulesyncFilesToToolFiles(rulesyncIgnores);
|
|
@@ -3103,7 +3146,13 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3103
3146
|
global = false
|
|
3104
3147
|
}) {
|
|
3105
3148
|
super({ baseDir });
|
|
3106
|
-
|
|
3149
|
+
const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
|
|
3150
|
+
if (!result.success) {
|
|
3151
|
+
throw new Error(
|
|
3152
|
+
`Invalid tool target for McpProcessor: ${toolTarget}. ${result.error.message}`
|
|
3153
|
+
);
|
|
3154
|
+
}
|
|
3155
|
+
this.toolTarget = result.data;
|
|
3107
3156
|
this.global = global;
|
|
3108
3157
|
}
|
|
3109
3158
|
/**
|
|
@@ -3337,7 +3386,9 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3337
3386
|
if (rest.validate) {
|
|
3338
3387
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3339
3388
|
if (!result.success) {
|
|
3340
|
-
throw
|
|
3389
|
+
throw new Error(
|
|
3390
|
+
`Invalid frontmatter in ${(0, import_node_path33.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3391
|
+
);
|
|
3341
3392
|
}
|
|
3342
3393
|
}
|
|
3343
3394
|
super({
|
|
@@ -3384,7 +3435,12 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3384
3435
|
if (result.success) {
|
|
3385
3436
|
return { success: true, error: null };
|
|
3386
3437
|
} else {
|
|
3387
|
-
return {
|
|
3438
|
+
return {
|
|
3439
|
+
success: false,
|
|
3440
|
+
error: new Error(
|
|
3441
|
+
`Invalid frontmatter in ${(0, import_node_path33.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3442
|
+
)
|
|
3443
|
+
};
|
|
3388
3444
|
}
|
|
3389
3445
|
}
|
|
3390
3446
|
static async fromFileDefault({
|
|
@@ -3577,7 +3633,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3577
3633
|
if (rest.validate !== false) {
|
|
3578
3634
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3579
3635
|
if (!result.success) {
|
|
3580
|
-
throw
|
|
3636
|
+
throw new Error(
|
|
3637
|
+
`Invalid frontmatter in ${(0, import_node_path34.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3638
|
+
);
|
|
3581
3639
|
}
|
|
3582
3640
|
}
|
|
3583
3641
|
super({
|
|
@@ -3605,7 +3663,12 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3605
3663
|
if (result.success) {
|
|
3606
3664
|
return { success: true, error: null };
|
|
3607
3665
|
} else {
|
|
3608
|
-
return {
|
|
3666
|
+
return {
|
|
3667
|
+
success: false,
|
|
3668
|
+
error: new Error(
|
|
3669
|
+
`Invalid frontmatter in ${(0, import_node_path34.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3670
|
+
)
|
|
3671
|
+
};
|
|
3609
3672
|
}
|
|
3610
3673
|
}
|
|
3611
3674
|
static async fromFile({
|
|
@@ -3642,7 +3705,9 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3642
3705
|
if (rest.validate !== false) {
|
|
3643
3706
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3644
3707
|
if (!result.success) {
|
|
3645
|
-
throw
|
|
3708
|
+
throw new Error(
|
|
3709
|
+
`Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3710
|
+
);
|
|
3646
3711
|
}
|
|
3647
3712
|
}
|
|
3648
3713
|
super({
|
|
@@ -3723,7 +3788,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3723
3788
|
if (result.success) {
|
|
3724
3789
|
return { success: true, error: null };
|
|
3725
3790
|
} else {
|
|
3726
|
-
return {
|
|
3791
|
+
return {
|
|
3792
|
+
success: false,
|
|
3793
|
+
error: new Error(
|
|
3794
|
+
`Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3795
|
+
)
|
|
3796
|
+
};
|
|
3727
3797
|
}
|
|
3728
3798
|
}
|
|
3729
3799
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
@@ -3787,7 +3857,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3787
3857
|
global = false
|
|
3788
3858
|
}) {
|
|
3789
3859
|
super({ baseDir });
|
|
3790
|
-
|
|
3860
|
+
const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
|
|
3861
|
+
if (!result.success) {
|
|
3862
|
+
throw new Error(
|
|
3863
|
+
`Invalid tool target for SubagentsProcessor: ${toolTarget}. ${result.error.message}`
|
|
3864
|
+
);
|
|
3865
|
+
}
|
|
3866
|
+
this.toolTarget = result.data;
|
|
3791
3867
|
this.global = global;
|
|
3792
3868
|
}
|
|
3793
3869
|
async convertRulesyncFilesToToolFiles(rulesyncFiles) {
|
|
@@ -4083,7 +4159,9 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4083
4159
|
if (rest.validate !== false) {
|
|
4084
4160
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4085
4161
|
if (!result.success) {
|
|
4086
|
-
throw
|
|
4162
|
+
throw new Error(
|
|
4163
|
+
`Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4164
|
+
);
|
|
4087
4165
|
}
|
|
4088
4166
|
}
|
|
4089
4167
|
super({
|
|
@@ -4114,7 +4192,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4114
4192
|
if (result.success) {
|
|
4115
4193
|
return { success: true, error: null };
|
|
4116
4194
|
} else {
|
|
4117
|
-
return {
|
|
4195
|
+
return {
|
|
4196
|
+
success: false,
|
|
4197
|
+
error: new Error(
|
|
4198
|
+
`Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
4199
|
+
)
|
|
4200
|
+
};
|
|
4118
4201
|
}
|
|
4119
4202
|
}
|
|
4120
4203
|
static async fromFileLegacy({
|
|
@@ -4816,7 +4899,9 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4816
4899
|
if (rest.validate) {
|
|
4817
4900
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4818
4901
|
if (!result.success) {
|
|
4819
|
-
throw
|
|
4902
|
+
throw new Error(
|
|
4903
|
+
`Invalid frontmatter in ${(0, import_node_path46.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4904
|
+
);
|
|
4820
4905
|
}
|
|
4821
4906
|
}
|
|
4822
4907
|
super({
|
|
@@ -4929,7 +5014,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4929
5014
|
if (result.success) {
|
|
4930
5015
|
return { success: true, error: null };
|
|
4931
5016
|
} else {
|
|
4932
|
-
return {
|
|
5017
|
+
return {
|
|
5018
|
+
success: false,
|
|
5019
|
+
error: new Error(
|
|
5020
|
+
`Invalid frontmatter in ${(0, import_node_path46.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5021
|
+
)
|
|
5022
|
+
};
|
|
4933
5023
|
}
|
|
4934
5024
|
}
|
|
4935
5025
|
getFrontmatter() {
|
|
@@ -4968,7 +5058,9 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4968
5058
|
if (rest.validate) {
|
|
4969
5059
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4970
5060
|
if (!result.success) {
|
|
4971
|
-
throw
|
|
5061
|
+
throw new Error(
|
|
5062
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
5063
|
+
);
|
|
4972
5064
|
}
|
|
4973
5065
|
}
|
|
4974
5066
|
super({
|
|
@@ -5100,7 +5192,12 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5100
5192
|
if (result.success) {
|
|
5101
5193
|
return { success: true, error: null };
|
|
5102
5194
|
} else {
|
|
5103
|
-
return {
|
|
5195
|
+
return {
|
|
5196
|
+
success: false,
|
|
5197
|
+
error: new Error(
|
|
5198
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5199
|
+
)
|
|
5200
|
+
};
|
|
5104
5201
|
}
|
|
5105
5202
|
}
|
|
5106
5203
|
getFrontmatter() {
|
|
@@ -5668,7 +5765,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5668
5765
|
global = false
|
|
5669
5766
|
}) {
|
|
5670
5767
|
super({ baseDir });
|
|
5671
|
-
|
|
5768
|
+
const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
|
|
5769
|
+
if (!result.success) {
|
|
5770
|
+
throw new Error(
|
|
5771
|
+
`Invalid tool target for RulesProcessor: ${toolTarget}. ${result.error.message}`
|
|
5772
|
+
);
|
|
5773
|
+
}
|
|
5774
|
+
this.toolTarget = result.data;
|
|
5672
5775
|
this.global = global;
|
|
5673
5776
|
this.simulateCommands = simulateCommands;
|
|
5674
5777
|
this.simulateSubagents = simulateSubagents;
|
|
@@ -6997,7 +7100,7 @@ globs: ["**/*"]
|
|
|
6997
7100
|
}
|
|
6998
7101
|
|
|
6999
7102
|
// src/cli/index.ts
|
|
7000
|
-
var getVersion = () => "3.4.
|
|
7103
|
+
var getVersion = () => "3.4.2";
|
|
7001
7104
|
var main = async () => {
|
|
7002
7105
|
const program = new import_commander.Command();
|
|
7003
7106
|
const version = getVersion();
|
package/dist/index.js
CHANGED
|
@@ -418,7 +418,9 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
418
418
|
if (rest.validate) {
|
|
419
419
|
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
420
420
|
if (!result.success) {
|
|
421
|
-
throw
|
|
421
|
+
throw new Error(
|
|
422
|
+
`Invalid frontmatter in ${join2(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
423
|
+
);
|
|
422
424
|
}
|
|
423
425
|
}
|
|
424
426
|
super({
|
|
@@ -464,7 +466,12 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
464
466
|
if (result.success) {
|
|
465
467
|
return { success: true, error: null };
|
|
466
468
|
} else {
|
|
467
|
-
return {
|
|
469
|
+
return {
|
|
470
|
+
success: false,
|
|
471
|
+
error: new Error(
|
|
472
|
+
`Invalid frontmatter in ${join2(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
473
|
+
)
|
|
474
|
+
};
|
|
468
475
|
}
|
|
469
476
|
}
|
|
470
477
|
static async fromFileDefault({
|
|
@@ -599,7 +606,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
599
606
|
if (rest.validate) {
|
|
600
607
|
const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
|
|
601
608
|
if (!result.success) {
|
|
602
|
-
throw
|
|
609
|
+
throw new Error(
|
|
610
|
+
`Invalid frontmatter in ${join4(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
611
|
+
);
|
|
603
612
|
}
|
|
604
613
|
}
|
|
605
614
|
super({
|
|
@@ -628,7 +637,12 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
628
637
|
if (result.success) {
|
|
629
638
|
return { success: true, error: null };
|
|
630
639
|
} else {
|
|
631
|
-
return {
|
|
640
|
+
return {
|
|
641
|
+
success: false,
|
|
642
|
+
error: new Error(
|
|
643
|
+
`Invalid frontmatter in ${join4(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
644
|
+
)
|
|
645
|
+
};
|
|
632
646
|
}
|
|
633
647
|
}
|
|
634
648
|
static async fromFile({
|
|
@@ -665,7 +679,9 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
665
679
|
if (rest.validate) {
|
|
666
680
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
667
681
|
if (!result.success) {
|
|
668
|
-
throw
|
|
682
|
+
throw new Error(
|
|
683
|
+
`Invalid frontmatter in ${join5(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
684
|
+
);
|
|
669
685
|
}
|
|
670
686
|
}
|
|
671
687
|
super({
|
|
@@ -737,7 +753,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
737
753
|
if (result.success) {
|
|
738
754
|
return { success: true, error: null };
|
|
739
755
|
} else {
|
|
740
|
-
return {
|
|
756
|
+
return {
|
|
757
|
+
success: false,
|
|
758
|
+
error: new Error(
|
|
759
|
+
`Invalid frontmatter in ${join5(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
760
|
+
)
|
|
761
|
+
};
|
|
741
762
|
}
|
|
742
763
|
}
|
|
743
764
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
@@ -1001,10 +1022,13 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1001
1022
|
parseTomlContent(content) {
|
|
1002
1023
|
try {
|
|
1003
1024
|
const parsed = parseToml(content);
|
|
1004
|
-
const
|
|
1025
|
+
const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
|
|
1026
|
+
if (!result.success) {
|
|
1027
|
+
throw new Error(`Invalid frontmatter in Gemini CLI command file: ${result.error.message}`);
|
|
1028
|
+
}
|
|
1005
1029
|
return {
|
|
1006
|
-
description:
|
|
1007
|
-
prompt:
|
|
1030
|
+
description: result.data.description || "",
|
|
1031
|
+
prompt: result.data.prompt
|
|
1008
1032
|
};
|
|
1009
1033
|
} catch (error) {
|
|
1010
1034
|
throw new Error(`Failed to parse TOML command file: ${error}`, { cause: error });
|
|
@@ -1112,7 +1136,9 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1112
1136
|
if (rest.validate) {
|
|
1113
1137
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1114
1138
|
if (!result.success) {
|
|
1115
|
-
throw
|
|
1139
|
+
throw new Error(
|
|
1140
|
+
`Invalid frontmatter in ${join10(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
1141
|
+
);
|
|
1116
1142
|
}
|
|
1117
1143
|
}
|
|
1118
1144
|
super({
|
|
@@ -1174,7 +1200,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1174
1200
|
if (result.success) {
|
|
1175
1201
|
return { success: true, error: null };
|
|
1176
1202
|
} else {
|
|
1177
|
-
return {
|
|
1203
|
+
return {
|
|
1204
|
+
success: false,
|
|
1205
|
+
error: new Error(
|
|
1206
|
+
`Invalid frontmatter in ${join10(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
1207
|
+
)
|
|
1208
|
+
};
|
|
1178
1209
|
}
|
|
1179
1210
|
}
|
|
1180
1211
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
@@ -1236,7 +1267,13 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1236
1267
|
global = false
|
|
1237
1268
|
}) {
|
|
1238
1269
|
super({ baseDir });
|
|
1239
|
-
|
|
1270
|
+
const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
|
|
1271
|
+
if (!result.success) {
|
|
1272
|
+
throw new Error(
|
|
1273
|
+
`Invalid tool target for CommandsProcessor: ${toolTarget}. ${result.error.message}`
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
this.toolTarget = result.data;
|
|
1240
1277
|
this.global = global;
|
|
1241
1278
|
}
|
|
1242
1279
|
async convertRulesyncFilesToToolFiles(rulesyncFiles) {
|
|
@@ -2321,7 +2358,13 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2321
2358
|
toolTarget
|
|
2322
2359
|
}) {
|
|
2323
2360
|
super({ baseDir });
|
|
2324
|
-
|
|
2361
|
+
const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
|
|
2362
|
+
if (!result.success) {
|
|
2363
|
+
throw new Error(
|
|
2364
|
+
`Invalid tool target for IgnoreProcessor: ${toolTarget}. ${result.error.message}`
|
|
2365
|
+
);
|
|
2366
|
+
}
|
|
2367
|
+
this.toolTarget = result.data;
|
|
2325
2368
|
}
|
|
2326
2369
|
async writeToolIgnoresFromRulesyncIgnores(rulesyncIgnores) {
|
|
2327
2370
|
const toolIgnores = await this.convertRulesyncFilesToToolFiles(rulesyncIgnores);
|
|
@@ -3080,7 +3123,13 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3080
3123
|
global = false
|
|
3081
3124
|
}) {
|
|
3082
3125
|
super({ baseDir });
|
|
3083
|
-
|
|
3126
|
+
const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
|
|
3127
|
+
if (!result.success) {
|
|
3128
|
+
throw new Error(
|
|
3129
|
+
`Invalid tool target for McpProcessor: ${toolTarget}. ${result.error.message}`
|
|
3130
|
+
);
|
|
3131
|
+
}
|
|
3132
|
+
this.toolTarget = result.data;
|
|
3084
3133
|
this.global = global;
|
|
3085
3134
|
}
|
|
3086
3135
|
/**
|
|
@@ -3314,7 +3363,9 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3314
3363
|
if (rest.validate) {
|
|
3315
3364
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3316
3365
|
if (!result.success) {
|
|
3317
|
-
throw
|
|
3366
|
+
throw new Error(
|
|
3367
|
+
`Invalid frontmatter in ${join32(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3368
|
+
);
|
|
3318
3369
|
}
|
|
3319
3370
|
}
|
|
3320
3371
|
super({
|
|
@@ -3361,7 +3412,12 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3361
3412
|
if (result.success) {
|
|
3362
3413
|
return { success: true, error: null };
|
|
3363
3414
|
} else {
|
|
3364
|
-
return {
|
|
3415
|
+
return {
|
|
3416
|
+
success: false,
|
|
3417
|
+
error: new Error(
|
|
3418
|
+
`Invalid frontmatter in ${join32(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3419
|
+
)
|
|
3420
|
+
};
|
|
3365
3421
|
}
|
|
3366
3422
|
}
|
|
3367
3423
|
static async fromFileDefault({
|
|
@@ -3554,7 +3610,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3554
3610
|
if (rest.validate !== false) {
|
|
3555
3611
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3556
3612
|
if (!result.success) {
|
|
3557
|
-
throw
|
|
3613
|
+
throw new Error(
|
|
3614
|
+
`Invalid frontmatter in ${join33(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3615
|
+
);
|
|
3558
3616
|
}
|
|
3559
3617
|
}
|
|
3560
3618
|
super({
|
|
@@ -3582,7 +3640,12 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3582
3640
|
if (result.success) {
|
|
3583
3641
|
return { success: true, error: null };
|
|
3584
3642
|
} else {
|
|
3585
|
-
return {
|
|
3643
|
+
return {
|
|
3644
|
+
success: false,
|
|
3645
|
+
error: new Error(
|
|
3646
|
+
`Invalid frontmatter in ${join33(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3647
|
+
)
|
|
3648
|
+
};
|
|
3586
3649
|
}
|
|
3587
3650
|
}
|
|
3588
3651
|
static async fromFile({
|
|
@@ -3619,7 +3682,9 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3619
3682
|
if (rest.validate !== false) {
|
|
3620
3683
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3621
3684
|
if (!result.success) {
|
|
3622
|
-
throw
|
|
3685
|
+
throw new Error(
|
|
3686
|
+
`Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3687
|
+
);
|
|
3623
3688
|
}
|
|
3624
3689
|
}
|
|
3625
3690
|
super({
|
|
@@ -3700,7 +3765,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3700
3765
|
if (result.success) {
|
|
3701
3766
|
return { success: true, error: null };
|
|
3702
3767
|
} else {
|
|
3703
|
-
return {
|
|
3768
|
+
return {
|
|
3769
|
+
success: false,
|
|
3770
|
+
error: new Error(
|
|
3771
|
+
`Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3772
|
+
)
|
|
3773
|
+
};
|
|
3704
3774
|
}
|
|
3705
3775
|
}
|
|
3706
3776
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
@@ -3764,7 +3834,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3764
3834
|
global = false
|
|
3765
3835
|
}) {
|
|
3766
3836
|
super({ baseDir });
|
|
3767
|
-
|
|
3837
|
+
const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
|
|
3838
|
+
if (!result.success) {
|
|
3839
|
+
throw new Error(
|
|
3840
|
+
`Invalid tool target for SubagentsProcessor: ${toolTarget}. ${result.error.message}`
|
|
3841
|
+
);
|
|
3842
|
+
}
|
|
3843
|
+
this.toolTarget = result.data;
|
|
3768
3844
|
this.global = global;
|
|
3769
3845
|
}
|
|
3770
3846
|
async convertRulesyncFilesToToolFiles(rulesyncFiles) {
|
|
@@ -4060,7 +4136,9 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4060
4136
|
if (rest.validate !== false) {
|
|
4061
4137
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4062
4138
|
if (!result.success) {
|
|
4063
|
-
throw
|
|
4139
|
+
throw new Error(
|
|
4140
|
+
`Invalid frontmatter in ${join36(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4141
|
+
);
|
|
4064
4142
|
}
|
|
4065
4143
|
}
|
|
4066
4144
|
super({
|
|
@@ -4091,7 +4169,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4091
4169
|
if (result.success) {
|
|
4092
4170
|
return { success: true, error: null };
|
|
4093
4171
|
} else {
|
|
4094
|
-
return {
|
|
4172
|
+
return {
|
|
4173
|
+
success: false,
|
|
4174
|
+
error: new Error(
|
|
4175
|
+
`Invalid frontmatter in ${join36(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
4176
|
+
)
|
|
4177
|
+
};
|
|
4095
4178
|
}
|
|
4096
4179
|
}
|
|
4097
4180
|
static async fromFileLegacy({
|
|
@@ -4793,7 +4876,9 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4793
4876
|
if (rest.validate) {
|
|
4794
4877
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4795
4878
|
if (!result.success) {
|
|
4796
|
-
throw
|
|
4879
|
+
throw new Error(
|
|
4880
|
+
`Invalid frontmatter in ${join45(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4881
|
+
);
|
|
4797
4882
|
}
|
|
4798
4883
|
}
|
|
4799
4884
|
super({
|
|
@@ -4906,7 +4991,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4906
4991
|
if (result.success) {
|
|
4907
4992
|
return { success: true, error: null };
|
|
4908
4993
|
} else {
|
|
4909
|
-
return {
|
|
4994
|
+
return {
|
|
4995
|
+
success: false,
|
|
4996
|
+
error: new Error(
|
|
4997
|
+
`Invalid frontmatter in ${join45(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
4998
|
+
)
|
|
4999
|
+
};
|
|
4910
5000
|
}
|
|
4911
5001
|
}
|
|
4912
5002
|
getFrontmatter() {
|
|
@@ -4945,7 +5035,9 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4945
5035
|
if (rest.validate) {
|
|
4946
5036
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4947
5037
|
if (!result.success) {
|
|
4948
|
-
throw
|
|
5038
|
+
throw new Error(
|
|
5039
|
+
`Invalid frontmatter in ${join46(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
5040
|
+
);
|
|
4949
5041
|
}
|
|
4950
5042
|
}
|
|
4951
5043
|
super({
|
|
@@ -5077,7 +5169,12 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5077
5169
|
if (result.success) {
|
|
5078
5170
|
return { success: true, error: null };
|
|
5079
5171
|
} else {
|
|
5080
|
-
return {
|
|
5172
|
+
return {
|
|
5173
|
+
success: false,
|
|
5174
|
+
error: new Error(
|
|
5175
|
+
`Invalid frontmatter in ${join46(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5176
|
+
)
|
|
5177
|
+
};
|
|
5081
5178
|
}
|
|
5082
5179
|
}
|
|
5083
5180
|
getFrontmatter() {
|
|
@@ -5645,7 +5742,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5645
5742
|
global = false
|
|
5646
5743
|
}) {
|
|
5647
5744
|
super({ baseDir });
|
|
5648
|
-
|
|
5745
|
+
const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
|
|
5746
|
+
if (!result.success) {
|
|
5747
|
+
throw new Error(
|
|
5748
|
+
`Invalid tool target for RulesProcessor: ${toolTarget}. ${result.error.message}`
|
|
5749
|
+
);
|
|
5750
|
+
}
|
|
5751
|
+
this.toolTarget = result.data;
|
|
5649
5752
|
this.global = global;
|
|
5650
5753
|
this.simulateCommands = simulateCommands;
|
|
5651
5754
|
this.simulateSubagents = simulateSubagents;
|
|
@@ -6974,7 +7077,7 @@ globs: ["**/*"]
|
|
|
6974
7077
|
}
|
|
6975
7078
|
|
|
6976
7079
|
// src/cli/index.ts
|
|
6977
|
-
var getVersion = () => "3.4.
|
|
7080
|
+
var getVersion = () => "3.4.2";
|
|
6978
7081
|
var main = async () => {
|
|
6979
7082
|
const program = new Command();
|
|
6980
7083
|
const version = getVersion();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulesync",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"chokidar": "4.0.3",
|
|
41
41
|
"commander": "14.0.1",
|
|
42
42
|
"consola": "3.4.2",
|
|
43
|
-
"es-toolkit": "1.
|
|
43
|
+
"es-toolkit": "1.40.0",
|
|
44
44
|
"fast-xml-parser": "5.3.0",
|
|
45
45
|
"gray-matter": "4.0.3",
|
|
46
46
|
"js-yaml": "4.1.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"zod": "4.1.12"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@anthropic-ai/claude-agent-sdk": "0.1.
|
|
52
|
+
"@anthropic-ai/claude-agent-sdk": "0.1.11",
|
|
53
53
|
"@biomejs/biome": "2.2.5",
|
|
54
54
|
"@eslint/js": "9.37.0",
|
|
55
55
|
"@secretlint/secretlint-rule-preset-recommend": "11.2.4",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
"@types/js-yaml": "4.0.9",
|
|
58
58
|
"@types/micromatch": "4.0.9",
|
|
59
59
|
"@types/node": "24.7.0",
|
|
60
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
60
|
+
"@typescript/native-preview": "7.0.0-dev.20251008.1",
|
|
61
61
|
"@vitest/coverage-v8": "3.2.4",
|
|
62
62
|
"cspell": "9.2.1",
|
|
63
63
|
"eslint": "9.37.0",
|
|
64
64
|
"eslint-plugin-import": "2.32.0",
|
|
65
65
|
"eslint-plugin-no-type-assertion": "1.3.0",
|
|
66
|
-
"eslint-plugin-oxlint": "1.
|
|
66
|
+
"eslint-plugin-oxlint": "1.21.0",
|
|
67
67
|
"eslint-plugin-strict-dependencies": "1.3.26",
|
|
68
68
|
"eslint-plugin-zod-import": "0.3.0",
|
|
69
69
|
"knip": "5.64.2",
|
|
70
70
|
"lint-staged": "16.2.3",
|
|
71
71
|
"o3-search-mcp": "0.0.9",
|
|
72
|
-
"oxlint": "1.
|
|
72
|
+
"oxlint": "1.22.0",
|
|
73
73
|
"secretlint": "11.2.4",
|
|
74
74
|
"simple-git-hooks": "2.13.1",
|
|
75
75
|
"sort-package-json": "3.4.0",
|