rulesync 3.12.3 → 3.12.4

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 CHANGED
@@ -226,12 +226,24 @@ var FeatureProcessor = class {
226
226
  }
227
227
  };
228
228
 
229
- // src/utils/zod-error.ts
230
- function formatZodError(error) {
231
- return error.issues.map((issue) => {
232
- const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
233
- return `${path2}${issue.message}`;
234
- }).join("; ");
229
+ // src/utils/error.ts
230
+ var import_zod = require("zod");
231
+ function isZodErrorLike(error) {
232
+ return error !== null && typeof error === "object" && "issues" in error && Array.isArray(error.issues) && error.issues.every(
233
+ (issue) => issue !== null && typeof issue === "object" && "path" in issue && Array.isArray(issue.path) && "message" in issue && typeof issue.message === "string"
234
+ );
235
+ }
236
+ function formatError(error) {
237
+ if (error instanceof import_zod.ZodError || isZodErrorLike(error)) {
238
+ return error.issues.map((issue) => {
239
+ const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
240
+ return `${path2}${issue.message}`;
241
+ }).join("; ");
242
+ }
243
+ if (error instanceof Error) {
244
+ return `${error.name}: ${error.message}`;
245
+ }
246
+ return String(error);
235
247
  }
236
248
 
237
249
  // src/commands/agentsmd-command.ts
@@ -450,7 +462,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
450
462
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
451
463
  if (!result.success) {
452
464
  throw new Error(
453
- `Invalid frontmatter in ${(0, import_node_path3.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
465
+ `Invalid frontmatter in ${(0, import_node_path3.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
454
466
  );
455
467
  }
456
468
  }
@@ -500,7 +512,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
500
512
  return {
501
513
  success: false,
502
514
  error: new Error(
503
- `Invalid frontmatter in ${(0, import_node_path3.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
515
+ `Invalid frontmatter in ${(0, import_node_path3.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
504
516
  )
505
517
  };
506
518
  }
@@ -519,7 +531,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
519
531
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
520
532
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
521
533
  if (!result.success) {
522
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
534
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
523
535
  }
524
536
  return {
525
537
  baseDir,
@@ -562,7 +574,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
562
574
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
563
575
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
564
576
  if (!result.success) {
565
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
577
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
566
578
  }
567
579
  return new _AgentsmdCommand({
568
580
  baseDir,
@@ -638,7 +650,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
638
650
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
639
651
  if (!result.success) {
640
652
  throw new Error(
641
- `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
653
+ `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
642
654
  );
643
655
  }
644
656
  }
@@ -671,7 +683,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
671
683
  return {
672
684
  success: false,
673
685
  error: new Error(
674
- `Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
686
+ `Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
675
687
  )
676
688
  };
677
689
  }
@@ -685,9 +697,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
685
697
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
686
698
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
687
699
  if (!result.success) {
688
- throw new Error(
689
- `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
690
- );
700
+ throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
691
701
  }
692
702
  const filename = (0, import_node_path5.basename)(relativeFilePath);
693
703
  return new _RulesyncCommand({
@@ -713,7 +723,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
713
723
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
714
724
  if (!result.success) {
715
725
  throw new Error(
716
- `Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
726
+ `Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
717
727
  );
718
728
  }
719
729
  }
@@ -784,7 +794,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
784
794
  return {
785
795
  success: false,
786
796
  error: new Error(
787
- `Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
797
+ `Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
788
798
  )
789
799
  };
790
800
  }
@@ -807,7 +817,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
807
817
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
808
818
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
809
819
  if (!result.success) {
810
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
820
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
811
821
  }
812
822
  return new _ClaudecodeCommand({
813
823
  baseDir,
@@ -909,7 +919,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
909
919
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
910
920
  if (!result.success) {
911
921
  throw new Error(
912
- `Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
922
+ `Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
913
923
  );
914
924
  }
915
925
  }
@@ -959,7 +969,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
959
969
  return {
960
970
  success: false,
961
971
  error: new Error(
962
- `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
972
+ `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
963
973
  )
964
974
  };
965
975
  }
@@ -998,7 +1008,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
998
1008
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
999
1009
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
1000
1010
  if (!result.success) {
1001
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
1011
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
1002
1012
  }
1003
1013
  return new _CopilotCommand({
1004
1014
  baseDir,
@@ -1116,7 +1126,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1116
1126
  const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
1117
1127
  if (!result.success) {
1118
1128
  throw new Error(
1119
- `Invalid frontmatter in Gemini CLI command file: ${formatZodError(result.error)}`
1129
+ `Invalid frontmatter in Gemini CLI command file: ${formatError(result.error)}`
1120
1130
  );
1121
1131
  }
1122
1132
  return {
@@ -1230,7 +1240,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1230
1240
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1231
1241
  if (!result.success) {
1232
1242
  throw new Error(
1233
- `Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
1243
+ `Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1234
1244
  );
1235
1245
  }
1236
1246
  }
@@ -1296,7 +1306,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1296
1306
  return {
1297
1307
  success: false,
1298
1308
  error: new Error(
1299
- `Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
1309
+ `Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1300
1310
  )
1301
1311
  };
1302
1312
  }
@@ -1317,7 +1327,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1317
1327
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
1318
1328
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1319
1329
  if (!result.success) {
1320
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
1330
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
1321
1331
  }
1322
1332
  return new _RooCommand({
1323
1333
  baseDir,
@@ -1363,7 +1373,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1363
1373
  const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
1364
1374
  if (!result.success) {
1365
1375
  throw new Error(
1366
- `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
1376
+ `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatError(result.error)}`
1367
1377
  );
1368
1378
  }
1369
1379
  this.toolTarget = result.data;
@@ -2532,7 +2542,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2532
2542
  const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
2533
2543
  if (!result.success) {
2534
2544
  throw new Error(
2535
- `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatZodError(result.error)}`
2545
+ `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatError(result.error)}`
2536
2546
  );
2537
2547
  }
2538
2548
  this.toolTarget = result.data;
@@ -2769,7 +2779,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2769
2779
  return {
2770
2780
  success: false,
2771
2781
  error: new Error(
2772
- `Invalid MCP server configuration for modular-mcp: ${formatZodError(result.error)}`
2782
+ `Invalid MCP server configuration for modular-mcp: ${formatError(result.error)}`
2773
2783
  )
2774
2784
  };
2775
2785
  }
@@ -3549,7 +3559,7 @@ var McpProcessor = class extends FeatureProcessor {
3549
3559
  const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
3550
3560
  if (!result.success) {
3551
3561
  throw new Error(
3552
- `Invalid tool target for McpProcessor: ${toolTarget}. ${formatZodError(result.error)}`
3562
+ `Invalid tool target for McpProcessor: ${toolTarget}. ${formatError(result.error)}`
3553
3563
  );
3554
3564
  }
3555
3565
  this.toolTarget = result.data;
@@ -3815,7 +3825,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3815
3825
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3816
3826
  if (!result.success) {
3817
3827
  throw new Error(
3818
- `Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
3828
+ `Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
3819
3829
  );
3820
3830
  }
3821
3831
  }
@@ -3866,7 +3876,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3866
3876
  return {
3867
3877
  success: false,
3868
3878
  error: new Error(
3869
- `Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
3879
+ `Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
3870
3880
  )
3871
3881
  };
3872
3882
  }
@@ -3881,7 +3891,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3881
3891
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3882
3892
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3883
3893
  if (!result.success) {
3884
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
3894
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
3885
3895
  }
3886
3896
  return {
3887
3897
  baseDir,
@@ -4062,7 +4072,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4062
4072
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4063
4073
  if (!result.success) {
4064
4074
  throw new Error(
4065
- `Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4075
+ `Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4066
4076
  );
4067
4077
  }
4068
4078
  }
@@ -4094,7 +4104,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4094
4104
  return {
4095
4105
  success: false,
4096
4106
  error: new Error(
4097
- `Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4107
+ `Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4098
4108
  )
4099
4109
  };
4100
4110
  }
@@ -4106,9 +4116,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4106
4116
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4107
4117
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4108
4118
  if (!result.success) {
4109
- throw new Error(
4110
- `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
4111
- );
4119
+ throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
4112
4120
  }
4113
4121
  const filename = (0, import_node_path36.basename)(relativeFilePath);
4114
4122
  return new _RulesyncSubagent({
@@ -4136,7 +4144,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4136
4144
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4137
4145
  if (!result.success) {
4138
4146
  throw new Error(
4139
- `Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4147
+ `Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4140
4148
  );
4141
4149
  }
4142
4150
  }
@@ -4216,7 +4224,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4216
4224
  return {
4217
4225
  success: false,
4218
4226
  error: new Error(
4219
- `Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4227
+ `Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4220
4228
  )
4221
4229
  };
4222
4230
  }
@@ -4239,7 +4247,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4239
4247
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4240
4248
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4241
4249
  if (!result.success) {
4242
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4250
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
4243
4251
  }
4244
4252
  return new _ClaudecodeSubagent({
4245
4253
  baseDir,
@@ -4285,7 +4293,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4285
4293
  const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
4286
4294
  if (!result.success) {
4287
4295
  throw new Error(
4288
- `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
4296
+ `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatError(result.error)}`
4289
4297
  );
4290
4298
  }
4291
4299
  this.toolTarget = result.data;
@@ -4585,7 +4593,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4585
4593
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4586
4594
  if (!result.success) {
4587
4595
  throw new Error(
4588
- `Invalid frontmatter in ${(0, import_node_path39.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4596
+ `Invalid frontmatter in ${(0, import_node_path39.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4589
4597
  );
4590
4598
  }
4591
4599
  }
@@ -4620,7 +4628,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4620
4628
  return {
4621
4629
  success: false,
4622
4630
  error: new Error(
4623
- `Invalid frontmatter in ${(0, import_node_path39.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4631
+ `Invalid frontmatter in ${(0, import_node_path39.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4624
4632
  )
4625
4633
  };
4626
4634
  }
@@ -4639,7 +4647,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4639
4647
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4640
4648
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4641
4649
  if (!result.success) {
4642
- throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatZodError(result.error)}`);
4650
+ throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatError(result.error)}`);
4643
4651
  }
4644
4652
  const validatedFrontmatter = {
4645
4653
  root: result.data.root ?? false,
@@ -4668,7 +4676,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4668
4676
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4669
4677
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4670
4678
  if (!result.success) {
4671
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4679
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
4672
4680
  }
4673
4681
  const validatedFrontmatter = {
4674
4682
  root: result.data.root ?? false,
@@ -5331,7 +5339,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5331
5339
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5332
5340
  if (!result.success) {
5333
5341
  throw new Error(
5334
- `Invalid frontmatter in ${(0, import_node_path48.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5342
+ `Invalid frontmatter in ${(0, import_node_path48.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5335
5343
  );
5336
5344
  }
5337
5345
  }
@@ -5426,7 +5434,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5426
5434
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5427
5435
  if (!result.success) {
5428
5436
  throw new Error(
5429
- `Invalid frontmatter in ${(0, import_node_path48.join)(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5437
+ `Invalid frontmatter in ${(0, import_node_path48.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5430
5438
  );
5431
5439
  }
5432
5440
  return new _CopilotRule({
@@ -5450,7 +5458,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5450
5458
  return {
5451
5459
  success: false,
5452
5460
  error: new Error(
5453
- `Invalid frontmatter in ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5461
+ `Invalid frontmatter in ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5454
5462
  )
5455
5463
  };
5456
5464
  }
@@ -5492,7 +5500,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5492
5500
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5493
5501
  if (!result.success) {
5494
5502
  throw new Error(
5495
- `Invalid frontmatter in ${(0, import_node_path49.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5503
+ `Invalid frontmatter in ${(0, import_node_path49.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5496
5504
  );
5497
5505
  }
5498
5506
  }
@@ -5615,7 +5623,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5615
5623
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5616
5624
  if (!result.success) {
5617
5625
  throw new Error(
5618
- `Invalid frontmatter in ${(0, import_node_path49.join)(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5626
+ `Invalid frontmatter in ${(0, import_node_path49.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5619
5627
  );
5620
5628
  }
5621
5629
  return new _CursorRule({
@@ -5638,7 +5646,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5638
5646
  return {
5639
5647
  success: false,
5640
5648
  error: new Error(
5641
- `Invalid frontmatter in ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5649
+ `Invalid frontmatter in ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5642
5650
  )
5643
5651
  };
5644
5652
  }
@@ -6213,7 +6221,7 @@ var RulesProcessor = class extends FeatureProcessor {
6213
6221
  const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
6214
6222
  if (!result.success) {
6215
6223
  throw new Error(
6216
- `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatZodError(result.error)}`
6224
+ `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatError(result.error)}`
6217
6225
  );
6218
6226
  }
6219
6227
  this.toolTarget = result.data;
@@ -7681,7 +7689,7 @@ Attention, again, you are just the planner, so though you can read any files and
7681
7689
  }
7682
7690
 
7683
7691
  // src/cli/index.ts
7684
- var getVersion = () => "3.12.3";
7692
+ var getVersion = () => "3.12.4";
7685
7693
  var main = async () => {
7686
7694
  const program = new import_commander.Command();
7687
7695
  const version = getVersion();
package/dist/index.js CHANGED
@@ -203,12 +203,24 @@ var FeatureProcessor = class {
203
203
  }
204
204
  };
205
205
 
206
- // src/utils/zod-error.ts
207
- function formatZodError(error) {
208
- return error.issues.map((issue) => {
209
- const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
210
- return `${path2}${issue.message}`;
211
- }).join("; ");
206
+ // src/utils/error.ts
207
+ import { ZodError } from "zod";
208
+ function isZodErrorLike(error) {
209
+ return error !== null && typeof error === "object" && "issues" in error && Array.isArray(error.issues) && error.issues.every(
210
+ (issue) => issue !== null && typeof issue === "object" && "path" in issue && Array.isArray(issue.path) && "message" in issue && typeof issue.message === "string"
211
+ );
212
+ }
213
+ function formatError(error) {
214
+ if (error instanceof ZodError || isZodErrorLike(error)) {
215
+ return error.issues.map((issue) => {
216
+ const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
217
+ return `${path2}${issue.message}`;
218
+ }).join("; ");
219
+ }
220
+ if (error instanceof Error) {
221
+ return `${error.name}: ${error.message}`;
222
+ }
223
+ return String(error);
212
224
  }
213
225
 
214
226
  // src/commands/agentsmd-command.ts
@@ -427,7 +439,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
427
439
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
428
440
  if (!result.success) {
429
441
  throw new Error(
430
- `Invalid frontmatter in ${join2(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
442
+ `Invalid frontmatter in ${join2(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
431
443
  );
432
444
  }
433
445
  }
@@ -477,7 +489,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
477
489
  return {
478
490
  success: false,
479
491
  error: new Error(
480
- `Invalid frontmatter in ${join2(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
492
+ `Invalid frontmatter in ${join2(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
481
493
  )
482
494
  };
483
495
  }
@@ -496,7 +508,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
496
508
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
497
509
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
498
510
  if (!result.success) {
499
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
511
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
500
512
  }
501
513
  return {
502
514
  baseDir,
@@ -539,7 +551,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
539
551
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
540
552
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
541
553
  if (!result.success) {
542
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
554
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
543
555
  }
544
556
  return new _AgentsmdCommand({
545
557
  baseDir,
@@ -615,7 +627,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
615
627
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
616
628
  if (!result.success) {
617
629
  throw new Error(
618
- `Invalid frontmatter in ${join4(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
630
+ `Invalid frontmatter in ${join4(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
619
631
  );
620
632
  }
621
633
  }
@@ -648,7 +660,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
648
660
  return {
649
661
  success: false,
650
662
  error: new Error(
651
- `Invalid frontmatter in ${join4(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
663
+ `Invalid frontmatter in ${join4(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
652
664
  )
653
665
  };
654
666
  }
@@ -662,9 +674,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
662
674
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
663
675
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
664
676
  if (!result.success) {
665
- throw new Error(
666
- `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
667
- );
677
+ throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
668
678
  }
669
679
  const filename = basename4(relativeFilePath);
670
680
  return new _RulesyncCommand({
@@ -690,7 +700,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
690
700
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
691
701
  if (!result.success) {
692
702
  throw new Error(
693
- `Invalid frontmatter in ${join5(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
703
+ `Invalid frontmatter in ${join5(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
694
704
  );
695
705
  }
696
706
  }
@@ -761,7 +771,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
761
771
  return {
762
772
  success: false,
763
773
  error: new Error(
764
- `Invalid frontmatter in ${join5(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
774
+ `Invalid frontmatter in ${join5(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
765
775
  )
766
776
  };
767
777
  }
@@ -784,7 +794,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
784
794
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
785
795
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
786
796
  if (!result.success) {
787
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
797
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
788
798
  }
789
799
  return new _ClaudecodeCommand({
790
800
  baseDir,
@@ -886,7 +896,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
886
896
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
887
897
  if (!result.success) {
888
898
  throw new Error(
889
- `Invalid frontmatter in ${join7(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
899
+ `Invalid frontmatter in ${join7(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
890
900
  );
891
901
  }
892
902
  }
@@ -936,7 +946,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
936
946
  return {
937
947
  success: false,
938
948
  error: new Error(
939
- `Invalid frontmatter in ${join7(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
949
+ `Invalid frontmatter in ${join7(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
940
950
  )
941
951
  };
942
952
  }
@@ -975,7 +985,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
975
985
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
976
986
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
977
987
  if (!result.success) {
978
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
988
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
979
989
  }
980
990
  return new _CopilotCommand({
981
991
  baseDir,
@@ -1093,7 +1103,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1093
1103
  const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
1094
1104
  if (!result.success) {
1095
1105
  throw new Error(
1096
- `Invalid frontmatter in Gemini CLI command file: ${formatZodError(result.error)}`
1106
+ `Invalid frontmatter in Gemini CLI command file: ${formatError(result.error)}`
1097
1107
  );
1098
1108
  }
1099
1109
  return {
@@ -1207,7 +1217,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1207
1217
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1208
1218
  if (!result.success) {
1209
1219
  throw new Error(
1210
- `Invalid frontmatter in ${join10(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
1220
+ `Invalid frontmatter in ${join10(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1211
1221
  );
1212
1222
  }
1213
1223
  }
@@ -1273,7 +1283,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1273
1283
  return {
1274
1284
  success: false,
1275
1285
  error: new Error(
1276
- `Invalid frontmatter in ${join10(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
1286
+ `Invalid frontmatter in ${join10(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1277
1287
  )
1278
1288
  };
1279
1289
  }
@@ -1294,7 +1304,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1294
1304
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
1295
1305
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1296
1306
  if (!result.success) {
1297
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
1307
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
1298
1308
  }
1299
1309
  return new _RooCommand({
1300
1310
  baseDir,
@@ -1340,7 +1350,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1340
1350
  const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
1341
1351
  if (!result.success) {
1342
1352
  throw new Error(
1343
- `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
1353
+ `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatError(result.error)}`
1344
1354
  );
1345
1355
  }
1346
1356
  this.toolTarget = result.data;
@@ -2509,7 +2519,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2509
2519
  const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
2510
2520
  if (!result.success) {
2511
2521
  throw new Error(
2512
- `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatZodError(result.error)}`
2522
+ `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatError(result.error)}`
2513
2523
  );
2514
2524
  }
2515
2525
  this.toolTarget = result.data;
@@ -2746,7 +2756,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2746
2756
  return {
2747
2757
  success: false,
2748
2758
  error: new Error(
2749
- `Invalid MCP server configuration for modular-mcp: ${formatZodError(result.error)}`
2759
+ `Invalid MCP server configuration for modular-mcp: ${formatError(result.error)}`
2750
2760
  )
2751
2761
  };
2752
2762
  }
@@ -3526,7 +3536,7 @@ var McpProcessor = class extends FeatureProcessor {
3526
3536
  const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
3527
3537
  if (!result.success) {
3528
3538
  throw new Error(
3529
- `Invalid tool target for McpProcessor: ${toolTarget}. ${formatZodError(result.error)}`
3539
+ `Invalid tool target for McpProcessor: ${toolTarget}. ${formatError(result.error)}`
3530
3540
  );
3531
3541
  }
3532
3542
  this.toolTarget = result.data;
@@ -3792,7 +3802,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3792
3802
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3793
3803
  if (!result.success) {
3794
3804
  throw new Error(
3795
- `Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
3805
+ `Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
3796
3806
  );
3797
3807
  }
3798
3808
  }
@@ -3843,7 +3853,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3843
3853
  return {
3844
3854
  success: false,
3845
3855
  error: new Error(
3846
- `Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
3856
+ `Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
3847
3857
  )
3848
3858
  };
3849
3859
  }
@@ -3858,7 +3868,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3858
3868
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3859
3869
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3860
3870
  if (!result.success) {
3861
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
3871
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
3862
3872
  }
3863
3873
  return {
3864
3874
  baseDir,
@@ -4039,7 +4049,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4039
4049
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4040
4050
  if (!result.success) {
4041
4051
  throw new Error(
4042
- `Invalid frontmatter in ${join35(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4052
+ `Invalid frontmatter in ${join35(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4043
4053
  );
4044
4054
  }
4045
4055
  }
@@ -4071,7 +4081,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4071
4081
  return {
4072
4082
  success: false,
4073
4083
  error: new Error(
4074
- `Invalid frontmatter in ${join35(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4084
+ `Invalid frontmatter in ${join35(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4075
4085
  )
4076
4086
  };
4077
4087
  }
@@ -4083,9 +4093,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4083
4093
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4084
4094
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4085
4095
  if (!result.success) {
4086
- throw new Error(
4087
- `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
4088
- );
4096
+ throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
4089
4097
  }
4090
4098
  const filename = basename13(relativeFilePath);
4091
4099
  return new _RulesyncSubagent({
@@ -4113,7 +4121,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4113
4121
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4114
4122
  if (!result.success) {
4115
4123
  throw new Error(
4116
- `Invalid frontmatter in ${join36(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4124
+ `Invalid frontmatter in ${join36(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4117
4125
  );
4118
4126
  }
4119
4127
  }
@@ -4193,7 +4201,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4193
4201
  return {
4194
4202
  success: false,
4195
4203
  error: new Error(
4196
- `Invalid frontmatter in ${join36(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4204
+ `Invalid frontmatter in ${join36(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4197
4205
  )
4198
4206
  };
4199
4207
  }
@@ -4216,7 +4224,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4216
4224
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4217
4225
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4218
4226
  if (!result.success) {
4219
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4227
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
4220
4228
  }
4221
4229
  return new _ClaudecodeSubagent({
4222
4230
  baseDir,
@@ -4262,7 +4270,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4262
4270
  const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
4263
4271
  if (!result.success) {
4264
4272
  throw new Error(
4265
- `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
4273
+ `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatError(result.error)}`
4266
4274
  );
4267
4275
  }
4268
4276
  this.toolTarget = result.data;
@@ -4562,7 +4570,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4562
4570
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4563
4571
  if (!result.success) {
4564
4572
  throw new Error(
4565
- `Invalid frontmatter in ${join38(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4573
+ `Invalid frontmatter in ${join38(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4566
4574
  );
4567
4575
  }
4568
4576
  }
@@ -4597,7 +4605,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4597
4605
  return {
4598
4606
  success: false,
4599
4607
  error: new Error(
4600
- `Invalid frontmatter in ${join38(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4608
+ `Invalid frontmatter in ${join38(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4601
4609
  )
4602
4610
  };
4603
4611
  }
@@ -4616,7 +4624,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4616
4624
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4617
4625
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4618
4626
  if (!result.success) {
4619
- throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatZodError(result.error)}`);
4627
+ throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatError(result.error)}`);
4620
4628
  }
4621
4629
  const validatedFrontmatter = {
4622
4630
  root: result.data.root ?? false,
@@ -4645,7 +4653,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4645
4653
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4646
4654
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4647
4655
  if (!result.success) {
4648
- throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4656
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
4649
4657
  }
4650
4658
  const validatedFrontmatter = {
4651
4659
  root: result.data.root ?? false,
@@ -5308,7 +5316,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5308
5316
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5309
5317
  if (!result.success) {
5310
5318
  throw new Error(
5311
- `Invalid frontmatter in ${join47(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5319
+ `Invalid frontmatter in ${join47(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5312
5320
  );
5313
5321
  }
5314
5322
  }
@@ -5403,7 +5411,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5403
5411
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5404
5412
  if (!result.success) {
5405
5413
  throw new Error(
5406
- `Invalid frontmatter in ${join47(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5414
+ `Invalid frontmatter in ${join47(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5407
5415
  );
5408
5416
  }
5409
5417
  return new _CopilotRule({
@@ -5427,7 +5435,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5427
5435
  return {
5428
5436
  success: false,
5429
5437
  error: new Error(
5430
- `Invalid frontmatter in ${join47(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5438
+ `Invalid frontmatter in ${join47(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5431
5439
  )
5432
5440
  };
5433
5441
  }
@@ -5469,7 +5477,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5469
5477
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5470
5478
  if (!result.success) {
5471
5479
  throw new Error(
5472
- `Invalid frontmatter in ${join48(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5480
+ `Invalid frontmatter in ${join48(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5473
5481
  );
5474
5482
  }
5475
5483
  }
@@ -5592,7 +5600,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5592
5600
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5593
5601
  if (!result.success) {
5594
5602
  throw new Error(
5595
- `Invalid frontmatter in ${join48(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5603
+ `Invalid frontmatter in ${join48(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5596
5604
  );
5597
5605
  }
5598
5606
  return new _CursorRule({
@@ -5615,7 +5623,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5615
5623
  return {
5616
5624
  success: false,
5617
5625
  error: new Error(
5618
- `Invalid frontmatter in ${join48(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5626
+ `Invalid frontmatter in ${join48(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5619
5627
  )
5620
5628
  };
5621
5629
  }
@@ -6190,7 +6198,7 @@ var RulesProcessor = class extends FeatureProcessor {
6190
6198
  const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
6191
6199
  if (!result.success) {
6192
6200
  throw new Error(
6193
- `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatZodError(result.error)}`
6201
+ `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatError(result.error)}`
6194
6202
  );
6195
6203
  }
6196
6204
  this.toolTarget = result.data;
@@ -7658,7 +7666,7 @@ Attention, again, you are just the planner, so though you can read any files and
7658
7666
  }
7659
7667
 
7660
7668
  // src/cli/index.ts
7661
- var getVersion = () => "3.12.3";
7669
+ var getVersion = () => "3.12.4";
7662
7670
  var main = async () => {
7663
7671
  const program = new Command();
7664
7672
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",